From 9da28f6be0008918eb8066d409276478ec1e52ba Mon Sep 17 00:00:00 2001 From: blair2004 Date: Mon, 22 Apr 2024 17:47:54 +0100 Subject: [PATCH] Building Assets --- config/nexopos.php | 2 +- ...f2 => 92zUtBhPNqw73oHt4D4h-056b27ea.woff2} | Bin ...=> 92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2} | Bin ...=> 92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2} | Bin ...f2 => 92zatBhPNqw73oDd4iYl-4e5d24cd.woff2} | Bin ...off2 => 92zatBhPNqw73oTd4g-fd4988cb.woff2} | Bin ...f2 => 92zatBhPNqw73ord4iYl-807bd521.woff2} | Bin ... => _plugin-vue_export-helper-c27b6911.js} | 0 ...s-ObotXMtS.css => animations-a433d466.css} | 0 public/build/assets/app-2f0e443c.js | 10 + public/build/assets/app-Ch6C7ECm.css | 1 - public/build/assets/app-DQJzMt1l.js | 16 - public/build/assets/app-e173161f.css | 1 + public/build/assets/auth-415a13f9.js | 1 + public/build/assets/auth-CoKQNf5-.js | 7 - ...trap-CnLEEQCx.js => bootstrap-8be442b1.js} | 100 +- ...ashier-DKjkAUUa.js => cashier-e85f233f.js} | 2 +- ...nts-D4w1etK_.js => components-ef1ba55f.js} | 2 +- ...D4ttYNFe.js => create-coupons-f729626b.js} | 2 +- ...rency-lOMYG1Wf.js => currency-f8bd78d1.js} | 6 +- .../{dark-DLDKNvYK.css => dark-95e05480.css} | 2 +- ...oard-Dr37fGQI.js => dashboard-e07c0864.js} | 2 +- ...abase-DWdkiGZ_.js => database-7955ce82.js} | 2 +- .../{dev-2K57nxTt.js => dev-0f5ad8b1.js} | 2 +- ...{fonts-DqDFhRvh.css => fonts-5cd6fc81.css} | 2 +- .../{grid-BxC3i8lq.css => grid-48793d28.css} | 0 ...ex.es-Br67aBEV.js => index.es-25aa42ee.js} | 86 +- ...ray-DPKtuOQJ.js => join-array-4b30b096.js} | 2 +- ...xOIwB.woff => la-brands-400-14c63377.woff} | Bin ...sUI3UJ9.svg => la-brands-400-4da18191.svg} | 0 ...N4CMlGg.eot => la-brands-400-c0e32387.eot} | Bin ...DglUfU7.ttf => la-brands-400-fbc98702.ttf} | Bin ...OEF.woff2 => la-brands-400-ff70c9bc.woff2} | Bin ...nW_RTo.ttf => la-regular-400-4b6ab8d0.ttf} | Bin ...sw.woff2 => la-regular-400-51ca2c00.woff2} | Bin ...HgcS.woff => la-regular-400-7711fabc.woff} | Bin ...6vm3uW.eot => la-regular-400-7dc456f0.eot} | Bin ...Vb34ql.svg => la-regular-400-884ce19c.svg} | 0 ...BUOWlSBQ.ttf => la-solid-900-07ce3559.ttf} | Bin ...dtlPMWb8.svg => la-solid-900-0ce0cc40.svg} | 0 ...gv3Q.woff2 => la-solid-900-10a68e01.woff2} | Bin ...DkmX4G2x.eot => la-solid-900-8a57f8a9.eot} | Bin ..._Kd-su.woff => la-solid-900-a0d21b2a.woff} | Bin ...er-Bc41QNge.js => lang-loader-2a92cbe8.js} | 0 ...{light-R07V6ba6.css => light-d9e7cf53.css} | 2 +- ...BsCcXKB-.css => line-awesome-00e77db5.css} | 2 +- ...GV6ZKw4.js => manage-products-bcbb478a.js} | 2 +- ...odules-BnSJ_Yqz.js => modules-b5fed665.js} | 2 +- ...SVrn5Xft.js => ns-alert-popup-5493aad8.js} | 2 +- ...AD6xUGA.js => ns-avatar-image-35303576.js} | 2 +- ...2cE_fd.js => ns-best-cashiers-6dc9e947.js} | 2 +- ...JPhn0.js => ns-best-customers-8d476fc5.js} | 2 +- ...js => ns-best-products-report-9979457f.js} | 2 +- ...hUc.js => ns-cash-flow-report-d8680316.js} | 2 +- ...ns-customers-statement-report-154a2535.js} | 2 +- public/build/assets/ns-dashboard-4a768a15.js | 1 + public/build/assets/ns-dashboard-BXpytQ25.js | 1 - ...ss-B_9sUEWO.js => ns-hotpress-fbaed768.js} | 0 ...s-incomplete-sale-card-widget-bcb344af.js} | 2 +- ...login-x3kPrV7g.js => ns-login-20974704.js} | 2 +- ...sx2.js => ns-low-stock-report-585a8342.js} | 2 +- ...lPed_gF.js => ns-new-password-218c1f96.js} | 2 +- ...jb1c-h.js => ns-notifications-39f1777d.js} | 2 +- ...MLCmH7.js => ns-order-invoice-bf57ed55.js} | 2 +- ...a1FNVnv.js => ns-orders-chart-56a999e9.js} | 2 +- ...js => ns-orders-preview-popup-5ba94079.js} | 2 +- ...m0m_-.js => ns-orders-summary-6d8db186.js} | 2 +- ...5NyGNB.js => ns-password-lost-11a5d453.js} | 2 +- ...js => ns-payment-types-report-3fa90e99.js} | 2 +- ...Vq5RVCAd.js => ns-permissions-96631af1.js} | 2 +- ...{ns-pos-Bfp50WUL.js => ns-pos-982621e4.js} | 2 +- ...rt-BIVAfgl2.js => ns-pos-cart-64fbf2af.js} | 2 +- .../ns-pos-customers-button-21230a7b.js | 1 + .../ns-pos-customers-button-Bs0KmNPr.js | 7 - ...js => ns-pos-dashboard-button-d46d82b6.js} | 2 +- ...id-BRV51Ubf.js => ns-pos-grid-0d26a576.js} | 2 +- ...5O.js => ns-pos-layaway-popup-f9593185.js} | 2 +- ...s => ns-pos-order-type-button-584f8007.js} | 2 +- ...js => ns-pos-order-type-popup-5204386b.js} | 2 +- ... ns-pos-pending-orders-button-b934d686.js} | 2 +- .../ns-pos-registers-button-4728e787.js | 1 + .../ns-pos-registers-button-BtlrbZz2.js | 1 - ...4zh.js => ns-pos-reset-button-b79bfbdf.js} | 2 +- ...M.js => ns-pos-shipping-popup-acf8319e.js} | 2 +- ...Ba0cSQu9.js => ns-print-label-53077c3e.js} | 2 +- ...ZlaTCRbQ.js => ns-procurement-791c80fe.js} | 2 +- ....js => ns-procurement-invoice-b9a1ca34.js} | 0 ...js => ns-procurement-quantity-ecf5ad70.js} | 2 +- ...d8E1M.js => ns-profile-widget-cef1ba8a.js} | 2 +- .../build/assets/ns-profit-report-CeVRN_L-.js | 1 - .../build/assets/ns-profit-report-a9e68261.js | 1 + ...KRiwYBT.js => ns-prompt-popup-100414c5.js} | 20 +- .../build/assets/ns-prompt-popup-6013118d.css | 1 + .../build/assets/ns-prompt-popup-CVxzoclS.css | 1 - ...er-Aa0C02iW.js => ns-register-1025a0d4.js} | 2 +- ...8qK.js => ns-sale-card-widget-1ca586e0.js} | 2 +- ...W6rkz1Ix.js => ns-sale-report-41e30de6.js} | 2 +- ...gs-BKNggef9.js => ns-settings-a4c45132.js} | 2 +- ...Kv.js => ns-sold-stock-report-f37081a1.js} | 2 +- ...Rob.js => ns-stock-adjustment-879e0777.js} | 2 +- ...s => ns-stock-combined-report-dc25d7cd.js} | 2 +- public/build/assets/ns-token-8f108109.js | 10 + public/build/assets/ns-token-D1cc8I2I.js | 10 - ...DUyzyDxx.js => ns-transaction-41cc182e.js} | 2 +- ...=> ns-transaction-card-widget-f1d2d684.js} | 2 +- ...htuPO_.js => ns-yearly-report-14b5e6ca.js} | 2 +- ...{popups-CcAxDfLK.js => popups-486ddd78.js} | 2 +- public/build/assets/pos-5aad06e1.js | 1 + public/build/assets/pos-B_gF7Wru.js | 7 - public/build/assets/pos-init-518de82b.js | 1 + public/build/assets/pos-init-DDAi99qB.js | 7 - ...cXVX.js => pos-section-switch-0869c4e1.js} | 0 .../build/assets/preload-helper-41c905a7.js | 1 + .../build/assets/preload-helper-BQ24v_F8.js | 1 - .../{reset-D2Q0Ljgf.js => reset-5070ff9f.js} | 2 +- ...CrYstzlc.js => rewards-system-fac66d99.js} | 2 +- .../runtime-core.esm-bundler-RT2b-_3S.js | 13 - .../runtime-core.esm-bundler-b48de70a.js | 13 + ...XY5.js => select-api-entities-c72f4497.js} | 2 +- public/build/assets/setup-0nrlLWcm.js | 7 - public/build/assets/setup-11814a54.js | 1 + ...kHX.js => setup-configuration-4eddae61.js} | 2 +- .../{time-Cz9qvQko.js => time-ccbcc647.js} | 2 +- ...y-CjUEAFec.css => typography-4457a1b1.css} | 0 ...{update-BVM077CA.js => update-e4fa2b1a.js} | 2 +- public/build/assets/vue-router-D26Ko6bT.js | 5 - public/build/assets/vue-router-fe7700e6.js | 5 + ...elcome-DhnKJMzx.js => welcome-892dd819.js} | 2 +- public/build/assets/widgets-4c788367.js | 1 + public/build/assets/widgets-C-fUob9a.js | 7 - public/build/manifest.json | 1449 ++++++++--------- resources/ts/components/ns-table-row.vue | 6 +- 132 files changed, 948 insertions(+), 991 deletions(-) rename public/build/assets/{92zUtBhPNqw73oHt4D4h-CgntkySV.woff2 => 92zUtBhPNqw73oHt4D4h-056b27ea.woff2} (100%) rename public/build/assets/{92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2 => 92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2} (100%) rename public/build/assets/{92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2 => 92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2} (100%) rename public/build/assets/{92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2 => 92zatBhPNqw73oDd4iYl-4e5d24cd.woff2} (100%) rename public/build/assets/{92zatBhPNqw73oTd4g-DUShLcwS.woff2 => 92zatBhPNqw73oTd4g-fd4988cb.woff2} (100%) rename public/build/assets/{92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2 => 92zatBhPNqw73ord4iYl-807bd521.woff2} (100%) rename public/build/assets/{_plugin-vue_export-helper-DlAUqK2U.js => _plugin-vue_export-helper-c27b6911.js} (100%) rename public/build/assets/{animations-ObotXMtS.css => animations-a433d466.css} (100%) create mode 100644 public/build/assets/app-2f0e443c.js delete mode 100644 public/build/assets/app-Ch6C7ECm.css delete mode 100644 public/build/assets/app-DQJzMt1l.js create mode 100644 public/build/assets/app-e173161f.css create mode 100644 public/build/assets/auth-415a13f9.js delete mode 100644 public/build/assets/auth-CoKQNf5-.js rename public/build/assets/{bootstrap-CnLEEQCx.js => bootstrap-8be442b1.js} (52%) rename public/build/assets/{cashier-DKjkAUUa.js => cashier-e85f233f.js} (83%) rename public/build/assets/{components-D4w1etK_.js => components-ef1ba55f.js} (92%) rename public/build/assets/{create-coupons-D4ttYNFe.js => create-coupons-f729626b.js} (95%) rename public/build/assets/{currency-lOMYG1Wf.js => currency-f8bd78d1.js} (75%) rename public/build/assets/{dark-DLDKNvYK.css => dark-95e05480.css} (61%) rename public/build/assets/{dashboard-Dr37fGQI.js => dashboard-e07c0864.js} (89%) rename public/build/assets/{database-DWdkiGZ_.js => database-7955ce82.js} (95%) rename public/build/assets/{dev-2K57nxTt.js => dev-0f5ad8b1.js} (90%) rename public/build/assets/{fonts-DqDFhRvh.css => fonts-5cd6fc81.css} (70%) rename public/build/assets/{grid-BxC3i8lq.css => grid-48793d28.css} (100%) rename public/build/assets/{index.es-Br67aBEV.js => index.es-25aa42ee.js} (87%) rename public/build/assets/{join-array-DPKtuOQJ.js => join-array-4b30b096.js} (76%) rename public/build/assets/{la-brands-400-D0lxOIwB.woff => la-brands-400-14c63377.woff} (100%) rename public/build/assets/{la-brands-400-wsUI3UJ9.svg => la-brands-400-4da18191.svg} (100%) rename public/build/assets/{la-brands-400-LN4CMlGg.eot => la-brands-400-c0e32387.eot} (100%) rename public/build/assets/{la-brands-400-gDglUfU7.ttf => la-brands-400-fbc98702.ttf} (100%) rename public/build/assets/{la-brands-400-Cq-R4OEF.woff2 => la-brands-400-ff70c9bc.woff2} (100%) rename public/build/assets/{la-regular-400-CmnW_RTo.ttf => la-regular-400-4b6ab8d0.ttf} (100%) rename public/build/assets/{la-regular-400-DuFMN_sw.woff2 => la-regular-400-51ca2c00.woff2} (100%) rename public/build/assets/{la-regular-400-ehe5HgcS.woff => la-regular-400-7711fabc.woff} (100%) rename public/build/assets/{la-regular-400-Cx6vm3uW.eot => la-regular-400-7dc456f0.eot} (100%) rename public/build/assets/{la-regular-400-BmVb34ql.svg => la-regular-400-884ce19c.svg} (100%) rename public/build/assets/{la-solid-900-BUOWlSBQ.ttf => la-solid-900-07ce3559.ttf} (100%) rename public/build/assets/{la-solid-900-dtlPMWb8.svg => la-solid-900-0ce0cc40.svg} (100%) rename public/build/assets/{la-solid-900-TjMEgv3Q.woff2 => la-solid-900-10a68e01.woff2} (100%) rename public/build/assets/{la-solid-900-DkmX4G2x.eot => la-solid-900-8a57f8a9.eot} (100%) rename public/build/assets/{la-solid-900-CR_Kd-su.woff => la-solid-900-a0d21b2a.woff} (100%) rename public/build/assets/{lang-loader-Bc41QNge.js => lang-loader-2a92cbe8.js} (100%) rename public/build/assets/{light-R07V6ba6.css => light-d9e7cf53.css} (60%) rename public/build/assets/{line-awesome-BsCcXKB-.css => line-awesome-00e77db5.css} (98%) rename public/build/assets/{manage-products-rGV6ZKw4.js => manage-products-bcbb478a.js} (98%) rename public/build/assets/{modules-BnSJ_Yqz.js => modules-b5fed665.js} (94%) rename public/build/assets/{ns-alert-popup-SVrn5Xft.js => ns-alert-popup-5493aad8.js} (83%) rename public/build/assets/{ns-avatar-image-CAD6xUGA.js => ns-avatar-image-35303576.js} (75%) rename public/build/assets/{ns-best-cashiers-DG2cE_fd.js => ns-best-cashiers-6dc9e947.js} (90%) rename public/build/assets/{ns-best-customers-BlaJPhn0.js => ns-best-customers-8d476fc5.js} (90%) rename public/build/assets/{ns-best-products-report-CShWqh07.js => ns-best-products-report-9979457f.js} (91%) rename public/build/assets/{ns-cash-flow-report-C_Ru4hUc.js => ns-cash-flow-report-d8680316.js} (91%) rename public/build/assets/{ns-customers-statement-report-DWzLJEA5.js => ns-customers-statement-report-154a2535.js} (96%) create mode 100644 public/build/assets/ns-dashboard-4a768a15.js delete mode 100644 public/build/assets/ns-dashboard-BXpytQ25.js rename public/build/assets/{ns-hotpress-B_9sUEWO.js => ns-hotpress-fbaed768.js} (100%) rename public/build/assets/{ns-incomplete-sale-card-widget-DHcCVEz0.js => ns-incomplete-sale-card-widget-bcb344af.js} (81%) rename public/build/assets/{ns-login-x3kPrV7g.js => ns-login-20974704.js} (93%) rename public/build/assets/{ns-low-stock-report-BeG70sx2.js => ns-low-stock-report-585a8342.js} (94%) rename public/build/assets/{ns-new-password-DlPed_gF.js => ns-new-password-218c1f96.js} (89%) rename public/build/assets/{ns-notifications-sHjb1c-h.js => ns-notifications-39f1777d.js} (89%) rename public/build/assets/{ns-order-invoice-DoMLCmH7.js => ns-order-invoice-bf57ed55.js} (97%) rename public/build/assets/{ns-orders-chart-Da1FNVnv.js => ns-orders-chart-56a999e9.js} (94%) rename public/build/assets/{ns-orders-preview-popup-DkNvPnrF.js => ns-orders-preview-popup-5ba94079.js} (99%) rename public/build/assets/{ns-orders-summary-PlQm0m_-.js => ns-orders-summary-6d8db186.js} (88%) rename public/build/assets/{ns-password-lost-Dg5NyGNB.js => ns-password-lost-11a5d453.js} (90%) rename public/build/assets/{ns-payment-types-report-CG9D6K6Q.js => ns-payment-types-report-3fa90e99.js} (87%) rename public/build/assets/{ns-permissions-Vq5RVCAd.js => ns-permissions-96631af1.js} (94%) rename public/build/assets/{ns-pos-Bfp50WUL.js => ns-pos-982621e4.js} (70%) rename public/build/assets/{ns-pos-cart-BIVAfgl2.js => ns-pos-cart-64fbf2af.js} (98%) create mode 100644 public/build/assets/ns-pos-customers-button-21230a7b.js delete mode 100644 public/build/assets/ns-pos-customers-button-Bs0KmNPr.js rename public/build/assets/{ns-pos-dashboard-button-Bw-MsaBT.js => ns-pos-dashboard-button-d46d82b6.js} (72%) rename public/build/assets/{ns-pos-grid-BRV51Ubf.js => ns-pos-grid-0d26a576.js} (97%) rename public/build/assets/{ns-pos-layaway-popup-Kg1Mj15O.js => ns-pos-layaway-popup-f9593185.js} (96%) rename public/build/assets/{ns-pos-order-type-button-DAGoltL9.js => ns-pos-order-type-button-584f8007.js} (62%) rename public/build/assets/{ns-pos-order-type-popup-BV_7i2Py.js => ns-pos-order-type-popup-5204386b.js} (99%) rename public/build/assets/{ns-pos-pending-orders-button-CbJwpMtz.js => ns-pos-pending-orders-button-b934d686.js} (97%) create mode 100644 public/build/assets/ns-pos-registers-button-4728e787.js delete mode 100644 public/build/assets/ns-pos-registers-button-BtlrbZz2.js rename public/build/assets/{ns-pos-reset-button-GSZiA4zh.js => ns-pos-reset-button-b79bfbdf.js} (66%) rename public/build/assets/{ns-pos-shipping-popup-DbqQTrvM.js => ns-pos-shipping-popup-acf8319e.js} (93%) rename public/build/assets/{ns-print-label-Ba0cSQu9.js => ns-print-label-53077c3e.js} (98%) rename public/build/assets/{ns-procurement-ZlaTCRbQ.js => ns-procurement-791c80fe.js} (97%) rename public/build/assets/{ns-procurement-invoice-DSSNRCNz.js => ns-procurement-invoice-b9a1ca34.js} (100%) rename public/build/assets/{ns-procurement-quantity-C_tA1rn-.js => ns-procurement-quantity-ecf5ad70.js} (90%) rename public/build/assets/{ns-profile-widget-C1hd8E1M.js => ns-profile-widget-cef1ba8a.js} (82%) delete mode 100644 public/build/assets/ns-profit-report-CeVRN_L-.js create mode 100644 public/build/assets/ns-profit-report-a9e68261.js rename public/build/assets/{ns-prompt-popup-DKRiwYBT.js => ns-prompt-popup-100414c5.js} (74%) create mode 100644 public/build/assets/ns-prompt-popup-6013118d.css delete mode 100644 public/build/assets/ns-prompt-popup-CVxzoclS.css rename public/build/assets/{ns-register-Aa0C02iW.js => ns-register-1025a0d4.js} (88%) rename public/build/assets/{ns-sale-card-widget-7QyJE8qK.js => ns-sale-card-widget-1ca586e0.js} (81%) rename public/build/assets/{ns-sale-report-W6rkz1Ix.js => ns-sale-report-41e30de6.js} (97%) rename public/build/assets/{ns-settings-BKNggef9.js => ns-settings-a4c45132.js} (91%) rename public/build/assets/{ns-sold-stock-report-CEfd0LKv.js => ns-sold-stock-report-f37081a1.js} (90%) rename public/build/assets/{ns-stock-adjustment-CqT09Rob.js => ns-stock-adjustment-879e0777.js} (97%) rename public/build/assets/{ns-stock-combined-report-CRDPCdjC.js => ns-stock-combined-report-dc25d7cd.js} (94%) create mode 100644 public/build/assets/ns-token-8f108109.js delete mode 100644 public/build/assets/ns-token-D1cc8I2I.js rename public/build/assets/{ns-transaction-DUyzyDxx.js => ns-transaction-41cc182e.js} (96%) rename public/build/assets/{ns-transaction-card-widget-Bkxjn7yB.js => ns-transaction-card-widget-f1d2d684.js} (81%) rename public/build/assets/{ns-yearly-report-BbhtuPO_.js => ns-yearly-report-14b5e6ca.js} (93%) rename public/build/assets/{popups-CcAxDfLK.js => popups-486ddd78.js} (94%) create mode 100644 public/build/assets/pos-5aad06e1.js delete mode 100644 public/build/assets/pos-B_gF7Wru.js create mode 100644 public/build/assets/pos-init-518de82b.js delete mode 100644 public/build/assets/pos-init-DDAi99qB.js rename public/build/assets/{pos-section-switch-DmfccXVX.js => pos-section-switch-0869c4e1.js} (100%) create mode 100644 public/build/assets/preload-helper-41c905a7.js delete mode 100644 public/build/assets/preload-helper-BQ24v_F8.js rename public/build/assets/{reset-D2Q0Ljgf.js => reset-5070ff9f.js} (85%) rename public/build/assets/{rewards-system-CrYstzlc.js => rewards-system-fac66d99.js} (95%) delete mode 100644 public/build/assets/runtime-core.esm-bundler-RT2b-_3S.js create mode 100644 public/build/assets/runtime-core.esm-bundler-b48de70a.js rename public/build/assets/{select-api-entities-Dz_g0XY5.js => select-api-entities-c72f4497.js} (70%) delete mode 100644 public/build/assets/setup-0nrlLWcm.js create mode 100644 public/build/assets/setup-11814a54.js rename public/build/assets/{setup-configuration-BuS09kHX.js => setup-configuration-4eddae61.js} (91%) rename public/build/assets/{time-Cz9qvQko.js => time-ccbcc647.js} (87%) rename public/build/assets/{typography-CjUEAFec.css => typography-4457a1b1.css} (100%) rename public/build/assets/{update-BVM077CA.js => update-e4fa2b1a.js} (89%) delete mode 100644 public/build/assets/vue-router-D26Ko6bT.js create mode 100644 public/build/assets/vue-router-fe7700e6.js rename public/build/assets/{welcome-DhnKJMzx.js => welcome-892dd819.js} (90%) create mode 100644 public/build/assets/widgets-4c788367.js delete mode 100644 public/build/assets/widgets-C-fUob9a.js diff --git a/config/nexopos.php b/config/nexopos.php index 79ce5a401..94eb64a0c 100644 --- a/config/nexopos.php +++ b/config/nexopos.php @@ -9,7 +9,7 @@ * This is the core version of NexoPOS. This is used to displays on the * dashboard and to ensure a compatibility with the modules. */ - 'version' => '5.2.4-b2', + 'version' => '5.2.4-b3', /** * -------------------------------------------------------------------- diff --git a/public/build/assets/92zUtBhPNqw73oHt4D4h-CgntkySV.woff2 b/public/build/assets/92zUtBhPNqw73oHt4D4h-056b27ea.woff2 similarity index 100% rename from public/build/assets/92zUtBhPNqw73oHt4D4h-CgntkySV.woff2 rename to public/build/assets/92zUtBhPNqw73oHt4D4h-056b27ea.woff2 diff --git a/public/build/assets/92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2 b/public/build/assets/92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2 similarity index 100% rename from public/build/assets/92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2 rename to public/build/assets/92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2 diff --git a/public/build/assets/92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2 b/public/build/assets/92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2 similarity index 100% rename from public/build/assets/92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2 rename to public/build/assets/92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2 diff --git a/public/build/assets/92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2 b/public/build/assets/92zatBhPNqw73oDd4iYl-4e5d24cd.woff2 similarity index 100% rename from public/build/assets/92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2 rename to public/build/assets/92zatBhPNqw73oDd4iYl-4e5d24cd.woff2 diff --git a/public/build/assets/92zatBhPNqw73oTd4g-DUShLcwS.woff2 b/public/build/assets/92zatBhPNqw73oTd4g-fd4988cb.woff2 similarity index 100% rename from public/build/assets/92zatBhPNqw73oTd4g-DUShLcwS.woff2 rename to public/build/assets/92zatBhPNqw73oTd4g-fd4988cb.woff2 diff --git a/public/build/assets/92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2 b/public/build/assets/92zatBhPNqw73ord4iYl-807bd521.woff2 similarity index 100% rename from public/build/assets/92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2 rename to public/build/assets/92zatBhPNqw73ord4iYl-807bd521.woff2 diff --git a/public/build/assets/_plugin-vue_export-helper-DlAUqK2U.js b/public/build/assets/_plugin-vue_export-helper-c27b6911.js similarity index 100% rename from public/build/assets/_plugin-vue_export-helper-DlAUqK2U.js rename to public/build/assets/_plugin-vue_export-helper-c27b6911.js diff --git a/public/build/assets/animations-ObotXMtS.css b/public/build/assets/animations-a433d466.css similarity index 100% rename from public/build/assets/animations-ObotXMtS.css rename to public/build/assets/animations-a433d466.css diff --git a/public/build/assets/app-2f0e443c.js b/public/build/assets/app-2f0e443c.js new file mode 100644 index 000000000..5a188db9a --- /dev/null +++ b/public/build/assets/app-2f0e443c.js @@ -0,0 +1,10 @@ +import{_ as e}from"./preload-helper-41c905a7.js";import"./time-ccbcc647.js";import{b as w,n as I,a as L}from"./components-ef1ba55f.js";import{c as m,n as y}from"./bootstrap-8be442b1.js";import{N as V}from"./ns-hotpress-fbaed768.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";function O(o,_){_.forEach(a=>{let r=o.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),o.document.getElementsByTagName("head")[0].appendChild(r)})}const S={install(o,_={}){o.config.globalProperties.$htmlToPaper=(a,r,D=()=>!0)=>{let P="_blank",v=["fullscreen=yes","titlebar=yes","scrollbars=yes"],R=!0,A=[],{name:u=P,specs:i=v,replace:T=R,styles:p=A}=_;r&&(r.name&&(u=r.name),r.specs&&(i=r.specs),r.replace&&(T=r.replace),r.styles&&(p=r.styles)),i=i.length?i.join(","):"";const l=window.document.getElementById(a);if(!l){alert(`Element to print #${a} not found!`);return}const f="",s=window.open(f,u,i);return s.document.write(` + + + ${window.document.title} + + + ${l.innerHTML} + + + `),O(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},g=t(()=>e(()=>import("./rewards-system-fac66d99.js"),["./rewards-system-fac66d99.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),C=t(()=>e(()=>import("./create-coupons-f729626b.js"),["./create-coupons-f729626b.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),k=t(()=>e(()=>import("./ns-settings-a4c45132.js"),["./ns-settings-a4c45132.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),H=t(()=>e(()=>import("./reset-5070ff9f.js"),["./reset-5070ff9f.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),M=t(()=>e(()=>import("./modules-b5fed665.js"),["./modules-b5fed665.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),j=t(()=>e(()=>import("./ns-permissions-96631af1.js"),["./ns-permissions-96631af1.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),N=t(()=>e(()=>import("./ns-procurement-791c80fe.js"),["./ns-procurement-791c80fe.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./manage-products-bcbb478a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js","./index.es-25aa42ee.js"],import.meta.url)),q=t(()=>e(()=>import("./manage-products-bcbb478a.js"),["./manage-products-bcbb478a.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),x=t(()=>e(()=>import("./ns-procurement-invoice-b9a1ca34.js"),[],import.meta.url)),$=t(()=>e(()=>import("./ns-notifications-39f1777d.js"),["./ns-notifications-39f1777d.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js"],import.meta.url)),B=t(()=>e(()=>import("./components-ef1ba55f.js").then(o=>o.i),["./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./bootstrap-8be442b1.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),F=t(()=>e(()=>import("./ns-transaction-41cc182e.js"),["./ns-transaction-41cc182e.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Y=t(()=>e(()=>import("./ns-dashboard-4a768a15.js"),["./ns-dashboard-4a768a15.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),z=t(()=>e(()=>import("./ns-low-stock-report-585a8342.js"),["./ns-low-stock-report-585a8342.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),G=t(()=>e(()=>import("./ns-sale-report-41e30de6.js"),["./ns-sale-report-41e30de6.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),J=t(()=>e(()=>import("./ns-sold-stock-report-f37081a1.js"),["./ns-sold-stock-report-f37081a1.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),K=t(()=>e(()=>import("./ns-profit-report-a9e68261.js"),["./ns-profit-report-a9e68261.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css","./select-api-entities-c72f4497.js","./join-array-4b30b096.js"],import.meta.url)),Q=t(()=>e(()=>import("./ns-stock-combined-report-dc25d7cd.js"),["./ns-stock-combined-report-dc25d7cd.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./select-api-entities-c72f4497.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./join-array-4b30b096.js"],import.meta.url)),U=t(()=>e(()=>import("./ns-cash-flow-report-d8680316.js"),["./ns-cash-flow-report-d8680316.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),W=t(()=>e(()=>import("./ns-yearly-report-14b5e6ca.js"),["./ns-yearly-report-14b5e6ca.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),X=t(()=>e(()=>import("./ns-best-products-report-9979457f.js"),["./ns-best-products-report-9979457f.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),Z=t(()=>e(()=>import("./ns-payment-types-report-3fa90e99.js"),["./ns-payment-types-report-3fa90e99.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./components-ef1ba55f.js","./ns-alert-popup-5493aad8.js","./_plugin-vue_export-helper-c27b6911.js","./ns-avatar-image-35303576.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),ee=t(()=>e(()=>import("./ns-customers-statement-report-154a2535.js"),["./ns-customers-statement-report-154a2535.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),te=t(()=>e(()=>import("./ns-stock-adjustment-879e0777.js"),["./ns-stock-adjustment-879e0777.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-procurement-quantity-ecf5ad70.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url)),oe=t(()=>e(()=>import("./ns-order-invoice-bf57ed55.js"),["./ns-order-invoice-bf57ed55.js","./currency-f8bd78d1.js","./_plugin-vue_export-helper-c27b6911.js","./runtime-core.esm-bundler-b48de70a.js"],import.meta.url)),re=t(()=>e(()=>import("./ns-print-label-53077c3e.js"),["./ns-print-label-53077c3e.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./bootstrap-8be442b1.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url)),n=window.nsState,se=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-8f108109.js"),["./ns-token-8f108109.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js","./index.es-25aa42ee.js","./ns-prompt-popup-100414c5.js","./ns-prompt-popup-6013118d.css"],import.meta.url));window.nsHotPress=new V;const d=Object.assign({nsModules:M,nsRewardsSystem:g,nsCreateCoupons:C,nsManageProducts:q,nsSettings:k,nsReset:H,nsPermissions:j,nsProcurement:N,nsProcurementInvoice:x,nsMedia:B,nsTransaction:F,nsDashboard:Y,nsPrintLabel:re,nsNotifications:$,nsSaleReport:G,nsSoldStockReport:J,nsProfitReport:K,nsStockCombinedReport:Q,nsCashFlowReport:U,nsYearlyReport:W,nsPaymentTypesReport:Z,nsBestProductsReport:X,nsLowStockReport:z,nsCustomersStatementReport:ee,nsStockAdjustment:te,nsOrderInvoice:oe,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:I,nsSubmenu:L},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(se.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(S,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);y.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); diff --git a/public/build/assets/app-Ch6C7ECm.css b/public/build/assets/app-Ch6C7ECm.css deleted file mode 100644 index 791fa17d0..000000000 --- a/public/build/assets/app-Ch6C7ECm.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none!important}.\!visible,.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.relative{position:relative!important}.inset-y-0{top:0!important;bottom:0!important}.-bottom-10{bottom:-5em!important}.-top-10{top:-5em!important}.-top-\[8px\]{top:-8px!important}.bottom-0{bottom:0!important}.left-0{left:0!important}.right-0{right:0!important}.top-0{top:0!important}.z-10{z-index:10!important}.z-30{z-index:30!important}.z-40{z-index:40!important}.z-50{z-index:50!important}.col-span-2{grid-column:span 2 / span 2!important}.col-span-3{grid-column:span 3 / span 3!important}.-m-2{margin:-.5rem!important}.-m-3{margin:-.75rem!important}.-m-4{margin:-1rem!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-4{margin:1rem!important}.-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.-my-1{margin-top:-.25rem!important;margin-bottom:-.25rem!important}.-my-2{margin-top:-.5rem!important;margin-bottom:-.5rem!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-4{margin-left:1rem!important;margin-right:1rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:.75rem!important;margin-bottom:.75rem!important}.my-4{margin-top:1rem!important;margin-bottom:1rem!important}.my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.-mb-2{margin-bottom:-.5rem!important}.-ml-28{margin-left:-7rem!important}.-ml-6{margin-left:-1.5rem!important}.-mt-4{margin-top:-1rem!important}.-mt-8{margin-top:-2rem!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:.75rem!important}.mb-4{margin-bottom:1rem!important}.mb-6{margin-bottom:1.5rem!important}.mb-8{margin-bottom:2rem!important}.ml-1{margin-left:.25rem!important}.ml-2{margin-left:.5rem!important}.ml-3{margin-left:.75rem!important}.ml-4{margin-left:1rem!important}.mr-1{margin-right:.25rem!important}.mr-2{margin-right:.5rem!important}.mr-4{margin-right:1rem!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-4{margin-top:1rem!important}.mt-5{margin-top:1.25rem!important}.mt-8{margin-top:2rem!important}.box-border{box-sizing:border-box!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.table{display:table!important}.table-cell{display:table-cell!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-square{aspect-ratio:1 / 1!important}.h-0{height:0px!important}.h-10{height:2.5rem!important}.h-12{height:3rem!important}.h-120{height:30rem!important}.h-16{height:4rem!important}.h-2{height:.5rem!important}.h-2\/5-screen{height:40vh!important}.h-20{height:5rem!important}.h-24{height:6rem!important}.h-3\/5-screen{height:60vh!important}.h-32{height:8rem!important}.h-36{height:9rem!important}.h-40{height:10rem!important}.h-5{height:1.25rem!important}.h-5\/7-screen{height:71.42vh!important}.h-56{height:14rem!important}.h-6{height:1.5rem!important}.h-6\/7-screen{height:85.71vh!important}.h-60{height:15rem!important}.h-64{height:16rem!important}.h-8{height:2rem!important}.h-95vh{height:95vh!important}.h-96{height:24rem!important}.h-full{height:100%!important}.h-half{height:50vh!important}.h-screen{height:100vh!important}.max-h-5\/6-screen{max-height:83.33vh!important}.max-h-80{max-height:20rem!important}.min-h-2\/5-screen{min-height:40vh!important}.w-0{width:0px!important}.w-1\/2{width:50%!important}.w-1\/3{width:33.333333%!important}.w-1\/4{width:25%!important}.w-1\/6{width:16.666667%!important}.w-10{width:2.5rem!important}.w-11\/12{width:91.666667%!important}.w-12{width:3rem!important}.w-16{width:4rem!important}.w-20{width:5rem!important}.w-24{width:6rem!important}.w-3\/4-screen{width:75vw!important}.w-32{width:8rem!important}.w-36{width:9rem!important}.w-4\/5-screen{width:80vw!important}.w-48{width:12rem!important}.w-5{width:1.25rem!important}.w-5\/7-screen{width:71.42vw!important}.w-52{width:13rem!important}.w-56{width:14rem!important}.w-6{width:1.5rem!important}.w-6\/7-screen{width:85.71vw!important}.w-60{width:15rem!important}.w-64{width:16rem!important}.w-72{width:18rem!important}.w-8{width:2rem!important}.w-95vw{width:95vw!important}.w-\[225px\]{width:225px!important}.w-auto{width:auto!important}.w-full{width:100%!important}.w-screen{width:100vw!important}.min-w-\[2rem\]{min-width:2rem!important}.min-w-fit{min-width:fit-content!important}.flex-auto{flex:1 1 auto!important}.flex-shrink-0{flex-shrink:0!important}.grow-0{flex-grow:0!important}.table-auto{table-layout:auto!important}.origin-bottom-right{transform-origin:bottom right!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite!important}.cursor-default{cursor:default!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.select-none{-webkit-user-select:none!important;user-select:none!important}.resize{resize:both!important}.appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))!important}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))!important}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))!important}.flex-row{flex-direction:row!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.justify-around{justify-content:space-around!important}.gap-0{gap:0px!important}.gap-2{gap:.5rem!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0 !important;border-right-width:calc(1px * var(--tw-divide-x-reverse))!important;border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(4px * var(--tw-divide-y-reverse))!important}.self-center{align-self:center!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-x-auto{overflow-x:auto!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-scroll{overflow-y:scroll!important}.truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.whitespace-pre-wrap{white-space:pre-wrap!important}.rounded{border-radius:.25rem!important}.rounded-full{border-radius:9999px!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-none{border-radius:0!important}.rounded-b-md{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-t-lg{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.rounded-bl{border-bottom-left-radius:.25rem!important}.rounded-bl-lg{border-bottom-left-radius:.5rem!important}.rounded-br{border-bottom-right-radius:.25rem!important}.rounded-br-lg{border-bottom-right-radius:.5rem!important}.rounded-tl{border-top-left-radius:.25rem!important}.rounded-tl-lg{border-top-left-radius:.5rem!important}.rounded-tr{border-top-right-radius:.25rem!important}.rounded-tr-lg{border-top-right-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0px!important}.border-2{border-width:2px!important}.border-4{border-width:4px!important}.border-b{border-bottom-width:1px!important}.border-b-0{border-bottom-width:0px!important}.border-b-2{border-bottom-width:2px!important}.border-b-4{border-bottom-width:4px!important}.border-l{border-left-width:1px!important}.border-l-0{border-left-width:0px!important}.border-l-2{border-left-width:2px!important}.border-l-4{border-left-width:4px!important}.border-l-8{border-left-width:8px!important}.border-r{border-right-width:1px!important}.border-r-0{border-right-width:0px!important}.border-r-2{border-right-width:2px!important}.border-t{border-top-width:1px!important}.border-t-0{border-top-width:0px!important}.border-t-4{border-top-width:4px!important}.border-dashed{border-style:dashed!important}.border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity))!important}.border-blue-200{--tw-border-opacity: 1 !important;border-color:rgb(191 219 254 / var(--tw-border-opacity))!important}.border-blue-400{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.border-blue-600{--tw-border-opacity: 1 !important;border-color:rgb(37 99 235 / var(--tw-border-opacity))!important}.border-box-background{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-background) / var(--tw-border-opacity))!important}.border-box-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.border-box-elevation-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity))!important}.border-danger-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity))!important}.border-error-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))!important}.border-error-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.border-error-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.border-floating-menu-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--floating-menu-edge) / var(--tw-border-opacity))!important}.border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity))!important}.border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity))!important}.border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity))!important}.border-gray-500{--tw-border-opacity: 1 !important;border-color:rgb(107 114 128 / var(--tw-border-opacity))!important}.border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity))!important}.border-gray-800{--tw-border-opacity: 1 !important;border-color:rgb(31 41 55 / var(--tw-border-opacity))!important}.border-green-200{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity))!important}.border-green-600{--tw-border-opacity: 1 !important;border-color:rgb(22 163 74 / var(--tw-border-opacity))!important}.border-info-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.border-info-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.border-info-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))!important}.border-input-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))!important}.border-input-option-hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-option-hover) / var(--tw-border-opacity))!important}.border-numpad-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.border-red-200{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity))!important}.border-slate-400{--tw-border-opacity: 1 !important;border-color:rgb(148 163 184 / var(--tw-border-opacity))!important}.border-slate-600{--tw-border-opacity: 1 !important;border-color:rgb(71 85 105 / var(--tw-border-opacity))!important}.border-success-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))!important}.border-success-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity))!important}.border-success-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))!important}.border-tab-table-th{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th) / var(--tw-border-opacity))!important}.border-tab-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity))!important}.border-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))!important}.border-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--tertiary) / var(--tw-border-opacity))!important}.border-transparent{border-color:transparent!important}.border-yellow-200{--tw-border-opacity: 1 !important;border-color:rgb(254 240 138 / var(--tw-border-opacity))!important}.border-b-transparent{border-bottom-color:transparent!important}.bg-blue-100{--tw-bg-opacity: 1 !important;background-color:rgb(219 234 254 / var(--tw-bg-opacity))!important}.bg-blue-400{--tw-bg-opacity: 1 !important;background-color:rgb(96 165 250 / var(--tw-bg-opacity))!important}.bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity))!important}.bg-box-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.bg-error-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.bg-error-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.bg-error-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.bg-floating-menu{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu) / var(--tw-bg-opacity))!important}.bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity))!important}.bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity))!important}.bg-gray-400{--tw-bg-opacity: 1 !important;background-color:rgb(156 163 175 / var(--tw-bg-opacity))!important}.bg-gray-500{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.bg-gray-600{--tw-bg-opacity: 1 !important;background-color:rgb(75 85 99 / var(--tw-bg-opacity))!important}.bg-gray-700{--tw-bg-opacity: 1 !important;background-color:rgb(55 65 81 / var(--tw-bg-opacity))!important}.bg-gray-800{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity))!important}.bg-gray-900{--tw-bg-opacity: 1 !important;background-color:rgb(17 24 39 / var(--tw-bg-opacity))!important}.bg-green-100{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity))!important}.bg-green-200{--tw-bg-opacity: 1 !important;background-color:rgb(187 247 208 / var(--tw-bg-opacity))!important}.bg-green-400{--tw-bg-opacity: 1 !important;background-color:rgb(74 222 128 / var(--tw-bg-opacity))!important}.bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.bg-info-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.bg-info-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.bg-info-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.bg-input-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))!important}.bg-input-button{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))!important}.bg-input-disabled{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))!important}.bg-input-edge{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))!important}.bg-orange-400{--tw-bg-opacity: 1 !important;background-color:rgb(251 146 60 / var(--tw-bg-opacity))!important}.bg-popup-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))!important}.bg-red-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 226 226 / var(--tw-bg-opacity))!important}.bg-red-400{--tw-bg-opacity: 1 !important;background-color:rgb(248 113 113 / var(--tw-bg-opacity))!important}.bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity))!important}.bg-slate-200{--tw-bg-opacity: 1 !important;background-color:rgb(226 232 240 / var(--tw-bg-opacity))!important}.bg-slate-300{--tw-bg-opacity: 1 !important;background-color:rgb(203 213 225 / var(--tw-bg-opacity))!important}.bg-success-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))!important}.bg-success-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))!important}.bg-success-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.bg-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--surface) / var(--tw-bg-opacity))!important}.bg-tab-active{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))!important}.bg-tab-inactive{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))!important}.bg-tab-table-th{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity))!important}.bg-transparent{background-color:transparent!important}.bg-warning-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity))!important}.bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.bg-yellow-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 249 195 / var(--tw-bg-opacity))!important}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))!important}.bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))!important}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))!important}.from-blue-200{--tw-gradient-from: #bfdbfe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(191 219 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-error-secondary{--tw-gradient-from: rgb(var(--error-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--error-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-green-400{--tw-gradient-from: #4ade80 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(74 222 128 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-indigo-400{--tw-gradient-from: #818cf8 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(129 140 248 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-info-secondary{--tw-gradient-from: rgb(var(--info-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--info-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-pink-400{--tw-gradient-from: #f472b6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(244 114 182 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-400{--tw-gradient-from: #f87171 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(248 113 113 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-success-secondary{--tw-gradient-from: rgb(var(--success-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--success-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-teal-500{--tw-gradient-from: #14b8a6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(20 184 166 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position) !important}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position) !important}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position) !important}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position) !important}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position) !important}.to-green-700{--tw-gradient-to: #15803d var(--tw-gradient-to-position) !important}.to-indigo-400{--tw-gradient-to: #818cf8 var(--tw-gradient-to-position) !important}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position) !important}.to-info-tertiary{--tw-gradient-to: rgb(var(--info-tertiary)) var(--tw-gradient-to-position) !important}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position) !important}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position) !important}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position) !important}.to-red-600{--tw-gradient-to: #dc2626 var(--tw-gradient-to-position) !important}.to-red-700{--tw-gradient-to: #b91c1c var(--tw-gradient-to-position) !important}.to-teal-700{--tw-gradient-to: #0f766e var(--tw-gradient-to-position) !important}.bg-clip-text{-webkit-background-clip:text!important;background-clip:text!important}.object-cover{object-fit:cover!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-10{padding:2.5rem!important}.p-2{padding:.5rem!important}.p-3{padding:.75rem!important}.p-4{padding:1rem!important}.p-8{padding:2rem!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-10{padding-top:2.5rem!important;padding-bottom:2.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.py-4{padding-top:1rem!important;padding-bottom:1rem!important}.py-5{padding-top:1.25rem!important;padding-bottom:1.25rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-8{padding-top:2rem!important;padding-bottom:2rem!important}.pb-1{padding-bottom:.25rem!important}.pb-10{padding-bottom:2.5rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:.75rem!important}.pb-4{padding-bottom:1rem!important}.pl-0{padding-left:0!important}.pl-1{padding-left:.25rem!important}.pl-2{padding-left:.5rem!important}.pl-3{padding-left:.75rem!important}.pl-7{padding-left:1.75rem!important}.pl-8{padding-left:2rem!important}.pr-1{padding-right:.25rem!important}.pr-12{padding-right:3rem!important}.pr-2{padding-right:.5rem!important}.pr-8{padding-right:2rem!important}.pt-2{padding-top:.5rem!important}.pt-6{padding-top:1.5rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.font-body{font-family:Graphik,sans-serif!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-6xl{font-size:3.75rem!important;line-height:1!important}.text-7xl{font-size:4.5rem!important;line-height:1!important}.text-8xl{font-size:6rem!important;line-height:1!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-black{font-weight:900!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.uppercase{text-transform:uppercase!important}.leading-5{line-height:1.25rem!important}.text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.text-blue-500{--tw-text-opacity: 1 !important;color:rgb(59 130 246 / var(--tw-text-opacity))!important}.text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity))!important}.text-danger-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--danger-light-tertiary) / var(--tw-text-opacity))!important}.text-error-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-light-tertiary) / var(--tw-text-opacity))!important}.text-error-primary{--tw-text-opacity: 1 !important;color:rgb(var(--error-primary) / var(--tw-text-opacity))!important}.text-error-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.text-error-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))!important}.text-gray-100{--tw-text-opacity: 1 !important;color:rgb(243 244 246 / var(--tw-text-opacity))!important}.text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity))!important}.text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity))!important}.text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity))!important}.text-green-700{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity))!important}.text-info-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--info-secondary) / var(--tw-text-opacity))!important}.text-info-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))!important}.text-primary{--tw-text-opacity: 1 !important;color:rgb(var(--primary) / var(--tw-text-opacity))!important}.text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.text-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--secondary) / var(--tw-text-opacity))!important}.text-soft-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-secondary) / var(--tw-text-opacity))!important}.text-soft-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-tertiary) / var(--tw-text-opacity))!important}.text-success-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.text-success-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))!important}.text-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--tertiary) / var(--tw-text-opacity))!important}.text-transparent{color:transparent!important}.text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.underline{text-decoration-line:underline!important}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.blur{--tw-blur: blur(8px) !important;filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.duration-100{transition-duration:.1s!important}.ease-linear{transition-timing-function:linear!important}.\[key\:string\]{key:string}html,body{height:100%;font-family:Jost;width:100%}.bg-overlay{background:#33333342}[v-cloak]>*{display:none}.loader{border-top-color:#3498db!important}.loader.slow{-webkit-animation:spinner 1.5s linear infinite;animation:spinner 1.5s linear infinite}.loader.fast{-webkit-animation:spinner .7s linear infinite;animation:spinner .7s linear infinite}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}button{border-radius:0}#editor h1{font-size:3rem;line-height:1;font-weight:700}#editor h2{font-size:2.25rem;line-height:2.5rem;font-weight:700}#editor h3{font-size:1.875rem;line-height:2.25rem;font-weight:700}#editor h4{font-size:1.5rem;line-height:2rem;font-weight:700}#editor h5{font-size:1.25rem;line-height:1.75rem;font-weight:700}#grid-items .vue-recycle-scroller__item-wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0px;overflow-y:auto}@media (min-width: 768px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1280px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(5,minmax(0,1fr))}}#grid-items .vue-recycle-scroller__item-view{display:flex;height:8rem;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-view{height:10rem}}#grid-items .vue-recycle-scroller__item-view:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.popup-heading{display:flex;align-items:center;justify-content:space-between;padding:.5rem}.popup-heading h3{font-weight:600}.hover\:cursor-pointer:hover{cursor:pointer!important}.hover\:border-info-primary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.hover\:border-transparent:hover{border-color:transparent!important}.hover\:border-opacity-0:hover{--tw-border-opacity: 0 !important}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.hover\:bg-box-elevation-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.hover\:bg-error-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.hover\:bg-error-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-error-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-floating-menu-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu-hover) / var(--tw-bg-opacity))!important}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.hover\:bg-green-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.hover\:bg-green-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(22 163 74 / var(--tw-bg-opacity))!important}.hover\:bg-info-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.hover\:bg-info-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-info-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-input-button-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))!important}.hover\:bg-numpad-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))!important}.hover\:bg-red-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.hover\:bg-success-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-white:hover{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.hover\:text-blue-400:hover{--tw-text-opacity: 1 !important;color:rgb(96 165 250 / var(--tw-text-opacity))!important}.hover\:text-error-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.hover\:text-gray-700:hover{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.hover\:text-info-primary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--info-primary) / var(--tw-text-opacity))!important}.hover\:text-success-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.hover\:text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:underline:hover{text-decoration-line:underline!important}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.focus\:border-blue-400:focus{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.focus\:shadow-sm:focus{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.active\:border-numpad-edge:active{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}:is(.dark .dark\:border-blue-700){--tw-border-opacity: 1 !important;border-color:rgb(29 78 216 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-green-800){--tw-border-opacity: 1 !important;border-color:rgb(22 101 52 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-red-700){--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-yellow-700){--tw-border-opacity: 1 !important;border-color:rgb(161 98 7 / var(--tw-border-opacity))!important}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-green-700){--tw-bg-opacity: 1 !important;background-color:rgb(21 128 61 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-yellow-600){--tw-bg-opacity: 1 !important;background-color:rgb(202 138 4 / var(--tw-bg-opacity))!important}:is(.dark .dark\:text-slate-300){--tw-text-opacity: 1 !important;color:rgb(203 213 225 / var(--tw-text-opacity))!important}@media (min-width: 640px){.sm\:relative{position:relative!important}.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:hidden{display:none!important}.sm\:h-108{height:27rem!important}.sm\:w-64{width:16rem!important}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.sm\:flex-row{flex-direction:row!important}.sm\:rounded-lg{border-radius:.5rem!important}.sm\:text-sm{font-size:.875rem!important;line-height:1.25rem!important}.sm\:leading-5{line-height:1.25rem!important}}@media (min-width: 768px){.md\:visible{visibility:visible!important}.md\:static{position:static!important}.md\:-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.md\:-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.md\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.md\:mx-auto{margin-left:auto!important;margin-right:auto!important}.md\:my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.md\:mb-0{margin-bottom:0!important}.md\:mt-0{margin-top:0!important}.md\:mt-2{margin-top:.5rem!important}.md\:block{display:block!important}.md\:inline-block{display:inline-block!important}.md\:inline{display:inline!important}.md\:flex{display:flex!important}.md\:table-cell{display:table-cell!important}.md\:hidden{display:none!important}.md\:h-10{height:2.5rem!important}.md\:h-3\/5-screen{height:60vh!important}.md\:h-4\/5-screen{height:80vh!important}.md\:h-5\/6-screen{height:83.33vh!important}.md\:h-5\/7-screen{height:71.42vh!important}.md\:h-6\/7-screen{height:85.71vh!important}.md\:h-full{height:100%!important}.md\:w-1\/2{width:50%!important}.md\:w-1\/3{width:33.333333%!important}.md\:w-1\/4{width:25%!important}.md\:w-10{width:2.5rem!important}.md\:w-16{width:4rem!important}.md\:w-2\/3{width:66.666667%!important}.md\:w-2\/3-screen{width:66.66vw!important}.md\:w-2\/4-screen{width:50vw!important}.md\:w-2\/5{width:40%!important}.md\:w-2\/5-screen{width:40vw!important}.md\:w-24{width:6rem!important}.md\:w-28{width:7rem!important}.md\:w-3\/4{width:75%!important}.md\:w-3\/5{width:60%!important}.md\:w-3\/5-screen{width:60vw!important}.md\:w-3\/6-screen{width:50vw!important}.md\:w-3\/7-screen{width:42.85vw!important}.md\:w-4\/5{width:80%!important}.md\:w-4\/5-screen{width:80vw!important}.md\:w-4\/6-screen{width:66.66vw!important}.md\:w-4\/7-screen{width:57.14vw!important}.md\:w-5\/7-screen{width:71.42vw!important}.md\:w-56{width:14rem!important}.md\:w-6\/7-screen{width:85.71vw!important}.md\:w-60{width:15rem!important}.md\:w-72{width:18rem!important}.md\:w-80{width:20rem!important}.md\:w-96{width:24rem!important}.md\:w-\[550px\]{width:550px!important}.md\:w-auto{width:auto!important}.md\:w-full{width:100%!important}.md\:flex-auto{flex:1 1 auto!important}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.md\:flex-row{flex-direction:row!important}.md\:flex-col{flex-direction:column!important}.md\:flex-wrap{flex-wrap:wrap!important}.md\:items-start{align-items:flex-start!important}.md\:items-center{align-items:center!important}.md\:justify-center{justify-content:center!important}.md\:justify-between{justify-content:space-between!important}.md\:rounded{border-radius:.25rem!important}.md\:border-l{border-left-width:1px!important}.md\:p-0{padding:0!important}.md\:px-1{padding-left:.25rem!important;padding-right:.25rem!important}.md\:px-2{padding-left:.5rem!important;padding-right:.5rem!important}.md\:px-4{padding-left:1rem!important;padding-right:1rem!important}.md\:text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:text-base{font-size:1rem!important;line-height:1.5rem!important}.md\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1024px){.lg\:my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.lg\:my-8{margin-top:2rem!important;margin-bottom:2rem!important}.lg\:block{display:block!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:h-3\/7-screen{height:42.85vh!important}.lg\:h-4\/5-screen{height:80vh!important}.lg\:h-5\/6-screen{height:83.33vh!important}.lg\:h-5\/7-screen{height:71.42vh!important}.lg\:h-full{height:100%!important}.lg\:w-1\/2{width:50%!important}.lg\:w-1\/3{width:33.333333%!important}.lg\:w-1\/3-screen{width:33.33vw!important}.lg\:w-1\/4{width:25%!important}.lg\:w-1\/6{width:16.666667%!important}.lg\:w-2\/3{width:66.666667%!important}.lg\:w-2\/4{width:50%!important}.lg\:w-2\/4-screen{width:50vw!important}.lg\:w-2\/5{width:40%!important}.lg\:w-2\/5-screen{width:40vw!important}.lg\:w-2\/6-screen{width:33.33vw!important}.lg\:w-2\/7-screen{width:28.57vw!important}.lg\:w-3\/5{width:60%!important}.lg\:w-3\/5-screen{width:60vw!important}.lg\:w-3\/6-screen{width:50vw!important}.lg\:w-3\/7-screen{width:42.85vw!important}.lg\:w-4\/6{width:66.666667%!important}.lg\:w-4\/7-screen{width:57.14vw!important}.lg\:w-56{width:14rem!important}.lg\:w-auto{width:auto!important}.lg\:w-full{width:100%!important}.lg\:w-half{width:50vw!important}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.lg\:flex-row{flex-direction:row!important}.lg\:items-start{align-items:flex-start!important}.lg\:border-t{border-top-width:1px!important}.lg\:px-0{padding-left:0!important;padding-right:0!important}.lg\:py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.lg\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.lg\:text-5xl{font-size:3rem!important;line-height:1!important}.lg\:text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.lg\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1280px){.xl\:h-2\/5-screen{height:40vh!important}.xl\:w-1\/4{width:25%!important}.xl\:w-108{width:27rem!important}.xl\:w-2\/5-screen{width:40vw!important}.xl\:w-2\/6-screen{width:33.33vw!important}.xl\:w-84{width:21rem!important}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))!important}.xl\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media print{.print\:w-1\/2{width:50%!important}.print\:w-1\/3{width:33.333333%!important}.print\:text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}} diff --git a/public/build/assets/app-DQJzMt1l.js b/public/build/assets/app-DQJzMt1l.js deleted file mode 100644 index c03a87d0b..000000000 --- a/public/build/assets/app-DQJzMt1l.js +++ /dev/null @@ -1,16 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./rewards-system-CrYstzlc.js","./bootstrap-CnLEEQCx.js","./currency-lOMYG1Wf.js","./runtime-core.esm-bundler-RT2b-_3S.js","./_plugin-vue_export-helper-DlAUqK2U.js","./create-coupons-D4ttYNFe.js","./ns-settings-BKNggef9.js","./components-D4w1etK_.js","./ns-alert-popup-SVrn5Xft.js","./ns-avatar-image-CAD6xUGA.js","./index.es-Br67aBEV.js","./ns-prompt-popup-DKRiwYBT.js","./ns-prompt-popup-CVxzoclS.css","./reset-D2Q0Ljgf.js","./modules-BnSJ_Yqz.js","./ns-permissions-Vq5RVCAd.js","./ns-procurement-ZlaTCRbQ.js","./manage-products-rGV6ZKw4.js","./select-api-entities-Dz_g0XY5.js","./join-array-DPKtuOQJ.js","./ns-notifications-sHjb1c-h.js","./ns-transaction-DUyzyDxx.js","./ns-dashboard-BXpytQ25.js","./ns-low-stock-report-BeG70sx2.js","./ns-sale-report-W6rkz1Ix.js","./ns-sold-stock-report-CEfd0LKv.js","./ns-profit-report-CeVRN_L-.js","./ns-stock-combined-report-CRDPCdjC.js","./ns-cash-flow-report-C_Ru4hUc.js","./ns-yearly-report-BbhtuPO_.js","./ns-best-products-report-CShWqh07.js","./ns-payment-types-report-CG9D6K6Q.js","./ns-customers-statement-report-DWzLJEA5.js","./ns-stock-adjustment-CqT09Rob.js","./ns-procurement-quantity-C_tA1rn-.js","./ns-order-invoice-DoMLCmH7.js","./ns-print-label-Ba0cSQu9.js","./ns-token-D1cc8I2I.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -import{_ as e}from"./preload-helper-BQ24v_F8.js";import"./time-Cz9qvQko.js";import{b as w,n as f,a as I}from"./components-D4w1etK_.js";import{c as m,n as L}from"./bootstrap-CnLEEQCx.js";import{N as y}from"./ns-hotpress-B_9sUEWO.js";import{d as t}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./currency-lOMYG1Wf.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";function V(o,_){_.forEach(a=>{let r=o.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),o.document.getElementsByTagName("head")[0].appendChild(r)})}const O={install(o,_={}){o.config.globalProperties.$htmlToPaper=(a,r,D=()=>!0)=>{let P="_blank",v=["fullscreen=yes","titlebar=yes","scrollbars=yes"],R=!0,A=[],{name:u=P,specs:i=v,replace:T=R,styles:p=A}=_;r&&(r.name&&(u=r.name),r.specs&&(i=r.specs),r.replace&&(T=r.replace),r.styles&&(p=r.styles)),i=i.length?i.join(","):"";const l=window.document.getElementById(a);if(!l){alert(`Element to print #${a} not found!`);return}const s=window.open("",u,i);return s.document.write(` - - - ${window.document.title} - - - ${l.innerHTML} - - - `),V(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},S=t(()=>e(()=>import("./rewards-system-CrYstzlc.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),g=t(()=>e(()=>import("./create-coupons-D4ttYNFe.js"),__vite__mapDeps([5,1,2,3,4]),import.meta.url)),C=t(()=>e(()=>import("./ns-settings-BKNggef9.js"),__vite__mapDeps([6,2,1,3,7,8,4,9,10,11,12]),import.meta.url)),k=t(()=>e(()=>import("./reset-D2Q0Ljgf.js"),__vite__mapDeps([13,2,1,3,4]),import.meta.url)),H=t(()=>e(()=>import("./modules-BnSJ_Yqz.js"),__vite__mapDeps([14,1,2,3,8,4,10,11,12]),import.meta.url)),M=t(()=>e(()=>import("./ns-permissions-Vq5RVCAd.js"),__vite__mapDeps([15,1,2,3,4]),import.meta.url)),j=t(()=>e(()=>import("./ns-procurement-ZlaTCRbQ.js"),__vite__mapDeps([16,1,2,3,17,11,4,12,18,19,10]),import.meta.url)),N=t(()=>e(()=>import("./manage-products-rGV6ZKw4.js"),__vite__mapDeps([17,1,2,3,11,4,12]),import.meta.url)),q=t(()=>e(()=>import("./ns-procurement-invoice-DSSNRCNz.js"),__vite__mapDeps([]),import.meta.url)),x=t(()=>e(()=>import("./ns-notifications-sHjb1c-h.js"),__vite__mapDeps([20,1,2,3,11,4,12,7,8,9,10]),import.meta.url)),$=t(()=>e(()=>import("./components-D4w1etK_.js").then(o=>o.i),__vite__mapDeps([7,8,2,4,3,9,10,1,11,12]),import.meta.url)),B=t(()=>e(()=>import("./ns-transaction-DUyzyDxx.js"),__vite__mapDeps([21,1,2,3,8,4,10,11,12]),import.meta.url)),F=t(()=>e(()=>import("./ns-dashboard-BXpytQ25.js"),__vite__mapDeps([22,1,2,3,4]),import.meta.url)),Y=t(()=>e(()=>import("./ns-low-stock-report-BeG70sx2.js"),__vite__mapDeps([23,1,2,3,7,8,4,9,10,11,12,19]),import.meta.url)),z=t(()=>e(()=>import("./ns-sale-report-W6rkz1Ix.js"),__vite__mapDeps([24,1,2,3,7,8,4,9,10,11,12,19]),import.meta.url)),G=t(()=>e(()=>import("./ns-sold-stock-report-CEfd0LKv.js"),__vite__mapDeps([25,1,2,3,7,8,4,9,10,11,12,18,19]),import.meta.url)),J=t(()=>e(()=>import("./ns-profit-report-CeVRN_L-.js"),__vite__mapDeps([26,1,2,3,7,8,4,9,10,11,12,18,19]),import.meta.url)),K=t(()=>e(()=>import("./ns-stock-combined-report-CRDPCdjC.js"),__vite__mapDeps([27,1,2,3,18,11,4,12,19]),import.meta.url)),Q=t(()=>e(()=>import("./ns-cash-flow-report-C_Ru4hUc.js"),__vite__mapDeps([28,1,2,3,7,8,4,9,10,11,12]),import.meta.url)),U=t(()=>e(()=>import("./ns-yearly-report-BbhtuPO_.js"),__vite__mapDeps([29,1,2,3,7,8,4,9,10,11,12]),import.meta.url)),W=t(()=>e(()=>import("./ns-best-products-report-CShWqh07.js"),__vite__mapDeps([30,1,2,3,7,8,4,9,10,11,12]),import.meta.url)),X=t(()=>e(()=>import("./ns-payment-types-report-CG9D6K6Q.js"),__vite__mapDeps([31,1,2,3,7,8,4,9,10,11,12]),import.meta.url)),Z=t(()=>e(()=>import("./ns-customers-statement-report-DWzLJEA5.js"),__vite__mapDeps([32,2,4,3]),import.meta.url)),ee=t(()=>e(()=>import("./ns-stock-adjustment-CqT09Rob.js"),__vite__mapDeps([33,1,2,3,34,4,11,12]),import.meta.url)),te=t(()=>e(()=>import("./ns-order-invoice-DoMLCmH7.js"),__vite__mapDeps([35,2,4,3]),import.meta.url)),oe=t(()=>e(()=>import("./ns-print-label-Ba0cSQu9.js"),__vite__mapDeps([36,2,3,1,4]),import.meta.url)),n=window.nsState,re=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-D1cc8I2I.js"),__vite__mapDeps([37,1,2,3,4,10,11,12]),import.meta.url));window.nsHotPress=new y;const d=Object.assign({nsModules:H,nsRewardsSystem:S,nsCreateCoupons:g,nsManageProducts:N,nsSettings:C,nsReset:k,nsPermissions:M,nsProcurement:j,nsProcurementInvoice:q,nsMedia:$,nsTransaction:B,nsDashboard:F,nsPrintLabel:oe,nsNotifications:x,nsSaleReport:z,nsSoldStockReport:G,nsProfitReport:J,nsStockCombinedReport:K,nsCashFlowReport:Q,nsYearlyReport:U,nsPaymentTypesReport:X,nsBestProductsReport:W,nsLowStockReport:Y,nsCustomersStatementReport:Z,nsStockAdjustment:ee,nsOrderInvoice:te,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:f,nsSubmenu:I},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(re.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(O,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);L.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); diff --git a/public/build/assets/app-e173161f.css b/public/build/assets/app-e173161f.css new file mode 100644 index 000000000..12bd6629a --- /dev/null +++ b/public/build/assets/app-e173161f.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none!important}.\!visible,.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.relative{position:relative!important}.inset-y-0{top:0em!important;bottom:0em!important}.-bottom-10{bottom:-5em!important}.-top-10{top:-5em!important}.-top-\[8px\]{top:-8px!important}.bottom-0{bottom:0em!important}.left-0{left:0em!important}.right-0{right:0em!important}.top-0{top:0em!important}.z-10{z-index:10!important}.z-30{z-index:30!important}.z-40{z-index:40!important}.z-50{z-index:50!important}.col-span-2{grid-column:span 2 / span 2!important}.col-span-3{grid-column:span 3 / span 3!important}.-m-2{margin:-.5rem!important}.-m-3{margin:-.75rem!important}.-m-4{margin:-1rem!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-4{margin:1rem!important}.-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.-my-1{margin-top:-.25rem!important;margin-bottom:-.25rem!important}.-my-2{margin-top:-.5rem!important;margin-bottom:-.5rem!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-4{margin-left:1rem!important;margin-right:1rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:.75rem!important;margin-bottom:.75rem!important}.my-4{margin-top:1rem!important;margin-bottom:1rem!important}.my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.-mb-2{margin-bottom:-.5rem!important}.-ml-28{margin-left:-7rem!important}.-ml-6{margin-left:-1.5rem!important}.-mt-4{margin-top:-1rem!important}.-mt-8{margin-top:-2rem!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:.75rem!important}.mb-4{margin-bottom:1rem!important}.mb-6{margin-bottom:1.5rem!important}.mb-8{margin-bottom:2rem!important}.ml-1{margin-left:.25rem!important}.ml-2{margin-left:.5rem!important}.ml-3{margin-left:.75rem!important}.ml-4{margin-left:1rem!important}.mr-1{margin-right:.25rem!important}.mr-2{margin-right:.5rem!important}.mr-4{margin-right:1rem!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-4{margin-top:1rem!important}.mt-5{margin-top:1.25rem!important}.mt-8{margin-top:2rem!important}.box-border{box-sizing:border-box!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.table{display:table!important}.table-cell{display:table-cell!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-square{aspect-ratio:1 / 1!important}.h-0{height:0px!important}.h-10{height:2.5rem!important}.h-12{height:3rem!important}.h-120{height:30rem!important}.h-16{height:4rem!important}.h-2{height:.5rem!important}.h-2\/5-screen{height:40vh!important}.h-20{height:5rem!important}.h-24{height:6rem!important}.h-3\/5-screen{height:60vh!important}.h-32{height:8rem!important}.h-36{height:9rem!important}.h-40{height:10rem!important}.h-5{height:1.25rem!important}.h-5\/7-screen{height:71.42vh!important}.h-56{height:14rem!important}.h-6{height:1.5rem!important}.h-6\/7-screen{height:85.71vh!important}.h-60{height:15rem!important}.h-64{height:16rem!important}.h-8{height:2rem!important}.h-95vh{height:95vh!important}.h-96{height:24rem!important}.h-full{height:100%!important}.h-half{height:50vh!important}.h-screen{height:100vh!important}.max-h-5\/6-screen{max-height:83.33vh!important}.max-h-80{max-height:20rem!important}.min-h-2\/5-screen{min-height:40vh!important}.w-0{width:0px!important}.w-1\/2{width:50%!important}.w-1\/3{width:33.333333%!important}.w-1\/4{width:25%!important}.w-1\/6{width:16.666667%!important}.w-10{width:2.5rem!important}.w-11\/12{width:91.666667%!important}.w-12{width:3rem!important}.w-16{width:4rem!important}.w-20{width:5rem!important}.w-24{width:6rem!important}.w-3\/4-screen{width:75vw!important}.w-32{width:8rem!important}.w-36{width:9rem!important}.w-4\/5-screen{width:80vw!important}.w-48{width:12rem!important}.w-5{width:1.25rem!important}.w-5\/7-screen{width:71.42vw!important}.w-52{width:13rem!important}.w-56{width:14rem!important}.w-6{width:1.5rem!important}.w-6\/7-screen{width:85.71vw!important}.w-60{width:15rem!important}.w-64{width:16rem!important}.w-72{width:18rem!important}.w-8{width:2rem!important}.w-95vw{width:95vw!important}.w-\[225px\]{width:225px!important}.w-auto{width:auto!important}.w-full{width:100%!important}.w-screen{width:100vw!important}.min-w-\[2rem\]{min-width:2rem!important}.min-w-fit{min-width:fit-content!important}.flex-auto{flex:1 1 auto!important}.flex-shrink-0{flex-shrink:0!important}.grow-0{flex-grow:0!important}.table-auto{table-layout:auto!important}.origin-bottom-right{transform-origin:bottom right!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite!important}.cursor-default{cursor:default!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.select-none{user-select:none!important}.resize{resize:both!important}.appearance-none{appearance:none!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))!important}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))!important}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))!important}.flex-row{flex-direction:row!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.justify-around{justify-content:space-around!important}.gap-0{gap:0px!important}.gap-2{gap:.5rem!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0 !important;border-right-width:calc(1px * var(--tw-divide-x-reverse))!important;border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(4px * var(--tw-divide-y-reverse))!important}.self-center{align-self:center!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-x-auto{overflow-x:auto!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-scroll{overflow-y:scroll!important}.truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.whitespace-pre-wrap{white-space:pre-wrap!important}.rounded{border-radius:.25rem!important}.rounded-full{border-radius:9999px!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-none{border-radius:0!important}.rounded-b-md{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-t-lg{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.rounded-bl{border-bottom-left-radius:.25rem!important}.rounded-bl-lg{border-bottom-left-radius:.5rem!important}.rounded-br{border-bottom-right-radius:.25rem!important}.rounded-br-lg{border-bottom-right-radius:.5rem!important}.rounded-tl{border-top-left-radius:.25rem!important}.rounded-tl-lg{border-top-left-radius:.5rem!important}.rounded-tr{border-top-right-radius:.25rem!important}.rounded-tr-lg{border-top-right-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0px!important}.border-2{border-width:2px!important}.border-4{border-width:4px!important}.border-b{border-bottom-width:1px!important}.border-b-0{border-bottom-width:0px!important}.border-b-2{border-bottom-width:2px!important}.border-b-4{border-bottom-width:4px!important}.border-l{border-left-width:1px!important}.border-l-0{border-left-width:0px!important}.border-l-2{border-left-width:2px!important}.border-l-4{border-left-width:4px!important}.border-l-8{border-left-width:8px!important}.border-r{border-right-width:1px!important}.border-r-0{border-right-width:0px!important}.border-r-2{border-right-width:2px!important}.border-t{border-top-width:1px!important}.border-t-0{border-top-width:0px!important}.border-t-4{border-top-width:4px!important}.border-dashed{border-style:dashed!important}.border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity))!important}.border-blue-200{--tw-border-opacity: 1 !important;border-color:rgb(191 219 254 / var(--tw-border-opacity))!important}.border-blue-400{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.border-blue-600{--tw-border-opacity: 1 !important;border-color:rgb(37 99 235 / var(--tw-border-opacity))!important}.border-box-background{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-background) / var(--tw-border-opacity))!important}.border-box-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.border-box-elevation-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity))!important}.border-danger-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity))!important}.border-error-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))!important}.border-error-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.border-error-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.border-floating-menu-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--floating-menu-edge) / var(--tw-border-opacity))!important}.border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity))!important}.border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity))!important}.border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity))!important}.border-gray-500{--tw-border-opacity: 1 !important;border-color:rgb(107 114 128 / var(--tw-border-opacity))!important}.border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity))!important}.border-gray-800{--tw-border-opacity: 1 !important;border-color:rgb(31 41 55 / var(--tw-border-opacity))!important}.border-green-200{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity))!important}.border-green-600{--tw-border-opacity: 1 !important;border-color:rgb(22 163 74 / var(--tw-border-opacity))!important}.border-info-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.border-info-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.border-info-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))!important}.border-input-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))!important}.border-input-option-hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-option-hover) / var(--tw-border-opacity))!important}.border-numpad-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.border-red-200{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity))!important}.border-slate-400{--tw-border-opacity: 1 !important;border-color:rgb(148 163 184 / var(--tw-border-opacity))!important}.border-slate-600{--tw-border-opacity: 1 !important;border-color:rgb(71 85 105 / var(--tw-border-opacity))!important}.border-success-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))!important}.border-success-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity))!important}.border-success-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))!important}.border-tab-table-th{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th) / var(--tw-border-opacity))!important}.border-tab-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity))!important}.border-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))!important}.border-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--tertiary) / var(--tw-border-opacity))!important}.border-transparent{border-color:transparent!important}.border-yellow-200{--tw-border-opacity: 1 !important;border-color:rgb(254 240 138 / var(--tw-border-opacity))!important}.border-b-transparent{border-bottom-color:transparent!important}.bg-blue-100{--tw-bg-opacity: 1 !important;background-color:rgb(219 234 254 / var(--tw-bg-opacity))!important}.bg-blue-400{--tw-bg-opacity: 1 !important;background-color:rgb(96 165 250 / var(--tw-bg-opacity))!important}.bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity))!important}.bg-box-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.bg-error-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.bg-error-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.bg-error-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.bg-floating-menu{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu) / var(--tw-bg-opacity))!important}.bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity))!important}.bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity))!important}.bg-gray-400{--tw-bg-opacity: 1 !important;background-color:rgb(156 163 175 / var(--tw-bg-opacity))!important}.bg-gray-500{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.bg-gray-600{--tw-bg-opacity: 1 !important;background-color:rgb(75 85 99 / var(--tw-bg-opacity))!important}.bg-gray-700{--tw-bg-opacity: 1 !important;background-color:rgb(55 65 81 / var(--tw-bg-opacity))!important}.bg-gray-800{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity))!important}.bg-gray-900{--tw-bg-opacity: 1 !important;background-color:rgb(17 24 39 / var(--tw-bg-opacity))!important}.bg-green-100{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity))!important}.bg-green-200{--tw-bg-opacity: 1 !important;background-color:rgb(187 247 208 / var(--tw-bg-opacity))!important}.bg-green-400{--tw-bg-opacity: 1 !important;background-color:rgb(74 222 128 / var(--tw-bg-opacity))!important}.bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.bg-info-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.bg-info-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.bg-info-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.bg-input-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))!important}.bg-input-button{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))!important}.bg-input-disabled{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))!important}.bg-input-edge{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))!important}.bg-orange-400{--tw-bg-opacity: 1 !important;background-color:rgb(251 146 60 / var(--tw-bg-opacity))!important}.bg-popup-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))!important}.bg-red-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 226 226 / var(--tw-bg-opacity))!important}.bg-red-400{--tw-bg-opacity: 1 !important;background-color:rgb(248 113 113 / var(--tw-bg-opacity))!important}.bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity))!important}.bg-slate-200{--tw-bg-opacity: 1 !important;background-color:rgb(226 232 240 / var(--tw-bg-opacity))!important}.bg-slate-300{--tw-bg-opacity: 1 !important;background-color:rgb(203 213 225 / var(--tw-bg-opacity))!important}.bg-success-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))!important}.bg-success-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))!important}.bg-success-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.bg-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--surface) / var(--tw-bg-opacity))!important}.bg-tab-active{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))!important}.bg-tab-inactive{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))!important}.bg-tab-table-th{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity))!important}.bg-transparent{background-color:transparent!important}.bg-warning-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity))!important}.bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.bg-yellow-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 249 195 / var(--tw-bg-opacity))!important}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))!important}.bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))!important}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))!important}.from-blue-200{--tw-gradient-from: #bfdbfe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(191 219 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-error-secondary{--tw-gradient-from: rgb(var(--error-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--error-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-green-400{--tw-gradient-from: #4ade80 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(74 222 128 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-indigo-400{--tw-gradient-from: #818cf8 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(129 140 248 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-info-secondary{--tw-gradient-from: rgb(var(--info-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--info-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-pink-400{--tw-gradient-from: #f472b6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(244 114 182 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-400{--tw-gradient-from: #f87171 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(248 113 113 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-success-secondary{--tw-gradient-from: rgb(var(--success-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--success-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-teal-500{--tw-gradient-from: #14b8a6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(20 184 166 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position) !important}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position) !important}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position) !important}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position) !important}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position) !important}.to-green-700{--tw-gradient-to: #15803d var(--tw-gradient-to-position) !important}.to-indigo-400{--tw-gradient-to: #818cf8 var(--tw-gradient-to-position) !important}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position) !important}.to-info-tertiary{--tw-gradient-to: rgb(var(--info-tertiary)) var(--tw-gradient-to-position) !important}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position) !important}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position) !important}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position) !important}.to-red-600{--tw-gradient-to: #dc2626 var(--tw-gradient-to-position) !important}.to-red-700{--tw-gradient-to: #b91c1c var(--tw-gradient-to-position) !important}.to-teal-700{--tw-gradient-to: #0f766e var(--tw-gradient-to-position) !important}.bg-clip-text{background-clip:text!important}.object-cover{object-fit:cover!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-10{padding:2.5rem!important}.p-2{padding:.5rem!important}.p-3{padding:.75rem!important}.p-4{padding:1rem!important}.p-8{padding:2rem!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-10{padding-top:2.5rem!important;padding-bottom:2.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.py-4{padding-top:1rem!important;padding-bottom:1rem!important}.py-5{padding-top:1.25rem!important;padding-bottom:1.25rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-8{padding-top:2rem!important;padding-bottom:2rem!important}.pb-1{padding-bottom:.25rem!important}.pb-10{padding-bottom:2.5rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:.75rem!important}.pb-4{padding-bottom:1rem!important}.pl-0{padding-left:0!important}.pl-1{padding-left:.25rem!important}.pl-2{padding-left:.5rem!important}.pl-3{padding-left:.75rem!important}.pl-7{padding-left:1.75rem!important}.pl-8{padding-left:2rem!important}.pr-1{padding-right:.25rem!important}.pr-12{padding-right:3rem!important}.pr-2{padding-right:.5rem!important}.pr-8{padding-right:2rem!important}.pt-2{padding-top:.5rem!important}.pt-6{padding-top:1.5rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.font-body{font-family:Graphik,sans-serif!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-6xl{font-size:3.75rem!important;line-height:1!important}.text-7xl{font-size:4.5rem!important;line-height:1!important}.text-8xl{font-size:6rem!important;line-height:1!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-black{font-weight:900!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.uppercase{text-transform:uppercase!important}.leading-5{line-height:1.25rem!important}.text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.text-blue-500{--tw-text-opacity: 1 !important;color:rgb(59 130 246 / var(--tw-text-opacity))!important}.text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity))!important}.text-danger-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--danger-light-tertiary) / var(--tw-text-opacity))!important}.text-error-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-light-tertiary) / var(--tw-text-opacity))!important}.text-error-primary{--tw-text-opacity: 1 !important;color:rgb(var(--error-primary) / var(--tw-text-opacity))!important}.text-error-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.text-error-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))!important}.text-gray-100{--tw-text-opacity: 1 !important;color:rgb(243 244 246 / var(--tw-text-opacity))!important}.text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity))!important}.text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity))!important}.text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity))!important}.text-green-700{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity))!important}.text-info-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--info-secondary) / var(--tw-text-opacity))!important}.text-info-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))!important}.text-primary{--tw-text-opacity: 1 !important;color:rgb(var(--primary) / var(--tw-text-opacity))!important}.text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.text-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--secondary) / var(--tw-text-opacity))!important}.text-soft-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-secondary) / var(--tw-text-opacity))!important}.text-soft-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-tertiary) / var(--tw-text-opacity))!important}.text-success-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.text-success-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))!important}.text-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--tertiary) / var(--tw-text-opacity))!important}.text-transparent{color:transparent!important}.text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.underline{text-decoration-line:underline!important}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.blur{--tw-blur: blur(8px) !important;filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.duration-100{transition-duration:.1s!important}.ease-linear{transition-timing-function:linear!important}.\[key\:string\]{key:string}html,body{height:100%;font-family:Jost;width:100%}.bg-overlay{background:rgba(51,51,51,.26)}[v-cloak]>*{display:none}.loader{border-top-color:#3498db!important}.loader.slow{-webkit-animation:spinner 1.5s linear infinite;animation:spinner 1.5s linear infinite}.loader.fast{-webkit-animation:spinner .7s linear infinite;animation:spinner .7s linear infinite}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}button{border-radius:0}#editor h1{font-size:3rem;line-height:1;font-weight:700}#editor h2{font-size:2.25rem;line-height:2.5rem;font-weight:700}#editor h3{font-size:1.875rem;line-height:2.25rem;font-weight:700}#editor h4{font-size:1.5rem;line-height:2rem;font-weight:700}#editor h5{font-size:1.25rem;line-height:1.75rem;font-weight:700}#grid-items .vue-recycle-scroller__item-wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0px;overflow-y:auto}@media (min-width: 768px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1280px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(5,minmax(0,1fr))}}#grid-items .vue-recycle-scroller__item-view{display:flex;height:8rem;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-view{height:10rem}}#grid-items .vue-recycle-scroller__item-view:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.popup-heading{display:flex;align-items:center;justify-content:space-between;padding:.5rem}.popup-heading h3{font-weight:600}.hover\:cursor-pointer:hover{cursor:pointer!important}.hover\:border-info-primary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.hover\:border-transparent:hover{border-color:transparent!important}.hover\:border-opacity-0:hover{--tw-border-opacity: 0 !important}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.hover\:bg-box-elevation-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.hover\:bg-error-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.hover\:bg-error-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-error-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-floating-menu-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu-hover) / var(--tw-bg-opacity))!important}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.hover\:bg-green-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.hover\:bg-green-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(22 163 74 / var(--tw-bg-opacity))!important}.hover\:bg-info-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.hover\:bg-info-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-info-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-input-button-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))!important}.hover\:bg-numpad-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))!important}.hover\:bg-red-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.hover\:bg-success-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-white:hover{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.hover\:text-blue-400:hover{--tw-text-opacity: 1 !important;color:rgb(96 165 250 / var(--tw-text-opacity))!important}.hover\:text-error-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.hover\:text-gray-700:hover{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.hover\:text-info-primary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--info-primary) / var(--tw-text-opacity))!important}.hover\:text-success-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.hover\:text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:underline:hover{text-decoration-line:underline!important}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.focus\:border-blue-400:focus{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.focus\:shadow-sm:focus{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.active\:border-numpad-edge:active{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}:is(.dark .dark\:border-blue-700){--tw-border-opacity: 1 !important;border-color:rgb(29 78 216 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-green-800){--tw-border-opacity: 1 !important;border-color:rgb(22 101 52 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-red-700){--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity))!important}:is(.dark .dark\:border-yellow-700){--tw-border-opacity: 1 !important;border-color:rgb(161 98 7 / var(--tw-border-opacity))!important}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-green-700){--tw-bg-opacity: 1 !important;background-color:rgb(21 128 61 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}:is(.dark .dark\:bg-yellow-600){--tw-bg-opacity: 1 !important;background-color:rgb(202 138 4 / var(--tw-bg-opacity))!important}:is(.dark .dark\:text-slate-300){--tw-text-opacity: 1 !important;color:rgb(203 213 225 / var(--tw-text-opacity))!important}@media (min-width: 640px){.sm\:relative{position:relative!important}.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:hidden{display:none!important}.sm\:h-108{height:27rem!important}.sm\:w-64{width:16rem!important}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.sm\:flex-row{flex-direction:row!important}.sm\:rounded-lg{border-radius:.5rem!important}.sm\:text-sm{font-size:.875rem!important;line-height:1.25rem!important}.sm\:leading-5{line-height:1.25rem!important}}@media (min-width: 768px){.md\:visible{visibility:visible!important}.md\:static{position:static!important}.md\:-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.md\:-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.md\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.md\:mx-auto{margin-left:auto!important;margin-right:auto!important}.md\:my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.md\:mb-0{margin-bottom:0!important}.md\:mt-0{margin-top:0!important}.md\:mt-2{margin-top:.5rem!important}.md\:block{display:block!important}.md\:inline-block{display:inline-block!important}.md\:inline{display:inline!important}.md\:flex{display:flex!important}.md\:table-cell{display:table-cell!important}.md\:hidden{display:none!important}.md\:h-10{height:2.5rem!important}.md\:h-3\/5-screen{height:60vh!important}.md\:h-4\/5-screen{height:80vh!important}.md\:h-5\/6-screen{height:83.33vh!important}.md\:h-5\/7-screen{height:71.42vh!important}.md\:h-6\/7-screen{height:85.71vh!important}.md\:h-full{height:100%!important}.md\:w-1\/2{width:50%!important}.md\:w-1\/3{width:33.333333%!important}.md\:w-1\/4{width:25%!important}.md\:w-10{width:2.5rem!important}.md\:w-16{width:4rem!important}.md\:w-2\/3{width:66.666667%!important}.md\:w-2\/3-screen{width:66.66vw!important}.md\:w-2\/4-screen{width:50vw!important}.md\:w-2\/5{width:40%!important}.md\:w-2\/5-screen{width:40vw!important}.md\:w-24{width:6rem!important}.md\:w-28{width:7rem!important}.md\:w-3\/4{width:75%!important}.md\:w-3\/5{width:60%!important}.md\:w-3\/5-screen{width:60vw!important}.md\:w-3\/6-screen{width:50vw!important}.md\:w-3\/7-screen{width:42.85vw!important}.md\:w-4\/5{width:80%!important}.md\:w-4\/5-screen{width:80vw!important}.md\:w-4\/6-screen{width:66.66vw!important}.md\:w-4\/7-screen{width:57.14vw!important}.md\:w-5\/7-screen{width:71.42vw!important}.md\:w-56{width:14rem!important}.md\:w-6\/7-screen{width:85.71vw!important}.md\:w-60{width:15rem!important}.md\:w-72{width:18rem!important}.md\:w-80{width:20rem!important}.md\:w-96{width:24rem!important}.md\:w-\[550px\]{width:550px!important}.md\:w-auto{width:auto!important}.md\:w-full{width:100%!important}.md\:flex-auto{flex:1 1 auto!important}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.md\:flex-row{flex-direction:row!important}.md\:flex-col{flex-direction:column!important}.md\:flex-wrap{flex-wrap:wrap!important}.md\:items-start{align-items:flex-start!important}.md\:items-center{align-items:center!important}.md\:justify-center{justify-content:center!important}.md\:justify-between{justify-content:space-between!important}.md\:rounded{border-radius:.25rem!important}.md\:border-l{border-left-width:1px!important}.md\:p-0{padding:0!important}.md\:px-1{padding-left:.25rem!important;padding-right:.25rem!important}.md\:px-2{padding-left:.5rem!important;padding-right:.5rem!important}.md\:px-4{padding-left:1rem!important;padding-right:1rem!important}.md\:text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:text-base{font-size:1rem!important;line-height:1.5rem!important}.md\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1024px){.lg\:my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.lg\:my-8{margin-top:2rem!important;margin-bottom:2rem!important}.lg\:block{display:block!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:h-3\/7-screen{height:42.85vh!important}.lg\:h-4\/5-screen{height:80vh!important}.lg\:h-5\/6-screen{height:83.33vh!important}.lg\:h-5\/7-screen{height:71.42vh!important}.lg\:h-full{height:100%!important}.lg\:w-1\/2{width:50%!important}.lg\:w-1\/3{width:33.333333%!important}.lg\:w-1\/3-screen{width:33.33vw!important}.lg\:w-1\/4{width:25%!important}.lg\:w-1\/6{width:16.666667%!important}.lg\:w-2\/3{width:66.666667%!important}.lg\:w-2\/4{width:50%!important}.lg\:w-2\/4-screen{width:50vw!important}.lg\:w-2\/5{width:40%!important}.lg\:w-2\/5-screen{width:40vw!important}.lg\:w-2\/6-screen{width:33.33vw!important}.lg\:w-2\/7-screen{width:28.57vw!important}.lg\:w-3\/5{width:60%!important}.lg\:w-3\/5-screen{width:60vw!important}.lg\:w-3\/6-screen{width:50vw!important}.lg\:w-3\/7-screen{width:42.85vw!important}.lg\:w-4\/6{width:66.666667%!important}.lg\:w-4\/7-screen{width:57.14vw!important}.lg\:w-56{width:14rem!important}.lg\:w-auto{width:auto!important}.lg\:w-full{width:100%!important}.lg\:w-half{width:50vw!important}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.lg\:flex-row{flex-direction:row!important}.lg\:items-start{align-items:flex-start!important}.lg\:border-t{border-top-width:1px!important}.lg\:px-0{padding-left:0!important;padding-right:0!important}.lg\:py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.lg\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.lg\:text-5xl{font-size:3rem!important;line-height:1!important}.lg\:text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.lg\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1280px){.xl\:h-2\/5-screen{height:40vh!important}.xl\:w-1\/4{width:25%!important}.xl\:w-108{width:27rem!important}.xl\:w-2\/5-screen{width:40vw!important}.xl\:w-2\/6-screen{width:33.33vw!important}.xl\:w-84{width:21rem!important}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))!important}.xl\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media print{.print\:w-1\/2{width:50%!important}.print\:w-1\/3{width:33.333333%!important}.print\:text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}} diff --git a/public/build/assets/auth-415a13f9.js b/public/build/assets/auth-415a13f9.js new file mode 100644 index 000000000..b9dfb5411 --- /dev/null +++ b/public/build/assets/auth-415a13f9.js @@ -0,0 +1 @@ +import{_ as o}from"./preload-helper-41c905a7.js";import{b as n}from"./components-ef1ba55f.js";import{N as e}from"./ns-hotpress-fbaed768.js";import{c as m}from"./bootstrap-8be442b1.js";import{d as t}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";nsExtraComponents.nsRegister=t(()=>o(()=>import("./ns-register-1025a0d4.js"),["./ns-register-1025a0d4.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsLogin=t(()=>o(()=>import("./ns-login-20974704.js"),["./ns-login-20974704.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsPasswordLost=t(()=>o(()=>import("./ns-password-lost-11a5d453.js"),["./ns-password-lost-11a5d453.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));nsExtraComponents.nsNewPassword=t(()=>o(()=>import("./ns-new-password-218c1f96.js"),["./ns-new-password-218c1f96.js","./currency-f8bd78d1.js","./bootstrap-8be442b1.js","./runtime-core.esm-bundler-b48de70a.js","./_plugin-vue_export-helper-c27b6911.js"],import.meta.url));window.nsHotPress=new e;window.nsHttpClient=nsHttpClient;window.authVueComponent=m({components:{...nsExtraComponents,...n}});for(let r in n)window.authVueComponent.component(r,n[r]);window.authVueComponent.mount("#page-container"); diff --git a/public/build/assets/auth-CoKQNf5-.js b/public/build/assets/auth-CoKQNf5-.js deleted file mode 100644 index 6e21541cc..000000000 --- a/public/build/assets/auth-CoKQNf5-.js +++ /dev/null @@ -1,7 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./ns-register-Aa0C02iW.js","./bootstrap-CnLEEQCx.js","./currency-lOMYG1Wf.js","./runtime-core.esm-bundler-RT2b-_3S.js","./_plugin-vue_export-helper-DlAUqK2U.js","./ns-login-x3kPrV7g.js","./ns-password-lost-Dg5NyGNB.js","./ns-new-password-DlPed_gF.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -import{_ as o}from"./preload-helper-BQ24v_F8.js";import{b as n}from"./components-D4w1etK_.js";import{N as e}from"./ns-hotpress-B_9sUEWO.js";import{c as m}from"./bootstrap-CnLEEQCx.js";import{d as t}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./currency-lOMYG1Wf.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";nsExtraComponents.nsRegister=t(()=>o(()=>import("./ns-register-Aa0C02iW.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url));nsExtraComponents.nsLogin=t(()=>o(()=>import("./ns-login-x3kPrV7g.js"),__vite__mapDeps([5,1,2,3,4]),import.meta.url));nsExtraComponents.nsPasswordLost=t(()=>o(()=>import("./ns-password-lost-Dg5NyGNB.js"),__vite__mapDeps([6,2,1,3,4]),import.meta.url));nsExtraComponents.nsNewPassword=t(()=>o(()=>import("./ns-new-password-DlPed_gF.js"),__vite__mapDeps([7,2,1,3,4]),import.meta.url));window.nsHotPress=new e;window.nsHttpClient=nsHttpClient;window.authVueComponent=m({components:{...nsExtraComponents,...n}});for(let r in n)window.authVueComponent.component(r,n[r]);window.authVueComponent.mount("#page-container"); diff --git a/public/build/assets/bootstrap-CnLEEQCx.js b/public/build/assets/bootstrap-8be442b1.js similarity index 52% rename from public/build/assets/bootstrap-CnLEEQCx.js rename to public/build/assets/bootstrap-8be442b1.js index cad066b47..cdb448d7b 100644 --- a/public/build/assets/bootstrap-CnLEEQCx.js +++ b/public/build/assets/bootstrap-8be442b1.js @@ -1,14 +1,14 @@ -var b$=Object.defineProperty;var x$=(t,e,r)=>e in t?b$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var je=(t,e,r)=>(x$(t,typeof e!="symbol"?e+"":e,r),r);import{c as Zi,b as zu,_ as Hl,g as w$,e as S$,n as _$,a as A$}from"./currency-lOMYG1Wf.js";import{bk as zM,bl as jr,x as UM,M as qM,bm as gi,N as HM,bn as WM,bo as Zy,be as VM,J as YM,K as jM,l as o1,a1 as Oi,bp as _o,f as u1,bq as Wl,br as Pm,bs as Hn,bt as Lv,bu as Wh,bv as vh,a7 as GM,ak as $v,F as l1,U as XM,m as c1,ba as ZM,aM as KM,b0 as JM,am as QM,aV as Ky,aS as Jy,bw as D$,a5 as eT,bx as f1,by as N$,a2 as zv,bz as E$,bA as tT,$ as rT,O as C$,P as M$,Q as T$,R as O$,S as F$,L as R$,T as B$,V as P$,W as I$,X as k$,Y as L$,Z as $$,_ as z$,a0 as U$,a3 as q$,a4 as H$,v as W$,g as V$,e as Y$,c as j$,a as G$,a6 as X$,a8 as Z$,a9 as K$,i as J$,aa as Q$,d as nT,ab as ez,ac as tz,ad as rz,ae as nz,af as iz,ag as az,ah as sz,ai as oz,aj as uz,al as lz,I as cz,an as fz,ao as hz,ap as dz,q as pz,aq as mz,ar as vz,as as gz,at as yz,au as bz,av as xz,aw as wz,ax as Sz,ay as iT,az as _z,aA as Az,aB as Dz,n as Nz,H as Ez,C as Cz,aC as Mz,aD as Tz,aE as Oz,aF as Fz,aG as Rz,aH as Bz,aI as Pz,aJ as Iz,aK as kz,aL as Lz,o as $z,E as zz,y as Uz,aN as qz,D as Hz,aO as Wz,p as Vz,aP as Yz,h as jz,aQ as aT,b as Gz,A as Xz,r as Zz,G as Kz,j as Jz,aR as Qz,aT as e9,aU as t9,k as r9,aW as n9,s as Uv,aX as i9,aY as a9,aZ as s9,t as o9,a_ as sT,a$ as u9,b1 as l9,b2 as c9,b3 as f9,b4 as h9,b5 as d9,u as p9,b6 as m9,b7 as v9,b8 as g9,b9 as y9,bb as b9,bc as x9,z as w9,bd as S9,bf as _9,bg as A9,w as D9,bh as N9,B as E9,bi as C9,bj as M9,bB as h1,bC as cy,bD as th,bE as T9,bF as O_,bG as O9,bH as F9,bI as R9,bJ as B9,bK as P9,bL as qv}from"./runtime-core.esm-bundler-RT2b-_3S.js";function I9(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Im={exports:{}};/** +var y$=Object.defineProperty;var b$=(t,e,r)=>e in t?y$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var je=(t,e,r)=>(b$(t,typeof e!="symbol"?e+"":e,r),r);import{c as Zi,b as g1,_ as Hl,g as x$,e as w$,n as S$,a as _$}from"./currency-f8bd78d1.js";import{bk as WM,bl as jr,x as VM,M as YM,bm as gi,N as jM,bn as GM,bo as Jy,be as XM,J as ZM,K as KM,l as y1,a1 as Oi,bp as _o,f as b1,bq as Wl,br as Pm,bs as Hn,bt as zv,bu as Wh,bv as mh,a7 as JM,ak as Uv,F as x1,U as QM,m as w1,ba as eT,aM as tT,b0 as rT,am as nT,aV as Qy,aS as eb,bw as A$,a5 as iT,bx as S1,by as D$,a2 as qv,bz as N$,bA as aT,$ as sT,O as E$,P as C$,Q as M$,R as T$,S as O$,L as F$,T as R$,V as B$,W as P$,X as I$,Y as k$,Z as L$,_ as $$,a0 as z$,a3 as U$,a4 as q$,v as H$,g as W$,e as V$,c as Y$,a as j$,a6 as G$,a8 as X$,a9 as Z$,i as K$,aa as J$,d as oT,ab as Q$,ac as ez,ad as tz,ae as rz,af as nz,ag as iz,ah as az,ai as sz,aj as oz,al as uz,I as lz,an as cz,ao as fz,ap as hz,q as dz,aq as pz,ar as mz,as as vz,at as gz,au as yz,av as bz,aw as xz,ax as wz,ay as uT,az as Sz,aA as _z,aB as Az,n as Dz,H as Nz,C as Ez,aC as Cz,aD as Mz,aE as Tz,aF as Oz,aG as Fz,aH as Rz,aI as Bz,aJ as Pz,aK as Iz,aL as kz,o as Lz,E as $z,y as zz,aN as Uz,D as qz,aO as Hz,p as Wz,aP as Vz,h as Yz,aQ as lT,b as jz,A as Gz,r as Xz,G as Zz,j as Kz,aR as Jz,aT as Qz,aU as e9,k as t9,aW as r9,s as Hv,aX as n9,aY as i9,aZ as a9,t as s9,a_ as cT,a$ as o9,b1 as u9,b2 as l9,b3 as c9,b4 as f9,b5 as h9,u as d9,b6 as p9,b7 as m9,b8 as v9,b9 as g9,bb as y9,bc as b9,z as x9,bd as w9,bf as S9,bg as _9,w as A9,bh as D9,B as N9,bi as E9,bj as C9,bB as _1,bC as hy,bD as eh,bE as M9,bF as P_,bG as T9,bH as O9,bI as F9,bJ as R9,bK as B9,bL as Wv}from"./runtime-core.esm-bundler-b48de70a.js";function P9(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var vh={},I9={get exports(){return vh},set exports(t){vh=t}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Im.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,h=2,p=4,v=1,m=2,b=1,y=2,S=4,x=8,A=16,_=32,w=64,C=128,E=256,N=512,M=30,O="...",F=800,U=16,V=1,H=2,I=3,P=1/0,K=9007199254740991,$=17976931348623157e292,se=NaN,he=4294967295,ne=he-1,X=he>>>1,de=[["ary",C],["bind",b],["bindKey",y],["curry",x],["curryRight",A],["flip",N],["partial",_],["partialRight",w],["rearg",E]],Se="[object Arguments]",ce="[object Array]",xe="[object AsyncFunction]",_e="[object Boolean]",me="[object Date]",we="[object DOMException]",Ne="[object Error]",Ce="[object Function]",He="[object GeneratorFunction]",qe="[object Map]",J="[object Number]",te="[object Null]",ye="[object Object]",ee="[object Promise]",ue="[object Proxy]",le="[object RegExp]",Ee="[object Set]",Me="[object String]",R="[object Symbol]",q="[object Undefined]",Y="[object WeakMap]",pe="[object WeakSet]",ge="[object ArrayBuffer]",De="[object DataView]",Be="[object Float32Array]",Pe="[object Float64Array]",Ve="[object Int8Array]",ze="[object Int16Array]",gt="[object Int32Array]",St="[object Uint8Array]",at="[object Uint8ClampedArray]",mr="[object Uint16Array]",k="[object Uint32Array]",oe=/\b__p \+= '';/g,Ae=/\b(__p \+=) '' \+/g,$e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ct=/&(?:amp|lt|gt|quot|#39);/g,ht=/[&<>"']/g,Dn=RegExp(ct.source),Js=RegExp(ht.source),il=/<%-([\s\S]+?)%>/g,al=/<%([\s\S]+?)%>/g,Jo=/<%=([\s\S]+?)%>/g,Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qc=/^\w*$/,Hc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pa=/[\\^$.*+?()[\]{}|]/g,Wc=RegExp(Pa.source),Qs=/^\s+/,Vc=/\s/,Yc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,jc=/\{\n\/\* \[wrapped with (.+)\] \*/,Gc=/,? & /,Xc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zc=/[()=,{}\[\]\/\s]/,sl=/\\(\\)?/g,fa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ol=/\w*$/,Kc=/^[-+]0x[0-9a-f]+$/i,Jc=/^0b[01]+$/i,Qo=/^\[object .+?Constructor\]$/,eu=/^0o[0-7]+$/i,Qc=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eo=/($^)/,as=/['\n\r\u2028\u2029\\]/g,Wt="\\ud800-\\udfff",bn="\\u0300-\\u036f",tf="\\ufe20-\\ufe2f",to="\\u20d0-\\u20ff",Ia=bn+tf+to,ul="\\u2700-\\u27bf",ki="a-z\\xdf-\\xf6\\xf8-\\xff",xd="\\xac\\xb1\\xd7\\xf7",ss="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rf="\\u2000-\\u206f",Xg=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wd="A-Z\\xc0-\\xd6\\xd8-\\xde",Sd="\\ufe0e\\ufe0f",_d=xd+ss+rf+Xg,tu="['’]",Zg="["+Wt+"]",Ad="["+_d+"]",ru="["+Ia+"]",nu="\\d+",iu="["+ul+"]",Dd="["+ki+"]",ro="[^"+Wt+_d+nu+ul+ki+wd+"]",nf="\\ud83c[\\udffb-\\udfff]",Kg="(?:"+ru+"|"+nf+")",Nd="[^"+Wt+"]",af="(?:\\ud83c[\\udde6-\\uddff]){2}",sf="[\\ud800-\\udbff][\\udc00-\\udfff]",no="["+wd+"]",Ed="\\u200d",ll="(?:"+Dd+"|"+ro+")",os="(?:"+no+"|"+ro+")",Cd="(?:"+tu+"(?:d|ll|m|re|s|t|ve))?",Md="(?:"+tu+"(?:D|LL|M|RE|S|T|VE))?",Td=Kg+"?",Od="["+Sd+"]?",Fd="(?:"+Ed+"(?:"+[Nd,af,sf].join("|")+")"+Od+Td+")*",Jg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bd=Od+Td+Fd,Qg="(?:"+[iu,af,sf].join("|")+")"+Bd,e0="(?:"+[Nd+ru+"?",ru,af,sf,Zg].join("|")+")",t0=RegExp(tu,"g"),r0=RegExp(ru,"g"),of=RegExp(nf+"(?="+nf+")|"+e0+Bd,"g"),n0=RegExp([no+"?"+Dd+"+"+Cd+"(?="+[Ad,no,"$"].join("|")+")",os+"+"+Md+"(?="+[Ad,no+ll,"$"].join("|")+")",no+"?"+ll+"+"+Cd,no+"+"+Md,Rd,Jg,nu,Qg].join("|"),"g"),i0=RegExp("["+Ed+Wt+Ia+Sd+"]"),a0=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],s0=-1,Ar={};Ar[Be]=Ar[Pe]=Ar[Ve]=Ar[ze]=Ar[gt]=Ar[St]=Ar[at]=Ar[mr]=Ar[k]=!0,Ar[Se]=Ar[ce]=Ar[ge]=Ar[_e]=Ar[De]=Ar[me]=Ar[Ne]=Ar[Ce]=Ar[qe]=Ar[J]=Ar[ye]=Ar[le]=Ar[Ee]=Ar[Me]=Ar[Y]=!1;var et={};et[Se]=et[ce]=et[ge]=et[De]=et[_e]=et[me]=et[Be]=et[Pe]=et[Ve]=et[ze]=et[gt]=et[qe]=et[J]=et[ye]=et[le]=et[Ee]=et[Me]=et[R]=et[St]=et[at]=et[mr]=et[k]=!0,et[Ne]=et[Ce]=et[Y]=!1;var uf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},cl={"&":"&","<":"<",">":">",'"':""","'":"'"},o0={"&":"&","<":"<",">":">",""":'"',"'":"'"},u0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Id=parseFloat,l0=parseInt,kd=typeof Zi=="object"&&Zi&&Zi.Object===Object&&Zi,c0=typeof self=="object"&&self&&self.Object===Object&&self,on=kd||c0||Function("return this")(),lf=e&&!e.nodeType&&e,io=lf&&!0&&t&&!t.nodeType&&t,Ld=io&&io.exports===lf,cf=Ld&&kd.process,_i=function(){try{var ve=io&&io.require&&io.require("util").types;return ve||cf&&cf.binding&&cf.binding("util")}catch{}}(),$d=_i&&_i.isArrayBuffer,zd=_i&&_i.isDate,ff=_i&&_i.isMap,Ud=_i&&_i.isRegExp,qd=_i&&_i.isSet,Hd=_i&&_i.isTypedArray;function Gn(ve,Fe,Te){switch(Te.length){case 0:return ve.call(Fe);case 1:return ve.call(Fe,Te[0]);case 2:return ve.call(Fe,Te[0],Te[1]);case 3:return ve.call(Fe,Te[0],Te[1],Te[2])}return ve.apply(Fe,Te)}function f0(ve,Fe,Te,nt){for(var Et=-1,fr=ve==null?0:ve.length;++Et-1}function hf(ve,Fe,Te){for(var nt=-1,Et=ve==null?0:ve.length;++nt-1;);return Te}function gf(ve,Fe){for(var Te=ve.length;Te--&&Oe(Fe,ve[Te],0)>-1;);return Te}function Yd(ve,Fe){for(var Te=ve.length,nt=0;Te--;)ve[Te]===Fe&&++nt;return nt}var jd=ar(uf),yf=ar(cl);function bf(ve){return"\\"+u0[ve]}function Gd(ve,Fe){return ve==null?r:ve[Fe]}function ao(ve){return i0.test(ve)}function p0(ve){return a0.test(ve)}function m0(ve){for(var Fe,Te=[];!(Fe=ve.next()).done;)Te.push(Fe.value);return Te}function xf(ve){var Fe=-1,Te=Array(ve.size);return ve.forEach(function(nt,Et){Te[++Fe]=[Et,nt]}),Te}function wf(ve,Fe){return function(Te){return ve(Fe(Te))}}function so(ve,Fe){for(var Te=-1,nt=ve.length,Et=0,fr=[];++Te-1}function Wk(d,g){var D=this.__data__,B=cp(D,d);return B<0?(++this.size,D.push([d,g])):D[B][1]=g,this}us.prototype.clear=zk,us.prototype.delete=Uk,us.prototype.get=qk,us.prototype.has=Hk,us.prototype.set=Wk;function ls(d){var g=-1,D=d==null?0:d.length;for(this.clear();++g=g?d:g)),d}function zi(d,g,D,B,W,Z){var ae,fe=g&f,be=g&h,Ie=g&p;if(D&&(ae=W?D(d,B,W,Z):D(d)),ae!==r)return ae;if(!zr(d))return d;var ke=Ot(d);if(ke){if(ae=G4(d),!fe)return ui(d,ae)}else{var We=Pn(d),Je=We==Ce||We==He;if(ho(d))return SS(d,fe);if(We==ye||We==Se||Je&&!W){if(ae=be||Je?{}:US(d),!fe)return be?k4(d,s4(ae,d)):I4(d,Jw(ae,d))}else{if(!et[We])return W?d:{};ae=X4(d,We,fe)}}Z||(Z=new da);var ut=Z.get(d);if(ut)return ut;Z.set(d,ae),v_(d)?d.forEach(function(bt){ae.add(zi(bt,g,D,bt,d,Z))}):p_(d)&&d.forEach(function(bt,Vt){ae.set(Vt,zi(bt,g,D,Vt,d,Z))});var yt=Ie?be?U0:z0:be?ci:xn,Ut=ke?r:yt(d);return Xn(Ut||d,function(bt,Vt){Ut&&(Vt=bt,bt=d[Vt]),Ef(ae,Vt,zi(bt,g,D,Vt,d,Z))}),ae}function o4(d){var g=xn(d);return function(D){return Qw(D,d,g)}}function Qw(d,g,D){var B=D.length;if(d==null)return!B;for(d=Dr(d);B--;){var W=D[B],Z=g[W],ae=d[W];if(ae===r&&!(W in d)||!Z(ae))return!1}return!0}function eS(d,g,D){if(typeof d!="function")throw new Li(s);return Bf(function(){d.apply(r,D)},g)}function Cf(d,g,D,B){var W=-1,Z=fl,ae=!0,fe=d.length,be=[],Ie=g.length;if(!fe)return be;D&&(g=Er(g,Zn(D))),B?(Z=hf,ae=!1):g.length>=i&&(Z=au,ae=!1,g=new uu(g));e:for(;++WW?0:W+D),B=B===r||B>W?W:kt(B),B<0&&(B+=W),B=D>B?0:y_(B);D0&&D(fe)?g>1?Nn(fe,g-1,D,B,W):La(W,fe):B||(W[W.length]=fe)}return W}var S0=CS(),nS=CS(!0);function $a(d,g){return d&&S0(d,g,xn)}function _0(d,g){return d&&nS(d,g,xn)}function hp(d,g){return ka(g,function(D){return ps(d[D])})}function cu(d,g){g=co(g,d);for(var D=0,B=g.length;d!=null&&Dg}function c4(d,g){return d!=null&&vr.call(d,g)}function f4(d,g){return d!=null&&g in Dr(d)}function h4(d,g,D){return d>=Bn(g,D)&&d=120&&ke.length>=120)?new uu(ae&&ke):r}ke=d[0];var We=-1,Je=fe[0];e:for(;++We-1;)fe!==d&&np.call(fe,be,1),np.call(d,be,1);return d}function pS(d,g){for(var D=d?g.length:0,B=D-1;D--;){var W=g[D];if(D==B||W!==Z){var Z=W;ds(W)?np.call(d,W,1):R0(d,W)}}return d}function T0(d,g){return d+sp(Gw()*(g-d+1))}function D4(d,g,D,B){for(var W=-1,Z=ln(ap((g-d)/(D||1)),0),ae=Te(Z);Z--;)ae[B?Z:++W]=d,d+=D;return ae}function O0(d,g){var D="";if(!d||g<1||g>K)return D;do g%2&&(D+=d),g=sp(g/2),g&&(d+=d);while(g);return D}function qt(d,g){return G0(WS(d,g,fi),d+"")}function N4(d){return Kw(Dl(d))}function E4(d,g){var D=Dl(d);return _p(D,lu(g,0,D.length))}function Of(d,g,D,B){if(!zr(d))return d;g=co(g,d);for(var W=-1,Z=g.length,ae=Z-1,fe=d;fe!=null&&++WW?0:W+g),D=D>W?W:D,D<0&&(D+=W),W=g>D?0:D-g>>>0,g>>>=0;for(var Z=Te(W);++B>>1,ae=d[Z];ae!==null&&!Di(ae)&&(D?ae<=g:ae=i){var Ie=g?null:U4(d);if(Ie)return Xd(Ie);ae=!1,W=au,be=new uu}else be=g?[]:fe;e:for(;++B=B?d:Ui(d,g,D)}var wS=yk||function(d){return on.clearTimeout(d)};function SS(d,g){if(g)return d.slice();var D=d.length,B=Hw?Hw(D):new d.constructor(D);return d.copy(B),B}function k0(d){var g=new d.constructor(d.byteLength);return new tp(g).set(new tp(d)),g}function F4(d,g){var D=g?k0(d.buffer):d.buffer;return new d.constructor(D,d.byteOffset,d.byteLength)}function R4(d){var g=new d.constructor(d.source,ol.exec(d));return g.lastIndex=d.lastIndex,g}function B4(d){return Nf?Dr(Nf.call(d)):{}}function _S(d,g){var D=g?k0(d.buffer):d.buffer;return new d.constructor(D,d.byteOffset,d.length)}function AS(d,g){if(d!==g){var D=d!==r,B=d===null,W=d===d,Z=Di(d),ae=g!==r,fe=g===null,be=g===g,Ie=Di(g);if(!fe&&!Ie&&!Z&&d>g||Z&&ae&&be&&!fe&&!Ie||B&&ae&&be||!D&&be||!W)return 1;if(!B&&!Z&&!Ie&&d=fe)return be;var Ie=D[B];return be*(Ie=="desc"?-1:1)}}return d.index-g.index}function DS(d,g,D,B){for(var W=-1,Z=d.length,ae=D.length,fe=-1,be=g.length,Ie=ln(Z-ae,0),ke=Te(be+Ie),We=!B;++fe1?D[W-1]:r,ae=W>2?D[2]:r;for(Z=d.length>3&&typeof Z=="function"?(W--,Z):r,ae&&Jn(D[0],D[1],ae)&&(Z=W<3?r:Z,W=1),g=Dr(g);++B-1?W[Z?g[ae]:ae]:r}}function OS(d){return hs(function(g){var D=g.length,B=D,W=$i.prototype.thru;for(d&&g.reverse();B--;){var Z=g[B];if(typeof Z!="function")throw new Li(s);if(W&&!ae&&wp(Z)=="wrapper")var ae=new $i([],!0)}for(B=ae?B:D;++B1&&Jt.reverse(),ke&&befe))return!1;var Ie=Z.get(d),ke=Z.get(g);if(Ie&&ke)return Ie==g&&ke==d;var We=-1,Je=!0,ut=D&m?new uu:r;for(Z.set(d,g),Z.set(g,d);++We1?"& ":"")+g[B],g=g.join(D>2?", ":" "),d.replace(Yc,`{ + */(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,h=2,p=4,v=1,m=2,b=1,y=2,S=4,x=8,A=16,_=32,w=64,C=128,E=256,N=512,M=30,O="...",F=800,U=16,V=1,H=2,I=3,P=1/0,K=9007199254740991,$=17976931348623157e292,se=0/0,he=4294967295,ne=he-1,X=he>>>1,de=[["ary",C],["bind",b],["bindKey",y],["curry",x],["curryRight",A],["flip",N],["partial",_],["partialRight",w],["rearg",E]],Se="[object Arguments]",ce="[object Array]",xe="[object AsyncFunction]",_e="[object Boolean]",me="[object Date]",we="[object DOMException]",Ne="[object Error]",Ce="[object Function]",He="[object GeneratorFunction]",qe="[object Map]",J="[object Number]",te="[object Null]",ye="[object Object]",ee="[object Promise]",ue="[object Proxy]",le="[object RegExp]",Ee="[object Set]",Me="[object String]",R="[object Symbol]",q="[object Undefined]",Y="[object WeakMap]",pe="[object WeakSet]",ge="[object ArrayBuffer]",De="[object DataView]",Be="[object Float32Array]",Pe="[object Float64Array]",Ve="[object Int8Array]",ze="[object Int16Array]",gt="[object Int32Array]",St="[object Uint8Array]",at="[object Uint8ClampedArray]",mr="[object Uint16Array]",k="[object Uint32Array]",oe=/\b__p \+= '';/g,Ae=/\b(__p \+=) '' \+/g,$e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ct=/&(?:amp|lt|gt|quot|#39);/g,ht=/[&<>"']/g,Dn=RegExp(ct.source),Js=RegExp(ht.source),il=/<%-([\s\S]+?)%>/g,al=/<%([\s\S]+?)%>/g,Jo=/<%=([\s\S]+?)%>/g,zc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uc=/^\w*$/,qc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pa=/[\\^$.*+?()[\]{}|]/g,Hc=RegExp(Pa.source),Qs=/^\s+/,Wc=/\s/,Vc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yc=/\{\n\/\* \[wrapped with (.+)\] \*/,jc=/,? & /,Gc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xc=/[()=,{}\[\]\/\s]/,sl=/\\(\\)?/g,fa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ol=/\w*$/,Zc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,Qo=/^\[object .+?Constructor\]$/,eu=/^0o[0-7]+$/i,Jc=/^(?:0|[1-9]\d*)$/,Qc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eo=/($^)/,as=/['\n\r\u2028\u2029\\]/g,Wt="\\ud800-\\udfff",bn="\\u0300-\\u036f",ef="\\ufe20-\\ufe2f",to="\\u20d0-\\u20ff",Ia=bn+ef+to,ul="\\u2700-\\u27bf",ki="a-z\\xdf-\\xf6\\xf8-\\xff",xd="\\xac\\xb1\\xd7\\xf7",ss="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tf="\\u2000-\\u206f",Kg=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wd="A-Z\\xc0-\\xd6\\xd8-\\xde",Sd="\\ufe0e\\ufe0f",_d=xd+ss+tf+Kg,tu="['’]",Jg="["+Wt+"]",Ad="["+_d+"]",ru="["+Ia+"]",nu="\\d+",iu="["+ul+"]",Dd="["+ki+"]",ro="[^"+Wt+_d+nu+ul+ki+wd+"]",rf="\\ud83c[\\udffb-\\udfff]",Qg="(?:"+ru+"|"+rf+")",Nd="[^"+Wt+"]",nf="(?:\\ud83c[\\udde6-\\uddff]){2}",af="[\\ud800-\\udbff][\\udc00-\\udfff]",no="["+wd+"]",Ed="\\u200d",ll="(?:"+Dd+"|"+ro+")",os="(?:"+no+"|"+ro+")",Cd="(?:"+tu+"(?:d|ll|m|re|s|t|ve))?",Md="(?:"+tu+"(?:D|LL|M|RE|S|T|VE))?",Td=Qg+"?",Od="["+Sd+"]?",Fd="(?:"+Ed+"(?:"+[Nd,nf,af].join("|")+")"+Od+Td+")*",e0="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bd=Od+Td+Fd,t0="(?:"+[iu,nf,af].join("|")+")"+Bd,r0="(?:"+[Nd+ru+"?",ru,nf,af,Jg].join("|")+")",n0=RegExp(tu,"g"),i0=RegExp(ru,"g"),sf=RegExp(rf+"(?="+rf+")|"+r0+Bd,"g"),a0=RegExp([no+"?"+Dd+"+"+Cd+"(?="+[Ad,no,"$"].join("|")+")",os+"+"+Md+"(?="+[Ad,no+ll,"$"].join("|")+")",no+"?"+ll+"+"+Cd,no+"+"+Md,Rd,e0,nu,t0].join("|"),"g"),s0=RegExp("["+Ed+Wt+Ia+Sd+"]"),o0=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],u0=-1,Nr={};Nr[Be]=Nr[Pe]=Nr[Ve]=Nr[ze]=Nr[gt]=Nr[St]=Nr[at]=Nr[mr]=Nr[k]=!0,Nr[Se]=Nr[ce]=Nr[ge]=Nr[_e]=Nr[De]=Nr[me]=Nr[Ne]=Nr[Ce]=Nr[qe]=Nr[J]=Nr[ye]=Nr[le]=Nr[Ee]=Nr[Me]=Nr[Y]=!1;var et={};et[Se]=et[ce]=et[ge]=et[De]=et[_e]=et[me]=et[Be]=et[Pe]=et[Ve]=et[ze]=et[gt]=et[qe]=et[J]=et[ye]=et[le]=et[Ee]=et[Me]=et[R]=et[St]=et[at]=et[mr]=et[k]=!0,et[Ne]=et[Ce]=et[Y]=!1;var of={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},cl={"&":"&","<":"<",">":">",'"':""","'":"'"},l0={"&":"&","<":"<",">":">",""":'"',"'":"'"},c0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Id=parseFloat,f0=parseInt,kd=typeof Zi=="object"&&Zi&&Zi.Object===Object&&Zi,h0=typeof self=="object"&&self&&self.Object===Object&&self,on=kd||h0||Function("return this")(),uf=e&&!e.nodeType&&e,io=uf&&!0&&t&&!t.nodeType&&t,Ld=io&&io.exports===uf,lf=Ld&&kd.process,_i=function(){try{var ve=io&&io.require&&io.require("util").types;return ve||lf&&lf.binding&&lf.binding("util")}catch{}}(),$d=_i&&_i.isArrayBuffer,zd=_i&&_i.isDate,cf=_i&&_i.isMap,Ud=_i&&_i.isRegExp,qd=_i&&_i.isSet,Hd=_i&&_i.isTypedArray;function Gn(ve,Fe,Te){switch(Te.length){case 0:return ve.call(Fe);case 1:return ve.call(Fe,Te[0]);case 2:return ve.call(Fe,Te[0],Te[1]);case 3:return ve.call(Fe,Te[0],Te[1],Te[2])}return ve.apply(Fe,Te)}function d0(ve,Fe,Te,nt){for(var Et=-1,fr=ve==null?0:ve.length;++Et-1}function ff(ve,Fe,Te){for(var nt=-1,Et=ve==null?0:ve.length;++nt-1;);return Te}function vf(ve,Fe){for(var Te=ve.length;Te--&&Oe(Fe,ve[Te],0)>-1;);return Te}function Yd(ve,Fe){for(var Te=ve.length,nt=0;Te--;)ve[Te]===Fe&&++nt;return nt}var jd=ar(of),gf=ar(cl);function yf(ve){return"\\"+c0[ve]}function Gd(ve,Fe){return ve==null?r:ve[Fe]}function ao(ve){return s0.test(ve)}function v0(ve){return o0.test(ve)}function g0(ve){for(var Fe,Te=[];!(Fe=ve.next()).done;)Te.push(Fe.value);return Te}function bf(ve){var Fe=-1,Te=Array(ve.size);return ve.forEach(function(nt,Et){Te[++Fe]=[Et,nt]}),Te}function xf(ve,Fe){return function(Te){return ve(Fe(Te))}}function so(ve,Fe){for(var Te=-1,nt=ve.length,Et=0,fr=[];++Te-1}function Hk(d,g){var D=this.__data__,B=cp(D,d);return B<0?(++this.size,D.push([d,g])):D[B][1]=g,this}us.prototype.clear=$k,us.prototype.delete=zk,us.prototype.get=Uk,us.prototype.has=qk,us.prototype.set=Hk;function ls(d){var g=-1,D=d==null?0:d.length;for(this.clear();++g=g?d:g)),d}function zi(d,g,D,B,W,Z){var ae,fe=g&f,be=g&h,Ie=g&p;if(D&&(ae=W?D(d,B,W,Z):D(d)),ae!==r)return ae;if(!zr(d))return d;var ke=Ot(d);if(ke){if(ae=j4(d),!fe)return ui(d,ae)}else{var We=Pn(d),Je=We==Ce||We==He;if(ho(d))return NS(d,fe);if(We==ye||We==Se||Je&&!W){if(ae=be||Je?{}:VS(d),!fe)return be?I4(d,a4(ae,d)):P4(d,rS(ae,d))}else{if(!et[We])return W?d:{};ae=G4(d,We,fe)}}Z||(Z=new da);var ut=Z.get(d);if(ut)return ut;Z.set(d,ae),x_(d)?d.forEach(function(bt){ae.add(zi(bt,g,D,bt,d,Z))}):y_(d)&&d.forEach(function(bt,Vt){ae.set(Vt,zi(bt,g,D,Vt,d,Z))});var yt=Ie?be?H0:q0:be?ci:xn,Ut=ke?r:yt(d);return Xn(Ut||d,function(bt,Vt){Ut&&(Vt=bt,bt=d[Vt]),Nf(ae,Vt,zi(bt,g,D,Vt,d,Z))}),ae}function s4(d){var g=xn(d);return function(D){return nS(D,d,g)}}function nS(d,g,D){var B=D.length;if(d==null)return!B;for(d=Er(d);B--;){var W=D[B],Z=g[W],ae=d[W];if(ae===r&&!(W in d)||!Z(ae))return!1}return!0}function iS(d,g,D){if(typeof d!="function")throw new Li(s);return Rf(function(){d.apply(r,D)},g)}function Ef(d,g,D,B){var W=-1,Z=fl,ae=!0,fe=d.length,be=[],Ie=g.length;if(!fe)return be;D&&(g=Mr(g,Zn(D))),B?(Z=ff,ae=!1):g.length>=i&&(Z=au,ae=!1,g=new uu(g));e:for(;++WW?0:W+D),B=B===r||B>W?W:kt(B),B<0&&(B+=W),B=D>B?0:S_(B);D0&&D(fe)?g>1?Nn(fe,g-1,D,B,W):La(W,fe):B||(W[W.length]=fe)}return W}var A0=FS(),oS=FS(!0);function $a(d,g){return d&&A0(d,g,xn)}function D0(d,g){return d&&oS(d,g,xn)}function hp(d,g){return ka(g,function(D){return ps(d[D])})}function cu(d,g){g=co(g,d);for(var D=0,B=g.length;d!=null&&Dg}function l4(d,g){return d!=null&&vr.call(d,g)}function c4(d,g){return d!=null&&g in Er(d)}function f4(d,g,D){return d>=Bn(g,D)&&d=120&&ke.length>=120)?new uu(ae&&ke):r}ke=d[0];var We=-1,Je=fe[0];e:for(;++We-1;)fe!==d&&np.call(fe,be,1),np.call(d,be,1);return d}function yS(d,g){for(var D=d?g.length:0,B=D-1;D--;){var W=g[D];if(D==B||W!==Z){var Z=W;ds(W)?np.call(d,W,1):P0(d,W)}}return d}function F0(d,g){return d+sp(Jw()*(g-d+1))}function A4(d,g,D,B){for(var W=-1,Z=ln(ap((g-d)/(D||1)),0),ae=Te(Z);Z--;)ae[B?Z:++W]=d,d+=D;return ae}function R0(d,g){var D="";if(!d||g<1||g>K)return D;do g%2&&(D+=d),g=sp(g/2),g&&(d+=d);while(g);return D}function qt(d,g){return Z0(GS(d,g,fi),d+"")}function D4(d){return tS(Dl(d))}function N4(d,g){var D=Dl(d);return _p(D,lu(g,0,D.length))}function Tf(d,g,D,B){if(!zr(d))return d;g=co(g,d);for(var W=-1,Z=g.length,ae=Z-1,fe=d;fe!=null&&++WW?0:W+g),D=D>W?W:D,D<0&&(D+=W),W=g>D?0:D-g>>>0,g>>>=0;for(var Z=Te(W);++B>>1,ae=d[Z];ae!==null&&!Di(ae)&&(D?ae<=g:ae=i){var Ie=g?null:z4(d);if(Ie)return Xd(Ie);ae=!1,W=au,be=new uu}else be=g?[]:fe;e:for(;++B=B?d:Ui(d,g,D)}var DS=gk||function(d){return on.clearTimeout(d)};function NS(d,g){if(g)return d.slice();var D=d.length,B=jw?jw(D):new d.constructor(D);return d.copy(B),B}function $0(d){var g=new d.constructor(d.byteLength);return new tp(g).set(new tp(d)),g}function O4(d,g){var D=g?$0(d.buffer):d.buffer;return new d.constructor(D,d.byteOffset,d.byteLength)}function F4(d){var g=new d.constructor(d.source,ol.exec(d));return g.lastIndex=d.lastIndex,g}function R4(d){return Df?Er(Df.call(d)):{}}function ES(d,g){var D=g?$0(d.buffer):d.buffer;return new d.constructor(D,d.byteOffset,d.length)}function CS(d,g){if(d!==g){var D=d!==r,B=d===null,W=d===d,Z=Di(d),ae=g!==r,fe=g===null,be=g===g,Ie=Di(g);if(!fe&&!Ie&&!Z&&d>g||Z&&ae&&be&&!fe&&!Ie||B&&ae&&be||!D&&be||!W)return 1;if(!B&&!Z&&!Ie&&d=fe)return be;var Ie=D[B];return be*(Ie=="desc"?-1:1)}}return d.index-g.index}function MS(d,g,D,B){for(var W=-1,Z=d.length,ae=D.length,fe=-1,be=g.length,Ie=ln(Z-ae,0),ke=Te(be+Ie),We=!B;++fe1?D[W-1]:r,ae=W>2?D[2]:r;for(Z=d.length>3&&typeof Z=="function"?(W--,Z):r,ae&&Jn(D[0],D[1],ae)&&(Z=W<3?r:Z,W=1),g=Er(g);++B-1?W[Z?g[ae]:ae]:r}}function PS(d){return hs(function(g){var D=g.length,B=D,W=$i.prototype.thru;for(d&&g.reverse();B--;){var Z=g[B];if(typeof Z!="function")throw new Li(s);if(W&&!ae&&wp(Z)=="wrapper")var ae=new $i([],!0)}for(B=ae?B:D;++B1&&Jt.reverse(),ke&&befe))return!1;var Ie=Z.get(d),ke=Z.get(g);if(Ie&&ke)return Ie==g&&ke==d;var We=-1,Je=!0,ut=D&m?new uu:r;for(Z.set(d,g),Z.set(g,d);++We1?"& ":"")+g[B],g=g.join(D>2?", ":" "),d.replace(Vc,`{ /* [wrapped with `+g+`] */ -`)}function K4(d){return Ot(d)||du(d)||!!(Yw&&d&&d[Yw])}function ds(d,g){var D=typeof d;return g=g??K,!!g&&(D=="number"||D!="symbol"&&Qc.test(d))&&d>-1&&d%1==0&&d0){if(++g>=F)return arguments[0]}else g=0;return d.apply(r,arguments)}}function _p(d,g){var D=-1,B=d.length,W=B-1;for(g=g===r?B:g;++D1?d[g-1]:r;return D=typeof D=="function"?(d.pop(),D):r,r_(d,D)});function n_(d){var g=j(d);return g.__chain__=!0,g}function u5(d,g){return g(d),d}function Ap(d,g){return g(d)}var l5=hs(function(d){var g=d.length,D=g?d[0]:0,B=this.__wrapped__,W=function(Z){return w0(Z,d)};return g>1||this.__actions__.length||!(B instanceof jt)||!ds(D)?this.thru(W):(B=B.slice(D,+D+(g?1:0)),B.__actions__.push({func:Ap,args:[W],thisArg:r}),new $i(B,this.__chain__).thru(function(Z){return g&&!Z.length&&Z.push(r),Z}))});function c5(){return n_(this)}function f5(){return new $i(this.value(),this.__chain__)}function h5(){this.__values__===r&&(this.__values__=g_(this.value()));var d=this.__index__>=this.__values__.length,g=d?r:this.__values__[this.__index__++];return{done:d,value:g}}function d5(){return this}function p5(d){for(var g,D=this;D instanceof lp;){var B=ZS(D);B.__index__=0,B.__values__=r,g?W.__wrapped__=B:g=B;var W=B;D=D.__wrapped__}return W.__wrapped__=d,g}function m5(){var d=this.__wrapped__;if(d instanceof jt){var g=d;return this.__actions__.length&&(g=new jt(this)),g=g.reverse(),g.__actions__.push({func:Ap,args:[X0],thisArg:r}),new $i(g,this.__chain__)}return this.thru(X0)}function v5(){return bS(this.__wrapped__,this.__actions__)}var g5=vp(function(d,g,D){vr.call(d,D)?++d[D]:cs(d,D,1)});function y5(d,g,D){var B=Ot(d)?Wd:u4;return D&&Jn(d,g,D)&&(g=r),B(d,pt(g,3))}function b5(d,g){var D=Ot(d)?ka:rS;return D(d,pt(g,3))}var x5=TS(KS),w5=TS(JS);function S5(d,g){return Nn(Dp(d,g),1)}function _5(d,g){return Nn(Dp(d,g),P)}function A5(d,g,D){return D=D===r?1:kt(D),Nn(Dp(d,g),D)}function i_(d,g){var D=Ot(d)?Xn:uo;return D(d,pt(g,3))}function a_(d,g){var D=Ot(d)?h0:tS;return D(d,pt(g,3))}var D5=vp(function(d,g,D){vr.call(d,D)?d[D].push(g):cs(d,D,[g])});function N5(d,g,D,B){d=li(d)?d:Dl(d),D=D&&!B?kt(D):0;var W=d.length;return D<0&&(D=ln(W+D,0)),Tp(d)?D<=W&&d.indexOf(g,D)>-1:!!W&&Oe(d,g,D)>-1}var E5=qt(function(d,g,D){var B=-1,W=typeof g=="function",Z=li(d)?Te(d.length):[];return uo(d,function(ae){Z[++B]=W?Gn(g,ae,D):Mf(ae,g,D)}),Z}),C5=vp(function(d,g,D){cs(d,D,g)});function Dp(d,g){var D=Ot(d)?Er:uS;return D(d,pt(g,3))}function M5(d,g,D,B){return d==null?[]:(Ot(g)||(g=g==null?[]:[g]),D=B?r:D,Ot(D)||(D=D==null?[]:[D]),hS(d,g,D))}var T5=vp(function(d,g,D){d[D?0:1].push(g)},function(){return[[],[]]});function O5(d,g,D){var B=Ot(d)?Zr:$r,W=arguments.length<3;return B(d,pt(g,4),D,W,uo)}function F5(d,g,D){var B=Ot(d)?df:$r,W=arguments.length<3;return B(d,pt(g,4),D,W,tS)}function R5(d,g){var D=Ot(d)?ka:rS;return D(d,Cp(pt(g,3)))}function B5(d){var g=Ot(d)?Kw:N4;return g(d)}function P5(d,g,D){(D?Jn(d,g,D):g===r)?g=1:g=kt(g);var B=Ot(d)?n4:E4;return B(d,g)}function I5(d){var g=Ot(d)?i4:M4;return g(d)}function k5(d){if(d==null)return 0;if(li(d))return Tp(d)?ml(d):d.length;var g=Pn(d);return g==qe||g==Ee?d.size:E0(d).length}function L5(d,g,D){var B=Ot(d)?pf:T4;return D&&Jn(d,g,D)&&(g=r),B(d,pt(g,3))}var $5=qt(function(d,g){if(d==null)return[];var D=g.length;return D>1&&Jn(d,g[0],g[1])?g=[]:D>2&&Jn(g[0],g[1],g[2])&&(g=[g[0]]),hS(d,Nn(g,1),[])}),Np=bk||function(){return on.Date.now()};function z5(d,g){if(typeof g!="function")throw new Li(s);return d=kt(d),function(){if(--d<1)return g.apply(this,arguments)}}function s_(d,g,D){return g=D?r:g,g=d&&g==null?d.length:g,fs(d,C,r,r,r,r,g)}function o_(d,g){var D;if(typeof g!="function")throw new Li(s);return d=kt(d),function(){return--d>0&&(D=g.apply(this,arguments)),d<=1&&(g=r),D}}var K0=qt(function(d,g,D){var B=b;if(D.length){var W=so(D,_l(K0));B|=_}return fs(d,B,g,D,W)}),u_=qt(function(d,g,D){var B=b|y;if(D.length){var W=so(D,_l(u_));B|=_}return fs(g,B,d,D,W)});function l_(d,g,D){g=D?r:g;var B=fs(d,x,r,r,r,r,r,g);return B.placeholder=l_.placeholder,B}function c_(d,g,D){g=D?r:g;var B=fs(d,A,r,r,r,r,r,g);return B.placeholder=c_.placeholder,B}function f_(d,g,D){var B,W,Z,ae,fe,be,Ie=0,ke=!1,We=!1,Je=!0;if(typeof d!="function")throw new Li(s);g=Hi(g)||0,zr(D)&&(ke=!!D.leading,We="maxWait"in D,Z=We?ln(Hi(D.maxWait)||0,g):Z,Je="trailing"in D?!!D.trailing:Je);function ut(Jr){var ma=B,vs=W;return B=W=r,Ie=Jr,ae=d.apply(vs,ma),ae}function yt(Jr){return Ie=Jr,fe=Bf(Vt,g),ke?ut(Jr):ae}function Ut(Jr){var ma=Jr-be,vs=Jr-Ie,T_=g-ma;return We?Bn(T_,Z-vs):T_}function bt(Jr){var ma=Jr-be,vs=Jr-Ie;return be===r||ma>=g||ma<0||We&&vs>=Z}function Vt(){var Jr=Np();if(bt(Jr))return Jt(Jr);fe=Bf(Vt,Ut(Jr))}function Jt(Jr){return fe=r,Je&&B?ut(Jr):(B=W=r,ae)}function Ni(){fe!==r&&wS(fe),Ie=0,B=be=W=fe=r}function Qn(){return fe===r?ae:Jt(Np())}function Ei(){var Jr=Np(),ma=bt(Jr);if(B=arguments,W=this,be=Jr,ma){if(fe===r)return yt(be);if(We)return wS(fe),fe=Bf(Vt,g),ut(be)}return fe===r&&(fe=Bf(Vt,g)),ae}return Ei.cancel=Ni,Ei.flush=Qn,Ei}var U5=qt(function(d,g){return eS(d,1,g)}),q5=qt(function(d,g,D){return eS(d,Hi(g)||0,D)});function H5(d){return fs(d,N)}function Ep(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new Li(s);var D=function(){var B=arguments,W=g?g.apply(this,B):B[0],Z=D.cache;if(Z.has(W))return Z.get(W);var ae=d.apply(this,B);return D.cache=Z.set(W,ae)||Z,ae};return D.cache=new(Ep.Cache||ls),D}Ep.Cache=ls;function Cp(d){if(typeof d!="function")throw new Li(s);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function W5(d){return o_(2,d)}var V5=O4(function(d,g){g=g.length==1&&Ot(g[0])?Er(g[0],Zn(pt())):Er(Nn(g,1),Zn(pt()));var D=g.length;return qt(function(B){for(var W=-1,Z=Bn(B.length,D);++W=g}),du=aS(function(){return arguments}())?aS:function(d){return qr(d)&&vr.call(d,"callee")&&!Vw.call(d,"callee")},Ot=Te.isArray,s8=$d?Zn($d):p4;function li(d){return d!=null&&Mp(d.length)&&!ps(d)}function Kr(d){return qr(d)&&li(d)}function o8(d){return d===!0||d===!1||qr(d)&&Kn(d)==_e}var ho=wk||ly,u8=zd?Zn(zd):m4;function l8(d){return qr(d)&&d.nodeType===1&&!Pf(d)}function c8(d){if(d==null)return!0;if(li(d)&&(Ot(d)||typeof d=="string"||typeof d.splice=="function"||ho(d)||Al(d)||du(d)))return!d.length;var g=Pn(d);if(g==qe||g==Ee)return!d.size;if(Rf(d))return!E0(d).length;for(var D in d)if(vr.call(d,D))return!1;return!0}function f8(d,g){return Tf(d,g)}function h8(d,g,D){D=typeof D=="function"?D:r;var B=D?D(d,g):r;return B===r?Tf(d,g,r,D):!!B}function Q0(d){if(!qr(d))return!1;var g=Kn(d);return g==Ne||g==we||typeof d.message=="string"&&typeof d.name=="string"&&!Pf(d)}function d8(d){return typeof d=="number"&&jw(d)}function ps(d){if(!zr(d))return!1;var g=Kn(d);return g==Ce||g==He||g==xe||g==ue}function d_(d){return typeof d=="number"&&d==kt(d)}function Mp(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=K}function zr(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function qr(d){return d!=null&&typeof d=="object"}var p_=ff?Zn(ff):g4;function p8(d,g){return d===g||N0(d,g,H0(g))}function m8(d,g,D){return D=typeof D=="function"?D:r,N0(d,g,H0(g),D)}function v8(d){return m_(d)&&d!=+d}function g8(d){if(eL(d))throw new Et(a);return sS(d)}function y8(d){return d===null}function b8(d){return d==null}function m_(d){return typeof d=="number"||qr(d)&&Kn(d)==J}function Pf(d){if(!qr(d)||Kn(d)!=ye)return!1;var g=rp(d);if(g===null)return!0;var D=vr.call(g,"constructor")&&g.constructor;return typeof D=="function"&&D instanceof D&&Jd.call(D)==mk}var ey=Ud?Zn(Ud):y4;function x8(d){return d_(d)&&d>=-K&&d<=K}var v_=qd?Zn(qd):b4;function Tp(d){return typeof d=="string"||!Ot(d)&&qr(d)&&Kn(d)==Me}function Di(d){return typeof d=="symbol"||qr(d)&&Kn(d)==R}var Al=Hd?Zn(Hd):x4;function w8(d){return d===r}function S8(d){return qr(d)&&Pn(d)==Y}function _8(d){return qr(d)&&Kn(d)==pe}var A8=xp(C0),D8=xp(function(d,g){return d<=g});function g_(d){if(!d)return[];if(li(d))return Tp(d)?ha(d):ui(d);if(Sf&&d[Sf])return m0(d[Sf]());var g=Pn(d),D=g==qe?xf:g==Ee?Xd:Dl;return D(d)}function ms(d){if(!d)return d===0?d:0;if(d=Hi(d),d===P||d===-P){var g=d<0?-1:1;return g*$}return d===d?d:0}function kt(d){var g=ms(d),D=g%1;return g===g?D?g-D:g:0}function y_(d){return d?lu(kt(d),0,he):0}function Hi(d){if(typeof d=="number")return d;if(Di(d))return se;if(zr(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=zr(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=vf(d);var D=Jc.test(d);return D||eu.test(d)?l0(d.slice(2),D?2:8):Kc.test(d)?se:+d}function b_(d){return za(d,ci(d))}function N8(d){return d?lu(kt(d),-K,K):d===0?d:0}function dr(d){return d==null?"":Ai(d)}var E8=wl(function(d,g){if(Rf(g)||li(g)){za(g,xn(g),d);return}for(var D in g)vr.call(g,D)&&Ef(d,D,g[D])}),x_=wl(function(d,g){za(g,ci(g),d)}),Op=wl(function(d,g,D,B){za(g,ci(g),d,B)}),C8=wl(function(d,g,D,B){za(g,xn(g),d,B)}),M8=hs(w0);function T8(d,g){var D=xl(d);return g==null?D:Jw(D,g)}var O8=qt(function(d,g){d=Dr(d);var D=-1,B=g.length,W=B>2?g[2]:r;for(W&&Jn(g[0],g[1],W)&&(B=1);++D1),Z}),za(d,U0(d),D),B&&(D=zi(D,f|h|p,q4));for(var W=g.length;W--;)R0(D,g[W]);return D});function X8(d,g){return S_(d,Cp(pt(g)))}var Z8=hs(function(d,g){return d==null?{}:_4(d,g)});function S_(d,g){if(d==null)return{};var D=Er(U0(d),function(B){return[B]});return g=pt(g),dS(d,D,function(B,W){return g(B,W[0])})}function K8(d,g,D){g=co(g,d);var B=-1,W=g.length;for(W||(W=1,d=r);++Bg){var B=d;d=g,g=B}if(D||d%1||g%1){var W=Gw();return Bn(d+W*(g-d+Id("1e-"+((W+"").length-1))),g)}return T0(d,g)}var u6=Sl(function(d,g,D){return g=g.toLowerCase(),d+(D?D_(g):g)});function D_(d){return ny(dr(d).toLowerCase())}function N_(d){return d=dr(d),d&&d.replace(ef,jd).replace(r0,"")}function l6(d,g,D){d=dr(d),g=Ai(g);var B=d.length;D=D===r?B:lu(kt(D),0,B);var W=D;return D-=g.length,D>=0&&d.slice(D,W)==g}function c6(d){return d=dr(d),d&&Js.test(d)?d.replace(ht,yf):d}function f6(d){return d=dr(d),d&&Wc.test(d)?d.replace(Pa,"\\$&"):d}var h6=Sl(function(d,g,D){return d+(D?"-":"")+g.toLowerCase()}),d6=Sl(function(d,g,D){return d+(D?" ":"")+g.toLowerCase()}),p6=MS("toLowerCase");function m6(d,g,D){d=dr(d),g=kt(g);var B=g?ml(d):0;if(!g||B>=g)return d;var W=(g-B)/2;return bp(sp(W),D)+d+bp(ap(W),D)}function v6(d,g,D){d=dr(d),g=kt(g);var B=g?ml(d):0;return g&&B>>0,D?(d=dr(d),d&&(typeof g=="string"||g!=null&&!ey(g))&&(g=Ai(g),!g&&ao(d))?fo(ha(d),0,D):d.split(g,D)):[]}var _6=Sl(function(d,g,D){return d+(D?" ":"")+ny(g)});function A6(d,g,D){return d=dr(d),D=D==null?0:lu(kt(D),0,d.length),g=Ai(g),d.slice(D,D+g.length)==g}function D6(d,g,D){var B=j.templateSettings;D&&Jn(d,g,D)&&(g=r),d=dr(d),g=Op({},g,B,IS);var W=Op({},g.imports,B.imports,IS),Z=xn(W),ae=pl(W,Z),fe,be,Ie=0,ke=g.interpolate||eo,We="__p += '",Je=v0((g.escape||eo).source+"|"+ke.source+"|"+(ke===Jo?fa:eo).source+"|"+(g.evaluate||eo).source+"|$","g"),ut="//# sourceURL="+(vr.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++s0+"]")+` -`;d.replace(Je,function(bt,Vt,Jt,Ni,Qn,Ei){return Jt||(Jt=Ni),We+=d.slice(Ie,Ei).replace(as,bf),Vt&&(fe=!0,We+=`' + +`)}function Z4(d){return Ot(d)||du(d)||!!(Zw&&d&&d[Zw])}function ds(d,g){var D=typeof d;return g=g??K,!!g&&(D=="number"||D!="symbol"&&Jc.test(d))&&d>-1&&d%1==0&&d0){if(++g>=F)return arguments[0]}else g=0;return d.apply(r,arguments)}}function _p(d,g){var D=-1,B=d.length,W=B-1;for(g=g===r?B:g;++D1?d[g-1]:r;return D=typeof D=="function"?(d.pop(),D):r,s_(d,D)});function o_(d){var g=j(d);return g.__chain__=!0,g}function o5(d,g){return g(d),d}function Ap(d,g){return g(d)}var u5=hs(function(d){var g=d.length,D=g?d[0]:0,B=this.__wrapped__,W=function(Z){return _0(Z,d)};return g>1||this.__actions__.length||!(B instanceof jt)||!ds(D)?this.thru(W):(B=B.slice(D,+D+(g?1:0)),B.__actions__.push({func:Ap,args:[W],thisArg:r}),new $i(B,this.__chain__).thru(function(Z){return g&&!Z.length&&Z.push(r),Z}))});function l5(){return o_(this)}function c5(){return new $i(this.value(),this.__chain__)}function f5(){this.__values__===r&&(this.__values__=w_(this.value()));var d=this.__index__>=this.__values__.length,g=d?r:this.__values__[this.__index__++];return{done:d,value:g}}function h5(){return this}function d5(d){for(var g,D=this;D instanceof lp;){var B=e_(D);B.__index__=0,B.__values__=r,g?W.__wrapped__=B:g=B;var W=B;D=D.__wrapped__}return W.__wrapped__=d,g}function p5(){var d=this.__wrapped__;if(d instanceof jt){var g=d;return this.__actions__.length&&(g=new jt(this)),g=g.reverse(),g.__actions__.push({func:Ap,args:[K0],thisArg:r}),new $i(g,this.__chain__)}return this.thru(K0)}function m5(){return _S(this.__wrapped__,this.__actions__)}var v5=vp(function(d,g,D){vr.call(d,D)?++d[D]:cs(d,D,1)});function g5(d,g,D){var B=Ot(d)?Wd:o4;return D&&Jn(d,g,D)&&(g=r),B(d,pt(g,3))}function y5(d,g){var D=Ot(d)?ka:sS;return D(d,pt(g,3))}var b5=BS(t_),x5=BS(r_);function w5(d,g){return Nn(Dp(d,g),1)}function S5(d,g){return Nn(Dp(d,g),P)}function _5(d,g,D){return D=D===r?1:kt(D),Nn(Dp(d,g),D)}function u_(d,g){var D=Ot(d)?Xn:uo;return D(d,pt(g,3))}function l_(d,g){var D=Ot(d)?p0:aS;return D(d,pt(g,3))}var A5=vp(function(d,g,D){vr.call(d,D)?d[D].push(g):cs(d,D,[g])});function D5(d,g,D,B){d=li(d)?d:Dl(d),D=D&&!B?kt(D):0;var W=d.length;return D<0&&(D=ln(W+D,0)),Tp(d)?D<=W&&d.indexOf(g,D)>-1:!!W&&Oe(d,g,D)>-1}var N5=qt(function(d,g,D){var B=-1,W=typeof g=="function",Z=li(d)?Te(d.length):[];return uo(d,function(ae){Z[++B]=W?Gn(g,ae,D):Cf(ae,g,D)}),Z}),E5=vp(function(d,g,D){cs(d,D,g)});function Dp(d,g){var D=Ot(d)?Mr:hS;return D(d,pt(g,3))}function C5(d,g,D,B){return d==null?[]:(Ot(g)||(g=g==null?[]:[g]),D=B?r:D,Ot(D)||(D=D==null?[]:[D]),vS(d,g,D))}var M5=vp(function(d,g,D){d[D?0:1].push(g)},function(){return[[],[]]});function T5(d,g,D){var B=Ot(d)?Zr:$r,W=arguments.length<3;return B(d,pt(g,4),D,W,uo)}function O5(d,g,D){var B=Ot(d)?hf:$r,W=arguments.length<3;return B(d,pt(g,4),D,W,aS)}function F5(d,g){var D=Ot(d)?ka:sS;return D(d,Cp(pt(g,3)))}function R5(d){var g=Ot(d)?tS:D4;return g(d)}function B5(d,g,D){(D?Jn(d,g,D):g===r)?g=1:g=kt(g);var B=Ot(d)?r4:N4;return B(d,g)}function P5(d){var g=Ot(d)?n4:C4;return g(d)}function I5(d){if(d==null)return 0;if(li(d))return Tp(d)?ml(d):d.length;var g=Pn(d);return g==qe||g==Ee?d.size:M0(d).length}function k5(d,g,D){var B=Ot(d)?df:M4;return D&&Jn(d,g,D)&&(g=r),B(d,pt(g,3))}var L5=qt(function(d,g){if(d==null)return[];var D=g.length;return D>1&&Jn(d,g[0],g[1])?g=[]:D>2&&Jn(g[0],g[1],g[2])&&(g=[g[0]]),vS(d,Nn(g,1),[])}),Np=yk||function(){return on.Date.now()};function $5(d,g){if(typeof g!="function")throw new Li(s);return d=kt(d),function(){if(--d<1)return g.apply(this,arguments)}}function c_(d,g,D){return g=D?r:g,g=d&&g==null?d.length:g,fs(d,C,r,r,r,r,g)}function f_(d,g){var D;if(typeof g!="function")throw new Li(s);return d=kt(d),function(){return--d>0&&(D=g.apply(this,arguments)),d<=1&&(g=r),D}}var Q0=qt(function(d,g,D){var B=b;if(D.length){var W=so(D,_l(Q0));B|=_}return fs(d,B,g,D,W)}),h_=qt(function(d,g,D){var B=b|y;if(D.length){var W=so(D,_l(h_));B|=_}return fs(g,B,d,D,W)});function d_(d,g,D){g=D?r:g;var B=fs(d,x,r,r,r,r,r,g);return B.placeholder=d_.placeholder,B}function p_(d,g,D){g=D?r:g;var B=fs(d,A,r,r,r,r,r,g);return B.placeholder=p_.placeholder,B}function m_(d,g,D){var B,W,Z,ae,fe,be,Ie=0,ke=!1,We=!1,Je=!0;if(typeof d!="function")throw new Li(s);g=Hi(g)||0,zr(D)&&(ke=!!D.leading,We="maxWait"in D,Z=We?ln(Hi(D.maxWait)||0,g):Z,Je="trailing"in D?!!D.trailing:Je);function ut(Jr){var ma=B,vs=W;return B=W=r,Ie=Jr,ae=d.apply(vs,ma),ae}function yt(Jr){return Ie=Jr,fe=Rf(Vt,g),ke?ut(Jr):ae}function Ut(Jr){var ma=Jr-be,vs=Jr-Ie,B_=g-ma;return We?Bn(B_,Z-vs):B_}function bt(Jr){var ma=Jr-be,vs=Jr-Ie;return be===r||ma>=g||ma<0||We&&vs>=Z}function Vt(){var Jr=Np();if(bt(Jr))return Jt(Jr);fe=Rf(Vt,Ut(Jr))}function Jt(Jr){return fe=r,Je&&B?ut(Jr):(B=W=r,ae)}function Ni(){fe!==r&&DS(fe),Ie=0,B=be=W=fe=r}function Qn(){return fe===r?ae:Jt(Np())}function Ei(){var Jr=Np(),ma=bt(Jr);if(B=arguments,W=this,be=Jr,ma){if(fe===r)return yt(be);if(We)return DS(fe),fe=Rf(Vt,g),ut(be)}return fe===r&&(fe=Rf(Vt,g)),ae}return Ei.cancel=Ni,Ei.flush=Qn,Ei}var z5=qt(function(d,g){return iS(d,1,g)}),U5=qt(function(d,g,D){return iS(d,Hi(g)||0,D)});function q5(d){return fs(d,N)}function Ep(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new Li(s);var D=function(){var B=arguments,W=g?g.apply(this,B):B[0],Z=D.cache;if(Z.has(W))return Z.get(W);var ae=d.apply(this,B);return D.cache=Z.set(W,ae)||Z,ae};return D.cache=new(Ep.Cache||ls),D}Ep.Cache=ls;function Cp(d){if(typeof d!="function")throw new Li(s);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function H5(d){return f_(2,d)}var W5=T4(function(d,g){g=g.length==1&&Ot(g[0])?Mr(g[0],Zn(pt())):Mr(Nn(g,1),Zn(pt()));var D=g.length;return qt(function(B){for(var W=-1,Z=Bn(B.length,D);++W=g}),du=lS(function(){return arguments}())?lS:function(d){return qr(d)&&vr.call(d,"callee")&&!Xw.call(d,"callee")},Ot=Te.isArray,a8=$d?Zn($d):d4;function li(d){return d!=null&&Mp(d.length)&&!ps(d)}function Kr(d){return qr(d)&&li(d)}function s8(d){return d===!0||d===!1||qr(d)&&Kn(d)==_e}var ho=xk||fy,o8=zd?Zn(zd):p4;function u8(d){return qr(d)&&d.nodeType===1&&!Bf(d)}function l8(d){if(d==null)return!0;if(li(d)&&(Ot(d)||typeof d=="string"||typeof d.splice=="function"||ho(d)||Al(d)||du(d)))return!d.length;var g=Pn(d);if(g==qe||g==Ee)return!d.size;if(Ff(d))return!M0(d).length;for(var D in d)if(vr.call(d,D))return!1;return!0}function c8(d,g){return Mf(d,g)}function f8(d,g,D){D=typeof D=="function"?D:r;var B=D?D(d,g):r;return B===r?Mf(d,g,r,D):!!B}function ty(d){if(!qr(d))return!1;var g=Kn(d);return g==Ne||g==we||typeof d.message=="string"&&typeof d.name=="string"&&!Bf(d)}function h8(d){return typeof d=="number"&&Kw(d)}function ps(d){if(!zr(d))return!1;var g=Kn(d);return g==Ce||g==He||g==xe||g==ue}function g_(d){return typeof d=="number"&&d==kt(d)}function Mp(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=K}function zr(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function qr(d){return d!=null&&typeof d=="object"}var y_=cf?Zn(cf):v4;function d8(d,g){return d===g||C0(d,g,V0(g))}function p8(d,g,D){return D=typeof D=="function"?D:r,C0(d,g,V0(g),D)}function m8(d){return b_(d)&&d!=+d}function v8(d){if(Q4(d))throw new Et(a);return cS(d)}function g8(d){return d===null}function y8(d){return d==null}function b_(d){return typeof d=="number"||qr(d)&&Kn(d)==J}function Bf(d){if(!qr(d)||Kn(d)!=ye)return!1;var g=rp(d);if(g===null)return!0;var D=vr.call(g,"constructor")&&g.constructor;return typeof D=="function"&&D instanceof D&&Jd.call(D)==pk}var ry=Ud?Zn(Ud):g4;function b8(d){return g_(d)&&d>=-K&&d<=K}var x_=qd?Zn(qd):y4;function Tp(d){return typeof d=="string"||!Ot(d)&&qr(d)&&Kn(d)==Me}function Di(d){return typeof d=="symbol"||qr(d)&&Kn(d)==R}var Al=Hd?Zn(Hd):b4;function x8(d){return d===r}function w8(d){return qr(d)&&Pn(d)==Y}function S8(d){return qr(d)&&Kn(d)==pe}var _8=xp(T0),A8=xp(function(d,g){return d<=g});function w_(d){if(!d)return[];if(li(d))return Tp(d)?ha(d):ui(d);if(wf&&d[wf])return g0(d[wf]());var g=Pn(d),D=g==qe?bf:g==Ee?Xd:Dl;return D(d)}function ms(d){if(!d)return d===0?d:0;if(d=Hi(d),d===P||d===-P){var g=d<0?-1:1;return g*$}return d===d?d:0}function kt(d){var g=ms(d),D=g%1;return g===g?D?g-D:g:0}function S_(d){return d?lu(kt(d),0,he):0}function Hi(d){if(typeof d=="number")return d;if(Di(d))return se;if(zr(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=zr(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=mf(d);var D=Kc.test(d);return D||eu.test(d)?f0(d.slice(2),D?2:8):Zc.test(d)?se:+d}function __(d){return za(d,ci(d))}function D8(d){return d?lu(kt(d),-K,K):d===0?d:0}function dr(d){return d==null?"":Ai(d)}var N8=wl(function(d,g){if(Ff(g)||li(g)){za(g,xn(g),d);return}for(var D in g)vr.call(g,D)&&Nf(d,D,g[D])}),A_=wl(function(d,g){za(g,ci(g),d)}),Op=wl(function(d,g,D,B){za(g,ci(g),d,B)}),E8=wl(function(d,g,D,B){za(g,xn(g),d,B)}),C8=hs(_0);function M8(d,g){var D=xl(d);return g==null?D:rS(D,g)}var T8=qt(function(d,g){d=Er(d);var D=-1,B=g.length,W=B>2?g[2]:r;for(W&&Jn(g[0],g[1],W)&&(B=1);++D1),Z}),za(d,H0(d),D),B&&(D=zi(D,f|h|p,U4));for(var W=g.length;W--;)P0(D,g[W]);return D});function G8(d,g){return N_(d,Cp(pt(g)))}var X8=hs(function(d,g){return d==null?{}:S4(d,g)});function N_(d,g){if(d==null)return{};var D=Mr(H0(d),function(B){return[B]});return g=pt(g),gS(d,D,function(B,W){return g(B,W[0])})}function Z8(d,g,D){g=co(g,d);var B=-1,W=g.length;for(W||(W=1,d=r);++Bg){var B=d;d=g,g=B}if(D||d%1||g%1){var W=Jw();return Bn(d+W*(g-d+Id("1e-"+((W+"").length-1))),g)}return F0(d,g)}var o6=Sl(function(d,g,D){return g=g.toLowerCase(),d+(D?M_(g):g)});function M_(d){return ay(dr(d).toLowerCase())}function T_(d){return d=dr(d),d&&d.replace(Qc,jd).replace(i0,"")}function u6(d,g,D){d=dr(d),g=Ai(g);var B=d.length;D=D===r?B:lu(kt(D),0,B);var W=D;return D-=g.length,D>=0&&d.slice(D,W)==g}function l6(d){return d=dr(d),d&&Js.test(d)?d.replace(ht,gf):d}function c6(d){return d=dr(d),d&&Hc.test(d)?d.replace(Pa,"\\$&"):d}var f6=Sl(function(d,g,D){return d+(D?"-":"")+g.toLowerCase()}),h6=Sl(function(d,g,D){return d+(D?" ":"")+g.toLowerCase()}),d6=RS("toLowerCase");function p6(d,g,D){d=dr(d),g=kt(g);var B=g?ml(d):0;if(!g||B>=g)return d;var W=(g-B)/2;return bp(sp(W),D)+d+bp(ap(W),D)}function m6(d,g,D){d=dr(d),g=kt(g);var B=g?ml(d):0;return g&&B>>0,D?(d=dr(d),d&&(typeof g=="string"||g!=null&&!ry(g))&&(g=Ai(g),!g&&ao(d))?fo(ha(d),0,D):d.split(g,D)):[]}var S6=Sl(function(d,g,D){return d+(D?" ":"")+ay(g)});function _6(d,g,D){return d=dr(d),D=D==null?0:lu(kt(D),0,d.length),g=Ai(g),d.slice(D,D+g.length)==g}function A6(d,g,D){var B=j.templateSettings;D&&Jn(d,g,D)&&(g=r),d=dr(d),g=Op({},g,B,zS);var W=Op({},g.imports,B.imports,zS),Z=xn(W),ae=pl(W,Z),fe,be,Ie=0,ke=g.interpolate||eo,We="__p += '",Je=y0((g.escape||eo).source+"|"+ke.source+"|"+(ke===Jo?fa:eo).source+"|"+(g.evaluate||eo).source+"|$","g"),ut="//# sourceURL="+(vr.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++u0+"]")+` +`;d.replace(Je,function(bt,Vt,Jt,Ni,Qn,Ei){return Jt||(Jt=Ni),We+=d.slice(Ie,Ei).replace(as,yf),Vt&&(fe=!0,We+=`' + __e(`+Vt+`) + '`),Qn&&(be=!0,We+=`'; `+Qn+`; @@ -18,75 +18,75 @@ __p += '`),Jt&&(We+=`' + `;var yt=vr.call(g,"variable")&&g.variable;if(!yt)We=`with (obj) { `+We+` } -`;else if(Zc.test(yt))throw new Et(o);We=(be?We.replace(oe,""):We).replace(Ae,"$1").replace($e,"$1;"),We="function("+(yt||"obj")+`) { +`;else if(Xc.test(yt))throw new Et(o);We=(be?We.replace(oe,""):We).replace(Ae,"$1").replace($e,"$1;"),We="function("+(yt||"obj")+`) { `+(yt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(be?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+We+`return __p -}`;var Ut=C_(function(){return fr(Z,ut+"return "+We).apply(r,ae)});if(Ut.source=We,Q0(Ut))throw Ut;return Ut}function N6(d){return dr(d).toLowerCase()}function E6(d){return dr(d).toUpperCase()}function C6(d,g,D){if(d=dr(d),d&&(D||g===r))return vf(d);if(!d||!(g=Ai(g)))return d;var B=ha(d),W=ha(g),Z=Vd(B,W),ae=gf(B,W)+1;return fo(B,Z,ae).join("")}function M6(d,g,D){if(d=dr(d),d&&(D||g===r))return d.slice(0,Uw(d)+1);if(!d||!(g=Ai(g)))return d;var B=ha(d),W=gf(B,ha(g))+1;return fo(B,0,W).join("")}function T6(d,g,D){if(d=dr(d),d&&(D||g===r))return d.replace(Qs,"");if(!d||!(g=Ai(g)))return d;var B=ha(d),W=Vd(B,ha(g));return fo(B,W).join("")}function O6(d,g){var D=M,B=O;if(zr(g)){var W="separator"in g?g.separator:W;D="length"in g?kt(g.length):D,B="omission"in g?Ai(g.omission):B}d=dr(d);var Z=d.length;if(ao(d)){var ae=ha(d);Z=ae.length}if(D>=Z)return d;var fe=D-ml(B);if(fe<1)return B;var be=ae?fo(ae,0,fe).join(""):d.slice(0,fe);if(W===r)return be+B;if(ae&&(fe+=be.length-fe),ey(W)){if(d.slice(fe).search(W)){var Ie,ke=be;for(W.global||(W=v0(W.source,dr(ol.exec(W))+"g")),W.lastIndex=0;Ie=W.exec(ke);)var We=Ie.index;be=be.slice(0,We===r?fe:We)}}else if(d.indexOf(Ai(W),fe)!=fe){var Je=be.lastIndexOf(W);Je>-1&&(be=be.slice(0,Je))}return be+B}function F6(d){return d=dr(d),d&&Dn.test(d)?d.replace(ct,ok):d}var R6=Sl(function(d,g,D){return d+(D?" ":"")+g.toUpperCase()}),ny=MS("toUpperCase");function E_(d,g,D){return d=dr(d),g=D?r:g,g===r?p0(d)?ck(d):L(d):d.match(g)||[]}var C_=qt(function(d,g){try{return Gn(d,r,g)}catch(D){return Q0(D)?D:new Et(D)}}),B6=hs(function(d,g){return Xn(g,function(D){D=Ua(D),cs(d,D,K0(d[D],d))}),d});function P6(d){var g=d==null?0:d.length,D=pt();return d=g?Er(d,function(B){if(typeof B[1]!="function")throw new Li(s);return[D(B[0]),B[1]]}):[],qt(function(B){for(var W=-1;++WK)return[];var D=he,B=Bn(d,he);g=pt(g),d-=he;for(var W=dl(B,g);++D0||g<0)?new jt(D):(d<0?D=D.takeRight(-d):d&&(D=D.drop(d)),g!==r&&(g=kt(g),D=g<0?D.dropRight(-g):D.take(g-d)),D)},jt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},jt.prototype.toArray=function(){return this.take(he)},$a(jt.prototype,function(d,g){var D=/^(?:filter|find|map|reject)|While$/.test(g),B=/^(?:head|last)$/.test(g),W=j[B?"take"+(g=="last"?"Right":""):g],Z=B||/^find/.test(g);W&&(j.prototype[g]=function(){var ae=this.__wrapped__,fe=B?[1]:arguments,be=ae instanceof jt,Ie=fe[0],ke=be||Ot(ae),We=function(Vt){var Jt=W.apply(j,La([Vt],fe));return B&&Je?Jt[0]:Jt};ke&&D&&typeof Ie=="function"&&Ie.length!=1&&(be=ke=!1);var Je=this.__chain__,ut=!!this.__actions__.length,yt=Z&&!Je,Ut=be&&!ut;if(!Z&&ke){ae=Ut?ae:new jt(this);var bt=d.apply(ae,fe);return bt.__actions__.push({func:Ap,args:[We],thisArg:r}),new $i(bt,Je)}return yt&&Ut?d.apply(this,fe):(bt=this.thru(We),yt?B?bt.value()[0]:bt.value():bt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(d){var g=Zd[d],D=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",B=/^(?:pop|shift)$/.test(d);j.prototype[d]=function(){var W=arguments;if(B&&!this.__chain__){var Z=this.value();return g.apply(Ot(Z)?Z:[],W)}return this[D](function(ae){return g.apply(Ot(ae)?ae:[],W)})}}),$a(jt.prototype,function(d,g){var D=j[g];if(D){var B=D.name+"";vr.call(bl,B)||(bl[B]=[]),bl[B].push({name:g,func:D})}}),bl[gp(r,y).name]=[{name:"wrapper",func:r}],jt.prototype.clone=Fk,jt.prototype.reverse=Rk,jt.prototype.value=Bk,j.prototype.at=l5,j.prototype.chain=c5,j.prototype.commit=f5,j.prototype.next=h5,j.prototype.plant=p5,j.prototype.reverse=m5,j.prototype.toJSON=j.prototype.valueOf=j.prototype.value=v5,j.prototype.first=j.prototype.head,Sf&&(j.prototype[Sf]=d5),j},vl=fk();io?((io.exports=vl)._=vl,lf._=vl):on._=vl}).call(Zi)})(Im,Im.exports);var oT=Im.exports;const k9=zu(oT),L9=I9({__proto__:null,default:k9},[oT]);var uT={exports:{}};/*! +}`;var Ut=F_(function(){return fr(Z,ut+"return "+We).apply(r,ae)});if(Ut.source=We,ty(Ut))throw Ut;return Ut}function D6(d){return dr(d).toLowerCase()}function N6(d){return dr(d).toUpperCase()}function E6(d,g,D){if(d=dr(d),d&&(D||g===r))return mf(d);if(!d||!(g=Ai(g)))return d;var B=ha(d),W=ha(g),Z=Vd(B,W),ae=vf(B,W)+1;return fo(B,Z,ae).join("")}function C6(d,g,D){if(d=dr(d),d&&(D||g===r))return d.slice(0,Vw(d)+1);if(!d||!(g=Ai(g)))return d;var B=ha(d),W=vf(B,ha(g))+1;return fo(B,0,W).join("")}function M6(d,g,D){if(d=dr(d),d&&(D||g===r))return d.replace(Qs,"");if(!d||!(g=Ai(g)))return d;var B=ha(d),W=Vd(B,ha(g));return fo(B,W).join("")}function T6(d,g){var D=M,B=O;if(zr(g)){var W="separator"in g?g.separator:W;D="length"in g?kt(g.length):D,B="omission"in g?Ai(g.omission):B}d=dr(d);var Z=d.length;if(ao(d)){var ae=ha(d);Z=ae.length}if(D>=Z)return d;var fe=D-ml(B);if(fe<1)return B;var be=ae?fo(ae,0,fe).join(""):d.slice(0,fe);if(W===r)return be+B;if(ae&&(fe+=be.length-fe),ry(W)){if(d.slice(fe).search(W)){var Ie,ke=be;for(W.global||(W=y0(W.source,dr(ol.exec(W))+"g")),W.lastIndex=0;Ie=W.exec(ke);)var We=Ie.index;be=be.slice(0,We===r?fe:We)}}else if(d.indexOf(Ai(W),fe)!=fe){var Je=be.lastIndexOf(W);Je>-1&&(be=be.slice(0,Je))}return be+B}function O6(d){return d=dr(d),d&&Dn.test(d)?d.replace(ct,sk):d}var F6=Sl(function(d,g,D){return d+(D?" ":"")+g.toUpperCase()}),ay=RS("toUpperCase");function O_(d,g,D){return d=dr(d),g=D?r:g,g===r?v0(d)?lk(d):L(d):d.match(g)||[]}var F_=qt(function(d,g){try{return Gn(d,r,g)}catch(D){return ty(D)?D:new Et(D)}}),R6=hs(function(d,g){return Xn(g,function(D){D=Ua(D),cs(d,D,Q0(d[D],d))}),d});function B6(d){var g=d==null?0:d.length,D=pt();return d=g?Mr(d,function(B){if(typeof B[1]!="function")throw new Li(s);return[D(B[0]),B[1]]}):[],qt(function(B){for(var W=-1;++WK)return[];var D=he,B=Bn(d,he);g=pt(g),d-=he;for(var W=dl(B,g);++D0||g<0)?new jt(D):(d<0?D=D.takeRight(-d):d&&(D=D.drop(d)),g!==r&&(g=kt(g),D=g<0?D.dropRight(-g):D.take(g-d)),D)},jt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},jt.prototype.toArray=function(){return this.take(he)},$a(jt.prototype,function(d,g){var D=/^(?:filter|find|map|reject)|While$/.test(g),B=/^(?:head|last)$/.test(g),W=j[B?"take"+(g=="last"?"Right":""):g],Z=B||/^find/.test(g);W&&(j.prototype[g]=function(){var ae=this.__wrapped__,fe=B?[1]:arguments,be=ae instanceof jt,Ie=fe[0],ke=be||Ot(ae),We=function(Vt){var Jt=W.apply(j,La([Vt],fe));return B&&Je?Jt[0]:Jt};ke&&D&&typeof Ie=="function"&&Ie.length!=1&&(be=ke=!1);var Je=this.__chain__,ut=!!this.__actions__.length,yt=Z&&!Je,Ut=be&&!ut;if(!Z&&ke){ae=Ut?ae:new jt(this);var bt=d.apply(ae,fe);return bt.__actions__.push({func:Ap,args:[We],thisArg:r}),new $i(bt,Je)}return yt&&Ut?d.apply(this,fe):(bt=this.thru(We),yt?B?bt.value()[0]:bt.value():bt)})}),Xn(["pop","push","shift","sort","splice","unshift"],function(d){var g=Zd[d],D=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",B=/^(?:pop|shift)$/.test(d);j.prototype[d]=function(){var W=arguments;if(B&&!this.__chain__){var Z=this.value();return g.apply(Ot(Z)?Z:[],W)}return this[D](function(ae){return g.apply(Ot(ae)?ae:[],W)})}}),$a(jt.prototype,function(d,g){var D=j[g];if(D){var B=D.name+"";vr.call(bl,B)||(bl[B]=[]),bl[B].push({name:g,func:D})}}),bl[gp(r,y).name]=[{name:"wrapper",func:r}],jt.prototype.clone=Ok,jt.prototype.reverse=Fk,jt.prototype.value=Rk,j.prototype.at=u5,j.prototype.chain=l5,j.prototype.commit=c5,j.prototype.next=f5,j.prototype.plant=d5,j.prototype.reverse=p5,j.prototype.toJSON=j.prototype.valueOf=j.prototype.value=m5,j.prototype.first=j.prototype.head,wf&&(j.prototype[wf]=h5),j},vl=ck();io?((io.exports=vl)._=vl,uf._=vl):on._=vl}).call(Zi)})(I9,vh);const k9=vh,L9=P9({__proto__:null,default:k9},[vh]);var tb={},$9={get exports(){return tb},set exports(t){tb=t}};/*! * Pusher JavaScript Library v8.4.0-rc2 * https://pusher.com/ * * Copyright 2020, Pusher * Released under the MIT licence. - */(function(t,e){(function(n,i){t.exports=i()})(window,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:o})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(s&1&&(a=i(a)),s&8||s&4&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),s&2&&typeof a!="string")for(var u in a)i.d(o,u,(function(l){return a[l]}).bind(null,u));return o},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=2)}([function(r,n,i){var a=this&&this.__extends||function(){var m=function(b,y){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,x){S.__proto__=x}||function(S,x){for(var A in x)x.hasOwnProperty(A)&&(S[A]=x[A])},m(b,y)};return function(b,y){m(b,y);function S(){this.constructor=b}b.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=256,o=function(){function m(b){b===void 0&&(b="="),this._paddingCharacter=b}return m.prototype.encodedLength=function(b){return this._paddingCharacter?(b+2)/3*4|0:(b*8+5)/6|0},m.prototype.encode=function(b){for(var y="",S=0;S>>3*6&63),y+=this._encodeByte(x>>>2*6&63),y+=this._encodeByte(x>>>1*6&63),y+=this._encodeByte(x>>>0*6&63)}var A=b.length-S;if(A>0){var x=b[S]<<16|(A===2?b[S+1]<<8:0);y+=this._encodeByte(x>>>3*6&63),y+=this._encodeByte(x>>>2*6&63),A===2?y+=this._encodeByte(x>>>1*6&63):y+=this._paddingCharacter||"",y+=this._paddingCharacter||""}return y},m.prototype.maxDecodedLength=function(b){return this._paddingCharacter?b/4*3|0:(b*6+7)/8|0},m.prototype.decodedLength=function(b){return this.maxDecodedLength(b.length-this._getPaddingLength(b))},m.prototype.decode=function(b){if(b.length===0)return new Uint8Array(0);for(var y=this._getPaddingLength(b),S=b.length-y,x=new Uint8Array(this.maxDecodedLength(S)),A=0,_=0,w=0,C=0,E=0,N=0,M=0;_>>4,x[A++]=E<<4|N>>>2,x[A++]=N<<6|M,w|=C&s,w|=E&s,w|=N&s,w|=M&s;if(_>>4,w|=C&s,w|=E&s),_>>2,w|=N&s),_>>8&6,y+=51-b>>>8&-75,y+=61-b>>>8&-15,y+=62-b>>>8&3,String.fromCharCode(y)},m.prototype._decodeChar=function(b){var y=s;return y+=(42-b&b-44)>>>8&-s+b-43+62,y+=(46-b&b-48)>>>8&-s+b-47+63,y+=(47-b&b-58)>>>8&-s+b-48+52,y+=(64-b&b-91)>>>8&-s+b-65+0,y+=(96-b&b-123)>>>8&-s+b-97+26,y},m.prototype._getPaddingLength=function(b){var y=0;if(this._paddingCharacter){for(var S=b.length-1;S>=0&&b[S]===this._paddingCharacter;S--)y++;if(b.length<4||y>2)throw new Error("Base64Coder: incorrect padding")}return y},m}();n.Coder=o;var u=new o;function l(m){return u.encode(m)}n.encode=l;function c(m){return u.decode(m)}n.decode=c;var f=function(m){a(b,m);function b(){return m!==null&&m.apply(this,arguments)||this}return b.prototype._encodeByte=function(y){var S=y;return S+=65,S+=25-y>>>8&6,S+=51-y>>>8&-75,S+=61-y>>>8&-13,S+=62-y>>>8&49,String.fromCharCode(S)},b.prototype._decodeChar=function(y){var S=s;return S+=(44-y&y-46)>>>8&-s+y-45+62,S+=(94-y&y-96)>>>8&-s+y-95+63,S+=(47-y&y-58)>>>8&-s+y-48+52,S+=(64-y&y-91)>>>8&-s+y-65+0,S+=(96-y&y-123)>>>8&-s+y-97+26,S},b}(o);n.URLSafeCoder=f;var h=new f;function p(m){return h.encode(m)}n.encodeURLSafe=p;function v(m){return h.decode(m)}n.decodeURLSafe=v,n.encodedLength=function(m){return u.encodedLength(m)},n.maxDecodedLength=function(m){return u.maxDecodedLength(m)},n.decodedLength=function(m){return u.decodedLength(m)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a="utf8: invalid string",s="utf8: invalid source encoding";function o(c){for(var f=new Uint8Array(u(c)),h=0,p=0;p>6,f[h++]=128|v&63):v<55296?(f[h++]=224|v>>12,f[h++]=128|v>>6&63,f[h++]=128|v&63):(p++,v=(v&1023)<<10,v|=c.charCodeAt(p)&1023,v+=65536,f[h++]=240|v>>18,f[h++]=128|v>>12&63,f[h++]=128|v>>6&63,f[h++]=128|v&63)}return f}n.encode=o;function u(c){for(var f=0,h=0;h=c.length-1)throw new Error(a);h++,f+=4}else throw new Error(a)}return f}n.encodedLength=u;function l(c){for(var f=[],h=0;h=c.length)throw new Error(s);var m=c[++h];if((m&192)!==128)throw new Error(s);p=(p&31)<<6|m&63,v=128}else if(p<240){if(h>=c.length-1)throw new Error(s);var m=c[++h],b=c[++h];if((m&192)!==128||(b&192)!==128)throw new Error(s);p=(p&15)<<12|(m&63)<<6|b&63,v=2048}else if(p<248){if(h>=c.length-2)throw new Error(s);var m=c[++h],b=c[++h],y=c[++h];if((m&192)!==128||(b&192)!==128||(y&192)!==128)throw new Error(s);p=(p&15)<<18|(m&63)<<12|(b&63)<<6|y&63,v=65536}else throw new Error(s);if(p=55296&&p<=57343)throw new Error(s);if(p>=65536){if(p>1114111)throw new Error(s);p-=65536,f.push(String.fromCharCode(55296|p>>10)),p=56320|p&1023}}f.push(String.fromCharCode(p))}return f.join("")}n.decode=l},function(r,n,i){r.exports=i(3).default},function(r,n,i){i.r(n);class a{constructor(T,L){this.lastId=0,this.prefix=T,this.name=L}create(T){this.lastId++;var L=this.lastId,Q=this.prefix+L,ie=this.name+"["+L+"]",Oe=!1,Ze=function(){Oe||(T.apply(null,arguments),Oe=!0)};return this[L]=Ze,{number:L,id:Q,name:ie,callback:Ze}}remove(T){delete this[T.number]}}var s=new a("_pusher_script_","Pusher.ScriptReceivers"),o={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},u=o;class l{constructor(T){this.options=T,this.receivers=T.receivers||s,this.loading={}}load(T,L,Q){var ie=this;if(ie.loading[T]&&ie.loading[T].length>0)ie.loading[T].push(Q);else{ie.loading[T]=[Q];var Oe=et.createScriptRequest(ie.getPath(T,L)),Ze=ie.receivers.create(function(st){if(ie.receivers.remove(Ze),ie.loading[T]){var _t=ie.loading[T];delete ie.loading[T];for(var Yt=function($r){$r||Oe.cleanup()},ar=0;ar<_t.length;ar++)_t[ar](st,Yt)}});Oe.send(Ze)}}getRoot(T){var L,Q=et.getDocument().location.protocol;return T&&T.useTLS||Q==="https:"?L=this.options.cdn_https:L=this.options.cdn_http,L.replace(/\/*$/,"")+"/"+this.options.version}getPath(T,L){return this.getRoot(L)+"/"+T+this.options.suffix+".js"}}var c=new a("_pusher_dependencies","Pusher.DependenciesReceivers"),f=new l({cdn_http:u.cdn_http,cdn_https:u.cdn_https,version:u.VERSION,suffix:u.dependency_suffix,receivers:c});const h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var v={buildLogSuffix:function(z){const T="See:",L=h.urls[z];if(!L)return"";let Q;return L.fullUrl?Q=L.fullUrl:L.path&&(Q=h.baseUrl+L.path),Q?`${T} ${Q}`:""}},m;(function(z){z.UserAuthentication="user-authentication",z.ChannelAuthorization="channel-authorization"})(m||(m={}));class b extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class w extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(T,L){super(L),this.status=T,Object.setPrototypeOf(this,new.target.prototype)}}var M=function(z,T,L,Q,ie){const Oe=et.createXHR();Oe.open("POST",L.endpoint,!0),Oe.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var Ze in L.headers)Oe.setRequestHeader(Ze,L.headers[Ze]);if(L.headersProvider!=null){let st=L.headersProvider();for(var Ze in st)Oe.setRequestHeader(Ze,st[Ze])}return Oe.onreadystatechange=function(){if(Oe.readyState===4)if(Oe.status===200){let st,_t=!1;try{st=JSON.parse(Oe.responseText),_t=!0}catch{ie(new E(200,`JSON returned from ${Q.toString()} endpoint was invalid, yet status code was 200. Data was: ${Oe.responseText}`),null)}_t&&ie(null,st)}else{let st="";switch(Q){case m.UserAuthentication:st=v.buildLogSuffix("authenticationEndpoint");break;case m.ChannelAuthorization:st=`Clients must be authorized to join private or presence channels. ${v.buildLogSuffix("authorizationEndpoint")}`;break}ie(new E(Oe.status,`Unable to retrieve auth string from ${Q.toString()} endpoint - received status: ${Oe.status} from ${L.endpoint}. ${st}`),null)}},Oe.send(T),Oe};function O(z){return P(H(z))}var F=String.fromCharCode,U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",V=function(z){var T=z.charCodeAt(0);return T<128?z:T<2048?F(192|T>>>6)+F(128|T&63):F(224|T>>>12&15)+F(128|T>>>6&63)+F(128|T&63)},H=function(z){return z.replace(/[^\x00-\x7F]/g,V)},I=function(z){var T=[0,2,1][z.length%3],L=z.charCodeAt(0)<<16|(z.length>1?z.charCodeAt(1):0)<<8|(z.length>2?z.charCodeAt(2):0),Q=[U.charAt(L>>>18),U.charAt(L>>>12&63),T>=2?"=":U.charAt(L>>>6&63),T>=1?"=":U.charAt(L&63)];return Q.join("")},P=window.btoa||function(z){return z.replace(/[\s\S]{1,3}/g,I)};class K{constructor(T,L,Q,ie){this.clear=L,this.timer=T(()=>{this.timer&&(this.timer=ie(this.timer))},Q)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var $=K;function se(z){window.clearTimeout(z)}function he(z){window.clearInterval(z)}class ne extends ${constructor(T,L){super(setTimeout,se,T,function(Q){return L(),null})}}class X extends ${constructor(T,L){super(setInterval,he,T,function(Q){return L(),Q})}}var de={now(){return Date.now?Date.now():new Date().valueOf()},defer(z){return new ne(0,z)},method(z,...T){var L=Array.prototype.slice.call(arguments,1);return function(Q){return Q[z].apply(Q,L.concat(arguments))}}},Se=de;function ce(z,...T){for(var L=0;L{window.console&&window.console.log&&window.console.log(T)}}debug(...T){this.log(this.globalLog,T)}warn(...T){this.log(this.globalLogWarn,T)}error(...T){this.log(this.globalLogError,T)}globalLogWarn(T){window.console&&window.console.warn?window.console.warn(T):this.globalLog(T)}globalLogError(T){window.console&&window.console.error?window.console.error(T):this.globalLogWarn(T)}log(T,...L){var Q=xe.apply(this,arguments);df.log?df.log(Q):df.logToConsole&&T.bind(this)(Q)}}var Y=new q,pe=function(z,T,L,Q,ie){(L.headers!==void 0||L.headersProvider!=null)&&Y.warn(`To send headers with the ${Q.toString()} request, you must use AJAX, rather than JSONP.`);var Oe=z.nextAuthCallbackID.toString();z.nextAuthCallbackID++;var Ze=z.getDocument(),st=Ze.createElement("script");z.auth_callbacks[Oe]=function(ar){ie(null,ar)};var _t="Pusher.auth_callbacks['"+Oe+"']";st.src=L.endpoint+"?callback="+encodeURIComponent(_t)+"&"+T;var Yt=Ze.getElementsByTagName("head")[0]||Ze.documentElement;Yt.insertBefore(st,Yt.firstChild)},ge=pe;class De{constructor(T){this.src=T}send(T){var L=this,Q="Error loading "+L.src;L.script=document.createElement("script"),L.script.id=T.id,L.script.src=L.src,L.script.type="text/javascript",L.script.charset="UTF-8",L.script.addEventListener?(L.script.onerror=function(){T.callback(Q)},L.script.onload=function(){T.callback(null)}):L.script.onreadystatechange=function(){(L.script.readyState==="loaded"||L.script.readyState==="complete")&&T.callback(null)},L.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(L.errorScript=document.createElement("script"),L.errorScript.id=T.id+"_error",L.errorScript.text=T.name+"('"+Q+"');",L.script.async=L.errorScript.async=!1):L.script.async=!0;var ie=document.getElementsByTagName("head")[0];ie.insertBefore(L.script,ie.firstChild),L.errorScript&&ie.insertBefore(L.errorScript,L.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Be{constructor(T,L){this.url=T,this.data=L}send(T){if(!this.request){var L=Ee(this.data),Q=this.url+"/"+T.number+"?"+L;this.request=et.createScriptRequest(Q),this.request.send(T)}}cleanup(){this.request&&this.request.cleanup()}}var Pe=function(z,T){return function(L,Q){var ie="http"+(T?"s":"")+"://",Oe=ie+(z.host||z.options.host)+z.options.path,Ze=et.createJSONPRequest(Oe,L),st=et.ScriptReceivers.create(function(_t,Yt){s.remove(st),Ze.cleanup(),Yt&&Yt.host&&(z.host=Yt.host),Q&&Q(_t,Yt)});Ze.send(st)}},Ve={name:"jsonp",getAgent:Pe},ze=Ve;function gt(z,T,L){var Q=z+(T.useTLS?"s":""),ie=T.useTLS?T.hostTLS:T.hostNonTLS;return Q+"://"+ie+L}function St(z,T){var L="/app/"+z,Q="?protocol="+u.PROTOCOL+"&client=js&version="+u.VERSION+(T?"&"+T:"");return L+Q}var at={getInitial:function(z,T){var L=(T.httpPath||"")+St(z,"flash=false");return gt("ws",T,L)}},mr={getInitial:function(z,T){var L=(T.httpPath||"/pusher")+St(z);return gt("http",T,L)}},k={getInitial:function(z,T){return gt("http",T,T.httpPath||"/pusher")},getPath:function(z,T){return St(z)}};class oe{constructor(){this._callbacks={}}get(T){return this._callbacks[Ae(T)]}add(T,L,Q){var ie=Ae(T);this._callbacks[ie]=this._callbacks[ie]||[],this._callbacks[ie].push({fn:L,context:Q})}remove(T,L,Q){if(!T&&!L&&!Q){this._callbacks={};return}var ie=T?[Ae(T)]:we(this._callbacks);L||Q?this.removeCallback(ie,L,Q):this.removeAllCallbacks(ie)}removeCallback(T,L,Q){Ce(T,function(ie){this._callbacks[ie]=J(this._callbacks[ie]||[],function(Oe){return L&&L!==Oe.fn||Q&&Q!==Oe.context}),this._callbacks[ie].length===0&&delete this._callbacks[ie]},this)}removeAllCallbacks(T){Ce(T,function(L){delete this._callbacks[L]},this)}}function Ae(z){return"_"+z}class $e{constructor(T){this.callbacks=new oe,this.global_callbacks=[],this.failThrough=T}bind(T,L,Q){return this.callbacks.add(T,L,Q),this}bind_global(T){return this.global_callbacks.push(T),this}unbind(T,L,Q){return this.callbacks.remove(T,L,Q),this}unbind_global(T){return T?(this.global_callbacks=J(this.global_callbacks||[],L=>L!==T),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(T,L,Q){for(var ie=0;ie0)for(var ie=0;ie{this.onError(L),this.changeState("closed")}),!1}return this.bindListeners(),Y.debug("Connecting",{transport:this.name,url:T}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(T){return this.state==="open"?(Se.defer(()=>{this.socket&&this.socket.send(T)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(T){this.emit("error",{type:"WebSocketError",error:T}),this.timeline.error(this.buildTimelineMessage({error:T.toString()}))}onClose(T){T?this.changeState("closed",{code:T.code,reason:T.reason,wasClean:T.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(T){this.emit("message",T)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=T=>{this.onError(T)},this.socket.onclose=T=>{this.onClose(T)},this.socket.onmessage=T=>{this.onMessage(T)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(T,L){this.state=T,this.timeline.info(this.buildTimelineMessage({state:T,params:L})),this.emit(T,L)}buildTimelineMessage(T){return ce({cid:this.id},T)}}class ht{constructor(T){this.hooks=T}isSupported(T){return this.hooks.isSupported(T)}createConnection(T,L,Q,ie){return new ct(this.hooks,T,L,Q,ie)}}var Dn=new ht({urls:at,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!et.getWebSocketAPI()},isSupported:function(){return!!et.getWebSocketAPI()},getSocket:function(z){return et.createWebSocket(z)}}),Js={urls:mr,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},il=ce({getSocket:function(z){return et.HTTPFactory.createStreamingSocket(z)}},Js),al=ce({getSocket:function(z){return et.HTTPFactory.createPollingSocket(z)}},Js),Jo={isSupported:function(){return et.isXHRSupported()}},Uc=new ht(ce({},il,Jo)),qc=new ht(ce({},al,Jo)),Hc={ws:Dn,xhr_streaming:Uc,xhr_polling:qc},Pa=Hc,Wc=new ht({file:"sockjs",urls:k,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(z,T){return new window.SockJS(z,null,{js_path:f.getPath("sockjs",{useTLS:T.useTLS}),ignore_null_origin:T.ignoreNullOrigin})},beforeOpen:function(z,T){z.send(JSON.stringify({path:T}))}}),Qs={isSupported:function(z){var T=et.isXDRSupported(z.useTLS);return T}},Vc=new ht(ce({},il,Qs)),Yc=new ht(ce({},al,Qs));Pa.xdr_streaming=Vc,Pa.xdr_polling=Yc,Pa.sockjs=Wc;var jc=Pa;class Gc extends $e{constructor(){super();var T=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){T.emit("online")},!1),window.addEventListener("offline",function(){T.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Xc=new Gc;class Zc{constructor(T,L,Q){this.manager=T,this.transport=L,this.minPingDelay=Q.minPingDelay,this.maxPingDelay=Q.maxPingDelay,this.pingDelay=void 0}createConnection(T,L,Q,ie){ie=ce({},ie,{activityTimeout:this.pingDelay});var Oe=this.transport.createConnection(T,L,Q,ie),Ze=null,st=function(){Oe.unbind("open",st),Oe.bind("closed",_t),Ze=Se.now()},_t=Yt=>{if(Oe.unbind("closed",_t),Yt.code===1002||Yt.code===1003)this.manager.reportDeath();else if(!Yt.wasClean&&Ze){var ar=Se.now()-Ze;ar<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ar/2,this.minPingDelay))}};return Oe.bind("open",st),Oe}isSupported(T){return this.manager.isAlive()&&this.transport.isSupported(T)}}const sl={decodeMessage:function(z){try{var T=JSON.parse(z.data),L=T.data;if(typeof L=="string")try{L=JSON.parse(T.data)}catch{}var Q={event:T.event,channel:T.channel,data:L};return T.user_id&&(Q.user_id=T.user_id),Q}catch(ie){throw{type:"MessageParseError",error:ie,data:z.data}}},encodeMessage:function(z){return JSON.stringify(z)},processHandshake:function(z){var T=sl.decodeMessage(z);if(T.event==="pusher:connection_established"){if(!T.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:T.data.socket_id,activityTimeout:T.data.activity_timeout*1e3}}else{if(T.event==="pusher:error")return{action:this.getCloseAction(T.data),error:this.getCloseError(T.data)};throw"Invalid handshake"}},getCloseAction:function(z){return z.code<4e3?z.code>=1002&&z.code<=1004?"backoff":null:z.code===4e3?"tls_only":z.code<4100?"refused":z.code<4200?"backoff":z.code<4300?"retry":"refused"},getCloseError:function(z){return z.code!==1e3&&z.code!==1001?{type:"PusherError",data:{code:z.code,message:z.reason||z.message}}:null}};var fa=sl;class ol extends $e{constructor(T,L){super(),this.id=T,this.transport=L,this.activityTimeout=L.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(T){return this.transport.send(T)}send_event(T,L,Q){var ie={event:T,data:L};return Q&&(ie.channel=Q),Y.debug("Event sent",ie),this.send(fa.encodeMessage(ie))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var T={message:Q=>{var ie;try{ie=fa.decodeMessage(Q)}catch(Oe){this.emit("error",{type:"MessageParseError",error:Oe,data:Q.data})}if(ie!==void 0){switch(Y.debug("Event recd",ie),ie.event){case"pusher:error":this.emit("error",{type:"PusherError",data:ie.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",ie)}},activity:()=>{this.emit("activity")},error:Q=>{this.emit("error",Q)},closed:Q=>{L(),Q&&Q.code&&this.handleCloseEvent(Q),this.transport=null,this.emit("closed")}},L=()=>{me(T,(Q,ie)=>{this.transport.unbind(ie,Q)})};me(T,(Q,ie)=>{this.transport.bind(ie,Q)})}handleCloseEvent(T){var L=fa.getCloseAction(T),Q=fa.getCloseError(T);Q&&this.emit("error",Q),L&&this.emit(L,{action:L,error:Q})}}class Kc{constructor(T,L){this.transport=T,this.callback=L,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=T=>{this.unbindListeners();var L;try{L=fa.processHandshake(T)}catch(Q){this.finish("error",{error:Q}),this.transport.close();return}L.action==="connected"?this.finish("connected",{connection:new ol(L.id,this.transport),activityTimeout:L.activityTimeout}):(this.finish(L.action,{error:L.error}),this.transport.close())},this.onClosed=T=>{this.unbindListeners();var L=fa.getCloseAction(T)||"backoff",Q=fa.getCloseError(T);this.finish(L,{error:Q})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(T,L){this.callback(ce({transport:this.transport,action:T},L))}}class Jc{constructor(T,L){this.timeline=T,this.options=L||{}}send(T,L){this.timeline.isEmpty()||this.timeline.send(et.TimelineTransport.getAgent(this,T),L)}}class Qo extends $e{constructor(T,L){super(function(Q,ie){Y.debug("No callbacks on "+T+" for "+Q)}),this.name=T,this.pusher=L,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(T,L){return L(null,{auth:""})}trigger(T,L){if(T.indexOf("client-")!==0)throw new b("Event '"+T+"' does not start with 'client-'");if(!this.subscribed){var Q=v.buildLogSuffix("triggeringClientEvents");Y.warn(`Client event triggered before channel 'subscription_succeeded' event . ${Q}`)}return this.pusher.send_event(T,L,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(T){var L=T.event,Q=T.data;if(L==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(T);else if(L==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(T);else if(L.indexOf("pusher_internal:")!==0){var ie={};this.emit(L,Q,ie)}}handleSubscriptionSucceededEvent(T){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",T.data)}handleSubscriptionCountEvent(T){T.data.subscription_count&&(this.subscriptionCount=T.data.subscription_count),this.emit("pusher:subscription_count",T.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(T,L)=>{T?(this.subscriptionPending=!1,Y.error(T.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:T.message},T instanceof E?{status:T.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:L.auth,channel_data:L.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class eu extends Qo{authorize(T,L){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:T},L)}}class Qc{constructor(){this.reset()}get(T){return Object.prototype.hasOwnProperty.call(this.members,T)?{id:T,info:this.members[T]}:null}each(T){me(this.members,(L,Q)=>{T(this.get(Q))})}setMyID(T){this.myID=T}onSubscription(T){this.members=T.presence.hash,this.count=T.presence.count,this.me=this.get(this.myID)}addMember(T){return this.get(T.user_id)===null&&this.count++,this.members[T.user_id]=T.user_info,this.get(T.user_id)}removeMember(T){var L=this.get(T.user_id);return L&&(delete this.members[T.user_id],this.count--),L}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var ef=function(z,T,L,Q){function ie(Oe){return Oe instanceof L?Oe:new L(function(Ze){Ze(Oe)})}return new(L||(L=Promise))(function(Oe,Ze){function st(ar){try{Yt(Q.next(ar))}catch($r){Ze($r)}}function _t(ar){try{Yt(Q.throw(ar))}catch($r){Ze($r)}}function Yt(ar){ar.done?Oe(ar.value):ie(ar.value).then(st,_t)}Yt((Q=Q.apply(z,T||[])).next())})};class eo extends eu{constructor(T,L){super(T,L),this.members=new Qc}authorize(T,L){super.authorize(T,(Q,ie)=>ef(this,void 0,void 0,function*(){if(!Q)if(ie=ie,ie.channel_data!=null){var Oe=JSON.parse(ie.channel_data);this.members.setMyID(Oe.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let Ze=v.buildLogSuffix("authorizationEndpoint");Y.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${Ze}, or the user should be signed in.`),L("Invalid auth response");return}L(Q,ie)}))}handleEvent(T){var L=T.event;if(L.indexOf("pusher_internal:")===0)this.handleInternalEvent(T);else{var Q=T.data,ie={};T.user_id&&(ie.user_id=T.user_id),this.emit(L,Q,ie)}}handleInternalEvent(T){var L=T.event,Q=T.data;switch(L){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(T);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(T);break;case"pusher_internal:member_added":var ie=this.members.addMember(Q);this.emit("pusher:member_added",ie);break;case"pusher_internal:member_removed":var Oe=this.members.removeMember(Q);Oe&&this.emit("pusher:member_removed",Oe);break}}handleSubscriptionSucceededEvent(T){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(T.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var as=i(1),Wt=i(0);class bn extends eu{constructor(T,L,Q){super(T,L),this.key=null,this.nacl=Q}authorize(T,L){super.authorize(T,(Q,ie)=>{if(Q){L(Q,ie);return}let Oe=ie.shared_secret;if(!Oe){L(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(Wt.decode)(Oe),delete ie.shared_secret,L(null,ie)})}trigger(T,L){throw new _("Client events are not currently supported for encrypted channels")}handleEvent(T){var L=T.event,Q=T.data;if(L.indexOf("pusher_internal:")===0||L.indexOf("pusher:")===0){super.handleEvent(T);return}this.handleEncryptedEvent(L,Q)}handleEncryptedEvent(T,L){if(!this.key){Y.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!L.ciphertext||!L.nonce){Y.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+L);return}let Q=Object(Wt.decode)(L.ciphertext);if(Q.length{if(Ze){Y.error(`Failed to make a request to the authEndpoint: ${st}. Unable to fetch new key, so dropping encrypted event`);return}if(Oe=this.nacl.secretbox.open(Q,ie,this.key),Oe===null){Y.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(T,this.getDataToEmit(Oe))});return}this.emit(T,this.getDataToEmit(Oe))}getDataToEmit(T){let L=Object(as.decode)(T);try{return JSON.parse(L)}catch{return L}}}class tf extends $e{constructor(T,L){super(),this.state="initialized",this.connection=null,this.key=T,this.options=L,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var Q=et.getNetwork();Q.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),Q.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(T){this.key=T,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(T){return this.connection?this.connection.send(T):!1}send_event(T,L,Q){return this.connection?this.connection.send_event(T,L,Q):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var T=(L,Q)=>{L?this.runner=this.strategy.connect(0,T):Q.action==="error"?(this.emit("error",{type:"HandshakeError",error:Q.error}),this.timeline.error({handshakeError:Q.error})):(this.abortConnecting(),this.handshakeCallbacks[Q.action](Q))};this.runner=this.strategy.connect(0,T)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var T=this.abandonConnection();T.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(T){this.timeline.info({action:"retry",delay:T}),T>0&&this.emit("connecting_in",Math.round(T/1e3)),this.retryTimer=new ne(T||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new ne(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ne(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new ne(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(T){return ce({},T,{message:L=>{this.resetActivityCheck(),this.emit("message",L)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:L=>{this.emit("error",L)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(T){return ce({},T,{connected:L=>{this.activityTimeout=Math.min(this.options.activityTimeout,L.activityTimeout,L.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(L.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let T=L=>Q=>{Q.error&&this.emit("error",{type:"WebSocketError",error:Q.error}),L(Q)};return{tls_only:T(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:T(()=>{this.disconnect()}),backoff:T(()=>{this.retryIn(1e3)}),retry:T(()=>{this.retryIn(0)})}}setConnection(T){this.connection=T;for(var L in this.connectionCallbacks)this.connection.bind(L,this.connectionCallbacks[L]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var T in this.connectionCallbacks)this.connection.unbind(T,this.connectionCallbacks[T]);var L=this.connection;return this.connection=null,L}}updateState(T,L){var Q=this.state;if(this.state=T,Q!==T){var ie=T;ie==="connected"&&(ie+=" with new socket ID "+L.socket_id),Y.debug("State changed",Q+" -> "+ie),this.timeline.info({state:T,params:L}),this.emit("state_change",{previous:Q,current:T}),this.emit(T,L)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class to{constructor(){this.channels={}}add(T,L){return this.channels[T]||(this.channels[T]=Ia(T,L)),this.channels[T]}all(){return Ne(this.channels)}find(T){return this.channels[T]}remove(T){var L=this.channels[T];return delete this.channels[T],L}disconnect(){me(this.channels,function(T){T.disconnect()})}}function Ia(z,T){if(z.indexOf("private-encrypted-")===0){if(T.config.nacl)return ki.createEncryptedChannel(z,T,T.config.nacl);let L="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",Q=v.buildLogSuffix("encryptedChannelSupport");throw new _(`${L}. ${Q}`)}else{if(z.indexOf("private-")===0)return ki.createPrivateChannel(z,T);if(z.indexOf("presence-")===0)return ki.createPresenceChannel(z,T);if(z.indexOf("#")===0)throw new y('Cannot create a channel with name "'+z+'".');return ki.createChannel(z,T)}}var ul={createChannels(){return new to},createConnectionManager(z,T){return new tf(z,T)},createChannel(z,T){return new Qo(z,T)},createPrivateChannel(z,T){return new eu(z,T)},createPresenceChannel(z,T){return new eo(z,T)},createEncryptedChannel(z,T,L){return new bn(z,T,L)},createTimelineSender(z,T){return new Jc(z,T)},createHandshake(z,T){return new Kc(z,T)},createAssistantToTheTransportManager(z,T,L){return new Zc(z,T,L)}},ki=ul;class xd{constructor(T){this.options=T||{},this.livesLeft=this.options.lives||1/0}getAssistant(T){return ki.createAssistantToTheTransportManager(this,T,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class ss{constructor(T,L){this.strategies=T,this.loop=!!L.loop,this.failFast=!!L.failFast,this.timeout=L.timeout,this.timeoutLimit=L.timeoutLimit}isSupported(){return ee(this.strategies,Se.method("isSupported"))}connect(T,L){var Q=this.strategies,ie=0,Oe=this.timeout,Ze=null,st=(_t,Yt)=>{Yt?L(null,Yt):(ie=ie+1,this.loop&&(ie=ie%Q.length),ie0&&(Oe=new ne(Q.timeout,function(){Ze.abort(),ie(!0)})),Ze=T.connect(L,function(st,_t){st&&Oe&&Oe.isRunning()&&!Q.failFast||(Oe&&Oe.ensureAborted(),ie(st,_t))}),{abort:function(){Oe&&Oe.ensureAborted(),Ze.abort()},forceMinPriority:function(st){Ze.forceMinPriority(st)}}}}class rf{constructor(T){this.strategies=T}isSupported(){return ee(this.strategies,Se.method("isSupported"))}connect(T,L){return Xg(this.strategies,T,function(Q,ie){return function(Oe,Ze){if(ie[Q].error=Oe,Oe){wd(ie)&&L(!0);return}Ce(ie,function(st){st.forceMinPriority(Ze.transport.priority)}),L(null,Ze)}})}}function Xg(z,T,L){var Q=He(z,function(ie,Oe,Ze,st){return ie.connect(T,L(Oe,st))});return{abort:function(){Ce(Q,Sd)},forceMinPriority:function(ie){Ce(Q,function(Oe){Oe.forceMinPriority(ie)})}}}function wd(z){return ue(z,function(T){return!!T.error})}function Sd(z){!z.error&&!z.aborted&&(z.abort(),z.aborted=!0)}class _d{constructor(T,L,Q){this.strategy=T,this.transports=L,this.ttl=Q.ttl||1800*1e3,this.usingTLS=Q.useTLS,this.timeline=Q.timeline}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.usingTLS,ie=Zg(Q),Oe=ie&&ie.cacheSkipCount?ie.cacheSkipCount:0,Ze=[this.strategy];if(ie&&ie.timestamp+this.ttl>=Se.now()){var st=this.transports[ie.transport];st&&(["ws","wss"].includes(ie.transport)||Oe>3?(this.timeline.info({cached:!0,transport:ie.transport,latency:ie.latency}),Ze.push(new ss([st],{timeout:ie.latency*2+1e3,failFast:!0}))):Oe++)}var _t=Se.now(),Yt=Ze.pop().connect(T,function ar($r,hl){$r?(ru(Q),Ze.length>0?(_t=Se.now(),Yt=Ze.pop().connect(T,ar)):L($r)):(Ad(Q,hl.transport.name,Se.now()-_t,Oe),L(null,hl))});return{abort:function(){Yt.abort()},forceMinPriority:function(ar){T=ar,Yt&&Yt.forceMinPriority(ar)}}}}function tu(z){return"pusherTransport"+(z?"TLS":"NonTLS")}function Zg(z){var T=et.getLocalStorage();if(T)try{var L=T[tu(z)];if(L)return JSON.parse(L)}catch{ru(z)}return null}function Ad(z,T,L,Q){var ie=et.getLocalStorage();if(ie)try{ie[tu(z)]=R({timestamp:Se.now(),transport:T,latency:L,cacheSkipCount:Q})}catch{}}function ru(z){var T=et.getLocalStorage();if(T)try{delete T[tu(z)]}catch{}}class nu{constructor(T,{delay:L}){this.strategy=T,this.options={delay:L}}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.strategy,ie,Oe=new ne(this.options.delay,function(){ie=Q.connect(T,L)});return{abort:function(){Oe.ensureAborted(),ie&&ie.abort()},forceMinPriority:function(Ze){T=Ze,ie&&ie.forceMinPriority(Ze)}}}}class iu{constructor(T,L,Q){this.test=T,this.trueBranch=L,this.falseBranch=Q}isSupported(){var T=this.test()?this.trueBranch:this.falseBranch;return T.isSupported()}connect(T,L){var Q=this.test()?this.trueBranch:this.falseBranch;return Q.connect(T,L)}}class Dd{constructor(T){this.strategy=T}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.strategy.connect(T,function(ie,Oe){Oe&&Q.abort(),L(ie,Oe)});return Q}}function ro(z){return function(){return z.isSupported()}}var nf=function(z,T,L){var Q={};function ie(Gd,ao,p0,m0,xf){var wf=L(z,Gd,ao,p0,m0,xf);return Q[Gd]=wf,wf}var Oe=Object.assign({},T,{hostNonTLS:z.wsHost+":"+z.wsPort,hostTLS:z.wsHost+":"+z.wssPort,httpPath:z.wsPath}),Ze=Object.assign({},Oe,{useTLS:!0}),st=Object.assign({},T,{hostNonTLS:z.httpHost+":"+z.httpPort,hostTLS:z.httpHost+":"+z.httpsPort,httpPath:z.httpPath}),_t={loop:!0,timeout:15e3,timeoutLimit:6e4},Yt=new xd({minPingDelay:1e4,maxPingDelay:z.activityTimeout}),ar=new xd({lives:2,minPingDelay:1e4,maxPingDelay:z.activityTimeout}),$r=ie("ws","ws",3,Oe,Yt),hl=ie("wss","ws",3,Ze,Yt),mf=ie("sockjs","sockjs",1,st),dl=ie("xhr_streaming","xhr_streaming",1,st,ar),d0=ie("xdr_streaming","xdr_streaming",1,st,ar),vf=ie("xhr_polling","xhr_polling",1,st),Zn=ie("xdr_polling","xdr_polling",1,st),pl=new ss([$r],_t),au=new ss([hl],_t),Vd=new ss([mf],_t),gf=new ss([new iu(ro(dl),dl,d0)],_t),Yd=new ss([new iu(ro(vf),vf,Zn)],_t),jd=new ss([new iu(ro(gf),new rf([gf,new nu(Yd,{delay:4e3})]),Yd)],_t),yf=new iu(ro(jd),jd,Vd),bf;return T.useTLS?bf=new rf([pl,new nu(yf,{delay:2e3})]):bf=new rf([pl,new nu(au,{delay:2e3}),new nu(yf,{delay:5e3})]),new _d(new Dd(new iu(ro($r),bf,yf)),Q,{ttl:18e5,timeline:T.timeline,useTLS:T.useTLS})},Kg=nf,Nd=function(){var z=this;z.timeline.info(z.buildTimelineMessage({transport:z.name+(z.options.useTLS?"s":"")})),z.hooks.isInitialized()?z.changeState("initialized"):z.hooks.file?(z.changeState("initializing"),f.load(z.hooks.file,{useTLS:z.options.useTLS},function(T,L){z.hooks.isInitialized()?(z.changeState("initialized"),L(!0)):(T&&z.onError(T),z.onClose(),L(!1))})):z.onClose()},af={getRequest:function(z){var T=new window.XDomainRequest;return T.ontimeout=function(){z.emit("error",new S),z.close()},T.onerror=function(L){z.emit("error",L),z.close()},T.onprogress=function(){T.responseText&&T.responseText.length>0&&z.onChunk(200,T.responseText)},T.onload=function(){T.responseText&&T.responseText.length>0&&z.onChunk(200,T.responseText),z.emit("finished",200),z.close()},T},abortRequest:function(z){z.ontimeout=z.onerror=z.onprogress=z.onload=null,z.abort()}},sf=af;const no=256*1024;class Ed extends $e{constructor(T,L,Q){super(),this.hooks=T,this.method=L,this.url=Q}start(T){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},et.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(T)}close(){this.unloader&&(et.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(T,L){for(;;){var Q=this.advanceBuffer(L);if(Q)this.emit("chunk",{status:T,data:Q});else break}this.isBufferTooLong(L)&&this.emit("buffer_too_long")}advanceBuffer(T){var L=T.slice(this.position),Q=L.indexOf(` -`);return Q!==-1?(this.position+=Q+1,L.slice(0,Q)):null}isBufferTooLong(T){return this.position===T.length&&T.length>no}}var ll;(function(z){z[z.CONNECTING=0]="CONNECTING",z[z.OPEN=1]="OPEN",z[z.CLOSED=3]="CLOSED"})(ll||(ll={}));var os=ll,Cd=1;class Md{constructor(T,L){this.hooks=T,this.session=Rd(1e3)+"/"+Bd(8),this.location=Td(L),this.readyState=os.CONNECTING,this.openStream()}send(T){return this.sendRaw(JSON.stringify([T]))}ping(){this.hooks.sendHeartbeat(this)}close(T,L){this.onClose(T,L,!0)}sendRaw(T){if(this.readyState===os.OPEN)try{return et.createSocketRequest("POST",Fd(Od(this.location,this.session))).start(T),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(T,L,Q){this.closeStream(),this.readyState=os.CLOSED,this.onclose&&this.onclose({code:T,reason:L,wasClean:Q})}onChunk(T){if(T.status===200){this.readyState===os.OPEN&&this.onActivity();var L,Q=T.data.slice(0,1);switch(Q){case"o":L=JSON.parse(T.data.slice(1)||"{}"),this.onOpen(L);break;case"a":L=JSON.parse(T.data.slice(1)||"[]");for(var ie=0;ie{this.onChunk(T)}),this.stream.bind("finished",T=>{this.hooks.onFinished(this,T)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(T){Se.defer(()=>{this.onError(T),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Td(z){var T=/([^\?]*)\/*(\??.*)/.exec(z);return{base:T[1],queryString:T[2]}}function Od(z,T){return z.base+"/"+T+"/xhr_send"}function Fd(z){var T=z.indexOf("?")===-1?"?":"&";return z+T+"t="+ +new Date+"&n="+Cd++}function Jg(z,T){var L=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(z);return L[1]+T+L[3]}function Rd(z){return et.randomInt(z)}function Bd(z){for(var T=[],L=0;L0&&z.onChunk(L.status,L.responseText);break;case 4:L.responseText&&L.responseText.length>0&&z.onChunk(L.status,L.responseText),z.emit("finished",L.status),z.close();break}},L},abortRequest:function(z){z.onreadystatechange=null,z.abort()}},i0=n0,a0={createStreamingSocket(z){return this.createSocket(t0,z)},createPollingSocket(z){return this.createSocket(of,z)},createSocket(z,T){return new Qg(z,T)},createXHR(z,T){return this.createRequest(i0,z,T)},createRequest(z,T,L){return new Ed(z,T,L)}},Pd=a0;Pd.createXDR=function(z,T){return this.createRequest(sf,z,T)};var s0=Pd,Ar={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:c,getDefaultStrategy:Kg,Transports:jc,transportConnectionInitializer:Nd,HTTPFactory:s0,TimelineTransport:ze,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(z){window.Pusher=z;var T=()=>{this.onDocumentBody(z.ready)};window.JSON?T():f.load("json2",{},T)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:M,jsonp:ge}},onDocumentBody(z){document.body?z():setTimeout(()=>{this.onDocumentBody(z)},0)},createJSONPRequest(z,T){return new Be(z,T)},createScriptRequest(z){return new De(z)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var z=this.getXHRAPI();return new z},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Xc},createWebSocket(z){var T=this.getWebSocketAPI();return new T(z)},createSocketRequest(z,T){if(this.isXHRSupported())return this.HTTPFactory.createXHR(z,T);if(this.isXDRSupported(T.indexOf("https:")===0))return this.HTTPFactory.createXDR(z,T);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var z=this.getXHRAPI();return!!z&&new z().withCredentials!==void 0},isXDRSupported(z){var T=z?"https:":"http:",L=this.getProtocol();return!!window.XDomainRequest&&L===T},addUnloadListener(z){window.addEventListener!==void 0?window.addEventListener("unload",z,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",z)},removeUnloadListener(z){window.addEventListener!==void 0?window.removeEventListener("unload",z,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",z)},randomInt(z){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*z)}},et=Ar,uf;(function(z){z[z.ERROR=3]="ERROR",z[z.INFO=6]="INFO",z[z.DEBUG=7]="DEBUG"})(uf||(uf={}));var cl=uf;class o0{constructor(T,L,Q){this.key=T,this.session=L,this.events=[],this.options=Q||{},this.sent=0,this.uniqueID=0}log(T,L){T<=this.options.level&&(this.events.push(ce({},L,{timestamp:Se.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(T){this.log(cl.ERROR,T)}info(T){this.log(cl.INFO,T)}debug(T){this.log(cl.DEBUG,T)}isEmpty(){return this.events.length===0}send(T,L){var Q=ce({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],T(Q,(ie,Oe)=>{ie||this.sent++,L&&L(ie,Oe)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class u0{constructor(T,L,Q,ie){this.name=T,this.priority=L,this.transport=Q,this.options=ie||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(T,L){if(this.isSupported()){if(this.priority{Q||(ar(),Oe?Oe.close():ie.close())},forceMinPriority:$r=>{Q||this.priority<$r&&(Oe?Oe.close():ie.close())}}}}function Id(z,T){return Se.defer(function(){T(z)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:l0}=et;var kd=function(z,T,L,Q,ie,Oe){var Ze=l0[L];if(!Ze)throw new w(L);var st=(!z.enabledTransports||_e(z.enabledTransports,T)!==-1)&&(!z.disabledTransports||_e(z.disabledTransports,T)===-1),_t;return st?(ie=Object.assign({ignoreNullOrigin:z.ignoreNullOrigin},ie),_t=new u0(T,Q,Oe?Oe.getAssistant(Ze):Ze,ie)):_t=c0,_t},c0={isSupported:function(){return!1},connect:function(z,T){var L=Se.defer(function(){T(new C)});return{abort:function(){L.ensureAborted()},forceMinPriority:function(){}}}};function on(z){if(z==null)throw"You must pass an options object";if(z.cluster==null)throw"Options object must provide a cluster";"disableStats"in z&&Y.warn("The disableStats option is deprecated in favor of enableStats")}const lf=(z,T)=>{var L="socket_id="+encodeURIComponent(z.socketId);for(var Q in T.params)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(T.params[Q]);if(T.paramsProvider!=null){let ie=T.paramsProvider();for(var Q in ie)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(ie[Q])}return L};var Ld=z=>{if(typeof et.getAuthorizers()[z.transport]>"u")throw`'${z.transport}' is not a recognized auth transport`;return(T,L)=>{const Q=lf(T,z);et.getAuthorizers()[z.transport](et,Q,z,m.UserAuthentication,L)}};const cf=(z,T)=>{var L="socket_id="+encodeURIComponent(z.socketId);L+="&channel_name="+encodeURIComponent(z.channelName);for(var Q in T.params)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(T.params[Q]);if(T.paramsProvider!=null){let ie=T.paramsProvider();for(var Q in ie)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(ie[Q])}return L};var $d=z=>{if(typeof et.getAuthorizers()[z.transport]>"u")throw`'${z.transport}' is not a recognized auth transport`;return(T,L)=>{const Q=cf(T,z);et.getAuthorizers()[z.transport](et,Q,z,m.ChannelAuthorization,L)}};const zd=(z,T,L)=>{const Q={authTransport:T.transport,authEndpoint:T.endpoint,auth:{params:T.params,headers:T.headers}};return(ie,Oe)=>{const Ze=z.channel(ie.channelName);L(Ze,Q).authorize(ie.socketId,Oe)}};function ff(z,T){let L={activityTimeout:z.activityTimeout||u.activityTimeout,cluster:z.cluster,httpPath:z.httpPath||u.httpPath,httpPort:z.httpPort||u.httpPort,httpsPort:z.httpsPort||u.httpsPort,pongTimeout:z.pongTimeout||u.pongTimeout,statsHost:z.statsHost||u.stats_host,unavailableTimeout:z.unavailableTimeout||u.unavailableTimeout,wsPath:z.wsPath||u.wsPath,wsPort:z.wsPort||u.wsPort,wssPort:z.wssPort||u.wssPort,enableStats:f0(z),httpHost:Ud(z),useTLS:Gn(z),wsHost:qd(z),userAuthenticator:h0(z),channelAuthorizer:ka(z,T)};return"disabledTransports"in z&&(L.disabledTransports=z.disabledTransports),"enabledTransports"in z&&(L.enabledTransports=z.enabledTransports),"ignoreNullOrigin"in z&&(L.ignoreNullOrigin=z.ignoreNullOrigin),"timelineParams"in z&&(L.timelineParams=z.timelineParams),"nacl"in z&&(L.nacl=z.nacl),L}function Ud(z){return z.httpHost?z.httpHost:z.cluster?`sockjs-${z.cluster}.pusher.com`:u.httpHost}function qd(z){return z.wsHost?z.wsHost:Hd(z.cluster)}function Hd(z){return`ws-${z}.pusher.com`}function Gn(z){return et.getProtocol()==="https:"?!0:z.forceTLS!==!1}function f0(z){return"enableStats"in z?z.enableStats:"disableStats"in z?!z.disableStats:!1}const Xn=z=>"customHandler"in z&&z.customHandler!=null;function h0(z){const T=Object.assign(Object.assign({},u.userAuthentication),z.userAuthentication);return Xn(T)?T.customHandler:Ld(T)}function Wd(z,T){let L;if("channelAuthorization"in z)L=Object.assign(Object.assign({},u.channelAuthorization),z.channelAuthorization);else if(L={transport:z.authTransport||u.authTransport,endpoint:z.authEndpoint||u.authEndpoint},"auth"in z&&("params"in z.auth&&(L.params=z.auth.params),"headers"in z.auth&&(L.headers=z.auth.headers)),"authorizer"in z)return{customHandler:zd(T,L,z.authorizer)};return L}function ka(z,T){const L=Wd(z,T);return Xn(L)?L.customHandler:$d(L)}class fl extends $e{constructor(T){super(function(L,Q){Y.debug(`No callbacks on watchlist events for ${L}`)}),this.pusher=T,this.bindWatchlistInternalEvent()}handleEvent(T){T.data.events.forEach(L=>{this.emit(L.name,L)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",T=>{var L=T.event;L==="pusher_internal:watchlist_events"&&this.handleEvent(T)})}}function hf(){let z,T;return{promise:new Promise((Q,ie)=>{z=Q,T=ie}),resolve:z,reject:T}}var Er=hf;class La extends $e{constructor(T){super(function(L,Q){Y.debug("No callbacks on user for "+L)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(L,Q)=>{if(L){Y.warn(`Error during signin: ${L}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:Q.auth,user_data:Q.user_data})},this.pusher=T,this.pusher.connection.bind("state_change",({previous:L,current:Q})=>{L!=="connected"&&Q==="connected"&&this._signin(),L==="connected"&&Q!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new fl(T),this.pusher.connection.bind("message",L=>{var Q=L.event;Q==="pusher:signin_success"&&this._onSigninSuccess(L.data),this.serverToUserChannel&&this.serverToUserChannel.name===L.channel&&this.serverToUserChannel.handleEvent(L)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(T){try{this.user_data=JSON.parse(T.user_data)}catch{Y.error(`Failed parsing user data after signin: ${T.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){Y.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const T=L=>{L.subscriptionPending&&L.subscriptionCancelled?L.reinstateSubscription():!L.subscriptionPending&&this.pusher.connection.state==="connected"&&L.subscribe()};this.serverToUserChannel=new Qo(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((L,Q)=>{L.indexOf("pusher_internal:")===0||L.indexOf("pusher:")===0||this.emit(L,Q)}),T(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:T,resolve:L,reject:Q}=Er();T.done=!1;const ie=()=>{T.done=!0};T.then(ie).catch(ie),this.signinDonePromise=T,this._signinDoneResolve=L}}class Zr{static ready(){Zr.isReady=!0;for(var T=0,L=Zr.instances.length;Tet.getDefaultStrategy(this.config,ie,kd);this.connection=ki.createConnectionManager(this.key,{getStrategy:Q,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",ie=>{var Oe=ie.event,Ze=Oe.indexOf("pusher_internal:")===0;if(ie.channel){var st=this.channel(ie.channel);st&&st.handleEvent(ie)}Ze||this.global_emitter.emit(ie.event,ie.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",ie=>{Y.warn(ie)}),Zr.instances.push(this),this.timeline.info({instances:Zr.instances.length}),this.user=new La(this),Zr.isReady&&this.connect()}switchCluster(T){const{appKey:L,cluster:Q}=T;this.key=L,this.options=Object.assign(Object.assign({},this.options),{cluster:Q}),this.config=ff(this.options,this),this.connection.switchCluster(this.key)}channel(T){return this.channels.find(T)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var T=this.connection.isUsingTLS(),L=this.timelineSender;this.timelineSenderTimer=new X(6e4,function(){L.send(T)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(T,L,Q){return this.global_emitter.bind(T,L,Q),this}unbind(T,L,Q){return this.global_emitter.unbind(T,L,Q),this}bind_global(T){return this.global_emitter.bind_global(T),this}unbind_global(T){return this.global_emitter.unbind_global(T),this}unbind_all(T){return this.global_emitter.unbind_all(),this}subscribeAll(){var T;for(T in this.channels.channels)this.channels.channels.hasOwnProperty(T)&&this.subscribe(T)}subscribe(T){var L=this.channels.add(T,this);return L.subscriptionPending&&L.subscriptionCancelled?L.reinstateSubscription():!L.subscriptionPending&&this.connection.state==="connected"&&L.subscribe(),L}unsubscribe(T){var L=this.channels.find(T);L&&L.subscriptionPending?L.cancelSubscription():(L=this.channels.remove(T),L&&L.subscribed&&L.unsubscribe())}send_event(T,L,Q){return this.connection.send_event(T,L,Q)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Zr.instances=[],Zr.isReady=!1,Zr.logToConsole=!1,Zr.Runtime=et,Zr.ScriptReceivers=et.ScriptReceivers,Zr.DependenciesReceivers=et.DependenciesReceivers,Zr.auth_callbacks=et.auth_callbacks;var df=n.default=Zr;function pf(z){if(z==null)throw"You must pass your app key when you instantiate Pusher."}et.setup(Zr)}])})})(uT);var $9=uT.exports;const z9=zu($9);function lT(t,e){return function(){return t.apply(e,arguments)}}const{toString:U9}=Object.prototype,{getPrototypeOf:d1}=Object,Hv=(t=>e=>{const r=U9.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xa=t=>(t=t.toLowerCase(),e=>Hv(e)===t),Wv=t=>e=>typeof e===t,{isArray:wc}=Array,gh=Wv("undefined");function q9(t){return t!==null&&!gh(t)&&t.constructor!==null&&!gh(t.constructor)&&ea(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const cT=Xa("ArrayBuffer");function H9(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&cT(t.buffer),e}const W9=Wv("string"),ea=Wv("function"),fT=Wv("number"),Vv=t=>t!==null&&typeof t=="object",V9=t=>t===!0||t===!1,bm=t=>{if(Hv(t)!=="object")return!1;const e=d1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Y9=Xa("Date"),j9=Xa("File"),G9=Xa("Blob"),X9=Xa("FileList"),Z9=t=>Vv(t)&&ea(t.pipe),K9=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ea(t.append)&&((e=Hv(t))==="formdata"||e==="object"&&ea(t.toString)&&t.toString()==="[object FormData]"))},J9=Xa("URLSearchParams"),Q9=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vh(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),wc(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}const dT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pT=t=>!gh(t)&&t!==dT;function Qy(){const{caseless:t}=pT(this)&&this||{},e={},r=(n,i)=>{const a=t&&hT(e,i)||i;bm(e[a])&&bm(n)?e[a]=Qy(e[a],n):bm(n)?e[a]=Qy({},n):wc(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n(Vh(e,(i,a)=>{r&&ea(i)?t[a]=lT(i,r):t[a]=i},{allOwnKeys:n}),t),t7=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),r7=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},n7=(t,e,r,n)=>{let i,a,s;const o={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],(!n||n(s,t,e))&&!o[s]&&(e[s]=t[s],o[s]=!0);t=r!==!1&&d1(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},i7=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},a7=t=>{if(!t)return null;if(wc(t))return t;let e=t.length;if(!fT(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},s7=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&d1(Uint8Array)),o7=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const a=i.value;e.call(t,a[0],a[1])}},u7=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},l7=Xa("HTMLFormElement"),c7=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),F_=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),f7=Xa("RegExp"),mT=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Vh(r,(i,a)=>{let s;(s=e(i,a,t))!==!1&&(n[a]=s||i)}),Object.defineProperties(t,n)},h7=t=>{mT(t,(e,r)=>{if(ea(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(ea(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},d7=(t,e)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return wc(t)?n(t):n(String(t).split(e)),r},p7=()=>{},m7=(t,e)=>(t=+t,Number.isFinite(t)?t:e),fy="abcdefghijklmnopqrstuvwxyz",R_="0123456789",vT={DIGIT:R_,ALPHA:fy,ALPHA_DIGIT:fy+fy.toUpperCase()+R_},v7=(t=16,e=vT.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function g7(t){return!!(t&&ea(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const y7=t=>{const e=new Array(10),r=(n,i)=>{if(Vv(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const a=wc(n)?[]:{};return Vh(n,(s,o)=>{const u=r(s,i+1);!gh(u)&&(a[o]=u)}),e[i]=void 0,a}}return n};return r(t,0)},b7=Xa("AsyncFunction"),x7=t=>t&&(Vv(t)||ea(t))&&ea(t.then)&&ea(t.catch),Le={isArray:wc,isArrayBuffer:cT,isBuffer:q9,isFormData:K9,isArrayBufferView:H9,isString:W9,isNumber:fT,isBoolean:V9,isObject:Vv,isPlainObject:bm,isUndefined:gh,isDate:Y9,isFile:j9,isBlob:G9,isRegExp:f7,isFunction:ea,isStream:Z9,isURLSearchParams:J9,isTypedArray:s7,isFileList:X9,forEach:Vh,merge:Qy,extend:e7,trim:Q9,stripBOM:t7,inherits:r7,toFlatObject:n7,kindOf:Hv,kindOfTest:Xa,endsWith:i7,toArray:a7,forEachEntry:o7,matchAll:u7,isHTMLForm:l7,hasOwnProperty:F_,hasOwnProp:F_,reduceDescriptors:mT,freezeMethods:h7,toObjectSet:d7,toCamelCase:c7,noop:p7,toFiniteNumber:m7,findKey:hT,global:dT,isContextDefined:pT,ALPHABET:vT,generateString:v7,isSpecCompliantForm:g7,toJSONObject:y7,isAsyncFn:b7,isThenable:x7};function nr(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Le.inherits(nr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Le.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const gT=nr.prototype,yT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{yT[t]={value:t}});Object.defineProperties(nr,yT);Object.defineProperty(gT,"isAxiosError",{value:!0});nr.from=(t,e,r,n,i,a)=>{const s=Object.create(gT);return Le.toFlatObject(t,s,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),nr.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,a&&Object.assign(s,a),s};const w7=null;function eb(t){return Le.isPlainObject(t)||Le.isArray(t)}function bT(t){return Le.endsWith(t,"[]")?t.slice(0,-2):t}function B_(t,e,r){return t?t.concat(e).map(function(i,a){return i=bT(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function S7(t){return Le.isArray(t)&&!t.some(eb)}const _7=Le.toFlatObject(Le,{},null,function(e){return/^is[A-Z]/.test(e)});function Yv(t,e,r){if(!Le.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Le.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,b){return!Le.isUndefined(b[m])});const n=r.metaTokens,i=r.visitor||c,a=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Le.isSpecCompliantForm(e);if(!Le.isFunction(i))throw new TypeError("visitor must be a function");function l(v){if(v===null)return"";if(Le.isDate(v))return v.toISOString();if(!u&&Le.isBlob(v))throw new nr("Blob is not supported. Use a Buffer instead.");return Le.isArrayBuffer(v)||Le.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function c(v,m,b){let y=v;if(v&&!b&&typeof v=="object"){if(Le.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(Le.isArray(v)&&S7(v)||(Le.isFileList(v)||Le.endsWith(m,"[]"))&&(y=Le.toArray(v)))return m=bT(m),y.forEach(function(x,A){!(Le.isUndefined(x)||x===null)&&e.append(s===!0?B_([m],A,a):s===null?m:m+"[]",l(x))}),!1}return eb(v)?!0:(e.append(B_(b,m,a),l(v)),!1)}const f=[],h=Object.assign(_7,{defaultVisitor:c,convertValue:l,isVisitable:eb});function p(v,m){if(!Le.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(v),Le.forEach(v,function(y,S){(!(Le.isUndefined(y)||y===null)&&i.call(e,y,Le.isString(S)?S.trim():S,m,h))===!0&&p(y,m?m.concat(S):[S])}),f.pop()}}if(!Le.isObject(t))throw new TypeError("data must be an object");return p(t),e}function P_(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function p1(t,e){this._pairs=[],t&&Yv(t,this,e)}const xT=p1.prototype;xT.append=function(e,r){this._pairs.push([e,r])};xT.toString=function(e){const r=e?function(n){return e.call(this,n,P_)}:P_;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function A7(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wT(t,e,r){if(!e)return t;const n=r&&r.encode||A7,i=r&&r.serialize;let a;if(i?a=i(e,r):a=Le.isURLSearchParams(e)?e.toString():new p1(e,r).toString(n),a){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class I_{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Le.forEach(this.handlers,function(n){n!==null&&e(n)})}}const ST={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},D7=typeof URLSearchParams<"u"?URLSearchParams:p1,N7=typeof FormData<"u"?FormData:null,E7=typeof Blob<"u"?Blob:null,C7={isBrowser:!0,classes:{URLSearchParams:D7,FormData:N7,Blob:E7},protocols:["http","https","file","blob","url","data"]},_T=typeof window<"u"&&typeof document<"u",M7=(t=>_T&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),T7=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",O7=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_T,hasStandardBrowserEnv:M7,hasStandardBrowserWebWorkerEnv:T7},Symbol.toStringTag,{value:"Module"})),Va={...O7,...C7};function F7(t,e){return Yv(t,new Va.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Va.isNode&&Le.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function R7(t){return Le.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function B7(t){const e={},r=Object.keys(t);let n;const i=r.length;let a;for(n=0;n=r.length;return s=!s&&Le.isArray(i)?i.length:s,u?(Le.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!o):((!i[s]||!Le.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],a)&&Le.isArray(i[s])&&(i[s]=B7(i[s])),!o)}if(Le.isFormData(t)&&Le.isFunction(t.entries)){const r={};return Le.forEachEntry(t,(n,i)=>{e(R7(n),i,r,0)}),r}return null}function P7(t,e,r){if(Le.isString(t))try{return(e||JSON.parse)(t),Le.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const m1={transitional:ST,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Le.isObject(e);if(a&&Le.isHTMLForm(e)&&(e=new FormData(e)),Le.isFormData(e))return i?JSON.stringify(AT(e)):e;if(Le.isArrayBuffer(e)||Le.isBuffer(e)||Le.isStream(e)||Le.isFile(e)||Le.isBlob(e))return e;if(Le.isArrayBufferView(e))return e.buffer;if(Le.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return F7(e,this.formSerializer).toString();if((o=Le.isFileList(e))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yv(o?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),P7(e)):e}],transformResponse:[function(e){const r=this.transitional||m1.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Le.isString(e)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(o){if(s)throw o.name==="SyntaxError"?nr.from(o,nr.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Va.classes.FormData,Blob:Va.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Le.forEach(["delete","get","head","post","put","patch"],t=>{m1.headers[t]={}});const v1=m1,I7=Le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),k7=t=>{const e={};let r,n,i;return t&&t.split(` -`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&I7[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},k_=Symbol("internals");function If(t){return t&&String(t).trim().toLowerCase()}function xm(t){return t===!1||t==null?t:Le.isArray(t)?t.map(xm):String(t)}function L7(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const $7=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function hy(t,e,r,n,i){if(Le.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!Le.isString(e)){if(Le.isString(n))return e.indexOf(n)!==-1;if(Le.isRegExp(n))return n.test(e)}}function z7(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function U7(t,e){const r=Le.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,s){return this[n].call(this,e,i,a,s)},configurable:!0})})}class jv{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function a(o,u,l){const c=If(u);if(!c)throw new Error("header name must be a non-empty string");const f=Le.findKey(i,c);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||u]=xm(o))}const s=(o,u)=>Le.forEach(o,(l,c)=>a(l,c,u));return Le.isPlainObject(e)||e instanceof this.constructor?s(e,r):Le.isString(e)&&(e=e.trim())&&!$7(e)?s(k7(e),r):e!=null&&a(r,e,n),this}get(e,r){if(e=If(e),e){const n=Le.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return L7(i);if(Le.isFunction(r))return r.call(this,i,n);if(Le.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=If(e),e){const n=Le.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||hy(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function a(s){if(s=If(s),s){const o=Le.findKey(n,s);o&&(!r||hy(n,n[o],o,r))&&(delete n[o],i=!0)}}return Le.isArray(e)?e.forEach(a):a(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!e||hy(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const r=this,n={};return Le.forEach(this,(i,a)=>{const s=Le.findKey(n,a);if(s){r[s]=xm(i),delete r[a];return}const o=e?z7(a):String(a).trim();o!==a&&delete r[a],r[o]=xm(i),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return Le.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&Le.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[k_]=this[k_]={accessors:{}}).accessors,i=this.prototype;function a(s){const o=If(s);n[o]||(U7(i,s),n[o]=!0)}return Le.isArray(e)?e.forEach(a):a(e),this}}jv.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Le.reduceDescriptors(jv.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});Le.freezeMethods(jv);const Is=jv;function dy(t,e){const r=this||v1,n=e||r,i=Is.from(n.headers);let a=n.data;return Le.forEach(t,function(o){a=o.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function DT(t){return!!(t&&t.__CANCEL__)}function Yh(t,e,r){nr.call(this,t??"canceled",nr.ERR_CANCELED,e,r),this.name="CanceledError"}Le.inherits(Yh,nr,{__CANCEL__:!0});function q7(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new nr("Request failed with status code "+r.status,[nr.ERR_BAD_REQUEST,nr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const H7=Va.hasStandardBrowserEnv?{write(t,e,r,n,i,a){const s=[t+"="+encodeURIComponent(e)];Le.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Le.isString(n)&&s.push("path="+n),Le.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function W7(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function V7(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function NT(t,e){return t&&!W7(e)?V7(t,e):e}const Y7=Va.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(a){let s=a;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(s){const o=Le.isString(s)?i(s):s;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function j7(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function G7(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,a=0,s;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),c=n[a];s||(s=l),r[i]=u,n[i]=l;let f=a,h=0;for(;f!==i;)h+=r[f++],f=f%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),l-s{const a=i.loaded,s=i.lengthComputable?i.total:void 0,o=a-r,u=n(o),l=a<=s;r=a;const c={loaded:a,total:s,progress:s?a/s:void 0,bytes:o,rate:u||void 0,estimated:u&&s&&l?(s-a)/u:void 0,event:i};c[e?"download":"upload"]=!0,t(c)}}const X7=typeof XMLHttpRequest<"u",Z7=X7&&function(t){return new Promise(function(r,n){let i=t.data;const a=Is.from(t.headers).normalize();let{responseType:s,withXSRFToken:o}=t,u;function l(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}let c;if(Le.isFormData(i)){if(Va.hasStandardBrowserEnv||Va.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((c=a.getContentType())!==!1){const[m,...b]=c?c.split(";").map(y=>y.trim()).filter(Boolean):[];a.setContentType([m||"multipart/form-data",...b].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",b=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(m+":"+b))}const h=NT(t.baseURL,t.url);f.open(t.method.toUpperCase(),wT(h,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function p(){if(!f)return;const m=Is.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:m,config:t,request:f};q7(function(x){r(x),l()},function(x){n(x),l()},y),f=null}if("onloadend"in f?f.onloadend=p:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(p)},f.onabort=function(){f&&(n(new nr("Request aborted",nr.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new nr("Network Error",nr.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let b=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||ST;t.timeoutErrorMessage&&(b=t.timeoutErrorMessage),n(new nr(b,y.clarifyTimeoutError?nr.ETIMEDOUT:nr.ECONNABORTED,t,f)),f=null},Va.hasStandardBrowserEnv&&(o&&Le.isFunction(o)&&(o=o(t)),o||o!==!1&&Y7(h))){const m=t.xsrfHeaderName&&t.xsrfCookieName&&H7.read(t.xsrfCookieName);m&&a.set(t.xsrfHeaderName,m)}i===void 0&&a.setContentType(null),"setRequestHeader"in f&&Le.forEach(a.toJSON(),function(b,y){f.setRequestHeader(y,b)}),Le.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",L_(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",L_(t.onUploadProgress)),(t.cancelToken||t.signal)&&(u=m=>{f&&(n(!m||m.type?new Yh(null,t,f):m),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u)));const v=j7(h);if(v&&Va.protocols.indexOf(v)===-1){n(new nr("Unsupported protocol "+v+":",nr.ERR_BAD_REQUEST,t));return}f.send(i||null)})},tb={http:w7,xhr:Z7};Le.forEach(tb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const $_=t=>`- ${t}`,K7=t=>Le.isFunction(t)||t===null||t===!1,ET={getAdapter:t=>{t=Le.isArray(t)?t:[t];const{length:e}=t;let r,n;const i={};for(let a=0;a`adapter ${o} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=e?a.length>1?`since : -`+a.map($_).join(` -`):" "+$_(a[0]):"as no adapter specified";throw new nr("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:tb};function py(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yh(null,t)}function z_(t){return py(t),t.headers=Is.from(t.headers),t.data=dy.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ET.getAdapter(t.adapter||v1.adapter)(t).then(function(n){return py(t),n.data=dy.call(t,t.transformResponse,n),n.headers=Is.from(n.headers),n},function(n){return DT(n)||(py(t),n&&n.response&&(n.response.data=dy.call(t,t.transformResponse,n.response),n.response.headers=Is.from(n.response.headers))),Promise.reject(n)})}const U_=t=>t instanceof Is?t.toJSON():t;function ec(t,e){e=e||{};const r={};function n(l,c,f){return Le.isPlainObject(l)&&Le.isPlainObject(c)?Le.merge.call({caseless:f},l,c):Le.isPlainObject(c)?Le.merge({},c):Le.isArray(c)?c.slice():c}function i(l,c,f){if(Le.isUndefined(c)){if(!Le.isUndefined(l))return n(void 0,l,f)}else return n(l,c,f)}function a(l,c){if(!Le.isUndefined(c))return n(void 0,c)}function s(l,c){if(Le.isUndefined(c)){if(!Le.isUndefined(l))return n(void 0,l)}else return n(void 0,c)}function o(l,c,f){if(f in e)return n(l,c);if(f in t)return n(void 0,l)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(l,c)=>i(U_(l),U_(c),!0)};return Le.forEach(Object.keys(Object.assign({},t,e)),function(c){const f=u[c]||i,h=f(t[c],e[c],c);Le.isUndefined(h)&&f!==o||(r[c]=h)}),r}const CT="1.6.7",g1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{g1[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const q_={};g1.transitional=function(e,r,n){function i(a,s){return"[Axios v"+CT+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,o)=>{if(e===!1)throw new nr(i(s," has been removed"+(r?" in "+r:"")),nr.ERR_DEPRECATED);return r&&!q_[s]&&(q_[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,o):!0}};function J7(t,e,r){if(typeof t!="object")throw new nr("options must be an object",nr.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const a=n[i],s=e[a];if(s){const o=t[a],u=o===void 0||s(o,a,t);if(u!==!0)throw new nr("option "+a+" must be "+u,nr.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new nr("Unknown option "+a,nr.ERR_BAD_OPTION)}}const rb={assertOptions:J7,validators:g1},po=rb.validators;class km{constructor(e){this.defaults=e,this.interceptors={request:new I_,response:new I_}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+a):n.stack=a}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ec(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&rb.assertOptions(n,{silentJSONParsing:po.transitional(po.boolean),forcedJSONParsing:po.transitional(po.boolean),clarifyTimeoutError:po.transitional(po.boolean)},!1),i!=null&&(Le.isFunction(i)?r.paramsSerializer={serialize:i}:rb.assertOptions(i,{encode:po.function,serialize:po.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=a&&Le.merge(a.common,a[r.method]);a&&Le.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=Is.concat(s,a);const o=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(u=u&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let c,f=0,h;if(!u){const v=[z_.bind(this),void 0];for(v.unshift.apply(v,o),v.push.apply(v,l),h=v.length,c=Promise.resolve(r);f{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(o=>{n.subscribe(o),a=o}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},e(function(a,s,o){n.reason||(n.reason=new Yh(a,s,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new y1(function(i){e=i}),cancel:e}}}const Q7=y1;function eU(t){return function(r){return t.apply(null,r)}}function tU(t){return Le.isObject(t)&&t.isAxiosError===!0}const nb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nb).forEach(([t,e])=>{nb[e]=t});const rU=nb;function MT(t){const e=new wm(t),r=lT(wm.prototype.request,e);return Le.extend(r,wm.prototype,e,{allOwnKeys:!0}),Le.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return MT(ec(t,i))},r}const rn=MT(v1);rn.Axios=wm;rn.CanceledError=Yh;rn.CancelToken=Q7;rn.isCancel=DT;rn.VERSION=CT;rn.toFormData=Yv;rn.AxiosError=nr;rn.Cancel=rn.CanceledError;rn.all=function(e){return Promise.all(e)};rn.spread=eU;rn.isAxiosError=tU;rn.mergeConfig=ec;rn.AxiosHeaders=Is;rn.formToJSON=t=>AT(Le.isHTMLForm(t)?new FormData(t):t);rn.getAdapter=ET.getAdapter;rn.HttpStatusCode=rU;rn.default=rn;const TT=rn;/*! + */(function(t,e){(function(n,i){t.exports=i()})(window,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:o})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(s&1&&(a=i(a)),s&8||s&4&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),s&2&&typeof a!="string")for(var u in a)i.d(o,u,function(l){return a[l]}.bind(null,u));return o},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=2)}([function(r,n,i){var a=this&&this.__extends||function(){var m=function(b,y){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,x){S.__proto__=x}||function(S,x){for(var A in x)x.hasOwnProperty(A)&&(S[A]=x[A])},m(b,y)};return function(b,y){m(b,y);function S(){this.constructor=b}b.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=256,o=function(){function m(b){b===void 0&&(b="="),this._paddingCharacter=b}return m.prototype.encodedLength=function(b){return this._paddingCharacter?(b+2)/3*4|0:(b*8+5)/6|0},m.prototype.encode=function(b){for(var y="",S=0;S>>3*6&63),y+=this._encodeByte(x>>>2*6&63),y+=this._encodeByte(x>>>1*6&63),y+=this._encodeByte(x>>>0*6&63)}var A=b.length-S;if(A>0){var x=b[S]<<16|(A===2?b[S+1]<<8:0);y+=this._encodeByte(x>>>3*6&63),y+=this._encodeByte(x>>>2*6&63),A===2?y+=this._encodeByte(x>>>1*6&63):y+=this._paddingCharacter||"",y+=this._paddingCharacter||""}return y},m.prototype.maxDecodedLength=function(b){return this._paddingCharacter?b/4*3|0:(b*6+7)/8|0},m.prototype.decodedLength=function(b){return this.maxDecodedLength(b.length-this._getPaddingLength(b))},m.prototype.decode=function(b){if(b.length===0)return new Uint8Array(0);for(var y=this._getPaddingLength(b),S=b.length-y,x=new Uint8Array(this.maxDecodedLength(S)),A=0,_=0,w=0,C=0,E=0,N=0,M=0;_>>4,x[A++]=E<<4|N>>>2,x[A++]=N<<6|M,w|=C&s,w|=E&s,w|=N&s,w|=M&s;if(_>>4,w|=C&s,w|=E&s),_>>2,w|=N&s),_>>8&0-65-26+97,y+=51-b>>>8&26-97-52+48,y+=61-b>>>8&52-48-62+43,y+=62-b>>>8&62-43-63+47,String.fromCharCode(y)},m.prototype._decodeChar=function(b){var y=s;return y+=(42-b&b-44)>>>8&-s+b-43+62,y+=(46-b&b-48)>>>8&-s+b-47+63,y+=(47-b&b-58)>>>8&-s+b-48+52,y+=(64-b&b-91)>>>8&-s+b-65+0,y+=(96-b&b-123)>>>8&-s+b-97+26,y},m.prototype._getPaddingLength=function(b){var y=0;if(this._paddingCharacter){for(var S=b.length-1;S>=0&&b[S]===this._paddingCharacter;S--)y++;if(b.length<4||y>2)throw new Error("Base64Coder: incorrect padding")}return y},m}();n.Coder=o;var u=new o;function l(m){return u.encode(m)}n.encode=l;function c(m){return u.decode(m)}n.decode=c;var f=function(m){a(b,m);function b(){return m!==null&&m.apply(this,arguments)||this}return b.prototype._encodeByte=function(y){var S=y;return S+=65,S+=25-y>>>8&0-65-26+97,S+=51-y>>>8&26-97-52+48,S+=61-y>>>8&52-48-62+45,S+=62-y>>>8&62-45-63+95,String.fromCharCode(S)},b.prototype._decodeChar=function(y){var S=s;return S+=(44-y&y-46)>>>8&-s+y-45+62,S+=(94-y&y-96)>>>8&-s+y-95+63,S+=(47-y&y-58)>>>8&-s+y-48+52,S+=(64-y&y-91)>>>8&-s+y-65+0,S+=(96-y&y-123)>>>8&-s+y-97+26,S},b}(o);n.URLSafeCoder=f;var h=new f;function p(m){return h.encode(m)}n.encodeURLSafe=p;function v(m){return h.decode(m)}n.decodeURLSafe=v,n.encodedLength=function(m){return u.encodedLength(m)},n.maxDecodedLength=function(m){return u.maxDecodedLength(m)},n.decodedLength=function(m){return u.decodedLength(m)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a="utf8: invalid string",s="utf8: invalid source encoding";function o(c){for(var f=new Uint8Array(u(c)),h=0,p=0;p>6,f[h++]=128|v&63):v<55296?(f[h++]=224|v>>12,f[h++]=128|v>>6&63,f[h++]=128|v&63):(p++,v=(v&1023)<<10,v|=c.charCodeAt(p)&1023,v+=65536,f[h++]=240|v>>18,f[h++]=128|v>>12&63,f[h++]=128|v>>6&63,f[h++]=128|v&63)}return f}n.encode=o;function u(c){for(var f=0,h=0;h=c.length-1)throw new Error(a);h++,f+=4}else throw new Error(a)}return f}n.encodedLength=u;function l(c){for(var f=[],h=0;h=c.length)throw new Error(s);var m=c[++h];if((m&192)!==128)throw new Error(s);p=(p&31)<<6|m&63,v=128}else if(p<240){if(h>=c.length-1)throw new Error(s);var m=c[++h],b=c[++h];if((m&192)!==128||(b&192)!==128)throw new Error(s);p=(p&15)<<12|(m&63)<<6|b&63,v=2048}else if(p<248){if(h>=c.length-2)throw new Error(s);var m=c[++h],b=c[++h],y=c[++h];if((m&192)!==128||(b&192)!==128||(y&192)!==128)throw new Error(s);p=(p&15)<<18|(m&63)<<12|(b&63)<<6|y&63,v=65536}else throw new Error(s);if(p=55296&&p<=57343)throw new Error(s);if(p>=65536){if(p>1114111)throw new Error(s);p-=65536,f.push(String.fromCharCode(55296|p>>10)),p=56320|p&1023}}f.push(String.fromCharCode(p))}return f.join("")}n.decode=l},function(r,n,i){r.exports=i(3).default},function(r,n,i){i.r(n);class a{constructor(T,L){this.lastId=0,this.prefix=T,this.name=L}create(T){this.lastId++;var L=this.lastId,Q=this.prefix+L,ie=this.name+"["+L+"]",Oe=!1,Ze=function(){Oe||(T.apply(null,arguments),Oe=!0)};return this[L]=Ze,{number:L,id:Q,name:ie,callback:Ze}}remove(T){delete this[T.number]}}var s=new a("_pusher_script_","Pusher.ScriptReceivers"),o={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},u=o;class l{constructor(T){this.options=T,this.receivers=T.receivers||s,this.loading={}}load(T,L,Q){var ie=this;if(ie.loading[T]&&ie.loading[T].length>0)ie.loading[T].push(Q);else{ie.loading[T]=[Q];var Oe=et.createScriptRequest(ie.getPath(T,L)),Ze=ie.receivers.create(function(st){if(ie.receivers.remove(Ze),ie.loading[T]){var _t=ie.loading[T];delete ie.loading[T];for(var Yt=function($r){$r||Oe.cleanup()},ar=0;ar<_t.length;ar++)_t[ar](st,Yt)}});Oe.send(Ze)}}getRoot(T){var L,Q=et.getDocument().location.protocol;return T&&T.useTLS||Q==="https:"?L=this.options.cdn_https:L=this.options.cdn_http,L.replace(/\/*$/,"")+"/"+this.options.version}getPath(T,L){return this.getRoot(L)+"/"+T+this.options.suffix+".js"}}var c=new a("_pusher_dependencies","Pusher.DependenciesReceivers"),f=new l({cdn_http:u.cdn_http,cdn_https:u.cdn_https,version:u.VERSION,suffix:u.dependency_suffix,receivers:c});const h={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var v={buildLogSuffix:function(z){const T="See:",L=h.urls[z];if(!L)return"";let Q;return L.fullUrl?Q=L.fullUrl:L.path&&(Q=h.baseUrl+L.path),Q?`${T} ${Q}`:""}},m;(function(z){z.UserAuthentication="user-authentication",z.ChannelAuthorization="channel-authorization"})(m||(m={}));class b extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class y extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class w extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(T){super(T),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(T,L){super(L),this.status=T,Object.setPrototypeOf(this,new.target.prototype)}}var M=function(z,T,L,Q,ie){const Oe=et.createXHR();Oe.open("POST",L.endpoint,!0),Oe.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var Ze in L.headers)Oe.setRequestHeader(Ze,L.headers[Ze]);if(L.headersProvider!=null){let st=L.headersProvider();for(var Ze in st)Oe.setRequestHeader(Ze,st[Ze])}return Oe.onreadystatechange=function(){if(Oe.readyState===4)if(Oe.status===200){let st,_t=!1;try{st=JSON.parse(Oe.responseText),_t=!0}catch{ie(new E(200,`JSON returned from ${Q.toString()} endpoint was invalid, yet status code was 200. Data was: ${Oe.responseText}`),null)}_t&&ie(null,st)}else{let st="";switch(Q){case m.UserAuthentication:st=v.buildLogSuffix("authenticationEndpoint");break;case m.ChannelAuthorization:st=`Clients must be authorized to join private or presence channels. ${v.buildLogSuffix("authorizationEndpoint")}`;break}ie(new E(Oe.status,`Unable to retrieve auth string from ${Q.toString()} endpoint - received status: ${Oe.status} from ${L.endpoint}. ${st}`),null)}},Oe.send(T),Oe};function O(z){return P(H(z))}var F=String.fromCharCode,U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",V=function(z){var T=z.charCodeAt(0);return T<128?z:T<2048?F(192|T>>>6)+F(128|T&63):F(224|T>>>12&15)+F(128|T>>>6&63)+F(128|T&63)},H=function(z){return z.replace(/[^\x00-\x7F]/g,V)},I=function(z){var T=[0,2,1][z.length%3],L=z.charCodeAt(0)<<16|(z.length>1?z.charCodeAt(1):0)<<8|(z.length>2?z.charCodeAt(2):0),Q=[U.charAt(L>>>18),U.charAt(L>>>12&63),T>=2?"=":U.charAt(L>>>6&63),T>=1?"=":U.charAt(L&63)];return Q.join("")},P=window.btoa||function(z){return z.replace(/[\s\S]{1,3}/g,I)};class K{constructor(T,L,Q,ie){this.clear=L,this.timer=T(()=>{this.timer&&(this.timer=ie(this.timer))},Q)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var $=K;function se(z){window.clearTimeout(z)}function he(z){window.clearInterval(z)}class ne extends ${constructor(T,L){super(setTimeout,se,T,function(Q){return L(),null})}}class X extends ${constructor(T,L){super(setInterval,he,T,function(Q){return L(),Q})}}var de={now(){return Date.now?Date.now():new Date().valueOf()},defer(z){return new ne(0,z)},method(z,...T){var L=Array.prototype.slice.call(arguments,1);return function(Q){return Q[z].apply(Q,L.concat(arguments))}}},Se=de;function ce(z,...T){for(var L=0;L{window.console&&window.console.log&&window.console.log(T)}}debug(...T){this.log(this.globalLog,T)}warn(...T){this.log(this.globalLogWarn,T)}error(...T){this.log(this.globalLogError,T)}globalLogWarn(T){window.console&&window.console.warn?window.console.warn(T):this.globalLog(T)}globalLogError(T){window.console&&window.console.error?window.console.error(T):this.globalLogWarn(T)}log(T,...L){var Q=xe.apply(this,arguments);hf.log?hf.log(Q):hf.logToConsole&&T.bind(this)(Q)}}var Y=new q,pe=function(z,T,L,Q,ie){(L.headers!==void 0||L.headersProvider!=null)&&Y.warn(`To send headers with the ${Q.toString()} request, you must use AJAX, rather than JSONP.`);var Oe=z.nextAuthCallbackID.toString();z.nextAuthCallbackID++;var Ze=z.getDocument(),st=Ze.createElement("script");z.auth_callbacks[Oe]=function(ar){ie(null,ar)};var _t="Pusher.auth_callbacks['"+Oe+"']";st.src=L.endpoint+"?callback="+encodeURIComponent(_t)+"&"+T;var Yt=Ze.getElementsByTagName("head")[0]||Ze.documentElement;Yt.insertBefore(st,Yt.firstChild)},ge=pe;class De{constructor(T){this.src=T}send(T){var L=this,Q="Error loading "+L.src;L.script=document.createElement("script"),L.script.id=T.id,L.script.src=L.src,L.script.type="text/javascript",L.script.charset="UTF-8",L.script.addEventListener?(L.script.onerror=function(){T.callback(Q)},L.script.onload=function(){T.callback(null)}):L.script.onreadystatechange=function(){(L.script.readyState==="loaded"||L.script.readyState==="complete")&&T.callback(null)},L.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(L.errorScript=document.createElement("script"),L.errorScript.id=T.id+"_error",L.errorScript.text=T.name+"('"+Q+"');",L.script.async=L.errorScript.async=!1):L.script.async=!0;var ie=document.getElementsByTagName("head")[0];ie.insertBefore(L.script,ie.firstChild),L.errorScript&&ie.insertBefore(L.errorScript,L.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Be{constructor(T,L){this.url=T,this.data=L}send(T){if(!this.request){var L=Ee(this.data),Q=this.url+"/"+T.number+"?"+L;this.request=et.createScriptRequest(Q),this.request.send(T)}}cleanup(){this.request&&this.request.cleanup()}}var Pe=function(z,T){return function(L,Q){var ie="http"+(T?"s":"")+"://",Oe=ie+(z.host||z.options.host)+z.options.path,Ze=et.createJSONPRequest(Oe,L),st=et.ScriptReceivers.create(function(_t,Yt){s.remove(st),Ze.cleanup(),Yt&&Yt.host&&(z.host=Yt.host),Q&&Q(_t,Yt)});Ze.send(st)}},Ve={name:"jsonp",getAgent:Pe},ze=Ve;function gt(z,T,L){var Q=z+(T.useTLS?"s":""),ie=T.useTLS?T.hostTLS:T.hostNonTLS;return Q+"://"+ie+L}function St(z,T){var L="/app/"+z,Q="?protocol="+u.PROTOCOL+"&client=js&version="+u.VERSION+(T?"&"+T:"");return L+Q}var at={getInitial:function(z,T){var L=(T.httpPath||"")+St(z,"flash=false");return gt("ws",T,L)}},mr={getInitial:function(z,T){var L=(T.httpPath||"/pusher")+St(z);return gt("http",T,L)}},k={getInitial:function(z,T){return gt("http",T,T.httpPath||"/pusher")},getPath:function(z,T){return St(z)}};class oe{constructor(){this._callbacks={}}get(T){return this._callbacks[Ae(T)]}add(T,L,Q){var ie=Ae(T);this._callbacks[ie]=this._callbacks[ie]||[],this._callbacks[ie].push({fn:L,context:Q})}remove(T,L,Q){if(!T&&!L&&!Q){this._callbacks={};return}var ie=T?[Ae(T)]:we(this._callbacks);L||Q?this.removeCallback(ie,L,Q):this.removeAllCallbacks(ie)}removeCallback(T,L,Q){Ce(T,function(ie){this._callbacks[ie]=J(this._callbacks[ie]||[],function(Oe){return L&&L!==Oe.fn||Q&&Q!==Oe.context}),this._callbacks[ie].length===0&&delete this._callbacks[ie]},this)}removeAllCallbacks(T){Ce(T,function(L){delete this._callbacks[L]},this)}}function Ae(z){return"_"+z}class $e{constructor(T){this.callbacks=new oe,this.global_callbacks=[],this.failThrough=T}bind(T,L,Q){return this.callbacks.add(T,L,Q),this}bind_global(T){return this.global_callbacks.push(T),this}unbind(T,L,Q){return this.callbacks.remove(T,L,Q),this}unbind_global(T){return T?(this.global_callbacks=J(this.global_callbacks||[],L=>L!==T),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(T,L,Q){for(var ie=0;ie0)for(var ie=0;ie{this.onError(L),this.changeState("closed")}),!1}return this.bindListeners(),Y.debug("Connecting",{transport:this.name,url:T}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(T){return this.state==="open"?(Se.defer(()=>{this.socket&&this.socket.send(T)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(T){this.emit("error",{type:"WebSocketError",error:T}),this.timeline.error(this.buildTimelineMessage({error:T.toString()}))}onClose(T){T?this.changeState("closed",{code:T.code,reason:T.reason,wasClean:T.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(T){this.emit("message",T)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=T=>{this.onError(T)},this.socket.onclose=T=>{this.onClose(T)},this.socket.onmessage=T=>{this.onMessage(T)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(T,L){this.state=T,this.timeline.info(this.buildTimelineMessage({state:T,params:L})),this.emit(T,L)}buildTimelineMessage(T){return ce({cid:this.id},T)}}class ht{constructor(T){this.hooks=T}isSupported(T){return this.hooks.isSupported(T)}createConnection(T,L,Q,ie){return new ct(this.hooks,T,L,Q,ie)}}var Dn=new ht({urls:at,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!et.getWebSocketAPI()},isSupported:function(){return!!et.getWebSocketAPI()},getSocket:function(z){return et.createWebSocket(z)}}),Js={urls:mr,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},il=ce({getSocket:function(z){return et.HTTPFactory.createStreamingSocket(z)}},Js),al=ce({getSocket:function(z){return et.HTTPFactory.createPollingSocket(z)}},Js),Jo={isSupported:function(){return et.isXHRSupported()}},zc=new ht(ce({},il,Jo)),Uc=new ht(ce({},al,Jo)),qc={ws:Dn,xhr_streaming:zc,xhr_polling:Uc},Pa=qc,Hc=new ht({file:"sockjs",urls:k,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(z,T){return new window.SockJS(z,null,{js_path:f.getPath("sockjs",{useTLS:T.useTLS}),ignore_null_origin:T.ignoreNullOrigin})},beforeOpen:function(z,T){z.send(JSON.stringify({path:T}))}}),Qs={isSupported:function(z){var T=et.isXDRSupported(z.useTLS);return T}},Wc=new ht(ce({},il,Qs)),Vc=new ht(ce({},al,Qs));Pa.xdr_streaming=Wc,Pa.xdr_polling=Vc,Pa.sockjs=Hc;var Yc=Pa;class jc extends $e{constructor(){super();var T=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){T.emit("online")},!1),window.addEventListener("offline",function(){T.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Gc=new jc;class Xc{constructor(T,L,Q){this.manager=T,this.transport=L,this.minPingDelay=Q.minPingDelay,this.maxPingDelay=Q.maxPingDelay,this.pingDelay=void 0}createConnection(T,L,Q,ie){ie=ce({},ie,{activityTimeout:this.pingDelay});var Oe=this.transport.createConnection(T,L,Q,ie),Ze=null,st=function(){Oe.unbind("open",st),Oe.bind("closed",_t),Ze=Se.now()},_t=Yt=>{if(Oe.unbind("closed",_t),Yt.code===1002||Yt.code===1003)this.manager.reportDeath();else if(!Yt.wasClean&&Ze){var ar=Se.now()-Ze;ar<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ar/2,this.minPingDelay))}};return Oe.bind("open",st),Oe}isSupported(T){return this.manager.isAlive()&&this.transport.isSupported(T)}}const sl={decodeMessage:function(z){try{var T=JSON.parse(z.data),L=T.data;if(typeof L=="string")try{L=JSON.parse(T.data)}catch{}var Q={event:T.event,channel:T.channel,data:L};return T.user_id&&(Q.user_id=T.user_id),Q}catch(ie){throw{type:"MessageParseError",error:ie,data:z.data}}},encodeMessage:function(z){return JSON.stringify(z)},processHandshake:function(z){var T=sl.decodeMessage(z);if(T.event==="pusher:connection_established"){if(!T.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:T.data.socket_id,activityTimeout:T.data.activity_timeout*1e3}}else{if(T.event==="pusher:error")return{action:this.getCloseAction(T.data),error:this.getCloseError(T.data)};throw"Invalid handshake"}},getCloseAction:function(z){return z.code<4e3?z.code>=1002&&z.code<=1004?"backoff":null:z.code===4e3?"tls_only":z.code<4100?"refused":z.code<4200?"backoff":z.code<4300?"retry":"refused"},getCloseError:function(z){return z.code!==1e3&&z.code!==1001?{type:"PusherError",data:{code:z.code,message:z.reason||z.message}}:null}};var fa=sl;class ol extends $e{constructor(T,L){super(),this.id=T,this.transport=L,this.activityTimeout=L.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(T){return this.transport.send(T)}send_event(T,L,Q){var ie={event:T,data:L};return Q&&(ie.channel=Q),Y.debug("Event sent",ie),this.send(fa.encodeMessage(ie))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var T={message:Q=>{var ie;try{ie=fa.decodeMessage(Q)}catch(Oe){this.emit("error",{type:"MessageParseError",error:Oe,data:Q.data})}if(ie!==void 0){switch(Y.debug("Event recd",ie),ie.event){case"pusher:error":this.emit("error",{type:"PusherError",data:ie.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",ie)}},activity:()=>{this.emit("activity")},error:Q=>{this.emit("error",Q)},closed:Q=>{L(),Q&&Q.code&&this.handleCloseEvent(Q),this.transport=null,this.emit("closed")}},L=()=>{me(T,(Q,ie)=>{this.transport.unbind(ie,Q)})};me(T,(Q,ie)=>{this.transport.bind(ie,Q)})}handleCloseEvent(T){var L=fa.getCloseAction(T),Q=fa.getCloseError(T);Q&&this.emit("error",Q),L&&this.emit(L,{action:L,error:Q})}}class Zc{constructor(T,L){this.transport=T,this.callback=L,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=T=>{this.unbindListeners();var L;try{L=fa.processHandshake(T)}catch(Q){this.finish("error",{error:Q}),this.transport.close();return}L.action==="connected"?this.finish("connected",{connection:new ol(L.id,this.transport),activityTimeout:L.activityTimeout}):(this.finish(L.action,{error:L.error}),this.transport.close())},this.onClosed=T=>{this.unbindListeners();var L=fa.getCloseAction(T)||"backoff",Q=fa.getCloseError(T);this.finish(L,{error:Q})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(T,L){this.callback(ce({transport:this.transport,action:T},L))}}class Kc{constructor(T,L){this.timeline=T,this.options=L||{}}send(T,L){this.timeline.isEmpty()||this.timeline.send(et.TimelineTransport.getAgent(this,T),L)}}class Qo extends $e{constructor(T,L){super(function(Q,ie){Y.debug("No callbacks on "+T+" for "+Q)}),this.name=T,this.pusher=L,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(T,L){return L(null,{auth:""})}trigger(T,L){if(T.indexOf("client-")!==0)throw new b("Event '"+T+"' does not start with 'client-'");if(!this.subscribed){var Q=v.buildLogSuffix("triggeringClientEvents");Y.warn(`Client event triggered before channel 'subscription_succeeded' event . ${Q}`)}return this.pusher.send_event(T,L,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(T){var L=T.event,Q=T.data;if(L==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(T);else if(L==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(T);else if(L.indexOf("pusher_internal:")!==0){var ie={};this.emit(L,Q,ie)}}handleSubscriptionSucceededEvent(T){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",T.data)}handleSubscriptionCountEvent(T){T.data.subscription_count&&(this.subscriptionCount=T.data.subscription_count),this.emit("pusher:subscription_count",T.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(T,L)=>{T?(this.subscriptionPending=!1,Y.error(T.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:T.message},T instanceof E?{status:T.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:L.auth,channel_data:L.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class eu extends Qo{authorize(T,L){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:T},L)}}class Jc{constructor(){this.reset()}get(T){return Object.prototype.hasOwnProperty.call(this.members,T)?{id:T,info:this.members[T]}:null}each(T){me(this.members,(L,Q)=>{T(this.get(Q))})}setMyID(T){this.myID=T}onSubscription(T){this.members=T.presence.hash,this.count=T.presence.count,this.me=this.get(this.myID)}addMember(T){return this.get(T.user_id)===null&&this.count++,this.members[T.user_id]=T.user_info,this.get(T.user_id)}removeMember(T){var L=this.get(T.user_id);return L&&(delete this.members[T.user_id],this.count--),L}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Qc=function(z,T,L,Q){function ie(Oe){return Oe instanceof L?Oe:new L(function(Ze){Ze(Oe)})}return new(L||(L=Promise))(function(Oe,Ze){function st(ar){try{Yt(Q.next(ar))}catch($r){Ze($r)}}function _t(ar){try{Yt(Q.throw(ar))}catch($r){Ze($r)}}function Yt(ar){ar.done?Oe(ar.value):ie(ar.value).then(st,_t)}Yt((Q=Q.apply(z,T||[])).next())})};class eo extends eu{constructor(T,L){super(T,L),this.members=new Jc}authorize(T,L){super.authorize(T,(Q,ie)=>Qc(this,void 0,void 0,function*(){if(!Q)if(ie=ie,ie.channel_data!=null){var Oe=JSON.parse(ie.channel_data);this.members.setMyID(Oe.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let Ze=v.buildLogSuffix("authorizationEndpoint");Y.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${Ze}, or the user should be signed in.`),L("Invalid auth response");return}L(Q,ie)}))}handleEvent(T){var L=T.event;if(L.indexOf("pusher_internal:")===0)this.handleInternalEvent(T);else{var Q=T.data,ie={};T.user_id&&(ie.user_id=T.user_id),this.emit(L,Q,ie)}}handleInternalEvent(T){var L=T.event,Q=T.data;switch(L){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(T);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(T);break;case"pusher_internal:member_added":var ie=this.members.addMember(Q);this.emit("pusher:member_added",ie);break;case"pusher_internal:member_removed":var Oe=this.members.removeMember(Q);Oe&&this.emit("pusher:member_removed",Oe);break}}handleSubscriptionSucceededEvent(T){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(T.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var as=i(1),Wt=i(0);class bn extends eu{constructor(T,L,Q){super(T,L),this.key=null,this.nacl=Q}authorize(T,L){super.authorize(T,(Q,ie)=>{if(Q){L(Q,ie);return}let Oe=ie.shared_secret;if(!Oe){L(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(Wt.decode)(Oe),delete ie.shared_secret,L(null,ie)})}trigger(T,L){throw new _("Client events are not currently supported for encrypted channels")}handleEvent(T){var L=T.event,Q=T.data;if(L.indexOf("pusher_internal:")===0||L.indexOf("pusher:")===0){super.handleEvent(T);return}this.handleEncryptedEvent(L,Q)}handleEncryptedEvent(T,L){if(!this.key){Y.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!L.ciphertext||!L.nonce){Y.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+L);return}let Q=Object(Wt.decode)(L.ciphertext);if(Q.length{if(Ze){Y.error(`Failed to make a request to the authEndpoint: ${st}. Unable to fetch new key, so dropping encrypted event`);return}if(Oe=this.nacl.secretbox.open(Q,ie,this.key),Oe===null){Y.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(T,this.getDataToEmit(Oe))});return}this.emit(T,this.getDataToEmit(Oe))}getDataToEmit(T){let L=Object(as.decode)(T);try{return JSON.parse(L)}catch{return L}}}class ef extends $e{constructor(T,L){super(),this.state="initialized",this.connection=null,this.key=T,this.options=L,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var Q=et.getNetwork();Q.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),Q.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(T){this.key=T,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(T){return this.connection?this.connection.send(T):!1}send_event(T,L,Q){return this.connection?this.connection.send_event(T,L,Q):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var T=(L,Q)=>{L?this.runner=this.strategy.connect(0,T):Q.action==="error"?(this.emit("error",{type:"HandshakeError",error:Q.error}),this.timeline.error({handshakeError:Q.error})):(this.abortConnecting(),this.handshakeCallbacks[Q.action](Q))};this.runner=this.strategy.connect(0,T)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var T=this.abandonConnection();T.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(T){this.timeline.info({action:"retry",delay:T}),T>0&&this.emit("connecting_in",Math.round(T/1e3)),this.retryTimer=new ne(T||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new ne(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ne(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new ne(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(T){return ce({},T,{message:L=>{this.resetActivityCheck(),this.emit("message",L)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:L=>{this.emit("error",L)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(T){return ce({},T,{connected:L=>{this.activityTimeout=Math.min(this.options.activityTimeout,L.activityTimeout,L.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(L.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let T=L=>Q=>{Q.error&&this.emit("error",{type:"WebSocketError",error:Q.error}),L(Q)};return{tls_only:T(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:T(()=>{this.disconnect()}),backoff:T(()=>{this.retryIn(1e3)}),retry:T(()=>{this.retryIn(0)})}}setConnection(T){this.connection=T;for(var L in this.connectionCallbacks)this.connection.bind(L,this.connectionCallbacks[L]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var T in this.connectionCallbacks)this.connection.unbind(T,this.connectionCallbacks[T]);var L=this.connection;return this.connection=null,L}}updateState(T,L){var Q=this.state;if(this.state=T,Q!==T){var ie=T;ie==="connected"&&(ie+=" with new socket ID "+L.socket_id),Y.debug("State changed",Q+" -> "+ie),this.timeline.info({state:T,params:L}),this.emit("state_change",{previous:Q,current:T}),this.emit(T,L)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class to{constructor(){this.channels={}}add(T,L){return this.channels[T]||(this.channels[T]=Ia(T,L)),this.channels[T]}all(){return Ne(this.channels)}find(T){return this.channels[T]}remove(T){var L=this.channels[T];return delete this.channels[T],L}disconnect(){me(this.channels,function(T){T.disconnect()})}}function Ia(z,T){if(z.indexOf("private-encrypted-")===0){if(T.config.nacl)return ki.createEncryptedChannel(z,T,T.config.nacl);let L="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",Q=v.buildLogSuffix("encryptedChannelSupport");throw new _(`${L}. ${Q}`)}else{if(z.indexOf("private-")===0)return ki.createPrivateChannel(z,T);if(z.indexOf("presence-")===0)return ki.createPresenceChannel(z,T);if(z.indexOf("#")===0)throw new y('Cannot create a channel with name "'+z+'".');return ki.createChannel(z,T)}}var ul={createChannels(){return new to},createConnectionManager(z,T){return new ef(z,T)},createChannel(z,T){return new Qo(z,T)},createPrivateChannel(z,T){return new eu(z,T)},createPresenceChannel(z,T){return new eo(z,T)},createEncryptedChannel(z,T,L){return new bn(z,T,L)},createTimelineSender(z,T){return new Kc(z,T)},createHandshake(z,T){return new Zc(z,T)},createAssistantToTheTransportManager(z,T,L){return new Xc(z,T,L)}},ki=ul;class xd{constructor(T){this.options=T||{},this.livesLeft=this.options.lives||1/0}getAssistant(T){return ki.createAssistantToTheTransportManager(this,T,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class ss{constructor(T,L){this.strategies=T,this.loop=!!L.loop,this.failFast=!!L.failFast,this.timeout=L.timeout,this.timeoutLimit=L.timeoutLimit}isSupported(){return ee(this.strategies,Se.method("isSupported"))}connect(T,L){var Q=this.strategies,ie=0,Oe=this.timeout,Ze=null,st=(_t,Yt)=>{Yt?L(null,Yt):(ie=ie+1,this.loop&&(ie=ie%Q.length),ie0&&(Oe=new ne(Q.timeout,function(){Ze.abort(),ie(!0)})),Ze=T.connect(L,function(st,_t){st&&Oe&&Oe.isRunning()&&!Q.failFast||(Oe&&Oe.ensureAborted(),ie(st,_t))}),{abort:function(){Oe&&Oe.ensureAborted(),Ze.abort()},forceMinPriority:function(st){Ze.forceMinPriority(st)}}}}class tf{constructor(T){this.strategies=T}isSupported(){return ee(this.strategies,Se.method("isSupported"))}connect(T,L){return Kg(this.strategies,T,function(Q,ie){return function(Oe,Ze){if(ie[Q].error=Oe,Oe){wd(ie)&&L(!0);return}Ce(ie,function(st){st.forceMinPriority(Ze.transport.priority)}),L(null,Ze)}})}}function Kg(z,T,L){var Q=He(z,function(ie,Oe,Ze,st){return ie.connect(T,L(Oe,st))});return{abort:function(){Ce(Q,Sd)},forceMinPriority:function(ie){Ce(Q,function(Oe){Oe.forceMinPriority(ie)})}}}function wd(z){return ue(z,function(T){return!!T.error})}function Sd(z){!z.error&&!z.aborted&&(z.abort(),z.aborted=!0)}class _d{constructor(T,L,Q){this.strategy=T,this.transports=L,this.ttl=Q.ttl||1800*1e3,this.usingTLS=Q.useTLS,this.timeline=Q.timeline}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.usingTLS,ie=Jg(Q),Oe=ie&&ie.cacheSkipCount?ie.cacheSkipCount:0,Ze=[this.strategy];if(ie&&ie.timestamp+this.ttl>=Se.now()){var st=this.transports[ie.transport];st&&(["ws","wss"].includes(ie.transport)||Oe>3?(this.timeline.info({cached:!0,transport:ie.transport,latency:ie.latency}),Ze.push(new ss([st],{timeout:ie.latency*2+1e3,failFast:!0}))):Oe++)}var _t=Se.now(),Yt=Ze.pop().connect(T,function ar($r,hl){$r?(ru(Q),Ze.length>0?(_t=Se.now(),Yt=Ze.pop().connect(T,ar)):L($r)):(Ad(Q,hl.transport.name,Se.now()-_t,Oe),L(null,hl))});return{abort:function(){Yt.abort()},forceMinPriority:function(ar){T=ar,Yt&&Yt.forceMinPriority(ar)}}}}function tu(z){return"pusherTransport"+(z?"TLS":"NonTLS")}function Jg(z){var T=et.getLocalStorage();if(T)try{var L=T[tu(z)];if(L)return JSON.parse(L)}catch{ru(z)}return null}function Ad(z,T,L,Q){var ie=et.getLocalStorage();if(ie)try{ie[tu(z)]=R({timestamp:Se.now(),transport:T,latency:L,cacheSkipCount:Q})}catch{}}function ru(z){var T=et.getLocalStorage();if(T)try{delete T[tu(z)]}catch{}}class nu{constructor(T,{delay:L}){this.strategy=T,this.options={delay:L}}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.strategy,ie,Oe=new ne(this.options.delay,function(){ie=Q.connect(T,L)});return{abort:function(){Oe.ensureAborted(),ie&&ie.abort()},forceMinPriority:function(Ze){T=Ze,ie&&ie.forceMinPriority(Ze)}}}}class iu{constructor(T,L,Q){this.test=T,this.trueBranch=L,this.falseBranch=Q}isSupported(){var T=this.test()?this.trueBranch:this.falseBranch;return T.isSupported()}connect(T,L){var Q=this.test()?this.trueBranch:this.falseBranch;return Q.connect(T,L)}}class Dd{constructor(T){this.strategy=T}isSupported(){return this.strategy.isSupported()}connect(T,L){var Q=this.strategy.connect(T,function(ie,Oe){Oe&&Q.abort(),L(ie,Oe)});return Q}}function ro(z){return function(){return z.isSupported()}}var rf=function(z,T,L){var Q={};function ie(Gd,ao,v0,g0,bf){var xf=L(z,Gd,ao,v0,g0,bf);return Q[Gd]=xf,xf}var Oe=Object.assign({},T,{hostNonTLS:z.wsHost+":"+z.wsPort,hostTLS:z.wsHost+":"+z.wssPort,httpPath:z.wsPath}),Ze=Object.assign({},Oe,{useTLS:!0}),st=Object.assign({},T,{hostNonTLS:z.httpHost+":"+z.httpPort,hostTLS:z.httpHost+":"+z.httpsPort,httpPath:z.httpPath}),_t={loop:!0,timeout:15e3,timeoutLimit:6e4},Yt=new xd({minPingDelay:1e4,maxPingDelay:z.activityTimeout}),ar=new xd({lives:2,minPingDelay:1e4,maxPingDelay:z.activityTimeout}),$r=ie("ws","ws",3,Oe,Yt),hl=ie("wss","ws",3,Ze,Yt),pf=ie("sockjs","sockjs",1,st),dl=ie("xhr_streaming","xhr_streaming",1,st,ar),m0=ie("xdr_streaming","xdr_streaming",1,st,ar),mf=ie("xhr_polling","xhr_polling",1,st),Zn=ie("xdr_polling","xdr_polling",1,st),pl=new ss([$r],_t),au=new ss([hl],_t),Vd=new ss([pf],_t),vf=new ss([new iu(ro(dl),dl,m0)],_t),Yd=new ss([new iu(ro(mf),mf,Zn)],_t),jd=new ss([new iu(ro(vf),new tf([vf,new nu(Yd,{delay:4e3})]),Yd)],_t),gf=new iu(ro(jd),jd,Vd),yf;return T.useTLS?yf=new tf([pl,new nu(gf,{delay:2e3})]):yf=new tf([pl,new nu(au,{delay:2e3}),new nu(gf,{delay:5e3})]),new _d(new Dd(new iu(ro($r),yf,gf)),Q,{ttl:18e5,timeline:T.timeline,useTLS:T.useTLS})},Qg=rf,Nd=function(){var z=this;z.timeline.info(z.buildTimelineMessage({transport:z.name+(z.options.useTLS?"s":"")})),z.hooks.isInitialized()?z.changeState("initialized"):z.hooks.file?(z.changeState("initializing"),f.load(z.hooks.file,{useTLS:z.options.useTLS},function(T,L){z.hooks.isInitialized()?(z.changeState("initialized"),L(!0)):(T&&z.onError(T),z.onClose(),L(!1))})):z.onClose()},nf={getRequest:function(z){var T=new window.XDomainRequest;return T.ontimeout=function(){z.emit("error",new S),z.close()},T.onerror=function(L){z.emit("error",L),z.close()},T.onprogress=function(){T.responseText&&T.responseText.length>0&&z.onChunk(200,T.responseText)},T.onload=function(){T.responseText&&T.responseText.length>0&&z.onChunk(200,T.responseText),z.emit("finished",200),z.close()},T},abortRequest:function(z){z.ontimeout=z.onerror=z.onprogress=z.onload=null,z.abort()}},af=nf;const no=256*1024;class Ed extends $e{constructor(T,L,Q){super(),this.hooks=T,this.method=L,this.url=Q}start(T){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},et.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(T)}close(){this.unloader&&(et.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(T,L){for(;;){var Q=this.advanceBuffer(L);if(Q)this.emit("chunk",{status:T,data:Q});else break}this.isBufferTooLong(L)&&this.emit("buffer_too_long")}advanceBuffer(T){var L=T.slice(this.position),Q=L.indexOf(` +`);return Q!==-1?(this.position+=Q+1,L.slice(0,Q)):null}isBufferTooLong(T){return this.position===T.length&&T.length>no}}var ll;(function(z){z[z.CONNECTING=0]="CONNECTING",z[z.OPEN=1]="OPEN",z[z.CLOSED=3]="CLOSED"})(ll||(ll={}));var os=ll,Cd=1;class Md{constructor(T,L){this.hooks=T,this.session=Rd(1e3)+"/"+Bd(8),this.location=Td(L),this.readyState=os.CONNECTING,this.openStream()}send(T){return this.sendRaw(JSON.stringify([T]))}ping(){this.hooks.sendHeartbeat(this)}close(T,L){this.onClose(T,L,!0)}sendRaw(T){if(this.readyState===os.OPEN)try{return et.createSocketRequest("POST",Fd(Od(this.location,this.session))).start(T),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(T,L,Q){this.closeStream(),this.readyState=os.CLOSED,this.onclose&&this.onclose({code:T,reason:L,wasClean:Q})}onChunk(T){if(T.status===200){this.readyState===os.OPEN&&this.onActivity();var L,Q=T.data.slice(0,1);switch(Q){case"o":L=JSON.parse(T.data.slice(1)||"{}"),this.onOpen(L);break;case"a":L=JSON.parse(T.data.slice(1)||"[]");for(var ie=0;ie{this.onChunk(T)}),this.stream.bind("finished",T=>{this.hooks.onFinished(this,T)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(T){Se.defer(()=>{this.onError(T),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Td(z){var T=/([^\?]*)\/*(\??.*)/.exec(z);return{base:T[1],queryString:T[2]}}function Od(z,T){return z.base+"/"+T+"/xhr_send"}function Fd(z){var T=z.indexOf("?")===-1?"?":"&";return z+T+"t="+ +new Date+"&n="+Cd++}function e0(z,T){var L=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(z);return L[1]+T+L[3]}function Rd(z){return et.randomInt(z)}function Bd(z){for(var T=[],L=0;L0&&z.onChunk(L.status,L.responseText);break;case 4:L.responseText&&L.responseText.length>0&&z.onChunk(L.status,L.responseText),z.emit("finished",L.status),z.close();break}},L},abortRequest:function(z){z.onreadystatechange=null,z.abort()}},s0=a0,o0={createStreamingSocket(z){return this.createSocket(n0,z)},createPollingSocket(z){return this.createSocket(sf,z)},createSocket(z,T){return new t0(z,T)},createXHR(z,T){return this.createRequest(s0,z,T)},createRequest(z,T,L){return new Ed(z,T,L)}},Pd=o0;Pd.createXDR=function(z,T){return this.createRequest(af,z,T)};var u0=Pd,Nr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:c,getDefaultStrategy:Qg,Transports:Yc,transportConnectionInitializer:Nd,HTTPFactory:u0,TimelineTransport:ze,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(z){window.Pusher=z;var T=()=>{this.onDocumentBody(z.ready)};window.JSON?T():f.load("json2",{},T)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:M,jsonp:ge}},onDocumentBody(z){document.body?z():setTimeout(()=>{this.onDocumentBody(z)},0)},createJSONPRequest(z,T){return new Be(z,T)},createScriptRequest(z){return new De(z)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var z=this.getXHRAPI();return new z},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Gc},createWebSocket(z){var T=this.getWebSocketAPI();return new T(z)},createSocketRequest(z,T){if(this.isXHRSupported())return this.HTTPFactory.createXHR(z,T);if(this.isXDRSupported(T.indexOf("https:")===0))return this.HTTPFactory.createXDR(z,T);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var z=this.getXHRAPI();return!!z&&new z().withCredentials!==void 0},isXDRSupported(z){var T=z?"https:":"http:",L=this.getProtocol();return!!window.XDomainRequest&&L===T},addUnloadListener(z){window.addEventListener!==void 0?window.addEventListener("unload",z,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",z)},removeUnloadListener(z){window.addEventListener!==void 0?window.removeEventListener("unload",z,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",z)},randomInt(z){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*z)}},et=Nr,of;(function(z){z[z.ERROR=3]="ERROR",z[z.INFO=6]="INFO",z[z.DEBUG=7]="DEBUG"})(of||(of={}));var cl=of;class l0{constructor(T,L,Q){this.key=T,this.session=L,this.events=[],this.options=Q||{},this.sent=0,this.uniqueID=0}log(T,L){T<=this.options.level&&(this.events.push(ce({},L,{timestamp:Se.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(T){this.log(cl.ERROR,T)}info(T){this.log(cl.INFO,T)}debug(T){this.log(cl.DEBUG,T)}isEmpty(){return this.events.length===0}send(T,L){var Q=ce({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],T(Q,(ie,Oe)=>{ie||this.sent++,L&&L(ie,Oe)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class c0{constructor(T,L,Q,ie){this.name=T,this.priority=L,this.transport=Q,this.options=ie||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(T,L){if(this.isSupported()){if(this.priority{Q||(ar(),Oe?Oe.close():ie.close())},forceMinPriority:$r=>{Q||this.priority<$r&&(Oe?Oe.close():ie.close())}}}}function Id(z,T){return Se.defer(function(){T(z)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:f0}=et;var kd=function(z,T,L,Q,ie,Oe){var Ze=f0[L];if(!Ze)throw new w(L);var st=(!z.enabledTransports||_e(z.enabledTransports,T)!==-1)&&(!z.disabledTransports||_e(z.disabledTransports,T)===-1),_t;return st?(ie=Object.assign({ignoreNullOrigin:z.ignoreNullOrigin},ie),_t=new c0(T,Q,Oe?Oe.getAssistant(Ze):Ze,ie)):_t=h0,_t},h0={isSupported:function(){return!1},connect:function(z,T){var L=Se.defer(function(){T(new C)});return{abort:function(){L.ensureAborted()},forceMinPriority:function(){}}}};function on(z){if(z==null)throw"You must pass an options object";if(z.cluster==null)throw"Options object must provide a cluster";"disableStats"in z&&Y.warn("The disableStats option is deprecated in favor of enableStats")}const uf=(z,T)=>{var L="socket_id="+encodeURIComponent(z.socketId);for(var Q in T.params)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(T.params[Q]);if(T.paramsProvider!=null){let ie=T.paramsProvider();for(var Q in ie)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(ie[Q])}return L};var Ld=z=>{if(typeof et.getAuthorizers()[z.transport]>"u")throw`'${z.transport}' is not a recognized auth transport`;return(T,L)=>{const Q=uf(T,z);et.getAuthorizers()[z.transport](et,Q,z,m.UserAuthentication,L)}};const lf=(z,T)=>{var L="socket_id="+encodeURIComponent(z.socketId);L+="&channel_name="+encodeURIComponent(z.channelName);for(var Q in T.params)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(T.params[Q]);if(T.paramsProvider!=null){let ie=T.paramsProvider();for(var Q in ie)L+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(ie[Q])}return L};var $d=z=>{if(typeof et.getAuthorizers()[z.transport]>"u")throw`'${z.transport}' is not a recognized auth transport`;return(T,L)=>{const Q=lf(T,z);et.getAuthorizers()[z.transport](et,Q,z,m.ChannelAuthorization,L)}};const zd=(z,T,L)=>{const Q={authTransport:T.transport,authEndpoint:T.endpoint,auth:{params:T.params,headers:T.headers}};return(ie,Oe)=>{const Ze=z.channel(ie.channelName);L(Ze,Q).authorize(ie.socketId,Oe)}};function cf(z,T){let L={activityTimeout:z.activityTimeout||u.activityTimeout,cluster:z.cluster,httpPath:z.httpPath||u.httpPath,httpPort:z.httpPort||u.httpPort,httpsPort:z.httpsPort||u.httpsPort,pongTimeout:z.pongTimeout||u.pongTimeout,statsHost:z.statsHost||u.stats_host,unavailableTimeout:z.unavailableTimeout||u.unavailableTimeout,wsPath:z.wsPath||u.wsPath,wsPort:z.wsPort||u.wsPort,wssPort:z.wssPort||u.wssPort,enableStats:d0(z),httpHost:Ud(z),useTLS:Gn(z),wsHost:qd(z),userAuthenticator:p0(z),channelAuthorizer:ka(z,T)};return"disabledTransports"in z&&(L.disabledTransports=z.disabledTransports),"enabledTransports"in z&&(L.enabledTransports=z.enabledTransports),"ignoreNullOrigin"in z&&(L.ignoreNullOrigin=z.ignoreNullOrigin),"timelineParams"in z&&(L.timelineParams=z.timelineParams),"nacl"in z&&(L.nacl=z.nacl),L}function Ud(z){return z.httpHost?z.httpHost:z.cluster?`sockjs-${z.cluster}.pusher.com`:u.httpHost}function qd(z){return z.wsHost?z.wsHost:Hd(z.cluster)}function Hd(z){return`ws-${z}.pusher.com`}function Gn(z){return et.getProtocol()==="https:"?!0:z.forceTLS!==!1}function d0(z){return"enableStats"in z?z.enableStats:"disableStats"in z?!z.disableStats:!1}const Xn=z=>"customHandler"in z&&z.customHandler!=null;function p0(z){const T=Object.assign(Object.assign({},u.userAuthentication),z.userAuthentication);return Xn(T)?T.customHandler:Ld(T)}function Wd(z,T){let L;if("channelAuthorization"in z)L=Object.assign(Object.assign({},u.channelAuthorization),z.channelAuthorization);else if(L={transport:z.authTransport||u.authTransport,endpoint:z.authEndpoint||u.authEndpoint},"auth"in z&&("params"in z.auth&&(L.params=z.auth.params),"headers"in z.auth&&(L.headers=z.auth.headers)),"authorizer"in z)return{customHandler:zd(T,L,z.authorizer)};return L}function ka(z,T){const L=Wd(z,T);return Xn(L)?L.customHandler:$d(L)}class fl extends $e{constructor(T){super(function(L,Q){Y.debug(`No callbacks on watchlist events for ${L}`)}),this.pusher=T,this.bindWatchlistInternalEvent()}handleEvent(T){T.data.events.forEach(L=>{this.emit(L.name,L)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",T=>{var L=T.event;L==="pusher_internal:watchlist_events"&&this.handleEvent(T)})}}function ff(){let z,T;return{promise:new Promise((Q,ie)=>{z=Q,T=ie}),resolve:z,reject:T}}var Mr=ff;class La extends $e{constructor(T){super(function(L,Q){Y.debug("No callbacks on user for "+L)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(L,Q)=>{if(L){Y.warn(`Error during signin: ${L}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:Q.auth,user_data:Q.user_data})},this.pusher=T,this.pusher.connection.bind("state_change",({previous:L,current:Q})=>{L!=="connected"&&Q==="connected"&&this._signin(),L==="connected"&&Q!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new fl(T),this.pusher.connection.bind("message",L=>{var Q=L.event;Q==="pusher:signin_success"&&this._onSigninSuccess(L.data),this.serverToUserChannel&&this.serverToUserChannel.name===L.channel&&this.serverToUserChannel.handleEvent(L)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(T){try{this.user_data=JSON.parse(T.user_data)}catch{Y.error(`Failed parsing user data after signin: ${T.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){Y.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const T=L=>{L.subscriptionPending&&L.subscriptionCancelled?L.reinstateSubscription():!L.subscriptionPending&&this.pusher.connection.state==="connected"&&L.subscribe()};this.serverToUserChannel=new Qo(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((L,Q)=>{L.indexOf("pusher_internal:")===0||L.indexOf("pusher:")===0||this.emit(L,Q)}),T(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:T,resolve:L,reject:Q}=Mr();T.done=!1;const ie=()=>{T.done=!0};T.then(ie).catch(ie),this.signinDonePromise=T,this._signinDoneResolve=L}}class Zr{static ready(){Zr.isReady=!0;for(var T=0,L=Zr.instances.length;Tet.getDefaultStrategy(this.config,ie,kd);this.connection=ki.createConnectionManager(this.key,{getStrategy:Q,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",ie=>{var Oe=ie.event,Ze=Oe.indexOf("pusher_internal:")===0;if(ie.channel){var st=this.channel(ie.channel);st&&st.handleEvent(ie)}Ze||this.global_emitter.emit(ie.event,ie.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",ie=>{Y.warn(ie)}),Zr.instances.push(this),this.timeline.info({instances:Zr.instances.length}),this.user=new La(this),Zr.isReady&&this.connect()}switchCluster(T){const{appKey:L,cluster:Q}=T;this.key=L,this.options=Object.assign(Object.assign({},this.options),{cluster:Q}),this.config=cf(this.options,this),this.connection.switchCluster(this.key)}channel(T){return this.channels.find(T)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var T=this.connection.isUsingTLS(),L=this.timelineSender;this.timelineSenderTimer=new X(6e4,function(){L.send(T)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(T,L,Q){return this.global_emitter.bind(T,L,Q),this}unbind(T,L,Q){return this.global_emitter.unbind(T,L,Q),this}bind_global(T){return this.global_emitter.bind_global(T),this}unbind_global(T){return this.global_emitter.unbind_global(T),this}unbind_all(T){return this.global_emitter.unbind_all(),this}subscribeAll(){var T;for(T in this.channels.channels)this.channels.channels.hasOwnProperty(T)&&this.subscribe(T)}subscribe(T){var L=this.channels.add(T,this);return L.subscriptionPending&&L.subscriptionCancelled?L.reinstateSubscription():!L.subscriptionPending&&this.connection.state==="connected"&&L.subscribe(),L}unsubscribe(T){var L=this.channels.find(T);L&&L.subscriptionPending?L.cancelSubscription():(L=this.channels.remove(T),L&&L.subscribed&&L.unsubscribe())}send_event(T,L,Q){return this.connection.send_event(T,L,Q)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Zr.instances=[],Zr.isReady=!1,Zr.logToConsole=!1,Zr.Runtime=et,Zr.ScriptReceivers=et.ScriptReceivers,Zr.DependenciesReceivers=et.DependenciesReceivers,Zr.auth_callbacks=et.auth_callbacks;var hf=n.default=Zr;function df(z){if(z==null)throw"You must pass your app key when you instantiate Pusher."}et.setup(Zr)}])})})($9);const z9=g1(tb);function fT(t,e){return function(){return t.apply(e,arguments)}}const{toString:U9}=Object.prototype,{getPrototypeOf:A1}=Object,Vv=(t=>e=>{const r=U9.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xa=t=>(t=t.toLowerCase(),e=>Vv(e)===t),Yv=t=>e=>typeof e===t,{isArray:xc}=Array,gh=Yv("undefined");function q9(t){return t!==null&&!gh(t)&&t.constructor!==null&&!gh(t.constructor)&&ea(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const hT=Xa("ArrayBuffer");function H9(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&hT(t.buffer),e}const W9=Yv("string"),ea=Yv("function"),dT=Yv("number"),jv=t=>t!==null&&typeof t=="object",V9=t=>t===!0||t===!1,bm=t=>{if(Vv(t)!=="object")return!1;const e=A1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Y9=Xa("Date"),j9=Xa("File"),G9=Xa("Blob"),X9=Xa("FileList"),Z9=t=>jv(t)&&ea(t.pipe),K9=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ea(t.append)&&((e=Vv(t))==="formdata"||e==="object"&&ea(t.toString)&&t.toString()==="[object FormData]"))},J9=Xa("URLSearchParams"),Q9=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vh(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),xc(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}const mT=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),vT=t=>!gh(t)&&t!==mT;function rb(){const{caseless:t}=vT(this)&&this||{},e={},r=(n,i)=>{const a=t&&pT(e,i)||i;bm(e[a])&&bm(n)?e[a]=rb(e[a],n):bm(n)?e[a]=rb({},n):xc(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n(Vh(e,(i,a)=>{r&&ea(i)?t[a]=fT(i,r):t[a]=i},{allOwnKeys:n}),t),t7=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),r7=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},n7=(t,e,r,n)=>{let i,a,s;const o={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],(!n||n(s,t,e))&&!o[s]&&(e[s]=t[s],o[s]=!0);t=r!==!1&&A1(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},i7=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},a7=t=>{if(!t)return null;if(xc(t))return t;let e=t.length;if(!dT(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},s7=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&A1(Uint8Array)),o7=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const a=i.value;e.call(t,a[0],a[1])}},u7=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},l7=Xa("HTMLFormElement"),c7=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),I_=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),f7=Xa("RegExp"),gT=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Vh(r,(i,a)=>{let s;(s=e(i,a,t))!==!1&&(n[a]=s||i)}),Object.defineProperties(t,n)},h7=t=>{gT(t,(e,r)=>{if(ea(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(ea(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},d7=(t,e)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return xc(t)?n(t):n(String(t).split(e)),r},p7=()=>{},m7=(t,e)=>(t=+t,Number.isFinite(t)?t:e),dy="abcdefghijklmnopqrstuvwxyz",k_="0123456789",yT={DIGIT:k_,ALPHA:dy,ALPHA_DIGIT:dy+dy.toUpperCase()+k_},v7=(t=16,e=yT.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function g7(t){return!!(t&&ea(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const y7=t=>{const e=new Array(10),r=(n,i)=>{if(jv(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const a=xc(n)?[]:{};return Vh(n,(s,o)=>{const u=r(s,i+1);!gh(u)&&(a[o]=u)}),e[i]=void 0,a}}return n};return r(t,0)},b7=Xa("AsyncFunction"),x7=t=>t&&(jv(t)||ea(t))&&ea(t.then)&&ea(t.catch),Le={isArray:xc,isArrayBuffer:hT,isBuffer:q9,isFormData:K9,isArrayBufferView:H9,isString:W9,isNumber:dT,isBoolean:V9,isObject:jv,isPlainObject:bm,isUndefined:gh,isDate:Y9,isFile:j9,isBlob:G9,isRegExp:f7,isFunction:ea,isStream:Z9,isURLSearchParams:J9,isTypedArray:s7,isFileList:X9,forEach:Vh,merge:rb,extend:e7,trim:Q9,stripBOM:t7,inherits:r7,toFlatObject:n7,kindOf:Vv,kindOfTest:Xa,endsWith:i7,toArray:a7,forEachEntry:o7,matchAll:u7,isHTMLForm:l7,hasOwnProperty:I_,hasOwnProp:I_,reduceDescriptors:gT,freezeMethods:h7,toObjectSet:d7,toCamelCase:c7,noop:p7,toFiniteNumber:m7,findKey:pT,global:mT,isContextDefined:vT,ALPHABET:yT,generateString:v7,isSpecCompliantForm:g7,toJSONObject:y7,isAsyncFn:b7,isThenable:x7};function nr(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Le.inherits(nr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Le.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const bT=nr.prototype,xT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{xT[t]={value:t}});Object.defineProperties(nr,xT);Object.defineProperty(bT,"isAxiosError",{value:!0});nr.from=(t,e,r,n,i,a)=>{const s=Object.create(bT);return Le.toFlatObject(t,s,function(u){return u!==Error.prototype},o=>o!=="isAxiosError"),nr.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,a&&Object.assign(s,a),s};const w7=null;function nb(t){return Le.isPlainObject(t)||Le.isArray(t)}function wT(t){return Le.endsWith(t,"[]")?t.slice(0,-2):t}function L_(t,e,r){return t?t.concat(e).map(function(i,a){return i=wT(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function S7(t){return Le.isArray(t)&&!t.some(nb)}const _7=Le.toFlatObject(Le,{},null,function(e){return/^is[A-Z]/.test(e)});function Gv(t,e,r){if(!Le.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Le.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,b){return!Le.isUndefined(b[m])});const n=r.metaTokens,i=r.visitor||c,a=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Le.isSpecCompliantForm(e);if(!Le.isFunction(i))throw new TypeError("visitor must be a function");function l(v){if(v===null)return"";if(Le.isDate(v))return v.toISOString();if(!u&&Le.isBlob(v))throw new nr("Blob is not supported. Use a Buffer instead.");return Le.isArrayBuffer(v)||Le.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function c(v,m,b){let y=v;if(v&&!b&&typeof v=="object"){if(Le.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(Le.isArray(v)&&S7(v)||(Le.isFileList(v)||Le.endsWith(m,"[]"))&&(y=Le.toArray(v)))return m=wT(m),y.forEach(function(x,A){!(Le.isUndefined(x)||x===null)&&e.append(s===!0?L_([m],A,a):s===null?m:m+"[]",l(x))}),!1}return nb(v)?!0:(e.append(L_(b,m,a),l(v)),!1)}const f=[],h=Object.assign(_7,{defaultVisitor:c,convertValue:l,isVisitable:nb});function p(v,m){if(!Le.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(v),Le.forEach(v,function(y,S){(!(Le.isUndefined(y)||y===null)&&i.call(e,y,Le.isString(S)?S.trim():S,m,h))===!0&&p(y,m?m.concat(S):[S])}),f.pop()}}if(!Le.isObject(t))throw new TypeError("data must be an object");return p(t),e}function $_(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function D1(t,e){this._pairs=[],t&&Gv(t,this,e)}const ST=D1.prototype;ST.append=function(e,r){this._pairs.push([e,r])};ST.toString=function(e){const r=e?function(n){return e.call(this,n,$_)}:$_;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function A7(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _T(t,e,r){if(!e)return t;const n=r&&r.encode||A7,i=r&&r.serialize;let a;if(i?a=i(e,r):a=Le.isURLSearchParams(e)?e.toString():new D1(e,r).toString(n),a){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class D7{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Le.forEach(this.handlers,function(n){n!==null&&e(n)})}}const z_=D7,AT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},N7=typeof URLSearchParams<"u"?URLSearchParams:D1,E7=typeof FormData<"u"?FormData:null,C7=typeof Blob<"u"?Blob:null,M7={isBrowser:!0,classes:{URLSearchParams:N7,FormData:E7,Blob:C7},protocols:["http","https","file","blob","url","data"]},DT=typeof window<"u"&&typeof document<"u",T7=(t=>DT&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),O7=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),F7=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:DT,hasStandardBrowserEnv:T7,hasStandardBrowserWebWorkerEnv:O7},Symbol.toStringTag,{value:"Module"})),Va={...F7,...M7};function R7(t,e){return Gv(t,new Va.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Va.isNode&&Le.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function B7(t){return Le.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function P7(t){const e={},r=Object.keys(t);let n;const i=r.length;let a;for(n=0;n=r.length;return s=!s&&Le.isArray(i)?i.length:s,u?(Le.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!o):((!i[s]||!Le.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],a)&&Le.isArray(i[s])&&(i[s]=P7(i[s])),!o)}if(Le.isFormData(t)&&Le.isFunction(t.entries)){const r={};return Le.forEachEntry(t,(n,i)=>{e(B7(n),i,r,0)}),r}return null}function I7(t,e,r){if(Le.isString(t))try{return(e||JSON.parse)(t),Le.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const N1={transitional:AT,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Le.isObject(e);if(a&&Le.isHTMLForm(e)&&(e=new FormData(e)),Le.isFormData(e))return i?JSON.stringify(NT(e)):e;if(Le.isArrayBuffer(e)||Le.isBuffer(e)||Le.isStream(e)||Le.isFile(e)||Le.isBlob(e))return e;if(Le.isArrayBufferView(e))return e.buffer;if(Le.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return R7(e,this.formSerializer).toString();if((o=Le.isFileList(e))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Gv(o?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),I7(e)):e}],transformResponse:[function(e){const r=this.transitional||N1.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Le.isString(e)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(o){if(s)throw o.name==="SyntaxError"?nr.from(o,nr.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Va.classes.FormData,Blob:Va.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Le.forEach(["delete","get","head","post","put","patch"],t=>{N1.headers[t]={}});const E1=N1,k7=Le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),L7=t=>{const e={};let r,n,i;return t&&t.split(` +`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&k7[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},U_=Symbol("internals");function Pf(t){return t&&String(t).trim().toLowerCase()}function xm(t){return t===!1||t==null?t:Le.isArray(t)?t.map(xm):String(t)}function $7(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const z7=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function py(t,e,r,n,i){if(Le.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!Le.isString(e)){if(Le.isString(n))return e.indexOf(n)!==-1;if(Le.isRegExp(n))return n.test(e)}}function U7(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function q7(t,e){const r=Le.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,s){return this[n].call(this,e,i,a,s)},configurable:!0})})}class Xv{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function a(o,u,l){const c=Pf(u);if(!c)throw new Error("header name must be a non-empty string");const f=Le.findKey(i,c);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||u]=xm(o))}const s=(o,u)=>Le.forEach(o,(l,c)=>a(l,c,u));return Le.isPlainObject(e)||e instanceof this.constructor?s(e,r):Le.isString(e)&&(e=e.trim())&&!z7(e)?s(L7(e),r):e!=null&&a(r,e,n),this}get(e,r){if(e=Pf(e),e){const n=Le.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return $7(i);if(Le.isFunction(r))return r.call(this,i,n);if(Le.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Pf(e),e){const n=Le.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||py(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function a(s){if(s=Pf(s),s){const o=Le.findKey(n,s);o&&(!r||py(n,n[o],o,r))&&(delete n[o],i=!0)}}return Le.isArray(e)?e.forEach(a):a(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!e||py(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const r=this,n={};return Le.forEach(this,(i,a)=>{const s=Le.findKey(n,a);if(s){r[s]=xm(i),delete r[a];return}const o=e?U7(a):String(a).trim();o!==a&&delete r[a],r[o]=xm(i),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return Le.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&Le.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[U_]=this[U_]={accessors:{}}).accessors,i=this.prototype;function a(s){const o=Pf(s);n[o]||(q7(i,s),n[o]=!0)}return Le.isArray(e)?e.forEach(a):a(e),this}}Xv.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Le.reduceDescriptors(Xv.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});Le.freezeMethods(Xv);const Is=Xv;function my(t,e){const r=this||E1,n=e||r,i=Is.from(n.headers);let a=n.data;return Le.forEach(t,function(o){a=o.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function ET(t){return!!(t&&t.__CANCEL__)}function Yh(t,e,r){nr.call(this,t??"canceled",nr.ERR_CANCELED,e,r),this.name="CanceledError"}Le.inherits(Yh,nr,{__CANCEL__:!0});function H7(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new nr("Request failed with status code "+r.status,[nr.ERR_BAD_REQUEST,nr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const W7=Va.hasStandardBrowserEnv?{write(t,e,r,n,i,a){const s=[t+"="+encodeURIComponent(e)];Le.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Le.isString(n)&&s.push("path="+n),Le.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function V7(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Y7(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function CT(t,e){return t&&!V7(e)?Y7(t,e):e}const j7=Va.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(a){let s=a;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(s){const o=Le.isString(s)?i(s):s;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function G7(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function X7(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,a=0,s;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),c=n[a];s||(s=l),r[i]=u,n[i]=l;let f=a,h=0;for(;f!==i;)h+=r[f++],f=f%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),l-s{const a=i.loaded,s=i.lengthComputable?i.total:void 0,o=a-r,u=n(o),l=a<=s;r=a;const c={loaded:a,total:s,progress:s?a/s:void 0,bytes:o,rate:u||void 0,estimated:u&&s&&l?(s-a)/u:void 0,event:i};c[e?"download":"upload"]=!0,t(c)}}const Z7=typeof XMLHttpRequest<"u",K7=Z7&&function(t){return new Promise(function(r,n){let i=t.data;const a=Is.from(t.headers).normalize();let{responseType:s,withXSRFToken:o}=t,u;function l(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}let c;if(Le.isFormData(i)){if(Va.hasStandardBrowserEnv||Va.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((c=a.getContentType())!==!1){const[m,...b]=c?c.split(";").map(y=>y.trim()).filter(Boolean):[];a.setContentType([m||"multipart/form-data",...b].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",b=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(m+":"+b))}const h=CT(t.baseURL,t.url);f.open(t.method.toUpperCase(),_T(h,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function p(){if(!f)return;const m=Is.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:m,config:t,request:f};H7(function(x){r(x),l()},function(x){n(x),l()},y),f=null}if("onloadend"in f?f.onloadend=p:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(p)},f.onabort=function(){f&&(n(new nr("Request aborted",nr.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new nr("Network Error",nr.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let b=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||AT;t.timeoutErrorMessage&&(b=t.timeoutErrorMessage),n(new nr(b,y.clarifyTimeoutError?nr.ETIMEDOUT:nr.ECONNABORTED,t,f)),f=null},Va.hasStandardBrowserEnv&&(o&&Le.isFunction(o)&&(o=o(t)),o||o!==!1&&j7(h))){const m=t.xsrfHeaderName&&t.xsrfCookieName&&W7.read(t.xsrfCookieName);m&&a.set(t.xsrfHeaderName,m)}i===void 0&&a.setContentType(null),"setRequestHeader"in f&&Le.forEach(a.toJSON(),function(b,y){f.setRequestHeader(y,b)}),Le.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",q_(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",q_(t.onUploadProgress)),(t.cancelToken||t.signal)&&(u=m=>{f&&(n(!m||m.type?new Yh(null,t,f):m),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u)));const v=G7(h);if(v&&Va.protocols.indexOf(v)===-1){n(new nr("Unsupported protocol "+v+":",nr.ERR_BAD_REQUEST,t));return}f.send(i||null)})},ib={http:w7,xhr:K7};Le.forEach(ib,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const H_=t=>`- ${t}`,J7=t=>Le.isFunction(t)||t===null||t===!1,MT={getAdapter:t=>{t=Le.isArray(t)?t:[t];const{length:e}=t;let r,n;const i={};for(let a=0;a`adapter ${o} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=e?a.length>1?`since : +`+a.map(H_).join(` +`):" "+H_(a[0]):"as no adapter specified";throw new nr("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:ib};function vy(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yh(null,t)}function W_(t){return vy(t),t.headers=Is.from(t.headers),t.data=my.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),MT.getAdapter(t.adapter||E1.adapter)(t).then(function(n){return vy(t),n.data=my.call(t,t.transformResponse,n),n.headers=Is.from(n.headers),n},function(n){return ET(n)||(vy(t),n&&n.response&&(n.response.data=my.call(t,t.transformResponse,n.response),n.response.headers=Is.from(n.response.headers))),Promise.reject(n)})}const V_=t=>t instanceof Is?t.toJSON():t;function ec(t,e){e=e||{};const r={};function n(l,c,f){return Le.isPlainObject(l)&&Le.isPlainObject(c)?Le.merge.call({caseless:f},l,c):Le.isPlainObject(c)?Le.merge({},c):Le.isArray(c)?c.slice():c}function i(l,c,f){if(Le.isUndefined(c)){if(!Le.isUndefined(l))return n(void 0,l,f)}else return n(l,c,f)}function a(l,c){if(!Le.isUndefined(c))return n(void 0,c)}function s(l,c){if(Le.isUndefined(c)){if(!Le.isUndefined(l))return n(void 0,l)}else return n(void 0,c)}function o(l,c,f){if(f in e)return n(l,c);if(f in t)return n(void 0,l)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(l,c)=>i(V_(l),V_(c),!0)};return Le.forEach(Object.keys(Object.assign({},t,e)),function(c){const f=u[c]||i,h=f(t[c],e[c],c);Le.isUndefined(h)&&f!==o||(r[c]=h)}),r}const TT="1.6.7",C1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{C1[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Y_={};C1.transitional=function(e,r,n){function i(a,s){return"[Axios v"+TT+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,o)=>{if(e===!1)throw new nr(i(s," has been removed"+(r?" in "+r:"")),nr.ERR_DEPRECATED);return r&&!Y_[s]&&(Y_[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,o):!0}};function Q7(t,e,r){if(typeof t!="object")throw new nr("options must be an object",nr.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const a=n[i],s=e[a];if(s){const o=t[a],u=o===void 0||s(o,a,t);if(u!==!0)throw new nr("option "+a+" must be "+u,nr.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new nr("Unknown option "+a,nr.ERR_BAD_OPTION)}}const ab={assertOptions:Q7,validators:C1},po=ab.validators;class Im{constructor(e){this.defaults=e,this.interceptors={request:new z_,response:new z_}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+a):n.stack=a}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ec(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&ab.assertOptions(n,{silentJSONParsing:po.transitional(po.boolean),forcedJSONParsing:po.transitional(po.boolean),clarifyTimeoutError:po.transitional(po.boolean)},!1),i!=null&&(Le.isFunction(i)?r.paramsSerializer={serialize:i}:ab.assertOptions(i,{encode:po.function,serialize:po.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=a&&Le.merge(a.common,a[r.method]);a&&Le.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=Is.concat(s,a);const o=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(u=u&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let c,f=0,h;if(!u){const v=[W_.bind(this),void 0];for(v.unshift.apply(v,o),v.push.apply(v,l),h=v.length,c=Promise.resolve(r);f{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const s=new Promise(o=>{n.subscribe(o),a=o}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},e(function(a,s,o){n.reason||(n.reason=new Yh(a,s,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new M1(function(i){e=i}),cancel:e}}}const eU=M1;function tU(t){return function(r){return t.apply(null,r)}}function rU(t){return Le.isObject(t)&&t.isAxiosError===!0}const sb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sb).forEach(([t,e])=>{sb[e]=t});const nU=sb;function OT(t){const e=new wm(t),r=fT(wm.prototype.request,e);return Le.extend(r,wm.prototype,e,{allOwnKeys:!0}),Le.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return OT(ec(t,i))},r}const rn=OT(E1);rn.Axios=wm;rn.CanceledError=Yh;rn.CancelToken=eU;rn.isCancel=ET;rn.VERSION=TT;rn.toFormData=Gv;rn.AxiosError=nr;rn.Cancel=rn.CanceledError;rn.all=function(e){return Promise.all(e)};rn.spread=tU;rn.isAxiosError=rU;rn.mergeConfig=ec;rn.AxiosHeaders=Is;rn.formToJSON=t=>NT(Le.isHTMLForm(t)?new FormData(t):t);rn.getAdapter=MT.getAdapter;rn.HttpStatusCode=nU;rn.default=rn;const FT=rn;/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function jh(t){return t+.5|0}const Ao=(t,e,r)=>Math.max(Math.min(t,r),e);function Gf(t){return Ao(jh(t*2.55),0,255)}function Fo(t){return Ao(jh(t*255),0,255)}function Ns(t){return Ao(jh(t/2.55)/100,0,1)}function H_(t){return Ao(jh(t*100),0,100)}const Wi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ib=[..."0123456789ABCDEF"],nU=t=>ib[t&15],iU=t=>ib[(t&240)>>4]+ib[t&15],Fp=t=>(t&240)>>4===(t&15),aU=t=>Fp(t.r)&&Fp(t.g)&&Fp(t.b)&&Fp(t.a);function sU(t){var e=t.length,r;return t[0]==="#"&&(e===4||e===5?r={r:255&Wi[t[1]]*17,g:255&Wi[t[2]]*17,b:255&Wi[t[3]]*17,a:e===5?Wi[t[4]]*17:255}:(e===7||e===9)&&(r={r:Wi[t[1]]<<4|Wi[t[2]],g:Wi[t[3]]<<4|Wi[t[4]],b:Wi[t[5]]<<4|Wi[t[6]],a:e===9?Wi[t[7]]<<4|Wi[t[8]]:255})),r}const oU=(t,e)=>t<255?e(t):"";function uU(t){var e=aU(t)?nU:iU;return t?"#"+e(t.r)+e(t.g)+e(t.b)+oU(t.a,e):void 0}const lU=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function OT(t,e,r){const n=e*Math.min(r,1-r),i=(a,s=(a+t/30)%12)=>r-n*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function cU(t,e,r){const n=(i,a=(i+t/60)%6)=>r-r*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function fU(t,e,r){const n=OT(t,1,.5);let i;for(e+r>1&&(i=1/(e+r),e*=i,r*=i),i=0;i<3;i++)n[i]*=1-e-r,n[i]+=e;return n}function hU(t,e,r,n,i){return t===i?(e-r)/n+(e.5?c/(2-a-s):c/(a+s),u=hU(r,n,i,c,a),u=u*60+.5),[u|0,l||0,o]}function x1(t,e,r,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,r,n)).map(Fo)}function w1(t,e,r){return x1(OT,t,e,r)}function dU(t,e,r){return x1(fU,t,e,r)}function pU(t,e,r){return x1(cU,t,e,r)}function FT(t){return(t%360+360)%360}function mU(t){const e=lU.exec(t);let r=255,n;if(!e)return;e[5]!==n&&(r=e[6]?Gf(+e[5]):Fo(+e[5]));const i=FT(+e[2]),a=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?n=dU(i,a,s):e[1]==="hsv"?n=pU(i,a,s):n=w1(i,a,s),{r:n[0],g:n[1],b:n[2],a:r}}function vU(t,e){var r=b1(t);r[0]=FT(r[0]+e),r=w1(r),t.r=r[0],t.g=r[1],t.b=r[2]}function gU(t){if(!t)return;const e=b1(t),r=e[0],n=H_(e[1]),i=H_(e[2]);return t.a<255?`hsla(${r}, ${n}%, ${i}%, ${Ns(t.a)})`:`hsl(${r}, ${n}%, ${i}%)`}const W_={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},V_={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function yU(){const t={},e=Object.keys(V_),r=Object.keys(W_);let n,i,a,s,o;for(n=0;n>16&255,a>>8&255,a&255]}return t}let Rp;function bU(t){Rp||(Rp=yU(),Rp.transparent=[0,0,0,0]);const e=Rp[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const xU=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function wU(t){const e=xU.exec(t);let r=255,n,i,a;if(e){if(e[7]!==n){const s=+e[7];r=e[8]?Gf(s):Ao(s*255,0,255)}return n=+e[1],i=+e[3],a=+e[5],n=255&(e[2]?Gf(n):Ao(n,0,255)),i=255&(e[4]?Gf(i):Ao(i,0,255)),a=255&(e[6]?Gf(a):Ao(a,0,255)),{r:n,g:i,b:a,a:r}}}function SU(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ns(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const my=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Nl=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function _U(t,e,r){const n=Nl(Ns(t.r)),i=Nl(Ns(t.g)),a=Nl(Ns(t.b));return{r:Fo(my(n+r*(Nl(Ns(e.r))-n))),g:Fo(my(i+r*(Nl(Ns(e.g))-i))),b:Fo(my(a+r*(Nl(Ns(e.b))-a))),a:t.a+r*(e.a-t.a)}}function Bp(t,e,r){if(t){let n=b1(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*r,e===0?360:1)),n=w1(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function RT(t,e){return t&&Object.assign(e||{},t)}function Y_(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Fo(t[3]))):(e=RT(t,{r:0,g:0,b:0,a:1}),e.a=Fo(e.a)),e}function AU(t){return t.charAt(0)==="r"?wU(t):mU(t)}class yh{constructor(e){if(e instanceof yh)return e;const r=typeof e;let n;r==="object"?n=Y_(e):r==="string"&&(n=sU(e)||bU(e)||AU(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=RT(this._rgb);return e&&(e.a=Ns(e.a)),e}set rgb(e){this._rgb=Y_(e)}rgbString(){return this._valid?SU(this._rgb):void 0}hexString(){return this._valid?uU(this._rgb):void 0}hslString(){return this._valid?gU(this._rgb):void 0}mix(e,r){if(e){const n=this.rgb,i=e.rgb;let a;const s=r===a?.5:r,o=2*s-1,u=n.a-i.a,l=((o*u===-1?o:(o+u)/(1+o*u))+1)/2;a=1-l,n.r=255&l*n.r+a*i.r+.5,n.g=255&l*n.g+a*i.g+.5,n.b=255&l*n.b+a*i.b+.5,n.a=s*n.a+(1-s)*i.a,this.rgb=n}return this}interpolate(e,r){return e&&(this._rgb=_U(this._rgb,e._rgb,r)),this}clone(){return new yh(this.rgb)}alpha(e){return this._rgb.a=Fo(e),this}clearer(e){const r=this._rgb;return r.a*=1-e,this}greyscale(){const e=this._rgb,r=jh(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=r,this}opaquer(e){const r=this._rgb;return r.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bp(this._rgb,2,e),this}darken(e){return Bp(this._rgb,2,-e),this}saturate(e){return Bp(this._rgb,1,e),this}desaturate(e){return Bp(this._rgb,1,-e),this}rotate(e){return vU(this._rgb,e),this}}/*! + */function jh(t){return t+.5|0}const Ao=(t,e,r)=>Math.max(Math.min(t,r),e);function jf(t){return Ao(jh(t*2.55),0,255)}function Fo(t){return Ao(jh(t*255),0,255)}function Ns(t){return Ao(jh(t/2.55)/100,0,1)}function j_(t){return Ao(jh(t*100),0,100)}const Wi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ob=[..."0123456789ABCDEF"],iU=t=>ob[t&15],aU=t=>ob[(t&240)>>4]+ob[t&15],Fp=t=>(t&240)>>4===(t&15),sU=t=>Fp(t.r)&&Fp(t.g)&&Fp(t.b)&&Fp(t.a);function oU(t){var e=t.length,r;return t[0]==="#"&&(e===4||e===5?r={r:255&Wi[t[1]]*17,g:255&Wi[t[2]]*17,b:255&Wi[t[3]]*17,a:e===5?Wi[t[4]]*17:255}:(e===7||e===9)&&(r={r:Wi[t[1]]<<4|Wi[t[2]],g:Wi[t[3]]<<4|Wi[t[4]],b:Wi[t[5]]<<4|Wi[t[6]],a:e===9?Wi[t[7]]<<4|Wi[t[8]]:255})),r}const uU=(t,e)=>t<255?e(t):"";function lU(t){var e=sU(t)?iU:aU;return t?"#"+e(t.r)+e(t.g)+e(t.b)+uU(t.a,e):void 0}const cU=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function RT(t,e,r){const n=e*Math.min(r,1-r),i=(a,s=(a+t/30)%12)=>r-n*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function fU(t,e,r){const n=(i,a=(i+t/60)%6)=>r-r*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function hU(t,e,r){const n=RT(t,1,.5);let i;for(e+r>1&&(i=1/(e+r),e*=i,r*=i),i=0;i<3;i++)n[i]*=1-e-r,n[i]+=e;return n}function dU(t,e,r,n,i){return t===i?(e-r)/n+(e.5?c/(2-a-s):c/(a+s),u=dU(r,n,i,c,a),u=u*60+.5),[u|0,l||0,o]}function O1(t,e,r,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,r,n)).map(Fo)}function F1(t,e,r){return O1(RT,t,e,r)}function pU(t,e,r){return O1(hU,t,e,r)}function mU(t,e,r){return O1(fU,t,e,r)}function BT(t){return(t%360+360)%360}function vU(t){const e=cU.exec(t);let r=255,n;if(!e)return;e[5]!==n&&(r=e[6]?jf(+e[5]):Fo(+e[5]));const i=BT(+e[2]),a=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?n=pU(i,a,s):e[1]==="hsv"?n=mU(i,a,s):n=F1(i,a,s),{r:n[0],g:n[1],b:n[2],a:r}}function gU(t,e){var r=T1(t);r[0]=BT(r[0]+e),r=F1(r),t.r=r[0],t.g=r[1],t.b=r[2]}function yU(t){if(!t)return;const e=T1(t),r=e[0],n=j_(e[1]),i=j_(e[2]);return t.a<255?`hsla(${r}, ${n}%, ${i}%, ${Ns(t.a)})`:`hsl(${r}, ${n}%, ${i}%)`}const G_={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},X_={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bU(){const t={},e=Object.keys(X_),r=Object.keys(G_);let n,i,a,s,o;for(n=0;n>16&255,a>>8&255,a&255]}return t}let Rp;function xU(t){Rp||(Rp=bU(),Rp.transparent=[0,0,0,0]);const e=Rp[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const wU=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function SU(t){const e=wU.exec(t);let r=255,n,i,a;if(e){if(e[7]!==n){const s=+e[7];r=e[8]?jf(s):Ao(s*255,0,255)}return n=+e[1],i=+e[3],a=+e[5],n=255&(e[2]?jf(n):Ao(n,0,255)),i=255&(e[4]?jf(i):Ao(i,0,255)),a=255&(e[6]?jf(a):Ao(a,0,255)),{r:n,g:i,b:a,a:r}}}function _U(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ns(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const gy=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Nl=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function AU(t,e,r){const n=Nl(Ns(t.r)),i=Nl(Ns(t.g)),a=Nl(Ns(t.b));return{r:Fo(gy(n+r*(Nl(Ns(e.r))-n))),g:Fo(gy(i+r*(Nl(Ns(e.g))-i))),b:Fo(gy(a+r*(Nl(Ns(e.b))-a))),a:t.a+r*(e.a-t.a)}}function Bp(t,e,r){if(t){let n=T1(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*r,e===0?360:1)),n=F1(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function PT(t,e){return t&&Object.assign(e||{},t)}function Z_(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Fo(t[3]))):(e=PT(t,{r:0,g:0,b:0,a:1}),e.a=Fo(e.a)),e}function DU(t){return t.charAt(0)==="r"?SU(t):vU(t)}class yh{constructor(e){if(e instanceof yh)return e;const r=typeof e;let n;r==="object"?n=Z_(e):r==="string"&&(n=oU(e)||xU(e)||DU(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=PT(this._rgb);return e&&(e.a=Ns(e.a)),e}set rgb(e){this._rgb=Z_(e)}rgbString(){return this._valid?_U(this._rgb):void 0}hexString(){return this._valid?lU(this._rgb):void 0}hslString(){return this._valid?yU(this._rgb):void 0}mix(e,r){if(e){const n=this.rgb,i=e.rgb;let a;const s=r===a?.5:r,o=2*s-1,u=n.a-i.a,l=((o*u===-1?o:(o+u)/(1+o*u))+1)/2;a=1-l,n.r=255&l*n.r+a*i.r+.5,n.g=255&l*n.g+a*i.g+.5,n.b=255&l*n.b+a*i.b+.5,n.a=s*n.a+(1-s)*i.a,this.rgb=n}return this}interpolate(e,r){return e&&(this._rgb=AU(this._rgb,e._rgb,r)),this}clone(){return new yh(this.rgb)}alpha(e){return this._rgb.a=Fo(e),this}clearer(e){const r=this._rgb;return r.a*=1-e,this}greyscale(){const e=this._rgb,r=jh(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=r,this}opaquer(e){const r=this._rgb;return r.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bp(this._rgb,2,e),this}darken(e){return Bp(this._rgb,2,-e),this}saturate(e){return Bp(this._rgb,1,e),this}desaturate(e){return Bp(this._rgb,1,-e),this}rotate(e){return gU(this._rgb,e),this}}/*! * Chart.js v4.4.2 * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */function gs(){}const DU=(()=>{let t=0;return()=>t++})();function or(t){return t===null||typeof t>"u"}function Or(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Gt(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Vr(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Ci(t,e){return Vr(t)?t:e}function Bt(t,e){return typeof t>"u"?e:t}const NU=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,BT=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Cr(t,e,r){if(t&&typeof t.call=="function")return t.apply(r,e)}function yr(t,e,r,n){let i,a,s;if(Or(t))if(a=t.length,n)for(i=a-1;i>=0;i--)e.call(r,t[i],i);else for(i=0;it,x:t=>t.x,y:t=>t.y};function MU(t){const e=t.split("."),r=[];let n="";for(const i of e)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(r.push(n),n="");return r}function TU(t){const e=MU(t);return r=>{for(const n of e){if(n==="")break;r=r&&r[n]}return r}}function Po(t,e){return(j_[e]||(j_[e]=TU(e)))(t)}function S1(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xh=t=>typeof t<"u",Io=t=>typeof t=="function",G_=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0};function OU(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Rr=Math.PI,Fr=2*Rr,FU=Fr+Rr,zm=Number.POSITIVE_INFINITY,RU=Rr/180,en=Rr/2,pu=Rr/4,X_=Rr*2/3,Do=Math.log10,Ya=Math.sign;function nh(t,e,r){return Math.abs(t-e)i-a).pop(),e}function tc(t){return!isNaN(parseFloat(t))&&isFinite(t)}function PU(t,e){const r=Math.round(t);return r-e<=t&&r+e>=t}function IT(t,e,r){let n,i,a;for(n=0,i=t.length;nu&&l=Math.min(e,r)-n&&t<=Math.max(e,r)+n}function A1(t,e,r){r=r||(s=>t[s]1;)a=i+n>>1,r(a)?i=a:n=a;return{lo:i,hi:n}}const Ms=(t,e,r,n)=>A1(t,r,n?i=>{const a=t[i][e];return at[i][e]A1(t,r,n=>t[n][e]>=r);function $U(t,e,r){let n=0,i=t.length;for(;nn&&t[i-1]>r;)i--;return n>0||i{const n="_onData"+S1(r),i=t[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value(...a){const s=i.apply(this,a);return t._chartjs.listeners.forEach(o=>{typeof o[n]=="function"&&o[n](...a)}),s}})})}function J_(t,e){const r=t._chartjs;if(!r)return;const n=r.listeners,i=n.indexOf(e);i!==-1&&n.splice(i,1),!(n.length>0)&&(LT.forEach(a=>{delete t[a]}),delete t._chartjs)}function $T(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const zT=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function UT(t,e){let r=[],n=!1;return function(...i){r=i,n||(n=!0,zT.call(window,()=>{n=!1,t.apply(e,r)}))}}function UU(t,e){let r;return function(...n){return e?(clearTimeout(r),r=setTimeout(t,e,n)):t.apply(this,n),e}}const D1=t=>t==="start"?"left":t==="end"?"right":"center",kn=(t,e,r)=>t==="start"?e:t==="end"?r:(e+r)/2,qU=(t,e,r,n)=>t===(n?"left":"right")?r:t==="center"?(e+r)/2:e;function qT(t,e,r){const n=e.length;let i=0,a=n;if(t._sorted){const{iScale:s,_parsed:o}=t,u=s.axis,{min:l,max:c,minDefined:f,maxDefined:h}=s.getUserBounds();f&&(i=wn(Math.min(Ms(o,u,l).lo,r?n:Ms(e,u,s.getPixelForValue(l)).lo),0,n-1)),h?a=wn(Math.max(Ms(o,s.axis,c,!0).hi+1,r?0:Ms(e,u,s.getPixelForValue(c),!0).hi+1),i,n)-i:a=n-i}return{start:i,count:a}}function HT(t){const{xScale:e,yScale:r,_scaleRanges:n}=t,i={xmin:e.min,xmax:e.max,ymin:r.min,ymax:r.max};if(!n)return t._scaleRanges=i,!0;const a=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==r.min||n.ymax!==r.max;return Object.assign(n,i),a}const Pp=t=>t===0||t===1,Q_=(t,e,r)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Fr/r)),eA=(t,e,r)=>Math.pow(2,-10*t)*Math.sin((t-e)*Fr/r)+1,ih={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*en)+1,easeOutSine:t=>Math.sin(t*en),easeInOutSine:t=>-.5*(Math.cos(Rr*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Pp(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Pp(t)?t:Q_(t,.075,.3),easeOutElastic:t=>Pp(t)?t:eA(t,.075,.3),easeInOutElastic(t){return Pp(t)?t:t<.5?.5*Q_(t*2,.1125,.45):.5+.5*eA(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-ih.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?ih.easeInBounce(t*2)*.5:ih.easeOutBounce(t*2-1)*.5+.5};function N1(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function tA(t){return N1(t)?t:new yh(t)}function vy(t){return N1(t)?t:new yh(t).saturate(.5).darken(.1).hexString()}const HU=["x","y","borderWidth","radius","tension"],WU=["color","borderColor","backgroundColor"];function VU(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:WU},numbers:{type:"number",properties:HU}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function YU(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rA=new Map;function jU(t,e){e=e||{};const r=t+JSON.stringify(e);let n=rA.get(r);return n||(n=new Intl.NumberFormat(t,e),rA.set(r,n)),n}function Gh(t,e,r){return jU(e,r).format(t)}const WT={values(t){return Or(t)?t:""+t},numeric(t,e,r){if(t===0)return"0";const n=this.chart.options.locale;let i,a=t;if(r.length>1){const l=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(l<1e-4||l>1e15)&&(i="scientific"),a=GU(t,r)}const s=Do(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),u={notation:i,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(u,this.options.ticks.format),Gh(t,n,u)},logarithmic(t,e,r){if(t===0)return"0";const n=r[e].significand||t/Math.pow(10,Math.floor(Do(t)));return[1,2,3,5,10,15].includes(n)||e>.8*r.length?WT.numeric.call(this,t,e,r):""}};function GU(t,e){let r=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(r)>=1&&t!==Math.floor(t)&&(r=t-Math.floor(t)),r}var Xh={formatters:WT};function XU(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,r)=>r.lineWidth,tickColor:(e,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Xh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Bu=Object.create(null),sb=Object.create(null);function ah(t,e){if(!e)return t;const r=e.split(".");for(let n=0,i=r.length;nn.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,i)=>vy(i.backgroundColor),this.hoverBorderColor=(n,i)=>vy(i.borderColor),this.hoverColor=(n,i)=>vy(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(r)}set(e,r){return gy(this,e,r)}get(e){return ah(this,e)}describe(e,r){return gy(sb,e,r)}override(e,r){return gy(Bu,e,r)}route(e,r,n,i){const a=ah(this,e),s=ah(this,n),o="_"+r;Object.defineProperties(a,{[o]:{value:a[r],writable:!0},[r]:{enumerable:!0,get(){const u=this[o],l=s[i];return Gt(u)?Object.assign({},l,u):Bt(u,l)},set(u){this[o]=u}}})}apply(e){e.forEach(r=>r(this))}}var Ur=new ZU({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[VU,YU,XU]);function KU(t){return!t||or(t.size)||or(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Um(t,e,r,n,i){let a=e[i];return a||(a=e[i]=t.measureText(i).width,r.push(i)),a>n&&(n=a),n}function JU(t,e,r,n){n=n||{};let i=n.data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(i=n.data={},a=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let s=0;const o=r.length;let u,l,c,f,h;for(u=0;ur.length){for(u=0;u0&&t.stroke()}}function Ts(t,e,r){return r=r||.5,!e||t&&t.x>e.left-r&&t.xe.top-r&&t.y0&&a.strokeColor!=="";let u,l;for(t.save(),t.font=i.string,tq(t,a),u=0;u+t||0;function E1(t,e){const r={},n=Gt(e),i=n?Object.keys(e):e,a=Gt(t)?n?s=>Bt(t[s],t[e[s]]):s=>t[s]:()=>t;for(const s of i)r[s]=oq(a(s));return r}function YT(t){return E1(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cu(t){return E1(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Wn(t){const e=YT(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pn(t,e){t=t||{},e=e||Ur.font;let r=Bt(t.size,e.size);typeof r=="string"&&(r=parseInt(r,10));let n=Bt(t.style,e.style);n&&!(""+n).match(aq)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const i={family:Bt(t.family,e.family),lineHeight:sq(Bt(t.lineHeight,e.lineHeight),r),size:r,style:n,weight:Bt(t.weight,e.weight),string:""};return i.string=KU(i),i}function Xf(t,e,r,n){let i=!0,a,s,o;for(a=0,s=t.length;ar&&o===0?0:o+u;return{min:s(n,-Math.abs(a)),max:s(i,a)}}function Uo(t,e){return Object.assign(Object.create(t),e)}function C1(t,e=[""],r,n,i=()=>t[0]){const a=r||t;typeof n>"u"&&(n=ZT("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:n,_getTarget:i,override:o=>C1([o,...t],e,a,n)};return new Proxy(s,{deleteProperty(o,u){return delete o[u],delete o._keys,delete t[0][u],!0},get(o,u){return GT(o,u,()=>vq(u,e,t,o))},getOwnPropertyDescriptor(o,u){return Reflect.getOwnPropertyDescriptor(o._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(o,u){return aA(o).includes(u)},ownKeys(o){return aA(o)},set(o,u,l){const c=o._storage||(o._storage=i());return o[u]=c[u]=l,delete o._keys,!0}})}function rc(t,e,r,n){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:r,_stack:new Set,_descriptors:jT(t,n),setContext:a=>rc(t,a,r,n),override:a=>rc(t.override(a),e,r,n)};return new Proxy(i,{deleteProperty(a,s){return delete a[s],delete t[s],!0},get(a,s,o){return GT(a,s,()=>cq(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(t,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,s)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(a,s){return Reflect.has(t,s)},ownKeys(){return Reflect.ownKeys(t)},set(a,s,o){return t[s]=o,delete a[s],!0}})}function jT(t,e={scriptable:!0,indexable:!0}){const{_scriptable:r=e.scriptable,_indexable:n=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:r,indexable:n,isScriptable:Io(r)?r:()=>r,isIndexable:Io(n)?n:()=>n}}const lq=(t,e)=>t?t+S1(e):e,M1=(t,e)=>Gt(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function GT(t,e,r){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=r();return t[e]=n,n}function cq(t,e,r){const{_proxy:n,_context:i,_subProxy:a,_descriptors:s}=t;let o=n[e];return Io(o)&&s.isScriptable(e)&&(o=fq(e,o,t,r)),Or(o)&&o.length&&(o=hq(e,o,t,s.isIndexable)),M1(e,o)&&(o=rc(o,i,a&&a[e],s)),o}function fq(t,e,r,n){const{_proxy:i,_context:a,_subProxy:s,_stack:o}=r;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t);let u=e(a,s||n);return o.delete(t),M1(t,u)&&(u=T1(i._scopes,i,t,u)),u}function hq(t,e,r,n){const{_proxy:i,_context:a,_subProxy:s,_descriptors:o}=r;if(typeof a.index<"u"&&n(t))return e[a.index%e.length];if(Gt(e[0])){const u=e,l=i._scopes.filter(c=>c!==u);e=[];for(const c of u){const f=T1(l,i,t,c);e.push(rc(f,a,s&&s[t],o))}}return e}function XT(t,e,r){return Io(t)?t(e,r):t}const dq=(t,e)=>t===!0?e:typeof t=="string"?Po(e,t):void 0;function pq(t,e,r,n,i){for(const a of e){const s=dq(r,a);if(s){t.add(s);const o=XT(s._fallback,r,i);if(typeof o<"u"&&o!==r&&o!==n)return o}else if(s===!1&&typeof n<"u"&&r!==n)return null}return!1}function T1(t,e,r,n){const i=e._rootScopes,a=XT(e._fallback,r,n),s=[...t,...i],o=new Set;o.add(n);let u=iA(o,s,r,a||r,n);return u===null||typeof a<"u"&&a!==r&&(u=iA(o,s,a,u,n),u===null)?!1:C1(Array.from(o),[""],i,a,()=>mq(e,r,n))}function iA(t,e,r,n,i){for(;r;)r=pq(t,e,r,n,i);return r}function mq(t,e,r){const n=t._getTarget();e in n||(n[e]={});const i=n[e];return Or(i)&&Gt(r)?r:i||{}}function vq(t,e,r,n){let i;for(const a of e)if(i=ZT(lq(a,t),r),typeof i<"u")return M1(t,i)?T1(r,n,t,i):i}function ZT(t,e){for(const r of e){if(!r)continue;const n=r[t];if(typeof n<"u")return n}}function aA(t){let e=t._keys;return e||(e=t._keys=gq(t._scopes)),e}function gq(t){const e=new Set;for(const r of t)for(const n of Object.keys(r).filter(i=>!i.startsWith("_")))e.add(n);return Array.from(e)}function KT(t,e,r,n){const{iScale:i}=t,{key:a="r"}=this._parsing,s=new Array(n);let o,u,l,c;for(o=0,u=n;oet==="x"?"y":"x";function bq(t,e,r,n){const i=t.skip?e:t,a=e,s=r.skip?e:r,o=ab(a,i),u=ab(s,a);let l=o/(o+u),c=u/(o+u);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const f=n*l,h=n*c;return{previous:{x:a.x-f*(s.x-i.x),y:a.y-f*(s.y-i.y)},next:{x:a.x+h*(s.x-i.x),y:a.y+h*(s.y-i.y)}}}function xq(t,e,r){const n=t.length;let i,a,s,o,u,l=nc(t,0);for(let c=0;c!l.skip)),e.cubicInterpolationMode==="monotone")Sq(t,i);else{let l=n?t[t.length-1]:t[0];for(a=0,s=t.length;at.ownerDocument.defaultView.getComputedStyle(t,null);function Dq(t,e){return Zv(t).getPropertyValue(e)}const Nq=["top","right","bottom","left"];function Mu(t,e,r){const n={};r=r?"-"+r:"";for(let i=0;i<4;i++){const a=Nq[i];n[a]=parseFloat(t[e+"-"+a+r])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Eq=(t,e,r)=>(t>0||e>0)&&(!r||!r.shadowRoot);function Cq(t,e){const r=t.touches,n=r&&r.length?r[0]:t,{offsetX:i,offsetY:a}=n;let s=!1,o,u;if(Eq(i,a,t.target))o=i,u=a;else{const l=e.getBoundingClientRect();o=n.clientX-l.left,u=n.clientY-l.top,s=!0}return{x:o,y:u,box:s}}function xu(t,e){if("native"in t)return t;const{canvas:r,currentDevicePixelRatio:n}=e,i=Zv(r),a=i.boxSizing==="border-box",s=Mu(i,"padding"),o=Mu(i,"border","width"),{x:u,y:l,box:c}=Cq(t,r),f=s.left+(c&&o.left),h=s.top+(c&&o.top);let{width:p,height:v}=e;return a&&(p-=s.width+o.width,v-=s.height+o.height),{x:Math.round((u-f)/p*r.width/n),y:Math.round((l-h)/v*r.height/n)}}function Mq(t,e,r){let n,i;if(e===void 0||r===void 0){const a=F1(t);if(!a)e=t.clientWidth,r=t.clientHeight;else{const s=a.getBoundingClientRect(),o=Zv(a),u=Mu(o,"border","width"),l=Mu(o,"padding");e=s.width-l.width-u.width,r=s.height-l.height-u.height,n=qm(o.maxWidth,a,"clientWidth"),i=qm(o.maxHeight,a,"clientHeight")}}return{width:e,height:r,maxWidth:n||zm,maxHeight:i||zm}}const kp=t=>Math.round(t*10)/10;function Tq(t,e,r,n){const i=Zv(t),a=Mu(i,"margin"),s=qm(i.maxWidth,t,"clientWidth")||zm,o=qm(i.maxHeight,t,"clientHeight")||zm,u=Mq(t,e,r);let{width:l,height:c}=u;if(i.boxSizing==="content-box"){const h=Mu(i,"border","width"),p=Mu(i,"padding");l-=p.width+h.width,c-=p.height+h.height}return l=Math.max(0,l-a.width),c=Math.max(0,n?l/n:c-a.height),l=kp(Math.min(l,s,u.maxWidth)),c=kp(Math.min(c,o,u.maxHeight)),l&&!c&&(c=kp(l/2)),(e!==void 0||r!==void 0)&&n&&u.height&&c>u.height&&(c=u.height,l=kp(Math.floor(c*n))),{width:l,height:c}}function sA(t,e,r){const n=e||1,i=Math.floor(t.height*n),a=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const s=t.canvas;return s.style&&(r||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),t.currentDevicePixelRatio!==n||s.height!==i||s.width!==a?(t.currentDevicePixelRatio=n,s.height=i,s.width=a,t.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Oq=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};O1()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function oA(t,e){const r=Dq(t,e),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function wu(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:t.y+r*(e.y-t.y)}}function Fq(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:n==="middle"?r<.5?t.y:e.y:n==="after"?r<1?t.y:e.y:r>0?e.y:t.y}}function Rq(t,e,r,n){const i={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},s=wu(t,i,r),o=wu(i,a,r),u=wu(a,e,r),l=wu(s,o,r),c=wu(o,u,r);return wu(l,c,r)}const Bq=function(t,e){return{x(r){return t+t+e-r},setWidth(r){e=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,n){return r-n},leftForLtr(r,n){return r-n}}},Pq=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Vl(t,e,r){return t?Bq(e,r):Pq()}function QT(t,e){let r,n;(e==="ltr"||e==="rtl")&&(r=t.canvas.style,n=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=n)}function eO(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function tO(t){return t==="angle"?{between:wh,compare:IU,normalize:Ti}:{between:Cs,compare:(e,r)=>e-r,normalize:e=>e}}function uA({start:t,end:e,count:r,loop:n,style:i}){return{start:t%r,end:e%r,loop:n&&(e-t+1)%r===0,style:i}}function Iq(t,e,r){const{property:n,start:i,end:a}=r,{between:s,normalize:o}=tO(n),u=e.length;let{start:l,end:c,loop:f}=t,h,p;if(f){for(l+=u,c+=u,h=0,p=u;hu(i,x,y)&&o(i,x)!==0,_=()=>o(a,y)===0||u(a,x,y),w=()=>m||A(),C=()=>!m||_();for(let E=c,N=c;E<=f;++E)S=e[E%s],!S.skip&&(y=l(S[n]),y!==x&&(m=u(y,i,a),b===null&&w()&&(b=o(y,i)===0?E:N),b!==null&&C()&&(v.push(uA({start:b,end:E,loop:h,count:s,style:p})),b=null),N=E,x=y));return b!==null&&v.push(uA({start:b,end:f,loop:h,count:s,style:p})),v}function nO(t,e){const r=[],n=t.segments;for(let i=0;ii&&t[a%e].skip;)a--;return a%=e,{start:i,end:a}}function Lq(t,e,r,n){const i=t.length,a=[];let s=e,o=t[e],u;for(u=e+1;u<=r;++u){const l=t[u%i];l.skip||l.stop?o.skip||(n=!1,a.push({start:e%i,end:(u-1)%i,loop:n}),e=s=l.stop?u:null):(s=u,o.skip&&(e=u)),o=l}return s!==null&&a.push({start:e%i,end:s%i,loop:n}),a}function $q(t,e){const r=t.points,n=t.options.spanGaps,i=r.length;if(!i)return[];const a=!!t._loop,{start:s,end:o}=kq(r,i,a,n);if(n===!0)return lA(t,[{start:s,end:o,loop:a}],r,e);const u=o{let t=0;return()=>t++})();function or(t){return t===null||typeof t>"u"}function Or(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Gt(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Vr(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Ci(t,e){return Vr(t)?t:e}function Bt(t,e){return typeof t>"u"?e:t}const EU=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,IT=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Tr(t,e,r){if(t&&typeof t.call=="function")return t.apply(r,e)}function yr(t,e,r,n){let i,a,s;if(Or(t))if(a=t.length,n)for(i=a-1;i>=0;i--)e.call(r,t[i],i);else for(i=0;it,x:t=>t.x,y:t=>t.y};function TU(t){const e=t.split("."),r=[];let n="";for(const i of e)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(r.push(n),n="");return r}function OU(t){const e=TU(t);return r=>{for(const n of e){if(n==="")break;r=r&&r[n]}return r}}function Po(t,e){return(K_[e]||(K_[e]=OU(e)))(t)}function R1(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xh=t=>typeof t<"u",Io=t=>typeof t=="function",J_=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0};function FU(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Rr=Math.PI,Fr=2*Rr,RU=Fr+Rr,$m=Number.POSITIVE_INFINITY,BU=Rr/180,en=Rr/2,pu=Rr/4,Q_=Rr*2/3,Do=Math.log10,Ya=Math.sign;function rh(t,e,r){return Math.abs(t-e)i-a).pop(),e}function tc(t){return!isNaN(parseFloat(t))&&isFinite(t)}function IU(t,e){const r=Math.round(t);return r-e<=t&&r+e>=t}function LT(t,e,r){let n,i,a;for(n=0,i=t.length;nu&&l=Math.min(e,r)-n&&t<=Math.max(e,r)+n}function P1(t,e,r){r=r||(s=>t[s]1;)a=i+n>>1,r(a)?i=a:n=a;return{lo:i,hi:n}}const Ms=(t,e,r,n)=>P1(t,r,n?i=>{const a=t[i][e];return at[i][e]P1(t,r,n=>t[n][e]>=r);function zU(t,e,r){let n=0,i=t.length;for(;nn&&t[i-1]>r;)i--;return n>0||i{const n="_onData"+R1(r),i=t[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value(...a){const s=i.apply(this,a);return t._chartjs.listeners.forEach(o=>{typeof o[n]=="function"&&o[n](...a)}),s}})})}function rA(t,e){const r=t._chartjs;if(!r)return;const n=r.listeners,i=n.indexOf(e);i!==-1&&n.splice(i,1),!(n.length>0)&&(zT.forEach(a=>{delete t[a]}),delete t._chartjs)}function UT(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const qT=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function HT(t,e){let r=[],n=!1;return function(...i){r=i,n||(n=!0,qT.call(window,()=>{n=!1,t.apply(e,r)}))}}function qU(t,e){let r;return function(...n){return e?(clearTimeout(r),r=setTimeout(t,e,n)):t.apply(this,n),e}}const I1=t=>t==="start"?"left":t==="end"?"right":"center",kn=(t,e,r)=>t==="start"?e:t==="end"?r:(e+r)/2,HU=(t,e,r,n)=>t===(n?"left":"right")?r:t==="center"?(e+r)/2:e;function WT(t,e,r){const n=e.length;let i=0,a=n;if(t._sorted){const{iScale:s,_parsed:o}=t,u=s.axis,{min:l,max:c,minDefined:f,maxDefined:h}=s.getUserBounds();f&&(i=wn(Math.min(Ms(o,u,l).lo,r?n:Ms(e,u,s.getPixelForValue(l)).lo),0,n-1)),h?a=wn(Math.max(Ms(o,s.axis,c,!0).hi+1,r?0:Ms(e,u,s.getPixelForValue(c),!0).hi+1),i,n)-i:a=n-i}return{start:i,count:a}}function VT(t){const{xScale:e,yScale:r,_scaleRanges:n}=t,i={xmin:e.min,xmax:e.max,ymin:r.min,ymax:r.max};if(!n)return t._scaleRanges=i,!0;const a=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==r.min||n.ymax!==r.max;return Object.assign(n,i),a}const Pp=t=>t===0||t===1,nA=(t,e,r)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Fr/r)),iA=(t,e,r)=>Math.pow(2,-10*t)*Math.sin((t-e)*Fr/r)+1,nh={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*en)+1,easeOutSine:t=>Math.sin(t*en),easeInOutSine:t=>-.5*(Math.cos(Rr*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Pp(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Pp(t)?t:nA(t,.075,.3),easeOutElastic:t=>Pp(t)?t:iA(t,.075,.3),easeInOutElastic(t){return Pp(t)?t:t<.5?.5*nA(t*2,.1125,.45):.5+.5*iA(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-nh.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?nh.easeInBounce(t*2)*.5:nh.easeOutBounce(t*2-1)*.5+.5};function k1(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function aA(t){return k1(t)?t:new yh(t)}function yy(t){return k1(t)?t:new yh(t).saturate(.5).darken(.1).hexString()}const WU=["x","y","borderWidth","radius","tension"],VU=["color","borderColor","backgroundColor"];function YU(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:VU},numbers:{type:"number",properties:WU}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function jU(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const sA=new Map;function GU(t,e){e=e||{};const r=t+JSON.stringify(e);let n=sA.get(r);return n||(n=new Intl.NumberFormat(t,e),sA.set(r,n)),n}function Gh(t,e,r){return GU(e,r).format(t)}const YT={values(t){return Or(t)?t:""+t},numeric(t,e,r){if(t===0)return"0";const n=this.chart.options.locale;let i,a=t;if(r.length>1){const l=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(l<1e-4||l>1e15)&&(i="scientific"),a=XU(t,r)}const s=Do(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),u={notation:i,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(u,this.options.ticks.format),Gh(t,n,u)},logarithmic(t,e,r){if(t===0)return"0";const n=r[e].significand||t/Math.pow(10,Math.floor(Do(t)));return[1,2,3,5,10,15].includes(n)||e>.8*r.length?YT.numeric.call(this,t,e,r):""}};function XU(t,e){let r=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(r)>=1&&t!==Math.floor(t)&&(r=t-Math.floor(t)),r}var Xh={formatters:YT};function ZU(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,r)=>r.lineWidth,tickColor:(e,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Xh.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Pu=Object.create(null),lb=Object.create(null);function ih(t,e){if(!e)return t;const r=e.split(".");for(let n=0,i=r.length;nn.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,i)=>yy(i.backgroundColor),this.hoverBorderColor=(n,i)=>yy(i.borderColor),this.hoverColor=(n,i)=>yy(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(r)}set(e,r){return by(this,e,r)}get(e){return ih(this,e)}describe(e,r){return by(lb,e,r)}override(e,r){return by(Pu,e,r)}route(e,r,n,i){const a=ih(this,e),s=ih(this,n),o="_"+r;Object.defineProperties(a,{[o]:{value:a[r],writable:!0},[r]:{enumerable:!0,get(){const u=this[o],l=s[i];return Gt(u)?Object.assign({},l,u):Bt(u,l)},set(u){this[o]=u}}})}apply(e){e.forEach(r=>r(this))}}var Ur=new KU({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[YU,jU,ZU]);function JU(t){return!t||or(t.size)||or(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zm(t,e,r,n,i){let a=e[i];return a||(a=e[i]=t.measureText(i).width,r.push(i)),a>n&&(n=a),n}function QU(t,e,r,n){n=n||{};let i=n.data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(i=n.data={},a=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let s=0;const o=r.length;let u,l,c,f,h;for(u=0;ur.length){for(u=0;u0&&t.stroke()}}function Ts(t,e,r){return r=r||.5,!e||t&&t.x>e.left-r&&t.xe.top-r&&t.y0&&a.strokeColor!=="";let u,l;for(t.save(),t.font=i.string,rq(t,a),u=0;u+t||0;function L1(t,e){const r={},n=Gt(e),i=n?Object.keys(e):e,a=Gt(t)?n?s=>Bt(t[s],t[e[s]]):s=>t[s]:()=>t;for(const s of i)r[s]=uq(a(s));return r}function GT(t){return L1(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Cu(t){return L1(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Wn(t){const e=GT(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pn(t,e){t=t||{},e=e||Ur.font;let r=Bt(t.size,e.size);typeof r=="string"&&(r=parseInt(r,10));let n=Bt(t.style,e.style);n&&!(""+n).match(sq)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const i={family:Bt(t.family,e.family),lineHeight:oq(Bt(t.lineHeight,e.lineHeight),r),size:r,style:n,weight:Bt(t.weight,e.weight),string:""};return i.string=JU(i),i}function Gf(t,e,r,n){let i=!0,a,s,o;for(a=0,s=t.length;ar&&o===0?0:o+u;return{min:s(n,-Math.abs(a)),max:s(i,a)}}function Uo(t,e){return Object.assign(Object.create(t),e)}function $1(t,e=[""],r,n,i=()=>t[0]){const a=r||t;typeof n>"u"&&(n=JT("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:n,_getTarget:i,override:o=>$1([o,...t],e,a,n)};return new Proxy(s,{deleteProperty(o,u){return delete o[u],delete o._keys,delete t[0][u],!0},get(o,u){return ZT(o,u,()=>gq(u,e,t,o))},getOwnPropertyDescriptor(o,u){return Reflect.getOwnPropertyDescriptor(o._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(o,u){return lA(o).includes(u)},ownKeys(o){return lA(o)},set(o,u,l){const c=o._storage||(o._storage=i());return o[u]=c[u]=l,delete o._keys,!0}})}function rc(t,e,r,n){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:r,_stack:new Set,_descriptors:XT(t,n),setContext:a=>rc(t,a,r,n),override:a=>rc(t.override(a),e,r,n)};return new Proxy(i,{deleteProperty(a,s){return delete a[s],delete t[s],!0},get(a,s,o){return ZT(a,s,()=>fq(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(t,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,s)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(a,s){return Reflect.has(t,s)},ownKeys(){return Reflect.ownKeys(t)},set(a,s,o){return t[s]=o,delete a[s],!0}})}function XT(t,e={scriptable:!0,indexable:!0}){const{_scriptable:r=e.scriptable,_indexable:n=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:r,indexable:n,isScriptable:Io(r)?r:()=>r,isIndexable:Io(n)?n:()=>n}}const cq=(t,e)=>t?t+R1(e):e,z1=(t,e)=>Gt(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function ZT(t,e,r){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=r();return t[e]=n,n}function fq(t,e,r){const{_proxy:n,_context:i,_subProxy:a,_descriptors:s}=t;let o=n[e];return Io(o)&&s.isScriptable(e)&&(o=hq(e,o,t,r)),Or(o)&&o.length&&(o=dq(e,o,t,s.isIndexable)),z1(e,o)&&(o=rc(o,i,a&&a[e],s)),o}function hq(t,e,r,n){const{_proxy:i,_context:a,_subProxy:s,_stack:o}=r;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t);let u=e(a,s||n);return o.delete(t),z1(t,u)&&(u=U1(i._scopes,i,t,u)),u}function dq(t,e,r,n){const{_proxy:i,_context:a,_subProxy:s,_descriptors:o}=r;if(typeof a.index<"u"&&n(t))return e[a.index%e.length];if(Gt(e[0])){const u=e,l=i._scopes.filter(c=>c!==u);e=[];for(const c of u){const f=U1(l,i,t,c);e.push(rc(f,a,s&&s[t],o))}}return e}function KT(t,e,r){return Io(t)?t(e,r):t}const pq=(t,e)=>t===!0?e:typeof t=="string"?Po(e,t):void 0;function mq(t,e,r,n,i){for(const a of e){const s=pq(r,a);if(s){t.add(s);const o=KT(s._fallback,r,i);if(typeof o<"u"&&o!==r&&o!==n)return o}else if(s===!1&&typeof n<"u"&&r!==n)return null}return!1}function U1(t,e,r,n){const i=e._rootScopes,a=KT(e._fallback,r,n),s=[...t,...i],o=new Set;o.add(n);let u=uA(o,s,r,a||r,n);return u===null||typeof a<"u"&&a!==r&&(u=uA(o,s,a,u,n),u===null)?!1:$1(Array.from(o),[""],i,a,()=>vq(e,r,n))}function uA(t,e,r,n,i){for(;r;)r=mq(t,e,r,n,i);return r}function vq(t,e,r){const n=t._getTarget();e in n||(n[e]={});const i=n[e];return Or(i)&&Gt(r)?r:i||{}}function gq(t,e,r,n){let i;for(const a of e)if(i=JT(cq(a,t),r),typeof i<"u")return z1(t,i)?U1(r,n,t,i):i}function JT(t,e){for(const r of e){if(!r)continue;const n=r[t];if(typeof n<"u")return n}}function lA(t){let e=t._keys;return e||(e=t._keys=yq(t._scopes)),e}function yq(t){const e=new Set;for(const r of t)for(const n of Object.keys(r).filter(i=>!i.startsWith("_")))e.add(n);return Array.from(e)}function QT(t,e,r,n){const{iScale:i}=t,{key:a="r"}=this._parsing,s=new Array(n);let o,u,l,c;for(o=0,u=n;oet==="x"?"y":"x";function xq(t,e,r,n){const i=t.skip?e:t,a=e,s=r.skip?e:r,o=ub(a,i),u=ub(s,a);let l=o/(o+u),c=u/(o+u);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const f=n*l,h=n*c;return{previous:{x:a.x-f*(s.x-i.x),y:a.y-f*(s.y-i.y)},next:{x:a.x+h*(s.x-i.x),y:a.y+h*(s.y-i.y)}}}function wq(t,e,r){const n=t.length;let i,a,s,o,u,l=nc(t,0);for(let c=0;c!l.skip)),e.cubicInterpolationMode==="monotone")_q(t,i);else{let l=n?t[t.length-1]:t[0];for(a=0,s=t.length;at.ownerDocument.defaultView.getComputedStyle(t,null);function Nq(t,e){return Jv(t).getPropertyValue(e)}const Eq=["top","right","bottom","left"];function Mu(t,e,r){const n={};r=r?"-"+r:"";for(let i=0;i<4;i++){const a=Eq[i];n[a]=parseFloat(t[e+"-"+a+r])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Cq=(t,e,r)=>(t>0||e>0)&&(!r||!r.shadowRoot);function Mq(t,e){const r=t.touches,n=r&&r.length?r[0]:t,{offsetX:i,offsetY:a}=n;let s=!1,o,u;if(Cq(i,a,t.target))o=i,u=a;else{const l=e.getBoundingClientRect();o=n.clientX-l.left,u=n.clientY-l.top,s=!0}return{x:o,y:u,box:s}}function xu(t,e){if("native"in t)return t;const{canvas:r,currentDevicePixelRatio:n}=e,i=Jv(r),a=i.boxSizing==="border-box",s=Mu(i,"padding"),o=Mu(i,"border","width"),{x:u,y:l,box:c}=Mq(t,r),f=s.left+(c&&o.left),h=s.top+(c&&o.top);let{width:p,height:v}=e;return a&&(p-=s.width+o.width,v-=s.height+o.height),{x:Math.round((u-f)/p*r.width/n),y:Math.round((l-h)/v*r.height/n)}}function Tq(t,e,r){let n,i;if(e===void 0||r===void 0){const a=H1(t);if(!a)e=t.clientWidth,r=t.clientHeight;else{const s=a.getBoundingClientRect(),o=Jv(a),u=Mu(o,"border","width"),l=Mu(o,"padding");e=s.width-l.width-u.width,r=s.height-l.height-u.height,n=Um(o.maxWidth,a,"clientWidth"),i=Um(o.maxHeight,a,"clientHeight")}}return{width:e,height:r,maxWidth:n||$m,maxHeight:i||$m}}const kp=t=>Math.round(t*10)/10;function Oq(t,e,r,n){const i=Jv(t),a=Mu(i,"margin"),s=Um(i.maxWidth,t,"clientWidth")||$m,o=Um(i.maxHeight,t,"clientHeight")||$m,u=Tq(t,e,r);let{width:l,height:c}=u;if(i.boxSizing==="content-box"){const h=Mu(i,"border","width"),p=Mu(i,"padding");l-=p.width+h.width,c-=p.height+h.height}return l=Math.max(0,l-a.width),c=Math.max(0,n?l/n:c-a.height),l=kp(Math.min(l,s,u.maxWidth)),c=kp(Math.min(c,o,u.maxHeight)),l&&!c&&(c=kp(l/2)),(e!==void 0||r!==void 0)&&n&&u.height&&c>u.height&&(c=u.height,l=kp(Math.floor(c*n))),{width:l,height:c}}function cA(t,e,r){const n=e||1,i=Math.floor(t.height*n),a=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const s=t.canvas;return s.style&&(r||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),t.currentDevicePixelRatio!==n||s.height!==i||s.width!==a?(t.currentDevicePixelRatio=n,s.height=i,s.width=a,t.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Fq=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};q1()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function fA(t,e){const r=Nq(t,e),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function wu(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:t.y+r*(e.y-t.y)}}function Rq(t,e,r,n){return{x:t.x+r*(e.x-t.x),y:n==="middle"?r<.5?t.y:e.y:n==="after"?r<1?t.y:e.y:r>0?e.y:t.y}}function Bq(t,e,r,n){const i={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},s=wu(t,i,r),o=wu(i,a,r),u=wu(a,e,r),l=wu(s,o,r),c=wu(o,u,r);return wu(l,c,r)}const Pq=function(t,e){return{x(r){return t+t+e-r},setWidth(r){e=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,n){return r-n},leftForLtr(r,n){return r-n}}},Iq=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Vl(t,e,r){return t?Pq(e,r):Iq()}function tO(t,e){let r,n;(e==="ltr"||e==="rtl")&&(r=t.canvas.style,n=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=n)}function rO(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function nO(t){return t==="angle"?{between:wh,compare:kU,normalize:Ti}:{between:Cs,compare:(e,r)=>e-r,normalize:e=>e}}function hA({start:t,end:e,count:r,loop:n,style:i}){return{start:t%r,end:e%r,loop:n&&(e-t+1)%r===0,style:i}}function kq(t,e,r){const{property:n,start:i,end:a}=r,{between:s,normalize:o}=nO(n),u=e.length;let{start:l,end:c,loop:f}=t,h,p;if(f){for(l+=u,c+=u,h=0,p=u;hu(i,x,y)&&o(i,x)!==0,_=()=>o(a,y)===0||u(a,x,y),w=()=>m||A(),C=()=>!m||_();for(let E=c,N=c;E<=f;++E)S=e[E%s],!S.skip&&(y=l(S[n]),y!==x&&(m=u(y,i,a),b===null&&w()&&(b=o(y,i)===0?E:N),b!==null&&C()&&(v.push(hA({start:b,end:E,loop:h,count:s,style:p})),b=null),N=E,x=y));return b!==null&&v.push(hA({start:b,end:f,loop:h,count:s,style:p})),v}function aO(t,e){const r=[],n=t.segments;for(let i=0;ii&&t[a%e].skip;)a--;return a%=e,{start:i,end:a}}function $q(t,e,r,n){const i=t.length,a=[];let s=e,o=t[e],u;for(u=e+1;u<=r;++u){const l=t[u%i];l.skip||l.stop?o.skip||(n=!1,a.push({start:e%i,end:(u-1)%i,loop:n}),e=s=l.stop?u:null):(s=u,o.skip&&(e=u)),o=l}return s!==null&&a.push({start:e%i,end:s%i,loop:n}),a}function zq(t,e){const r=t.points,n=t.options.spanGaps,i=r.length;if(!i)return[];const a=!!t._loop,{start:s,end:o}=Lq(r,i,a,n);if(n===!0)return dA(t,[{start:s,end:o,loop:a}],r,e);const u=oo({chart:e,initial:r.initial,numSteps:s,currentStep:Math.min(n-r.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=zT.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let r=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const a=n.items;let s=a.length-1,o=!1,u;for(;s>=0;--s)u=a[s],u._active?(u._total>n.duration&&(n.duration=u._total),u.tick(e),o=!0):(a[s]=a[a.length-1],a.pop());o&&(i.draw(),this._notify(i,n,e,"progress")),a.length||(n.running=!1,this._notify(i,n,e,"complete"),n.initial=!1),r+=a.length}),this._lastDate=e,r===0&&(this._running=!1)}_getAnims(e){const r=this._charts;let n=r.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(e,n)),n}listen(e,r,n){this._getAnims(e).listeners[r].push(n)}add(e,r){!r||!r.length||this._getAnims(e).items.push(...r)}has(e){return this._getAnims(e).items.length>0}start(e){const r=this._charts.get(e);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const r=this._charts.get(e);return!(!r||!r.running||!r.items.length)}stop(e){const r=this._charts.get(e);if(!r||!r.items.length)return;const n=r.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();r.items=[],this._notify(e,r,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ha=new qq;const fA="transparent",Hq={boolean(t,e,r){return r>.5?e:t},color(t,e,r){const n=tA(t||fA),i=n.valid&&tA(e||fA);return i&&i.valid?i.mix(n,r).hexString():e},number(t,e,r){return t+(e-t)*r}};class iO{constructor(e,r,n,i){const a=r[n];i=Xf([e.to,i,a,e.from]);const s=Xf([e.from,a,i]);this._active=!0,this._fn=e.fn||Hq[e.type||typeof s],this._easing=ih[e.easing]||ih.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=r,this._prop=n,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(e,r,n){if(this._active){this._notify(!1);const i=this._target[this._prop],a=n-this._start,s=this._duration-a;this._start=n,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=Xf([e.to,r,i,e.from]),this._from=Xf([e.from,i,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const r=e-this._start,n=this._duration,i=this._prop,a=this._from,s=this._loop,o=this._to;let u;if(this._active=a!==o&&(s||r1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[i]=this._fn(a,o,u)}wait(){const e=this._promises||(this._promises=[]);return new Promise((r,n)=>{e.push({res:r,rej:n})})}_notify(e){const r=e?"res":"rej",n=this._promises||[];for(let i=0;i{const a=e[i];if(!Gt(a))return;const s={};for(const o of r)s[o]=a[o];(Or(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,s)})})}_animateOptions(e,r){const n=r.options,i=Vq(e,n);if(!i)return[];const a=this._createAnimations(i,n);return n.$shared&&Wq(e.options.$animations,n).then(()=>{e.options=n},()=>{}),a}_createAnimations(e,r){const n=this._properties,i=[],a=e.$animations||(e.$animations={}),s=Object.keys(r),o=Date.now();let u;for(u=s.length-1;u>=0;--u){const l=s[u];if(l.charAt(0)==="$")continue;if(l==="options"){i.push(...this._animateOptions(e,r));continue}const c=r[l];let f=a[l];const h=n.get(l);if(f)if(h&&f.active()){f.update(h,c,o);continue}else f.cancel();if(!h||!h.duration){e[l]=c;continue}a[l]=f=new iO(h,e,l,c),i.push(f)}return i}update(e,r){if(this._properties.size===0){Object.assign(e,r);return}const n=this._createAnimations(e,r);if(n.length)return Ha.add(this._chart,n),!0}}function Wq(t,e){const r=[],n=Object.keys(e);for(let i=0;i0||!r&&a<0)return i.index}return null}function vA(t,e){const{chart:r,_cachedMeta:n}=t,i=r._stacks||(r._stacks={}),{iScale:a,vScale:s,index:o}=n,u=a.axis,l=s.axis,c=Xq(a,s,n),f=e.length;let h;for(let p=0;pr[n].axis===e).shift()}function Jq(t,e){return Uo(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Qq(t,e,r){return Uo(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:r,index:e,mode:"default",type:"data"})}function kf(t,e){const r=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const i of e){const a=i._stacks;if(!a||a[n]===void 0||a[n][r]===void 0)return;delete a[n][r],a[n]._visualValues!==void 0&&a[n]._visualValues[r]!==void 0&&delete a[n]._visualValues[r]}}}const by=t=>t==="reset"||t==="none",gA=(t,e)=>e?t:Object.assign({},t),eH=(t,e,r)=>t&&!e.hidden&&e._stacked&&{keys:aO(r,!0),values:null};class ta{constructor(e,r){this.chart=e,this._ctx=e.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=pA(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&kf(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,r=this._cachedMeta,n=this.getDataset(),i=(f,h,p,v)=>f==="x"?h:f==="r"?v:p,a=r.xAxisID=Bt(n.xAxisID,yy(e,"x")),s=r.yAxisID=Bt(n.yAxisID,yy(e,"y")),o=r.rAxisID=Bt(n.rAxisID,yy(e,"r")),u=r.indexAxis,l=r.iAxisID=i(u,a,s,o),c=r.vAxisID=i(u,s,a,o);r.xScale=this.getScaleForId(a),r.yScale=this.getScaleForId(s),r.rScale=this.getScaleForId(o),r.iScale=this.getScaleForId(l),r.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const r=this._cachedMeta;return e===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&J_(this._data,this),e._stacked&&kf(e)}_dataCheck(){const e=this.getDataset(),r=e.data||(e.data=[]),n=this._data;if(Gt(r))this._data=Gq(r);else if(n!==r){if(n){J_(n,this);const i=this._cachedMeta;kf(i),i._parsed=[]}r&&Object.isExtensible(r)&&zU(r,this),this._syncList=[],this._data=r}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const r=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const a=r._stacked;r._stacked=pA(r.vScale,r),r.stack!==n.stack&&(i=!0,kf(r),r.stack=n.stack),this._resyncElements(e),(i||a!==r._stacked)&&vA(this,r._parsed)}configure(){const e=this.chart.config,r=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),r,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,r){const{_cachedMeta:n,_data:i}=this,{iScale:a,_stacked:s}=n,o=a.axis;let u=e===0&&r===i.length?!0:n._sorted,l=e>0&&n._parsed[e-1],c,f,h;if(this._parsing===!1)n._parsed=i,n._sorted=!0,h=i;else{Or(i[e])?h=this.parseArrayData(n,i,e,r):Gt(i[e])?h=this.parseObjectData(n,i,e,r):h=this.parsePrimitiveData(n,i,e,r);const p=()=>f[o]===null||l&&f[o]m||f=0;--h)if(!v()){this.updateRangeFromParsed(l,e,p,u);break}}return l}getAllParsedValues(e){const r=this._cachedMeta._parsed,n=[];let i,a,s;for(i=0,a=r.length;i=0&&ethis.getContext(n,i,r),m=l.resolveNamedOptions(h,p,v,f);return m.$shared&&(m.$shared=u,a[s]=Object.freeze(gA(m,u))),m}_resolveAnimations(e,r,n){const i=this.chart,a=this._cachedDataOpts,s=`animation-${r}`,o=a[s];if(o)return o;let u;if(i.options.animation!==!1){const c=this.chart.config,f=c.datasetAnimationScopeKeys(this._type,r),h=c.getOptionScopes(this.getDataset(),f);u=c.createResolver(h,this.getContext(e,n,r))}const l=new R1(i,u&&u.animations);return u&&u._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,r){return!r||by(e)||this.chart._animationsDisabled}_getSharedOptions(e,r){const n=this.resolveDataElementOptions(e,r),i=this._sharedOptions,a=this.getSharedOptions(n),s=this.includeOptions(r,a)||a!==i;return this.updateSharedOptions(a,r,n),{sharedOptions:a,includeOptions:s}}updateElement(e,r,n,i){by(i)?Object.assign(e,n):this._resolveAnimations(r,i).update(e,n)}updateSharedOptions(e,r,n){e&&!by(r)&&this._resolveAnimations(void 0,r).update(e,n)}_setStyle(e,r,n,i){e.active=i;const a=this.getStyle(r,i);this._resolveAnimations(r,n,i).update(e,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(e,r,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,r,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const r=this._data,n=this._cachedMeta.data;for(const[o,u,l]of this._syncList)this[o](u,l);this._syncList=[];const i=n.length,a=r.length,s=Math.min(a,i);s&&this.parse(0,s),a>i?this._insertElements(i,a-i,e):a{for(l.length+=r,o=l.length-1;o>=s;o--)l[o]=l[o-r]};for(u(a),o=e;oi-a))}return t._cache.$bar}function rH(t){const e=t.iScale,r=tH(e,t.type);let n=e._length,i,a,s,o;const u=()=>{s===32767||s===-32768||(xh(o)&&(n=Math.min(n,Math.abs(s-o)||n)),o=s)};for(i=0,a=r.length;i0?i[t-1]:null,o=tMath.abs(o)&&(u=o,l=s),e[r.axis]=l,e._custom={barStart:u,barEnd:l,start:i,end:a,min:s,max:o}}function sO(t,e,r,n){return Or(t)?aH(t,e,r,n):e[r.axis]=r.parse(t,n),e}function yA(t,e,r,n){const i=t.iScale,a=t.vScale,s=i.getLabels(),o=i===a,u=[];let l,c,f,h;for(l=r,c=r+n;l=r?1:-1)}function oH(t){let e,r,n,i,a;return t.horizontal?(e=t.base>t.x,r="left",n="right"):(e=t.baseu.controller.options.grouped),a=n.options.stacked,s=[],o=u=>{const l=u.controller.getParsed(r),c=l&&l[u.vScale.axis];if(or(c)||isNaN(c))return!0};for(const u of i)if(!(r!==void 0&&o(u))&&((a===!1||s.indexOf(u.stack)===-1||a===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,r,n){const i=this._getStacks(e,n),a=r!==void 0?i.indexOf(r):-1;return a===-1?i.length-1:a}_getRuler(){const e=this.options,r=this._cachedMeta,n=r.iScale,i=[];let a,s;for(a=0,s=r.data.length;a=0;--n)r=Math.max(r,e[n].size(this.resolveDataElementOptions(n))/2);return r>0&&r}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:a}=r,s=this.getParsed(e),o=i.getLabelForValue(s.x),u=a.getLabelForValue(s.y),l=s._custom;return{label:n[e]||"",value:"("+o+", "+u+(l?", "+l:"")+")"}}update(e){const r=this._cachedMeta.data;this.updateElements(r,0,r.length,e)}updateElements(e,r,n,i){const a=i==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:u,includeOptions:l}=this._getSharedOptions(r,i),c=s.axis,f=o.axis;for(let h=r;hwh(x,o,u,!0)?1:Math.max(A,A*r,_,_*r),v=(x,A,_)=>wh(x,o,u,!0)?-1:Math.min(A,A*r,_,_*r),m=p(0,l,f),b=p(en,c,h),y=v(Rr,l,f),S=v(Rr+en,c,h);n=(m-y)/2,i=(b-S)/2,a=-(m+y)/2,s=-(b+S)/2}return{ratioX:n,ratioY:i,offsetX:a,offsetY:s}}class No extends ta{constructor(e,r){super(e,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,r){const n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=n;else{let a=u=>+n[u];if(Gt(n[e])){const{key:u="value"}=this._parsing;a=l=>+Po(n[l],u)}let s,o;for(s=e,o=e+r;s0&&!isNaN(e)?Fr*(Math.abs(e)/r):0}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Gh(r._parsed[e],n.options.locale);return{label:i[e]||"",value:a}}getMaxBorderWidth(e){let r=0;const n=this.chart;let i,a,s,o,u;if(!e){for(i=0,a=n.data.datasets.length;ie!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),je(No,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data;if(r.labels.length&&r.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return r.labels.map((a,s)=>{const u=e.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:i,lineWidth:u.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}}});class uh extends ta{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const r=this._cachedMeta,{dataset:n,data:i=[],_dataset:a}=r,s=this.chart._animationsDisabled;let{start:o,count:u}=qT(r,i,s);this._drawStart=o,this._drawCount=u,HT(r)&&(o=0,u=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=i;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:l},e),this.updateElements(i,o,u,e)}updateElements(e,r,n,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:u,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:f}=this._getSharedOptions(r,i),h=s.axis,p=o.axis,{spanGaps:v,segment:m}=this.options,b=tc(v)?v:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||i==="none",S=r+n,x=e.length;let A=r>0&&this.getParsed(r-1);for(let _=0;_=S){C.skip=!0;continue}const E=this.getParsed(_),N=or(E[p]),M=C[h]=s.getPixelForValue(E[h],_),O=C[p]=a||N?o.getBasePixel():o.getPixelForValue(u?this.applyStack(o,E,u):E[p],_);C.skip=isNaN(M)||isNaN(O)||N,C.stop=_>0&&Math.abs(E[h]-A[h])>b,m&&(C.parsed=E,C.raw=l.data[_]),f&&(C.options=c||this.resolveDataElementOptions(_,w.active?"active":i)),y||this.updateElement(w,_,C,i),A=E}}getMaxOverflow(){const e=this._cachedMeta,r=e.dataset,n=r.options&&r.options.borderWidth||0,i=e.data||[];if(!i.length)return n;const a=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,a,s)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}je(uh,"id","line"),je(uh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),je(uh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Yl extends ta{constructor(e,r){super(e,r),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Gh(r._parsed[e].r,n.options.locale);return{label:i[e]||"",value:a}}parseObjectData(e,r,n,i){return KT.bind(this)(e,r,n,i)}update(e){const r=this._cachedMeta.data;this._updateRadius(),this.updateElements(r,0,r.length,e)}getMinMax(){const e=this._cachedMeta,r={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((n,i)=>{const a=this.getParsed(i).r;!isNaN(a)&&this.chart.getDataVisibility(i)&&(ar.max&&(r.max=a))}),r}_updateRadius(){const e=this.chart,r=e.chartArea,n=e.options,i=Math.min(r.right-r.left,r.bottom-r.top),a=Math.max(i/2,0),s=Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0),o=(a-s)/e.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,r,n,i){const a=i==="reset",s=this.chart,u=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,f=l.yCenter,h=l.getIndexAngle(0)-.5*Rr;let p=h,v;const m=360/this.countVisibleElements();for(v=0;v{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&r++}),r}_computeAngle(e,r,n){return this.chart.getDataVisibility(e)?ba(this.resolveDataElementOptions(e,r).angle||n):0}}je(Yl,"id","polarArea"),je(Yl,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),je(Yl,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data;if(r.labels.length&&r.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return r.labels.map((a,s)=>{const u=e.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:i,lineWidth:u.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Hm extends No{}je(Hm,"id","pie"),je(Hm,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lh extends ta{getLabelAndValue(e){const r=this._cachedMeta.vScale,n=this.getParsed(e);return{label:r.getLabels()[e],value:""+r.getLabelForValue(n[r.axis])}}parseObjectData(e,r,n,i){return KT.bind(this)(e,r,n,i)}update(e){const r=this._cachedMeta,n=r.dataset,i=r.data||[],a=r.iScale.getLabels();if(n.points=i,e!=="resize"){const s=this.resolveDatasetElementOptions(e);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:s};this.updateElement(n,void 0,o,e)}this.updateElements(i,0,i.length,e)}updateElements(e,r,n,i){const a=this._cachedMeta.rScale,s=i==="reset";for(let o=r;o0&&this.getParsed(r-1);for(let A=r;A0&&Math.abs(w[p]-x[p])>y,b&&(C.parsed=w,C.raw=l.data[A]),h&&(C.options=f||this.resolveDataElementOptions(A,_.active?"active":i)),S||this.updateElement(_,A,C,i),x=w}this.updateSharedOptions(f,i,c)}getMaxOverflow(){const e=this._cachedMeta,r=e.data||[];if(!this.options.showLine){let o=0;for(let u=r.length-1;u>=0;--u)o=Math.max(o,r[u].size(this.resolveDataElementOptions(u))/2);return o>0&&o}const n=e.dataset,i=n.options&&n.options.borderWidth||0;if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}}je(ch,"id","scatter"),je(ch,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),je(ch,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var oO=Object.freeze({__proto__:null,BarController:sh,BubbleController:oh,DoughnutController:No,LineController:uh,PieController:Hm,PolarAreaController:Yl,RadarController:lh,ScatterController:ch});function vu(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class B1{constructor(e){je(this,"options");this.options=e||{}}static override(e){Object.assign(B1.prototype,e)}init(){}formats(){return vu()}parse(){return vu()}format(){return vu()}add(){return vu()}diff(){return vu()}startOf(){return vu()}endOf(){return vu()}}var uO={_date:B1};function hH(t,e,r,n){const{controller:i,data:a,_sorted:s}=t,o=i._cachedMeta.iScale;if(o&&e===o.axis&&e!=="r"&&s&&a.length){const u=o._reversePixels?LU:Ms;if(n){if(i._sharedOptions){const l=a[0],c=typeof l.getRange=="function"&&l.getRange(e);if(c){const f=u(a,e,r-c),h=u(a,e,r+c);return{lo:f.lo,hi:h.hi}}}}else return u(a,e,r)}return{lo:0,hi:a.length-1}}function Zh(t,e,r,n,i){const a=t.getSortedVisibleDatasetMetas(),s=r[e];for(let o=0,u=a.length;o{u[s](e[r],i)&&(a.push({element:u,datasetIndex:l,index:c}),o=o||u.inRange(e.x,e.y,i))}),n&&!o?[]:a}var lO={evaluateInteractionItems:Zh,modes:{index(t,e,r,n){const i=xu(e,t),a=r.axis||"x",s=r.includeInvisible||!1,o=r.intersect?wy(t,i,a,n,s):Sy(t,i,a,!1,n,s),u=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(l=>{const c=o[0].index,f=l.data[c];f&&!f.skip&&u.push({element:f,datasetIndex:l.index,index:c})}),u):[]},dataset(t,e,r,n){const i=xu(e,t),a=r.axis||"xy",s=r.includeInvisible||!1;let o=r.intersect?wy(t,i,a,n,s):Sy(t,i,a,!1,n,s);if(o.length>0){const u=o[0].datasetIndex,l=t.getDatasetMeta(u).data;o=[];for(let c=0;cr.pos===e)}function SA(t,e){return t.filter(r=>cO.indexOf(r.pos)===-1&&r.box.axis===e)}function $f(t,e){return t.sort((r,n)=>{const i=e?n:r,a=e?r:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function vH(t){const e=[];let r,n,i,a,s,o;for(r=0,n=(t||[]).length;rl.box.fullSize),!0),n=$f(Lf(e,"left"),!0),i=$f(Lf(e,"right")),a=$f(Lf(e,"top"),!0),s=$f(Lf(e,"bottom")),o=SA(e,"x"),u=SA(e,"y");return{fullSize:r,leftAndTop:n.concat(a),rightAndBottom:i.concat(u).concat(s).concat(o),chartArea:Lf(e,"chartArea"),vertical:n.concat(i).concat(u),horizontal:a.concat(s).concat(o)}}function _A(t,e,r,n){return Math.max(t[r],e[r])+Math.max(t[n],e[n])}function fO(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function xH(t,e,r,n){const{pos:i,box:a}=r,s=t.maxPadding;if(!Gt(i)){r.size&&(t[i]-=r.size);const f=n[r.stack]||{size:0,count:1};f.size=Math.max(f.size,r.horizontal?a.height:a.width),r.size=f.size/f.count,t[i]+=r.size}a.getPadding&&fO(s,a.getPadding());const o=Math.max(0,e.outerWidth-_A(s,t,"left","right")),u=Math.max(0,e.outerHeight-_A(s,t,"top","bottom")),l=o!==t.w,c=u!==t.h;return t.w=o,t.h=u,r.horizontal?{same:l,other:c}:{same:c,other:l}}function wH(t){const e=t.maxPadding;function r(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=r("top"),t.x+=r("left"),r("right"),r("bottom")}function SH(t,e){const r=e.maxPadding;function n(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{a[s]=Math.max(e[s],r[s])}),a}return n(t?["left","right"]:["top","bottom"])}function Zf(t,e,r,n){const i=[];let a,s,o,u,l,c;for(a=0,s=t.length,l=0;a{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=u.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:r,padding:i,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/c,hBoxMaxHeight:s/2}),h=Object.assign({},i);fO(h,Wn(n));const p=Object.assign({maxPadding:h,w:a,h:s,x:i.left,y:i.top},i),v=yH(u.concat(l),f);Zf(o.fullSize,p,f,v),Zf(u,p,f,v),Zf(l,p,f,v)&&Zf(u,p,f,v),wH(p),AA(o.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,AA(o.rightAndBottom,p,f,v),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},yr(o.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class P1{acquireContext(e,r){}releaseContext(e){return!1}addEventListener(e,r,n){}removeEventListener(e,r,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,r,n,i){return r=Math.max(0,r||e.width),n=n||e.height,{width:r,height:Math.max(0,i?Math.floor(r/i):n)}}isAttached(e){return!0}updateConfig(e){}}class hO extends P1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Sm="$chartjs",_H={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DA=t=>t===null||t==="";function AH(t,e){const r=t.style,n=t.getAttribute("height"),i=t.getAttribute("width");if(t[Sm]={initial:{height:n,width:i,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",DA(i)){const a=oA(t,"width");a!==void 0&&(t.width=a)}if(DA(n))if(t.style.height==="")t.height=t.width/(e||2);else{const a=oA(t,"height");a!==void 0&&(t.height=a)}return t}const dO=Oq?{passive:!0}:!1;function DH(t,e,r){t&&t.addEventListener(e,r,dO)}function NH(t,e,r){t&&t.canvas&&t.canvas.removeEventListener(e,r,dO)}function EH(t,e){const r=_H[t.type]||t.type,{x:n,y:i}=xu(t,e);return{type:r,chart:e,native:t,x:n!==void 0?n:null,y:i!==void 0?i:null}}function Wm(t,e){for(const r of t)if(r===e||r.contains(e))return!0}function CH(t,e,r){const n=t.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Wm(o.addedNodes,n),s=s&&!Wm(o.removedNodes,n);s&&r()});return i.observe(document,{childList:!0,subtree:!0}),i}function MH(t,e,r){const n=t.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Wm(o.removedNodes,n),s=s&&!Wm(o.addedNodes,n);s&&r()});return i.observe(document,{childList:!0,subtree:!0}),i}const _h=new Map;let NA=0;function pO(){const t=window.devicePixelRatio;t!==NA&&(NA=t,_h.forEach((e,r)=>{r.currentDevicePixelRatio!==t&&e()}))}function TH(t,e){_h.size||window.addEventListener("resize",pO),_h.set(t,e)}function OH(t){_h.delete(t),_h.size||window.removeEventListener("resize",pO)}function FH(t,e,r){const n=t.canvas,i=n&&F1(n);if(!i)return;const a=UT((o,u)=>{const l=i.clientWidth;r(o,u),l{const u=o[0],l=u.contentRect.width,c=u.contentRect.height;l===0&&c===0||a(l,c)});return s.observe(i),TH(t,a),s}function _y(t,e,r){r&&r.disconnect(),e==="resize"&&OH(t)}function RH(t,e,r){const n=t.canvas,i=UT(a=>{t.ctx!==null&&r(EH(a,t))},t);return DH(n,e,i),i}class mO extends P1{acquireContext(e,r){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(AH(e,r),n):null}releaseContext(e){const r=e.canvas;if(!r[Sm])return!1;const n=r[Sm].initial;["height","width"].forEach(a=>{const s=n[a];or(s)?r.removeAttribute(a):r.setAttribute(a,s)});const i=n.style||{};return Object.keys(i).forEach(a=>{r.style[a]=i[a]}),r.width=r.width,delete r[Sm],!0}addEventListener(e,r,n){this.removeEventListener(e,r);const i=e.$proxies||(e.$proxies={}),s={attach:CH,detach:MH,resize:FH}[r]||RH;i[r]=s(e,r,n)}removeEventListener(e,r){const n=e.$proxies||(e.$proxies={}),i=n[r];if(!i)return;({attach:_y,detach:_y,resize:_y}[r]||NH)(e,r,i),n[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,r,n,i){return Tq(e,r,n,i)}isAttached(e){const r=F1(e);return!!(r&&r.isConnected)}}function vO(t){return!O1()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?hO:mO}var ym;let Za=(ym=class{constructor(){je(this,"x");je(this,"y");je(this,"active",!1);je(this,"options");je(this,"$animations")}tooltipPosition(e){const{x:r,y:n}=this.getProps(["x","y"],e);return{x:r,y:n}}hasValue(){return tc(this.x)&&tc(this.y)}getProps(e,r){const n=this.$animations;if(!r||!n)return this;const i={};return e.forEach(a=>{i[a]=n[a]&&n[a].active()?n[a]._to:this[a]}),i}},je(ym,"defaults",{}),je(ym,"defaultRoutes"),ym);function BH(t,e){const r=t.options.ticks,n=PH(t),i=Math.min(r.maxTicksLimit||n,n),a=r.major.enabled?kH(e):[],s=a.length,o=a[0],u=a[s-1],l=[];if(s>i)return LH(e,l,a,s/i),l;const c=IH(a,e,i);if(s>0){let f,h;const p=s>1?Math.round((u-o)/(s-1)):null;for($p(e,l,c,or(p)?0:o-p,o),f=0,h=s-1;fi)return u}return Math.max(i,1)}function kH(t){const e=[];let r,n;for(r=0,n=t.length;rt==="left"?"right":t==="right"?"left":t,EA=(t,e,r)=>e==="top"||e==="left"?t[e]+r:t[e]-r,CA=(t,e)=>Math.min(e||t,t);function MA(t,e){const r=[],n=t.length/e,i=t.length;let a=0;for(;as+o)))return u}function qH(t,e){yr(t,r=>{const n=r.gc,i=n.length/2;let a;if(i>e){for(a=0;an?n:r,n=i&&r>n?r:n,{min:Ci(r,Ci(n,r)),max:Ci(n,Ci(r,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Cr(this.options.beforeUpdate,[this])}update(e,r,n){const{beginAtZero:i,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=r,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=uq(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=o=a||n<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),f=c.widest.width,h=c.highest.height,p=wn(this.chart.width-f,0,this.maxWidth);o=e.offset?this.maxWidth/n:p/(n-1),f+6>o&&(o=p/(n-(e.offset?.5:1)),u=this.maxHeight-zf(e.grid)-r.padding-TA(e.title,this.chart.options.font),l=Math.sqrt(f*f+h*h),s=_1(Math.min(Math.asin(wn((c.highest.height+6)/o,-1,1)),Math.asin(wn(u/l,-1,1))-Math.asin(wn(h/l,-1,1)))),s=Math.max(i,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){Cr(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Cr(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:r,options:{ticks:n,title:i,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const u=TA(i,r.options.font);if(o?(e.width=this.maxWidth,e.height=zf(a)+u):(e.height=this.maxHeight,e.width=zf(a)+u),n.display&&this.ticks.length){const{first:l,last:c,widest:f,highest:h}=this._getLabelSizes(),p=n.padding*2,v=ba(this.labelRotation),m=Math.cos(v),b=Math.sin(v);if(o){const y=n.mirror?0:b*f.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+y+p)}else{const y=n.mirror?0:m*f.width+b*h.height;e.width=Math.min(this.maxWidth,e.width+y+p)}this._calculatePadding(l,c,b,m)}}this._handleMargins(),o?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,r,n,i){const{ticks:{align:a,padding:s},position:o}=this.options,u=this.labelRotation!==0,l=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;u?l?(h=i*e.width,p=n*r.height):(h=n*e.height,p=i*r.width):a==="start"?p=r.width:a==="end"?h=e.width:a!=="inner"&&(h=e.width/2,p=r.width/2),this.paddingLeft=Math.max((h-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let c=r.height/2,f=e.height/2;a==="start"?(c=0,f=e.height):a==="end"&&(c=r.height,f=0),this.paddingTop=c+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Cr(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:r}=this.options;return r==="top"||r==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let r,n;for(r=0,n=e.length;r({width:s[N]||0,height:o[N]||0});return{first:E(0),last:E(r-1),widest:E(w),highest:E(C),widths:s,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,r){return NaN}getValueForPixel(e){}getPixelForTick(e){const r=this.ticks;return e<0||e>r.length-1?null:this.getPixelForValue(r[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const r=this._startPixel+e*this._length;return kU(this._alignToPixels?mu(this.chart,r,0):r)}getDecimalForPixel(e){const r=(e-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:r}=this;return e<0&&r<0?r:e>0&&r>0?e:0}getContext(e){const r=this.ticks||[];if(e>=0&&eo*i?o/n:u/i:u*i0}_computeGridLineItems(e){const r=this.axis,n=this.chart,i=this.options,{grid:a,position:s,border:o}=i,u=a.offset,l=this.isHorizontal(),f=this.ticks.length+(u?1:0),h=zf(a),p=[],v=o.setContext(this.getContext()),m=v.display?v.width:0,b=m/2,y=function(I){return mu(n,I,m)};let S,x,A,_,w,C,E,N,M,O,F,U;if(s==="top")S=y(this.bottom),C=this.bottom-h,N=S-b,O=y(e.top)+b,U=e.bottom;else if(s==="bottom")S=y(this.top),O=e.top,U=y(e.bottom)-b,C=S+b,N=this.top+h;else if(s==="left")S=y(this.right),w=this.right-h,E=S-b,M=y(e.left)+b,F=e.right;else if(s==="right")S=y(this.left),M=e.left,F=y(e.right)-b,w=S+b,E=this.left+h;else if(r==="x"){if(s==="center")S=y((e.top+e.bottom)/2+.5);else if(Gt(s)){const I=Object.keys(s)[0],P=s[I];S=y(this.chart.scales[I].getPixelForValue(P))}O=e.top,U=e.bottom,C=S+b,N=C+h}else if(r==="y"){if(s==="center")S=y((e.left+e.right)/2);else if(Gt(s)){const I=Object.keys(s)[0],P=s[I];S=y(this.chart.scales[I].getPixelForValue(P))}w=S-b,E=w-h,M=e.left,F=e.right}const V=Bt(i.ticks.maxTicksLimit,f),H=Math.max(1,Math.ceil(f/V));for(x=0;x0&&(ce-=de/2);break}he={left:ce,top:Se,width:de+ne.width,height:X+ne.height,color:H.backdropColor}}b.push({label:A,font:N,textOffset:F,options:{rotation:m,color:P,strokeColor:K,strokeWidth:$,textAlign:se,textBaseline:U,translation:[_,w],backdrop:he}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:r}=this.options;if(-ba(this.labelRotation))return e==="top"?"left":"right";let i="center";return r.align==="start"?i="left":r.align==="end"?i="right":r.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:r,ticks:{crossAlign:n,mirror:i,padding:a}}=this.options,s=this._getLabelSizes(),o=e+a,u=s.widest.width;let l,c;return r==="left"?i?(c=this.right+a,n==="near"?l="left":n==="center"?(l="center",c+=u/2):(l="right",c+=u)):(c=this.right-o,n==="near"?l="right":n==="center"?(l="center",c-=u/2):(l="left",c=this.left)):r==="right"?i?(c=this.left+a,n==="near"?l="right":n==="center"?(l="center",c-=u/2):(l="left",c-=u)):(c=this.left+o,n==="near"?l="left":n==="center"?(l="center",c+=u/2):(l="right",c=this.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:r},left:n,top:i,width:a,height:s}=this;r&&(e.save(),e.fillStyle=r,e.fillRect(n,i,a,s),e.restore())}getLineWidthForValue(e){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const i=this.ticks.findIndex(a=>a.value===e);return i>=0?r.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const r=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let a,s;const o=(u,l,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(u.x,u.y),n.lineTo(l.x,l.y),n.stroke(),n.restore())};if(r.display)for(a=0,s=i.length;a{this.draw(a)}}]:[{z:n,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:r,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(e){const r=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let a,s;for(a=0,s=r.length;a{const n=r.split("."),i=n.pop(),a=[t].concat(n).join("."),s=e[r].split("."),o=s.pop(),u=s.join(".");Ur.route(a,i,u,o)})}function XH(t){return"id"in t&&"defaults"in t}class ZH{constructor(){this.controllers=new zp(ta,"datasets",!0),this.elements=new zp(Za,"elements"),this.plugins=new zp(Object,"plugins"),this.scales=new zp(qo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,r,n){[...r].forEach(i=>{const a=n||this._getRegistryForType(i);n||a.isForType(i)||a===this.plugins&&i.id?this._exec(e,a,i):yr(i,s=>{const o=n||this._getRegistryForType(s);this._exec(e,o,s)})})}_exec(e,r,n){const i=S1(e);Cr(n["before"+i],[],n),r[e](n),Cr(n["after"+i],[],n)}_getRegistryForType(e){for(let r=0;ra.filter(o=>!s.some(u=>o.plugin.id===u.plugin.id));this._notify(i(r,n),e,"stop"),this._notify(i(n,r),e,"start")}}function JH(t){const e={},r=[],n=Object.keys(va.plugins.items);for(let a=0;a1&&OA(t[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function FA(t,e,r){if(r[e+"AxisID"]===t)return{axis:e}}function aW(t,e){if(e.data&&e.data.datasets){const r=e.data.datasets.filter(n=>n.xAxisID===t||n.yAxisID===t);if(r.length)return FA(t,"x",r[0])||FA(t,"y",r[0])}return{}}function sW(t,e){const r=Bu[t.type]||{scales:{}},n=e.scales||{},i=ub(t.type,e),a=Object.create(null);return Object.keys(n).forEach(s=>{const o=n[s];if(!Gt(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const u=lb(s,o,aW(s,t),Ur.scales[o.type]),l=nW(u,i),c=r.scales||{};a[s]=rh(Object.create(null),[{axis:u},o,c[u],c[l]])}),t.data.datasets.forEach(s=>{const o=s.type||t.type,u=s.indexAxis||ub(o,e),c=(Bu[o]||{}).scales||{};Object.keys(c).forEach(f=>{const h=rW(f,u),p=s[h+"AxisID"]||h;a[p]=a[p]||Object.create(null),rh(a[p],[{axis:h},n[p],c[f]])})}),Object.keys(a).forEach(s=>{const o=a[s];rh(o,[Ur.scales[o.type],Ur.scale])}),a}function gO(t){const e=t.options||(t.options={});e.plugins=Bt(e.plugins,{}),e.scales=sW(t,e)}function yO(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function oW(t){return t=t||{},t.data=yO(t.data),gO(t),t}const RA=new Map,bO=new Set;function Up(t,e){let r=RA.get(t);return r||(r=e(),RA.set(t,r),bO.add(r)),r}const Uf=(t,e,r)=>{const n=Po(e,r);n!==void 0&&t.add(n)};class uW{constructor(e){this._config=oW(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=yO(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),gO(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Up(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,r){return Up(`${e}.transition.${r}`,()=>[[`datasets.${e}.transitions.${r}`,`transitions.${r}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,r){return Up(`${e}-${r}`,()=>[[`datasets.${e}.elements.${r}`,`datasets.${e}`,`elements.${r}`,""]])}pluginScopeKeys(e){const r=e.id,n=this.type;return Up(`${n}-plugin-${r}`,()=>[[`plugins.${r}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,r){const n=this._scopeCache;let i=n.get(e);return(!i||r)&&(i=new Map,n.set(e,i)),i}getOptionScopes(e,r,n){const{options:i,type:a}=this,s=this._cachedScopes(e,n),o=s.get(r);if(o)return o;const u=new Set;r.forEach(c=>{e&&(u.add(e),c.forEach(f=>Uf(u,e,f))),c.forEach(f=>Uf(u,i,f)),c.forEach(f=>Uf(u,Bu[a]||{},f)),c.forEach(f=>Uf(u,Ur,f)),c.forEach(f=>Uf(u,sb,f))});const l=Array.from(u);return l.length===0&&l.push(Object.create(null)),bO.has(r)&&s.set(r,l),l}chartOptionScopes(){const{options:e,type:r}=this;return[e,Bu[r]||{},Ur.datasets[r]||{},{type:r},Ur,sb]}resolveNamedOptions(e,r,n,i=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=BA(this._resolverCache,e,i);let u=s;if(cW(s,r)){a.$shared=!1,n=Io(n)?n():n;const l=this.createResolver(e,n,o);u=rc(s,n,l)}for(const l of r)a[l]=u[l];return a}createResolver(e,r,n=[""],i){const{resolver:a}=BA(this._resolverCache,e,n);return Gt(r)?rc(a,r,void 0,i):a}}function BA(t,e,r){let n=t.get(e);n||(n=new Map,t.set(e,n));const i=r.join();let a=n.get(i);return a||(a={resolver:C1(e,r),subPrefixes:r.filter(o=>!o.toLowerCase().includes("hover"))},n.set(i,a)),a}const lW=t=>Gt(t)&&Object.getOwnPropertyNames(t).some(e=>Io(t[e]));function cW(t,e){const{isScriptable:r,isIndexable:n}=jT(t);for(const i of e){const a=r(i),s=n(i),o=(s||a)&&t[i];if(a&&(Io(o)||lW(o))||s&&Or(o))return!0}return!1}var fW="4.4.2";const hW=["top","bottom","left","right","chartArea"];function PA(t,e){return t==="top"||t==="bottom"||hW.indexOf(t)===-1&&e==="x"}function IA(t,e){return function(r,n){return r[t]===n[t]?r[e]-n[e]:r[t]-n[t]}}function kA(t){const e=t.chart,r=e.options.animation;e.notifyPlugins("afterRender"),Cr(r&&r.onComplete,[t],e)}function dW(t){const e=t.chart,r=e.options.animation;Cr(r&&r.onProgress,[t],e)}function xO(t){return O1()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const _m={},LA=t=>{const e=xO(t);return Object.values(_m).filter(r=>r.canvas===e).pop()};function pW(t,e,r){const n=Object.keys(t);for(const i of n){const a=+i;if(a>=e){const s=t[i];delete t[i],(r>0||a>e)&&(t[a+r]=s)}}}function mW(t,e,r,n){return!r||t.type==="mouseout"?null:n?e:t}function qp(t,e,r){return t.options.clip?t[r]:e[r]}function vW(t,e){const{xScale:r,yScale:n}=t;return r&&n?{left:qp(r,e,"left"),right:qp(r,e,"right"),top:qp(n,e,"top"),bottom:qp(n,e,"bottom")}:e}class yo{static register(...e){va.add(...e),$A()}static unregister(...e){va.remove(...e),$A()}constructor(e,r){const n=this.config=new uW(r),i=xO(e),a=LA(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||vO(i)),this.platform.updateConfig(n);const o=this.platform.acquireContext(i,s.aspectRatio),u=o&&o.canvas,l=u&&u.height,c=u&&u.width;if(this.id=DU(),this.ctx=o,this.canvas=u,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new KH,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=UU(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],_m[this.id]=this,!o||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ha.listen(this,"complete",kA),Ha.listen(this,"progress",dW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:r},width:n,height:i,_aspectRatio:a}=this;return or(e)?r&&a?a:i?n/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return va}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nA(this.canvas,this.ctx),this}stop(){return Ha.stop(this),this}resize(e,r){Ha.running(this)?this._resizeBeforeDraw={width:e,height:r}:this._resize(e,r)}_resize(e,r){const n=this.options,i=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,e,r,a),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,sA(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Cr(n.onResize,[this,s],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};yr(r,(n,i)=>{n.id=i})}buildOrUpdateScales(){const e=this.options,r=e.scales,n=this.scales,i=Object.keys(n).reduce((s,o)=>(s[o]=!1,s),{});let a=[];r&&(a=a.concat(Object.keys(r).map(s=>{const o=r[s],u=lb(s,o),l=u==="r",c=u==="x";return{options:o,dposition:l?"chartArea":c?"bottom":"left",dtype:l?"radialLinear":c?"category":"linear"}}))),yr(a,s=>{const o=s.options,u=o.id,l=lb(u,o),c=Bt(o.type,s.dtype);(o.position===void 0||PA(o.position,l)!==PA(s.dposition))&&(o.position=s.dposition),i[u]=!0;let f=null;if(u in n&&n[u].type===c)f=n[u];else{const h=va.getScale(c);f=new h({id:u,type:c,ctx:this.ctx,chart:this}),n[f.id]=f}f.init(o,e)}),yr(i,(s,o)=>{s||delete n[o]}),yr(n,s=>{Mn.configure(this,s,s.options),Mn.addBox(this,s)})}_updateMetasets(){const e=this._metasets,r=this.data.datasets.length,n=e.length;if(e.sort((i,a)=>i.index-a.index),n>r){for(let i=r;ir.length&&delete this._stacks,e.forEach((n,i)=>{r.filter(a=>a===n._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],r=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=r.length;n{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const r=this.config;r.update();const n=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,c=this.data.datasets.length;l{l.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(IA("z","_idx"));const{_active:o,_lastEvent:u}=this;u?this._eventHandler(u,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){yr(this.scales,e=>{Mn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,r=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!G_(r,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,r=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:a}of r){const s=n==="_removeElements"?-a:a;pW(e,i,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const r=this.data.datasets.length,n=a=>new Set(e.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),i=n(0);for(let a=1;aa.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Mn.update(this,this.width,this.height,e);const r=this.chartArea,n=r.width<=0||r.height<=0;this._layers=[],yr(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let r=0,n=this.data.datasets.length;r=0;--r)this._drawDataset(e[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const r=this.ctx,n=e._clip,i=!n.disabled,a=vW(e,this.chartArea),s={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Gv(r,{left:n.left===!1?0:a.left-n.left,right:n.right===!1?this.width:a.right+n.right,top:n.top===!1?0:a.top-n.top,bottom:n.bottom===!1?this.height:a.bottom+n.bottom}),e.controller.draw(),i&&Xv(r),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return Ts(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,r,n,i){const a=lO.modes[r];return typeof a=="function"?a(this,e,n,i):[]}getDatasetMeta(e){const r=this.data.datasets[e],n=this._metasets;let i=n.filter(a=>a&&a._dataset===r).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:e,_dataset:r,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const r=this.data.datasets[e];if(!r)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!r.hidden}setDatasetVisibility(e,r){const n=this.getDatasetMeta(e);n.hidden=!r}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,r,n){const i=n?"show":"hide",a=this.getDatasetMeta(e),s=a.controller._resolveAnimations(void 0,i);xh(r)?(a.data[r].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),s.update(a,{visible:n}),this.update(o=>o.datasetIndex===e?i:void 0))}hide(e,r){this._updateVisibility(e,r,!1)}show(e,r){this._updateVisibility(e,r,!0)}_destroyDatasetMeta(e){const r=this._metasets[e];r&&r.controller&&r.controller._destroy(),delete this._metasets[e]}_stop(){let e,r;for(this.stop(),Ha.remove(this),e=0,r=this.data.datasets.length;e{r.addEventListener(this,a,s),e[a]=s},i=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};yr(this.options.events,a=>n(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,r=this.platform,n=(u,l)=>{r.addEventListener(this,u,l),e[u]=l},i=(u,l)=>{e[u]&&(r.removeEventListener(this,u,l),delete e[u])},a=(u,l)=>{this.canvas&&this.resize(u,l)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),n("resize",a),n("detach",s)};s=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),n("attach",o)},r.isAttached(this.canvas)?o():s()}unbindEvents(){yr(this._listeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._listeners={},yr(this._responsiveListeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,r,n){const i=n?"set":"remove";let a,s,o,u;for(r==="dataset"&&(a=this.getDatasetMeta(e[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),o=0,u=e.length;o{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!Lm(n,r)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,r))}notifyPlugins(e,r,n){return this._plugins.notify(this,e,r,n)}isPluginEnabled(e){return this._plugins._cache.filter(r=>r.plugin.id===e).length===1}_updateHoverStyles(e,r,n){const i=this.options.hover,a=(u,l)=>u.filter(c=>!l.some(f=>c.datasetIndex===f.datasetIndex&&c.index===f.index)),s=a(r,e),o=n?e:a(e,r);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(e,r){const n={event:e,replay:r,cancelable:!0,inChartArea:this.isPointInArea(e)},i=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,i)===!1)return;const a=this._handleEvent(e,r,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(a||n.changed)&&this.render(),this}_handleEvent(e,r,n){const{_active:i=[],options:a}=this,s=r,o=this._getActiveElements(e,i,n,s),u=OU(e),l=mW(e,this._lastEvent,n,u);n&&(this._lastEvent=null,Cr(a.onHover,[e,o,this],this),u&&Cr(a.onClick,[e,o,this],this));const c=!Lm(o,i);return(c||r)&&(this._active=o,this._updateHoverStyles(o,i,r)),this._lastEvent=l,c}_getActiveElements(e,r,n,i){if(e.type==="mouseout")return[];if(!n)return r;const a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,i)}}je(yo,"defaults",Ur),je(yo,"instances",_m),je(yo,"overrides",Bu),je(yo,"registry",va),je(yo,"version",fW),je(yo,"getChart",LA);function $A(){return yr(yo.instances,t=>t._plugins.invalidate())}function gW(t,e,r){const{startAngle:n,pixelMargin:i,x:a,y:s,outerRadius:o,innerRadius:u}=e;let l=i/o;t.beginPath(),t.arc(a,s,o,n-l,r+l),u>i?(l=i/u,t.arc(a,s,u,r+l,n-l,!0)):t.arc(a,s,i,r+en,n-en),t.closePath(),t.clip()}function yW(t){return E1(t,["outerStart","outerEnd","innerStart","innerEnd"])}function bW(t,e,r,n){const i=yW(t.options.borderRadius),a=(r-e)/2,s=Math.min(a,n*e/2),o=u=>{const l=(r-Math.min(a,u))*n/2;return wn(u,0,Math.min(a,l))};return{outerStart:o(i.outerStart),outerEnd:o(i.outerEnd),innerStart:wn(i.innerStart,0,s),innerEnd:wn(i.innerEnd,0,s)}}function El(t,e,r,n){return{x:r+t*Math.cos(e),y:n+t*Math.sin(e)}}function Vm(t,e,r,n,i,a){const{x:s,y:o,startAngle:u,pixelMargin:l,innerRadius:c}=e,f=Math.max(e.outerRadius+n+r-l,0),h=c>0?c+n+r+l:0;let p=0;const v=i-u;if(n){const H=c>0?c-n:0,I=f>0?f-n:0,P=(H+I)/2,K=P!==0?v*P/(P+n):v;p=(v-K)/2}const m=Math.max(.001,v*f-r/Rr)/f,b=(v-m)/2,y=u+b+p,S=i-b-p,{outerStart:x,outerEnd:A,innerStart:_,innerEnd:w}=bW(e,h,f,S-y),C=f-x,E=f-A,N=y+x/C,M=S-A/E,O=h+_,F=h+w,U=y+_/O,V=S-w/F;if(t.beginPath(),a){const H=(N+M)/2;if(t.arc(s,o,f,N,H),t.arc(s,o,f,H,M),A>0){const $=El(E,M,s,o);t.arc($.x,$.y,A,M,S+en)}const I=El(F,S,s,o);if(t.lineTo(I.x,I.y),w>0){const $=El(F,V,s,o);t.arc($.x,$.y,w,S+en,V+Math.PI)}const P=(S-w/h+(y+_/h))/2;if(t.arc(s,o,h,S-w/h,P,!0),t.arc(s,o,h,P,y+_/h,!0),_>0){const $=El(O,U,s,o);t.arc($.x,$.y,_,U+Math.PI,y-en)}const K=El(C,y,s,o);if(t.lineTo(K.x,K.y),x>0){const $=El(C,N,s,o);t.arc($.x,$.y,x,y-en,N)}}else{t.moveTo(s,o);const H=Math.cos(N)*f+s,I=Math.sin(N)*f+o;t.lineTo(H,I);const P=Math.cos(M)*f+s,K=Math.sin(M)*f+o;t.lineTo(P,K)}t.closePath()}function xW(t,e,r,n,i){const{fullCircles:a,startAngle:s,circumference:o}=e;let u=e.endAngle;if(a){Vm(t,e,r,n,u,i);for(let l=0;l=Fr||wh(s,u,l),b=Cs(o,c+p,f+p);return m&&b}getCenterPoint(r){const{x:n,y:i,startAngle:a,endAngle:s,innerRadius:o,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],r),{offset:l,spacing:c}=this.options,f=(a+s)/2,h=(o+u+c+l)/2;return{x:n+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(r){return this.getCenterPoint(r)}draw(r){const{options:n,circumference:i}=this,a=(n.offset||0)/4,s=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Fr?Math.floor(i/Fr):0,i===0||this.innerRadius<0||this.outerRadius<0)return;r.save();const u=(this.startAngle+this.endAngle)/2;r.translate(Math.cos(u)*a,Math.sin(u)*a);const l=1-Math.sin(Math.min(Rr,i||0)),c=a*l;r.fillStyle=n.backgroundColor,r.strokeStyle=n.borderColor,xW(r,this,c,s,o),wW(r,this,c,s,o),r.restore()}}je(Il,"id","arc"),je(Il,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),je(Il,"defaultRoutes",{backgroundColor:"backgroundColor"}),je(Il,"descriptors",{_scriptable:!0,_indexable:r=>r!=="borderDash"});function wO(t,e,r=e){t.lineCap=Bt(r.borderCapStyle,e.borderCapStyle),t.setLineDash(Bt(r.borderDash,e.borderDash)),t.lineDashOffset=Bt(r.borderDashOffset,e.borderDashOffset),t.lineJoin=Bt(r.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Bt(r.borderWidth,e.borderWidth),t.strokeStyle=Bt(r.borderColor,e.borderColor)}function SW(t,e,r){t.lineTo(r.x,r.y)}function _W(t){return t.stepped?QU:t.tension||t.cubicInterpolationMode==="monotone"?eq:SW}function SO(t,e,r={}){const n=t.length,{start:i=0,end:a=n-1}=r,{start:s,end:o}=e,u=Math.max(i,s),l=Math.min(a,o),c=io&&a>o;return{count:n,start:u,loop:e.loop,ilen:l(s+(l?o-A:A))%a,x=()=>{m!==b&&(t.lineTo(c,b),t.lineTo(c,m),t.lineTo(c,y))};for(u&&(p=i[S(0)],t.moveTo(p.x,p.y)),h=0;h<=o;++h){if(p=i[S(h)],p.skip)continue;const A=p.x,_=p.y,w=A|0;w===v?(_b&&(b=_),c=(f*c+A)/++f):(x(),t.lineTo(A,_),v=w,f=0,m=b=_),y=_}x()}function cb(t){const e=t.options,r=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!r?DW:AW}function NW(t){return t.stepped?Fq:t.tension||t.cubicInterpolationMode==="monotone"?Rq:wu}function EW(t,e,r,n){let i=e._path;i||(i=e._path=new Path2D,e.path(i,r,n)&&i.closePath()),wO(t,e.options),t.stroke(i)}function CW(t,e,r,n){const{segments:i,options:a}=e,s=cb(e);for(const o of i)wO(t,a,o.style),t.beginPath(),s(t,e,o,{start:r,end:r+n-1})&&t.closePath(),t.stroke()}const MW=typeof Path2D=="function";function TW(t,e,r,n){MW&&!e.options.segment?EW(t,e,r,n):CW(t,e,r,n)}class Os extends Za{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,r){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Aq(this._points,n,e,i,r),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=$q(this,this.options.segment))}first(){const e=this.segments,r=this.points;return e.length&&r[e[0].start]}last(){const e=this.segments,r=this.points,n=e.length;return n&&r[e[n-1].end]}interpolate(e,r){const n=this.options,i=e[r],a=this.points,s=nO(this,{property:r,start:i,end:i});if(!s.length)return;const o=[],u=NW(n);let l,c;for(l=0,c=s.length;le!=="borderDash"&&e!=="fill"});function zA(t,e,r,n){const i=t.options,{[r]:a}=t.getProps([r],n);return Math.abs(e-a)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function DO(t){return fb[t%fb.length]}function NO(t){return UA[t%UA.length]}function IW(t,e){return t.borderColor=DO(e),t.backgroundColor=NO(e),++e}function kW(t,e){return t.backgroundColor=t.data.map(()=>DO(e++)),e}function LW(t,e){return t.backgroundColor=t.data.map(()=>NO(e++)),e}function $W(t){let e=0;return(r,n)=>{const i=t.getDatasetMeta(n).controller;i instanceof No?e=kW(r,e):i instanceof Yl?e=LW(r,e):i&&(e=IW(r,e))}}function qA(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function zW(t){return t&&(t.borderColor||t.backgroundColor)}var EO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,r){if(!r.enabled)return;const{data:{datasets:n},options:i}=t.config,{elements:a}=i;if(!r.forceOverride&&(qA(n)||zW(i)||a&&qA(a)))return;const s=$W(t);n.forEach(s)}};function UW(t,e,r,n,i){const a=i.samples||n;if(a>=r)return t.slice(e,e+r);const s=[],o=(r-2)/(a-2);let u=0;const l=e+r-1;let c=e,f,h,p,v,m;for(s[u++]=t[c],f=0;fp&&(p=v,h=t[S],m=S);s[u++]=h,c=m}return s[u++]=t[l],s}function qW(t,e,r,n){let i=0,a=0,s,o,u,l,c,f,h,p,v,m;const b=[],y=e+r-1,S=t[e].x,A=t[y].x-S;for(s=e;sm&&(m=l,h=s),i=(a*i+o.x)/++a;else{const w=s-1;if(!or(f)&&!or(h)){const C=Math.min(f,h),E=Math.max(f,h);C!==p&&C!==w&&b.push({...t[C],x:i}),E!==p&&E!==w&&b.push({...t[E],x:i})}s>0&&w!==p&&b.push(t[w]),b.push(o),c=_,a=0,v=m=l,f=h=p=s}}return b}function CO(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function HA(t){t.data.datasets.forEach(e=>{CO(e)})}function HW(t,e){const r=e.length;let n=0,i;const{iScale:a}=t,{min:s,max:o,minDefined:u,maxDefined:l}=a.getUserBounds();return u&&(n=wn(Ms(e,a.axis,s).lo,0,r-1)),l?i=wn(Ms(e,a.axis,o).hi+1,n,r)-n:i=r-n,{start:n,count:i}}var MO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,r)=>{if(!r.enabled){HA(t);return}const n=t.width;t.data.datasets.forEach((i,a)=>{const{_data:s,indexAxis:o}=i,u=t.getDatasetMeta(a),l=s||i.data;if(Xf([o,t.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const c=t.scales[u.xAxisID];if(c.type!=="linear"&&c.type!=="time"||t.options.parsing)return;let{start:f,count:h}=HW(u,l);const p=r.threshold||4*n;if(h<=p){CO(i);return}or(s)&&(i._data=l,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let v;switch(r.algorithm){case"lttb":v=UW(l,f,h,n,r);break;case"min-max":v=qW(l,f,h,n);break;default:throw new Error(`Unsupported decimation algorithm '${r.algorithm}'`)}i._decimated=v})},destroy(t){HA(t)}};function WW(t,e,r){const n=t.segments,i=t.points,a=e.points,s=[];for(const o of n){let{start:u,end:l}=o;l=I1(u,l,i);const c=hb(r,i[u],i[l],o.loop);if(!e.segments){s.push({source:o,target:c,start:i[u],end:i[l]});continue}const f=nO(e,c);for(const h of f){const p=hb(r,a[h.start],a[h.end],h.loop),v=rO(o,i,p);for(const m of v)s.push({source:m,target:h,start:{[r]:WA(c,p,"start",Math.max)},end:{[r]:WA(c,p,"end",Math.min)}})}}return s}function hb(t,e,r,n){if(n)return;let i=e[t],a=r[t];return t==="angle"&&(i=Ti(i),a=Ti(a)),{property:t,start:i,end:a}}function VW(t,e){const{x:r=null,y:n=null}=t||{},i=e.points,a=[];return e.segments.forEach(({start:s,end:o})=>{o=I1(s,o,i);const u=i[s],l=i[o];n!==null?(a.push({x:u.x,y:n}),a.push({x:l.x,y:n})):r!==null&&(a.push({x:r,y:u.y}),a.push({x:r,y:l.y}))}),a}function I1(t,e,r){for(;e>t;e--){const n=r[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function WA(t,e,r,n){return t&&e?n(t[r],e[r]):t?t[r]:e?e[r]:0}function TO(t,e){let r=[],n=!1;return Or(t)?(n=!0,r=t):r=VW(t,e),r.length?new Os({points:r,options:{tension:0},_loop:n,_fullLoop:n}):null}function VA(t){return t&&t.fill!==!1}function YW(t,e,r){let i=t[e].fill;const a=[e];let s;if(!r)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!Vr(i))return i;if(s=t[i],!s)return!1;if(s.visible)return i;a.push(i),i=s.fill}return!1}function jW(t,e,r){const n=KW(t);if(Gt(n))return isNaN(n.value)?!1:n;let i=parseFloat(n);return Vr(i)&&Math.floor(i)===i?GW(n[0],e,i,r):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function GW(t,e,r,n){return(t==="-"||t==="+")&&(r=e+r),r===e||r<0||r>=n?!1:r}function XW(t,e){let r=null;return t==="start"?r=e.bottom:t==="end"?r=e.top:Gt(t)?r=e.getPixelForValue(t.value):e.getBasePixel&&(r=e.getBasePixel()),r}function ZW(t,e,r){let n;return t==="start"?n=r:t==="end"?n=e.options.reverse?e.min:e.max:Gt(t)?n=t.value:n=e.getBaseValue(),n}function KW(t){const e=t.options,r=e.fill;let n=Bt(r&&r.target,r);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function JW(t){const{scale:e,index:r,line:n}=t,i=[],a=n.segments,s=n.points,o=QW(e,r);o.push(TO({x:null,y:e.bottom},n));for(let u=0;u=0;--s){const o=i[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),n&&o.fill&&Ny(t.ctx,o,a))}},beforeDatasetsDraw(t,e,r){if(r.drawTime!=="beforeDatasetsDraw")return;const n=t.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){const a=n[i].$filler;VA(a)&&Ny(t.ctx,a,t.chartArea)}},beforeDatasetDraw(t,e,r){const n=e.meta.$filler;!VA(n)||r.drawTime!=="beforeDatasetDraw"||Ny(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const XA=(t,e)=>{let{boxHeight:r=e,boxWidth:n=e}=t;return t.usePointStyle&&(r=Math.min(r,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:r,itemHeight:Math.max(e,r)}},lV=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class ZA extends Za{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r,n){this.maxWidth=e,this.maxHeight=r,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let r=Cr(e.generateLabels,[this.chart],this)||[];e.filter&&(r=r.filter(n=>e.filter(n,this.chart.data))),e.sort&&(r=r.sort((n,i)=>e.sort(n,i,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:e,ctx:r}=this;if(!e.display){this.width=this.height=0;return}const n=e.labels,i=pn(n.font),a=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:u}=XA(n,a);let l,c;r.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(s,a,o,u)+10):(c=this.maxHeight,l=this._fitCols(s,i,o,u)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,r,n,i){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,u=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+o;let f=e;a.textAlign="left",a.textBaseline="middle";let h=-1,p=-c;return this.legendItems.forEach((v,m)=>{const b=n+r/2+a.measureText(v.text).width;(m===0||l[l.length-1]+b+2*o>s)&&(f+=c,l[l.length-(m>0?0:1)]=0,p+=c,h++),u[m]={left:0,top:p,row:h,width:b,height:i},l[l.length-1]+=b+o}),f}_fitCols(e,r,n,i){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,u=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-e;let f=o,h=0,p=0,v=0,m=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:S,itemHeight:x}=cV(n,r,a,b,i);y>0&&p+x+2*o>c&&(f+=h+o,l.push({width:h,height:p}),v+=h+o,m++,h=p=0),u[y]={left:v,top:p,col:m,width:S,height:x},h=Math.max(h,S),p+=x+o}),f+=h,l.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:n,labels:{padding:i},rtl:a}}=this,s=Vl(a,this.left,this.width);if(this.isHorizontal()){let o=0,u=kn(n,this.left+i,this.right-this.lineWidths[o]);for(const l of r)o!==l.row&&(o=l.row,u=kn(n,this.left+i,this.right-this.lineWidths[o])),l.top+=this.top+e+i,l.left=s.leftForLtr(s.x(u),l.width),u+=l.width+i}else{let o=0,u=kn(n,this.top+e+i,this.bottom-this.columnSizes[o].height);for(const l of r)l.col!==o&&(o=l.col,u=kn(n,this.top+e+i,this.bottom-this.columnSizes[o].height)),l.top=u,l.left+=this.left+i,l.left=s.leftForLtr(s.x(l.left),l.width),u+=l.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Gv(e,this),this._draw(),Xv(e)}}_draw(){const{options:e,columnSizes:r,lineWidths:n,ctx:i}=this,{align:a,labels:s}=e,o=Ur.color,u=Vl(e.rtl,this.left,this.width),l=pn(s.font),{padding:c}=s,f=l.size,h=f/2;let p;this.drawTitle(),i.textAlign=u.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:v,boxHeight:m,itemHeight:b}=XA(s,f),y=function(w,C,E){if(isNaN(v)||v<=0||isNaN(m)||m<0)return;i.save();const N=Bt(E.lineWidth,1);if(i.fillStyle=Bt(E.fillStyle,o),i.lineCap=Bt(E.lineCap,"butt"),i.lineDashOffset=Bt(E.lineDashOffset,0),i.lineJoin=Bt(E.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=Bt(E.strokeStyle,o),i.setLineDash(Bt(E.lineDash,[])),s.usePointStyle){const M={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:N},O=u.xPlus(w,v/2),F=C+h;VT(i,M,O,F,s.pointStyleWidth&&v)}else{const M=C+Math.max((f-m)/2,0),O=u.leftForLtr(w,v),F=Cu(E.borderRadius);i.beginPath(),Object.values(F).some(U=>U!==0)?Sh(i,{x:O,y:M,w:v,h:m,radius:F}):i.rect(O,M,v,m),i.fill(),N!==0&&i.stroke()}i.restore()},S=function(w,C,E){Pu(i,E.text,w,C+b/2,l,{strikethrough:E.hidden,textAlign:u.textAlign(E.textAlign)})},x=this.isHorizontal(),A=this._computeTitleHeight();x?p={x:kn(a,this.left+c,this.right-n[0]),y:this.top+c+A,line:0}:p={x:this.left+c,y:kn(a,this.top+A+c,this.bottom-r[0].height),line:0},QT(this.ctx,e.textDirection);const _=b+c;this.legendItems.forEach((w,C)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const E=i.measureText(w.text).width,N=u.textAlign(w.textAlign||(w.textAlign=s.textAlign)),M=v+h+E;let O=p.x,F=p.y;u.setWidth(this.width),x?C>0&&O+M+c>this.right&&(F=p.y+=_,p.line++,O=p.x=kn(a,this.left+c,this.right-n[p.line])):C>0&&F+_>this.bottom&&(O=p.x=O+r[p.line].width+c,p.line++,F=p.y=kn(a,this.top+A+c,this.bottom-r[p.line].height));const U=u.x(O);if(y(U,F,w),O=qU(N,O+v+h,x?O+M:this.right,e.rtl),S(u.x(O),F,w),x)p.x+=M+c;else if(typeof w.text!="string"){const V=l.lineHeight;p.y+=RO(w,V)+c}else p.y+=_}),eO(this.ctx,e.textDirection)}drawTitle(){const e=this.options,r=e.title,n=pn(r.font),i=Wn(r.padding);if(!r.display)return;const a=Vl(e.rtl,this.left,this.width),s=this.ctx,o=r.position,u=n.size/2,l=i.top+u;let c,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,f=kn(e.align,f,this.right-h);else{const v=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);c=l+kn(e.align,this.top,this.bottom-v-e.labels.padding-this._computeTitleHeight())}const p=kn(o,f,f+h);s.textAlign=a.textAlign(D1(o)),s.textBaseline="middle",s.strokeStyle=r.color,s.fillStyle=r.color,s.font=n.string,Pu(s,r.text,p,c,n)}_computeTitleHeight(){const e=this.options.title,r=pn(e.font),n=Wn(e.padding);return e.display?r.lineHeight+n.height:0}_getLegendItemAt(e,r){let n,i,a;if(Cs(e,this.left,this.right)&&Cs(r,this.top,this.bottom)){for(a=this.legendHitBoxes,n=0;na.length>s.length?a:s)),e+r.size/2+n.measureText(i).width}function hV(t,e,r){let n=t;return typeof e.text!="string"&&(n=RO(e,r)),n}function RO(t,e){const r=t.text?t.text.length:0;return e*r}function dV(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var BO={id:"legend",_element:ZA,start(t,e,r){const n=t.legend=new ZA({ctx:t.ctx,options:r,chart:t});Mn.configure(t,n,r),Mn.addBox(t,n)},stop(t){Mn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,r){const n=t.legend;Mn.configure(t,n,r),n.options=r},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,r){const n=e.datasetIndex,i=r.chart;i.isDatasetVisible(n)?(i.hide(n),e.hidden=!0):(i.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:r,pointStyle:n,textAlign:i,color:a,useBorderRadius:s,borderRadius:o}}=t.legend.options;return t._getSortedDatasetMetas().map(u=>{const l=u.controller.getStyle(r?0:void 0),c=Wn(l.borderWidth);return{text:e[u.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!u.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:s&&(o||l.borderRadius),datasetIndex:u.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class k1 extends Za{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=r;const i=Or(n.text)?n.text.length:1;this._padding=Wn(n.padding);const a=i*pn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:r,left:n,bottom:i,right:a,options:s}=this,o=s.align;let u=0,l,c,f;return this.isHorizontal()?(c=kn(o,n,a),f=r+e,l=a-n):(s.position==="left"?(c=n+e,f=kn(o,i,r),u=Rr*-.5):(c=a-e,f=kn(o,r,i),u=Rr*.5),l=i-r),{titleX:c,titleY:f,maxWidth:l,rotation:u}}draw(){const e=this.ctx,r=this.options;if(!r.display)return;const n=pn(r.font),a=n.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:u,rotation:l}=this._drawArgs(a);Pu(e,r.text,0,0,n,{color:r.color,maxWidth:u,rotation:l,textAlign:D1(r.align),textBaseline:"middle",translation:[s,o]})}}function pV(t,e){const r=new k1({ctx:t.ctx,options:e,chart:t});Mn.configure(t,r,e),Mn.addBox(t,r),t.titleBlock=r}var PO={id:"title",_element:k1,start(t,e,r){pV(t,r)},stop(t){const e=t.titleBlock;Mn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,r){const n=t.titleBlock;Mn.configure(t,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Hp=new WeakMap;var IO={id:"subtitle",start(t,e,r){const n=new k1({ctx:t.ctx,options:r,chart:t});Mn.configure(t,n,r),Mn.addBox(t,n),Hp.set(t,n)},stop(t){Mn.removeBox(t,Hp.get(t)),Hp.delete(t)},beforeUpdate(t,e,r){const n=Hp.get(t);Mn.configure(t,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kf={average(t){if(!t.length)return!1;let e,r,n=new Set,i=0,a=0;for(e=0,r=t.length;eo+u)/n.size,y:i/a}},nearest(t,e){if(!t.length)return!1;let r=e.x,n=e.y,i=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=t.length;ao({chart:e,initial:r.initial,numSteps:s,currentStep:Math.min(n-r.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=qT.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let r=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const a=n.items;let s=a.length-1,o=!1,u;for(;s>=0;--s)u=a[s],u._active?(u._total>n.duration&&(n.duration=u._total),u.tick(e),o=!0):(a[s]=a[a.length-1],a.pop());o&&(i.draw(),this._notify(i,n,e,"progress")),a.length||(n.running=!1,this._notify(i,n,e,"complete"),n.initial=!1),r+=a.length}),this._lastDate=e,r===0&&(this._running=!1)}_getAnims(e){const r=this._charts;let n=r.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(e,n)),n}listen(e,r,n){this._getAnims(e).listeners[r].push(n)}add(e,r){!r||!r.length||this._getAnims(e).items.push(...r)}has(e){return this._getAnims(e).items.length>0}start(e){const r=this._charts.get(e);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const r=this._charts.get(e);return!(!r||!r.running||!r.items.length)}stop(e){const r=this._charts.get(e);if(!r||!r.items.length)return;const n=r.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();r.items=[],this._notify(e,r,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ha=new Hq;const mA="transparent",Wq={boolean(t,e,r){return r>.5?e:t},color(t,e,r){const n=aA(t||mA),i=n.valid&&aA(e||mA);return i&&i.valid?i.mix(n,r).hexString():e},number(t,e,r){return t+(e-t)*r}};class sO{constructor(e,r,n,i){const a=r[n];i=Gf([e.to,i,a,e.from]);const s=Gf([e.from,a,i]);this._active=!0,this._fn=e.fn||Wq[e.type||typeof s],this._easing=nh[e.easing]||nh.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=r,this._prop=n,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(e,r,n){if(this._active){this._notify(!1);const i=this._target[this._prop],a=n-this._start,s=this._duration-a;this._start=n,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=a,this._loop=!!e.loop,this._to=Gf([e.to,r,i,e.from]),this._from=Gf([e.from,i,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const r=e-this._start,n=this._duration,i=this._prop,a=this._from,s=this._loop,o=this._to;let u;if(this._active=a!==o&&(s||r1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[i]=this._fn(a,o,u)}wait(){const e=this._promises||(this._promises=[]);return new Promise((r,n)=>{e.push({res:r,rej:n})})}_notify(e){const r=e?"res":"rej",n=this._promises||[];for(let i=0;i{const a=e[i];if(!Gt(a))return;const s={};for(const o of r)s[o]=a[o];(Or(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!n.has(o))&&n.set(o,s)})})}_animateOptions(e,r){const n=r.options,i=Yq(e,n);if(!i)return[];const a=this._createAnimations(i,n);return n.$shared&&Vq(e.options.$animations,n).then(()=>{e.options=n},()=>{}),a}_createAnimations(e,r){const n=this._properties,i=[],a=e.$animations||(e.$animations={}),s=Object.keys(r),o=Date.now();let u;for(u=s.length-1;u>=0;--u){const l=s[u];if(l.charAt(0)==="$")continue;if(l==="options"){i.push(...this._animateOptions(e,r));continue}const c=r[l];let f=a[l];const h=n.get(l);if(f)if(h&&f.active()){f.update(h,c,o);continue}else f.cancel();if(!h||!h.duration){e[l]=c;continue}a[l]=f=new sO(h,e,l,c),i.push(f)}return i}update(e,r){if(this._properties.size===0){Object.assign(e,r);return}const n=this._createAnimations(e,r);if(n.length)return Ha.add(this._chart,n),!0}}function Vq(t,e){const r=[],n=Object.keys(e);for(let i=0;i0||!r&&a<0)return i.index}return null}function xA(t,e){const{chart:r,_cachedMeta:n}=t,i=r._stacks||(r._stacks={}),{iScale:a,vScale:s,index:o}=n,u=a.axis,l=s.axis,c=Zq(a,s,n),f=e.length;let h;for(let p=0;pr[n].axis===e).shift()}function Qq(t,e){return Uo(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function eH(t,e,r){return Uo(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:r,index:e,mode:"default",type:"data"})}function If(t,e){const r=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const i of e){const a=i._stacks;if(!a||a[n]===void 0||a[n][r]===void 0)return;delete a[n][r],a[n]._visualValues!==void 0&&a[n]._visualValues[r]!==void 0&&delete a[n]._visualValues[r]}}}const wy=t=>t==="reset"||t==="none",wA=(t,e)=>e?t:Object.assign({},t),tH=(t,e,r)=>t&&!e.hidden&&e._stacked&&{keys:oO(r,!0),values:null};class ta{constructor(e,r){this.chart=e,this._ctx=e.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=yA(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&If(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,r=this._cachedMeta,n=this.getDataset(),i=(f,h,p,v)=>f==="x"?h:f==="r"?v:p,a=r.xAxisID=Bt(n.xAxisID,xy(e,"x")),s=r.yAxisID=Bt(n.yAxisID,xy(e,"y")),o=r.rAxisID=Bt(n.rAxisID,xy(e,"r")),u=r.indexAxis,l=r.iAxisID=i(u,a,s,o),c=r.vAxisID=i(u,s,a,o);r.xScale=this.getScaleForId(a),r.yScale=this.getScaleForId(s),r.rScale=this.getScaleForId(o),r.iScale=this.getScaleForId(l),r.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const r=this._cachedMeta;return e===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&rA(this._data,this),e._stacked&&If(e)}_dataCheck(){const e=this.getDataset(),r=e.data||(e.data=[]),n=this._data;if(Gt(r))this._data=Xq(r);else if(n!==r){if(n){rA(n,this);const i=this._cachedMeta;If(i),i._parsed=[]}r&&Object.isExtensible(r)&&UU(r,this),this._syncList=[],this._data=r}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const r=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const a=r._stacked;r._stacked=yA(r.vScale,r),r.stack!==n.stack&&(i=!0,If(r),r.stack=n.stack),this._resyncElements(e),(i||a!==r._stacked)&&xA(this,r._parsed)}configure(){const e=this.chart.config,r=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),r,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,r){const{_cachedMeta:n,_data:i}=this,{iScale:a,_stacked:s}=n,o=a.axis;let u=e===0&&r===i.length?!0:n._sorted,l=e>0&&n._parsed[e-1],c,f,h;if(this._parsing===!1)n._parsed=i,n._sorted=!0,h=i;else{Or(i[e])?h=this.parseArrayData(n,i,e,r):Gt(i[e])?h=this.parseObjectData(n,i,e,r):h=this.parsePrimitiveData(n,i,e,r);const p=()=>f[o]===null||l&&f[o]m||f=0;--h)if(!v()){this.updateRangeFromParsed(l,e,p,u);break}}return l}getAllParsedValues(e){const r=this._cachedMeta._parsed,n=[];let i,a,s;for(i=0,a=r.length;i=0&&ethis.getContext(n,i,r),m=l.resolveNamedOptions(h,p,v,f);return m.$shared&&(m.$shared=u,a[s]=Object.freeze(wA(m,u))),m}_resolveAnimations(e,r,n){const i=this.chart,a=this._cachedDataOpts,s=`animation-${r}`,o=a[s];if(o)return o;let u;if(i.options.animation!==!1){const c=this.chart.config,f=c.datasetAnimationScopeKeys(this._type,r),h=c.getOptionScopes(this.getDataset(),f);u=c.createResolver(h,this.getContext(e,n,r))}const l=new W1(i,u&&u.animations);return u&&u._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,r){return!r||wy(e)||this.chart._animationsDisabled}_getSharedOptions(e,r){const n=this.resolveDataElementOptions(e,r),i=this._sharedOptions,a=this.getSharedOptions(n),s=this.includeOptions(r,a)||a!==i;return this.updateSharedOptions(a,r,n),{sharedOptions:a,includeOptions:s}}updateElement(e,r,n,i){wy(i)?Object.assign(e,n):this._resolveAnimations(r,i).update(e,n)}updateSharedOptions(e,r,n){e&&!wy(r)&&this._resolveAnimations(void 0,r).update(e,n)}_setStyle(e,r,n,i){e.active=i;const a=this.getStyle(r,i);this._resolveAnimations(r,n,i).update(e,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(e,r,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,r,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const r=this._data,n=this._cachedMeta.data;for(const[o,u,l]of this._syncList)this[o](u,l);this._syncList=[];const i=n.length,a=r.length,s=Math.min(a,i);s&&this.parse(0,s),a>i?this._insertElements(i,a-i,e):a{for(l.length+=r,o=l.length-1;o>=s;o--)l[o]=l[o-r]};for(u(a),o=e;oi-a))}return t._cache.$bar}function nH(t){const e=t.iScale,r=rH(e,t.type);let n=e._length,i,a,s,o;const u=()=>{s===32767||s===-32768||(xh(o)&&(n=Math.min(n,Math.abs(s-o)||n)),o=s)};for(i=0,a=r.length;i0?i[t-1]:null,o=tMath.abs(o)&&(u=o,l=s),e[r.axis]=l,e._custom={barStart:u,barEnd:l,start:i,end:a,min:s,max:o}}function uO(t,e,r,n){return Or(t)?sH(t,e,r,n):e[r.axis]=r.parse(t,n),e}function SA(t,e,r,n){const i=t.iScale,a=t.vScale,s=i.getLabels(),o=i===a,u=[];let l,c,f,h;for(l=r,c=r+n;l=r?1:-1)}function uH(t){let e,r,n,i,a;return t.horizontal?(e=t.base>t.x,r="left",n="right"):(e=t.baseu.controller.options.grouped),a=n.options.stacked,s=[],o=u=>{const l=u.controller.getParsed(r),c=l&&l[u.vScale.axis];if(or(c)||isNaN(c))return!0};for(const u of i)if(!(r!==void 0&&o(u))&&((a===!1||s.indexOf(u.stack)===-1||a===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,r,n){const i=this._getStacks(e,n),a=r!==void 0?i.indexOf(r):-1;return a===-1?i.length-1:a}_getRuler(){const e=this.options,r=this._cachedMeta,n=r.iScale,i=[];let a,s;for(a=0,s=r.data.length;a=0;--n)r=Math.max(r,e[n].size(this.resolveDataElementOptions(n))/2);return r>0&&r}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:a}=r,s=this.getParsed(e),o=i.getLabelForValue(s.x),u=a.getLabelForValue(s.y),l=s._custom;return{label:n[e]||"",value:"("+o+", "+u+(l?", "+l:"")+")"}}update(e){const r=this._cachedMeta.data;this.updateElements(r,0,r.length,e)}updateElements(e,r,n,i){const a=i==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:u,includeOptions:l}=this._getSharedOptions(r,i),c=s.axis,f=o.axis;for(let h=r;hwh(x,o,u,!0)?1:Math.max(A,A*r,_,_*r),v=(x,A,_)=>wh(x,o,u,!0)?-1:Math.min(A,A*r,_,_*r),m=p(0,l,f),b=p(en,c,h),y=v(Rr,l,f),S=v(Rr+en,c,h);n=(m-y)/2,i=(b-S)/2,a=-(m+y)/2,s=-(b+S)/2}return{ratioX:n,ratioY:i,offsetX:a,offsetY:s}}class No extends ta{constructor(e,r){super(e,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,r){const n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=n;else{let a=u=>+n[u];if(Gt(n[e])){const{key:u="value"}=this._parsing;a=l=>+Po(n[l],u)}let s,o;for(s=e,o=e+r;s0&&!isNaN(e)?Fr*(Math.abs(e)/r):0}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Gh(r._parsed[e],n.options.locale);return{label:i[e]||"",value:a}}getMaxBorderWidth(e){let r=0;const n=this.chart;let i,a,s,o,u;if(!e){for(i=0,a=n.data.datasets.length;ie!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),je(No,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data;if(r.labels.length&&r.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return r.labels.map((a,s)=>{const u=e.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:i,lineWidth:u.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}}});class oh extends ta{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const r=this._cachedMeta,{dataset:n,data:i=[],_dataset:a}=r,s=this.chart._animationsDisabled;let{start:o,count:u}=WT(r,i,s);this._drawStart=o,this._drawCount=u,VT(r)&&(o=0,u=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=i;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:l},e),this.updateElements(i,o,u,e)}updateElements(e,r,n,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:u,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:f}=this._getSharedOptions(r,i),h=s.axis,p=o.axis,{spanGaps:v,segment:m}=this.options,b=tc(v)?v:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||i==="none",S=r+n,x=e.length;let A=r>0&&this.getParsed(r-1);for(let _=0;_=S){C.skip=!0;continue}const E=this.getParsed(_),N=or(E[p]),M=C[h]=s.getPixelForValue(E[h],_),O=C[p]=a||N?o.getBasePixel():o.getPixelForValue(u?this.applyStack(o,E,u):E[p],_);C.skip=isNaN(M)||isNaN(O)||N,C.stop=_>0&&Math.abs(E[h]-A[h])>b,m&&(C.parsed=E,C.raw=l.data[_]),f&&(C.options=c||this.resolveDataElementOptions(_,w.active?"active":i)),y||this.updateElement(w,_,C,i),A=E}}getMaxOverflow(){const e=this._cachedMeta,r=e.dataset,n=r.options&&r.options.borderWidth||0,i=e.data||[];if(!i.length)return n;const a=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,a,s)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}je(oh,"id","line"),je(oh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),je(oh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Yl extends ta{constructor(e,r){super(e,r),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const r=this._cachedMeta,n=this.chart,i=n.data.labels||[],a=Gh(r._parsed[e].r,n.options.locale);return{label:i[e]||"",value:a}}parseObjectData(e,r,n,i){return QT.bind(this)(e,r,n,i)}update(e){const r=this._cachedMeta.data;this._updateRadius(),this.updateElements(r,0,r.length,e)}getMinMax(){const e=this._cachedMeta,r={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((n,i)=>{const a=this.getParsed(i).r;!isNaN(a)&&this.chart.getDataVisibility(i)&&(ar.max&&(r.max=a))}),r}_updateRadius(){const e=this.chart,r=e.chartArea,n=e.options,i=Math.min(r.right-r.left,r.bottom-r.top),a=Math.max(i/2,0),s=Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0),o=(a-s)/e.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(e,r,n,i){const a=i==="reset",s=this.chart,u=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,f=l.yCenter,h=l.getIndexAngle(0)-.5*Rr;let p=h,v;const m=360/this.countVisibleElements();for(v=0;v{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&r++}),r}_computeAngle(e,r,n){return this.chart.getDataVisibility(e)?ba(this.resolveDataElementOptions(e,r).angle||n):0}}je(Yl,"id","polarArea"),je(Yl,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),je(Yl,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data;if(r.labels.length&&r.datasets.length){const{labels:{pointStyle:n,color:i}}=e.legend.options;return r.labels.map((a,s)=>{const u=e.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:i,lineWidth:u.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class qm extends No{}je(qm,"id","pie"),je(qm,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class uh extends ta{getLabelAndValue(e){const r=this._cachedMeta.vScale,n=this.getParsed(e);return{label:r.getLabels()[e],value:""+r.getLabelForValue(n[r.axis])}}parseObjectData(e,r,n,i){return QT.bind(this)(e,r,n,i)}update(e){const r=this._cachedMeta,n=r.dataset,i=r.data||[],a=r.iScale.getLabels();if(n.points=i,e!=="resize"){const s=this.resolveDatasetElementOptions(e);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:s};this.updateElement(n,void 0,o,e)}this.updateElements(i,0,i.length,e)}updateElements(e,r,n,i){const a=this._cachedMeta.rScale,s=i==="reset";for(let o=r;o0&&this.getParsed(r-1);for(let A=r;A0&&Math.abs(w[p]-x[p])>y,b&&(C.parsed=w,C.raw=l.data[A]),h&&(C.options=f||this.resolveDataElementOptions(A,_.active?"active":i)),S||this.updateElement(_,A,C,i),x=w}this.updateSharedOptions(f,i,c)}getMaxOverflow(){const e=this._cachedMeta,r=e.data||[];if(!this.options.showLine){let o=0;for(let u=r.length-1;u>=0;--u)o=Math.max(o,r[u].size(this.resolveDataElementOptions(u))/2);return o>0&&o}const n=e.dataset,i=n.options&&n.options.borderWidth||0;if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}}je(lh,"id","scatter"),je(lh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),je(lh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var lO=Object.freeze({__proto__:null,BarController:ah,BubbleController:sh,DoughnutController:No,LineController:oh,PieController:qm,PolarAreaController:Yl,RadarController:uh,ScatterController:lh});function vu(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class V1{constructor(e){je(this,"options");this.options=e||{}}static override(e){Object.assign(V1.prototype,e)}init(){}formats(){return vu()}parse(){return vu()}format(){return vu()}add(){return vu()}diff(){return vu()}startOf(){return vu()}endOf(){return vu()}}var cO={_date:V1};function dH(t,e,r,n){const{controller:i,data:a,_sorted:s}=t,o=i._cachedMeta.iScale;if(o&&e===o.axis&&e!=="r"&&s&&a.length){const u=o._reversePixels?$U:Ms;if(n){if(i._sharedOptions){const l=a[0],c=typeof l.getRange=="function"&&l.getRange(e);if(c){const f=u(a,e,r-c),h=u(a,e,r+c);return{lo:f.lo,hi:h.hi}}}}else return u(a,e,r)}return{lo:0,hi:a.length-1}}function Zh(t,e,r,n,i){const a=t.getSortedVisibleDatasetMetas(),s=r[e];for(let o=0,u=a.length;o{u[s](e[r],i)&&(a.push({element:u,datasetIndex:l,index:c}),o=o||u.inRange(e.x,e.y,i))}),n&&!o?[]:a}var fO={evaluateInteractionItems:Zh,modes:{index(t,e,r,n){const i=xu(e,t),a=r.axis||"x",s=r.includeInvisible||!1,o=r.intersect?_y(t,i,a,n,s):Ay(t,i,a,!1,n,s),u=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(l=>{const c=o[0].index,f=l.data[c];f&&!f.skip&&u.push({element:f,datasetIndex:l.index,index:c})}),u):[]},dataset(t,e,r,n){const i=xu(e,t),a=r.axis||"xy",s=r.includeInvisible||!1;let o=r.intersect?_y(t,i,a,n,s):Ay(t,i,a,!1,n,s);if(o.length>0){const u=o[0].datasetIndex,l=t.getDatasetMeta(u).data;o=[];for(let c=0;cr.pos===e)}function NA(t,e){return t.filter(r=>hO.indexOf(r.pos)===-1&&r.box.axis===e)}function Lf(t,e){return t.sort((r,n)=>{const i=e?n:r,a=e?r:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function gH(t){const e=[];let r,n,i,a,s,o;for(r=0,n=(t||[]).length;rl.box.fullSize),!0),n=Lf(kf(e,"left"),!0),i=Lf(kf(e,"right")),a=Lf(kf(e,"top"),!0),s=Lf(kf(e,"bottom")),o=NA(e,"x"),u=NA(e,"y");return{fullSize:r,leftAndTop:n.concat(a),rightAndBottom:i.concat(u).concat(s).concat(o),chartArea:kf(e,"chartArea"),vertical:n.concat(i).concat(u),horizontal:a.concat(s).concat(o)}}function EA(t,e,r,n){return Math.max(t[r],e[r])+Math.max(t[n],e[n])}function dO(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function wH(t,e,r,n){const{pos:i,box:a}=r,s=t.maxPadding;if(!Gt(i)){r.size&&(t[i]-=r.size);const f=n[r.stack]||{size:0,count:1};f.size=Math.max(f.size,r.horizontal?a.height:a.width),r.size=f.size/f.count,t[i]+=r.size}a.getPadding&&dO(s,a.getPadding());const o=Math.max(0,e.outerWidth-EA(s,t,"left","right")),u=Math.max(0,e.outerHeight-EA(s,t,"top","bottom")),l=o!==t.w,c=u!==t.h;return t.w=o,t.h=u,r.horizontal?{same:l,other:c}:{same:c,other:l}}function SH(t){const e=t.maxPadding;function r(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=r("top"),t.x+=r("left"),r("right"),r("bottom")}function _H(t,e){const r=e.maxPadding;function n(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{a[s]=Math.max(e[s],r[s])}),a}return n(t?["left","right"]:["top","bottom"])}function Xf(t,e,r,n){const i=[];let a,s,o,u,l,c;for(a=0,s=t.length,l=0;a{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=u.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:r,padding:i,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/c,hBoxMaxHeight:s/2}),h=Object.assign({},i);dO(h,Wn(n));const p=Object.assign({maxPadding:h,w:a,h:s,x:i.left,y:i.top},i),v=bH(u.concat(l),f);Xf(o.fullSize,p,f,v),Xf(u,p,f,v),Xf(l,p,f,v)&&Xf(u,p,f,v),SH(p),CA(o.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,CA(o.rightAndBottom,p,f,v),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},yr(o.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Y1{acquireContext(e,r){}releaseContext(e){return!1}addEventListener(e,r,n){}removeEventListener(e,r,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,r,n,i){return r=Math.max(0,r||e.width),n=n||e.height,{width:r,height:Math.max(0,i?Math.floor(r/i):n)}}isAttached(e){return!0}updateConfig(e){}}class pO extends Y1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Sm="$chartjs",AH={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},MA=t=>t===null||t==="";function DH(t,e){const r=t.style,n=t.getAttribute("height"),i=t.getAttribute("width");if(t[Sm]={initial:{height:n,width:i,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",MA(i)){const a=fA(t,"width");a!==void 0&&(t.width=a)}if(MA(n))if(t.style.height==="")t.height=t.width/(e||2);else{const a=fA(t,"height");a!==void 0&&(t.height=a)}return t}const mO=Fq?{passive:!0}:!1;function NH(t,e,r){t&&t.addEventListener(e,r,mO)}function EH(t,e,r){t&&t.canvas&&t.canvas.removeEventListener(e,r,mO)}function CH(t,e){const r=AH[t.type]||t.type,{x:n,y:i}=xu(t,e);return{type:r,chart:e,native:t,x:n!==void 0?n:null,y:i!==void 0?i:null}}function Hm(t,e){for(const r of t)if(r===e||r.contains(e))return!0}function MH(t,e,r){const n=t.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Hm(o.addedNodes,n),s=s&&!Hm(o.removedNodes,n);s&&r()});return i.observe(document,{childList:!0,subtree:!0}),i}function TH(t,e,r){const n=t.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Hm(o.removedNodes,n),s=s&&!Hm(o.addedNodes,n);s&&r()});return i.observe(document,{childList:!0,subtree:!0}),i}const _h=new Map;let TA=0;function vO(){const t=window.devicePixelRatio;t!==TA&&(TA=t,_h.forEach((e,r)=>{r.currentDevicePixelRatio!==t&&e()}))}function OH(t,e){_h.size||window.addEventListener("resize",vO),_h.set(t,e)}function FH(t){_h.delete(t),_h.size||window.removeEventListener("resize",vO)}function RH(t,e,r){const n=t.canvas,i=n&&H1(n);if(!i)return;const a=HT((o,u)=>{const l=i.clientWidth;r(o,u),l{const u=o[0],l=u.contentRect.width,c=u.contentRect.height;l===0&&c===0||a(l,c)});return s.observe(i),OH(t,a),s}function Dy(t,e,r){r&&r.disconnect(),e==="resize"&&FH(t)}function BH(t,e,r){const n=t.canvas,i=HT(a=>{t.ctx!==null&&r(CH(a,t))},t);return NH(n,e,i),i}class gO extends Y1{acquireContext(e,r){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(DH(e,r),n):null}releaseContext(e){const r=e.canvas;if(!r[Sm])return!1;const n=r[Sm].initial;["height","width"].forEach(a=>{const s=n[a];or(s)?r.removeAttribute(a):r.setAttribute(a,s)});const i=n.style||{};return Object.keys(i).forEach(a=>{r.style[a]=i[a]}),r.width=r.width,delete r[Sm],!0}addEventListener(e,r,n){this.removeEventListener(e,r);const i=e.$proxies||(e.$proxies={}),s={attach:MH,detach:TH,resize:RH}[r]||BH;i[r]=s(e,r,n)}removeEventListener(e,r){const n=e.$proxies||(e.$proxies={}),i=n[r];if(!i)return;({attach:Dy,detach:Dy,resize:Dy}[r]||EH)(e,r,i),n[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,r,n,i){return Oq(e,r,n,i)}isAttached(e){const r=H1(e);return!!(r&&r.isConnected)}}function yO(t){return!q1()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?pO:gO}var ym;let Za=(ym=class{constructor(){je(this,"x");je(this,"y");je(this,"active",!1);je(this,"options");je(this,"$animations")}tooltipPosition(e){const{x:r,y:n}=this.getProps(["x","y"],e);return{x:r,y:n}}hasValue(){return tc(this.x)&&tc(this.y)}getProps(e,r){const n=this.$animations;if(!r||!n)return this;const i={};return e.forEach(a=>{i[a]=n[a]&&n[a].active()?n[a]._to:this[a]}),i}},je(ym,"defaults",{}),je(ym,"defaultRoutes"),ym);function PH(t,e){const r=t.options.ticks,n=IH(t),i=Math.min(r.maxTicksLimit||n,n),a=r.major.enabled?LH(e):[],s=a.length,o=a[0],u=a[s-1],l=[];if(s>i)return $H(e,l,a,s/i),l;const c=kH(a,e,i);if(s>0){let f,h;const p=s>1?Math.round((u-o)/(s-1)):null;for($p(e,l,c,or(p)?0:o-p,o),f=0,h=s-1;fi)return u}return Math.max(i,1)}function LH(t){const e=[];let r,n;for(r=0,n=t.length;rt==="left"?"right":t==="right"?"left":t,OA=(t,e,r)=>e==="top"||e==="left"?t[e]+r:t[e]-r,FA=(t,e)=>Math.min(e||t,t);function RA(t,e){const r=[],n=t.length/e,i=t.length;let a=0;for(;as+o)))return u}function HH(t,e){yr(t,r=>{const n=r.gc,i=n.length/2;let a;if(i>e){for(a=0;an?n:r,n=i&&r>n?r:n,{min:Ci(r,Ci(n,r)),max:Ci(n,Ci(r,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Tr(this.options.beforeUpdate,[this])}update(e,r,n){const{beginAtZero:i,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=r,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lq(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=o=a||n<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),f=c.widest.width,h=c.highest.height,p=wn(this.chart.width-f,0,this.maxWidth);o=e.offset?this.maxWidth/n:p/(n-1),f+6>o&&(o=p/(n-(e.offset?.5:1)),u=this.maxHeight-$f(e.grid)-r.padding-BA(e.title,this.chart.options.font),l=Math.sqrt(f*f+h*h),s=B1(Math.min(Math.asin(wn((c.highest.height+6)/o,-1,1)),Math.asin(wn(u/l,-1,1))-Math.asin(wn(h/l,-1,1)))),s=Math.max(i,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){Tr(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Tr(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:r,options:{ticks:n,title:i,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const u=BA(i,r.options.font);if(o?(e.width=this.maxWidth,e.height=$f(a)+u):(e.height=this.maxHeight,e.width=$f(a)+u),n.display&&this.ticks.length){const{first:l,last:c,widest:f,highest:h}=this._getLabelSizes(),p=n.padding*2,v=ba(this.labelRotation),m=Math.cos(v),b=Math.sin(v);if(o){const y=n.mirror?0:b*f.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+y+p)}else{const y=n.mirror?0:m*f.width+b*h.height;e.width=Math.min(this.maxWidth,e.width+y+p)}this._calculatePadding(l,c,b,m)}}this._handleMargins(),o?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,r,n,i){const{ticks:{align:a,padding:s},position:o}=this.options,u=this.labelRotation!==0,l=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;u?l?(h=i*e.width,p=n*r.height):(h=n*e.height,p=i*r.width):a==="start"?p=r.width:a==="end"?h=e.width:a!=="inner"&&(h=e.width/2,p=r.width/2),this.paddingLeft=Math.max((h-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let c=r.height/2,f=e.height/2;a==="start"?(c=0,f=e.height):a==="end"&&(c=r.height,f=0),this.paddingTop=c+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Tr(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:r}=this.options;return r==="top"||r==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let r,n;for(r=0,n=e.length;r({width:s[N]||0,height:o[N]||0});return{first:E(0),last:E(r-1),widest:E(w),highest:E(C),widths:s,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,r){return NaN}getValueForPixel(e){}getPixelForTick(e){const r=this.ticks;return e<0||e>r.length-1?null:this.getPixelForValue(r[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const r=this._startPixel+e*this._length;return LU(this._alignToPixels?mu(this.chart,r,0):r)}getDecimalForPixel(e){const r=(e-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:r}=this;return e<0&&r<0?r:e>0&&r>0?e:0}getContext(e){const r=this.ticks||[];if(e>=0&&eo*i?o/n:u/i:u*i0}_computeGridLineItems(e){const r=this.axis,n=this.chart,i=this.options,{grid:a,position:s,border:o}=i,u=a.offset,l=this.isHorizontal(),f=this.ticks.length+(u?1:0),h=$f(a),p=[],v=o.setContext(this.getContext()),m=v.display?v.width:0,b=m/2,y=function(I){return mu(n,I,m)};let S,x,A,_,w,C,E,N,M,O,F,U;if(s==="top")S=y(this.bottom),C=this.bottom-h,N=S-b,O=y(e.top)+b,U=e.bottom;else if(s==="bottom")S=y(this.top),O=e.top,U=y(e.bottom)-b,C=S+b,N=this.top+h;else if(s==="left")S=y(this.right),w=this.right-h,E=S-b,M=y(e.left)+b,F=e.right;else if(s==="right")S=y(this.left),M=e.left,F=y(e.right)-b,w=S+b,E=this.left+h;else if(r==="x"){if(s==="center")S=y((e.top+e.bottom)/2+.5);else if(Gt(s)){const I=Object.keys(s)[0],P=s[I];S=y(this.chart.scales[I].getPixelForValue(P))}O=e.top,U=e.bottom,C=S+b,N=C+h}else if(r==="y"){if(s==="center")S=y((e.left+e.right)/2);else if(Gt(s)){const I=Object.keys(s)[0],P=s[I];S=y(this.chart.scales[I].getPixelForValue(P))}w=S-b,E=w-h,M=e.left,F=e.right}const V=Bt(i.ticks.maxTicksLimit,f),H=Math.max(1,Math.ceil(f/V));for(x=0;x0&&(ce-=de/2);break}he={left:ce,top:Se,width:de+ne.width,height:X+ne.height,color:H.backdropColor}}b.push({label:A,font:N,textOffset:F,options:{rotation:m,color:P,strokeColor:K,strokeWidth:$,textAlign:se,textBaseline:U,translation:[_,w],backdrop:he}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:r}=this.options;if(-ba(this.labelRotation))return e==="top"?"left":"right";let i="center";return r.align==="start"?i="left":r.align==="end"?i="right":r.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:r,ticks:{crossAlign:n,mirror:i,padding:a}}=this.options,s=this._getLabelSizes(),o=e+a,u=s.widest.width;let l,c;return r==="left"?i?(c=this.right+a,n==="near"?l="left":n==="center"?(l="center",c+=u/2):(l="right",c+=u)):(c=this.right-o,n==="near"?l="right":n==="center"?(l="center",c-=u/2):(l="left",c=this.left)):r==="right"?i?(c=this.left+a,n==="near"?l="right":n==="center"?(l="center",c-=u/2):(l="left",c-=u)):(c=this.left+o,n==="near"?l="left":n==="center"?(l="center",c+=u/2):(l="right",c=this.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:r},left:n,top:i,width:a,height:s}=this;r&&(e.save(),e.fillStyle=r,e.fillRect(n,i,a,s),e.restore())}getLineWidthForValue(e){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const i=this.ticks.findIndex(a=>a.value===e);return i>=0?r.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const r=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let a,s;const o=(u,l,c)=>{!c.width||!c.color||(n.save(),n.lineWidth=c.width,n.strokeStyle=c.color,n.setLineDash(c.borderDash||[]),n.lineDashOffset=c.borderDashOffset,n.beginPath(),n.moveTo(u.x,u.y),n.lineTo(l.x,l.y),n.stroke(),n.restore())};if(r.display)for(a=0,s=i.length;a{this.draw(a)}}]:[{z:n,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:r,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(e){const r=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let a,s;for(a=0,s=r.length;a{const n=r.split("."),i=n.pop(),a=[t].concat(n).join("."),s=e[r].split("."),o=s.pop(),u=s.join(".");Ur.route(a,i,u,o)})}function ZH(t){return"id"in t&&"defaults"in t}class KH{constructor(){this.controllers=new zp(ta,"datasets",!0),this.elements=new zp(Za,"elements"),this.plugins=new zp(Object,"plugins"),this.scales=new zp(qo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,r,n){[...r].forEach(i=>{const a=n||this._getRegistryForType(i);n||a.isForType(i)||a===this.plugins&&i.id?this._exec(e,a,i):yr(i,s=>{const o=n||this._getRegistryForType(s);this._exec(e,o,s)})})}_exec(e,r,n){const i=R1(e);Tr(n["before"+i],[],n),r[e](n),Tr(n["after"+i],[],n)}_getRegistryForType(e){for(let r=0;ra.filter(o=>!s.some(u=>o.plugin.id===u.plugin.id));this._notify(i(r,n),e,"stop"),this._notify(i(n,r),e,"start")}}function QH(t){const e={},r=[],n=Object.keys(va.plugins.items);for(let a=0;a1&&PA(t[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function IA(t,e,r){if(r[e+"AxisID"]===t)return{axis:e}}function sW(t,e){if(e.data&&e.data.datasets){const r=e.data.datasets.filter(n=>n.xAxisID===t||n.yAxisID===t);if(r.length)return IA(t,"x",r[0])||IA(t,"y",r[0])}return{}}function oW(t,e){const r=Pu[t.type]||{scales:{}},n=e.scales||{},i=fb(t.type,e),a=Object.create(null);return Object.keys(n).forEach(s=>{const o=n[s];if(!Gt(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const u=hb(s,o,sW(s,t),Ur.scales[o.type]),l=iW(u,i),c=r.scales||{};a[s]=th(Object.create(null),[{axis:u},o,c[u],c[l]])}),t.data.datasets.forEach(s=>{const o=s.type||t.type,u=s.indexAxis||fb(o,e),c=(Pu[o]||{}).scales||{};Object.keys(c).forEach(f=>{const h=nW(f,u),p=s[h+"AxisID"]||h;a[p]=a[p]||Object.create(null),th(a[p],[{axis:h},n[p],c[f]])})}),Object.keys(a).forEach(s=>{const o=a[s];th(o,[Ur.scales[o.type],Ur.scale])}),a}function bO(t){const e=t.options||(t.options={});e.plugins=Bt(e.plugins,{}),e.scales=oW(t,e)}function xO(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function uW(t){return t=t||{},t.data=xO(t.data),bO(t),t}const kA=new Map,wO=new Set;function Up(t,e){let r=kA.get(t);return r||(r=e(),kA.set(t,r),wO.add(r)),r}const zf=(t,e,r)=>{const n=Po(e,r);n!==void 0&&t.add(n)};class lW{constructor(e){this._config=uW(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=xO(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),bO(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Up(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,r){return Up(`${e}.transition.${r}`,()=>[[`datasets.${e}.transitions.${r}`,`transitions.${r}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,r){return Up(`${e}-${r}`,()=>[[`datasets.${e}.elements.${r}`,`datasets.${e}`,`elements.${r}`,""]])}pluginScopeKeys(e){const r=e.id,n=this.type;return Up(`${n}-plugin-${r}`,()=>[[`plugins.${r}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,r){const n=this._scopeCache;let i=n.get(e);return(!i||r)&&(i=new Map,n.set(e,i)),i}getOptionScopes(e,r,n){const{options:i,type:a}=this,s=this._cachedScopes(e,n),o=s.get(r);if(o)return o;const u=new Set;r.forEach(c=>{e&&(u.add(e),c.forEach(f=>zf(u,e,f))),c.forEach(f=>zf(u,i,f)),c.forEach(f=>zf(u,Pu[a]||{},f)),c.forEach(f=>zf(u,Ur,f)),c.forEach(f=>zf(u,lb,f))});const l=Array.from(u);return l.length===0&&l.push(Object.create(null)),wO.has(r)&&s.set(r,l),l}chartOptionScopes(){const{options:e,type:r}=this;return[e,Pu[r]||{},Ur.datasets[r]||{},{type:r},Ur,lb]}resolveNamedOptions(e,r,n,i=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=LA(this._resolverCache,e,i);let u=s;if(fW(s,r)){a.$shared=!1,n=Io(n)?n():n;const l=this.createResolver(e,n,o);u=rc(s,n,l)}for(const l of r)a[l]=u[l];return a}createResolver(e,r,n=[""],i){const{resolver:a}=LA(this._resolverCache,e,n);return Gt(r)?rc(a,r,void 0,i):a}}function LA(t,e,r){let n=t.get(e);n||(n=new Map,t.set(e,n));const i=r.join();let a=n.get(i);return a||(a={resolver:$1(e,r),subPrefixes:r.filter(o=>!o.toLowerCase().includes("hover"))},n.set(i,a)),a}const cW=t=>Gt(t)&&Object.getOwnPropertyNames(t).some(e=>Io(t[e]));function fW(t,e){const{isScriptable:r,isIndexable:n}=XT(t);for(const i of e){const a=r(i),s=n(i),o=(s||a)&&t[i];if(a&&(Io(o)||cW(o))||s&&Or(o))return!0}return!1}var hW="4.4.2";const dW=["top","bottom","left","right","chartArea"];function $A(t,e){return t==="top"||t==="bottom"||dW.indexOf(t)===-1&&e==="x"}function zA(t,e){return function(r,n){return r[t]===n[t]?r[e]-n[e]:r[t]-n[t]}}function UA(t){const e=t.chart,r=e.options.animation;e.notifyPlugins("afterRender"),Tr(r&&r.onComplete,[t],e)}function pW(t){const e=t.chart,r=e.options.animation;Tr(r&&r.onProgress,[t],e)}function SO(t){return q1()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const _m={},qA=t=>{const e=SO(t);return Object.values(_m).filter(r=>r.canvas===e).pop()};function mW(t,e,r){const n=Object.keys(t);for(const i of n){const a=+i;if(a>=e){const s=t[i];delete t[i],(r>0||a>e)&&(t[a+r]=s)}}}function vW(t,e,r,n){return!r||t.type==="mouseout"?null:n?e:t}function qp(t,e,r){return t.options.clip?t[r]:e[r]}function gW(t,e){const{xScale:r,yScale:n}=t;return r&&n?{left:qp(r,e,"left"),right:qp(r,e,"right"),top:qp(n,e,"top"),bottom:qp(n,e,"bottom")}:e}class yo{static register(...e){va.add(...e),HA()}static unregister(...e){va.remove(...e),HA()}constructor(e,r){const n=this.config=new lW(r),i=SO(e),a=qA(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||yO(i)),this.platform.updateConfig(n);const o=this.platform.acquireContext(i,s.aspectRatio),u=o&&o.canvas,l=u&&u.height,c=u&&u.width;if(this.id=NU(),this.ctx=o,this.canvas=u,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new JH,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qU(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],_m[this.id]=this,!o||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ha.listen(this,"complete",UA),Ha.listen(this,"progress",pW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:r},width:n,height:i,_aspectRatio:a}=this;return or(e)?r&&a?a:i?n/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return va}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():cA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return oA(this.canvas,this.ctx),this}stop(){return Ha.stop(this),this}resize(e,r){Ha.running(this)?this._resizeBeforeDraw={width:e,height:r}:this._resize(e,r)}_resize(e,r){const n=this.options,i=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,e,r,a),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,cA(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Tr(n.onResize,[this,s],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};yr(r,(n,i)=>{n.id=i})}buildOrUpdateScales(){const e=this.options,r=e.scales,n=this.scales,i=Object.keys(n).reduce((s,o)=>(s[o]=!1,s),{});let a=[];r&&(a=a.concat(Object.keys(r).map(s=>{const o=r[s],u=hb(s,o),l=u==="r",c=u==="x";return{options:o,dposition:l?"chartArea":c?"bottom":"left",dtype:l?"radialLinear":c?"category":"linear"}}))),yr(a,s=>{const o=s.options,u=o.id,l=hb(u,o),c=Bt(o.type,s.dtype);(o.position===void 0||$A(o.position,l)!==$A(s.dposition))&&(o.position=s.dposition),i[u]=!0;let f=null;if(u in n&&n[u].type===c)f=n[u];else{const h=va.getScale(c);f=new h({id:u,type:c,ctx:this.ctx,chart:this}),n[f.id]=f}f.init(o,e)}),yr(i,(s,o)=>{s||delete n[o]}),yr(n,s=>{Mn.configure(this,s,s.options),Mn.addBox(this,s)})}_updateMetasets(){const e=this._metasets,r=this.data.datasets.length,n=e.length;if(e.sort((i,a)=>i.index-a.index),n>r){for(let i=r;ir.length&&delete this._stacks,e.forEach((n,i)=>{r.filter(a=>a===n._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],r=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=r.length;n{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const r=this.config;r.update();const n=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,c=this.data.datasets.length;l{l.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(zA("z","_idx"));const{_active:o,_lastEvent:u}=this;u?this._eventHandler(u,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){yr(this.scales,e=>{Mn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,r=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!J_(r,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,r=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:a}of r){const s=n==="_removeElements"?-a:a;mW(e,i,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const r=this.data.datasets.length,n=a=>new Set(e.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),i=n(0);for(let a=1;aa.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Mn.update(this,this.width,this.height,e);const r=this.chartArea,n=r.width<=0||r.height<=0;this._layers=[],yr(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let r=0,n=this.data.datasets.length;r=0;--r)this._drawDataset(e[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const r=this.ctx,n=e._clip,i=!n.disabled,a=gW(e,this.chartArea),s={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Zv(r,{left:n.left===!1?0:a.left-n.left,right:n.right===!1?this.width:a.right+n.right,top:n.top===!1?0:a.top-n.top,bottom:n.bottom===!1?this.height:a.bottom+n.bottom}),e.controller.draw(),i&&Kv(r),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return Ts(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,r,n,i){const a=fO.modes[r];return typeof a=="function"?a(this,e,n,i):[]}getDatasetMeta(e){const r=this.data.datasets[e],n=this._metasets;let i=n.filter(a=>a&&a._dataset===r).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:e,_dataset:r,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const r=this.data.datasets[e];if(!r)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!r.hidden}setDatasetVisibility(e,r){const n=this.getDatasetMeta(e);n.hidden=!r}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,r,n){const i=n?"show":"hide",a=this.getDatasetMeta(e),s=a.controller._resolveAnimations(void 0,i);xh(r)?(a.data[r].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),s.update(a,{visible:n}),this.update(o=>o.datasetIndex===e?i:void 0))}hide(e,r){this._updateVisibility(e,r,!1)}show(e,r){this._updateVisibility(e,r,!0)}_destroyDatasetMeta(e){const r=this._metasets[e];r&&r.controller&&r.controller._destroy(),delete this._metasets[e]}_stop(){let e,r;for(this.stop(),Ha.remove(this),e=0,r=this.data.datasets.length;e{r.addEventListener(this,a,s),e[a]=s},i=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};yr(this.options.events,a=>n(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,r=this.platform,n=(u,l)=>{r.addEventListener(this,u,l),e[u]=l},i=(u,l)=>{e[u]&&(r.removeEventListener(this,u,l),delete e[u])},a=(u,l)=>{this.canvas&&this.resize(u,l)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),n("resize",a),n("detach",s)};s=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),n("attach",o)},r.isAttached(this.canvas)?o():s()}unbindEvents(){yr(this._listeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._listeners={},yr(this._responsiveListeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,r,n){const i=n?"set":"remove";let a,s,o,u;for(r==="dataset"&&(a=this.getDatasetMeta(e[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),o=0,u=e.length;o{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!km(n,r)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,r))}notifyPlugins(e,r,n){return this._plugins.notify(this,e,r,n)}isPluginEnabled(e){return this._plugins._cache.filter(r=>r.plugin.id===e).length===1}_updateHoverStyles(e,r,n){const i=this.options.hover,a=(u,l)=>u.filter(c=>!l.some(f=>c.datasetIndex===f.datasetIndex&&c.index===f.index)),s=a(r,e),o=n?e:a(e,r);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(e,r){const n={event:e,replay:r,cancelable:!0,inChartArea:this.isPointInArea(e)},i=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,i)===!1)return;const a=this._handleEvent(e,r,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(a||n.changed)&&this.render(),this}_handleEvent(e,r,n){const{_active:i=[],options:a}=this,s=r,o=this._getActiveElements(e,i,n,s),u=FU(e),l=vW(e,this._lastEvent,n,u);n&&(this._lastEvent=null,Tr(a.onHover,[e,o,this],this),u&&Tr(a.onClick,[e,o,this],this));const c=!km(o,i);return(c||r)&&(this._active=o,this._updateHoverStyles(o,i,r)),this._lastEvent=l,c}_getActiveElements(e,r,n,i){if(e.type==="mouseout")return[];if(!n)return r;const a=this.options.hover;return this.getElementsAtEventForMode(e,a.mode,a,i)}}je(yo,"defaults",Ur),je(yo,"instances",_m),je(yo,"overrides",Pu),je(yo,"registry",va),je(yo,"version",hW),je(yo,"getChart",qA);function HA(){return yr(yo.instances,t=>t._plugins.invalidate())}function yW(t,e,r){const{startAngle:n,pixelMargin:i,x:a,y:s,outerRadius:o,innerRadius:u}=e;let l=i/o;t.beginPath(),t.arc(a,s,o,n-l,r+l),u>i?(l=i/u,t.arc(a,s,u,r+l,n-l,!0)):t.arc(a,s,i,r+en,n-en),t.closePath(),t.clip()}function bW(t){return L1(t,["outerStart","outerEnd","innerStart","innerEnd"])}function xW(t,e,r,n){const i=bW(t.options.borderRadius),a=(r-e)/2,s=Math.min(a,n*e/2),o=u=>{const l=(r-Math.min(a,u))*n/2;return wn(u,0,Math.min(a,l))};return{outerStart:o(i.outerStart),outerEnd:o(i.outerEnd),innerStart:wn(i.innerStart,0,s),innerEnd:wn(i.innerEnd,0,s)}}function El(t,e,r,n){return{x:r+t*Math.cos(e),y:n+t*Math.sin(e)}}function Wm(t,e,r,n,i,a){const{x:s,y:o,startAngle:u,pixelMargin:l,innerRadius:c}=e,f=Math.max(e.outerRadius+n+r-l,0),h=c>0?c+n+r+l:0;let p=0;const v=i-u;if(n){const H=c>0?c-n:0,I=f>0?f-n:0,P=(H+I)/2,K=P!==0?v*P/(P+n):v;p=(v-K)/2}const m=Math.max(.001,v*f-r/Rr)/f,b=(v-m)/2,y=u+b+p,S=i-b-p,{outerStart:x,outerEnd:A,innerStart:_,innerEnd:w}=xW(e,h,f,S-y),C=f-x,E=f-A,N=y+x/C,M=S-A/E,O=h+_,F=h+w,U=y+_/O,V=S-w/F;if(t.beginPath(),a){const H=(N+M)/2;if(t.arc(s,o,f,N,H),t.arc(s,o,f,H,M),A>0){const $=El(E,M,s,o);t.arc($.x,$.y,A,M,S+en)}const I=El(F,S,s,o);if(t.lineTo(I.x,I.y),w>0){const $=El(F,V,s,o);t.arc($.x,$.y,w,S+en,V+Math.PI)}const P=(S-w/h+(y+_/h))/2;if(t.arc(s,o,h,S-w/h,P,!0),t.arc(s,o,h,P,y+_/h,!0),_>0){const $=El(O,U,s,o);t.arc($.x,$.y,_,U+Math.PI,y-en)}const K=El(C,y,s,o);if(t.lineTo(K.x,K.y),x>0){const $=El(C,N,s,o);t.arc($.x,$.y,x,y-en,N)}}else{t.moveTo(s,o);const H=Math.cos(N)*f+s,I=Math.sin(N)*f+o;t.lineTo(H,I);const P=Math.cos(M)*f+s,K=Math.sin(M)*f+o;t.lineTo(P,K)}t.closePath()}function wW(t,e,r,n,i){const{fullCircles:a,startAngle:s,circumference:o}=e;let u=e.endAngle;if(a){Wm(t,e,r,n,u,i);for(let l=0;l=Fr||wh(s,u,l),b=Cs(o,c+p,f+p);return m&&b}getCenterPoint(r){const{x:n,y:i,startAngle:a,endAngle:s,innerRadius:o,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],r),{offset:l,spacing:c}=this.options,f=(a+s)/2,h=(o+u+c+l)/2;return{x:n+Math.cos(f)*h,y:i+Math.sin(f)*h}}tooltipPosition(r){return this.getCenterPoint(r)}draw(r){const{options:n,circumference:i}=this,a=(n.offset||0)/4,s=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Fr?Math.floor(i/Fr):0,i===0||this.innerRadius<0||this.outerRadius<0)return;r.save();const u=(this.startAngle+this.endAngle)/2;r.translate(Math.cos(u)*a,Math.sin(u)*a);const l=1-Math.sin(Math.min(Rr,i||0)),c=a*l;r.fillStyle=n.backgroundColor,r.strokeStyle=n.borderColor,wW(r,this,c,s,o),SW(r,this,c,s,o),r.restore()}}je(Il,"id","arc"),je(Il,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),je(Il,"defaultRoutes",{backgroundColor:"backgroundColor"}),je(Il,"descriptors",{_scriptable:!0,_indexable:r=>r!=="borderDash"});function _O(t,e,r=e){t.lineCap=Bt(r.borderCapStyle,e.borderCapStyle),t.setLineDash(Bt(r.borderDash,e.borderDash)),t.lineDashOffset=Bt(r.borderDashOffset,e.borderDashOffset),t.lineJoin=Bt(r.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Bt(r.borderWidth,e.borderWidth),t.strokeStyle=Bt(r.borderColor,e.borderColor)}function _W(t,e,r){t.lineTo(r.x,r.y)}function AW(t){return t.stepped?eq:t.tension||t.cubicInterpolationMode==="monotone"?tq:_W}function AO(t,e,r={}){const n=t.length,{start:i=0,end:a=n-1}=r,{start:s,end:o}=e,u=Math.max(i,s),l=Math.min(a,o),c=io&&a>o;return{count:n,start:u,loop:e.loop,ilen:l(s+(l?o-A:A))%a,x=()=>{m!==b&&(t.lineTo(c,b),t.lineTo(c,m),t.lineTo(c,y))};for(u&&(p=i[S(0)],t.moveTo(p.x,p.y)),h=0;h<=o;++h){if(p=i[S(h)],p.skip)continue;const A=p.x,_=p.y,w=A|0;w===v?(_b&&(b=_),c=(f*c+A)/++f):(x(),t.lineTo(A,_),v=w,f=0,m=b=_),y=_}x()}function db(t){const e=t.options,r=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!r?NW:DW}function EW(t){return t.stepped?Rq:t.tension||t.cubicInterpolationMode==="monotone"?Bq:wu}function CW(t,e,r,n){let i=e._path;i||(i=e._path=new Path2D,e.path(i,r,n)&&i.closePath()),_O(t,e.options),t.stroke(i)}function MW(t,e,r,n){const{segments:i,options:a}=e,s=db(e);for(const o of i)_O(t,a,o.style),t.beginPath(),s(t,e,o,{start:r,end:r+n-1})&&t.closePath(),t.stroke()}const TW=typeof Path2D=="function";function OW(t,e,r,n){TW&&!e.options.segment?CW(t,e,r,n):MW(t,e,r,n)}class Os extends Za{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,r){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Dq(this._points,n,e,i,r),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zq(this,this.options.segment))}first(){const e=this.segments,r=this.points;return e.length&&r[e[0].start]}last(){const e=this.segments,r=this.points,n=e.length;return n&&r[e[n-1].end]}interpolate(e,r){const n=this.options,i=e[r],a=this.points,s=aO(this,{property:r,start:i,end:i});if(!s.length)return;const o=[],u=EW(n);let l,c;for(l=0,c=s.length;le!=="borderDash"&&e!=="fill"});function WA(t,e,r,n){const i=t.options,{[r]:a}=t.getProps([r],n);return Math.abs(e-a)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function EO(t){return pb[t%pb.length]}function CO(t){return VA[t%VA.length]}function kW(t,e){return t.borderColor=EO(e),t.backgroundColor=CO(e),++e}function LW(t,e){return t.backgroundColor=t.data.map(()=>EO(e++)),e}function $W(t,e){return t.backgroundColor=t.data.map(()=>CO(e++)),e}function zW(t){let e=0;return(r,n)=>{const i=t.getDatasetMeta(n).controller;i instanceof No?e=LW(r,e):i instanceof Yl?e=$W(r,e):i&&(e=kW(r,e))}}function YA(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function UW(t){return t&&(t.borderColor||t.backgroundColor)}var MO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,r){if(!r.enabled)return;const{data:{datasets:n},options:i}=t.config,{elements:a}=i;if(!r.forceOverride&&(YA(n)||UW(i)||a&&YA(a)))return;const s=zW(t);n.forEach(s)}};function qW(t,e,r,n,i){const a=i.samples||n;if(a>=r)return t.slice(e,e+r);const s=[],o=(r-2)/(a-2);let u=0;const l=e+r-1;let c=e,f,h,p,v,m;for(s[u++]=t[c],f=0;fp&&(p=v,h=t[S],m=S);s[u++]=h,c=m}return s[u++]=t[l],s}function HW(t,e,r,n){let i=0,a=0,s,o,u,l,c,f,h,p,v,m;const b=[],y=e+r-1,S=t[e].x,A=t[y].x-S;for(s=e;sm&&(m=l,h=s),i=(a*i+o.x)/++a;else{const w=s-1;if(!or(f)&&!or(h)){const C=Math.min(f,h),E=Math.max(f,h);C!==p&&C!==w&&b.push({...t[C],x:i}),E!==p&&E!==w&&b.push({...t[E],x:i})}s>0&&w!==p&&b.push(t[w]),b.push(o),c=_,a=0,v=m=l,f=h=p=s}}return b}function TO(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function jA(t){t.data.datasets.forEach(e=>{TO(e)})}function WW(t,e){const r=e.length;let n=0,i;const{iScale:a}=t,{min:s,max:o,minDefined:u,maxDefined:l}=a.getUserBounds();return u&&(n=wn(Ms(e,a.axis,s).lo,0,r-1)),l?i=wn(Ms(e,a.axis,o).hi+1,n,r)-n:i=r-n,{start:n,count:i}}var OO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,r)=>{if(!r.enabled){jA(t);return}const n=t.width;t.data.datasets.forEach((i,a)=>{const{_data:s,indexAxis:o}=i,u=t.getDatasetMeta(a),l=s||i.data;if(Gf([o,t.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const c=t.scales[u.xAxisID];if(c.type!=="linear"&&c.type!=="time"||t.options.parsing)return;let{start:f,count:h}=WW(u,l);const p=r.threshold||4*n;if(h<=p){TO(i);return}or(s)&&(i._data=l,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let v;switch(r.algorithm){case"lttb":v=qW(l,f,h,n,r);break;case"min-max":v=HW(l,f,h,n);break;default:throw new Error(`Unsupported decimation algorithm '${r.algorithm}'`)}i._decimated=v})},destroy(t){jA(t)}};function VW(t,e,r){const n=t.segments,i=t.points,a=e.points,s=[];for(const o of n){let{start:u,end:l}=o;l=j1(u,l,i);const c=mb(r,i[u],i[l],o.loop);if(!e.segments){s.push({source:o,target:c,start:i[u],end:i[l]});continue}const f=aO(e,c);for(const h of f){const p=mb(r,a[h.start],a[h.end],h.loop),v=iO(o,i,p);for(const m of v)s.push({source:m,target:h,start:{[r]:GA(c,p,"start",Math.max)},end:{[r]:GA(c,p,"end",Math.min)}})}}return s}function mb(t,e,r,n){if(n)return;let i=e[t],a=r[t];return t==="angle"&&(i=Ti(i),a=Ti(a)),{property:t,start:i,end:a}}function YW(t,e){const{x:r=null,y:n=null}=t||{},i=e.points,a=[];return e.segments.forEach(({start:s,end:o})=>{o=j1(s,o,i);const u=i[s],l=i[o];n!==null?(a.push({x:u.x,y:n}),a.push({x:l.x,y:n})):r!==null&&(a.push({x:r,y:u.y}),a.push({x:r,y:l.y}))}),a}function j1(t,e,r){for(;e>t;e--){const n=r[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function GA(t,e,r,n){return t&&e?n(t[r],e[r]):t?t[r]:e?e[r]:0}function FO(t,e){let r=[],n=!1;return Or(t)?(n=!0,r=t):r=YW(t,e),r.length?new Os({points:r,options:{tension:0},_loop:n,_fullLoop:n}):null}function XA(t){return t&&t.fill!==!1}function jW(t,e,r){let i=t[e].fill;const a=[e];let s;if(!r)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!Vr(i))return i;if(s=t[i],!s)return!1;if(s.visible)return i;a.push(i),i=s.fill}return!1}function GW(t,e,r){const n=JW(t);if(Gt(n))return isNaN(n.value)?!1:n;let i=parseFloat(n);return Vr(i)&&Math.floor(i)===i?XW(n[0],e,i,r):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function XW(t,e,r,n){return(t==="-"||t==="+")&&(r=e+r),r===e||r<0||r>=n?!1:r}function ZW(t,e){let r=null;return t==="start"?r=e.bottom:t==="end"?r=e.top:Gt(t)?r=e.getPixelForValue(t.value):e.getBasePixel&&(r=e.getBasePixel()),r}function KW(t,e,r){let n;return t==="start"?n=r:t==="end"?n=e.options.reverse?e.min:e.max:Gt(t)?n=t.value:n=e.getBaseValue(),n}function JW(t){const e=t.options,r=e.fill;let n=Bt(r&&r.target,r);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function QW(t){const{scale:e,index:r,line:n}=t,i=[],a=n.segments,s=n.points,o=eV(e,r);o.push(FO({x:null,y:e.bottom},n));for(let u=0;u=0;--s){const o=i[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),n&&o.fill&&Cy(t.ctx,o,a))}},beforeDatasetsDraw(t,e,r){if(r.drawTime!=="beforeDatasetsDraw")return;const n=t.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){const a=n[i].$filler;XA(a)&&Cy(t.ctx,a,t.chartArea)}},beforeDatasetDraw(t,e,r){const n=e.meta.$filler;!XA(n)||r.drawTime!=="beforeDatasetDraw"||Cy(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const QA=(t,e)=>{let{boxHeight:r=e,boxWidth:n=e}=t;return t.usePointStyle&&(r=Math.min(r,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:r,itemHeight:Math.max(e,r)}},cV=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class eD extends Za{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r,n){this.maxWidth=e,this.maxHeight=r,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let r=Tr(e.generateLabels,[this.chart],this)||[];e.filter&&(r=r.filter(n=>e.filter(n,this.chart.data))),e.sort&&(r=r.sort((n,i)=>e.sort(n,i,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:e,ctx:r}=this;if(!e.display){this.width=this.height=0;return}const n=e.labels,i=pn(n.font),a=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:u}=QA(n,a);let l,c;r.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(s,a,o,u)+10):(c=this.maxHeight,l=this._fitCols(s,i,o,u)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,r,n,i){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,u=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+o;let f=e;a.textAlign="left",a.textBaseline="middle";let h=-1,p=-c;return this.legendItems.forEach((v,m)=>{const b=n+r/2+a.measureText(v.text).width;(m===0||l[l.length-1]+b+2*o>s)&&(f+=c,l[l.length-(m>0?0:1)]=0,p+=c,h++),u[m]={left:0,top:p,row:h,width:b,height:i},l[l.length-1]+=b+o}),f}_fitCols(e,r,n,i){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,u=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-e;let f=o,h=0,p=0,v=0,m=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:S,itemHeight:x}=fV(n,r,a,b,i);y>0&&p+x+2*o>c&&(f+=h+o,l.push({width:h,height:p}),v+=h+o,m++,h=p=0),u[y]={left:v,top:p,col:m,width:S,height:x},h=Math.max(h,S),p+=x+o}),f+=h,l.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:n,labels:{padding:i},rtl:a}}=this,s=Vl(a,this.left,this.width);if(this.isHorizontal()){let o=0,u=kn(n,this.left+i,this.right-this.lineWidths[o]);for(const l of r)o!==l.row&&(o=l.row,u=kn(n,this.left+i,this.right-this.lineWidths[o])),l.top+=this.top+e+i,l.left=s.leftForLtr(s.x(u),l.width),u+=l.width+i}else{let o=0,u=kn(n,this.top+e+i,this.bottom-this.columnSizes[o].height);for(const l of r)l.col!==o&&(o=l.col,u=kn(n,this.top+e+i,this.bottom-this.columnSizes[o].height)),l.top=u,l.left+=this.left+i,l.left=s.leftForLtr(s.x(l.left),l.width),u+=l.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Zv(e,this),this._draw(),Kv(e)}}_draw(){const{options:e,columnSizes:r,lineWidths:n,ctx:i}=this,{align:a,labels:s}=e,o=Ur.color,u=Vl(e.rtl,this.left,this.width),l=pn(s.font),{padding:c}=s,f=l.size,h=f/2;let p;this.drawTitle(),i.textAlign=u.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:v,boxHeight:m,itemHeight:b}=QA(s,f),y=function(w,C,E){if(isNaN(v)||v<=0||isNaN(m)||m<0)return;i.save();const N=Bt(E.lineWidth,1);if(i.fillStyle=Bt(E.fillStyle,o),i.lineCap=Bt(E.lineCap,"butt"),i.lineDashOffset=Bt(E.lineDashOffset,0),i.lineJoin=Bt(E.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=Bt(E.strokeStyle,o),i.setLineDash(Bt(E.lineDash,[])),s.usePointStyle){const M={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:N},O=u.xPlus(w,v/2),F=C+h;jT(i,M,O,F,s.pointStyleWidth&&v)}else{const M=C+Math.max((f-m)/2,0),O=u.leftForLtr(w,v),F=Cu(E.borderRadius);i.beginPath(),Object.values(F).some(U=>U!==0)?Sh(i,{x:O,y:M,w:v,h:m,radius:F}):i.rect(O,M,v,m),i.fill(),N!==0&&i.stroke()}i.restore()},S=function(w,C,E){Iu(i,E.text,w,C+b/2,l,{strikethrough:E.hidden,textAlign:u.textAlign(E.textAlign)})},x=this.isHorizontal(),A=this._computeTitleHeight();x?p={x:kn(a,this.left+c,this.right-n[0]),y:this.top+c+A,line:0}:p={x:this.left+c,y:kn(a,this.top+A+c,this.bottom-r[0].height),line:0},tO(this.ctx,e.textDirection);const _=b+c;this.legendItems.forEach((w,C)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const E=i.measureText(w.text).width,N=u.textAlign(w.textAlign||(w.textAlign=s.textAlign)),M=v+h+E;let O=p.x,F=p.y;u.setWidth(this.width),x?C>0&&O+M+c>this.right&&(F=p.y+=_,p.line++,O=p.x=kn(a,this.left+c,this.right-n[p.line])):C>0&&F+_>this.bottom&&(O=p.x=O+r[p.line].width+c,p.line++,F=p.y=kn(a,this.top+A+c,this.bottom-r[p.line].height));const U=u.x(O);if(y(U,F,w),O=HU(N,O+v+h,x?O+M:this.right,e.rtl),S(u.x(O),F,w),x)p.x+=M+c;else if(typeof w.text!="string"){const V=l.lineHeight;p.y+=PO(w,V)+c}else p.y+=_}),rO(this.ctx,e.textDirection)}drawTitle(){const e=this.options,r=e.title,n=pn(r.font),i=Wn(r.padding);if(!r.display)return;const a=Vl(e.rtl,this.left,this.width),s=this.ctx,o=r.position,u=n.size/2,l=i.top+u;let c,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,f=kn(e.align,f,this.right-h);else{const v=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);c=l+kn(e.align,this.top,this.bottom-v-e.labels.padding-this._computeTitleHeight())}const p=kn(o,f,f+h);s.textAlign=a.textAlign(I1(o)),s.textBaseline="middle",s.strokeStyle=r.color,s.fillStyle=r.color,s.font=n.string,Iu(s,r.text,p,c,n)}_computeTitleHeight(){const e=this.options.title,r=pn(e.font),n=Wn(e.padding);return e.display?r.lineHeight+n.height:0}_getLegendItemAt(e,r){let n,i,a;if(Cs(e,this.left,this.right)&&Cs(r,this.top,this.bottom)){for(a=this.legendHitBoxes,n=0;na.length>s.length?a:s)),e+r.size/2+n.measureText(i).width}function dV(t,e,r){let n=t;return typeof e.text!="string"&&(n=PO(e,r)),n}function PO(t,e){const r=t.text?t.text.length:0;return e*r}function pV(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var IO={id:"legend",_element:eD,start(t,e,r){const n=t.legend=new eD({ctx:t.ctx,options:r,chart:t});Mn.configure(t,n,r),Mn.addBox(t,n)},stop(t){Mn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,r){const n=t.legend;Mn.configure(t,n,r),n.options=r},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,r){const n=e.datasetIndex,i=r.chart;i.isDatasetVisible(n)?(i.hide(n),e.hidden=!0):(i.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:r,pointStyle:n,textAlign:i,color:a,useBorderRadius:s,borderRadius:o}}=t.legend.options;return t._getSortedDatasetMetas().map(u=>{const l=u.controller.getStyle(r?0:void 0),c=Wn(l.borderWidth);return{text:e[u.index].label,fillStyle:l.backgroundColor,fontColor:a,hidden:!u.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:s&&(o||l.borderRadius),datasetIndex:u.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class G1 extends Za{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=r;const i=Or(n.text)?n.text.length:1;this._padding=Wn(n.padding);const a=i*pn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:r,left:n,bottom:i,right:a,options:s}=this,o=s.align;let u=0,l,c,f;return this.isHorizontal()?(c=kn(o,n,a),f=r+e,l=a-n):(s.position==="left"?(c=n+e,f=kn(o,i,r),u=Rr*-.5):(c=a-e,f=kn(o,r,i),u=Rr*.5),l=i-r),{titleX:c,titleY:f,maxWidth:l,rotation:u}}draw(){const e=this.ctx,r=this.options;if(!r.display)return;const n=pn(r.font),a=n.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:u,rotation:l}=this._drawArgs(a);Iu(e,r.text,0,0,n,{color:r.color,maxWidth:u,rotation:l,textAlign:I1(r.align),textBaseline:"middle",translation:[s,o]})}}function mV(t,e){const r=new G1({ctx:t.ctx,options:e,chart:t});Mn.configure(t,r,e),Mn.addBox(t,r),t.titleBlock=r}var kO={id:"title",_element:G1,start(t,e,r){mV(t,r)},stop(t){const e=t.titleBlock;Mn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,r){const n=t.titleBlock;Mn.configure(t,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Hp=new WeakMap;var LO={id:"subtitle",start(t,e,r){const n=new G1({ctx:t.ctx,options:r,chart:t});Mn.configure(t,n,r),Mn.addBox(t,n),Hp.set(t,n)},stop(t){Mn.removeBox(t,Hp.get(t)),Hp.delete(t)},beforeUpdate(t,e,r){const n=Hp.get(t);Mn.configure(t,n,r),n.options=r},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Zf={average(t){if(!t.length)return!1;let e,r,n=new Set,i=0,a=0;for(e=0,r=t.length;eo+u)/n.size,y:i/a}},nearest(t,e){if(!t.length)return!1;let r=e.x,n=e.y,i=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=t.length;a-1?t.split(` -`):t}function mV(t,e){const{element:r,datasetIndex:n,index:i}=e,a=t.getDatasetMeta(n).controller,{label:s,value:o}=a.getLabelAndValue(i);return{chart:t,label:s,parsed:a.getParsed(i),raw:t.data.datasets[n].data[i],formattedValue:o,dataset:a.getDataset(),dataIndex:i,datasetIndex:n,element:r}}function KA(t,e){const r=t.chart.ctx,{body:n,footer:i,title:a}=t,{boxWidth:s,boxHeight:o}=e,u=pn(e.bodyFont),l=pn(e.titleFont),c=pn(e.footerFont),f=a.length,h=i.length,p=n.length,v=Wn(e.padding);let m=v.height,b=0,y=n.reduce((A,_)=>A+_.before.length+_.lines.length+_.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*l.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const A=e.displayColors?Math.max(o,u.lineHeight):u.lineHeight;m+=p*A+(y-p)*u.lineHeight+(y-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let S=0;const x=function(A){b=Math.max(b,r.measureText(A).width+S)};return r.save(),r.font=l.string,yr(t.title,x),r.font=u.string,yr(t.beforeBody.concat(t.afterBody),x),S=e.displayColors?s+2+e.boxPadding:0,yr(n,A=>{yr(A.before,x),yr(A.lines,x),yr(A.after,x)}),S=0,r.font=c.string,yr(t.footer,x),r.restore(),b+=v.width,{width:b,height:m}}function vV(t,e){const{y:r,height:n}=e;return rt.height-n/2?"bottom":"center"}function gV(t,e,r,n){const{x:i,width:a}=n,s=r.caretSize+r.caretPadding;if(t==="left"&&i+a+s>e.width||t==="right"&&i-a-s<0)return!0}function yV(t,e,r,n){const{x:i,width:a}=r,{width:s,chartArea:{left:o,right:u}}=t;let l="center";return n==="center"?l=i<=(o+u)/2?"left":"right":i<=a/2?l="left":i>=s-a/2&&(l="right"),gV(l,t,e,r)&&(l="center"),l}function JA(t,e,r){const n=r.yAlign||e.yAlign||vV(t,r);return{xAlign:r.xAlign||e.xAlign||yV(t,e,r,n),yAlign:n}}function bV(t,e){let{x:r,width:n}=t;return e==="right"?r-=n:e==="center"&&(r-=n/2),r}function xV(t,e,r){let{y:n,height:i}=t;return e==="top"?n+=r:e==="bottom"?n-=i+r:n-=i/2,n}function QA(t,e,r,n){const{caretSize:i,caretPadding:a,cornerRadius:s}=t,{xAlign:o,yAlign:u}=r,l=i+a,{topLeft:c,topRight:f,bottomLeft:h,bottomRight:p}=Cu(s);let v=bV(e,o);const m=xV(e,u,l);return u==="center"?o==="left"?v+=l:o==="right"&&(v-=l):o==="left"?v-=Math.max(c,h)+i:o==="right"&&(v+=Math.max(f,p)+i),{x:wn(v,0,n.width-e.width),y:wn(m,0,n.height-e.height)}}function Wp(t,e,r){const n=Wn(r.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-n.right:t.x+n.left}function eD(t){return qa([],Ss(t))}function wV(t,e,r){return Uo(t,{tooltip:e,tooltipItems:r,type:"tooltip"})}function tD(t,e){const r=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return r?t.override(r):t}const kO={beforeTitle:gs,title(t){if(t.length>0){const e=t[0],r=e.chart.data.labels,n=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"u"?kO[e].call(r,n):i}class db extends Za{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const r=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&r.options.animation&&n.animations,a=new R1(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=wV(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,r){const{callbacks:n}=r,i=hi(n,"beforeTitle",this,e),a=hi(n,"title",this,e),s=hi(n,"afterTitle",this,e);let o=[];return o=qa(o,Ss(i)),o=qa(o,Ss(a)),o=qa(o,Ss(s)),o}getBeforeBody(e,r){return eD(hi(r.callbacks,"beforeBody",this,e))}getBody(e,r){const{callbacks:n}=r,i=[];return yr(e,a=>{const s={before:[],lines:[],after:[]},o=tD(n,a);qa(s.before,Ss(hi(o,"beforeLabel",this,a))),qa(s.lines,hi(o,"label",this,a)),qa(s.after,Ss(hi(o,"afterLabel",this,a))),i.push(s)}),i}getAfterBody(e,r){return eD(hi(r.callbacks,"afterBody",this,e))}getFooter(e,r){const{callbacks:n}=r,i=hi(n,"beforeFooter",this,e),a=hi(n,"footer",this,e),s=hi(n,"afterFooter",this,e);let o=[];return o=qa(o,Ss(i)),o=qa(o,Ss(a)),o=qa(o,Ss(s)),o}_createItems(e){const r=this._active,n=this.chart.data,i=[],a=[],s=[];let o=[],u,l;for(u=0,l=r.length;ue.filter(c,f,h,n))),e.itemSort&&(o=o.sort((c,f)=>e.itemSort(c,f,n))),yr(o,c=>{const f=tD(e.callbacks,c);i.push(hi(f,"labelColor",this,c)),a.push(hi(f,"labelPointStyle",this,c)),s.push(hi(f,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(e,r){const n=this.options.setContext(this.getContext()),i=this._active;let a,s=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const o=Kf[n.position].call(this,i,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);const u=this._size=KA(this,n),l=Object.assign({},o,u),c=JA(this.chart,n,l),f=QA(n,l,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:f.x,y:f.y,width:u.width,height:u.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(e,r,n,i){const a=this.getCaretPosition(e,n,i);r.lineTo(a.x1,a.y1),r.lineTo(a.x2,a.y2),r.lineTo(a.x3,a.y3)}getCaretPosition(e,r,n){const{xAlign:i,yAlign:a}=this,{caretSize:s,cornerRadius:o}=n,{topLeft:u,topRight:l,bottomLeft:c,bottomRight:f}=Cu(o),{x:h,y:p}=e,{width:v,height:m}=r;let b,y,S,x,A,_;return a==="center"?(A=p+m/2,i==="left"?(b=h,y=b-s,x=A+s,_=A-s):(b=h+v,y=b+s,x=A-s,_=A+s),S=b):(i==="left"?y=h+Math.max(u,c)+s:i==="right"?y=h+v-Math.max(l,f)-s:y=this.caretX,a==="top"?(x=p,A=x-s,b=y-s,S=y+s):(x=p+m,A=x+s,b=y+s,S=y-s),_=x),{x1:b,x2:y,x3:S,y1:x,y2:A,y3:_}}drawTitle(e,r,n){const i=this.title,a=i.length;let s,o,u;if(a){const l=Vl(n.rtl,this.x,this.width);for(e.x=Wp(this,n.titleAlign,n),r.textAlign=l.textAlign(n.titleAlign),r.textBaseline="middle",s=pn(n.titleFont),o=n.titleSpacing,r.fillStyle=n.titleColor,r.font=s.string,u=0;uS!==0)?(e.beginPath(),e.fillStyle=a.multiKeyBackground,Sh(e,{x:m,y:v,w:l,h:u,radius:y}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),Sh(e,{x:b,y:v+1,w:l-2,h:u-2,radius:y}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(m,v,l,u),e.strokeRect(m,v,l,u),e.fillStyle=s.backgroundColor,e.fillRect(b,v+1,l-2,u-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,r,n){const{body:i}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:u,boxWidth:l,boxPadding:c}=n,f=pn(n.bodyFont);let h=f.lineHeight,p=0;const v=Vl(n.rtl,this.x,this.width),m=function(E){r.fillText(E,v.x(e.x+p),e.y+h/2),e.y+=h+a},b=v.textAlign(s);let y,S,x,A,_,w,C;for(r.textAlign=s,r.textBaseline="middle",r.font=f.string,e.x=Wp(this,b,n),r.fillStyle=n.bodyColor,yr(this.beforeBody,m),p=o&&b!=="right"?s==="center"?l/2+c:l+2+c:0,A=0,w=i.length;A0&&r.stroke()}_updateAnimationTarget(e){const r=this.chart,n=this.$animations,i=n&&n.x,a=n&&n.y;if(i||a){const s=Kf[e.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=KA(this,e),u=Object.assign({},s,this._size),l=JA(r,e,u),c=QA(e,u,l,r);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const r=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(r);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const s=Wn(r.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(a,e,i,r),QT(e,r.textDirection),a.y+=s.top,this.drawTitle(a,e,r),this.drawBody(a,e,r),this.drawFooter(a,e,r),eO(e,r.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,r){const n=this._active,i=e.map(({datasetIndex:o,index:u})=>{const l=this.chart.getDatasetMeta(o);if(!l)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:l.data[u],index:u}}),a=!Lm(n,i),s=this._positionChanged(i,r);(a||s)&&(this._active=i,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,r,n=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],s=this._getActiveElements(e,a,r,n),o=this._positionChanged(s,e),u=r||!Lm(s,a)||o;return u&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,r))),u}_getActiveElements(e,r,n,i){const a=this.options;if(e.type==="mouseout")return[];if(!i)return r.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,a.mode,a,n);return a.reverse&&s.reverse(),s}_positionChanged(e,r){const{caretX:n,caretY:i,options:a}=this,s=Kf[a.position].call(this,e,r);return s!==!1&&(n!==s.x||i!==s.y)}}je(db,"positioners",Kf);var LO={id:"tooltip",_element:db,positioners:Kf,afterInit(t,e,r){r&&(t.tooltip=new db({chart:t,options:r}))},beforeUpdate(t,e,r){t.tooltip&&t.tooltip.initialize(r)},reset(t,e,r){t.tooltip&&t.tooltip.initialize(r)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const r={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",r)}},afterEvent(t,e){if(t.tooltip){const r=e.replay;t.tooltip.handleEvent(e.event,r,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:kO},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},$O=Object.freeze({__proto__:null,Colors:EO,Decimation:MO,Filler:FO,Legend:BO,SubTitle:IO,Title:PO,Tooltip:LO});const SV=(t,e,r,n)=>(typeof e=="string"?(r=t.push(e)-1,n.unshift({index:r,label:e})):isNaN(e)&&(r=null),r);function _V(t,e,r,n){const i=t.indexOf(e);if(i===-1)return SV(t,e,r,n);const a=t.lastIndexOf(e);return i!==a?r:i}const AV=(t,e)=>t===null?null:wn(Math.round(t),0,e);function rD(t){const e=this.getLabels();return t>=0&&tr.length-1?null:this.getPixelForValue(r[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}je(Ym,"id","category"),je(Ym,"defaults",{ticks:{callback:rD}});function DV(t,e){const r=[],{bounds:i,step:a,min:s,max:o,precision:u,count:l,maxTicks:c,maxDigits:f,includeBounds:h}=t,p=a||1,v=c-1,{min:m,max:b}=e,y=!or(s),S=!or(o),x=!or(l),A=(b-m)/(f+1);let _=Z_((b-m)/v/p)*p,w,C,E,N;if(_<1e-14&&!y&&!S)return[{value:m},{value:b}];N=Math.ceil(b/_)-Math.floor(m/_),N>v&&(_=Z_(N*_/v/p)*p),or(u)||(w=Math.pow(10,u),_=Math.ceil(_*w)/w),i==="ticks"?(C=Math.floor(m/_)*_,E=Math.ceil(b/_)*_):(C=m,E=b),y&&S&&a&&PU((o-s)/a,_/1e3)?(N=Math.round(Math.min((o-s)/_,c)),_=(o-s)/N,C=s,E=o):x?(C=y?s:C,E=S?o:E,N=l-1,_=(E-C)/N):(N=(E-C)/_,nh(N,Math.round(N),_/1e3)?N=Math.round(N):N=Math.ceil(N));const M=Math.max(K_(_),K_(C));w=Math.pow(10,or(u)?M:u),C=Math.round(C*w)/w,E=Math.round(E*w)/w;let O=0;for(y&&(h&&C!==s?(r.push({value:s}),Co)break;r.push({value:F})}return S&&h&&E!==o?r.length&&nh(r[r.length-1].value,o,nD(o,A,t))?r[r.length-1].value=o:r.push({value:o}):(!S||E===o)&&r.push({value:E}),r}function nD(t,e,{horizontal:r,minRotation:n}){const i=ba(n),a=(r?Math.sin(i):Math.cos(i))||.001,s=.75*e*(""+t).length;return Math.min(e/a,s)}class jm extends qo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,r){return or(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:r,maxDefined:n}=this.getUserBounds();let{min:i,max:a}=this;const s=u=>i=r?i:u,o=u=>a=n?a:u;if(e){const u=Ya(i),l=Ya(a);u<0&&l<0?o(0):u>0&&l>0&&s(0)}if(i===a){let u=a===0?1:Math.abs(a*.05);o(a+u),e||s(i-u)}this.min=i,this.max=a}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:r,stepSize:n}=e,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),r=r||11),r&&(i=Math.min(r,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,r=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},a=this._range||this,s=DV(i,a);return e.bounds==="ticks"&&IT(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let r=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const i=(n-r)/Math.max(e.length-1,1)/2;r-=i,n+=i}this._startValue=r,this._endValue=n,this._valueRange=n-r}getLabelForValue(e){return Gh(e,this.chart.options.locale,this.options.ticks.format)}}class Gm extends jm{determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=Vr(e)?e:0,this.max=Vr(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),r=e?this.width:this.height,n=ba(this.options.ticks.minRotation),i=(e?Math.sin(n):Math.cos(n))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,a.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}je(Gm,"id","linear"),je(Gm,"defaults",{ticks:{callback:Xh.formatters.numeric}});const Ah=t=>Math.floor(Do(t)),gu=(t,e)=>Math.pow(10,Ah(t)+e);function iD(t){return t/Math.pow(10,Ah(t))===1}function aD(t,e,r){const n=Math.pow(10,r),i=Math.floor(t/n);return Math.ceil(e/n)-i}function NV(t,e){const r=e-t;let n=Ah(r);for(;aD(t,e,n)>10;)n++;for(;aD(t,e,n)<10;)n--;return Math.min(n,Ah(t))}function EV(t,{min:e,max:r}){e=Ci(t.min,e);const n=[],i=Ah(e);let a=NV(e,r),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),u=i>a?Math.pow(10,i):0,l=Math.round((e-u)*s)/s,c=Math.floor((e-u)/o/10)*o*10;let f=Math.floor((l-c)/Math.pow(10,a)),h=Ci(t.min,Math.round((u+c+f*Math.pow(10,a))*s)/s);for(;h=10?f=f<15?15:20:f++,f>=20&&(a++,f=2,s=a>=0?1:s),h=Math.round((u+c+f*Math.pow(10,a))*s)/s;const p=Ci(t.max,h);return n.push({value:p,major:iD(p),significand:f}),n}class Xm extends qo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,r){const n=jm.prototype.parse.apply(this,[e,r]);if(n===0){this._zero=!0;return}return Vr(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=Vr(e)?Math.max(0,e):null,this.max=Vr(r)?Math.max(0,r):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Vr(this._userMin)&&(this.min=e===gu(this.min,0)?gu(this.min,-1):gu(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:r}=this.getUserBounds();let n=this.min,i=this.max;const a=o=>n=e?n:o,s=o=>i=r?i:o;n===i&&(n<=0?(a(1),s(10)):(a(gu(n,-1)),s(gu(i,1)))),n<=0&&a(gu(i,-1)),i<=0&&s(gu(n,1)),this.min=n,this.max=i}buildTicks(){const e=this.options,r={min:this._userMin,max:this._userMax},n=EV(r,this);return e.bounds==="ticks"&&IT(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":Gh(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Do(e),this._valueRange=Do(this.max)-Do(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Do(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const r=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+r*this._valueRange)}}je(Xm,"id","logarithmic"),je(Xm,"defaults",{ticks:{callback:Xh.formatters.logarithmic,major:{enabled:!0}}});function pb(t){const e=t.ticks;if(e.display&&t.display){const r=Wn(e.backdropPadding);return Bt(e.font&&e.font.size,Ur.font.size)+r.height}return 0}function CV(t,e,r){return r=Or(r)?r:[r],{w:JU(t,e.string,r),h:r.length*e.lineHeight}}function sD(t,e,r,n,i){return t===n||t===i?{start:e-r/2,end:e+r/2}:ti?{start:e-r,end:e}:{start:e,end:e+r}}function MV(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},r=Object.assign({},e),n=[],i=[],a=t._pointLabels.length,s=t.options.pointLabels,o=s.centerPointLabels?Rr/a:0;for(let u=0;ue.r&&(o=(n.end-e.r)/a,t.r=Math.max(t.r,e.r+o)),i.starte.b&&(u=(i.end-e.b)/s,t.b=Math.max(t.b,e.b+u))}function OV(t,e,r){const n=t.drawingArea,{extra:i,additionalAngle:a,padding:s,size:o}=r,u=t.getPointPosition(e,n+i+s,a),l=Math.round(_1(Ti(u.angle+en))),c=IV(u.y,o.h,l),f=BV(l),h=PV(u.x,o.w,f);return{visible:!0,x:u.x,y:c,textAlign:f,left:h,top:c,right:h+o.w,bottom:c+o.h}}function FV(t,e){if(!e)return!0;const{left:r,top:n,right:i,bottom:a}=t;return!(Ts({x:r,y:n},e)||Ts({x:r,y:a},e)||Ts({x:i,y:n},e)||Ts({x:i,y:a},e))}function RV(t,e,r){const n=[],i=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:o}=a.pointLabels,u={extra:pb(a)/2,additionalAngle:s?Rr/i:0};let l;for(let c=0;c270||r<90)&&(t-=e),t}function kV(t,e,r){const{left:n,top:i,right:a,bottom:s}=r,{backdropColor:o}=e;if(!or(o)){const u=Cu(e.borderRadius),l=Wn(e.backdropPadding);t.fillStyle=o;const c=n-l.left,f=i-l.top,h=a-n+l.width,p=s-i+l.height;Object.values(u).some(v=>v!==0)?(t.beginPath(),Sh(t,{x:c,y:f,w:h,h:p,radius:u}),t.fill()):t.fillRect(c,f,h,p)}}function LV(t,e){const{ctx:r,options:{pointLabels:n}}=t;for(let i=e-1;i>=0;i--){const a=t._pointLabelItems[i];if(!a.visible)continue;const s=n.setContext(t.getPointLabelContext(i));kV(r,s,a);const o=pn(s.font),{x:u,y:l,textAlign:c}=a;Pu(r,t._pointLabels[i],u,l+o.lineHeight/2,o,{color:s.color,textAlign:c,textBaseline:"middle"})}}function zO(t,e,r,n){const{ctx:i}=t;if(r)i.arc(t.xCenter,t.yCenter,e,0,Fr);else{let a=t.getPointPosition(0,e);i.moveTo(a.x,a.y);for(let s=1;s{const i=Cr(this.options.pointLabels.callback,[r,n],this);return i||i===0?i:""}).filter((r,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?MV(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,r,n,i){this.xCenter+=Math.floor((e-r)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,r,n,i))}getIndexAngle(e){const r=Fr/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ti(e*r+ba(n))}getDistanceFromCenterForValue(e){if(or(e))return NaN;const r=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*r:(e-this.min)*r}getValueForDistanceFromCenter(e){if(or(e))return NaN;const r=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-r:this.min+r}getPointLabelContext(e){const r=this._pointLabels||[];if(e>=0&&e{if(f!==0||f===0&&this.min<0){u=this.getDistanceFromCenterForValue(c.value);const h=this.getContext(f),p=i.setContext(h),v=a.setContext(h);$V(this,p,u,s,v)}}),n.display){for(e.save(),o=s-1;o>=0;o--){const c=n.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:h}=c;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(c.borderDash),e.lineDashOffset=c.borderDashOffset,u=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,u),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,r=this.options,n=r.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let a,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((o,u)=>{if(u===0&&this.min>=0&&!r.reverse)return;const l=n.setContext(this.getContext(u)),c=pn(l.font);if(a=this.getDistanceFromCenterForValue(this.ticks[u].value),l.showLabelBackdrop){e.font=c.string,s=e.measureText(o.label).width,e.fillStyle=l.backdropColor;const f=Wn(l.backdropPadding);e.fillRect(-s/2-f.left,-a-c.size/2-f.top,s+f.width,c.size+f.height)}Pu(e,o.label,0,-a,c,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),e.restore()}drawTitle(){}}je(kl,"id","radialLinear"),je(kl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Xh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),je(kl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),je(kl,"descriptors",{angleLines:{_fallback:"grid"}});const Kv={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mi=Object.keys(Kv);function oD(t,e){return t-e}function uD(t,e){if(or(e))return null;const r=t._adapter,{parser:n,round:i,isoWeekday:a}=t._parseOpts;let s=e;return typeof n=="function"&&(s=n(s)),Vr(s)||(s=typeof n=="string"?r.parse(s,n):r.parse(s)),s===null?null:(i&&(s=i==="week"&&(tc(a)||a===!0)?r.startOf(s,"isoWeek",a):r.startOf(s,i)),+s)}function lD(t,e,r,n){const i=mi.length;for(let a=mi.indexOf(t);a=mi.indexOf(r);a--){const s=mi[a];if(Kv[s].common&&t._adapter.diff(i,n,s)>=e-1)return s}return mi[r?mi.indexOf(r):0]}function qV(t){for(let e=mi.indexOf(t)+1,r=mi.length;e=e?r[n]:r[i];t[a]=!0}}function HV(t,e,r,n){const i=t._adapter,a=+i.startOf(e[0].value,n),s=e[e.length-1].value;let o,u;for(o=a;o<=s;o=+i.add(o,1,n))u=r[o],u>=0&&(e[u].major=!0);return e}function fD(t,e,r){const n=[],i={},a=e.length;let s,o;for(s=0;s+e.value))}initOffsets(e=[]){let r=0,n=0,i,a;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?r=1-i:r=(this.getDecimalForValue(e[1])-i)/2,a=this.getDecimalForValue(e[e.length-1]),e.length===1?n=a:n=(a-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;r=wn(r,0,s),n=wn(n,0,s),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){const e=this._adapter,r=this.min,n=this.max,i=this.options,a=i.time,s=a.unit||lD(a.minUnit,r,n,this._getLabelCapacity(r)),o=Bt(i.ticks.stepSize,1),u=s==="week"?a.isoWeekday:!1,l=tc(u)||u===!0,c={};let f=r,h,p;if(l&&(f=+e.startOf(f,"isoWeek",u)),f=+e.startOf(f,l?"day":s),e.diff(n,r,s)>1e5*o)throw new Error(r+" and "+n+" are too far apart with stepSize of "+o+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h+m)}getLabelForValue(e){const r=this._adapter,n=this.options.time;return n.tooltipFormat?r.format(e,n.tooltipFormat):r.format(e,n.displayFormats.datetime)}format(e,r){const i=this.options.time.displayFormats,a=this._unit,s=r||i[a];return this._adapter.format(e,s)}_tickFormatFunction(e,r,n,i){const a=this.options,s=a.ticks.callback;if(s)return Cr(s,[e,r,n],this);const o=a.time.displayFormats,u=this._unit,l=this._majorUnit,c=u&&o[u],f=l&&o[l],h=n[r],p=l&&f&&h&&h.major;return this._adapter.format(e,i||(p?f:c))}generateTickLabels(e){let r,n,i;for(r=0,n=e.length;r0?o:1}getDataTimestamps(){let e=this._cache.data||[],r,n;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(r=0,n=i.length;r=t[n].pos&&e<=t[i].pos&&({lo:n,hi:i}=Ms(t,"pos",e)),{pos:a,time:o}=t[n],{pos:s,time:u}=t[i]):(e>=t[n].time&&e<=t[i].time&&({lo:n,hi:i}=Ms(t,"time",e)),{time:a,pos:o}=t[n],{time:s,pos:u}=t[i]);const l=s-a;return l?o+(u-o)*(e-a)/l:o}class Zm extends ic{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(e);this._minPos=Vp(r,this.min),this._tableRange=Vp(r,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:r,max:n}=this,i=[],a=[];let s,o,u,l,c;for(s=0,o=e.length;s=r&&l<=n&&i.push(l);if(i.length<2)return[{time:r,pos:0},{time:n,pos:1}];for(s=0,o=i.length;si-a)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const r=this.getDataTimestamps(),n=this.getLabelTimestamps();return r.length&&n.length?e=this.normalize(r.concat(n)):e=r.length?r:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Vp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const r=this._offsets,n=this.getDecimalForPixel(e)/r.factor-r.end;return Vp(this._table,n*this._tableRange+this._minPos,!0)}}je(Zm,"id","timeseries"),je(Zm,"defaults",ic.defaults);var UO=Object.freeze({__proto__:null,CategoryScale:Ym,LinearScale:Gm,LogarithmicScale:Xm,RadialLinearScale:kl,TimeScale:ic,TimeSeriesScale:Zm});const WV=[oO,AO,$O,UO],qO=Object.freeze(Object.defineProperty({__proto__:null,Animation:iO,Animations:R1,ArcElement:Il,BarController:sh,BarElement:hh,BasePlatform:P1,BasicPlatform:hO,BubbleController:oh,CategoryScale:Ym,Chart:yo,Colors:EO,DatasetController:ta,Decimation:MO,DomPlatform:mO,DoughnutController:No,Element:Za,Filler:FO,Interaction:lO,Legend:BO,LineController:uh,LineElement:Os,LinearScale:Gm,LogarithmicScale:Xm,PieController:Hm,PointElement:fh,PolarAreaController:Yl,RadarController:lh,RadialLinearScale:kl,Scale:qo,ScatterController:ch,SubTitle:IO,Ticks:Xh,TimeScale:ic,TimeSeriesScale:Zm,Title:PO,Tooltip:LO,_adapters:uO,_detectPlatform:vO,animator:Ha,controllers:oO,defaults:Ur,elements:AO,layouts:Mn,plugins:$O,registerables:WV,registry:va,scales:UO},Symbol.toStringTag,{value:"Module"}));var mb=function(t,e){return mb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},mb(t,e)};function sn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mb(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function VV(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?a(c.value):i(c.value).then(o,u)}l((n=n.apply(t,e||[])).next())})}function L1(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function Tr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n1||o(h,p)})})}function o(h,p){try{u(n[h](p))}catch(v){f(a[0][3],v)}}function u(h){h.value instanceof jl?Promise.resolve(h.value.v).then(l,c):f(a[0][2],h)}function l(h){o("next",h)}function c(h){o("throw",h)}function f(h,p){h(p),a.shift(),a.length&&o(a[0][0],a[0][1])}}function jV(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof yi=="function"?yi(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,u){s=t[a](s),i(o,u,s.done,s.value)})}}function i(a,s,o,u){Promise.resolve(u).then(function(l){a({value:l,done:o})},s)}}function Ft(t){return typeof t=="function"}function Uu(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Am=Uu(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription: +`):t}function vV(t,e){const{element:r,datasetIndex:n,index:i}=e,a=t.getDatasetMeta(n).controller,{label:s,value:o}=a.getLabelAndValue(i);return{chart:t,label:s,parsed:a.getParsed(i),raw:t.data.datasets[n].data[i],formattedValue:o,dataset:a.getDataset(),dataIndex:i,datasetIndex:n,element:r}}function tD(t,e){const r=t.chart.ctx,{body:n,footer:i,title:a}=t,{boxWidth:s,boxHeight:o}=e,u=pn(e.bodyFont),l=pn(e.titleFont),c=pn(e.footerFont),f=a.length,h=i.length,p=n.length,v=Wn(e.padding);let m=v.height,b=0,y=n.reduce((A,_)=>A+_.before.length+_.lines.length+_.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*l.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const A=e.displayColors?Math.max(o,u.lineHeight):u.lineHeight;m+=p*A+(y-p)*u.lineHeight+(y-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let S=0;const x=function(A){b=Math.max(b,r.measureText(A).width+S)};return r.save(),r.font=l.string,yr(t.title,x),r.font=u.string,yr(t.beforeBody.concat(t.afterBody),x),S=e.displayColors?s+2+e.boxPadding:0,yr(n,A=>{yr(A.before,x),yr(A.lines,x),yr(A.after,x)}),S=0,r.font=c.string,yr(t.footer,x),r.restore(),b+=v.width,{width:b,height:m}}function gV(t,e){const{y:r,height:n}=e;return rt.height-n/2?"bottom":"center"}function yV(t,e,r,n){const{x:i,width:a}=n,s=r.caretSize+r.caretPadding;if(t==="left"&&i+a+s>e.width||t==="right"&&i-a-s<0)return!0}function bV(t,e,r,n){const{x:i,width:a}=r,{width:s,chartArea:{left:o,right:u}}=t;let l="center";return n==="center"?l=i<=(o+u)/2?"left":"right":i<=a/2?l="left":i>=s-a/2&&(l="right"),yV(l,t,e,r)&&(l="center"),l}function rD(t,e,r){const n=r.yAlign||e.yAlign||gV(t,r);return{xAlign:r.xAlign||e.xAlign||bV(t,e,r,n),yAlign:n}}function xV(t,e){let{x:r,width:n}=t;return e==="right"?r-=n:e==="center"&&(r-=n/2),r}function wV(t,e,r){let{y:n,height:i}=t;return e==="top"?n+=r:e==="bottom"?n-=i+r:n-=i/2,n}function nD(t,e,r,n){const{caretSize:i,caretPadding:a,cornerRadius:s}=t,{xAlign:o,yAlign:u}=r,l=i+a,{topLeft:c,topRight:f,bottomLeft:h,bottomRight:p}=Cu(s);let v=xV(e,o);const m=wV(e,u,l);return u==="center"?o==="left"?v+=l:o==="right"&&(v-=l):o==="left"?v-=Math.max(c,h)+i:o==="right"&&(v+=Math.max(f,p)+i),{x:wn(v,0,n.width-e.width),y:wn(m,0,n.height-e.height)}}function Wp(t,e,r){const n=Wn(r.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-n.right:t.x+n.left}function iD(t){return qa([],Ss(t))}function SV(t,e,r){return Uo(t,{tooltip:e,tooltipItems:r,type:"tooltip"})}function aD(t,e){const r=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return r?t.override(r):t}const $O={beforeTitle:gs,title(t){if(t.length>0){const e=t[0],r=e.chart.data.labels,n=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"u"?$O[e].call(r,n):i}class vb extends Za{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const r=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&r.options.animation&&n.animations,a=new W1(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=SV(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,r){const{callbacks:n}=r,i=hi(n,"beforeTitle",this,e),a=hi(n,"title",this,e),s=hi(n,"afterTitle",this,e);let o=[];return o=qa(o,Ss(i)),o=qa(o,Ss(a)),o=qa(o,Ss(s)),o}getBeforeBody(e,r){return iD(hi(r.callbacks,"beforeBody",this,e))}getBody(e,r){const{callbacks:n}=r,i=[];return yr(e,a=>{const s={before:[],lines:[],after:[]},o=aD(n,a);qa(s.before,Ss(hi(o,"beforeLabel",this,a))),qa(s.lines,hi(o,"label",this,a)),qa(s.after,Ss(hi(o,"afterLabel",this,a))),i.push(s)}),i}getAfterBody(e,r){return iD(hi(r.callbacks,"afterBody",this,e))}getFooter(e,r){const{callbacks:n}=r,i=hi(n,"beforeFooter",this,e),a=hi(n,"footer",this,e),s=hi(n,"afterFooter",this,e);let o=[];return o=qa(o,Ss(i)),o=qa(o,Ss(a)),o=qa(o,Ss(s)),o}_createItems(e){const r=this._active,n=this.chart.data,i=[],a=[],s=[];let o=[],u,l;for(u=0,l=r.length;ue.filter(c,f,h,n))),e.itemSort&&(o=o.sort((c,f)=>e.itemSort(c,f,n))),yr(o,c=>{const f=aD(e.callbacks,c);i.push(hi(f,"labelColor",this,c)),a.push(hi(f,"labelPointStyle",this,c)),s.push(hi(f,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(e,r){const n=this.options.setContext(this.getContext()),i=this._active;let a,s=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const o=Zf[n.position].call(this,i,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);const u=this._size=tD(this,n),l=Object.assign({},o,u),c=rD(this.chart,n,l),f=nD(n,l,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:f.x,y:f.y,width:u.width,height:u.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(e,r,n,i){const a=this.getCaretPosition(e,n,i);r.lineTo(a.x1,a.y1),r.lineTo(a.x2,a.y2),r.lineTo(a.x3,a.y3)}getCaretPosition(e,r,n){const{xAlign:i,yAlign:a}=this,{caretSize:s,cornerRadius:o}=n,{topLeft:u,topRight:l,bottomLeft:c,bottomRight:f}=Cu(o),{x:h,y:p}=e,{width:v,height:m}=r;let b,y,S,x,A,_;return a==="center"?(A=p+m/2,i==="left"?(b=h,y=b-s,x=A+s,_=A-s):(b=h+v,y=b+s,x=A-s,_=A+s),S=b):(i==="left"?y=h+Math.max(u,c)+s:i==="right"?y=h+v-Math.max(l,f)-s:y=this.caretX,a==="top"?(x=p,A=x-s,b=y-s,S=y+s):(x=p+m,A=x+s,b=y+s,S=y-s),_=x),{x1:b,x2:y,x3:S,y1:x,y2:A,y3:_}}drawTitle(e,r,n){const i=this.title,a=i.length;let s,o,u;if(a){const l=Vl(n.rtl,this.x,this.width);for(e.x=Wp(this,n.titleAlign,n),r.textAlign=l.textAlign(n.titleAlign),r.textBaseline="middle",s=pn(n.titleFont),o=n.titleSpacing,r.fillStyle=n.titleColor,r.font=s.string,u=0;uS!==0)?(e.beginPath(),e.fillStyle=a.multiKeyBackground,Sh(e,{x:m,y:v,w:l,h:u,radius:y}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),Sh(e,{x:b,y:v+1,w:l-2,h:u-2,radius:y}),e.fill()):(e.fillStyle=a.multiKeyBackground,e.fillRect(m,v,l,u),e.strokeRect(m,v,l,u),e.fillStyle=s.backgroundColor,e.fillRect(b,v+1,l-2,u-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,r,n){const{body:i}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:u,boxWidth:l,boxPadding:c}=n,f=pn(n.bodyFont);let h=f.lineHeight,p=0;const v=Vl(n.rtl,this.x,this.width),m=function(E){r.fillText(E,v.x(e.x+p),e.y+h/2),e.y+=h+a},b=v.textAlign(s);let y,S,x,A,_,w,C;for(r.textAlign=s,r.textBaseline="middle",r.font=f.string,e.x=Wp(this,b,n),r.fillStyle=n.bodyColor,yr(this.beforeBody,m),p=o&&b!=="right"?s==="center"?l/2+c:l+2+c:0,A=0,w=i.length;A0&&r.stroke()}_updateAnimationTarget(e){const r=this.chart,n=this.$animations,i=n&&n.x,a=n&&n.y;if(i||a){const s=Zf[e.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=tD(this,e),u=Object.assign({},s,this._size),l=rD(r,e,u),c=nD(e,u,l,r);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const r=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(r);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const s=Wn(r.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(a,e,i,r),tO(e,r.textDirection),a.y+=s.top,this.drawTitle(a,e,r),this.drawBody(a,e,r),this.drawFooter(a,e,r),rO(e,r.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,r){const n=this._active,i=e.map(({datasetIndex:o,index:u})=>{const l=this.chart.getDatasetMeta(o);if(!l)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:l.data[u],index:u}}),a=!km(n,i),s=this._positionChanged(i,r);(a||s)&&(this._active=i,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,r,n=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],s=this._getActiveElements(e,a,r,n),o=this._positionChanged(s,e),u=r||!km(s,a)||o;return u&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,r))),u}_getActiveElements(e,r,n,i){const a=this.options;if(e.type==="mouseout")return[];if(!i)return r.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,a.mode,a,n);return a.reverse&&s.reverse(),s}_positionChanged(e,r){const{caretX:n,caretY:i,options:a}=this,s=Zf[a.position].call(this,e,r);return s!==!1&&(n!==s.x||i!==s.y)}}je(vb,"positioners",Zf);var zO={id:"tooltip",_element:vb,positioners:Zf,afterInit(t,e,r){r&&(t.tooltip=new vb({chart:t,options:r}))},beforeUpdate(t,e,r){t.tooltip&&t.tooltip.initialize(r)},reset(t,e,r){t.tooltip&&t.tooltip.initialize(r)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const r={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",r)}},afterEvent(t,e){if(t.tooltip){const r=e.replay;t.tooltip.handleEvent(e.event,r,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$O},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},UO=Object.freeze({__proto__:null,Colors:MO,Decimation:OO,Filler:BO,Legend:IO,SubTitle:LO,Title:kO,Tooltip:zO});const _V=(t,e,r,n)=>(typeof e=="string"?(r=t.push(e)-1,n.unshift({index:r,label:e})):isNaN(e)&&(r=null),r);function AV(t,e,r,n){const i=t.indexOf(e);if(i===-1)return _V(t,e,r,n);const a=t.lastIndexOf(e);return i!==a?r:i}const DV=(t,e)=>t===null?null:wn(Math.round(t),0,e);function sD(t){const e=this.getLabels();return t>=0&&tr.length-1?null:this.getPixelForValue(r[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}je(Vm,"id","category"),je(Vm,"defaults",{ticks:{callback:sD}});function NV(t,e){const r=[],{bounds:i,step:a,min:s,max:o,precision:u,count:l,maxTicks:c,maxDigits:f,includeBounds:h}=t,p=a||1,v=c-1,{min:m,max:b}=e,y=!or(s),S=!or(o),x=!or(l),A=(b-m)/(f+1);let _=eA((b-m)/v/p)*p,w,C,E,N;if(_<1e-14&&!y&&!S)return[{value:m},{value:b}];N=Math.ceil(b/_)-Math.floor(m/_),N>v&&(_=eA(N*_/v/p)*p),or(u)||(w=Math.pow(10,u),_=Math.ceil(_*w)/w),i==="ticks"?(C=Math.floor(m/_)*_,E=Math.ceil(b/_)*_):(C=m,E=b),y&&S&&a&&IU((o-s)/a,_/1e3)?(N=Math.round(Math.min((o-s)/_,c)),_=(o-s)/N,C=s,E=o):x?(C=y?s:C,E=S?o:E,N=l-1,_=(E-C)/N):(N=(E-C)/_,rh(N,Math.round(N),_/1e3)?N=Math.round(N):N=Math.ceil(N));const M=Math.max(tA(_),tA(C));w=Math.pow(10,or(u)?M:u),C=Math.round(C*w)/w,E=Math.round(E*w)/w;let O=0;for(y&&(h&&C!==s?(r.push({value:s}),Co)break;r.push({value:F})}return S&&h&&E!==o?r.length&&rh(r[r.length-1].value,o,oD(o,A,t))?r[r.length-1].value=o:r.push({value:o}):(!S||E===o)&&r.push({value:E}),r}function oD(t,e,{horizontal:r,minRotation:n}){const i=ba(n),a=(r?Math.sin(i):Math.cos(i))||.001,s=.75*e*(""+t).length;return Math.min(e/a,s)}class Ym extends qo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,r){return or(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:r,maxDefined:n}=this.getUserBounds();let{min:i,max:a}=this;const s=u=>i=r?i:u,o=u=>a=n?a:u;if(e){const u=Ya(i),l=Ya(a);u<0&&l<0?o(0):u>0&&l>0&&s(0)}if(i===a){let u=a===0?1:Math.abs(a*.05);o(a+u),e||s(i-u)}this.min=i,this.max=a}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:r,stepSize:n}=e,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),r=r||11),r&&(i=Math.min(r,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,r=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},a=this._range||this,s=NV(i,a);return e.bounds==="ticks"&<(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let r=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const i=(n-r)/Math.max(e.length-1,1)/2;r-=i,n+=i}this._startValue=r,this._endValue=n,this._valueRange=n-r}getLabelForValue(e){return Gh(e,this.chart.options.locale,this.options.ticks.format)}}class jm extends Ym{determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=Vr(e)?e:0,this.max=Vr(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),r=e?this.width:this.height,n=ba(this.options.ticks.minRotation),i=(e?Math.sin(n):Math.cos(n))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,a.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}je(jm,"id","linear"),je(jm,"defaults",{ticks:{callback:Xh.formatters.numeric}});const Ah=t=>Math.floor(Do(t)),gu=(t,e)=>Math.pow(10,Ah(t)+e);function uD(t){return t/Math.pow(10,Ah(t))===1}function lD(t,e,r){const n=Math.pow(10,r),i=Math.floor(t/n);return Math.ceil(e/n)-i}function EV(t,e){const r=e-t;let n=Ah(r);for(;lD(t,e,n)>10;)n++;for(;lD(t,e,n)<10;)n--;return Math.min(n,Ah(t))}function CV(t,{min:e,max:r}){e=Ci(t.min,e);const n=[],i=Ah(e);let a=EV(e,r),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),u=i>a?Math.pow(10,i):0,l=Math.round((e-u)*s)/s,c=Math.floor((e-u)/o/10)*o*10;let f=Math.floor((l-c)/Math.pow(10,a)),h=Ci(t.min,Math.round((u+c+f*Math.pow(10,a))*s)/s);for(;h=10?f=f<15?15:20:f++,f>=20&&(a++,f=2,s=a>=0?1:s),h=Math.round((u+c+f*Math.pow(10,a))*s)/s;const p=Ci(t.max,h);return n.push({value:p,major:uD(p),significand:f}),n}class Gm extends qo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,r){const n=Ym.prototype.parse.apply(this,[e,r]);if(n===0){this._zero=!0;return}return Vr(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=Vr(e)?Math.max(0,e):null,this.max=Vr(r)?Math.max(0,r):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Vr(this._userMin)&&(this.min=e===gu(this.min,0)?gu(this.min,-1):gu(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:r}=this.getUserBounds();let n=this.min,i=this.max;const a=o=>n=e?n:o,s=o=>i=r?i:o;n===i&&(n<=0?(a(1),s(10)):(a(gu(n,-1)),s(gu(i,1)))),n<=0&&a(gu(i,-1)),i<=0&&s(gu(n,1)),this.min=n,this.max=i}buildTicks(){const e=this.options,r={min:this._userMin,max:this._userMax},n=CV(r,this);return e.bounds==="ticks"&<(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":Gh(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Do(e),this._valueRange=Do(this.max)-Do(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Do(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const r=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+r*this._valueRange)}}je(Gm,"id","logarithmic"),je(Gm,"defaults",{ticks:{callback:Xh.formatters.logarithmic,major:{enabled:!0}}});function gb(t){const e=t.ticks;if(e.display&&t.display){const r=Wn(e.backdropPadding);return Bt(e.font&&e.font.size,Ur.font.size)+r.height}return 0}function MV(t,e,r){return r=Or(r)?r:[r],{w:QU(t,e.string,r),h:r.length*e.lineHeight}}function cD(t,e,r,n,i){return t===n||t===i?{start:e-r/2,end:e+r/2}:ti?{start:e-r,end:e}:{start:e,end:e+r}}function TV(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},r=Object.assign({},e),n=[],i=[],a=t._pointLabels.length,s=t.options.pointLabels,o=s.centerPointLabels?Rr/a:0;for(let u=0;ue.r&&(o=(n.end-e.r)/a,t.r=Math.max(t.r,e.r+o)),i.starte.b&&(u=(i.end-e.b)/s,t.b=Math.max(t.b,e.b+u))}function FV(t,e,r){const n=t.drawingArea,{extra:i,additionalAngle:a,padding:s,size:o}=r,u=t.getPointPosition(e,n+i+s,a),l=Math.round(B1(Ti(u.angle+en))),c=kV(u.y,o.h,l),f=PV(l),h=IV(u.x,o.w,f);return{visible:!0,x:u.x,y:c,textAlign:f,left:h,top:c,right:h+o.w,bottom:c+o.h}}function RV(t,e){if(!e)return!0;const{left:r,top:n,right:i,bottom:a}=t;return!(Ts({x:r,y:n},e)||Ts({x:r,y:a},e)||Ts({x:i,y:n},e)||Ts({x:i,y:a},e))}function BV(t,e,r){const n=[],i=t._pointLabels.length,a=t.options,{centerPointLabels:s,display:o}=a.pointLabels,u={extra:gb(a)/2,additionalAngle:s?Rr/i:0};let l;for(let c=0;c270||r<90)&&(t-=e),t}function LV(t,e,r){const{left:n,top:i,right:a,bottom:s}=r,{backdropColor:o}=e;if(!or(o)){const u=Cu(e.borderRadius),l=Wn(e.backdropPadding);t.fillStyle=o;const c=n-l.left,f=i-l.top,h=a-n+l.width,p=s-i+l.height;Object.values(u).some(v=>v!==0)?(t.beginPath(),Sh(t,{x:c,y:f,w:h,h:p,radius:u}),t.fill()):t.fillRect(c,f,h,p)}}function $V(t,e){const{ctx:r,options:{pointLabels:n}}=t;for(let i=e-1;i>=0;i--){const a=t._pointLabelItems[i];if(!a.visible)continue;const s=n.setContext(t.getPointLabelContext(i));LV(r,s,a);const o=pn(s.font),{x:u,y:l,textAlign:c}=a;Iu(r,t._pointLabels[i],u,l+o.lineHeight/2,o,{color:s.color,textAlign:c,textBaseline:"middle"})}}function qO(t,e,r,n){const{ctx:i}=t;if(r)i.arc(t.xCenter,t.yCenter,e,0,Fr);else{let a=t.getPointPosition(0,e);i.moveTo(a.x,a.y);for(let s=1;s{const i=Tr(this.options.pointLabels.callback,[r,n],this);return i||i===0?i:""}).filter((r,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?TV(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,r,n,i){this.xCenter+=Math.floor((e-r)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,r,n,i))}getIndexAngle(e){const r=Fr/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ti(e*r+ba(n))}getDistanceFromCenterForValue(e){if(or(e))return NaN;const r=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*r:(e-this.min)*r}getValueForDistanceFromCenter(e){if(or(e))return NaN;const r=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-r:this.min+r}getPointLabelContext(e){const r=this._pointLabels||[];if(e>=0&&e{if(f!==0||f===0&&this.min<0){u=this.getDistanceFromCenterForValue(c.value);const h=this.getContext(f),p=i.setContext(h),v=a.setContext(h);zV(this,p,u,s,v)}}),n.display){for(e.save(),o=s-1;o>=0;o--){const c=n.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:h}=c;!h||!f||(e.lineWidth=h,e.strokeStyle=f,e.setLineDash(c.borderDash),e.lineDashOffset=c.borderDashOffset,u=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,u),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,r=this.options,n=r.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let a,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((o,u)=>{if(u===0&&this.min>=0&&!r.reverse)return;const l=n.setContext(this.getContext(u)),c=pn(l.font);if(a=this.getDistanceFromCenterForValue(this.ticks[u].value),l.showLabelBackdrop){e.font=c.string,s=e.measureText(o.label).width,e.fillStyle=l.backdropColor;const f=Wn(l.backdropPadding);e.fillRect(-s/2-f.left,-a-c.size/2-f.top,s+f.width,c.size+f.height)}Iu(e,o.label,0,-a,c,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),e.restore()}drawTitle(){}}je(kl,"id","radialLinear"),je(kl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Xh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),je(kl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),je(kl,"descriptors",{angleLines:{_fallback:"grid"}});const Qv={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mi=Object.keys(Qv);function fD(t,e){return t-e}function hD(t,e){if(or(e))return null;const r=t._adapter,{parser:n,round:i,isoWeekday:a}=t._parseOpts;let s=e;return typeof n=="function"&&(s=n(s)),Vr(s)||(s=typeof n=="string"?r.parse(s,n):r.parse(s)),s===null?null:(i&&(s=i==="week"&&(tc(a)||a===!0)?r.startOf(s,"isoWeek",a):r.startOf(s,i)),+s)}function dD(t,e,r,n){const i=mi.length;for(let a=mi.indexOf(t);a=mi.indexOf(r);a--){const s=mi[a];if(Qv[s].common&&t._adapter.diff(i,n,s)>=e-1)return s}return mi[r?mi.indexOf(r):0]}function HV(t){for(let e=mi.indexOf(t)+1,r=mi.length;e=e?r[n]:r[i];t[a]=!0}}function WV(t,e,r,n){const i=t._adapter,a=+i.startOf(e[0].value,n),s=e[e.length-1].value;let o,u;for(o=a;o<=s;o=+i.add(o,1,n))u=r[o],u>=0&&(e[u].major=!0);return e}function mD(t,e,r){const n=[],i={},a=e.length;let s,o;for(s=0;s+e.value))}initOffsets(e=[]){let r=0,n=0,i,a;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?r=1-i:r=(this.getDecimalForValue(e[1])-i)/2,a=this.getDecimalForValue(e[e.length-1]),e.length===1?n=a:n=(a-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;r=wn(r,0,s),n=wn(n,0,s),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){const e=this._adapter,r=this.min,n=this.max,i=this.options,a=i.time,s=a.unit||dD(a.minUnit,r,n,this._getLabelCapacity(r)),o=Bt(i.ticks.stepSize,1),u=s==="week"?a.isoWeekday:!1,l=tc(u)||u===!0,c={};let f=r,h,p;if(l&&(f=+e.startOf(f,"isoWeek",u)),f=+e.startOf(f,l?"day":s),e.diff(n,r,s)>1e5*o)throw new Error(r+" and "+n+" are too far apart with stepSize of "+o+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h+m)}getLabelForValue(e){const r=this._adapter,n=this.options.time;return n.tooltipFormat?r.format(e,n.tooltipFormat):r.format(e,n.displayFormats.datetime)}format(e,r){const i=this.options.time.displayFormats,a=this._unit,s=r||i[a];return this._adapter.format(e,s)}_tickFormatFunction(e,r,n,i){const a=this.options,s=a.ticks.callback;if(s)return Tr(s,[e,r,n],this);const o=a.time.displayFormats,u=this._unit,l=this._majorUnit,c=u&&o[u],f=l&&o[l],h=n[r],p=l&&f&&h&&h.major;return this._adapter.format(e,i||(p?f:c))}generateTickLabels(e){let r,n,i;for(r=0,n=e.length;r0?o:1}getDataTimestamps(){let e=this._cache.data||[],r,n;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(r=0,n=i.length;r=t[n].pos&&e<=t[i].pos&&({lo:n,hi:i}=Ms(t,"pos",e)),{pos:a,time:o}=t[n],{pos:s,time:u}=t[i]):(e>=t[n].time&&e<=t[i].time&&({lo:n,hi:i}=Ms(t,"time",e)),{time:a,pos:o}=t[n],{time:s,pos:u}=t[i]);const l=s-a;return l?o+(u-o)*(e-a)/l:o}class Xm extends ic{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(e);this._minPos=Vp(r,this.min),this._tableRange=Vp(r,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:r,max:n}=this,i=[],a=[];let s,o,u,l,c;for(s=0,o=e.length;s=r&&l<=n&&i.push(l);if(i.length<2)return[{time:r,pos:0},{time:n,pos:1}];for(s=0,o=i.length;si-a)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const r=this.getDataTimestamps(),n=this.getLabelTimestamps();return r.length&&n.length?e=this.normalize(r.concat(n)):e=r.length?r:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Vp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const r=this._offsets,n=this.getDecimalForPixel(e)/r.factor-r.end;return Vp(this._table,n*this._tableRange+this._minPos,!0)}}je(Xm,"id","timeseries"),je(Xm,"defaults",ic.defaults);var HO=Object.freeze({__proto__:null,CategoryScale:Vm,LinearScale:jm,LogarithmicScale:Gm,RadialLinearScale:kl,TimeScale:ic,TimeSeriesScale:Xm});const VV=[lO,NO,UO,HO],WO=Object.freeze(Object.defineProperty({__proto__:null,Animation:sO,Animations:W1,ArcElement:Il,BarController:ah,BarElement:fh,BasePlatform:Y1,BasicPlatform:pO,BubbleController:sh,CategoryScale:Vm,Chart:yo,Colors:MO,DatasetController:ta,Decimation:OO,DomPlatform:gO,DoughnutController:No,Element:Za,Filler:BO,Interaction:fO,Legend:IO,LineController:oh,LineElement:Os,LinearScale:jm,LogarithmicScale:Gm,PieController:qm,PointElement:ch,PolarAreaController:Yl,RadarController:uh,RadialLinearScale:kl,Scale:qo,ScatterController:lh,SubTitle:LO,Ticks:Xh,TimeScale:ic,TimeSeriesScale:Xm,Title:kO,Tooltip:zO,_adapters:cO,_detectPlatform:yO,animator:Ha,controllers:lO,defaults:Ur,elements:NO,layouts:Mn,plugins:UO,registerables:VV,registry:va,scales:HO},Symbol.toStringTag,{value:"Module"}));var yb=function(t,e){return yb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},yb(t,e)};function sn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yb(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function YV(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(f){s(f)}}function u(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?a(c.value):i(c.value).then(o,u)}l((n=n.apply(t,e||[])).next())})}function X1(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function _r(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n1||o(h,p)})})}function o(h,p){try{u(n[h](p))}catch(v){f(a[0][3],v)}}function u(h){h.value instanceof jl?Promise.resolve(h.value.v).then(l,c):f(a[0][2],h)}function l(h){o("next",h)}function c(h){o("throw",h)}function f(h,p){h(p),a.shift(),a.length&&o(a[0][0],a[0][1])}}function GV(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof yi=="function"?yi(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,u){s=t[a](s),i(o,u,s.done,s.value)})}}function i(a,s,o,u){Promise.resolve(u).then(function(l){a({value:l,done:o})},s)}}function Ft(t){return typeof t=="function"}function Uu(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Am=Uu(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription: `+r.map(function(n,i){return i+1+") "+n.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=r}});function Us(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var wi=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,i,a;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=yi(s),u=o.next();!u.done;u=o.next()){var l=u.value;l.remove(this)}}catch(m){e={error:m}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}else s.remove(this);var c=this.initialTeardown;if(Ft(c))try{c()}catch(m){a=m instanceof Am?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=yi(f),p=h.next();!p.done;p=h.next()){var v=p.value;try{hD(v)}catch(m){a=a??[],m instanceof Am?a=Tr(Tr([],Mr(a)),Mr(m.errors)):a.push(m)}}}catch(m){n={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}if(a)throw new Am(a)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)hD(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&Us(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&Us(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),HO=wi.EMPTY;function WO(t){return t instanceof wi||t&&"closed"in t&&Ft(t.remove)&&Ft(t.add)&&Ft(t.unsubscribe)}function hD(t){Ft(t)?t():t.unsubscribe()}var Ho={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$1={setTimeout:function(t,e){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,s=i.isStopped,o=i.observers;return a||s?HO:(this.currentObservers=null,o.push(r),new wi(function(){n.currentObservers=null,Us(o,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,s=n.isStopped;i?r.error(a):s&&r.complete()},e.prototype.asObservable=function(){var r=new Kt;return r.source=this,r},e.create=function(r,n){return new pD(r,n)},e}(Kt),pD=function(t){sn(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:HO},e}(an),H1=function(t){sn(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(an),tg={now:function(){return(tg.delegate||Date).now()},delegate:void 0},rg=function(t){sn(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=tg);var a=t.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return e.prototype.next=function(r){var n=this,i=n.isStopped,a=n._buffer,s=n._infiniteTimeWindow,o=n._timestampProvider,u=n._windowTime;i||(a.push(r),!s&&a.push(o.now()+u)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,a=i._infiniteTimeWindow,s=i._buffer,o=s.slice(),u=0;u0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=yb.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var s=r.actions;n!=null&&((a=s[s.length-1])===null||a===void 0?void 0:a.id)!==n&&(yb.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e}(Kh),bb=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=tg.now,t}(),Jh=function(t){sn(e,t);function e(r,n){n===void 0&&(n=bb.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(bb),fY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(Jh),QO=new fY(cY),hY=QO,aa=new Jh(Kh),V1=aa,dY=function(t){sn(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.flush(this),0)},e}(Kh),pY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jh),eF=new pY(dY),mY=eF,vY=function(t){sn(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=sc.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var s=r.actions;n!=null&&((a=s[s.length-1])===null||a===void 0?void 0:a.id)!==n&&(sc.cancelAnimationFrame(n),r._scheduled=void 0)},e}(Kh),gY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(Jh),tF=new gY(vY),yY=tF,bY=function(t){sn(e,t);function e(r,n){r===void 0&&(r=rF),n===void 0&&(n=1/0);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,a,s;(s=n[0])&&s.delay<=i&&(n.shift(),this.frame=s.delay,!(a=s.execute(s.state,s.delay))););if(a){for(;s=n.shift();)s.unsubscribe();throw a}},e.frameTimeFactor=10,e}(Jh),rF=function(t){sn(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var a=t.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.index=i,a.active=!0,a.index=r.index=i,a}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}else return wi.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var a=r.actions;return a.push(this),a.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(Kh),Ka=new Kt(function(t){return t.complete()});function xY(t){return t?wY(t):Ka}function wY(t){return new Kt(function(e){return t.schedule(function(){return e.complete()})})}function ng(t){return t&&Ft(t.schedule)}function Y1(t){return t[t.length-1]}function Qh(t){return Ft(Y1(t))?t.pop():void 0}function Vs(t){return ng(Y1(t))?t.pop():void 0}function nF(t,e){return typeof Y1(t)=="number"?t.pop():e}var j1=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function iF(t){return Ft(t==null?void 0:t.then)}function aF(t){return Ft(t[Qv])}function sF(t){return Symbol.asyncIterator&&Ft(t==null?void 0:t[Symbol.asyncIterator])}function oF(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function SY(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var uF=SY();function lF(t){return Ft(t==null?void 0:t[uF])}function cF(t){return YV(this,arguments,function(){var r,n,i,a;return L1(this,function(s){switch(s.label){case 0:r=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,jl(r.read())];case 3:return n=s.sent(),i=n.value,a=n.done,a?[4,jl(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,jl(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function fF(t){return Ft(t==null?void 0:t.getReader)}function wt(t){if(t instanceof Kt)return t;if(t!=null){if(aF(t))return _Y(t);if(j1(t))return AY(t);if(iF(t))return DY(t);if(sF(t))return hF(t);if(lF(t))return NY(t);if(fF(t))return EY(t)}throw oF(t)}function _Y(t){return new Kt(function(e){var r=t[Qv]();if(Ft(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function AY(t){return new Kt(function(e){for(var r=0;r0&&y(i)},void 0,void 0,function(){v!=null&&v.closed||v==null||v.unsubscribe(),m=null})),!b&&y(n!=null?typeof n=="number"?n:+n-u.now():i)})}function IY(t){throw new xF(t)}function Hu(t,e){return rt(function(r,n){var i=0;r.subscribe(Ke(n,function(a){n.next(t.call(e,a,i++))}))})}var kY=Array.isArray;function LY(t,e){return kY(e)?t.apply(void 0,Tr([],Mr(e))):t(e)}function Wu(t){return Hu(function(e){return LY(t,e)})}function Km(t,e,r,n){if(r)if(ng(r))n=r;else return function(){for(var i=[],a=0;a=0?bi(l,a,p,s,!0):f=!0,p();var v=Ke(l,function(m){var b,y,S=c.slice();try{for(var x=yi(S),A=x.next();!A.done;A=x.next()){var _=A.value,w=_.buffer;w.push(m),o<=w.length&&h(_)}}catch(C){b={error:C}}finally{try{A&&!A.done&&(y=x.return)&&y.call(x)}finally{if(b)throw b.error}}},function(){for(;c!=null&&c.length;)l.next(c.shift().buffer);v==null||v.unsubscribe(),l.complete(),l.unsubscribe()},void 0,function(){return c=null});u.subscribe(v)})}function vj(t,e){return rt(function(r,n){var i=[];wt(t).subscribe(Ke(n,function(a){var s=[];i.push(s);var o=new wi,u=function(){Us(i,s),n.next(s),o.unsubscribe()};o.add(wt(e(a)).subscribe(Ke(n,u,nn)))},nn)),r.subscribe(Ke(n,function(a){var s,o;try{for(var u=yi(i),l=u.next();!l.done;l=u.next()){var c=l.value;c.push(a)}}catch(f){s={error:f}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(s)throw s.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}function gj(t){return rt(function(e,r){var n=null,i=null,a=function(){i==null||i.unsubscribe();var s=n;n=[],s&&r.next(s),wt(t()).subscribe(i=Ke(r,a,nn))};a(),e.subscribe(Ke(r,function(s){return n==null?void 0:n.push(s)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}function FF(t){return rt(function(e,r){var n=null,i=!1,a;n=e.subscribe(Ke(r,void 0,void 0,function(s){a=wt(t(s,FF(t)(e))),n?(n.unsubscribe(),n=null,a.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,a.subscribe(r))})}function RF(t,e,r,n,i){return function(a,s){var o=r,u=e,l=0;a.subscribe(Ke(s,function(c){var f=l++;u=o?t(u,c,f):(o=!0,c),n&&s.next(u)},i&&function(){o&&s.next(u),s.complete()}))}}function ed(t,e){return rt(RF(t,e,arguments.length>=2,!1,!0))}var yj=function(t,e){return t.push(e),t};function BF(){return rt(function(t,e){ed(yj,[])(t).subscribe(e)})}function PF(t,e){return U1(BF(),Da(function(r){return t(r)}),e?Wu(e):An)}function IF(t){return PF(AF,t)}var bj=IF;function kF(){for(var t=[],e=0;e=2;return function(n){return n.pipe(Iu(function(i,a){return a===t}),Nh(1),r?ug(e):lg(function(){return new wb}))}}function Ij(){for(var t=[],e=0;e=2;return function(n){return n.pipe(t?Iu(function(i,a){return t(i,a,n)}):An,Nh(1),r?ug(e):lg(function(){return new qu}))}}function Wj(t,e,r,n){return rt(function(i,a){var s;!e||typeof e=="function"?s=e:(r=e.duration,s=e.element,n=e.connector);var o=new Map,u=function(v){o.forEach(v),v(a)},l=function(v){return u(function(m){return m.error(v)})},c=0,f=!1,h=new q1(a,function(v){try{var m=t(v),b=o.get(m);if(!b){o.set(m,b=n?n():new an);var y=p(m,b);if(a.next(y),r){var S=Ke(b,function(){b.complete(),S==null||S.unsubscribe()},void 0,void 0,function(){return o.delete(m)});h.add(wt(r(y)).subscribe(S))}}b.next(s?s(v):v)}catch(x){l(x)}},function(){return u(function(v){return v.complete()})},l,function(){return o.clear()},function(){return f=!0,c===0});i.subscribe(h);function p(v,m){var b=new Kt(function(y){c++;var S=m.subscribe(y);return function(){S.unsubscribe(),--c===0&&f&&h.unsubscribe()}});return b.key=v,b}})}function Vj(){return rt(function(t,e){t.subscribe(Ke(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}function HF(t){return t<=0?function(){return Ka}:rt(function(e,r){var n=[];e.subscribe(Ke(r,function(i){n.push(i),t=2;return function(n){return n.pipe(t?Iu(function(i,a){return t(i,a,n)}):An,HF(1),r?ug(e):lg(function(){return new qu}))}}function jj(){return rt(function(t,e){t.subscribe(Ke(e,function(r){e.next(Nm.createNext(r))},function(){e.next(Nm.createComplete()),e.complete()},function(r){e.next(Nm.createError(r)),e.complete()}))})}function Gj(t){return ed(Ft(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}var Xj=Da;function Zj(t,e,r){return r===void 0&&(r=1/0),Ft(e)?Da(function(){return t},e,r):(typeof e=="number"&&(r=e),Da(function(){return t},r))}function Kj(t,e,r){return r===void 0&&(r=1/0),rt(function(n,i){var a=e;return Z1(n,i,function(s,o){return t(a,s,o)},r,function(s){a=s},!1,void 0,function(){return a=null})})}function Jj(){for(var t=[],e=0;e=2,!0))}function mG(t,e){return e===void 0&&(e=function(r,n){return r===n}),rt(function(r,n){var i=yD(),a=yD(),s=function(u){n.next(u),n.complete()},o=function(u,l){var c=Ke(n,function(f){var h=l.buffer,p=l.complete;h.length===0?p?s(!1):u.buffer.push(f):!e(f,h.shift())&&s(!1)},function(){u.complete=!0;var f=l.complete,h=l.buffer;f&&s(h.length===0),c==null||c.unsubscribe()});return c};r.subscribe(o(i,a)),wt(t).subscribe(o(a,i))})}function yD(){return{buffer:[],complete:!1}}function VF(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new an}:e,n=t.resetOnError,i=n===void 0?!0:n,a=t.resetOnComplete,s=a===void 0?!0:a,o=t.resetOnRefCountZero,u=o===void 0?!0:o;return function(l){var c,f,h,p=0,v=!1,m=!1,b=function(){f==null||f.unsubscribe(),f=void 0},y=function(){b(),c=h=void 0,v=m=!1},S=function(){var x=c;y(),x==null||x.unsubscribe()};return rt(function(x,A){p++,!m&&!v&&b();var _=h=h??r();A.add(function(){p--,p===0&&!m&&!v&&(f=Ty(S,u))}),_.subscribe(A),!c&&p>0&&(c=new ac({next:function(w){return _.next(w)},error:function(w){m=!0,b(),f=Ty(y,i,w),_.error(w)},complete:function(){v=!0,b(),f=Ty(y,s),_.complete()}}),wt(x).subscribe(c))})(l)}}function Ty(t,e){for(var r=[],n=2;n0?e:t;return rt(function(n,i){var a=[new an],s=[],o=0;i.next(a[0].asObservable()),n.subscribe(Ke(i,function(u){var l,c;try{for(var f=yi(a),h=f.next();!h.done;h=f.next()){var p=h.value;p.next(u)}}catch(b){l={error:b}}finally{try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}var v=o-t+1;if(v>=0&&v%r===0&&a.shift().complete(),++o%r===0){var m=new an;a.push(m),i.next(m.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(u){for(;a.length>0;)a.shift().error(u);i.error(u)},function(){s=null,a=null}))})}function IG(t){for(var e,r,n=[],i=1;i=0?bi(l,a,p,s,!0):f=!0,p();var v=function(b){return c.slice().forEach(b)},m=function(b){v(function(y){var S=y.window;return b(S)}),b(l),l.unsubscribe()};return u.subscribe(Ke(l,function(b){v(function(y){y.window.next(b),o<=++y.seen&&h(y)})},function(){return m(function(b){return b.complete()})},function(b){return m(function(y){return y.error(b)})})),function(){c=null}})}function kG(t,e){return rt(function(r,n){var i=[],a=function(s){for(;00},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,s=i.isStopped,o=i.observers;return a||s?VO:(this.currentObservers=null,o.push(r),new wi(function(){n.currentObservers=null,Us(o,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,s=n.isStopped;i?r.error(a):s&&r.complete()},e.prototype.asObservable=function(){var r=new Kt;return r.source=this,r},e.create=function(r,n){return new yD(r,n)},e}(Kt),yD=function(t){sn(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:VO},e}(an),Q1=function(t){sn(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(an),ng={now:function(){return(ng.delegate||Date).now()},delegate:void 0},ig=function(t){sn(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=ng);var a=t.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return e.prototype.next=function(r){var n=this,i=n.isStopped,a=n._buffer,s=n._infiniteTimeWindow,o=n._timestampProvider,u=n._windowTime;i||(a.push(r),!s&&a.push(o.now()+u)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,a=i._infiniteTimeWindow,s=i._buffer,o=s.slice(),u=0;u0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Jm.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var s=r.actions;n!=null&&((a=s[s.length-1])===null||a===void 0?void 0:a.id)!==n&&(Jm.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},e}(Kh),xb=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=ng.now,t}(),Jh=function(t){sn(e,t);function e(r,n){n===void 0&&(n=xb.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(xb),hY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(Jh),tF=new hY(fY),dY=tF,aa=new Jh(Kh),tx=aa,pY=function(t){sn(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.flush(this),0)},e}(Kh),mY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Jh),rF=new mY(pY),vY=rF,gY=function(t){sn(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Tu.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){var a;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);var s=r.actions;n!=null&&((a=s[s.length-1])===null||a===void 0?void 0:a.id)!==n&&(Tu.cancelAnimationFrame(n),r._scheduled=void 0)},e}(Kh),yY=function(t){sn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(Jh),nF=new yY(gY),bY=nF,xY=function(t){sn(e,t);function e(r,n){r===void 0&&(r=iF),n===void 0&&(n=1/0);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,a,s;(s=n[0])&&s.delay<=i&&(n.shift(),this.frame=s.delay,!(a=s.execute(s.state,s.delay))););if(a){for(;s=n.shift();)s.unsubscribe();throw a}},e.frameTimeFactor=10,e}(Jh),iF=function(t){sn(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var a=t.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.index=i,a.active=!0,a.index=r.index=i,a}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}else return wi.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var a=r.actions;return a.push(this),a.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(Kh),Ka=new Kt(function(t){return t.complete()});function wY(t){return t?SY(t):Ka}function SY(t){return new Kt(function(e){return t.schedule(function(){return e.complete()})})}function ag(t){return t&&Ft(t.schedule)}function rx(t){return t[t.length-1]}function Qh(t){return Ft(rx(t))?t.pop():void 0}function Vs(t){return ag(rx(t))?t.pop():void 0}function aF(t,e){return typeof rx(t)=="number"?t.pop():e}var nx=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function sF(t){return Ft(t==null?void 0:t.then)}function oF(t){return Ft(t[tg])}function uF(t){return Symbol.asyncIterator&&Ft(t==null?void 0:t[Symbol.asyncIterator])}function lF(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function _Y(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var cF=_Y();function fF(t){return Ft(t==null?void 0:t[cF])}function hF(t){return jV(this,arguments,function(){var r,n,i,a;return X1(this,function(s){switch(s.label){case 0:r=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,jl(r.read())];case 3:return n=s.sent(),i=n.value,a=n.done,a?[4,jl(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,jl(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function dF(t){return Ft(t==null?void 0:t.getReader)}function wt(t){if(t instanceof Kt)return t;if(t!=null){if(oF(t))return AY(t);if(nx(t))return DY(t);if(sF(t))return NY(t);if(uF(t))return pF(t);if(fF(t))return EY(t);if(dF(t))return CY(t)}throw lF(t)}function AY(t){return new Kt(function(e){var r=t[tg]();if(Ft(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function DY(t){return new Kt(function(e){for(var r=0;r0&&y(i)},void 0,void 0,function(){v!=null&&v.closed||v==null||v.unsubscribe(),m=null})),!b&&y(n!=null?typeof n=="number"?n:+n-u.now():i)})}function kY(t){throw new SF(t)}function Hu(t,e){return rt(function(r,n){var i=0;r.subscribe(Ke(n,function(a){n.next(t.call(e,a,i++))}))})}var LY=Array.isArray;function $Y(t,e){return LY(e)?t.apply(void 0,_r([],Sr(e))):t(e)}function Wu(t){return Hu(function(e){return $Y(t,e)})}function Qm(t,e,r,n){if(r)if(ag(r))n=r;else return function(){for(var i=[],a=0;a=0?bi(l,a,p,s,!0):f=!0,p();var v=Ke(l,function(m){var b,y,S=c.slice();try{for(var x=yi(S),A=x.next();!A.done;A=x.next()){var _=A.value,w=_.buffer;w.push(m),o<=w.length&&h(_)}}catch(C){b={error:C}}finally{try{A&&!A.done&&(y=x.return)&&y.call(x)}finally{if(b)throw b.error}}},function(){for(;c!=null&&c.length;)l.next(c.shift().buffer);v==null||v.unsubscribe(),l.complete(),l.unsubscribe()},void 0,function(){return c=null});u.subscribe(v)})}function gj(t,e){return rt(function(r,n){var i=[];wt(t).subscribe(Ke(n,function(a){var s=[];i.push(s);var o=new wi,u=function(){Us(i,s),n.next(s),o.unsubscribe()};o.add(wt(e(a)).subscribe(Ke(n,u,nn)))},nn)),r.subscribe(Ke(n,function(a){var s,o;try{for(var u=yi(i),l=u.next();!l.done;l=u.next()){var c=l.value;c.push(a)}}catch(f){s={error:f}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(s)throw s.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}function yj(t){return rt(function(e,r){var n=null,i=null,a=function(){i==null||i.unsubscribe();var s=n;n=[],s&&r.next(s),wt(t()).subscribe(i=Ke(r,a,nn))};a(),e.subscribe(Ke(r,function(s){return n==null?void 0:n.push(s)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}function BF(t){return rt(function(e,r){var n=null,i=!1,a;n=e.subscribe(Ke(r,void 0,void 0,function(s){a=wt(t(s,BF(t)(e))),n?(n.unsubscribe(),n=null,a.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,a.subscribe(r))})}function PF(t,e,r,n,i){return function(a,s){var o=r,u=e,l=0;a.subscribe(Ke(s,function(c){var f=l++;u=o?t(u,c,f):(o=!0,c),n&&s.next(u)},i&&function(){o&&s.next(u),s.complete()}))}}function ed(t,e){return rt(PF(t,e,arguments.length>=2,!1,!0))}var bj=function(t,e){return t.push(e),t};function IF(){return rt(function(t,e){ed(bj,[])(t).subscribe(e)})}function kF(t,e){return K1(IF(),Da(function(r){return t(r)}),e?Wu(e):An)}function LF(t){return kF(NF,t)}var xj=LF;function $F(){for(var t=[],e=0;e=2;return function(n){return n.pipe(ku(function(i,a){return a===t}),Nh(1),r?cg(e):fg(function(){return new Sb}))}}function kj(){for(var t=[],e=0;e=2;return function(n){return n.pipe(t?ku(function(i,a){return t(i,a,n)}):An,Nh(1),r?cg(e):fg(function(){return new qu}))}}function Vj(t,e,r,n){return rt(function(i,a){var s;!e||typeof e=="function"?s=e:(r=e.duration,s=e.element,n=e.connector);var o=new Map,u=function(v){o.forEach(v),v(a)},l=function(v){return u(function(m){return m.error(v)})},c=0,f=!1,h=new J1(a,function(v){try{var m=t(v),b=o.get(m);if(!b){o.set(m,b=n?n():new an);var y=p(m,b);if(a.next(y),r){var S=Ke(b,function(){b.complete(),S==null||S.unsubscribe()},void 0,void 0,function(){return o.delete(m)});h.add(wt(r(y)).subscribe(S))}}b.next(s?s(v):v)}catch(x){l(x)}},function(){return u(function(v){return v.complete()})},l,function(){return o.clear()},function(){return f=!0,c===0});i.subscribe(h);function p(v,m){var b=new Kt(function(y){c++;var S=m.subscribe(y);return function(){S.unsubscribe(),--c===0&&f&&h.unsubscribe()}});return b.key=v,b}})}function Yj(){return rt(function(t,e){t.subscribe(Ke(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}function VF(t){return t<=0?function(){return Ka}:rt(function(e,r){var n=[];e.subscribe(Ke(r,function(i){n.push(i),t=2;return function(n){return n.pipe(t?ku(function(i,a){return t(i,a,n)}):An,VF(1),r?cg(e):fg(function(){return new qu}))}}function Gj(){return rt(function(t,e){t.subscribe(Ke(e,function(r){e.next(Nm.createNext(r))},function(){e.next(Nm.createComplete()),e.complete()},function(r){e.next(Nm.createError(r)),e.complete()}))})}function Xj(t){return ed(Ft(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}var Zj=Da;function Kj(t,e,r){return r===void 0&&(r=1/0),Ft(e)?Da(function(){return t},e,r):(typeof e=="number"&&(r=e),Da(function(){return t},r))}function Jj(t,e,r){return r===void 0&&(r=1/0),rt(function(n,i){var a=e;return sx(n,i,function(s,o){return t(a,s,o)},r,function(s){a=s},!1,void 0,function(){return a=null})})}function Qj(){for(var t=[],e=0;e=2,!0))}function vG(t,e){return e===void 0&&(e=function(r,n){return r===n}),rt(function(r,n){var i=SD(),a=SD(),s=function(u){n.next(u),n.complete()},o=function(u,l){var c=Ke(n,function(f){var h=l.buffer,p=l.complete;h.length===0?p?s(!1):u.buffer.push(f):!e(f,h.shift())&&s(!1)},function(){u.complete=!0;var f=l.complete,h=l.buffer;f&&s(h.length===0),c==null||c.unsubscribe()});return c};r.subscribe(o(i,a)),wt(t).subscribe(o(a,i))})}function SD(){return{buffer:[],complete:!1}}function jF(t){t===void 0&&(t={});var e=t.connector,r=e===void 0?function(){return new an}:e,n=t.resetOnError,i=n===void 0?!0:n,a=t.resetOnComplete,s=a===void 0?!0:a,o=t.resetOnRefCountZero,u=o===void 0?!0:o;return function(l){var c,f,h,p=0,v=!1,m=!1,b=function(){f==null||f.unsubscribe(),f=void 0},y=function(){b(),c=h=void 0,v=m=!1},S=function(){var x=c;y(),x==null||x.unsubscribe()};return rt(function(x,A){p++,!m&&!v&&b();var _=h=h??r();A.add(function(){p--,p===0&&!m&&!v&&(f=Fy(S,u))}),_.subscribe(A),!c&&p>0&&(c=new ac({next:function(w){return _.next(w)},error:function(w){m=!0,b(),f=Fy(y,i,w),_.error(w)},complete:function(){v=!0,b(),f=Fy(y,s),_.complete()}}),wt(x).subscribe(c))})(l)}}function Fy(t,e){for(var r=[],n=2;n0?e:t;return rt(function(n,i){var a=[new an],s=[],o=0;i.next(a[0].asObservable()),n.subscribe(Ke(i,function(u){var l,c;try{for(var f=yi(a),h=f.next();!h.done;h=f.next()){var p=h.value;p.next(u)}}catch(b){l={error:b}}finally{try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}var v=o-t+1;if(v>=0&&v%r===0&&a.shift().complete(),++o%r===0){var m=new an;a.push(m),i.next(m.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(u){for(;a.length>0;)a.shift().error(u);i.error(u)},function(){s=null,a=null}))})}function kG(t){for(var e,r,n=[],i=1;i=0?bi(l,a,p,s,!0):f=!0,p();var v=function(b){return c.slice().forEach(b)},m=function(b){v(function(y){var S=y.window;return b(S)}),b(l),l.unsubscribe()};return u.subscribe(Ke(l,function(b){v(function(y){y.window.next(b),o<=++y.seen&&h(y)})},function(){return m(function(b){return b.complete()})},function(b){return m(function(y){return y.error(b)})})),function(){c=null}})}function LG(t,e){return rt(function(r,n){var i=[],a=function(s){for(;0>>0,n;for(n=0;n0)for(r=0;r>>0,n;for(n=0;n0)for(r=0;r=0;return(a?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var ox=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,jp=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Fy={},Gl={};function ft(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(Gl[t]=i),e&&(Gl[e[0]]=function(){return ja(i.apply(this,arguments),e[1],e[2])}),r&&(Gl[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function XG(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function ZG(t){var e=t.match(ox),r,n;for(r=0,n=e.length;r=0&&jp.test(t);)t=t.replace(jp,n),jp.lastIndex=0,r-=1;return t}var KG={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function JG(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(ox).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var QG="Invalid date";function eX(){return this._invalidDate}var tX="%d",rX=/\d{1,2}/;function nX(t){return this._ordinal.replace("%d",t)}var iX={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function aX(t,e,r,n){var i=this._relativeTime[r];return Qa(i)?i(t,e,r,n):i.replace(/%d/i,t)}function sX(t,e){var r=this._relativeTime[t>0?"future":"past"];return Qa(r)?r(e):r.replace(/%s/i,e)}var wD={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function oa(t){return typeof t=="string"?wD[t]||wD[t.toLowerCase()]:void 0}function ux(t){var e={},r,n;for(n in t)ur(t,n)&&(r=oa(n),r&&(e[r]=t[n]));return e}var oX={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function uX(t){var e=[],r;for(r in t)ur(t,r)&&e.push({unit:r,priority:oX[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}var JF=/\d/,Ri=/\d\d/,QF=/\d{3}/,lx=/\d{4}/,fg=/[+-]?\d{6}/,Pr=/\d\d?/,e3=/\d\d\d\d?/,t3=/\d\d\d\d\d\d?/,hg=/\d{1,3}/,cx=/\d{1,4}/,dg=/[+-]?\d{1,6}/,_c=/\d+/,pg=/[+-]?\d+/,lX=/Z|[+-]\d\d:?\d\d/gi,mg=/Z|[+-]\d\d(?::?\d\d)?/gi,cX=/[+-]?\d+(\.\d{1,3})?/,nd=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ac=/^[1-9]\d?/,fx=/^([1-9]\d|\d)/,Qm;Qm={};function it(t,e,r){Qm[t]=Qa(e)?e:function(n,i){return n&&r?r:e}}function fX(t,e){return ur(Qm,t)?Qm[t](e._strict,e._locale):new RegExp(hX(t))}function hX(t){return ks(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,a){return r||n||i||a}))}function ks(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Gi(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Xt(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=Gi(e)),r}var Nb={};function Sr(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),qs(e)&&(n=function(a,s){s[e]=Xt(a)}),i=t.length,r=0;r68?1900:2e3)};var r3=Dc("FullYear",!0);function vX(){return vg(this.year())}function Dc(t,e){return function(r){return r!=null?(n3(this,t,r),Qe.updateOffset(this,e),this):Ch(this,t)}}function Ch(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function n3(t,e,r){var n,i,a,s,o;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}a=r,s=t.month(),o=t.date(),o=o===29&&s===1&&!vg(a)?28:o,i?n.setUTCFullYear(a,s,o):n.setFullYear(a,s,o)}}function gX(t){return t=oa(t),Qa(this[t])?this[t]():this}function yX(t,e){if(typeof t=="object"){t=ux(t);var r=uX(t),n,i=r.length;for(n=0;n=0?(o=new Date(t+400,e,r,n,i,a,s),isFinite(o.getFullYear())&&o.setFullYear(t)):o=new Date(t,e,r,n,i,a,s),o}function Mh(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function ev(t,e,r){var n=7+e-r,i=(7+Mh(t,0,n).getUTCDay()-e)%7;return-i+n-1}function l3(t,e,r,n,i){var a=(7+r-n)%7,s=ev(t,n,i),o=1+7*(e-1)+a+s,u,l;return o<=0?(u=t-1,l=dh(u)+o):o>dh(t)?(u=t+1,l=o-dh(t)):(u=t,l=o),{year:u,dayOfYear:l}}function Th(t,e,r){var n=ev(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,a,s;return i<1?(s=t.year()-1,a=i+Ls(s,e,r)):i>Ls(t.year(),e,r)?(a=i-Ls(t.year(),e,r),s=t.year()+1):(s=t.year(),a=i),{week:a,year:s}}function Ls(t,e,r){var n=ev(t,e,r),i=ev(t+1,e,r);return(dh(t)-n+i)/7}ft("w",["ww",2],"wo","week");ft("W",["WW",2],"Wo","isoWeek");it("w",Pr,Ac);it("ww",Pr,Ri);it("W",Pr,Ac);it("WW",Pr,Ri);id(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=Xt(t)});function OX(t){return Th(t,this._week.dow,this._week.doy).week}var FX={dow:0,doy:6};function RX(){return this._week.dow}function BX(){return this._week.doy}function PX(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function IX(t){var e=Th(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}ft("d",0,"do","day");ft("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});ft("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});ft("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});ft("e",0,0,"weekday");ft("E",0,0,"isoWeekday");it("d",Pr);it("e",Pr);it("E",Pr);it("dd",function(t,e){return e.weekdaysMinRegex(t)});it("ddd",function(t,e){return e.weekdaysShortRegex(t)});it("dddd",function(t,e){return e.weekdaysRegex(t)});id(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:Lt(r).invalidWeekday=t});id(["d","e","E"],function(t,e,r,n){e[n]=Xt(t)});function kX(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function LX(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function dx(t,e){return t.slice(e,7).concat(t.slice(0,e))}var $X="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),c3="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),zX="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),UX=nd,qX=nd,HX=nd;function WX(t,e){var r=Na(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?dx(r,this._week.dow):t?r[t.day()]:r}function VX(t){return t===!0?dx(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function YX(t){return t===!0?dx(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function jX(t,e,r){var n,i,a,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=Ja([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();return r?e==="dddd"?(i=Qr.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Qr.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Qr.call(this._weekdaysParse,s),i!==-1||(i=Qr.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Qr.call(this._shortWeekdaysParse,s),i!==-1||(i=Qr.call(this._weekdaysParse,s),i!==-1)?i:(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Qr.call(this._minWeekdaysParse,s),i!==-1||(i=Qr.call(this._weekdaysParse,s),i!==-1)?i:(i=Qr.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function GX(t,e,r){var n,i,a;if(this._weekdaysParseExact)return jX.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Ja([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function XX(t){if(!this.isValid())return t!=null?this:NaN;var e=Ch(this,"Day");return t!=null?(t=kX(t,this.localeData()),this.add(t-e,"d")):e}function ZX(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function KX(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=LX(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function JX(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||px.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ur(this,"_weekdaysRegex")||(this._weekdaysRegex=UX),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function QX(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||px.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ur(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qX),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function eZ(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||px.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ur(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=HX),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function px(){function t(c,f){return f.length-c.length}var e=[],r=[],n=[],i=[],a,s,o,u,l;for(a=0;a<7;a++)s=Ja([2e3,1]).day(a),o=ks(this.weekdaysMin(s,"")),u=ks(this.weekdaysShort(s,"")),l=ks(this.weekdays(s,"")),e.push(o),r.push(u),n.push(l),i.push(o),i.push(u),i.push(l);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function mx(){return this.hours()%12||12}function tZ(){return this.hours()||24}ft("H",["HH",2],0,"hour");ft("h",["hh",2],0,mx);ft("k",["kk",2],0,tZ);ft("hmm",0,0,function(){return""+mx.apply(this)+ja(this.minutes(),2)});ft("hmmss",0,0,function(){return""+mx.apply(this)+ja(this.minutes(),2)+ja(this.seconds(),2)});ft("Hmm",0,0,function(){return""+this.hours()+ja(this.minutes(),2)});ft("Hmmss",0,0,function(){return""+this.hours()+ja(this.minutes(),2)+ja(this.seconds(),2)});function f3(t,e){ft(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}f3("a",!0);f3("A",!1);function h3(t,e){return e._meridiemParse}it("a",h3);it("A",h3);it("H",Pr,fx);it("h",Pr,Ac);it("k",Pr,Ac);it("HH",Pr,Ri);it("hh",Pr,Ri);it("kk",Pr,Ri);it("hmm",e3);it("hmmss",t3);it("Hmm",e3);it("Hmmss",t3);Sr(["H","HH"],mn);Sr(["k","kk"],function(t,e,r){var n=Xt(t);e[mn]=n===24?0:n});Sr(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t});Sr(["h","hh"],function(t,e,r){e[mn]=Xt(t),Lt(r).bigHour=!0});Sr("hmm",function(t,e,r){var n=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n)),Lt(r).bigHour=!0});Sr("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n,2)),e[Rs]=Xt(t.substr(i)),Lt(r).bigHour=!0});Sr("Hmm",function(t,e,r){var n=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n))});Sr("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n,2)),e[Rs]=Xt(t.substr(i))});function rZ(t){return(t+"").toLowerCase().charAt(0)==="p"}var nZ=/[ap]\.?m?\.?/i,iZ=Dc("Hours",!0);function aZ(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var d3={calendar:jG,longDateFormat:KG,invalidDate:QG,ordinal:tX,dayOfMonthOrdinalParse:rX,relativeTime:iX,months:xX,monthsShort:i3,week:FX,weekdays:$X,weekdaysMin:zX,weekdaysShort:c3,meridiemParse:nZ},Ir={},qf={},Oh;function sZ(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r0;){if(i=gg(a.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&sZ(a,n)>=r-1)break;r--}e++}return Oh}function uZ(t){return!!(t&&t.match("^[^/\\\\]*$"))}function gg(t){var e=null,r;if(Ir[t]===void 0&&typeof module<"u"&&module&&module.exports&&uZ(t))try{e=Oh._abbr,r=require,r("./locale/"+t),Ro(e)}catch{Ir[t]=null}return Ir[t]}function Ro(t,e){var r;return t&&(pi(e)?r=js(t):r=vx(t,e),r?Oh=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Oh._abbr}function vx(t,e){if(e!==null){var r,n=d3;if(e.abbr=t,Ir[t]!=null)ZF("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ir[t]._config;else if(e.parentLocale!=null)if(Ir[e.parentLocale]!=null)n=Ir[e.parentLocale]._config;else if(r=gg(e.parentLocale),r!=null)n=r._config;else return qf[e.parentLocale]||(qf[e.parentLocale]=[]),qf[e.parentLocale].push({name:t,config:e}),null;return Ir[t]=new sx(Ab(n,e)),qf[t]&&qf[t].forEach(function(i){vx(i.name,i.config)}),Ro(t),Ir[t]}else return delete Ir[t],null}function lZ(t,e){if(e!=null){var r,n,i=d3;Ir[t]!=null&&Ir[t].parentLocale!=null?Ir[t].set(Ab(Ir[t]._config,e)):(n=gg(t),n!=null&&(i=n._config),e=Ab(i,e),n==null&&(e.abbr=t),r=new sx(e),r.parentLocale=Ir[t],Ir[t]=r),Ro(t)}else Ir[t]!=null&&(Ir[t].parentLocale!=null?(Ir[t]=Ir[t].parentLocale,t===Ro()&&Ro(t)):Ir[t]!=null&&delete Ir[t]);return Ir[t]}function js(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Oh;if(!Na(t)){if(e=gg(t),e)return e;t=[t]}return oZ(t)}function cZ(){return Db(Ir)}function gx(t){var e,r=t._a;return r&&Lt(t).overflow===-2&&(e=r[Fs]<0||r[Fs]>11?Fs:r[Wa]<1||r[Wa]>hx(r[zn],r[Fs])?Wa:r[mn]<0||r[mn]>24||r[mn]===24&&(r[xa]!==0||r[Rs]!==0||r[Au]!==0)?mn:r[xa]<0||r[xa]>59?xa:r[Rs]<0||r[Rs]>59?Rs:r[Au]<0||r[Au]>999?Au:-1,Lt(t)._overflowDayOfYear&&(eWa)&&(e=Wa),Lt(t)._overflowWeeks&&e===-1&&(e=pX),Lt(t)._overflowWeekday&&e===-1&&(e=mX),Lt(t).overflow=e),t}var fZ=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,hZ=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dZ=/Z|[+-]\d\d(?::?\d\d)?/,Gp=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Ry=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pZ=/^\/?Date\((-?\d+)/i,mZ=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vZ={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function p3(t){var e,r,n=t._i,i=fZ.exec(n)||hZ.exec(n),a,s,o,u,l=Gp.length,c=Ry.length;if(i){for(Lt(t).iso=!0,e=0,r=l;edh(s)||t._dayOfYear===0)&&(Lt(t)._overflowDayOfYear=!0),r=Mh(s,0,t._dayOfYear),t._a[Fs]=r.getUTCMonth(),t._a[Wa]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[mn]===24&&t._a[xa]===0&&t._a[Rs]===0&&t._a[Au]===0&&(t._nextDay=!0,t._a[mn]=0),t._d=(t._useUTC?Mh:TX).apply(null,n),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[mn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==a&&(Lt(t).weekdayMismatch=!0)}}function AZ(t){var e,r,n,i,a,s,o,u,l;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(a=1,s=4,r=Bl(e.GG,t._a[zn],Th(Br(),1,4).year),n=Bl(e.W,1),i=Bl(e.E,1),(i<1||i>7)&&(u=!0)):(a=t._locale._week.dow,s=t._locale._week.doy,l=Th(Br(),a,s),r=Bl(e.gg,t._a[zn],l.year),n=Bl(e.w,l.week),e.d!=null?(i=e.d,(i<0||i>6)&&(u=!0)):e.e!=null?(i=e.e+a,(e.e<0||e.e>6)&&(u=!0)):i=a),n<1||n>Ls(r,a,s)?Lt(t)._overflowWeeks=!0:u!=null?Lt(t)._overflowWeekday=!0:(o=l3(r,n,i,a,s),t._a[zn]=o.year,t._dayOfYear=o.dayOfYear)}Qe.ISO_8601=function(){};Qe.RFC_2822=function(){};function bx(t){if(t._f===Qe.ISO_8601){p3(t);return}if(t._f===Qe.RFC_2822){m3(t);return}t._a=[],Lt(t).empty=!0;var e=""+t._i,r,n,i,a,s,o=e.length,u=0,l,c;for(i=KF(t._f,t._locale).match(ox)||[],c=i.length,r=0;r0&&Lt(t).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),u+=n.length),Gl[a]?(n?Lt(t).empty=!1:Lt(t).unusedTokens.push(a),dX(a,n,t)):t._strict&&!n&&Lt(t).unusedTokens.push(a);Lt(t).charsLeftOver=o-u,e.length>0&&Lt(t).unusedInput.push(e),t._a[mn]<=12&&Lt(t).bigHour===!0&&t._a[mn]>0&&(Lt(t).bigHour=void 0),Lt(t).parsedDateParts=t._a.slice(0),Lt(t).meridiem=t._meridiem,t._a[mn]=DZ(t._locale,t._a[mn],t._meridiem),l=Lt(t).era,l!==null&&(t._a[zn]=t._locale.erasConvertYear(l,t._a[zn])),yx(t),gx(t)}function DZ(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function NZ(t){var e,r,n,i,a,s,o=!1,u=t._f.length;if(u===0){Lt(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;ithis?this:t:cg()});function y3(t,e){var r,n;if(e.length===1&&Na(e[0])&&(e=e[0]),!e.length)return Br();for(r=e[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function jZ(){if(!pi(this._isDSTShifted))return this._isDSTShifted;var t={},e;return ax(t,this),t=v3(t),t._a?(e=t._isUTC?Ja(t._a):Br(t._a),this._isDSTShifted=this.isValid()&&LZ(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function GZ(){return this.isValid()?!this._isUTC:!1}function XZ(){return this.isValid()?this._isUTC:!1}function x3(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ZZ=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,KZ=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ca(t,e){var r=t,n=null,i,a,s;return Cm(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:qs(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=ZZ.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:Xt(n[Wa])*i,h:Xt(n[mn])*i,m:Xt(n[xa])*i,s:Xt(n[Rs])*i,ms:Xt(Eb(n[Au]*1e3))*i}):(n=KZ.exec(t))?(i=n[1]==="-"?-1:1,r={y:yu(n[2],i),M:yu(n[3],i),w:yu(n[4],i),d:yu(n[5],i),h:yu(n[6],i),m:yu(n[7],i),s:yu(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(s=JZ(Br(r.from),Br(r.to)),r={},r.ms=s.milliseconds,r.M=s.months),a=new yg(r),Cm(t)&&ur(t,"_locale")&&(a._locale=t._locale),Cm(t)&&ur(t,"_isValid")&&(a._isValid=t._isValid),a}Ca.fn=yg.prototype;Ca.invalid=kZ;function yu(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function _D(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function JZ(t,e){var r;return t.isValid()&&e.isValid()?(e=wx(e,t),t.isBefore(e)?r=_D(t,e):(r=_D(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function w3(t,e){return function(r,n){var i,a;return n!==null&&!isNaN(+n)&&(ZF(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),i=Ca(r,n),S3(this,i,t),this}}function S3(t,e,r,n){var i=e._milliseconds,a=Eb(e._days),s=Eb(e._months);t.isValid()&&(n=n??!0,s&&s3(t,Ch(t,"Month")+s*r),a&&n3(t,"Date",Ch(t,"Date")+a*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&Qe.updateOffset(t,a||s))}var QZ=w3(1,"add"),eK=w3(-1,"subtract");function _3(t){return typeof t=="string"||t instanceof String}function tK(t){return Ea(t)||td(t)||_3(t)||qs(t)||nK(t)||rK(t)||t===null||t===void 0}function rK(t){var e=Tu(t)&&!nx(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,s=n.length;for(i=0;ir.valueOf():r.valueOf()9999?Em(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Qa(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Em(r,"Z")):Em(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function gK(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,a;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=e+'[")]',this.format(r+n+i+a)}function yK(t){t||(t=this.isUtc()?Qe.defaultFormatUtc:Qe.defaultFormat);var e=Em(this,t);return this.localeData().postformat(e)}function bK(t,e){return this.isValid()&&(Ea(t)&&t.isValid()||Br(t).isValid())?Ca({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function xK(t){return this.from(Br(),t)}function wK(t,e){return this.isValid()&&(Ea(t)&&t.isValid()||Br(t).isValid())?Ca({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function SK(t){return this.to(Br(),t)}function A3(t){var e;return t===void 0?this._locale._abbr:(e=js(t),e!=null&&(this._locale=e),this)}var D3=sa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function N3(){return this._locale}var tv=1e3,Xl=60*tv,rv=60*Xl,E3=(365*400+97)*24*rv;function Zl(t,e){return(t%e+e)%e}function C3(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-E3:new Date(t,e,r).valueOf()}function M3(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-E3:Date.UTC(t,e,r)}function _K(t){var e,r;if(t=oa(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?M3:C3,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Zl(e+(this._isUTC?0:this.utcOffset()*Xl),rv);break;case"minute":e=this._d.valueOf(),e-=Zl(e,Xl);break;case"second":e=this._d.valueOf(),e-=Zl(e,tv);break}return this._d.setTime(e),Qe.updateOffset(this,!0),this}function AK(t){var e,r;if(t=oa(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?M3:C3,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=rv-Zl(e+(this._isUTC?0:this.utcOffset()*Xl),rv)-1;break;case"minute":e=this._d.valueOf(),e+=Xl-Zl(e,Xl)-1;break;case"second":e=this._d.valueOf(),e+=tv-Zl(e,tv)-1;break}return this._d.setTime(e),Qe.updateOffset(this,!0),this}function DK(){return this._d.valueOf()-(this._offset||0)*6e4}function NK(){return Math.floor(this.valueOf()/1e3)}function EK(){return new Date(this.valueOf())}function CK(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function MK(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function TK(){return this.isValid()?this.toISOString():null}function OK(){return ix(this)}function FK(){return Co({},Lt(this))}function RK(){return Lt(this).overflow}function BK(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ft("N",0,0,"eraAbbr");ft("NN",0,0,"eraAbbr");ft("NNN",0,0,"eraAbbr");ft("NNNN",0,0,"eraName");ft("NNNNN",0,0,"eraNarrow");ft("y",["y",1],"yo","eraYear");ft("y",["yy",2],0,"eraYear");ft("y",["yyy",3],0,"eraYear");ft("y",["yyyy",4],0,"eraYear");it("N",Sx);it("NN",Sx);it("NNN",Sx);it("NNNN",VK);it("NNNNN",YK);Sr(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?Lt(r).era=i:Lt(r).invalidEra=t});it("y",_c);it("yy",_c);it("yyy",_c);it("yyyy",_c);it("yo",jK);Sr(["y","yy","yyy","yyyy"],zn);Sr(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[zn]=r._locale.eraYearOrdinalParse(t,i):e[zn]=parseInt(t,10)});function PK(t,e){var r,n,i,a=this._eras||js("en")._eras;for(r=0,n=a.length;r=0)return a[n]}function kK(t,e){var r=t.since<=t.until?1:-1;return e===void 0?Qe(t.since).year():Qe(t.since).year()+(e-t.offset)*r}function LK(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;ta&&(e=a),eJ.call(this,t,e,r,n,i))}function eJ(t,e,r,n,i){var a=l3(t,e,r,n,i),s=Mh(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}ft("Q",0,"Qo","quarter");it("Q",JF);Sr("Q",function(t,e){e[Fs]=(Xt(t)-1)*3});function tJ(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}ft("D",["DD",2],"Do","date");it("D",Pr,Ac);it("DD",Pr,Ri);it("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Sr(["D","DD"],Wa);Sr("Do",function(t,e){e[Wa]=Xt(t.match(Pr)[0])});var O3=Dc("Date",!0);ft("DDD",["DDDD",3],"DDDo","dayOfYear");it("DDD",hg);it("DDDD",QF);Sr(["DDD","DDDD"],function(t,e,r){r._dayOfYear=Xt(t)});function rJ(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}ft("m",["mm",2],0,"minute");it("m",Pr,fx);it("mm",Pr,Ri);Sr(["m","mm"],xa);var nJ=Dc("Minutes",!1);ft("s",["ss",2],0,"second");it("s",Pr,fx);it("ss",Pr,Ri);Sr(["s","ss"],Rs);var iJ=Dc("Seconds",!1);ft("S",0,0,function(){return~~(this.millisecond()/100)});ft(0,["SS",2],0,function(){return~~(this.millisecond()/10)});ft(0,["SSS",3],0,"millisecond");ft(0,["SSSS",4],0,function(){return this.millisecond()*10});ft(0,["SSSSS",5],0,function(){return this.millisecond()*100});ft(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});ft(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});ft(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});ft(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});it("S",hg,JF);it("SS",hg,Ri);it("SSS",hg,QF);var Mo,F3;for(Mo="SSSS";Mo.length<=9;Mo+="S")it(Mo,_c);function aJ(t,e){e[Au]=Xt(("0."+t)*1e3)}for(Mo="S";Mo.length<=9;Mo+="S")Sr(Mo,aJ);F3=Dc("Milliseconds",!1);ft("z",0,0,"zoneAbbr");ft("zz",0,0,"zoneName");function sJ(){return this._isUTC?"UTC":""}function oJ(){return this._isUTC?"Coordinated Universal Time":""}var Xe=rd.prototype;Xe.add=QZ;Xe.calendar=sK;Xe.clone=oK;Xe.diff=pK;Xe.endOf=AK;Xe.format=yK;Xe.from=bK;Xe.fromNow=xK;Xe.to=wK;Xe.toNow=SK;Xe.get=gX;Xe.invalidAt=RK;Xe.isAfter=uK;Xe.isBefore=lK;Xe.isBetween=cK;Xe.isSame=fK;Xe.isSameOrAfter=hK;Xe.isSameOrBefore=dK;Xe.isValid=OK;Xe.lang=D3;Xe.locale=A3;Xe.localeData=N3;Xe.max=OZ;Xe.min=TZ;Xe.parsingFlags=FK;Xe.set=yX;Xe.startOf=_K;Xe.subtract=eK;Xe.toArray=CK;Xe.toObject=MK;Xe.toDate=EK;Xe.toISOString=vK;Xe.inspect=gK;typeof Symbol<"u"&&Symbol.for!=null&&(Xe[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Xe.toJSON=TK;Xe.toString=mK;Xe.unix=NK;Xe.valueOf=DK;Xe.creationData=BK;Xe.eraName=LK;Xe.eraNarrow=$K;Xe.eraAbbr=zK;Xe.eraYear=UK;Xe.year=r3;Xe.isLeapYear=vX;Xe.weekYear=GK;Xe.isoWeekYear=XK;Xe.quarter=Xe.quarters=tJ;Xe.month=o3;Xe.daysInMonth=EX;Xe.week=Xe.weeks=PX;Xe.isoWeek=Xe.isoWeeks=IX;Xe.weeksInYear=JK;Xe.weeksInWeekYear=QK;Xe.isoWeeksInYear=ZK;Xe.isoWeeksInISOWeekYear=KK;Xe.date=O3;Xe.day=Xe.days=XX;Xe.weekday=ZX;Xe.isoWeekday=KX;Xe.dayOfYear=rJ;Xe.hour=Xe.hours=iZ;Xe.minute=Xe.minutes=nJ;Xe.second=Xe.seconds=iJ;Xe.millisecond=Xe.milliseconds=F3;Xe.utcOffset=zZ;Xe.utc=qZ;Xe.local=HZ;Xe.parseZone=WZ;Xe.hasAlignedHourOffset=VZ;Xe.isDST=YZ;Xe.isLocal=GZ;Xe.isUtcOffset=XZ;Xe.isUtc=x3;Xe.isUTC=x3;Xe.zoneAbbr=sJ;Xe.zoneName=oJ;Xe.dates=sa("dates accessor is deprecated. Use date instead.",O3);Xe.months=sa("months accessor is deprecated. Use month instead",o3);Xe.years=sa("years accessor is deprecated. Use year instead",r3);Xe.zone=sa("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",UZ);Xe.isDSTShifted=sa("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",jZ);function uJ(t){return Br(t*1e3)}function lJ(){return Br.apply(null,arguments).parseZone()}function R3(t){return t}var cr=sx.prototype;cr.calendar=GG;cr.longDateFormat=JG;cr.invalidDate=eX;cr.ordinal=nX;cr.preparse=R3;cr.postformat=R3;cr.relativeTime=aX;cr.pastFuture=sX;cr.set=YG;cr.eras=PK;cr.erasParse=IK;cr.erasConvertYear=kK;cr.erasAbbrRegex=HK;cr.erasNameRegex=qK;cr.erasNarrowRegex=WK;cr.months=_X;cr.monthsShort=AX;cr.monthsParse=NX;cr.monthsRegex=MX;cr.monthsShortRegex=CX;cr.week=OX;cr.firstDayOfYear=BX;cr.firstDayOfWeek=RX;cr.weekdays=WX;cr.weekdaysMin=YX;cr.weekdaysShort=VX;cr.weekdaysParse=GX;cr.weekdaysRegex=JX;cr.weekdaysShortRegex=QX;cr.weekdaysMinRegex=eZ;cr.isPM=rZ;cr.meridiem=aZ;function nv(t,e,r,n){var i=js(),a=Ja().set(n,e);return i[r](a,t)}function B3(t,e,r){if(qs(t)&&(e=t,t=void 0),t=t||"",e!=null)return nv(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=nv(t,n,r,"month");return i}function Ax(t,e,r,n){typeof t=="boolean"?(qs(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,qs(e)&&(r=e,e=void 0),e=e||"");var i=js(),a=t?i._week.dow:0,s,o=[];if(r!=null)return nv(e,(r+a)%7,n,"day");for(s=0;s<7;s++)o[s]=nv(e,(s+a)%7,n,"day");return o}function cJ(t,e){return B3(t,e,"months")}function fJ(t,e){return B3(t,e,"monthsShort")}function hJ(t,e,r){return Ax(t,e,r,"weekdays")}function dJ(t,e,r){return Ax(t,e,r,"weekdaysShort")}function pJ(t,e,r){return Ax(t,e,r,"weekdaysMin")}Ro("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=Xt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}});Qe.lang=sa("moment.lang is deprecated. Use moment.locale instead.",Ro);Qe.langData=sa("moment.langData is deprecated. Use moment.localeData instead.",js);var ys=Math.abs;function mJ(){var t=this._data;return this._milliseconds=ys(this._milliseconds),this._days=ys(this._days),this._months=ys(this._months),t.milliseconds=ys(t.milliseconds),t.seconds=ys(t.seconds),t.minutes=ys(t.minutes),t.hours=ys(t.hours),t.months=ys(t.months),t.years=ys(t.years),this}function P3(t,e,r,n){var i=Ca(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function vJ(t,e){return P3(this,t,e,1)}function gJ(t,e){return P3(this,t,e,-1)}function AD(t){return t<0?Math.floor(t):Math.ceil(t)}function yJ(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,a,s,o,u;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=AD(Mb(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=Gi(t/1e3),n.seconds=i%60,a=Gi(i/60),n.minutes=a%60,s=Gi(a/60),n.hours=s%24,e+=Gi(s/24),u=Gi(I3(e)),r+=u,e-=AD(Mb(u)),o=Gi(r/12),r%=12,n.days=e,n.months=r,n.years=o,this}function I3(t){return t*4800/146097}function Mb(t){return t*146097/4800}function bJ(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=oa(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+I3(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(Mb(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function Gs(t){return function(){return this.as(t)}}var k3=Gs("ms"),xJ=Gs("s"),wJ=Gs("m"),SJ=Gs("h"),_J=Gs("d"),AJ=Gs("w"),DJ=Gs("M"),NJ=Gs("Q"),EJ=Gs("y"),CJ=k3;function MJ(){return Ca(this)}function TJ(t){return t=oa(t),this.isValid()?this[t+"s"]():NaN}function Yu(t){return function(){return this.isValid()?this._data[t]:NaN}}var OJ=Yu("milliseconds"),FJ=Yu("seconds"),RJ=Yu("minutes"),BJ=Yu("hours"),PJ=Yu("days"),IJ=Yu("months"),kJ=Yu("years");function LJ(){return Gi(this.days()/7)}var Ds=Math.round,Ll={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function $J(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function zJ(t,e,r,n){var i=Ca(t).abs(),a=Ds(i.as("s")),s=Ds(i.as("m")),o=Ds(i.as("h")),u=Ds(i.as("d")),l=Ds(i.as("M")),c=Ds(i.as("w")),f=Ds(i.as("y")),h=a<=r.ss&&["s",a]||a0,h[4]=n,$J.apply(null,h)}function UJ(t){return t===void 0?Ds:typeof t=="function"?(Ds=t,!0):!1}function qJ(t,e){return Ll[t]===void 0?!1:e===void 0?Ll[t]:(Ll[t]=e,t==="s"&&(Ll.ss=e-1),!0)}function HJ(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ll,i,a;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Ll,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),a=zJ(this,!r,n,i),r&&(a=i.pastFuture(+this,a)),i.postformat(a)}var By=Math.abs;function Cl(t){return(t>0)-(t<0)||+t}function xg(){if(!this.isValid())return this.localeData().invalidDate();var t=By(this._milliseconds)/1e3,e=By(this._days),r=By(this._months),n,i,a,s,o=this.asSeconds(),u,l,c,f;return o?(n=Gi(t/60),i=Gi(n/60),t%=60,n%=60,a=Gi(r/12),r%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",u=o<0?"-":"",l=Cl(this._months)!==Cl(o)?"-":"",c=Cl(this._days)!==Cl(o)?"-":"",f=Cl(this._milliseconds)!==Cl(o)?"-":"",u+"P"+(a?l+a+"Y":"")+(r?l+r+"M":"")+(e?c+e+"D":"")+(i||n||t?"T":"")+(i?f+i+"H":"")+(n?f+n+"M":"")+(t?f+s+"S":"")):"P0D"}var ir=yg.prototype;ir.isValid=IZ;ir.abs=mJ;ir.add=vJ;ir.subtract=gJ;ir.as=bJ;ir.asMilliseconds=k3;ir.asSeconds=xJ;ir.asMinutes=wJ;ir.asHours=SJ;ir.asDays=_J;ir.asWeeks=AJ;ir.asMonths=DJ;ir.asQuarters=NJ;ir.asYears=EJ;ir.valueOf=CJ;ir._bubble=yJ;ir.clone=MJ;ir.get=TJ;ir.milliseconds=OJ;ir.seconds=FJ;ir.minutes=RJ;ir.hours=BJ;ir.days=PJ;ir.weeks=LJ;ir.months=IJ;ir.years=kJ;ir.humanize=HJ;ir.toISOString=xg;ir.toString=xg;ir.toJSON=xg;ir.locale=A3;ir.localeData=N3;ir.toIsoString=sa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xg);ir.lang=D3;ft("X",0,0,"unix");ft("x",0,0,"valueOf");it("x",pg);it("X",cX);Sr("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)});Sr("x",function(t,e,r){r._d=new Date(Xt(t))});//! moment.js -Qe.version="2.30.1";WG(Br);Qe.fn=Xe;Qe.min=FZ;Qe.max=RZ;Qe.now=BZ;Qe.utc=Ja;Qe.unix=uJ;Qe.months=cJ;Qe.isDate=td;Qe.locale=Ro;Qe.invalid=cg;Qe.duration=Ca;Qe.isMoment=Ea;Qe.weekdays=hJ;Qe.parseZone=lJ;Qe.localeData=js;Qe.isDuration=Cm;Qe.monthsShort=fJ;Qe.weekdaysMin=pJ;Qe.defineLocale=vx;Qe.updateLocale=lZ;Qe.locales=cZ;Qe.weekdaysShort=dJ;Qe.normalizeUnits=oa;Qe.relativeTimeRounding=UJ;Qe.relativeTimeThreshold=qJ;Qe.calendarFormat=aK;Qe.prototype=Xe;Qe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};/** +`+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var AD={};function JF(t,e){Qe.deprecationHandler!=null&&Qe.deprecationHandler(t,e),AD[t]||(KF(e),AD[t]=!0)}Qe.suppressDeprecationWarnings=!1;Qe.deprecationHandler=null;function Qa(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function jG(t){var e,r;for(r in t)ur(t,r)&&(e=t[r],Qa(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Db(t,e){var r=Co({},t),n;for(n in e)ur(e,n)&&(Ou(t[n])&&Ou(e[n])?(r[n]={},Co(r[n],t[n]),Co(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)ur(t,n)&&!ur(e,n)&&Ou(t[n])&&(r[n]=Co({},r[n]));return r}function vx(t){t!=null&&this.set(t)}var Nb;Object.keys?Nb=Object.keys:Nb=function(t){var e,r=[];for(e in t)ur(t,e)&&r.push(e);return r};var GG={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function XG(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return Qa(n)?n.call(e,r):n}function ja(t,e,r){var n=""+Math.abs(t),i=e-n.length,a=t>=0;return(a?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var gx=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,jp=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,By={},Gl={};function ft(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(Gl[t]=i),e&&(Gl[e[0]]=function(){return ja(i.apply(this,arguments),e[1],e[2])}),r&&(Gl[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function ZG(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function KG(t){var e=t.match(gx),r,n;for(r=0,n=e.length;r=0&&jp.test(t);)t=t.replace(jp,n),jp.lastIndex=0,r-=1;return t}var JG={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function QG(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(gx).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var eX="Invalid date";function tX(){return this._invalidDate}var rX="%d",nX=/\d{1,2}/;function iX(t){return this._ordinal.replace("%d",t)}var aX={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function sX(t,e,r,n){var i=this._relativeTime[r];return Qa(i)?i(t,e,r,n):i.replace(/%d/i,t)}function oX(t,e){var r=this._relativeTime[t>0?"future":"past"];return Qa(r)?r(e):r.replace(/%s/i,e)}var DD={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function oa(t){return typeof t=="string"?DD[t]||DD[t.toLowerCase()]:void 0}function yx(t){var e={},r,n;for(n in t)ur(t,n)&&(r=oa(n),r&&(e[r]=t[n]));return e}var uX={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function lX(t){var e=[],r;for(r in t)ur(t,r)&&e.push({unit:r,priority:uX[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}var e3=/\d/,Ri=/\d\d/,t3=/\d{3}/,bx=/\d{4}/,dg=/[+-]?\d{6}/,Pr=/\d\d?/,r3=/\d\d\d\d?/,n3=/\d\d\d\d\d\d?/,pg=/\d{1,3}/,xx=/\d{1,4}/,mg=/[+-]?\d{1,6}/,Sc=/\d+/,vg=/[+-]?\d+/,cX=/Z|[+-]\d\d:?\d\d/gi,gg=/Z|[+-]\d\d(?::?\d\d)?/gi,fX=/[+-]?\d+(\.\d{1,3})?/,nd=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,_c=/^[1-9]\d?/,wx=/^([1-9]\d|\d)/,tv;tv={};function it(t,e,r){tv[t]=Qa(e)?e:function(n,i){return n&&r?r:e}}function hX(t,e){return ur(tv,t)?tv[t](e._strict,e._locale):new RegExp(dX(t))}function dX(t){return ks(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,a){return r||n||i||a}))}function ks(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Gi(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Xt(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=Gi(e)),r}var Eb={};function Ar(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),qs(e)&&(n=function(a,s){s[e]=Xt(a)}),i=t.length,r=0;r68?1900:2e3)};var i3=Ac("FullYear",!0);function gX(){return yg(this.year())}function Ac(t,e){return function(r){return r!=null?(a3(this,t,r),Qe.updateOffset(this,e),this):Ch(this,t)}}function Ch(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function a3(t,e,r){var n,i,a,s,o;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}a=r,s=t.month(),o=t.date(),o=o===29&&s===1&&!yg(a)?28:o,i?n.setUTCFullYear(a,s,o):n.setFullYear(a,s,o)}}function yX(t){return t=oa(t),Qa(this[t])?this[t]():this}function bX(t,e){if(typeof t=="object"){t=yx(t);var r=lX(t),n,i=r.length;for(n=0;n=0?(o=new Date(t+400,e,r,n,i,a,s),isFinite(o.getFullYear())&&o.setFullYear(t)):o=new Date(t,e,r,n,i,a,s),o}function Mh(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function rv(t,e,r){var n=7+e-r,i=(7+Mh(t,0,n).getUTCDay()-e)%7;return-i+n-1}function f3(t,e,r,n,i){var a=(7+r-n)%7,s=rv(t,n,i),o=1+7*(e-1)+a+s,u,l;return o<=0?(u=t-1,l=hh(u)+o):o>hh(t)?(u=t+1,l=o-hh(t)):(u=t,l=o),{year:u,dayOfYear:l}}function Th(t,e,r){var n=rv(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,a,s;return i<1?(s=t.year()-1,a=i+Ls(s,e,r)):i>Ls(t.year(),e,r)?(a=i-Ls(t.year(),e,r),s=t.year()+1):(s=t.year(),a=i),{week:a,year:s}}function Ls(t,e,r){var n=rv(t,e,r),i=rv(t+1,e,r);return(hh(t)-n+i)/7}ft("w",["ww",2],"wo","week");ft("W",["WW",2],"Wo","isoWeek");it("w",Pr,_c);it("ww",Pr,Ri);it("W",Pr,_c);it("WW",Pr,Ri);id(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=Xt(t)});function FX(t){return Th(t,this._week.dow,this._week.doy).week}var RX={dow:0,doy:6};function BX(){return this._week.dow}function PX(){return this._week.doy}function IX(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function kX(t){var e=Th(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}ft("d",0,"do","day");ft("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});ft("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});ft("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});ft("e",0,0,"weekday");ft("E",0,0,"isoWeekday");it("d",Pr);it("e",Pr);it("E",Pr);it("dd",function(t,e){return e.weekdaysMinRegex(t)});it("ddd",function(t,e){return e.weekdaysShortRegex(t)});it("dddd",function(t,e){return e.weekdaysRegex(t)});id(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:Lt(r).invalidWeekday=t});id(["d","e","E"],function(t,e,r,n){e[n]=Xt(t)});function LX(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function $X(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function _x(t,e){return t.slice(e,7).concat(t.slice(0,e))}var zX="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),h3="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),UX="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qX=nd,HX=nd,WX=nd;function VX(t,e){var r=Na(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?_x(r,this._week.dow):t?r[t.day()]:r}function YX(t){return t===!0?_x(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function jX(t){return t===!0?_x(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function GX(t,e,r){var n,i,a,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=Ja([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();return r?e==="dddd"?(i=Qr.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Qr.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Qr.call(this._weekdaysParse,s),i!==-1||(i=Qr.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Qr.call(this._shortWeekdaysParse,s),i!==-1||(i=Qr.call(this._weekdaysParse,s),i!==-1)?i:(i=Qr.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Qr.call(this._minWeekdaysParse,s),i!==-1||(i=Qr.call(this._weekdaysParse,s),i!==-1)?i:(i=Qr.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function XX(t,e,r){var n,i,a;if(this._weekdaysParseExact)return GX.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=Ja([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function ZX(t){if(!this.isValid())return t!=null?this:NaN;var e=Ch(this,"Day");return t!=null?(t=LX(t,this.localeData()),this.add(t-e,"d")):e}function KX(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function JX(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=$X(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function QX(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||Ax.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ur(this,"_weekdaysRegex")||(this._weekdaysRegex=qX),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function eZ(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||Ax.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ur(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=HX),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tZ(t){return this._weekdaysParseExact?(ur(this,"_weekdaysRegex")||Ax.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ur(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=WX),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ax(){function t(c,f){return f.length-c.length}var e=[],r=[],n=[],i=[],a,s,o,u,l;for(a=0;a<7;a++)s=Ja([2e3,1]).day(a),o=ks(this.weekdaysMin(s,"")),u=ks(this.weekdaysShort(s,"")),l=ks(this.weekdays(s,"")),e.push(o),r.push(u),n.push(l),i.push(o),i.push(u),i.push(l);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Dx(){return this.hours()%12||12}function rZ(){return this.hours()||24}ft("H",["HH",2],0,"hour");ft("h",["hh",2],0,Dx);ft("k",["kk",2],0,rZ);ft("hmm",0,0,function(){return""+Dx.apply(this)+ja(this.minutes(),2)});ft("hmmss",0,0,function(){return""+Dx.apply(this)+ja(this.minutes(),2)+ja(this.seconds(),2)});ft("Hmm",0,0,function(){return""+this.hours()+ja(this.minutes(),2)});ft("Hmmss",0,0,function(){return""+this.hours()+ja(this.minutes(),2)+ja(this.seconds(),2)});function d3(t,e){ft(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}d3("a",!0);d3("A",!1);function p3(t,e){return e._meridiemParse}it("a",p3);it("A",p3);it("H",Pr,wx);it("h",Pr,_c);it("k",Pr,_c);it("HH",Pr,Ri);it("hh",Pr,Ri);it("kk",Pr,Ri);it("hmm",r3);it("hmmss",n3);it("Hmm",r3);it("Hmmss",n3);Ar(["H","HH"],mn);Ar(["k","kk"],function(t,e,r){var n=Xt(t);e[mn]=n===24?0:n});Ar(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t});Ar(["h","hh"],function(t,e,r){e[mn]=Xt(t),Lt(r).bigHour=!0});Ar("hmm",function(t,e,r){var n=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n)),Lt(r).bigHour=!0});Ar("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n,2)),e[Rs]=Xt(t.substr(i)),Lt(r).bigHour=!0});Ar("Hmm",function(t,e,r){var n=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n))});Ar("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[mn]=Xt(t.substr(0,n)),e[xa]=Xt(t.substr(n,2)),e[Rs]=Xt(t.substr(i))});function nZ(t){return(t+"").toLowerCase().charAt(0)==="p"}var iZ=/[ap]\.?m?\.?/i,aZ=Ac("Hours",!0);function sZ(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var m3={calendar:GG,longDateFormat:JG,invalidDate:eX,ordinal:rX,dayOfMonthOrdinalParse:nX,relativeTime:aX,months:wX,monthsShort:s3,week:RX,weekdays:zX,weekdaysMin:UX,weekdaysShort:h3,meridiemParse:iZ},Ir={},Uf={},Oh;function oZ(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r0;){if(i=bg(a.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&oZ(a,n)>=r-1)break;r--}e++}return Oh}function lZ(t){return!!(t&&t.match("^[^/\\\\]*$"))}function bg(t){var e=null,r;if(Ir[t]===void 0&&typeof module<"u"&&module&&module.exports&&lZ(t))try{e=Oh._abbr,r=require,r("./locale/"+t),Ro(e)}catch{Ir[t]=null}return Ir[t]}function Ro(t,e){var r;return t&&(pi(e)?r=js(t):r=Nx(t,e),r?Oh=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Oh._abbr}function Nx(t,e){if(e!==null){var r,n=m3;if(e.abbr=t,Ir[t]!=null)JF("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ir[t]._config;else if(e.parentLocale!=null)if(Ir[e.parentLocale]!=null)n=Ir[e.parentLocale]._config;else if(r=bg(e.parentLocale),r!=null)n=r._config;else return Uf[e.parentLocale]||(Uf[e.parentLocale]=[]),Uf[e.parentLocale].push({name:t,config:e}),null;return Ir[t]=new vx(Db(n,e)),Uf[t]&&Uf[t].forEach(function(i){Nx(i.name,i.config)}),Ro(t),Ir[t]}else return delete Ir[t],null}function cZ(t,e){if(e!=null){var r,n,i=m3;Ir[t]!=null&&Ir[t].parentLocale!=null?Ir[t].set(Db(Ir[t]._config,e)):(n=bg(t),n!=null&&(i=n._config),e=Db(i,e),n==null&&(e.abbr=t),r=new vx(e),r.parentLocale=Ir[t],Ir[t]=r),Ro(t)}else Ir[t]!=null&&(Ir[t].parentLocale!=null?(Ir[t]=Ir[t].parentLocale,t===Ro()&&Ro(t)):Ir[t]!=null&&delete Ir[t]);return Ir[t]}function js(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Oh;if(!Na(t)){if(e=bg(t),e)return e;t=[t]}return uZ(t)}function fZ(){return Nb(Ir)}function Ex(t){var e,r=t._a;return r&&Lt(t).overflow===-2&&(e=r[Fs]<0||r[Fs]>11?Fs:r[Wa]<1||r[Wa]>Sx(r[zn],r[Fs])?Wa:r[mn]<0||r[mn]>24||r[mn]===24&&(r[xa]!==0||r[Rs]!==0||r[Au]!==0)?mn:r[xa]<0||r[xa]>59?xa:r[Rs]<0||r[Rs]>59?Rs:r[Au]<0||r[Au]>999?Au:-1,Lt(t)._overflowDayOfYear&&(eWa)&&(e=Wa),Lt(t)._overflowWeeks&&e===-1&&(e=mX),Lt(t)._overflowWeekday&&e===-1&&(e=vX),Lt(t).overflow=e),t}var hZ=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dZ=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pZ=/Z|[+-]\d\d(?::?\d\d)?/,Gp=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Py=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mZ=/^\/?Date\((-?\d+)/i,vZ=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gZ={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function v3(t){var e,r,n=t._i,i=hZ.exec(n)||dZ.exec(n),a,s,o,u,l=Gp.length,c=Py.length;if(i){for(Lt(t).iso=!0,e=0,r=l;ehh(s)||t._dayOfYear===0)&&(Lt(t)._overflowDayOfYear=!0),r=Mh(s,0,t._dayOfYear),t._a[Fs]=r.getUTCMonth(),t._a[Wa]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[mn]===24&&t._a[xa]===0&&t._a[Rs]===0&&t._a[Au]===0&&(t._nextDay=!0,t._a[mn]=0),t._d=(t._useUTC?Mh:OX).apply(null,n),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[mn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==a&&(Lt(t).weekdayMismatch=!0)}}function DZ(t){var e,r,n,i,a,s,o,u,l;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(a=1,s=4,r=Bl(e.GG,t._a[zn],Th(Br(),1,4).year),n=Bl(e.W,1),i=Bl(e.E,1),(i<1||i>7)&&(u=!0)):(a=t._locale._week.dow,s=t._locale._week.doy,l=Th(Br(),a,s),r=Bl(e.gg,t._a[zn],l.year),n=Bl(e.w,l.week),e.d!=null?(i=e.d,(i<0||i>6)&&(u=!0)):e.e!=null?(i=e.e+a,(e.e<0||e.e>6)&&(u=!0)):i=a),n<1||n>Ls(r,a,s)?Lt(t)._overflowWeeks=!0:u!=null?Lt(t)._overflowWeekday=!0:(o=f3(r,n,i,a,s),t._a[zn]=o.year,t._dayOfYear=o.dayOfYear)}Qe.ISO_8601=function(){};Qe.RFC_2822=function(){};function Mx(t){if(t._f===Qe.ISO_8601){v3(t);return}if(t._f===Qe.RFC_2822){g3(t);return}t._a=[],Lt(t).empty=!0;var e=""+t._i,r,n,i,a,s,o=e.length,u=0,l,c;for(i=QF(t._f,t._locale).match(gx)||[],c=i.length,r=0;r0&&Lt(t).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),u+=n.length),Gl[a]?(n?Lt(t).empty=!1:Lt(t).unusedTokens.push(a),pX(a,n,t)):t._strict&&!n&&Lt(t).unusedTokens.push(a);Lt(t).charsLeftOver=o-u,e.length>0&&Lt(t).unusedInput.push(e),t._a[mn]<=12&&Lt(t).bigHour===!0&&t._a[mn]>0&&(Lt(t).bigHour=void 0),Lt(t).parsedDateParts=t._a.slice(0),Lt(t).meridiem=t._meridiem,t._a[mn]=NZ(t._locale,t._a[mn],t._meridiem),l=Lt(t).era,l!==null&&(t._a[zn]=t._locale.erasConvertYear(l,t._a[zn])),Cx(t),Ex(t)}function NZ(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function EZ(t){var e,r,n,i,a,s,o=!1,u=t._f.length;if(u===0){Lt(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;ithis?this:t:hg()});function x3(t,e){var r,n;if(e.length===1&&Na(e[0])&&(e=e[0]),!e.length)return Br();for(r=e[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function GZ(){if(!pi(this._isDSTShifted))return this._isDSTShifted;var t={},e;return mx(t,this),t=y3(t),t._a?(e=t._isUTC?Ja(t._a):Br(t._a),this._isDSTShifted=this.isValid()&&$Z(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function XZ(){return this.isValid()?!this._isUTC:!1}function ZZ(){return this.isValid()?this._isUTC:!1}function S3(){return this.isValid()?this._isUTC&&this._offset===0:!1}var KZ=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,JZ=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ca(t,e){var r=t,n=null,i,a,s;return Cm(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:qs(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=KZ.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:Xt(n[Wa])*i,h:Xt(n[mn])*i,m:Xt(n[xa])*i,s:Xt(n[Rs])*i,ms:Xt(Cb(n[Au]*1e3))*i}):(n=JZ.exec(t))?(i=n[1]==="-"?-1:1,r={y:yu(n[2],i),M:yu(n[3],i),w:yu(n[4],i),d:yu(n[5],i),h:yu(n[6],i),m:yu(n[7],i),s:yu(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(s=QZ(Br(r.from),Br(r.to)),r={},r.ms=s.milliseconds,r.M=s.months),a=new xg(r),Cm(t)&&ur(t,"_locale")&&(a._locale=t._locale),Cm(t)&&ur(t,"_isValid")&&(a._isValid=t._isValid),a}Ca.fn=xg.prototype;Ca.invalid=LZ;function yu(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function ED(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function QZ(t,e){var r;return t.isValid()&&e.isValid()?(e=Ox(e,t),t.isBefore(e)?r=ED(t,e):(r=ED(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function _3(t,e){return function(r,n){var i,a;return n!==null&&!isNaN(+n)&&(JF(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=r,r=n,n=a),i=Ca(r,n),A3(this,i,t),this}}function A3(t,e,r,n){var i=e._milliseconds,a=Cb(e._days),s=Cb(e._months);t.isValid()&&(n=n??!0,s&&u3(t,Ch(t,"Month")+s*r),a&&a3(t,"Date",Ch(t,"Date")+a*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&Qe.updateOffset(t,a||s))}var eK=_3(1,"add"),tK=_3(-1,"subtract");function D3(t){return typeof t=="string"||t instanceof String}function rK(t){return Ea(t)||td(t)||D3(t)||qs(t)||iK(t)||nK(t)||t===null||t===void 0}function nK(t){var e=Ou(t)&&!dx(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,s=n.length;for(i=0;ir.valueOf():r.valueOf()9999?Em(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Qa(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Em(r,"Z")):Em(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yK(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,a;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=e+'[")]',this.format(r+n+i+a)}function bK(t){t||(t=this.isUtc()?Qe.defaultFormatUtc:Qe.defaultFormat);var e=Em(this,t);return this.localeData().postformat(e)}function xK(t,e){return this.isValid()&&(Ea(t)&&t.isValid()||Br(t).isValid())?Ca({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function wK(t){return this.from(Br(),t)}function SK(t,e){return this.isValid()&&(Ea(t)&&t.isValid()||Br(t).isValid())?Ca({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function _K(t){return this.to(Br(),t)}function N3(t){var e;return t===void 0?this._locale._abbr:(e=js(t),e!=null&&(this._locale=e),this)}var E3=sa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function C3(){return this._locale}var nv=1e3,Xl=60*nv,iv=60*Xl,M3=(365*400+97)*24*iv;function Zl(t,e){return(t%e+e)%e}function T3(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-M3:new Date(t,e,r).valueOf()}function O3(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-M3:Date.UTC(t,e,r)}function AK(t){var e,r;if(t=oa(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?O3:T3,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Zl(e+(this._isUTC?0:this.utcOffset()*Xl),iv);break;case"minute":e=this._d.valueOf(),e-=Zl(e,Xl);break;case"second":e=this._d.valueOf(),e-=Zl(e,nv);break}return this._d.setTime(e),Qe.updateOffset(this,!0),this}function DK(t){var e,r;if(t=oa(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?O3:T3,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=iv-Zl(e+(this._isUTC?0:this.utcOffset()*Xl),iv)-1;break;case"minute":e=this._d.valueOf(),e+=Xl-Zl(e,Xl)-1;break;case"second":e=this._d.valueOf(),e+=nv-Zl(e,nv)-1;break}return this._d.setTime(e),Qe.updateOffset(this,!0),this}function NK(){return this._d.valueOf()-(this._offset||0)*6e4}function EK(){return Math.floor(this.valueOf()/1e3)}function CK(){return new Date(this.valueOf())}function MK(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function TK(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function OK(){return this.isValid()?this.toISOString():null}function FK(){return px(this)}function RK(){return Co({},Lt(this))}function BK(){return Lt(this).overflow}function PK(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ft("N",0,0,"eraAbbr");ft("NN",0,0,"eraAbbr");ft("NNN",0,0,"eraAbbr");ft("NNNN",0,0,"eraName");ft("NNNNN",0,0,"eraNarrow");ft("y",["y",1],"yo","eraYear");ft("y",["yy",2],0,"eraYear");ft("y",["yyy",3],0,"eraYear");ft("y",["yyyy",4],0,"eraYear");it("N",Fx);it("NN",Fx);it("NNN",Fx);it("NNNN",YK);it("NNNNN",jK);Ar(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?Lt(r).era=i:Lt(r).invalidEra=t});it("y",Sc);it("yy",Sc);it("yyy",Sc);it("yyyy",Sc);it("yo",GK);Ar(["y","yy","yyy","yyyy"],zn);Ar(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[zn]=r._locale.eraYearOrdinalParse(t,i):e[zn]=parseInt(t,10)});function IK(t,e){var r,n,i,a=this._eras||js("en")._eras;for(r=0,n=a.length;r=0)return a[n]}function LK(t,e){var r=t.since<=t.until?1:-1;return e===void 0?Qe(t.since).year():Qe(t.since).year()+(e-t.offset)*r}function $K(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;ta&&(e=a),tJ.call(this,t,e,r,n,i))}function tJ(t,e,r,n,i){var a=f3(t,e,r,n,i),s=Mh(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}ft("Q",0,"Qo","quarter");it("Q",e3);Ar("Q",function(t,e){e[Fs]=(Xt(t)-1)*3});function rJ(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}ft("D",["DD",2],"Do","date");it("D",Pr,_c);it("DD",Pr,Ri);it("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Ar(["D","DD"],Wa);Ar("Do",function(t,e){e[Wa]=Xt(t.match(Pr)[0])});var R3=Ac("Date",!0);ft("DDD",["DDDD",3],"DDDo","dayOfYear");it("DDD",pg);it("DDDD",t3);Ar(["DDD","DDDD"],function(t,e,r){r._dayOfYear=Xt(t)});function nJ(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}ft("m",["mm",2],0,"minute");it("m",Pr,wx);it("mm",Pr,Ri);Ar(["m","mm"],xa);var iJ=Ac("Minutes",!1);ft("s",["ss",2],0,"second");it("s",Pr,wx);it("ss",Pr,Ri);Ar(["s","ss"],Rs);var aJ=Ac("Seconds",!1);ft("S",0,0,function(){return~~(this.millisecond()/100)});ft(0,["SS",2],0,function(){return~~(this.millisecond()/10)});ft(0,["SSS",3],0,"millisecond");ft(0,["SSSS",4],0,function(){return this.millisecond()*10});ft(0,["SSSSS",5],0,function(){return this.millisecond()*100});ft(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});ft(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});ft(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});ft(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});it("S",pg,e3);it("SS",pg,Ri);it("SSS",pg,t3);var Mo,B3;for(Mo="SSSS";Mo.length<=9;Mo+="S")it(Mo,Sc);function sJ(t,e){e[Au]=Xt(("0."+t)*1e3)}for(Mo="S";Mo.length<=9;Mo+="S")Ar(Mo,sJ);B3=Ac("Milliseconds",!1);ft("z",0,0,"zoneAbbr");ft("zz",0,0,"zoneName");function oJ(){return this._isUTC?"UTC":""}function uJ(){return this._isUTC?"Coordinated Universal Time":""}var Xe=rd.prototype;Xe.add=eK;Xe.calendar=oK;Xe.clone=uK;Xe.diff=mK;Xe.endOf=DK;Xe.format=bK;Xe.from=xK;Xe.fromNow=wK;Xe.to=SK;Xe.toNow=_K;Xe.get=yX;Xe.invalidAt=BK;Xe.isAfter=lK;Xe.isBefore=cK;Xe.isBetween=fK;Xe.isSame=hK;Xe.isSameOrAfter=dK;Xe.isSameOrBefore=pK;Xe.isValid=FK;Xe.lang=E3;Xe.locale=N3;Xe.localeData=C3;Xe.max=FZ;Xe.min=OZ;Xe.parsingFlags=RK;Xe.set=bX;Xe.startOf=AK;Xe.subtract=tK;Xe.toArray=MK;Xe.toObject=TK;Xe.toDate=CK;Xe.toISOString=gK;Xe.inspect=yK;typeof Symbol<"u"&&Symbol.for!=null&&(Xe[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Xe.toJSON=OK;Xe.toString=vK;Xe.unix=EK;Xe.valueOf=NK;Xe.creationData=PK;Xe.eraName=$K;Xe.eraNarrow=zK;Xe.eraAbbr=UK;Xe.eraYear=qK;Xe.year=i3;Xe.isLeapYear=gX;Xe.weekYear=XK;Xe.isoWeekYear=ZK;Xe.quarter=Xe.quarters=rJ;Xe.month=l3;Xe.daysInMonth=CX;Xe.week=Xe.weeks=IX;Xe.isoWeek=Xe.isoWeeks=kX;Xe.weeksInYear=QK;Xe.weeksInWeekYear=eJ;Xe.isoWeeksInYear=KK;Xe.isoWeeksInISOWeekYear=JK;Xe.date=R3;Xe.day=Xe.days=ZX;Xe.weekday=KX;Xe.isoWeekday=JX;Xe.dayOfYear=nJ;Xe.hour=Xe.hours=aZ;Xe.minute=Xe.minutes=iJ;Xe.second=Xe.seconds=aJ;Xe.millisecond=Xe.milliseconds=B3;Xe.utcOffset=UZ;Xe.utc=HZ;Xe.local=WZ;Xe.parseZone=VZ;Xe.hasAlignedHourOffset=YZ;Xe.isDST=jZ;Xe.isLocal=XZ;Xe.isUtcOffset=ZZ;Xe.isUtc=S3;Xe.isUTC=S3;Xe.zoneAbbr=oJ;Xe.zoneName=uJ;Xe.dates=sa("dates accessor is deprecated. Use date instead.",R3);Xe.months=sa("months accessor is deprecated. Use month instead",l3);Xe.years=sa("years accessor is deprecated. Use year instead",i3);Xe.zone=sa("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",qZ);Xe.isDSTShifted=sa("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",GZ);function lJ(t){return Br(t*1e3)}function cJ(){return Br.apply(null,arguments).parseZone()}function P3(t){return t}var cr=vx.prototype;cr.calendar=XG;cr.longDateFormat=QG;cr.invalidDate=tX;cr.ordinal=iX;cr.preparse=P3;cr.postformat=P3;cr.relativeTime=sX;cr.pastFuture=oX;cr.set=jG;cr.eras=IK;cr.erasParse=kK;cr.erasConvertYear=LK;cr.erasAbbrRegex=WK;cr.erasNameRegex=HK;cr.erasNarrowRegex=VK;cr.months=AX;cr.monthsShort=DX;cr.monthsParse=EX;cr.monthsRegex=TX;cr.monthsShortRegex=MX;cr.week=FX;cr.firstDayOfYear=PX;cr.firstDayOfWeek=BX;cr.weekdays=VX;cr.weekdaysMin=jX;cr.weekdaysShort=YX;cr.weekdaysParse=XX;cr.weekdaysRegex=QX;cr.weekdaysShortRegex=eZ;cr.weekdaysMinRegex=tZ;cr.isPM=nZ;cr.meridiem=sZ;function av(t,e,r,n){var i=js(),a=Ja().set(n,e);return i[r](a,t)}function I3(t,e,r){if(qs(t)&&(e=t,t=void 0),t=t||"",e!=null)return av(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=av(t,n,r,"month");return i}function Bx(t,e,r,n){typeof t=="boolean"?(qs(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,qs(e)&&(r=e,e=void 0),e=e||"");var i=js(),a=t?i._week.dow:0,s,o=[];if(r!=null)return av(e,(r+a)%7,n,"day");for(s=0;s<7;s++)o[s]=av(e,(s+a)%7,n,"day");return o}function fJ(t,e){return I3(t,e,"months")}function hJ(t,e){return I3(t,e,"monthsShort")}function dJ(t,e,r){return Bx(t,e,r,"weekdays")}function pJ(t,e,r){return Bx(t,e,r,"weekdaysShort")}function mJ(t,e,r){return Bx(t,e,r,"weekdaysMin")}Ro("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=Xt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}});Qe.lang=sa("moment.lang is deprecated. Use moment.locale instead.",Ro);Qe.langData=sa("moment.langData is deprecated. Use moment.localeData instead.",js);var ys=Math.abs;function vJ(){var t=this._data;return this._milliseconds=ys(this._milliseconds),this._days=ys(this._days),this._months=ys(this._months),t.milliseconds=ys(t.milliseconds),t.seconds=ys(t.seconds),t.minutes=ys(t.minutes),t.hours=ys(t.hours),t.months=ys(t.months),t.years=ys(t.years),this}function k3(t,e,r,n){var i=Ca(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function gJ(t,e){return k3(this,t,e,1)}function yJ(t,e){return k3(this,t,e,-1)}function CD(t){return t<0?Math.floor(t):Math.ceil(t)}function bJ(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,a,s,o,u;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=CD(Tb(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=Gi(t/1e3),n.seconds=i%60,a=Gi(i/60),n.minutes=a%60,s=Gi(a/60),n.hours=s%24,e+=Gi(s/24),u=Gi(L3(e)),r+=u,e-=CD(Tb(u)),o=Gi(r/12),r%=12,n.days=e,n.months=r,n.years=o,this}function L3(t){return t*4800/146097}function Tb(t){return t*146097/4800}function xJ(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=oa(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+L3(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(Tb(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function Gs(t){return function(){return this.as(t)}}var $3=Gs("ms"),wJ=Gs("s"),SJ=Gs("m"),_J=Gs("h"),AJ=Gs("d"),DJ=Gs("w"),NJ=Gs("M"),EJ=Gs("Q"),CJ=Gs("y"),MJ=$3;function TJ(){return Ca(this)}function OJ(t){return t=oa(t),this.isValid()?this[t+"s"]():NaN}function Yu(t){return function(){return this.isValid()?this._data[t]:NaN}}var FJ=Yu("milliseconds"),RJ=Yu("seconds"),BJ=Yu("minutes"),PJ=Yu("hours"),IJ=Yu("days"),kJ=Yu("months"),LJ=Yu("years");function $J(){return Gi(this.days()/7)}var Ds=Math.round,Ll={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function zJ(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function UJ(t,e,r,n){var i=Ca(t).abs(),a=Ds(i.as("s")),s=Ds(i.as("m")),o=Ds(i.as("h")),u=Ds(i.as("d")),l=Ds(i.as("M")),c=Ds(i.as("w")),f=Ds(i.as("y")),h=a<=r.ss&&["s",a]||a0,h[4]=n,zJ.apply(null,h)}function qJ(t){return t===void 0?Ds:typeof t=="function"?(Ds=t,!0):!1}function HJ(t,e){return Ll[t]===void 0?!1:e===void 0?Ll[t]:(Ll[t]=e,t==="s"&&(Ll.ss=e-1),!0)}function WJ(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ll,i,a;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Ll,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),a=UJ(this,!r,n,i),r&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Iy=Math.abs;function Cl(t){return(t>0)-(t<0)||+t}function Sg(){if(!this.isValid())return this.localeData().invalidDate();var t=Iy(this._milliseconds)/1e3,e=Iy(this._days),r=Iy(this._months),n,i,a,s,o=this.asSeconds(),u,l,c,f;return o?(n=Gi(t/60),i=Gi(n/60),t%=60,n%=60,a=Gi(r/12),r%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",u=o<0?"-":"",l=Cl(this._months)!==Cl(o)?"-":"",c=Cl(this._days)!==Cl(o)?"-":"",f=Cl(this._milliseconds)!==Cl(o)?"-":"",u+"P"+(a?l+a+"Y":"")+(r?l+r+"M":"")+(e?c+e+"D":"")+(i||n||t?"T":"")+(i?f+i+"H":"")+(n?f+n+"M":"")+(t?f+s+"S":"")):"P0D"}var ir=xg.prototype;ir.isValid=kZ;ir.abs=vJ;ir.add=gJ;ir.subtract=yJ;ir.as=xJ;ir.asMilliseconds=$3;ir.asSeconds=wJ;ir.asMinutes=SJ;ir.asHours=_J;ir.asDays=AJ;ir.asWeeks=DJ;ir.asMonths=NJ;ir.asQuarters=EJ;ir.asYears=CJ;ir.valueOf=MJ;ir._bubble=bJ;ir.clone=TJ;ir.get=OJ;ir.milliseconds=FJ;ir.seconds=RJ;ir.minutes=BJ;ir.hours=PJ;ir.days=IJ;ir.weeks=$J;ir.months=kJ;ir.years=LJ;ir.humanize=WJ;ir.toISOString=Sg;ir.toString=Sg;ir.toJSON=Sg;ir.locale=N3;ir.localeData=C3;ir.toIsoString=sa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Sg);ir.lang=E3;ft("X",0,0,"unix");ft("x",0,0,"valueOf");it("x",vg);it("X",fX);Ar("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)});Ar("x",function(t,e,r){r._d=new Date(Xt(t))});//! moment.js +Qe.version="2.30.1";VG(Br);Qe.fn=Xe;Qe.min=RZ;Qe.max=BZ;Qe.now=PZ;Qe.utc=Ja;Qe.unix=lJ;Qe.months=fJ;Qe.isDate=td;Qe.locale=Ro;Qe.invalid=hg;Qe.duration=Ca;Qe.isMoment=Ea;Qe.weekdays=dJ;Qe.parseZone=cJ;Qe.localeData=js;Qe.isDuration=Cm;Qe.monthsShort=hJ;Qe.weekdaysMin=mJ;Qe.defineLocale=Nx;Qe.updateLocale=cZ;Qe.locales=fZ;Qe.weekdaysShort=pJ;Qe.normalizeUnits=oa;Qe.relativeTimeRounding=qJ;Qe.relativeTimeThreshold=HJ;Qe.calendarFormat=sK;Qe.prototype=Xe;Qe.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};/** * @vue/runtime-dom v3.4.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const WJ="http://www.w3.org/2000/svg",VJ="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,DD=bo&&bo.createElement("template"),YJ={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?bo.createElementNS(WJ,t):e==="mathml"?bo.createElementNS(VJ,t):bo.createElement(t,r?{is:r}:void 0);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>bo.createTextNode(t),createComment:t=>bo.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>bo.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,a){const s=r?r.previousSibling:e.lastChild;if(i&&(i===a||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===a||!(i=i.nextSibling)););else{DD.innerHTML=n==="svg"?`${t}`:n==="mathml"?`${t}`:t;const o=DD.content;if(n==="svg"||n==="mathml"){const u=o.firstChild;for(;u.firstChild;)o.appendChild(u.firstChild);o.removeChild(u)}e.insertBefore(o,r)}return[s?s.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},mo="transition",Wf="animation",oc=Symbol("_vtc"),Dx=(t,{slots:e})=>UM(qM,$3(t),e);Dx.displayName="Transition";const L3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},jJ=Dx.props=gi({},HM,L3),bu=(t,e=[])=>{Hn(t)?t.forEach(r=>r(...e)):t&&t(...e)},ND=t=>t?Hn(t)?t.some(e=>e.length>1):t.length>1:!1;function $3(t){const e={};for(const F in t)F in L3||(e[F]=t[F]);if(t.css===!1)return e;const{name:r="v",type:n,duration:i,enterFromClass:a=`${r}-enter-from`,enterActiveClass:s=`${r}-enter-active`,enterToClass:o=`${r}-enter-to`,appearFromClass:u=a,appearActiveClass:l=s,appearToClass:c=o,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:h=`${r}-leave-active`,leaveToClass:p=`${r}-leave-to`}=t,v=GJ(i),m=v&&v[0],b=v&&v[1],{onBeforeEnter:y,onEnter:S,onEnterCancelled:x,onLeave:A,onLeaveCancelled:_,onBeforeAppear:w=y,onAppear:C=S,onAppearCancelled:E=x}=e,N=(F,U,V)=>{go(F,U?c:o),go(F,U?l:s),V&&V()},M=(F,U)=>{F._isLeaving=!1,go(F,f),go(F,p),go(F,h),U&&U()},O=F=>(U,V)=>{const H=F?C:S,I=()=>N(U,F,V);bu(H,[U,I]),ED(()=>{go(U,F?u:a),_s(U,F?c:o),ND(H)||CD(U,n,m,I)})};return gi(e,{onBeforeEnter(F){bu(y,[F]),_s(F,a),_s(F,s)},onBeforeAppear(F){bu(w,[F]),_s(F,u),_s(F,l)},onEnter:O(!1),onAppear:O(!0),onLeave(F,U){F._isLeaving=!0;const V=()=>M(F,U);_s(F,f),U3(),_s(F,h),ED(()=>{F._isLeaving&&(go(F,f),_s(F,p),ND(A)||CD(F,n,b,V))}),bu(A,[F,V])},onEnterCancelled(F){N(F,!1),bu(x,[F])},onAppearCancelled(F){N(F,!0),bu(E,[F])},onLeaveCancelled(F){M(F),bu(_,[F])}})}function GJ(t){if(t==null)return null;if(WM(t))return[Py(t.enter),Py(t.leave)];{const e=Py(t);return[e,e]}}function Py(t){return Zy(t)}function _s(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.add(r)),(t[oc]||(t[oc]=new Set)).add(e)}function go(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const r=t[oc];r&&(r.delete(e),r.size||(t[oc]=void 0))}function ED(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let XJ=0;function CD(t,e,r,n){const i=t._endId=++XJ,a=()=>{i===t._endId&&n()};if(r)return setTimeout(a,r);const{type:s,timeout:o,propCount:u}=z3(t,e);if(!s)return n();const l=s+"end";let c=0;const f=()=>{t.removeEventListener(l,h),a()},h=p=>{p.target===t&&++c>=u&&f()};setTimeout(()=>{c(r[v]||"").split(", "),i=n(`${mo}Delay`),a=n(`${mo}Duration`),s=MD(i,a),o=n(`${Wf}Delay`),u=n(`${Wf}Duration`),l=MD(o,u);let c=null,f=0,h=0;e===mo?s>0&&(c=mo,f=s,h=a.length):e===Wf?l>0&&(c=Wf,f=l,h=u.length):(f=Math.max(s,l),c=f>0?s>l?mo:Wf:null,h=c?c===mo?a.length:u.length:0);const p=c===mo&&/\b(transform|all)(,|$)/.test(n(`${mo}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:p}}function MD(t,e){for(;t.lengthTD(r)+TD(t[n])))}function TD(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function U3(){return document.body.offsetHeight}function ZJ(t,e,r){const n=t[oc];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const Fh=Symbol("_vod"),q3={beforeMount(t,{value:e},{transition:r}){t[Fh]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):Vf(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e==!r&&t.style.display===t[Fh]||(n?e?(n.beforeEnter(t),Vf(t,!0),n.enter(t)):n.leave(t,()=>{Vf(t,!1)}):Vf(t,e))},beforeUnmount(t,{value:e}){Vf(t,e)}};function Vf(t,e){t.style.display=e?t[Fh]:"none"}function KJ(){q3.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const H3=Symbol("");function JJ(t){const e=$v();if(!e)return;const r=e.ut=(i=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(a=>Ob(a,i))},n=()=>{const i=t(e.proxy);Tb(e.subTree,i),r(i)};VM(n),YM(()=>{const i=new MutationObserver(n);i.observe(e.subTree.el.parentNode,{childList:!0}),jM(()=>i.disconnect())})}function Tb(t,e){if(t.shapeFlag&128){const r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{Tb(r.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)Ob(t.el,e);else if(t.type===l1)t.children.forEach(r=>Tb(r,e));else if(t.type===XM){let{el:r,anchor:n}=t;for(;r&&(Ob(r,e),r!==n);)r=r.nextSibling}}function Ob(t,e){if(t.nodeType===1){const r=t.style;let n="";for(const i in e)r.setProperty(`--${i}`,e[i]),n+=`--${i}: ${e[i]};`;r[H3]=n}}const QJ=/(^|;)\s*display\s*:/;function eQ(t,e,r){const n=t.style,i=jr(r),a=n.display;let s=!1;if(r&&!i){if(e&&!jr(e))for(const o in e)r[o]==null&&Fb(n,o,"");for(const o in r)o==="display"&&(s=!0),Fb(n,o,r[o])}else if(i){if(e!==r){const o=n[H3];o&&(r+=";"+o),n.cssText=r,s=QJ.test(r)}}else e&&t.removeAttribute("style");Fh in t&&(t[Fh]=s?n.display:"",n.display=a)}const OD=/\s*!important$/;function Fb(t,e,r){if(Hn(r))r.forEach(n=>Fb(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=tQ(t,e);OD.test(r)?t.setProperty(_o(n),r.replace(OD,""),"important"):t[n]=r}}const FD=["Webkit","Moz","ms"],Iy={};function tQ(t,e){const r=Iy[e];if(r)return r;let n=Oi(e);if(n!=="filter"&&n in t)return Iy[e]=n;n=zv(n);for(let i=0;iky||(oQ.then(()=>ky=0),ky=Date.now());function lQ(t,e){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;rT(cQ(n,r.value),e,5,[n])};return r.value=t,r.attached=uQ(),r}function cQ(t,e){if(Hn(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const ID=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,fQ=(t,e,r,n,i,a,s,o,u)=>{const l=i==="svg";e==="class"?ZJ(t,n,l):e==="style"?eQ(t,r,n):f1(e)?N$(e)||aQ(t,e,r,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):hQ(t,e,n,l))?nQ(t,e,n,a,s,o,u):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),rQ(t,e,n,l))};function hQ(t,e,r,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&ID(e)&&zM(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return ID(e)&&jr(r)?!1:e in t}/*! #__NO_SIDE_EFFECTS__ */function W3(t,e){const r=c1(t);class n extends wg{constructor(a){super(r,a,e)}}return n.def=r,n}/*! #__NO_SIDE_EFFECTS__ */const dQ=t=>W3(t,tR),pQ=typeof HTMLElement<"u"?HTMLElement:class{};class wg extends pQ{constructor(e,r={},n){super(),this._def=e,this._props=r,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,this._ob&&(this._ob.disconnect(),this._ob=null),o1(()=>{this._connected||(Rb(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let n=0;n{for(const i of n)this._setAttr(i.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(n,i=!1)=>{const{props:a,styles:s}=n;let o;if(a&&!Hn(a))for(const u in a){const l=a[u];(l===Number||l&&l.type===Number)&&(u in this._props&&(this._props[u]=Zy(this._props[u])),(o||(o=Object.create(null)))[Oi(u)]=!0)}this._numberProps=o,i&&this._resolveProps(n),this._applyStyles(s),this._update()},r=this._def.__asyncLoader;r?r().then(n=>e(n,!0)):e(this._def)}_resolveProps(e){const{props:r}=e,n=Hn(r)?r:Object.keys(r||{});for(const i of Object.keys(this))i[0]!=="_"&&n.includes(i)&&this._setProp(i,this[i],!0,!1);for(const i of n.map(Oi))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(a){this._setProp(i,a)}})}_setAttr(e){let r=this.getAttribute(e);const n=Oi(e);this._numberProps&&this._numberProps[n]&&(r=Zy(r)),this._setProp(n,r,!1)}_getProp(e){return this._props[e]}_setProp(e,r,n=!0,i=!0){r!==this._props[e]&&(this._props[e]=r,i&&this._instance&&this._update(),n&&(r===!0?this.setAttribute(_o(e),""):typeof r=="string"||typeof r=="number"?this.setAttribute(_o(e),r+""):r||this.removeAttribute(_o(e))))}_update(){Rb(this._createVNode(),this.shadowRoot)}_createVNode(){const e=u1(this._def,gi({},this._props));return this._instance||(e.ce=r=>{this._instance=r,r.isCE=!0;const n=(a,s)=>{this.dispatchEvent(new CustomEvent(a,{detail:s}))};r.emit=(a,...s)=>{n(a,s),_o(a)!==a&&n(_o(a),s)};let i=this;for(;i=i&&(i.parentNode||i.host);)if(i instanceof wg){r.parent=i._instance,r.provides=i._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(r=>{const n=document.createElement("style");n.textContent=r,this.shadowRoot.appendChild(n)})}}function mQ(t="$style"){{const e=$v();if(!e)return Wl;const r=e.type.__cssModules;if(!r)return Wl;const n=r[t];return n||Wl}}const V3=new WeakMap,Y3=new WeakMap,iv=Symbol("_moveCb"),kD=Symbol("_enterCb"),j3={name:"TransitionGroup",props:gi({},jJ,{tag:String,moveClass:String}),setup(t,{slots:e}){const r=$v(),n=ZM();let i,a;return KM(()=>{if(!i.length)return;const s=t.moveClass||`${t.name||"v"}-move`;if(!wQ(i[0].el,r.vnode.el,s))return;i.forEach(yQ),i.forEach(bQ);const o=i.filter(xQ);U3(),o.forEach(u=>{const l=u.el,c=l.style;_s(l,s),c.transform=c.webkitTransform=c.transitionDuration="";const f=l[iv]=h=>{h&&h.target!==l||(!h||/transform$/.test(h.propertyName))&&(l.removeEventListener("transitionend",f),l[iv]=null,go(l,s))};l.addEventListener("transitionend",f)})}),()=>{const s=JM(t),o=$3(s);let u=s.tag||l1;i=a,a=e.default?QM(e.default()):[];for(let l=0;ldelete t.mode;j3.props;const gQ=j3;function yQ(t){const e=t.el;e[iv]&&e[iv](),e[kD]&&e[kD]()}function bQ(t){Y3.set(t,t.el.getBoundingClientRect())}function xQ(t){const e=V3.get(t),r=Y3.get(t),n=e.left-r.left,i=e.top-r.top;if(n||i){const a=t.el.style;return a.transform=a.webkitTransform=`translate(${n}px,${i}px)`,a.transitionDuration="0s",t}}function wQ(t,e,r){const n=t.cloneNode(),i=t[oc];i&&i.forEach(o=>{o.split(/\s+/).forEach(u=>u&&n.classList.remove(u))}),r.split(/\s+/).forEach(o=>o&&n.classList.add(o)),n.style.display="none";const a=e.nodeType===1?e:e.parentNode;a.appendChild(n);const{hasTransform:s}=z3(n);return a.removeChild(n),s}const ko=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Hn(e)?r=>D$(e,r):e};function SQ(t){t.target.composing=!0}function LD(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const ra=Symbol("_assign"),av={created(t,{modifiers:{lazy:e,trim:r,number:n}},i){t[ra]=ko(i);const a=n||i.props&&i.props.type==="number";Es(t,e?"change":"input",s=>{if(s.target.composing)return;let o=t.value;r&&(o=o.trim()),a&&(o=Pm(o)),t[ra](o)}),r&&Es(t,"change",()=>{t.value=t.value.trim()}),e||(Es(t,"compositionstart",SQ),Es(t,"compositionend",LD),Es(t,"change",LD))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:r,trim:n,number:i}},a){if(t[ra]=ko(a),t.composing)return;const s=i||t.type==="number"?Pm(t.value):t.value,o=e??"";s!==o&&(document.activeElement===t&&t.type!=="range"&&(r||n&&t.value.trim()===o)||(t.value=o))}},Nx={deep:!0,created(t,e,r){t[ra]=ko(r),Es(t,"change",()=>{const n=t._modelValue,i=uc(t),a=t.checked,s=t[ra];if(Hn(n)){const o=Lv(n,i),u=o!==-1;if(a&&!u)s(n.concat(i));else if(!a&&u){const l=[...n];l.splice(o,1),s(l)}}else if(Wh(n)){const o=new Set(n);a?o.add(i):o.delete(i),s(o)}else s(X3(t,a))})},mounted:$D,beforeUpdate(t,e,r){t[ra]=ko(r),$D(t,e,r)}};function $D(t,{value:e,oldValue:r},n){t._modelValue=e,Hn(e)?t.checked=Lv(e,n.props.value)>-1:Wh(e)?t.checked=e.has(n.props.value):e!==r&&(t.checked=vh(e,X3(t,!0)))}const Ex={created(t,{value:e},r){t.checked=vh(e,r.props.value),t[ra]=ko(r),Es(t,"change",()=>{t[ra](uc(t))})},beforeUpdate(t,{value:e,oldValue:r},n){t[ra]=ko(n),e!==r&&(t.checked=vh(e,n.props.value))}},G3={deep:!0,created(t,{value:e,modifiers:{number:r}},n){const i=Wh(e);Es(t,"change",()=>{const a=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>r?Pm(uc(s)):uc(s));t[ra](t.multiple?i?new Set(a):a:a[0]),t._assigning=!0,o1(()=>{t._assigning=!1})}),t[ra]=ko(n)},mounted(t,{value:e,oldValue:r,modifiers:{number:n}}){zD(t,e,r,n)},beforeUpdate(t,e,r){t[ra]=ko(r)},updated(t,{value:e,oldValue:r,modifiers:{number:n}}){t._assigning||zD(t,e,r,n)}};function zD(t,e,r,n){const i=t.multiple,a=Hn(e);if(!(i&&!a&&!Wh(e))){for(let s=0,o=t.options.length;s-1}else u.selected=e.has(l);else if(vh(uc(u),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function uc(t){return"_value"in t?t._value:t.value}function X3(t,e){const r=e?"_trueValue":"_falseValue";return r in t?t[r]:e}const Z3={created(t,e,r){Xp(t,e,r,null,"created")},mounted(t,e,r){Xp(t,e,r,null,"mounted")},beforeUpdate(t,e,r,n){Xp(t,e,r,n,"beforeUpdate")},updated(t,e,r,n){Xp(t,e,r,n,"updated")}};function K3(t,e){switch(t){case"SELECT":return G3;case"TEXTAREA":return av;default:switch(e){case"checkbox":return Nx;case"radio":return Ex;default:return av}}}function Xp(t,e,r,n,i){const s=K3(t.tagName,r.props&&r.props.type)[i];s&&s(t,e,r,n)}function _Q(){av.getSSRProps=({value:t})=>({value:t}),Ex.getSSRProps=({value:t},e)=>{if(e.props&&vh(e.props.value,t))return{checked:!0}},Nx.getSSRProps=({value:t},e)=>{if(Hn(t)){if(e.props&&Lv(t,e.props.value)>-1)return{checked:!0}}else if(Wh(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},Z3.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const r=K3(e.type.toUpperCase(),e.props&&e.props.type);if(r.getSSRProps)return r.getSSRProps(t,e)}}const AQ=["ctrl","shift","alt","meta"],DQ={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>AQ.some(r=>t[`${r}Key`]&&!e.includes(r))},NQ=(t,e)=>{const r=t._withMods||(t._withMods={}),n=e.join(".");return r[n]||(r[n]=(i,...a)=>{for(let s=0;s{const r=t._withKeys||(t._withKeys={}),n=e.join(".");return r[n]||(r[n]=i=>{if(!("key"in i))return;const a=_o(i.key);if(e.some(s=>s===a||EQ[s]===a))return t(i)})},J3=gi({patchProp:fQ},YJ);let ph,UD=!1;function Q3(){return ph||(ph=GM(J3))}function eR(){return ph=UD?ph:eT(J3),UD=!0,ph}const Rb=(...t)=>{Q3().render(...t)},tR=(...t)=>{eR().hydrate(...t)},Cx=(...t)=>{const e=Q3().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=nR(n);if(!i)return;const a=e._component;!zM(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.innerHTML="";const s=r(i,!1,rR(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},e},MQ=(...t)=>{const e=eR().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=nR(n);if(i)return r(i,!0,rR(i))},e};function rR(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function nR(t){return jr(t)?document.querySelector(t):t}let qD=!1;const TQ=()=>{qD||(qD=!0,_Q(),KJ())},OQ=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:qM,BaseTransitionPropsValidators:HM,Comment:C$,DeprecationTypes:M$,EffectScope:T$,ErrorCodes:O$,ErrorTypeStrings:F$,Fragment:l1,KeepAlive:R$,ReactiveEffect:B$,Static:XM,Suspense:P$,Teleport:I$,Text:k$,TrackOpTypes:L$,Transition:Dx,TransitionGroup:gQ,TriggerOpTypes:$$,VueElement:wg,assertNumber:z$,callWithAsyncErrorHandling:rT,callWithErrorHandling:U$,camelize:Oi,capitalize:zv,cloneVNode:q$,compatUtils:H$,computed:W$,createApp:Cx,createBlock:V$,createCommentVNode:Y$,createElementBlock:j$,createElementVNode:G$,createHydrationRenderer:eT,createPropsRestProxy:X$,createRenderer:GM,createSSRApp:MQ,createSlots:Z$,createStaticVNode:K$,createTextVNode:J$,createVNode:u1,customRef:Q$,defineAsyncComponent:nT,defineComponent:c1,defineCustomElement:W3,defineEmits:ez,defineExpose:tz,defineModel:rz,defineOptions:nz,defineProps:iz,defineSSRCustomElement:dQ,defineSlots:az,devtools:sz,effect:oz,effectScope:uz,getCurrentInstance:$v,getCurrentScope:lz,getTransitionRawChildren:QM,guardReactiveProps:cz,h:UM,handleError:fz,hasInjectionContext:hz,hydrate:tR,initCustomFormatter:dz,initDirectivesForSSR:TQ,inject:pz,isMemoSame:mz,isProxy:vz,isReactive:gz,isReadonly:yz,isRef:bz,isRuntimeOnly:xz,isShallow:wz,isVNode:Sz,markRaw:iT,mergeDefaults:_z,mergeModels:Az,mergeProps:Dz,nextTick:o1,normalizeClass:Nz,normalizeProps:Ez,normalizeStyle:Cz,onActivated:Mz,onBeforeMount:Tz,onBeforeUnmount:Oz,onBeforeUpdate:Fz,onDeactivated:Rz,onErrorCaptured:Bz,onMounted:YM,onRenderTracked:Pz,onRenderTriggered:Iz,onScopeDispose:kz,onServerPrefetch:Lz,onUnmounted:jM,onUpdated:KM,openBlock:$z,popScopeId:zz,provide:Uz,proxyRefs:qz,pushScopeId:Hz,queuePostFlushCb:Wz,reactive:Vz,readonly:Yz,ref:jz,registerRuntimeCompiler:aT,render:Rb,renderList:Gz,renderSlot:Xz,resolveComponent:Zz,resolveDirective:Kz,resolveDynamicComponent:Jz,resolveFilter:Qz,resolveTransitionHooks:Jy,setBlockTracking:e9,setDevtoolsHook:t9,setTransitionHooks:Ky,shallowReactive:r9,shallowReadonly:n9,shallowRef:Uv,ssrContextKey:i9,ssrUtils:a9,stop:s9,toDisplayString:o9,toHandlerKey:sT,toHandlers:u9,toRaw:JM,toRef:l9,toRefs:c9,toValue:f9,transformVNodeArgs:h9,triggerRef:d9,unref:p9,useAttrs:m9,useCssModule:mQ,useCssVars:JJ,useModel:v9,useSSRContext:g9,useSlots:y9,useTransitionState:ZM,vModelCheckbox:Nx,vModelDynamic:Z3,vModelRadio:Ex,vModelSelect:G3,vModelText:av,vShow:q3,version:b9,warn:x9,watch:w9,watchEffect:S9,watchPostEffect:VM,watchSyncEffect:_9,withAsyncContext:A9,withCtx:D9,withDefaults:N9,withDirectives:E9,withKeys:CQ,withMemo:C9,withModifiers:NQ,withScopeId:M9},Symbol.toStringTag,{value:"Module"}));/** +**/const VJ="http://www.w3.org/2000/svg",YJ="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,MD=bo&&bo.createElement("template"),jJ={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e==="svg"?bo.createElementNS(VJ,t):e==="mathml"?bo.createElementNS(YJ,t):bo.createElement(t,r?{is:r}:void 0);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>bo.createTextNode(t),createComment:t=>bo.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>bo.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,n,i,a){const s=r?r.previousSibling:e.lastChild;if(i&&(i===a||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===a||!(i=i.nextSibling)););else{MD.innerHTML=n==="svg"?`${t}`:n==="mathml"?`${t}`:t;const o=MD.content;if(n==="svg"||n==="mathml"){const u=o.firstChild;for(;u.firstChild;)o.appendChild(u.firstChild);o.removeChild(u)}e.insertBefore(o,r)}return[s?s.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},mo="transition",Hf="animation",sc=Symbol("_vtc"),Px=(t,{slots:e})=>VM(YM,U3(t),e);Px.displayName="Transition";const z3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},GJ=Px.props=gi({},jM,z3),bu=(t,e=[])=>{Hn(t)?t.forEach(r=>r(...e)):t&&t(...e)},TD=t=>t?Hn(t)?t.some(e=>e.length>1):t.length>1:!1;function U3(t){const e={};for(const F in t)F in z3||(e[F]=t[F]);if(t.css===!1)return e;const{name:r="v",type:n,duration:i,enterFromClass:a=`${r}-enter-from`,enterActiveClass:s=`${r}-enter-active`,enterToClass:o=`${r}-enter-to`,appearFromClass:u=a,appearActiveClass:l=s,appearToClass:c=o,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:h=`${r}-leave-active`,leaveToClass:p=`${r}-leave-to`}=t,v=XJ(i),m=v&&v[0],b=v&&v[1],{onBeforeEnter:y,onEnter:S,onEnterCancelled:x,onLeave:A,onLeaveCancelled:_,onBeforeAppear:w=y,onAppear:C=S,onAppearCancelled:E=x}=e,N=(F,U,V)=>{go(F,U?c:o),go(F,U?l:s),V&&V()},M=(F,U)=>{F._isLeaving=!1,go(F,f),go(F,p),go(F,h),U&&U()},O=F=>(U,V)=>{const H=F?C:S,I=()=>N(U,F,V);bu(H,[U,I]),OD(()=>{go(U,F?u:a),_s(U,F?c:o),TD(H)||FD(U,n,m,I)})};return gi(e,{onBeforeEnter(F){bu(y,[F]),_s(F,a),_s(F,s)},onBeforeAppear(F){bu(w,[F]),_s(F,u),_s(F,l)},onEnter:O(!1),onAppear:O(!0),onLeave(F,U){F._isLeaving=!0;const V=()=>M(F,U);_s(F,f),H3(),_s(F,h),OD(()=>{F._isLeaving&&(go(F,f),_s(F,p),TD(A)||FD(F,n,b,V))}),bu(A,[F,V])},onEnterCancelled(F){N(F,!1),bu(x,[F])},onAppearCancelled(F){N(F,!0),bu(E,[F])},onLeaveCancelled(F){M(F),bu(_,[F])}})}function XJ(t){if(t==null)return null;if(GM(t))return[ky(t.enter),ky(t.leave)];{const e=ky(t);return[e,e]}}function ky(t){return Jy(t)}function _s(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.add(r)),(t[sc]||(t[sc]=new Set)).add(e)}function go(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const r=t[sc];r&&(r.delete(e),r.size||(t[sc]=void 0))}function OD(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let ZJ=0;function FD(t,e,r,n){const i=t._endId=++ZJ,a=()=>{i===t._endId&&n()};if(r)return setTimeout(a,r);const{type:s,timeout:o,propCount:u}=q3(t,e);if(!s)return n();const l=s+"end";let c=0;const f=()=>{t.removeEventListener(l,h),a()},h=p=>{p.target===t&&++c>=u&&f()};setTimeout(()=>{c(r[v]||"").split(", "),i=n(`${mo}Delay`),a=n(`${mo}Duration`),s=RD(i,a),o=n(`${Hf}Delay`),u=n(`${Hf}Duration`),l=RD(o,u);let c=null,f=0,h=0;e===mo?s>0&&(c=mo,f=s,h=a.length):e===Hf?l>0&&(c=Hf,f=l,h=u.length):(f=Math.max(s,l),c=f>0?s>l?mo:Hf:null,h=c?c===mo?a.length:u.length:0);const p=c===mo&&/\b(transform|all)(,|$)/.test(n(`${mo}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:p}}function RD(t,e){for(;t.lengthBD(r)+BD(t[n])))}function BD(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function H3(){return document.body.offsetHeight}function KJ(t,e,r){const n=t[sc];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const Fh=Symbol("_vod"),W3={beforeMount(t,{value:e},{transition:r}){t[Fh]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):Wf(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e==!r&&t.style.display===t[Fh]||(n?e?(n.beforeEnter(t),Wf(t,!0),n.enter(t)):n.leave(t,()=>{Wf(t,!1)}):Wf(t,e))},beforeUnmount(t,{value:e}){Wf(t,e)}};function Wf(t,e){t.style.display=e?t[Fh]:"none"}function JJ(){W3.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const V3=Symbol("");function QJ(t){const e=Uv();if(!e)return;const r=e.ut=(i=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(a=>Fb(a,i))},n=()=>{const i=t(e.proxy);Ob(e.subTree,i),r(i)};XM(n),ZM(()=>{const i=new MutationObserver(n);i.observe(e.subTree.el.parentNode,{childList:!0}),KM(()=>i.disconnect())})}function Ob(t,e){if(t.shapeFlag&128){const r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{Ob(r.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)Fb(t.el,e);else if(t.type===x1)t.children.forEach(r=>Ob(r,e));else if(t.type===QM){let{el:r,anchor:n}=t;for(;r&&(Fb(r,e),r!==n);)r=r.nextSibling}}function Fb(t,e){if(t.nodeType===1){const r=t.style;let n="";for(const i in e)r.setProperty(`--${i}`,e[i]),n+=`--${i}: ${e[i]};`;r[V3]=n}}const eQ=/(^|;)\s*display\s*:/;function tQ(t,e,r){const n=t.style,i=jr(r),a=n.display;let s=!1;if(r&&!i){if(e&&!jr(e))for(const o in e)r[o]==null&&Rb(n,o,"");for(const o in r)o==="display"&&(s=!0),Rb(n,o,r[o])}else if(i){if(e!==r){const o=n[V3];o&&(r+=";"+o),n.cssText=r,s=eQ.test(r)}}else e&&t.removeAttribute("style");Fh in t&&(t[Fh]=s?n.display:"",n.display=a)}const PD=/\s*!important$/;function Rb(t,e,r){if(Hn(r))r.forEach(n=>Rb(t,e,n));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const n=rQ(t,e);PD.test(r)?t.setProperty(_o(n),r.replace(PD,""),"important"):t[n]=r}}const ID=["Webkit","Moz","ms"],Ly={};function rQ(t,e){const r=Ly[e];if(r)return r;let n=Oi(e);if(n!=="filter"&&n in t)return Ly[e]=n;n=qv(n);for(let i=0;i$y||(uQ.then(()=>$y=0),$y=Date.now());function cQ(t,e){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;sT(fQ(n,r.value),e,5,[n])};return r.value=t,r.attached=lQ(),r}function fQ(t,e){if(Hn(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const zD=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,hQ=(t,e,r,n,i,a,s,o,u)=>{const l=i==="svg";e==="class"?KJ(t,n,l):e==="style"?tQ(t,r,n):S1(e)?D$(e)||sQ(t,e,r,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):dQ(t,e,n,l))?iQ(t,e,n,a,s,o,u):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),nQ(t,e,n,l))};function dQ(t,e,r,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&zD(e)&&WM(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return zD(e)&&jr(r)?!1:e in t}/*! #__NO_SIDE_EFFECTS__ */function Y3(t,e){const r=w1(t);class n extends _g{constructor(a){super(r,a,e)}}return n.def=r,n}/*! #__NO_SIDE_EFFECTS__ */const pQ=t=>Y3(t,nR),mQ=typeof HTMLElement<"u"?HTMLElement:class{};class _g extends mQ{constructor(e,r={},n){super(),this._def=e,this._props=r,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,this._ob&&(this._ob.disconnect(),this._ob=null),y1(()=>{this._connected||(Bb(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let n=0;n{for(const i of n)this._setAttr(i.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(n,i=!1)=>{const{props:a,styles:s}=n;let o;if(a&&!Hn(a))for(const u in a){const l=a[u];(l===Number||l&&l.type===Number)&&(u in this._props&&(this._props[u]=Jy(this._props[u])),(o||(o=Object.create(null)))[Oi(u)]=!0)}this._numberProps=o,i&&this._resolveProps(n),this._applyStyles(s),this._update()},r=this._def.__asyncLoader;r?r().then(n=>e(n,!0)):e(this._def)}_resolveProps(e){const{props:r}=e,n=Hn(r)?r:Object.keys(r||{});for(const i of Object.keys(this))i[0]!=="_"&&n.includes(i)&&this._setProp(i,this[i],!0,!1);for(const i of n.map(Oi))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(a){this._setProp(i,a)}})}_setAttr(e){let r=this.getAttribute(e);const n=Oi(e);this._numberProps&&this._numberProps[n]&&(r=Jy(r)),this._setProp(n,r,!1)}_getProp(e){return this._props[e]}_setProp(e,r,n=!0,i=!0){r!==this._props[e]&&(this._props[e]=r,i&&this._instance&&this._update(),n&&(r===!0?this.setAttribute(_o(e),""):typeof r=="string"||typeof r=="number"?this.setAttribute(_o(e),r+""):r||this.removeAttribute(_o(e))))}_update(){Bb(this._createVNode(),this.shadowRoot)}_createVNode(){const e=b1(this._def,gi({},this._props));return this._instance||(e.ce=r=>{this._instance=r,r.isCE=!0;const n=(a,s)=>{this.dispatchEvent(new CustomEvent(a,{detail:s}))};r.emit=(a,...s)=>{n(a,s),_o(a)!==a&&n(_o(a),s)};let i=this;for(;i=i&&(i.parentNode||i.host);)if(i instanceof _g){r.parent=i._instance,r.provides=i._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(r=>{const n=document.createElement("style");n.textContent=r,this.shadowRoot.appendChild(n)})}}function vQ(t="$style"){{const e=Uv();if(!e)return Wl;const r=e.type.__cssModules;if(!r)return Wl;const n=r[t];return n||Wl}}const j3=new WeakMap,G3=new WeakMap,sv=Symbol("_moveCb"),UD=Symbol("_enterCb"),X3={name:"TransitionGroup",props:gi({},GJ,{tag:String,moveClass:String}),setup(t,{slots:e}){const r=Uv(),n=eT();let i,a;return tT(()=>{if(!i.length)return;const s=t.moveClass||`${t.name||"v"}-move`;if(!SQ(i[0].el,r.vnode.el,s))return;i.forEach(bQ),i.forEach(xQ);const o=i.filter(wQ);H3(),o.forEach(u=>{const l=u.el,c=l.style;_s(l,s),c.transform=c.webkitTransform=c.transitionDuration="";const f=l[sv]=h=>{h&&h.target!==l||(!h||/transform$/.test(h.propertyName))&&(l.removeEventListener("transitionend",f),l[sv]=null,go(l,s))};l.addEventListener("transitionend",f)})}),()=>{const s=rT(t),o=U3(s);let u=s.tag||x1;i=a,a=e.default?nT(e.default()):[];for(let l=0;ldelete t.mode;X3.props;const yQ=X3;function bQ(t){const e=t.el;e[sv]&&e[sv](),e[UD]&&e[UD]()}function xQ(t){G3.set(t,t.el.getBoundingClientRect())}function wQ(t){const e=j3.get(t),r=G3.get(t),n=e.left-r.left,i=e.top-r.top;if(n||i){const a=t.el.style;return a.transform=a.webkitTransform=`translate(${n}px,${i}px)`,a.transitionDuration="0s",t}}function SQ(t,e,r){const n=t.cloneNode(),i=t[sc];i&&i.forEach(o=>{o.split(/\s+/).forEach(u=>u&&n.classList.remove(u))}),r.split(/\s+/).forEach(o=>o&&n.classList.add(o)),n.style.display="none";const a=e.nodeType===1?e:e.parentNode;a.appendChild(n);const{hasTransform:s}=q3(n);return a.removeChild(n),s}const ko=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Hn(e)?r=>A$(e,r):e};function _Q(t){t.target.composing=!0}function qD(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const ra=Symbol("_assign"),ov={created(t,{modifiers:{lazy:e,trim:r,number:n}},i){t[ra]=ko(i);const a=n||i.props&&i.props.type==="number";Es(t,e?"change":"input",s=>{if(s.target.composing)return;let o=t.value;r&&(o=o.trim()),a&&(o=Pm(o)),t[ra](o)}),r&&Es(t,"change",()=>{t.value=t.value.trim()}),e||(Es(t,"compositionstart",_Q),Es(t,"compositionend",qD),Es(t,"change",qD))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:r,trim:n,number:i}},a){if(t[ra]=ko(a),t.composing)return;const s=i||t.type==="number"?Pm(t.value):t.value,o=e??"";s!==o&&(document.activeElement===t&&t.type!=="range"&&(r||n&&t.value.trim()===o)||(t.value=o))}},Ix={deep:!0,created(t,e,r){t[ra]=ko(r),Es(t,"change",()=>{const n=t._modelValue,i=oc(t),a=t.checked,s=t[ra];if(Hn(n)){const o=zv(n,i),u=o!==-1;if(a&&!u)s(n.concat(i));else if(!a&&u){const l=[...n];l.splice(o,1),s(l)}}else if(Wh(n)){const o=new Set(n);a?o.add(i):o.delete(i),s(o)}else s(K3(t,a))})},mounted:HD,beforeUpdate(t,e,r){t[ra]=ko(r),HD(t,e,r)}};function HD(t,{value:e,oldValue:r},n){t._modelValue=e,Hn(e)?t.checked=zv(e,n.props.value)>-1:Wh(e)?t.checked=e.has(n.props.value):e!==r&&(t.checked=mh(e,K3(t,!0)))}const kx={created(t,{value:e},r){t.checked=mh(e,r.props.value),t[ra]=ko(r),Es(t,"change",()=>{t[ra](oc(t))})},beforeUpdate(t,{value:e,oldValue:r},n){t[ra]=ko(n),e!==r&&(t.checked=mh(e,n.props.value))}},Z3={deep:!0,created(t,{value:e,modifiers:{number:r}},n){const i=Wh(e);Es(t,"change",()=>{const a=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>r?Pm(oc(s)):oc(s));t[ra](t.multiple?i?new Set(a):a:a[0]),t._assigning=!0,y1(()=>{t._assigning=!1})}),t[ra]=ko(n)},mounted(t,{value:e,oldValue:r,modifiers:{number:n}}){WD(t,e,r,n)},beforeUpdate(t,e,r){t[ra]=ko(r)},updated(t,{value:e,oldValue:r,modifiers:{number:n}}){t._assigning||WD(t,e,r,n)}};function WD(t,e,r,n){const i=t.multiple,a=Hn(e);if(!(i&&!a&&!Wh(e))){for(let s=0,o=t.options.length;s-1}else u.selected=e.has(l);else if(mh(oc(u),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function oc(t){return"_value"in t?t._value:t.value}function K3(t,e){const r=e?"_trueValue":"_falseValue";return r in t?t[r]:e}const J3={created(t,e,r){Xp(t,e,r,null,"created")},mounted(t,e,r){Xp(t,e,r,null,"mounted")},beforeUpdate(t,e,r,n){Xp(t,e,r,n,"beforeUpdate")},updated(t,e,r,n){Xp(t,e,r,n,"updated")}};function Q3(t,e){switch(t){case"SELECT":return Z3;case"TEXTAREA":return ov;default:switch(e){case"checkbox":return Ix;case"radio":return kx;default:return ov}}}function Xp(t,e,r,n,i){const s=Q3(t.tagName,r.props&&r.props.type)[i];s&&s(t,e,r,n)}function AQ(){ov.getSSRProps=({value:t})=>({value:t}),kx.getSSRProps=({value:t},e)=>{if(e.props&&mh(e.props.value,t))return{checked:!0}},Ix.getSSRProps=({value:t},e)=>{if(Hn(t)){if(e.props&&zv(t,e.props.value)>-1)return{checked:!0}}else if(Wh(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},J3.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const r=Q3(e.type.toUpperCase(),e.props&&e.props.type);if(r.getSSRProps)return r.getSSRProps(t,e)}}const DQ=["ctrl","shift","alt","meta"],NQ={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>DQ.some(r=>t[`${r}Key`]&&!e.includes(r))},EQ=(t,e)=>{const r=t._withMods||(t._withMods={}),n=e.join(".");return r[n]||(r[n]=(i,...a)=>{for(let s=0;s{const r=t._withKeys||(t._withKeys={}),n=e.join(".");return r[n]||(r[n]=i=>{if(!("key"in i))return;const a=_o(i.key);if(e.some(s=>s===a||CQ[s]===a))return t(i)})},eR=gi({patchProp:hQ},jJ);let dh,VD=!1;function tR(){return dh||(dh=JM(eR))}function rR(){return dh=VD?dh:iT(eR),VD=!0,dh}const Bb=(...t)=>{tR().render(...t)},nR=(...t)=>{rR().hydrate(...t)},Lx=(...t)=>{const e=tR().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=aR(n);if(!i)return;const a=e._component;!WM(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.innerHTML="";const s=r(i,!1,iR(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},e},TQ=(...t)=>{const e=rR().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=aR(n);if(i)return r(i,!0,iR(i))},e};function iR(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function aR(t){return jr(t)?document.querySelector(t):t}let YD=!1;const OQ=()=>{YD||(YD=!0,AQ(),JJ())},FQ=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:YM,BaseTransitionPropsValidators:jM,Comment:E$,DeprecationTypes:C$,EffectScope:M$,ErrorCodes:T$,ErrorTypeStrings:O$,Fragment:x1,KeepAlive:F$,ReactiveEffect:R$,Static:QM,Suspense:B$,Teleport:P$,Text:I$,TrackOpTypes:k$,Transition:Px,TransitionGroup:yQ,TriggerOpTypes:L$,VueElement:_g,assertNumber:$$,callWithAsyncErrorHandling:sT,callWithErrorHandling:z$,camelize:Oi,capitalize:qv,cloneVNode:U$,compatUtils:q$,computed:H$,createApp:Lx,createBlock:W$,createCommentVNode:V$,createElementBlock:Y$,createElementVNode:j$,createHydrationRenderer:iT,createPropsRestProxy:G$,createRenderer:JM,createSSRApp:TQ,createSlots:X$,createStaticVNode:Z$,createTextVNode:K$,createVNode:b1,customRef:J$,defineAsyncComponent:oT,defineComponent:w1,defineCustomElement:Y3,defineEmits:Q$,defineExpose:ez,defineModel:tz,defineOptions:rz,defineProps:nz,defineSSRCustomElement:pQ,defineSlots:iz,devtools:az,effect:sz,effectScope:oz,getCurrentInstance:Uv,getCurrentScope:uz,getTransitionRawChildren:nT,guardReactiveProps:lz,h:VM,handleError:cz,hasInjectionContext:fz,hydrate:nR,initCustomFormatter:hz,initDirectivesForSSR:OQ,inject:dz,isMemoSame:pz,isProxy:mz,isReactive:vz,isReadonly:gz,isRef:yz,isRuntimeOnly:bz,isShallow:xz,isVNode:wz,markRaw:uT,mergeDefaults:Sz,mergeModels:_z,mergeProps:Az,nextTick:y1,normalizeClass:Dz,normalizeProps:Nz,normalizeStyle:Ez,onActivated:Cz,onBeforeMount:Mz,onBeforeUnmount:Tz,onBeforeUpdate:Oz,onDeactivated:Fz,onErrorCaptured:Rz,onMounted:ZM,onRenderTracked:Bz,onRenderTriggered:Pz,onScopeDispose:Iz,onServerPrefetch:kz,onUnmounted:KM,onUpdated:tT,openBlock:Lz,popScopeId:$z,provide:zz,proxyRefs:Uz,pushScopeId:qz,queuePostFlushCb:Hz,reactive:Wz,readonly:Vz,ref:Yz,registerRuntimeCompiler:lT,render:Bb,renderList:jz,renderSlot:Gz,resolveComponent:Xz,resolveDirective:Zz,resolveDynamicComponent:Kz,resolveFilter:Jz,resolveTransitionHooks:eb,setBlockTracking:Qz,setDevtoolsHook:e9,setTransitionHooks:Qy,shallowReactive:t9,shallowReadonly:r9,shallowRef:Hv,ssrContextKey:n9,ssrUtils:i9,stop:a9,toDisplayString:s9,toHandlerKey:cT,toHandlers:o9,toRaw:rT,toRef:u9,toRefs:l9,toValue:c9,transformVNodeArgs:f9,triggerRef:h9,unref:d9,useAttrs:p9,useCssModule:vQ,useCssVars:QJ,useModel:m9,useSSRContext:v9,useSlots:g9,useTransitionState:eT,vModelCheckbox:Ix,vModelDynamic:J3,vModelRadio:kx,vModelSelect:Z3,vModelText:ov,vShow:W3,version:y9,warn:b9,watch:x9,watchEffect:w9,watchPostEffect:XM,watchSyncEffect:S9,withAsyncContext:_9,withCtx:A9,withDefaults:D9,withDirectives:N9,withKeys:MQ,withMemo:E9,withModifiers:EQ,withScopeId:C9},Symbol.toStringTag,{value:"Module"}));/** * @vue/compiler-core v3.4.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const Rh=Symbol(""),mh=Symbol(""),Mx=Symbol(""),sv=Symbol(""),iR=Symbol(""),ku=Symbol(""),aR=Symbol(""),sR=Symbol(""),Tx=Symbol(""),Ox=Symbol(""),ad=Symbol(""),Fx=Symbol(""),oR=Symbol(""),Rx=Symbol(""),Bx=Symbol(""),Px=Symbol(""),Ix=Symbol(""),kx=Symbol(""),Lx=Symbol(""),uR=Symbol(""),lR=Symbol(""),Sg=Symbol(""),ov=Symbol(""),$x=Symbol(""),zx=Symbol(""),Bh=Symbol(""),sd=Symbol(""),Ux=Symbol(""),Bb=Symbol(""),FQ=Symbol(""),Pb=Symbol(""),uv=Symbol(""),RQ=Symbol(""),BQ=Symbol(""),qx=Symbol(""),PQ=Symbol(""),IQ=Symbol(""),Hx=Symbol(""),cR=Symbol(""),lc={[Rh]:"Fragment",[mh]:"Teleport",[Mx]:"Suspense",[sv]:"KeepAlive",[iR]:"BaseTransition",[ku]:"openBlock",[aR]:"createBlock",[sR]:"createElementBlock",[Tx]:"createVNode",[Ox]:"createElementVNode",[ad]:"createCommentVNode",[Fx]:"createTextVNode",[oR]:"createStaticVNode",[Rx]:"resolveComponent",[Bx]:"resolveDynamicComponent",[Px]:"resolveDirective",[Ix]:"resolveFilter",[kx]:"withDirectives",[Lx]:"renderList",[uR]:"renderSlot",[lR]:"createSlots",[Sg]:"toDisplayString",[ov]:"mergeProps",[$x]:"normalizeClass",[zx]:"normalizeStyle",[Bh]:"normalizeProps",[sd]:"guardReactiveProps",[Ux]:"toHandlers",[Bb]:"camelize",[FQ]:"capitalize",[Pb]:"toHandlerKey",[uv]:"setBlockTracking",[RQ]:"pushScopeId",[BQ]:"popScopeId",[qx]:"withCtx",[PQ]:"unref",[IQ]:"isRef",[Hx]:"withMemo",[cR]:"isMemoSame"};function kQ(t){Object.getOwnPropertySymbols(t).forEach(e=>{lc[e]=t[e]})}const Bi={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function LQ(t,e=""){return{type:0,source:e,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:Bi}}function Ph(t,e,r,n,i,a,s,o=!1,u=!1,l=!1,c=Bi){return t&&(o?(t.helper(ku),t.helper(hc(t.inSSR,l))):t.helper(fc(t.inSSR,l)),s&&t.helper(kx)),{type:13,tag:e,props:r,children:n,patchFlag:i,dynamicProps:a,directives:s,isBlock:o,disableTracking:u,isComponent:l,loc:c}}function od(t,e=Bi){return{type:17,loc:e,elements:t}}function Ji(t,e=Bi){return{type:15,loc:e,properties:t}}function Yr(t,e){return{type:16,loc:Bi,key:jr(t)?$t(t,!0):t,value:e}}function $t(t,e=!1,r=Bi,n=0){return{type:4,loc:r,content:t,isStatic:e,constType:e?3:n}}function Sa(t,e=Bi){return{type:8,loc:e,children:t}}function hn(t,e=[],r=Bi){return{type:14,loc:r,callee:t,arguments:e}}function cc(t,e=void 0,r=!1,n=!1,i=Bi){return{type:18,params:t,returns:e,newline:r,isSlot:n,loc:i}}function Ib(t,e,r,n=!0){return{type:19,test:t,consequent:e,alternate:r,newline:n,loc:Bi}}function $Q(t,e,r=!1){return{type:20,index:t,value:e,isVNode:r,loc:Bi}}function zQ(t){return{type:21,body:t,loc:Bi}}function fc(t,e){return t||e?Tx:Ox}function hc(t,e){return t||e?aR:sR}function Wx(t,{helper:e,removeHelper:r,inSSR:n}){t.isBlock||(t.isBlock=!0,r(fc(n,t.isComponent)),e(ku),e(hc(n,t.isComponent)))}const HD=new Uint8Array([123,123]),WD=new Uint8Array([125,125]);function VD(t){return t>=97&&t<=122||t>=65&&t<=90}function Mi(t){return t===32||t===10||t===9||t===12||t===13}function vo(t){return t===47||t===62||Mi(t)}function lv(t){const e=new Uint8Array(t.length);for(let r=0;r=0;i--){const a=this.newlines[i];if(e>a){r=i+2,n=e-a;break}}return{column:n,line:r,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const r=this.index+1-this.delimiterOpen.length;r>this.sectionStart&&this.cbs.ontext(this.sectionStart,r),this.state=3,this.sectionStart=r}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const r=this.sequenceIndex===this.currentSequence.length;if(!(r?vo(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!r){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||Mi(e)){const r=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===In.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,r){}}function YD(t,{compatConfig:e}){const r=e&&e[t];return t==="MODE"?r||3:r}function Ou(t,e){const r=YD("MODE",e),n=YD(t,e);return r===3?n===!0:n!==!1}function Ih(t,e,r,...n){return Ou(t,e)}function Vx(t){throw t}function fR(t){}function kr(t,e,r,n){const i=`https://vuejs.org/error-reference/#compiler-${t}`,a=new SyntaxError(String(i));return a.code=t,a.loc=e,a}const vi=t=>t.type===4&&t.isStatic;function hR(t){switch(t){case"Teleport":case"teleport":return mh;case"Suspense":case"suspense":return Mx;case"KeepAlive":case"keep-alive":return sv;case"BaseTransition":case"base-transition":return iR}}const qQ=/^\d|[^\$\w]/,Yx=t=>!qQ.test(t),HQ=/[A-Za-z_$\xA0-\uFFFF]/,WQ=/[\.\?\w$\xA0-\uFFFF]/,VQ=/\s+[.[]\s*|\s*[.[]\s+/g,YQ=t=>{t=t.trim().replace(VQ,s=>s.trim());let e=0,r=[],n=0,i=0,a=null;for(let s=0;se.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function Ly(t){return t.type===5||t.type===2}function GQ(t){return t.type===7&&t.name==="slot"}function cv(t){return t.type===1&&t.tagType===3}function fv(t){return t.type===1&&t.tagType===2}const XQ=new Set([Bh,sd]);function pR(t,e=[]){if(t&&!jr(t)&&t.type===14){const r=t.callee;if(!jr(r)&&XQ.has(r))return pR(t.arguments[0],e.concat(t))}return[t,e]}function hv(t,e,r){let n,i=t.type===13?t.props:t.arguments[2],a=[],s;if(i&&!jr(i)&&i.type===14){const o=pR(i);i=o[0],a=o[1],s=a[a.length-1]}if(i==null||jr(i))n=Ji([e]);else if(i.type===14){const o=i.arguments[0];!jr(o)&&o.type===15?jD(e,o)||o.properties.unshift(e):i.callee===Ux?n=hn(r.helper(ov),[Ji([e]),i]):i.arguments.unshift(Ji([e])),!n&&(n=i)}else i.type===15?(jD(e,i)||i.properties.unshift(e),n=i):(n=hn(r.helper(ov),[Ji([e]),i]),s&&s.callee===sd&&(s=a[a.length-2]));t.type===13?s?s.arguments[0]=n:t.props=n:s?s.arguments[0]=n:t.arguments[2]=n}function jD(t,e){let r=!1;if(t.key.type===4){const n=t.key.content;r=e.properties.some(i=>i.key.type===4&&i.key.content===n)}return r}function kh(t,e){return`_${e}_${t.replace(/[^\w]/g,(r,n)=>r==="-"?"_":t.charCodeAt(n).toString())}`}function ZQ(t){return t.type===14&&t.callee===Hx?t.arguments[1].returns:t}const KQ=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,mR={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:cy,isPreTag:cy,isCustomElement:cy,onError:Vx,onWarn:fR,comments:!1,prefixIdentifiers:!1};let hr=mR,Lh=null,Fu="",Ln=null,rr=null,di="",As=-1,Su=-1,dv=0,xo=!1,kb=null;const Hr=[],Wr=new UQ(Hr,{onerr:bs,ontext(t,e){Zp(Cn(t,e),t,e)},ontextentity(t,e,r){Zp(t,e,r)},oninterpolation(t,e){if(xo)return Zp(Cn(t,e),t,e);let r=t+Wr.delimiterOpen.length,n=e-Wr.delimiterClose.length;for(;Mi(Fu.charCodeAt(r));)r++;for(;Mi(Fu.charCodeAt(n-1));)n--;let i=Cn(r,n);i.includes("&")&&(i=hr.decodeEntities(i,!1)),Lb({type:5,content:Om(i,!1,cn(r,n)),loc:cn(t,e)})},onopentagname(t,e){const r=Cn(t,e);Ln={type:1,tag:r,ns:hr.getNamespace(r,Hr[0],hr.ns),tagType:0,props:[],children:[],loc:cn(t-1,e),codegenNode:void 0}},onopentagend(t){XD(t)},onclosetag(t,e){const r=Cn(t,e);if(!hr.isVoidTag(r)){let n=!1;for(let i=0;i0&&bs(24,Hr[0].loc.start.offset);for(let s=0;s<=i;s++){const o=Hr.shift();Tm(o,e,s(n.type===7?n.rawName:n.name)===r)&&bs(2,e)},onattribend(t,e){if(Ln&&rr){if(Nu(rr.loc,e),t!==0)if(di.includes("&")&&(di=hr.decodeEntities(di,!0)),rr.type===6)rr.name==="class"&&(di=yR(di).trim()),t===1&&!di&&bs(13,e),rr.value={type:2,content:di,loc:t===1?cn(As,Su):cn(As-1,Su+1)},Wr.inSFCRoot&&Ln.tag==="template"&&rr.name==="lang"&&di&&di!=="html"&&Wr.enterRCDATA(lv("-1&&Ih("COMPILER_V_BIND_SYNC",hr,rr.loc,rr.rawName)&&(rr.name="model",rr.modifiers.splice(n,1))}(rr.type!==7||rr.name!=="pre")&&Ln.props.push(rr)}di="",As=Su=-1},oncomment(t,e){hr.comments&&Lb({type:3,content:Cn(t,e),loc:cn(t-4,e+3)})},onend(){const t=Fu.length;for(let e=0;e{const v=e.start.offset+h,m=v+f.length;return Om(f,!1,cn(v,m),0,p?1:0)},o={source:s(a.trim(),r.indexOf(a,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let u=i.trim().replace(JQ,"").trim();const l=i.indexOf(u),c=u.match(GD);if(c){u=u.replace(GD,"").trim();const f=c[1].trim();let h;if(f&&(h=r.indexOf(f,l+u.length),o.key=s(f,h,!0)),c[2]){const p=c[2].trim();p&&(o.index=s(p,r.indexOf(p,o.key?h+f.length:l+u.length),!0))}}return u&&(o.value=s(u,l,!0)),o}function Cn(t,e){return Fu.slice(t,e)}function XD(t){Wr.inSFCRoot&&(Ln.innerLoc=cn(t+1,t+1)),Lb(Ln);const{tag:e,ns:r}=Ln;r===0&&hr.isPreTag(e)&&dv++,hr.isVoidTag(e)?Tm(Ln,t):(Hr.unshift(Ln),(r===1||r===2)&&(Wr.inXML=!0)),Ln=null}function Zp(t,e,r){var n;{const s=(n=Hr[0])==null?void 0:n.tag;s!=="script"&&s!=="style"&&t.includes("&")&&(t=hr.decodeEntities(t,!1))}const i=Hr[0]||Lh,a=i.children[i.children.length-1];(a==null?void 0:a.type)===2?(a.content+=t,Nu(a.loc,r)):i.children.push({type:2,content:t,loc:cn(e,r)})}function Tm(t,e,r=!1){r?Nu(t.loc,vR(e,60)):Nu(t.loc,e+1),Wr.inSFCRoot&&(t.children.length?t.innerLoc.end=gi({},t.children[t.children.length-1].loc.end):t.innerLoc.end=gi({},t.innerLoc.start),t.innerLoc.source=Cn(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:n,ns:i}=t;xo||(n==="slot"?t.tagType=2:ZD(t)?t.tagType=3:tee(t)&&(t.tagType=1)),Wr.inRCDATA||(t.children=gR(t.children,t.tag)),i===0&&hr.isPreTag(n)&&dv--,kb===t&&(xo=Wr.inVPre=!1,kb=null),Wr.inXML&&(Hr[0]?Hr[0].ns:hr.ns)===0&&(Wr.inXML=!1);{const a=t.props;if(!Wr.inSFCRoot&&Ou("COMPILER_NATIVE_TEMPLATE",hr)&&t.tag==="template"&&!ZD(t)){const o=Hr[0]||Lh,u=o.children.indexOf(t);o.children.splice(u,1,...t.children)}const s=a.find(o=>o.type===6&&o.name==="inline-template");s&&Ih("COMPILER_INLINE_TEMPLATE",hr,s.loc)&&t.children.length&&(s.value={type:2,content:Cn(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:s.loc})}}function vR(t,e){let r=t;for(;Fu.charCodeAt(r)!==e&&r>=0;)r--;return r}const eee=new Set(["if","else","else-if","for","slot"]);function ZD({tag:t,props:e}){if(t==="template"){for(let r=0;r64&&t<91}const nee=/\r\n/g;function gR(t,e){var r,n;const i=hr.whitespace!=="preserve";let a=!1;for(let s=0;s0){if(u>=2){o.codegenNode.patchFlag="-1",o.codegenNode=e.hoist(o.codegenNode),a++;continue}}else{const l=o.codegenNode;if(l.type===13){const c=_R(l);if((!c||c===512||c===1)&&wR(o,e)>=2){const f=SR(o);f&&(l.props=e.hoist(f))}l.dynamicProps&&(l.dynamicProps=e.hoist(l.dynamicProps))}}}if(o.type===1){const u=o.tagType===1;u&&e.scopes.vSlot++,Fm(o,e),u&&e.scopes.vSlot--}else if(o.type===11)Fm(o,e,o.children.length===1);else if(o.type===9)for(let u=0;u1)for(let l=0;lO&&(E.childIndex--,E.onNodeRemoved()),E.parent.children.splice(O,1)},onNodeRemoved:th,addIdentifiers(N){},removeIdentifiers(N){},hoist(N){jr(N)&&(N=$t(N)),E.hoists.push(N);const M=$t(`_hoisted_${E.hoists.length}`,!1,N.loc,2);return M.hoisted=N,M},cache(N,M=!1){return $Q(E.cached++,N,M)}};return E.filters=new Set,E}function hee(t,e){const r=fee(t,e);Ag(t,r),e.hoistStatic&&lee(t,r),e.ssr||dee(t,r),t.helpers=new Set([...r.helpers.keys()]),t.components=[...r.components],t.directives=[...r.directives],t.imports=r.imports,t.hoists=r.hoists,t.temps=r.temps,t.cached=r.cached,t.transformed=!0,t.filters=[...r.filters]}function dee(t,e){const{helper:r}=e,{children:n}=t;if(n.length===1){const i=n[0];if(bR(t,i)&&i.codegenNode){const a=i.codegenNode;a.type===13&&Wx(a,e),t.codegenNode=a}else t.codegenNode=i}else if(n.length>1){let i=64;t.codegenNode=Ph(e,r(Rh),void 0,t.children,i+"",void 0,void 0,!0,void 0,!1)}}function pee(t,e){let r=0;const n=()=>{r--};for(;rn===t:n=>t.test(n);return(n,i)=>{if(n.type===1){const{props:a}=n;if(n.tagType===3&&a.some(GQ))return;const s=[];for(let o=0;o`${lc[t]}: _${lc[t]}`;function mee(t,{mode:e="function",prefixIdentifiers:r=e==="module",sourceMap:n=!1,filename:i="template.vue.html",scopeId:a=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:u="vue",ssrRuntimeModuleName:l="vue/server-renderer",ssr:c=!1,isTS:f=!1,inSSR:h=!1}){const p={mode:e,prefixIdentifiers:r,sourceMap:n,filename:i,scopeId:a,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:u,ssrRuntimeModuleName:l,ssr:c,isTS:f,inSSR:h,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(m){return`_${lc[m]}`},push(m,b=-2,y){p.code+=m},indent(){v(++p.indentLevel)},deindent(m=!1){m?--p.indentLevel:v(--p.indentLevel)},newline(){v(p.indentLevel)}};function v(m){p.push(` -`+" ".repeat(m),0)}return p}function vee(t,e={}){const r=mee(t,e);e.onContextCreated&&e.onContextCreated(r);const{mode:n,push:i,prefixIdentifiers:a,indent:s,deindent:o,newline:u,scopeId:l,ssr:c}=r,f=Array.from(t.helpers),h=f.length>0,p=!a&&n!=="module";gee(t,r);const m=c?"ssrRender":"render",y=(c?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(i(`function ${m}(${y}) {`),s(),p&&(i("with (_ctx) {"),s(),h&&(i(`const { ${f.map(DR).join(", ")} } = _Vue -`,-1),u())),t.components.length&&($y(t.components,"component",r),(t.directives.length||t.temps>0)&&u()),t.directives.length&&($y(t.directives,"directive",r),t.temps>0&&u()),t.filters&&t.filters.length&&(u(),$y(t.filters,"filter",r),u()),t.temps>0){i("let ");for(let S=0;S0?", ":""}_temp${S}`)}return(t.components.length||t.directives.length||t.temps)&&(i(` -`,0),u()),c||i("return "),t.codegenNode?Un(t.codegenNode,r):i("null"),p&&(o(),i("}")),o(),i("}"),{ast:t,code:r.code,preamble:"",map:r.map?r.map.toJSON():void 0}}function gee(t,e){const{ssr:r,prefixIdentifiers:n,push:i,newline:a,runtimeModuleName:s,runtimeGlobalName:o,ssrRuntimeModuleName:u}=e,l=o,c=Array.from(t.helpers);if(c.length>0&&(i(`const _Vue = ${l} -`,-1),t.hoists.length)){const f=[Tx,Ox,ad,Fx,oR].filter(h=>c.includes(h)).map(DR).join(", ");i(`const { ${f} } = _Vue -`,-1)}yee(t.hoists,e),a(),i("return ")}function $y(t,e,{helper:r,push:n,newline:i,isTS:a}){const s=r(e==="filter"?Ix:e==="component"?Rx:Px);for(let o=0;o3||!1;e.push("["),r&&e.indent(),ud(t,e,r),r&&e.deindent(),e.push("]")}function ud(t,e,r=!1,n=!0){const{push:i,newline:a}=e;for(let s=0;sr||"null")}function Dee(t,e){const{push:r,helper:n,pure:i}=e,a=jr(t.callee)?t.callee:n(t.callee);i&&r(Dg),r(a+"(",-2,t),ud(t.arguments,e),r(")")}function Nee(t,e){const{push:r,indent:n,deindent:i,newline:a}=e,{properties:s}=t;if(!s.length){r("{}",-2,t);return}const o=s.length>1||!1;r(o?"{":"{ "),o&&n();for(let u=0;u "),(u||o)&&(r("{"),n()),s?(u&&r("return "),Hn(s)?jx(s,e):Un(s,e)):o&&Un(o,e),(u||o)&&(i(),r("}")),l&&(t.isNonScopedSlot&&r(", undefined, true"),r(")"))}function Mee(t,e){const{test:r,consequent:n,alternate:i,newline:a}=t,{push:s,indent:o,deindent:u,newline:l}=e;if(r.type===4){const f=!Yx(r.content);f&&s("("),NR(r,e),f&&s(")")}else s("("),Un(r,e),s(")");a&&o(),e.indentLevel++,a||s(" "),s("? "),Un(n,e),e.indentLevel--,a&&l(),a||s(" "),s(": ");const c=i.type===19;c||e.indentLevel++,Un(i,e),c||e.indentLevel--,a&&u(!0)}function Tee(t,e){const{push:r,helper:n,indent:i,deindent:a,newline:s}=e;r(`_cache[${t.index}] || (`),t.isVNode&&(i(),r(`${n(uv)}(-1),`),s()),r(`_cache[${t.index}] = `),Un(t.value,e),t.isVNode&&(r(","),s(),r(`${n(uv)}(1),`),s(),r(`_cache[${t.index}]`),a()),r(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Oee=AR(/^(if|else|else-if)$/,(t,e,r)=>Fee(t,e,r,(n,i,a)=>{const s=r.parent.children;let o=s.indexOf(n),u=0;for(;o-->=0;){const l=s[o];l&&l.type===9&&(u+=l.branches.length)}return()=>{if(a)n.codegenNode=JD(i,u,r);else{const l=Ree(n.codegenNode);l.alternate=JD(i,u+n.branches.length-1,r)}}}));function Fee(t,e,r,n){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const i=e.exp?e.exp.loc:t.loc;r.onError(kr(28,e.loc)),e.exp=$t("true",!1,i)}if(e.name==="if"){const i=KD(t,e),a={type:9,loc:t.loc,branches:[i]};if(r.replaceNode(a),n)return n(a,i,!0)}else{const i=r.parent.children;let a=i.indexOf(t);for(;a-->=-1;){const s=i[a];if(s&&s.type===3){r.removeNode(s);continue}if(s&&s.type===2&&!s.content.trim().length){r.removeNode(s);continue}if(s&&s.type===9){e.name==="else-if"&&s.branches[s.branches.length-1].condition===void 0&&r.onError(kr(30,t.loc)),r.removeNode();const o=KD(t,e);s.branches.push(o);const u=n&&n(s,o,!1);Ag(o,r),u&&u(),r.currentNode=null}else r.onError(kr(30,t.loc));break}}}function KD(t,e){const r=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:r&&!ga(t,"for")?t.children:[t],userKey:_g(t,"key"),isTemplateIf:r}}function JD(t,e,r){return t.condition?Ib(t.condition,QD(t,e,r),hn(r.helper(ad),['""',"true"])):QD(t,e,r)}function QD(t,e,r){const{helper:n}=r,i=Yr("key",$t(`${e}`,!1,Bi,2)),{children:a}=t,s=a[0];if(a.length!==1||s.type!==1)if(a.length===1&&s.type===11){const u=s.codegenNode;return hv(u,i,r),u}else return Ph(r,n(Rh),Ji([i]),a,64+"",void 0,void 0,!0,!1,!1,t.loc);else{const u=s.codegenNode,l=ZQ(u);return l.type===13&&Wx(l,r),hv(l,i,r),u}}function Ree(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Bee=AR("for",(t,e,r)=>{const{helper:n,removeHelper:i}=r;return Pee(t,e,r,a=>{const s=hn(n(Lx),[a.source]),o=cv(t),u=ga(t,"memo"),l=_g(t,"key"),c=l&&(l.type===6?$t(l.value.content,!0):l.exp),f=l?Yr("key",c):null,h=a.source.type===4&&a.source.constType>0,p=h?64:l?128:256;return a.codegenNode=Ph(r,n(Rh),void 0,s,p+"",void 0,void 0,!0,!h,!1,t.loc),()=>{let v;const{children:m}=a,b=m.length!==1||m[0].type!==1,y=fv(t)?t:o&&t.children.length===1&&fv(t.children[0])?t.children[0]:null;if(y?(v=y.codegenNode,o&&f&&hv(v,f,r)):b?v=Ph(r,n(Rh),f?Ji([f]):void 0,t.children,"64",void 0,void 0,!0,void 0,!1):(v=m[0].codegenNode,o&&f&&hv(v,f,r),v.isBlock!==!h&&(v.isBlock?(i(ku),i(hc(r.inSSR,v.isComponent))):i(fc(r.inSSR,v.isComponent))),v.isBlock=!h,v.isBlock?(n(ku),n(hc(r.inSSR,v.isComponent))):n(fc(r.inSSR,v.isComponent))),u){const S=cc($b(a.parseResult,[$t("_cached")]));S.body=zQ([Sa(["const _memo = (",u.exp,")"]),Sa(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${r.helperString(cR)}(_cached, _memo)) return _cached`]),Sa(["const _item = ",v]),$t("_item.memo = _memo"),$t("return _item")]),s.arguments.push(S,$t("_cache"),$t(String(r.cached++)))}else s.arguments.push(cc($b(a.parseResult),v,!0))}})});function Pee(t,e,r,n){if(!e.exp){r.onError(kr(31,e.loc));return}const i=e.forParseResult;if(!i){r.onError(kr(32,e.loc));return}CR(i);const{addIdentifiers:a,removeIdentifiers:s,scopes:o}=r,{source:u,value:l,key:c,index:f}=i,h={type:11,loc:e.loc,source:u,valueAlias:l,keyAlias:c,objectIndexAlias:f,parseResult:i,children:cv(t)?t.children:[t]};r.replaceNode(h),o.vFor++;const p=n&&n(h);return()=>{o.vFor--,p&&p()}}function CR(t,e){t.finalized||(t.finalized=!0)}function $b({value:t,key:e,index:r},n=[]){return Iee([t,e,r,...n])}function Iee(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((r,n)=>r||$t("_".repeat(n+1),!1))}const e2=$t("undefined",!1),kee=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const r=ga(t,"slot");if(r)return r.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},Lee=(t,e,r,n)=>cc(t,r,!1,!0,r.length?r[0].loc:n);function $ee(t,e,r=Lee){e.helper(qx);const{children:n,loc:i}=t,a=[],s=[];let o=e.scopes.vSlot>0||e.scopes.vFor>0;const u=ga(t,"slot",!0);if(u){const{arg:b,exp:y}=u;b&&!vi(b)&&(o=!0),a.push(Yr(b||$t("default",!0),r(y,void 0,n,i)))}let l=!1,c=!1;const f=[],h=new Set;let p=0;for(let b=0;b{const x=r(y,void 0,S,i);return e.compatConfig&&(x.isNonScopedSlot=!0),Yr("default",x)};l?f.length&&f.some(y=>MR(y))&&(c?e.onError(kr(39,f[0].loc)):a.push(b(void 0,f))):a.push(b(void 0,n))}const v=o?2:Rm(t.children)?3:1;let m=Ji(a.concat(Yr("_",$t(v+"",!1))),i);return s.length&&(m=hn(e.helper(lR),[m,od(s)])),{slots:m,hasDynamicSlots:o}}function Kp(t,e,r){const n=[Yr("name",t),Yr("fn",e)];return r!=null&&n.push(Yr("key",$t(String(r),!0))),Ji(n)}function Rm(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:n,props:i}=t,a=t.tagType===1;let s=a?Uee(t,e):`"${n}"`;const o=WM(s)&&s.callee===Bx;let u,l,c,f=0,h,p,v,m=o||s===mh||s===Mx||!a&&(n==="svg"||n==="foreignObject");if(i.length>0){const b=OR(t,e,void 0,a,o);u=b.props,f=b.patchFlag,p=b.dynamicPropNames;const y=b.directives;v=y&&y.length?od(y.map(S=>Hee(S,e))):void 0,b.shouldUseBlock&&(m=!0)}if(t.children.length>0)if(s===sv&&(m=!0,f|=1024),a&&s!==mh&&s!==sv){const{slots:y,hasDynamicSlots:S}=$ee(t,e);l=y,S&&(f|=1024)}else if(t.children.length===1&&s!==mh){const y=t.children[0],S=y.type,x=S===5||S===8;x&&Qi(y,e)===0&&(f|=1),x||S===2?l=y:l=t.children}else l=t.children;f!==0&&(c=String(f),p&&p.length&&(h=Wee(p))),t.codegenNode=Ph(e,s,u,l,c,h,v,!!m,!1,a,t.loc)};function Uee(t,e,r=!1){let{tag:n}=t;const i=zb(n),a=_g(t,"is");if(a)if(i||Ou("COMPILER_IS_ON_ELEMENT",e)){const o=a.type===6?a.value&&$t(a.value.content,!0):a.exp;if(o)return hn(e.helper(Bx),[o])}else a.type===6&&a.value.content.startsWith("vue:")&&(n=a.value.content.slice(4));const s=hR(n)||e.isBuiltInComponent(n);return s?(r||e.helper(s),s):(e.helper(Rx),e.components.add(n),kh(n,"component"))}function OR(t,e,r=t.props,n,i,a=!1){const{tag:s,loc:o,children:u}=t;let l=[];const c=[],f=[],h=u.length>0;let p=!1,v=0,m=!1,b=!1,y=!1,S=!1,x=!1,A=!1;const _=[],w=N=>{l.length&&(c.push(Ji(t2(l),o)),l=[]),N&&c.push(N)},C=({key:N,value:M})=>{if(vi(N)){const O=N.content,F=f1(O);if(F&&(!n||i)&&O.toLowerCase()!=="onclick"&&O!=="onUpdate:modelValue"&&!O_(O)&&(S=!0),F&&O_(O)&&(A=!0),F&&M.type===14&&(M=M.arguments[0]),M.type===20||(M.type===4||M.type===8)&&Qi(M,e)>0)return;O==="ref"?m=!0:O==="class"?b=!0:O==="style"?y=!0:O!=="key"&&!_.includes(O)&&_.push(O),n&&(O==="class"||O==="style")&&!_.includes(O)&&_.push(O)}else x=!0};for(let N=0;N0&&l.push(Yr($t("ref_for",!0),$t("true")))),F==="is"&&(zb(s)||V&&V.content.startsWith("vue:")||Ou("COMPILER_IS_ON_ELEMENT",e)))continue;l.push(Yr($t(F,!0,U),$t(V?V.content:"",H,V?V.loc:O)))}else{const{name:O,arg:F,exp:U,loc:V,modifiers:H}=M,I=O==="bind",P=O==="on";if(O==="slot"){n||e.onError(kr(40,V));continue}if(O==="once"||O==="memo"||O==="is"||I&&Du(F,"is")&&(zb(s)||Ou("COMPILER_IS_ON_ELEMENT",e))||P&&a)continue;if((I&&Du(F,"key")||P&&h&&Du(F,"vue:before-update"))&&(p=!0),I&&Du(F,"ref")&&e.scopes.vFor>0&&l.push(Yr($t("ref_for",!0),$t("true"))),!F&&(I||P)){if(x=!0,U)if(I){if(w(),Ou("COMPILER_V_BIND_OBJECT_ORDER",e)){c.unshift(U);continue}c.push(U)}else w({type:14,loc:V,callee:e.helper(Ux),arguments:n?[U]:[U,"true"]});else e.onError(kr(I?34:35,V));continue}I&&H.includes("prop")&&(v|=32);const K=e.directiveTransforms[O];if(K){const{props:$,needRuntime:se}=K(M,t,e);!a&&$.forEach(C),P&&F&&!vi(F)?w(Ji($,o)):l.push(...$),se&&(f.push(M),h1(se)&&TR.set(M,se))}else T9(O)||(f.push(M),h&&(p=!0))}}let E;if(c.length?(w(),c.length>1?E=hn(e.helper(ov),c,o):E=c[0]):l.length&&(E=Ji(t2(l),o)),x?v|=16:(b&&!n&&(v|=2),y&&!n&&(v|=4),_.length&&(v|=8),S&&(v|=32)),!p&&(v===0||v===32)&&(m||A||f.length>0)&&(v|=512),!e.inSSR&&E)switch(E.type){case 15:let N=-1,M=-1,O=!1;for(let V=0;VYr(s,a)),i))}return od(r,t.loc)}function Wee(t){let e="[";for(let r=0,n=t.length;r{if(fv(t)){const{children:r,loc:n}=t,{slotName:i,slotProps:a}=Yee(t,e),s=[e.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"];let o=2;a&&(s[2]=a,o=3),r.length&&(s[3]=cc([],r,!1,!1,n),o=4),e.scopeId&&!e.slotted&&(o=5),s.splice(o),t.codegenNode=hn(e.helper(uR),s,n)}};function Yee(t,e){let r='"default"',n;const i=[];for(let a=0;a0){const{props:a,directives:s}=OR(t,e,i,!1,!1);n=a,s.length&&e.onError(kr(36,s[0].loc))}return{slotName:r,slotProps:n}}const jee=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,FR=(t,e,r,n)=>{const{loc:i,modifiers:a,arg:s}=t;!t.exp&&!a.length&&r.onError(kr(35,i));let o;if(s.type===4)if(s.isStatic){let f=s.content;f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const h=e.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?sT(Oi(f)):`on:${f}`;o=$t(h,!0,s.loc)}else o=Sa([`${r.helperString(Pb)}(`,s,")"]);else o=s,o.children.unshift(`${r.helperString(Pb)}(`),o.children.push(")");let u=t.exp;u&&!u.content.trim()&&(u=void 0);let l=r.cacheHandlers&&!u&&!r.inVOnce;if(u){const f=dR(u.content),h=!(f||jee.test(u.content)),p=u.content.includes(";");(h||l&&f)&&(u=Sa([`${h?"$event":"(...args)"} => ${p?"{":"("}`,u,p?"}":")"]))}let c={props:[Yr(o,u||$t("() => {}",!1,i))]};return n&&(c=n(c)),l&&(c.props[0].value=r.cache(c.props[0].value)),c.props.forEach(f=>f.key.isHandlerKey=!0),c},Gee=(t,e,r)=>{const{modifiers:n,loc:i}=t,a=t.arg;let{exp:s}=t;if(s&&s.type===4&&!s.content.trim()&&(s=void 0),!s){if(a.type!==4||!a.isStatic)return r.onError(kr(52,a.loc)),{props:[Yr(a,$t("",!0,i))]};const o=Oi(a.content);s=t.exp=$t(o,!1,a.loc)}return a.type!==4?(a.children.unshift("("),a.children.push(') || ""')):a.isStatic||(a.content=`${a.content} || ""`),n.includes("camel")&&(a.type===4?a.isStatic?a.content=Oi(a.content):a.content=`${r.helperString(Bb)}(${a.content})`:(a.children.unshift(`${r.helperString(Bb)}(`),a.children.push(")"))),r.inSSR||(n.includes("prop")&&r2(a,"."),n.includes("attr")&&r2(a,"^")),{props:[Yr(a,s)]}},r2=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},Xee=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const r=t.children;let n,i=!1;for(let a=0;aa.type===7&&!e.directiveTransforms[a.name])&&t.tag!=="template")))for(let a=0;a{if(t.type===1&&ga(t,"once",!0))return n2.has(t)||e.inVOnce||e.inSSR?void 0:(n2.add(t),e.inVOnce=!0,e.helper(uv),()=>{e.inVOnce=!1;const r=e.currentNode;r.codegenNode&&(r.codegenNode=e.cache(r.codegenNode,!0))})},RR=(t,e,r)=>{const{exp:n,arg:i}=t;if(!n)return r.onError(kr(41,t.loc)),Jp();const a=n.loc.source,s=n.type===4?n.content:a,o=r.bindingMetadata[a];if(o==="props"||o==="props-aliased")return r.onError(kr(44,n.loc)),Jp();if(!s.trim()||!dR(s)&&!!1)return r.onError(kr(42,n.loc)),Jp();const l=i||$t("modelValue",!0),c=i?vi(i)?`onUpdate:${Oi(i.content)}`:Sa(['"onUpdate:" + ',i]):"onUpdate:modelValue";let f;const h=r.isTS?"($event: any)":"$event";f=Sa([`${h} => ((`,n,") = $event)"]);const p=[Yr(l,t.exp),Yr(c,f)];if(t.modifiers.length&&e.tagType===1){const v=t.modifiers.map(b=>(Yx(b)?b:JSON.stringify(b))+": true").join(", "),m=i?vi(i)?`${i.content}Modifiers`:Sa([i,' + "Modifiers"']):"modelModifiers";p.push(Yr(m,$t(`{ ${v} }`,!1,t.loc,2)))}return Jp(p)};function Jp(t=[]){return{props:t}}const Kee=/[\w).+\-_$\]]/,Jee=(t,e)=>{Ou("COMPILER_FILTERS",e)&&(t.type===5&&pv(t.content,e),t.type===1&&t.props.forEach(r=>{r.type===7&&r.name!=="for"&&r.exp&&pv(r.exp,e)}))};function pv(t,e){if(t.type===4)i2(t,e);else for(let r=0;r=0&&(S=r.charAt(y),S===" ");y--);(!S||!Kee.test(S))&&(s=!0)}}v===void 0?v=r.slice(0,p).trim():c!==0&&b();function b(){m.push(r.slice(c,p).trim()),c=p+1}if(m.length){for(p=0;p{if(t.type===1){const r=ga(t,"memo");return!r||a2.has(t)?void 0:(a2.add(t),()=>{const n=t.codegenNode||e.currentNode.codegenNode;n&&n.type===13&&(t.tagType!==1&&Wx(n,e),t.codegenNode=hn(e.helper(Hx),[r.exp,cc(void 0,n),"_cache",String(e.cached++)]))})}};function tte(t){return[[Zee,Oee,ete,Bee,Jee,Vee,zee,kee,Xee],{on:FR,bind:Gee,model:RR}]}function rte(t,e={}){const r=e.onError||Vx,n=e.mode==="module";e.prefixIdentifiers===!0?r(kr(47)):n&&r(kr(48));const i=!1;e.cacheHandlers&&r(kr(49)),e.scopeId&&!n&&r(kr(50));const a=gi({},e,{prefixIdentifiers:i}),s=jr(t)?uee(t,a):t,[o,u]=tte();return hee(s,gi({},a,{nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:gi({},u,e.directiveTransforms||{})})),vee(s,a)}const nte=()=>({props:[]});/** +**/const Rh=Symbol(""),ph=Symbol(""),$x=Symbol(""),uv=Symbol(""),sR=Symbol(""),Lu=Symbol(""),oR=Symbol(""),uR=Symbol(""),zx=Symbol(""),Ux=Symbol(""),ad=Symbol(""),qx=Symbol(""),lR=Symbol(""),Hx=Symbol(""),Wx=Symbol(""),Vx=Symbol(""),Yx=Symbol(""),jx=Symbol(""),Gx=Symbol(""),cR=Symbol(""),fR=Symbol(""),Ag=Symbol(""),lv=Symbol(""),Xx=Symbol(""),Zx=Symbol(""),Bh=Symbol(""),sd=Symbol(""),Kx=Symbol(""),Pb=Symbol(""),RQ=Symbol(""),Ib=Symbol(""),cv=Symbol(""),BQ=Symbol(""),PQ=Symbol(""),Jx=Symbol(""),IQ=Symbol(""),kQ=Symbol(""),Qx=Symbol(""),hR=Symbol(""),uc={[Rh]:"Fragment",[ph]:"Teleport",[$x]:"Suspense",[uv]:"KeepAlive",[sR]:"BaseTransition",[Lu]:"openBlock",[oR]:"createBlock",[uR]:"createElementBlock",[zx]:"createVNode",[Ux]:"createElementVNode",[ad]:"createCommentVNode",[qx]:"createTextVNode",[lR]:"createStaticVNode",[Hx]:"resolveComponent",[Wx]:"resolveDynamicComponent",[Vx]:"resolveDirective",[Yx]:"resolveFilter",[jx]:"withDirectives",[Gx]:"renderList",[cR]:"renderSlot",[fR]:"createSlots",[Ag]:"toDisplayString",[lv]:"mergeProps",[Xx]:"normalizeClass",[Zx]:"normalizeStyle",[Bh]:"normalizeProps",[sd]:"guardReactiveProps",[Kx]:"toHandlers",[Pb]:"camelize",[RQ]:"capitalize",[Ib]:"toHandlerKey",[cv]:"setBlockTracking",[BQ]:"pushScopeId",[PQ]:"popScopeId",[Jx]:"withCtx",[IQ]:"unref",[kQ]:"isRef",[Qx]:"withMemo",[hR]:"isMemoSame"};function LQ(t){Object.getOwnPropertySymbols(t).forEach(e=>{uc[e]=t[e]})}const Bi={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function $Q(t,e=""){return{type:0,source:e,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:Bi}}function Ph(t,e,r,n,i,a,s,o=!1,u=!1,l=!1,c=Bi){return t&&(o?(t.helper(Lu),t.helper(fc(t.inSSR,l))):t.helper(cc(t.inSSR,l)),s&&t.helper(jx)),{type:13,tag:e,props:r,children:n,patchFlag:i,dynamicProps:a,directives:s,isBlock:o,disableTracking:u,isComponent:l,loc:c}}function od(t,e=Bi){return{type:17,loc:e,elements:t}}function Ji(t,e=Bi){return{type:15,loc:e,properties:t}}function Yr(t,e){return{type:16,loc:Bi,key:jr(t)?$t(t,!0):t,value:e}}function $t(t,e=!1,r=Bi,n=0){return{type:4,loc:r,content:t,isStatic:e,constType:e?3:n}}function Sa(t,e=Bi){return{type:8,loc:e,children:t}}function hn(t,e=[],r=Bi){return{type:14,loc:r,callee:t,arguments:e}}function lc(t,e=void 0,r=!1,n=!1,i=Bi){return{type:18,params:t,returns:e,newline:r,isSlot:n,loc:i}}function kb(t,e,r,n=!0){return{type:19,test:t,consequent:e,alternate:r,newline:n,loc:Bi}}function zQ(t,e,r=!1){return{type:20,index:t,value:e,isVNode:r,loc:Bi}}function UQ(t){return{type:21,body:t,loc:Bi}}function cc(t,e){return t||e?zx:Ux}function fc(t,e){return t||e?oR:uR}function ew(t,{helper:e,removeHelper:r,inSSR:n}){t.isBlock||(t.isBlock=!0,r(cc(n,t.isComponent)),e(Lu),e(fc(n,t.isComponent)))}const jD=new Uint8Array([123,123]),GD=new Uint8Array([125,125]);function XD(t){return t>=97&&t<=122||t>=65&&t<=90}function Mi(t){return t===32||t===10||t===9||t===12||t===13}function vo(t){return t===47||t===62||Mi(t)}function fv(t){const e=new Uint8Array(t.length);for(let r=0;r=0;i--){const a=this.newlines[i];if(e>a){r=i+2,n=e-a;break}}return{column:n,line:r,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const r=this.index+1-this.delimiterOpen.length;r>this.sectionStart&&this.cbs.ontext(this.sectionStart,r),this.state=3,this.sectionStart=r}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const r=this.sequenceIndex===this.currentSequence.length;if(!(r?vo(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!r){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||Mi(e)){const r=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===In.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,r){}}function ZD(t,{compatConfig:e}){const r=e&&e[t];return t==="MODE"?r||3:r}function Fu(t,e){const r=ZD("MODE",e),n=ZD(t,e);return r===3?n===!0:n!==!1}function Ih(t,e,r,...n){return Fu(t,e)}function tw(t){throw t}function dR(t){}function kr(t,e,r,n){const i=`https://vuejs.org/error-reference/#compiler-${t}`,a=new SyntaxError(String(i));return a.code=t,a.loc=e,a}const vi=t=>t.type===4&&t.isStatic;function pR(t){switch(t){case"Teleport":case"teleport":return ph;case"Suspense":case"suspense":return $x;case"KeepAlive":case"keep-alive":return uv;case"BaseTransition":case"base-transition":return sR}}const HQ=/^\d|[^\$\w]/,rw=t=>!HQ.test(t),WQ=/[A-Za-z_$\xA0-\uFFFF]/,VQ=/[\.\?\w$\xA0-\uFFFF]/,YQ=/\s+[.[]\s*|\s*[.[]\s+/g,jQ=t=>{t=t.trim().replace(YQ,s=>s.trim());let e=0,r=[],n=0,i=0,a=null;for(let s=0;se.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function zy(t){return t.type===5||t.type===2}function XQ(t){return t.type===7&&t.name==="slot"}function hv(t){return t.type===1&&t.tagType===3}function dv(t){return t.type===1&&t.tagType===2}const ZQ=new Set([Bh,sd]);function vR(t,e=[]){if(t&&!jr(t)&&t.type===14){const r=t.callee;if(!jr(r)&&ZQ.has(r))return vR(t.arguments[0],e.concat(t))}return[t,e]}function pv(t,e,r){let n,i=t.type===13?t.props:t.arguments[2],a=[],s;if(i&&!jr(i)&&i.type===14){const o=vR(i);i=o[0],a=o[1],s=a[a.length-1]}if(i==null||jr(i))n=Ji([e]);else if(i.type===14){const o=i.arguments[0];!jr(o)&&o.type===15?KD(e,o)||o.properties.unshift(e):i.callee===Kx?n=hn(r.helper(lv),[Ji([e]),i]):i.arguments.unshift(Ji([e])),!n&&(n=i)}else i.type===15?(KD(e,i)||i.properties.unshift(e),n=i):(n=hn(r.helper(lv),[Ji([e]),i]),s&&s.callee===sd&&(s=a[a.length-2]));t.type===13?s?s.arguments[0]=n:t.props=n:s?s.arguments[0]=n:t.arguments[2]=n}function KD(t,e){let r=!1;if(t.key.type===4){const n=t.key.content;r=e.properties.some(i=>i.key.type===4&&i.key.content===n)}return r}function kh(t,e){return`_${e}_${t.replace(/[^\w]/g,(r,n)=>r==="-"?"_":t.charCodeAt(n).toString())}`}function KQ(t){return t.type===14&&t.callee===Qx?t.arguments[1].returns:t}const JQ=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,gR={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:hy,isPreTag:hy,isCustomElement:hy,onError:tw,onWarn:dR,comments:!1,prefixIdentifiers:!1};let hr=gR,Lh=null,Ru="",Ln=null,rr=null,di="",As=-1,Su=-1,mv=0,xo=!1,Lb=null;const Hr=[],Wr=new qQ(Hr,{onerr:bs,ontext(t,e){Zp(Cn(t,e),t,e)},ontextentity(t,e,r){Zp(t,e,r)},oninterpolation(t,e){if(xo)return Zp(Cn(t,e),t,e);let r=t+Wr.delimiterOpen.length,n=e-Wr.delimiterClose.length;for(;Mi(Ru.charCodeAt(r));)r++;for(;Mi(Ru.charCodeAt(n-1));)n--;let i=Cn(r,n);i.includes("&")&&(i=hr.decodeEntities(i,!1)),$b({type:5,content:Om(i,!1,cn(r,n)),loc:cn(t,e)})},onopentagname(t,e){const r=Cn(t,e);Ln={type:1,tag:r,ns:hr.getNamespace(r,Hr[0],hr.ns),tagType:0,props:[],children:[],loc:cn(t-1,e),codegenNode:void 0}},onopentagend(t){QD(t)},onclosetag(t,e){const r=Cn(t,e);if(!hr.isVoidTag(r)){let n=!1;for(let i=0;i0&&bs(24,Hr[0].loc.start.offset);for(let s=0;s<=i;s++){const o=Hr.shift();Tm(o,e,s(n.type===7?n.rawName:n.name)===r)&&bs(2,e)},onattribend(t,e){if(Ln&&rr){if(Nu(rr.loc,e),t!==0)if(di.includes("&")&&(di=hr.decodeEntities(di,!0)),rr.type===6)rr.name==="class"&&(di=xR(di).trim()),t===1&&!di&&bs(13,e),rr.value={type:2,content:di,loc:t===1?cn(As,Su):cn(As-1,Su+1)},Wr.inSFCRoot&&Ln.tag==="template"&&rr.name==="lang"&&di&&di!=="html"&&Wr.enterRCDATA(fv("-1&&Ih("COMPILER_V_BIND_SYNC",hr,rr.loc,rr.rawName)&&(rr.name="model",rr.modifiers.splice(n,1))}(rr.type!==7||rr.name!=="pre")&&Ln.props.push(rr)}di="",As=Su=-1},oncomment(t,e){hr.comments&&$b({type:3,content:Cn(t,e),loc:cn(t-4,e+3)})},onend(){const t=Ru.length;for(let e=0;e{const v=e.start.offset+h,m=v+f.length;return Om(f,!1,cn(v,m),0,p?1:0)},o={source:s(a.trim(),r.indexOf(a,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let u=i.trim().replace(QQ,"").trim();const l=i.indexOf(u),c=u.match(JD);if(c){u=u.replace(JD,"").trim();const f=c[1].trim();let h;if(f&&(h=r.indexOf(f,l+u.length),o.key=s(f,h,!0)),c[2]){const p=c[2].trim();p&&(o.index=s(p,r.indexOf(p,o.key?h+f.length:l+u.length),!0))}}return u&&(o.value=s(u,l,!0)),o}function Cn(t,e){return Ru.slice(t,e)}function QD(t){Wr.inSFCRoot&&(Ln.innerLoc=cn(t+1,t+1)),$b(Ln);const{tag:e,ns:r}=Ln;r===0&&hr.isPreTag(e)&&mv++,hr.isVoidTag(e)?Tm(Ln,t):(Hr.unshift(Ln),(r===1||r===2)&&(Wr.inXML=!0)),Ln=null}function Zp(t,e,r){var n;{const s=(n=Hr[0])==null?void 0:n.tag;s!=="script"&&s!=="style"&&t.includes("&")&&(t=hr.decodeEntities(t,!1))}const i=Hr[0]||Lh,a=i.children[i.children.length-1];(a==null?void 0:a.type)===2?(a.content+=t,Nu(a.loc,r)):i.children.push({type:2,content:t,loc:cn(e,r)})}function Tm(t,e,r=!1){r?Nu(t.loc,yR(e,60)):Nu(t.loc,e+1),Wr.inSFCRoot&&(t.children.length?t.innerLoc.end=gi({},t.children[t.children.length-1].loc.end):t.innerLoc.end=gi({},t.innerLoc.start),t.innerLoc.source=Cn(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:n,ns:i}=t;xo||(n==="slot"?t.tagType=2:e2(t)?t.tagType=3:ree(t)&&(t.tagType=1)),Wr.inRCDATA||(t.children=bR(t.children,t.tag)),i===0&&hr.isPreTag(n)&&mv--,Lb===t&&(xo=Wr.inVPre=!1,Lb=null),Wr.inXML&&(Hr[0]?Hr[0].ns:hr.ns)===0&&(Wr.inXML=!1);{const a=t.props;if(!Wr.inSFCRoot&&Fu("COMPILER_NATIVE_TEMPLATE",hr)&&t.tag==="template"&&!e2(t)){const o=Hr[0]||Lh,u=o.children.indexOf(t);o.children.splice(u,1,...t.children)}const s=a.find(o=>o.type===6&&o.name==="inline-template");s&&Ih("COMPILER_INLINE_TEMPLATE",hr,s.loc)&&t.children.length&&(s.value={type:2,content:Cn(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:s.loc})}}function yR(t,e){let r=t;for(;Ru.charCodeAt(r)!==e&&r>=0;)r--;return r}const tee=new Set(["if","else","else-if","for","slot"]);function e2({tag:t,props:e}){if(t==="template"){for(let r=0;r64&&t<91}const iee=/\r\n/g;function bR(t,e){var r,n;const i=hr.whitespace!=="preserve";let a=!1;for(let s=0;s0){if(u>=2){o.codegenNode.patchFlag="-1",o.codegenNode=e.hoist(o.codegenNode),a++;continue}}else{const l=o.codegenNode;if(l.type===13){const c=DR(l);if((!c||c===512||c===1)&&_R(o,e)>=2){const f=AR(o);f&&(l.props=e.hoist(f))}l.dynamicProps&&(l.dynamicProps=e.hoist(l.dynamicProps))}}}if(o.type===1){const u=o.tagType===1;u&&e.scopes.vSlot++,Fm(o,e),u&&e.scopes.vSlot--}else if(o.type===11)Fm(o,e,o.children.length===1);else if(o.type===9)for(let u=0;u1)for(let l=0;lO&&(E.childIndex--,E.onNodeRemoved()),E.parent.children.splice(O,1)},onNodeRemoved:eh,addIdentifiers(N){},removeIdentifiers(N){},hoist(N){jr(N)&&(N=$t(N)),E.hoists.push(N);const M=$t(`_hoisted_${E.hoists.length}`,!1,N.loc,2);return M.hoisted=N,M},cache(N,M=!1){return zQ(E.cached++,N,M)}};return E.filters=new Set,E}function dee(t,e){const r=hee(t,e);Ng(t,r),e.hoistStatic&&cee(t,r),e.ssr||pee(t,r),t.helpers=new Set([...r.helpers.keys()]),t.components=[...r.components],t.directives=[...r.directives],t.imports=r.imports,t.hoists=r.hoists,t.temps=r.temps,t.cached=r.cached,t.transformed=!0,t.filters=[...r.filters]}function pee(t,e){const{helper:r}=e,{children:n}=t;if(n.length===1){const i=n[0];if(wR(t,i)&&i.codegenNode){const a=i.codegenNode;a.type===13&&ew(a,e),t.codegenNode=a}else t.codegenNode=i}else if(n.length>1){let i=64;t.codegenNode=Ph(e,r(Rh),void 0,t.children,i+"",void 0,void 0,!0,void 0,!1)}}function mee(t,e){let r=0;const n=()=>{r--};for(;rn===t:n=>t.test(n);return(n,i)=>{if(n.type===1){const{props:a}=n;if(n.tagType===3&&a.some(XQ))return;const s=[];for(let o=0;o`${uc[t]}: _${uc[t]}`;function vee(t,{mode:e="function",prefixIdentifiers:r=e==="module",sourceMap:n=!1,filename:i="template.vue.html",scopeId:a=null,optimizeImports:s=!1,runtimeGlobalName:o="Vue",runtimeModuleName:u="vue",ssrRuntimeModuleName:l="vue/server-renderer",ssr:c=!1,isTS:f=!1,inSSR:h=!1}){const p={mode:e,prefixIdentifiers:r,sourceMap:n,filename:i,scopeId:a,optimizeImports:s,runtimeGlobalName:o,runtimeModuleName:u,ssrRuntimeModuleName:l,ssr:c,isTS:f,inSSR:h,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(m){return`_${uc[m]}`},push(m,b=-2,y){p.code+=m},indent(){v(++p.indentLevel)},deindent(m=!1){m?--p.indentLevel:v(--p.indentLevel)},newline(){v(p.indentLevel)}};function v(m){p.push(` +`+" ".repeat(m),0)}return p}function gee(t,e={}){const r=vee(t,e);e.onContextCreated&&e.onContextCreated(r);const{mode:n,push:i,prefixIdentifiers:a,indent:s,deindent:o,newline:u,scopeId:l,ssr:c}=r,f=Array.from(t.helpers),h=f.length>0,p=!a&&n!=="module";yee(t,r);const m=c?"ssrRender":"render",y=(c?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(i(`function ${m}(${y}) {`),s(),p&&(i("with (_ctx) {"),s(),h&&(i(`const { ${f.map(ER).join(", ")} } = _Vue +`,-1),u())),t.components.length&&(Uy(t.components,"component",r),(t.directives.length||t.temps>0)&&u()),t.directives.length&&(Uy(t.directives,"directive",r),t.temps>0&&u()),t.filters&&t.filters.length&&(u(),Uy(t.filters,"filter",r),u()),t.temps>0){i("let ");for(let S=0;S0?", ":""}_temp${S}`)}return(t.components.length||t.directives.length||t.temps)&&(i(` +`,0),u()),c||i("return "),t.codegenNode?Un(t.codegenNode,r):i("null"),p&&(o(),i("}")),o(),i("}"),{ast:t,code:r.code,preamble:"",map:r.map?r.map.toJSON():void 0}}function yee(t,e){const{ssr:r,prefixIdentifiers:n,push:i,newline:a,runtimeModuleName:s,runtimeGlobalName:o,ssrRuntimeModuleName:u}=e,l=o,c=Array.from(t.helpers);if(c.length>0&&(i(`const _Vue = ${l} +`,-1),t.hoists.length)){const f=[zx,Ux,ad,qx,lR].filter(h=>c.includes(h)).map(ER).join(", ");i(`const { ${f} } = _Vue +`,-1)}bee(t.hoists,e),a(),i("return ")}function Uy(t,e,{helper:r,push:n,newline:i,isTS:a}){const s=r(e==="filter"?Yx:e==="component"?Hx:Vx);for(let o=0;o3||!1;e.push("["),r&&e.indent(),ud(t,e,r),r&&e.deindent(),e.push("]")}function ud(t,e,r=!1,n=!0){const{push:i,newline:a}=e;for(let s=0;sr||"null")}function Nee(t,e){const{push:r,helper:n,pure:i}=e,a=jr(t.callee)?t.callee:n(t.callee);i&&r(Eg),r(a+"(",-2,t),ud(t.arguments,e),r(")")}function Eee(t,e){const{push:r,indent:n,deindent:i,newline:a}=e,{properties:s}=t;if(!s.length){r("{}",-2,t);return}const o=s.length>1||!1;r(o?"{":"{ "),o&&n();for(let u=0;u "),(u||o)&&(r("{"),n()),s?(u&&r("return "),Hn(s)?nw(s,e):Un(s,e)):o&&Un(o,e),(u||o)&&(i(),r("}")),l&&(t.isNonScopedSlot&&r(", undefined, true"),r(")"))}function Tee(t,e){const{test:r,consequent:n,alternate:i,newline:a}=t,{push:s,indent:o,deindent:u,newline:l}=e;if(r.type===4){const f=!rw(r.content);f&&s("("),CR(r,e),f&&s(")")}else s("("),Un(r,e),s(")");a&&o(),e.indentLevel++,a||s(" "),s("? "),Un(n,e),e.indentLevel--,a&&l(),a||s(" "),s(": ");const c=i.type===19;c||e.indentLevel++,Un(i,e),c||e.indentLevel--,a&&u(!0)}function Oee(t,e){const{push:r,helper:n,indent:i,deindent:a,newline:s}=e;r(`_cache[${t.index}] || (`),t.isVNode&&(i(),r(`${n(cv)}(-1),`),s()),r(`_cache[${t.index}] = `),Un(t.value,e),t.isVNode&&(r(","),s(),r(`${n(cv)}(1),`),s(),r(`_cache[${t.index}]`),a()),r(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Fee=NR(/^(if|else|else-if)$/,(t,e,r)=>Ree(t,e,r,(n,i,a)=>{const s=r.parent.children;let o=s.indexOf(n),u=0;for(;o-->=0;){const l=s[o];l&&l.type===9&&(u+=l.branches.length)}return()=>{if(a)n.codegenNode=r2(i,u,r);else{const l=Bee(n.codegenNode);l.alternate=r2(i,u+n.branches.length-1,r)}}}));function Ree(t,e,r,n){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const i=e.exp?e.exp.loc:t.loc;r.onError(kr(28,e.loc)),e.exp=$t("true",!1,i)}if(e.name==="if"){const i=t2(t,e),a={type:9,loc:t.loc,branches:[i]};if(r.replaceNode(a),n)return n(a,i,!0)}else{const i=r.parent.children;let a=i.indexOf(t);for(;a-->=-1;){const s=i[a];if(s&&s.type===3){r.removeNode(s);continue}if(s&&s.type===2&&!s.content.trim().length){r.removeNode(s);continue}if(s&&s.type===9){e.name==="else-if"&&s.branches[s.branches.length-1].condition===void 0&&r.onError(kr(30,t.loc)),r.removeNode();const o=t2(t,e);s.branches.push(o);const u=n&&n(s,o,!1);Ng(o,r),u&&u(),r.currentNode=null}else r.onError(kr(30,t.loc));break}}}function t2(t,e){const r=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:r&&!ga(t,"for")?t.children:[t],userKey:Dg(t,"key"),isTemplateIf:r}}function r2(t,e,r){return t.condition?kb(t.condition,n2(t,e,r),hn(r.helper(ad),['""',"true"])):n2(t,e,r)}function n2(t,e,r){const{helper:n}=r,i=Yr("key",$t(`${e}`,!1,Bi,2)),{children:a}=t,s=a[0];if(a.length!==1||s.type!==1)if(a.length===1&&s.type===11){const u=s.codegenNode;return pv(u,i,r),u}else{let u=64;return Ph(r,n(Rh),Ji([i]),a,u+"",void 0,void 0,!0,!1,!1,t.loc)}else{const u=s.codegenNode,l=KQ(u);return l.type===13&&ew(l,r),pv(l,i,r),u}}function Bee(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const Pee=NR("for",(t,e,r)=>{const{helper:n,removeHelper:i}=r;return Iee(t,e,r,a=>{const s=hn(n(Gx),[a.source]),o=hv(t),u=ga(t,"memo"),l=Dg(t,"key"),c=l&&(l.type===6?$t(l.value.content,!0):l.exp),f=l?Yr("key",c):null,h=a.source.type===4&&a.source.constType>0,p=h?64:l?128:256;return a.codegenNode=Ph(r,n(Rh),void 0,s,p+"",void 0,void 0,!0,!h,!1,t.loc),()=>{let v;const{children:m}=a,b=m.length!==1||m[0].type!==1,y=dv(t)?t:o&&t.children.length===1&&dv(t.children[0])?t.children[0]:null;if(y?(v=y.codegenNode,o&&f&&pv(v,f,r)):b?v=Ph(r,n(Rh),f?Ji([f]):void 0,t.children,"64",void 0,void 0,!0,void 0,!1):(v=m[0].codegenNode,o&&f&&pv(v,f,r),v.isBlock!==!h&&(v.isBlock?(i(Lu),i(fc(r.inSSR,v.isComponent))):i(cc(r.inSSR,v.isComponent))),v.isBlock=!h,v.isBlock?(n(Lu),n(fc(r.inSSR,v.isComponent))):n(cc(r.inSSR,v.isComponent))),u){const S=lc(zb(a.parseResult,[$t("_cached")]));S.body=UQ([Sa(["const _memo = (",u.exp,")"]),Sa(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${r.helperString(hR)}(_cached, _memo)) return _cached`]),Sa(["const _item = ",v]),$t("_item.memo = _memo"),$t("return _item")]),s.arguments.push(S,$t("_cache"),$t(String(r.cached++)))}else s.arguments.push(lc(zb(a.parseResult),v,!0))}})});function Iee(t,e,r,n){if(!e.exp){r.onError(kr(31,e.loc));return}const i=e.forParseResult;if(!i){r.onError(kr(32,e.loc));return}TR(i);const{addIdentifiers:a,removeIdentifiers:s,scopes:o}=r,{source:u,value:l,key:c,index:f}=i,h={type:11,loc:e.loc,source:u,valueAlias:l,keyAlias:c,objectIndexAlias:f,parseResult:i,children:hv(t)?t.children:[t]};r.replaceNode(h),o.vFor++;const p=n&&n(h);return()=>{o.vFor--,p&&p()}}function TR(t,e){t.finalized||(t.finalized=!0)}function zb({value:t,key:e,index:r},n=[]){return kee([t,e,r,...n])}function kee(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((r,n)=>r||$t("_".repeat(n+1),!1))}const i2=$t("undefined",!1),Lee=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const r=ga(t,"slot");if(r)return r.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},$ee=(t,e,r,n)=>lc(t,r,!1,!0,r.length?r[0].loc:n);function zee(t,e,r=$ee){e.helper(Jx);const{children:n,loc:i}=t,a=[],s=[];let o=e.scopes.vSlot>0||e.scopes.vFor>0;const u=ga(t,"slot",!0);if(u){const{arg:b,exp:y}=u;b&&!vi(b)&&(o=!0),a.push(Yr(b||$t("default",!0),r(y,void 0,n,i)))}let l=!1,c=!1;const f=[],h=new Set;let p=0;for(let b=0;b{const x=r(y,void 0,S,i);return e.compatConfig&&(x.isNonScopedSlot=!0),Yr("default",x)};l?f.length&&f.some(y=>OR(y))&&(c?e.onError(kr(39,f[0].loc)):a.push(b(void 0,f))):a.push(b(void 0,n))}const v=o?2:Rm(t.children)?3:1;let m=Ji(a.concat(Yr("_",$t(v+"",!1))),i);return s.length&&(m=hn(e.helper(fR),[m,od(s)])),{slots:m,hasDynamicSlots:o}}function Kp(t,e,r){const n=[Yr("name",t),Yr("fn",e)];return r!=null&&n.push(Yr("key",$t(String(r),!0))),Ji(n)}function Rm(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:n,props:i}=t,a=t.tagType===1;let s=a?qee(t,e):`"${n}"`;const o=GM(s)&&s.callee===Wx;let u,l,c,f=0,h,p,v,m=o||s===ph||s===$x||!a&&(n==="svg"||n==="foreignObject");if(i.length>0){const b=RR(t,e,void 0,a,o);u=b.props,f=b.patchFlag,p=b.dynamicPropNames;const y=b.directives;v=y&&y.length?od(y.map(S=>Wee(S,e))):void 0,b.shouldUseBlock&&(m=!0)}if(t.children.length>0)if(s===uv&&(m=!0,f|=1024),a&&s!==ph&&s!==uv){const{slots:y,hasDynamicSlots:S}=zee(t,e);l=y,S&&(f|=1024)}else if(t.children.length===1&&s!==ph){const y=t.children[0],S=y.type,x=S===5||S===8;x&&Qi(y,e)===0&&(f|=1),x||S===2?l=y:l=t.children}else l=t.children;f!==0&&(c=String(f),p&&p.length&&(h=Vee(p))),t.codegenNode=Ph(e,s,u,l,c,h,v,!!m,!1,a,t.loc)};function qee(t,e,r=!1){let{tag:n}=t;const i=Ub(n),a=Dg(t,"is");if(a)if(i||Fu("COMPILER_IS_ON_ELEMENT",e)){const o=a.type===6?a.value&&$t(a.value.content,!0):a.exp;if(o)return hn(e.helper(Wx),[o])}else a.type===6&&a.value.content.startsWith("vue:")&&(n=a.value.content.slice(4));const s=pR(n)||e.isBuiltInComponent(n);return s?(r||e.helper(s),s):(e.helper(Hx),e.components.add(n),kh(n,"component"))}function RR(t,e,r=t.props,n,i,a=!1){const{tag:s,loc:o,children:u}=t;let l=[];const c=[],f=[],h=u.length>0;let p=!1,v=0,m=!1,b=!1,y=!1,S=!1,x=!1,A=!1;const _=[],w=N=>{l.length&&(c.push(Ji(a2(l),o)),l=[]),N&&c.push(N)},C=({key:N,value:M})=>{if(vi(N)){const O=N.content,F=S1(O);if(F&&(!n||i)&&O.toLowerCase()!=="onclick"&&O!=="onUpdate:modelValue"&&!P_(O)&&(S=!0),F&&P_(O)&&(A=!0),F&&M.type===14&&(M=M.arguments[0]),M.type===20||(M.type===4||M.type===8)&&Qi(M,e)>0)return;O==="ref"?m=!0:O==="class"?b=!0:O==="style"?y=!0:O!=="key"&&!_.includes(O)&&_.push(O),n&&(O==="class"||O==="style")&&!_.includes(O)&&_.push(O)}else x=!0};for(let N=0;N0&&l.push(Yr($t("ref_for",!0),$t("true")))),F==="is"&&(Ub(s)||V&&V.content.startsWith("vue:")||Fu("COMPILER_IS_ON_ELEMENT",e)))continue;l.push(Yr($t(F,!0,U),$t(V?V.content:"",H,V?V.loc:O)))}else{const{name:O,arg:F,exp:U,loc:V,modifiers:H}=M,I=O==="bind",P=O==="on";if(O==="slot"){n||e.onError(kr(40,V));continue}if(O==="once"||O==="memo"||O==="is"||I&&Du(F,"is")&&(Ub(s)||Fu("COMPILER_IS_ON_ELEMENT",e))||P&&a)continue;if((I&&Du(F,"key")||P&&h&&Du(F,"vue:before-update"))&&(p=!0),I&&Du(F,"ref")&&e.scopes.vFor>0&&l.push(Yr($t("ref_for",!0),$t("true"))),!F&&(I||P)){if(x=!0,U)if(I){if(w(),Fu("COMPILER_V_BIND_OBJECT_ORDER",e)){c.unshift(U);continue}c.push(U)}else w({type:14,loc:V,callee:e.helper(Kx),arguments:n?[U]:[U,"true"]});else e.onError(kr(I?34:35,V));continue}I&&H.includes("prop")&&(v|=32);const K=e.directiveTransforms[O];if(K){const{props:$,needRuntime:se}=K(M,t,e);!a&&$.forEach(C),P&&F&&!vi(F)?w(Ji($,o)):l.push(...$),se&&(f.push(M),_1(se)&&FR.set(M,se))}else M9(O)||(f.push(M),h&&(p=!0))}}let E;if(c.length?(w(),c.length>1?E=hn(e.helper(lv),c,o):E=c[0]):l.length&&(E=Ji(a2(l),o)),x?v|=16:(b&&!n&&(v|=2),y&&!n&&(v|=4),_.length&&(v|=8),S&&(v|=32)),!p&&(v===0||v===32)&&(m||A||f.length>0)&&(v|=512),!e.inSSR&&E)switch(E.type){case 15:let N=-1,M=-1,O=!1;for(let V=0;VYr(s,a)),i))}return od(r,t.loc)}function Vee(t){let e="[";for(let r=0,n=t.length;r{if(dv(t)){const{children:r,loc:n}=t,{slotName:i,slotProps:a}=jee(t,e),s=[e.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"];let o=2;a&&(s[2]=a,o=3),r.length&&(s[3]=lc([],r,!1,!1,n),o=4),e.scopeId&&!e.slotted&&(o=5),s.splice(o),t.codegenNode=hn(e.helper(cR),s,n)}};function jee(t,e){let r='"default"',n;const i=[];for(let a=0;a0){const{props:a,directives:s}=RR(t,e,i,!1,!1);n=a,s.length&&e.onError(kr(36,s[0].loc))}return{slotName:r,slotProps:n}}const Gee=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,BR=(t,e,r,n)=>{const{loc:i,modifiers:a,arg:s}=t;!t.exp&&!a.length&&r.onError(kr(35,i));let o;if(s.type===4)if(s.isStatic){let f=s.content;f.startsWith("vue:")&&(f=`vnode-${f.slice(4)}`);const h=e.tagType!==0||f.startsWith("vnode")||!/[A-Z]/.test(f)?cT(Oi(f)):`on:${f}`;o=$t(h,!0,s.loc)}else o=Sa([`${r.helperString(Ib)}(`,s,")"]);else o=s,o.children.unshift(`${r.helperString(Ib)}(`),o.children.push(")");let u=t.exp;u&&!u.content.trim()&&(u=void 0);let l=r.cacheHandlers&&!u&&!r.inVOnce;if(u){const f=mR(u.content),h=!(f||Gee.test(u.content)),p=u.content.includes(";");(h||l&&f)&&(u=Sa([`${h?"$event":"(...args)"} => ${p?"{":"("}`,u,p?"}":")"]))}let c={props:[Yr(o,u||$t("() => {}",!1,i))]};return n&&(c=n(c)),l&&(c.props[0].value=r.cache(c.props[0].value)),c.props.forEach(f=>f.key.isHandlerKey=!0),c},Xee=(t,e,r)=>{const{modifiers:n,loc:i}=t,a=t.arg;let{exp:s}=t;if(s&&s.type===4&&!s.content.trim()&&(s=void 0),!s){if(a.type!==4||!a.isStatic)return r.onError(kr(52,a.loc)),{props:[Yr(a,$t("",!0,i))]};const o=Oi(a.content);s=t.exp=$t(o,!1,a.loc)}return a.type!==4?(a.children.unshift("("),a.children.push(') || ""')):a.isStatic||(a.content=`${a.content} || ""`),n.includes("camel")&&(a.type===4?a.isStatic?a.content=Oi(a.content):a.content=`${r.helperString(Pb)}(${a.content})`:(a.children.unshift(`${r.helperString(Pb)}(`),a.children.push(")"))),r.inSSR||(n.includes("prop")&&s2(a,"."),n.includes("attr")&&s2(a,"^")),{props:[Yr(a,s)]}},s2=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},Zee=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const r=t.children;let n,i=!1;for(let a=0;aa.type===7&&!e.directiveTransforms[a.name])&&t.tag!=="template")))for(let a=0;a{if(t.type===1&&ga(t,"once",!0))return o2.has(t)||e.inVOnce||e.inSSR?void 0:(o2.add(t),e.inVOnce=!0,e.helper(cv),()=>{e.inVOnce=!1;const r=e.currentNode;r.codegenNode&&(r.codegenNode=e.cache(r.codegenNode,!0))})},PR=(t,e,r)=>{const{exp:n,arg:i}=t;if(!n)return r.onError(kr(41,t.loc)),Jp();const a=n.loc.source,s=n.type===4?n.content:a,o=r.bindingMetadata[a];if(o==="props"||o==="props-aliased")return r.onError(kr(44,n.loc)),Jp();const u=!1;if(!s.trim()||!mR(s)&&!u)return r.onError(kr(42,n.loc)),Jp();const l=i||$t("modelValue",!0),c=i?vi(i)?`onUpdate:${Oi(i.content)}`:Sa(['"onUpdate:" + ',i]):"onUpdate:modelValue";let f;const h=r.isTS?"($event: any)":"$event";f=Sa([`${h} => ((`,n,") = $event)"]);const p=[Yr(l,t.exp),Yr(c,f)];if(t.modifiers.length&&e.tagType===1){const v=t.modifiers.map(b=>(rw(b)?b:JSON.stringify(b))+": true").join(", "),m=i?vi(i)?`${i.content}Modifiers`:Sa([i,' + "Modifiers"']):"modelModifiers";p.push(Yr(m,$t(`{ ${v} }`,!1,t.loc,2)))}return Jp(p)};function Jp(t=[]){return{props:t}}const Jee=/[\w).+\-_$\]]/,Qee=(t,e)=>{Fu("COMPILER_FILTERS",e)&&(t.type===5&&vv(t.content,e),t.type===1&&t.props.forEach(r=>{r.type===7&&r.name!=="for"&&r.exp&&vv(r.exp,e)}))};function vv(t,e){if(t.type===4)u2(t,e);else for(let r=0;r=0&&(S=r.charAt(y),S===" ");y--);(!S||!Jee.test(S))&&(s=!0)}}v===void 0?v=r.slice(0,p).trim():c!==0&&b();function b(){m.push(r.slice(c,p).trim()),c=p+1}if(m.length){for(p=0;p{if(t.type===1){const r=ga(t,"memo");return!r||l2.has(t)?void 0:(l2.add(t),()=>{const n=t.codegenNode||e.currentNode.codegenNode;n&&n.type===13&&(t.tagType!==1&&ew(n,e),t.codegenNode=hn(e.helper(Qx),[r.exp,lc(void 0,n),"_cache",String(e.cached++)]))})}};function rte(t){return[[Kee,Fee,tte,Pee,Qee,Yee,Uee,Lee,Zee],{on:BR,bind:Xee,model:PR}]}function nte(t,e={}){const r=e.onError||tw,n=e.mode==="module";e.prefixIdentifiers===!0?r(kr(47)):n&&r(kr(48));const i=!1;e.cacheHandlers&&r(kr(49)),e.scopeId&&!n&&r(kr(50));const a=gi({},e,{prefixIdentifiers:i}),s=jr(t)?lee(t,a):t,[o,u]=rte();return dee(s,gi({},a,{nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:gi({},u,e.directiveTransforms||{})})),gee(s,a)}const ite=()=>({props:[]});/** * @vue/compiler-dom v3.4.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const BR=Symbol(""),PR=Symbol(""),IR=Symbol(""),kR=Symbol(""),Ub=Symbol(""),LR=Symbol(""),$R=Symbol(""),zR=Symbol(""),UR=Symbol(""),qR=Symbol("");kQ({[BR]:"vModelRadio",[PR]:"vModelCheckbox",[IR]:"vModelText",[kR]:"vModelSelect",[Ub]:"vModelDynamic",[LR]:"withModifiers",[$R]:"withKeys",[zR]:"vShow",[UR]:"Transition",[qR]:"TransitionGroup"});let Ml;function ite(t,e=!1){return Ml||(Ml=document.createElement("div")),e?(Ml.innerHTML=`
`,Ml.children[0].getAttribute("foo")):(Ml.innerHTML=t,Ml.textContent)}const ate={parseMode:"html",isVoidTag:O9,isNativeTag:t=>F9(t)||R9(t)||B9(t),isPreTag:t=>t==="pre",decodeEntities:ite,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return UR;if(t==="TransitionGroup"||t==="transition-group")return qR},getNamespace(t,e,r){let n=e?e.ns:r;if(e&&n===2)if(e.tag==="annotation-xml"){if(t==="svg")return 1;e.props.some(i=>i.type===6&&i.name==="encoding"&&i.value!=null&&(i.value.content==="text/html"||i.value.content==="application/xhtml+xml"))&&(n=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(n=0);else e&&n===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(n=0);if(n===0){if(t==="svg")return 1;if(t==="math")return 2}return n}},ste=t=>{t.type===1&&t.props.forEach((e,r)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[r]={type:7,name:"bind",arg:$t("style",!0,e.loc),exp:ote(e.value.content,e.loc),modifiers:[],loc:e.loc})})},ote=(t,e)=>{const r=P9(t);return $t(JSON.stringify(r),!1,e,3)};function Bo(t,e){return kr(t,e)}const ute=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(53,i)),e.children.length&&(r.onError(Bo(54,i)),e.children.length=0),{props:[Yr($t("innerHTML",!0,i),n||$t("",!0))]}},lte=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(55,i)),e.children.length&&(r.onError(Bo(56,i)),e.children.length=0),{props:[Yr($t("textContent",!0),n?Qi(n,r)>0?n:hn(r.helperString(Sg),[n],i):$t("",!0))]}},cte=(t,e,r)=>{const n=RR(t,e,r);if(!n.props.length||e.tagType===1)return n;t.arg&&r.onError(Bo(58,t.arg.loc));const{tag:i}=e,a=r.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||a){let s=IR,o=!1;if(i==="input"||a){const u=_g(e,"type");if(u){if(u.type===7)s=Ub;else if(u.value)switch(u.value.content){case"radio":s=BR;break;case"checkbox":s=PR;break;case"file":o=!0,r.onError(Bo(59,t.loc));break}}else jQ(e)&&(s=Ub)}else i==="select"&&(s=kR);o||(n.needRuntime=r.helper(s))}else r.onError(Bo(57,t.loc));return n.props=n.props.filter(s=>!(s.key.type===4&&s.key.content==="modelValue")),n},fte=qv("passive,once,capture"),hte=qv("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),dte=qv("left,right"),HR=qv("onkeyup,onkeydown,onkeypress",!0),pte=(t,e,r,n)=>{const i=[],a=[],s=[];for(let o=0;ovi(t)&&t.content.toLowerCase()==="onclick"?$t(e,!0):t.type!==4?Sa(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,mte=(t,e,r)=>FR(t,e,r,n=>{const{modifiers:i}=t;if(!i.length)return n;let{key:a,value:s}=n.props[0];const{keyModifiers:o,nonKeyModifiers:u,eventOptionModifiers:l}=pte(a,i,r,t.loc);if(u.includes("right")&&(a=s2(a,"onContextmenu")),u.includes("middle")&&(a=s2(a,"onMouseup")),u.length&&(s=hn(r.helper(LR),[s,JSON.stringify(u)])),o.length&&(!vi(a)||HR(a.content))&&(s=hn(r.helper($R),[s,JSON.stringify(o)])),l.length){const c=l.map(zv).join("");a=vi(a)?$t(`${a.content}${c}`,!0):Sa(["(",a,`) + "${c}"`])}return{props:[Yr(a,s)]}}),vte=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(61,i)),{props:[],needRuntime:r.helper(zR)}},gte=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&e.removeNode()},yte=[ste],bte={cloak:nte,html:ute,text:lte,model:cte,on:mte,show:vte};function xte(t,e={}){return rte(t,gi({},ate,e,{nodeTransforms:[gte,...yte,...e.nodeTransforms||[]],directiveTransforms:gi({},bte,e.directiveTransforms||{}),transformHoist:null}))}/** +**/const IR=Symbol(""),kR=Symbol(""),LR=Symbol(""),$R=Symbol(""),qb=Symbol(""),zR=Symbol(""),UR=Symbol(""),qR=Symbol(""),HR=Symbol(""),WR=Symbol("");LQ({[IR]:"vModelRadio",[kR]:"vModelCheckbox",[LR]:"vModelText",[$R]:"vModelSelect",[qb]:"vModelDynamic",[zR]:"withModifiers",[UR]:"withKeys",[qR]:"vShow",[HR]:"Transition",[WR]:"TransitionGroup"});let Ml;function ate(t,e=!1){return Ml||(Ml=document.createElement("div")),e?(Ml.innerHTML=`
`,Ml.children[0].getAttribute("foo")):(Ml.innerHTML=t,Ml.textContent)}const ste={parseMode:"html",isVoidTag:T9,isNativeTag:t=>O9(t)||F9(t)||R9(t),isPreTag:t=>t==="pre",decodeEntities:ate,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return HR;if(t==="TransitionGroup"||t==="transition-group")return WR},getNamespace(t,e,r){let n=e?e.ns:r;if(e&&n===2)if(e.tag==="annotation-xml"){if(t==="svg")return 1;e.props.some(i=>i.type===6&&i.name==="encoding"&&i.value!=null&&(i.value.content==="text/html"||i.value.content==="application/xhtml+xml"))&&(n=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(n=0);else e&&n===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(n=0);if(n===0){if(t==="svg")return 1;if(t==="math")return 2}return n}},ote=t=>{t.type===1&&t.props.forEach((e,r)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[r]={type:7,name:"bind",arg:$t("style",!0,e.loc),exp:ute(e.value.content,e.loc),modifiers:[],loc:e.loc})})},ute=(t,e)=>{const r=B9(t);return $t(JSON.stringify(r),!1,e,3)};function Bo(t,e){return kr(t,e)}const lte=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(53,i)),e.children.length&&(r.onError(Bo(54,i)),e.children.length=0),{props:[Yr($t("innerHTML",!0,i),n||$t("",!0))]}},cte=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(55,i)),e.children.length&&(r.onError(Bo(56,i)),e.children.length=0),{props:[Yr($t("textContent",!0),n?Qi(n,r)>0?n:hn(r.helperString(Ag),[n],i):$t("",!0))]}},fte=(t,e,r)=>{const n=PR(t,e,r);if(!n.props.length||e.tagType===1)return n;t.arg&&r.onError(Bo(58,t.arg.loc));const{tag:i}=e,a=r.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||a){let s=LR,o=!1;if(i==="input"||a){const u=Dg(e,"type");if(u){if(u.type===7)s=qb;else if(u.value)switch(u.value.content){case"radio":s=IR;break;case"checkbox":s=kR;break;case"file":o=!0,r.onError(Bo(59,t.loc));break}}else GQ(e)&&(s=qb)}else i==="select"&&(s=$R);o||(n.needRuntime=r.helper(s))}else r.onError(Bo(57,t.loc));return n.props=n.props.filter(s=>!(s.key.type===4&&s.key.content==="modelValue")),n},hte=Wv("passive,once,capture"),dte=Wv("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),pte=Wv("left,right"),VR=Wv("onkeyup,onkeydown,onkeypress",!0),mte=(t,e,r,n)=>{const i=[],a=[],s=[];for(let o=0;ovi(t)&&t.content.toLowerCase()==="onclick"?$t(e,!0):t.type!==4?Sa(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,vte=(t,e,r)=>BR(t,e,r,n=>{const{modifiers:i}=t;if(!i.length)return n;let{key:a,value:s}=n.props[0];const{keyModifiers:o,nonKeyModifiers:u,eventOptionModifiers:l}=mte(a,i,r,t.loc);if(u.includes("right")&&(a=c2(a,"onContextmenu")),u.includes("middle")&&(a=c2(a,"onMouseup")),u.length&&(s=hn(r.helper(zR),[s,JSON.stringify(u)])),o.length&&(!vi(a)||VR(a.content))&&(s=hn(r.helper(UR),[s,JSON.stringify(o)])),l.length){const c=l.map(qv).join("");a=vi(a)?$t(`${a.content}${c}`,!0):Sa(["(",a,`) + "${c}"`])}return{props:[Yr(a,s)]}}),gte=(t,e,r)=>{const{exp:n,loc:i}=t;return n||r.onError(Bo(61,i)),{props:[],needRuntime:r.helper(qR)}},yte=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&e.removeNode()},bte=[ote],xte={cloak:ite,html:lte,text:cte,model:fte,on:vte,show:gte};function wte(t,e={}){return nte(t,gi({},ste,e,{nodeTransforms:[yte,...bte,...e.nodeTransforms||[]],directiveTransforms:gi({},xte,e.directiveTransforms||{}),transformHoist:null}))}/** * vue v3.4.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const o2=new WeakMap;function wte(t){let e=o2.get(t??Wl);return e||(e=Object.create(null),o2.set(t??Wl,e)),e}function Ste(t,e){if(!jr(t))if(t.nodeType)t=t.innerHTML;else return th;const r=t,n=wte(e),i=n[r];if(i)return i;if(t[0]==="#"){const u=document.querySelector(t);t=u?u.innerHTML:""}const a=gi({hoistStatic:!0,onError:void 0,onWarn:th},e);!a.isCustomElement&&typeof customElements<"u"&&(a.isCustomElement=u=>!!customElements.get(u));const{code:s}=xte(t,a),o=new Function("Vue",s)(OQ);return o._rc=!0,n[r]=o}aT(Ste);class Gx{constructor(e={}){je(this,"config",{primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"});je(this,"container",document.createElement("div"));je(this,"popupBody",document.createElement("div"));je(this,"parentWrapper");if(this.config=Object.assign(this.config,e),this.config.primarySelector===void 0&&document.querySelectorAll(".is-popup").length>0){const r=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[r-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0]}static show(e,r={},n={}){return new Gx(n).open(e,r)}hash(){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<10;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e.toLocaleLowerCase()}open(e,r={},n={}){if(this.popupBody=document.createElement("div"),typeof e=="function")try{e=(async()=>(await e()).default)()}catch{}const i=document.querySelector("body").querySelectorAll("div")[0];this.parentWrapper.style.filter="blur(4px)",i.style.filter="blur(6px)";let a=[];const s=nsState.state.getValue();s.popups!==void 0&&(a=s.popups);let o={};e.props&&(o=Object.keys(r).filter(l=>e.props.includes(l)).reduce((l,c)=>(l[c]=r[c],l),{}));const u={hash:`popup-${this.hash()}-${this.hash()}`,component:Uv(e),close:(l=null)=>this.close(u,l),props:o,params:r,config:n};return a.push(u),nsState.setState({popups:a}),u}close(e,r=null){this.parentWrapper.style.filter="blur(0px)";const n=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(n.style.filter="blur(0px)");const i=`#${e.hash} .popup-body`,a=document.querySelector(i);a.classList.remove("zoom-out-entrance"),a.classList.add("zoom-in-exit"),document.querySelector(`#${e.hash}`).classList.remove("is-popup"),setTimeout(()=>{const{popups:o}=nsState.state.getValue(),u=o.indexOf(e);if(o.splice(u,1),nsState.setState({popups:o}),nsHotPress.destroy(`popup-esc-${e.hash}`),r!==null)return r(e)},250)}}class WR{constructor(){je(this,"_subject");this._subject=new rg}subject(){return this._subject}emit({identifier:e,value:r}){this._subject.next({identifier:e,value:r})}}class zy{constructor(e){this.instance=e}close(){this.instance.classList.add("fade-out-exit"),this.instance.classList.add("anim-duration-300"),this.instance.classList.remove("zoom-in-entrance"),setTimeout(()=>{this.instance.remove()},250)}}class VR{constructor(){je(this,"queue");window.floatingNotices===void 0&&(window.floatingNotices=[],this.queue=window.floatingNotices)}show(e,r,n={duration:3e3,type:"info"}){const{floatingNotice:i}=this.__createSnack({title:e,description:r,options:n});n.actions===void 0&&(n.duration=3e3),this.__startTimer(n.duration,i)}error(e,r,n={duration:3e3,type:"error"}){return this.show(e,r,{...n,type:"error"})}success(e,r,n={duration:3e3,type:"success"}){return this.show(e,r,{...n,type:"success"})}info(e,r,n={duration:3e3,type:"info"}){return this.show(e,r,{...n,type:"info"})}warning(e,r,n={duration:3e3,type:"warning"}){return this.show(e,r,{...n,type:"warning"})}__startTimer(e,r){let n;const i=()=>{e>0&&e!==!1&&(n=setTimeout(()=>{new zy(r).close()},e))};r.addEventListener("mouseenter",()=>{clearTimeout(n)}),r.addEventListener("mouseleave",()=>{i()}),i()}__createSnack({title:e,description:r,options:n}){let i="",a="";switch(n.type){case"info":i="",a="info";break;case"error":i="",a="error";break;case"success":i="",a="success";break;case"warning":i="",a="warning";break}if(document.getElementById("floating-notice-wrapper")===null){const u=new DOMParser().parseFromString(` +**/const f2=new WeakMap;function Ste(t){let e=f2.get(t??Wl);return e||(e=Object.create(null),f2.set(t??Wl,e)),e}function _te(t,e){if(!jr(t))if(t.nodeType)t=t.innerHTML;else return eh;const r=t,n=Ste(e),i=n[r];if(i)return i;if(t[0]==="#"){const u=document.querySelector(t);t=u?u.innerHTML:""}const a=gi({hoistStatic:!0,onError:void 0,onWarn:eh},e);!a.isCustomElement&&typeof customElements<"u"&&(a.isCustomElement=u=>!!customElements.get(u));const{code:s}=wte(t,a),o=new Function("Vue",s)(FQ);return o._rc=!0,n[r]=o}lT(_te);class iw{constructor(e={}){je(this,"config",{primarySelector:void 0,popupClass:"shadow-lg h-half w-1/2 bg-white"});je(this,"container",document.createElement("div"));je(this,"popupBody",document.createElement("div"));je(this,"parentWrapper");if(this.config=Object.assign(this.config,e),this.config.primarySelector===void 0&&document.querySelectorAll(".is-popup").length>0){const r=document.querySelectorAll(".is-popup").length;this.parentWrapper=document.querySelectorAll(".is-popup")[r-1]}else this.parentWrapper=document.querySelector("body").querySelectorAll("div")[0]}static show(e,r={},n={}){return new iw(n).open(e,r)}hash(){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<10;n++)e+=r.charAt(Math.floor(Math.random()*r.length));return e.toLocaleLowerCase()}open(e,r={},n={}){if(this.popupBody=document.createElement("div"),typeof e=="function")try{e=(async()=>(await e()).default)()}catch{}const i=document.querySelector("body").querySelectorAll("div")[0];this.parentWrapper.style.filter="blur(4px)",i.style.filter="blur(6px)";let a=[];const s=nsState.state.getValue();s.popups!==void 0&&(a=s.popups);let o={};e.props&&(o=Object.keys(r).filter(l=>e.props.includes(l)).reduce((l,c)=>(l[c]=r[c],l),{}));const u={hash:`popup-${this.hash()}-${this.hash()}`,component:Hv(e),close:(l=null)=>this.close(u,l),props:o,params:r,config:n};return a.push(u),nsState.setState({popups:a}),u}close(e,r=null){this.parentWrapper.style.filter="blur(0px)";const n=document.querySelector("body").querySelectorAll("div")[0];document.querySelectorAll(".is-popup").length<=1&&(n.style.filter="blur(0px)");const i=`#${e.hash} .popup-body`,a=document.querySelector(i);a.classList.remove("zoom-out-entrance"),a.classList.add("zoom-in-exit"),document.querySelector(`#${e.hash}`).classList.remove("is-popup"),setTimeout(()=>{const{popups:o}=nsState.state.getValue(),u=o.indexOf(e);if(o.splice(u,1),nsState.setState({popups:o}),nsHotPress.destroy(`popup-esc-${e.hash}`),r!==null)return r(e)},250)}}class YR{constructor(){je(this,"_subject");this._subject=new ig}subject(){return this._subject}emit({identifier:e,value:r}){this._subject.next({identifier:e,value:r})}}class qy{constructor(e){this.instance=e}close(){this.instance.classList.add("fade-out-exit"),this.instance.classList.add("anim-duration-300"),this.instance.classList.remove("zoom-in-entrance"),setTimeout(()=>{this.instance.remove()},250)}}class jR{constructor(){je(this,"queue");window.floatingNotices===void 0&&(window.floatingNotices=[],this.queue=window.floatingNotices)}show(e,r,n={duration:3e3,type:"info"}){const{floatingNotice:i}=this.__createSnack({title:e,description:r,options:n});n.actions===void 0&&(n.duration=3e3),this.__startTimer(n.duration,i)}error(e,r,n={duration:3e3,type:"error"}){return this.show(e,r,{...n,type:"error"})}success(e,r,n={duration:3e3,type:"success"}){return this.show(e,r,{...n,type:"success"})}info(e,r,n={duration:3e3,type:"info"}){return this.show(e,r,{...n,type:"info"})}warning(e,r,n={duration:3e3,type:"warning"}){return this.show(e,r,{...n,type:"warning"})}__startTimer(e,r){let n;const i=()=>{e>0&&e!==!1&&(n=setTimeout(()=>{new qy(r).close()},e))};r.addEventListener("mouseenter",()=>{clearTimeout(n)}),r.addEventListener("mouseleave",()=>{i()}),i()}__createSnack({title:e,description:r,options:n}){let i="",a="";switch(n.type){case"info":i="",a="info";break;case"error":i="",a="error";break;case"success":i="",a="success";break;case"warning":i="",a="warning";break}if(document.getElementById("floating-notice-wrapper")===null){const u=new DOMParser().parseFromString(`
@@ -104,43 +104,43 @@ Qe.version="2.30.1";WG(Br);Qe.fn=Xe;Qe.min=FZ;Qe.max=RZ;Qe.now=BZ;Qe.utc=Ja;Qe.u
- `,"text/html").firstElementChild;n.actions[u].onClick?c.querySelector(".ns-button").addEventListener("click",()=>{n.actions[u].onClick(new zy(o))}):c.querySelector(".ns-button").addEventListener("click",()=>new zy(o).close()),l.appendChild(c.querySelector(".ns-button"))}return s.appendChild(o),{floatingNotice:o}}}class _te{constructor(){je(this,"_subject");je(this,"_client");je(this,"_lastRequestData");this._subject=new an}defineClient(e){this._client=e}post(e,r,n={}){return this._request("post",e,r,n)}get(e,r={}){return this._request("get",e,void 0,r)}delete(e,r={}){return this._request("delete",e,void 0,r)}put(e,r,n={}){return this._request("put",e,r,n)}get response(){return this._lastRequestData}_request(e,r,n={},i={}){return r=nsHooks.applyFilters("http-client-url",r.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:r,data:n}),new Kt(a=>{this._client[e](r,n,{...this._client.defaults[e],...i}).then(s=>{this._lastRequestData=s,a.next(s.data),a.complete(),this._subject.next({identifier:"async.stop"})}).catch(s=>{var o;a.error(((o=s.response)==null?void 0:o.data)||s.response||s),this._subject.next({identifier:"async.stop"})})})}subject(){return this._subject}emit({identifier:e,value:r}){this._subject.next({identifier:e,value:r})}}class YR{constructor(){je(this,"queue");window.snackbarQueue===void 0&&(window.snackbarQueue=[],this.queue=window.snackbarQueue)}show(e,r,n={duration:3e3,type:"info"}){return new Kt(i=>{const{buttonNode:a,textNode:s,snackWrapper:o,sampleSnack:u}=this.__createSnack({message:e,label:r,type:n.type});a.addEventListener("click",l=>{i.next(a),i.complete(),u.remove()}),this.__startTimer(n.duration,u)})}error(e,r=null,n={duration:3e3,type:"error"}){return this.show(e,r,{...n,type:"error"})}success(e,r=null,n={duration:3e3,type:"success"}){return this.show(e,r,{...n,type:"success"})}info(e,r=null,n={duration:3e3,type:"info"}){return this.show(e,r,{...n,type:"info"})}__startTimer(e,r){let n;const i=()=>{e>0&&e!==!1&&(n=setTimeout(()=>{r.remove()},e))};r.addEventListener("mouseenter",()=>{clearTimeout(n)}),r.addEventListener("mouseleave",()=>{i()}),i()}__createSnack({message:e,label:r,type:n="info"}){const i=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),s=document.createElement("p"),o=document.createElement("div"),u=document.createElement("button");let l="",c="";switch(n){case"info":l="",c="info";break;case"error":l="",c="error";break;case"success":l="",c="success";break}return s.textContent=e,s.setAttribute("class","pr-2"),r&&(o.setAttribute("class","ns-button default"),u.textContent=r,u.setAttribute("class",`px-3 py-2 shadow rounded uppercase ${l}`),o.appendChild(u)),a.appendChild(s),a.appendChild(o),a.setAttribute("class",`md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ${c}`),i.appendChild(a),document.getElementById("snack-wrapper")===null&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:a,buttonsWrapper:o,buttonNode:u,textNode:s}}}class Ate{constructor(e){je(this,"behaviorState");je(this,"stateStore",{});this.behaviorState=new H1({}),this.behaviorState.subscribe(r=>{this.stateStore=r}),this.setState(e)}setState(e){this.behaviorState.next({...this.stateStore,...e})}get state(){return this.behaviorState}subscribe(e){this.behaviorState.subscribe(e)}}class Dte{validateFields(e){return e.map(r=>(this.checkField(r,e,{touchField:!1}),r.errors?r.errors.length===0:0)).filter(r=>r===!1).length===0}validateFieldsErrors(e){return e.map(r=>(this.checkField(r,e,{touchField:!1}),r.errors)).flat()}validateForm(e){e.main&&this.validateField(e.main);const r=[];for(let n in e.tabs)if(e.tabs[n].fields){const i=[],a=this.validateFieldsErrors(e.tabs[n].fields);a.length>0&&i.push(a),e.tabs[n].errors=i.flat(),r.push(i.flat())}return r.flat().filter(n=>n!==void 0)}initializeTabs(e){let r=0;for(let n in e)r===0&&(e[n].active=!0),e[n].active=e[n].active===void 0?!1:e[n].active,e[n].fields=this.createFields(e[n].fields),r++;return e}validateField(e){return this.checkField(e,[],{touchField:!1})}fieldsValid(e){return!(e.map(r=>r.errors&&r.errors.length>0).filter(r=>r).length>0)}createFields(e){return e.map(r=>{if(r.type=r.type||"text",r.errors=r.errors||[],r.disabled=r.disabled||!1,r.touched=!1,r.type==="custom"&&typeof r.component=="string"){const n=r.component;if(r.component=Uv(nsExtraComponents[r.component]),r.component)r.component.value.$field=r,r.component.value.$fields=e;else throw`Failed to load a custom component. "${n}" is not provided as an extra component. More details here: "https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component"`}return r})}isFormUntouched(e){let r=!0;if(e.main&&(r=e.main.touched?!1:r),e.tabs)for(let n in e.tabs)r=e.tabs[n].fields.filter(i=>i.touched).length>0?!1:r;return r}createForm(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(let r in e.tabs)e.tabs[r].errors=[],e.tabs[r].fields!==void 0?e.tabs[r].fields=this.createFields(e.tabs[r].fields):console.info(`Warning: The tab "${e.tabs[r].label}" is missing fields. Fallback on checking dynamic component instead.`);return e}enableFields(e){return e.map(r=>r.disabled=!1)}disableFields(e){return e.map(r=>r.disabled=!0)}disableForm(e){e.main&&(e.main.disabled=!0);for(let r in e.tabs)e.tabs[r].fields.forEach(n=>n.disabled=!0)}enableForm(e){e.main&&(e.main.disabled=!1);for(let r in e.tabs)e.tabs[r].fields.forEach(n=>n.disabled=!1)}getValue(e){const r={};return e.forEach(n=>{r[n.name]=n.value}),r}checkField(e,r=[],n={touchField:!0}){if(e.validation!==void 0){e.errors=[];const i=this.detectValidationRules(e.validation).filter(s=>s!=null);i.map(s=>s.identifier).includes("sometimes")?e.value!==void 0&&e.value.length>0&&i.forEach(s=>{this.fieldPassCheck(e,s,r)}):i.forEach(s=>{this.fieldPassCheck(e,s,r)})}return n.touchField&&(e.touched=!0),e}extractForm(e){let r={};if(e.main&&(r[e.main.name]=e.main.value),e.tabs)for(let n in e.tabs)r[n]===void 0&&(r[n]={}),r[n]=this.extractFields(e.tabs[n].fields);return r}extractFields(e,r={}){return e.forEach(n=>{r[n.name]=n.value}),r}detectValidationRules(e){const r=n=>{const i=/(min)\:([0-9])+/g,a=/(sometimes)/g,s=/(max)\:([0-9])+/g,o=/(same):(\w+)/g,u=/(different):(\w+)/g;let l;if(["email","required"].includes(n))return{identifier:n};if(n.length>0&&(l=i.exec(n)||s.exec(n)||o.exec(n)||u.exec(n)||a.exec(n),l!==null))return{identifier:l[1],value:l[2]}};return Array.isArray(e)?e.filter(n=>typeof n=="string").map(r):e.split("|").map(r)}triggerError(e,r){if(r.errors)for(let n in r.errors){let i=n.split(".").filter(a=>!/^\d+$/.test(a));i.length===2&&e.tabs[i[0]].fields.forEach(a=>{a.name===i[1]&&r.errors[n].forEach(s=>{const o={identifier:"invalid",invalid:!0,message:s,name:a.name};a.errors.push(o)})}),n===e.main.name&&r.errors[n].forEach(a=>{e.main.errors.push({identifier:"invalid",invalid:!0,message:a,name:e.main.name})})}}triggerFieldsErrors(e,r){if(r&&r.errors)for(let n in r.errors)e.forEach(i=>{i.name===n&&r.errors[n].forEach(a=>{const s={identifier:"invalid",invalid:!0,message:a,name:i.name};i.errors.push(s)})})}trackError(e,r,n){e.errors.push({identifier:r.identifier,invalid:!0,name:e.name,rule:r,fields:n})}unTrackError(e,r){e.errors.forEach((n,i)=>{n.identifier===r.identifier&&n.invalid===!0&&e.errors.splice(i,1)})}fieldPassCheck(e,r,n){if(r!==void 0){const a={required:(s,o)=>s.value===void 0||s.value===null||s.value.length===0,email:(s,o)=>s.value.length>0&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(s.value),same:(s,o)=>{const u=n.filter(l=>l.name===o.value);return u.length===1&&["string","number"].includes(typeof s.value)&&s.value.length>0&&u[0].value!==s.value},different:(s,o)=>{const u=n.filter(l=>l.name===o.value);return u.length===1&&["string","number"].includes(typeof s.value)&&s.value.length>0&&u[0].value===s.value},min:(s,o)=>s.value&&s.value.lengths.value&&s.value.length>parseInt(o.value)}[r.identifier];return typeof a=="function"?a(e,r)===!1?this.unTrackError(e,r):this.trackError(e,r,n):e}}}class Nte{constructor(){je(this,"url");this.url=ns.base_url}get(e){return this.url+e}}/** + `,"text/html").firstElementChild;n.actions[u].onClick?c.querySelector(".ns-button").addEventListener("click",()=>{n.actions[u].onClick(new qy(o))}):c.querySelector(".ns-button").addEventListener("click",()=>new qy(o).close()),l.appendChild(c.querySelector(".ns-button"))}return s.appendChild(o),{floatingNotice:o}}}class Ate{constructor(){je(this,"_subject");je(this,"_client");je(this,"_lastRequestData");this._subject=new an}defineClient(e){this._client=e}post(e,r,n={}){return this._request("post",e,r,n)}get(e,r={}){return this._request("get",e,void 0,r)}delete(e,r={}){return this._request("delete",e,void 0,r)}put(e,r,n={}){return this._request("put",e,r,n)}get response(){return this._lastRequestData}_request(e,r,n={},i={}){return r=nsHooks.applyFilters("http-client-url",r.replace(/\/$/,"")),this._subject.next({identifier:"async.start",url:r,data:n}),new Kt(a=>{this._client[e](r,n,{...this._client.defaults[e],...i}).then(s=>{this._lastRequestData=s,a.next(s.data),a.complete(),this._subject.next({identifier:"async.stop"})}).catch(s=>{var o;a.error(((o=s.response)==null?void 0:o.data)||s.response||s),this._subject.next({identifier:"async.stop"})})})}subject(){return this._subject}emit({identifier:e,value:r}){this._subject.next({identifier:e,value:r})}}class GR{constructor(){je(this,"queue");window.snackbarQueue===void 0&&(window.snackbarQueue=[],this.queue=window.snackbarQueue)}show(e,r,n={duration:3e3,type:"info"}){return new Kt(i=>{const{buttonNode:a,textNode:s,snackWrapper:o,sampleSnack:u}=this.__createSnack({message:e,label:r,type:n.type});a.addEventListener("click",l=>{i.next(a),i.complete(),u.remove()}),this.__startTimer(n.duration,u)})}error(e,r=null,n={duration:3e3,type:"error"}){return this.show(e,r,{...n,type:"error"})}success(e,r=null,n={duration:3e3,type:"success"}){return this.show(e,r,{...n,type:"success"})}info(e,r=null,n={duration:3e3,type:"info"}){return this.show(e,r,{...n,type:"info"})}__startTimer(e,r){let n;const i=()=>{e>0&&e!==!1&&(n=setTimeout(()=>{r.remove()},e))};r.addEventListener("mouseenter",()=>{clearTimeout(n)}),r.addEventListener("mouseleave",()=>{i()}),i()}__createSnack({message:e,label:r,type:n="info"}){const i=document.getElementById("snack-wrapper")||document.createElement("div"),a=document.createElement("div"),s=document.createElement("p"),o=document.createElement("div"),u=document.createElement("button");let l="",c="";switch(n){case"info":l="",c="info";break;case"error":l="",c="error";break;case"success":l="",c="success";break}return s.textContent=e,s.setAttribute("class","pr-2"),r&&(o.setAttribute("class","ns-button default"),u.textContent=r,u.setAttribute("class",`px-3 py-2 shadow rounded uppercase ${l}`),o.appendChild(u)),a.appendChild(s),a.appendChild(o),a.setAttribute("class",`md:rounded py-2 px-3 md:w-2/5 w-full z-10 md:my-2 shadow-lg flex justify-between items-center zoom-in-entrance anim-duration-300 ns-notice ${c}`),i.appendChild(a),document.getElementById("snack-wrapper")===null&&(i.setAttribute("id","snack-wrapper"),i.setAttribute("class","absolute bottom-0 w-full flex justify-between items-center flex-col"),document.body.appendChild(i)),{snackWrapper:i,sampleSnack:a,buttonsWrapper:o,buttonNode:u,textNode:s}}}class Dte{constructor(e){je(this,"behaviorState");je(this,"stateStore",{});this.behaviorState=new Q1({}),this.behaviorState.subscribe(r=>{this.stateStore=r}),this.setState(e)}setState(e){this.behaviorState.next({...this.stateStore,...e})}get state(){return this.behaviorState}subscribe(e){this.behaviorState.subscribe(e)}}class Nte{validateFields(e){return e.map(r=>(this.checkField(r,e,{touchField:!1}),r.errors?r.errors.length===0:0)).filter(r=>r===!1).length===0}validateFieldsErrors(e){return e.map(r=>(this.checkField(r,e,{touchField:!1}),r.errors)).flat()}validateForm(e){e.main&&this.validateField(e.main);const r=[];for(let n in e.tabs)if(e.tabs[n].fields){const i=[],a=this.validateFieldsErrors(e.tabs[n].fields);a.length>0&&i.push(a),e.tabs[n].errors=i.flat(),r.push(i.flat())}return r.flat().filter(n=>n!==void 0)}initializeTabs(e){let r=0;for(let n in e)r===0&&(e[n].active=!0),e[n].active=e[n].active===void 0?!1:e[n].active,e[n].fields=this.createFields(e[n].fields),r++;return e}validateField(e){return this.checkField(e,[],{touchField:!1})}fieldsValid(e){return!(e.map(r=>r.errors&&r.errors.length>0).filter(r=>r).length>0)}createFields(e){return e.map(r=>{if(r.type=r.type||"text",r.errors=r.errors||[],r.disabled=r.disabled||!1,r.touched=!1,r.type==="custom"&&typeof r.component=="string"){const n=r.component;if(r.component=Hv(nsExtraComponents[r.component]),r.component)r.component.value.$field=r,r.component.value.$fields=e;else throw`Failed to load a custom component. "${n}" is not provided as an extra component. More details here: "https://my.nexopos.com/en/documentation/developpers-guides/how-to-register-a-custom-vue-component"`}return r})}isFormUntouched(e){let r=!0;if(e.main&&(r=e.main.touched?!1:r),e.tabs)for(let n in e.tabs)r=e.tabs[n].fields.filter(i=>i.touched).length>0?!1:r;return r}createForm(e){if(e.main&&(e.main=this.createFields([e.main])[0]),e.tabs)for(let r in e.tabs)e.tabs[r].errors=[],e.tabs[r].fields!==void 0?e.tabs[r].fields=this.createFields(e.tabs[r].fields):console.info(`Warning: The tab "${e.tabs[r].label}" is missing fields. Fallback on checking dynamic component instead.`);return e}enableFields(e){return e.map(r=>r.disabled=!1)}disableFields(e){return e.map(r=>r.disabled=!0)}disableForm(e){e.main&&(e.main.disabled=!0);for(let r in e.tabs)e.tabs[r].fields.forEach(n=>n.disabled=!0)}enableForm(e){e.main&&(e.main.disabled=!1);for(let r in e.tabs)e.tabs[r].fields.forEach(n=>n.disabled=!1)}getValue(e){const r={};return e.forEach(n=>{r[n.name]=n.value}),r}checkField(e,r=[],n={touchField:!0}){if(e.validation!==void 0){e.errors=[];const i=this.detectValidationRules(e.validation).filter(s=>s!=null);i.map(s=>s.identifier).includes("sometimes")?e.value!==void 0&&e.value.length>0&&i.forEach(s=>{this.fieldPassCheck(e,s,r)}):i.forEach(s=>{this.fieldPassCheck(e,s,r)})}return n.touchField&&(e.touched=!0),e}extractForm(e){let r={};if(e.main&&(r[e.main.name]=e.main.value),e.tabs)for(let n in e.tabs)r[n]===void 0&&(r[n]={}),r[n]=this.extractFields(e.tabs[n].fields);return r}extractFields(e,r={}){return e.forEach(n=>{r[n.name]=n.value}),r}detectValidationRules(e){const r=n=>{const i=/(min)\:([0-9])+/g,a=/(sometimes)/g,s=/(max)\:([0-9])+/g,o=/(same):(\w+)/g,u=/(different):(\w+)/g;let l;if(["email","required"].includes(n))return{identifier:n};if(n.length>0&&(l=i.exec(n)||s.exec(n)||o.exec(n)||u.exec(n)||a.exec(n),l!==null))return{identifier:l[1],value:l[2]}};return Array.isArray(e)?e.filter(n=>typeof n=="string").map(r):e.split("|").map(r)}triggerError(e,r){if(r.errors)for(let n in r.errors){let i=n.split(".").filter(a=>!/^\d+$/.test(a));i.length===2&&e.tabs[i[0]].fields.forEach(a=>{a.name===i[1]&&r.errors[n].forEach(s=>{const o={identifier:"invalid",invalid:!0,message:s,name:a.name};a.errors.push(o)})}),n===e.main.name&&r.errors[n].forEach(a=>{e.main.errors.push({identifier:"invalid",invalid:!0,message:a,name:e.main.name})})}}triggerFieldsErrors(e,r){if(r&&r.errors)for(let n in r.errors)e.forEach(i=>{i.name===n&&r.errors[n].forEach(a=>{const s={identifier:"invalid",invalid:!0,message:a,name:i.name};i.errors.push(s)})})}trackError(e,r,n){e.errors.push({identifier:r.identifier,invalid:!0,name:e.name,rule:r,fields:n})}unTrackError(e,r){e.errors.forEach((n,i)=>{n.identifier===r.identifier&&n.invalid===!0&&e.errors.splice(i,1)})}fieldPassCheck(e,r,n){if(r!==void 0){const a={required:(s,o)=>s.value===void 0||s.value===null||s.value.length===0,email:(s,o)=>s.value.length>0&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(s.value),same:(s,o)=>{const u=n.filter(l=>l.name===o.value);return u.length===1&&["string","number"].includes(typeof s.value)&&s.value.length>0&&u[0].value!==s.value},different:(s,o)=>{const u=n.filter(l=>l.name===o.value);return u.length===1&&["string","number"].includes(typeof s.value)&&s.value.length>0&&u[0].value===s.value},min:(s,o)=>s.value&&s.value.lengths.value&&s.value.length>parseInt(o.value)}[r.identifier];return typeof a=="function"?a(e,r)===!1?this.unTrackError(e,r):this.trackError(e,r,n):e}}}class Ete{constructor(){je(this,"url");this.url=ns.base_url}get(e){return this.url+e}}/** * @license countdown.js v2.6.1 http://countdownjs.org * Copyright (c)2006-2014 Stephen M. McKamey. * Licensed under The MIT License. - */var Yi=function(){var t=1,e=2,r=4,n=8,i=16,a=32,s=64,o=128,u=256,l=512,c=1024,f=o|s|i|n|r|e,h=1e3,p=60,v=60,m=24,b=m*v*p*h,y=7,S=12,x=10,A=10,_=10,w=Math.ceil,C=Math.floor;function E(R,q){var Y=R.getTime();return R.setMonth(R.getMonth()+q),Math.round((R.getTime()-Y)/b)}function N(R){var q=R.getTime(),Y=new Date(q);return Y.setMonth(R.getMonth()+1),Math.round((Y.getTime()-q)/b)}function M(R){var q=R.getTime(),Y=new Date(q);return Y.setFullYear(R.getFullYear()+1),Math.round((Y.getTime()-q)/b)}function O(R,q){if(q=q instanceof Date||q!==null&&isFinite(q)?new Date(+q):new Date,!R)return q;var Y=+R.value||0;return Y?(q.setTime(q.getTime()+Y),q):(Y=+R.milliseconds||0,Y&&q.setMilliseconds(q.getMilliseconds()+Y),Y=+R.seconds||0,Y&&q.setSeconds(q.getSeconds()+Y),Y=+R.minutes||0,Y&&q.setMinutes(q.getMinutes()+Y),Y=+R.hours||0,Y&&q.setHours(q.getHours()+Y),Y=+R.weeks||0,Y&&(Y*=y),Y+=+R.days||0,Y&&q.setDate(q.getDate()+Y),Y=+R.months||0,Y&&q.setMonth(q.getMonth()+Y),Y=+R.millennia||0,Y&&(Y*=_),Y+=+R.centuries||0,Y&&(Y*=A),Y+=+R.decades||0,Y&&(Y*=x),Y+=+R.years||0,Y&&q.setFullYear(q.getFullYear()+Y),q)}var F=0,U=1,V=2,H=3,I=4,P=5,K=6,$=7,se=8,he=9,ne=10,X,de,Se,ce,xe,_e,me;function we(R,q){return me(R)+(R===1?X[q]:de[q])}var Ne;function Ce(){}Ce.prototype.toString=function(R){var q=Ne(this),Y=q.length;if(!Y)return R?""+R:xe;if(Y===1)return q[0];var pe=Se+q.pop();return q.join(ce)+pe},Ce.prototype.toHTML=function(R,q){R=R||"span";var Y=Ne(this),pe=Y.length;if(!pe)return q=q||xe,q&&"<"+R+">"+q+"";for(var ge=0;ge"+Y[ge]+"";if(pe===1)return Y[0];var De=Se+Y.pop();return Y.join(ce)+De},Ce.prototype.addTo=function(R){return O(this,R)},Ne=function(R){var q=[],Y=R.millennia;return Y&&q.push(_e(Y,ne)),Y=R.centuries,Y&&q.push(_e(Y,he)),Y=R.decades,Y&&q.push(_e(Y,se)),Y=R.years,Y&&q.push(_e(Y,$)),Y=R.months,Y&&q.push(_e(Y,K)),Y=R.weeks,Y&&q.push(_e(Y,P)),Y=R.days,Y&&q.push(_e(Y,I)),Y=R.hours,Y&&q.push(_e(Y,H)),Y=R.minutes,Y&&q.push(_e(Y,V)),Y=R.seconds,Y&&q.push(_e(Y,U)),Y=R.milliseconds,Y&&q.push(_e(Y,F)),q};function He(R,q){switch(q){case"seconds":if(R.seconds!==p||isNaN(R.minutes))return;R.minutes++,R.seconds=0;case"minutes":if(R.minutes!==v||isNaN(R.hours))return;R.hours++,R.minutes=0;case"hours":if(R.hours!==m||isNaN(R.days))return;R.days++,R.hours=0;case"days":if(R.days!==y||isNaN(R.weeks))return;R.weeks++,R.days=0;case"weeks":if(R.weeks!==N(R.refMonth)/y||isNaN(R.months))return;R.months++,R.weeks=0;case"months":if(R.months!==S||isNaN(R.years))return;R.years++,R.months=0;case"years":if(R.years!==x||isNaN(R.decades))return;R.decades++,R.years=0;case"decades":if(R.decades!==A||isNaN(R.centuries))return;R.centuries++,R.decades=0;case"centuries":if(R.centuries!==_||isNaN(R.millennia))return;R.millennia++,R.centuries=0}}function qe(R,q,Y,pe,ge,De){return R[Y]>=0&&(q+=R[Y],delete R[Y]),q/=ge,q+1<=1?0:R[pe]>=0?(R[pe]=+(R[pe]+q).toFixed(De),He(R,pe),0):q}function J(R,q){var Y=qe(R,0,"milliseconds","seconds",h,q);if(Y&&(Y=qe(R,Y,"seconds","minutes",p,q),!!Y&&(Y=qe(R,Y,"minutes","hours",v,q),!!Y&&(Y=qe(R,Y,"hours","days",m,q),!!Y&&(Y=qe(R,Y,"days","weeks",y,q),!!Y&&(Y=qe(R,Y,"weeks","months",N(R.refMonth)/y,q),!!Y&&(Y=qe(R,Y,"months","years",M(R.refMonth)/N(R.refMonth),q),!!Y&&(Y=qe(R,Y,"years","decades",x,q),!!Y&&(Y=qe(R,Y,"decades","centuries",A,q),!!Y&&(Y=qe(R,Y,"centuries","millennia",_,q),Y))))))))))throw new Error("Fractional unit overflow")}function te(R){var q;for(R.milliseconds<0?(q=w(-R.milliseconds/h),R.seconds-=q,R.milliseconds+=q*h):R.milliseconds>=h&&(R.seconds+=C(R.milliseconds/h),R.milliseconds%=h),R.seconds<0?(q=w(-R.seconds/p),R.minutes-=q,R.seconds+=q*p):R.seconds>=p&&(R.minutes+=C(R.seconds/p),R.seconds%=p),R.minutes<0?(q=w(-R.minutes/v),R.hours-=q,R.minutes+=q*v):R.minutes>=v&&(R.hours+=C(R.minutes/v),R.minutes%=v),R.hours<0?(q=w(-R.hours/m),R.days-=q,R.hours+=q*m):R.hours>=m&&(R.days+=C(R.hours/m),R.hours%=m);R.days<0;)R.months--,R.days+=E(R.refMonth,1);R.days>=y&&(R.weeks+=C(R.days/y),R.days%=y),R.months<0?(q=w(-R.months/S),R.years-=q,R.months+=q*S):R.months>=S&&(R.years+=C(R.months/S),R.months%=S),R.years>=x&&(R.decades+=C(R.years/x),R.years%=x,R.decades>=A&&(R.centuries+=C(R.decades/A),R.decades%=A,R.centuries>=_&&(R.millennia+=C(R.centuries/_),R.centuries%=_)))}function ye(R,q,Y,pe){var ge=0;!(q&c)||ge>=Y?(R.centuries+=R.millennia*_,delete R.millennia):R.millennia&&ge++,!(q&l)||ge>=Y?(R.decades+=R.centuries*A,delete R.centuries):R.centuries&&ge++,!(q&u)||ge>=Y?(R.years+=R.decades*x,delete R.decades):R.decades&&ge++,!(q&o)||ge>=Y?(R.months+=R.years*S,delete R.years):R.years&&ge++,!(q&s)||ge>=Y?(R.months&&(R.days+=E(R.refMonth,R.months)),delete R.months,R.days>=y&&(R.weeks+=C(R.days/y),R.days%=y)):R.months&&ge++,!(q&a)||ge>=Y?(R.days+=R.weeks*y,delete R.weeks):R.weeks&&ge++,!(q&i)||ge>=Y?(R.hours+=R.days*m,delete R.days):R.days&&ge++,!(q&n)||ge>=Y?(R.minutes+=R.hours*v,delete R.hours):R.hours&&ge++,!(q&r)||ge>=Y?(R.seconds+=R.minutes*p,delete R.minutes):R.minutes&&ge++,!(q&e)||ge>=Y?(R.milliseconds+=R.seconds*h,delete R.seconds):R.seconds&&ge++,(!(q&t)||ge>=Y)&&J(R,pe)}function ee(R,q,Y,pe,ge,De){var Be=new Date;if(R.start=q=q||Be,R.end=Y=Y||Be,R.units=pe,R.value=Y.getTime()-q.getTime(),R.value<0){var Pe=Y;Y=q,q=Pe}R.refMonth=new Date(q.getFullYear(),q.getMonth(),15,12,0,0);try{R.millennia=0,R.centuries=0,R.decades=0,R.years=Y.getFullYear()-q.getFullYear(),R.months=Y.getMonth()-q.getMonth(),R.weeks=0,R.days=Y.getDate()-q.getDate(),R.hours=Y.getHours()-q.getHours(),R.minutes=Y.getMinutes()-q.getMinutes(),R.seconds=Y.getSeconds()-q.getSeconds(),R.milliseconds=Y.getMilliseconds()-q.getMilliseconds(),te(R),ye(R,pe,ge,De)}finally{delete R.refMonth}return R}function ue(R){return R&t?h/30:R&e?h:R&r?h*p:R&n?h*p*v:R&i?h*p*v*m:h*p*v*m*y}function le(R,q,Y,pe,ge){var De;Y=+Y||f,pe=pe>0?pe:NaN,ge=ge>0?ge<20?Math.round(ge):20:0;var Be=null;typeof R=="function"?(De=R,R=null):R instanceof Date||(R!==null&&isFinite(R)?R=new Date(+R):(typeof Be=="object"&&(Be=R),R=null));var Pe=null;if(typeof q=="function"?(De=q,q=null):q instanceof Date||(q!==null&&isFinite(q)?q=new Date(+q):(typeof q=="object"&&(Pe=q),q=null)),Be&&(R=O(Be,q)),Pe&&(q=O(Pe,R)),!R&&!q)return new Ce;if(!De)return ee(new Ce,R,q,Y,pe,ge);var Ve=ue(Y),ze,gt=function(){De(ee(new Ce,R,q,Y,pe,ge),ze)};return gt(),ze=setInterval(gt,Ve)}le.MILLISECONDS=t,le.SECONDS=e,le.MINUTES=r,le.HOURS=n,le.DAYS=i,le.WEEKS=a,le.MONTHS=s,le.YEARS=o,le.DECADES=u,le.CENTURIES=l,le.MILLENNIA=c,le.DEFAULTS=f,le.ALL=c|l|u|o|s|a|i|n|r|e|t;var Ee=le.setFormat=function(R){if(R){if("singular"in R||"plural"in R){var q=R.singular||[];q.split&&(q=q.split("|"));var Y=R.plural||[];Y.split&&(Y=Y.split("|"));for(var pe=F;pe<=ne;pe++)X[pe]=q[pe]||X[pe],de[pe]=Y[pe]||de[pe]}typeof R.last=="string"&&(Se=R.last),typeof R.delim=="string"&&(ce=R.delim),typeof R.empty=="string"&&(xe=R.empty),typeof R.formatNumber=="function"&&(me=R.formatNumber),typeof R.formatter=="function"&&(_e=R.formatter)}},Me=le.resetFormat=function(){X=" millisecond| second| minute| hour| day| week| month| year| decade| century| millennium".split("|"),de=" milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia".split("|"),Se=" and ",ce=", ",xe="",me=function(R){return R},_e=we};return le.setLabels=function(R,q,Y,pe,ge,De,Be){Ee({singular:R,plural:q,last:Y,delim:pe,empty:ge,formatNumber:De,formatter:Be})},le.resetLabels=Me,Me(),typeof module<"u"&&module.exports?module.exports=le:typeof window<"u"&&typeof window.define=="function"&&typeof window.define.amd<"u"&&window.define("countdown",[],function(){return le}),le}();class Ete{constructor(){je(this,"instances");this.instances=new Object}getInstance(e){return this.instances[e]}defineInstance(e,r){this.instances[e]=r}}function jR(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function Xx(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function u2(t,e){return function(n,i,a,s=10){const o=t[e];if(!Xx(n)||!jR(i))return;if(typeof a!="function"){console.error("The hook callback must be a function.");return}if(typeof s!="number"){console.error("If specified, the hook priority must be a number.");return}const u={callback:a,priority:s,namespace:i};if(o[n]){const l=o[n].handlers;let c;for(c=l.length;c>0&&!(s>=l[c-1].priority);c--);c===l.length?l[c]=u:l.splice(c,0,u),o.__current.forEach(f=>{f.name===n&&f.currentIndex>=c&&f.currentIndex++})}else o[n]={handlers:[u],runs:0};n!=="hookAdded"&&t.doAction("hookAdded",n,i,a,s)}}function Qp(t,e,r=!1){return function(i,a){const s=t[e];if(!Xx(i)||!r&&!jR(a))return;if(!s[i])return 0;let o=0;if(r)o=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else{const u=s[i].handlers;for(let l=u.length-1;l>=0;l--)u[l].namespace===a&&(u.splice(l,1),o++,s.__current.forEach(c=>{c.name===i&&c.currentIndex>=l&&c.currentIndex--}))}return i!=="hookRemoved"&&t.doAction("hookRemoved",i,a),o}}function l2(t,e){return function(n,i){const a=t[e];return typeof i<"u"?n in a&&a[n].handlers.some(s=>s.namespace===i):n in a}}function c2(t,e,r=!1){return function(i,...a){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const o=s[i].handlers;if(!o||!o.length)return r?a[0]:void 0;const u={name:i,currentIndex:0};for(s.__current.push(u);u.currentIndex"u"?typeof i.__current[0]<"u":i.__current[0]?n===i.__current[0].name:!1}}function d2(t,e){return function(n){const i=t[e];if(Xx(n))return i[n]&&i[n].runs?i[n].runs:0}}class Cte{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=u2(this,"actions"),this.addFilter=u2(this,"filters"),this.removeAction=Qp(this,"actions"),this.removeFilter=Qp(this,"filters"),this.hasAction=l2(this,"actions"),this.hasFilter=l2(this,"filters"),this.removeAllActions=Qp(this,"actions",!0),this.removeAllFilters=Qp(this,"filters",!0),this.doAction=c2(this,"actions"),this.applyFilters=c2(this,"filters",!0),this.currentAction=f2(this,"actions"),this.currentFilter=f2(this,"filters"),this.doingAction=h2(this,"actions"),this.doingFilter=h2(this,"filters"),this.didAction=d2(this,"actions"),this.didFilter=d2(this,"filters")}}function GR(){return new Cte}GR();function Mte(t,e,r,n){const i={};return Object.keys(t).forEach(a=>{a===e&&(i[r]=n),i[a]=t[a]}),i}function Tte(t,e,r,n){const i={};return Object.keys(t).forEach(a=>{i[a]=t[a],a===e&&(i[r]=n)}),i[r]||(i[r]=n),i}function Ote(t){this.popup.params.resolve!==void 0&&this.popup.params.reject&&(t!==!1?this.popup.params.resolve(t):this.popup.params.reject(t)),this.popup.close()}function Fte(){this.popup!==void 0&&nsHotPress.create(`popup-esc-${this.popup.hash}`).whenPressed("escape",t=>{t.preventDefault();const e=document.querySelector(`#${this.popup.hash}`);if(e&&e.getAttribute("focused")!=="true")return;const r=parseInt(this.$el.parentElement.getAttribute("data-index"));document.querySelector(`.is-popup [data-index="${r+1}]`)===null&&(this.popup.params&&this.popup.params.reject!==void 0&&this.popup.params.reject(!1),this.popup.close(),nsHotPress.destroy(`popup-esc-${this.popup.hash}`))})}Yi.setFormat({singular:` ${Hl("millisecond| second| minute| hour| day| week| month| year| decade| century| millennium")}`,plural:` ${Hl("milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia")}`,last:` ${Hl("and")} `,delim:", ",empty:""});const Rte=function(t){const e=Qe(ns.date.current,"YYYY-MM-DD HH:mm:ss"),r=Qe(t),n=e.isBefore(r)?"after":"before",i=Math.abs(e.diff(r,"months"))>0,a=Math.abs(e.diff(r,"days"))>0,s=Math.abs(e.diff(r,"hours"))>0,o=Math.abs(e.diff(r,"minutes"))>0,u=Math.abs(e.diff(r,"seconds"))>0;let l;i?l=Yi.MONTHS:a?l=Yi.DAYS:s?l=Yi.HOURS:o?l=Yi.MINUTES:u?l=Yi.SECONDS:l=Yi.MONTHS|Yi.DAYS|Yi.HOURS|Yi.MINUTES;const c=Yi(e.toDate(),r.toDate(),l,void 0,void 0);return(n==="before"?Hl("{date} ago"):Hl("In {date}")).replace("{date}",c.toString())},Bte=t=>{var e=t;if(t>=1e3){for(var r=["","k","m","b","t"],n=Math.floor((""+t).length/3),i,a=2;a>=1;a--){i=parseFloat((n!=0?t/Math.pow(1e3,n):t).toPrecision(a));var s=(i+"").replace(/[^a-zA-Z 0-9]+/g,"");if(s.length<=2)break}i%1!=0&&(i=i.toFixed(1)),e=i+r[n]}return e},Pte=(t,e)=>t?(t=t.toString(),t.length>e?t.substring(0,e)+"...":t):"";function dn(){return dn=Object.assign?Object.assign.bind():function(t){for(var e=1;et[e])}var Hb=["Matrix","Array"],Wb=["number","BigNumber","Fraction"];function JAe(t,e){function r(n){if(n){var i=Jf(t,vt);p2(n,"matrix",Hb),p2(n,"number",Wb),JR(t,n);var a=Jf(t,vt),s=Jf(n,vt);return e("config",a,i,s),a}else return Jf(t,vt)}return r.MATRIX_OPTIONS=Hb,r.NUMBER_OPTIONS=Wb,Object.keys(Zx).forEach(n=>{Object.defineProperty(r,n,{get:()=>t[n],enumerable:!0,configurable:!0})}),r}function Zte(t,e){return t.indexOf(e)!==-1}function p2(t,e,r){t[e]!==void 0&&!Zte(r,t[e])&&console.warn('Warning: Unknown value "'+t[e]+'" for configuration option "'+e+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var Re=function(e){if(e)throw new Error(`The global config is readonly. + */var Yi=function(){var t=1,e=2,r=4,n=8,i=16,a=32,s=64,o=128,u=256,l=512,c=1024,f=o|s|i|n|r|e,h=1e3,p=60,v=60,m=24,b=m*v*p*h,y=7,S=12,x=10,A=10,_=10,w=Math.ceil,C=Math.floor;function E(R,q){var Y=R.getTime();return R.setMonth(R.getMonth()+q),Math.round((R.getTime()-Y)/b)}function N(R){var q=R.getTime(),Y=new Date(q);return Y.setMonth(R.getMonth()+1),Math.round((Y.getTime()-q)/b)}function M(R){var q=R.getTime(),Y=new Date(q);return Y.setFullYear(R.getFullYear()+1),Math.round((Y.getTime()-q)/b)}function O(R,q){if(q=q instanceof Date||q!==null&&isFinite(q)?new Date(+q):new Date,!R)return q;var Y=+R.value||0;return Y?(q.setTime(q.getTime()+Y),q):(Y=+R.milliseconds||0,Y&&q.setMilliseconds(q.getMilliseconds()+Y),Y=+R.seconds||0,Y&&q.setSeconds(q.getSeconds()+Y),Y=+R.minutes||0,Y&&q.setMinutes(q.getMinutes()+Y),Y=+R.hours||0,Y&&q.setHours(q.getHours()+Y),Y=+R.weeks||0,Y&&(Y*=y),Y+=+R.days||0,Y&&q.setDate(q.getDate()+Y),Y=+R.months||0,Y&&q.setMonth(q.getMonth()+Y),Y=+R.millennia||0,Y&&(Y*=_),Y+=+R.centuries||0,Y&&(Y*=A),Y+=+R.decades||0,Y&&(Y*=x),Y+=+R.years||0,Y&&q.setFullYear(q.getFullYear()+Y),q)}var F=0,U=1,V=2,H=3,I=4,P=5,K=6,$=7,se=8,he=9,ne=10,X,de,Se,ce,xe,_e,me;function we(R,q){return me(R)+(R===1?X[q]:de[q])}var Ne;function Ce(){}Ce.prototype.toString=function(R){var q=Ne(this),Y=q.length;if(!Y)return R?""+R:xe;if(Y===1)return q[0];var pe=Se+q.pop();return q.join(ce)+pe},Ce.prototype.toHTML=function(R,q){R=R||"span";var Y=Ne(this),pe=Y.length;if(!pe)return q=q||xe,q&&"<"+R+">"+q+"";for(var ge=0;ge"+Y[ge]+"";if(pe===1)return Y[0];var De=Se+Y.pop();return Y.join(ce)+De},Ce.prototype.addTo=function(R){return O(this,R)},Ne=function(R){var q=[],Y=R.millennia;return Y&&q.push(_e(Y,ne)),Y=R.centuries,Y&&q.push(_e(Y,he)),Y=R.decades,Y&&q.push(_e(Y,se)),Y=R.years,Y&&q.push(_e(Y,$)),Y=R.months,Y&&q.push(_e(Y,K)),Y=R.weeks,Y&&q.push(_e(Y,P)),Y=R.days,Y&&q.push(_e(Y,I)),Y=R.hours,Y&&q.push(_e(Y,H)),Y=R.minutes,Y&&q.push(_e(Y,V)),Y=R.seconds,Y&&q.push(_e(Y,U)),Y=R.milliseconds,Y&&q.push(_e(Y,F)),q};function He(R,q){switch(q){case"seconds":if(R.seconds!==p||isNaN(R.minutes))return;R.minutes++,R.seconds=0;case"minutes":if(R.minutes!==v||isNaN(R.hours))return;R.hours++,R.minutes=0;case"hours":if(R.hours!==m||isNaN(R.days))return;R.days++,R.hours=0;case"days":if(R.days!==y||isNaN(R.weeks))return;R.weeks++,R.days=0;case"weeks":if(R.weeks!==N(R.refMonth)/y||isNaN(R.months))return;R.months++,R.weeks=0;case"months":if(R.months!==S||isNaN(R.years))return;R.years++,R.months=0;case"years":if(R.years!==x||isNaN(R.decades))return;R.decades++,R.years=0;case"decades":if(R.decades!==A||isNaN(R.centuries))return;R.centuries++,R.decades=0;case"centuries":if(R.centuries!==_||isNaN(R.millennia))return;R.millennia++,R.centuries=0}}function qe(R,q,Y,pe,ge,De){return R[Y]>=0&&(q+=R[Y],delete R[Y]),q/=ge,q+1<=1?0:R[pe]>=0?(R[pe]=+(R[pe]+q).toFixed(De),He(R,pe),0):q}function J(R,q){var Y=qe(R,0,"milliseconds","seconds",h,q);if(Y&&(Y=qe(R,Y,"seconds","minutes",p,q),!!Y&&(Y=qe(R,Y,"minutes","hours",v,q),!!Y&&(Y=qe(R,Y,"hours","days",m,q),!!Y&&(Y=qe(R,Y,"days","weeks",y,q),!!Y&&(Y=qe(R,Y,"weeks","months",N(R.refMonth)/y,q),!!Y&&(Y=qe(R,Y,"months","years",M(R.refMonth)/N(R.refMonth),q),!!Y&&(Y=qe(R,Y,"years","decades",x,q),!!Y&&(Y=qe(R,Y,"decades","centuries",A,q),!!Y&&(Y=qe(R,Y,"centuries","millennia",_,q),Y))))))))))throw new Error("Fractional unit overflow")}function te(R){var q;for(R.milliseconds<0?(q=w(-R.milliseconds/h),R.seconds-=q,R.milliseconds+=q*h):R.milliseconds>=h&&(R.seconds+=C(R.milliseconds/h),R.milliseconds%=h),R.seconds<0?(q=w(-R.seconds/p),R.minutes-=q,R.seconds+=q*p):R.seconds>=p&&(R.minutes+=C(R.seconds/p),R.seconds%=p),R.minutes<0?(q=w(-R.minutes/v),R.hours-=q,R.minutes+=q*v):R.minutes>=v&&(R.hours+=C(R.minutes/v),R.minutes%=v),R.hours<0?(q=w(-R.hours/m),R.days-=q,R.hours+=q*m):R.hours>=m&&(R.days+=C(R.hours/m),R.hours%=m);R.days<0;)R.months--,R.days+=E(R.refMonth,1);R.days>=y&&(R.weeks+=C(R.days/y),R.days%=y),R.months<0?(q=w(-R.months/S),R.years-=q,R.months+=q*S):R.months>=S&&(R.years+=C(R.months/S),R.months%=S),R.years>=x&&(R.decades+=C(R.years/x),R.years%=x,R.decades>=A&&(R.centuries+=C(R.decades/A),R.decades%=A,R.centuries>=_&&(R.millennia+=C(R.centuries/_),R.centuries%=_)))}function ye(R,q,Y,pe){var ge=0;!(q&c)||ge>=Y?(R.centuries+=R.millennia*_,delete R.millennia):R.millennia&&ge++,!(q&l)||ge>=Y?(R.decades+=R.centuries*A,delete R.centuries):R.centuries&&ge++,!(q&u)||ge>=Y?(R.years+=R.decades*x,delete R.decades):R.decades&&ge++,!(q&o)||ge>=Y?(R.months+=R.years*S,delete R.years):R.years&&ge++,!(q&s)||ge>=Y?(R.months&&(R.days+=E(R.refMonth,R.months)),delete R.months,R.days>=y&&(R.weeks+=C(R.days/y),R.days%=y)):R.months&&ge++,!(q&a)||ge>=Y?(R.days+=R.weeks*y,delete R.weeks):R.weeks&&ge++,!(q&i)||ge>=Y?(R.hours+=R.days*m,delete R.days):R.days&&ge++,!(q&n)||ge>=Y?(R.minutes+=R.hours*v,delete R.hours):R.hours&&ge++,!(q&r)||ge>=Y?(R.seconds+=R.minutes*p,delete R.minutes):R.minutes&&ge++,!(q&e)||ge>=Y?(R.milliseconds+=R.seconds*h,delete R.seconds):R.seconds&&ge++,(!(q&t)||ge>=Y)&&J(R,pe)}function ee(R,q,Y,pe,ge,De){var Be=new Date;if(R.start=q=q||Be,R.end=Y=Y||Be,R.units=pe,R.value=Y.getTime()-q.getTime(),R.value<0){var Pe=Y;Y=q,q=Pe}R.refMonth=new Date(q.getFullYear(),q.getMonth(),15,12,0,0);try{R.millennia=0,R.centuries=0,R.decades=0,R.years=Y.getFullYear()-q.getFullYear(),R.months=Y.getMonth()-q.getMonth(),R.weeks=0,R.days=Y.getDate()-q.getDate(),R.hours=Y.getHours()-q.getHours(),R.minutes=Y.getMinutes()-q.getMinutes(),R.seconds=Y.getSeconds()-q.getSeconds(),R.milliseconds=Y.getMilliseconds()-q.getMilliseconds(),te(R),ye(R,pe,ge,De)}finally{delete R.refMonth}return R}function ue(R){return R&t?h/30:R&e?h:R&r?h*p:R&n?h*p*v:R&i?h*p*v*m:h*p*v*m*y}function le(R,q,Y,pe,ge){var De;Y=+Y||f,pe=pe>0?pe:NaN,ge=ge>0?ge<20?Math.round(ge):20:0;var Be=null;typeof R=="function"?(De=R,R=null):R instanceof Date||(R!==null&&isFinite(R)?R=new Date(+R):(typeof Be=="object"&&(Be=R),R=null));var Pe=null;if(typeof q=="function"?(De=q,q=null):q instanceof Date||(q!==null&&isFinite(q)?q=new Date(+q):(typeof q=="object"&&(Pe=q),q=null)),Be&&(R=O(Be,q)),Pe&&(q=O(Pe,R)),!R&&!q)return new Ce;if(!De)return ee(new Ce,R,q,Y,pe,ge);var Ve=ue(Y),ze,gt=function(){De(ee(new Ce,R,q,Y,pe,ge),ze)};return gt(),ze=setInterval(gt,Ve)}le.MILLISECONDS=t,le.SECONDS=e,le.MINUTES=r,le.HOURS=n,le.DAYS=i,le.WEEKS=a,le.MONTHS=s,le.YEARS=o,le.DECADES=u,le.CENTURIES=l,le.MILLENNIA=c,le.DEFAULTS=f,le.ALL=c|l|u|o|s|a|i|n|r|e|t;var Ee=le.setFormat=function(R){if(R){if("singular"in R||"plural"in R){var q=R.singular||[];q.split&&(q=q.split("|"));var Y=R.plural||[];Y.split&&(Y=Y.split("|"));for(var pe=F;pe<=ne;pe++)X[pe]=q[pe]||X[pe],de[pe]=Y[pe]||de[pe]}typeof R.last=="string"&&(Se=R.last),typeof R.delim=="string"&&(ce=R.delim),typeof R.empty=="string"&&(xe=R.empty),typeof R.formatNumber=="function"&&(me=R.formatNumber),typeof R.formatter=="function"&&(_e=R.formatter)}},Me=le.resetFormat=function(){X=" millisecond| second| minute| hour| day| week| month| year| decade| century| millennium".split("|"),de=" milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia".split("|"),Se=" and ",ce=", ",xe="",me=function(R){return R},_e=we};return le.setLabels=function(R,q,Y,pe,ge,De,Be){Ee({singular:R,plural:q,last:Y,delim:pe,empty:ge,formatNumber:De,formatter:Be})},le.resetLabels=Me,Me(),typeof module<"u"&&module.exports?module.exports=le:typeof window<"u"&&typeof window.define=="function"&&typeof window.define.amd<"u"&&window.define("countdown",[],function(){return le}),le}();class Cte{constructor(){je(this,"instances");this.instances=new Object}getInstance(e){return this.instances[e]}defineInstance(e,r){this.instances[e]=r}}function XR(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function aw(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function h2(t,e){return function(n,i,a,s=10){const o=t[e];if(!aw(n)||!XR(i))return;if(typeof a!="function"){console.error("The hook callback must be a function.");return}if(typeof s!="number"){console.error("If specified, the hook priority must be a number.");return}const u={callback:a,priority:s,namespace:i};if(o[n]){const l=o[n].handlers;let c;for(c=l.length;c>0&&!(s>=l[c-1].priority);c--);c===l.length?l[c]=u:l.splice(c,0,u),o.__current.forEach(f=>{f.name===n&&f.currentIndex>=c&&f.currentIndex++})}else o[n]={handlers:[u],runs:0};n!=="hookAdded"&&t.doAction("hookAdded",n,i,a,s)}}function Qp(t,e,r=!1){return function(i,a){const s=t[e];if(!aw(i)||!r&&!XR(a))return;if(!s[i])return 0;let o=0;if(r)o=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else{const u=s[i].handlers;for(let l=u.length-1;l>=0;l--)u[l].namespace===a&&(u.splice(l,1),o++,s.__current.forEach(c=>{c.name===i&&c.currentIndex>=l&&c.currentIndex--}))}return i!=="hookRemoved"&&t.doAction("hookRemoved",i,a),o}}function d2(t,e){return function(n,i){const a=t[e];return typeof i<"u"?n in a&&a[n].handlers.some(s=>s.namespace===i):n in a}}function p2(t,e,r=!1){return function(i,...a){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const o=s[i].handlers;if(!o||!o.length)return r?a[0]:void 0;const u={name:i,currentIndex:0};for(s.__current.push(u);u.currentIndex"u"?typeof i.__current[0]<"u":i.__current[0]?n===i.__current[0].name:!1}}function g2(t,e){return function(n){const i=t[e];if(aw(n))return i[n]&&i[n].runs?i[n].runs:0}}class Mte{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=h2(this,"actions"),this.addFilter=h2(this,"filters"),this.removeAction=Qp(this,"actions"),this.removeFilter=Qp(this,"filters"),this.hasAction=d2(this,"actions"),this.hasFilter=d2(this,"filters"),this.removeAllActions=Qp(this,"actions",!0),this.removeAllFilters=Qp(this,"filters",!0),this.doAction=p2(this,"actions"),this.applyFilters=p2(this,"filters",!0),this.currentAction=m2(this,"actions"),this.currentFilter=m2(this,"filters"),this.doingAction=v2(this,"actions"),this.doingFilter=v2(this,"filters"),this.didAction=g2(this,"actions"),this.didFilter=g2(this,"filters")}}function ZR(){return new Mte}ZR();function Tte(t,e,r,n){const i={};return Object.keys(t).forEach(a=>{a===e&&(i[r]=n),i[a]=t[a]}),i}function Ote(t,e,r,n){const i={};return Object.keys(t).forEach(a=>{i[a]=t[a],a===e&&(i[r]=n)}),i[r]||(i[r]=n),i}function Fte(t){this.popup.params.resolve!==void 0&&this.popup.params.reject&&(t!==!1?this.popup.params.resolve(t):this.popup.params.reject(t)),this.popup.close()}function Rte(){this.popup!==void 0&&nsHotPress.create(`popup-esc-${this.popup.hash}`).whenPressed("escape",t=>{t.preventDefault();const e=document.querySelector(`#${this.popup.hash}`);if(e&&e.getAttribute("focused")!=="true")return;const r=parseInt(this.$el.parentElement.getAttribute("data-index"));document.querySelector(`.is-popup [data-index="${r+1}]`)===null&&(this.popup.params&&this.popup.params.reject!==void 0&&this.popup.params.reject(!1),this.popup.close(),nsHotPress.destroy(`popup-esc-${this.popup.hash}`))})}Yi.setFormat({singular:` ${Hl("millisecond| second| minute| hour| day| week| month| year| decade| century| millennium")}`,plural:` ${Hl("milliseconds| seconds| minutes| hours| days| weeks| months| years| decades| centuries| millennia")}`,last:` ${Hl("and")} `,delim:", ",empty:""});const Bte=function(t){const e=Qe(ns.date.current,"YYYY-MM-DD HH:mm:ss"),r=Qe(t),n=e.isBefore(r)?"after":"before",i=Math.abs(e.diff(r,"months"))>0,a=Math.abs(e.diff(r,"days"))>0,s=Math.abs(e.diff(r,"hours"))>0,o=Math.abs(e.diff(r,"minutes"))>0,u=Math.abs(e.diff(r,"seconds"))>0;let l;i?l=Yi.MONTHS:a?l=Yi.DAYS:s?l=Yi.HOURS:o?l=Yi.MINUTES:u?l=Yi.SECONDS:l=Yi.MONTHS|Yi.DAYS|Yi.HOURS|Yi.MINUTES;const c=Yi(e.toDate(),r.toDate(),l,void 0,void 0);return(n==="before"?Hl("{date} ago"):Hl("In {date}")).replace("{date}",c.toString())},Pte=t=>{var e=t;if(t>=1e3){for(var r=["","k","m","b","t"],n=Math.floor((""+t).length/3),i,a=2;a>=1;a--){i=parseFloat((n!=0?t/Math.pow(1e3,n):t).toPrecision(a));var s=(i+"").replace(/[^a-zA-Z 0-9]+/g,"");if(s.length<=2)break}i%1!=0&&(i=i.toFixed(1)),e=i+r[n]}return e},Ite=(t,e)=>t?(t=t.toString(),t.length>e?t.substring(0,e)+"...":t):"";function dn(){return dn=Object.assign?Object.assign.bind():function(t){for(var e=1;et[e])}var Wb=["Matrix","Array"],Vb=["number","BigNumber","Fraction"];function KAe(t,e){function r(n){if(n){var i=Kf(t,vt);y2(n,"matrix",Wb),y2(n,"number",Vb),eB(t,n);var a=Kf(t,vt),s=Kf(n,vt);return e("config",a,i,s),a}else return Kf(t,vt)}return r.MATRIX_OPTIONS=Wb,r.NUMBER_OPTIONS=Vb,Object.keys(sw).forEach(n=>{Object.defineProperty(r,n,{get:()=>t[n],enumerable:!0,configurable:!0})}),r}function Kte(t,e){return t.indexOf(e)!==-1}function y2(t,e,r){t[e]!==void 0&&!Kte(r,t[e])&&console.warn('Warning: Unknown value "'+t[e]+'" for configuration option "'+e+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var Re=function(e){if(e)throw new Error(`The global config is readonly. Please create a mathjs instance if you want to change the default configuration. Example: import { create, all } from 'mathjs'; const mathjs = create(all); mathjs.config({ number: 'BigNumber' }); -`);return Object.freeze(Zx)};dn(Re,Zx,{MATRIX_OPTIONS:Hb,NUMBER_OPTIONS:Wb});function m2(){return!0}function Vi(){return!1}function Tl(){}const v2="Argument is not a typed-function.";function eB(){function t(R){return typeof R=="object"&&R!==null&&R.constructor===Object}const e=[{name:"number",test:function(R){return typeof R=="number"}},{name:"string",test:function(R){return typeof R=="string"}},{name:"boolean",test:function(R){return typeof R=="boolean"}},{name:"Function",test:function(R){return typeof R=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(R){return R instanceof Date}},{name:"RegExp",test:function(R){return R instanceof RegExp}},{name:"Object",test:t},{name:"null",test:function(R){return R===null}},{name:"undefined",test:function(R){return R===void 0}}],r={name:"any",test:m2,isAny:!0};let n,i,a=0,s={createCount:0};function o(R){const q=n.get(R);if(q)return q;let Y='Unknown type "'+R+'"';const pe=R.toLowerCase();let ge;for(ge of i)if(ge.toLowerCase()===pe){Y+='. Did you mean "'+ge+'" ?';break}throw new TypeError(Y)}function u(R){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Y=q?o(q).index:i.length,pe=[];for(let De=0;De{const pe=n.get(Y);return!pe.isAny&&pe.test(R)});return q.length?q:["any"]}function h(R){return R&&typeof R=="function"&&"_typedFunctionData"in R}function p(R,q,Y){if(!h(R))throw new TypeError(v2);const pe=Y&&Y.exact,ge=Array.isArray(q)?q.join(","):q,De=A(ge),Be=b(De);if(!pe||Be in R.signatures){const gt=R._typedFunctionData.signatureMap.get(Be);if(gt)return gt}const Pe=De.length;let Ve;if(pe){Ve=[];let gt;for(gt in R.signatures)Ve.push(R._typedFunctionData.signatureMap.get(gt))}else Ve=R._typedFunctionData.signatures;for(let gt=0;gt!oe.has(Ae.name)))continue}at.push(mr)}}if(Ve=at,Ve.length===0)break}let ze;for(ze of Ve)if(ze.params.length<=Pe)return ze;throw new TypeError("Signature not found (signature: "+(R.name||"unnamed")+"("+b(De,", ")+"))")}function v(R,q,Y){return p(R,q,Y).implementation}function m(R,q){const Y=o(q);if(Y.test(R))return R;const pe=Y.conversionsTo;if(pe.length===0)throw new Error("There are no conversions to "+q+" defined.");for(let ge=0;ge1&&arguments[1]!==void 0?arguments[1]:",";return R.map(Y=>Y.name).join(q)}function y(R){const q=R.indexOf("...")===0,pe=(q?R.length>3?R.slice(3):"any":R).split("|").map(Pe=>o(Pe.trim()));let ge=!1,De=q?"...":"";return{types:pe.map(function(Pe){return ge=Pe.isAny||ge,De+=Pe.name+"|",{name:Pe.name,typeIndex:Pe.index,test:Pe.test,isAny:Pe.isAny,conversion:null,conversionIndex:-1}}),name:De.slice(0,-1),hasAny:ge,hasConversion:!1,restParam:q}}function S(R){const q=R.types.map(Be=>Be.name),Y=P(q);let pe=R.hasAny,ge=R.name;const De=Y.map(function(Be){const Pe=o(Be.from);return pe=Pe.isAny||pe,ge+="|"+Be.from,{name:Be.from,typeIndex:Pe.index,test:Pe.test,isAny:Pe.isAny,conversion:Be,conversionIndex:Be.index}});return{types:R.types.concat(De),name:ge,hasAny:pe,hasConversion:De.length>0,restParam:R.restParam}}function x(R){return R.typeSet||(R.typeSet=new Set,R.types.forEach(q=>R.typeSet.add(q.name))),R.typeSet}function A(R){const q=[];if(typeof R!="string")throw new TypeError("Signatures must be strings");const Y=R.trim();if(Y==="")return q;const pe=Y.split(",");for(let ge=0;ge=ge+1}}else return R.length===0?function(De){return De.length===0}:R.length===1?(Y=w(R[0]),function(De){return Y(De[0])&&De.length===1}):R.length===2?(Y=w(R[0]),pe=w(R[1]),function(De){return Y(De[0])&&pe(De[1])&&De.length===2}):(q=R.map(w),function(De){for(let Be=0;Be{const ge=N(pe.params,q);let De;for(De of ge)Y.add(De)}),Y.has("any")?["any"]:Array.from(Y)}function F(R,q,Y){let pe,ge;const De=R||"unnamed";let Be=Y,Pe;for(Pe=0;Pe{const mr=E(at.params,Pe),k=w(mr);(Pe0){const at=f(q[Pe]);return pe=new TypeError("Unexpected type of argument in function "+De+" (expected: "+ge.join(" or ")+", actual: "+at.join(" | ")+", index: "+Pe+")"),pe.data={category:"wrongType",fn:De,index:Pe,actual:at,expected:ge},pe}}else Be=St}const Ve=Be.map(function(St){return _(St.params)?1/0:St.params.length});if(q.lengthze)return pe=new TypeError("Too many arguments in function "+De+" (expected: "+ze+", actual: "+q.length+")"),pe.data={category:"tooManyArgs",fn:De,index:q.length,expectedLength:ze},pe;const gt=[];for(let St=0;St0)return 1;const pe=V(R)-V(q);return pe<0?-1:pe>0?1:0}function I(R,q){const Y=R.params,pe=q.params,ge=me(Y),De=me(pe),Be=_(Y),Pe=_(pe);if(Be&&ge.hasAny){if(!Pe||!De.hasAny)return 1}else if(Pe&&De.hasAny)return-1;let Ve=0,ze=0,gt;for(gt of Y)gt.hasAny&&++Ve,gt.hasConversion&&++ze;let St=0,at=0;for(gt of pe)gt.hasAny&&++St,gt.hasConversion&&++at;if(Ve!==St)return Ve-St;if(Be&&ge.hasConversion){if(!Pe||!De.hasConversion)return 1}else if(Pe&&De.hasConversion)return-1;if(ze!==at)return ze-at;if(Be){if(!Pe)return 1}else if(Pe)return-1;const mr=(Y.length-pe.length)*(Be?-1:1);if(mr!==0)return mr;const k=[];let oe=0;for(let $e=0;$e1&&q.sort((ge,De)=>ge.index-De.index);let Y=q[0].conversionsTo;if(R.length===1)return Y;Y=Y.concat([]);const pe=new Set(R);for(let ge=1;gege.hasConversion)){const ge=_(R),De=R.map($);Y=function(){const Pe=[],Ve=ge?arguments.length-1:arguments.length;for(let ze=0;zeVe.name).join("|"),hasAny:Pe.some(Ve=>Ve.isAny),hasConversion:!1,restParam:!0}),Be.push(De)}else Be=De.types.map(function(Pe){return{types:[Pe],name:Pe.name,hasAny:Pe.isAny,hasConversion:Pe.conversion,restParam:!1}});return Ce(Be,function(Pe){return q(Y,pe+1,ge.concat([Pe]))})}else return[ge]}return q(R,0,[])}function he(R,q){const Y=Math.max(R.length,q.length);for(let Pe=0;Pe=pe:Be?pe>=ge:pe===ge}function ne(R){return R.map(q=>ye(q)?J(q.referToSelf.callback):te(q)?qe(q.referTo.references,q.referTo.callback):q)}function X(R,q,Y){const pe=[];let ge;for(ge of R){let De=Y[ge];if(typeof De!="number")throw new TypeError('No definition for referenced signature "'+ge+'"');if(De=q[De],typeof De!="function")return!1;pe.push(De)}return pe}function de(R,q,Y){const pe=ne(R),ge=new Array(pe.length).fill(!1);let De=!0;for(;De;){De=!1;let Be=!0;for(let Pe=0;Pe{const pe=R[Y];if(q.test(pe.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ce(R,q){if(s.createCount++,Object.keys(q).length===0)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&Se(q);const Y=[],pe=[],ge={},De=[];let Be;for(Be in q){if(!Object.prototype.hasOwnProperty.call(q,Be))continue;const Wt=A(Be);if(!Wt)continue;Y.forEach(function(Ia){if(he(Ia,Wt))throw new TypeError('Conflicting signatures "'+b(Ia)+'" and "'+b(Wt)+'".')}),Y.push(Wt);const bn=pe.length;pe.push(q[Be]);const tf=Wt.map(S);let to;for(to of se(tf)){const Ia=b(to);De.push({params:to,name:Ia,fn:bn}),to.every(ul=>!ul.hasConversion)&&(ge[Ia]=bn)}}De.sort(I);const Pe=de(pe,ge,as);let Ve;for(Ve in ge)Object.prototype.hasOwnProperty.call(ge,Ve)&&(ge[Ve]=Pe[ge[Ve]]);const ze=[],gt=new Map;for(Ve of De)gt.has(Ve.name)||(Ve.fn=Pe[Ve.fn],ze.push(Ve),gt.set(Ve.name,Ve));const St=ze[0]&&ze[0].params.length<=2&&!_(ze[0].params),at=ze[1]&&ze[1].params.length<=2&&!_(ze[1].params),mr=ze[2]&&ze[2].params.length<=2&&!_(ze[2].params),k=ze[3]&&ze[3].params.length<=2&&!_(ze[3].params),oe=ze[4]&&ze[4].params.length<=2&&!_(ze[4].params),Ae=ze[5]&&ze[5].params.length<=2&&!_(ze[5].params),$e=St&&at&&mr&&k&&oe&&Ae;for(let Wt=0;WtWt.test),ef=ze.map(Wt=>Wt.implementation),eo=function(){for(let bn=Qo;bnb(A(Y))),q=me(arguments);if(typeof q!="function")throw new TypeError("Callback function expected as last argument");return qe(R,q)}function qe(R,q){return{referTo:{references:R,callback:q}}}function J(R){if(typeof R!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:R}}}function te(R){return R&&typeof R.referTo=="object"&&Array.isArray(R.referTo.references)&&typeof R.referTo.callback=="function"}function ye(R){return R&&typeof R.referToSelf=="object"&&typeof R.referToSelf.callback=="function"}function ee(R,q){if(!R)return q;if(q&&q!==R){const Y=new Error("Function names do not match (expected: "+R+", actual: "+q+")");throw Y.data={actual:q,expected:R},Y}return R}function ue(R){let q;for(const Y in R)Object.prototype.hasOwnProperty.call(R,Y)&&(h(R[Y])||typeof R[Y].signature=="string")&&(q=ee(q,R[Y].name));return q}function le(R,q){let Y;for(Y in q)if(Object.prototype.hasOwnProperty.call(q,Y)){if(Y in R&&q[Y]!==R[Y]){const pe=new Error('Signature "'+Y+'" is defined twice');throw pe.data={signature:Y,sourceFunction:q[Y],destFunction:R[Y]},pe}R[Y]=q[Y]}}const Ee=s;s=function(R){const q=typeof R=="string",Y=q?1:0;let pe=q?R:"";const ge={};for(let De=Y;Dege.from===R.from);if(!Y)throw new Error("Attempt to remove nonexistent conversion from "+R.from+" to "+R.to);if(Y.convert!==R.convert)throw new Error("Conversion to remove does not match existing conversion");const pe=q.conversionsTo.indexOf(Y);q.conversionsTo.splice(pe,1)},s.resolve=function(R,q){if(!h(R))throw new TypeError(v2);const Y=R._typedFunctionData.signatures;for(let pe=0;pe0?1:t<0?-1:0},Kte=Math.log2||function(e){return Math.log(e)/Math.LN2},Jte=Math.log10||function(e){return Math.log(e)/Math.LN10},Qte=Math.log1p||function(t){return Math.log(t+1)},ere=Math.cbrt||function(e){if(e===0)return e;var r=e<0,n;return r&&(e=-e),isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,r?-n:n},tre=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function Uy(t,e,r){var n={2:"0b",8:"0o",16:"0x"},i=n[e],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ot(r))throw new Error("size must be an integer");if(t>2**(r-1)-1||t<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!ot(t))throw new Error("Value must be an integer");t<0&&(t=t+2**r),a="i".concat(r)}var s="";return t<0&&(t=-t,s="-"),"".concat(s).concat(i).concat(t.toString(e)).concat(a)}function Ru(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:r,precision:n,wordSize:i}=tB(e);switch(r){case"fixed":return rB(t,n);case"exponential":return nB(t,n);case"engineering":return rre(t,n);case"bin":return Uy(t,2,i);case"oct":return Uy(t,8,i);case"hex":return Uy(t,16,i);case"auto":return nre(t,n,e).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function tB(t){var e="auto",r,n;if(t!==void 0)if(Ct(t))r=t;else if(Mt(t))r=t.toNumber();else if(Eg(t))t.precision!==void 0&&(r=g2(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(n=g2(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:r,wordSize:n}}function fd(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],i=parseFloat(e[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(o){return i-=o.length,""}).replace(/0*$/,"").split("").map(function(o){return parseInt(o)});return s.length===0&&(s.push(0),i++),{sign:r,coefficients:s,exponent:i}}function rre(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=fd(t),n=Mg(r,e),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ct(e))for(;e>a.length||i-s+1>a.length;)a.push(0);else for(var o=Math.abs(i-s)-(a.length-1),u=0;u0;)c++,l--;var f=a.slice(c).join(""),h=Ct(e)&&f.length||f.match(/[1-9]/)?"."+f:"",p=a.slice(0,c).join("")+h+"e"+(i>=0?"+":"")+s.toString();return n.sign+p}function rB(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=fd(t),n=typeof e=="number"?Mg(r,r.exponent+1+e):r,i=n.coefficients,a=n.exponent+1,s=a+(e||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function nre(t,e,r){if(isNaN(t)||!isFinite(t))return String(t);var n=y2(r==null?void 0:r.lowerExp,-3),i=y2(r==null?void 0:r.upperExp,5),a=fd(t),s=e?Mg(a,e):a;if(s.exponent=i)return nB(t,e);var o=s.coefficients,u=s.exponent;o.length0?u:0;return le){var i=n.splice(e,n.length-e);if(i[0]>=5){var a=e-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function Kl(t){for(var e=[],r=0;r0?!0:t<0?!1:1/t===1/0,n=e>0?!0:e<0?!1:1/e===1/0;return r^n?-t:t}function g2(t,e){if(Ct(t))return t;if(Mt(t))return t.toNumber();e()}function y2(t,e){return Ct(t)?t:Mt(t)?t.toNumber():e}function qy(t,e,r){var n=t.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ot(r))throw new Error("size must be an integer");if(t.greaterThan(i.pow(r-1).sub(1))||t.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(i.pow(r))),a="i".concat(r)}switch(e){case 2:return"".concat(t.toBinary()).concat(a);case 8:return"".concat(t.toOctal()).concat(a);case 16:return"".concat(t.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(e," not supported "))}}function dre(t,e){if(typeof e=="function")return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=tB(e);switch(r){case"fixed":return mre(t,n);case"exponential":return b2(t,n);case"engineering":return pre(t,n);case"bin":return qy(t,2,i);case"oct":return qy(t,8,i);case"hex":return qy(t,16,i);case"auto":{var a=x2(e==null?void 0:e.lowerExp,-3),s=x2(e==null?void 0:e.upperExp,5);if(t.isZero())return"0";var o,u=t.toSignificantDigits(n),l=u.e;return l>=a&&l=0?"+":"")+n.toString()}function b2(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function mre(t,e){return t.toFixed(e)}function x2(t,e){return Ct(t)?t:Mt(t)?t.toNumber():e}function vre(t,e){var r=t.length-e.length,n=t.length;return t.substring(r,n)===e}function Rt(t,e){var r=gre(t,e);return e&&typeof e=="object"&&"truncate"in e&&r.length>e.truncate?r.substring(0,e.truncate-3)+"...":r}function gre(t,e){if(typeof t=="number")return Ru(t,e);if(Mt(t))return dre(t,e);if(yre(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return iB(t,e);if($n(t))return zl(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var r=Object.keys(t).map(n=>zl(n)+": "+Rt(t[n],e));return"{"+r.join(", ")+"}"}return String(t)}function zl(t){for(var e=String(t),r="",n=0;n/g,">"),e}function iB(t,e){if(Array.isArray(t)){for(var r="[",n=t.length,i=0;ie?1:-1}function Pt(t,e,r){if(!(this instanceof Pt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}Pt.prototype=new RangeError;Pt.prototype.constructor=RangeError;Pt.prototype.name="DimensionError";Pt.prototype.isDimensionError=!0;function Ma(t,e,r){if(!(this instanceof Ma))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=r),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Ma.prototype=new RangeError;Ma.prototype.constructor=RangeError;Ma.prototype.name="IndexError";Ma.prototype.isIndexError=!0;function Nt(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function aB(t,e,r){var n,i=t.length;if(i!==e[r])throw new Pt(i,e[r]);if(r")}function S2(t,e){var r=e.length===0;if(r){if(Array.isArray(t))throw new Pt(t.length,0)}else aB(t,e,0)}function vv(t,e){var r=t.isMatrix?t._size:Nt(t),n=e._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new Pt(i,r[a])})}function gr(t,e){if(t!==void 0){if(!Ct(t)||!ot(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new Ma(t,e)}}function dc(t){for(var e=0;e=0,u=e%r===0;if(o)if(u)n[a]=-e/r;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-r);return n}function sB(t){return t.reduce((e,r)=>e*r,1)}function bre(t,e){for(var r=t,n,i=e.length-1;i>0;i--){var a=e[i];n=[];for(var s=r.length/a,o=0;oe.test(r))}function _2(t,e){return Array.prototype.join.call(t,e)}function mc(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;var e=[],r=0;e[0]={value:t[0],identifier:0};for(var n=1;n1)return t.slice(1).reduce(function(r,n){return fB(r,n,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function xre(){for(var t=arguments.length,e=new Array(t),r=0;rh.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[c]&&(a[c]=o[l])}for(var f=0;f1||t[i]>e[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(n," with size ").concat(t[i]," to size ").concat(e[a]))}}function A2(t,e){var r=Nt(t);if($u(r,e))return t;xv(r,e);var n=xre(r,e),i=n.length,a=[...Array(i-r.length).fill(1),...r],s=Sre(t);r.length!Are(a)).every(a=>r[a]!==void 0);if(!n){var i=e.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function Are(t){return t&&t[0]==="?"}function Dre(t){return t&&t[0]==="?"?t.slice(1):t}function ei(t,e){if(pB(t)&&dB(t,e))return t[e];throw typeof t[e]=="function"&&ew(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function vc(t,e,r){if(pB(t)&&dB(t,e))return t[e]=r,r;throw new Error('No access to property "'+e+'"')}function Nre(t,e){return e in t}function dB(t,e){return!t||typeof t!="object"?!1:tt(Cre,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Ere(t,e){if(!ew(t,e))throw new Error('No access to method "'+e+'"');return t[e]}function ew(t,e){return t==null||typeof t[e]!="function"||tt(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:tt(Mre,e)?!0:!(e in Object.prototype||e in Function.prototype)}function pB(t){return typeof t=="object"&&t&&t.constructor===Object}var Cre={length:!0,name:!0},Mre={toString:!0,valueOf:!0,toLocaleString:!0};class Og{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return ei(this.wrappedObject,e)}set(e,r){return vc(this.wrappedObject,e,r),this}has(e){return Nre(this.wrappedObject,e)}entries(){return vB(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class mB{constructor(e,r,n){this.a=e,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,r){return this.bKeys.has(e)?this.b.set(e,r):this.a.set(e,r),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return vB(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function vB(t,e){return{next:()=>{var r=t.next();return r.done?r:{value:e(r.value),done:!1}}}}function zh(){return new Map}function Jl(t){if(!t)return zh();if(gB(t))return t;if(Eg(t))return new Og(t);throw new Error("createMap can create maps from objects or Maps")}function Tre(t){if(t instanceof Og)return t.wrappedObject;var e={};for(var r of t.keys()){var n=t.get(r);vc(e,r,n)}return e}function gB(t){return t?t instanceof Map||t instanceof Og||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var yB=function(){return yB=$l.create,$l},Ore=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Fre=G("typed",Ore,function(e){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:a}=e,s=yB();return s.clear(),s.addTypes([{name:"number",test:Ct},{name:"Complex",test:$s},{name:"BigNumber",test:Mt},{name:"Fraction",test:ld},{name:"Unit",test:Xi},{name:"identifier",test:o=>$n&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(o)},{name:"string",test:$n},{name:"Chain",test:ZR},{name:"Array",test:sr},{name:"Matrix",test:dt},{name:"DenseMatrix",test:mv},{name:"SparseMatrix",test:Eu},{name:"Range",test:Kx},{name:"Index",test:Ng},{name:"boolean",test:Ite},{name:"ResultSet",test:kte},{name:"Help",test:XR},{name:"function",test:Lte},{name:"Date",test:$te},{name:"RegExp",test:zte},{name:"null",test:Ute},{name:"undefined",test:qte},{name:"AccessorNode",test:Lu},{name:"ArrayNode",test:ji},{name:"AssignmentNode",test:Hte},{name:"BlockNode",test:Wte},{name:"ConditionalNode",test:Vte},{name:"ConstantNode",test:er},{name:"FunctionNode",test:Lo},{name:"FunctionAssignmentNode",test:cd},{name:"IndexNode",test:Nc},{name:"Node",test:pr},{name:"ObjectNode",test:Cg},{name:"OperatorNode",test:tn},{name:"ParenthesisNode",test:Hs},{name:"RangeNode",test:Yte},{name:"RelationalNode",test:jte},{name:"SymbolNode",test:Sn},{name:"Map",test:gB},{name:"Object",test:Eg}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(u){if(r||Hy(u),ire(u)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+u+"). Use function bignumber(x) to convert to BigNumber.");return new r(u)}},{from:"number",to:"Complex",convert:function(u){return n||em(u),new n(u,0)}},{from:"BigNumber",to:"Complex",convert:function(u){return n||em(u),new n(u.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(u){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(u){return n||em(u),new n(u.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(u){a||Wy(u);var l=new a(u);if(l.valueOf()!==u)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+u+"). Use function fraction(x) to convert to Fraction.");return l}},{from:"string",to:"number",convert:function(u){var l=Number(u);if(isNaN(l))throw new Error('Cannot convert "'+u+'" to a number');return l}},{from:"string",to:"BigNumber",convert:function(u){r||Hy(u);try{return new r(u)}catch{throw new Error('Cannot convert "'+u+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(u){a||Wy(u);try{return new a(u)}catch{throw new Error('Cannot convert "'+u+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(u){n||em(u);try{return new n(u)}catch{throw new Error('Cannot convert "'+u+'" to Complex')}}},{from:"boolean",to:"number",convert:function(u){return+u}},{from:"boolean",to:"BigNumber",convert:function(u){return r||Hy(u),new r(+u)}},{from:"boolean",to:"Fraction",convert:function(u){return a||Wy(u),new a(+u)}},{from:"boolean",to:"string",convert:function(u){return String(u)}},{from:"Array",to:"Matrix",convert:function(u){return i||Rre(),new i(u)}},{from:"Matrix",to:"Array",convert:function(u){return u.valueOf()}}]),s.onMismatch=(o,u,l)=>{var c=s.createError(o,u,l);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&na(u[0])&&l.some(h=>!h.params.includes(","))){var f=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw f.data=c.data,f}throw c},s.onMismatch=(o,u,l)=>{var c=s.createError(o,u,l);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&na(u[0])&&l.some(h=>!h.params.includes(","))){var f=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw f.data=c.data,f}throw c},s});function Hy(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function em(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Rre(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Wy(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var Bre="ResultSet",Pre=[],Ire=G(Bre,Pre,()=>{function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});/*! +`);return Object.freeze(sw)};dn(Re,sw,{MATRIX_OPTIONS:Wb,NUMBER_OPTIONS:Vb});function b2(){return!0}function Vi(){return!1}function Tl(){}const x2="Argument is not a typed-function.";function rB(){function t(R){return typeof R=="object"&&R!==null&&R.constructor===Object}const e=[{name:"number",test:function(R){return typeof R=="number"}},{name:"string",test:function(R){return typeof R=="string"}},{name:"boolean",test:function(R){return typeof R=="boolean"}},{name:"Function",test:function(R){return typeof R=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(R){return R instanceof Date}},{name:"RegExp",test:function(R){return R instanceof RegExp}},{name:"Object",test:t},{name:"null",test:function(R){return R===null}},{name:"undefined",test:function(R){return R===void 0}}],r={name:"any",test:b2,isAny:!0};let n,i,a=0,s={createCount:0};function o(R){const q=n.get(R);if(q)return q;let Y='Unknown type "'+R+'"';const pe=R.toLowerCase();let ge;for(ge of i)if(ge.toLowerCase()===pe){Y+='. Did you mean "'+ge+'" ?';break}throw new TypeError(Y)}function u(R){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Y=q?o(q).index:i.length,pe=[];for(let De=0;De{const pe=n.get(Y);return!pe.isAny&&pe.test(R)});return q.length?q:["any"]}function h(R){return R&&typeof R=="function"&&"_typedFunctionData"in R}function p(R,q,Y){if(!h(R))throw new TypeError(x2);const pe=Y&&Y.exact,ge=Array.isArray(q)?q.join(","):q,De=A(ge),Be=b(De);if(!pe||Be in R.signatures){const gt=R._typedFunctionData.signatureMap.get(Be);if(gt)return gt}const Pe=De.length;let Ve;if(pe){Ve=[];let gt;for(gt in R.signatures)Ve.push(R._typedFunctionData.signatureMap.get(gt))}else Ve=R._typedFunctionData.signatures;for(let gt=0;gt!oe.has(Ae.name)))continue}at.push(mr)}}if(Ve=at,Ve.length===0)break}let ze;for(ze of Ve)if(ze.params.length<=Pe)return ze;throw new TypeError("Signature not found (signature: "+(R.name||"unnamed")+"("+b(De,", ")+"))")}function v(R,q,Y){return p(R,q,Y).implementation}function m(R,q){const Y=o(q);if(Y.test(R))return R;const pe=Y.conversionsTo;if(pe.length===0)throw new Error("There are no conversions to "+q+" defined.");for(let ge=0;ge1&&arguments[1]!==void 0?arguments[1]:",";return R.map(Y=>Y.name).join(q)}function y(R){const q=R.indexOf("...")===0,pe=(q?R.length>3?R.slice(3):"any":R).split("|").map(Pe=>o(Pe.trim()));let ge=!1,De=q?"...":"";return{types:pe.map(function(Pe){return ge=Pe.isAny||ge,De+=Pe.name+"|",{name:Pe.name,typeIndex:Pe.index,test:Pe.test,isAny:Pe.isAny,conversion:null,conversionIndex:-1}}),name:De.slice(0,-1),hasAny:ge,hasConversion:!1,restParam:q}}function S(R){const q=R.types.map(Be=>Be.name),Y=P(q);let pe=R.hasAny,ge=R.name;const De=Y.map(function(Be){const Pe=o(Be.from);return pe=Pe.isAny||pe,ge+="|"+Be.from,{name:Be.from,typeIndex:Pe.index,test:Pe.test,isAny:Pe.isAny,conversion:Be,conversionIndex:Be.index}});return{types:R.types.concat(De),name:ge,hasAny:pe,hasConversion:De.length>0,restParam:R.restParam}}function x(R){return R.typeSet||(R.typeSet=new Set,R.types.forEach(q=>R.typeSet.add(q.name))),R.typeSet}function A(R){const q=[];if(typeof R!="string")throw new TypeError("Signatures must be strings");const Y=R.trim();if(Y==="")return q;const pe=Y.split(",");for(let ge=0;ge=ge+1}}else return R.length===0?function(De){return De.length===0}:R.length===1?(Y=w(R[0]),function(De){return Y(De[0])&&De.length===1}):R.length===2?(Y=w(R[0]),pe=w(R[1]),function(De){return Y(De[0])&&pe(De[1])&&De.length===2}):(q=R.map(w),function(De){for(let Be=0;Be{const ge=N(pe.params,q);let De;for(De of ge)Y.add(De)}),Y.has("any")?["any"]:Array.from(Y)}function F(R,q,Y){let pe,ge;const De=R||"unnamed";let Be=Y,Pe;for(Pe=0;Pe{const mr=E(at.params,Pe),k=w(mr);(Pe0){const at=f(q[Pe]);return pe=new TypeError("Unexpected type of argument in function "+De+" (expected: "+ge.join(" or ")+", actual: "+at.join(" | ")+", index: "+Pe+")"),pe.data={category:"wrongType",fn:De,index:Pe,actual:at,expected:ge},pe}}else Be=St}const Ve=Be.map(function(St){return _(St.params)?1/0:St.params.length});if(q.lengthze)return pe=new TypeError("Too many arguments in function "+De+" (expected: "+ze+", actual: "+q.length+")"),pe.data={category:"tooManyArgs",fn:De,index:q.length,expectedLength:ze},pe;const gt=[];for(let St=0;St0)return 1;const pe=V(R)-V(q);return pe<0?-1:pe>0?1:0}function I(R,q){const Y=R.params,pe=q.params,ge=me(Y),De=me(pe),Be=_(Y),Pe=_(pe);if(Be&&ge.hasAny){if(!Pe||!De.hasAny)return 1}else if(Pe&&De.hasAny)return-1;let Ve=0,ze=0,gt;for(gt of Y)gt.hasAny&&++Ve,gt.hasConversion&&++ze;let St=0,at=0;for(gt of pe)gt.hasAny&&++St,gt.hasConversion&&++at;if(Ve!==St)return Ve-St;if(Be&&ge.hasConversion){if(!Pe||!De.hasConversion)return 1}else if(Pe&&De.hasConversion)return-1;if(ze!==at)return ze-at;if(Be){if(!Pe)return 1}else if(Pe)return-1;const mr=(Y.length-pe.length)*(Be?-1:1);if(mr!==0)return mr;const k=[];let oe=0;for(let $e=0;$e1&&q.sort((ge,De)=>ge.index-De.index);let Y=q[0].conversionsTo;if(R.length===1)return Y;Y=Y.concat([]);const pe=new Set(R);for(let ge=1;gege.hasConversion)){const ge=_(R),De=R.map($);Y=function(){const Pe=[],Ve=ge?arguments.length-1:arguments.length;for(let ze=0;zeVe.name).join("|"),hasAny:Pe.some(Ve=>Ve.isAny),hasConversion:!1,restParam:!0}),Be.push(De)}else Be=De.types.map(function(Pe){return{types:[Pe],name:Pe.name,hasAny:Pe.isAny,hasConversion:Pe.conversion,restParam:!1}});return Ce(Be,function(Pe){return q(Y,pe+1,ge.concat([Pe]))})}else return[ge]}return q(R,0,[])}function he(R,q){const Y=Math.max(R.length,q.length);for(let Pe=0;Pe=pe:Be?pe>=ge:pe===ge}function ne(R){return R.map(q=>ye(q)?J(q.referToSelf.callback):te(q)?qe(q.referTo.references,q.referTo.callback):q)}function X(R,q,Y){const pe=[];let ge;for(ge of R){let De=Y[ge];if(typeof De!="number")throw new TypeError('No definition for referenced signature "'+ge+'"');if(De=q[De],typeof De!="function")return!1;pe.push(De)}return pe}function de(R,q,Y){const pe=ne(R),ge=new Array(pe.length).fill(!1);let De=!0;for(;De;){De=!1;let Be=!0;for(let Pe=0;Pe{const pe=R[Y];if(q.test(pe.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ce(R,q){if(s.createCount++,Object.keys(q).length===0)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&Se(q);const Y=[],pe=[],ge={},De=[];let Be;for(Be in q){if(!Object.prototype.hasOwnProperty.call(q,Be))continue;const Wt=A(Be);if(!Wt)continue;Y.forEach(function(Ia){if(he(Ia,Wt))throw new TypeError('Conflicting signatures "'+b(Ia)+'" and "'+b(Wt)+'".')}),Y.push(Wt);const bn=pe.length;pe.push(q[Be]);const ef=Wt.map(S);let to;for(to of se(ef)){const Ia=b(to);De.push({params:to,name:Ia,fn:bn}),to.every(ul=>!ul.hasConversion)&&(ge[Ia]=bn)}}De.sort(I);const Pe=de(pe,ge,as);let Ve;for(Ve in ge)Object.prototype.hasOwnProperty.call(ge,Ve)&&(ge[Ve]=Pe[ge[Ve]]);const ze=[],gt=new Map;for(Ve of De)gt.has(Ve.name)||(Ve.fn=Pe[Ve.fn],ze.push(Ve),gt.set(Ve.name,Ve));const St=ze[0]&&ze[0].params.length<=2&&!_(ze[0].params),at=ze[1]&&ze[1].params.length<=2&&!_(ze[1].params),mr=ze[2]&&ze[2].params.length<=2&&!_(ze[2].params),k=ze[3]&&ze[3].params.length<=2&&!_(ze[3].params),oe=ze[4]&&ze[4].params.length<=2&&!_(ze[4].params),Ae=ze[5]&&ze[5].params.length<=2&&!_(ze[5].params),$e=St&&at&&mr&&k&&oe&&Ae;for(let Wt=0;WtWt.test),Qc=ze.map(Wt=>Wt.implementation),eo=function(){for(let bn=Qo;bnb(A(Y))),q=me(arguments);if(typeof q!="function")throw new TypeError("Callback function expected as last argument");return qe(R,q)}function qe(R,q){return{referTo:{references:R,callback:q}}}function J(R){if(typeof R!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:R}}}function te(R){return R&&typeof R.referTo=="object"&&Array.isArray(R.referTo.references)&&typeof R.referTo.callback=="function"}function ye(R){return R&&typeof R.referToSelf=="object"&&typeof R.referToSelf.callback=="function"}function ee(R,q){if(!R)return q;if(q&&q!==R){const Y=new Error("Function names do not match (expected: "+R+", actual: "+q+")");throw Y.data={actual:q,expected:R},Y}return R}function ue(R){let q;for(const Y in R)Object.prototype.hasOwnProperty.call(R,Y)&&(h(R[Y])||typeof R[Y].signature=="string")&&(q=ee(q,R[Y].name));return q}function le(R,q){let Y;for(Y in q)if(Object.prototype.hasOwnProperty.call(q,Y)){if(Y in R&&q[Y]!==R[Y]){const pe=new Error('Signature "'+Y+'" is defined twice');throw pe.data={signature:Y,sourceFunction:q[Y],destFunction:R[Y]},pe}R[Y]=q[Y]}}const Ee=s;s=function(R){const q=typeof R=="string",Y=q?1:0;let pe=q?R:"";const ge={};for(let De=Y;Dege.from===R.from);if(!Y)throw new Error("Attempt to remove nonexistent conversion from "+R.from+" to "+R.to);if(Y.convert!==R.convert)throw new Error("Conversion to remove does not match existing conversion");const pe=q.conversionsTo.indexOf(Y);q.conversionsTo.splice(pe,1)},s.resolve=function(R,q){if(!h(R))throw new TypeError(x2);const Y=R._typedFunctionData.signatures;for(let pe=0;pe0?1:t<0?-1:0},Jte=Math.log2||function(e){return Math.log(e)/Math.LN2},Qte=Math.log10||function(e){return Math.log(e)/Math.LN10},ere=Math.log1p||function(t){return Math.log(t+1)},tre=Math.cbrt||function(e){if(e===0)return e;var r=e<0,n;return r&&(e=-e),isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,r?-n:n},rre=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function Hy(t,e,r){var n={2:"0b",8:"0o",16:"0x"},i=n[e],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ot(r))throw new Error("size must be an integer");if(t>2**(r-1)-1||t<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!ot(t))throw new Error("Value must be an integer");t<0&&(t=t+2**r),a="i".concat(r)}var s="";return t<0&&(t=-t,s="-"),"".concat(s).concat(i).concat(t.toString(e)).concat(a)}function Bu(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:r,precision:n,wordSize:i}=nB(e);switch(r){case"fixed":return iB(t,n);case"exponential":return aB(t,n);case"engineering":return nre(t,n);case"bin":return Hy(t,2,i);case"oct":return Hy(t,8,i);case"hex":return Hy(t,16,i);case"auto":return ire(t,n,e).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function nB(t){var e="auto",r,n;if(t!==void 0)if(Ct(t))r=t;else if(Mt(t))r=t.toNumber();else if(Mg(t))t.precision!==void 0&&(r=w2(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(n=w2(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:r,wordSize:n}}function fd(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],i=parseFloat(e[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(o){return i-=o.length,""}).replace(/0*$/,"").split("").map(function(o){return parseInt(o)});return s.length===0&&(s.push(0),i++),{sign:r,coefficients:s,exponent:i}}function nre(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=fd(t),n=Og(r,e),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ct(e))for(;e>a.length||i-s+1>a.length;)a.push(0);else for(var o=Math.abs(i-s)-(a.length-1),u=0;u0;)c++,l--;var f=a.slice(c).join(""),h=Ct(e)&&f.length||f.match(/[1-9]/)?"."+f:"",p=a.slice(0,c).join("")+h+"e"+(i>=0?"+":"")+s.toString();return n.sign+p}function iB(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=fd(t),n=typeof e=="number"?Og(r,r.exponent+1+e):r,i=n.coefficients,a=n.exponent+1,s=a+(e||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function ire(t,e,r){if(isNaN(t)||!isFinite(t))return String(t);var n=S2(r==null?void 0:r.lowerExp,-3),i=S2(r==null?void 0:r.upperExp,5),a=fd(t),s=e?Og(a,e):a;if(s.exponent=i)return aB(t,e);var o=s.coefficients,u=s.exponent;o.length0?u:0;return le){var i=n.splice(e,n.length-e);if(i[0]>=5){var a=e-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function Kl(t){for(var e=[],r=0;r0?!0:t<0?!1:1/t===1/0,n=e>0?!0:e<0?!1:1/e===1/0;return r^n?-t:t}function w2(t,e){if(Ct(t))return t;if(Mt(t))return t.toNumber();e()}function S2(t,e){return Ct(t)?t:Mt(t)?t.toNumber():e}function Wy(t,e,r){var n=t.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ot(r))throw new Error("size must be an integer");if(t.greaterThan(i.pow(r-1).sub(1))||t.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(i.pow(r))),a="i".concat(r)}switch(e){case 2:return"".concat(t.toBinary()).concat(a);case 8:return"".concat(t.toOctal()).concat(a);case 16:return"".concat(t.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(e," not supported "))}}function pre(t,e){if(typeof e=="function")return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=nB(e);switch(r){case"fixed":return vre(t,n);case"exponential":return _2(t,n);case"engineering":return mre(t,n);case"bin":return Wy(t,2,i);case"oct":return Wy(t,8,i);case"hex":return Wy(t,16,i);case"auto":{var a=A2(e==null?void 0:e.lowerExp,-3),s=A2(e==null?void 0:e.upperExp,5);if(t.isZero())return"0";var o,u=t.toSignificantDigits(n),l=u.e;return l>=a&&l=0?"+":"")+n.toString()}function _2(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function vre(t,e){return t.toFixed(e)}function A2(t,e){return Ct(t)?t:Mt(t)?t.toNumber():e}function gre(t,e){var r=t.length-e.length,n=t.length;return t.substring(r,n)===e}function Rt(t,e){var r=yre(t,e);return e&&typeof e=="object"&&"truncate"in e&&r.length>e.truncate?r.substring(0,e.truncate-3)+"...":r}function yre(t,e){if(typeof t=="number")return Bu(t,e);if(Mt(t))return pre(t,e);if(bre(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return sB(t,e);if($n(t))return zl(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var r=Object.keys(t).map(n=>zl(n)+": "+Rt(t[n],e));return"{"+r.join(", ")+"}"}return String(t)}function zl(t){for(var e=String(t),r="",n=0;n/g,">"),e}function sB(t,e){if(Array.isArray(t)){for(var r="[",n=t.length,i=0;ie?1:-1}function Pt(t,e,r){if(!(this instanceof Pt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}Pt.prototype=new RangeError;Pt.prototype.constructor=RangeError;Pt.prototype.name="DimensionError";Pt.prototype.isDimensionError=!0;function Ma(t,e,r){if(!(this instanceof Ma))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=r),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Ma.prototype=new RangeError;Ma.prototype.constructor=RangeError;Ma.prototype.name="IndexError";Ma.prototype.isIndexError=!0;function Nt(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function oB(t,e,r){var n,i=t.length;if(i!==e[r])throw new Pt(i,e[r]);if(r")}function N2(t,e){var r=e.length===0;if(r){if(Array.isArray(t))throw new Pt(t.length,0)}else oB(t,e,0)}function yv(t,e){var r=t.isMatrix?t._size:Nt(t),n=e._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new Pt(i,r[a])})}function gr(t,e){if(t!==void 0){if(!Ct(t)||!ot(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new Ma(t,e)}}function hc(t){for(var e=0;e=0,u=e%r===0;if(o)if(u)n[a]=-e/r;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-r);return n}function uB(t){return t.reduce((e,r)=>e*r,1)}function xre(t,e){for(var r=t,n,i=e.length-1;i>0;i--){var a=e[i];n=[];for(var s=r.length/a,o=0;oe.test(r))}function E2(t,e){return Array.prototype.join.call(t,e)}function pc(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;var e=[],r=0;e[0]={value:t[0],identifier:0};for(var n=1;n1)return t.slice(1).reduce(function(r,n){return dB(r,n,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function wre(){for(var t=arguments.length,e=new Array(t),r=0;rh.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[c]&&(a[c]=o[l])}for(var f=0;f1||t[i]>e[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(n," with size ").concat(t[i]," to size ").concat(e[a]))}}function C2(t,e){var r=Nt(t);if(zu(r,e))return t;Sv(r,e);var n=wre(r,e),i=n.length,a=[...Array(i-r.length).fill(1),...r],s=_re(t);r.length!Dre(a)).every(a=>r[a]!==void 0);if(!n){var i=e.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function Dre(t){return t&&t[0]==="?"}function Nre(t){return t&&t[0]==="?"?t.slice(1):t}function ei(t,e){if(vB(t)&&mB(t,e))return t[e];throw typeof t[e]=="function"&&cw(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function mc(t,e,r){if(vB(t)&&mB(t,e))return t[e]=r,r;throw new Error('No access to property "'+e+'"')}function Ere(t,e){return e in t}function mB(t,e){return!t||typeof t!="object"?!1:tt(Mre,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Cre(t,e){if(!cw(t,e))throw new Error('No access to method "'+e+'"');return t[e]}function cw(t,e){return t==null||typeof t[e]!="function"||tt(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:tt(Tre,e)?!0:!(e in Object.prototype||e in Function.prototype)}function vB(t){return typeof t=="object"&&t&&t.constructor===Object}var Mre={length:!0,name:!0},Tre={toString:!0,valueOf:!0,toLocaleString:!0};class Rg{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return ei(this.wrappedObject,e)}set(e,r){return mc(this.wrappedObject,e,r),this}has(e){return Ere(this.wrappedObject,e)}entries(){return yB(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class gB{constructor(e,r,n){this.a=e,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,r){return this.bKeys.has(e)?this.b.set(e,r):this.a.set(e,r),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return yB(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function yB(t,e){return{next:()=>{var r=t.next();return r.done?r:{value:e(r.value),done:!1}}}}function zh(){return new Map}function Jl(t){if(!t)return zh();if(bB(t))return t;if(Mg(t))return new Rg(t);throw new Error("createMap can create maps from objects or Maps")}function Ore(t){if(t instanceof Rg)return t.wrappedObject;var e={};for(var r of t.keys()){var n=t.get(r);mc(e,r,n)}return e}function bB(t){return t?t instanceof Map||t instanceof Rg||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var xB=function(){return xB=$l.create,$l},Fre=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Rre=G("typed",Fre,function(e){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:a}=e,s=xB();return s.clear(),s.addTypes([{name:"number",test:Ct},{name:"Complex",test:$s},{name:"BigNumber",test:Mt},{name:"Fraction",test:ld},{name:"Unit",test:Xi},{name:"identifier",test:o=>$n&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(o)},{name:"string",test:$n},{name:"Chain",test:JR},{name:"Array",test:sr},{name:"Matrix",test:dt},{name:"DenseMatrix",test:gv},{name:"SparseMatrix",test:Eu},{name:"Range",test:ow},{name:"Index",test:Cg},{name:"boolean",test:kte},{name:"ResultSet",test:Lte},{name:"Help",test:KR},{name:"function",test:$te},{name:"Date",test:zte},{name:"RegExp",test:Ute},{name:"null",test:qte},{name:"undefined",test:Hte},{name:"AccessorNode",test:$u},{name:"ArrayNode",test:ji},{name:"AssignmentNode",test:Wte},{name:"BlockNode",test:Vte},{name:"ConditionalNode",test:Yte},{name:"ConstantNode",test:er},{name:"FunctionNode",test:Lo},{name:"FunctionAssignmentNode",test:cd},{name:"IndexNode",test:Dc},{name:"Node",test:pr},{name:"ObjectNode",test:Tg},{name:"OperatorNode",test:tn},{name:"ParenthesisNode",test:Hs},{name:"RangeNode",test:jte},{name:"RelationalNode",test:Gte},{name:"SymbolNode",test:Sn},{name:"Map",test:bB},{name:"Object",test:Mg}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(u){if(r||Vy(u),are(u)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+u+"). Use function bignumber(x) to convert to BigNumber.");return new r(u)}},{from:"number",to:"Complex",convert:function(u){return n||em(u),new n(u,0)}},{from:"BigNumber",to:"Complex",convert:function(u){return n||em(u),new n(u.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(u){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(u){return n||em(u),new n(u.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(u){a||Yy(u);var l=new a(u);if(l.valueOf()!==u)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+u+"). Use function fraction(x) to convert to Fraction.");return l}},{from:"string",to:"number",convert:function(u){var l=Number(u);if(isNaN(l))throw new Error('Cannot convert "'+u+'" to a number');return l}},{from:"string",to:"BigNumber",convert:function(u){r||Vy(u);try{return new r(u)}catch{throw new Error('Cannot convert "'+u+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(u){a||Yy(u);try{return new a(u)}catch{throw new Error('Cannot convert "'+u+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(u){n||em(u);try{return new n(u)}catch{throw new Error('Cannot convert "'+u+'" to Complex')}}},{from:"boolean",to:"number",convert:function(u){return+u}},{from:"boolean",to:"BigNumber",convert:function(u){return r||Vy(u),new r(+u)}},{from:"boolean",to:"Fraction",convert:function(u){return a||Yy(u),new a(+u)}},{from:"boolean",to:"string",convert:function(u){return String(u)}},{from:"Array",to:"Matrix",convert:function(u){return i||Bre(),new i(u)}},{from:"Matrix",to:"Array",convert:function(u){return u.valueOf()}}]),s.onMismatch=(o,u,l)=>{var c=s.createError(o,u,l);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&na(u[0])&&l.some(h=>!h.params.includes(","))){var f=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw f.data=c.data,f}throw c},s.onMismatch=(o,u,l)=>{var c=s.createError(o,u,l);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&na(u[0])&&l.some(h=>!h.params.includes(","))){var f=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw f.data=c.data,f}throw c},s});function Vy(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function em(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Bre(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Yy(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var Pre="ResultSet",Ire=[],kre=G(Pre,Ire,()=>{function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});/*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2022 Michael Mclaughlin * MIT Licence - */var Ul=9e15,Wo=1e9,jb="0123456789abcdef",wv="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Sv="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Gb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ul,maxE:Ul,crypto:!1},bB,Bs,At=!0,Fg="[DecimalError] ",$o=Fg+"Invalid argument: ",xB=Fg+"Precision limit exceeded",wB=Fg+"crypto unavailable",SB="[object Decimal]",Vn=Math.floor,fn=Math.pow,kre=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Lre=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,$re=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_B=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_a=1e7,mt=7,zre=9007199254740991,Ure=wv.length-1,Xb=Sv.length-1,Ue={toStringTag:SB};Ue.absoluteValue=Ue.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),lt(t)};Ue.ceil=function(){return lt(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error($o+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};Ue.comparedTo=Ue.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,u=a.s,l=t.s;if(!s||!o)return!u||!l?NaN:u!==l?u:s===o?0:!s^u<0?1:-1;if(!s[0]||!o[0])return s[0]?u:o[0]?-l:0;if(u!==l)return u;if(a.e!==t.e)return a.e>t.e^u<0?1:-1;for(n=s.length,i=o.length,e=0,r=no[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};Ue.cosine=Ue.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+mt,n.rounding=1,r=qre(n,CB(n,r)),n.precision=t,n.rounding=e,lt(Bs==2||Bs==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var t,e,r,n,i,a,s,o,u,l,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(At=!1,a=c.s*fn(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=Tn(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=fn(r,1/3),t=Vn((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new f(r),n.s=c.s):n=new f(a.toString()),s=(t=f.precision)+3;;)if(o=n,u=o.times(o).times(o),l=u.plus(c),n=Nr(l.plus(c).times(o),l.plus(u),s+2,1),Tn(o.d).slice(0,s)===(r=Tn(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(lt(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(lt(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return At=!0,lt(n,t,f.rounding,e)};Ue.decimalPlaces=Ue.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-Vn(this.e/mt))*mt,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};Ue.dividedBy=Ue.div=function(t){return Nr(this,new this.constructor(t))};Ue.dividedToIntegerBy=Ue.divToInt=function(t){var e=this,r=e.constructor;return lt(Nr(e,new r(t),0,1,1),r.precision,r.rounding)};Ue.equals=Ue.eq=function(t){return this.cmp(t)===0};Ue.floor=function(){return lt(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(t){return this.cmp(t)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(t){var e=this.cmp(t);return e==1||e===0};Ue.hyperbolicCosine=Ue.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/Bg(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=gc(s,1,a.times(e),new s(1),!0);for(var u,l=t,c=new s(8);l--;)u=a.times(a),a=o.minus(u.times(c.minus(u.times(c))));return lt(a,s.precision=r,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=gc(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/Bg(5,t)),i=gc(a,2,i,i,!0);for(var s,o=new a(5),u=new a(16),l=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(u.times(s).plus(l))))}return a.precision=e,a.rounding=r,lt(i,e,r,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,Nr(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};Ue.inverseCosine=Ue.acos=function(){var t,e=this,r=e.constructor,n=e.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?e.isNeg()?wa(r,i,a):new r(0):new r(NaN):e.isZero()?wa(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,e=e.asin(),t=wa(r,i+4,a).times(.5),r.precision=i,r.rounding=a,t.minus(e))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,At=!1,r=r.times(r).minus(1).sqrt().plus(r),At=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,At=!1,r=r.times(r).plus(1).sqrt().plus(r),At=!0,n.precision=t,n.rounding=e,r.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?lt(new a(i),t,e,!0):(a.precision=r=n-i.e,i=Nr(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=wa(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var t,e,r,n,i,a,s,o,u,l=this,c=l.constructor,f=c.precision,h=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&f+4<=Xb)return s=wa(c,f+4,h).times(.25),s.s=l.s,s}else{if(!l.s)return new c(NaN);if(f+4<=Xb)return s=wa(c,f+4,h).times(.5),s.s=l.s,s}for(c.precision=o=f+10,c.rounding=1,r=Math.min(28,o/mt+2|0),t=r;t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(At=!1,e=Math.ceil(o/mt),n=1,u=l.times(l),s=new c(l),i=l;t!==-1;)if(i=i.times(u),a=s.minus(i.div(n+=2)),i=i.times(u),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(t){return this.cmp(t)<0};Ue.lessThanOrEqualTo=Ue.lte=function(t){return this.cmp(t)<1};Ue.logarithm=Ue.log=function(t){var e,r,n,i,a,s,o,u,l=this,c=l.constructor,f=c.precision,h=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(At=!1,o=f+p,s=Oo(l,o),n=e?_v(c,o+10):Oo(t,o),u=Nr(s,n,o,1),Uh(u.d,i=f,h))do if(o+=10,s=Oo(l,o),n=e?_v(c,o+10):Oo(t,o),u=Nr(s,n,o,1),!a){+Tn(u.d).slice(i+1,i+15)+1==1e14&&(u=lt(u,f+1,0));break}while(Uh(u.d,i+=10,h));return At=!0,lt(u,f,h)};Ue.minus=Ue.sub=function(t){var e,r,n,i,a,s,o,u,l,c,f,h,p=this,v=p.constructor;if(t=new v(t),!p.d||!t.d)return!p.s||!t.s?t=new v(NaN):p.d?t.s=-t.s:t=new v(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(l=p.d,h=t.d,o=v.precision,u=v.rounding,!l[0]||!h[0]){if(h[0])t.s=-t.s;else if(l[0])t=new v(p);else return new v(u===3?-0:0);return At?lt(t,o,u):t}if(r=Vn(t.e/mt),c=Vn(p.e/mt),l=l.slice(),a=c-r,a){for(f=a<0,f?(e=l,a=-a,s=h.length):(e=h,r=c,s=l.length),n=Math.max(Math.ceil(o/mt),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=l.length,s=h.length,f=n0;--n)l[s++]=0;for(n=h.length;n>a;){if(l[--n]s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=c.length,s-i<0&&(i=s,r=c,c=l,l=r),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/_a|0,l[i]%=_a;for(e&&(l.unshift(e),++n),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=Rg(l,n),At?lt(t,o,u):t};Ue.precision=Ue.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error($o+t);return r.d?(e=AB(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};Ue.round=function(){var t=this,e=t.constructor;return lt(new e(t),t.e+1,e.rounding)};Ue.sine=Ue.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+mt,n.rounding=1,r=Wre(n,CB(n,r)),n.precision=t,n.rounding=e,lt(Bs>2?r.neg():r,t,e,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,u=s.e,l=s.s,c=s.constructor;if(l!==1||!o||!o[0])return new c(!l||l<0&&(!o||o[0])?NaN:o?s:1/0);for(At=!1,l=Math.sqrt(+s),l==0||l==1/0?(e=Tn(o),(e.length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=Vn((u+1)/2)-(u<0||u%2),l==1/0?e="5e"+u:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new c(e)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(a=n,n=a.plus(Nr(s,a,r+2,1)).times(.5),Tn(a.d).slice(0,r)===(e=Tn(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(lt(a,u+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(lt(n,u+1,1),t=!n.times(n).eq(s));break}return At=!0,lt(n,u,c.rounding,t)};Ue.tangent=Ue.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=Nr(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,lt(Bs==2||Bs==4?r.neg():r,t,e,!0)):new n(NaN)};Ue.times=Ue.mul=function(t){var e,r,n,i,a,s,o,u,l,c=this,f=c.constructor,h=c.d,p=(t=new f(t)).d;if(t.s*=c.s,!h||!h[0]||!p||!p[0])return new f(!t.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:!h||!p?t.s/0:t.s*0);for(r=Vn(c.e/mt)+Vn(t.e/mt),u=h.length,l=p.length,u=0;){for(e=0,i=u+n;i>n;)o=a[i]+p[n]*h[i-n-1]+e,a[i--]=o%_a|0,e=o/_a|0;a[i]=(a[i]+e)%_a|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=Rg(a,r),At?lt(t,f.precision,f.rounding):t};Ue.toBinary=function(t,e){return tw(this,2,t,e)};Ue.toDecimalPlaces=Ue.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Si(t,0,Wo),e===void 0?e=n.rounding:Si(e,0,8),lt(r,t+r.e+1,e))};Ue.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ga(n,!0):(Si(t,0,Wo),e===void 0?e=i.rounding:Si(e,0,8),n=lt(new i(n),t+1,e),r=Ga(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};Ue.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Ga(i):(Si(t,0,Wo),e===void 0?e=a.rounding:Si(e,0,8),n=lt(new a(i),t+i.e+1,e),r=Ga(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};Ue.toFraction=function(t){var e,r,n,i,a,s,o,u,l,c,f,h,p=this,v=p.d,m=p.constructor;if(!v)return new m(p);if(l=r=new m(1),n=u=new m(0),e=new m(n),a=e.e=AB(v)-p.e-1,s=a%mt,e.d[0]=fn(10,s<0?mt+s:s),t==null)t=a>0?e:l;else{if(o=new m(t),!o.isInt()||o.lt(l))throw Error($o+o);t=o.gt(e)?a>0?e:l:o}for(At=!1,o=new m(Tn(v)),c=m.precision,m.precision=a=v.length*mt*2;f=Nr(o,e,0,1,1),i=r.plus(f.times(n)),i.cmp(t)!=1;)r=n,n=i,i=l,l=u.plus(f.times(i)),u=i,i=e,e=o.minus(f.times(i)),o=i;return i=Nr(t.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=p.s,h=Nr(l,n,a,1).minus(p).abs().cmp(Nr(u,r,a,1).minus(p).abs())<1?[l,n]:[u,r],m.precision=c,At=!0,h};Ue.toHexadecimal=Ue.toHex=function(t,e){return tw(this,16,t,e)};Ue.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:Si(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(At=!1,r=Nr(r,t,0,e,1).times(t),At=!0,lt(r)):(t.s=r.s,r=t),r};Ue.toNumber=function(){return+this};Ue.toOctal=function(t,e){return tw(this,8,t,e)};Ue.toPower=Ue.pow=function(t){var e,r,n,i,a,s,o=this,u=o.constructor,l=+(t=new u(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new u(fn(+o,l));if(o=new u(o),o.eq(1))return o;if(n=u.precision,a=u.rounding,t.eq(1))return lt(o,n,a);if(e=Vn(t.e/mt),e>=t.d.length-1&&(r=l<0?-l:l)<=zre)return i=DB(u,o,r,n),t.s<0?new u(1).div(i):lt(i,n,a);if(s=o.s,s<0){if(eu.maxE+1||e0?s/0:0):(At=!1,u.rounding=o.s=1,r=Math.min(12,(e+"").length),i=Zb(t.times(Oo(o,n+r)),n),i.d&&(i=lt(i,n+5,1),Uh(i.d,n,a)&&(e=n+10,i=lt(Zb(t.times(Oo(o,e+r)),e),e+5,1),+Tn(i.d).slice(n+1,n+15)+1==1e14&&(i=lt(i,n+1,0)))),i.s=s,At=!0,u.rounding=a,lt(i,n,a))};Ue.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ga(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Si(t,1,Wo),e===void 0?e=i.rounding:Si(e,0,8),n=lt(new i(n),t,e),r=Ga(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};Ue.toSignificantDigits=Ue.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Si(t,1,Wo),e===void 0?e=n.rounding:Si(e,0,8)),lt(new n(r),t,e)};Ue.toString=function(){var t=this,e=t.constructor,r=Ga(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};Ue.truncated=Ue.trunc=function(){return lt(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var t=this,e=t.constructor,r=Ga(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function Tn(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;er)throw Error($o+t)}function Uh(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=mt,i=0):(i=Math.ceil((e+1)/mt),e%=mt),a=fn(10,mt-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==fn(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==fn(10,e-3)-1,s}function Bm(t,e,r){for(var n,i=[0],a,s=0,o=t.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function qre(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/Bg(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=gc(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var Nr=function(){function t(n,i,a){var s,o=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+o,n[u]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,u;if(a!=s)u=a>s?1:-1;else for(o=u=0;oi[o]?1:-1;break}return u}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,s,o,u){var l,c,f,h,p,v,m,b,y,S,x,A,_,w,C,E,N,M,O,F,U=n.constructor,V=n.s==i.s?1:-1,H=n.d,I=i.d;if(!H||!H[0]||!I||!I[0])return new U(!n.s||!i.s||(H?I&&H[0]==I[0]:!I)?NaN:H&&H[0]==0||!I?V*0:V/0);for(u?(p=1,c=n.e-i.e):(u=_a,p=mt,c=Vn(n.e/p)-Vn(i.e/p)),O=I.length,N=H.length,y=new U(V),S=y.d=[],f=0;I[f]==(H[f]||0);f++);if(I[f]>(H[f]||0)&&c--,a==null?(w=a=U.precision,s=U.rounding):o?w=a+(n.e-i.e)+1:w=a,w<0)S.push(1),v=!0;else{if(w=w/p+2|0,f=0,O==1){for(h=0,I=I[0],w++;(f1&&(I=t(I,h,u),H=t(H,h,u),O=I.length,N=H.length),E=O,x=H.slice(0,O),A=x.length;A=u/2&&++M;do h=0,l=e(I,x,O,A),l<0?(_=x[0],O!=A&&(_=_*u+(x[1]||0)),h=_/M|0,h>1?(h>=u&&(h=u-1),m=t(I,h,u),b=m.length,A=x.length,l=e(m,x,b,A),l==1&&(h--,r(m,O=10;h/=10)f++;y.e=f+c*p-1,lt(y,o?a+y.e+1:a,s,v)}return y}}();function lt(t,e,r,n){var i,a,s,o,u,l,c,f,h,p=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,o=f[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=mt,s=e,c=f[h=0],u=c/fn(10,i-s-1)%10|0;else if(h=Math.ceil((a+1)/mt),o=f.length,h>=o)if(n){for(;o++<=h;)f.push(0);c=u=0,i=1,a%=mt,s=a-mt+1}else break e;else{for(c=o=f[h],i=1;o>=10;o/=10)i++;a%=mt,s=a-mt+i,u=s<0?0:c/fn(10,i-s-1)%10|0}if(n=n||e<0||f[h+1]!==void 0||(s<0?c:c%fn(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(t.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(a>0?s>0?c/fn(10,i-s):0:f[h-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,l?(e-=t.e+1,f[0]=fn(10,(mt-e%mt)%mt),t.e=-e||0):f[0]=t.e=0,t;if(a==0?(f.length=h,o=1,h--):(f.length=h+1,o=fn(10,mt-a),f[h]=s>0?(c/fn(10,i-s)%fn(10,s)|0)*o:0),l)for(;;)if(h==0){for(a=1,s=f[0];s>=10;s/=10)a++;for(s=f[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,f[0]==_a&&(f[0]=1));break}else{if(f[h]+=o,f[h]!=_a)break;f[h--]=0,o=1}for(a=f.length;f[--a]===0;)f.pop()}return At&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?a=a.charAt(0)+"."+a.slice(1)+wo(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+wo(-i-1)+a,r&&(n=r-s)>0&&(a+=wo(n))):i>=s?(a+=wo(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+wo(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=wo(n))),a}function Rg(t,e){var r=t[0];for(e*=mt;r>=10;r/=10)e++;return e}function _v(t,e,r){if(e>Ure)throw At=!0,r&&(t.precision=r),Error(xB);return lt(new t(wv),e,1,!0)}function wa(t,e,r){if(e>Xb)throw Error(xB);return lt(new t(Sv),e,r,!0)}function AB(t){var e=t.length-1,r=e*mt+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function wo(t){for(var e="";t--;)e+="0";return e}function DB(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/mt+4);for(At=!1;;){if(r%2&&(a=a.times(e),N2(a.d,s)&&(i=!0)),r=Vn(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),N2(e.d,s)}return At=!0,a}function D2(t){return t.d[t.d.length-1]&1}function NB(t,e,r){for(var n,i=new t(e[0]),a=0;++a17)return new h(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(At=!1,u=v):u=e,o=new h(.03125);t.e>-2;)t=t.times(o),f+=5;for(n=Math.log(fn(2,f))/Math.LN10*2+5|0,u+=n,r=a=s=new h(1),h.precision=u;;){if(a=lt(a.times(t),u,1),r=r.times(++c),o=s.plus(Nr(a,r,u,1)),Tn(o.d).slice(0,u)===Tn(s.d).slice(0,u)){for(i=f;i--;)s=lt(s.times(s),u,1);if(e==null)if(l<3&&Uh(s.d,u-n,p,l))h.precision=u+=10,r=a=o=new h(1),c=0,l++;else return lt(s,h.precision=v,p,At=!0);else return h.precision=v,s}s=o}}function Oo(t,e){var r,n,i,a,s,o,u,l,c,f,h,p=1,v=10,m=t,b=m.d,y=m.constructor,S=y.rounding,x=y.precision;if(m.s<0||!b||!b[0]||!m.e&&b[0]==1&&b.length==1)return new y(b&&!b[0]?-1/0:m.s!=1?NaN:b?0:m);if(e==null?(At=!1,c=x):c=e,y.precision=c+=v,r=Tn(b),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=Tn(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new y("0."+r),a++):m=new y(n+"."+r.slice(1))}else return l=_v(y,c+2,x).times(a+""),m=Oo(new y(n+"."+r.slice(1)),c-v).plus(l),y.precision=x,e==null?lt(m,x,S,At=!0):m;for(f=m,u=s=m=Nr(m.minus(1),m.plus(1),c,1),h=lt(m.times(m),c,1),i=3;;){if(s=lt(s.times(h),c,1),l=u.plus(Nr(s,new y(i),c,1)),Tn(l.d).slice(0,c)===Tn(u.d).slice(0,c))if(u=u.times(2),a!==0&&(u=u.plus(_v(y,c+2,x).times(a+""))),u=Nr(u,new y(p),c,1),e==null)if(Uh(u.d,c-v,S,o))y.precision=c+=v,l=s=m=Nr(f.minus(1),f.plus(1),c,1),h=lt(m.times(m),c,1),i=o=1;else return lt(u,y.precision=x,S,At=!0);else return y.precision=x,u;u=l,i+=2}}function EB(t){return String(t.s*t.s/0)}function Kb(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%mt,r<0&&(n+=mt),nt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),_B.test(e))return Kb(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Lre.test(e))r=16,e=e.toLowerCase();else if(kre.test(e))r=2;else if($re.test(e))r=8;else throw Error($o+e);for(a=e.search(/p/i),a>0?(u=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=DB(n,new n(r),a,a*2)),l=Bm(e,r,_a),c=l.length-1,a=c;l[a]===0;--a)l.pop();return a<0?new n(t.s*0):(t.e=Rg(l,c),t.d=l,At=!1,s&&(t=Nr(t,i,o*4)),u&&(t=t.times(Math.abs(u)<54?fn(2,u):zo.pow(2,u))),At=!0,t)}function Wre(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:gc(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/Bg(5,r)),e=gc(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function gc(t,e,r,n,i){var a,s,o,u,l=t.precision,c=Math.ceil(l/mt);for(At=!1,u=r.times(r),o=new t(n);;){if(s=Nr(o.times(u),new t(e++*e++),l,1),o=i?n.plus(s):n.minus(s),n=Nr(s.times(u),new t(e++*e++),l,1),s=o.plus(n),s.d[c]!==void 0){for(a=c;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a}return At=!0,s.d.length=c+1,s}function Bg(t,e){for(var r=t;--e;)r*=t;return r}function CB(t,e){var r,n=e.s<0,i=wa(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return Bs=n?4:1,e;if(r=e.divToInt(i),r.isZero())Bs=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return Bs=D2(r)?n?2:3:n?4:1,e;Bs=D2(r)?n?1:4:n?3:2}return e.minus(i).abs()}function tw(t,e,r,n){var i,a,s,o,u,l,c,f,h,p=t.constructor,v=r!==void 0;if(v?(Si(r,1,Wo),n===void 0?n=p.rounding:Si(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=EB(t);else{for(c=Ga(t),s=c.indexOf("."),v?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),h=new p(1),h.e=c.length-s,h.d=Bm(Ga(h),10,i),h.e=h.d.length),f=Bm(c,10,i),a=u=f.length;f[--u]==0;)f.pop();if(!f[0])c=v?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=f,t.e=a,t=Nr(t,h,r,n,0,i),f=t.d,a=t.e,l=bB),s=f[r],o=i/2,l=l||f[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||l||n===6&&f[r-1]&1||n===(t.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(u=f.length;!f[u-1];--u);for(s=0,c="";s1)if(e==16||e==8){for(s=e==16?4:3,--u;u%s;u++)c+="0";for(f=Bm(c,i,e),u=f.length;!f[u-1];--u);for(s=1,c="1.";su)for(a-=u;a--;)c+="0";else ae)return t.length=e,!0}function Vre(t){return new this(t).abs()}function Yre(t){return new this(t).acos()}function jre(t){return new this(t).acosh()}function Gre(t,e){return new this(t).plus(e)}function Xre(t){return new this(t).asin()}function Zre(t){return new this(t).asinh()}function Kre(t){return new this(t).atan()}function Jre(t){return new this(t).atanh()}function Qre(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=wa(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?wa(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=wa(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(Nr(t,e,a,1)),e=wa(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(Nr(t,e,a,1)),r}function ene(t){return new this(t).cbrt()}function tne(t){return lt(t=new this(t),t.e+1,2)}function rne(t,e,r){return new this(t).clamp(e,r)}function nne(t){if(!t||typeof t!="object")throw Error(Fg+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,Wo,"rounding",0,8,"toExpNeg",-Ul,0,"toExpPos",0,Ul,"maxE",0,Ul,"minE",-Ul,0,"modulo",0,9];for(e=0;e=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error($o+r+": "+n);if(r="crypto",i&&(this[r]=Gb[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(wB);else this[r]=!1;else throw Error($o+r+": "+n);return this}function ine(t){return new this(t).cos()}function ane(t){return new this(t).cosh()}function MB(t){var e,r,n;function i(a){var s,o,u,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,E2(a)){l.s=a.s,At?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e=10;o/=10)s++;At?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(wB);else for(;a=10;i/=10)n++;n{var{on:e,config:r}=t,n=zo.clone({precision:r.precision,modulo:zo.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},e&&e("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),TB={exports:{}};/** + */var Ul=9e15,Wo=1e9,Gb="0123456789abcdef",_v="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Av="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Xb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ul,maxE:Ul,crypto:!1},wB,Bs,At=!0,Bg="[DecimalError] ",$o=Bg+"Invalid argument: ",SB=Bg+"Precision limit exceeded",_B=Bg+"crypto unavailable",AB="[object Decimal]",Vn=Math.floor,fn=Math.pow,Lre=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$re=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,zre=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,DB=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_a=1e7,mt=7,Ure=9007199254740991,qre=_v.length-1,Zb=Av.length-1,Ue={toStringTag:AB};Ue.absoluteValue=Ue.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),lt(t)};Ue.ceil=function(){return lt(new this.constructor(this),this.e+1,2)};Ue.clampedTo=Ue.clamp=function(t,e){var r,n=this,i=n.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error($o+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new i(n)};Ue.comparedTo=Ue.cmp=function(t){var e,r,n,i,a=this,s=a.d,o=(t=new a.constructor(t)).d,u=a.s,l=t.s;if(!s||!o)return!u||!l?NaN:u!==l?u:s===o?0:!s^u<0?1:-1;if(!s[0]||!o[0])return s[0]?u:o[0]?-l:0;if(u!==l)return u;if(a.e!==t.e)return a.e>t.e^u<0?1:-1;for(n=s.length,i=o.length,e=0,r=no[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};Ue.cosine=Ue.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+mt,n.rounding=1,r=Hre(n,TB(n,r)),n.precision=t,n.rounding=e,lt(Bs==2||Bs==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)};Ue.cubeRoot=Ue.cbrt=function(){var t,e,r,n,i,a,s,o,u,l,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(At=!1,a=c.s*fn(c.s*c,1/3),!a||Math.abs(a)==1/0?(r=Tn(c.d),t=c.e,(a=(t-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=fn(r,1/3),t=Vn((t+1)/3)-(t%3==(t<0?-1:2)),a==1/0?r="5e"+t:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new f(r),n.s=c.s):n=new f(a.toString()),s=(t=f.precision)+3;;)if(o=n,u=o.times(o).times(o),l=u.plus(c),n=Cr(l.plus(c).times(o),l.plus(u),s+2,1),Tn(o.d).slice(0,s)===(r=Tn(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(lt(o,t+1,0),o.times(o).times(o).eq(c))){n=o;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(lt(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return At=!0,lt(n,t,f.rounding,e)};Ue.decimalPlaces=Ue.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-Vn(this.e/mt))*mt,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};Ue.dividedBy=Ue.div=function(t){return Cr(this,new this.constructor(t))};Ue.dividedToIntegerBy=Ue.divToInt=function(t){var e=this,r=e.constructor;return lt(Cr(e,new r(t),0,1,1),r.precision,r.rounding)};Ue.equals=Ue.eq=function(t){return this.cmp(t)===0};Ue.floor=function(){return lt(new this.constructor(this),this.e+1,3)};Ue.greaterThan=Ue.gt=function(t){return this.cmp(t)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(t){var e=this.cmp(t);return e==1||e===0};Ue.hyperbolicCosine=Ue.cosh=function(){var t,e,r,n,i,a=this,s=a.constructor,o=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return o;r=s.precision,n=s.rounding,s.precision=r+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(t=Math.ceil(i/3),e=(1/Ig(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),a=vc(s,1,a.times(e),new s(1),!0);for(var u,l=t,c=new s(8);l--;)u=a.times(a),a=o.minus(u.times(c.minus(u.times(c))));return lt(a,s.precision=r,s.rounding=n,!0)};Ue.hyperbolicSine=Ue.sinh=function(){var t,e,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(e=a.precision,r=a.rounding,a.precision=e+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=vc(a,2,i,i,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,i=i.times(1/Ig(5,t)),i=vc(a,2,i,i,!0);for(var s,o=new a(5),u=new a(16),l=new a(20);t--;)s=i.times(i),i=i.times(o.plus(s.times(u.times(s).plus(l))))}return a.precision=e,a.rounding=r,lt(i,e,r,!0)};Ue.hyperbolicTangent=Ue.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,Cr(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)};Ue.inverseCosine=Ue.acos=function(){var t,e=this,r=e.constructor,n=e.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?e.isNeg()?wa(r,i,a):new r(0):new r(NaN):e.isZero()?wa(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,e=e.asin(),t=wa(r,i+4,a).times(.5),r.precision=i,r.rounding=a,t.minus(e))};Ue.inverseHyperbolicCosine=Ue.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,At=!1,r=r.times(r).minus(1).sqrt().plus(r),At=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)};Ue.inverseHyperbolicSine=Ue.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,At=!1,r=r.times(r).plus(1).sqrt().plus(r),At=!0,n.precision=t,n.rounding=e,r.ln())};Ue.inverseHyperbolicTangent=Ue.atanh=function(){var t,e,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=a.precision,e=a.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?lt(new a(i),t,e,!0):(a.precision=r=n-i.e,i=Cr(i.plus(1),new a(1).minus(i),r+t,1),a.precision=t+4,a.rounding=1,i=i.ln(),a.precision=t,a.rounding=e,i.times(.5))):new a(NaN)};Ue.inverseSine=Ue.asin=function(){var t,e,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(e=i.abs().cmp(1),r=a.precision,n=a.rounding,e!==-1?e===0?(t=wa(a,r+4,n).times(.5),t.s=i.s,t):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};Ue.inverseTangent=Ue.atan=function(){var t,e,r,n,i,a,s,o,u,l=this,c=l.constructor,f=c.precision,h=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&f+4<=Zb)return s=wa(c,f+4,h).times(.25),s.s=l.s,s}else{if(!l.s)return new c(NaN);if(f+4<=Zb)return s=wa(c,f+4,h).times(.5),s.s=l.s,s}for(c.precision=o=f+10,c.rounding=1,r=Math.min(28,o/mt+2|0),t=r;t;--t)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(At=!1,e=Math.ceil(o/mt),n=1,u=l.times(l),s=new c(l),i=l;t!==-1;)if(i=i.times(u),a=s.minus(i.div(n+=2)),i=i.times(u),s=a.plus(i.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===a.d[t]&&t--;);return r&&(s=s.times(2<this.d.length-2};Ue.isNaN=function(){return!this.s};Ue.isNegative=Ue.isNeg=function(){return this.s<0};Ue.isPositive=Ue.isPos=function(){return this.s>0};Ue.isZero=function(){return!!this.d&&this.d[0]===0};Ue.lessThan=Ue.lt=function(t){return this.cmp(t)<0};Ue.lessThanOrEqualTo=Ue.lte=function(t){return this.cmp(t)<1};Ue.logarithm=Ue.log=function(t){var e,r,n,i,a,s,o,u,l=this,c=l.constructor,f=c.precision,h=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new c(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(At=!1,o=f+p,s=Oo(l,o),n=e?Dv(c,o+10):Oo(t,o),u=Cr(s,n,o,1),Uh(u.d,i=f,h))do if(o+=10,s=Oo(l,o),n=e?Dv(c,o+10):Oo(t,o),u=Cr(s,n,o,1),!a){+Tn(u.d).slice(i+1,i+15)+1==1e14&&(u=lt(u,f+1,0));break}while(Uh(u.d,i+=10,h));return At=!0,lt(u,f,h)};Ue.minus=Ue.sub=function(t){var e,r,n,i,a,s,o,u,l,c,f,h,p=this,v=p.constructor;if(t=new v(t),!p.d||!t.d)return!p.s||!t.s?t=new v(NaN):p.d?t.s=-t.s:t=new v(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(l=p.d,h=t.d,o=v.precision,u=v.rounding,!l[0]||!h[0]){if(h[0])t.s=-t.s;else if(l[0])t=new v(p);else return new v(u===3?-0:0);return At?lt(t,o,u):t}if(r=Vn(t.e/mt),c=Vn(p.e/mt),l=l.slice(),a=c-r,a){for(f=a<0,f?(e=l,a=-a,s=h.length):(e=h,r=c,s=l.length),n=Math.max(Math.ceil(o/mt),s)+2,a>n&&(a=n,e.length=1),e.reverse(),n=a;n--;)e.push(0);e.reverse()}else{for(n=l.length,s=h.length,f=n0;--n)l[s++]=0;for(n=h.length;n>a;){if(l[--n]s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=c.length,s-i<0&&(i=s,r=c,c=l,l=r),e=0;i;)e=(l[--i]=l[i]+c[i]+e)/_a|0,l[i]%=_a;for(e&&(l.unshift(e),++n),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=Pg(l,n),At?lt(t,o,u):t};Ue.precision=Ue.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error($o+t);return r.d?(e=NB(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};Ue.round=function(){var t=this,e=t.constructor;return lt(new e(t),t.e+1,e.rounding)};Ue.sine=Ue.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+mt,n.rounding=1,r=Vre(n,TB(n,r)),n.precision=t,n.rounding=e,lt(Bs>2?r.neg():r,t,e,!0)):new n(NaN)};Ue.squareRoot=Ue.sqrt=function(){var t,e,r,n,i,a,s=this,o=s.d,u=s.e,l=s.s,c=s.constructor;if(l!==1||!o||!o[0])return new c(!l||l<0&&(!o||o[0])?NaN:o?s:1/0);for(At=!1,l=Math.sqrt(+s),l==0||l==1/0?(e=Tn(o),(e.length+u)%2==0&&(e+="0"),l=Math.sqrt(e),u=Vn((u+1)/2)-(u<0||u%2),l==1/0?e="5e"+u:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new c(e)):n=new c(l.toString()),r=(u=c.precision)+3;;)if(a=n,n=a.plus(Cr(s,a,r+2,1)).times(.5),Tn(a.d).slice(0,r)===(e=Tn(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!i&&e=="4999"){if(!i&&(lt(a,u+1,0),a.times(a).eq(s))){n=a;break}r+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(lt(n,u+1,1),t=!n.times(n).eq(s));break}return At=!0,lt(n,u,c.rounding,t)};Ue.tangent=Ue.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=Cr(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,lt(Bs==2||Bs==4?r.neg():r,t,e,!0)):new n(NaN)};Ue.times=Ue.mul=function(t){var e,r,n,i,a,s,o,u,l,c=this,f=c.constructor,h=c.d,p=(t=new f(t)).d;if(t.s*=c.s,!h||!h[0]||!p||!p[0])return new f(!t.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:!h||!p?t.s/0:t.s*0);for(r=Vn(c.e/mt)+Vn(t.e/mt),u=h.length,l=p.length,u=0;){for(e=0,i=u+n;i>n;)o=a[i]+p[n]*h[i-n-1]+e,a[i--]=o%_a|0,e=o/_a|0;a[i]=(a[i]+e)%_a|0}for(;!a[--s];)a.pop();return e?++r:a.shift(),t.d=a,t.e=Pg(a,r),At?lt(t,f.precision,f.rounding):t};Ue.toBinary=function(t,e){return fw(this,2,t,e)};Ue.toDecimalPlaces=Ue.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Si(t,0,Wo),e===void 0?e=n.rounding:Si(e,0,8),lt(r,t+r.e+1,e))};Ue.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ga(n,!0):(Si(t,0,Wo),e===void 0?e=i.rounding:Si(e,0,8),n=lt(new i(n),t+1,e),r=Ga(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r};Ue.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?r=Ga(i):(Si(t,0,Wo),e===void 0?e=a.rounding:Si(e,0,8),n=lt(new a(i),t+i.e+1,e),r=Ga(n,!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};Ue.toFraction=function(t){var e,r,n,i,a,s,o,u,l,c,f,h,p=this,v=p.d,m=p.constructor;if(!v)return new m(p);if(l=r=new m(1),n=u=new m(0),e=new m(n),a=e.e=NB(v)-p.e-1,s=a%mt,e.d[0]=fn(10,s<0?mt+s:s),t==null)t=a>0?e:l;else{if(o=new m(t),!o.isInt()||o.lt(l))throw Error($o+o);t=o.gt(e)?a>0?e:l:o}for(At=!1,o=new m(Tn(v)),c=m.precision,m.precision=a=v.length*mt*2;f=Cr(o,e,0,1,1),i=r.plus(f.times(n)),i.cmp(t)!=1;)r=n,n=i,i=l,l=u.plus(f.times(i)),u=i,i=e,e=o.minus(f.times(i)),o=i;return i=Cr(t.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=p.s,h=Cr(l,n,a,1).minus(p).abs().cmp(Cr(u,r,a,1).minus(p).abs())<1?[l,n]:[u,r],m.precision=c,At=!0,h};Ue.toHexadecimal=Ue.toHex=function(t,e){return fw(this,16,t,e)};Ue.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:Si(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(At=!1,r=Cr(r,t,0,e,1).times(t),At=!0,lt(r)):(t.s=r.s,r=t),r};Ue.toNumber=function(){return+this};Ue.toOctal=function(t,e){return fw(this,8,t,e)};Ue.toPower=Ue.pow=function(t){var e,r,n,i,a,s,o=this,u=o.constructor,l=+(t=new u(t));if(!o.d||!t.d||!o.d[0]||!t.d[0])return new u(fn(+o,l));if(o=new u(o),o.eq(1))return o;if(n=u.precision,a=u.rounding,t.eq(1))return lt(o,n,a);if(e=Vn(t.e/mt),e>=t.d.length-1&&(r=l<0?-l:l)<=Ure)return i=EB(u,o,r,n),t.s<0?new u(1).div(i):lt(i,n,a);if(s=o.s,s<0){if(eu.maxE+1||e0?s/0:0):(At=!1,u.rounding=o.s=1,r=Math.min(12,(e+"").length),i=Kb(t.times(Oo(o,n+r)),n),i.d&&(i=lt(i,n+5,1),Uh(i.d,n,a)&&(e=n+10,i=lt(Kb(t.times(Oo(o,e+r)),e),e+5,1),+Tn(i.d).slice(n+1,n+15)+1==1e14&&(i=lt(i,n+1,0)))),i.s=s,At=!0,u.rounding=a,lt(i,n,a))};Ue.toPrecision=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Ga(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Si(t,1,Wo),e===void 0?e=i.rounding:Si(e,0,8),n=lt(new i(n),t,e),r=Ga(n,t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r};Ue.toSignificantDigits=Ue.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Si(t,1,Wo),e===void 0?e=n.rounding:Si(e,0,8)),lt(new n(r),t,e)};Ue.toString=function(){var t=this,e=t.constructor,r=Ga(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};Ue.truncated=Ue.trunc=function(){return lt(new this.constructor(this),this.e+1,1)};Ue.valueOf=Ue.toJSON=function(){var t=this,e=t.constructor,r=Ga(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function Tn(t){var e,r,n,i=t.length-1,a="",s=t[0];if(i>0){for(a+=s,e=1;er)throw Error($o+t)}function Uh(t,e,r,n){var i,a,s,o;for(a=t[0];a>=10;a/=10)--e;return--e<0?(e+=mt,i=0):(i=Math.ceil((e+1)/mt),e%=mt),a=fn(10,mt-e),o=t[i]%a|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),s=r<4&&o==99999||r>3&&o==49999||o==5e4||o==0):s=(r<4&&o+1==a||r>3&&o+1==a/2)&&(t[i+1]/a/100|0)==fn(10,e-2)-1||(o==a/2||o==0)&&(t[i+1]/a/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),s=(n||r<4)&&o==9999||!n&&r>3&&o==4999):s=((n||r<4)&&o+1==a||!n&&r>3&&o+1==a/2)&&(t[i+1]/a/1e3|0)==fn(10,e-3)-1,s}function Bm(t,e,r){for(var n,i=[0],a,s=0,o=t.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Hre(t,e){var r,n,i;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),i=(1/Ig(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),t.precision+=r,e=vc(t,1,e.times(i),new t(1));for(var a=r;a--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var Cr=function(){function t(n,i,a){var s,o=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+o,n[u]=s%a|0,o=s/a|0;return o&&n.unshift(o),n}function e(n,i,a,s){var o,u;if(a!=s)u=a>s?1:-1;else for(o=u=0;oi[o]?1:-1;break}return u}function r(n,i,a,s){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,s,o,u){var l,c,f,h,p,v,m,b,y,S,x,A,_,w,C,E,N,M,O,F,U=n.constructor,V=n.s==i.s?1:-1,H=n.d,I=i.d;if(!H||!H[0]||!I||!I[0])return new U(!n.s||!i.s||(H?I&&H[0]==I[0]:!I)?NaN:H&&H[0]==0||!I?V*0:V/0);for(u?(p=1,c=n.e-i.e):(u=_a,p=mt,c=Vn(n.e/p)-Vn(i.e/p)),O=I.length,N=H.length,y=new U(V),S=y.d=[],f=0;I[f]==(H[f]||0);f++);if(I[f]>(H[f]||0)&&c--,a==null?(w=a=U.precision,s=U.rounding):o?w=a+(n.e-i.e)+1:w=a,w<0)S.push(1),v=!0;else{if(w=w/p+2|0,f=0,O==1){for(h=0,I=I[0],w++;(f1&&(I=t(I,h,u),H=t(H,h,u),O=I.length,N=H.length),E=O,x=H.slice(0,O),A=x.length;A=u/2&&++M;do h=0,l=e(I,x,O,A),l<0?(_=x[0],O!=A&&(_=_*u+(x[1]||0)),h=_/M|0,h>1?(h>=u&&(h=u-1),m=t(I,h,u),b=m.length,A=x.length,l=e(m,x,b,A),l==1&&(h--,r(m,O=10;h/=10)f++;y.e=f+c*p-1,lt(y,o?a+y.e+1:a,s,v)}return y}}();function lt(t,e,r,n){var i,a,s,o,u,l,c,f,h,p=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(i=1,o=f[0];o>=10;o/=10)i++;if(a=e-i,a<0)a+=mt,s=e,c=f[h=0],u=c/fn(10,i-s-1)%10|0;else if(h=Math.ceil((a+1)/mt),o=f.length,h>=o)if(n){for(;o++<=h;)f.push(0);c=u=0,i=1,a%=mt,s=a-mt+1}else break e;else{for(c=o=f[h],i=1;o>=10;o/=10)i++;a%=mt,s=a-mt+i,u=s<0?0:c/fn(10,i-s-1)%10|0}if(n=n||e<0||f[h+1]!==void 0||(s<0?c:c%fn(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(t.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(a>0?s>0?c/fn(10,i-s):0:f[h-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,l?(e-=t.e+1,f[0]=fn(10,(mt-e%mt)%mt),t.e=-e||0):f[0]=t.e=0,t;if(a==0?(f.length=h,o=1,h--):(f.length=h+1,o=fn(10,mt-a),f[h]=s>0?(c/fn(10,i-s)%fn(10,s)|0)*o:0),l)for(;;)if(h==0){for(a=1,s=f[0];s>=10;s/=10)a++;for(s=f[0]+=o,o=1;s>=10;s/=10)o++;a!=o&&(t.e++,f[0]==_a&&(f[0]=1));break}else{if(f[h]+=o,f[h]!=_a)break;f[h--]=0,o=1}for(a=f.length;f[--a]===0;)f.pop()}return At&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?a=a.charAt(0)+"."+a.slice(1)+wo(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(t.e<0?"e":"e+")+t.e):i<0?(a="0."+wo(-i-1)+a,r&&(n=r-s)>0&&(a+=wo(n))):i>=s?(a+=wo(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+wo(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=wo(n))),a}function Pg(t,e){var r=t[0];for(e*=mt;r>=10;r/=10)e++;return e}function Dv(t,e,r){if(e>qre)throw At=!0,r&&(t.precision=r),Error(SB);return lt(new t(_v),e,1,!0)}function wa(t,e,r){if(e>Zb)throw Error(SB);return lt(new t(Av),e,r,!0)}function NB(t){var e=t.length-1,r=e*mt+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function wo(t){for(var e="";t--;)e+="0";return e}function EB(t,e,r,n){var i,a=new t(1),s=Math.ceil(n/mt+4);for(At=!1;;){if(r%2&&(a=a.times(e),T2(a.d,s)&&(i=!0)),r=Vn(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}e=e.times(e),T2(e.d,s)}return At=!0,a}function M2(t){return t.d[t.d.length-1]&1}function CB(t,e,r){for(var n,i=new t(e[0]),a=0;++a17)return new h(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:0/0);for(e==null?(At=!1,u=v):u=e,o=new h(.03125);t.e>-2;)t=t.times(o),f+=5;for(n=Math.log(fn(2,f))/Math.LN10*2+5|0,u+=n,r=a=s=new h(1),h.precision=u;;){if(a=lt(a.times(t),u,1),r=r.times(++c),o=s.plus(Cr(a,r,u,1)),Tn(o.d).slice(0,u)===Tn(s.d).slice(0,u)){for(i=f;i--;)s=lt(s.times(s),u,1);if(e==null)if(l<3&&Uh(s.d,u-n,p,l))h.precision=u+=10,r=a=o=new h(1),c=0,l++;else return lt(s,h.precision=v,p,At=!0);else return h.precision=v,s}s=o}}function Oo(t,e){var r,n,i,a,s,o,u,l,c,f,h,p=1,v=10,m=t,b=m.d,y=m.constructor,S=y.rounding,x=y.precision;if(m.s<0||!b||!b[0]||!m.e&&b[0]==1&&b.length==1)return new y(b&&!b[0]?-1/0:m.s!=1?NaN:b?0:m);if(e==null?(At=!1,c=x):c=e,y.precision=c+=v,r=Tn(b),n=r.charAt(0),Math.abs(a=m.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(t),r=Tn(m.d),n=r.charAt(0),p++;a=m.e,n>1?(m=new y("0."+r),a++):m=new y(n+"."+r.slice(1))}else return l=Dv(y,c+2,x).times(a+""),m=Oo(new y(n+"."+r.slice(1)),c-v).plus(l),y.precision=x,e==null?lt(m,x,S,At=!0):m;for(f=m,u=s=m=Cr(m.minus(1),m.plus(1),c,1),h=lt(m.times(m),c,1),i=3;;){if(s=lt(s.times(h),c,1),l=u.plus(Cr(s,new y(i),c,1)),Tn(l.d).slice(0,c)===Tn(u.d).slice(0,c))if(u=u.times(2),a!==0&&(u=u.plus(Dv(y,c+2,x).times(a+""))),u=Cr(u,new y(p),c,1),e==null)if(Uh(u.d,c-v,S,o))y.precision=c+=v,l=s=m=Cr(f.minus(1),f.plus(1),c,1),h=lt(m.times(m),c,1),i=o=1;else return lt(u,y.precision=x,S,At=!0);else return y.precision=x,u;u=l,i+=2}}function MB(t){return String(t.s*t.s/0)}function Jb(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%mt,r<0&&(n+=mt),nt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),DB.test(e))return Jb(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if($re.test(e))r=16,e=e.toLowerCase();else if(Lre.test(e))r=2;else if(zre.test(e))r=8;else throw Error($o+e);for(a=e.search(/p/i),a>0?(u=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),a=e.indexOf("."),s=a>=0,n=t.constructor,s&&(e=e.replace(".",""),o=e.length,a=o-a,i=EB(n,new n(r),a,a*2)),l=Bm(e,r,_a),c=l.length-1,a=c;l[a]===0;--a)l.pop();return a<0?new n(t.s*0):(t.e=Pg(l,c),t.d=l,At=!1,s&&(t=Cr(t,i,o*4)),u&&(t=t.times(Math.abs(u)<54?fn(2,u):zo.pow(2,u))),At=!0,t)}function Vre(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:vc(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/Ig(5,r)),e=vc(t,2,e,e);for(var i,a=new t(5),s=new t(16),o=new t(20);r--;)i=e.times(e),e=e.times(a.plus(i.times(s.times(i).minus(o))));return e}function vc(t,e,r,n,i){var a,s,o,u,l=t.precision,c=Math.ceil(l/mt);for(At=!1,u=r.times(r),o=new t(n);;){if(s=Cr(o.times(u),new t(e++*e++),l,1),o=i?n.plus(s):n.minus(s),n=Cr(s.times(u),new t(e++*e++),l,1),s=o.plus(n),s.d[c]!==void 0){for(a=c;s.d[a]===o.d[a]&&a--;);if(a==-1)break}a=o,o=n,n=s,s=a}return At=!0,s.d.length=c+1,s}function Ig(t,e){for(var r=t;--e;)r*=t;return r}function TB(t,e){var r,n=e.s<0,i=wa(t,t.precision,1),a=i.times(.5);if(e=e.abs(),e.lte(a))return Bs=n?4:1,e;if(r=e.divToInt(i),r.isZero())Bs=n?3:2;else{if(e=e.minus(r.times(i)),e.lte(a))return Bs=M2(r)?n?2:3:n?4:1,e;Bs=M2(r)?n?1:4:n?3:2}return e.minus(i).abs()}function fw(t,e,r,n){var i,a,s,o,u,l,c,f,h,p=t.constructor,v=r!==void 0;if(v?(Si(r,1,Wo),n===void 0?n=p.rounding:Si(n,0,8)):(r=p.precision,n=p.rounding),!t.isFinite())c=MB(t);else{for(c=Ga(t),s=c.indexOf("."),v?(i=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):i=e,s>=0&&(c=c.replace(".",""),h=new p(1),h.e=c.length-s,h.d=Bm(Ga(h),10,i),h.e=h.d.length),f=Bm(c,10,i),a=u=f.length;f[--u]==0;)f.pop();if(!f[0])c=v?"0p+0":"0";else{if(s<0?a--:(t=new p(t),t.d=f,t.e=a,t=Cr(t,h,r,n,0,i),f=t.d,a=t.e,l=wB),s=f[r],o=i/2,l=l||f[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(t.s<0?3:2)):s>o||s===o&&(n===4||l||n===6&&f[r-1]&1||n===(t.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(u=f.length;!f[u-1];--u);for(s=0,c="";s1)if(e==16||e==8){for(s=e==16?4:3,--u;u%s;u++)c+="0";for(f=Bm(c,i,e),u=f.length;!f[u-1];--u);for(s=1,c="1.";su)for(a-=u;a--;)c+="0";else ae)return t.length=e,!0}function Yre(t){return new this(t).abs()}function jre(t){return new this(t).acos()}function Gre(t){return new this(t).acosh()}function Xre(t,e){return new this(t).plus(e)}function Zre(t){return new this(t).asin()}function Kre(t){return new this(t).asinh()}function Jre(t){return new this(t).atan()}function Qre(t){return new this(t).atanh()}function ene(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,a=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=wa(this,a,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?wa(this,n,i):new this(0),r.s=t.s):!t.d||e.isZero()?(r=wa(this,a,1).times(.5),r.s=t.s):e.s<0?(this.precision=a,this.rounding=1,r=this.atan(Cr(t,e,a,1)),e=wa(this,a,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(Cr(t,e,a,1)),r}function tne(t){return new this(t).cbrt()}function rne(t){return lt(t=new this(t),t.e+1,2)}function nne(t,e,r){return new this(t).clamp(e,r)}function ine(t){if(!t||typeof t!="object")throw Error(Bg+"Object expected");var e,r,n,i=t.defaults===!0,a=["precision",1,Wo,"rounding",0,8,"toExpNeg",-Ul,0,"toExpPos",0,Ul,"maxE",0,Ul,"minE",-Ul,0,"modulo",0,9];for(e=0;e=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error($o+r+": "+n);if(r="crypto",i&&(this[r]=Xb[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(_B);else this[r]=!1;else throw Error($o+r+": "+n);return this}function ane(t){return new this(t).cos()}function sne(t){return new this(t).cosh()}function OB(t){var e,r,n;function i(a){var s,o,u,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,O2(a)){l.s=a.s,At?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e=10;o/=10)s++;At?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?e[a]=crypto.getRandomValues(new Uint32Array(1))[0]:o[a++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(e,a):(o.push(i%1e7),a+=4);a=n/4}else throw Error(_B);else for(;a=10;i/=10)n++;n{var{on:e,config:r}=t,n=zo.clone({precision:r.precision,modulo:zo.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},e&&e("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),Qb={},Bne={get exports(){return Qb},set exports(t){Qb=t}};/** * @license Complex.js v2.1.1 12/05/2020 * * Copyright (c) 2020, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/(function(t,e){(function(r){var n=Math.cosh||function(f){return Math.abs(f)<1e-9?1-f:(Math.exp(f)+Math.exp(-f))*.5},i=Math.sinh||function(f){return Math.abs(f)<1e-9?f:(Math.exp(f)-Math.exp(-f))*.5},a=function(f){var h=Math.PI/4;if(-h>f||f>h)return Math.cos(f)-1;var p=f*f;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},s=function(f,h){var p=Math.abs(f),v=Math.abs(h);return p<3e3&&v<3e3?Math.sqrt(p*p+v*v):(p0&&o();break;case"number":p.im=0,p.re=f;break;default:o()}return isNaN(p.re)||isNaN(p.im),p};function c(f,h){if(!(this instanceof c))return new c(f,h);var p=l(f,h);this.re=p.re,this.im=p.im}c.prototype={re:0,im:0,sign:function(){var f=this.abs();return new c(this.re/f,this.im/f)},add:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re+p.re,this.im+p.im)},sub:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re-p.re,this.im-p.im)},mul:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:p.im===0&&this.im===0?new c(this.re*p.re,0):new c(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(f,h){var p=new c(f,h);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return c.NAN;if(this.isInfinite()||p.isZero())return c.INFINITY;if(this.isZero()||p.isInfinite())return c.ZERO;f=this.re,h=this.im;var v=p.re,m=p.im,b,y;return m===0?new c(f/v,h/v):Math.abs(v)0)return new c(Math.pow(f,p.re),0);if(f===0)switch((p.re%4+4)%4){case 0:return new c(Math.pow(h,p.re),0);case 1:return new c(0,Math.pow(h,p.re));case 2:return new c(-Math.pow(h,p.re),0);case 3:return new c(0,-Math.pow(h,p.re))}}if(f===0&&h===0&&p.re>0&&p.im>=0)return c.ZERO;var v=Math.atan2(h,f),m=u(f,h);return f=Math.exp(p.re*m-p.im*v),h=p.im*m+p.re*v,new c(f*Math.cos(h),f*Math.sin(h))},sqrt:function(){var f=this.re,h=this.im,p=this.abs(),v,m;if(f>=0){if(h===0)return new c(Math.sqrt(f),0);v=.5*Math.sqrt(2*(p+f))}else v=Math.abs(h)/Math.sqrt(2*(p-f));return f<=0?m=.5*Math.sqrt(2*(p-f)):m=Math.abs(h)/Math.sqrt(2*(p+f)),new c(v,h<0?-m:m)},exp:function(){var f=Math.exp(this.re);return this.im,new c(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,h=this.im;return new c(Math.expm1(f)*Math.cos(h)+a(h),Math.exp(f)*Math.sin(h))},log:function(){var f=this.re,h=this.im;return new c(u(f,h),Math.atan2(h,f))},abs:function(){return s(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,h=this.im;return new c(Math.sin(f)*n(h),Math.cos(f)*i(h))},cos:function(){var f=this.re,h=this.im;return new c(Math.cos(f)*n(h),-Math.sin(f)*i(h))},tan:function(){var f=2*this.re,h=2*this.im,p=Math.cos(f)+n(h);return new c(Math.sin(f)/p,i(h)/p)},cot:function(){var f=2*this.re,h=2*this.im,p=Math.cos(f)-n(h);return new c(-Math.sin(f)/p,i(h)/p)},sec:function(){var f=this.re,h=this.im,p=.5*n(2*h)+.5*Math.cos(2*f);return new c(Math.cos(f)*n(h)/p,Math.sin(f)*i(h)/p)},csc:function(){var f=this.re,h=this.im,p=.5*n(2*h)-.5*Math.cos(2*f);return new c(Math.sin(f)*n(h)/p,-Math.cos(f)*i(h)/p)},asin:function(){var f=this.re,h=this.im,p=new c(h*h-f*f+1,-2*f*h).sqrt(),v=new c(p.re-h,p.im+f).log();return new c(v.im,-v.re)},acos:function(){var f=this.re,h=this.im,p=new c(h*h-f*f+1,-2*f*h).sqrt(),v=new c(p.re-h,p.im+f).log();return new c(Math.PI/2-v.im,v.re)},atan:function(){var f=this.re,h=this.im;if(f===0){if(h===1)return new c(0,1/0);if(h===-1)return new c(0,-1/0)}var p=f*f+(1-h)*(1-h),v=new c((1-h*h-f*f)/p,-2*f/p).log();return new c(-.5*v.im,.5*v.re)},acot:function(){var f=this.re,h=this.im;if(h===0)return new c(Math.atan2(1,f),0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).atan():new c(f!==0?f/0:0,h!==0?-h/0:0).atan()},asec:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(0,1/0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).acos():new c(f!==0?f/0:0,h!==0?-h/0:0).acos()},acsc:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(Math.PI/2,1/0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).asin():new c(f!==0?f/0:0,h!==0?-h/0:0).asin()},sinh:function(){var f=this.re,h=this.im;return new c(i(f)*Math.cos(h),n(f)*Math.sin(h))},cosh:function(){var f=this.re,h=this.im;return new c(n(f)*Math.cos(h),i(f)*Math.sin(h))},tanh:function(){var f=2*this.re,h=2*this.im,p=n(f)+Math.cos(h);return new c(i(f)/p,Math.sin(h)/p)},coth:function(){var f=2*this.re,h=2*this.im,p=n(f)-Math.cos(h);return new c(i(f)/p,-Math.sin(h)/p)},csch:function(){var f=this.re,h=this.im,p=Math.cos(2*h)-n(2*f);return new c(-2*i(f)*Math.cos(h)/p,2*n(f)*Math.sin(h)/p)},sech:function(){var f=this.re,h=this.im,p=Math.cos(2*h)+n(2*f);return new c(2*n(f)*Math.cos(h)/p,-2*i(f)*Math.sin(h)/p)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var h=this.asin();return this.re=-this.im,this.im=f,f=h.re,h.re=-h.im,h.im=f,h},acosh:function(){var f=this.acos();if(f.im<=0){var h=f.re;f.re=-f.im,f.im=h}else{var h=f.im;f.im=-f.re,f.re=h}return f},atanh:function(){var f=this.re,h=this.im,p=f>1&&h===0,v=1-f,m=1+f,b=v*v+h*h,y=b!==0?new c((m*v-h*h)/b,(h*v+m*h)/b):new c(f!==-1?f/0:0,h!==0?h/0:0),S=y.re;return y.re=u(y.re,y.im)/2,y.im=Math.atan2(y.im,S)/2,p&&(y.im=-y.im),y},acoth:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(0,Math.PI/2);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).atanh():new c(f!==0?f/0:0,h!==0?-h/0:0).atanh()},acsch:function(){var f=this.re,h=this.im;if(h===0)return new c(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).asinh():new c(f!==0?f/0:0,h!==0?-h/0:0).asinh()},asech:function(){var f=this.re,h=this.im;if(this.isZero())return c.INFINITY;var p=f*f+h*h;return p!==0?new c(f/p,-h/p).acosh():new c(f!==0?f/0:0,h!==0?-h/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var f=this.re,h=this.im,p=f*f+h*h;return new c(f/p,-h/p)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new c(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new c(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new c(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,h){var p=new c(f,h);return Math.abs(p.re-this.re)<=c.EPSILON&&Math.abs(p.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var f=this.re,h=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)(Object.defineProperty(En,"name",{value:"Complex"}),En.prototype.constructor=En,En.prototype.type="Complex",En.prototype.isComplex=!0,En.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},En.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},En.prototype.format=function(t){var e="",r=this.im,n=this.re,i=Ru(this.re,t),a=Ru(this.im,t),s=Ct(t)?t:t?t.precision:null;if(s!==null){var o=Math.pow(10,-s);Math.abs(n/r)e.re?1:t.ree.im?1:t.im0&&o();break;case"number":p.im=0,p.re=f;break;default:o()}return isNaN(p.re)||isNaN(p.im),p};function c(f,h){if(!(this instanceof c))return new c(f,h);var p=l(f,h);this.re=p.re,this.im=p.im}c.prototype={re:0,im:0,sign:function(){var f=this.abs();return new c(this.re/f,this.im/f)},add:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re+p.re,this.im+p.im)},sub:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:new c(this.re-p.re,this.im-p.im)},mul:function(f,h){var p=new c(f,h);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?c.NAN:this.isInfinite()||p.isInfinite()?c.INFINITY:p.im===0&&this.im===0?new c(this.re*p.re,0):new c(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(f,h){var p=new c(f,h);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return c.NAN;if(this.isInfinite()||p.isZero())return c.INFINITY;if(this.isZero()||p.isInfinite())return c.ZERO;f=this.re,h=this.im;var v=p.re,m=p.im,b,y;return m===0?new c(f/v,h/v):Math.abs(v)0)return new c(Math.pow(f,p.re),0);if(f===0)switch((p.re%4+4)%4){case 0:return new c(Math.pow(h,p.re),0);case 1:return new c(0,Math.pow(h,p.re));case 2:return new c(-Math.pow(h,p.re),0);case 3:return new c(0,-Math.pow(h,p.re))}}if(f===0&&h===0&&p.re>0&&p.im>=0)return c.ZERO;var v=Math.atan2(h,f),m=u(f,h);return f=Math.exp(p.re*m-p.im*v),h=p.im*m+p.re*v,new c(f*Math.cos(h),f*Math.sin(h))},sqrt:function(){var f=this.re,h=this.im,p=this.abs(),v,m;if(f>=0){if(h===0)return new c(Math.sqrt(f),0);v=.5*Math.sqrt(2*(p+f))}else v=Math.abs(h)/Math.sqrt(2*(p-f));return f<=0?m=.5*Math.sqrt(2*(p-f)):m=Math.abs(h)/Math.sqrt(2*(p+f)),new c(v,h<0?-m:m)},exp:function(){var f=Math.exp(this.re);return this.im,new c(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,h=this.im;return new c(Math.expm1(f)*Math.cos(h)+a(h),Math.exp(f)*Math.sin(h))},log:function(){var f=this.re,h=this.im;return new c(u(f,h),Math.atan2(h,f))},abs:function(){return s(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,h=this.im;return new c(Math.sin(f)*n(h),Math.cos(f)*i(h))},cos:function(){var f=this.re,h=this.im;return new c(Math.cos(f)*n(h),-Math.sin(f)*i(h))},tan:function(){var f=2*this.re,h=2*this.im,p=Math.cos(f)+n(h);return new c(Math.sin(f)/p,i(h)/p)},cot:function(){var f=2*this.re,h=2*this.im,p=Math.cos(f)-n(h);return new c(-Math.sin(f)/p,i(h)/p)},sec:function(){var f=this.re,h=this.im,p=.5*n(2*h)+.5*Math.cos(2*f);return new c(Math.cos(f)*n(h)/p,Math.sin(f)*i(h)/p)},csc:function(){var f=this.re,h=this.im,p=.5*n(2*h)-.5*Math.cos(2*f);return new c(Math.sin(f)*n(h)/p,-Math.cos(f)*i(h)/p)},asin:function(){var f=this.re,h=this.im,p=new c(h*h-f*f+1,-2*f*h).sqrt(),v=new c(p.re-h,p.im+f).log();return new c(v.im,-v.re)},acos:function(){var f=this.re,h=this.im,p=new c(h*h-f*f+1,-2*f*h).sqrt(),v=new c(p.re-h,p.im+f).log();return new c(Math.PI/2-v.im,v.re)},atan:function(){var f=this.re,h=this.im;if(f===0){if(h===1)return new c(0,1/0);if(h===-1)return new c(0,-1/0)}var p=f*f+(1-h)*(1-h),v=new c((1-h*h-f*f)/p,-2*f/p).log();return new c(-.5*v.im,.5*v.re)},acot:function(){var f=this.re,h=this.im;if(h===0)return new c(Math.atan2(1,f),0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).atan():new c(f!==0?f/0:0,h!==0?-h/0:0).atan()},asec:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(0,1/0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).acos():new c(f!==0?f/0:0,h!==0?-h/0:0).acos()},acsc:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(Math.PI/2,1/0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).asin():new c(f!==0?f/0:0,h!==0?-h/0:0).asin()},sinh:function(){var f=this.re,h=this.im;return new c(i(f)*Math.cos(h),n(f)*Math.sin(h))},cosh:function(){var f=this.re,h=this.im;return new c(n(f)*Math.cos(h),i(f)*Math.sin(h))},tanh:function(){var f=2*this.re,h=2*this.im,p=n(f)+Math.cos(h);return new c(i(f)/p,Math.sin(h)/p)},coth:function(){var f=2*this.re,h=2*this.im,p=n(f)-Math.cos(h);return new c(i(f)/p,-Math.sin(h)/p)},csch:function(){var f=this.re,h=this.im,p=Math.cos(2*h)-n(2*f);return new c(-2*i(f)*Math.cos(h)/p,2*n(f)*Math.sin(h)/p)},sech:function(){var f=this.re,h=this.im,p=Math.cos(2*h)+n(2*f);return new c(2*n(f)*Math.cos(h)/p,-2*i(f)*Math.sin(h)/p)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var h=this.asin();return this.re=-this.im,this.im=f,f=h.re,h.re=-h.im,h.im=f,h},acosh:function(){var f=this.acos();if(f.im<=0){var h=f.re;f.re=-f.im,f.im=h}else{var h=f.im;f.im=-f.re,f.re=h}return f},atanh:function(){var f=this.re,h=this.im,p=f>1&&h===0,v=1-f,m=1+f,b=v*v+h*h,y=b!==0?new c((m*v-h*h)/b,(h*v+m*h)/b):new c(f!==-1?f/0:0,h!==0?h/0:0),S=y.re;return y.re=u(y.re,y.im)/2,y.im=Math.atan2(y.im,S)/2,p&&(y.im=-y.im),y},acoth:function(){var f=this.re,h=this.im;if(f===0&&h===0)return new c(0,Math.PI/2);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).atanh():new c(f!==0?f/0:0,h!==0?-h/0:0).atanh()},acsch:function(){var f=this.re,h=this.im;if(h===0)return new c(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var p=f*f+h*h;return p!==0?new c(f/p,-h/p).asinh():new c(f!==0?f/0:0,h!==0?-h/0:0).asinh()},asech:function(){var f=this.re,h=this.im;if(this.isZero())return c.INFINITY;var p=f*f+h*h;return p!==0?new c(f/p,-h/p).acosh():new c(f!==0?f/0:0,h!==0?-h/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var f=this.re,h=this.im,p=f*f+h*h;return new c(f/p,-h/p)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new c(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new c(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new c(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,h){var p=new c(f,h);return Math.abs(p.re-this.re)<=c.EPSILON&&Math.abs(p.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var f=this.re,h=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)(Object.defineProperty(En,"name",{value:"Complex"}),En.prototype.constructor=En,En.prototype.type="Complex",En.prototype.isComplex=!0,En.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},En.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},En.prototype.format=function(t){var e="",r=this.im,n=this.re,i=Bu(this.re,t),a=Bu(this.im,t),s=Ct(t)?t:t?t.precision:null;if(s!==null){var o=Math.pow(10,-s);Math.abs(n/r)e.re?1:t.ree.im?1:t.im1&&(S[x]=(S[x]||0)+1):S[y]=(S[y]||0)+1,S}var u=function(y,S){var x=0,A=1,_=1,w=0,C=0,E=0,N=1,M=1,O=0,F=1,U=1,V=1,H=1e7,I;if(y!=null)if(S!==void 0){if(x=y,A=S,_=x*A,x%1!==0||A%1!==0)throw b()}else switch(typeof y){case"object":{if("d"in y&&"n"in y)x=y.n,A=y.d,"s"in y&&(x*=y.s);else if(0 in y)x=y[0],1 in y&&(A=y[1]);else throw m();_=x*A;break}case"number":{if(y<0&&(_=y,y=-y),y%1===0)x=y;else if(y>0){for(y>=1&&(M=Math.pow(10,Math.floor(1+Math.log(y)/Math.LN10)),y/=M);F<=H&&V<=H;)if(I=(O+U)/(F+V),y===I){F+V<=H?(x=O+U,A=F+V):V>F?(x=U,A=V):(x=O,A=F);break}else y>I?(O+=U,F+=V):(U+=O,V+=F),F>H?(x=U,A=V):(x=O,A=F);x*=M}else(isNaN(y)||isNaN(S))&&(A=x=NaN);break}case"string":{if(F=y.match(/\d+|./g),F===null)throw m();if(F[O]==="-"?(_=-1,O++):F[O]==="+"&&O++,F.length===O+1?C=a(F[O++],_):F[O+1]==="."||F[O]==="."?(F[O]!=="."&&(w=a(F[O++],_)),O++,(O+1===F.length||F[O+1]==="("&&F[O+3]===")"||F[O+1]==="'"&&F[O+3]==="'")&&(C=a(F[O],_),N=Math.pow(10,F[O].length),O++),(F[O]==="("&&F[O+2]===")"||F[O]==="'"&&F[O+2]==="'")&&(E=a(F[O+1],_),M=Math.pow(10,F[O+1].length)-1,O+=3)):F[O+1]==="/"||F[O+1]===":"?(C=a(F[O],_),N=a(F[O+2],1),O+=3):F[O+3]==="/"&&F[O+1]===" "&&(w=a(F[O],_),C=a(F[O+2],_),N=a(F[O+4],1),O+=5),F.length<=O){A=N*M,_=x=E+A*w+M*C;break}}default:throw m()}if(A===0)throw v();i.s=_<0?-1:1,i.n=Math.abs(x),i.d=Math.abs(A)};function l(y,S,x){for(var A=1;S>0;y=y*y%x,S>>=1)S&1&&(A=A*y%x);return A}function c(y,S){for(;S%2===0;S/=2);for(;S%5===0;S/=5);if(S===1)return 0;for(var x=10%S,A=1;x!==1;A++)if(x=x*10%S,A>n)return 0;return A}function f(y,S,x){for(var A=1,_=l(10,x,S),w=0;w<300;w++){if(A===_)return w;A=A*10%S,_=_*10%S}return 0}function h(y,S){if(!y)return S;if(!S)return y;for(;;){if(y%=S,!y)return S;if(S%=y,!S)return y}}function p(y,S){if(u(y,S),this instanceof p)y=h(i.d,i.n),this.s=i.s,this.n=i.n/y,this.d=i.d/y;else return s(i.s*i.n,i.d)}var v=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},b=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(y,S){return u(y,S),s(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(y,S){return u(y,S),s(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(y,S){return u(y,S),s(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(y,S){return u(y,S),s(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(y,S){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(y===void 0)return s(this.s*this.n%this.d,1);if(u(y,S),i.n===0&&this.d===0)throw v();return s(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(y,S){return u(y,S),s(h(i.n,this.n)*h(i.d,this.d),i.d*this.d)},lcm:function(y,S){return u(y,S),i.n===0&&this.n===0?s(0,1):s(i.n*this.n,h(i.n,this.n)*h(i.d,this.d))},ceil:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.ceil(y*this.s*this.n/this.d),y)},floor:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.floor(y*this.s*this.n/this.d),y)},round:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.round(y*this.s*this.n/this.d),y)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(y,S){if(u(y,S),i.d===1)return i.s<0?s(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):s(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var x=o(this.n),A=o(this.d),_=1,w=1;for(var C in x)if(C!=="1"){if(C==="0"){_=0;break}if(x[C]*=i.n,x[C]%i.d===0)x[C]/=i.d;else return null;_*=Math.pow(C,x[C])}for(var C in A)if(C!=="1"){if(A[C]*=i.n,A[C]%i.d===0)A[C]/=i.d;else return null;w*=Math.pow(C,A[C])}return i.s<0?s(w,_):s(_,w)},equals:function(y,S){return u(y,S),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(y,S){u(y,S);var x=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;w--)_=_.inverse().add(x[w]);if(Math.abs(_.sub(S).valueOf())0&&(x+=S,x+=" ",A%=_),x+=A,x+="/",x+=_),x},toLatex:function(y){var S,x="",A=this.n,_=this.d;return this.s<0&&(x+="-"),_===1?x+=A:(y&&(S=Math.floor(A/_))>0&&(x+=S,A%=_),x+="\\frac{",x+=A,x+="}{",x+=_,x+="}"),x},toContinued:function(){var y,S=this.n,x=this.d,A=[];if(isNaN(S)||isNaN(x))return A;do A.push(Math.floor(S/x)),y=S%x,S=x,x=y;while(S!==1);return A},toString:function(y){var S=this.n,x=this.d;if(isNaN(S)||isNaN(x))return"NaN";y=y||15;var A=c(S,x),_=f(S,x,A),w=this.s<0?"-":"";if(w+=S/x|0,S%=x,S*=10,S&&(w+="."),A){for(var C=_;C--;)w+=S/x|0,S%=x,S*=10;w+="(";for(var C=A;C--;)w+=S/x|0,S%=x,S*=10;w+=")"}else for(var C=y;S&&C--;)w+=S/x|0,S%=x,S*=10;return w}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,t.exports=p})()})(OB);var kne=OB.exports;const xs=zu(kne);var Lne="Fraction",$ne=[],zne=G(Lne,$ne,()=>(Object.defineProperty(xs,"name",{value:"Fraction"}),xs.prototype.constructor=xs,xs.prototype.type="Fraction",xs.prototype.isFraction=!0,xs.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},xs.fromJSON=function(t){return new xs(t)},xs),{isClass:!0}),Une="Range",qne=[],Hne=G(Une,qne,()=>{function t(e,r,n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");var i=e!=null,a=r!=null,s=n!=null;if(i){if(Mt(e))e=e.toNumber();else if(typeof e!="number")throw new TypeError("Parameter start must be a number")}if(a){if(Mt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(s){if(Mt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(e):0,this.end=a?parseFloat(r):0,this.step=s?parseFloat(n):1}return t.prototype.type="Range",t.prototype.isRange=!0,t.parse=function(e){if(typeof e!="string")return null;var r=e.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[2],n[1]);default:return null}},t.prototype.clone=function(){return new t(this.start,this.end,this.step)},t.prototype.size=function(){var e=0,r=this.start,n=this.step,i=this.end,a=i-r;return To(n)===To(a)?e=Math.ceil(a/n):a===0&&(e=0),isNaN(e)&&(e=0),[e]},t.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},t.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},t.prototype.forEach=function(e){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ri;)e(r,[a],this),r+=n,a++},t.prototype.map=function(e){var r=[];return this.forEach(function(n,i,a){r[i[0]]=e(n,i,a)}),r},t.prototype.toArray=function(){var e=[];return this.forEach(function(r,n){e[n[0]]=r}),e},t.prototype.valueOf=function(){return this.toArray()},t.prototype.format=function(e){var r=Ru(this.start,e);return this.step!==1&&(r+=":"+Ru(this.step,e)),r+=":"+Ru(this.end,e),r},t.prototype.toString=function(){return this.format()},t.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},t.fromJSON=function(e){return new t(e.start,e.end,e.step)},t},{isClass:!0}),Wne="Matrix",Vne=[],Yne=G(Wne,Vne,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,r){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,r,n){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,r){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,r){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,r){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function jne(t){var e=0,r=1,n=Object.create(null),i=Object.create(null),a=0,s=function(u){var l=i[u];if(l&&(delete n[l],delete i[u],--e,r===l)){if(!e){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return t=Math.abs(t),{hit:function(u){var l=i[u],c=++a;if(n[c]=u,i[u]=c,!l)return++e,e<=t?void 0:(u=n[r],s(u),u);if(delete n[l],r===l)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:s,clear:function(){e=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function hd(t){var{hasher:e,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:jne(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:e}=t;function r(c,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!$n(f))throw new Error("Invalid datatype: "+f);if(dt(c))c.type==="DenseMatrix"?(this._data=vt(c._data),this._size=vt(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&sr(c.data)&&sr(c.size))this._data=c.data,this._size=c.size,S2(this._data,this._size),this._datatype=f||c.datatype;else if(sr(c))this._data=l(c),this._size=Nt(this._data),S2(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+xr(c)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new e,r.prototype.createDenseMatrix=function(c,f){return new r(c,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return $h(this._data,xr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(c,f){return new r(c,f)},r.prototype.subset=function(c,f,h){switch(arguments.length){case 1:return n(this,c);case 2:case 3:return a(this,c,f,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(c){if(!sr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Pt(c.length,this._size.length);for(var f=0;f");var x=f.max().map(function(w){return w+1});u(c,x,p);var A=v.length,_=0;s(c._data,f,h,A,_)}return c}function s(c,f,h,p,v){var m=v===p-1,b=f.dimension(v);m?b.forEach(function(y,S){gr(y),c[y]=h[S[0]]}):b.forEach(function(y,S){gr(y),s(c[y],f,h[S[0]],p,v+1)})}r.prototype.resize=function(c,f,h){if(!na(c))throw new TypeError("Array or Matrix expected");var p=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=h?this.clone():this;return o(v,p,f)};function o(c,f,h){if(f.length===0){for(var p=c._data;sr(p);)p=p[0];return p}return c._size=f.slice(0),c._data=pc(c._data,c._size,h),c}r.prototype.reshape=function(c,f){var h=f?this.clone():this;h._data=Jx(h._data,c);var p=h._size.reduce((v,m)=>v*m);return h._size=Qx(c,p),h};function u(c,f,h){for(var p=c._size.slice(0),v=!1;p.lengthp[m]&&(p[m]=f[m],v=!0);v&&o(c,p,h)}r.prototype.clone=function(){var c=new r({data:vt(this._data),size:vt(this._size),datatype:this._datatype});return c},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(c){var f=this,h=FB(c),p=function b(y,S){return sr(y)?y.map(function(x,A){return b(x,S.concat(A))}):h===1?c(y):h===2?c(y,S):c(y,S,f)},v=p(this._data,[]),m=this._datatype!==void 0?$h(v,xr):void 0;return new r(v,m)},r.prototype.forEach=function(c){var f=this,h=function p(v,m){sr(v)?v.forEach(function(b,y){p(b,m.concat(y))}):c(v,m,f)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var c=function*f(h,p){if(sr(h))for(var v=0;v[x[y]]);f.push(new r(S,c._datatype))},m=0;m0?c:0,h=c<0?-c:0,p=this._size[0],v=this._size[1],m=Math.min(p-h,v-f),b=[],y=0;y0?h:0,m=h<0?-h:0,b=c[0],y=c[1],S=Math.min(b-m,y-v),x;if(sr(f)){if(f.length!==S)throw new Error("Invalid value array length");x=function(E){return f[E]}}else if(dt(f)){var A=f.size();if(A.length!==1||A[0]!==S)throw new Error("Invalid matrix length");x=function(E){return f.get([E])}}else x=function(){return f};p||(p=Mt(x(0))?x(0).mul(0):0);var _=[];if(c.length>0){_=pc(_,c,p);for(var w=0;w{var{typed:e}=t;return e(C2,{any:vt})});function RB(t){var e=t.length,r=t[0].length,n,i,a=[];for(i=0;i=n.length)throw new Ma(e,n.length);return dt(t)?t.create(Av(t.valueOf(),e,r)):Av(t,e,r)}function Av(t,e,r){var n,i,a,s;if(e<=0)if(Array.isArray(t[0])){for(s=RB(t),i=[],n=0;n{var{typed:e}=t;return e(T2,{number:ot,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),Ta="number",Cc="number, number";function BB(t){return Math.abs(t)}BB.signature=Ta;function PB(t,e){return t+e}PB.signature=Cc;function IB(t,e){return t-e}IB.signature=Cc;function kB(t,e){return t*e}kB.signature=Cc;function LB(t){return-t}LB.signature=Ta;function $B(t){return t}$B.signature=Ta;function Qf(t){return ere(t)}Qf.signature=Ta;function zB(t){return t*t*t}zB.signature=Ta;function UB(t){return Math.exp(t)}UB.signature=Ta;function qB(t){return tre(t)}qB.signature=Ta;function HB(t,e){if(!ot(t)||!ot(e))throw new Error("Parameters in function lcm must be integer numbers");if(t===0||e===0)return 0;for(var r,n=t*e;e!==0;)r=e,e=t%r,t=r;return Math.abs(n/t)}HB.signature=Cc;function tie(t,e){return e?Math.log(t)/Math.log(e):Math.log(t)}function WB(t){return Jte(t)}WB.signature=Ta;function VB(t){return Kte(t)}VB.signature=Ta;function O2(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=e<0;if(r&&(e=-e),e===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return r?1/0:0;if(!isFinite(t))return r?0:t;var n=Math.pow(Math.abs(t),1/e);return n=t<0?-n:n,r?1/n:n}function Jb(t){return To(t)}Jb.signature=Ta;function YB(t){return t*t}YB.signature=Ta;function jB(t,e){var r,n,i,a=0,s=1,o=1,u=0;if(!ot(t)||!ot(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)n=Math.floor(t/e),i=t-n*e,r=a,a=s-n*a,s=r,r=o,o=u-n*o,u=r,t=e,e=i;var l;return t<0?l=[-t,-s,-u]:l=[t,t?s:0,u],l}jB.signature=Cc;function GB(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}GB.signature=Cc;function Yf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!ot(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(rB(t,e))}var rie="number",Mc="number, number";function XB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitAnd");return t&e}XB.signature=Mc;function ZB(t){if(!ot(t))throw new Error("Integer expected in function bitNot");return~t}ZB.signature=rie;function KB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitOr");return t|e}KB.signature=Mc;function JB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitXor");return t^e}JB.signature=Mc;function QB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function leftShift");return t<>e}eP.signature=Mc;function tP(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}tP.signature=Mc;function Ps(t,e){if(e>1;return Ps(t,r)*Ps(r+1,e)}function rP(t,e){if(!ot(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!ot(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(e>t)throw new TypeError("k must be less than or equal to n");for(var r=t-e,n=1,i=e171?1/0:Ps(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*Dv(1-t));if(t>=171.35)return 1/0;if(t>85){var r=t*t,n=r*t,i=n*t,a=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*t))}--t,e=Ql[0];for(var s=1;s=1;n--)r+=F2[n]/(t+n);return uP+(t+.5)*Math.log(e)-e+Math.log(r)}Nv.signature="number";var Yn="number";function lP(t){return sre(t)}lP.signature=Yn;function cP(t){return Math.atan(1/t)}cP.signature=Yn;function fP(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}fP.signature=Yn;function hP(t){return Math.asin(1/t)}hP.signature=Yn;function dP(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}dP.signature=Yn;function pP(t){return Math.acos(1/t)}pP.signature=Yn;function mP(t){var e=1/t,r=Math.sqrt(e*e-1);return Math.log(r+e)}mP.signature=Yn;function vP(t){return ore(t)}vP.signature=Yn;function gP(t){return ure(t)}gP.signature=Yn;function yP(t){return 1/Math.tan(t)}yP.signature=Yn;function bP(t){var e=Math.exp(2*t);return(e+1)/(e-1)}bP.signature=Yn;function xP(t){return 1/Math.sin(t)}xP.signature=Yn;function wP(t){return t===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*To(t)}wP.signature=Yn;function SP(t){return 1/Math.cos(t)}SP.signature=Yn;function _P(t){return 2/(Math.exp(t)+Math.exp(-t))}_P.signature=Yn;function AP(t){return cre(t)}AP.signature=Yn;var Ig="number";function DP(t){return t<0}DP.signature=Ig;function NP(t){return t>0}NP.signature=Ig;function EP(t){return t===0}EP.signature=Ig;function CP(t){return Number.isNaN(t)}CP.signature=Ig;var R2="isNegative",cie=["typed"],fie=G(R2,cie,t=>{var{typed:e}=t;return e(R2,{number:DP,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),B2="isNumeric",hie=["typed"],die=G(B2,hie,t=>{var{typed:e}=t;return e(B2,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),P2="hasNumericValue",pie=["typed","isNumeric"],mie=G(P2,pie,t=>{var{typed:e,isNumeric:r}=t;return e(P2,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})}),I2="isPositive",vie=["typed"],gie=G(I2,vie,t=>{var{typed:e}=t;return e(I2,{number:NP,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),k2="isZero",yie=["typed"],bie=G(k2,yie,t=>{var{typed:e}=t;return e(k2,{number:EP,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),L2="isNaN",xie=["typed"],wie=G(L2,xie,t=>{var{typed:e}=t;return e(L2,{number:CP,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return It(n,Number.isNaN)}})}),$2="typeOf",Sie=["typed"],_ie=G($2,Sie,t=>{var{typed:e}=t;return e($2,{any:xr})});function ia(t,e,r){if(r==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var n=t.minus(e).abs();if(n.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return n.lte(i.times(r))}return!1}function Aie(t,e,r){return ni(t.re,e.re,r)&&ni(t.im,e.im,r)}var Tc=G("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return e.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Ev="equalScalar",Die=["typed","config"],Nie=G(Ev,Die,t=>{var{typed:e,config:r}=t,n=Tc({typed:e});return e(Ev,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return ni(a,s,r.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||ia(a,s,r.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return Aie(a,s,r.epsilon)}},n)});G(Ev,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Ev,{"number, number":function(i,a){return ni(i,a,r.epsilon)}})});var Eie="SparseMatrix",Cie=["typed","equalScalar","Matrix"],Mie=G(Eie,Cie,t=>{var{typed:e,equalScalar:r,Matrix:n}=t;function i(m,b){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(b&&!$n(b))throw new Error("Invalid datatype: "+b);if(dt(m))a(this,m,b);else if(m&&sr(m.index)&&sr(m.ptr)&&sr(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=b||m.datatype;else if(sr(m))s(this,m,b);else{if(m)throw new TypeError("Unsupported type of data ("+xr(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=b}}function a(m,b,y){b.type==="SparseMatrix"?(m._values=b._values?vt(b._values):void 0,m._index=vt(b._index),m._ptr=vt(b._ptr),m._size=vt(b._size),m._datatype=y||b._datatype):s(m,b.valueOf(),y||b._datatype)}function s(m,b,y){m._values=[],m._index=[],m._ptr=[],m._datatype=y;var S=b.length,x=0,A=r,_=0;if($n(y)&&(A=e.find(r,[y,y])||r,_=e.convert(0,y)),S>0){var w=0;do{m._ptr.push(m._index.length);for(var C=0;C");if(x.length===1){var E=b.dimension(0);E.forEach(function(O,F){gr(O),m.set([O,0],y[F[0]],S)})}else{var N=b.dimension(0),M=b.dimension(1);N.forEach(function(O,F){gr(O),M.forEach(function(U,V){gr(U),m.set([O,U],y[F[0]][V[0]],S)})})}}return m}i.prototype.get=function(m){if(!sr(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Pt(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var b=m[0],y=m[1];gr(b,this._size[0]),gr(y,this._size[1]);var S=l(b,this._ptr[y],this._ptr[y+1],this._index);return SA-1||x>_-1)&&(h(this,Math.max(S+1,A),Math.max(x+1,_),y),A=this._size[0],_=this._size[1]),gr(S,A),gr(x,_);var E=l(S,this._ptr[x],this._ptr[x+1],this._index);return EArray.isArray(A)&&A.length===1?A[0]:A);if(S.length!==2)throw new Error("Only two dimensions matrix are supported");S.forEach(function(A){if(!Ct(A)||!ot(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Rt(S)+")")});var x=y?this.clone():this;return h(x,S[0],S[1],b)};function h(m,b,y,S){var x=S||0,A=r,_=0;$n(m._datatype)&&(A=e.find(r,[m._datatype,m._datatype])||r,_=e.convert(0,m._datatype),x=e.convert(x,m._datatype));var w=!A(x,_),C=m._size[0],E=m._size[1],N,M,O;if(y>E){for(M=E;MC){if(w){var F=0;for(M=0;Mb-1&&(m._values.splice(O,1),m._index.splice(O,1),V++)}m._ptr[M]=m._values.length}return m._size[0]=b,m._size[1]=y,m}i.prototype.reshape=function(m,b){if(!sr(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function($){if(!Ct($)||!ot($)||$<=-2||$===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Rt(m)+")")});var y=this._size[0]*this._size[1];m=Qx(m,y);var S=m[0]*m[1];if(y!==S)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var x=b?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return x;for(var A=[],_=0;_=b&&I<=y&&O(m._values[H],I-b,F-S)}else{for(var P={},K=U;K1&&(S[x]=(S[x]||0)+1):S[y]=(S[y]||0)+1,S}var u=function(y,S){var x=0,A=1,_=1,w=0,C=0,E=0,N=1,M=1,O=0,F=1,U=1,V=1,H=1e7,I;if(y!=null)if(S!==void 0){if(x=y,A=S,_=x*A,x%1!==0||A%1!==0)throw b()}else switch(typeof y){case"object":{if("d"in y&&"n"in y)x=y.n,A=y.d,"s"in y&&(x*=y.s);else if(0 in y)x=y[0],1 in y&&(A=y[1]);else throw m();_=x*A;break}case"number":{if(y<0&&(_=y,y=-y),y%1===0)x=y;else if(y>0){for(y>=1&&(M=Math.pow(10,Math.floor(1+Math.log(y)/Math.LN10)),y/=M);F<=H&&V<=H;)if(I=(O+U)/(F+V),y===I){F+V<=H?(x=O+U,A=F+V):V>F?(x=U,A=V):(x=O,A=F);break}else y>I?(O+=U,F+=V):(U+=O,V+=F),F>H?(x=U,A=V):(x=O,A=F);x*=M}else(isNaN(y)||isNaN(S))&&(A=x=NaN);break}case"string":{if(F=y.match(/\d+|./g),F===null)throw m();if(F[O]==="-"?(_=-1,O++):F[O]==="+"&&O++,F.length===O+1?C=a(F[O++],_):F[O+1]==="."||F[O]==="."?(F[O]!=="."&&(w=a(F[O++],_)),O++,(O+1===F.length||F[O+1]==="("&&F[O+3]===")"||F[O+1]==="'"&&F[O+3]==="'")&&(C=a(F[O],_),N=Math.pow(10,F[O].length),O++),(F[O]==="("&&F[O+2]===")"||F[O]==="'"&&F[O+2]==="'")&&(E=a(F[O+1],_),M=Math.pow(10,F[O+1].length)-1,O+=3)):F[O+1]==="/"||F[O+1]===":"?(C=a(F[O],_),N=a(F[O+2],1),O+=3):F[O+3]==="/"&&F[O+1]===" "&&(w=a(F[O],_),C=a(F[O+2],_),N=a(F[O+4],1),O+=5),F.length<=O){A=N*M,_=x=E+A*w+M*C;break}}default:throw m()}if(A===0)throw v();i.s=_<0?-1:1,i.n=Math.abs(x),i.d=Math.abs(A)};function l(y,S,x){for(var A=1;S>0;y=y*y%x,S>>=1)S&1&&(A=A*y%x);return A}function c(y,S){for(;S%2===0;S/=2);for(;S%5===0;S/=5);if(S===1)return 0;for(var x=10%S,A=1;x!==1;A++)if(x=x*10%S,A>n)return 0;return A}function f(y,S,x){for(var A=1,_=l(10,x,S),w=0;w<300;w++){if(A===_)return w;A=A*10%S,_=_*10%S}return 0}function h(y,S){if(!y)return S;if(!S)return y;for(;;){if(y%=S,!y)return S;if(S%=y,!S)return y}}function p(y,S){if(u(y,S),this instanceof p)y=h(i.d,i.n),this.s=i.s,this.n=i.n/y,this.d=i.d/y;else return s(i.s*i.n,i.d)}var v=function(){return new Error("Division by Zero")},m=function(){return new Error("Invalid argument")},b=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(y,S){return u(y,S),s(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(y,S){return u(y,S),s(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(y,S){return u(y,S),s(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(y,S){return u(y,S),s(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(y,S){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(y===void 0)return s(this.s*this.n%this.d,1);if(u(y,S),i.n===0&&this.d===0)throw v();return s(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(y,S){return u(y,S),s(h(i.n,this.n)*h(i.d,this.d),i.d*this.d)},lcm:function(y,S){return u(y,S),i.n===0&&this.n===0?s(0,1):s(i.n*this.n,h(i.n,this.n)*h(i.d,this.d))},ceil:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.ceil(y*this.s*this.n/this.d),y)},floor:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.floor(y*this.s*this.n/this.d),y)},round:function(y){return y=Math.pow(10,y||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):s(Math.round(y*this.s*this.n/this.d),y)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(y,S){if(u(y,S),i.d===1)return i.s<0?s(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):s(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var x=o(this.n),A=o(this.d),_=1,w=1;for(var C in x)if(C!=="1"){if(C==="0"){_=0;break}if(x[C]*=i.n,x[C]%i.d===0)x[C]/=i.d;else return null;_*=Math.pow(C,x[C])}for(var C in A)if(C!=="1"){if(A[C]*=i.n,A[C]%i.d===0)A[C]/=i.d;else return null;w*=Math.pow(C,A[C])}return i.s<0?s(w,_):s(_,w)},equals:function(y,S){return u(y,S),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(y,S){u(y,S);var x=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;w--)_=_.inverse().add(x[w]);if(Math.abs(_.sub(S).valueOf())0&&(x+=S,x+=" ",A%=_),x+=A,x+="/",x+=_),x},toLatex:function(y){var S,x="",A=this.n,_=this.d;return this.s<0&&(x+="-"),_===1?x+=A:(y&&(S=Math.floor(A/_))>0&&(x+=S,A%=_),x+="\\frac{",x+=A,x+="}{",x+=_,x+="}"),x},toContinued:function(){var y,S=this.n,x=this.d,A=[];if(isNaN(S)||isNaN(x))return A;do A.push(Math.floor(S/x)),y=S%x,S=x,x=y;while(S!==1);return A},toString:function(y){var S=this.n,x=this.d;if(isNaN(S)||isNaN(x))return"NaN";y=y||15;var A=c(S,x),_=f(S,x,A),w=this.s<0?"-":"";if(w+=S/x|0,S%=x,S*=10,S&&(w+="."),A){for(var C=_;C--;)w+=S/x|0,S%=x,S*=10;w+="(";for(var C=A;C--;)w+=S/x|0,S%=x,S*=10;w+=")"}else for(var C=y;S&&C--;)w+=S/x|0,S%=x,S*=10;return w}},Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,t.exports=p})()})(Lne);const xs=g1(e1);var $ne="Fraction",zne=[],Une=G($ne,zne,()=>(Object.defineProperty(xs,"name",{value:"Fraction"}),xs.prototype.constructor=xs,xs.prototype.type="Fraction",xs.prototype.isFraction=!0,xs.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},xs.fromJSON=function(t){return new xs(t)},xs),{isClass:!0}),qne="Range",Hne=[],Wne=G(qne,Hne,()=>{function t(e,r,n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");var i=e!=null,a=r!=null,s=n!=null;if(i){if(Mt(e))e=e.toNumber();else if(typeof e!="number")throw new TypeError("Parameter start must be a number")}if(a){if(Mt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(s){if(Mt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(e):0,this.end=a?parseFloat(r):0,this.step=s?parseFloat(n):1}return t.prototype.type="Range",t.prototype.isRange=!0,t.parse=function(e){if(typeof e!="string")return null;var r=e.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[2],n[1]);default:return null}},t.prototype.clone=function(){return new t(this.start,this.end,this.step)},t.prototype.size=function(){var e=0,r=this.start,n=this.step,i=this.end,a=i-r;return To(n)===To(a)?e=Math.ceil(a/n):a===0&&(e=0),isNaN(e)&&(e=0),[e]},t.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},t.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},t.prototype.forEach=function(e){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ri;)e(r,[a],this),r+=n,a++},t.prototype.map=function(e){var r=[];return this.forEach(function(n,i,a){r[i[0]]=e(n,i,a)}),r},t.prototype.toArray=function(){var e=[];return this.forEach(function(r,n){e[n[0]]=r}),e},t.prototype.valueOf=function(){return this.toArray()},t.prototype.format=function(e){var r=Bu(this.start,e);return this.step!==1&&(r+=":"+Bu(this.step,e)),r+=":"+Bu(this.end,e),r},t.prototype.toString=function(){return this.format()},t.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},t.fromJSON=function(e){return new t(e.start,e.end,e.step)},t},{isClass:!0}),Vne="Matrix",Yne=[],jne=G(Vne,Yne,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,r){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,r,n){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,r){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,r){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,r){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function Gne(t){var e=0,r=1,n=Object.create(null),i=Object.create(null),a=0,s=function(u){var l=i[u];if(l&&(delete n[l],delete i[u],--e,r===l)){if(!e){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return t=Math.abs(t),{hit:function(u){var l=i[u],c=++a;if(n[c]=u,i[u]=c,!l)return++e,e<=t?void 0:(u=n[r],s(u),u);if(delete n[l],r===l)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:s,clear:function(){e=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function hd(t){var{hasher:e,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:Gne(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:e}=t;function r(c,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!$n(f))throw new Error("Invalid datatype: "+f);if(dt(c))c.type==="DenseMatrix"?(this._data=vt(c._data),this._size=vt(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&sr(c.data)&&sr(c.size))this._data=c.data,this._size=c.size,N2(this._data,this._size),this._datatype=f||c.datatype;else if(sr(c))this._data=l(c),this._size=Nt(this._data),N2(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+xr(c)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new e,r.prototype.createDenseMatrix=function(c,f){return new r(c,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return $h(this._data,xr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(c,f){return new r(c,f)},r.prototype.subset=function(c,f,h){switch(arguments.length){case 1:return n(this,c);case 2:case 3:return a(this,c,f,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(c){if(!sr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Pt(c.length,this._size.length);for(var f=0;f");var x=f.max().map(function(w){return w+1});u(c,x,p);var A=v.length,_=0;s(c._data,f,h,A,_)}return c}function s(c,f,h,p,v){var m=v===p-1,b=f.dimension(v);m?b.forEach(function(y,S){gr(y),c[y]=h[S[0]]}):b.forEach(function(y,S){gr(y),s(c[y],f,h[S[0]],p,v+1)})}r.prototype.resize=function(c,f,h){if(!na(c))throw new TypeError("Array or Matrix expected");var p=c.valueOf().map(m=>Array.isArray(m)&&m.length===1?m[0]:m),v=h?this.clone():this;return o(v,p,f)};function o(c,f,h){if(f.length===0){for(var p=c._data;sr(p);)p=p[0];return p}return c._size=f.slice(0),c._data=dc(c._data,c._size,h),c}r.prototype.reshape=function(c,f){var h=f?this.clone():this;h._data=uw(h._data,c);var p=h._size.reduce((v,m)=>v*m);return h._size=lw(c,p),h};function u(c,f,h){for(var p=c._size.slice(0),v=!1;p.lengthp[m]&&(p[m]=f[m],v=!0);v&&o(c,p,h)}r.prototype.clone=function(){var c=new r({data:vt(this._data),size:vt(this._size),datatype:this._datatype});return c},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(c){var f=this,h=FB(c),p=function b(y,S){return sr(y)?y.map(function(x,A){return b(x,S.concat(A))}):h===1?c(y):h===2?c(y,S):c(y,S,f)},v=p(this._data,[]),m=this._datatype!==void 0?$h(v,xr):void 0;return new r(v,m)},r.prototype.forEach=function(c){var f=this,h=function p(v,m){sr(v)?v.forEach(function(b,y){p(b,m.concat(y))}):c(v,m,f)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var c=function*f(h,p){if(sr(h))for(var v=0;v[x[y]]);f.push(new r(S,c._datatype))},m=0;m0?c:0,h=c<0?-c:0,p=this._size[0],v=this._size[1],m=Math.min(p-h,v-f),b=[],y=0;y0?h:0,m=h<0?-h:0,b=c[0],y=c[1],S=Math.min(b-m,y-v),x;if(sr(f)){if(f.length!==S)throw new Error("Invalid value array length");x=function(E){return f[E]}}else if(dt(f)){var A=f.size();if(A.length!==1||A[0]!==S)throw new Error("Invalid matrix length");x=function(E){return f.get([E])}}else x=function(){return f};p||(p=Mt(x(0))?x(0).mul(0):0);var _=[];if(c.length>0){_=dc(_,c,p);for(var w=0;w{var{typed:e}=t;return e(F2,{any:vt})});function RB(t){var e=t.length,r=t[0].length,n,i,a=[];for(i=0;i=n.length)throw new Ma(e,n.length);return dt(t)?t.create(Nv(t.valueOf(),e,r)):Nv(t,e,r)}function Nv(t,e,r){var n,i,a,s;if(e<=0)if(Array.isArray(t[0])){for(s=RB(t),i=[],n=0;n{var{typed:e}=t;return e(B2,{number:ot,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),Ta="number",Ec="number, number";function BB(t){return Math.abs(t)}BB.signature=Ta;function PB(t,e){return t+e}PB.signature=Ec;function IB(t,e){return t-e}IB.signature=Ec;function kB(t,e){return t*e}kB.signature=Ec;function LB(t){return-t}LB.signature=Ta;function $B(t){return t}$B.signature=Ta;function Jf(t){return tre(t)}Jf.signature=Ta;function zB(t){return t*t*t}zB.signature=Ta;function UB(t){return Math.exp(t)}UB.signature=Ta;function qB(t){return rre(t)}qB.signature=Ta;function HB(t,e){if(!ot(t)||!ot(e))throw new Error("Parameters in function lcm must be integer numbers");if(t===0||e===0)return 0;for(var r,n=t*e;e!==0;)r=e,e=t%r,t=r;return Math.abs(n/t)}HB.signature=Ec;function rie(t,e){return e?Math.log(t)/Math.log(e):Math.log(t)}function WB(t){return Qte(t)}WB.signature=Ta;function VB(t){return Jte(t)}VB.signature=Ta;function P2(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=e<0;if(r&&(e=-e),e===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return r?1/0:0;if(!isFinite(t))return r?0:t;var n=Math.pow(Math.abs(t),1/e);return n=t<0?-n:n,r?1/n:n}function t1(t){return To(t)}t1.signature=Ta;function YB(t){return t*t}YB.signature=Ta;function jB(t,e){var r,n,i,a=0,s=1,o=1,u=0;if(!ot(t)||!ot(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)n=Math.floor(t/e),i=t-n*e,r=a,a=s-n*a,s=r,r=o,o=u-n*o,u=r,t=e,e=i;var l;return t<0?l=[-t,-s,-u]:l=[t,t?s:0,u],l}jB.signature=Ec;function GB(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}GB.signature=Ec;function Vf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!ot(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(iB(t,e))}var nie="number",Cc="number, number";function XB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitAnd");return t&e}XB.signature=Cc;function ZB(t){if(!ot(t))throw new Error("Integer expected in function bitNot");return~t}ZB.signature=nie;function KB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitOr");return t|e}KB.signature=Cc;function JB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function bitXor");return t^e}JB.signature=Cc;function QB(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function leftShift");return t<>e}eP.signature=Cc;function tP(t,e){if(!ot(t)||!ot(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}tP.signature=Cc;function Ps(t,e){if(e>1;return Ps(t,r)*Ps(r+1,e)}function rP(t,e){if(!ot(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!ot(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(e>t)throw new TypeError("k must be less than or equal to n");for(var r=t-e,n=1,i=e171?1/0:Ps(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*Ev(1-t));if(t>=171.35)return 1/0;if(t>85){var r=t*t,n=r*t,i=n*t,a=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*t))}--t,e=Ql[0];for(var s=1;s=1;n--)r+=I2[n]/(t+n);return uP+(t+.5)*Math.log(e)-e+Math.log(r)}Cv.signature="number";var Yn="number";function lP(t){return ore(t)}lP.signature=Yn;function cP(t){return Math.atan(1/t)}cP.signature=Yn;function fP(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}fP.signature=Yn;function hP(t){return Math.asin(1/t)}hP.signature=Yn;function dP(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}dP.signature=Yn;function pP(t){return Math.acos(1/t)}pP.signature=Yn;function mP(t){var e=1/t,r=Math.sqrt(e*e-1);return Math.log(r+e)}mP.signature=Yn;function vP(t){return ure(t)}vP.signature=Yn;function gP(t){return lre(t)}gP.signature=Yn;function yP(t){return 1/Math.tan(t)}yP.signature=Yn;function bP(t){var e=Math.exp(2*t);return(e+1)/(e-1)}bP.signature=Yn;function xP(t){return 1/Math.sin(t)}xP.signature=Yn;function wP(t){return t===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*To(t)}wP.signature=Yn;function SP(t){return 1/Math.cos(t)}SP.signature=Yn;function _P(t){return 2/(Math.exp(t)+Math.exp(-t))}_P.signature=Yn;function AP(t){return fre(t)}AP.signature=Yn;var Lg="number";function DP(t){return t<0}DP.signature=Lg;function NP(t){return t>0}NP.signature=Lg;function EP(t){return t===0}EP.signature=Lg;function CP(t){return Number.isNaN(t)}CP.signature=Lg;var k2="isNegative",fie=["typed"],hie=G(k2,fie,t=>{var{typed:e}=t;return e(k2,{number:DP,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),L2="isNumeric",die=["typed"],pie=G(L2,die,t=>{var{typed:e}=t;return e(L2,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),$2="hasNumericValue",mie=["typed","isNumeric"],vie=G($2,mie,t=>{var{typed:e,isNumeric:r}=t;return e($2,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})}),z2="isPositive",gie=["typed"],yie=G(z2,gie,t=>{var{typed:e}=t;return e(z2,{number:NP,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),U2="isZero",bie=["typed"],xie=G(U2,bie,t=>{var{typed:e}=t;return e(U2,{number:EP,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),q2="isNaN",wie=["typed"],Sie=G(q2,wie,t=>{var{typed:e}=t;return e(q2,{number:CP,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return It(n,Number.isNaN)}})}),H2="typeOf",_ie=["typed"],Aie=G(H2,_ie,t=>{var{typed:e}=t;return e(H2,{any:xr})});function ia(t,e,r){if(r==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var n=t.minus(e).abs();if(n.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return n.lte(i.times(r))}return!1}function Die(t,e,r){return ni(t.re,e.re,r)&&ni(t.im,e.im,r)}var Mc=G("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return e.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Mv="equalScalar",Nie=["typed","config"],Eie=G(Mv,Nie,t=>{var{typed:e,config:r}=t,n=Mc({typed:e});return e(Mv,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return ni(a,s,r.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||ia(a,s,r.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return Die(a,s,r.epsilon)}},n)});G(Mv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Mv,{"number, number":function(i,a){return ni(i,a,r.epsilon)}})});var Cie="SparseMatrix",Mie=["typed","equalScalar","Matrix"],Tie=G(Cie,Mie,t=>{var{typed:e,equalScalar:r,Matrix:n}=t;function i(m,b){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(b&&!$n(b))throw new Error("Invalid datatype: "+b);if(dt(m))a(this,m,b);else if(m&&sr(m.index)&&sr(m.ptr)&&sr(m.size))this._values=m.values,this._index=m.index,this._ptr=m.ptr,this._size=m.size,this._datatype=b||m.datatype;else if(sr(m))s(this,m,b);else{if(m)throw new TypeError("Unsupported type of data ("+xr(m)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=b}}function a(m,b,y){b.type==="SparseMatrix"?(m._values=b._values?vt(b._values):void 0,m._index=vt(b._index),m._ptr=vt(b._ptr),m._size=vt(b._size),m._datatype=y||b._datatype):s(m,b.valueOf(),y||b._datatype)}function s(m,b,y){m._values=[],m._index=[],m._ptr=[],m._datatype=y;var S=b.length,x=0,A=r,_=0;if($n(y)&&(A=e.find(r,[y,y])||r,_=e.convert(0,y)),S>0){var w=0;do{m._ptr.push(m._index.length);for(var C=0;C");if(x.length===1){var E=b.dimension(0);E.forEach(function(O,F){gr(O),m.set([O,0],y[F[0]],S)})}else{var N=b.dimension(0),M=b.dimension(1);N.forEach(function(O,F){gr(O),M.forEach(function(U,V){gr(U),m.set([O,U],y[F[0]][V[0]],S)})})}}return m}i.prototype.get=function(m){if(!sr(m))throw new TypeError("Array expected");if(m.length!==this._size.length)throw new Pt(m.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var b=m[0],y=m[1];gr(b,this._size[0]),gr(y,this._size[1]);var S=l(b,this._ptr[y],this._ptr[y+1],this._index);return SA-1||x>_-1)&&(h(this,Math.max(S+1,A),Math.max(x+1,_),y),A=this._size[0],_=this._size[1]),gr(S,A),gr(x,_);var E=l(S,this._ptr[x],this._ptr[x+1],this._index);return EArray.isArray(A)&&A.length===1?A[0]:A);if(S.length!==2)throw new Error("Only two dimensions matrix are supported");S.forEach(function(A){if(!Ct(A)||!ot(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Rt(S)+")")});var x=y?this.clone():this;return h(x,S[0],S[1],b)};function h(m,b,y,S){var x=S||0,A=r,_=0;$n(m._datatype)&&(A=e.find(r,[m._datatype,m._datatype])||r,_=e.convert(0,m._datatype),x=e.convert(x,m._datatype));var w=!A(x,_),C=m._size[0],E=m._size[1],N,M,O;if(y>E){for(M=E;MC){if(w){var F=0;for(M=0;Mb-1&&(m._values.splice(O,1),m._index.splice(O,1),V++)}m._ptr[M]=m._values.length}return m._size[0]=b,m._size[1]=y,m}i.prototype.reshape=function(m,b){if(!sr(m))throw new TypeError("Array expected");if(m.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");m.forEach(function($){if(!Ct($)||!ot($)||$<=-2||$===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Rt(m)+")")});var y=this._size[0]*this._size[1];m=lw(m,y);var S=m[0]*m[1];if(y!==S)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var x=b?this.clone():this;if(this._size[0]===m[0]&&this._size[1]===m[1])return x;for(var A=[],_=0;_=b&&I<=y&&O(m._values[H],I-b,F-S)}else{for(var P={},K=U;K "+(this._values?Rt(this._values[C],m):"X")}return x},i.prototype.toString=function(){return Rt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(m){if(m){if(Mt(m)&&(m=m.toNumber()),!Ct(m)||!ot(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var b=m>0?m:0,y=m<0?-m:0,S=this._size[0],x=this._size[1],A=Math.min(S-y,x-b),_=[],w=[],C=[];C[0]=0;for(var E=b;E0?y:0,C=y<0?-y:0,E=m[0],N=m[1],M=Math.min(E-C,N-w),O;if(sr(b)){if(b.length!==M)throw new Error("Invalid value array length");O=function(se){return b[se]}}else if(dt(b)){var F=b.size();if(F.length!==1||F[0]!==M)throw new Error("Invalid matrix length");O=function(se){return b.get([se])}}else O=function(){return b};for(var U=[],V=[],H=[],I=0;I=0&&P=C||x[N]!==b)){var O=S?S[E]:void 0;x.splice(N,0,b),S&&S.splice(N,0,O),x.splice(N<=E?E+1:E,1),S&&S.splice(N<=E?E+1:E,1);continue}if(N=C||x[E]!==m)){var F=S?S[N]:void 0;x.splice(E,0,m),S&&S.splice(E,0,F),x.splice(E<=N?N+1:N,1),S&&S.splice(E<=N?N+1:N,1)}}},i},{isClass:!0}),Tie="number",Oie=["typed"];function Fie(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var r={"0b":2,"0o":8,"0x":16}[e[1]],n=e[2],i=e[3];return{input:t,radix:r,integerPart:n,fractionalPart:i}}else return null}function Rie(t){for(var e=parseInt(t.integerPart,t.radix),r=0,n=0;n{var{typed:e}=t,r=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=Fie(i);if(a)return Rie(a);var s=0,o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(s=Number(o[2]),i=o[1]);var u=Number(i);if(isNaN(u))throw new SyntaxError('String "'+i+'" is not a valid number');if(o){if(u>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));u>=2**(s-1)&&(u=u-2**s)}return u},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),z2="string",Pie=["typed"],Iie=G(z2,Pie,t=>{var{typed:e}=t;return e(z2,{"":function(){return""},number:Ru,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":e.referToSelf(r=>n=>It(n,r)),any:function(n){return String(n)}})}),U2="boolean",kie=["typed"],Lie=G(U2,kie,t=>{var{typed:e}=t;return e(U2,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),$ie="bignumber",zie=["typed","BigNumber"],Uie=G($ie,zie,t=>{var{typed:e,BigNumber:r}=t;return e("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],o=r(a[1]),u=new r(2).pow(Number(s));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var l=new r(2).pow(Number(s)-1);return o.gte(l)?o.sub(u):o}return new r(i)},BigNumber:function(i){return i},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),qie="complex",Hie=["typed","Complex"],Wie=G(qie,Hie,t=>{var{typed:e,Complex:r}=t;return e("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,a){return new r(i,a)},"BigNumber, BigNumber":function(i,a){return new r(i.toNumber(),a.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),Vie="fraction",Yie=["typed","Fraction"],jie=G(Vie,Yie,t=>{var{typed:e,Fraction:r}=t;return e("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,a){return new r(i,a)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new r(i)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),q2="matrix",Gie=["typed","Matrix","DenseMatrix","SparseMatrix"],Xie=G(q2,Gie,t=>{var{typed:e,Matrix:r,DenseMatrix:n,SparseMatrix:i}=t;return e(q2,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,o,u){if(o==="dense"||o==="default"||o===void 0)return new n(s,u);if(o==="sparse")return new i(s,u);throw new TypeError("Unknown matrix type "+JSON.stringify(o)+".")}}),H2="matrixFromFunction",Zie=["typed","matrix","isZero"],Kie=G(H2,Zie,t=>{var{typed:e,matrix:r,isZero:n}=t;return e(H2,{"Array | Matrix, function, string, string":function(s,o,u,l){return i(s,o,u,l)},"Array | Matrix, function, string":function(s,o,u){return i(s,o,u)},"Matrix, function":function(s,o){return i(s,o,"dense")},"Array, function":function(s,o){return i(s,o,"dense").toArray()},"Array | Matrix, string, function":function(s,o,u){return i(s,u,o)},"Array | Matrix, string, string, function":function(s,o,u,l){return i(s,l,o,u)}});function i(a,s,o,u){var l;return u!==void 0?l=r(o,u):l=r(o),l.resize(a),l.forEach(function(c,f){var h=s(f);n(h)||l.set(f,h)}),l}}),W2="matrixFromRows",Jie=["typed","matrix","flatten","size"],Qie=G(W2,Jie,t=>{var{typed:e,matrix:r,flatten:n,size:i}=t;return e(W2,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(l=>l.toArray())))}});function a(o){if(o.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var u=s(o[0]),l=[];for(var c of o){var f=s(c);if(f!==u)throw new TypeError("The vectors had different length: "+(u|0)+" ≠ "+(f|0));l.push(n(c))}return l}function s(o){var u=i(o);if(u.length===1)return u[0];if(u.length===2){if(u[0]===1)return u[1];if(u[1]===1)return u[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),V2="matrixFromColumns",eae=["typed","matrix","flatten","size"],tae=G(V2,eae,t=>{var{typed:e,matrix:r,flatten:n,size:i}=t;return e(V2,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(l=>l.toArray())))}});function a(o){if(o.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var u=s(o[0]),l=[],c=0;c{var{typed:e}=t;return e(Y2,{"Unit, Array":function(n,i){return n.splitUnit(i)}})}),j2="unaryMinus",iae=["typed"],aae=G(j2,iae,t=>{var{typed:e}=t;return e(j2,{number:LB,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=e.find(r,i.valueType())(n.value),i}),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),G2="unaryPlus",sae=["typed","config","BigNumber"],oae=G(G2,sae,t=>{var{typed:e,config:r,BigNumber:n}=t;return e(G2,{number:$B,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":e.referToSelf(i=>a=>It(a,i)),"boolean | string":function(a){return r.number==="BigNumber"?new n(+a):+a}})}),X2="abs",uae=["typed"],lae=G(X2,uae,t=>{var{typed:e}=t;return e(X2,{number:BB,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),Z2="apply",cae=["typed","isInteger"],nw=G(Z2,cae,t=>{var{typed:e,isInteger:r}=t;return e(Z2,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!r(a))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(i)?Nt(i):i.size();if(a<0||a>=o.length)throw new Ma(a,o.length);return dt(i)?i.create(Cv(i.valueOf(),a,s)):Cv(i,a,s)}})});function Cv(t,e,r){var n,i,a;if(e<=0)if(Array.isArray(t[0])){for(a=fae(t),i=[],n=0;n{var{typed:e}=t;return e(K2,{"number, number":PB,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=e.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),J2="subtractScalar",pae=["typed"],mae=G(J2,pae,t=>{var{typed:e}=t;return e(J2,{"number, number":IB,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=e.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Q2="cbrt",vae=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],gae=G(Q2,vae,t=>{var{config:e,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:o,Fraction:u}=t;return r(Q2,{number:Qf,Complex:l,"Complex, boolean":l,BigNumber:function(h){return h.cbrt()},Unit:c});function l(f,h){var p=f.arg()/3,v=f.abs(),m=new s(Qf(v),0).mul(new s(0,p).exp());if(h){var b=[m,new s(Qf(v),0).mul(new s(0,p+Math.PI*2/3).exp()),new s(Qf(v),0).mul(new s(0,p-Math.PI*2/3).exp())];return e.matrix==="Array"?b:a(b)}else return m}function c(f){if(f.value&&$s(f.value)){var h=f.clone();return h.value=1,h=h.pow(1/3),h.value=l(f.value),h}else{var p=n(f.value);p&&(f.value=i(f.value));var v;Mt(f.value)?v=new o(1).div(3):ld(f.value)?v=new u(1,3):v=1/3;var m=f.pow(v);return p&&(m.value=i(m.value)),m}}}),yae="matAlgo11xS0s",bae=["typed","equalScalar"],Fn=G(yae,bae,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=r,y=0,S=s;typeof h=="string"&&(m=h,b=e.find(r,[m,m]),y=e.convert(0,m),a=e.convert(a,m),S=e.find(s,[m,m]));for(var x=[],A=[],_=[],w=0;w{var{typed:e,DenseMatrix:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=s;typeof h=="string"&&(m=h,a=e.convert(a,m),b=e.find(s,[m,m]));for(var y=[],S=[],x=[],A=0;A{var{typed:e}=t;return function(i,a,s,o){var u=i._data,l=i._size,c=i._datatype,f,h=s;typeof c=="string"&&(f=c,a=e.convert(a,f),h=e.find(s,[f,f]));var p=l.length>0?r(h,0,l,l[0],u,a,o):[];return i.createDenseMatrix({data:p,size:vt(l),datatype:f})};function r(n,i,a,s,o,u,l){var c=[];if(i===a.length-1)for(var f=0;f{var{typed:e,config:r,round:n}=t;return e(Qb,{number:function(a){return ni(a,n(a),r.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(ni(a,n(a,s),r.epsilon))return n(a,s);var[o,u]="".concat(a,"e").split("e"),l=Math.ceil(Number("".concat(o,"e").concat(Number(u)+s)));return[o,u]="".concat(l,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-s))}})}),Nae=G(Qb,Aae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:a}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e}),f=Dae({typed:e,config:r,round:n});return e("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,v){return p.ceil(v)},"Complex, BigNumber":function(p,v){return p.ceil(v.toNumber())},BigNumber:function(p){return ia(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,v){return ia(p,n(p,v),r.epsilon)?n(p,v):p.toDecimalPlaces(v.toNumber(),zo.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,v){return p.ceil(v)},"Fraction, BigNumber":function(p,v){return p.ceil(v.toNumber())},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(i(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>a(p,0)?s(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),eN="cube",Eae=["typed"],Cae=G(eN,Eae,t=>{var{typed:e}=t;return e(eN,{number:zB,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})}),tN="exp",Mae=["typed"],Tae=G(tN,Mae,t=>{var{typed:e}=t;return e(tN,{number:UB,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})}),rN="expm1",Oae=["typed","Complex"],Fae=G(rN,Oae,t=>{var{typed:e,Complex:r}=t;return e(rN,{number:qB,Complex:function(i){var a=Math.exp(i.re);return new r(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})}),e1="fix",Rae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],Bae=G(e1,["typed","ceil","floor"],t=>{var{typed:e,ceil:r,floor:n}=t;return e(e1,{number:function(a){return a>0?n(a):r(a)},"number, number":function(a,s){return a>0?n(a,s):r(a,s)}})}),Pae=G(e1,Rae,t=>{var{typed:e,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:o,DenseMatrix:u}=t,l=gn({typed:e,DenseMatrix:u}),c=Oa({typed:e}),f=Bae({typed:e,ceil:i,floor:a});return e("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,v){return new r(p.re>0?a(p.re,v):i(p.re,v),p.im>0?a(p.im,v):i(p.im,v))},"Complex, BigNumber":function(p,v){var m=v.toNumber();return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,v){return p.isNegative()?i(p,v):a(p,v)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,v){return p.s<0?i(p,v):a(p,v)},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array | Matrix, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(n(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>s(p,0)?o(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),t1="floor",Iae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],kae=G(t1,["typed","config","round"],t=>{var{typed:e,config:r,round:n}=t;return e(t1,{number:function(a){return ni(a,n(a),r.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(ni(a,n(a,s),r.epsilon))return n(a,s);var[o,u]="".concat(a,"e").split("e"),l=Math.floor(Number("".concat(o,"e").concat(Number(u)+s)));return[o,u]="".concat(l,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-s))}})}),MP=G(t1,Iae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:a}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e}),f=kae({typed:e,config:r,round:n});return e("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,v){return p.floor(v)},"Complex, BigNumber":function(p,v){return p.floor(v.toNumber())},BigNumber:function(p){return ia(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,v){return ia(p,n(p,v),r.epsilon)?n(p,v):p.toDecimalPlaces(v.toNumber(),zo.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,v){return p.floor(v)},"Fraction, BigNumber":function(p,v){return p.floor(v.toNumber())},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(i(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>a(p,0)?s(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),Lae="matAlgo02xDS0",$ae=["typed","equalScalar"],Fa=G(Lae,$ae,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s,o){var u=i._data,l=i._size,c=i._datatype||i.getDataType(),f=a._values,h=a._index,p=a._ptr,v=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==v.length)throw new Pt(l.length,v.length);if(l[0]!==v[0]||l[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var b=l[0],y=l[1],S,x=r,A=0,_=s;typeof c=="string"&&c===m&&c!=="mixed"&&(S=c,x=e.find(r,[S,S]),A=e.convert(0,S),_=e.find(s,[S,S]));for(var w=[],C=[],E=[],N=0;N{var{typed:e}=t;return function(n,i,a,s){var o=n._data,u=n._size,l=n._datatype||n.getDataType(),c=i._values,f=i._index,h=i._ptr,p=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==p.length)throw new Pt(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=u[0],b=u[1],y,S=0,x=a;typeof l=="string"&&l===v&&l!=="mixed"&&(y=l,S=e.convert(0,y),x=e.find(a,[y,y]));for(var A=[],_=0;_{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=C?[]:void 0,O=C?[]:void 0,F=[],U=[],V,H,I,P;for(H=0;H{var{typed:e}=t;return function(i,a,s){var o=i._data,u=i._size,l=i._datatype,c=a._data,f=a._size,h=a._datatype,p=[];if(u.length!==f.length)throw new Pt(u.length,f.length);for(var v=0;v0?r(b,0,p,p[0],o,c):[];return i.createDenseMatrix({data:y,size:p,datatype:m})};function r(n,i,a,s,o,u){var l=[];if(i===a.length-1)for(var c=0;c{var{concat:e}=t;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((v,m)=>v===a._size[m]))return[i,a];for(var o=r(i._size,s,0),u=r(a._size,s,0),l=[],c=0;c{var{typed:e,matrix:r,concat:n}=t,i=Yae({typed:e}),a=Oa({typed:e}),s=Xae({concat:n});return function(u){var l=u.elop,c=u.SD||u.DS,f;l?(f={"DenseMatrix, DenseMatrix":(m,b)=>i(...s(m,b),l),"Array, Array":(m,b)=>i(...s(r(m),r(b)),l).valueOf(),"Array, DenseMatrix":(m,b)=>i(...s(r(m),b),l),"DenseMatrix, Array":(m,b)=>i(...s(m,r(b)),l)},u.SS&&(f["SparseMatrix, SparseMatrix"]=(m,b)=>u.SS(...s(m,b),l,!1)),u.DS&&(f["DenseMatrix, SparseMatrix"]=(m,b)=>u.DS(...s(m,b),l,!1),f["Array, SparseMatrix"]=(m,b)=>u.DS(...s(r(m),b),l,!1)),c&&(f["SparseMatrix, DenseMatrix"]=(m,b)=>c(...s(b,m),l,!0),f["SparseMatrix, Array"]=(m,b)=>c(...s(r(b),m),l,!0))):(f={"DenseMatrix, DenseMatrix":e.referToSelf(m=>(b,y)=>i(...s(b,y),m)),"Array, Array":e.referToSelf(m=>(b,y)=>i(...s(r(b),r(y)),m).valueOf()),"Array, DenseMatrix":e.referToSelf(m=>(b,y)=>i(...s(r(b),y),m)),"DenseMatrix, Array":e.referToSelf(m=>(b,y)=>i(...s(b,r(y)),m))},u.SS&&(f["SparseMatrix, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.SS(...s(b,y),m,!1))),u.DS&&(f["DenseMatrix, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.DS(...s(b,y),m,!1)),f["Array, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.DS(...s(r(b),y),m,!1))),c&&(f["SparseMatrix, DenseMatrix"]=e.referToSelf(m=>(b,y)=>c(...s(y,b),m,!0)),f["SparseMatrix, Array"]=e.referToSelf(m=>(b,y)=>c(...s(r(y),b),m,!0))));var h=u.scalar||"any",p=u.Ds||u.Ss;p&&(l?(f["DenseMatrix,"+h]=(m,b)=>a(m,b,l,!1),f[h+", DenseMatrix"]=(m,b)=>a(b,m,l,!0),f["Array,"+h]=(m,b)=>a(r(m),b,l,!1).valueOf(),f[h+", Array"]=(m,b)=>a(r(b),m,l,!0).valueOf()):(f["DenseMatrix,"+h]=e.referToSelf(m=>(b,y)=>a(b,y,m,!1)),f[h+", DenseMatrix"]=e.referToSelf(m=>(b,y)=>a(y,b,m,!0)),f["Array,"+h]=e.referToSelf(m=>(b,y)=>a(r(b),y,m,!1).valueOf()),f[h+", Array"]=e.referToSelf(m=>(b,y)=>a(r(y),b,m,!0).valueOf())));var v=u.sS!==void 0?u.sS:u.Ss;return l?(u.Ss&&(f["SparseMatrix,"+h]=(m,b)=>u.Ss(m,b,l,!1)),v&&(f[h+", SparseMatrix"]=(m,b)=>v(b,m,l,!0))):(u.Ss&&(f["SparseMatrix,"+h]=e.referToSelf(m=>(b,y)=>u.Ss(b,y,m,!1))),v&&(f[h+", SparseMatrix"]=e.referToSelf(m=>(b,y)=>v(y,b,m,!0)))),l&&l.signatures&&KR(f,l.signatures),f}}),nN="mod",Jae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],TP=G(nN,Jae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o,concat:u}=t,l=MP({typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}),c=Fa({typed:e,equalScalar:a}),f=ai({typed:e}),h=kg({typed:e,equalScalar:a}),p=Fn({typed:e,equalScalar:a}),v=gn({typed:e,DenseMatrix:o}),m=_r({typed:e,matrix:i,concat:u});return e(nN,{"number, number":b,"BigNumber, BigNumber":function(S,x){return x.isZero()?S:S.sub(x.mul(l(S.div(x))))},"Fraction, Fraction":function(S,x){return x.equals(0)?S:S.sub(x.mul(l(S.div(x))))}},m({SS:h,DS:f,SD:c,Ss:p,sS:v}));function b(y,S){return S===0?y:y-S*l(y/S)}}),Qae="matAlgo01xDSid",ese=["typed"],Vo=G(Qae,ese,t=>{var{typed:e}=t;return function(n,i,a,s){var o=n._data,u=n._size,l=n._datatype||n.getDataType(),c=i._values,f=i._index,h=i._ptr,p=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==p.length)throw new Pt(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=u[0],b=u[1],y=typeof l=="string"&&l!=="mixed"&&l===v?l:void 0,S=y?e.find(a,[y,y]):a,x,A,_=[];for(x=0;x{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=o&&h?[]:void 0,O=o&&h?[]:void 0,F=[],U=[],V,H,I,P,K;for(H=0;H{var{typed:e,DenseMatrix:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=s;typeof h=="string"&&(m=h,a=e.convert(a,m),b=e.find(s,[m,m]));for(var y=[],S=[],x=[],A=0;AArray.isArray(e))}var ose=G(iN,ase,t=>{var{typed:e,matrix:r,config:n,round:i,equalScalar:a,zeros:s,BigNumber:o,DenseMatrix:u,concat:l}=t,c=TP({typed:e,config:n,round:i,matrix:r,equalScalar:a,zeros:s,DenseMatrix:u,concat:l}),f=Vo({typed:e}),h=iw({typed:e,equalScalar:a}),p=ju({typed:e,DenseMatrix:u}),v=_r({typed:e,matrix:r,concat:l});return e(iN,{"number, number":m,"BigNumber, BigNumber":b,"Fraction, Fraction":(y,S)=>y.gcd(S)},v({SS:h,DS:f,Ss:p}),{[sse]:e.referToSelf(y=>(S,x,A)=>{for(var _=y(S,x),w=0;wS=>{if(S.length===1&&Array.isArray(S[0])&&aN(S[0]))return y(...S[0]);if(aN(S))return y(...S);throw new Gu("gcd() supports only 1d matrices!")}),Matrix:e.referToSelf(y=>S=>y(S.toArray()))});function m(y,S){if(!ot(y)||!ot(S))throw new Error("Parameters in function gcd must be integer numbers");for(var x;S!==0;)x=c(y,S),y=S,S=x;return y<0?-y:y}function b(y,S){if(!y.isInt()||!S.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var x=new o(0);!S.isZero();){var A=c(y,S);y=S,S=A}return y.lt(x)?y.neg():y}}),use="matAlgo06xS0S0",lse=["typed","equalScalar"],Lg=G(use,lse,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._size,l=i._datatype||i._data===void 0?i._datatype:i.getDataType(),c=a._values,f=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==f.length)throw new Pt(u.length,f.length);if(u[0]!==f[0]||u[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");var p=u[0],v=u[1],m,b=r,y=0,S=s;typeof l=="string"&&l===h&&l!=="mixed"&&(m=l,b=e.find(r,[m,m]),y=e.convert(0,m),S=e.find(s,[m,m]));for(var x=o&&c?[]:void 0,A=[],_=[],w=x?[]:void 0,C=[],E=[],N=0;N{var{typed:e,matrix:r,equalScalar:n,concat:i}=t,a=Fa({typed:e,equalScalar:n}),s=Lg({typed:e,equalScalar:n}),o=Fn({typed:e,equalScalar:n}),u=_r({typed:e,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",c={};return c["".concat(l,", ").concat(l,", ...").concat(l)]=e.referToSelf(h=>(p,v,m)=>{for(var b=h(p,v),y=0;yh.lcm(p)},u({SS:s,DS:a,Ss:o}),c);function f(h,p){if(!h.isInt()||!p.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(p.isZero())return p;for(var v=h.times(p);!p.isZero();){var m=p;p=h.mod(m),h=m}return v.div(h).abs()}}),oN="log10",hse=["typed","config","Complex"],dse=G(oN,hse,t=>{var{typed:e,config:r,Complex:n}=t;return e(oN,{number:function(a){return a>=0||r.predictable?WB(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||r.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":e.referToSelf(i=>a=>It(a,i))})}),uN="log2",pse=["typed","config","Complex"],mse=G(uN,pse,t=>{var{typed:e,config:r,Complex:n}=t;return e(uN,{number:function(s){return s>=0||r.predictable?VB(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||r.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":e.referToSelf(a=>s=>It(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),vse="multiplyScalar",gse=["typed"],yse=G(vse,gse,t=>{var{typed:e}=t;return e("multiplyScalar",{"number, number":kB,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),lN="multiply",bse=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],xse=G(lN,bse,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=t,o=Fn({typed:e,equalScalar:a}),u=Oa({typed:e});function l(_,w){switch(_.length){case 1:switch(w.length){case 1:if(_[0]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(_[0]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+_[0]+") must match Matrix rows ("+w[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+w.length+" dimensions)")}break;case 2:switch(w.length){case 1:if(_[1]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+_[1]+") must match Vector length ("+w[0]+")");break;case 2:if(_[1]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+_[1]+") must match Matrix B rows ("+w[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+w.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+_.length+" dimensions)")}}function c(_,w,C){if(C===0)throw new Error("Cannot multiply two empty vectors");return s(_,w)}function f(_,w){if(w.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(_,w)}function h(_,w){var C=_._data,E=_._size,N=_._datatype||_.getDataType(),M=w._data,O=w._size,F=w._datatype||w.getDataType(),U=E[0],V=O[1],H,I=n,P=i;N&&F&&N===F&&typeof N=="string"&&N!=="mixed"&&(H=N,I=e.find(n,[H,H]),P=e.find(i,[H,H]));for(var K=[],$=0;$xe)for(var me=0,we=0;we(w,C)=>{l(Nt(w),Nt(C));var E=_(r(w),r(C));return dt(E)?E.valueOf():E}),"Matrix, Matrix":function(w,C){var E=w.size(),N=C.size();return l(E,N),E.length===1?N.length===1?c(w,C,E[0]):f(w,C):N.length===1?p(w,C):v(w,C)},"Matrix, Array":e.referTo("Matrix,Matrix",_=>(w,C)=>_(w,r(C))),"Array, Matrix":e.referToSelf(_=>(w,C)=>_(r(w,C.storage()),C)),"SparseMatrix, any":function(w,C){return o(w,C,i,!1)},"DenseMatrix, any":function(w,C){return u(w,C,i,!1)},"any, SparseMatrix":function(w,C){return o(C,w,i,!0)},"any, DenseMatrix":function(w,C){return u(C,w,i,!0)},"Array, any":function(w,C){return u(r(w),C,i,!1).valueOf()},"any, Array":function(w,C){return u(r(C),w,i,!0).valueOf()},"any, any":i,"any, any, ...any":e.referToSelf(_=>(w,C,E)=>{for(var N=_(w,C),M=0;M{var{typed:e,matrix:r,equalScalar:n,BigNumber:i,concat:a}=t,s=Vo({typed:e}),o=Fa({typed:e,equalScalar:n}),u=Lg({typed:e,equalScalar:n}),l=Fn({typed:e,equalScalar:n}),c=_r({typed:e,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return e(cN,{number:O2,"number, number":O2,BigNumber:p=>h(p,new i(2)),"BigNumber, BigNumber":h,Complex:f,"Complex, number":f,Array:e.referTo("DenseMatrix,number",p=>v=>p(r(v),2).valueOf()),DenseMatrix:e.referTo("DenseMatrix,number",p=>v=>p(v,2)),SparseMatrix:e.referTo("SparseMatrix,number",p=>v=>p(v,2)),"SparseMatrix, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return u(v,m,p);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return s(v,m,p,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":e.referTo("DenseMatrix,SparseMatrix",p=>(v,m)=>p(r(v),m)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return l(m,v,p,!0);throw new Error("Root must be non-zero")})},c({scalar:"number | BigNumber",SD:o,Ss:l,sS:!1}));function h(p,v){var m=i.precision,b=i.clone({precision:m+2}),y=new i(0),S=new b(1),x=v.isNegative();if(x&&(v=v.neg()),v.isZero())throw new Error("Root must be non-zero");if(p.isNegative()&&!v.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(p.isZero())return x?new b(1/0):0;if(!p.isFinite())return x?y:p;var A=p.abs().pow(S.div(v));return A=p.isNeg()?A.neg():A,new i((x?S.div(A):A).toPrecision(m))}}),fN="sign",_se=["typed","BigNumber","Fraction","complex"],Ase=G(fN,_se,t=>{var{typed:e,BigNumber:r,complex:n,Fraction:i}=t;return e(fN,{number:Jb,Complex:function(s){return s.im===0?n(Jb(s.re)):s.sign()},BigNumber:function(s){return new r(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":e.referToSelf(a=>s=>It(s,a)),Unit:e.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return e.find(a,s.valueType())(s.value)})})}),Dse="sqrt",Nse=["config","typed","Complex"],Ese=G(Dse,Nse,t=>{var{config:e,typed:r,Complex:n}=t;return r("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||e.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||e.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),hN="square",Cse=["typed"],Mse=G(hN,Cse,t=>{var{typed:e}=t;return e(hN,{number:YB,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})}),dN="subtract",Tse=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Ose=G(dN,Tse,t=>{var{typed:e,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:o}=t,u=Vo({typed:e}),l=ai({typed:e}),c=kg({typed:e,equalScalar:n}),f=ju({typed:e,DenseMatrix:s}),h=gn({typed:e,DenseMatrix:s}),p=_r({typed:e,matrix:r,concat:o});return e(dN,{"any, any":i},p({elop:i,SS:c,DS:u,SD:l,Ss:h,sS:f}))}),pN="xgcd",Fse=["typed","config","matrix","BigNumber"],Rse=G(pN,Fse,t=>{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e(pN,{"number, number":function(o,u){var l=jB(o,u);return r.matrix==="Array"?l:n(l)},"BigNumber, BigNumber":a});function a(s,o){var u,l,c,f=new i(0),h=new i(1),p=f,v=h,m=h,b=f;if(!s.isInt()||!o.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!o.isZero();)l=s.div(o).floor(),c=s.mod(o),u=p,p=v.minus(l.times(p)),v=u,u=m,m=b.minus(l.times(m)),b=u,s=o,o=c;var y;return s.lt(f)?y=[s.neg(),v.neg(),b.neg()]:y=[s,s.isZero()?0:v,b],r.matrix==="Array"?y:n(y)}}),mN="invmod",Bse=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Pse=G(mN,Bse,t=>{var{typed:e,config:r,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:o,add:u,isInteger:l}=t;return e(mN,{"number, number":c,"BigNumber, BigNumber":c});function c(f,h){if(!l(f)||!l(h))throw new Error("Parameters in function invmod must be integer numbers");if(f=o(f,h),a(h,0))throw new Error("Divisor must be non zero");var p=i(f,h);p=p.valueOf();var[v,m]=p;return a(v,n(1))?(m=o(m,h),s(m,n(0))&&(m=u(m,h)),m):NaN}}),Ise="matAlgo09xS0Sf",kse=["typed","equalScalar"],OP=G(Ise,kse,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=C?[]:void 0,O=[],F,U,V,H,I;for(U=0;U{var{typed:e,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=t,s=Fa({typed:e,equalScalar:n}),o=OP({typed:e,equalScalar:n}),u=Fn({typed:e,equalScalar:n}),l=_r({typed:e,matrix:r,concat:a});return e(vN,l({elop:i,SS:o,DS:s,Ss:u}))});function zse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitAnd");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero()||e.eq(-1)||t.eq(e))return t;if(e.isZero()||t.eq(-1))return e;if(!t.isFinite()||!e.isFinite()){if(!t.isFinite()&&!e.isFinite())return t.isNegative()===e.isNegative()?t:new r(0);if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e;if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t}return aw(t,e,function(n,i){return n&i})}function qh(t){if(t.isFinite()&&!t.isInteger())throw new Error("Integer expected in function bitNot");var e=t.constructor,r=e.precision;e.config({precision:1e9});var n=t.plus(new e(1));return n.s=-n.s||null,e.config({precision:r}),n}function Use(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitOr");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);var n=new r(-1);return t.isZero()||e.eq(n)||t.eq(e)?e:e.isZero()||t.eq(n)?t:!t.isFinite()||!e.isFinite()?!t.isFinite()&&!t.isNegative()&&e.isNegative()||t.isNegative()&&!e.isNegative()&&!e.isFinite()?n:t.isNegative()&&e.isNegative()?t.isFinite()?t:e:t.isFinite()?e:t:aw(t,e,function(i,a){return i|a})}function aw(t,e,r){var n=t.constructor,i,a,s=+(t.s<0),o=+(e.s<0);if(s){i=tm(qh(t));for(var u=0;u0;)r(c[--p],f[--v])===m&&(b=b.plus(y)),y=y.times(S);for(;v>0;)r(h,f[--v])===m&&(b=b.plus(y)),y=y.times(S);return n.config({precision:x}),m===0&&(b.s=-b.s),b}function tm(t){for(var e=t.d,r=e[0]+"",n=1;n0)if(++o>l)for(o-=l;o--;)u+="0";else o1&&((c[p+1]===null||c[p+1]===void 0)&&(c[p+1]=0),c[p+1]+=c[p]>>1,c[p]&=1)}return c.reverse()}function qse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitXor");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero())return e;if(e.isZero())return t;if(t.eq(e))return new r(0);var n=new r(-1);return t.eq(n)?qh(e):e.eq(n)?qh(t):!t.isFinite()||!e.isFinite()?!t.isFinite()&&!e.isFinite()?n:new r(t.isNegative()===e.isNegative()?1/0:-1/0):aw(t,e,function(i,a){return i^a})}function Hse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function leftShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:!t.isFinite()&&!e.isFinite()?new r(NaN):e.lt(55)?t.times(Math.pow(2,e.toNumber())+""):t.times(new r(2).pow(e))}function Wse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:e.isFinite()?e.lt(55)?t.div(Math.pow(2,e.toNumber())+"").floor():t.div(new r(2).pow(e)).floor():t.isNegative()?new r(-1):t.isFinite()?new r(0):new r(NaN)}var gN="bitAnd",Vse=["typed","matrix","equalScalar","concat"],FP=G(gN,Vse,t=>{var{typed:e,matrix:r,equalScalar:n,concat:i}=t,a=Fa({typed:e,equalScalar:n}),s=Lg({typed:e,equalScalar:n}),o=Fn({typed:e,equalScalar:n}),u=_r({typed:e,matrix:r,concat:i});return e(gN,{"number, number":XB,"BigNumber, BigNumber":zse},u({SS:s,DS:a,Ss:o}))}),yN="bitNot",Yse=["typed"],jse=G(yN,Yse,t=>{var{typed:e}=t;return e(yN,{number:ZB,BigNumber:qh,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),bN="bitOr",Gse=["typed","matrix","equalScalar","DenseMatrix","concat"],RP=G(bN,Gse,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=Vo({typed:e}),o=iw({typed:e,equalScalar:n}),u=ju({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:r,concat:a});return e(bN,{"number, number":KB,"BigNumber, BigNumber":Use},l({SS:o,DS:s,Ss:u}))}),Xse="matAlgo07xSSf",Zse=["typed","DenseMatrix"],es=G(Xse,Zse,t=>{var{typed:e,DenseMatrix:r}=t;return function(a,s,o){var u=a._size,l=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=s._size,f=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(u.length!==c.length)throw new Pt(u.length,c.length);if(u[0]!==c[0]||u[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+c+")");var h=u[0],p=u[1],v,m=0,b=o;typeof l=="string"&&l===f&&l!=="mixed"&&(v=l,m=e.convert(0,v),b=e.find(o,[v,v]));var y,S,x=[];for(y=0;y{var{typed:e,matrix:r,DenseMatrix:n,concat:i}=t,a=ai({typed:e}),s=es({typed:e,DenseMatrix:n}),o=gn({typed:e,DenseMatrix:n}),u=_r({typed:e,matrix:r,concat:i});return e(xN,{"number, number":JB,"BigNumber, BigNumber":qse},u({SS:s,DS:a,Ss:o}))}),wN="arg",Qse=["typed"],eoe=G(wN,Qse,t=>{var{typed:e}=t;return e(wN,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),SN="conj",toe=["typed"],roe=G(SN,toe,t=>{var{typed:e}=t;return e(SN,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),_N="im",noe=["typed"],ioe=G(_N,noe,t=>{var{typed:e}=t;return e(_N,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),AN="re",aoe=["typed"],soe=G(AN,aoe,t=>{var{typed:e}=t;return e(AN,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),DN="not",ooe=["typed"],uoe=G(DN,ooe,t=>{var{typed:e}=t;return e(DN,{"null | undefined":()=>!0,number:nP,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),NN="or",loe=["typed","matrix","equalScalar","DenseMatrix","concat"],BP=G(NN,loe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=kg({typed:e,equalScalar:n}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:r,concat:a});return e(NN,{"number, number":iP,"Complex, Complex":function(f,h){return f.re!==0||f.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(f,h){return!f.isZero()&&!f.isNaN()||!h.isZero()&&!h.isNaN()},"Unit, Unit":e.referToSelf(c=>(f,h)=>c(f.value||0,h.value||0))},l({SS:o,DS:s,Ss:u}))}),EN="xor",coe=["typed","matrix","DenseMatrix","concat"],foe=G(EN,coe,t=>{var{typed:e,matrix:r,DenseMatrix:n,concat:i}=t,a=ai({typed:e}),s=es({typed:e,DenseMatrix:n}),o=gn({typed:e,DenseMatrix:n}),u=_r({typed:e,matrix:r,concat:i});return e(EN,{"number, number":aP,"Complex, Complex":function(c,f){return(c.re!==0||c.im!==0)!=(f.re!==0||f.im!==0)},"BigNumber, BigNumber":function(c,f){return(!c.isZero()&&!c.isNaN())!=(!f.isZero()&&!f.isNaN())},"Unit, Unit":e.referToSelf(l=>(c,f)=>l(c.value||0,f.value||0))},u({SS:s,DS:a,Ss:o}))}),CN="concat",hoe=["typed","matrix","isInteger"],PP=G(CN,hoe,t=>{var{typed:e,matrix:r,isInteger:n}=t;return e(CN,{"...Array | Matrix | number | BigNumber":function(a){var s,o=a.length,u=-1,l,c=!1,f=[];for(s=0;s0&&u>l)throw new Ma(u,l+1)}else{var p=vt(h).valueOf(),v=Nt(p);if(f[s]=p,l=u,u=v.length-1,s>0&&u!==l)throw new Pt(l+1,u+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=hB(m,f.shift(),u);return c?r(m):m},"...string":function(a){return a.join("")}})}),MN="column",doe=["typed","Index","matrix","range"],IP=G(MN,doe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t;return e(MN,{"Matrix, number":a,"Array, number":function(o,u){return a(n(vt(o)),u).valueOf()}});function a(s,o){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");gr(o,s.size()[1]);var u=i(0,s.size()[0]),l=new r(u,o),c=s.subset(l);return dt(c)?c:n([[c]])}}),TN="count",poe=["typed","size","prod"],moe=G(TN,poe,t=>{var{typed:e,size:r,prod:n}=t;return e(TN,{string:function(a){return a.length},"Matrix | Array":function(a){return n(r(a))}})}),ON="cross",voe=["typed","matrix","subtract","multiply"],goe=G(ON,voe,t=>{var{typed:e,matrix:r,subtract:n,multiply:i}=t;return e(ON,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(s,o){var u=Math.max(Nt(s).length,Nt(o).length);s=gv(s),o=gv(o);var l=Nt(s),c=Nt(o);if(l.length!==1||c.length!==1||l[0]!==3||c[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+c.join(", ")+"])");var f=[n(i(s[1],o[2]),i(s[2],o[1])),n(i(s[2],o[0]),i(s[0],o[2])),n(i(s[0],o[1]),i(s[1],o[0]))];return u>1?[f]:f}}),FN="diag",yoe=["typed","matrix","DenseMatrix","SparseMatrix"],boe=G(FN,yoe,t=>{var{typed:e,matrix:r,DenseMatrix:n,SparseMatrix:i}=t;return e(FN,{Array:function(l){return a(l,0,Nt(l),null)},"Array, number":function(l,c){return a(l,c,Nt(l),null)},"Array, BigNumber":function(l,c){return a(l,c.toNumber(),Nt(l),null)},"Array, string":function(l,c){return a(l,0,Nt(l),c)},"Array, number, string":function(l,c,f){return a(l,c,Nt(l),f)},"Array, BigNumber, string":function(l,c,f){return a(l,c.toNumber(),Nt(l),f)},Matrix:function(l){return a(l,0,l.size(),l.storage())},"Matrix, number":function(l,c){return a(l,c,l.size(),l.storage())},"Matrix, BigNumber":function(l,c){return a(l,c.toNumber(),l.size(),l.storage())},"Matrix, string":function(l,c){return a(l,0,l.size(),c)},"Matrix, number, string":function(l,c,f){return a(l,c,l.size(),f)},"Matrix, BigNumber, string":function(l,c,f){return a(l,c.toNumber(),l.size(),f)}});function a(u,l,c,f){if(!ot(l))throw new TypeError("Second parameter in function diag must be an integer");var h=l>0?l:0,p=l<0?-l:0;switch(c.length){case 1:return s(u,l,f,c[0],p,h);case 2:return o(u,l,f,c,p,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(u,l,c,f,h,p){var v=[f+h,f+p];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?i.diagonal(v,u,l):n.diagonal(v,u,l);return c!==null?m:m.valueOf()}function o(u,l,c,f,h,p){if(dt(u)){var v=u.diagonal(l);return c!==null?c!==v.storage()?r(v,c):v:v.valueOf()}for(var m=Math.min(f[0]-h,f[1]-p),b=[],y=0;y=2&&m.push("index: ".concat(xr(r))),p.length>=3&&m.push("array: ".concat(xr(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(t.name,"(").concat(m.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(t.name,": ").concat(b.message))}}}var xoe="filter",woe=["typed"],Soe=G(xoe,woe,t=>{var{typed:e}=t;return e("filter",{"Array, function":RN,"Matrix, function":function(n,i){return n.create(RN(n.toArray(),i))},"Array, RegExp":yv,"Matrix, RegExp":function(n,i){return n.create(yv(n.toArray(),i))}})});function RN(t,e){return cB(t,function(r,n,i){return Oc(e,r,[n],i,"filter")})}var BN="flatten",_oe=["typed","matrix"],Aoe=G(BN,_oe,t=>{var{typed:e,matrix:r}=t;return e(BN,{Array:function(i){return tr(i)},Matrix:function(i){var a=tr(i.toArray());return r(a)}})}),PN="forEach",Doe=["typed"],Noe=G(PN,Doe,t=>{var{typed:e}=t;return e(PN,{"Array, function":Eoe,"Matrix, function":function(n,i){n.forEach(i)}})});function Eoe(t,e){var r=function n(i,a){if(Array.isArray(i))Tg(i,function(s,o){n(s,a.concat(o))});else return Oc(e,i,a,t,"forEach")};r(t,[])}var IN="getMatrixDataType",Coe=["typed"],Moe=G(IN,Coe,t=>{var{typed:e}=t;return e(IN,{Array:function(n){return $h(n,xr)},Matrix:function(n){return n.getDataType()}})}),kN="identity",Toe=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Ooe=G(kN,Toe,t=>{var{typed:e,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=t;return e(kN,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(c){return n(c)},"number | BigNumber":function(c){return u(c,c,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return u(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return u(c,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,h){return u(c,f,h)},Array:function(c){return o(c)},"Array, string":function(c,f){return o(c,f)},Matrix:function(c){return o(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return o(c.valueOf(),f)}});function o(l,c){switch(l.length){case 0:return c?n(c):[];case 1:return u(l[0],l[0],c);case 2:return u(l[0],l[1],c);default:throw new Error("Vector containing two values expected")}}function u(l,c,f){var h=Mt(l)||Mt(c)?i:null;if(Mt(l)&&(l=l.toNumber()),Mt(c)&&(c=c.toNumber()),!ot(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!ot(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var p=h?new i(1):1,v=h?new h(0):0,m=[l,c];if(f){if(f==="sparse")return s.diagonal(m,p,0,v);if(f==="dense")return a.diagonal(m,p,0,v);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var b=pc([],m,v),y=l{var{typed:e,matrix:r,multiplyScalar:n}=t;return e(LN,{"Matrix, Matrix":function(s,o){return r(i(s.toArray(),o.toArray()))},"Matrix, Array":function(s,o){return r(i(s.toArray(),o))},"Array, Matrix":function(s,o){return r(i(s,o.toArray()))},"Array, Array":i});function i(a,s){if(Nt(a).length===1&&(a=[a]),Nt(s).length===1&&(s=[s]),Nt(a).length>2||Nt(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var o=[],u=[];return a.map(function(l){return s.map(function(c){return u=[],o.push(u),l.map(function(f){return c.map(function(h){return u.push(n(f,h))})})})})&&o}}),$N="map",Boe=["typed"],Poe=G($N,Boe,t=>{var{typed:e}=t;return e($N,{"Array, function":Ioe,"Matrix, function":function(n,i){return n.map(i)}})});function Ioe(t,e){var r=function n(i,a){return Array.isArray(i)?i.map(function(s,o){return n(s,a.concat(o))}):Oc(e,i,a,t,"map")};return r(t,[])}var zN="diff",koe=["typed","matrix","subtract","number"],kP=G(zN,koe,t=>{var{typed:e,matrix:r,subtract:n,number:i}=t;return e(zN,{"Array | Matrix":function(c){return dt(c)?r(s(c.toArray())):s(c)},"Array | Matrix, number":function(c,f){if(!ot(f))throw new RangeError("Dimension must be a whole number");return dt(c)?r(a(c.toArray(),f)):a(c,f)},"Array, BigNumber":e.referTo("Array,number",l=>(c,f)=>l(c,i(f))),"Matrix, BigNumber":e.referTo("Matrix,number",l=>(c,f)=>l(c,i(f)))});function a(l,c){if(dt(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(c>0){var f=[];return l.forEach(h=>{f.push(a(h,c-1))}),f}else{if(c===0)return s(l);throw RangeError("Cannot have negative dimension")}}function s(l){for(var c=[],f=l.length,h=1;h{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(l){var c=l[l.length-1];if(typeof c=="string"){var f=l.pop();return a(l,f)}else return r.matrix==="Array"?a(l):a(l,"default")},Array:a,Matrix:function(l){var c=l.storage();return a(l.valueOf(),c)},"Array | Matrix, string":function(l,c){return a(l.valueOf(),c)}});function a(u,l){var c=s(u),f=c?new i(1):1;if(o(u),l){var h=n(l);return u.length>0?h.resize(u,f):h}else{var p=[];return u.length>0?pc(p,u,f):p}}function s(u){var l=!1;return u.forEach(function(c,f,h){Mt(c)&&(l=!0,h[f]=c.toNumber())}),l}function o(u){u.forEach(function(l){if(typeof l!="number"||!ot(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function sw(){throw new Error('No "bignumber" implementation available')}function LP(){throw new Error('No "fraction" implementation available')}function $P(){throw new Error('No "matrix" implementation available')}var UN="range",Uoe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],zP=G(UN,Uoe,t=>{var{typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c}=t;return e(UN,{string:h,"string, boolean":h,"number, number":function(b,y){return f(p(b,y,1,!1))},"number, number, number":function(b,y,S){return f(p(b,y,S,!1))},"number, number, boolean":function(b,y,S){return f(p(b,y,1,S))},"number, number, number, boolean":function(b,y,S,x){return f(p(b,y,S,x))},"BigNumber, BigNumber":function(b,y){var S=b.constructor;return f(p(b,y,new S(1),!1))},"BigNumber, BigNumber, BigNumber":function(b,y,S){return f(p(b,y,S,!1))},"BigNumber, BigNumber, boolean":function(b,y,S){var x=b.constructor;return f(p(b,y,new x(1),S))},"BigNumber, BigNumber, BigNumber, boolean":function(b,y,S,x){return f(p(b,y,S,x))},"Unit, Unit, Unit":function(b,y,S){return f(p(b,y,S,!1))},"Unit, Unit, Unit, boolean":function(b,y,S,x){return f(p(b,y,S,x))}});function f(m){return r.matrix==="Matrix"?n?n(m):$P():m}function h(m,b){var y=v(m);if(!y)throw new SyntaxError('String "'+m+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&sw(),f(p(i(y.start),i(y.end),i(y.step)))):f(p(y.start,y.end,y.step,b))}function p(m,b,y,S){for(var x=[],A=c(y)?S?s:a:S?u:o,_=m;A(_,b);)x.push(_),_=l(_,y);return x}function v(m){var b=m.split(":"),y=b.map(function(x){return Number(x)}),S=y.some(function(x){return isNaN(x)});if(S)return null;switch(y.length){case 2:return{start:y[0],end:y[1],step:1};case 3:return{start:y[0],end:y[2],step:y[1]};default:return null}}}),qN="reshape",qoe=["typed","isInteger","matrix"],Hoe=G(qN,qoe,t=>{var{typed:e,isInteger:r}=t;return e(qN,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!r(s))throw new TypeError("Invalid size for dimension: "+s)}),Jx(i,a)}})}),Woe="resize",Voe=["config","matrix"],Yoe=G(Woe,Voe,t=>{var{config:e,matrix:r}=t;return function(a,s,o){if(arguments.length!==2&&arguments.length!==3)throw new Gu("resize",arguments.length,2,3);if(dt(s)&&(s=s.valueOf()),Mt(s[0])&&(s=s.map(function(c){return Mt(c)?c.toNumber():c})),dt(a))return a.resize(s,o,!0);if(typeof a=="string")return n(a,s,o);var u=Array.isArray(a)?!1:e.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return vt(a)}else{Array.isArray(a)||(a=[a]),a=vt(a);var l=pc(a,s,o);return u?r(l):l}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new Pt(a.length,1);var o=a[0];if(typeof o!="number"||!ot(o))throw new TypeError("Invalid size, must contain positive integers (size: "+Rt(a)+")");if(i.length>o)return i.substring(0,o);if(i.length{var{typed:e,multiply:r,rotationMatrix:n}=t;return e(HN,{"Array , number | BigNumber | Complex | Unit":function(s,o){i(s,2);var u=r(n(o),s);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,o){return i(s,2),r(n(o),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,o,u){i(s,3);var l=r(n(o,u),s);return l},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,o,u){return i(s,3),r(n(o,u),s)}});function i(a,s){var o=Array.isArray(a)?Nt(a):a.size();if(o.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(o.length===2&&o[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(o[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}}),WN="rotationMatrix",Xoe=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Zoe=G(WN,Xoe,t=>{var{typed:e,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:o,matrix:u,DenseMatrix:l,SparseMatrix:c,cos:f,sin:h}=t;return e(WN,{"":function(){return r.matrix==="Matrix"?u([]):[]},string:function(x){return u(x)},"number | BigNumber | Complex | Unit":function(x){return p(x,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(x,A){return p(x,A)},"number | BigNumber | Complex | Unit, Array":function(x,A){var _=u(A);return v(_),y(x,_,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(x,A){v(A);var _=A.storage()||(r.matrix==="Matrix"?"dense":void 0);return y(x,A,_)},"number | BigNumber | Complex | Unit, Array, string":function(x,A,_){var w=u(A);return v(w),y(x,w,_)},"number | BigNumber | Complex | Unit, Matrix, string":function(x,A,_){return v(A),y(x,A,_)}});function p(S,x){var A=Mt(S),_=A?new o(-1):-1,w=f(S),C=h(S),E=[[w,n(_,C)],[C,w]];return b(E,x)}function v(S){var x=S.size();if(x.length<1||x[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function m(S){return S.reduce((x,A)=>n(x,A))}function b(S,x){if(x){if(x==="sparse")return new c(S);if(x==="dense")return new l(S);throw new TypeError('Unknown matrix type "'.concat(x,'"'))}return S}function y(S,x,A){var _=s(x);if(_===0)throw new RangeError("Rotation around zero vector");var w=Mt(S)?o:null,C=w?new w(1):1,E=w?new w(-1):-1,N=w?new w(x.get([0])/_):x.get([0])/_,M=w?new w(x.get([1])/_):x.get([1])/_,O=w?new w(x.get([2])/_):x.get([2])/_,F=f(S),U=i(C,a(F)),V=h(S),H=i(F,m([N,N,U])),I=i(m([N,M,U]),m([E,O,V])),P=i(m([N,O,U]),m([M,V])),K=i(m([N,M,U]),m([O,V])),$=i(F,m([M,M,U])),se=i(m([M,O,U]),m([E,N,V])),he=i(m([N,O,U]),m([E,M,V])),ne=i(m([M,O,U]),m([N,V])),X=i(F,m([O,O,U])),de=[[H,I,P],[K,$,se],[he,ne,X]];return b(de,A)}}),VN="row",Koe=["typed","Index","matrix","range"],UP=G(VN,Koe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t;return e(VN,{"Matrix, number":a,"Array, number":function(o,u){return a(n(vt(o)),u).valueOf()}});function a(s,o){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");gr(o,s.size()[0]);var u=i(0,s.size()[1]),l=new r(o,u),c=s.subset(l);return dt(c)?c:n([[c]])}}),YN="size",Joe=["typed","config","?matrix"],Qoe=G(YN,Joe,t=>{var{typed:e,config:r,matrix:n}=t;return e(YN,{Matrix:function(a){return a.create(a.size())},Array:Nt,string:function(a){return r.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return r.matrix==="Array"?[]:n?n([]):$P()}})}),jN="squeeze",eue=["typed","matrix"],tue=G(jN,eue,t=>{var{typed:e,matrix:r}=t;return e(jN,{Array:function(i){return gv(vt(i))},Matrix:function(i){var a=gv(i.toArray());return Array.isArray(a)?r(a):a},any:function(i){return vt(i)}})}),GN="subset",rue=["typed","matrix","zeros","add"],qP=G(GN,rue,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t;return e(GN,{"Matrix, Index":function(o,u){return dc(u)?r():(vv(o,u),o.subset(u))},"Array, Index":e.referTo("Matrix, Index",function(s){return function(o,u){var l=s(r(o),u);return u.isScalar()?l:l.valueOf()}}),"Object, Index":iue,"string, Index":nue,"Matrix, Index, any, any":function(o,u,l,c){return dc(u)?o:(vv(o,u),o.clone().subset(u,a(l,u),c))},"Array, Index, any, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l,c){var f=s(r(o),u,l,c);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l){return s(r(o),u,l,void 0).valueOf()}}),"Matrix, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l){return s(o,u,l,void 0)}}),"string, Index, string":XN,"string, Index, string, string":XN,"Object, Index, any":aue});function a(s,o){if(typeof s=="string")throw new Error("can't boradcast a string");if(o._isScalar)return s;var u=o.size();if(u.every(l=>l>0))try{return i(s,n(u))}catch{return s}else return s}});function nue(t,e){if(!Ng(e))throw new TypeError("Index expected");if(dc(e))return"";if(vv(Array.from(t),e),e.size().length!==1)throw new Pt(e.size().length,1);var r=t.length;gr(e.min()[0],r),gr(e.max()[0],r);var n=e.dimension(0),i="";return n.forEach(function(a){i+=t.charAt(a)}),i}function XN(t,e,r,n){if(!e||e.isIndex!==!0)throw new TypeError("Index expected");if(dc(e))return t;if(vv(Array.from(t),e),e.size().length!==1)throw new Pt(e.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=e.dimension(0),a=i.size()[0];if(a!==r.length)throw new Pt(i.size()[0],r.length);var s=t.length;gr(e.min()[0]),gr(e.max()[0]);for(var o=[],u=0;us)for(var l=s-1,c=o.length;l{var{typed:e,matrix:r}=t;return e(ZN,{Array:s=>n(r(s)).valueOf(),Matrix:n,any:vt});function n(s){var o=s.size(),u;switch(o.length){case 1:u=s.clone();break;case 2:{var l=o[0],c=o[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Rt(o)+")");switch(s.storage()){case"dense":u=i(s,l,c);break;case"sparse":u=a(s,l,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Rt(o)+")")}return u}function i(s,o,u){for(var l=s._data,c=[],f,h=0;h{var{typed:e,transpose:r,conj:n}=t;return e(KN,{any:function(a){return n(r(a))}})}),JN="zeros",cue=["typed","config","matrix","BigNumber"],fue=G(JN,cue,t=>{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e(JN,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(l){var c=l[l.length-1];if(typeof c=="string"){var f=l.pop();return a(l,f)}else return r.matrix==="Array"?a(l):a(l,"default")},Array:a,Matrix:function(l){var c=l.storage();return a(l.valueOf(),c)},"Array | Matrix, string":function(l,c){return a(l.valueOf(),c)}});function a(u,l){var c=s(u),f=c?new i(0):0;if(o(u),l){var h=n(l);return u.length>0?h.resize(u,f):h}else{var p=[];return u.length>0?pc(p,u,f):p}}function s(u){var l=!1;return u.forEach(function(c,f,h){Mt(c)&&(l=!0,h[f]=c.toNumber())}),l}function o(u){u.forEach(function(l){if(typeof l!="number"||!ot(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),QN="fft",hue=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],due=G(QN,hue,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:o,i:u,dotDivide:l,conj:c,pow:f,ceil:h,log2:p}=t;return e(QN,{Array:v,Matrix:function(x){return x.create(v(x.toArray()))}});function v(S){var x=Nt(S);return x.length===1?y(S,x[0]):m(S.map(A=>v(A,x.slice(1))),0)}function m(S,x){var A=Nt(S);if(x!==0)return new Array(A[0]).fill(0).map((w,C)=>m(S[C],x-1));if(A.length===1)return y(S);function _(w){var C=Nt(w);return new Array(C[1]).fill(0).map((E,N)=>new Array(C[0]).fill(0).map((M,O)=>w[O][N]))}return _(m(_(S),1))}function b(S){for(var x=S.length,A=s(a(i(-1,i(u,o)),x)),_=[],w=1-x;wi(S[P],_[x-1+P])),...new Array(C-x).fill(0)],N=[...new Array(x+x-1).fill(0).map((I,P)=>a(1,_[P])),...new Array(C-(x+x-1)).fill(0)],M=y(E),O=y(N),F=new Array(C).fill(0).map((I,P)=>i(M[P],O[P])),U=l(c(v(c(F))),C),V=[],H=x-1;HN%2===0)),...y(S.filter((E,N)=>N%2===1))],_=0;_{var{typed:e,fft:r,dotDivide:n,conj:i}=t;return e(eE,{"Array | Matrix":function(s){var o=dt(s)?s.size():Nt(s);return n(i(r(i(s))),o.reduce((u,l)=>u*l,1))}})});function Hh(t){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(t)}function vue(t,e){if(Hh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gue(t){var e=vue(t,"string");return Hh(e)=="symbol"?e:String(e)}function vn(t,e,r){return e=gue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yue(t){for(var e=1;e{var{typed:e,add:r,subtract:n,multiply:i,divide:a,max:s,map:o,abs:u,isPositive:l,isNegative:c,larger:f,smaller:h,matrix:p,bignumber:v,unaryMinus:m}=t;function b(E){return function(N,M,O,F){var U=!(M.length===2&&(M.every(w)||M.every(Xi)));if(U)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var V=M[0],H=M[1],I=f(H,V),P=F.firstStep;if(P!==void 0&&!l(P))throw new Error('"firstStep" must be positive');var K=F.maxStep;if(K!==void 0&&!l(K))throw new Error('"maxStep" must be positive');var $=F.minStep;if($&&c($))throw new Error('"minStep" must be positive or zero');var se=[V,H,P,$,K].filter(R=>R!==void 0);if(!(se.every(w)||se.every(Xi)))throw new Error('Inconsistent type of "t" dependant variables');for(var he=1,ne=F.tol?F.tol:1e-4,X=F.minDelta?F.minDelta:.2,de=F.maxDelta?F.maxDelta:5,Se=F.maxIter?F.maxIter:1e4,ce=[V,H,...O,K,$].some(Mt),[xe,_e,me,we]=ce?[v(E.a),v(E.c),v(E.b),v(E.bp)]:[E.a,E.c,E.b,E.bp],Ne=P?I?P:m(P):a(n(H,V),he),Ce=[V],He=[O],qe=n(me,we),J=0,te=0,ye=A(I),ee=_(I);ye(Ce[J],H);){var ue=[];Ne=ee(Ce[J],H,Ne),ue.push(N(Ce[J],He[J]));for(var le=1;le<_e.length;++le)ue.push(N(r(Ce[J],i(_e[le],Ne)),r(He[J],i(Ne,xe[le],ue))));var Ee=s(u(o(i(qe,ue),R=>Xi(R)?R.value:R)));Ee1/4&&(Ce.push(r(Ce[J],Ne)),He.push(r(He[J],i(Ne,me,ue))),J++);var Me=.84*(ne/Ee)**(1/5);if(h(Me,X)?Me=X:f(Me,de)&&(Me=de),Me=ce?v(Me):Me,Ne=i(Ne,Me),K&&f(u(Ne),K)?Ne=I?K:m(K):$&&h(u(Ne),$)&&(Ne=I?$:m($)),te++,te>Se)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ce,y:He}}}function y(E,N,M,O){var F=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],U=[null,1/2,3/4,1],V=[2/9,1/3,4/9,0],H=[7/24,1/4,1/3,1/8],I={a:F,c:U,b:V,bp:H};return b(I)(E,N,M,O)}function S(E,N,M,O){var F=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],U=[null,1/5,3/10,4/5,8/9,1,1],V=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],H=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],I={a:F,c:U,b:V,bp:H};return b(I)(E,N,M,O)}function x(E,N,M,O){var F=O.method?O.method:"RK45",U={RK23:y,RK45:S};if(F.toUpperCase()in U){var V=yue({},O);return delete V.method,U[F.toUpperCase()](E,N,M,V)}else{var H=Object.keys(U).map(P=>'"'.concat(P,'"')),I="".concat(H.slice(0,-1).join(", ")," and ").concat(H.slice(-1));throw new Error('Unavailable method "'.concat(F,'". Available methods are ').concat(I))}}function A(E){return E?h:f}function _(E){var N=E?f:h;return function(M,O,F){var U=r(M,F);return N(U,O)?n(O,M):F}}function w(E){return Mt(E)||Ct(E)}function C(E,N,M,O){var F=x(E,N.toArray(),M.toArray(),O);return{t:p(F.t),y:p(F.y)}}return e("solveODE",{"function, Array, Array, Object":x,"function, Matrix, Matrix, Object":C,"function, Array, Array":(E,N,M)=>x(E,N,M,{}),"function, Matrix, Matrix":(E,N,M)=>C(E,N,M,{}),"function, Array, number | BigNumber | Unit":(E,N,M)=>{var O=x(E,N,[M],{});return{t:O.t,y:O.y.map(F=>F[0])}},"function, Matrix, number | BigNumber | Unit":(E,N,M)=>{var O=x(E,N.toArray(),[M],{});return{t:p(O.t),y:p(O.y.map(F=>F[0]))}},"function, Array, number | BigNumber | Unit, Object":(E,N,M,O)=>{var F=x(E,N,[M],O);return{t:F.t,y:F.y.map(U=>U[0])}},"function, Matrix, number | BigNumber | Unit, Object":(E,N,M,O)=>{var F=x(E,N.toArray(),[M],O);return{t:p(F.t),y:p(F.y.map(U=>U[0]))}}})}),Sue="erf",_ue=["typed"],Aue=G(Sue,_ue,t=>{var{typed:e}=t;return e("name",{number:function(s){var o=Math.abs(s);return o>=Eue?To(s):o<=Due?To(s)*r(o):o<=4?To(s)*(1-n(o)):To(s)*(1-i(o))},"Array | Matrix":e.referToSelf(a=>s=>It(s,a))});function r(a){var s=a*a,o=ws[0][4]*s,u=s,l;for(l=0;l<3;l+=1)o=(o+ws[0][l])*s,u=(u+Ol[0][l])*s;return a*(o+ws[0][3])/(u+Ol[0][3])}function n(a){var s=ws[1][8]*a,o=a,u;for(u=0;u<7;u+=1)s=(s+ws[1][u])*a,o=(o+Ol[1][u])*a;var l=(s+ws[1][7])/(o+Ol[1][7]),c=parseInt(a*16)/16,f=(a-c)*(a+c);return Math.exp(-c*c)*Math.exp(-f)*l}function i(a){var s=1/(a*a),o=ws[2][5]*s,u=s,l;for(l=0;l<4;l+=1)o=(o+ws[2][l])*s,u=(u+Ol[2][l])*s;var c=s*(o+ws[2][4])/(u+Ol[2][4]);c=(Nue-c)/a,s=parseInt(a*16)/16;var f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*c}}),Due=.46875,Nue=.5641895835477563,ws=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Ol=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Eue=Math.pow(2,53),rE="zeta",Cue=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Mue=G(rE,Cue,t=>{var{typed:e,config:r,multiply:n,pow:i,divide:a,factorial:s,equal:o,smallerEq:u,isNegative:l,gamma:c,sin:f,subtract:h,add:p,Complex:v,BigNumber:m,pi:b}=t;return e(rE,{number:w=>y(w,C=>C,()=>20),BigNumber:w=>y(w,C=>new m(C),()=>Math.abs(Math.log10(r.epsilon))),Complex:S});function y(w,C,E){return o(w,0)?C(-.5):o(w,1)?C(NaN):isFinite(w)?x(w,C,E,N=>N):l(w)?C(NaN):C(1)}function S(w){return w.re===0&&w.im===0?new v(-.5):w.re===1?new v(NaN,NaN):w.re===1/0&&w.im===0?new v(1):w.im===1/0||w.re===-1/0?new v(NaN,NaN):x(w,C=>C,C=>Math.round(1.3*15+.9*Math.abs(C.im)),C=>C.re)}function x(w,C,E,N){var M=E(w);if(N(w)>-(M-1)/2)return _(w,C(M),C);var O=n(i(2,w),i(C(b),h(w,1)));return O=n(O,f(n(a(C(b),2),w))),O=n(O,c(h(1,w))),n(O,x(h(1,w),C,E,N))}function A(w,C){for(var E=w,N=w;u(N,C);N=p(N,1)){var M=a(n(s(p(C,h(N,1))),i(4,N)),n(s(h(C,N)),s(n(2,N))));E=p(E,M)}return n(C,E)}function _(w,C,E){for(var N=a(1,n(A(E(0),C),h(1,i(2,h(1,w))))),M=E(0),O=E(1);u(O,C);O=p(O,1))M=p(M,a(n((-1)**(O-1),A(O,C)),i(O,w)));return n(N,M)}}),nE="mode",Tue=["typed","isNaN","isNumeric"],Oue=G(nE,Tue,t=>{var{typed:e,isNaN:r,isNumeric:n}=t;return e(nE,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=tr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var o={},u=[],l=0,c=0;cl&&(l=o[f],u=[f])}return u}});function ii(t,e,r){var n;return String(t).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+xr(r)+", value: "+JSON.stringify(r)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+n)):String(t).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+xr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+n)):t}var iE="prod",Fue=["typed","config","multiplyScalar","numeric"],Rue=G(iE,Fue,t=>{var{typed:e,config:r,multiplyScalar:n,numeric:i}=t;return e(iE,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(s){var o;if(Ws(s,function(u){try{o=o===void 0?u:n(o,u)}catch(l){throw ii(l,"prod",u)}}),typeof o=="string"&&(o=i(o,r.number)),o===void 0)throw new Error("Cannot calculate prod of an empty array");return o}}),aE="format",Bue=["typed"],Pue=G(aE,Bue,t=>{var{typed:e}=t;return e(aE,{any:Rt,"any, Object | function | number | BigNumber":Rt})}),sE="bin",Iue=["typed","format"],kue=G(sE,Iue,t=>{var{typed:e,format:r}=t;return e(sE,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"bin",wordSize:a})}})}),oE="oct",Lue=["typed","format"],$ue=G(oE,Lue,t=>{var{typed:e,format:r}=t;return e(oE,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"oct",wordSize:a})}})}),uE="hex",zue=["typed","format"],Uue=G(uE,zue,t=>{var{typed:e,format:r}=t;return e(uE,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"hex",wordSize:a})}})}),HP=/\$([\w.]+)/g,lE="print",que=["typed"],WP=G(lE,que,t=>{var{typed:e}=t;return e(lE,{"string, Object | Array":cE,"string, Object | Array, number | Object":cE})});function cE(t,e,r){return t.replace(HP,function(n,i){var a=i.split("."),s=e[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var o=a.shift();s=o?s[o]:s+"."}return s!==void 0?$n(s)?s:Rt(s,r):n})}var fE="to",Hue=["typed","matrix","concat"],Wue=G(fE,Hue,t=>{var{typed:e,matrix:r,concat:n}=t,i=_r({typed:e,matrix:r,concat:n});return e(fE,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))}),hE="isPrime",Vue=["typed"],Yue=G(hE,Vue,t=>{var{typed:e}=t;return e(hE,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(S,x,A){for(var _=1;!x.eq(0);)x.mod(2).eq(0)?(x=x.div(2),S=S.mul(S).mod(A)):(x=x.sub(1),_=S.mul(_).mod(A));return _}var o=n.constructor.clone({precision:n.toFixed(0).length*2});n=new o(n);for(var u=0,l=n.sub(1);l.mod(2).eq(0);)l=l.div(2),u+=1;var c=null;if(n.lt("3317044064679887385961981"))c=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(S=>Sn=>It(n,r))})}),jue="numeric",Gue=["number","?bignumber","?fraction"],Xue=G(jue,Gue,t=>{var{number:e,bignumber:r,fraction:n}=t,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>e(s),BigNumber:r?s=>r(s):sw,Fraction:n?s=>n(s):LP};return function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",l=arguments.length>2?arguments[2]:void 0;if(l!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=xr(o);if(!(c in i))throw new TypeError("Cannot convert "+o+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===c?o:a[u](o)}}),dE="divideScalar",Zue=["typed","numeric"],Kue=G(dE,Zue,t=>{var{typed:e,numeric:r}=t;return e(dE,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),pE="pow",Jue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Que=G(pE,Jue,t=>{var{typed:e,config:r,identity:n,multiply:i,matrix:a,inv:s,number:o,fraction:u,Complex:l}=t;return e(pE,{"number, number":c,"Complex, Complex":function(v,m){return v.pow(m)},"BigNumber, BigNumber":function(v,m){return m.isInteger()||v>=0||r.predictable?v.pow(m):new l(v.toNumber(),0).pow(m.toNumber(),0)},"Fraction, Fraction":function(v,m){var b=v.pow(m);if(b!=null)return b;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(v.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(v,m){return f(v,m.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(v,m){return h(v,m.toNumber())},"Unit, number | BigNumber":function(v,m){return v.pow(m)}});function c(p,v){if(r.predictable&&!ot(v)&&p<0)try{var m=u(v),b=o(m);if((v===b||Math.abs((v-b)/v)<1e-14)&&m.d%2===1)return(m.n%2===0?1:-1)*Math.pow(-p,v)}catch{}return r.predictable&&(p<-1&&v===1/0||p>-1&&p<0&&v===-1/0)?NaN:ot(v)||p>=0||r.predictable?GB(p,v):p*p<1&&v===1/0||p*p>1&&v===-1/0?0:new l(p,0).pow(v,0)}function f(p,v){if(!ot(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var m=Nt(p);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(v<0)try{return f(s(p),-v)}catch(S){throw S.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):S}for(var b=n(m[0]).valueOf(),y=p;v>=1;)(v&1)===1&&(b=i(y,b)),v>>=1,y=i(y,y);return b}function h(p,v){return a(f(p.valueOf(),v))}}),Fl="Number of decimals in function round must be an integer",mE="round",ele=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],tle=G(mE,ele,t=>{var{typed:e,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:i}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e});function f(h){return Math.abs(fd(h).exponent)}return e(mE,{number:function(p){var v=Yf(p,f(r.epsilon)),m=ni(p,v,r.epsilon)?v:p;return Yf(m)},"number, number":function(p,v){var m=f(r.epsilon);if(v>=m)return Yf(p,v);var b=Yf(p,m),y=ni(p,b,r.epsilon)?b:p;return Yf(y,v)},"number, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);return new s(p).toDecimalPlaces(v.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,v){if(v%1)throw new TypeError(Fl);return p.round(v)},"Complex, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);var m=v.toNumber();return p.round(m)},BigNumber:function(p){var v=new s(p).toDecimalPlaces(f(r.epsilon)),m=ia(p,v,r.epsilon)?v:p;return m.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);var m=f(r.epsilon);if(v>=m)return p.toDecimalPlaces(v.toNumber());var b=p.toDecimalPlaces(m),y=ia(p,b,r.epsilon)?b:p;return y.toDecimalPlaces(v.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,v){if(v%1)throw new TypeError(Fl);return p.round(v)},"Fraction, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);return p.round(v.toNumber())},"Unit, number, Unit":e.referToSelf(h=>function(p,v,m){var b=p.toNumeric(m);return m.multiply(h(b,v))}),"Unit, BigNumber, Unit":e.referToSelf(h=>(p,v,m)=>h(p,v.toNumber(),m)),"Unit, Unit":e.referToSelf(h=>(p,v)=>h(p,0,v)),"Array | Matrix, number, Unit":e.referToSelf(h=>(p,v,m)=>It(p,b=>h(b,v,m))),"Array | Matrix, BigNumber, Unit":e.referToSelf(h=>(p,v,m)=>h(p,v.toNumber(),m)),"Array | Matrix, Unit":e.referToSelf(h=>(p,v)=>h(p,0,v)),"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>c(n(p),v,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(h=>(p,v)=>i(p,0)?a(v.size(),v.storage()):l(v,p,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(h=>(p,v)=>i(p,0)?a(v.size(),v.storage()):c(v,p,h,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(h=>(p,v)=>c(n(v),p,h,!0).valueOf())})}),vE="log",rle=["config","typed","divideScalar","Complex"],nle=G(vE,rle,t=>{var{typed:e,config:r,divideScalar:n,Complex:i}=t;return e(vE,{number:function(s){return s>=0||r.predictable?tie(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":e.referToSelf(a=>(s,o)=>n(a(s),a(o)))})}),gE="log1p",ile=["typed","config","divideScalar","log","Complex"],ale=G(gE,ile,t=>{var{typed:e,config:r,divideScalar:n,log:i,Complex:a}=t;return e(gE,{number:function(u){return u>=-1||r.predictable?Qte(u):s(new a(u,0))},Complex:s,BigNumber:function(u){var l=u.plus(1);return!l.isNegative()||r.predictable?l.ln():s(new a(u.toNumber(),0))},"Array | Matrix":e.referToSelf(o=>u=>It(u,o)),"any, any":e.referToSelf(o=>(u,l)=>n(o(u),i(l)))});function s(o){var u=o.re+1;return new a(Math.log(Math.sqrt(u*u+o.im*o.im)),Math.atan2(o.im,u))}}),yE="nthRoots",sle=["config","typed","divideScalar","Complex"],ole=G(yE,sle,t=>{var{typed:e,config:r,divideScalar:n,Complex:i}=t,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function s(o,u){if(u<0)throw new Error("Root must be greater than zero");if(u===0)throw new Error("Root must be non-zero");if(u%1!==0)throw new Error("Root must be an integer");if(o===0||o.abs()===0)return[new i(0,0)];var l=typeof o=="number",c;(l||o.re===0||o.im===0)&&(l?c=2*+(o<0):o.im===0?c=2*+(o.re<0):c=2*+(o.im<0)+1);for(var f=o.arg(),h=o.abs(),p=[],v=Math.pow(h,1/u),m=0;m{var{typed:e,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:s}=t,o=ai({typed:e}),u=es({typed:e,DenseMatrix:a}),l=Fn({typed:e,equalScalar:r}),c=gn({typed:e,DenseMatrix:a}),f=_r({typed:e,matrix:n,concat:s}),h={};for(var p in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,p)&&!p.includes("Matrix")&&!p.includes("Array")&&(h[p]=i.signatures[p]);var v=e(h);return e(bE,f({elop:v,SS:u,DS:o,Ss:l,sS:c}))}),xE="dotDivide",cle=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],fle=G(xE,cle,t=>{var{typed:e,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=ai({typed:e}),l=es({typed:e,DenseMatrix:a}),c=Fn({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:a}),h=_r({typed:e,matrix:r,concat:s});return e(xE,h({elop:i,SS:l,DS:u,SD:o,Ss:c,sS:f}))});function dd(t){var{DenseMatrix:e}=t;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Rt(s)+")");var o=s[0],u=s[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Rt(s)+")");var l=[];if(dt(i)){var c=i.size(),f=i._data;if(c.length===1){if(c[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(wE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.valueOf()}});function l(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=[],y=f._data,S=0;SA&&(C.push(b[O]),E.push(F))}if(s(w,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var U=n(_,w),V=0,H=E.length;V{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(SE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.valueOf()}});function l(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=[],y=f._data,S=m-1;S>=0;S--){var x=p[S][0]||0,A=void 0;if(s(x,0))A=0;else{var _=y[S][S];if(s(_,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(x,_);for(var w=S-1;w>=0;w--)p[w]=[a(p[w][0]||0,i(A,y[w][S]))]}b[S]=[A]}return new o({data:b,size:[v,1]})}function c(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=[],A=m-1;A>=0;A--){var _=p[A][0]||0;if(s(_,0))x[A]=[0];else{for(var w=0,C=[],E=[],N=S[A],M=S[A+1],O=M-1;O>=N;O--){var F=y[O];F===A?w=b[O]:F{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(_E,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.map(b=>b.valueOf())}});function l(f,h){for(var p=[u(f,h,!0)._data.map(E=>E[0])],v=f._data,m=f._size[0],b=f._size[1],y=0;ynew o({data:E.map(N=>[N]),size:[m,1]}))}function c(f,h){for(var p=[u(f,h,!0)._data.map(he=>he[0])],v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=0;xx&&(C.push(b[F]),E.push(U))}if(s(O,0))if(s(w[x],0)){if(_===0){var P=[...w];P[x]=1;for(var K=0,$=E.length;K<$;K++){var se=E[K];P[se]=a(P[se],C[K])}p.push(P)}}else{if(_===0)return[];p.splice(_,1),_-=1,A-=1}else{w[x]=n(w[x],O);for(var V=0,H=E.length;Vnew o({data:he.map(ne=>[ne]),size:[v,1]}))}}),AE="usolveAll",yle=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],ble=G(AE,yle,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(AE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.map(b=>b.valueOf())}});function l(f,h){for(var p=[u(f,h,!0)._data.map(E=>E[0])],v=f._data,m=f._size[0],b=f._size[1],y=b-1;y>=0;y--)for(var S=p.length,x=0;x=0;C--)w[C]=a(w[C],v[C][y]);p.push(w)}}else{if(x===0)return[];p.splice(x,1),x-=1,S-=1}else{A[y]=n(A[y],v[y][y]);for(var _=y-1;_>=0;_--)A[_]=a(A[_],i(A[y],v[_][y]))}}return p.map(E=>new o({data:E.map(N=>[N]),size:[m,1]}))}function c(f,h){for(var p=[u(f,h,!0)._data.map(he=>he[0])],v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=m-1;x>=0;x--)for(var A=p.length,_=0;_=N;F--){var U=y[F];U===x?O=b[F]:Unew o({data:he.map(ne=>[ne]),size:[v,1]}))}}),xle="matAlgo08xS0Sid",wle=["typed","equalScalar"],ow=G(xle,wle,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!o||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));for(var C=[],E=[],N=[],M=[],O=[],F,U,V,H,I=0;I{var{typed:e,matrix:r}=t;return{"Array, number":e.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":e.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":e.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":e.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),DE="leftShift",Sle=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],_le=G(DE,Sle,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=ow({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=_r({typed:e,matrix:r,concat:s}),v=uw({typed:e,matrix:r});return e(DE,{"number, number":QB,"BigNumber, BigNumber":Hse,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),NE="rightArithShift",Ale=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Dle=G(NE,Ale,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=ow({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=_r({typed:e,matrix:r,concat:s}),v=uw({typed:e,matrix:r});return e(NE,{"number, number":eP,"BigNumber, BigNumber":Wse,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),EE="rightLogShift",Nle=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Ele=G(EE,Nle,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=ow({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=_r({typed:e,matrix:r,concat:s}),v=uw({typed:e,matrix:r});return e(EE,{"number, number":tP,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),CE="and",Cle=["typed","matrix","equalScalar","zeros","not","concat"],VP=G(CE,Cle,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=Lg({typed:e,equalScalar:n}),l=Fn({typed:e,equalScalar:n}),c=Oa({typed:e}),f=_r({typed:e,matrix:r,concat:s});return e(CE,{"number, number":sP,"Complex, Complex":function(p,v){return(p.re!==0||p.im!==0)&&(v.re!==0||v.im!==0)},"BigNumber, BigNumber":function(p,v){return!p.isZero()&&!v.isZero()&&!p.isNaN()&&!v.isNaN()},"Unit, Unit":e.referToSelf(h=>(p,v)=>h(p.value||0,v.value||0)),"SparseMatrix, any":e.referToSelf(h=>(p,v)=>a(v)?i(p.size(),p.storage()):l(p,v,h,!1)),"DenseMatrix, any":e.referToSelf(h=>(p,v)=>a(v)?i(p.size(),p.storage()):c(p,v,h,!1)),"any, SparseMatrix":e.referToSelf(h=>(p,v)=>a(p)?i(p.size(),p.storage()):l(v,p,h,!0)),"any, DenseMatrix":e.referToSelf(h=>(p,v)=>a(p)?i(p.size(),p.storage()):c(v,p,h,!0)),"Array, any":e.referToSelf(h=>(p,v)=>h(r(p),v).valueOf()),"any, Array":e.referToSelf(h=>(p,v)=>h(p,r(v)).valueOf())},f({SS:u,DS:o}))}),Mv="compare",Mle=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Tle=G(Mv,Mle,t=>{var{typed:e,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:o,concat:u}=t,l=ai({typed:e}),c=kg({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:o}),h=_r({typed:e,matrix:i,concat:u}),p=Tc({typed:e});return e(Mv,Ole({typed:e,config:r}),{"boolean, boolean":function(m,b){return m===b?0:m>b?1:-1},"BigNumber, BigNumber":function(m,b){return ia(m,b,r.epsilon)?new a(0):new a(m.cmp(b))},"Fraction, Fraction":function(m,b){return new s(m.compare(b))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,h({SS:c,DS:l,Ss:f}))}),Ole=G(Mv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Mv,{"number, number":function(i,a){return ni(i,a,r.epsilon)?0:i>a?1:-1}})}),Fle=function t(e,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,o=/^0/,u=function(x){return t.insensitive&&(""+x).toLowerCase()||""+x},l=u(e).replace(i,"")||"",c=u(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=c.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(l.match(s),16)||f.length!==1&&l.match(a)&&Date.parse(l),v=parseInt(c.match(s),16)||p&&c.match(a)&&Date.parse(c)||null,m,b;if(v){if(pv)return 1}for(var y=0,S=Math.max(f.length,h.length);yb)return 1}return 0};const Rl=zu(Fle);var ME="compareNatural",Rle=["typed","compare"],Ble=G(ME,Rle,t=>{var{typed:e,compare:r}=t,n=r.signatures["boolean,boolean"];return e(ME,{"any, any":i});function i(u,l){var c=xr(u),f=xr(l),h;if((c==="number"||c==="BigNumber"||c==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return h=r(u,l),h.toString()!=="0"?h>0?1:-1:Rl(c,f);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(c)||p.includes(f))return h=a(i,u,l),h!==0?h:Rl(c,f);if(c!==f)return Rl(c,f);if(c==="Complex")return Ple(u,l);if(c==="Unit")return u.equalBase(l)?i(u.value,l.value):s(i,u.formatUnits(),l.formatUnits());if(c==="boolean")return n(u,l);if(c==="string")return Rl(u,l);if(c==="Object")return o(i,u,l);if(c==="null"||c==="undefined")return 0;throw new TypeError('Unsupported type of value "'+c+'"')}function a(u,l,c){return Eu(l)&&Eu(c)?s(u,l.toJSON().values,c.toJSON().values):Eu(l)?a(u,l.toArray(),c):Eu(c)?a(u,l,c.toArray()):mv(l)?a(u,l.toJSON().data,c):mv(c)?a(u,l,c.toJSON().data):Array.isArray(l)?Array.isArray(c)?s(u,l,c):a(u,l,[c]):a(u,[l],c)}function s(u,l,c){for(var f=0,h=Math.min(l.length,c.length);fc.length?1:l.lengthe.re?1:t.ree.im?1:t.im{var{typed:e,matrix:r,concat:n}=t,i=_r({typed:e,matrix:r,concat:n});return e(TE,Vb,i({elop:Vb,Ds:!0}))}),Tv="equal",Lle=["typed","matrix","equalScalar","DenseMatrix","concat"],$le=G(Tv,Lle,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:r,concat:a});return e(Tv,zle({typed:e,equalScalar:n}),l({elop:n,SS:o,DS:s,Ss:u}))}),zle=G(Tv,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(Tv,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:r(i,a)}})}),OE="equalText",Ule=["typed","compareText","isZero"],qle=G(OE,Ule,t=>{var{typed:e,compareText:r,isZero:n}=t;return e(OE,{"any, any":function(a,s){return n(r(a,s))}})}),Ov="smaller",Hle=["typed","config","matrix","DenseMatrix","concat"],Wle=G(Ov,Hle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:n,concat:a}),c=Tc({typed:e});return e(Ov,Vle({typed:e,config:r}),{"boolean, boolean":(f,h)=>ff.compare(h)===-1,"Complex, Complex":function(h,p){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Vle=G(Ov,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Ov,{"number, number":function(i,a){return i{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:n,concat:a}),c=Tc({typed:e});return e(Fv,Gle({typed:e,config:r}),{"boolean, boolean":(f,h)=>f<=h,"BigNumber, BigNumber":function(h,p){return h.lte(p)||ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Gle=G(Fv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Fv,{"number, number":function(i,a){return i<=a||ni(i,a,r.epsilon)}})}),Rv="larger",Xle=["typed","config","matrix","DenseMatrix","concat"],Zle=G(Rv,Xle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:n,concat:a}),c=Tc({typed:e});return e(Rv,Kle({typed:e,config:r}),{"boolean, boolean":(f,h)=>f>h,"BigNumber, BigNumber":function(h,p){return h.gt(p)&&!ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Kle=G(Rv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Rv,{"number, number":function(i,a){return i>a&&!ni(i,a,r.epsilon)}})}),Bv="largerEq",Jle=["typed","config","matrix","DenseMatrix","concat"],Qle=G(Bv,Jle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=_r({typed:e,matrix:n,concat:a}),c=Tc({typed:e});return e(Bv,ece({typed:e,config:r}),{"boolean, boolean":(f,h)=>f>=h,"BigNumber, BigNumber":function(h,p){return h.gte(p)||ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),ece=G(Bv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Bv,{"number, number":function(i,a){return i>=a||ni(i,a,r.epsilon)}})}),FE="deepEqual",tce=["typed","equal"],rce=G(FE,tce,t=>{var{typed:e,equal:r}=t;return e(FE,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var o=0;o{var{typed:e,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=t,o=ai({typed:e}),u=es({typed:e,DenseMatrix:a}),l=gn({typed:e,DenseMatrix:a}),c=_r({typed:e,matrix:i,concat:s});return e(Pv,ace({typed:e,equalScalar:n}),c({elop:f,SS:u,DS:o,Ss:l}));function f(h,p){return!n(h,p)}}),ace=G(Pv,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(Pv,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!r(i,a)}})}),RE="partitionSelect",sce=["typed","isNumeric","isNaN","compare"],oce=G(RE,sce,t=>{var{typed:e,isNumeric:r,isNaN:n,compare:i}=t,a=i,s=(l,c)=>-i(l,c);return e(RE,{"Array | Matrix, number":function(c,f){return o(c,f,a)},"Array | Matrix, number, string":function(c,f,h){if(h==="asc")return o(c,f,a);if(h==="desc")return o(c,f,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":o});function o(l,c,f){if(!ot(c)||c<0)throw new Error("k must be a non-negative integer");if(dt(l)){var h=l.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return u(l.valueOf(),c,f)}if(Array.isArray(l))return u(l,c,f)}function u(l,c,f){if(c>=l.length)throw new Error("k out of bounds");for(var h=0;h=0){var S=l[b];l[b]=l[m],l[m]=S,--b}else++m;f(l[m],y)>0&&--m,c<=m?v=m:p=m+1}return l[c]}}),BE="sort",uce=["typed","matrix","compare","compareNatural"],lce=G(BE,uce,t=>{var{typed:e,matrix:r,compare:n,compareNatural:i}=t,a=n,s=(c,f)=>-n(c,f);return e(BE,{Array:function(f){return u(f),f.sort(a)},Matrix:function(f){return l(f),r(f.toArray().sort(a),f.storage())},"Array, function":function(f,h){return u(f),f.sort(h)},"Matrix, function":function(f,h){return l(f),r(f.toArray().sort(h),f.storage())},"Array, string":function(f,h){return u(f),f.sort(o(h))},"Matrix, string":function(f,h){return l(f),r(f.toArray().sort(o(h)),f.storage())}});function o(c){if(c==="asc")return a;if(c==="desc")return s;if(c==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(c){if(Nt(c).length!==1)throw new Error("One dimensional array expected")}function l(c){if(c.size().length!==1)throw new Error("One dimensional matrix expected")}}),PE="max",cce=["typed","config","numeric","larger"],YP=G(PE,cce,t=>{var{typed:e,config:r,numeric:n,larger:i}=t;return e(PE,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,l){return Pg(u,l.valueOf(),a)},"...":function(u){if(Ec(u))throw new TypeError("Scalar values expected in function max");return s(u)}});function a(o,u){try{return i(o,u)?o:u}catch(l){throw ii(l,"max",u)}}function s(o){var u;if(Ws(o,function(l){try{isNaN(l)&&typeof l=="number"?u=NaN:(u===void 0||i(l,u))&&(u=l)}catch(c){throw ii(c,"max",l)}}),u===void 0)throw new Error("Cannot calculate max of an empty array");return typeof u=="string"&&(u=n(u,r.number)),u}}),IE="min",fce=["typed","config","numeric","smaller"],jP=G(IE,fce,t=>{var{typed:e,config:r,numeric:n,smaller:i}=t;return e(IE,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,l){return Pg(u,l.valueOf(),a)},"...":function(u){if(Ec(u))throw new TypeError("Scalar values expected in function min");return s(u)}});function a(o,u){try{return i(o,u)?o:u}catch(l){throw ii(l,"min",u)}}function s(o){var u;if(Ws(o,function(l){try{isNaN(l)&&typeof l=="number"?u=NaN:(u===void 0||i(l,u))&&(u=l)}catch(c){throw ii(c,"min",l)}}),u===void 0)throw new Error("Cannot calculate min of an empty array");return typeof u=="string"&&(u=n(u,r.number)),u}}),hce="ImmutableDenseMatrix",dce=["smaller","DenseMatrix"],pce=G(hce,dce,t=>{var{smaller:e,DenseMatrix:r}=t;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!$n(a))throw new Error("Invalid datatype: "+a);if(dt(i)||sr(i)){var s=new r(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&sr(i.data)&&sr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+xr(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return dt(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:vt(this._data),size:vt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||e(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||e(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),mce="Index",vce=["ImmutableDenseMatrix","getMatrixDataType"],gce=G(mce,vce,t=>{var{ImmutableDenseMatrix:e,getMatrixDataType:r}=t;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,o=arguments.length;s{r&&e.push(n)}),e}var yce="FibonacciHeap",bce=["smaller","larger"],xce=G(yce,bce,t=>{var{smaller:e,larger:r}=t,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(c,f){var h={key:c,value:f,degree:0};if(this._minimum){var p=this._minimum;h.left=p,h.right=p.right,p.right=h,h.right.left=h,e(c,p.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var c=this._minimum;if(c===null)return c;for(var f=this._minimum,h=c.degree,p=c.child;h>0;){var v=p.right;p.left.right=p.right,p.right.left=p.left,p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p=v,h--}return c.left.right=c.right,c.right.left=c.left,c===c.right?f=null:(f=c.right,f=l(f,this._size)),this._size--,this._minimum=f,c},i.prototype.remove=function(c){this._minimum=a(this._minimum,c,-1),this.extractMinimum()};function a(c,f,h){f.key=h;var p=f.parent;return p&&e(f.key,p.key)&&(s(c,f,p),o(c,p)),e(f.key,c.key)&&(c=f),c}function s(c,f,h){f.left.right=f.right,f.right.left=f.left,h.degree--,h.child===f&&(h.child=f.right),h.degree===0&&(h.child=null),f.left=c,f.right=c.right,c.right=f,f.right.left=f,f.parent=null,f.mark=!1}function o(c,f){var h=f.parent;h&&(f.mark?(s(c,f,h),o(h)):f.mark=!0)}var u=function(f,h){f.left.right=f.right,f.right.left=f.left,f.parent=h,h.child?(f.left=h.child,f.right=h.child.right,h.child.right=f,f.right.left=f):(h.child=f,f.right=f,f.left=f),h.degree++,f.mark=!1};function l(c,f){var h=Math.floor(Math.log(f)*n)+1,p=new Array(h),v=0,m=c;if(m)for(v++,m=m.right;m!==c;)v++,m=m.right;for(var b;v>0;){for(var y=m.degree,S=m.right;b=p[y],!!b;){if(r(m.key,b.key)){var x=b;b=m,m=x}u(b,m),p[y]=null,y++}p[y]=m,m=S,v--}c=null;for(var A=0;A{var{addScalar:e,equalScalar:r,FibonacciHeap:n}=t;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var o=this._heap.insert(a,s);this._values[a]=o}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var o=this._values[a];o?o.value=e(o.value,s):(o=this._heap.insert(a,s),this._values[a]=o)},i.prototype.forEach=function(a,s,o){var u=this._heap,l=this._values,c=[],f=u.extractMinimum();for(f&&c.push(f);f&&f.key<=s;)f.key>=a&&(r(f.value,0)||o(f.key,f.value,this)),f=u.extractMinimum(),f&&c.push(f);for(var h=0;h{var{on:e,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:o,abs:u,fix:l,round:c,equal:f,isNumeric:h,format:p,number:v,Complex:m,BigNumber:b,Fraction:y}=t,S=v;function x(J,te){if(!(this instanceof x))throw new Error("Constructor must be called with the new operator");if(!(J==null||h(J)||$s(J)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=K.map(ee=>0);else if(typeof te=="string"){var ye=x.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(Xi(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>dn({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(J)}Object.defineProperty(x,"name",{value:"Unit"}),x.prototype.constructor=x,x.prototype.type="Unit",x.prototype.isUnit=!0;var A,_,w;function C(){for(;w===" "||w===" ";)M()}function E(J){return J>="0"&&J<="9"||J==="."}function N(J){return J>="0"&&J<="9"}function M(){_++,w=A.charAt(_)}function O(J){_=J,w=A.charAt(_)}function F(){var J="",te=_;if(w==="+"?M():w==="-"&&(J+=w,M()),!E(w))return O(te),null;if(w==="."){if(J+=w,M(),!N(w))return O(te),null}else{for(;N(w);)J+=w,M();w==="."&&(J+=w,M())}for(;N(w);)J+=w,M();if(w==="E"||w==="e"){var ye="",ee=_;if(ye+=w,M(),(w==="+"||w==="-")&&(ye+=w,M()),!N(w))return O(ee),J;for(J=J+ye;N(w);)J+=w,M()}return J}function U(){for(var J="";N(w)||x.isValidAlpha(w);)J+=w,M();var te=J.charAt(0);return x.isValidAlpha(te)?J:null}function V(J){return w===J?(M(),J):null}x.parse=function(J,te){if(te=te||{},A=J,_=-1,w="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new x;ye.units=[];var ee=1,ue=!1;M(),C();var le=F(),Ee=null;if(le){if(r.number==="BigNumber")Ee=new b(le);else if(r.number==="Fraction")try{Ee=new y(le)}catch{Ee=parseFloat(le)}else Ee=parseFloat(le);C(),V("*")?(ee=1,ue=!0):V("/")&&(ee=-1,ue=!0)}for(var Me=[],R=1;;){for(C();w==="(";)Me.push(ee),R*=ee,ee=1,M(),C();var q=void 0;if(w){var Y=w;if(q=U(),q===null)throw new SyntaxError('Unexpected "'+Y+'" in "'+A+'" at index '+_.toString())}else break;var pe=H(q);if(pe===null)throw new SyntaxError('Unit "'+q+'" not found.');var ge=ee*R;if(C(),V("^")){C();var De=F();if(De===null)throw new SyntaxError('In "'+J+'", "^" must be followed by a floating-point number');ge*=De}ye.units.push({unit:pe.unit,prefix:pe.prefix,power:ge});for(var Be=0;Be1||Math.abs(this.units[0].power-1)>1e-15},x.prototype._normalize=function(J){if(J==null||this.units.length===0)return J;for(var te=J,ye=x._getNumberConverter(xr(J)),ee=0;ee{if(tt(X,J)){var te=X[J],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in X)if(tt(X,ee)&&vre(J,ee)){var ue=X[ee],le=J.length-ee.length,Ee=J.substring(0,le),Me=tt(ue.prefixes,Ee)?ue.prefixes[Ee]:void 0;if(Me!==void 0)return{unit:ue,prefix:Me}}return null},{hasher:J=>J[0],limit:100});x.isValuelessUnit=function(J){return H(J)!==null},x.prototype.hasBase=function(J){if(typeof J=="string"&&(J=$[J]),!J)return!1;for(var te=0;te1e-12)return!1;return!0},x.prototype.equalBase=function(J){for(var te=0;te1e-12)return!1;return!0},x.prototype.equals=function(J){return this.equalBase(J)&&f(this.value,J.value)},x.prototype.multiply=function(J){for(var te=this.clone(),ye=Xi(J)?J:new x(J),ee=0;ee1e-12&&(tt(xe,Me)?te.push({unit:xe[Me].unit,prefix:xe[Me].prefix,power:J.dimensions[Ee]||0}):le=!0)}te.length1e-12)if(tt(ce.si,ee))te.push({unit:ce.si[ee].unit,prefix:ce.si[ee].prefix,power:J.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return J.units=te,J.fixPrefix=!0,J.skipAutomaticSimplification=!0,this.value!==null?(J.value=null,this.to(J)):J},x.prototype.formatUnits=function(){for(var J="",te="",ye=0,ee=0,ue=0;ue0?(ye++,J+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power-1)>1e-15&&(J+="^"+this.units[ue].power)):this.units[ue].power<0&&ee++;if(ee>0)for(var le=0;le0?(te+=" "+this.units[le].prefix.name+this.units[le].unit.name,Math.abs(this.units[le].power+1)>1e-15&&(te+="^"+-this.units[le].power)):(te+=" "+this.units[le].prefix.name+this.units[le].unit.name,te+="^"+this.units[le].power));J=J.substr(1),te=te.substr(1),ye>1&&ee>0&&(J="("+J+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=J;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},x.prototype.format=function(J){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&$s(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)tt(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=X.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=X.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ue=te._denormalize(te.value),le=te.value!==null?p(ue,J||{}):"",Ee=te.formatUnits();return te.value&&$s(te.value)&&(le="("+le+")"),Ee.length>0&&le.length>0&&(le+=" "),le+=Ee,le},x.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var J=this.value!==null?u(this.value):0,te=u(this.units[0].unit.value),ye=this.units[0].prefix;if(J===0)return ye;var ee=this.units[0].power,ue=Math.log(J/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ue>-2.200001&&ue<1.800001)return ye;ue=Math.abs(ue);var le=this.units[0].unit.prefixes;for(var Ee in le)if(tt(le,Ee)){var Me=le[Ee];if(Me.scientific){var R=Math.abs(Math.log(J/Math.pow(Me.value*te,ee))/Math.LN10-1.2);(R0)},X={meter:{name:"meter",base:$.LENGTH,prefixes:P.LONG,value:1,offset:0},inch:{name:"inch",base:$.LENGTH,prefixes:P.NONE,value:.0254,offset:0},foot:{name:"foot",base:$.LENGTH,prefixes:P.NONE,value:.3048,offset:0},yard:{name:"yard",base:$.LENGTH,prefixes:P.NONE,value:.9144,offset:0},mile:{name:"mile",base:$.LENGTH,prefixes:P.NONE,value:1609.344,offset:0},link:{name:"link",base:$.LENGTH,prefixes:P.NONE,value:.201168,offset:0},rod:{name:"rod",base:$.LENGTH,prefixes:P.NONE,value:5.0292,offset:0},chain:{name:"chain",base:$.LENGTH,prefixes:P.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:$.LENGTH,prefixes:P.NONE,value:1e-10,offset:0},m:{name:"m",base:$.LENGTH,prefixes:P.SHORT,value:1,offset:0},in:{name:"in",base:$.LENGTH,prefixes:P.NONE,value:.0254,offset:0},ft:{name:"ft",base:$.LENGTH,prefixes:P.NONE,value:.3048,offset:0},yd:{name:"yd",base:$.LENGTH,prefixes:P.NONE,value:.9144,offset:0},mi:{name:"mi",base:$.LENGTH,prefixes:P.NONE,value:1609.344,offset:0},li:{name:"li",base:$.LENGTH,prefixes:P.NONE,value:.201168,offset:0},rd:{name:"rd",base:$.LENGTH,prefixes:P.NONE,value:5.02921,offset:0},ch:{name:"ch",base:$.LENGTH,prefixes:P.NONE,value:20.1168,offset:0},mil:{name:"mil",base:$.LENGTH,prefixes:P.NONE,value:254e-7,offset:0},m2:{name:"m2",base:$.SURFACE,prefixes:P.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:$.SURFACE,prefixes:P.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:$.SURFACE,prefixes:P.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:$.SURFACE,prefixes:P.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:$.SURFACE,prefixes:P.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:$.SURFACE,prefixes:P.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:$.SURFACE,prefixes:P.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:$.SURFACE,prefixes:P.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:$.SURFACE,prefixes:P.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:$.SURFACE,prefixes:P.NONE,value:1e4,offset:0},m3:{name:"m3",base:$.VOLUME,prefixes:P.CUBIC,value:1,offset:0},L:{name:"L",base:$.VOLUME,prefixes:P.SHORT,value:.001,offset:0},l:{name:"l",base:$.VOLUME,prefixes:P.SHORT,value:.001,offset:0},litre:{name:"litre",base:$.VOLUME,prefixes:P.LONG,value:.001,offset:0},cuin:{name:"cuin",base:$.VOLUME,prefixes:P.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:$.VOLUME,prefixes:P.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:$.VOLUME,prefixes:P.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:$.VOLUME,prefixes:P.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:$.VOLUME,prefixes:P.NONE,value:15e-6,offset:0},drop:{name:"drop",base:$.VOLUME,prefixes:P.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:$.VOLUME,prefixes:P.NONE,value:5e-8,offset:0},minim:{name:"minim",base:$.VOLUME,prefixes:P.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:$.VOLUME,prefixes:P.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:$.VOLUME,prefixes:P.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:$.VOLUME,prefixes:P.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:$.VOLUME,prefixes:P.NONE,value:1e-6,offset:0},cup:{name:"cup",base:$.VOLUME,prefixes:P.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:$.VOLUME,prefixes:P.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:$.VOLUME,prefixes:P.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:$.VOLUME,prefixes:P.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:$.VOLUME,prefixes:P.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:$.VOLUME,prefixes:P.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:$.VOLUME,prefixes:P.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:$.VOLUME,prefixes:P.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:$.VOLUME,prefixes:P.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:$.VOLUME,prefixes:P.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:$.VOLUME,prefixes:P.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:$.VOLUME,prefixes:P.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:$.VOLUME,prefixes:P.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:$.VOLUME,prefixes:P.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:$.VOLUME,prefixes:P.NONE,value:.1173478,offset:0},obl:{name:"obl",base:$.VOLUME,prefixes:P.NONE,value:.1589873,offset:0},g:{name:"g",base:$.MASS,prefixes:P.SHORT,value:.001,offset:0},gram:{name:"gram",base:$.MASS,prefixes:P.LONG,value:.001,offset:0},ton:{name:"ton",base:$.MASS,prefixes:P.SHORT,value:907.18474,offset:0},t:{name:"t",base:$.MASS,prefixes:P.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:$.MASS,prefixes:P.LONG,value:1e3,offset:0},grain:{name:"grain",base:$.MASS,prefixes:P.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:$.MASS,prefixes:P.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:$.MASS,prefixes:P.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:$.MASS,prefixes:P.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:$.MASS,prefixes:P.NONE,value:45.359237,offset:0},stick:{name:"stick",base:$.MASS,prefixes:P.NONE,value:.115,offset:0},stone:{name:"stone",base:$.MASS,prefixes:P.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:$.MASS,prefixes:P.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:$.MASS,prefixes:P.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:$.MASS,prefixes:P.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:$.MASS,prefixes:P.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:$.MASS,prefixes:P.NONE,value:45.359237,offset:0},s:{name:"s",base:$.TIME,prefixes:P.SHORT,value:1,offset:0},min:{name:"min",base:$.TIME,prefixes:P.NONE,value:60,offset:0},h:{name:"h",base:$.TIME,prefixes:P.NONE,value:3600,offset:0},second:{name:"second",base:$.TIME,prefixes:P.LONG,value:1,offset:0},sec:{name:"sec",base:$.TIME,prefixes:P.LONG,value:1,offset:0},minute:{name:"minute",base:$.TIME,prefixes:P.NONE,value:60,offset:0},hour:{name:"hour",base:$.TIME,prefixes:P.NONE,value:3600,offset:0},day:{name:"day",base:$.TIME,prefixes:P.NONE,value:86400,offset:0},week:{name:"week",base:$.TIME,prefixes:P.NONE,value:7*86400,offset:0},month:{name:"month",base:$.TIME,prefixes:P.NONE,value:2629800,offset:0},year:{name:"year",base:$.TIME,prefixes:P.NONE,value:31557600,offset:0},decade:{name:"decade",base:$.TIME,prefixes:P.NONE,value:315576e3,offset:0},century:{name:"century",base:$.TIME,prefixes:P.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:$.TIME,prefixes:P.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:$.FREQUENCY,prefixes:P.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:$.FREQUENCY,prefixes:P.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:$.ANGLE,prefixes:P.SHORT,value:1,offset:0},radian:{name:"radian",base:$.ANGLE,prefixes:P.LONG,value:1,offset:0},deg:{name:"deg",base:$.ANGLE,prefixes:P.SHORT,value:null,offset:0},degree:{name:"degree",base:$.ANGLE,prefixes:P.LONG,value:null,offset:0},grad:{name:"grad",base:$.ANGLE,prefixes:P.SHORT,value:null,offset:0},gradian:{name:"gradian",base:$.ANGLE,prefixes:P.LONG,value:null,offset:0},cycle:{name:"cycle",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},A:{name:"A",base:$.CURRENT,prefixes:P.SHORT,value:1,offset:0},ampere:{name:"ampere",base:$.CURRENT,prefixes:P.LONG,value:1,offset:0},K:{name:"K",base:$.TEMPERATURE,prefixes:P.SHORT,value:1,offset:0},degC:{name:"degC",base:$.TEMPERATURE,prefixes:P.SHORT,value:1,offset:273.15},degF:{name:"degF",base:$.TEMPERATURE,prefixes:P.SHORT,value:new y(5,9),offset:459.67},degR:{name:"degR",base:$.TEMPERATURE,prefixes:P.SHORT,value:new y(5,9),offset:0},kelvin:{name:"kelvin",base:$.TEMPERATURE,prefixes:P.LONG,value:1,offset:0},celsius:{name:"celsius",base:$.TEMPERATURE,prefixes:P.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:$.TEMPERATURE,prefixes:P.LONG,value:new y(5,9),offset:459.67},rankine:{name:"rankine",base:$.TEMPERATURE,prefixes:P.LONG,value:new y(5,9),offset:0},mol:{name:"mol",base:$.AMOUNT_OF_SUBSTANCE,prefixes:P.SHORT,value:1,offset:0},mole:{name:"mole",base:$.AMOUNT_OF_SUBSTANCE,prefixes:P.LONG,value:1,offset:0},cd:{name:"cd",base:$.LUMINOUS_INTENSITY,prefixes:P.SHORT,value:1,offset:0},candela:{name:"candela",base:$.LUMINOUS_INTENSITY,prefixes:P.LONG,value:1,offset:0},N:{name:"N",base:$.FORCE,prefixes:P.SHORT,value:1,offset:0},newton:{name:"newton",base:$.FORCE,prefixes:P.LONG,value:1,offset:0},dyn:{name:"dyn",base:$.FORCE,prefixes:P.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:$.FORCE,prefixes:P.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:$.FORCE,prefixes:P.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:$.FORCE,prefixes:P.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:$.FORCE,prefixes:P.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:$.FORCE,prefixes:P.NONE,value:9.80665,offset:0},J:{name:"J",base:$.ENERGY,prefixes:P.SHORT,value:1,offset:0},joule:{name:"joule",base:$.ENERGY,prefixes:P.LONG,value:1,offset:0},erg:{name:"erg",base:$.ENERGY,prefixes:P.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:$.ENERGY,prefixes:P.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:$.ENERGY,prefixes:P.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:$.ENERGY,prefixes:P.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:$.ENERGY,prefixes:P.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:$.POWER,prefixes:P.SHORT,value:1,offset:0},watt:{name:"watt",base:$.POWER,prefixes:P.LONG,value:1,offset:0},hp:{name:"hp",base:$.POWER,prefixes:P.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:$.POWER,prefixes:P.SHORT,value:m.I,offset:0},VA:{name:"VA",base:$.POWER,prefixes:P.SHORT,value:1,offset:0},Pa:{name:"Pa",base:$.PRESSURE,prefixes:P.SHORT,value:1,offset:0},psi:{name:"psi",base:$.PRESSURE,prefixes:P.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:$.PRESSURE,prefixes:P.NONE,value:101325,offset:0},bar:{name:"bar",base:$.PRESSURE,prefixes:P.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:$.PRESSURE,prefixes:P.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:$.PRESSURE,prefixes:P.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:$.PRESSURE,prefixes:P.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:$.PRESSURE,prefixes:P.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:$.ELECTRIC_CHARGE,prefixes:P.LONG,value:1,offset:0},C:{name:"C",base:$.ELECTRIC_CHARGE,prefixes:P.SHORT,value:1,offset:0},farad:{name:"farad",base:$.ELECTRIC_CAPACITANCE,prefixes:P.LONG,value:1,offset:0},F:{name:"F",base:$.ELECTRIC_CAPACITANCE,prefixes:P.SHORT,value:1,offset:0},volt:{name:"volt",base:$.ELECTRIC_POTENTIAL,prefixes:P.LONG,value:1,offset:0},V:{name:"V",base:$.ELECTRIC_POTENTIAL,prefixes:P.SHORT,value:1,offset:0},ohm:{name:"ohm",base:$.ELECTRIC_RESISTANCE,prefixes:P.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:$.ELECTRIC_INDUCTANCE,prefixes:P.LONG,value:1,offset:0},H:{name:"H",base:$.ELECTRIC_INDUCTANCE,prefixes:P.SHORT,value:1,offset:0},siemens:{name:"siemens",base:$.ELECTRIC_CONDUCTANCE,prefixes:P.LONG,value:1,offset:0},S:{name:"S",base:$.ELECTRIC_CONDUCTANCE,prefixes:P.SHORT,value:1,offset:0},weber:{name:"weber",base:$.MAGNETIC_FLUX,prefixes:P.LONG,value:1,offset:0},Wb:{name:"Wb",base:$.MAGNETIC_FLUX,prefixes:P.SHORT,value:1,offset:0},tesla:{name:"tesla",base:$.MAGNETIC_FLUX_DENSITY,prefixes:P.LONG,value:1,offset:0},T:{name:"T",base:$.MAGNETIC_FLUX_DENSITY,prefixes:P.SHORT,value:1,offset:0},b:{name:"b",base:$.BIT,prefixes:P.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:$.BIT,prefixes:P.BINARY_LONG,value:1,offset:0},B:{name:"B",base:$.BIT,prefixes:P.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:$.BIT,prefixes:P.BINARY_LONG,value:8,offset:0}},de={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Se(J){if(J.number==="BigNumber"){var te=lw(b);X.rad.value=new b(1),X.deg.value=te.div(180),X.grad.value=te.div(200),X.cycle.value=te.times(2),X.arcsec.value=te.div(648e3),X.arcmin.value=te.div(10800)}else X.rad.value=1,X.deg.value=Math.PI/180,X.grad.value=Math.PI/200,X.cycle.value=Math.PI*2,X.arcsec.value=Math.PI/648e3,X.arcmin.value=Math.PI/10800;X.radian.value=X.rad.value,X.degree.value=X.deg.value,X.gradian.value=X.grad.value}Se(r),e&&e("config",function(J,te){J.number!==te.number&&Se(J)});var ce={si:{NONE:{unit:ne,prefix:P.NONE[""]},LENGTH:{unit:X.m,prefix:P.SHORT[""]},MASS:{unit:X.g,prefix:P.SHORT.k},TIME:{unit:X.s,prefix:P.SHORT[""]},CURRENT:{unit:X.A,prefix:P.SHORT[""]},TEMPERATURE:{unit:X.K,prefix:P.SHORT[""]},LUMINOUS_INTENSITY:{unit:X.cd,prefix:P.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:X.mol,prefix:P.SHORT[""]},ANGLE:{unit:X.rad,prefix:P.SHORT[""]},BIT:{unit:X.bits,prefix:P.SHORT[""]},FORCE:{unit:X.N,prefix:P.SHORT[""]},ENERGY:{unit:X.J,prefix:P.SHORT[""]},POWER:{unit:X.W,prefix:P.SHORT[""]},PRESSURE:{unit:X.Pa,prefix:P.SHORT[""]},ELECTRIC_CHARGE:{unit:X.C,prefix:P.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:X.F,prefix:P.SHORT[""]},ELECTRIC_POTENTIAL:{unit:X.V,prefix:P.SHORT[""]},ELECTRIC_RESISTANCE:{unit:X.ohm,prefix:P.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:X.H,prefix:P.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:X.S,prefix:P.SHORT[""]},MAGNETIC_FLUX:{unit:X.Wb,prefix:P.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:X.T,prefix:P.SHORT[""]},FREQUENCY:{unit:X.Hz,prefix:P.SHORT[""]}}};ce.cgs=JSON.parse(JSON.stringify(ce.si)),ce.cgs.LENGTH={unit:X.m,prefix:P.SHORT.c},ce.cgs.MASS={unit:X.g,prefix:P.SHORT[""]},ce.cgs.FORCE={unit:X.dyn,prefix:P.SHORT[""]},ce.cgs.ENERGY={unit:X.erg,prefix:P.NONE[""]},ce.us=JSON.parse(JSON.stringify(ce.si)),ce.us.LENGTH={unit:X.ft,prefix:P.NONE[""]},ce.us.MASS={unit:X.lbm,prefix:P.NONE[""]},ce.us.TEMPERATURE={unit:X.degF,prefix:P.NONE[""]},ce.us.FORCE={unit:X.lbf,prefix:P.NONE[""]},ce.us.ENERGY={unit:X.BTU,prefix:P.BTU[""]},ce.us.POWER={unit:X.hp,prefix:P.NONE[""]},ce.us.PRESSURE={unit:X.psi,prefix:P.NONE[""]},ce.auto=JSON.parse(JSON.stringify(ce.si));var xe=ce.auto;x.setUnitSystem=function(J){if(tt(ce,J))xe=ce[J];else throw new Error("Unit system "+J+" does not exist. Choices are: "+Object.keys(ce).join(", "))},x.getUnitSystem=function(){for(var J in ce)if(tt(ce,J)&&ce[J]===xe)return J},x.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new b(te.n).div(te.d).times(te.s):new b(te+"")},Fraction:function(te){return new y(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?v(te):te}},x.prototype._numberConverter=function(){var J=x.typeConverters[this.valueType()];if(J)return J;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},x._getNumberConverter=function(J){if(!x.typeConverters[J])throw new TypeError('Unsupported type "'+J+'"');return x.typeConverters[J]};for(var _e in X)if(tt(X,_e)){var me=X[_e];me.dimensions=me.base.dimensions}for(var we in de)if(tt(de,we)){var Ne=X[de[we]],Ce={};for(var He in Ne)tt(Ne,He)&&(Ce[He]=Ne[He]);Ce.name=we,X[we]=Ce}x.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function qe(J){for(var te=0;te0&&!(x.isValidAlpha(w)||N(w)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+J+'"')}}return x.createUnit=function(J,te){if(typeof J!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in J)if(tt(J,ye)&&x.deleteUnit(ye),J[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof J!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(tt(X,J))throw new Error('Cannot create unit "'+J+'": a unit with that name already exists');qe(J);var ye=null,ee=[],ue=0,le,Ee,Me;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(le=te);else if(typeof te=="object")le=te.definition,Ee=te.prefixes,ue=te.offset,Me=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+J+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var R=0;R1e-12){Pe=!1;break}if(Pe){De=!0,q.base=$[Be];break}}if(!De){Me=Me||J+"_STUFF";var ze={dimensions:ye.dimensions.slice(0)};ze.key=Me,$[Me]=ze,xe[Me]={unit:q,prefix:P.NONE[""]},q.base=$[Me]}}else{if(Me=Me||J+"_STUFF",K.indexOf(Me)>=0)throw new Error('Cannot create new base unit "'+J+'": a base unit with that name already exists (and cannot be overridden)');K.push(Me);for(var Y in $)tt($,Y)&&($[Y].dimensions[K.length-1]=0);for(var pe={dimensions:[]},ge=0;ge{var{typed:e,Unit:r}=t;return e($E,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new r(i,a)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),zE="sparse",Fce=["typed","SparseMatrix"],Rce=G(zE,Fce,t=>{var{typed:e,SparseMatrix:r}=t;return e(zE,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,a){return new r(i,a)}})}),UE="createUnit",Bce=["typed","Unit"],Pce=G(UE,Bce,t=>{var{typed:e,Unit:r}=t;return e(UE,{"Object, Object":function(i,a){return r.createUnit(i,a)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var o={};return o[i]=a,r.createUnit(o,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,r.createUnit(s,{})},string:function(i){var a={};return a[i]={},r.createUnit(a,{})}})}),qE="acos",Ice=["typed","config","Complex"],kce=G(qE,Ice,t=>{var{typed:e,config:r,Complex:n}=t;return e(qE,{number:function(a){return a>=-1&&a<=1||r.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})}),HE="acosh",Lce=["typed","config","Complex"],$ce=G(HE,Lce,t=>{var{typed:e,config:r,Complex:n}=t;return e(HE,{number:function(a){return a>=1||r.predictable?lP(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})}),WE="acot",zce=["typed","BigNumber"],Uce=G(WE,zce,t=>{var{typed:e,BigNumber:r}=t;return e(WE,{number:cP,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})}),VE="acoth",qce=["typed","config","Complex","BigNumber"],Hce=G(VE,qce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(VE,{number:function(s){return s>=1||s<=-1||r.predictable?fP(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})}),YE="acsc",Wce=["typed","config","Complex","BigNumber"],Vce=G(YE,Wce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(YE,{number:function(s){return s<=-1||s>=1||r.predictable?hP(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})}),jE="acsch",Yce=["typed","BigNumber"],jce=G(jE,Yce,t=>{var{typed:e,BigNumber:r}=t;return e(jE,{number:dP,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})}),GE="asec",Gce=["typed","config","Complex","BigNumber"],Xce=G(GE,Gce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(GE,{number:function(s){return s<=-1||s>=1||r.predictable?pP(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})}),XE="asech",Zce=["typed","config","Complex","BigNumber"],Kce=G(XE,Zce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(XE,{number:function(s){if(s<=1&&s>=-1||r.predictable){var o=1/s;if(o>0||r.predictable)return mP(s);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})}),ZE="asin",Jce=["typed","config","Complex"],Qce=G(ZE,Jce,t=>{var{typed:e,config:r,Complex:n}=t;return e(ZE,{number:function(a){return a>=-1&&a<=1||r.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})}),efe="asinh",tfe=["typed"],rfe=G(efe,tfe,t=>{var{typed:e}=t;return e("asinh",{number:vP,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})}),nfe="atan",ife=["typed"],afe=G(nfe,ife,t=>{var{typed:e}=t;return e("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})}),KE="atan2",sfe=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],ofe=G(KE,sfe,t=>{var{typed:e,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=ai({typed:e}),l=OP({typed:e,equalScalar:n}),c=Fn({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:a}),h=_r({typed:e,matrix:r,concat:s});return e(KE,{"number, number":Math.atan2,"BigNumber, BigNumber":(p,v)=>i.atan2(p,v)},h({scalar:"number | BigNumber",SS:l,DS:u,SD:o,Ss:c,sS:f}))}),JE="atanh",ufe=["typed","config","Complex"],lfe=G(JE,ufe,t=>{var{typed:e,config:r,Complex:n}=t;return e(JE,{number:function(a){return a<=1&&a>=-1||r.predictable?gP(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})}),Fc=G("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(r,n.valueType())(n.value)})}}),QE="cos",cfe=["typed"],ffe=G(QE,cfe,t=>{var{typed:e}=t,r=Fc({typed:e});return e(QE,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),eC="cosh",hfe=["typed"],dfe=G(eC,hfe,t=>{var{typed:e}=t;return e(eC,{number:lre,"Complex | BigNumber":r=>r.cosh()})}),tC="cot",pfe=["typed","BigNumber"],mfe=G(tC,pfe,t=>{var{typed:e,BigNumber:r}=t,n=Fc({typed:e});return e(tC,{number:yP,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),rC="coth",vfe=["typed","BigNumber"],gfe=G(rC,vfe,t=>{var{typed:e,BigNumber:r}=t;return e(rC,{number:bP,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),nC="csc",yfe=["typed","BigNumber"],bfe=G(nC,yfe,t=>{var{typed:e,BigNumber:r}=t,n=Fc({typed:e});return e(nC,{number:xP,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),iC="csch",xfe=["typed","BigNumber"],wfe=G(iC,xfe,t=>{var{typed:e,BigNumber:r}=t;return e(iC,{number:wP,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),aC="sec",Sfe=["typed","BigNumber"],_fe=G(aC,Sfe,t=>{var{typed:e,BigNumber:r}=t,n=Fc({typed:e});return e(aC,{number:SP,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),sC="sech",Afe=["typed","BigNumber"],Dfe=G(sC,Afe,t=>{var{typed:e,BigNumber:r}=t;return e(sC,{number:_P,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),oC="sin",Nfe=["typed"],Efe=G(oC,Nfe,t=>{var{typed:e}=t,r=Fc({typed:e});return e(oC,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),uC="sinh",Cfe=["typed"],Mfe=G(uC,Cfe,t=>{var{typed:e}=t;return e(uC,{number:AP,"Complex | BigNumber":r=>r.sinh()})}),lC="tan",Tfe=["typed"],Ofe=G(lC,Tfe,t=>{var{typed:e}=t,r=Fc({typed:e});return e(lC,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),Ffe="tanh",Rfe=["typed"],Bfe=G(Ffe,Rfe,t=>{var{typed:e}=t;return e("tanh",{number:fre,"Complex | BigNumber":r=>r.tanh()})}),cC="setCartesian",Pfe=["typed","size","subset","compareNatural","Index","DenseMatrix"],Ife=G(cC,Pfe,t=>{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(cC,{"Array | Matrix, Array | Matrix":function(u,l){var c=[];if(n(r(u),new a(0))!==0&&n(r(l),new a(0))!==0){var f=tr(Array.isArray(u)?u:u.toArray()).sort(i),h=tr(Array.isArray(l)?l:l.toArray()).sort(i);c=[];for(var p=0;p{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(fC,{"Array | Matrix, Array | Matrix":function(u,l){var c;if(n(r(u),new a(0))===0)c=[];else{if(n(r(l),new a(0))===0)return tr(u.toArray());var f=mc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),h=mc(tr(Array.isArray(l)?l:l.toArray()).sort(i));c=[];for(var p,v=0;v{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(hC,{"Array | Matrix":function(u){var l;if(n(r(u),new a(0))===0)l=[];else{var c=tr(Array.isArray(u)?u:u.toArray()).sort(i);l=[],l.push(c[0]);for(var f=1;f{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(dC,{"Array | Matrix, Array | Matrix":function(u,l){var c;if(n(r(u),new a(0))===0||n(r(l),new a(0))===0)c=[];else{var f=mc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),h=mc(tr(Array.isArray(l)?l:l.toArray()).sort(i));c=[];for(var p=0;p{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(pC,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var l=mc(tr(Array.isArray(o)?o:o.toArray()).sort(i)),c=mc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),f,h=0;h{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(mC,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var l=tr(Array.isArray(u)?u:u.toArray()),c=0,f=0;f{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(vC,{"Array | Matrix":function(l){if(n(r(l),new a(0))===0)return[];for(var c=tr(Array.isArray(l)?l:l.toArray()).sort(i),f=[],h=0;h.toString(2).length<=c.length;)f.push(s(c,h.toString(2).split("").reverse())),h++;return o(f)}});function s(u,l){for(var c=[],f=0;f0;c--)for(var f=0;fu[f+1].length&&(l=u[f],u[f]=u[f+1],u[f+1]=l);return u}}),gC="setSize",Xfe=["typed","compareNatural"],Zfe=G(gC,Xfe,t=>{var{typed:e,compareNatural:r}=t;return e(gC,{"Array | Matrix":function(i){return Array.isArray(i)?tr(i).length:tr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?tr(i).length:tr(i.toArray()).length;for(var s=tr(Array.isArray(i)?i:i.toArray()).sort(r),o=1,u=1;u{var{typed:e,size:r,concat:n,subset:i,setDifference:a,Index:s}=t;return e(yC,{"Array | Matrix, Array | Matrix":function(u,l){if(i(r(u),new s(0))===0)return tr(l);if(i(r(l),new s(0))===0)return tr(u);var c=tr(u),f=tr(l);return n(a(c,f),a(f,c))}})}),bC="setUnion",Qfe=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],ehe=G(bC,Qfe,t=>{var{typed:e,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:o}=t;return e(bC,{"Array | Matrix, Array | Matrix":function(l,c){if(i(r(l),new o(0))===0)return tr(c);if(i(r(c),new o(0))===0)return tr(l);var f=tr(l),h=tr(c);return n(s(f,h),a(f,h))}})}),xC="add",the=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],rhe=G(xC,the,t=>{var{typed:e,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:o}=t,u=Vo({typed:e}),l=iw({typed:e,equalScalar:i}),c=ju({typed:e,DenseMatrix:a}),f=_r({typed:e,matrix:r,concat:o});return e(xC,{"any, any":n,"any, any, ...any":e.referToSelf(h=>(p,v,m)=>{for(var b=h(p,v),y=0;y{var{typed:e,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:o,isPositive:u}=t;return e(wC,{"... number | BigNumber":l,Array:l,Matrix:c=>l(tr(c.toArray()))});function l(c){for(var f=0,h=0,p=0;p{var{typed:e,abs:r,add:n,pow:i,conj:a,sqrt:s,multiply:o,equalScalar:u,larger:l,smaller:c,matrix:f,ctranspose:h,eigs:p}=t;return e(SC,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return w(f(E),2)},Matrix:function(E){return w(E,2)},"Array, number | BigNumber | string":function(E,N){return w(f(E),N)},"Matrix, number | BigNumber | string":function(E,N){return w(E,N)}});function v(C){var E=0;return C.forEach(function(N){var M=r(N);l(M,E)&&(E=M)},!0),E}function m(C){var E;return C.forEach(function(N){var M=r(N);(!E||c(M,E))&&(E=M)},!0),E||0}function b(C,E){if(E===Number.POSITIVE_INFINITY||E==="inf")return v(C);if(E===Number.NEGATIVE_INFINITY||E==="-inf")return m(C);if(E==="fro")return w(C,2);if(typeof E=="number"&&!isNaN(E)){if(!u(E,0)){var N=0;return C.forEach(function(M){N=n(i(r(M),E),N)},!0),i(N,1/E)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function y(C){var E=0;return C.forEach(function(N,M){E=n(E,o(N,a(N)))}),r(s(E))}function S(C){var E=[],N=0;return C.forEach(function(M,O){var F=O[1],U=n(E[F]||0,r(M));l(U,N)&&(N=U),E[F]=U},!0),N}function x(C){var E=C.size();if(E[0]!==E[1])throw new RangeError("Invalid matrix dimensions");var N=h(C),M=o(N,C),O=p(M).values.toArray(),F=O[O.length-1];return r(s(F))}function A(C){var E=[],N=0;return C.forEach(function(M,O){var F=O[0],U=n(E[F]||0,r(M));l(U,N)&&(N=U),E[F]=U},!0),N}function _(C,E){if(E===1)return S(C);if(E===Number.POSITIVE_INFINITY||E==="inf")return A(C);if(E==="fro")return y(C);if(E===2)return x(C);throw new Error("Unsupported parameter value "+E)}function w(C,E){var N=C.size();if(N.length===1)return b(C,E);if(N.length===2){if(N[0]&&N[1])return _(C,E);throw new RangeError("Invalid matrix dimensions")}}}),_C="dot",ohe=["typed","addScalar","multiplyScalar","conj","size"],uhe=G(_C,ohe,t=>{var{typed:e,addScalar:r,multiplyScalar:n,conj:i,size:a}=t;return e(_C,{"Array | DenseMatrix, Array | DenseMatrix":o,"SparseMatrix, SparseMatrix":u});function s(c,f){var h=l(c),p=l(f),v,m;if(h.length===1)v=h[0];else if(h.length===2&&h[1]===1)v=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(p.length===1)m=p[0];else if(p.length===2&&p[1]===1)m=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(v!==m)throw new RangeError("Vectors must have equal length ("+v+" != "+m+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function o(c,f){var h=s(c,f),p=dt(c)?c._data:c,v=dt(c)?c._datatype||c.getDataType():void 0,m=dt(f)?f._data:f,b=dt(f)?f._datatype||f.getDataType():void 0,y=l(c).length===2,S=l(f).length===2,x=r,A=n;if(v&&b&&v===b&&typeof v=="string"&&v!=="mixed"){var _=v;x=e.find(r,[_,_]),A=e.find(n,[_,_])}if(!y&&!S){for(var w=A(i(p[0]),m[0]),C=1;Cw){A++;continue}_===w&&(b=y(b,S(p[x],m[A])),x++,A++)}return b}function l(c){return dt(c)?c.size():a(c)}}),lhe="trace",che=["typed","matrix","add"],fhe=G(lhe,che,t=>{var{typed:e,matrix:r,add:n}=t;return e("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:vt});function i(s){var o=s._size,u=s._data;switch(o.length){case 1:if(o[0]===1)return vt(u[0]);throw new RangeError("Matrix must be square (size: "+Rt(o)+")");case 2:{var l=o[0],c=o[1];if(l===c){for(var f=0,h=0;h0)for(var v=0;vv)break}return p}throw new RangeError("Matrix must be square (size: "+Rt(c)+")")}}),AC="index",hhe=["typed","Index"],dhe=G(AC,hhe,t=>{var{typed:e,Index:r}=t;return e(AC,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(o){return Mt(o)?o.toNumber():sr(o)||dt(o)?o.map(function(u){return Mt(u)?u.toNumber():u}):o}),s=new r;return r.apply(s,a),s}})}),GP=new Set(["end"]),phe="Node",mhe=["mathWithTransform"],vhe=G(phe,mhe,t=>{var{mathWithTransform:e}=t;function r(i){for(var a of[...GP])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(e,{}),s={},o=null;function u(l){var c=Jl(l);return r(c),a(c,s,o)}return{evaluate:u}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!pr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(o,u){o.forEach(function(l,c,f){u(l,c,f),s(l,u)})}s(this,a)}transform(a){function s(o,u,l){var c=a(o,u,l);return c!==o?c:o.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(o,u,l){a(o,u,l)&&s.push(o)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&$u(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function si(t){return t&&t.isIndexError?new Ma(t.index+1,t.min+1,t.max!==void 0?t.max+1:void 0):t}function XP(t){var{subset:e}=t;return function(n,i){try{if(Array.isArray(n))return e(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return e(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return ei(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw si(a)}}}var rm="AccessorNode",ghe=["subset","Node"],yhe=G(rm,ghe,t=>{var{subset:e,Node:r}=t,n=XP({subset:e});function i(s){return!(Lu(s)||ji(s)||er(s)||Lo(s)||Cg(s)||Hs(s)||Sn(s))}class a extends r{constructor(o,u){if(super(),!pr(o))throw new TypeError('Node expected for parameter "object"');if(!Nc(u))throw new TypeError('IndexNode expected for parameter "index"');this.object=o,this.index=u}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return rm}get isAccessorNode(){return!0}_compile(o,u){var l=this.object._compile(o,u),c=this.index._compile(o,u);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,v,m){return ei(l(p,v,m),f)}}else return function(p,v,m){var b=l(p,v,m),y=c(p,v,b);return n(b,y)}}forEach(o){o(this.object,"object",this),o(this.index,"index",this)}map(o){return new a(this._ifNode(o(this.object,"object",this)),this._ifNode(o(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(o){var u=this.object.toString(o);return i(this.object)&&(u="("+u+")"),u+this.index.toString(o)}_toHTML(o){var u=this.object.toHTML(o);return i(this.object)&&(u='('+u+')'),u+this.index.toHTML(o)}_toTex(o){var u=this.object.toTex(o);return i(this.object)&&(u="\\left(' + object + '\\right)"),u+this.index.toTex(o)}toJSON(){return{mathjs:rm,object:this.object,index:this.index}}static fromJSON(o){return new a(o.object,o.index)}}return vn(a,"name",rm),a},{isClass:!0,isNode:!0}),nm="ArrayNode",bhe=["Node"],xhe=G(nm,bhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(pr))throw new TypeError("Array containing Nodes expected")}get type(){return nm}get isArrayNode(){return!0}_compile(i,a){var s=zs(this.items,function(l){return l._compile(i,a)}),o=i.config.matrix!=="Array";if(o){var u=i.matrix;return function(c,f,h){return u(zs(s,function(p){return p(c,f,h)}))}}else return function(c,f,h){return zs(s,function(p){return p(c,f,h)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,o){var u=s.some(ji)&&!s.every(ji),l=o||u,c=l?"&":"\\\\",f=s.map(function(h){return h.items?a(h.items,!o):h.toTex(i)}).join(c);return u||!l||l&&!o?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return vn(r,"name",nm),r},{isClass:!0,isNode:!0});function whe(t){var{subset:e,matrix:r}=t;return function(i,a,s){try{if(Array.isArray(i)){var o=r(i).subset(a,s).valueOf();return o.forEach((u,l)=>{i[l]=u}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return e(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return vc(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw si(u)}}}var ya=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function im(t,e){if(!e||e!=="auto")return t;for(var r=t;Hs(r);)r=r.content;return r}function br(t,e,r,n){var i=t;e!=="keep"&&(i=t.getContent());for(var a=i.getIdentifier(),s=null,o=0;o{var{subset:e,matrix:r,Node:n}=t,i=XP({subset:e}),a=whe({subset:e,matrix:r});function s(u,l,c){l||(l="keep");var f=br(u,l,c),h=br(u.value,l,c);return l==="all"||h!==null&&h<=f}class o extends n{constructor(l,c,f){if(super(),this.object=l,this.index=f?c:null,this.value=f||c,!Sn(l)&&!Lu(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Sn(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Nc(this.index))throw new TypeError('IndexNode expected as "index"');if(!pr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return am}get isAssignmentNode(){return!0}_compile(l,c){var f=this.object._compile(l,c),h=this.index?this.index._compile(l,c):null,p=this.value._compile(l,c),v=this.object.name;if(this.index)if(this.index.isObjectProperty()){var m=this.index.getObjectProperty();return function(A,_,w){var C=f(A,_,w),E=p(A,_,w);return vc(C,m,E),E}}else{if(Sn(this.object))return function(A,_,w){var C=f(A,_,w),E=p(A,_,w),N=h(A,_,C);return A.set(v,a(C,N,E)),E};var b=this.object.object._compile(l,c);if(this.object.index.isObjectProperty()){var y=this.object.index.getObjectProperty();return function(A,_,w){var C=b(A,_,w),E=ei(C,y),N=h(A,_,E),M=p(A,_,w);return vc(C,y,a(E,N,M)),M}}else{var S=this.object.index._compile(l,c);return function(A,_,w){var C=b(A,_,w),E=S(A,_,C),N=i(C,E),M=h(A,_,N),O=p(A,_,w);return a(C,E,a(N,M,O)),O}}}else{if(!Sn(this.object))throw new TypeError("SymbolNode expected as object");return function(A,_,w){var C=p(A,_,w);return A.set(v,C),C}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var c=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,h=this._ifNode(l(this.value,"value",this));return new o(c,f,h)}clone(){return new o(this.object,this.index,this.value)}_toString(l){var c=this.object.toString(l),f=this.index?this.index.toString(l):"",h=this.value.toString(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h="("+h+")"),c+f+" = "+h}toJSON(){return{mathjs:am,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new o(l.object,l.index,l.value)}_toHTML(l){var c=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",h=this.value.toHTML(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h='('+h+')'),c+f+'='+h}_toTex(l){var c=this.object.toTex(l),f=this.index?this.index.toTex(l):"",h=this.value.toTex(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h="\\left(".concat(h,"\\right)")),c+f+"="+h}}return vn(o,"name",am),o},{isClass:!0,isNode:!0}),sm="BlockNode",Dhe=["ResultSet","Node"],Nhe=G(sm,Dhe,t=>{var{ResultSet:e,Node:r}=t;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var o=s&&s.node,u=s&&s.visible!==void 0?s.visible:!0;if(!pr(o))throw new TypeError('Property "node" must be a Node');if(typeof u!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:o,visible:u}})}get type(){return sm}get isBlockNode(){return!0}_compile(a,s){var o=zs(this.blocks,function(u){return{evaluate:u.node._compile(a,s),visible:u.visible}});return function(l,c,f){var h=[];return Tg(o,function(v){var m=v.evaluate(l,c,f);v.visible&&h.push(m)}),new e(h)}}forEach(a){for(var s=0;s "+(this._values?Rt(this._values[C],m):"X")}return x},i.prototype.toString=function(){return Rt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(m){if(m){if(Mt(m)&&(m=m.toNumber()),!Ct(m)||!ot(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var b=m>0?m:0,y=m<0?-m:0,S=this._size[0],x=this._size[1],A=Math.min(S-y,x-b),_=[],w=[],C=[];C[0]=0;for(var E=b;E0?y:0,C=y<0?-y:0,E=m[0],N=m[1],M=Math.min(E-C,N-w),O;if(sr(b)){if(b.length!==M)throw new Error("Invalid value array length");O=function(se){return b[se]}}else if(dt(b)){var F=b.size();if(F.length!==1||F[0]!==M)throw new Error("Invalid matrix length");O=function(se){return b.get([se])}}else O=function(){return b};for(var U=[],V=[],H=[],I=0;I=0&&P=C||x[N]!==b)){var O=S?S[E]:void 0;x.splice(N,0,b),S&&S.splice(N,0,O),x.splice(N<=E?E+1:E,1),S&&S.splice(N<=E?E+1:E,1);continue}if(N=C||x[E]!==m)){var F=S?S[N]:void 0;x.splice(E,0,m),S&&S.splice(E,0,F),x.splice(E<=N?N+1:N,1),S&&S.splice(E<=N?N+1:N,1)}}},i},{isClass:!0}),Oie="number",Fie=["typed"];function Rie(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var r={"0b":2,"0o":8,"0x":16}[e[1]],n=e[2],i=e[3];return{input:t,radix:r,integerPart:n,fractionalPart:i}}else return null}function Bie(t){for(var e=parseInt(t.integerPart,t.radix),r=0,n=0;n{var{typed:e}=t,r=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=Rie(i);if(a)return Bie(a);var s=0,o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(s=Number(o[2]),i=o[1]);var u=Number(i);if(isNaN(u))throw new SyntaxError('String "'+i+'" is not a valid number');if(o){if(u>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));u>=2**(s-1)&&(u=u-2**s)}return u},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),W2="string",Iie=["typed"],kie=G(W2,Iie,t=>{var{typed:e}=t;return e(W2,{"":function(){return""},number:Bu,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":e.referToSelf(r=>n=>It(n,r)),any:function(n){return String(n)}})}),V2="boolean",Lie=["typed"],$ie=G(V2,Lie,t=>{var{typed:e}=t;return e(V2,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),zie="bignumber",Uie=["typed","BigNumber"],qie=G(zie,Uie,t=>{var{typed:e,BigNumber:r}=t;return e("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],o=r(a[1]),u=new r(2).pow(Number(s));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var l=new r(2).pow(Number(s)-1);return o.gte(l)?o.sub(u):o}return new r(i)},BigNumber:function(i){return i},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),Hie="complex",Wie=["typed","Complex"],Vie=G(Hie,Wie,t=>{var{typed:e,Complex:r}=t;return e("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,a){return new r(i,a)},"BigNumber, BigNumber":function(i,a){return new r(i.toNumber(),a.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),Yie="fraction",jie=["typed","Fraction"],Gie=G(Yie,jie,t=>{var{typed:e,Fraction:r}=t;return e("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,a){return new r(i,a)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new r(i)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),Y2="matrix",Xie=["typed","Matrix","DenseMatrix","SparseMatrix"],Zie=G(Y2,Xie,t=>{var{typed:e,Matrix:r,DenseMatrix:n,SparseMatrix:i}=t;return e(Y2,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,o,u){if(o==="dense"||o==="default"||o===void 0)return new n(s,u);if(o==="sparse")return new i(s,u);throw new TypeError("Unknown matrix type "+JSON.stringify(o)+".")}}),j2="matrixFromFunction",Kie=["typed","matrix","isZero"],Jie=G(j2,Kie,t=>{var{typed:e,matrix:r,isZero:n}=t;return e(j2,{"Array | Matrix, function, string, string":function(s,o,u,l){return i(s,o,u,l)},"Array | Matrix, function, string":function(s,o,u){return i(s,o,u)},"Matrix, function":function(s,o){return i(s,o,"dense")},"Array, function":function(s,o){return i(s,o,"dense").toArray()},"Array | Matrix, string, function":function(s,o,u){return i(s,u,o)},"Array | Matrix, string, string, function":function(s,o,u,l){return i(s,l,o,u)}});function i(a,s,o,u){var l;return u!==void 0?l=r(o,u):l=r(o),l.resize(a),l.forEach(function(c,f){var h=s(f);n(h)||l.set(f,h)}),l}}),G2="matrixFromRows",Qie=["typed","matrix","flatten","size"],eae=G(G2,Qie,t=>{var{typed:e,matrix:r,flatten:n,size:i}=t;return e(G2,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(l=>l.toArray())))}});function a(o){if(o.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var u=s(o[0]),l=[];for(var c of o){var f=s(c);if(f!==u)throw new TypeError("The vectors had different length: "+(u|0)+" ≠ "+(f|0));l.push(n(c))}return l}function s(o){var u=i(o);if(u.length===1)return u[0];if(u.length===2){if(u[0]===1)return u[1];if(u[1]===1)return u[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),X2="matrixFromColumns",tae=["typed","matrix","flatten","size"],rae=G(X2,tae,t=>{var{typed:e,matrix:r,flatten:n,size:i}=t;return e(X2,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(l=>l.toArray())))}});function a(o){if(o.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var u=s(o[0]),l=[],c=0;c{var{typed:e}=t;return e(Z2,{"Unit, Array":function(n,i){return n.splitUnit(i)}})}),K2="unaryMinus",aae=["typed"],sae=G(K2,aae,t=>{var{typed:e}=t;return e(K2,{number:LB,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:e.referToSelf(r=>n=>{var i=n.clone();return i.value=e.find(r,i.valueType())(n.value),i}),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),J2="unaryPlus",oae=["typed","config","BigNumber"],uae=G(J2,oae,t=>{var{typed:e,config:r,BigNumber:n}=t;return e(J2,{number:$B,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":e.referToSelf(i=>a=>It(a,i)),"boolean | string":function(a){return r.number==="BigNumber"?new n(+a):+a}})}),Q2="abs",lae=["typed"],cae=G(Q2,lae,t=>{var{typed:e}=t;return e(Q2,{number:BB,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),eN="apply",fae=["typed","isInteger"],dw=G(eN,fae,t=>{var{typed:e,isInteger:r}=t;return e(eN,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!r(a))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(i)?Nt(i):i.size();if(a<0||a>=o.length)throw new Ma(a,o.length);return dt(i)?i.create(Tv(i.valueOf(),a,s)):Tv(i,a,s)}})});function Tv(t,e,r){var n,i,a;if(e<=0)if(Array.isArray(t[0])){for(a=hae(t),i=[],n=0;n{var{typed:e}=t;return e(tN,{"number, number":PB,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=e.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),rN="subtractScalar",mae=["typed"],vae=G(rN,mae,t=>{var{typed:e}=t;return e(rN,{"number, number":IB,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":e.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=e.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),nN="cbrt",gae=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],yae=G(nN,gae,t=>{var{config:e,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:o,Fraction:u}=t;return r(nN,{number:Jf,Complex:l,"Complex, boolean":l,BigNumber:function(h){return h.cbrt()},Unit:c});function l(f,h){var p=f.arg()/3,v=f.abs(),m=new s(Jf(v),0).mul(new s(0,p).exp());if(h){var b=[m,new s(Jf(v),0).mul(new s(0,p+Math.PI*2/3).exp()),new s(Jf(v),0).mul(new s(0,p-Math.PI*2/3).exp())];return e.matrix==="Array"?b:a(b)}else return m}function c(f){if(f.value&&$s(f.value)){var h=f.clone();return h.value=1,h=h.pow(1/3),h.value=l(f.value),h}else{var p=n(f.value);p&&(f.value=i(f.value));var v;Mt(f.value)?v=new o(1).div(3):ld(f.value)?v=new u(1,3):v=1/3;var m=f.pow(v);return p&&(m.value=i(m.value)),m}}}),bae="matAlgo11xS0s",xae=["typed","equalScalar"],Fn=G(bae,xae,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=r,y=0,S=s;typeof h=="string"&&(m=h,b=e.find(r,[m,m]),y=e.convert(0,m),a=e.convert(a,m),S=e.find(s,[m,m]));for(var x=[],A=[],_=[],w=0;w{var{typed:e,DenseMatrix:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=s;typeof h=="string"&&(m=h,a=e.convert(a,m),b=e.find(s,[m,m]));for(var y=[],S=[],x=[],A=0;A{var{typed:e}=t;return function(i,a,s,o){var u=i._data,l=i._size,c=i._datatype,f,h=s;typeof c=="string"&&(f=c,a=e.convert(a,f),h=e.find(s,[f,f]));var p=l.length>0?r(h,0,l,l[0],u,a,o):[];return i.createDenseMatrix({data:p,size:vt(l),datatype:f})};function r(n,i,a,s,o,u,l){var c=[];if(i===a.length-1)for(var f=0;f{var{typed:e,config:r,round:n}=t;return e(r1,{number:function(a){return ni(a,n(a),r.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(ni(a,n(a,s),r.epsilon))return n(a,s);var[o,u]="".concat(a,"e").split("e"),l=Math.ceil(Number("".concat(o,"e").concat(Number(u)+s)));return[o,u]="".concat(l,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-s))}})}),Eae=G(r1,Dae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:a}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e}),f=Nae({typed:e,config:r,round:n});return e("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,v){return p.ceil(v)},"Complex, BigNumber":function(p,v){return p.ceil(v.toNumber())},BigNumber:function(p){return ia(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,v){return ia(p,n(p,v),r.epsilon)?n(p,v):p.toDecimalPlaces(v.toNumber(),zo.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,v){return p.ceil(v)},"Fraction, BigNumber":function(p,v){return p.ceil(v.toNumber())},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(i(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>a(p,0)?s(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),iN="cube",Cae=["typed"],Mae=G(iN,Cae,t=>{var{typed:e}=t;return e(iN,{number:zB,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})}),aN="exp",Tae=["typed"],Oae=G(aN,Tae,t=>{var{typed:e}=t;return e(aN,{number:UB,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})}),sN="expm1",Fae=["typed","Complex"],Rae=G(sN,Fae,t=>{var{typed:e,Complex:r}=t;return e(sN,{number:qB,Complex:function(i){var a=Math.exp(i.re);return new r(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})}),n1="fix",Bae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],Pae=G(n1,["typed","ceil","floor"],t=>{var{typed:e,ceil:r,floor:n}=t;return e(n1,{number:function(a){return a>0?n(a):r(a)},"number, number":function(a,s){return a>0?n(a,s):r(a,s)}})}),Iae=G(n1,Bae,t=>{var{typed:e,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:o,DenseMatrix:u}=t,l=gn({typed:e,DenseMatrix:u}),c=Oa({typed:e}),f=Pae({typed:e,ceil:i,floor:a});return e("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,v){return new r(p.re>0?a(p.re,v):i(p.re,v),p.im>0?a(p.im,v):i(p.im,v))},"Complex, BigNumber":function(p,v){var m=v.toNumber();return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,v){return p.isNegative()?i(p,v):a(p,v)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,v){return p.s<0?i(p,v):a(p,v)},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array | Matrix, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(n(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>s(p,0)?o(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),i1="floor",kae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],Lae=G(i1,["typed","config","round"],t=>{var{typed:e,config:r,round:n}=t;return e(i1,{number:function(a){return ni(a,n(a),r.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(ni(a,n(a,s),r.epsilon))return n(a,s);var[o,u]="".concat(a,"e").split("e"),l=Math.floor(Number("".concat(o,"e").concat(Number(u)+s)));return[o,u]="".concat(l,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-s))}})}),MP=G(i1,kae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:a}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e}),f=Lae({typed:e,config:r,round:n});return e("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,v){return p.floor(v)},"Complex, BigNumber":function(p,v){return p.floor(v.toNumber())},BigNumber:function(p){return ia(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,v){return ia(p,n(p,v),r.epsilon)?n(p,v):p.toDecimalPlaces(v.toNumber(),zo.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,v){return p.floor(v)},"Fraction, BigNumber":function(p,v){return p.floor(v.toNumber())},"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>It(p,m=>h(m,v))),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(h=>(p,v)=>c(i(v),p,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(h=>(p,v)=>a(p,0)?s(v.size(),v.storage()):v.storage()==="dense"?c(v,p,h,!0):l(v,p,h,!0))})}),$ae="matAlgo02xDS0",zae=["typed","equalScalar"],Fa=G($ae,zae,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s,o){var u=i._data,l=i._size,c=i._datatype||i.getDataType(),f=a._values,h=a._index,p=a._ptr,v=a._size,m=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==v.length)throw new Pt(l.length,v.length);if(l[0]!==v[0]||l[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var b=l[0],y=l[1],S,x=r,A=0,_=s;typeof c=="string"&&c===m&&c!=="mixed"&&(S=c,x=e.find(r,[S,S]),A=e.convert(0,S),_=e.find(s,[S,S]));for(var w=[],C=[],E=[],N=0;N{var{typed:e}=t;return function(n,i,a,s){var o=n._data,u=n._size,l=n._datatype||n.getDataType(),c=i._values,f=i._index,h=i._ptr,p=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==p.length)throw new Pt(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=u[0],b=u[1],y,S=0,x=a;typeof l=="string"&&l===v&&l!=="mixed"&&(y=l,S=e.convert(0,y),x=e.find(a,[y,y]));for(var A=[],_=0;_{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=C?[]:void 0,O=C?[]:void 0,F=[],U=[],V,H,I,P;for(H=0;H{var{typed:e}=t;return function(i,a,s){var o=i._data,u=i._size,l=i._datatype,c=a._data,f=a._size,h=a._datatype,p=[];if(u.length!==f.length)throw new Pt(u.length,f.length);for(var v=0;v0?r(b,0,p,p[0],o,c):[];return i.createDenseMatrix({data:y,size:p,datatype:m})};function r(n,i,a,s,o,u){var l=[];if(i===a.length-1)for(var c=0;c{var{concat:e}=t;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((v,m)=>v===a._size[m]))return[i,a];for(var o=r(i._size,s,0),u=r(a._size,s,0),l=[],c=0;c{var{typed:e,matrix:r,concat:n}=t,i=jae({typed:e}),a=Oa({typed:e}),s=Zae({concat:n});return function(u){var l=u.elop,c=u.SD||u.DS,f;l?(f={"DenseMatrix, DenseMatrix":(m,b)=>i(...s(m,b),l),"Array, Array":(m,b)=>i(...s(r(m),r(b)),l).valueOf(),"Array, DenseMatrix":(m,b)=>i(...s(r(m),b),l),"DenseMatrix, Array":(m,b)=>i(...s(m,r(b)),l)},u.SS&&(f["SparseMatrix, SparseMatrix"]=(m,b)=>u.SS(...s(m,b),l,!1)),u.DS&&(f["DenseMatrix, SparseMatrix"]=(m,b)=>u.DS(...s(m,b),l,!1),f["Array, SparseMatrix"]=(m,b)=>u.DS(...s(r(m),b),l,!1)),c&&(f["SparseMatrix, DenseMatrix"]=(m,b)=>c(...s(b,m),l,!0),f["SparseMatrix, Array"]=(m,b)=>c(...s(r(b),m),l,!0))):(f={"DenseMatrix, DenseMatrix":e.referToSelf(m=>(b,y)=>i(...s(b,y),m)),"Array, Array":e.referToSelf(m=>(b,y)=>i(...s(r(b),r(y)),m).valueOf()),"Array, DenseMatrix":e.referToSelf(m=>(b,y)=>i(...s(r(b),y),m)),"DenseMatrix, Array":e.referToSelf(m=>(b,y)=>i(...s(b,r(y)),m))},u.SS&&(f["SparseMatrix, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.SS(...s(b,y),m,!1))),u.DS&&(f["DenseMatrix, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.DS(...s(b,y),m,!1)),f["Array, SparseMatrix"]=e.referToSelf(m=>(b,y)=>u.DS(...s(r(b),y),m,!1))),c&&(f["SparseMatrix, DenseMatrix"]=e.referToSelf(m=>(b,y)=>c(...s(y,b),m,!0)),f["SparseMatrix, Array"]=e.referToSelf(m=>(b,y)=>c(...s(r(y),b),m,!0))));var h=u.scalar||"any",p=u.Ds||u.Ss;p&&(l?(f["DenseMatrix,"+h]=(m,b)=>a(m,b,l,!1),f[h+", DenseMatrix"]=(m,b)=>a(b,m,l,!0),f["Array,"+h]=(m,b)=>a(r(m),b,l,!1).valueOf(),f[h+", Array"]=(m,b)=>a(r(b),m,l,!0).valueOf()):(f["DenseMatrix,"+h]=e.referToSelf(m=>(b,y)=>a(b,y,m,!1)),f[h+", DenseMatrix"]=e.referToSelf(m=>(b,y)=>a(y,b,m,!0)),f["Array,"+h]=e.referToSelf(m=>(b,y)=>a(r(b),y,m,!1).valueOf()),f[h+", Array"]=e.referToSelf(m=>(b,y)=>a(r(y),b,m,!0).valueOf())));var v=u.sS!==void 0?u.sS:u.Ss;return l?(u.Ss&&(f["SparseMatrix,"+h]=(m,b)=>u.Ss(m,b,l,!1)),v&&(f[h+", SparseMatrix"]=(m,b)=>v(b,m,l,!0))):(u.Ss&&(f["SparseMatrix,"+h]=e.referToSelf(m=>(b,y)=>u.Ss(b,y,m,!1))),v&&(f[h+", SparseMatrix"]=e.referToSelf(m=>(b,y)=>v(y,b,m,!0)))),l&&l.signatures&&QR(f,l.signatures),f}}),oN="mod",Qae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],TP=G(oN,Qae,t=>{var{typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o,concat:u}=t,l=MP({typed:e,config:r,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:o}),c=Fa({typed:e,equalScalar:a}),f=ai({typed:e}),h=$g({typed:e,equalScalar:a}),p=Fn({typed:e,equalScalar:a}),v=gn({typed:e,DenseMatrix:o}),m=Dr({typed:e,matrix:i,concat:u});return e(oN,{"number, number":b,"BigNumber, BigNumber":function(S,x){return x.isZero()?S:S.sub(x.mul(l(S.div(x))))},"Fraction, Fraction":function(S,x){return x.equals(0)?S:S.sub(x.mul(l(S.div(x))))}},m({SS:h,DS:f,SD:c,Ss:p,sS:v}));function b(y,S){return S===0?y:y-S*l(y/S)}}),ese="matAlgo01xDSid",tse=["typed"],Vo=G(ese,tse,t=>{var{typed:e}=t;return function(n,i,a,s){var o=n._data,u=n._size,l=n._datatype||n.getDataType(),c=i._values,f=i._index,h=i._ptr,p=i._size,v=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==p.length)throw new Pt(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=u[0],b=u[1],y=typeof l=="string"&&l!=="mixed"&&l===v?l:void 0,S=y?e.find(a,[y,y]):a,x,A,_=[];for(x=0;x{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=o&&h?[]:void 0,O=o&&h?[]:void 0,F=[],U=[],V,H,I,P,K;for(H=0;H{var{typed:e,DenseMatrix:r}=t;return function(i,a,s,o){var u=i._values,l=i._index,c=i._ptr,f=i._size,h=i._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],m,b=s;typeof h=="string"&&(m=h,a=e.convert(a,m),b=e.find(s,[m,m]));for(var y=[],S=[],x=[],A=0;AArray.isArray(e))}var use=G(uN,sse,t=>{var{typed:e,matrix:r,config:n,round:i,equalScalar:a,zeros:s,BigNumber:o,DenseMatrix:u,concat:l}=t,c=TP({typed:e,config:n,round:i,matrix:r,equalScalar:a,zeros:s,DenseMatrix:u,concat:l}),f=Vo({typed:e}),h=pw({typed:e,equalScalar:a}),p=ju({typed:e,DenseMatrix:u}),v=Dr({typed:e,matrix:r,concat:l});return e(uN,{"number, number":m,"BigNumber, BigNumber":b,"Fraction, Fraction":(y,S)=>y.gcd(S)},v({SS:h,DS:f,Ss:p}),{[ose]:e.referToSelf(y=>(S,x,A)=>{for(var _=y(S,x),w=0;wS=>{if(S.length===1&&Array.isArray(S[0])&&lN(S[0]))return y(...S[0]);if(lN(S))return y(...S);throw new Gu("gcd() supports only 1d matrices!")}),Matrix:e.referToSelf(y=>S=>y(S.toArray()))});function m(y,S){if(!ot(y)||!ot(S))throw new Error("Parameters in function gcd must be integer numbers");for(var x;S!==0;)x=c(y,S),y=S,S=x;return y<0?-y:y}function b(y,S){if(!y.isInt()||!S.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var x=new o(0);!S.isZero();){var A=c(y,S);y=S,S=A}return y.lt(x)?y.neg():y}}),lse="matAlgo06xS0S0",cse=["typed","equalScalar"],zg=G(lse,cse,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._size,l=i._datatype||i._data===void 0?i._datatype:i.getDataType(),c=a._values,f=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==f.length)throw new Pt(u.length,f.length);if(u[0]!==f[0]||u[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");var p=u[0],v=u[1],m,b=r,y=0,S=s;typeof l=="string"&&l===h&&l!=="mixed"&&(m=l,b=e.find(r,[m,m]),y=e.convert(0,m),S=e.find(s,[m,m]));for(var x=o&&c?[]:void 0,A=[],_=[],w=x?[]:void 0,C=[],E=[],N=0;N{var{typed:e,matrix:r,equalScalar:n,concat:i}=t,a=Fa({typed:e,equalScalar:n}),s=zg({typed:e,equalScalar:n}),o=Fn({typed:e,equalScalar:n}),u=Dr({typed:e,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",c={};return c["".concat(l,", ").concat(l,", ...").concat(l)]=e.referToSelf(h=>(p,v,m)=>{for(var b=h(p,v),y=0;yh.lcm(p)},u({SS:s,DS:a,Ss:o}),c);function f(h,p){if(!h.isInt()||!p.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(p.isZero())return p;for(var v=h.times(p);!p.isZero();){var m=p;p=h.mod(m),h=m}return v.div(h).abs()}}),fN="log10",dse=["typed","config","Complex"],pse=G(fN,dse,t=>{var{typed:e,config:r,Complex:n}=t;return e(fN,{number:function(a){return a>=0||r.predictable?WB(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||r.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":e.referToSelf(i=>a=>It(a,i))})}),hN="log2",mse=["typed","config","Complex"],vse=G(hN,mse,t=>{var{typed:e,config:r,Complex:n}=t;return e(hN,{number:function(s){return s>=0||r.predictable?VB(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||r.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":e.referToSelf(a=>s=>It(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),gse="multiplyScalar",yse=["typed"],bse=G(gse,yse,t=>{var{typed:e}=t;return e("multiplyScalar",{"number, number":kB,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),dN="multiply",xse=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],wse=G(dN,xse,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=t,o=Fn({typed:e,equalScalar:a}),u=Oa({typed:e});function l(_,w){switch(_.length){case 1:switch(w.length){case 1:if(_[0]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(_[0]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+_[0]+") must match Matrix rows ("+w[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+w.length+" dimensions)")}break;case 2:switch(w.length){case 1:if(_[1]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+_[1]+") must match Vector length ("+w[0]+")");break;case 2:if(_[1]!==w[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+_[1]+") must match Matrix B rows ("+w[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+w.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+_.length+" dimensions)")}}function c(_,w,C){if(C===0)throw new Error("Cannot multiply two empty vectors");return s(_,w)}function f(_,w){if(w.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(_,w)}function h(_,w){var C=_._data,E=_._size,N=_._datatype||_.getDataType(),M=w._data,O=w._size,F=w._datatype||w.getDataType(),U=E[0],V=O[1],H,I=n,P=i;N&&F&&N===F&&typeof N=="string"&&N!=="mixed"&&(H=N,I=e.find(n,[H,H]),P=e.find(i,[H,H]));for(var K=[],$=0;$xe)for(var me=0,we=0;we(w,C)=>{l(Nt(w),Nt(C));var E=_(r(w),r(C));return dt(E)?E.valueOf():E}),"Matrix, Matrix":function(w,C){var E=w.size(),N=C.size();return l(E,N),E.length===1?N.length===1?c(w,C,E[0]):f(w,C):N.length===1?p(w,C):v(w,C)},"Matrix, Array":e.referTo("Matrix,Matrix",_=>(w,C)=>_(w,r(C))),"Array, Matrix":e.referToSelf(_=>(w,C)=>_(r(w,C.storage()),C)),"SparseMatrix, any":function(w,C){return o(w,C,i,!1)},"DenseMatrix, any":function(w,C){return u(w,C,i,!1)},"any, SparseMatrix":function(w,C){return o(C,w,i,!0)},"any, DenseMatrix":function(w,C){return u(C,w,i,!0)},"Array, any":function(w,C){return u(r(w),C,i,!1).valueOf()},"any, Array":function(w,C){return u(r(C),w,i,!0).valueOf()},"any, any":i,"any, any, ...any":e.referToSelf(_=>(w,C,E)=>{for(var N=_(w,C),M=0;M{var{typed:e,matrix:r,equalScalar:n,BigNumber:i,concat:a}=t,s=Vo({typed:e}),o=Fa({typed:e,equalScalar:n}),u=zg({typed:e,equalScalar:n}),l=Fn({typed:e,equalScalar:n}),c=Dr({typed:e,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return e(pN,{number:P2,"number, number":P2,BigNumber:p=>h(p,new i(2)),"BigNumber, BigNumber":h,Complex:f,"Complex, number":f,Array:e.referTo("DenseMatrix,number",p=>v=>p(r(v),2).valueOf()),DenseMatrix:e.referTo("DenseMatrix,number",p=>v=>p(v,2)),SparseMatrix:e.referTo("SparseMatrix,number",p=>v=>p(v,2)),"SparseMatrix, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return u(v,m,p);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return s(v,m,p,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":e.referTo("DenseMatrix,SparseMatrix",p=>(v,m)=>p(r(v),m)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(v,m)=>{if(m.density()===1)return l(m,v,p,!0);throw new Error("Root must be non-zero")})},c({scalar:"number | BigNumber",SD:o,Ss:l,sS:!1}));function h(p,v){var m=i.precision,b=i.clone({precision:m+2}),y=new i(0),S=new b(1),x=v.isNegative();if(x&&(v=v.neg()),v.isZero())throw new Error("Root must be non-zero");if(p.isNegative()&&!v.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(p.isZero())return x?new b(1/0):0;if(!p.isFinite())return x?y:p;var A=p.abs().pow(S.div(v));return A=p.isNeg()?A.neg():A,new i((x?S.div(A):A).toPrecision(m))}}),mN="sign",Ase=["typed","BigNumber","Fraction","complex"],Dse=G(mN,Ase,t=>{var{typed:e,BigNumber:r,complex:n,Fraction:i}=t;return e(mN,{number:t1,Complex:function(s){return s.im===0?n(t1(s.re)):s.sign()},BigNumber:function(s){return new r(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":e.referToSelf(a=>s=>It(s,a)),Unit:e.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return e.find(a,s.valueType())(s.value)})})}),Nse="sqrt",Ese=["config","typed","Complex"],Cse=G(Nse,Ese,t=>{var{config:e,typed:r,Complex:n}=t;return r("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||e.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||e.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),vN="square",Mse=["typed"],Tse=G(vN,Mse,t=>{var{typed:e}=t;return e(vN,{number:YB,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})}),gN="subtract",Ose=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Fse=G(gN,Ose,t=>{var{typed:e,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:o}=t,u=Vo({typed:e}),l=ai({typed:e}),c=$g({typed:e,equalScalar:n}),f=ju({typed:e,DenseMatrix:s}),h=gn({typed:e,DenseMatrix:s}),p=Dr({typed:e,matrix:r,concat:o});return e(gN,{"any, any":i},p({elop:i,SS:c,DS:u,SD:l,Ss:h,sS:f}))}),yN="xgcd",Rse=["typed","config","matrix","BigNumber"],Bse=G(yN,Rse,t=>{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e(yN,{"number, number":function(o,u){var l=jB(o,u);return r.matrix==="Array"?l:n(l)},"BigNumber, BigNumber":a});function a(s,o){var u,l,c,f=new i(0),h=new i(1),p=f,v=h,m=h,b=f;if(!s.isInt()||!o.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!o.isZero();)l=s.div(o).floor(),c=s.mod(o),u=p,p=v.minus(l.times(p)),v=u,u=m,m=b.minus(l.times(m)),b=u,s=o,o=c;var y;return s.lt(f)?y=[s.neg(),v.neg(),b.neg()]:y=[s,s.isZero()?0:v,b],r.matrix==="Array"?y:n(y)}}),bN="invmod",Pse=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Ise=G(bN,Pse,t=>{var{typed:e,config:r,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:o,add:u,isInteger:l}=t;return e(bN,{"number, number":c,"BigNumber, BigNumber":c});function c(f,h){if(!l(f)||!l(h))throw new Error("Parameters in function invmod must be integer numbers");if(f=o(f,h),a(h,0))throw new Error("Divisor must be non zero");var p=i(f,h);p=p.valueOf();var[v,m]=p;return a(v,n(1))?(m=o(m,h),s(m,n(0))&&(m=u(m,h)),m):NaN}}),kse="matAlgo09xS0Sf",Lse=["typed","equalScalar"],OP=G(kse,Lse,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));var C=o&&h?[]:void 0,E=[],N=[],M=C?[]:void 0,O=[],F,U,V,H,I;for(U=0;U{var{typed:e,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=t,s=Fa({typed:e,equalScalar:n}),o=OP({typed:e,equalScalar:n}),u=Fn({typed:e,equalScalar:n}),l=Dr({typed:e,matrix:r,concat:a});return e(xN,l({elop:i,SS:o,DS:s,Ss:u}))});function Use(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitAnd");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero()||e.eq(-1)||t.eq(e))return t;if(e.isZero()||t.eq(-1))return e;if(!t.isFinite()||!e.isFinite()){if(!t.isFinite()&&!e.isFinite())return t.isNegative()===e.isNegative()?t:new r(0);if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e;if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t}return mw(t,e,function(n,i){return n&i})}function qh(t){if(t.isFinite()&&!t.isInteger())throw new Error("Integer expected in function bitNot");var e=t.constructor,r=e.precision;e.config({precision:1e9});var n=t.plus(new e(1));return n.s=-n.s||null,e.config({precision:r}),n}function qse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitOr");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);var n=new r(-1);return t.isZero()||e.eq(n)||t.eq(e)?e:e.isZero()||t.eq(n)?t:!t.isFinite()||!e.isFinite()?!t.isFinite()&&!t.isNegative()&&e.isNegative()||t.isNegative()&&!e.isNegative()&&!e.isFinite()?n:t.isNegative()&&e.isNegative()?t.isFinite()?t:e:t.isFinite()?e:t:mw(t,e,function(i,a){return i|a})}function mw(t,e,r){var n=t.constructor,i,a,s=+(t.s<0),o=+(e.s<0);if(s){i=tm(qh(t));for(var u=0;u0;)r(c[--p],f[--v])===m&&(b=b.plus(y)),y=y.times(S);for(;v>0;)r(h,f[--v])===m&&(b=b.plus(y)),y=y.times(S);return n.config({precision:x}),m===0&&(b.s=-b.s),b}function tm(t){for(var e=t.d,r=e[0]+"",n=1;n0)if(++o>l)for(o-=l;o--;)u+="0";else o1&&((c[p+1]===null||c[p+1]===void 0)&&(c[p+1]=0),c[p+1]+=c[p]>>1,c[p]&=1)}return c.reverse()}function Hse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitXor");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero())return e;if(e.isZero())return t;if(t.eq(e))return new r(0);var n=new r(-1);return t.eq(n)?qh(e):e.eq(n)?qh(t):!t.isFinite()||!e.isFinite()?!t.isFinite()&&!e.isFinite()?n:new r(t.isNegative()===e.isNegative()?1/0:-1/0):mw(t,e,function(i,a){return i^a})}function Wse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function leftShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:!t.isFinite()&&!e.isFinite()?new r(NaN):e.lt(55)?t.times(Math.pow(2,e.toNumber())+""):t.times(new r(2).pow(e))}function Vse(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:e.isFinite()?e.lt(55)?t.div(Math.pow(2,e.toNumber())+"").floor():t.div(new r(2).pow(e)).floor():t.isNegative()?new r(-1):t.isFinite()?new r(0):new r(NaN)}var wN="bitAnd",Yse=["typed","matrix","equalScalar","concat"],FP=G(wN,Yse,t=>{var{typed:e,matrix:r,equalScalar:n,concat:i}=t,a=Fa({typed:e,equalScalar:n}),s=zg({typed:e,equalScalar:n}),o=Fn({typed:e,equalScalar:n}),u=Dr({typed:e,matrix:r,concat:i});return e(wN,{"number, number":XB,"BigNumber, BigNumber":Use},u({SS:s,DS:a,Ss:o}))}),SN="bitNot",jse=["typed"],Gse=G(SN,jse,t=>{var{typed:e}=t;return e(SN,{number:ZB,BigNumber:qh,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),_N="bitOr",Xse=["typed","matrix","equalScalar","DenseMatrix","concat"],RP=G(_N,Xse,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=Vo({typed:e}),o=pw({typed:e,equalScalar:n}),u=ju({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:r,concat:a});return e(_N,{"number, number":KB,"BigNumber, BigNumber":qse},l({SS:o,DS:s,Ss:u}))}),Zse="matAlgo07xSSf",Kse=["typed","DenseMatrix"],es=G(Zse,Kse,t=>{var{typed:e,DenseMatrix:r}=t;return function(a,s,o){var u=a._size,l=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=s._size,f=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(u.length!==c.length)throw new Pt(u.length,c.length);if(u[0]!==c[0]||u[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+c+")");var h=u[0],p=u[1],v,m=0,b=o;typeof l=="string"&&l===f&&l!=="mixed"&&(v=l,m=e.convert(0,v),b=e.find(o,[v,v]));var y,S,x=[];for(y=0;y{var{typed:e,matrix:r,DenseMatrix:n,concat:i}=t,a=ai({typed:e}),s=es({typed:e,DenseMatrix:n}),o=gn({typed:e,DenseMatrix:n}),u=Dr({typed:e,matrix:r,concat:i});return e(AN,{"number, number":JB,"BigNumber, BigNumber":Hse},u({SS:s,DS:a,Ss:o}))}),DN="arg",eoe=["typed"],toe=G(DN,eoe,t=>{var{typed:e}=t;return e(DN,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),NN="conj",roe=["typed"],noe=G(NN,roe,t=>{var{typed:e}=t;return e(NN,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),EN="im",ioe=["typed"],aoe=G(EN,ioe,t=>{var{typed:e}=t;return e(EN,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),CN="re",soe=["typed"],ooe=G(CN,soe,t=>{var{typed:e}=t;return e(CN,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),MN="not",uoe=["typed"],loe=G(MN,uoe,t=>{var{typed:e}=t;return e(MN,{"null | undefined":()=>!0,number:nP,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>It(n,r))})}),TN="or",coe=["typed","matrix","equalScalar","DenseMatrix","concat"],BP=G(TN,coe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=$g({typed:e,equalScalar:n}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:r,concat:a});return e(TN,{"number, number":iP,"Complex, Complex":function(f,h){return f.re!==0||f.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(f,h){return!f.isZero()&&!f.isNaN()||!h.isZero()&&!h.isNaN()},"Unit, Unit":e.referToSelf(c=>(f,h)=>c(f.value||0,h.value||0))},l({SS:o,DS:s,Ss:u}))}),ON="xor",foe=["typed","matrix","DenseMatrix","concat"],hoe=G(ON,foe,t=>{var{typed:e,matrix:r,DenseMatrix:n,concat:i}=t,a=ai({typed:e}),s=es({typed:e,DenseMatrix:n}),o=gn({typed:e,DenseMatrix:n}),u=Dr({typed:e,matrix:r,concat:i});return e(ON,{"number, number":aP,"Complex, Complex":function(c,f){return(c.re!==0||c.im!==0)!=(f.re!==0||f.im!==0)},"BigNumber, BigNumber":function(c,f){return(!c.isZero()&&!c.isNaN())!=(!f.isZero()&&!f.isNaN())},"Unit, Unit":e.referToSelf(l=>(c,f)=>l(c.value||0,f.value||0))},u({SS:s,DS:a,Ss:o}))}),FN="concat",doe=["typed","matrix","isInteger"],PP=G(FN,doe,t=>{var{typed:e,matrix:r,isInteger:n}=t;return e(FN,{"...Array | Matrix | number | BigNumber":function(a){var s,o=a.length,u=-1,l,c=!1,f=[];for(s=0;s0&&u>l)throw new Ma(u,l+1)}else{var p=vt(h).valueOf(),v=Nt(p);if(f[s]=p,l=u,u=v.length-1,s>0&&u!==l)throw new Pt(l+1,u+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var m=f.shift();f.length;)m=pB(m,f.shift(),u);return c?r(m):m},"...string":function(a){return a.join("")}})}),RN="column",poe=["typed","Index","matrix","range"],IP=G(RN,poe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t;return e(RN,{"Matrix, number":a,"Array, number":function(o,u){return a(n(vt(o)),u).valueOf()}});function a(s,o){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");gr(o,s.size()[1]);var u=i(0,s.size()[0]),l=new r(u,o),c=s.subset(l);return dt(c)?c:n([[c]])}}),BN="count",moe=["typed","size","prod"],voe=G(BN,moe,t=>{var{typed:e,size:r,prod:n}=t;return e(BN,{string:function(a){return a.length},"Matrix | Array":function(a){return n(r(a))}})}),PN="cross",goe=["typed","matrix","subtract","multiply"],yoe=G(PN,goe,t=>{var{typed:e,matrix:r,subtract:n,multiply:i}=t;return e(PN,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(s,o){var u=Math.max(Nt(s).length,Nt(o).length);s=bv(s),o=bv(o);var l=Nt(s),c=Nt(o);if(l.length!==1||c.length!==1||l[0]!==3||c[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+c.join(", ")+"])");var f=[n(i(s[1],o[2]),i(s[2],o[1])),n(i(s[2],o[0]),i(s[0],o[2])),n(i(s[0],o[1]),i(s[1],o[0]))];return u>1?[f]:f}}),IN="diag",boe=["typed","matrix","DenseMatrix","SparseMatrix"],xoe=G(IN,boe,t=>{var{typed:e,matrix:r,DenseMatrix:n,SparseMatrix:i}=t;return e(IN,{Array:function(l){return a(l,0,Nt(l),null)},"Array, number":function(l,c){return a(l,c,Nt(l),null)},"Array, BigNumber":function(l,c){return a(l,c.toNumber(),Nt(l),null)},"Array, string":function(l,c){return a(l,0,Nt(l),c)},"Array, number, string":function(l,c,f){return a(l,c,Nt(l),f)},"Array, BigNumber, string":function(l,c,f){return a(l,c.toNumber(),Nt(l),f)},Matrix:function(l){return a(l,0,l.size(),l.storage())},"Matrix, number":function(l,c){return a(l,c,l.size(),l.storage())},"Matrix, BigNumber":function(l,c){return a(l,c.toNumber(),l.size(),l.storage())},"Matrix, string":function(l,c){return a(l,0,l.size(),c)},"Matrix, number, string":function(l,c,f){return a(l,c,l.size(),f)},"Matrix, BigNumber, string":function(l,c,f){return a(l,c.toNumber(),l.size(),f)}});function a(u,l,c,f){if(!ot(l))throw new TypeError("Second parameter in function diag must be an integer");var h=l>0?l:0,p=l<0?-l:0;switch(c.length){case 1:return s(u,l,f,c[0],p,h);case 2:return o(u,l,f,c,p,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(u,l,c,f,h,p){var v=[f+h,f+p];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var m=c==="sparse"?i.diagonal(v,u,l):n.diagonal(v,u,l);return c!==null?m:m.valueOf()}function o(u,l,c,f,h,p){if(dt(u)){var v=u.diagonal(l);return c!==null?c!==v.storage()?r(v,c):v:v.valueOf()}for(var m=Math.min(f[0]-h,f[1]-p),b=[],y=0;y=2&&m.push("index: ".concat(xr(r))),p.length>=3&&m.push("array: ".concat(xr(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(t.name,"(").concat(m.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(t.name,": ").concat(b.message))}}}var woe="filter",Soe=["typed"],_oe=G(woe,Soe,t=>{var{typed:e}=t;return e("filter",{"Array, function":kN,"Matrix, function":function(n,i){return n.create(kN(n.toArray(),i))},"Array, RegExp":xv,"Matrix, RegExp":function(n,i){return n.create(xv(n.toArray(),i))}})});function kN(t,e){return hB(t,function(r,n,i){return Tc(e,r,[n],i,"filter")})}var LN="flatten",Aoe=["typed","matrix"],Doe=G(LN,Aoe,t=>{var{typed:e,matrix:r}=t;return e(LN,{Array:function(i){return tr(i)},Matrix:function(i){var a=tr(i.toArray());return r(a)}})}),$N="forEach",Noe=["typed"],Eoe=G($N,Noe,t=>{var{typed:e}=t;return e($N,{"Array, function":Coe,"Matrix, function":function(n,i){n.forEach(i)}})});function Coe(t,e){var r=function n(i,a){if(Array.isArray(i))Fg(i,function(s,o){n(s,a.concat(o))});else return Tc(e,i,a,t,"forEach")};r(t,[])}var zN="getMatrixDataType",Moe=["typed"],Toe=G(zN,Moe,t=>{var{typed:e}=t;return e(zN,{Array:function(n){return $h(n,xr)},Matrix:function(n){return n.getDataType()}})}),UN="identity",Ooe=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Foe=G(UN,Ooe,t=>{var{typed:e,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=t;return e(UN,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(c){return n(c)},"number | BigNumber":function(c){return u(c,c,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return u(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return u(c,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,h){return u(c,f,h)},Array:function(c){return o(c)},"Array, string":function(c,f){return o(c,f)},Matrix:function(c){return o(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return o(c.valueOf(),f)}});function o(l,c){switch(l.length){case 0:return c?n(c):[];case 1:return u(l[0],l[0],c);case 2:return u(l[0],l[1],c);default:throw new Error("Vector containing two values expected")}}function u(l,c,f){var h=Mt(l)||Mt(c)?i:null;if(Mt(l)&&(l=l.toNumber()),Mt(c)&&(c=c.toNumber()),!ot(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!ot(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var p=h?new i(1):1,v=h?new h(0):0,m=[l,c];if(f){if(f==="sparse")return s.diagonal(m,p,0,v);if(f==="dense")return a.diagonal(m,p,0,v);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var b=dc([],m,v),y=l{var{typed:e,matrix:r,multiplyScalar:n}=t;return e(qN,{"Matrix, Matrix":function(s,o){return r(i(s.toArray(),o.toArray()))},"Matrix, Array":function(s,o){return r(i(s.toArray(),o))},"Array, Matrix":function(s,o){return r(i(s,o.toArray()))},"Array, Array":i});function i(a,s){if(Nt(a).length===1&&(a=[a]),Nt(s).length===1&&(s=[s]),Nt(a).length>2||Nt(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var o=[],u=[];return a.map(function(l){return s.map(function(c){return u=[],o.push(u),l.map(function(f){return c.map(function(h){return u.push(n(f,h))})})})})&&o}}),HN="map",Poe=["typed"],Ioe=G(HN,Poe,t=>{var{typed:e}=t;return e(HN,{"Array, function":koe,"Matrix, function":function(n,i){return n.map(i)}})});function koe(t,e){var r=function n(i,a){return Array.isArray(i)?i.map(function(s,o){return n(s,a.concat(o))}):Tc(e,i,a,t,"map")};return r(t,[])}var WN="diff",Loe=["typed","matrix","subtract","number"],kP=G(WN,Loe,t=>{var{typed:e,matrix:r,subtract:n,number:i}=t;return e(WN,{"Array | Matrix":function(c){return dt(c)?r(s(c.toArray())):s(c)},"Array | Matrix, number":function(c,f){if(!ot(f))throw new RangeError("Dimension must be a whole number");return dt(c)?r(a(c.toArray(),f)):a(c,f)},"Array, BigNumber":e.referTo("Array,number",l=>(c,f)=>l(c,i(f))),"Matrix, BigNumber":e.referTo("Matrix,number",l=>(c,f)=>l(c,i(f)))});function a(l,c){if(dt(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(c>0){var f=[];return l.forEach(h=>{f.push(a(h,c-1))}),f}else{if(c===0)return s(l);throw RangeError("Cannot have negative dimension")}}function s(l){for(var c=[],f=l.length,h=1;h{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(l){var c=l[l.length-1];if(typeof c=="string"){var f=l.pop();return a(l,f)}else return r.matrix==="Array"?a(l):a(l,"default")},Array:a,Matrix:function(l){var c=l.storage();return a(l.valueOf(),c)},"Array | Matrix, string":function(l,c){return a(l.valueOf(),c)}});function a(u,l){var c=s(u),f=c?new i(1):1;if(o(u),l){var h=n(l);return u.length>0?h.resize(u,f):h}else{var p=[];return u.length>0?dc(p,u,f):p}}function s(u){var l=!1;return u.forEach(function(c,f,h){Mt(c)&&(l=!0,h[f]=c.toNumber())}),l}function o(u){u.forEach(function(l){if(typeof l!="number"||!ot(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function vw(){throw new Error('No "bignumber" implementation available')}function LP(){throw new Error('No "fraction" implementation available')}function $P(){throw new Error('No "matrix" implementation available')}var VN="range",qoe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],zP=G(VN,qoe,t=>{var{typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c}=t;return e(VN,{string:h,"string, boolean":h,"number, number":function(b,y){return f(p(b,y,1,!1))},"number, number, number":function(b,y,S){return f(p(b,y,S,!1))},"number, number, boolean":function(b,y,S){return f(p(b,y,1,S))},"number, number, number, boolean":function(b,y,S,x){return f(p(b,y,S,x))},"BigNumber, BigNumber":function(b,y){var S=b.constructor;return f(p(b,y,new S(1),!1))},"BigNumber, BigNumber, BigNumber":function(b,y,S){return f(p(b,y,S,!1))},"BigNumber, BigNumber, boolean":function(b,y,S){var x=b.constructor;return f(p(b,y,new x(1),S))},"BigNumber, BigNumber, BigNumber, boolean":function(b,y,S,x){return f(p(b,y,S,x))},"Unit, Unit, Unit":function(b,y,S){return f(p(b,y,S,!1))},"Unit, Unit, Unit, boolean":function(b,y,S,x){return f(p(b,y,S,x))}});function f(m){return r.matrix==="Matrix"?n?n(m):$P():m}function h(m,b){var y=v(m);if(!y)throw new SyntaxError('String "'+m+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&vw(),f(p(i(y.start),i(y.end),i(y.step)))):f(p(y.start,y.end,y.step,b))}function p(m,b,y,S){for(var x=[],A=c(y)?S?s:a:S?u:o,_=m;A(_,b);)x.push(_),_=l(_,y);return x}function v(m){var b=m.split(":"),y=b.map(function(x){return Number(x)}),S=y.some(function(x){return isNaN(x)});if(S)return null;switch(y.length){case 2:return{start:y[0],end:y[1],step:1};case 3:return{start:y[0],end:y[2],step:y[1]};default:return null}}}),YN="reshape",Hoe=["typed","isInteger","matrix"],Woe=G(YN,Hoe,t=>{var{typed:e,isInteger:r}=t;return e(YN,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!r(s))throw new TypeError("Invalid size for dimension: "+s)}),uw(i,a)}})}),Voe="resize",Yoe=["config","matrix"],joe=G(Voe,Yoe,t=>{var{config:e,matrix:r}=t;return function(a,s,o){if(arguments.length!==2&&arguments.length!==3)throw new Gu("resize",arguments.length,2,3);if(dt(s)&&(s=s.valueOf()),Mt(s[0])&&(s=s.map(function(c){return Mt(c)?c.toNumber():c})),dt(a))return a.resize(s,o,!0);if(typeof a=="string")return n(a,s,o);var u=Array.isArray(a)?!1:e.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return vt(a)}else{Array.isArray(a)||(a=[a]),a=vt(a);var l=dc(a,s,o);return u?r(l):l}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new Pt(a.length,1);var o=a[0];if(typeof o!="number"||!ot(o))throw new TypeError("Invalid size, must contain positive integers (size: "+Rt(a)+")");if(i.length>o)return i.substring(0,o);if(i.length{var{typed:e,multiply:r,rotationMatrix:n}=t;return e(jN,{"Array , number | BigNumber | Complex | Unit":function(s,o){i(s,2);var u=r(n(o),s);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,o){return i(s,2),r(n(o),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,o,u){i(s,3);var l=r(n(o,u),s);return l},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,o,u){return i(s,3),r(n(o,u),s)}});function i(a,s){var o=Array.isArray(a)?Nt(a):a.size();if(o.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(o.length===2&&o[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(o[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}}),GN="rotationMatrix",Zoe=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Koe=G(GN,Zoe,t=>{var{typed:e,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:o,matrix:u,DenseMatrix:l,SparseMatrix:c,cos:f,sin:h}=t;return e(GN,{"":function(){return r.matrix==="Matrix"?u([]):[]},string:function(x){return u(x)},"number | BigNumber | Complex | Unit":function(x){return p(x,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(x,A){return p(x,A)},"number | BigNumber | Complex | Unit, Array":function(x,A){var _=u(A);return v(_),y(x,_,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(x,A){v(A);var _=A.storage()||(r.matrix==="Matrix"?"dense":void 0);return y(x,A,_)},"number | BigNumber | Complex | Unit, Array, string":function(x,A,_){var w=u(A);return v(w),y(x,w,_)},"number | BigNumber | Complex | Unit, Matrix, string":function(x,A,_){return v(A),y(x,A,_)}});function p(S,x){var A=Mt(S),_=A?new o(-1):-1,w=f(S),C=h(S),E=[[w,n(_,C)],[C,w]];return b(E,x)}function v(S){var x=S.size();if(x.length<1||x[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function m(S){return S.reduce((x,A)=>n(x,A))}function b(S,x){if(x){if(x==="sparse")return new c(S);if(x==="dense")return new l(S);throw new TypeError('Unknown matrix type "'.concat(x,'"'))}return S}function y(S,x,A){var _=s(x);if(_===0)throw new RangeError("Rotation around zero vector");var w=Mt(S)?o:null,C=w?new w(1):1,E=w?new w(-1):-1,N=w?new w(x.get([0])/_):x.get([0])/_,M=w?new w(x.get([1])/_):x.get([1])/_,O=w?new w(x.get([2])/_):x.get([2])/_,F=f(S),U=i(C,a(F)),V=h(S),H=i(F,m([N,N,U])),I=i(m([N,M,U]),m([E,O,V])),P=i(m([N,O,U]),m([M,V])),K=i(m([N,M,U]),m([O,V])),$=i(F,m([M,M,U])),se=i(m([M,O,U]),m([E,N,V])),he=i(m([N,O,U]),m([E,M,V])),ne=i(m([M,O,U]),m([N,V])),X=i(F,m([O,O,U])),de=[[H,I,P],[K,$,se],[he,ne,X]];return b(de,A)}}),XN="row",Joe=["typed","Index","matrix","range"],UP=G(XN,Joe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t;return e(XN,{"Matrix, number":a,"Array, number":function(o,u){return a(n(vt(o)),u).valueOf()}});function a(s,o){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");gr(o,s.size()[0]);var u=i(0,s.size()[1]),l=new r(o,u),c=s.subset(l);return dt(c)?c:n([[c]])}}),ZN="size",Qoe=["typed","config","?matrix"],eue=G(ZN,Qoe,t=>{var{typed:e,config:r,matrix:n}=t;return e(ZN,{Matrix:function(a){return a.create(a.size())},Array:Nt,string:function(a){return r.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return r.matrix==="Array"?[]:n?n([]):$P()}})}),KN="squeeze",tue=["typed","matrix"],rue=G(KN,tue,t=>{var{typed:e,matrix:r}=t;return e(KN,{Array:function(i){return bv(vt(i))},Matrix:function(i){var a=bv(i.toArray());return Array.isArray(a)?r(a):a},any:function(i){return vt(i)}})}),JN="subset",nue=["typed","matrix","zeros","add"],qP=G(JN,nue,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t;return e(JN,{"Matrix, Index":function(o,u){return hc(u)?r():(yv(o,u),o.subset(u))},"Array, Index":e.referTo("Matrix, Index",function(s){return function(o,u){var l=s(r(o),u);return u.isScalar()?l:l.valueOf()}}),"Object, Index":aue,"string, Index":iue,"Matrix, Index, any, any":function(o,u,l,c){return hc(u)?o:(yv(o,u),o.clone().subset(u,a(l,u),c))},"Array, Index, any, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l,c){var f=s(r(o),u,l,c);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l){return s(r(o),u,l,void 0).valueOf()}}),"Matrix, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(o,u,l){return s(o,u,l,void 0)}}),"string, Index, string":QN,"string, Index, string, string":QN,"Object, Index, any":sue});function a(s,o){if(typeof s=="string")throw new Error("can't boradcast a string");if(o._isScalar)return s;var u=o.size();if(u.every(l=>l>0))try{return i(s,n(u))}catch{return s}else return s}});function iue(t,e){if(!Cg(e))throw new TypeError("Index expected");if(hc(e))return"";if(yv(Array.from(t),e),e.size().length!==1)throw new Pt(e.size().length,1);var r=t.length;gr(e.min()[0],r),gr(e.max()[0],r);var n=e.dimension(0),i="";return n.forEach(function(a){i+=t.charAt(a)}),i}function QN(t,e,r,n){if(!e||e.isIndex!==!0)throw new TypeError("Index expected");if(hc(e))return t;if(yv(Array.from(t),e),e.size().length!==1)throw new Pt(e.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=e.dimension(0),a=i.size()[0];if(a!==r.length)throw new Pt(i.size()[0],r.length);var s=t.length;gr(e.min()[0]),gr(e.max()[0]);for(var o=[],u=0;us)for(var l=s-1,c=o.length;l{var{typed:e,matrix:r}=t;return e(eE,{Array:s=>n(r(s)).valueOf(),Matrix:n,any:vt});function n(s){var o=s.size(),u;switch(o.length){case 1:u=s.clone();break;case 2:{var l=o[0],c=o[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Rt(o)+")");switch(s.storage()){case"dense":u=i(s,l,c);break;case"sparse":u=a(s,l,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Rt(o)+")")}return u}function i(s,o,u){for(var l=s._data,c=[],f,h=0;h{var{typed:e,transpose:r,conj:n}=t;return e(tE,{any:function(a){return n(r(a))}})}),rE="zeros",fue=["typed","config","matrix","BigNumber"],hue=G(rE,fue,t=>{var{typed:e,config:r,matrix:n,BigNumber:i}=t;return e(rE,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(l){var c=l[l.length-1];if(typeof c=="string"){var f=l.pop();return a(l,f)}else return r.matrix==="Array"?a(l):a(l,"default")},Array:a,Matrix:function(l){var c=l.storage();return a(l.valueOf(),c)},"Array | Matrix, string":function(l,c){return a(l.valueOf(),c)}});function a(u,l){var c=s(u),f=c?new i(0):0;if(o(u),l){var h=n(l);return u.length>0?h.resize(u,f):h}else{var p=[];return u.length>0?dc(p,u,f):p}}function s(u){var l=!1;return u.forEach(function(c,f,h){Mt(c)&&(l=!0,h[f]=c.toNumber())}),l}function o(u){u.forEach(function(l){if(typeof l!="number"||!ot(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),nE="fft",due=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],pue=G(nE,due,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:o,i:u,dotDivide:l,conj:c,pow:f,ceil:h,log2:p}=t;return e(nE,{Array:v,Matrix:function(x){return x.create(v(x.toArray()))}});function v(S){var x=Nt(S);return x.length===1?y(S,x[0]):m(S.map(A=>v(A,x.slice(1))),0)}function m(S,x){var A=Nt(S);if(x!==0)return new Array(A[0]).fill(0).map((w,C)=>m(S[C],x-1));if(A.length===1)return y(S);function _(w){var C=Nt(w);return new Array(C[1]).fill(0).map((E,N)=>new Array(C[0]).fill(0).map((M,O)=>w[O][N]))}return _(m(_(S),1))}function b(S){for(var x=S.length,A=s(a(i(-1,i(u,o)),x)),_=[],w=1-x;wi(S[P],_[x-1+P])),...new Array(C-x).fill(0)],N=[...new Array(x+x-1).fill(0).map((I,P)=>a(1,_[P])),...new Array(C-(x+x-1)).fill(0)],M=y(E),O=y(N),F=new Array(C).fill(0).map((I,P)=>i(M[P],O[P])),U=l(c(v(c(F))),C),V=[],H=x-1;HN%2===0)),...y(S.filter((E,N)=>N%2===1))],_=0;_{var{typed:e,fft:r,dotDivide:n,conj:i}=t;return e(iE,{"Array | Matrix":function(s){var o=dt(s)?s.size():Nt(s);return n(i(r(i(s))),o.reduce((u,l)=>u*l,1))}})});function Hh(t){return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(t)}function gue(t,e){if(Hh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yue(t){var e=gue(t,"string");return Hh(e)=="symbol"?e:String(e)}function vn(t,e,r){return e=yue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bue(t){for(var e=1;e{var{typed:e,add:r,subtract:n,multiply:i,divide:a,max:s,map:o,abs:u,isPositive:l,isNegative:c,larger:f,smaller:h,matrix:p,bignumber:v,unaryMinus:m}=t;function b(E){return function(N,M,O,F){var U=!(M.length===2&&(M.every(w)||M.every(Xi)));if(U)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var V=M[0],H=M[1],I=f(H,V),P=F.firstStep;if(P!==void 0&&!l(P))throw new Error('"firstStep" must be positive');var K=F.maxStep;if(K!==void 0&&!l(K))throw new Error('"maxStep" must be positive');var $=F.minStep;if($&&c($))throw new Error('"minStep" must be positive or zero');var se=[V,H,P,$,K].filter(R=>R!==void 0);if(!(se.every(w)||se.every(Xi)))throw new Error('Inconsistent type of "t" dependant variables');for(var he=1,ne=F.tol?F.tol:1e-4,X=F.minDelta?F.minDelta:.2,de=F.maxDelta?F.maxDelta:5,Se=F.maxIter?F.maxIter:1e4,ce=[V,H,...O,K,$].some(Mt),[xe,_e,me,we]=ce?[v(E.a),v(E.c),v(E.b),v(E.bp)]:[E.a,E.c,E.b,E.bp],Ne=P?I?P:m(P):a(n(H,V),he),Ce=[V],He=[O],qe=n(me,we),J=0,te=0,ye=A(I),ee=_(I);ye(Ce[J],H);){var ue=[];Ne=ee(Ce[J],H,Ne),ue.push(N(Ce[J],He[J]));for(var le=1;le<_e.length;++le)ue.push(N(r(Ce[J],i(_e[le],Ne)),r(He[J],i(Ne,xe[le],ue))));var Ee=s(u(o(i(qe,ue),R=>Xi(R)?R.value:R)));Ee1/4&&(Ce.push(r(Ce[J],Ne)),He.push(r(He[J],i(Ne,me,ue))),J++);var Me=.84*(ne/Ee)**(1/5);if(h(Me,X)?Me=X:f(Me,de)&&(Me=de),Me=ce?v(Me):Me,Ne=i(Ne,Me),K&&f(u(Ne),K)?Ne=I?K:m(K):$&&h(u(Ne),$)&&(Ne=I?$:m($)),te++,te>Se)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ce,y:He}}}function y(E,N,M,O){var F=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],U=[null,1/2,3/4,1],V=[2/9,1/3,4/9,0],H=[7/24,1/4,1/3,1/8],I={a:F,c:U,b:V,bp:H};return b(I)(E,N,M,O)}function S(E,N,M,O){var F=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],U=[null,1/5,3/10,4/5,8/9,1,1],V=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],H=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],I={a:F,c:U,b:V,bp:H};return b(I)(E,N,M,O)}function x(E,N,M,O){var F=O.method?O.method:"RK45",U={RK23:y,RK45:S};if(F.toUpperCase()in U){var V=bue({},O);return delete V.method,U[F.toUpperCase()](E,N,M,V)}else{var H=Object.keys(U).map(P=>'"'.concat(P,'"')),I="".concat(H.slice(0,-1).join(", ")," and ").concat(H.slice(-1));throw new Error('Unavailable method "'.concat(F,'". Available methods are ').concat(I))}}function A(E){return E?h:f}function _(E){var N=E?f:h;return function(M,O,F){var U=r(M,F);return N(U,O)?n(O,M):F}}function w(E){return Mt(E)||Ct(E)}function C(E,N,M,O){var F=x(E,N.toArray(),M.toArray(),O);return{t:p(F.t),y:p(F.y)}}return e("solveODE",{"function, Array, Array, Object":x,"function, Matrix, Matrix, Object":C,"function, Array, Array":(E,N,M)=>x(E,N,M,{}),"function, Matrix, Matrix":(E,N,M)=>C(E,N,M,{}),"function, Array, number | BigNumber | Unit":(E,N,M)=>{var O=x(E,N,[M],{});return{t:O.t,y:O.y.map(F=>F[0])}},"function, Matrix, number | BigNumber | Unit":(E,N,M)=>{var O=x(E,N.toArray(),[M],{});return{t:p(O.t),y:p(O.y.map(F=>F[0]))}},"function, Array, number | BigNumber | Unit, Object":(E,N,M,O)=>{var F=x(E,N,[M],O);return{t:F.t,y:F.y.map(U=>U[0])}},"function, Matrix, number | BigNumber | Unit, Object":(E,N,M,O)=>{var F=x(E,N.toArray(),[M],O);return{t:p(F.t),y:p(F.y.map(U=>U[0]))}}})}),_ue="erf",Aue=["typed"],Due=G(_ue,Aue,t=>{var{typed:e}=t;return e("name",{number:function(s){var o=Math.abs(s);return o>=Cue?To(s):o<=Nue?To(s)*r(o):o<=4?To(s)*(1-n(o)):To(s)*(1-i(o))},"Array | Matrix":e.referToSelf(a=>s=>It(s,a))});function r(a){var s=a*a,o=ws[0][4]*s,u=s,l;for(l=0;l<3;l+=1)o=(o+ws[0][l])*s,u=(u+Ol[0][l])*s;return a*(o+ws[0][3])/(u+Ol[0][3])}function n(a){var s=ws[1][8]*a,o=a,u;for(u=0;u<7;u+=1)s=(s+ws[1][u])*a,o=(o+Ol[1][u])*a;var l=(s+ws[1][7])/(o+Ol[1][7]),c=parseInt(a*16)/16,f=(a-c)*(a+c);return Math.exp(-c*c)*Math.exp(-f)*l}function i(a){var s=1/(a*a),o=ws[2][5]*s,u=s,l;for(l=0;l<4;l+=1)o=(o+ws[2][l])*s,u=(u+Ol[2][l])*s;var c=s*(o+ws[2][4])/(u+Ol[2][4]);c=(Eue-c)/a,s=parseInt(a*16)/16;var f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*c}}),Nue=.46875,Eue=.5641895835477563,ws=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Ol=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Cue=Math.pow(2,53),sE="zeta",Mue=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Tue=G(sE,Mue,t=>{var{typed:e,config:r,multiply:n,pow:i,divide:a,factorial:s,equal:o,smallerEq:u,isNegative:l,gamma:c,sin:f,subtract:h,add:p,Complex:v,BigNumber:m,pi:b}=t;return e(sE,{number:w=>y(w,C=>C,()=>20),BigNumber:w=>y(w,C=>new m(C),()=>Math.abs(Math.log10(r.epsilon))),Complex:S});function y(w,C,E){return o(w,0)?C(-.5):o(w,1)?C(NaN):isFinite(w)?x(w,C,E,N=>N):l(w)?C(NaN):C(1)}function S(w){return w.re===0&&w.im===0?new v(-.5):w.re===1?new v(NaN,NaN):w.re===1/0&&w.im===0?new v(1):w.im===1/0||w.re===-1/0?new v(NaN,NaN):x(w,C=>C,C=>Math.round(1.3*15+.9*Math.abs(C.im)),C=>C.re)}function x(w,C,E,N){var M=E(w);if(N(w)>-(M-1)/2)return _(w,C(M),C);var O=n(i(2,w),i(C(b),h(w,1)));return O=n(O,f(n(a(C(b),2),w))),O=n(O,c(h(1,w))),n(O,x(h(1,w),C,E,N))}function A(w,C){for(var E=w,N=w;u(N,C);N=p(N,1)){var M=a(n(s(p(C,h(N,1))),i(4,N)),n(s(h(C,N)),s(n(2,N))));E=p(E,M)}return n(C,E)}function _(w,C,E){for(var N=a(1,n(A(E(0),C),h(1,i(2,h(1,w))))),M=E(0),O=E(1);u(O,C);O=p(O,1))M=p(M,a(n((-1)**(O-1),A(O,C)),i(O,w)));return n(N,M)}}),oE="mode",Oue=["typed","isNaN","isNumeric"],Fue=G(oE,Oue,t=>{var{typed:e,isNaN:r,isNumeric:n}=t;return e(oE,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=tr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var o={},u=[],l=0,c=0;cl&&(l=o[f],u=[f])}return u}});function ii(t,e,r){var n;return String(t).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+xr(r)+", value: "+JSON.stringify(r)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+n)):String(t).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+xr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+n)):t}var uE="prod",Rue=["typed","config","multiplyScalar","numeric"],Bue=G(uE,Rue,t=>{var{typed:e,config:r,multiplyScalar:n,numeric:i}=t;return e(uE,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(s){var o;if(Ws(s,function(u){try{o=o===void 0?u:n(o,u)}catch(l){throw ii(l,"prod",u)}}),typeof o=="string"&&(o=i(o,r.number)),o===void 0)throw new Error("Cannot calculate prod of an empty array");return o}}),lE="format",Pue=["typed"],Iue=G(lE,Pue,t=>{var{typed:e}=t;return e(lE,{any:Rt,"any, Object | function | number | BigNumber":Rt})}),cE="bin",kue=["typed","format"],Lue=G(cE,kue,t=>{var{typed:e,format:r}=t;return e(cE,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"bin",wordSize:a})}})}),fE="oct",$ue=["typed","format"],zue=G(fE,$ue,t=>{var{typed:e,format:r}=t;return e(fE,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"oct",wordSize:a})}})}),hE="hex",Uue=["typed","format"],que=G(hE,Uue,t=>{var{typed:e,format:r}=t;return e(hE,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return r(i,{notation:"hex",wordSize:a})}})}),HP=/\$([\w.]+)/g,dE="print",Hue=["typed"],WP=G(dE,Hue,t=>{var{typed:e}=t;return e(dE,{"string, Object | Array":pE,"string, Object | Array, number | Object":pE})});function pE(t,e,r){return t.replace(HP,function(n,i){var a=i.split("."),s=e[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var o=a.shift();s=o?s[o]:s+"."}return s!==void 0?$n(s)?s:Rt(s,r):n})}var mE="to",Wue=["typed","matrix","concat"],Vue=G(mE,Wue,t=>{var{typed:e,matrix:r,concat:n}=t,i=Dr({typed:e,matrix:r,concat:n});return e(mE,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))}),vE="isPrime",Yue=["typed"],jue=G(vE,Yue,t=>{var{typed:e}=t;return e(vE,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(S,x,A){for(var _=1;!x.eq(0);)x.mod(2).eq(0)?(x=x.div(2),S=S.mul(S).mod(A)):(x=x.sub(1),_=S.mul(_).mod(A));return _}var o=n.constructor.clone({precision:n.toFixed(0).length*2});n=new o(n);for(var u=0,l=n.sub(1);l.mod(2).eq(0);)l=l.div(2),u+=1;var c=null;if(n.lt("3317044064679887385961981"))c=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(S=>Sn=>It(n,r))})}),Gue="numeric",Xue=["number","?bignumber","?fraction"],Zue=G(Gue,Xue,t=>{var{number:e,bignumber:r,fraction:n}=t,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>e(s),BigNumber:r?s=>r(s):vw,Fraction:n?s=>n(s):LP};return function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",l=arguments.length>2?arguments[2]:void 0;if(l!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=xr(o);if(!(c in i))throw new TypeError("Cannot convert "+o+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===c?o:a[u](o)}}),gE="divideScalar",Kue=["typed","numeric"],Jue=G(gE,Kue,t=>{var{typed:e,numeric:r}=t;return e(gE,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),yE="pow",Que=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],ele=G(yE,Que,t=>{var{typed:e,config:r,identity:n,multiply:i,matrix:a,inv:s,number:o,fraction:u,Complex:l}=t;return e(yE,{"number, number":c,"Complex, Complex":function(v,m){return v.pow(m)},"BigNumber, BigNumber":function(v,m){return m.isInteger()||v>=0||r.predictable?v.pow(m):new l(v.toNumber(),0).pow(m.toNumber(),0)},"Fraction, Fraction":function(v,m){var b=v.pow(m);if(b!=null)return b;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(v.valueOf(),m.valueOf())},"Array, number":f,"Array, BigNumber":function(v,m){return f(v,m.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(v,m){return h(v,m.toNumber())},"Unit, number | BigNumber":function(v,m){return v.pow(m)}});function c(p,v){if(r.predictable&&!ot(v)&&p<0)try{var m=u(v),b=o(m);if((v===b||Math.abs((v-b)/v)<1e-14)&&m.d%2===1)return(m.n%2===0?1:-1)*Math.pow(-p,v)}catch{}return r.predictable&&(p<-1&&v===1/0||p>-1&&p<0&&v===-1/0)?NaN:ot(v)||p>=0||r.predictable?GB(p,v):p*p<1&&v===1/0||p*p>1&&v===-1/0?0:new l(p,0).pow(v,0)}function f(p,v){if(!ot(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var m=Nt(p);if(m.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+m.length+" dimensions)");if(m[0]!==m[1])throw new Error("For A^b, A must be square (size is "+m[0]+"x"+m[1]+")");if(v<0)try{return f(s(p),-v)}catch(S){throw S.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):S}for(var b=n(m[0]).valueOf(),y=p;v>=1;)(v&1)===1&&(b=i(y,b)),v>>=1,y=i(y,y);return b}function h(p,v){return a(f(p.valueOf(),v))}}),Fl="Number of decimals in function round must be an integer",bE="round",tle=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],rle=G(bE,tle,t=>{var{typed:e,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:o}=t,u=Fn({typed:e,equalScalar:i}),l=gn({typed:e,DenseMatrix:o}),c=Oa({typed:e});function f(h){return Math.abs(fd(h).exponent)}return e(bE,{number:function(p){var v=Vf(p,f(r.epsilon)),m=ni(p,v,r.epsilon)?v:p;return Vf(m)},"number, number":function(p,v){var m=f(r.epsilon);if(v>=m)return Vf(p,v);var b=Vf(p,m),y=ni(p,b,r.epsilon)?b:p;return Vf(y,v)},"number, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);return new s(p).toDecimalPlaces(v.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,v){if(v%1)throw new TypeError(Fl);return p.round(v)},"Complex, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);var m=v.toNumber();return p.round(m)},BigNumber:function(p){var v=new s(p).toDecimalPlaces(f(r.epsilon)),m=ia(p,v,r.epsilon)?v:p;return m.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);var m=f(r.epsilon);if(v>=m)return p.toDecimalPlaces(v.toNumber());var b=p.toDecimalPlaces(m),y=ia(p,b,r.epsilon)?b:p;return y.toDecimalPlaces(v.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,v){if(v%1)throw new TypeError(Fl);return p.round(v)},"Fraction, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(Fl);return p.round(v.toNumber())},"Unit, number, Unit":e.referToSelf(h=>function(p,v,m){var b=p.toNumeric(m);return m.multiply(h(b,v))}),"Unit, BigNumber, Unit":e.referToSelf(h=>(p,v,m)=>h(p,v.toNumber(),m)),"Unit, Unit":e.referToSelf(h=>(p,v)=>h(p,0,v)),"Array | Matrix, number, Unit":e.referToSelf(h=>(p,v,m)=>It(p,b=>h(b,v,m))),"Array | Matrix, BigNumber, Unit":e.referToSelf(h=>(p,v,m)=>h(p,v.toNumber(),m)),"Array | Matrix, Unit":e.referToSelf(h=>(p,v)=>h(p,0,v)),"Array | Matrix":e.referToSelf(h=>p=>It(p,h)),"SparseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>u(p,v,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(p,v)=>c(p,v,h,!1)),"Array, number | BigNumber":e.referToSelf(h=>(p,v)=>c(n(p),v,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(h=>(p,v)=>i(p,0)?a(v.size(),v.storage()):l(v,p,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(h=>(p,v)=>i(p,0)?a(v.size(),v.storage()):c(v,p,h,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(h=>(p,v)=>c(n(v),p,h,!0).valueOf())})}),xE="log",nle=["config","typed","divideScalar","Complex"],ile=G(xE,nle,t=>{var{typed:e,config:r,divideScalar:n,Complex:i}=t;return e(xE,{number:function(s){return s>=0||r.predictable?rie(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":e.referToSelf(a=>(s,o)=>n(a(s),a(o)))})}),wE="log1p",ale=["typed","config","divideScalar","log","Complex"],sle=G(wE,ale,t=>{var{typed:e,config:r,divideScalar:n,log:i,Complex:a}=t;return e(wE,{number:function(u){return u>=-1||r.predictable?ere(u):s(new a(u,0))},Complex:s,BigNumber:function(u){var l=u.plus(1);return!l.isNegative()||r.predictable?l.ln():s(new a(u.toNumber(),0))},"Array | Matrix":e.referToSelf(o=>u=>It(u,o)),"any, any":e.referToSelf(o=>(u,l)=>n(o(u),i(l)))});function s(o){var u=o.re+1;return new a(Math.log(Math.sqrt(u*u+o.im*o.im)),Math.atan2(o.im,u))}}),SE="nthRoots",ole=["config","typed","divideScalar","Complex"],ule=G(SE,ole,t=>{var{typed:e,config:r,divideScalar:n,Complex:i}=t,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function s(o,u){if(u<0)throw new Error("Root must be greater than zero");if(u===0)throw new Error("Root must be non-zero");if(u%1!==0)throw new Error("Root must be an integer");if(o===0||o.abs()===0)return[new i(0,0)];var l=typeof o=="number",c;(l||o.re===0||o.im===0)&&(l?c=2*+(o<0):o.im===0?c=2*+(o.re<0):c=2*+(o.im<0)+1);for(var f=o.arg(),h=o.abs(),p=[],v=Math.pow(h,1/u),m=0;m{var{typed:e,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:s}=t,o=ai({typed:e}),u=es({typed:e,DenseMatrix:a}),l=Fn({typed:e,equalScalar:r}),c=gn({typed:e,DenseMatrix:a}),f=Dr({typed:e,matrix:n,concat:s}),h={};for(var p in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,p)&&!p.includes("Matrix")&&!p.includes("Array")&&(h[p]=i.signatures[p]);var v=e(h);return e(_E,f({elop:v,SS:u,DS:o,Ss:l,sS:c}))}),AE="dotDivide",fle=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],hle=G(AE,fle,t=>{var{typed:e,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=ai({typed:e}),l=es({typed:e,DenseMatrix:a}),c=Fn({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:a}),h=Dr({typed:e,matrix:r,concat:s});return e(AE,h({elop:i,SS:l,DS:u,SD:o,Ss:c,sS:f}))});function dd(t){var{DenseMatrix:e}=t;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Rt(s)+")");var o=s[0],u=s[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Rt(s)+")");var l=[];if(dt(i)){var c=i.size(),f=i._data;if(c.length===1){if(c[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(DE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.valueOf()}});function l(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=[],y=f._data,S=0;SA&&(C.push(b[O]),E.push(F))}if(s(w,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var U=n(_,w),V=0,H=E.length;V{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(NE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.valueOf()}});function l(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=[],y=f._data,S=m-1;S>=0;S--){var x=p[S][0]||0,A=void 0;if(s(x,0))A=0;else{var _=y[S][S];if(s(_,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(x,_);for(var w=S-1;w>=0;w--)p[w]=[a(p[w][0]||0,i(A,y[w][S]))]}b[S]=[A]}return new o({data:b,size:[v,1]})}function c(f,h){h=u(f,h,!0);for(var p=h._data,v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=[],A=m-1;A>=0;A--){var _=p[A][0]||0;if(s(_,0))x[A]=[0];else{for(var w=0,C=[],E=[],N=S[A],M=S[A+1],O=M-1;O>=N;O--){var F=y[O];F===A?w=b[O]:F{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(EE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.map(b=>b.valueOf())}});function l(f,h){for(var p=[u(f,h,!0)._data.map(E=>E[0])],v=f._data,m=f._size[0],b=f._size[1],y=0;ynew o({data:E.map(N=>[N]),size:[m,1]}))}function c(f,h){for(var p=[u(f,h,!0)._data.map(he=>he[0])],v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=0;xx&&(C.push(b[F]),E.push(U))}if(s(O,0))if(s(w[x],0)){if(_===0){var P=[...w];P[x]=1;for(var K=0,$=E.length;K<$;K++){var se=E[K];P[se]=a(P[se],C[K])}p.push(P)}}else{if(_===0)return[];p.splice(_,1),_-=1,A-=1}else{w[x]=n(w[x],O);for(var V=0,H=E.length;Vnew o({data:he.map(ne=>[ne]),size:[v,1]}))}}),CE="usolveAll",ble=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],xle=G(CE,ble,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(CE,{"SparseMatrix, Array | Matrix":function(h,p){return c(h,p)},"DenseMatrix, Array | Matrix":function(h,p){return l(h,p)},"Array, Array | Matrix":function(h,p){var v=r(h),m=l(v,p);return m.map(b=>b.valueOf())}});function l(f,h){for(var p=[u(f,h,!0)._data.map(E=>E[0])],v=f._data,m=f._size[0],b=f._size[1],y=b-1;y>=0;y--)for(var S=p.length,x=0;x=0;C--)w[C]=a(w[C],v[C][y]);p.push(w)}}else{if(x===0)return[];p.splice(x,1),x-=1,S-=1}else{A[y]=n(A[y],v[y][y]);for(var _=y-1;_>=0;_--)A[_]=a(A[_],i(A[y],v[_][y]))}}return p.map(E=>new o({data:E.map(N=>[N]),size:[m,1]}))}function c(f,h){for(var p=[u(f,h,!0)._data.map(he=>he[0])],v=f._size[0],m=f._size[1],b=f._values,y=f._index,S=f._ptr,x=m-1;x>=0;x--)for(var A=p.length,_=0;_=N;F--){var U=y[F];U===x?O=b[F]:Unew o({data:he.map(ne=>[ne]),size:[v,1]}))}}),wle="matAlgo08xS0Sid",Sle=["typed","equalScalar"],gw=G(wle,Sle,t=>{var{typed:e,equalScalar:r}=t;return function(i,a,s){var o=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=a._values,p=a._index,v=a._ptr,m=a._size,b=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(c.length!==m.length)throw new Pt(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!o||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var y=c[0],S=c[1],x,A=r,_=0,w=s;typeof f=="string"&&f===b&&f!=="mixed"&&(x=f,A=e.find(r,[x,x]),_=e.convert(0,x),w=e.find(s,[x,x]));for(var C=[],E=[],N=[],M=[],O=[],F,U,V,H,I=0;I{var{typed:e,matrix:r}=t;return{"Array, number":e.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":e.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":e.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":e.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),ME="leftShift",_le=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Ale=G(ME,_le,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=gw({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=Dr({typed:e,matrix:r,concat:s}),v=yw({typed:e,matrix:r});return e(ME,{"number, number":QB,"BigNumber, BigNumber":Wse,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),TE="rightArithShift",Dle=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Nle=G(TE,Dle,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=gw({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=Dr({typed:e,matrix:r,concat:s}),v=yw({typed:e,matrix:r});return e(TE,{"number, number":eP,"BigNumber, BigNumber":Vse,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),OE="rightLogShift",Ele=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Cle=G(OE,Ele,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=t,o=Vo({typed:e}),u=Fa({typed:e,equalScalar:n}),l=gw({typed:e,equalScalar:n}),c=ju({typed:e,DenseMatrix:a}),f=Fn({typed:e,equalScalar:n}),h=Oa({typed:e}),p=Dr({typed:e,matrix:r,concat:s}),v=yw({typed:e,matrix:r});return e(OE,{"number, number":tP,"SparseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():f(b,y,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(b,y)=>n(y,0)?b.clone():h(b,y,m,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):c(y,b,m,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(m=>(b,y)=>n(b,0)?i(y.size(),y.storage()):h(y,b,m,!0))},v,p({SS:l,DS:o,SD:u}))}),FE="and",Mle=["typed","matrix","equalScalar","zeros","not","concat"],VP=G(FE,Mle,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=zg({typed:e,equalScalar:n}),l=Fn({typed:e,equalScalar:n}),c=Oa({typed:e}),f=Dr({typed:e,matrix:r,concat:s});return e(FE,{"number, number":sP,"Complex, Complex":function(p,v){return(p.re!==0||p.im!==0)&&(v.re!==0||v.im!==0)},"BigNumber, BigNumber":function(p,v){return!p.isZero()&&!v.isZero()&&!p.isNaN()&&!v.isNaN()},"Unit, Unit":e.referToSelf(h=>(p,v)=>h(p.value||0,v.value||0)),"SparseMatrix, any":e.referToSelf(h=>(p,v)=>a(v)?i(p.size(),p.storage()):l(p,v,h,!1)),"DenseMatrix, any":e.referToSelf(h=>(p,v)=>a(v)?i(p.size(),p.storage()):c(p,v,h,!1)),"any, SparseMatrix":e.referToSelf(h=>(p,v)=>a(p)?i(p.size(),p.storage()):l(v,p,h,!0)),"any, DenseMatrix":e.referToSelf(h=>(p,v)=>a(p)?i(p.size(),p.storage()):c(v,p,h,!0)),"Array, any":e.referToSelf(h=>(p,v)=>h(r(p),v).valueOf()),"any, Array":e.referToSelf(h=>(p,v)=>h(p,r(v)).valueOf())},f({SS:u,DS:o}))}),Ov="compare",Tle=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Ole=G(Ov,Tle,t=>{var{typed:e,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:o,concat:u}=t,l=ai({typed:e}),c=$g({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:o}),h=Dr({typed:e,matrix:i,concat:u}),p=Mc({typed:e});return e(Ov,Fle({typed:e,config:r}),{"boolean, boolean":function(m,b){return m===b?0:m>b?1:-1},"BigNumber, BigNumber":function(m,b){return ia(m,b,r.epsilon)?new a(0):new a(m.cmp(b))},"Fraction, Fraction":function(m,b){return new s(m.compare(b))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,h({SS:c,DS:l,Ss:f}))}),Fle=G(Ov,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Ov,{"number, number":function(i,a){return ni(i,a,r.epsilon)?0:i>a?1:-1}})}),Rl=function t(e,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,o=/^0/,u=function(x){return t.insensitive&&(""+x).toLowerCase()||""+x},l=u(e).replace(i,"")||"",c=u(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=c.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(l.match(s),16)||f.length!==1&&l.match(a)&&Date.parse(l),v=parseInt(c.match(s),16)||p&&c.match(a)&&Date.parse(c)||null,m,b;if(v){if(pv)return 1}for(var y=0,S=Math.max(f.length,h.length);yb)return 1}return 0},RE="compareNatural",Rle=["typed","compare"],Ble=G(RE,Rle,t=>{var{typed:e,compare:r}=t,n=r.signatures["boolean,boolean"];return e(RE,{"any, any":i});function i(u,l){var c=xr(u),f=xr(l),h;if((c==="number"||c==="BigNumber"||c==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return h=r(u,l),h.toString()!=="0"?h>0?1:-1:Rl(c,f);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(c)||p.includes(f))return h=a(i,u,l),h!==0?h:Rl(c,f);if(c!==f)return Rl(c,f);if(c==="Complex")return Ple(u,l);if(c==="Unit")return u.equalBase(l)?i(u.value,l.value):s(i,u.formatUnits(),l.formatUnits());if(c==="boolean")return n(u,l);if(c==="string")return Rl(u,l);if(c==="Object")return o(i,u,l);if(c==="null"||c==="undefined")return 0;throw new TypeError('Unsupported type of value "'+c+'"')}function a(u,l,c){return Eu(l)&&Eu(c)?s(u,l.toJSON().values,c.toJSON().values):Eu(l)?a(u,l.toArray(),c):Eu(c)?a(u,l,c.toArray()):gv(l)?a(u,l.toJSON().data,c):gv(c)?a(u,l,c.toJSON().data):Array.isArray(l)?Array.isArray(c)?s(u,l,c):a(u,l,[c]):a(u,[l],c)}function s(u,l,c){for(var f=0,h=Math.min(l.length,c.length);fc.length?1:l.lengthe.re?1:t.ree.im?1:t.im{var{typed:e,matrix:r,concat:n}=t,i=Dr({typed:e,matrix:r,concat:n});return e(BE,Yb,i({elop:Yb,Ds:!0}))}),Fv="equal",Lle=["typed","matrix","equalScalar","DenseMatrix","concat"],$le=G(Fv,Lle,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:r,concat:a});return e(Fv,zle({typed:e,equalScalar:n}),l({elop:n,SS:o,DS:s,Ss:u}))}),zle=G(Fv,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(Fv,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:r(i,a)}})}),PE="equalText",Ule=["typed","compareText","isZero"],qle=G(PE,Ule,t=>{var{typed:e,compareText:r,isZero:n}=t;return e(PE,{"any, any":function(a,s){return n(r(a,s))}})}),Rv="smaller",Hle=["typed","config","matrix","DenseMatrix","concat"],Wle=G(Rv,Hle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:n,concat:a}),c=Mc({typed:e});return e(Rv,Vle({typed:e,config:r}),{"boolean, boolean":(f,h)=>ff.compare(h)===-1,"Complex, Complex":function(h,p){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Vle=G(Rv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Rv,{"number, number":function(i,a){return i{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:n,concat:a}),c=Mc({typed:e});return e(Bv,Gle({typed:e,config:r}),{"boolean, boolean":(f,h)=>f<=h,"BigNumber, BigNumber":function(h,p){return h.lte(p)||ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Gle=G(Bv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Bv,{"number, number":function(i,a){return i<=a||ni(i,a,r.epsilon)}})}),Pv="larger",Xle=["typed","config","matrix","DenseMatrix","concat"],Zle=G(Pv,Xle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:n,concat:a}),c=Mc({typed:e});return e(Pv,Kle({typed:e,config:r}),{"boolean, boolean":(f,h)=>f>h,"BigNumber, BigNumber":function(h,p){return h.gt(p)&&!ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),Kle=G(Pv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Pv,{"number, number":function(i,a){return i>a&&!ni(i,a,r.epsilon)}})}),Iv="largerEq",Jle=["typed","config","matrix","DenseMatrix","concat"],Qle=G(Iv,Jle,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:i,concat:a}=t,s=ai({typed:e}),o=es({typed:e,DenseMatrix:i}),u=gn({typed:e,DenseMatrix:i}),l=Dr({typed:e,matrix:n,concat:a}),c=Mc({typed:e});return e(Iv,ece({typed:e,config:r}),{"boolean, boolean":(f,h)=>f>=h,"BigNumber, BigNumber":function(h,p){return h.gte(p)||ia(h,p,r.epsilon)},"Fraction, Fraction":(f,h)=>f.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,l({SS:o,DS:s,Ss:u}))}),ece=G(Iv,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Iv,{"number, number":function(i,a){return i>=a||ni(i,a,r.epsilon)}})}),IE="deepEqual",tce=["typed","equal"],rce=G(IE,tce,t=>{var{typed:e,equal:r}=t;return e(IE,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var o=0;o{var{typed:e,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=t,o=ai({typed:e}),u=es({typed:e,DenseMatrix:a}),l=gn({typed:e,DenseMatrix:a}),c=Dr({typed:e,matrix:i,concat:s});return e(kv,ace({typed:e,equalScalar:n}),c({elop:f,SS:u,DS:o,Ss:l}));function f(h,p){return!n(h,p)}}),ace=G(kv,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(kv,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!r(i,a)}})}),kE="partitionSelect",sce=["typed","isNumeric","isNaN","compare"],oce=G(kE,sce,t=>{var{typed:e,isNumeric:r,isNaN:n,compare:i}=t,a=i,s=(l,c)=>-i(l,c);return e(kE,{"Array | Matrix, number":function(c,f){return o(c,f,a)},"Array | Matrix, number, string":function(c,f,h){if(h==="asc")return o(c,f,a);if(h==="desc")return o(c,f,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":o});function o(l,c,f){if(!ot(c)||c<0)throw new Error("k must be a non-negative integer");if(dt(l)){var h=l.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return u(l.valueOf(),c,f)}if(Array.isArray(l))return u(l,c,f)}function u(l,c,f){if(c>=l.length)throw new Error("k out of bounds");for(var h=0;h=0){var S=l[b];l[b]=l[m],l[m]=S,--b}else++m;f(l[m],y)>0&&--m,c<=m?v=m:p=m+1}return l[c]}}),LE="sort",uce=["typed","matrix","compare","compareNatural"],lce=G(LE,uce,t=>{var{typed:e,matrix:r,compare:n,compareNatural:i}=t,a=n,s=(c,f)=>-n(c,f);return e(LE,{Array:function(f){return u(f),f.sort(a)},Matrix:function(f){return l(f),r(f.toArray().sort(a),f.storage())},"Array, function":function(f,h){return u(f),f.sort(h)},"Matrix, function":function(f,h){return l(f),r(f.toArray().sort(h),f.storage())},"Array, string":function(f,h){return u(f),f.sort(o(h))},"Matrix, string":function(f,h){return l(f),r(f.toArray().sort(o(h)),f.storage())}});function o(c){if(c==="asc")return a;if(c==="desc")return s;if(c==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(c){if(Nt(c).length!==1)throw new Error("One dimensional array expected")}function l(c){if(c.size().length!==1)throw new Error("One dimensional matrix expected")}}),$E="max",cce=["typed","config","numeric","larger"],YP=G($E,cce,t=>{var{typed:e,config:r,numeric:n,larger:i}=t;return e($E,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,l){return kg(u,l.valueOf(),a)},"...":function(u){if(Nc(u))throw new TypeError("Scalar values expected in function max");return s(u)}});function a(o,u){try{return i(o,u)?o:u}catch(l){throw ii(l,"max",u)}}function s(o){var u;if(Ws(o,function(l){try{isNaN(l)&&typeof l=="number"?u=NaN:(u===void 0||i(l,u))&&(u=l)}catch(c){throw ii(c,"max",l)}}),u===void 0)throw new Error("Cannot calculate max of an empty array");return typeof u=="string"&&(u=n(u,r.number)),u}}),zE="min",fce=["typed","config","numeric","smaller"],jP=G(zE,fce,t=>{var{typed:e,config:r,numeric:n,smaller:i}=t;return e(zE,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,l){return kg(u,l.valueOf(),a)},"...":function(u){if(Nc(u))throw new TypeError("Scalar values expected in function min");return s(u)}});function a(o,u){try{return i(o,u)?o:u}catch(l){throw ii(l,"min",u)}}function s(o){var u;if(Ws(o,function(l){try{isNaN(l)&&typeof l=="number"?u=NaN:(u===void 0||i(l,u))&&(u=l)}catch(c){throw ii(c,"min",l)}}),u===void 0)throw new Error("Cannot calculate min of an empty array");return typeof u=="string"&&(u=n(u,r.number)),u}}),hce="ImmutableDenseMatrix",dce=["smaller","DenseMatrix"],pce=G(hce,dce,t=>{var{smaller:e,DenseMatrix:r}=t;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!$n(a))throw new Error("Invalid datatype: "+a);if(dt(i)||sr(i)){var s=new r(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&sr(i.data)&&sr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+xr(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return dt(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:vt(this._data),size:vt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||e(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||e(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),mce="Index",vce=["ImmutableDenseMatrix","getMatrixDataType"],gce=G(mce,vce,t=>{var{ImmutableDenseMatrix:e,getMatrixDataType:r}=t;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,o=arguments.length;s{r&&e.push(n)}),e}var yce="FibonacciHeap",bce=["smaller","larger"],xce=G(yce,bce,t=>{var{smaller:e,larger:r}=t,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(c,f){var h={key:c,value:f,degree:0};if(this._minimum){var p=this._minimum;h.left=p,h.right=p.right,p.right=h,h.right.left=h,e(c,p.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var c=this._minimum;if(c===null)return c;for(var f=this._minimum,h=c.degree,p=c.child;h>0;){var v=p.right;p.left.right=p.right,p.right.left=p.left,p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p=v,h--}return c.left.right=c.right,c.right.left=c.left,c===c.right?f=null:(f=c.right,f=l(f,this._size)),this._size--,this._minimum=f,c},i.prototype.remove=function(c){this._minimum=a(this._minimum,c,-1),this.extractMinimum()};function a(c,f,h){f.key=h;var p=f.parent;return p&&e(f.key,p.key)&&(s(c,f,p),o(c,p)),e(f.key,c.key)&&(c=f),c}function s(c,f,h){f.left.right=f.right,f.right.left=f.left,h.degree--,h.child===f&&(h.child=f.right),h.degree===0&&(h.child=null),f.left=c,f.right=c.right,c.right=f,f.right.left=f,f.parent=null,f.mark=!1}function o(c,f){var h=f.parent;h&&(f.mark?(s(c,f,h),o(h)):f.mark=!0)}var u=function(f,h){f.left.right=f.right,f.right.left=f.left,f.parent=h,h.child?(f.left=h.child,f.right=h.child.right,h.child.right=f,f.right.left=f):(h.child=f,f.right=f,f.left=f),h.degree++,f.mark=!1};function l(c,f){var h=Math.floor(Math.log(f)*n)+1,p=new Array(h),v=0,m=c;if(m)for(v++,m=m.right;m!==c;)v++,m=m.right;for(var b;v>0;){for(var y=m.degree,S=m.right;b=p[y],!!b;){if(r(m.key,b.key)){var x=b;b=m,m=x}u(b,m),p[y]=null,y++}p[y]=m,m=S,v--}c=null;for(var A=0;A{var{addScalar:e,equalScalar:r,FibonacciHeap:n}=t;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var o=this._heap.insert(a,s);this._values[a]=o}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var o=this._values[a];o?o.value=e(o.value,s):(o=this._heap.insert(a,s),this._values[a]=o)},i.prototype.forEach=function(a,s,o){var u=this._heap,l=this._values,c=[],f=u.extractMinimum();for(f&&c.push(f);f&&f.key<=s;)f.key>=a&&(r(f.value,0)||o(f.key,f.value,this)),f=u.extractMinimum(),f&&c.push(f);for(var h=0;h{var{on:e,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:o,abs:u,fix:l,round:c,equal:f,isNumeric:h,format:p,number:v,Complex:m,BigNumber:b,Fraction:y}=t,S=v;function x(J,te){if(!(this instanceof x))throw new Error("Constructor must be called with the new operator");if(!(J==null||h(J)||$s(J)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=K.map(ee=>0);else if(typeof te=="string"){var ye=x.parse(te);this.units=ye.units,this.dimensions=ye.dimensions}else if(Xi(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>dn({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(J)}Object.defineProperty(x,"name",{value:"Unit"}),x.prototype.constructor=x,x.prototype.type="Unit",x.prototype.isUnit=!0;var A,_,w;function C(){for(;w===" "||w===" ";)M()}function E(J){return J>="0"&&J<="9"||J==="."}function N(J){return J>="0"&&J<="9"}function M(){_++,w=A.charAt(_)}function O(J){_=J,w=A.charAt(_)}function F(){var J="",te=_;if(w==="+"?M():w==="-"&&(J+=w,M()),!E(w))return O(te),null;if(w==="."){if(J+=w,M(),!N(w))return O(te),null}else{for(;N(w);)J+=w,M();w==="."&&(J+=w,M())}for(;N(w);)J+=w,M();if(w==="E"||w==="e"){var ye="",ee=_;if(ye+=w,M(),(w==="+"||w==="-")&&(ye+=w,M()),!N(w))return O(ee),J;for(J=J+ye;N(w);)J+=w,M()}return J}function U(){for(var J="";N(w)||x.isValidAlpha(w);)J+=w,M();var te=J.charAt(0);return x.isValidAlpha(te)?J:null}function V(J){return w===J?(M(),J):null}x.parse=function(J,te){if(te=te||{},A=J,_=-1,w="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ye=new x;ye.units=[];var ee=1,ue=!1;M(),C();var le=F(),Ee=null;if(le){if(r.number==="BigNumber")Ee=new b(le);else if(r.number==="Fraction")try{Ee=new y(le)}catch{Ee=parseFloat(le)}else Ee=parseFloat(le);C(),V("*")?(ee=1,ue=!0):V("/")&&(ee=-1,ue=!0)}for(var Me=[],R=1;;){for(C();w==="(";)Me.push(ee),R*=ee,ee=1,M(),C();var q=void 0;if(w){var Y=w;if(q=U(),q===null)throw new SyntaxError('Unexpected "'+Y+'" in "'+A+'" at index '+_.toString())}else break;var pe=H(q);if(pe===null)throw new SyntaxError('Unit "'+q+'" not found.');var ge=ee*R;if(C(),V("^")){C();var De=F();if(De===null)throw new SyntaxError('In "'+J+'", "^" must be followed by a floating-point number');ge*=De}ye.units.push({unit:pe.unit,prefix:pe.prefix,power:ge});for(var Be=0;Be1||Math.abs(this.units[0].power-1)>1e-15},x.prototype._normalize=function(J){if(J==null||this.units.length===0)return J;for(var te=J,ye=x._getNumberConverter(xr(J)),ee=0;ee{if(tt(X,J)){var te=X[J],ye=te.prefixes[""];return{unit:te,prefix:ye}}for(var ee in X)if(tt(X,ee)&&gre(J,ee)){var ue=X[ee],le=J.length-ee.length,Ee=J.substring(0,le),Me=tt(ue.prefixes,Ee)?ue.prefixes[Ee]:void 0;if(Me!==void 0)return{unit:ue,prefix:Me}}return null},{hasher:J=>J[0],limit:100});x.isValuelessUnit=function(J){return H(J)!==null},x.prototype.hasBase=function(J){if(typeof J=="string"&&(J=$[J]),!J)return!1;for(var te=0;te1e-12)return!1;return!0},x.prototype.equalBase=function(J){for(var te=0;te1e-12)return!1;return!0},x.prototype.equals=function(J){return this.equalBase(J)&&f(this.value,J.value)},x.prototype.multiply=function(J){for(var te=this.clone(),ye=Xi(J)?J:new x(J),ee=0;ee1e-12&&(tt(xe,Me)?te.push({unit:xe[Me].unit,prefix:xe[Me].prefix,power:J.dimensions[Ee]||0}):le=!0)}te.length1e-12)if(tt(ce.si,ee))te.push({unit:ce.si[ee].unit,prefix:ce.si[ee].prefix,power:J.dimensions[ye]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return J.units=te,J.fixPrefix=!0,J.skipAutomaticSimplification=!0,this.value!==null?(J.value=null,this.to(J)):J},x.prototype.formatUnits=function(){for(var J="",te="",ye=0,ee=0,ue=0;ue0?(ye++,J+=" "+this.units[ue].prefix.name+this.units[ue].unit.name,Math.abs(this.units[ue].power-1)>1e-15&&(J+="^"+this.units[ue].power)):this.units[ue].power<0&&ee++;if(ee>0)for(var le=0;le0?(te+=" "+this.units[le].prefix.name+this.units[le].unit.name,Math.abs(this.units[le].power+1)>1e-15&&(te+="^"+-this.units[le].power)):(te+=" "+this.units[le].prefix.name+this.units[le].unit.name,te+="^"+this.units[le].power));J=J.substr(1),te=te.substr(1),ye>1&&ee>0&&(J="("+J+")"),ee>1&&ye>0&&(te="("+te+")");var Ee=J;return ye>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},x.prototype.format=function(J){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ye=!1;typeof te.value<"u"&&te.value!==null&&$s(te.value)&&(ye=Math.abs(te.value.re)<1e-14);for(var ee in te.units)tt(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&ye?te.units[ee].unit=X.VAR:te.units[ee].unit.name==="VAR"&&!ye&&(te.units[ee].unit=X.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ue=te._denormalize(te.value),le=te.value!==null?p(ue,J||{}):"",Ee=te.formatUnits();return te.value&&$s(te.value)&&(le="("+le+")"),Ee.length>0&&le.length>0&&(le+=" "),le+=Ee,le},x.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var J=this.value!==null?u(this.value):0,te=u(this.units[0].unit.value),ye=this.units[0].prefix;if(J===0)return ye;var ee=this.units[0].power,ue=Math.log(J/Math.pow(ye.value*te,ee))/Math.LN10-1.2;if(ue>-2.200001&&ue<1.800001)return ye;ue=Math.abs(ue);var le=this.units[0].unit.prefixes;for(var Ee in le)if(tt(le,Ee)){var Me=le[Ee];if(Me.scientific){var R=Math.abs(Math.log(J/Math.pow(Me.value*te,ee))/Math.LN10-1.2);(R0)},X={meter:{name:"meter",base:$.LENGTH,prefixes:P.LONG,value:1,offset:0},inch:{name:"inch",base:$.LENGTH,prefixes:P.NONE,value:.0254,offset:0},foot:{name:"foot",base:$.LENGTH,prefixes:P.NONE,value:.3048,offset:0},yard:{name:"yard",base:$.LENGTH,prefixes:P.NONE,value:.9144,offset:0},mile:{name:"mile",base:$.LENGTH,prefixes:P.NONE,value:1609.344,offset:0},link:{name:"link",base:$.LENGTH,prefixes:P.NONE,value:.201168,offset:0},rod:{name:"rod",base:$.LENGTH,prefixes:P.NONE,value:5.0292,offset:0},chain:{name:"chain",base:$.LENGTH,prefixes:P.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:$.LENGTH,prefixes:P.NONE,value:1e-10,offset:0},m:{name:"m",base:$.LENGTH,prefixes:P.SHORT,value:1,offset:0},in:{name:"in",base:$.LENGTH,prefixes:P.NONE,value:.0254,offset:0},ft:{name:"ft",base:$.LENGTH,prefixes:P.NONE,value:.3048,offset:0},yd:{name:"yd",base:$.LENGTH,prefixes:P.NONE,value:.9144,offset:0},mi:{name:"mi",base:$.LENGTH,prefixes:P.NONE,value:1609.344,offset:0},li:{name:"li",base:$.LENGTH,prefixes:P.NONE,value:.201168,offset:0},rd:{name:"rd",base:$.LENGTH,prefixes:P.NONE,value:5.02921,offset:0},ch:{name:"ch",base:$.LENGTH,prefixes:P.NONE,value:20.1168,offset:0},mil:{name:"mil",base:$.LENGTH,prefixes:P.NONE,value:254e-7,offset:0},m2:{name:"m2",base:$.SURFACE,prefixes:P.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:$.SURFACE,prefixes:P.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:$.SURFACE,prefixes:P.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:$.SURFACE,prefixes:P.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:$.SURFACE,prefixes:P.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:$.SURFACE,prefixes:P.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:$.SURFACE,prefixes:P.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:$.SURFACE,prefixes:P.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:$.SURFACE,prefixes:P.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:$.SURFACE,prefixes:P.NONE,value:1e4,offset:0},m3:{name:"m3",base:$.VOLUME,prefixes:P.CUBIC,value:1,offset:0},L:{name:"L",base:$.VOLUME,prefixes:P.SHORT,value:.001,offset:0},l:{name:"l",base:$.VOLUME,prefixes:P.SHORT,value:.001,offset:0},litre:{name:"litre",base:$.VOLUME,prefixes:P.LONG,value:.001,offset:0},cuin:{name:"cuin",base:$.VOLUME,prefixes:P.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:$.VOLUME,prefixes:P.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:$.VOLUME,prefixes:P.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:$.VOLUME,prefixes:P.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:$.VOLUME,prefixes:P.NONE,value:15e-6,offset:0},drop:{name:"drop",base:$.VOLUME,prefixes:P.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:$.VOLUME,prefixes:P.NONE,value:5e-8,offset:0},minim:{name:"minim",base:$.VOLUME,prefixes:P.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:$.VOLUME,prefixes:P.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:$.VOLUME,prefixes:P.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:$.VOLUME,prefixes:P.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:$.VOLUME,prefixes:P.NONE,value:1e-6,offset:0},cup:{name:"cup",base:$.VOLUME,prefixes:P.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:$.VOLUME,prefixes:P.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:$.VOLUME,prefixes:P.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:$.VOLUME,prefixes:P.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:$.VOLUME,prefixes:P.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:$.VOLUME,prefixes:P.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:$.VOLUME,prefixes:P.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:$.VOLUME,prefixes:P.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:$.VOLUME,prefixes:P.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:$.VOLUME,prefixes:P.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:$.VOLUME,prefixes:P.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:$.VOLUME,prefixes:P.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:$.VOLUME,prefixes:P.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:$.VOLUME,prefixes:P.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:$.VOLUME,prefixes:P.NONE,value:.1173478,offset:0},obl:{name:"obl",base:$.VOLUME,prefixes:P.NONE,value:.1589873,offset:0},g:{name:"g",base:$.MASS,prefixes:P.SHORT,value:.001,offset:0},gram:{name:"gram",base:$.MASS,prefixes:P.LONG,value:.001,offset:0},ton:{name:"ton",base:$.MASS,prefixes:P.SHORT,value:907.18474,offset:0},t:{name:"t",base:$.MASS,prefixes:P.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:$.MASS,prefixes:P.LONG,value:1e3,offset:0},grain:{name:"grain",base:$.MASS,prefixes:P.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:$.MASS,prefixes:P.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:$.MASS,prefixes:P.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:$.MASS,prefixes:P.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:$.MASS,prefixes:P.NONE,value:45.359237,offset:0},stick:{name:"stick",base:$.MASS,prefixes:P.NONE,value:.115,offset:0},stone:{name:"stone",base:$.MASS,prefixes:P.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:$.MASS,prefixes:P.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:$.MASS,prefixes:P.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:$.MASS,prefixes:P.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:$.MASS,prefixes:P.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:$.MASS,prefixes:P.NONE,value:45.359237,offset:0},s:{name:"s",base:$.TIME,prefixes:P.SHORT,value:1,offset:0},min:{name:"min",base:$.TIME,prefixes:P.NONE,value:60,offset:0},h:{name:"h",base:$.TIME,prefixes:P.NONE,value:3600,offset:0},second:{name:"second",base:$.TIME,prefixes:P.LONG,value:1,offset:0},sec:{name:"sec",base:$.TIME,prefixes:P.LONG,value:1,offset:0},minute:{name:"minute",base:$.TIME,prefixes:P.NONE,value:60,offset:0},hour:{name:"hour",base:$.TIME,prefixes:P.NONE,value:3600,offset:0},day:{name:"day",base:$.TIME,prefixes:P.NONE,value:86400,offset:0},week:{name:"week",base:$.TIME,prefixes:P.NONE,value:7*86400,offset:0},month:{name:"month",base:$.TIME,prefixes:P.NONE,value:2629800,offset:0},year:{name:"year",base:$.TIME,prefixes:P.NONE,value:31557600,offset:0},decade:{name:"decade",base:$.TIME,prefixes:P.NONE,value:315576e3,offset:0},century:{name:"century",base:$.TIME,prefixes:P.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:$.TIME,prefixes:P.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:$.FREQUENCY,prefixes:P.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:$.FREQUENCY,prefixes:P.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:$.ANGLE,prefixes:P.SHORT,value:1,offset:0},radian:{name:"radian",base:$.ANGLE,prefixes:P.LONG,value:1,offset:0},deg:{name:"deg",base:$.ANGLE,prefixes:P.SHORT,value:null,offset:0},degree:{name:"degree",base:$.ANGLE,prefixes:P.LONG,value:null,offset:0},grad:{name:"grad",base:$.ANGLE,prefixes:P.SHORT,value:null,offset:0},gradian:{name:"gradian",base:$.ANGLE,prefixes:P.LONG,value:null,offset:0},cycle:{name:"cycle",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:$.ANGLE,prefixes:P.NONE,value:null,offset:0},A:{name:"A",base:$.CURRENT,prefixes:P.SHORT,value:1,offset:0},ampere:{name:"ampere",base:$.CURRENT,prefixes:P.LONG,value:1,offset:0},K:{name:"K",base:$.TEMPERATURE,prefixes:P.SHORT,value:1,offset:0},degC:{name:"degC",base:$.TEMPERATURE,prefixes:P.SHORT,value:1,offset:273.15},degF:{name:"degF",base:$.TEMPERATURE,prefixes:P.SHORT,value:new y(5,9),offset:459.67},degR:{name:"degR",base:$.TEMPERATURE,prefixes:P.SHORT,value:new y(5,9),offset:0},kelvin:{name:"kelvin",base:$.TEMPERATURE,prefixes:P.LONG,value:1,offset:0},celsius:{name:"celsius",base:$.TEMPERATURE,prefixes:P.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:$.TEMPERATURE,prefixes:P.LONG,value:new y(5,9),offset:459.67},rankine:{name:"rankine",base:$.TEMPERATURE,prefixes:P.LONG,value:new y(5,9),offset:0},mol:{name:"mol",base:$.AMOUNT_OF_SUBSTANCE,prefixes:P.SHORT,value:1,offset:0},mole:{name:"mole",base:$.AMOUNT_OF_SUBSTANCE,prefixes:P.LONG,value:1,offset:0},cd:{name:"cd",base:$.LUMINOUS_INTENSITY,prefixes:P.SHORT,value:1,offset:0},candela:{name:"candela",base:$.LUMINOUS_INTENSITY,prefixes:P.LONG,value:1,offset:0},N:{name:"N",base:$.FORCE,prefixes:P.SHORT,value:1,offset:0},newton:{name:"newton",base:$.FORCE,prefixes:P.LONG,value:1,offset:0},dyn:{name:"dyn",base:$.FORCE,prefixes:P.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:$.FORCE,prefixes:P.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:$.FORCE,prefixes:P.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:$.FORCE,prefixes:P.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:$.FORCE,prefixes:P.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:$.FORCE,prefixes:P.NONE,value:9.80665,offset:0},J:{name:"J",base:$.ENERGY,prefixes:P.SHORT,value:1,offset:0},joule:{name:"joule",base:$.ENERGY,prefixes:P.LONG,value:1,offset:0},erg:{name:"erg",base:$.ENERGY,prefixes:P.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:$.ENERGY,prefixes:P.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:$.ENERGY,prefixes:P.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:$.ENERGY,prefixes:P.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:$.ENERGY,prefixes:P.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:$.POWER,prefixes:P.SHORT,value:1,offset:0},watt:{name:"watt",base:$.POWER,prefixes:P.LONG,value:1,offset:0},hp:{name:"hp",base:$.POWER,prefixes:P.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:$.POWER,prefixes:P.SHORT,value:m.I,offset:0},VA:{name:"VA",base:$.POWER,prefixes:P.SHORT,value:1,offset:0},Pa:{name:"Pa",base:$.PRESSURE,prefixes:P.SHORT,value:1,offset:0},psi:{name:"psi",base:$.PRESSURE,prefixes:P.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:$.PRESSURE,prefixes:P.NONE,value:101325,offset:0},bar:{name:"bar",base:$.PRESSURE,prefixes:P.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:$.PRESSURE,prefixes:P.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:$.PRESSURE,prefixes:P.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:$.PRESSURE,prefixes:P.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:$.PRESSURE,prefixes:P.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:$.ELECTRIC_CHARGE,prefixes:P.LONG,value:1,offset:0},C:{name:"C",base:$.ELECTRIC_CHARGE,prefixes:P.SHORT,value:1,offset:0},farad:{name:"farad",base:$.ELECTRIC_CAPACITANCE,prefixes:P.LONG,value:1,offset:0},F:{name:"F",base:$.ELECTRIC_CAPACITANCE,prefixes:P.SHORT,value:1,offset:0},volt:{name:"volt",base:$.ELECTRIC_POTENTIAL,prefixes:P.LONG,value:1,offset:0},V:{name:"V",base:$.ELECTRIC_POTENTIAL,prefixes:P.SHORT,value:1,offset:0},ohm:{name:"ohm",base:$.ELECTRIC_RESISTANCE,prefixes:P.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:$.ELECTRIC_INDUCTANCE,prefixes:P.LONG,value:1,offset:0},H:{name:"H",base:$.ELECTRIC_INDUCTANCE,prefixes:P.SHORT,value:1,offset:0},siemens:{name:"siemens",base:$.ELECTRIC_CONDUCTANCE,prefixes:P.LONG,value:1,offset:0},S:{name:"S",base:$.ELECTRIC_CONDUCTANCE,prefixes:P.SHORT,value:1,offset:0},weber:{name:"weber",base:$.MAGNETIC_FLUX,prefixes:P.LONG,value:1,offset:0},Wb:{name:"Wb",base:$.MAGNETIC_FLUX,prefixes:P.SHORT,value:1,offset:0},tesla:{name:"tesla",base:$.MAGNETIC_FLUX_DENSITY,prefixes:P.LONG,value:1,offset:0},T:{name:"T",base:$.MAGNETIC_FLUX_DENSITY,prefixes:P.SHORT,value:1,offset:0},b:{name:"b",base:$.BIT,prefixes:P.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:$.BIT,prefixes:P.BINARY_LONG,value:1,offset:0},B:{name:"B",base:$.BIT,prefixes:P.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:$.BIT,prefixes:P.BINARY_LONG,value:8,offset:0}},de={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Se(J){if(J.number==="BigNumber"){var te=bw(b);X.rad.value=new b(1),X.deg.value=te.div(180),X.grad.value=te.div(200),X.cycle.value=te.times(2),X.arcsec.value=te.div(648e3),X.arcmin.value=te.div(10800)}else X.rad.value=1,X.deg.value=Math.PI/180,X.grad.value=Math.PI/200,X.cycle.value=Math.PI*2,X.arcsec.value=Math.PI/648e3,X.arcmin.value=Math.PI/10800;X.radian.value=X.rad.value,X.degree.value=X.deg.value,X.gradian.value=X.grad.value}Se(r),e&&e("config",function(J,te){J.number!==te.number&&Se(J)});var ce={si:{NONE:{unit:ne,prefix:P.NONE[""]},LENGTH:{unit:X.m,prefix:P.SHORT[""]},MASS:{unit:X.g,prefix:P.SHORT.k},TIME:{unit:X.s,prefix:P.SHORT[""]},CURRENT:{unit:X.A,prefix:P.SHORT[""]},TEMPERATURE:{unit:X.K,prefix:P.SHORT[""]},LUMINOUS_INTENSITY:{unit:X.cd,prefix:P.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:X.mol,prefix:P.SHORT[""]},ANGLE:{unit:X.rad,prefix:P.SHORT[""]},BIT:{unit:X.bits,prefix:P.SHORT[""]},FORCE:{unit:X.N,prefix:P.SHORT[""]},ENERGY:{unit:X.J,prefix:P.SHORT[""]},POWER:{unit:X.W,prefix:P.SHORT[""]},PRESSURE:{unit:X.Pa,prefix:P.SHORT[""]},ELECTRIC_CHARGE:{unit:X.C,prefix:P.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:X.F,prefix:P.SHORT[""]},ELECTRIC_POTENTIAL:{unit:X.V,prefix:P.SHORT[""]},ELECTRIC_RESISTANCE:{unit:X.ohm,prefix:P.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:X.H,prefix:P.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:X.S,prefix:P.SHORT[""]},MAGNETIC_FLUX:{unit:X.Wb,prefix:P.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:X.T,prefix:P.SHORT[""]},FREQUENCY:{unit:X.Hz,prefix:P.SHORT[""]}}};ce.cgs=JSON.parse(JSON.stringify(ce.si)),ce.cgs.LENGTH={unit:X.m,prefix:P.SHORT.c},ce.cgs.MASS={unit:X.g,prefix:P.SHORT[""]},ce.cgs.FORCE={unit:X.dyn,prefix:P.SHORT[""]},ce.cgs.ENERGY={unit:X.erg,prefix:P.NONE[""]},ce.us=JSON.parse(JSON.stringify(ce.si)),ce.us.LENGTH={unit:X.ft,prefix:P.NONE[""]},ce.us.MASS={unit:X.lbm,prefix:P.NONE[""]},ce.us.TEMPERATURE={unit:X.degF,prefix:P.NONE[""]},ce.us.FORCE={unit:X.lbf,prefix:P.NONE[""]},ce.us.ENERGY={unit:X.BTU,prefix:P.BTU[""]},ce.us.POWER={unit:X.hp,prefix:P.NONE[""]},ce.us.PRESSURE={unit:X.psi,prefix:P.NONE[""]},ce.auto=JSON.parse(JSON.stringify(ce.si));var xe=ce.auto;x.setUnitSystem=function(J){if(tt(ce,J))xe=ce[J];else throw new Error("Unit system "+J+" does not exist. Choices are: "+Object.keys(ce).join(", "))},x.getUnitSystem=function(){for(var J in ce)if(tt(ce,J)&&ce[J]===xe)return J},x.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new b(te.n).div(te.d).times(te.s):new b(te+"")},Fraction:function(te){return new y(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?v(te):te}},x.prototype._numberConverter=function(){var J=x.typeConverters[this.valueType()];if(J)return J;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},x._getNumberConverter=function(J){if(!x.typeConverters[J])throw new TypeError('Unsupported type "'+J+'"');return x.typeConverters[J]};for(var _e in X)if(tt(X,_e)){var me=X[_e];me.dimensions=me.base.dimensions}for(var we in de)if(tt(de,we)){var Ne=X[de[we]],Ce={};for(var He in Ne)tt(Ne,He)&&(Ce[He]=Ne[He]);Ce.name=we,X[we]=Ce}x.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function qe(J){for(var te=0;te0&&!(x.isValidAlpha(w)||N(w)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+J+'"')}}return x.createUnit=function(J,te){if(typeof J!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var ye in J)if(tt(J,ye)&&x.deleteUnit(ye),J[ye].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof J!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(tt(X,J))throw new Error('Cannot create unit "'+J+'": a unit with that name already exists');qe(J);var ye=null,ee=[],ue=0,le,Ee,Me;if(te&&te.type==="Unit")ye=te.clone();else if(typeof te=="string")te!==""&&(le=te);else if(typeof te=="object")le=te.definition,Ee=te.prefixes,ue=te.offset,Me=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+J+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var R=0;R1e-12){Pe=!1;break}if(Pe){De=!0,q.base=$[Be];break}}if(!De){Me=Me||J+"_STUFF";var ze={dimensions:ye.dimensions.slice(0)};ze.key=Me,$[Me]=ze,xe[Me]={unit:q,prefix:P.NONE[""]},q.base=$[Me]}}else{if(Me=Me||J+"_STUFF",K.indexOf(Me)>=0)throw new Error('Cannot create new base unit "'+J+'": a base unit with that name already exists (and cannot be overridden)');K.push(Me);for(var Y in $)tt($,Y)&&($[Y].dimensions[K.length-1]=0);for(var pe={dimensions:[]},ge=0;ge{var{typed:e,Unit:r}=t;return e(HE,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new r(i,a)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),WE="sparse",Fce=["typed","SparseMatrix"],Rce=G(WE,Fce,t=>{var{typed:e,SparseMatrix:r}=t;return e(WE,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,a){return new r(i,a)}})}),VE="createUnit",Bce=["typed","Unit"],Pce=G(VE,Bce,t=>{var{typed:e,Unit:r}=t;return e(VE,{"Object, Object":function(i,a){return r.createUnit(i,a)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var o={};return o[i]=a,r.createUnit(o,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,r.createUnit(s,{})},string:function(i){var a={};return a[i]={},r.createUnit(a,{})}})}),YE="acos",Ice=["typed","config","Complex"],kce=G(YE,Ice,t=>{var{typed:e,config:r,Complex:n}=t;return e(YE,{number:function(a){return a>=-1&&a<=1||r.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})}),jE="acosh",Lce=["typed","config","Complex"],$ce=G(jE,Lce,t=>{var{typed:e,config:r,Complex:n}=t;return e(jE,{number:function(a){return a>=1||r.predictable?lP(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})}),GE="acot",zce=["typed","BigNumber"],Uce=G(GE,zce,t=>{var{typed:e,BigNumber:r}=t;return e(GE,{number:cP,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})}),XE="acoth",qce=["typed","config","Complex","BigNumber"],Hce=G(XE,qce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(XE,{number:function(s){return s>=1||s<=-1||r.predictable?fP(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})}),ZE="acsc",Wce=["typed","config","Complex","BigNumber"],Vce=G(ZE,Wce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(ZE,{number:function(s){return s<=-1||s>=1||r.predictable?hP(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})}),KE="acsch",Yce=["typed","BigNumber"],jce=G(KE,Yce,t=>{var{typed:e,BigNumber:r}=t;return e(KE,{number:dP,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})}),JE="asec",Gce=["typed","config","Complex","BigNumber"],Xce=G(JE,Gce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(JE,{number:function(s){return s<=-1||s>=1||r.predictable?pP(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})}),QE="asech",Zce=["typed","config","Complex","BigNumber"],Kce=G(QE,Zce,t=>{var{typed:e,config:r,Complex:n,BigNumber:i}=t;return e(QE,{number:function(s){if(s<=1&&s>=-1||r.predictable){var o=1/s;if(o>0||r.predictable)return mP(s);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})}),eC="asin",Jce=["typed","config","Complex"],Qce=G(eC,Jce,t=>{var{typed:e,config:r,Complex:n}=t;return e(eC,{number:function(a){return a>=-1&&a<=1||r.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})}),efe="asinh",tfe=["typed"],rfe=G(efe,tfe,t=>{var{typed:e}=t;return e("asinh",{number:vP,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})}),nfe="atan",ife=["typed"],afe=G(nfe,ife,t=>{var{typed:e}=t;return e("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})}),tC="atan2",sfe=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],ofe=G(tC,sfe,t=>{var{typed:e,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=t,o=Fa({typed:e,equalScalar:n}),u=ai({typed:e}),l=OP({typed:e,equalScalar:n}),c=Fn({typed:e,equalScalar:n}),f=gn({typed:e,DenseMatrix:a}),h=Dr({typed:e,matrix:r,concat:s});return e(tC,{"number, number":Math.atan2,"BigNumber, BigNumber":(p,v)=>i.atan2(p,v)},h({scalar:"number | BigNumber",SS:l,DS:u,SD:o,Ss:c,sS:f}))}),rC="atanh",ufe=["typed","config","Complex"],lfe=G(rC,ufe,t=>{var{typed:e,config:r,Complex:n}=t;return e(rC,{number:function(a){return a<=1&&a>=-1||r.predictable?gP(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})}),Oc=G("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(r,n.valueType())(n.value)})}}),nC="cos",cfe=["typed"],ffe=G(nC,cfe,t=>{var{typed:e}=t,r=Oc({typed:e});return e(nC,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),iC="cosh",hfe=["typed"],dfe=G(iC,hfe,t=>{var{typed:e}=t;return e(iC,{number:cre,"Complex | BigNumber":r=>r.cosh()})}),aC="cot",pfe=["typed","BigNumber"],mfe=G(aC,pfe,t=>{var{typed:e,BigNumber:r}=t,n=Oc({typed:e});return e(aC,{number:yP,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),sC="coth",vfe=["typed","BigNumber"],gfe=G(sC,vfe,t=>{var{typed:e,BigNumber:r}=t;return e(sC,{number:bP,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),oC="csc",yfe=["typed","BigNumber"],bfe=G(oC,yfe,t=>{var{typed:e,BigNumber:r}=t,n=Oc({typed:e});return e(oC,{number:xP,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),uC="csch",xfe=["typed","BigNumber"],wfe=G(uC,xfe,t=>{var{typed:e,BigNumber:r}=t;return e(uC,{number:wP,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),lC="sec",Sfe=["typed","BigNumber"],_fe=G(lC,Sfe,t=>{var{typed:e,BigNumber:r}=t,n=Oc({typed:e});return e(lC,{number:SP,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),cC="sech",Afe=["typed","BigNumber"],Dfe=G(cC,Afe,t=>{var{typed:e,BigNumber:r}=t;return e(cC,{number:_P,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),fC="sin",Nfe=["typed"],Efe=G(fC,Nfe,t=>{var{typed:e}=t,r=Oc({typed:e});return e(fC,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),hC="sinh",Cfe=["typed"],Mfe=G(hC,Cfe,t=>{var{typed:e}=t;return e(hC,{number:AP,"Complex | BigNumber":r=>r.sinh()})}),dC="tan",Tfe=["typed"],Ofe=G(dC,Tfe,t=>{var{typed:e}=t,r=Oc({typed:e});return e(dC,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),Ffe="tanh",Rfe=["typed"],Bfe=G(Ffe,Rfe,t=>{var{typed:e}=t;return e("tanh",{number:hre,"Complex | BigNumber":r=>r.tanh()})}),pC="setCartesian",Pfe=["typed","size","subset","compareNatural","Index","DenseMatrix"],Ife=G(pC,Pfe,t=>{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(pC,{"Array | Matrix, Array | Matrix":function(u,l){var c=[];if(n(r(u),new a(0))!==0&&n(r(l),new a(0))!==0){var f=tr(Array.isArray(u)?u:u.toArray()).sort(i),h=tr(Array.isArray(l)?l:l.toArray()).sort(i);c=[];for(var p=0;p{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(mC,{"Array | Matrix, Array | Matrix":function(u,l){var c;if(n(r(u),new a(0))===0)c=[];else{if(n(r(l),new a(0))===0)return tr(u.toArray());var f=pc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),h=pc(tr(Array.isArray(l)?l:l.toArray()).sort(i));c=[];for(var p,v=0;v{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(vC,{"Array | Matrix":function(u){var l;if(n(r(u),new a(0))===0)l=[];else{var c=tr(Array.isArray(u)?u:u.toArray()).sort(i);l=[],l.push(c[0]);for(var f=1;f{var{typed:e,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=t;return e(gC,{"Array | Matrix, Array | Matrix":function(u,l){var c;if(n(r(u),new a(0))===0||n(r(l),new a(0))===0)c=[];else{var f=pc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),h=pc(tr(Array.isArray(l)?l:l.toArray()).sort(i));c=[];for(var p=0;p{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(yC,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var l=pc(tr(Array.isArray(o)?o:o.toArray()).sort(i)),c=pc(tr(Array.isArray(u)?u:u.toArray()).sort(i)),f,h=0;h{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(bC,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var l=tr(Array.isArray(u)?u:u.toArray()),c=0,f=0;f{var{typed:e,size:r,subset:n,compareNatural:i,Index:a}=t;return e(xC,{"Array | Matrix":function(l){if(n(r(l),new a(0))===0)return[];for(var c=tr(Array.isArray(l)?l:l.toArray()).sort(i),f=[],h=0;h.toString(2).length<=c.length;)f.push(s(c,h.toString(2).split("").reverse())),h++;return o(f)}});function s(u,l){for(var c=[],f=0;f0;c--)for(var f=0;fu[f+1].length&&(l=u[f],u[f]=u[f+1],u[f+1]=l);return u}}),wC="setSize",Xfe=["typed","compareNatural"],Zfe=G(wC,Xfe,t=>{var{typed:e,compareNatural:r}=t;return e(wC,{"Array | Matrix":function(i){return Array.isArray(i)?tr(i).length:tr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?tr(i).length:tr(i.toArray()).length;for(var s=tr(Array.isArray(i)?i:i.toArray()).sort(r),o=1,u=1;u{var{typed:e,size:r,concat:n,subset:i,setDifference:a,Index:s}=t;return e(SC,{"Array | Matrix, Array | Matrix":function(u,l){if(i(r(u),new s(0))===0)return tr(l);if(i(r(l),new s(0))===0)return tr(u);var c=tr(u),f=tr(l);return n(a(c,f),a(f,c))}})}),_C="setUnion",Qfe=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],ehe=G(_C,Qfe,t=>{var{typed:e,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:o}=t;return e(_C,{"Array | Matrix, Array | Matrix":function(l,c){if(i(r(l),new o(0))===0)return tr(c);if(i(r(c),new o(0))===0)return tr(l);var f=tr(l),h=tr(c);return n(s(f,h),a(f,h))}})}),AC="add",the=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],rhe=G(AC,the,t=>{var{typed:e,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:o}=t,u=Vo({typed:e}),l=pw({typed:e,equalScalar:i}),c=ju({typed:e,DenseMatrix:a}),f=Dr({typed:e,matrix:r,concat:o});return e(AC,{"any, any":n,"any, any, ...any":e.referToSelf(h=>(p,v,m)=>{for(var b=h(p,v),y=0;y{var{typed:e,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:o,isPositive:u}=t;return e(DC,{"... number | BigNumber":l,Array:l,Matrix:c=>l(tr(c.toArray()))});function l(c){for(var f=0,h=0,p=0;p{var{typed:e,abs:r,add:n,pow:i,conj:a,sqrt:s,multiply:o,equalScalar:u,larger:l,smaller:c,matrix:f,ctranspose:h,eigs:p}=t;return e(NC,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return w(f(E),2)},Matrix:function(E){return w(E,2)},"Array, number | BigNumber | string":function(E,N){return w(f(E),N)},"Matrix, number | BigNumber | string":function(E,N){return w(E,N)}});function v(C){var E=0;return C.forEach(function(N){var M=r(N);l(M,E)&&(E=M)},!0),E}function m(C){var E;return C.forEach(function(N){var M=r(N);(!E||c(M,E))&&(E=M)},!0),E||0}function b(C,E){if(E===Number.POSITIVE_INFINITY||E==="inf")return v(C);if(E===Number.NEGATIVE_INFINITY||E==="-inf")return m(C);if(E==="fro")return w(C,2);if(typeof E=="number"&&!isNaN(E)){if(!u(E,0)){var N=0;return C.forEach(function(M){N=n(i(r(M),E),N)},!0),i(N,1/E)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function y(C){var E=0;return C.forEach(function(N,M){E=n(E,o(N,a(N)))}),r(s(E))}function S(C){var E=[],N=0;return C.forEach(function(M,O){var F=O[1],U=n(E[F]||0,r(M));l(U,N)&&(N=U),E[F]=U},!0),N}function x(C){var E=C.size();if(E[0]!==E[1])throw new RangeError("Invalid matrix dimensions");var N=h(C),M=o(N,C),O=p(M).values.toArray(),F=O[O.length-1];return r(s(F))}function A(C){var E=[],N=0;return C.forEach(function(M,O){var F=O[0],U=n(E[F]||0,r(M));l(U,N)&&(N=U),E[F]=U},!0),N}function _(C,E){if(E===1)return S(C);if(E===Number.POSITIVE_INFINITY||E==="inf")return A(C);if(E==="fro")return y(C);if(E===2)return x(C);throw new Error("Unsupported parameter value "+E)}function w(C,E){var N=C.size();if(N.length===1)return b(C,E);if(N.length===2){if(N[0]&&N[1])return _(C,E);throw new RangeError("Invalid matrix dimensions")}}}),EC="dot",ohe=["typed","addScalar","multiplyScalar","conj","size"],uhe=G(EC,ohe,t=>{var{typed:e,addScalar:r,multiplyScalar:n,conj:i,size:a}=t;return e(EC,{"Array | DenseMatrix, Array | DenseMatrix":o,"SparseMatrix, SparseMatrix":u});function s(c,f){var h=l(c),p=l(f),v,m;if(h.length===1)v=h[0];else if(h.length===2&&h[1]===1)v=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(p.length===1)m=p[0];else if(p.length===2&&p[1]===1)m=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(v!==m)throw new RangeError("Vectors must have equal length ("+v+" != "+m+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function o(c,f){var h=s(c,f),p=dt(c)?c._data:c,v=dt(c)?c._datatype||c.getDataType():void 0,m=dt(f)?f._data:f,b=dt(f)?f._datatype||f.getDataType():void 0,y=l(c).length===2,S=l(f).length===2,x=r,A=n;if(v&&b&&v===b&&typeof v=="string"&&v!=="mixed"){var _=v;x=e.find(r,[_,_]),A=e.find(n,[_,_])}if(!y&&!S){for(var w=A(i(p[0]),m[0]),C=1;Cw){A++;continue}_===w&&(b=y(b,S(p[x],m[A])),x++,A++)}return b}function l(c){return dt(c)?c.size():a(c)}}),lhe="trace",che=["typed","matrix","add"],fhe=G(lhe,che,t=>{var{typed:e,matrix:r,add:n}=t;return e("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:vt});function i(s){var o=s._size,u=s._data;switch(o.length){case 1:if(o[0]===1)return vt(u[0]);throw new RangeError("Matrix must be square (size: "+Rt(o)+")");case 2:{var l=o[0],c=o[1];if(l===c){for(var f=0,h=0;h0)for(var v=0;vv)break}return p}throw new RangeError("Matrix must be square (size: "+Rt(c)+")")}}),CC="index",hhe=["typed","Index"],dhe=G(CC,hhe,t=>{var{typed:e,Index:r}=t;return e(CC,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(o){return Mt(o)?o.toNumber():sr(o)||dt(o)?o.map(function(u){return Mt(u)?u.toNumber():u}):o}),s=new r;return r.apply(s,a),s}})}),GP=new Set(["end"]),phe="Node",mhe=["mathWithTransform"],vhe=G(phe,mhe,t=>{var{mathWithTransform:e}=t;function r(i){for(var a of[...GP])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(e,{}),s={},o=null;function u(l){var c=Jl(l);return r(c),a(c,s,o)}return{evaluate:u}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!pr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(o,u){o.forEach(function(l,c,f){u(l,c,f),s(l,u)})}s(this,a)}transform(a){function s(o,u,l){var c=a(o,u,l);return c!==o?c:o.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(o,u,l){a(o,u,l)&&s.push(o)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&zu(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function si(t){return t&&t.isIndexError?new Ma(t.index+1,t.min+1,t.max!==void 0?t.max+1:void 0):t}function XP(t){var{subset:e}=t;return function(n,i){try{if(Array.isArray(n))return e(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return e(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return ei(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw si(a)}}}var rm="AccessorNode",ghe=["subset","Node"],yhe=G(rm,ghe,t=>{var{subset:e,Node:r}=t,n=XP({subset:e});function i(s){return!($u(s)||ji(s)||er(s)||Lo(s)||Tg(s)||Hs(s)||Sn(s))}class a extends r{constructor(o,u){if(super(),!pr(o))throw new TypeError('Node expected for parameter "object"');if(!Dc(u))throw new TypeError('IndexNode expected for parameter "index"');this.object=o,this.index=u}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return rm}get isAccessorNode(){return!0}_compile(o,u){var l=this.object._compile(o,u),c=this.index._compile(o,u);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,v,m){return ei(l(p,v,m),f)}}else return function(p,v,m){var b=l(p,v,m),y=c(p,v,b);return n(b,y)}}forEach(o){o(this.object,"object",this),o(this.index,"index",this)}map(o){return new a(this._ifNode(o(this.object,"object",this)),this._ifNode(o(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(o){var u=this.object.toString(o);return i(this.object)&&(u="("+u+")"),u+this.index.toString(o)}_toHTML(o){var u=this.object.toHTML(o);return i(this.object)&&(u='('+u+')'),u+this.index.toHTML(o)}_toTex(o){var u=this.object.toTex(o);return i(this.object)&&(u="\\left(' + object + '\\right)"),u+this.index.toTex(o)}toJSON(){return{mathjs:rm,object:this.object,index:this.index}}static fromJSON(o){return new a(o.object,o.index)}}return vn(a,"name",rm),a},{isClass:!0,isNode:!0}),nm="ArrayNode",bhe=["Node"],xhe=G(nm,bhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(pr))throw new TypeError("Array containing Nodes expected")}get type(){return nm}get isArrayNode(){return!0}_compile(i,a){var s=zs(this.items,function(l){return l._compile(i,a)}),o=i.config.matrix!=="Array";if(o){var u=i.matrix;return function(c,f,h){return u(zs(s,function(p){return p(c,f,h)}))}}else return function(c,f,h){return zs(s,function(p){return p(c,f,h)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,o){var u=s.some(ji)&&!s.every(ji),l=o||u,c=l?"&":"\\\\",f=s.map(function(h){return h.items?a(h.items,!o):h.toTex(i)}).join(c);return u||!l||l&&!o?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return vn(r,"name",nm),r},{isClass:!0,isNode:!0});function whe(t){var{subset:e,matrix:r}=t;return function(i,a,s){try{if(Array.isArray(i)){var o=r(i).subset(a,s).valueOf();return o.forEach((u,l)=>{i[l]=u}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return e(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return mc(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw si(u)}}}var ya=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function im(t,e){if(!e||e!=="auto")return t;for(var r=t;Hs(r);)r=r.content;return r}function br(t,e,r,n){var i=t;e!=="keep"&&(i=t.getContent());for(var a=i.getIdentifier(),s=null,o=0;o{var{subset:e,matrix:r,Node:n}=t,i=XP({subset:e}),a=whe({subset:e,matrix:r});function s(u,l,c){l||(l="keep");var f=br(u,l,c),h=br(u.value,l,c);return l==="all"||h!==null&&h<=f}class o extends n{constructor(l,c,f){if(super(),this.object=l,this.index=f?c:null,this.value=f||c,!Sn(l)&&!$u(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Sn(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Dc(this.index))throw new TypeError('IndexNode expected as "index"');if(!pr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return am}get isAssignmentNode(){return!0}_compile(l,c){var f=this.object._compile(l,c),h=this.index?this.index._compile(l,c):null,p=this.value._compile(l,c),v=this.object.name;if(this.index)if(this.index.isObjectProperty()){var m=this.index.getObjectProperty();return function(A,_,w){var C=f(A,_,w),E=p(A,_,w);return mc(C,m,E),E}}else{if(Sn(this.object))return function(A,_,w){var C=f(A,_,w),E=p(A,_,w),N=h(A,_,C);return A.set(v,a(C,N,E)),E};var b=this.object.object._compile(l,c);if(this.object.index.isObjectProperty()){var y=this.object.index.getObjectProperty();return function(A,_,w){var C=b(A,_,w),E=ei(C,y),N=h(A,_,E),M=p(A,_,w);return mc(C,y,a(E,N,M)),M}}else{var S=this.object.index._compile(l,c);return function(A,_,w){var C=b(A,_,w),E=S(A,_,C),N=i(C,E),M=h(A,_,N),O=p(A,_,w);return a(C,E,a(N,M,O)),O}}}else{if(!Sn(this.object))throw new TypeError("SymbolNode expected as object");return function(A,_,w){var C=p(A,_,w);return A.set(v,C),C}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var c=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,h=this._ifNode(l(this.value,"value",this));return new o(c,f,h)}clone(){return new o(this.object,this.index,this.value)}_toString(l){var c=this.object.toString(l),f=this.index?this.index.toString(l):"",h=this.value.toString(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h="("+h+")"),c+f+" = "+h}toJSON(){return{mathjs:am,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new o(l.object,l.index,l.value)}_toHTML(l){var c=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",h=this.value.toHTML(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h='('+h+')'),c+f+'='+h}_toTex(l){var c=this.object.toTex(l),f=this.index?this.index.toTex(l):"",h=this.value.toTex(l);return s(this,l&&l.parenthesis,l&&l.implicit)&&(h="\\left(".concat(h,"\\right)")),c+f+"="+h}}return vn(o,"name",am),o},{isClass:!0,isNode:!0}),sm="BlockNode",Dhe=["ResultSet","Node"],Nhe=G(sm,Dhe,t=>{var{ResultSet:e,Node:r}=t;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var o=s&&s.node,u=s&&s.visible!==void 0?s.visible:!0;if(!pr(o))throw new TypeError('Property "node" must be a Node');if(typeof u!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:o,visible:u}})}get type(){return sm}get isBlockNode(){return!0}_compile(a,s){var o=zs(this.blocks,function(u){return{evaluate:u.node._compile(a,s),visible:u.visible}});return function(l,c,f){var h=[];return Fg(o,function(v){var m=v.evaluate(l,c,f);v.visible&&h.push(m)}),new e(h)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(`\\;\\; -`)}}return vn(n,"name",sm),n},{isClass:!0,isNode:!0}),om="ConditionalNode",Ehe=["Node"],Che=G(om,Ehe,t=>{var{Node:e}=t;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(Mt(i))return!i.isZero();if($s(i))return!!(i.re||i.im);if(Xi(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+xr(i)+'"')}class n extends e{constructor(a,s,o){if(super(),!pr(a))throw new TypeError("Parameter condition must be a Node");if(!pr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!pr(o))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=o}get type(){return om}get isConditionalNode(){return!0}_compile(a,s){var o=this.condition._compile(a,s),u=this.trueExpr._compile(a,s),l=this.falseExpr._compile(a,s);return function(f,h,p){return r(o(f,h,p))?u(f,h,p):l(f,h,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.condition.toString(a),l=br(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=o)&&(u="("+u+")");var c=this.trueExpr.toString(a),f=br(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=o)&&(c="("+c+")");var h=this.falseExpr.toString(a),p=br(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=o)&&(h="("+h+")"),u+" ? "+c+" : "+h}toJSON(){return{mathjs:om,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.condition.toHTML(a),l=br(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=o)&&(u='('+u+')');var c=this.trueExpr.toHTML(a),f=br(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=o)&&(c='('+c+')');var h=this.falseExpr.toHTML(a),p=br(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=o)&&(h='('+h+')'),u+'?'+c+':'+h}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return vn(n,"name",om),n},{isClass:!0,isNode:!0}),r1=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},r=e.preserveFormatting,n=r===void 0?!1:r,i=e.escapeMapFn,a=i===void 0?Ohe:i,s=String(t),o="",u=a(r1({},Mhe),n?r1({},The):{}),l=Object.keys(u),c=function(){var h=!1;l.forEach(function(p,v){h||s.length>=p.length&&s.slice(0,p.length)===p&&(o+=u[l[v]],s=s.slice(p.length,s.length),h=!0)}),h||(o+=s.slice(0,1),s=s.slice(1,s.length))};s;)c();return o};const Rhe=zu(Fhe);var n1={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Qt={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},DC={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Qt.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Qt.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Qt.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Qt.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Qt.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Qt.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Qt.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Qt.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Qt.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Qt.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Qt.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Qt.bitAnd,"${args[1]}\\right)")},bitNot:{1:Qt.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Qt.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Qt.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Qt.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Qt.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Qt.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Qt.and,"${args[1]}\\right)")},not:{1:Qt.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Qt.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Qt.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Qt.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Qt.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Qt.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Qt.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Qt.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Qt.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Qt.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Qt.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Qt.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Qt.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Qt.to,"${args[1]}\\right)")},numeric:function(e,r){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(n1.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Bhe="\\mathrm{${name}}\\left(${args}\\right)",NC={deg:"^\\circ"};function i1(t){return Rhe(t,{preserveFormatting:!0})}function ZP(t,e){return e=typeof e>"u"?!1:e,e?tt(NC,t)?NC[t]:"\\mathrm{"+i1(t)+"}":tt(n1,t)?n1[t]:i1(t)}var um="ConstantNode",Phe=["Node"],Ihe=G(um,Phe,t=>{var{Node:e}=t;class r extends e{constructor(i){super(),this.value=i}get type(){return um}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Rt(this.value,i)}_toHTML(i){var a=this._toString(i);switch(xr(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:um,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i);switch(xr(this.value)){case"string":return"\\mathtt{"+i1(a)+"}";case"number":case"BigNumber":{if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var s=a.toLowerCase().indexOf("e");if(s!==-1)return a.substring(0,s)+"\\cdot10^{"+a.substring(s+1)+"}"}return a;case"Fraction":return this.value.toLatex();default:return a}}}return vn(r,"name",um),r},{isClass:!0,isNode:!0}),lm="FunctionAssignmentNode",khe=["typed","Node"],Lhe=G(lm,khe,t=>{var{typed:e,Node:r}=t;function n(a,s,o){var u=br(a,s,o),l=br(a.expr,s,o);return s==="all"||l!==null&&l<=u}class i extends r{constructor(s,o,u){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(o))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!pr(u))throw new TypeError('Node expected for parameter "expr"');if(GP.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var l=new Set;for(var c of o){var f=typeof c=="string"?c:c.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=s,this.params=o.map(function(h){return h&&h.name||h}),this.types=o.map(function(h){return h&&h.type||"any"}),this.expr=u}get type(){return lm}get isFunctionAssignmentNode(){return!0}_compile(s,o){var u=Object.create(o);Tg(this.params,function(v){u[v]=!0});var l=this.expr._compile(s,u),c=this.name,f=this.params,h=_2(this.types,","),p=c+"("+_2(this.params,", ")+")";return function(m,b,y){var S={};S[h]=function(){for(var A=Object.create(b),_=0;_'+Ki(this.params[l])+"");var c=this.expr.toHTML(s);return n(this,o,s&&s.implicit)&&(c='('+c+')'),''+Ki(this.name)+'('+u.join(',')+')='+c}_toTex(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=this.expr.toTex(s);return n(this,o,s&&s.implicit)&&(u="\\left(".concat(u,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(ZP).join(",")+"\\right)="+u}}return vn(i,"name",lm),i},{isClass:!0,isNode:!0}),cm="IndexNode",$he=["Node","size"],zhe=G(cm,$he,t=>{var{Node:e,size:r}=t;class n extends e{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(pr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return cm}get isIndexNode(){return!0}_compile(a,s){var o=zs(this.dimensions,function(l,c){var f=l.filter(v=>v.isSymbolNode&&v.name==="end").length>0;if(f){var h=Object.create(s);h.end=!0;var p=l._compile(a,h);return function(m,b,y){if(!dt(y)&&!sr(y)&&!$n(y))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+xr(y));var S=r(y).valueOf(),x=Object.create(b);return x.end=S[c],p(m,x,y)}}else return l._compile(a,s)}),u=ei(a,"index");return function(c,f,h){var p=zs(o,function(v){return v(c,f,h)});return u(...p)}}forEach(a){for(var s=0;s.'+Ki(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(o){return o.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return vn(n,"name",cm),n},{isClass:!0,isNode:!0}),fm="ObjectNode",Uhe=["Node"],qhe=G(fm,Uhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return pr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return fm}get isObjectNode(){return!0}_compile(i,a){var s={};for(var o in this.properties)if(tt(this.properties,o)){var u=zl(o),l=JSON.parse(u),c=ei(this.properties,o);s[l]=c._compile(i,a)}return function(h,p,v){var m={};for(var b in s)tt(s,b)&&(m[b]=s[b](h,p,v));return m}}forEach(i){for(var a in this.properties)tt(this.properties,a)&&i(this.properties[a],"properties["+zl(a)+"]",this)}map(i){var a={};for(var s in this.properties)tt(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+zl(s)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)tt(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push(zl(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:fm,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push(''+Ki(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push("\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\");var o="\\left\\{\\begin{array}{ll}"+a.join(` -`)+"\\end{array}\\right\\}";return o}}return vn(r,"name",fm),r},{isClass:!0,isNode:!0});function eh(t,e){return new mB(t,new Og(e),new Set(Object.keys(e)))}var hm="OperatorNode",Hhe=["Node"],Whe=G(hm,Hhe,t=>{var{Node:e}=t;function r(a,s){var o=a;if(s==="auto")for(;Hs(o);)o=o.content;return er(o)?!0:tn(o)?r(o.args[0],s):!1}function n(a,s,o,u,l){var c=br(a,s,o),f=jf(a,s);if(s==="all"||u.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return u.map(function(M){switch(M.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(u.length){case 0:h=[];break;case 1:{var p=br(u[0],s,o,a);if(l&&p!==null){var v,m;if(s==="keep"?(v=u[0].getIdentifier(),m=a.getIdentifier()):(v=u[0].getContent().getIdentifier(),m=a.getContent().getIdentifier()),ya[c][m].latexLeftParens===!1){h=[!1];break}if(ya[p][v].latexParens===!1){h=[!1];break}}if(p===null){h=[!1];break}if(p<=c){h=[!0];break}h=[!1]}break;case 2:{var b,y=br(u[0],s,o,a),S=jy(a,u[0],s);y===null?b=!1:y===c&&f==="right"&&!S||y=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&o==="hide")for(var N=1;N2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=l.map(function(y,S){return y=y.toString(s),c[S]&&(y="("+y+")"),y});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?b.join(" "):b.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:hm,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=s&&s.implicit?s.implicit:"hide",l=this.args,c=n(this,o,u,l,!1);if(l.length===1){var f=jf(this,o),h=l[0].toHTML(s);return c[0]&&(h='('+h+')'),f==="right"?''+Ki(this.op)+""+h:h+''+Ki(this.op)+""}else if(l.length===2){var p=l[0].toHTML(s),v=l[1].toHTML(s);return c[0]&&(p='('+p+')'),c[1]&&(v='('+v+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?p+''+v:p+''+Ki(this.op)+""+v}else{var m=l.map(function(b,y){return b=b.toHTML(s),c[y]&&(b='('+b+')'),b});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?m.join(''):m.join(''+Ki(this.op)+""):''+Ki(this.fn)+'('+m.join(',')+')'}}_toTex(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=s&&s.implicit?s.implicit:"hide",l=this.args,c=n(this,o,u,l,!0),f=Qt[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var h=jf(this,o),p=l[0].toTex(s);return c[0]&&(p="\\left(".concat(p,"\\right)")),h==="right"?f+p:p+f}else if(l.length===2){var v=l[0],m=v.toTex(s);c[0]&&(m="\\left(".concat(m,"\\right)"));var b=l[1],y=b.toTex(s);c[1]&&(y="\\left(".concat(y,"\\right)"));var S;switch(o==="keep"?S=v.getIdentifier():S=v.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+m+"}{"+y+"}";case"OperatorNode:pow":switch(m="{"+m+"}",y="{"+y+"}",S){case"ConditionalNode":case"OperatorNode:divide":m="\\left(".concat(m,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&u==="hide")return m+"~"+y}return m+f+y}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var x=l.map(function(A,_){return A=A.toTex(s),c[_]&&(A="\\left(".concat(A,"\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&u==="hide"?x.join("~"):x.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(A){return A.toTex(s)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return vn(i,"name",hm),i},{isClass:!0,isNode:!0}),dm="ParenthesisNode",Vhe=["Node"],Yhe=G(dm,Vhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),!pr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return dm}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:dm,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return vn(r,"name",dm),r},{isClass:!0,isNode:!0}),pm="RangeNode",jhe=["Node"],Ghe=G(pm,jhe,t=>{var{Node:e}=t;function r(i,a,s){var o=br(i,a,s),u={},l=br(i.start,a,s);if(u.start=l!==null&&l<=o||a==="all",i.step){var c=br(i.step,a,s);u.step=c!==null&&c<=o||a==="all"}var f=br(i.end,a,s);return u.end=f!==null&&f<=o||a==="all",u}class n extends e{constructor(a,s,o){if(super(),!pr(a))throw new TypeError("Node expected");if(!pr(s))throw new TypeError("Node expected");if(o&&!pr(o))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=o||null}get type(){return pm}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return Sn(s)&&s.name==="end"});return a.length>0}_compile(a,s){var o=a.range,u=this.start._compile(a,s),l=this.end._compile(a,s);if(this.step){var c=this.step._compile(a,s);return function(h,p,v){return o(u(h,p,v),l(h,p,v),c(h,p,v))}}else return function(h,p,v){return o(u(h,p,v),l(h,p,v))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u,l=this.start.toString(a);if(o.start&&(l="("+l+")"),u=l,this.step){var c=this.step.toString(a);o.step&&(c="("+c+")"),u+=":"+c}var f=this.end.toString(a);return o.end&&(f="("+f+")"),u+=":"+f,u}toJSON(){return{mathjs:pm,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u,l=this.start.toHTML(a);if(o.start&&(l='('+l+')'),u=l,this.step){var c=this.step.toHTML(a);o.step&&(c='('+c+')'),u+=':'+c}var f=this.end.toHTML(a);return o.end&&(f='('+f+')'),u+=':'+f,u}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u=this.start.toTex(a);if(o.start&&(u="\\left(".concat(u,"\\right)")),this.step){var l=this.step.toTex(a);o.step&&(l="\\left(".concat(l,"\\right)")),u+=":"+l}var c=this.end.toTex(a);return o.end&&(c="\\left(".concat(c,"\\right)")),u+=":"+c,u}}return vn(n,"name",pm),n},{isClass:!0,isNode:!0}),mm="RelationalNode",Xhe=["Node"],Zhe=G(mm,Xhe,t=>{var{Node:e}=t,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends e{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return mm}get isRelationalNode(){return!0}_compile(a,s){var o=this,u=this.params.map(l=>l._compile(a,s));return function(c,f,h){for(var p,v=u[0](c,f,h),m=0;ma(s,"params["+o+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,o)=>this._ifNode(a(s,"params["+o+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.params.map(function(f,h){var p=br(f,s,a&&a.implicit);return s==="all"||p!==null&&p<=o?"("+f.toString(a)+")":f.toString(a)}),l=u[0],c=0;c('+f.toHTML(a)+')':f.toHTML(a)}),l=u[0],c=0;c'+Ki(r[this.conditionals[c]])+""+u[c+1];return l}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.params.map(function(f,h){var p=br(f,s,a&&a.implicit);return s==="all"||p!==null&&p<=o?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=u[0],c=0;c{var{math:e,Unit:r,Node:n}=t;function i(s){return r?r.isValuelessUnit(s):!1}class a extends n{constructor(o){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');this.name=o}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(o,u){var l=this.name;if(u[l]===!0)return function(f,h,p){return ei(h,l)};if(l in o)return function(f,h,p){return f.has(l)?f.get(l):ei(o,l)};var c=i(l);return function(f,h,p){return f.has(l)?f.get(l):c?new r(null,l):a.onUndefinedSymbol(l)}}forEach(o){}map(o){return this.clone()}static onUndefinedSymbol(o){throw new Error("Undefined symbol "+o)}clone(){return new a(this.name)}_toString(o){return this.name}_toHTML(o){var u=Ki(this.name);return u==="true"||u==="false"?''+u+"":u==="i"?''+u+"":u==="Infinity"?''+u+"":u==="NaN"?''+u+"":u==="null"?''+u+"":u==="undefined"?''+u+"":''+u+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(o){return new a(o.name)}_toTex(o){var u=!1;typeof e[this.name]>"u"&&i(this.name)&&(u=!0);var l=ZP(this.name,u);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),vm="FunctionNode",ede=["math","Node","SymbolNode"],tde=G(vm,ede,t=>{var e,{math:r,Node:n,SymbolNode:i}=t,a=u=>Rt(u,{truncate:78});function s(u,l,c){for(var f="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,p=0,v;(v=h.exec(u))!==null;)if(f+=u.substring(p,v.index),p=v.index,v[0]==="$$")f+="$",p++;else{p+=v[0].length;var m=l[v[1]];if(!m)throw new ReferenceError("Template: Property "+v[1]+" does not exist.");if(v[2]===void 0)switch(typeof m){case"string":f+=m;break;case"object":if(pr(m))f+=m.toTex(c);else if(Array.isArray(m))f+=m.map(function(b,y){if(pr(b))return b.toTex(c);throw new TypeError("Template: "+v[1]+"["+y+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes")}else if(pr(m[v[2]]&&m[v[2]]))f+=m[v[2]].toTex(c);else throw new TypeError("Template: "+v[1]+"["+v[2]+"] is not a Node.")}return f+=u.slice(p),f}class o extends n{constructor(l,c){if(super(),typeof l=="string"&&(l=new i(l)),!pr(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(c)||!c.every(pr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=c||[]}get name(){return this.fn.name||""}get type(){return vm}get isFunctionNode(){return!0}_compile(l,c){var f=this.args.map(E=>E._compile(l,c));if(Sn(this.fn)){var h=this.fn.name;if(c[h]){var y=this.args;return function(N,M,O){var F=ei(M,h);if(typeof F!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(a(F)));if(F.rawArgs)return F(y,l,eh(N,M));var U=f.map(V=>V(N,M,O));return F.apply(F,U)}}else{var p=h in l?ei(l,h):void 0,v=typeof p=="function"&&p.rawArgs===!0,m=E=>{var N;if(E.has(h))N=E.get(h);else if(h in l)N=ei(l,h);else return o.onUndefinedFunction(h);if(typeof N=="function")return N;throw new TypeError("'".concat(h,`' is not a function; its value is: - `).concat(a(N)))};if(v){var b=this.args;return function(N,M,O){var F=m(N);return F(b,l,eh(N,M))}}else switch(f.length){case 0:return function(N,M,O){var F=m(N);return F()};case 1:return function(N,M,O){var F=m(N),U=f[0];return F(U(N,M,O))};case 2:return function(N,M,O){var F=m(N),U=f[0],V=f[1];return F(U(N,M,O),V(N,M,O))};default:return function(N,M,O){var F=m(N),U=f.map(V=>V(N,M,O));return F(...U)}}}}else if(Lu(this.fn)&&Nc(this.fn.index)&&this.fn.index.isObjectProperty()){var S=this.fn.object._compile(l,c),x=this.fn.index.getObjectProperty(),A=this.args;return function(N,M,O){var F=S(N,M,O),U=Ere(F,x);if(U!=null&&U.rawArgs)return U(A,l,eh(N,M));var V=f.map(H=>H(N,M,O));return U.apply(F,V)}}else{var _=this.fn.toString(),w=this.fn._compile(l,c),C=this.args;return function(N,M,O){var F=w(N,M,O);if(typeof F!="function")throw new TypeError("Expression '".concat(_,"' did not evaluate to a function; value is:")+` - `.concat(a(F)));if(F.rawArgs)return F(C,l,eh(N,M));var U=f.map(V=>V(N,M,O));return F.apply(F,U)}}}forEach(l){l(this.fn,"fn",this);for(var c=0;c'+Ki(this.fn)+'('+c.join(',')+')'}toTex(l){var c;return l&&typeof l.handler=="object"&&tt(l.handler,this.name)&&(c=l.handler[this.name](this,l)),typeof c<"u"?c:super.toTex(l)}_toTex(l){var c=this.args.map(function(p){return p.toTex(l)}),f;DC[this.name]&&(f=DC[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(f=r[this.name].toTex);var h;switch(typeof f){case"function":h=f(this,l);break;case"string":h=s(f,this,l);break;case"object":switch(typeof f[c.length]){case"function":h=f[c.length](this,l);break;case"string":h=s(f[c.length],this,l);break}}return typeof h<"u"?h:s(Bhe,this,l)}getIdentifier(){return this.type+":"+this.name}}return e=o,vn(o,"name",vm),vn(o,"onUndefinedFunction",function(u){throw new Error("Undefined function "+u)}),vn(o,"fromJSON",function(u){return new e(u.fn,u.args)}),o},{isClass:!0,isNode:!0}),EC="parse",rde=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],nde=G(EC,rde,t=>{var{typed:e,numeric:r,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:o,ConditionalNode:u,ConstantNode:l,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:h,ObjectNode:p,OperatorNode:v,ParenthesisNode:m,RangeNode:b,RelationalNode:y,SymbolNode:S}=t,x=e(EC,{string:function(oe){return he(oe,{})},"Array | Matrix":function(oe){return A(oe,{})},"string, Object":function(oe,Ae){var $e=Ae.nodes!==void 0?Ae.nodes:{};return he(oe,$e)},"Array | Matrix, Object":A});function A(k){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ae=oe.nodes!==void 0?oe.nodes:{};return It(k,function($e){if(typeof $e!="string")throw new TypeError("String expected");return he($e,Ae)})}var _={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},w={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},C={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},N=["NaN","Infinity"],M={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` +`)}}return vn(n,"name",sm),n},{isClass:!0,isNode:!0}),om="ConditionalNode",Ehe=["Node"],Che=G(om,Ehe,t=>{var{Node:e}=t;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(Mt(i))return!i.isZero();if($s(i))return!!(i.re||i.im);if(Xi(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+xr(i)+'"')}class n extends e{constructor(a,s,o){if(super(),!pr(a))throw new TypeError("Parameter condition must be a Node");if(!pr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!pr(o))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=o}get type(){return om}get isConditionalNode(){return!0}_compile(a,s){var o=this.condition._compile(a,s),u=this.trueExpr._compile(a,s),l=this.falseExpr._compile(a,s);return function(f,h,p){return r(o(f,h,p))?u(f,h,p):l(f,h,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.condition.toString(a),l=br(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=o)&&(u="("+u+")");var c=this.trueExpr.toString(a),f=br(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=o)&&(c="("+c+")");var h=this.falseExpr.toString(a),p=br(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=o)&&(h="("+h+")"),u+" ? "+c+" : "+h}toJSON(){return{mathjs:om,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.condition.toHTML(a),l=br(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=o)&&(u='('+u+')');var c=this.trueExpr.toHTML(a),f=br(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=o)&&(c='('+c+')');var h=this.falseExpr.toHTML(a),p=br(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=o)&&(h='('+h+')'),u+'?'+c+':'+h}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return vn(n,"name",om),n},{isClass:!0,isNode:!0}),a1=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},r=e.preserveFormatting,n=r===void 0?!1:r,i=e.escapeMapFn,a=i===void 0?Ohe:i,s=String(t),o="",u=a(a1({},Mhe),n?a1({},The):{}),l=Object.keys(u),c=function(){var h=!1;l.forEach(function(p,v){h||s.length>=p.length&&s.slice(0,p.length)===p&&(o+=u[l[v]],s=s.slice(p.length,s.length),h=!0)}),h||(o+=s.slice(0,1),s=s.slice(1,s.length))};s;)c();return o};const Rhe=Fhe;var s1={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Qt={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},MC={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Qt.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Qt.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Qt.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Qt.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Qt.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Qt.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Qt.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Qt.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Qt.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Qt.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Qt.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Qt.bitAnd,"${args[1]}\\right)")},bitNot:{1:Qt.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Qt.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Qt.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Qt.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Qt.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Qt.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Qt.and,"${args[1]}\\right)")},not:{1:Qt.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Qt.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Qt.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Qt.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Qt.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Qt.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Qt.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Qt.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Qt.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Qt.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Qt.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Qt.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Qt.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Qt.to,"${args[1]}\\right)")},numeric:function(e,r){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(s1.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Bhe="\\mathrm{${name}}\\left(${args}\\right)",TC={deg:"^\\circ"};function o1(t){return Rhe(t,{preserveFormatting:!0})}function ZP(t,e){return e=typeof e>"u"?!1:e,e?tt(TC,t)?TC[t]:"\\mathrm{"+o1(t)+"}":tt(s1,t)?s1[t]:o1(t)}var um="ConstantNode",Phe=["Node"],Ihe=G(um,Phe,t=>{var{Node:e}=t;class r extends e{constructor(i){super(),this.value=i}get type(){return um}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Rt(this.value,i)}_toHTML(i){var a=this._toString(i);switch(xr(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:um,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i);switch(xr(this.value)){case"string":return"\\mathtt{"+o1(a)+"}";case"number":case"BigNumber":{if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var s=a.toLowerCase().indexOf("e");if(s!==-1)return a.substring(0,s)+"\\cdot10^{"+a.substring(s+1)+"}"}return a;case"Fraction":return this.value.toLatex();default:return a}}}return vn(r,"name",um),r},{isClass:!0,isNode:!0}),lm="FunctionAssignmentNode",khe=["typed","Node"],Lhe=G(lm,khe,t=>{var{typed:e,Node:r}=t;function n(a,s,o){var u=br(a,s,o),l=br(a.expr,s,o);return s==="all"||l!==null&&l<=u}class i extends r{constructor(s,o,u){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(o))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!pr(u))throw new TypeError('Node expected for parameter "expr"');if(GP.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var l=new Set;for(var c of o){var f=typeof c=="string"?c:c.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=s,this.params=o.map(function(h){return h&&h.name||h}),this.types=o.map(function(h){return h&&h.type||"any"}),this.expr=u}get type(){return lm}get isFunctionAssignmentNode(){return!0}_compile(s,o){var u=Object.create(o);Fg(this.params,function(v){u[v]=!0});var l=this.expr._compile(s,u),c=this.name,f=this.params,h=E2(this.types,","),p=c+"("+E2(this.params,", ")+")";return function(m,b,y){var S={};S[h]=function(){for(var A=Object.create(b),_=0;_'+Ki(this.params[l])+"");var c=this.expr.toHTML(s);return n(this,o,s&&s.implicit)&&(c='('+c+')'),''+Ki(this.name)+'('+u.join(',')+')='+c}_toTex(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=this.expr.toTex(s);return n(this,o,s&&s.implicit)&&(u="\\left(".concat(u,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(ZP).join(",")+"\\right)="+u}}return vn(i,"name",lm),i},{isClass:!0,isNode:!0}),cm="IndexNode",$he=["Node","size"],zhe=G(cm,$he,t=>{var{Node:e,size:r}=t;class n extends e{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(pr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return cm}get isIndexNode(){return!0}_compile(a,s){var o=zs(this.dimensions,function(l,c){var f=l.filter(v=>v.isSymbolNode&&v.name==="end").length>0;if(f){var h=Object.create(s);h.end=!0;var p=l._compile(a,h);return function(m,b,y){if(!dt(y)&&!sr(y)&&!$n(y))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+xr(y));var S=r(y).valueOf(),x=Object.create(b);return x.end=S[c],p(m,x,y)}}else return l._compile(a,s)}),u=ei(a,"index");return function(c,f,h){var p=zs(o,function(v){return v(c,f,h)});return u(...p)}}forEach(a){for(var s=0;s.'+Ki(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(o){return o.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return vn(n,"name",cm),n},{isClass:!0,isNode:!0}),fm="ObjectNode",Uhe=["Node"],qhe=G(fm,Uhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return pr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return fm}get isObjectNode(){return!0}_compile(i,a){var s={};for(var o in this.properties)if(tt(this.properties,o)){var u=zl(o),l=JSON.parse(u),c=ei(this.properties,o);s[l]=c._compile(i,a)}return function(h,p,v){var m={};for(var b in s)tt(s,b)&&(m[b]=s[b](h,p,v));return m}}forEach(i){for(var a in this.properties)tt(this.properties,a)&&i(this.properties[a],"properties["+zl(a)+"]",this)}map(i){var a={};for(var s in this.properties)tt(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+zl(s)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)tt(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push(zl(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:fm,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push(''+Ki(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)tt(this.properties,s)&&a.push("\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\");var o="\\left\\{\\begin{array}{ll}"+a.join(` +`)+"\\end{array}\\right\\}";return o}}return vn(r,"name",fm),r},{isClass:!0,isNode:!0});function Qf(t,e){return new gB(t,new Rg(e),new Set(Object.keys(e)))}var hm="OperatorNode",Hhe=["Node"],Whe=G(hm,Hhe,t=>{var{Node:e}=t;function r(a,s){var o=a;if(s==="auto")for(;Hs(o);)o=o.content;return er(o)?!0:tn(o)?r(o.args[0],s):!1}function n(a,s,o,u,l){var c=br(a,s,o),f=Yf(a,s);if(s==="all"||u.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return u.map(function(M){switch(M.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(u.length){case 0:h=[];break;case 1:{var p=br(u[0],s,o,a);if(l&&p!==null){var v,m;if(s==="keep"?(v=u[0].getIdentifier(),m=a.getIdentifier()):(v=u[0].getContent().getIdentifier(),m=a.getContent().getIdentifier()),ya[c][m].latexLeftParens===!1){h=[!1];break}if(ya[p][v].latexParens===!1){h=[!1];break}}if(p===null){h=[!1];break}if(p<=c){h=[!0];break}h=[!1]}break;case 2:{var b,y=br(u[0],s,o,a),S=Xy(a,u[0],s);y===null?b=!1:y===c&&f==="right"&&!S||y=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&o==="hide")for(var N=1;N2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=l.map(function(y,S){return y=y.toString(s),c[S]&&(y="("+y+")"),y});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?b.join(" "):b.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:hm,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=s&&s.implicit?s.implicit:"hide",l=this.args,c=n(this,o,u,l,!1);if(l.length===1){var f=Yf(this,o),h=l[0].toHTML(s);return c[0]&&(h='('+h+')'),f==="right"?''+Ki(this.op)+""+h:h+''+Ki(this.op)+""}else if(l.length===2){var p=l[0].toHTML(s),v=l[1].toHTML(s);return c[0]&&(p='('+p+')'),c[1]&&(v='('+v+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?p+''+v:p+''+Ki(this.op)+""+v}else{var m=l.map(function(b,y){return b=b.toHTML(s),c[y]&&(b='('+b+')'),b});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?m.join(''):m.join(''+Ki(this.op)+""):''+Ki(this.fn)+'('+m.join(',')+')'}}_toTex(s){var o=s&&s.parenthesis?s.parenthesis:"keep",u=s&&s.implicit?s.implicit:"hide",l=this.args,c=n(this,o,u,l,!0),f=Qt[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var h=Yf(this,o),p=l[0].toTex(s);return c[0]&&(p="\\left(".concat(p,"\\right)")),h==="right"?f+p:p+f}else if(l.length===2){var v=l[0],m=v.toTex(s);c[0]&&(m="\\left(".concat(m,"\\right)"));var b=l[1],y=b.toTex(s);c[1]&&(y="\\left(".concat(y,"\\right)"));var S;switch(o==="keep"?S=v.getIdentifier():S=v.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+m+"}{"+y+"}";case"OperatorNode:pow":switch(m="{"+m+"}",y="{"+y+"}",S){case"ConditionalNode":case"OperatorNode:divide":m="\\left(".concat(m,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&u==="hide")return m+"~"+y}return m+f+y}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var x=l.map(function(A,_){return A=A.toTex(s),c[_]&&(A="\\left(".concat(A,"\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&u==="hide"?x.join("~"):x.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(A){return A.toTex(s)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return vn(i,"name",hm),i},{isClass:!0,isNode:!0}),dm="ParenthesisNode",Vhe=["Node"],Yhe=G(dm,Vhe,t=>{var{Node:e}=t;class r extends e{constructor(i){if(super(),!pr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return dm}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:dm,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return vn(r,"name",dm),r},{isClass:!0,isNode:!0}),pm="RangeNode",jhe=["Node"],Ghe=G(pm,jhe,t=>{var{Node:e}=t;function r(i,a,s){var o=br(i,a,s),u={},l=br(i.start,a,s);if(u.start=l!==null&&l<=o||a==="all",i.step){var c=br(i.step,a,s);u.step=c!==null&&c<=o||a==="all"}var f=br(i.end,a,s);return u.end=f!==null&&f<=o||a==="all",u}class n extends e{constructor(a,s,o){if(super(),!pr(a))throw new TypeError("Node expected");if(!pr(s))throw new TypeError("Node expected");if(o&&!pr(o))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=o||null}get type(){return pm}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return Sn(s)&&s.name==="end"});return a.length>0}_compile(a,s){var o=a.range,u=this.start._compile(a,s),l=this.end._compile(a,s);if(this.step){var c=this.step._compile(a,s);return function(h,p,v){return o(u(h,p,v),l(h,p,v),c(h,p,v))}}else return function(h,p,v){return o(u(h,p,v),l(h,p,v))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u,l=this.start.toString(a);if(o.start&&(l="("+l+")"),u=l,this.step){var c=this.step.toString(a);o.step&&(c="("+c+")"),u+=":"+c}var f=this.end.toString(a);return o.end&&(f="("+f+")"),u+=":"+f,u}toJSON(){return{mathjs:pm,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u,l=this.start.toHTML(a);if(o.start&&(l='('+l+')'),u=l,this.step){var c=this.step.toHTML(a);o.step&&(c='('+c+')'),u+=':'+c}var f=this.end.toHTML(a);return o.end&&(f='('+f+')'),u+=':'+f,u}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",o=r(this,s,a&&a.implicit),u=this.start.toTex(a);if(o.start&&(u="\\left(".concat(u,"\\right)")),this.step){var l=this.step.toTex(a);o.step&&(l="\\left(".concat(l,"\\right)")),u+=":"+l}var c=this.end.toTex(a);return o.end&&(c="\\left(".concat(c,"\\right)")),u+=":"+c,u}}return vn(n,"name",pm),n},{isClass:!0,isNode:!0}),mm="RelationalNode",Xhe=["Node"],Zhe=G(mm,Xhe,t=>{var{Node:e}=t,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends e{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return mm}get isRelationalNode(){return!0}_compile(a,s){var o=this,u=this.params.map(l=>l._compile(a,s));return function(c,f,h){for(var p,v=u[0](c,f,h),m=0;ma(s,"params["+o+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,o)=>this._ifNode(a(s,"params["+o+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.params.map(function(f,h){var p=br(f,s,a&&a.implicit);return s==="all"||p!==null&&p<=o?"("+f.toString(a)+")":f.toString(a)}),l=u[0],c=0;c('+f.toHTML(a)+')':f.toHTML(a)}),l=u[0],c=0;c'+Ki(r[this.conditionals[c]])+""+u[c+1];return l}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",o=br(this,s,a&&a.implicit),u=this.params.map(function(f,h){var p=br(f,s,a&&a.implicit);return s==="all"||p!==null&&p<=o?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=u[0],c=0;c{var{math:e,Unit:r,Node:n}=t;function i(s){return r?r.isValuelessUnit(s):!1}class a extends n{constructor(o){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');this.name=o}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(o,u){var l=this.name;if(u[l]===!0)return function(f,h,p){return ei(h,l)};if(l in o)return function(f,h,p){return f.has(l)?f.get(l):ei(o,l)};var c=i(l);return function(f,h,p){return f.has(l)?f.get(l):c?new r(null,l):a.onUndefinedSymbol(l)}}forEach(o){}map(o){return this.clone()}static onUndefinedSymbol(o){throw new Error("Undefined symbol "+o)}clone(){return new a(this.name)}_toString(o){return this.name}_toHTML(o){var u=Ki(this.name);return u==="true"||u==="false"?''+u+"":u==="i"?''+u+"":u==="Infinity"?''+u+"":u==="NaN"?''+u+"":u==="null"?''+u+"":u==="undefined"?''+u+"":''+u+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(o){return new a(o.name)}_toTex(o){var u=!1;typeof e[this.name]>"u"&&i(this.name)&&(u=!0);var l=ZP(this.name,u);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),vm="FunctionNode",ede=["math","Node","SymbolNode"],tde=G(vm,ede,t=>{var e,{math:r,Node:n,SymbolNode:i}=t,a=u=>Rt(u,{truncate:78});function s(u,l,c){for(var f="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,p=0,v;(v=h.exec(u))!==null;)if(f+=u.substring(p,v.index),p=v.index,v[0]==="$$")f+="$",p++;else{p+=v[0].length;var m=l[v[1]];if(!m)throw new ReferenceError("Template: Property "+v[1]+" does not exist.");if(v[2]===void 0)switch(typeof m){case"string":f+=m;break;case"object":if(pr(m))f+=m.toTex(c);else if(Array.isArray(m))f+=m.map(function(b,y){if(pr(b))return b.toTex(c);throw new TypeError("Template: "+v[1]+"["+y+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes")}else if(pr(m[v[2]]&&m[v[2]]))f+=m[v[2]].toTex(c);else throw new TypeError("Template: "+v[1]+"["+v[2]+"] is not a Node.")}return f+=u.slice(p),f}class o extends n{constructor(l,c){if(super(),typeof l=="string"&&(l=new i(l)),!pr(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(c)||!c.every(pr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=c||[]}get name(){return this.fn.name||""}get type(){return vm}get isFunctionNode(){return!0}_compile(l,c){var f=this.args.map(E=>E._compile(l,c));if(Sn(this.fn)){var h=this.fn.name;if(c[h]){var y=this.args;return function(N,M,O){var F=ei(M,h);if(typeof F!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(a(F)));if(F.rawArgs)return F(y,l,Qf(N,M));var U=f.map(V=>V(N,M,O));return F.apply(F,U)}}else{var p=h in l?ei(l,h):void 0,v=typeof p=="function"&&p.rawArgs===!0,m=E=>{var N;if(E.has(h))N=E.get(h);else if(h in l)N=ei(l,h);else return o.onUndefinedFunction(h);if(typeof N=="function")return N;throw new TypeError("'".concat(h,`' is not a function; its value is: + `).concat(a(N)))};if(v){var b=this.args;return function(N,M,O){var F=m(N);return F(b,l,Qf(N,M))}}else switch(f.length){case 0:return function(N,M,O){var F=m(N);return F()};case 1:return function(N,M,O){var F=m(N),U=f[0];return F(U(N,M,O))};case 2:return function(N,M,O){var F=m(N),U=f[0],V=f[1];return F(U(N,M,O),V(N,M,O))};default:return function(N,M,O){var F=m(N),U=f.map(V=>V(N,M,O));return F(...U)}}}}else if($u(this.fn)&&Dc(this.fn.index)&&this.fn.index.isObjectProperty()){var S=this.fn.object._compile(l,c),x=this.fn.index.getObjectProperty(),A=this.args;return function(N,M,O){var F=S(N,M,O),U=Cre(F,x);if(U!=null&&U.rawArgs)return U(A,l,Qf(N,M));var V=f.map(H=>H(N,M,O));return U.apply(F,V)}}else{var _=this.fn.toString(),w=this.fn._compile(l,c),C=this.args;return function(N,M,O){var F=w(N,M,O);if(typeof F!="function")throw new TypeError("Expression '".concat(_,"' did not evaluate to a function; value is:")+` + `.concat(a(F)));if(F.rawArgs)return F(C,l,Qf(N,M));var U=f.map(V=>V(N,M,O));return F.apply(F,U)}}}forEach(l){l(this.fn,"fn",this);for(var c=0;c'+Ki(this.fn)+'('+c.join(',')+')'}toTex(l){var c;return l&&typeof l.handler=="object"&&tt(l.handler,this.name)&&(c=l.handler[this.name](this,l)),typeof c<"u"?c:super.toTex(l)}_toTex(l){var c=this.args.map(function(p){return p.toTex(l)}),f;MC[this.name]&&(f=MC[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(f=r[this.name].toTex);var h;switch(typeof f){case"function":h=f(this,l);break;case"string":h=s(f,this,l);break;case"object":switch(typeof f[c.length]){case"function":h=f[c.length](this,l);break;case"string":h=s(f[c.length],this,l);break}}return typeof h<"u"?h:s(Bhe,this,l)}getIdentifier(){return this.type+":"+this.name}}return e=o,vn(o,"name",vm),vn(o,"onUndefinedFunction",function(u){throw new Error("Undefined function "+u)}),vn(o,"fromJSON",function(u){return new e(u.fn,u.args)}),o},{isClass:!0,isNode:!0}),OC="parse",rde=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],nde=G(OC,rde,t=>{var{typed:e,numeric:r,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:o,ConditionalNode:u,ConstantNode:l,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:h,ObjectNode:p,OperatorNode:v,ParenthesisNode:m,RangeNode:b,RelationalNode:y,SymbolNode:S}=t,x=e(OC,{string:function(oe){return he(oe,{})},"Array | Matrix":function(oe){return A(oe,{})},"string, Object":function(oe,Ae){var $e=Ae.nodes!==void 0?Ae.nodes:{};return he(oe,$e)},"Array | Matrix, Object":A});function A(k){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ae=oe.nodes!==void 0?oe.nodes:{};return It(k,function($e){if(typeof $e!="string")throw new TypeError("String expected");return he($e,Ae)})}var _={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},w={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},C={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},N=["NaN","Infinity"],M={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` `,r:"\r",t:" "};function O(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:_.NULL,nestingLevel:0,conditionalLevel:null}}function F(k,oe){return k.expression.substr(k.index,oe)}function U(k){return F(k,1)}function V(k){k.index++}function H(k){return k.expression.charAt(k.index-1)}function I(k){return k.expression.charAt(k.index+1)}function P(k){for(k.tokenType=_.NULL,k.token="",k.comment="";;){if(U(k)==="#")for(;U(k)!==` `&&U(k)!=="";)k.comment+=U(k),V(k);if(x.isWhitespace(U(k),k.nestingLevel))V(k);else break}if(U(k)===""){k.tokenType=_.DELIMITER;return}if(U(k)===` `&&!k.nestingLevel){k.tokenType=_.DELIMITER,k.token=U(k),V(k);return}var oe=U(k),Ae=F(k,2),$e=F(k,3);if($e.length===3&&w[$e]){k.tokenType=_.DELIMITER,k.token=$e,V(k),V(k),V(k);return}if(Ae.length===2&&w[Ae]){k.tokenType=_.DELIMITER,k.token=Ae,V(k),V(k);return}if(w[oe]){k.tokenType=_.DELIMITER,k.token=oe,V(k);return}if(x.isDigitDot(oe)){k.tokenType=_.NUMBER;var ct=F(k,2);if(ct==="0b"||ct==="0o"||ct==="0x"){for(k.token+=U(k),V(k),k.token+=U(k),V(k);x.isHexDigit(U(k));)k.token+=U(k),V(k);if(U(k)===".")for(k.token+=".",V(k);x.isHexDigit(U(k));)k.token+=U(k),V(k);else if(U(k)==="i")for(k.token+="i",V(k);x.isDigit(U(k));)k.token+=U(k),V(k);return}if(U(k)==="."){if(k.token+=U(k),V(k),!x.isDigit(U(k))){k.tokenType=_.DELIMITER;return}}else{for(;x.isDigit(U(k));)k.token+=U(k),V(k);x.isDecimalMark(U(k),I(k))&&(k.token+=U(k),V(k))}for(;x.isDigit(U(k));)k.token+=U(k),V(k);if(U(k)==="E"||U(k)==="e"){if(x.isDigit(I(k))||I(k)==="-"||I(k)==="+"){if(k.token+=U(k),V(k),(U(k)==="+"||U(k)==="-")&&(k.token+=U(k),V(k)),!x.isDigit(U(k)))throw at(k,'Digit expected, got "'+U(k)+'"');for(;x.isDigit(U(k));)k.token+=U(k),V(k);if(x.isDecimalMark(U(k),I(k)))throw at(k,'Digit expected, got "'+U(k)+'"')}else if(I(k)===".")throw V(k),at(k,'Digit expected, got "'+U(k)+'"')}return}if(x.isAlpha(U(k),H(k),I(k))){for(;x.isAlpha(U(k),H(k),I(k))||x.isDigit(U(k));)k.token+=U(k),V(k);tt(C,k.token)?k.tokenType=_.DELIMITER:k.tokenType=_.SYMBOL;return}for(k.tokenType=_.UNKNOWN;U(k)!=="";)k.token+=U(k),V(k);throw at(k,'Syntax error in part "'+k.token+'"')}function K(k){do P(k);while(k.token===` @@ -148,16 +148,16 @@ Example: `&&Ae>0},x.isDecimalMark=function(oe,Ae){return oe==="."&&Ae!=="/"&&Ae!=="*"&&Ae!=="^"},x.isDigitDot=function(oe){return oe>="0"&&oe<="9"||oe==="."},x.isDigit=function(oe){return oe>="0"&&oe<="9"},x.isHexDigit=function(oe){return oe>="0"&&oe<="9"||oe>="a"&&oe<="f"||oe>="A"&&oe<="F"};function he(k,oe){var Ae=O();dn(Ae,{expression:k,extraNodes:oe}),P(Ae);var $e=ne(Ae);if(Ae.token!=="")throw Ae.tokenType===_.DELIMITER?mr(Ae,"Unexpected operator "+Ae.token):at(Ae,'Unexpected part "'+Ae.token+'"');return $e}function ne(k){var oe,Ae=[],$e;for(k.token!==""&&k.token!==` `&&k.token!==";"&&(oe=X(k),k.comment&&(oe.comment=k.comment));k.token===` `||k.token===";";)Ae.length===0&&oe&&($e=k.token!==";",Ae.push({node:oe,visible:$e})),P(k),k.token!==` -`&&k.token!==";"&&k.token!==""&&(oe=X(k),k.comment&&(oe.comment=k.comment),$e=k.token!==";",Ae.push({node:oe,visible:$e}));return Ae.length>0?new o(Ae):(oe||(oe=new l(void 0),k.comment&&(oe.comment=k.comment)),oe)}function X(k){var oe,Ae,$e,ct,ht=de(k);if(k.token==="="){if(Sn(ht))return oe=ht.name,K(k),$e=X(k),new s(new S(oe),$e);if(Lu(ht))return K(k),$e=X(k),new s(ht.object,ht.index,$e);if(Lo(ht)&&Sn(ht.fn)&&(ct=!0,Ae=[],oe=ht.name,ht.args.forEach(function(Dn,Js){Sn(Dn)?Ae[Js]=Dn.name:ct=!1}),ct))return K(k),$e=X(k),new c(oe,Ae,$e);throw at(k,"Invalid left hand side of assignment operator =")}return ht}function de(k){for(var oe=Se(k);k.token==="?";){var Ae=k.conditionalLevel;k.conditionalLevel=k.nestingLevel,K(k);var $e=oe,ct=X(k);if(k.token!==":")throw at(k,"False part of conditional expression expected");k.conditionalLevel=null,K(k);var ht=X(k);oe=new u($e,ct,ht),k.conditionalLevel=Ae}return oe}function Se(k){for(var oe=ce(k);k.token==="or";)K(k),oe=new v("or","or",[oe,ce(k)]);return oe}function ce(k){for(var oe=xe(k);k.token==="xor";)K(k),oe=new v("xor","xor",[oe,xe(k)]);return oe}function xe(k){for(var oe=_e(k);k.token==="and";)K(k),oe=new v("and","and",[oe,_e(k)]);return oe}function _e(k){for(var oe=me(k);k.token==="|";)K(k),oe=new v("|","bitOr",[oe,me(k)]);return oe}function me(k){for(var oe=we(k);k.token==="^|";)K(k),oe=new v("^|","bitXor",[oe,we(k)]);return oe}function we(k){for(var oe=Ne(k);k.token==="&";)K(k),oe=new v("&","bitAnd",[oe,Ne(k)]);return oe}function Ne(k){for(var oe=[Ce(k)],Ae=[],$e={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};tt($e,k.token);){var ct={name:k.token,fn:$e[k.token]};Ae.push(ct),K(k),oe.push(Ce(k))}return oe.length===1?oe[0]:oe.length===2?new v(Ae[0].name,Ae[0].fn,oe):new y(Ae.map(ht=>ht.fn),oe)}function Ce(k){var oe,Ae,$e,ct;oe=He(k);for(var ht={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),ct=[oe,He(k)],oe=new v(Ae,$e,ct);return oe}function He(k){var oe,Ae,$e,ct;oe=qe(k);for(var ht={to:"to",in:"to"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),Ae==="in"&&k.token===""?oe=new v("*","multiply",[oe,new S("in")],!0):(ct=[oe,qe(k)],oe=new v(Ae,$e,ct));return oe}function qe(k){var oe,Ae=[];if(k.token===":"?oe=new l(1):oe=J(k),k.token===":"&&k.conditionalLevel!==k.nestingLevel){for(Ae.push(oe);k.token===":"&&Ae.length<3;)K(k),k.token===")"||k.token==="]"||k.token===","||k.token===""?Ae.push(new S("end")):Ae.push(J(k));Ae.length===3?oe=new b(Ae[0],Ae[2],Ae[1]):oe=new b(Ae[0],Ae[1])}return oe}function J(k){var oe,Ae,$e,ct;oe=te(k);for(var ht={"+":"add","-":"subtract"};tt(ht,k.token);){Ae=k.token,$e=ht[Ae],K(k);var Dn=te(k);Dn.isPercentage?ct=[oe,new v("*","multiply",[oe,Dn])]:ct=[oe,Dn],oe=new v(Ae,$e,ct)}return oe}function te(k){var oe,Ae,$e,ct;oe=ye(k),Ae=oe;for(var ht={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};tt(ht,k.token);)$e=k.token,ct=ht[$e],K(k),Ae=ye(k),oe=new v($e,ct,[oe,Ae]);return oe}function ye(k){var oe,Ae;for(oe=ee(k),Ae=oe;k.tokenType===_.SYMBOL||k.token==="in"&&er(oe)||k.tokenType===_.NUMBER&&!er(Ae)&&(!tn(Ae)||Ae.op==="!")||k.token==="(";)Ae=ee(k),oe=new v("*","multiply",[oe,Ae],!0);return oe}function ee(k){for(var oe=ue(k),Ae=oe,$e=[];k.token==="/"&&qb(Ae);)if($e.push(dn({},k)),K(k),k.tokenType===_.NUMBER)if($e.push(dn({},k)),K(k),k.tokenType===_.SYMBOL||k.token==="(")dn(k,$e.pop()),$e.pop(),Ae=ue(k),oe=new v("/","divide",[oe,Ae]);else{$e.pop(),dn(k,$e.pop());break}else{dn(k,$e.pop());break}return oe}function ue(k){var oe,Ae,$e,ct;oe=le(k);for(var ht={"%":"mod",mod:"mod"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),Ae==="%"&&k.tokenType===_.DELIMITER&&k.token!=="("?oe=new v("/","divide",[oe,new l(100)],!1,!0):(ct=[oe,le(k)],oe=new v(Ae,$e,ct));return oe}function le(k){var oe,Ae,$e,ct={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return tt(ct,k.token)?($e=ct[k.token],oe=k.token,K(k),Ae=[le(k)],new v(oe,$e,Ae)):Ee(k)}function Ee(k){var oe,Ae,$e,ct;return oe=Me(k),(k.token==="^"||k.token===".^")&&(Ae=k.token,$e=Ae==="^"?"pow":"dotPow",K(k),ct=[oe,le(k)],oe=new v(Ae,$e,ct)),oe}function Me(k){var oe,Ae,$e,ct;oe=R(k);for(var ht={"!":"factorial","'":"ctranspose"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],P(k),ct=[oe],oe=new v(Ae,$e,ct),oe=Y(k,oe);return oe}function R(k){var oe=[];if(k.tokenType===_.SYMBOL&&tt(k.extraNodes,k.token)){var Ae=k.extraNodes[k.token];if(P(k),k.token==="("){if(oe=[],$(k),P(k),k.token!==")")for(oe.push(X(k));k.token===",";)P(k),oe.push(X(k));if(k.token!==")")throw at(k,"Parenthesis ) expected");se(k),P(k)}return new Ae(oe)}return q(k)}function q(k){var oe,Ae;return k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C?(Ae=k.token,P(k),tt(E,Ae)?oe=new l(E[Ae]):N.indexOf(Ae)!==-1?oe=new l(r(Ae,"number")):oe=new S(Ae),oe=Y(k,oe),oe):pe(k)}function Y(k,oe,Ae){for(var $e;(k.token==="("||k.token==="["||k.token===".")&&(!Ae||Ae.indexOf(k.token)!==-1);)if($e=[],k.token==="(")if(Sn(oe)||Lu(oe)){if($(k),P(k),k.token!==")")for($e.push(X(k));k.token===",";)P(k),$e.push(X(k));if(k.token!==")")throw at(k,"Parenthesis ) expected");se(k),P(k),oe=new f(oe,$e)}else return oe;else if(k.token==="["){if($(k),P(k),k.token!=="]")for($e.push(X(k));k.token===",";)P(k),$e.push(X(k));if(k.token!=="]")throw at(k,"Parenthesis ] expected");se(k),P(k),oe=new i(oe,new h($e))}else{P(k);var ct=k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C;if(!ct)throw at(k,"Property name expected after dot");$e.push(new l(k.token)),P(k);var ht=!0;oe=new i(oe,new h($e,ht))}return oe}function pe(k){var oe,Ae;return k.token==='"'||k.token==="'"?(Ae=ge(k,k.token),oe=new l(Ae),oe=Y(k,oe),oe):De(k)}function ge(k,oe){for(var Ae="";U(k)!==""&&U(k)!==oe;)if(U(k)==="\\"){V(k);var $e=U(k),ct=M[$e];if(ct!==void 0)Ae+=ct,k.index+=1;else if($e==="u"){var ht=k.expression.slice(k.index+1,k.index+5);if(/^[0-9A-Fa-f]{4}$/.test(ht))Ae+=String.fromCharCode(parseInt(ht,16)),k.index+=5;else throw at(k,"Invalid unicode character \\u".concat(ht))}else throw at(k,"Bad escape character \\".concat($e))}else Ae+=U(k),V(k);if(P(k),k.token!==oe)throw at(k,"End of string ".concat(oe," expected"));return P(k),Ae}function De(k){var oe,Ae,$e,ct;if(k.token==="["){if($(k),P(k),k.token!=="]"){var ht=Be(k);if(k.token===";"){for($e=1,Ae=[ht];k.token===";";)P(k),k.token!=="]"&&(Ae[$e]=Be(k),$e++);if(k.token!=="]")throw at(k,"End of matrix ] expected");se(k),P(k),ct=Ae[0].items.length;for(var Dn=1;Dn<$e;Dn++)if(Ae[Dn].items.length!==ct)throw mr(k,"Column dimensions mismatch ("+Ae[Dn].items.length+" !== "+ct+")");oe=new a(Ae)}else{if(k.token!=="]")throw at(k,"End of matrix ] expected");se(k),P(k),oe=ht}}else se(k),P(k),oe=new a([]);return Y(k,oe)}return Pe(k)}function Be(k){for(var oe=[X(k)],Ae=1;k.token===",";)P(k),k.token!=="]"&&k.token!==";"&&(oe[Ae]=X(k),Ae++);return new a(oe)}function Pe(k){if(k.token==="{"){$(k);var oe,Ae={};do if(P(k),k.token!=="}"){if(k.token==='"'||k.token==="'")oe=ge(k,k.token);else if(k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C)oe=k.token,P(k);else throw at(k,"Symbol or string expected as object key");if(k.token!==":")throw at(k,"Colon : expected after object key");P(k),Ae[oe]=X(k)}while(k.token===",");if(k.token!=="}")throw at(k,"Comma , or bracket } expected after object value");se(k),P(k);var $e=new p(Ae);return $e=Y(k,$e),$e}return Ve(k)}function Ve(k){var oe;return k.tokenType===_.NUMBER?(oe=k.token,P(k),new l(r(oe,n.number))):ze(k)}function ze(k){var oe;if(k.token==="("){if($(k),P(k),oe=X(k),k.token!==")")throw at(k,"Parenthesis ) expected");return se(k),P(k),oe=new m(oe),oe=Y(k,oe),oe}return gt(k)}function gt(k){throw k.token===""?at(k,"Unexpected end of expression"):at(k,"Value expected")}function St(k){return k.index-k.token.length+1}function at(k,oe){var Ae=St(k),$e=new SyntaxError(oe+" (char "+Ae+")");return $e.char=Ae,$e}function mr(k,oe){var Ae=St(k),$e=new SyntaxError(oe+" (char "+Ae+")");return $e.char=Ae,$e}return e.addConversion({from:"string",to:"Node",convert:x}),x}),CC="compile",ide=["typed","parse"],ade=G(CC,ide,t=>{var{typed:e,parse:r}=t;return e(CC,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return It(i,function(a){return r(a).compile()})}})}),MC="evaluate",sde=["typed","parse"],ode=G(MC,sde,t=>{var{typed:e,parse:r}=t;return e(MC,{string:function(i){var a=zh();return r(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return r(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=zh();return It(i,function(s){return r(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return It(i,function(s){return r(s).compile().evaluate(a)})}})}),ude="Parser",lde=["evaluate"],cde=G(ude,lde,t=>{var{evaluate:e}=t;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:zh(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return e(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return Tre(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),TC="parser",fde=["typed","Parser"],hde=G(TC,fde,t=>{var{typed:e,Parser:r}=t;return e(TC,{"":function(){return new r}})}),OC="lup",dde=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],pde=G(OC,dde,t=>{var{typed:e,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:o,larger:u,equalScalar:l,unaryMinus:c,DenseMatrix:f,SparseMatrix:h,Spa:p}=t;return e(OC,{DenseMatrix:function(y){return v(y)},SparseMatrix:function(y){return m(y)},Array:function(y){var S=r(y),x=v(S);return{L:x.L.valueOf(),U:x.U.valueOf(),p:x.p}}});function v(b){var y=b._size[0],S=b._size[1],x=Math.min(y,S),A=vt(b._data),_=[],w=[y,x],C=[],E=[x,S],N,M,O,F=[];for(N=0;N0)for(N=0;N0?new o(Ae):(oe||(oe=new l(void 0),k.comment&&(oe.comment=k.comment)),oe)}function X(k){var oe,Ae,$e,ct,ht=de(k);if(k.token==="="){if(Sn(ht))return oe=ht.name,K(k),$e=X(k),new s(new S(oe),$e);if($u(ht))return K(k),$e=X(k),new s(ht.object,ht.index,$e);if(Lo(ht)&&Sn(ht.fn)&&(ct=!0,Ae=[],oe=ht.name,ht.args.forEach(function(Dn,Js){Sn(Dn)?Ae[Js]=Dn.name:ct=!1}),ct))return K(k),$e=X(k),new c(oe,Ae,$e);throw at(k,"Invalid left hand side of assignment operator =")}return ht}function de(k){for(var oe=Se(k);k.token==="?";){var Ae=k.conditionalLevel;k.conditionalLevel=k.nestingLevel,K(k);var $e=oe,ct=X(k);if(k.token!==":")throw at(k,"False part of conditional expression expected");k.conditionalLevel=null,K(k);var ht=X(k);oe=new u($e,ct,ht),k.conditionalLevel=Ae}return oe}function Se(k){for(var oe=ce(k);k.token==="or";)K(k),oe=new v("or","or",[oe,ce(k)]);return oe}function ce(k){for(var oe=xe(k);k.token==="xor";)K(k),oe=new v("xor","xor",[oe,xe(k)]);return oe}function xe(k){for(var oe=_e(k);k.token==="and";)K(k),oe=new v("and","and",[oe,_e(k)]);return oe}function _e(k){for(var oe=me(k);k.token==="|";)K(k),oe=new v("|","bitOr",[oe,me(k)]);return oe}function me(k){for(var oe=we(k);k.token==="^|";)K(k),oe=new v("^|","bitXor",[oe,we(k)]);return oe}function we(k){for(var oe=Ne(k);k.token==="&";)K(k),oe=new v("&","bitAnd",[oe,Ne(k)]);return oe}function Ne(k){for(var oe=[Ce(k)],Ae=[],$e={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};tt($e,k.token);){var ct={name:k.token,fn:$e[k.token]};Ae.push(ct),K(k),oe.push(Ce(k))}return oe.length===1?oe[0]:oe.length===2?new v(Ae[0].name,Ae[0].fn,oe):new y(Ae.map(ht=>ht.fn),oe)}function Ce(k){var oe,Ae,$e,ct;oe=He(k);for(var ht={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),ct=[oe,He(k)],oe=new v(Ae,$e,ct);return oe}function He(k){var oe,Ae,$e,ct;oe=qe(k);for(var ht={to:"to",in:"to"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),Ae==="in"&&k.token===""?oe=new v("*","multiply",[oe,new S("in")],!0):(ct=[oe,qe(k)],oe=new v(Ae,$e,ct));return oe}function qe(k){var oe,Ae=[];if(k.token===":"?oe=new l(1):oe=J(k),k.token===":"&&k.conditionalLevel!==k.nestingLevel){for(Ae.push(oe);k.token===":"&&Ae.length<3;)K(k),k.token===")"||k.token==="]"||k.token===","||k.token===""?Ae.push(new S("end")):Ae.push(J(k));Ae.length===3?oe=new b(Ae[0],Ae[2],Ae[1]):oe=new b(Ae[0],Ae[1])}return oe}function J(k){var oe,Ae,$e,ct;oe=te(k);for(var ht={"+":"add","-":"subtract"};tt(ht,k.token);){Ae=k.token,$e=ht[Ae],K(k);var Dn=te(k);Dn.isPercentage?ct=[oe,new v("*","multiply",[oe,Dn])]:ct=[oe,Dn],oe=new v(Ae,$e,ct)}return oe}function te(k){var oe,Ae,$e,ct;oe=ye(k),Ae=oe;for(var ht={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};tt(ht,k.token);)$e=k.token,ct=ht[$e],K(k),Ae=ye(k),oe=new v($e,ct,[oe,Ae]);return oe}function ye(k){var oe,Ae;for(oe=ee(k),Ae=oe;k.tokenType===_.SYMBOL||k.token==="in"&&er(oe)||k.tokenType===_.NUMBER&&!er(Ae)&&(!tn(Ae)||Ae.op==="!")||k.token==="(";)Ae=ee(k),oe=new v("*","multiply",[oe,Ae],!0);return oe}function ee(k){for(var oe=ue(k),Ae=oe,$e=[];k.token==="/"&&Hb(Ae);)if($e.push(dn({},k)),K(k),k.tokenType===_.NUMBER)if($e.push(dn({},k)),K(k),k.tokenType===_.SYMBOL||k.token==="(")dn(k,$e.pop()),$e.pop(),Ae=ue(k),oe=new v("/","divide",[oe,Ae]);else{$e.pop(),dn(k,$e.pop());break}else{dn(k,$e.pop());break}return oe}function ue(k){var oe,Ae,$e,ct;oe=le(k);for(var ht={"%":"mod",mod:"mod"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],K(k),Ae==="%"&&k.tokenType===_.DELIMITER&&k.token!=="("?oe=new v("/","divide",[oe,new l(100)],!1,!0):(ct=[oe,le(k)],oe=new v(Ae,$e,ct));return oe}function le(k){var oe,Ae,$e,ct={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return tt(ct,k.token)?($e=ct[k.token],oe=k.token,K(k),Ae=[le(k)],new v(oe,$e,Ae)):Ee(k)}function Ee(k){var oe,Ae,$e,ct;return oe=Me(k),(k.token==="^"||k.token===".^")&&(Ae=k.token,$e=Ae==="^"?"pow":"dotPow",K(k),ct=[oe,le(k)],oe=new v(Ae,$e,ct)),oe}function Me(k){var oe,Ae,$e,ct;oe=R(k);for(var ht={"!":"factorial","'":"ctranspose"};tt(ht,k.token);)Ae=k.token,$e=ht[Ae],P(k),ct=[oe],oe=new v(Ae,$e,ct),oe=Y(k,oe);return oe}function R(k){var oe=[];if(k.tokenType===_.SYMBOL&&tt(k.extraNodes,k.token)){var Ae=k.extraNodes[k.token];if(P(k),k.token==="("){if(oe=[],$(k),P(k),k.token!==")")for(oe.push(X(k));k.token===",";)P(k),oe.push(X(k));if(k.token!==")")throw at(k,"Parenthesis ) expected");se(k),P(k)}return new Ae(oe)}return q(k)}function q(k){var oe,Ae;return k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C?(Ae=k.token,P(k),tt(E,Ae)?oe=new l(E[Ae]):N.indexOf(Ae)!==-1?oe=new l(r(Ae,"number")):oe=new S(Ae),oe=Y(k,oe),oe):pe(k)}function Y(k,oe,Ae){for(var $e;(k.token==="("||k.token==="["||k.token===".")&&(!Ae||Ae.indexOf(k.token)!==-1);)if($e=[],k.token==="(")if(Sn(oe)||$u(oe)){if($(k),P(k),k.token!==")")for($e.push(X(k));k.token===",";)P(k),$e.push(X(k));if(k.token!==")")throw at(k,"Parenthesis ) expected");se(k),P(k),oe=new f(oe,$e)}else return oe;else if(k.token==="["){if($(k),P(k),k.token!=="]")for($e.push(X(k));k.token===",";)P(k),$e.push(X(k));if(k.token!=="]")throw at(k,"Parenthesis ] expected");se(k),P(k),oe=new i(oe,new h($e))}else{P(k);var ct=k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C;if(!ct)throw at(k,"Property name expected after dot");$e.push(new l(k.token)),P(k);var ht=!0;oe=new i(oe,new h($e,ht))}return oe}function pe(k){var oe,Ae;return k.token==='"'||k.token==="'"?(Ae=ge(k,k.token),oe=new l(Ae),oe=Y(k,oe),oe):De(k)}function ge(k,oe){for(var Ae="";U(k)!==""&&U(k)!==oe;)if(U(k)==="\\"){V(k);var $e=U(k),ct=M[$e];if(ct!==void 0)Ae+=ct,k.index+=1;else if($e==="u"){var ht=k.expression.slice(k.index+1,k.index+5);if(/^[0-9A-Fa-f]{4}$/.test(ht))Ae+=String.fromCharCode(parseInt(ht,16)),k.index+=5;else throw at(k,"Invalid unicode character \\u".concat(ht))}else throw at(k,"Bad escape character \\".concat($e))}else Ae+=U(k),V(k);if(P(k),k.token!==oe)throw at(k,"End of string ".concat(oe," expected"));return P(k),Ae}function De(k){var oe,Ae,$e,ct;if(k.token==="["){if($(k),P(k),k.token!=="]"){var ht=Be(k);if(k.token===";"){for($e=1,Ae=[ht];k.token===";";)P(k),k.token!=="]"&&(Ae[$e]=Be(k),$e++);if(k.token!=="]")throw at(k,"End of matrix ] expected");se(k),P(k),ct=Ae[0].items.length;for(var Dn=1;Dn<$e;Dn++)if(Ae[Dn].items.length!==ct)throw mr(k,"Column dimensions mismatch ("+Ae[Dn].items.length+" !== "+ct+")");oe=new a(Ae)}else{if(k.token!=="]")throw at(k,"End of matrix ] expected");se(k),P(k),oe=ht}}else se(k),P(k),oe=new a([]);return Y(k,oe)}return Pe(k)}function Be(k){for(var oe=[X(k)],Ae=1;k.token===",";)P(k),k.token!=="]"&&k.token!==";"&&(oe[Ae]=X(k),Ae++);return new a(oe)}function Pe(k){if(k.token==="{"){$(k);var oe,Ae={};do if(P(k),k.token!=="}"){if(k.token==='"'||k.token==="'")oe=ge(k,k.token);else if(k.tokenType===_.SYMBOL||k.tokenType===_.DELIMITER&&k.token in C)oe=k.token,P(k);else throw at(k,"Symbol or string expected as object key");if(k.token!==":")throw at(k,"Colon : expected after object key");P(k),Ae[oe]=X(k)}while(k.token===",");if(k.token!=="}")throw at(k,"Comma , or bracket } expected after object value");se(k),P(k);var $e=new p(Ae);return $e=Y(k,$e),$e}return Ve(k)}function Ve(k){var oe;return k.tokenType===_.NUMBER?(oe=k.token,P(k),new l(r(oe,n.number))):ze(k)}function ze(k){var oe;if(k.token==="("){if($(k),P(k),oe=X(k),k.token!==")")throw at(k,"Parenthesis ) expected");return se(k),P(k),oe=new m(oe),oe=Y(k,oe),oe}return gt(k)}function gt(k){throw k.token===""?at(k,"Unexpected end of expression"):at(k,"Value expected")}function St(k){return k.index-k.token.length+1}function at(k,oe){var Ae=St(k),$e=new SyntaxError(oe+" (char "+Ae+")");return $e.char=Ae,$e}function mr(k,oe){var Ae=St(k),$e=new SyntaxError(oe+" (char "+Ae+")");return $e.char=Ae,$e}return e.addConversion({from:"string",to:"Node",convert:x}),x}),FC="compile",ide=["typed","parse"],ade=G(FC,ide,t=>{var{typed:e,parse:r}=t;return e(FC,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return It(i,function(a){return r(a).compile()})}})}),RC="evaluate",sde=["typed","parse"],ode=G(RC,sde,t=>{var{typed:e,parse:r}=t;return e(RC,{string:function(i){var a=zh();return r(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return r(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=zh();return It(i,function(s){return r(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return It(i,function(s){return r(s).compile().evaluate(a)})}})}),ude="Parser",lde=["evaluate"],cde=G(ude,lde,t=>{var{evaluate:e}=t;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:zh(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return e(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return Ore(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),BC="parser",fde=["typed","Parser"],hde=G(BC,fde,t=>{var{typed:e,Parser:r}=t;return e(BC,{"":function(){return new r}})}),PC="lup",dde=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],pde=G(PC,dde,t=>{var{typed:e,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:o,larger:u,equalScalar:l,unaryMinus:c,DenseMatrix:f,SparseMatrix:h,Spa:p}=t;return e(PC,{DenseMatrix:function(y){return v(y)},SparseMatrix:function(y){return m(y)},Array:function(y){var S=r(y),x=v(S);return{L:x.L.valueOf(),U:x.U.valueOf(),p:x.p}}});function v(b){var y=b._size[0],S=b._size[1],x=Math.min(y,S),A=vt(b._data),_=[],w=[y,x],C=[],E=[x,S],N,M,O,F=[];for(N=0;N0)for(N=0;N0&&X.forEach(0,I-1,function(me,we){h._forEachRow(me,C,E,N,function(Ne,Ce){Ne>me&&X.accumulate(Ne,c(s(Ce,we)))})});var ce=I,xe=X.get(I),_e=n(xe);X.forEach(I+1,y-1,function(me,we){var Ne=n(we);u(Ne,_e)&&(ce=me,_e=Ne,xe=we)}),I!==ce&&(h._swapRows(I,ce,M[1],C,E,N),h._swapRows(I,ce,V[1],O,F,U),X.swap(I,ce),se(I,ce)),X.forEach(0,y-1,function(me,we){me<=I?(O.push(we),F.push(me)):(we=a(we,xe),l(we,0)||(C.push(we),E.push(me)))})};for(I=0;I{var{typed:e,matrix:r,zeros:n,identity:i,isZero:a,equal:s,sign:o,sqrt:u,conj:l,unaryMinus:c,addScalar:f,divideScalar:h,multiplyScalar:p,subtractScalar:v,complex:m}=t;return dn(e(FC,{DenseMatrix:function(A){return y(A)},SparseMatrix:function(A){return S()},Array:function(A){var _=r(A),w=y(_);return{Q:w.Q.valueOf(),R:w.R.valueOf()}}}),{_denseQRimpl:b});function b(x){var A=x._size[0],_=x._size[1],w=i([A],"dense"),C=w._data,E=x.clone(),N=E._data,M,O,F,U=n([A],"");for(F=0;F0)for(var w=_[0][0].type==="Complex"?m(0):0,C=0;C<_.length;++C)for(var E=0;E=0;){var u=r[s+o],l=r[n+u];l===-1?(o--,a[e++]=u):(r[n+u]=r[i+l],++o,r[s+o]=l)}return e}function yde(t,e){if(!t)return null;var r=0,n,i=[],a=[],s=0,o=e,u=2*e;for(n=0;n=0;n--)t[n]!==-1&&(a[o+n]=a[s+t[n]],a[s+t[n]]=n);for(n=0;n{var{add:e,multiply:r,transpose:n}=t;return function(c,f){if(!f||c<=0||c>3)return null;var h=f._size,p=h[0],v=h[1],m=0,b=Math.max(16,10*Math.sqrt(v));b=Math.min(v-2,b);var y=i(c,f,p,v,b);xde(y,u,null);for(var S=y._index,x=y._ptr,A=x[v],_=[],w=[],C=0,E=v+1,N=2*(v+1),M=3*(v+1),O=4*(v+1),F=5*(v+1),U=6*(v+1),V=7*(v+1),H=_,I=a(v,x,w,C,M,H,N,V,E,U,O,F),P=s(v,x,w,F,O,U,b,E,M,H,N),K=0,$,se,he,ne,X,de,Se,ce,xe,_e,me,we,Ne,Ce,He,qe;PJ?(de=he,Se=ee,ce=w[C+he]-J):(de=S[ee++],Se=x[de],ce=w[C+de]),X=1;X<=ce;X++)$=S[Se++],!((xe=w[E+$])<=0)&&(ye+=xe,w[E+$]=-xe,S[le++]=$,w[N+$]!==-1&&(H[w[N+$]]=H[$]),H[$]!==-1?w[N+H[$]]=w[N+$]:w[M+w[F+$]]=w[N+$]);de!==he&&(x[de]=So(he),w[U+de]=0)}for(J!==0&&(A=le),w[F+he]=ye,x[he]=ue,w[C+he]=le-ue,w[O+he]=-2,I=o(I,m,w,U,v),_e=ue;_e=I?w[U+de]-=xe:w[U+de]!==0&&(w[U+de]=w[F+de]+Ee)}for(_e=ue;_e0?(qe+=Me,S[Ce++]=de,He+=de):(x[de]=So(he),w[U+de]=0)}w[O+$]=Ce-we+1;var R=Ce,q=we+w[C+$];for(ee=Ne+1;ee=0))for(He=H[$],$=w[V+He],w[V+He]=-1;$!==-1&&w[N+$]!==-1;$=w[N+$],I++){for(ce=w[C+$],me=w[O+$],ee=x[$]+1;ee<=x[$]+ce-1;ee++)w[U+S[ee]]=I;var pe=$;for(se=w[N+$];se!==-1;){var ge=w[C+se]===ce&&w[O+se]===me;for(ee=x[se]+1;ge&&ee<=x[se]+ce-1;ee++)w[U+S[ee]]!==I&&(ge=0);ge?(x[se]=So($),w[E+$]+=w[E+se],w[E+se]=0,w[O+se]=-1,se=w[N+se],w[N+pe]=se):(pe=se,se=w[N+se])}}for(ee=ue,_e=ue;_e=0;se--)w[E+se]>0||(w[N+se]=w[M+x[se]],w[M+x[se]]=se);for(de=v;de>=0;de--)w[E+de]<=0||x[de]!==-1&&(w[N+de]=w[M+x[de]],w[M+x[de]]=de);for(he=0,$=0;$<=v;$++)x[$]===-1&&(he=KP($,he,w,M,N,_,U));return _.splice(_.length-1,1),_};function i(l,c,f,h,p){var v=n(c);if(l===1&&h===f)return e(c,v);if(l===2){for(var m=v._index,b=v._ptr,y=0,S=0;Sp))for(var A=b[S+1];xm)f[b+_]=0,f[p+_]=-1,A++,c[_]=So(l),f[b+l]++;else{var C=f[y+w];C!==-1&&(S[C]=_),f[x+_]=f[y+w],f[y+w]=_}}return A}function o(l,c,f,h,p){if(l<2||l+c<0){for(var v=0;v{var{transpose:e}=t;return function(r,n,i,a){if(!r||!n||!i)return null;var s=r._size,o=s[0],u=s[1],l,c,f,h,p,v,m,b=4*u+(a?u+o+1:0),y=[],S=0,x=u,A=2*u,_=3*u,w=4*u,C=5*u+1;for(f=0;f=1&&E[c]++,F.jleaf===2&&E[F.q]--}n[c]!==-1&&(y[S+c]=n[c])}for(c=0;c{var{add:e,multiply:r,transpose:n}=t,i=_de({add:e,multiply:r,transpose:n}),a=Ede({transpose:n});return function(u,l,c){var f=l._ptr,h=l._size,p=h[1],v,m={};if(m.q=i(u,l),u&&!m.q)return null;if(c){var b=u?gde(l,null,m.q,0):l;m.parent=bde(b,1);var y=yde(m.parent,p);if(m.cp=a(b,m.parent,y,1),b&&m.parent&&m.cp&&s(b,m))for(m.unz=0,v=0;v=0;C--)for(N=l[C],M=l[C+1],E=N;E=0;w--)m[w]=-1,C=b[w],C!==-1&&(y[_+C]++===0&&(y[A+C]=w),y[S+w]=y[x+C],y[x+C]=w);for(u.lnz=0,u.m2=h,C=0;C=0;){t=n[h];var p=i?i[t]:t;a1(s,t)||(JP(s,t),n[u+h]=p<0?0:RC(s[p]));var v=1;for(c=n[u+h],f=p<0?0:RC(s[p+1]);c{var{divideScalar:e,multiply:r,subtract:n}=t;return function(a,s,o,u,l,c,f){var h=a._values,p=a._index,v=a._ptr,m=a._size,b=m[1],y=s._values,S=s._index,x=s._ptr,A,_,w,C,E=Fde(a,s,o,u,c);for(A=E;A{var{abs:e,divideScalar:r,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:o}=t,u=Pde({divideScalar:r,multiply:n,subtract:i});return function(c,f,h){if(!c)return null;var p=c._size,v=p[1],m,b=100,y=100;f&&(m=f.q,b=f.lnz||b,y=f.unz||y);var S=[],x=[],A=[],_=new o({values:S,index:x,ptr:A,size:[v,v]}),w=[],C=[],E=[],N=new o({values:w,index:C,ptr:E,size:[v,v]}),M=[],O,F,U=[],V=[];for(O=0;O{var{typed:e,abs:r,add:n,multiply:i,transpose:a,divideScalar:s,subtract:o,larger:u,largerEq:l,SparseMatrix:c}=t,f=Tde({add:n,multiply:i,transpose:a}),h=Lde({abs:r,divideScalar:s,multiply:i,subtract:o,larger:u,largerEq:l,SparseMatrix:c});return e(BC,{"SparseMatrix, number, number":function(v,m,b){if(!ot(m)||m<0||m>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(b<0||b>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var y=f(m,v,!1),S=h(v,y,b);return{L:S.L,U:S.U,p:S.pinv,q:y.q,toString:function(){return"L: "+this.L.toString()+` +P: `+this.p}}}}),IC="qr",mde=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],vde=G(IC,mde,t=>{var{typed:e,matrix:r,zeros:n,identity:i,isZero:a,equal:s,sign:o,sqrt:u,conj:l,unaryMinus:c,addScalar:f,divideScalar:h,multiplyScalar:p,subtractScalar:v,complex:m}=t;return dn(e(IC,{DenseMatrix:function(A){return y(A)},SparseMatrix:function(A){return S()},Array:function(A){var _=r(A),w=y(_);return{Q:w.Q.valueOf(),R:w.R.valueOf()}}}),{_denseQRimpl:b});function b(x){var A=x._size[0],_=x._size[1],w=i([A],"dense"),C=w._data,E=x.clone(),N=E._data,M,O,F,U=n([A],"");for(F=0;F0)for(var w=_[0][0].type==="Complex"?m(0):0,C=0;C<_.length;++C)for(var E=0;E=0;){var u=r[s+o],l=r[n+u];l===-1?(o--,a[e++]=u):(r[n+u]=r[i+l],++o,r[s+o]=l)}return e}function yde(t,e){if(!t)return null;var r=0,n,i=[],a=[],s=0,o=e,u=2*e;for(n=0;n=0;n--)t[n]!==-1&&(a[o+n]=a[s+t[n]],a[s+t[n]]=n);for(n=0;n{var{add:e,multiply:r,transpose:n}=t;return function(c,f){if(!f||c<=0||c>3)return null;var h=f._size,p=h[0],v=h[1],m=0,b=Math.max(16,10*Math.sqrt(v));b=Math.min(v-2,b);var y=i(c,f,p,v,b);xde(y,u,null);for(var S=y._index,x=y._ptr,A=x[v],_=[],w=[],C=0,E=v+1,N=2*(v+1),M=3*(v+1),O=4*(v+1),F=5*(v+1),U=6*(v+1),V=7*(v+1),H=_,I=a(v,x,w,C,M,H,N,V,E,U,O,F),P=s(v,x,w,F,O,U,b,E,M,H,N),K=0,$,se,he,ne,X,de,Se,ce,xe,_e,me,we,Ne,Ce,He,qe;PJ?(de=he,Se=ee,ce=w[C+he]-J):(de=S[ee++],Se=x[de],ce=w[C+de]),X=1;X<=ce;X++)$=S[Se++],!((xe=w[E+$])<=0)&&(ye+=xe,w[E+$]=-xe,S[le++]=$,w[N+$]!==-1&&(H[w[N+$]]=H[$]),H[$]!==-1?w[N+H[$]]=w[N+$]:w[M+w[F+$]]=w[N+$]);de!==he&&(x[de]=So(he),w[U+de]=0)}for(J!==0&&(A=le),w[F+he]=ye,x[he]=ue,w[C+he]=le-ue,w[O+he]=-2,I=o(I,m,w,U,v),_e=ue;_e=I?w[U+de]-=xe:w[U+de]!==0&&(w[U+de]=w[F+de]+Ee)}for(_e=ue;_e0?(qe+=Me,S[Ce++]=de,He+=de):(x[de]=So(he),w[U+de]=0)}w[O+$]=Ce-we+1;var R=Ce,q=we+w[C+$];for(ee=Ne+1;ee=0))for(He=H[$],$=w[V+He],w[V+He]=-1;$!==-1&&w[N+$]!==-1;$=w[N+$],I++){for(ce=w[C+$],me=w[O+$],ee=x[$]+1;ee<=x[$]+ce-1;ee++)w[U+S[ee]]=I;var pe=$;for(se=w[N+$];se!==-1;){var ge=w[C+se]===ce&&w[O+se]===me;for(ee=x[se]+1;ge&&ee<=x[se]+ce-1;ee++)w[U+S[ee]]!==I&&(ge=0);ge?(x[se]=So($),w[E+$]+=w[E+se],w[E+se]=0,w[O+se]=-1,se=w[N+se],w[N+pe]=se):(pe=se,se=w[N+se])}}for(ee=ue,_e=ue;_e=0;se--)w[E+se]>0||(w[N+se]=w[M+x[se]],w[M+x[se]]=se);for(de=v;de>=0;de--)w[E+de]<=0||x[de]!==-1&&(w[N+de]=w[M+x[de]],w[M+x[de]]=de);for(he=0,$=0;$<=v;$++)x[$]===-1&&(he=KP($,he,w,M,N,_,U));return _.splice(_.length-1,1),_};function i(l,c,f,h,p){var v=n(c);if(l===1&&h===f)return e(c,v);if(l===2){for(var m=v._index,b=v._ptr,y=0,S=0;Sp))for(var A=b[S+1];xm)f[b+_]=0,f[p+_]=-1,A++,c[_]=So(l),f[b+l]++;else{var C=f[y+w];C!==-1&&(S[C]=_),f[x+_]=f[y+w],f[y+w]=_}}return A}function o(l,c,f,h,p){if(l<2||l+c<0){for(var v=0;v{var{transpose:e}=t;return function(r,n,i,a){if(!r||!n||!i)return null;var s=r._size,o=s[0],u=s[1],l,c,f,h,p,v,m,b=4*u+(a?u+o+1:0),y=[],S=0,x=u,A=2*u,_=3*u,w=4*u,C=5*u+1;for(f=0;f=1&&E[c]++,F.jleaf===2&&E[F.q]--}n[c]!==-1&&(y[S+c]=n[c])}for(c=0;c{var{add:e,multiply:r,transpose:n}=t,i=_de({add:e,multiply:r,transpose:n}),a=Ede({transpose:n});return function(u,l,c){var f=l._ptr,h=l._size,p=h[1],v,m={};if(m.q=i(u,l),u&&!m.q)return null;if(c){var b=u?gde(l,null,m.q,0):l;m.parent=bde(b,1);var y=yde(m.parent,p);if(m.cp=a(b,m.parent,y,1),b&&m.parent&&m.cp&&s(b,m))for(m.unz=0,v=0;v=0;C--)for(N=l[C],M=l[C+1],E=N;E=0;w--)m[w]=-1,C=b[w],C!==-1&&(y[_+C]++===0&&(y[A+C]=w),y[S+w]=y[x+C],y[x+C]=w);for(u.lnz=0,u.m2=h,C=0;C=0;){t=n[h];var p=i?i[t]:t;u1(s,t)||(JP(s,t),n[u+h]=p<0?0:kC(s[p]));var v=1;for(c=n[u+h],f=p<0?0:kC(s[p+1]);c{var{divideScalar:e,multiply:r,subtract:n}=t;return function(a,s,o,u,l,c,f){var h=a._values,p=a._index,v=a._ptr,m=a._size,b=m[1],y=s._values,S=s._index,x=s._ptr,A,_,w,C,E=Fde(a,s,o,u,c);for(A=E;A{var{abs:e,divideScalar:r,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:o}=t,u=Pde({divideScalar:r,multiply:n,subtract:i});return function(c,f,h){if(!c)return null;var p=c._size,v=p[1],m,b=100,y=100;f&&(m=f.q,b=f.lnz||b,y=f.unz||y);var S=[],x=[],A=[],_=new o({values:S,index:x,ptr:A,size:[v,v]}),w=[],C=[],E=[],N=new o({values:w,index:C,ptr:E,size:[v,v]}),M=[],O,F,U=[],V=[];for(O=0;O{var{typed:e,abs:r,add:n,multiply:i,transpose:a,divideScalar:s,subtract:o,larger:u,largerEq:l,SparseMatrix:c}=t,f=Tde({add:n,multiply:i,transpose:a}),h=Lde({abs:r,divideScalar:s,multiply:i,subtract:o,larger:u,largerEq:l,SparseMatrix:c});return e(LC,{"SparseMatrix, number, number":function(v,m,b){if(!ot(m)||m<0||m>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(b<0||b>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var y=f(m,v,!1),S=h(v,y,b);return{L:S.L,U:S.U,p:S.pinv,q:y.q,toString:function(){return"L: "+this.L.toString()+` U: `+this.U.toString()+` p: `+this.p.toString()+(this.q?` q: `+this.q.toString():"")+` -`}}}})});function PC(t,e){var r,n=e.length,i=[];if(t)for(r=0;r{var{typed:e,matrix:r,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(IC,{"Array, Array | Matrix":function(h,p){h=r(h);var v=n(h),m=c(v.L,v.U,v.p,null,p);return m.valueOf()},"DenseMatrix, Array | Matrix":function(h,p){var v=n(h);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix":function(h,p){var v=n(h);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(h,p,v,m){var b=i(h,v,m);return c(b.L,b.U,b.p,b.q,p)},"Object, Array | Matrix":function(h,p){return c(h.L,h.U,h.p,h.q,p)}});function l(f){if(dt(f))return f;if(sr(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function c(f,h,p,v,m){f=l(f),h=l(h),p&&(m=u(f,m,!0),m._data=PC(p,m._data));var b=s(f,m),y=a(h,b);return v&&(y._data=PC(v,y._data)),y}}),kC="polynomialRoot",Hde=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],Wde=G(kC,Hde,t=>{var{typed:e,isZero:r,equalScalar:n,add:i,subtract:a,multiply:s,divide:o,sqrt:u,unaryMinus:l,cbrt:c,typeOf:f,im:h,re:p}=t;return e(kC,{"number|Complex, ...number|Complex":(v,m)=>{for(var b=[v,...m];b.length>0&&r(b[b.length-1]);)b.pop();if(b.length<2)throw new RangeError("Polynomial [".concat(v,", ").concat(m,"] must have a non-zero non-constant coefficient"));switch(b.length){case 2:return[l(o(b[0],b[1]))];case 3:{var[y,S,x]=b,A=s(2,x),_=s(S,S),w=s(4,x,y);if(n(_,w))return[o(l(S),A)];var C=u(a(_,w));return[o(a(C,S),A),o(a(l(C),S),A)]}case 4:{var[E,N,M,O]=b,F=l(s(3,O)),U=s(M,M),V=s(3,O,N),H=i(s(2,M,M,M),s(27,O,O,E)),I=s(9,O,M,N);if(n(U,V)&&n(H,I))return[o(M,F)];var P=a(U,V),K=a(H,I),$=i(s(18,O,M,N,E),s(M,M,N,N)),se=i(s(4,M,M,M,E),s(4,O,N,N,N),s(27,O,O,E,E));if(n($,se))return[o(a(s(4,O,M,N),i(s(9,O,O,E),s(M,M,M))),s(O,P)),o(a(s(9,O,E),s(M,N)),s(2,P))];var he;n(U,V)?he=K:he=o(i(K,u(a(s(K,K),s(4,P,P,P)))),2);var ne=!0,X=c(he,ne).toArray().map(de=>o(i(M,de,o(P,de)),F));return X.map(de=>f(de)==="Complex"&&n(p(de),p(de)+h(de))?p(de):de)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(b))}}})}),Vde="Help",Yde=["evaluate"],jde=G(Vde,Yde,t=>{var{evaluate:e}=t;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` +`}}}})});function $C(t,e){var r,n=e.length,i=[];if(t)for(r=0;r{var{typed:e,matrix:r,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:o}=t,u=dd({DenseMatrix:o});return e(zC,{"Array, Array | Matrix":function(h,p){h=r(h);var v=n(h),m=c(v.L,v.U,v.p,null,p);return m.valueOf()},"DenseMatrix, Array | Matrix":function(h,p){var v=n(h);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix":function(h,p){var v=n(h);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(h,p,v,m){var b=i(h,v,m);return c(b.L,b.U,b.p,b.q,p)},"Object, Array | Matrix":function(h,p){return c(h.L,h.U,h.p,h.q,p)}});function l(f){if(dt(f))return f;if(sr(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function c(f,h,p,v,m){f=l(f),h=l(h),p&&(m=u(f,m,!0),m._data=$C(p,m._data));var b=s(f,m),y=a(h,b);return v&&(y._data=$C(v,y._data)),y}}),UC="polynomialRoot",Hde=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],Wde=G(UC,Hde,t=>{var{typed:e,isZero:r,equalScalar:n,add:i,subtract:a,multiply:s,divide:o,sqrt:u,unaryMinus:l,cbrt:c,typeOf:f,im:h,re:p}=t;return e(UC,{"number|Complex, ...number|Complex":(v,m)=>{for(var b=[v,...m];b.length>0&&r(b[b.length-1]);)b.pop();if(b.length<2)throw new RangeError("Polynomial [".concat(v,", ").concat(m,"] must have a non-zero non-constant coefficient"));switch(b.length){case 2:return[l(o(b[0],b[1]))];case 3:{var[y,S,x]=b,A=s(2,x),_=s(S,S),w=s(4,x,y);if(n(_,w))return[o(l(S),A)];var C=u(a(_,w));return[o(a(C,S),A),o(a(l(C),S),A)]}case 4:{var[E,N,M,O]=b,F=l(s(3,O)),U=s(M,M),V=s(3,O,N),H=i(s(2,M,M,M),s(27,O,O,E)),I=s(9,O,M,N);if(n(U,V)&&n(H,I))return[o(M,F)];var P=a(U,V),K=a(H,I),$=i(s(18,O,M,N,E),s(M,M,N,N)),se=i(s(4,M,M,M,E),s(4,O,N,N,N),s(27,O,O,E,E));if(n($,se))return[o(a(s(4,O,M,N),i(s(9,O,O,E),s(M,M,M))),s(O,P)),o(a(s(9,O,E),s(M,N)),s(2,P))];var he;n(U,V)?he=K:he=o(i(K,u(a(s(K,K),s(4,P,P,P)))),2);var ne=!0,X=c(he,ne).toArray().map(de=>o(i(M,de,o(P,de)),F));return X.map(de=>f(de)==="Complex"&&n(p(de),p(de)+h(de))?p(de):de)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(b))}}})}),Vde="Help",Yde=["evaluate"],jde=G(Vde,Yde,t=>{var{evaluate:e}=t;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` `;if(n.name&&(i+="Name: "+n.name+` `),n.category&&(i+="Category: "+n.category+` @@ -171,11 +171,11 @@ q: `+this.q.toString():"")+` `),n.examples){i+=`Examples: `;for(var a=!1,s=e("config()"),o={config:f=>(a=!0,e("config(newConfig)",{newConfig:f}))},u=0;ua!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),Gde="Chain",Xde=["?on","math","typed"],Zde=G(Gde,Xde,t=>{var{on:e,math:r,typed:n}=t;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");ZR(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Rt(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,c){typeof c=="function"&&(i.prototype[l]=o(c))}function s(l,c){Gte(i.prototype,l,function(){var h=c();if(typeof h=="function")return o(h)})}function o(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var c=[this.value],f=0;fl[v])};for(var h in l)f(h)}};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),e&&e("import",function(l,c,f){f||s(l,c)}),i},{isClass:!0}),LC={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},Kde={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},Jde={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Qde={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},epe={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},tpe={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},rpe={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},npe={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},ipe={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},ape={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},spe={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},$C={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},ope={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},upe={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},lpe={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},cpe={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},fpe={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},hpe={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},dpe={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},ppe={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},mpe={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},vpe={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},gpe={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},ype={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},bpe={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},xpe={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},wpe={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},Spe={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},_pe={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},Ape={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},Dpe={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},Npe={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},Epe={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},Cpe={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},Mpe={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},Tpe={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},Ope={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},Fpe={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},Rpe={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},Bpe={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},Ppe={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},Ipe={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},kpe={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},Lpe={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},$pe={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},zpe={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},Upe={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},qpe={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},Hpe={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},Wpe={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},Vpe={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},Ype={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},jpe={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},Gpe={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},Xpe={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},Zpe={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},Kpe={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},Jpe={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},Qpe={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},eme={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},tme={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},rme={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},nme={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},ime={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},ame={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},sme={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},ome={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},ume={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},lme={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},cme={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},fme={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},hme={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},dme={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},pme={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},mme={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},vme={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},gme={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},yme={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},bme={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},xme={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},wme={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},Sme={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},_me={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},Ame={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},Dme={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},Nme={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},Eme={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},Cme={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},Mme={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},Tme={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},Ome={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},Fme={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},Rme={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},Bme={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},Pme={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},Ime={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},kme={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},Lme={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},$me={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},zme={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},Ume={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},qme={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},Hme={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},Wme={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},Vme={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},Yme={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},jme={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},Gme={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},Xme={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},Zme={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},Kme={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},Jme={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},Qme={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},eve={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},tve={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},rve={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},nve={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},ive={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},ave={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},sve={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},ove={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},uve={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},lve={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},cve={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},fve={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},hve={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},dve={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pve={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},mve={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},vve={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},gve={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},yve={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},bve={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},xve={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},wve={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},Sve={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},_ve={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},Ave={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},Dve={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},Nve={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},Eve={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},Cve={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},Mve={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},Tve={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},Ove={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},Fve={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},Rve={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},Bve={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},Pve={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},Ive={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},kve={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},Lve={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},$ve={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},zve={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},Uve={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},qve={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},Hve={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},Wve={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},Vve={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},Yve={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},jve={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},Gve={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},Xve={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},Zve={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},Kve={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},Jve={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},Qve={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},ege={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},tge={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},rge={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},nge={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},ige={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},age={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},sge={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},oge={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},uge={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},lge={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},cge={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},fge={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},hge={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},dge={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},pge={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},mge={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},vge={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},gge={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},yge={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},bge={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},xge={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},wge={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},Sge={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},_ge={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},Age={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},Dge={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},Nge={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},Ege={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. +`),i},r.prototype.toJSON=function(){var n=vt(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),Gde="Chain",Xde=["?on","math","typed"],Zde=G(Gde,Xde,t=>{var{on:e,math:r,typed:n}=t;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");JR(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Rt(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,c){typeof c=="function"&&(i.prototype[l]=o(c))}function s(l,c){Xte(i.prototype,l,function(){var h=c();if(typeof h=="function")return o(h)})}function o(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var c=[this.value],f=0;fl[v])};for(var h in l)f(h)}};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),e&&e("import",function(l,c,f){f||s(l,c)}),i},{isClass:!0}),qC={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},Kde={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},Jde={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Qde={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},epe={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},tpe={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},rpe={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},npe={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},ipe={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},ape={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},spe={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},HC={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},ope={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},upe={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},lpe={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},cpe={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},fpe={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},hpe={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},dpe={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},ppe={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},mpe={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},vpe={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},gpe={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},ype={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},bpe={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},xpe={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},wpe={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},Spe={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},_pe={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},Ape={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},Dpe={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},Npe={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},Epe={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},Cpe={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},Mpe={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},Tpe={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},Ope={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},Fpe={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},Rpe={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},Bpe={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},Ppe={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},Ipe={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},kpe={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},Lpe={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},$pe={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},zpe={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},Upe={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},qpe={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},Hpe={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},Wpe={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},Vpe={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},Ype={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},jpe={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},Gpe={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},Xpe={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},Zpe={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},Kpe={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},Jpe={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},Qpe={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},eme={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},tme={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},rme={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},nme={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},ime={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},ame={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},sme={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},ome={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},ume={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},lme={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},cme={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},fme={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},hme={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},dme={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},pme={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},mme={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},vme={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},gme={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},yme={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},bme={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},xme={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},wme={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},Sme={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},_me={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},Ame={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},Dme={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},Nme={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},Eme={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},Cme={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},Mme={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},Tme={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},Ome={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},Fme={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},Rme={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},Bme={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},Pme={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},Ime={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},kme={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},Lme={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},$me={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},zme={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},Ume={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},qme={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},Hme={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},Wme={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},Vme={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},Yme={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},jme={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},Gme={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},Xme={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},Zme={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},Kme={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},Jme={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},Qme={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},eve={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},tve={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},rve={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},nve={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},ive={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},ave={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},sve={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},ove={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},uve={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},lve={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},cve={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},fve={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},hve={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},dve={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pve={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},mve={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},vve={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},gve={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},yve={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},bve={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},xve={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},wve={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},Sve={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},_ve={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},Ave={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},Dve={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},Nve={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},Eve={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},Cve={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},Mve={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},Tve={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},Ove={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},Fve={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},Rve={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},Bve={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},Pve={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},Ive={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},kve={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},Lve={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},$ve={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},zve={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},Uve={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},qve={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},Hve={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},Wve={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},Vve={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},Yve={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},jve={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},Gve={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},Xve={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},Zve={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},Kve={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},Jve={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},Qve={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},ege={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},tge={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},rge={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},nge={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},ige={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},age={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},sge={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},oge={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},uge={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},lge={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},cge={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},fge={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},hge={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},dge={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},pge={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},mge={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},vge={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},gge={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},yge={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},bge={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},xge={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},wge={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},Sge={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},_ge={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},Age={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},Dge={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},Nge={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},Ege={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},Cge={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},Mge={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},Tge={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},Oge={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},Fge={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},Rge={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},Bge={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},Pge={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},Ige={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},kge={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},Lge={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},$ge={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},zge={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},Uge={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},qge={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},Hge={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},Wge={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},Vge={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},Yge={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},jge={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},Gge={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},Xge={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},Zge={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},Kge={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},Jge={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},Qge={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},e0e={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},t0e={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},r0e={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},n0e={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},i0e={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},a0e={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},s0e={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},o0e={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},u0e={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},l0e={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},c0e={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},f0e={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},h0e={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},d0e={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},p0e={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},m0e={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},v0e={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},g0e={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},y0e={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},b0e={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},x0e={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},w0e={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},S0e={bignumber:hpe,boolean:dpe,complex:ppe,createUnit:mpe,fraction:vpe,index:gpe,matrix:ype,number:bpe,sparse:xpe,splitUnit:wpe,string:Spe,unit:_pe,e:LC,E:LC,false:Kde,i:Jde,Infinity:Qde,LN2:tpe,LN10:epe,LOG2E:npe,LOG10E:rpe,NaN:ipe,null:ape,pi:$C,PI:$C,phi:spe,SQRT1_2:ope,SQRT2:upe,tau:lpe,true:cpe,version:fpe,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:Epe,lsolve:Mpe,lsolveAll:Tpe,lup:Ope,lusolve:Fpe,leafCount:Cpe,polynomialRoot:Rpe,resolve:Ipe,simplify:kpe,simplifyConstant:Lpe,simplifyCore:$pe,symbolicEqual:Upe,rationalize:Ppe,slu:zpe,usolve:qpe,usolveAll:Hpe,qr:Bpe,abs:Wpe,add:Vpe,cbrt:Ype,ceil:jpe,cube:Gpe,divide:Xpe,dotDivide:Zpe,dotMultiply:Kpe,dotPow:Jpe,exp:Qpe,expm:eme,expm1:tme,fix:rme,floor:nme,gcd:ime,hypot:ame,lcm:ome,log:ume,log2:fme,log1p:cme,log10:lme,mod:hme,multiply:dme,norm:pme,nthRoot:mme,nthRoots:vme,pow:gme,round:yme,sign:bme,sqrt:xme,sqrtm:wme,square:Dme,subtract:Nme,unaryMinus:Eme,unaryPlus:Cme,xgcd:Mme,invmod:sme,bitAnd:Tme,bitNot:Ome,bitOr:Fme,bitXor:Rme,leftShift:Bme,rightArithShift:Pme,rightLogShift:Ime,bellNumbers:kme,catalan:Lme,composition:$me,stirlingS2:zme,config:Ape,import:Dpe,typed:Npe,arg:Ume,conj:qme,re:Wme,im:Hme,evaluate:Vme,help:Yme,distance:jme,intersect:Gme,and:Xme,not:Zme,or:Kme,xor:Jme,concat:eve,count:tve,cross:rve,column:Qme,ctranspose:nve,det:ive,diag:ave,diff:sve,dot:ove,getMatrixDataType:hve,identity:dve,filter:lve,flatten:cve,forEach:fve,inv:pve,pinv:mve,eigs:uve,kron:vve,matrixFromFunction:bve,matrixFromRows:xve,matrixFromColumns:yve,map:gve,ones:wve,partitionSelect:Sve,range:_ve,resize:Dve,reshape:Ave,rotate:Nve,rotationMatrix:Eve,row:Cve,size:Mve,sort:Tve,squeeze:Ove,subset:Fve,trace:Rve,transpose:Bve,zeros:Pve,fft:Ive,ifft:kve,sylvester:Sme,schur:_me,lyap:Ame,solveODE:w0e,combinations:Lve,combinationsWithRep:$ve,factorial:zve,gamma:Uve,kldivergence:Hve,lgamma:qve,multinomial:Wve,permutations:Vve,pickRandom:Yve,random:jve,randomInt:Gve,compare:Xve,compareNatural:Zve,compareText:Kve,deepEqual:Jve,equal:Qve,equalText:ege,larger:tge,largerEq:rge,smaller:nge,smallerEq:ige,unequal:age,setCartesian:sge,setDifference:oge,setDistinct:uge,setIntersect:lge,setIsSubset:cge,setMultiplicity:fge,setPowerset:hge,setSize:dge,setSymDifference:pge,setUnion:mge,zpk2tf:vge,freqz:gge,erf:yge,zeta:bge,cumsum:Mge,mad:xge,max:wge,mean:Sge,median:_ge,min:Age,mode:Dge,prod:Nge,quantileSeq:Ege,std:Cge,sum:Tge,variance:Oge,corr:Fge,acos:Rge,acosh:Bge,acot:Pge,acoth:Ige,acsc:kge,acsch:Lge,asec:$ge,asech:zge,asin:Uge,asinh:qge,atan:Hge,atanh:Vge,atan2:Wge,cos:Yge,cosh:jge,cot:Gge,coth:Xge,csc:Zge,csch:Kge,sec:Jge,sech:Qge,sin:e0e,sinh:t0e,tan:r0e,tanh:n0e,to:i0e,clone:s0e,format:o0e,bin:a0e,oct:y0e,hex:l0e,isNaN:f0e,isInteger:c0e,isNegative:h0e,isNumeric:d0e,hasNumericValue:u0e,isPositive:p0e,isPrime:m0e,isZero:v0e,print:b0e,typeOf:x0e,numeric:g0e},zC="help",_0e=["typed","mathWithTransform","Help"],A0e=G(zC,_0e,t=>{var{typed:e,mathWithTransform:r,Help:n}=t;return e(zC,{any:function(a){var s,o=a;if(typeof a!="string"){for(s in r)if(tt(r,s)&&a===r[s]){o=s;break}}var u=ei(S0e,o);if(!u){var l=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+l+'"')}return new n(u)}})}),UC="chain",D0e=["typed","Chain"],N0e=G(UC,D0e,t=>{var{typed:e,Chain:r}=t;return e(UC,{"":function(){return new r},any:function(i){return new r(i)}})}),qC="det",E0e=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],C0e=G(qC,E0e,t=>{var{typed:e,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:o}=t;return e(qC,{any:function(c){return vt(c)},"Array | Matrix":function(c){var f;switch(dt(c)?f=c.size():Array.isArray(c)?(c=r(c),f=c.size()):f=[],f.length){case 0:return vt(c);case 1:if(f[0]===1)return vt(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Rt(f)+")");case 2:{var h=f[0],p=f[1];if(h===p)return u(c.clone().valueOf(),h);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Rt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(f)+")")}}});function u(l,c,f){if(c===1)return vt(l[0][0]);if(c===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var h=!1,p=new Array(c).fill(0).map((C,E)=>E),v=0;v{var{typed:e,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:o,identity:u,abs:l}=t;return e(HC,{"Array | Matrix":function(h){var p=dt(h)?h.size():Nt(h);switch(p.length){case 1:if(p[0]===1)return dt(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Rt(p)+")");case 2:{var v=p[0],m=p[1];if(v===m)return dt(h)?r(c(h.valueOf(),v,m),h.storage()):c(h,v,m);throw new RangeError("Matrix must be square (size: "+Rt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(p)+")")}},any:function(h){return n(1,h)}});function c(f,h,p){var v,m,b,y,S;if(h===1){if(y=f[0][0],y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,y)]]}else if(h===2){var x=o(f);if(x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],x),n(s(f[0][1]),x)],[n(s(f[1][0]),x),n(f[0][0],x)]]}else{var A=f.concat();for(v=0;vC&&(C=l(A[v][w]),E=v),v++;if(C===0)throw Error("Cannot calculate inverse, determinant is zero");v=E,v!==w&&(S=A[w],A[w]=A[v],A[v]=S,S=_[w],_[w]=_[v],_[v]=S);var N=A[w],M=_[w];for(v=0;v{var{typed:e,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:o,ctranspose:u,divideScalar:l,multiply:c,add:f,Complex:h}=t;return e(WC,{"Array | Matrix":function(x){var A=dt(x)?x.size():Nt(x);switch(A.length){case 1:return y(x)?u(x):A[0]===1?n(x):s(u(x),o(x,x));case 2:{if(y(x))return u(x);var _=A[0],w=A[1];if(_===w)try{return n(x)}catch(C){if(!(C instanceof Error&&C.message.match(/Cannot calculate inverse, determinant is zero/)))throw C}return dt(x)?r(p(x.valueOf(),_,w),x.storage()):p(x,_,w)}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(A)+")")}},any:function(x){return a(x,0)?vt(x):l(1,x)}});function p(S,x,A){var{C:_,F:w}=m(S,x,A),C=c(n(c(u(_),_)),u(_)),E=c(u(w),n(c(w,u(w))));return c(E,C)}function v(S,x,A){for(var _=vt(S),w=0,C=0;CE.filter((M,O)=>O!b(o(_[N],_[N])));return{C:w,F:C}}function b(S){return a(f(S,h(1,1)),f(0,h(1,1)))}function y(S){return i(f(S,h(1,1)),f(c(S,0),h(1,1)))}});function R0e(t){var{addScalar:e,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:o,abs:u,bignumber:l,diag:c,size:f,reshape:h,inv:p,qr:v,usolve:m,usolveAll:b,equal:y,complex:S,larger:x,smaller:A,matrixFromColumns:_,dot:w}=t;function C(ne,X,de,Se){var ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,xe=E(ne,X,de,Se,ce);N(ne,X,de,Se,ce,xe);var{values:_e,C:me}=M(ne,X,de,Se,ce);if(ce){var we=O(ne,X,me,xe,_e,de,Se);return{values:_e,eigenvectors:we}}return{values:_e}}function E(ne,X,de,Se,ce){var xe=Se==="BigNumber",_e=Se==="Complex",me=xe?l(0):0,we=xe?l(1):_e?S(1):1,Ne=xe?l(1):1,Ce=xe?l(10):2,He=a(Ce,Ce),qe;ce&&(qe=Array(X).fill(we));for(var J=!1;!J;){J=!0;for(var te=0;te1&&(J=c(Array(Ce-1).fill(me)))),Ce-=1,we.pop();for(var Me=0;Me2&&(J=c(Array(Ce-2).fill(me)))),Ce-=2,we.pop(),we.pop();for(var q=0;q+r(u(ge),u(De))),te>100){var Y=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+Ne.join(", "));throw Y.values=Ne,Y.vectors=[],Y}var pe=ce?i(qe,H(He,X)):void 0;return{values:Ne,C:pe}}function O(ne,X,de,Se,ce,xe,_e){var me=p(de),we=i(me,ne,de),Ne=_e==="BigNumber",Ce=_e==="Complex",He=Ne?l(0):Ce?S(0):0,qe=Ne?l(1):Ce?S(1):1,J=[],te=[];for(var ye of ce){var ee=I(J,ye,y);ee===-1?(J.push(ye),te.push(1)):te[ee]+=1}for(var ue=[],le=J.length,Ee=Array(X).fill(He),Me=c(Array(X).fill(qe)),R=function(){var pe=J[q],ge=r(we,i(pe,Me)),De=b(ge,Ee);for(De.shift();De.lengthi(Pe,Ve)),ue.push(...De.map(Ve=>({value:pe,vector:n(Ve)})))},q=0;q=5)return null;for(me=0;;){var we=m(ne,_e);if(A(se($(_e,[we])),Se))break;if(++me>=10)return null;_e=he(we)}return _e}function K(ne,X,de){var Se=de==="BigNumber",ce=de==="Complex",xe=Array(ne).fill(0).map(_e=>2*Math.random()-1);return Se&&(xe=xe.map(_e=>l(_e))),ce&&(xe=xe.map(_e=>S(_e))),xe=$(xe,X),he(xe,de)}function $(ne,X){var de=f(ne);for(var Se of X)Se=h(Se,de),ne=r(ne,i(s(w(Se,ne),w(Se,Se)),Se));return ne}function se(ne){return u(o(w(ne,ne)))}function he(ne,X){var de=X==="BigNumber",Se=X==="Complex",ce=de?l(1):Se?S(1):1;return i(s(ce,se(ne)),ne)}return C}function B0e(t){var{config:e,addScalar:r,subtract:n,abs:i,atan:a,cos:s,sin:o,multiplyScalar:u,inv:l,bignumber:c,multiply:f,add:h}=t;function p(N,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.epsilon,F=arguments.length>3?arguments[3]:void 0,U=arguments.length>4?arguments[4]:void 0;if(F==="number")return v(N,O,U);if(F==="BigNumber")return m(N,O,U);throw TypeError("Unsupported data type: "+F)}function v(N,M,O){var F=N.length,U=Math.abs(M/F),V,H;if(O){H=new Array(F);for(var I=0;I=Math.abs(U);){var K=P[0][0],$=P[0][1];V=b(N[K][K],N[$][$],N[K][$]),N=_(N,V,K,$),O&&(H=S(H,V,K,$)),P=w(N)}for(var se=Array(F).fill(0),he=0;he=i(U);){var K=P[0][0],$=P[0][1];V=y(N[K][K],N[$][$],N[K][$]),N=A(N,V,K,$),O&&(H=x(H,V,K,$)),P=C(N)}for(var se=Array(F).fill(0),he=0;he({value:U[X],vector:ne}));return{values:U,eigenvectors:he}}return p}var P0e="eigs",I0e=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],k0e=G(P0e,I0e,t=>{var{config:e,typed:r,matrix:n,addScalar:i,subtract:a,equal:s,abs:o,atan:u,cos:l,sin:c,multiplyScalar:f,divideScalar:h,inv:p,bignumber:v,multiply:m,add:b,larger:y,column:S,flatten:x,number:A,complex:_,sqrt:w,diag:C,size:E,reshape:N,qr:M,usolve:O,usolveAll:F,im:U,re:V,smaller:H,matrixFromColumns:I,dot:P}=t,K=B0e({config:e,addScalar:i,subtract:a,column:S,flatten:x,equal:s,abs:o,atan:u,cos:l,sin:c,multiplyScalar:f,inv:p,bignumber:v,complex:_,multiply:m,add:b}),$=R0e({config:e,addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:x,divideScalar:h,sqrt:w,abs:o,bignumber:v,diag:C,size:E,reshape:N,qr:M,inv:p,usolve:O,usolveAll:F,equal:s,complex:_,larger:y,smaller:H,matrixFromColumns:I,dot:P});return r("eigs",{Array:function(xe){return se(n(xe))},"Array, number|BigNumber":function(xe,_e){return se(n(xe),{precision:_e})},"Array, Object"(ce,xe){return se(n(ce),xe)},Matrix:function(xe){return se(xe,{matricize:!0})},"Matrix, number|BigNumber":function(xe,_e){return se(xe,{precision:_e,matricize:!0})},"Matrix, Object":function(xe,_e){var me={matricize:!0};return dn(me,_e),se(xe,me)}});function se(ce){var xe,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me="eigenvectors"in _e?_e.eigenvectors:!0,we=(xe=_e.precision)!==null&&xe!==void 0?xe:e.epsilon,Ne=he(ce,we,me);return _e.matricize&&(Ne.values=n(Ne.values),me&&(Ne.eigenvectors=Ne.eigenvectors.map(Ce=>{var{value:He,vector:qe}=Ce;return{value:He,vector:n(qe)}}))),me&&Object.defineProperty(Ne,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),Ne}function he(ce,xe,_e){var me=ce.toArray(),we=ce.size();if(we.length!==2||we[0]!==we[1])throw new RangeError("Matrix must be square (size: ".concat(Rt(we),")"));var Ne=we[0];if(X(me,Ne,xe)&&(de(me,Ne),ne(me,Ne,xe))){var Ce=Se(ce,me,Ne);return K(me,Ne,xe,Ce,_e)}var He=Se(ce,me,Ne);return $(me,Ne,xe,He,_e)}function ne(ce,xe,_e){for(var me=0;me{var{typed:e,abs:r,add:n,identity:i,inv:a,multiply:s}=t;return e(VC,{Matrix:function(f){var h=f.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Rt(h)+")");for(var p=h[0],v=1e-15,m=o(f),b=u(m,v),y=b.q,S=b.j,x=s(f,Math.pow(2,-S)),A=i(p),_=i(p),w=1,C=x,E=-1,N=1;N<=y;N++)N>1&&(C=s(C,x),E=-E),w=w*(y-N+1)/((2*y-N+1)*N),A=n(A,s(w,C)),_=n(_,s(w*E,C));for(var M=s(a(_),A),O=0;O{var{typed:e,abs:r,add:n,multiply:i,map:a,sqrt:s,subtract:o,inv:u,size:l,max:c,identity:f}=t,h=1e3,p=1e-6;function v(m){var b,y=0,S=m,x=f(l(m));do{var A=S;if(S=i(.5,n(A,u(x))),x=i(.5,n(x,u(A))),b=c(r(o(S,A))),b>p&&++y>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(b>p);return S}return e(YC,{"Array | Matrix":function(b){var y=dt(b)?b.size():Nt(b);switch(y.length){case 1:if(y[0]===1)return a(b,s);throw new RangeError("Matrix must be square (size: "+Rt(y)+")");case 2:{var S=y[0],x=y[1];if(S===x)return v(b);throw new RangeError("Matrix must be square (size: "+Rt(y)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Rt(y)+")")}}})}),jC="sylvester",q0e=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],H0e=G(jC,q0e,t=>{var{typed:e,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:o,transpose:u,index:l,subset:c,add:f,subtract:h,identity:p,lusolve:v,abs:m}=t;return e(jC,{"Matrix, Matrix, Matrix":b,"Array, Matrix, Matrix":function(S,x,A){return b(i(S),x,A)},"Array, Array, Matrix":function(S,x,A){return b(i(S),i(x),A)},"Array, Matrix, Array":function(S,x,A){return b(i(S),x,i(A))},"Matrix, Array, Matrix":function(S,x,A){return b(S,i(x),A)},"Matrix, Array, Array":function(S,x,A){return b(S,i(x),i(A))},"Matrix, Matrix, Array":function(S,x,A){return b(S,x,i(A))},"Array, Array, Array":function(S,x,A){return b(i(S),i(x),i(A)).toArray()}});function b(y,S,x){for(var A=S.size()[0],_=y.size()[0],w=r(y),C=w.T,E=w.U,N=r(a(-1,S)),M=N.T,O=N.U,F=a(a(u(E),x),O),U=s(0,_),V=[],H=(Ce,He)=>o(Ce,He,1),I=(Ce,He)=>o(Ce,He,0),P=0;P1e-5){for(var K=I(c(F,l(U,P)),c(F,l(U,P+1))),$=0;${var{typed:e,matrix:r,identity:n,multiply:i,qr:a,norm:s,subtract:o}=t;return e(GC,{Array:function(c){var f=u(r(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return u(c)}});function u(l){var c=l.size()[0],f=l,h=n(c),p=0,v;do{v=f;var m=a(f),b=m.Q,y=m.R;if(f=i(y,b),h=i(h,b),p++>100)break}while(s(o(f,v))>1e-4);return{U:h,T:f}}}),XC="lyap",Y0e=["typed","matrix","sylvester","multiply","transpose"],j0e=G(XC,Y0e,t=>{var{typed:e,matrix:r,sylvester:n,multiply:i,transpose:a}=t;return e(XC,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),G0e="divide",X0e=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Z0e=G(G0e,X0e,t=>{var{typed:e,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:s}=t,o=Fn({typed:e,equalScalar:i}),u=Oa({typed:e});return e("divide",KR({"Array | Matrix, Array | Matrix":function(c,f){return n(c,s(f))},"DenseMatrix, any":function(c,f){return u(c,f,a,!1)},"SparseMatrix, any":function(c,f){return o(c,f,a,!1)},"Array, any":function(c,f){return u(r(c),f,a,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,s(f))}},a.signatures))}),ZC="distance",K0e=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],J0e=G(ZC,K0e,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:o,abs:u}=t;return e(ZC,{"Array, Array, Array":function(_,w,C){if(_.length===2&&w.length===2&&C.length===2){if(!c(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(w,C))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(C[1],w[1]),N=n(w[0],C[0]),M=n(i(C[0],w[1]),i(w[0],C[1]));return b(_[0],_[1],E,N,M)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(_,w,C){if(Object.keys(_).length===2&&Object.keys(w).length===2&&Object.keys(C).length===2){if(!c(_))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(w))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(C))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(v(w),v(C)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in _&&"pointY"in _&&"lineOnePtX"in w&&"lineOnePtY"in w&&"lineTwoPtX"in C&&"lineTwoPtY"in C){var E=n(C.lineTwoPtY,w.lineOnePtY),N=n(w.lineOnePtX,C.lineTwoPtX),M=n(i(C.lineTwoPtX,w.lineOnePtY),i(w.lineOnePtX,C.lineTwoPtY));return b(_.pointX,_.pointY,E,N,M)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(_,w){if(_.length===2&&w.length===3){if(!c(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(w))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return b(_[0],_[1],w[0],w[1],w[2])}else if(_.length===3&&w.length===6){if(!f(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!p(w))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(_[0],_[1],_[2],w[0],w[1],w[2],w[3],w[4],w[5])}else if(_.length===w.length&&_.length>0){if(!h(_))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(w))throw new TypeError("All values of an array should be numbers or BigNumbers");return S(_,w)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(_,w){if(Object.keys(_).length===2&&Object.keys(w).length===3){if(!c(_))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(w))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in _&&"pointY"in _&&"xCoeffLine"in w&&"yCoeffLine"in w&&"constant"in w)return b(_.pointX,_.pointY,w.xCoeffLine,w.yCoeffLine,w.constant);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===3&&Object.keys(w).length===6){if(!f(_))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!p(w))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in _&&"pointY"in _&&"x0"in w&&"y0"in w&&"z0"in w&&"a"in w&&"b"in w&&"c"in w)return y(_.pointX,_.pointY,_.pointZ,w.x0,w.y0,w.z0,w.a,w.b,w.c);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===2&&Object.keys(w).length===2){if(!c(_))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(w))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in _&&"pointOneY"in _&&"pointTwoX"in w&&"pointTwoY"in w)return S([_.pointOneX,_.pointOneY],[w.pointTwoX,w.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===3&&Object.keys(w).length===3){if(!f(_))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(w))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in _&&"pointOneY"in _&&"pointOneZ"in _&&"pointTwoX"in w&&"pointTwoY"in w&&"pointTwoZ"in w)return S([_.pointOneX,_.pointOneY,_.pointOneZ],[w.pointTwoX,w.pointTwoY,w.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(_){if(!m(_))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return x(_)}});function l(A){return typeof A=="number"||Mt(A)}function c(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])}function f(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])&&l(A[2])}function h(A){return Array.isArray(A)||(A=v(A)),A.every(l)}function p(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])&&l(A[2])&&l(A[3])&&l(A[4])&&l(A[5])}function v(A){for(var _=Object.keys(A),w=[],C=0;C<_.length;C++)w.push(A[_[C]]);return w}function m(A){if(A[0].length===2&&l(A[0][0])&&l(A[0][1])){if(A.some(_=>_.length!==2||!l(_[0])||!l(_[1])))return!1}else if(A[0].length===3&&l(A[0][0])&&l(A[0][1])&&l(A[0][2])){if(A.some(_=>_.length!==3||!l(_[0])||!l(_[1])||!l(_[2])))return!1}else return!1;return!0}function b(A,_,w,C,E){var N=u(r(r(i(w,A),i(C,_)),E)),M=o(r(i(w,w),i(C,C)));return a(N,M)}function y(A,_,w,C,E,N,M,O,F){var U=[n(i(n(E,_),F),i(n(N,w),O)),n(i(n(N,w),M),i(n(C,A),F)),n(i(n(C,A),O),i(n(E,_),M))];U=o(r(r(i(U[0],U[0]),i(U[1],U[1])),i(U[2],U[2])));var V=o(r(r(i(M,M),i(O,O)),i(F,F)));return a(U,V)}function S(A,_){for(var w=A.length,C=0,E=0,N=0;N{var{typed:e,config:r,abs:n,add:i,addScalar:a,matrix:s,multiply:o,multiplyScalar:u,divideScalar:l,subtract:c,smaller:f,equalScalar:h,flatten:p,isZero:v,isNumeric:m}=t;return e("intersect",{"Array, Array, Array":b,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(O,F,U){var V=b(O.valueOf(),F.valueOf(),U.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(O,F,U,V){var H=y(O.valueOf(),F.valueOf(),U.valueOf(),V.valueOf());return H===null?null:s(H)}});function b(M,O,F){if(M=S(M),O=S(O),F=S(F),!A(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!_(F))throw new TypeError("Array with 4 numbers expected as third argument");return N(M[0],M[1],M[2],O[0],O[1],O[2],F[0],F[1],F[2],F[3])}function y(M,O,F,U){if(M=S(M),O=S(O),F=S(F),U=S(U),M.length===2){if(!x(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(U))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return w(M,O,F,U)}else if(M.length===3){if(!A(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(F))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return E(M[0],M[1],M[2],O[0],O[1],O[2],F[0],F[1],F[2],U[0],U[1],U[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function S(M){return M.length===1?M[0]:M.length>1&&Array.isArray(M[0])&&M.every(O=>Array.isArray(O)&&O.length===1)?p(M):M}function x(M){return M.length===2&&m(M[0])&&m(M[1])}function A(M){return M.length===3&&m(M[0])&&m(M[1])&&m(M[2])}function _(M){return M.length===4&&m(M[0])&&m(M[1])&&m(M[2])&&m(M[3])}function w(M,O,F,U){var V=M,H=F,I=c(V,O),P=c(H,U),K=c(u(I[0],P[1]),u(P[0],I[1]));if(v(K)||f(n(K),r.epsilon))return null;var $=u(P[0],V[1]),se=u(P[1],V[0]),he=u(P[0],H[1]),ne=u(P[1],H[0]),X=l(a(c(c($,se),he),ne),K);return i(o(I,X),V)}function C(M,O,F,U,V,H,I,P,K,$,se,he){var ne=u(c(M,O),c(F,U)),X=u(c(V,H),c(I,P)),de=u(c(K,$),c(se,he));return a(a(ne,X),de)}function E(M,O,F,U,V,H,I,P,K,$,se,he){var ne=C(M,I,$,I,O,P,se,P,F,K,he,K),X=C($,I,U,M,se,P,V,O,he,K,H,F),de=C(M,I,U,M,O,P,V,O,F,K,H,F),Se=C($,I,$,I,se,P,se,P,he,K,he,K),ce=C(U,M,U,M,V,O,V,O,H,F,H,F),xe=c(u(ne,X),u(de,Se)),_e=c(u(ce,Se),u(X,X));if(v(_e))return null;var me=l(xe,_e),we=l(a(ne,u(me,X)),Se),Ne=a(M,u(me,c(U,M))),Ce=a(O,u(me,c(V,O))),He=a(F,u(me,c(H,F))),qe=a(I,u(we,c($,I))),J=a(P,u(we,c(se,P))),te=a(K,u(we,c(he,K)));return h(Ne,qe)&&h(Ce,J)&&h(He,te)?[Ne,Ce,He]:null}function N(M,O,F,U,V,H,I,P,K,$){var se=u(M,I),he=u(U,I),ne=u(O,P),X=u(V,P),de=u(F,K),Se=u(H,K),ce=c(c(c($,se),ne),de),xe=c(c(c(a(a(he,X),Se),se),ne),de),_e=l(ce,xe),me=a(M,u(_e,c(U,M))),we=a(O,u(_e,c(V,O))),Ne=a(F,u(_e,c(H,F)));return[me,we,Ne]}}),KC="sum",rye=["typed","config","add","numeric"],QP=G(KC,rye,t=>{var{typed:e,config:r,add:n,numeric:i}=t;return e(KC,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(u){if(Ec(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(o){var u;return Ws(o,function(l){try{u=u===void 0?l:n(u,l)}catch(c){throw ii(c,"sum",l)}}),u===void 0&&(u=i(0,r.number)),typeof u=="string"&&(u=i(u,r.number)),u}function s(o,u){try{var l=Pg(o,u,n);return l}catch(c){throw ii(c,"sum")}}}),gm="cumsum",nye=["typed","add","unaryPlus"],eI=G(gm,nye,t=>{var{typed:e,add:r,unaryPlus:n}=t;return e(gm,{Array:i,Matrix:function(l){return l.create(i(l.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(l,c){return l.create(s(l.valueOf(),c))},"...":function(l){if(Ec(l))throw new TypeError("All values expected to be scalar in function cumsum");return i(l)}});function i(u){try{return a(u)}catch(l){throw ii(l,gm)}}function a(u){if(u.length===0)return[];for(var l=[n(u[0])],c=1;c=c.length)throw new Ma(l,c.length);try{return o(u,l)}catch(f){throw ii(f,gm)}}function o(u,l){var c,f,h;if(l<=0){var p=u[0][0];if(Array.isArray(p)){for(h=RB(u),f=[],c=0;c{var{typed:e,add:r,divide:n}=t;return e(JC,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Ec(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(s,o){try{var u=Pg(s,o,r),l=Array.isArray(s)?Nt(s):s.size();return n(u,l[o])}catch(c){throw ii(c,"mean")}}function a(s){var o,u=0;if(Ws(s,function(l){try{o=o===void 0?l:r(o,l),u++}catch(c){throw ii(c,"mean",l)}}),u===0)throw new Error("Cannot calculate the mean of an empty array");return n(o,u)}}),QC="median",aye=["typed","add","divide","compare","partitionSelect"],sye=G(QC,aye,t=>{var{typed:e,add:r,divide:n,compare:i,partitionSelect:a}=t;function s(l){try{l=tr(l.valueOf());var c=l.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,h=a(l,f+1),p=l[f],v=0;v0&&(p=l[v]);return u(p,h)}else{var m=a(l,(c-1)/2);return o(m)}}catch(b){throw ii(b,"median")}}var o=e({"number | BigNumber | Complex | Unit":function(c){return c}}),u=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(r(c,f),2)}});return e(QC,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Ec(c))throw new TypeError("Scalar values expected in function median");return s(c)}})}),eM="mad",oye=["typed","abs","map","median","subtract"],uye=G(eM,oye,t=>{var{typed:e,abs:r,map:n,median:i,subtract:a}=t;return e(eM,{"Array | Matrix":s,"...":function(u){return s(u)}});function s(o){if(o=tr(o.valueOf()),o.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var u=i(o);return i(n(o,function(l){return r(a(l,u))}))}catch(l){throw l instanceof TypeError&&l.message.indexOf("median")!==-1?new TypeError(l.message.replace("median","mad")):ii(l,"mad")}}}),Gy="unbiased",tM="variance",lye=["typed","add","subtract","multiply","divide","apply","isNaN"],rI=G(tM,lye,t=>{var{typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o}=t;return e(tM,{"Array | Matrix":function(f){return u(f,Gy)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(f,h){return l(f,h,Gy)},"Array | Matrix, number | BigNumber, string":l,"...":function(f){return u(f,Gy)}});function u(c,f){var h,p=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Ws(c,function(b){try{h=h===void 0?b:r(h,b),p++}catch(y){throw ii(y,"variance",b)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var v=a(h,p);if(h=void 0,Ws(c,function(b){var y=n(b,v);h=h===void 0?i(y,y):r(h,i(y,y))}),o(h))return h;switch(f){case"uncorrected":return a(h,p);case"biased":return a(h,p+1);case"unbiased":{var m=Mt(h)?h.mul(0):0;return p===1?m:a(h,p-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(c,f,h){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(c,f,p=>u(p,h))}catch(p){throw ii(p,"variance")}}}),rM="quantileSeq",cye=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],nI=G(rM,cye,t=>{var{typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h}=t,p=nw({typed:e,isInteger:l});return e(rM,{"Array | Matrix, number | BigNumber":(S,x)=>m(S,x,!1),"Array | Matrix, number | BigNumber, number":(S,x,A)=>v(S,x,!1,A,m),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(S,x,A,_)=>v(S,x,A,_,m),"Array | Matrix, Array | Matrix":(S,x)=>b(S,x,!1),"Array | Matrix, Array | Matrix, number":(S,x,A)=>v(S,x,!1,A,b),"Array | Matrix, Array | Matrix, boolean":b,"Array | Matrix, Array | Matrix, boolean, number":(S,x,A,_)=>v(S,x,A,_,b)});function v(S,x,A,_,w){return p(S,_,C=>w(C,x,A))}function m(S,x,A){var _,w=S.valueOf();if(c(x,0))throw new Error("N/prob must be non-negative");if(f(x,1))return Ct(x)?y(w,x,A):r(y(w,x,A));if(h(x,1)){if(!l(x))throw new Error("N must be a positive integer");if(h(x,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var C=n(x,1);_=[];for(var E=0;c(E,x);E++){var N=a(E+1,C);_.push(y(w,N,A))}return Ct(x)?_:r(_)}}function b(S,x,A){for(var _=S.valueOf(),w=x.valueOf(),C=[],E=0;E0&&(M=_[F])}return n(s(M,i(1,N)),s(O,N))}}),nM="std",fye=["typed","map","sqrt","variance"],iI=G(nM,fye,t=>{var{typed:e,map:r,sqrt:n,variance:i}=t;return e(nM,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(s,o){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var u=i.apply(null,arguments);return na(u)?r(u,n):n(u)}catch(l){throw l instanceof TypeError&&l.message.indexOf(" variance")!==-1?new TypeError(l.message.replace(" variance"," std")):l}}}),iM="corr",hye=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],dye=G(iM,hye,t=>{var{typed:e,matrix:r,sqrt:n,sum:i,add:a,subtract:s,multiply:o,pow:u,divide:l}=t;return e(iM,{"Array, Array":function(p,v){return c(p,v)},"Matrix, Matrix":function(p,v){var m=c(p.toArray(),v.toArray());return Array.isArray(m)?r(m):m}});function c(h,p){var v=[];if(Array.isArray(h[0])&&Array.isArray(p[0])){if(h.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var m=0;ma(w,o(C,p[E])),0),S=i(h.map(w=>u(w,2))),x=i(p.map(w=>u(w,2))),A=s(o(v,y),o(m,b)),_=n(o(s(o(v,S),u(m,2)),s(o(v,x),u(b,2))));return l(A,_)}}),aM="combinations",pye=["typed"],mye=G(aM,pye,t=>{var{typed:e}=t;return e(aM,{"number, number":rP,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,o,u=n.minus(i),l=new a(1);if(!sM(n)||!sM(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=l,i.lt(u))for(o=l;o.lte(u);o=o.plus(l))s=s.times(i.plus(o)).dividedBy(o);else for(o=l;o.lte(i);o=o.plus(l))s=s.times(u.plus(o)).dividedBy(o);return s}})});function sM(t){return t.isInteger()&&t.gte(0)}var oM="combinationsWithRep",vye=["typed"],gye=G(oM,vye,t=>{var{typed:e}=t;return e(oM,{"number, number":function(n,i){if(!ot(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!ot(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:e,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=t;function o(l){if(l.im===0)return Dv(l.re);if(l.re<.5){var c=new s(1-l.re,-l.im),f=new s(Math.PI*l.re,Math.PI*l.im);return new s(Math.PI).div(f.sin()).div(o(c))}l=new s(l.re-1,l.im);for(var h=new s(Ql[0],0),p=1;p2;)h-=2,v+=h,p=p.times(v);return new a(p.toPrecision(a.precision))}}),cM="lgamma",xye=["Complex","typed"],wye=G(cM,xye,t=>{var{Complex:e,typed:r}=t,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(cM,{number:Nv,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(l){var c=6.283185307179586,f=1.1447298858494002,h=.1;if(l.isNaN())return new e(NaN,NaN);if(l.im===0)return new e(Nv(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return o(l);if(l.re<=h){var p=hre(c,l.im)*Math.floor(.5*l.re+.25),v=l.mul(Math.PI).sin().log(),m=s(new e(1-l.re,-l.im));return new e(f,p).sub(v).sub(m)}else return l.im>=0?u(l):u(l.conjugate()).conjugate()}function o(l){for(var c=l.sub(.5).mul(l.log()).sub(l).add(uP),f=new e(1,0).div(l),h=f.div(l),p=a[0],v=a[1],m=2*h.re,b=h.re*h.re+h.im*h.im,y=2;y<8;y++){var S=v;v=-b*p+a[y],p=m*p+S}var x=f.mul(h.mul(p).add(v));return c.add(x)}function u(l){var c=0,f=0,h=l;for(l=l.add(1);l.re<=n;){h=h.mul(l);var p=h.im<0?1:0;p!==0&&f===0&&c++,f=p,l=l.add(1)}return o(l).sub(h.log()).sub(new e(0,c*2*Math.PI*1))}}),fM="factorial",Sye=["typed","gamma"],_ye=G(fM,Sye,t=>{var{typed:e,gamma:r}=t;return e(fM,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),hM="kldivergence",Aye=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Dye=G(hM,Aye,t=>{var{typed:e,matrix:r,divide:n,sum:i,multiply:a,map:s,dotDivide:o,log:u,isNumeric:l}=t;return e(hM,{"Array, Array":function(h,p){return c(r(h),r(p))},"Matrix, Array":function(h,p){return c(h,r(p))},"Array, Matrix":function(h,p){return c(r(h),p)},"Matrix, Matrix":function(h,p){return c(h,p)}});function c(f,h){var p=h.size().length,v=f.size().length;if(p>1)throw new Error("first object must be one dimensional");if(v>1)throw new Error("second object must be one dimensional");if(p!==v)throw new Error("Length of two vectors must be equal");var m=i(f);if(m===0)throw new Error("Sum of elements in first object must be non zero");var b=i(h);if(b===0)throw new Error("Sum of elements in second object must be non zero");var y=n(f,i(f)),S=n(h,i(h)),x=i(a(y,s(o(y,S),A=>u(A))));return l(x)?x:Number.NaN}}),dM="multinomial",Nye=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Eye=G(dM,Nye,t=>{var{typed:e,add:r,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:o}=t;return e(dM,{"Array | Matrix":function(l){var c=0,f=1;return Ws(l,function(h){if(!s(h)||!o(h))throw new TypeError("Positive integer value expected in function multinomial");c=r(c,h),f=i(f,a(h))}),n(a(c),f)}})}),pM="permutations",Cye=["typed","factorial"],Mye=G(pM,Cye,t=>{var{typed:e,factorial:r}=t;return e(pM,{"number | BigNumber":r,"number, number":function(i,a){if(!ot(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!ot(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Ps(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,o;if(!mM(i)||!mM(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var u=i.mul(0).add(1);for(s=u,o=i.minus(a).plus(1);o.lte(i);o=o.plus(1))s=s.times(o);return s}})});function mM(t){return t.isInteger()&&t.gte(0)}var cw={exports:{}};cw.exports;(function(t){(function(e,r,n){function i(u){var l=this,c=o();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=c(" "),l.s1=c(" "),l.s2=c(" "),l.s0-=c(u),l.s0<0&&(l.s0+=1),l.s1-=c(u),l.s1<0&&(l.s1+=1),l.s2-=c(u),l.s2<0&&(l.s2+=1),c=null}function a(u,l){return l.c=u.c,l.s0=u.s0,l.s1=u.s1,l.s2=u.s2,l}function s(u,l){var c=new i(u),f=l&&l.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,f&&(typeof f=="object"&&a(f,c),h.state=function(){return a(c,{})}),h}function o(){var u=4022871197,l=function(c){c=String(c);for(var f=0;f>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.alea=s})(Zi,t,!1)})(cw);var Tye=cw.exports,fw={exports:{}};fw.exports;(function(t){(function(e,r,n){function i(o){var u=this,l="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},o===(o|0)?u.x=o:l+=o;for(var c=0;c>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xor128=s})(Zi,t,!1)})(fw);var Oye=fw.exports,hw={exports:{}};hw.exports;(function(t){(function(e,r,n){function i(o){var u=this,l="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,o===(o|0)?u.x=o:l+=o;for(var c=0;c>>4),u.next()}function a(o,u){return u.x=o.x,u.y=o.y,u.z=o.z,u.w=o.w,u.v=o.v,u.d=o.d,u}function s(o,u){var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xorwow=s})(Zi,t,!1)})(hw);var Fye=hw.exports,dw={exports:{}};dw.exports;(function(t){(function(e,r,n){function i(o){var u=this;u.next=function(){var c=u.x,f=u.i,h,p;return h=c[f],h^=h>>>7,p=h^h<<24,h=c[f+1&7],p^=h^h>>>10,h=c[f+3&7],p^=h^h>>>3,h=c[f+4&7],p^=h^h<<7,h=c[f+7&7],h=h^h<<13,p^=h^h<<9,c[f]=p,u.i=f+1&7,p};function l(c,f){var h,p=[];if(f===(f|0))p[0]=f;else for(f=""+f,h=0;h0;--h)c.next()}l(u,o)}function a(o,u){return u.x=o.x.slice(),u.i=o.i,u}function s(o,u){o==null&&(o=+new Date);var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(c.x&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xorshift7=s})(Zi,t,!1)})(dw);var Rye=dw.exports,pw={exports:{}};pw.exports;(function(t){(function(e,r,n){function i(o){var u=this;u.next=function(){var c=u.w,f=u.X,h=u.i,p,v;return u.w=c=c+1640531527|0,v=f[h+34&127],p=f[h=h+1&127],v^=v<<13,p^=p<<17,v^=v>>>15,p^=p>>>12,v=f[h]=v^p,u.i=h,v+(c^c>>>16)|0};function l(c,f){var h,p,v,m,b,y=[],S=128;for(f===(f|0)?(p=f,f=null):(f=f+"\0",p=0,S=Math.max(S,f.length)),v=0,m=-32;m>>15,p^=p<<4,p^=p>>>13,m>=0&&(b=b+1640531527|0,h=y[m&127]^=p+b,v=h==0?v+1:0);for(v>=128&&(y[(f&&f.length||0)&127]=-1),v=127,m=4*128;m>0;--m)p=y[v+34&127],h=y[v=v+1&127],p^=p<<13,h^=h<<17,p^=p>>>15,h^=h>>>12,y[v]=p^h;c.w=b,c.X=y,c.i=v}l(u,o)}function a(o,u){return u.i=o.i,u.w=o.w,u.X=o.X.slice(),u}function s(o,u){o==null&&(o=+new Date);var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(c.X&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xor4096=s})(Zi,t,!1)})(pw);var Bye=pw.exports,mw={exports:{}};mw.exports;(function(t){(function(e,r,n){function i(o){var u=this,l="";u.next=function(){var f=u.b,h=u.c,p=u.d,v=u.a;return f=f<<25^f>>>7^h,h=h-p|0,p=p<<24^p>>>8^v,v=v-f|0,u.b=f=f<<20^f>>>12^h,u.c=h=h-p|0,u.d=p<<16^h>>>16^v,u.a=v-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,o===Math.floor(o)?(u.a=o/4294967296|0,u.b=o|0):l+=o;for(var c=0;c>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.tychei=s})(Zi,t,!1)})(mw);var Pye=mw.exports,aI={exports:{}};const Iye={},kye=Object.freeze(Object.defineProperty({__proto__:null,default:Iye},Symbol.toStringTag,{value:"Module"})),Lye=w$(kye);(function(t){(function(e,r,n){var i=256,a=6,s=52,o="random",u=n.pow(i,a),l=n.pow(2,s),c=l*2,f=i-1,h;function p(A,_,w){var C=[];_=_==!0?{entropy:!0}:_||{};var E=y(b(_.entropy?[A,x(r)]:A??S(),3),C),N=new v(C),M=function(){for(var O=N.g(a),F=u,U=0;O=c;)O/=2,F/=2,U>>>=1;return(O+U)/F};return M.int32=function(){return N.g(4)|0},M.quick=function(){return N.g(4)/4294967296},M.double=M,y(x(N.S),r),(_.pass||w||function(O,F,U,V){return V&&(V.S&&m(V,N),O.state=function(){return m(N,{})}),U?(n[o]=O,F):O})(M,E,"global"in _?_.global:this==n,_.state)}function v(A){var _,w=A.length,C=this,E=0,N=C.i=C.j=0,M=C.S=[];for(w||(A=[w++]);E{var{typed:e,config:r,on:n}=t,i=yc(r.randomSeed);return n&&n("config",function(s,o){s.randomSeed!==o.randomSeed&&(i=yc(s.randomSeed))}),e(vM,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,l){return a(o,{number:l,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,l){return a(o,{number:u,weights:l})}});function a(s,o){var{number:u,weights:l,elementWise:c=!0}=o,f=typeof u>"u";f&&(u=1);var h=dt(s)?s.create:dt(l)?l.create:null;s=s.valueOf(),l&&(l=l.valueOf()),c===!0&&(s=tr(s),l=tr(l));var p=0;if(typeof l<"u"){if(l.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var v=0,m=l.length;v"u")S=s[Math.floor(i()*b)];else for(var x=i()*p,A=0,_=s.length;A<_;A++)if(x-=l[A],x<0){S=s[A];break}y.push(S)}return f?y[0]:h?h(y):y}});function vw(t,e){var r=[];if(t=t.slice(0),t.length>1)for(var n=0,i=t.shift();n{var{typed:e,config:r,on:n}=t,i=yc(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=yc(o.randomSeed))}),e(gM,{"":()=>s(0,1),number:o=>s(0,o),"number, number":(o,u)=>s(o,u),"Array | Matrix":o=>a(o,0,1),"Array | Matrix, number":(o,u)=>a(o,0,u),"Array | Matrix, number, number":(o,u,l)=>a(o,u,l)});function a(o,u,l){var c=vw(o.valueOf(),()=>s(u,l));return dt(o)?o.create(c):c}function s(o,u){return o+i()*(u-o)}}),yM="randomInt",Jye=["typed","config","?on"],Qye=G(yM,Jye,t=>{var{typed:e,config:r,on:n}=t,i=yc(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=yc(o.randomSeed))}),e(yM,{"":()=>s(0,1),number:o=>s(0,o),"number, number":(o,u)=>s(o,u),"Array | Matrix":o=>a(o,0,1),"Array | Matrix, number":(o,u)=>a(o,0,u),"Array | Matrix, number, number":(o,u,l)=>a(o,u,l)});function a(o,u,l){var c=vw(o.valueOf(),()=>s(u,l));return dt(o)?o.create(c):c}function s(o,u){return Math.floor(o+i()*(u-o))}}),bM="stirlingS2",ebe=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],tbe=G(bM,ebe,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:o,combinations:u,isNegative:l,isInteger:c,number:f,bignumber:h,larger:p}=t,v=[],m=[];return e(bM,{"number | BigNumber, number | BigNumber":function(y,S){if(!c(y)||l(y)||!c(S)||l(S))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(S,y))throw new TypeError("k must be less than or equal to n in function stirlingS2");var x=!(Ct(y)&&Ct(S)),A=x?m:v,_=x?h:f,w=f(y),C=f(S);if(A[w]&&A[w].length>C)return A[w][C];for(var E=0;E<=w;++E)if(A[E]||(A[E]=[_(E===0?1:0)]),E!==0)for(var N=A[E],M=A[E-1],O=N.length;O<=E&&O<=C;++O)O===E?N[O]=1:N[O]=r(i(_(O),M[O]),M[O-1]);return A[w][C]}})}),xM="bellNumbers",rbe=["typed","addScalar","isNegative","isInteger","stirlingS2"],nbe=G(xM,rbe,t=>{var{typed:e,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=t;return e(xM,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,l=0;l<=o;l++)u=r(u,a(o,l));return u}})}),wM="catalan",ibe=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],abe=G(wM,ibe,t=>{var{typed:e,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:o}=t;return e(wM,{"number | BigNumber":function(l){if(!o(l)||s(l))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(l,2),l),r(l,1))}})}),SM="composition",sbe=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],obe=G(SM,sbe,t=>{var{typed:e,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:o}=t;return e(SM,{"number | BigNumber, number | BigNumber":function(l,c){if(!s(l)||!i(l)||!s(c)||!i(c))throw new TypeError("Positive integer value expected in function composition");if(o(c,l))throw new TypeError("k must be less than or equal to n in function composition");return n(r(l,-1),r(c,-1))}})}),_M="leafCount",ube=["parse","typed"],lbe=G(_M,ube,t=>{var{parse:e,typed:r}=t;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return r(_M,{Node:function(a){return n(a)}})});function AM(t){return er(t)||tn(t)&&t.isUnary()&&er(t.args[0])}function Iv(t){return!!(er(t)||(Lo(t)||tn(t))&&t.args.every(Iv)||Hs(t)&&Iv(t.content))}function DM(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xy(t){for(var e=1;e{var{FunctionNode:e,OperatorNode:r,SymbolNode:n}=t,i=!0,a=!1,s="defaultF",o={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},u={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function c(x,A){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o,w=s;if(typeof x=="string"?w=x:tn(x)?w=x.fn.toString():Lo(x)?w=x.name:Hs(x)&&(w="paren"),tt(_,w)){var C=_[w];if(tt(C,A))return C[A];if(tt(o,w))return o[w][A]}if(tt(_,s)){var E=_[s];return tt(E,A)?E[A]:o[s][A]}if(tt(o,w)){var N=o[w];if(tt(N,A))return N[A]}return o[s][A]}function f(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return c(x,"commutative",A)}function h(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return c(x,"associative",A)}function p(x,A){var _=Xy({},x);for(var w in A)tt(x,w)?_[w]=Xy(Xy({},A[w]),x[w]):_[w]=A[w];return _}function v(x,A){if(!x.args||x.args.length===0)return x;x.args=m(x,A);for(var _=0;_2&&h(x,A)){for(var E=x.args.pop();x.args.length>0;)E=_([x.args.pop(),E]);x.args=E.args}}}function y(x,A){if(!(!x.args||x.args.length===0)){for(var _=S(x),w=x.args.length,C=0;C2&&h(x,A)){for(var E=x.args.shift();x.args.length>0;)E=_([E,x.args.shift()]);x.args=E.args}}}function S(x){return tn(x)?function(A){try{return new r(x.op,x.fn,A,x.implicit)}catch(_){return console.error(_),[]}}:function(A){return new e(new n(x.name),A)}}return{createMakeNodeFunction:S,hasProperty:c,isCommutative:f,isAssociative:h,mergeContext:p,flatten:v,allChildren:m,unflattenr:b,unflattenl:y,defaultContext:o,realContext:u,positiveContext:l}}),hbe="simplify",dbe=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],pbe=G(hbe,dbe,t=>{var{config:e,typed:r,parse:n,add:i,subtract:a,multiply:s,divide:o,pow:u,isZero:l,equal:c,resolve:f,simplifyConstant:h,simplifyCore:p,fraction:v,bignumber:m,mathWithTransform:b,matrix:y,AccessorNode:S,ArrayNode:x,ConstantNode:A,FunctionNode:_,IndexNode:w,ObjectNode:C,OperatorNode:E,ParenthesisNode:N,SymbolNode:M}=t,{hasProperty:O,isCommutative:F,isAssociative:U,mergeContext:V,flatten:H,unflattenr:I,unflattenl:P,createMakeNodeFunction:K,defaultContext:$,realContext:se,positiveContext:he}=gw({FunctionNode:_,OperatorNode:E,SymbolNode:M});r.addConversion({from:"Object",to:"Map",convert:Jl});var ne=r("simplify",{Node:me,"Node, Map":(ee,ue)=>me(ee,!1,ue),"Node, Map, Object":(ee,ue,le)=>me(ee,!1,ue,le),"Node, Array":me,"Node, Array, Map":me,"Node, Array, Map, Object":me});r.removeConversion({from:"Object",to:"Map",convert:Jl}),ne.defaultContext=$,ne.realContext=se,ne.positiveContext=he;function X(ee){return ee.transform(function(ue,le,Ee){return Hs(ue)?X(ue.content):ue})}var de={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ne.rules=[p,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Se(ee,ue){var le={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)le.l=Ee[0],le.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else le.l=ee.l,le.r=ee.r;le.l=X(n(le.l)),le.r=X(n(le.r));for(var Me of["imposeContext","repeat","assuming"])Me in ee&&(le[Me]=ee[Me]);if(ee.evaluate&&(le.evaluate=n(ee.evaluate)),U(le.l,ue)){var R=!F(le.l,ue),q;R&&(q=_e());var Y=K(le.l),pe=_e();le.expanded={},le.expanded.l=Y([le.l,pe]),H(le.expanded.l,ue),I(le.expanded.l,ue),le.expanded.r=Y([le.r,pe]),R&&(le.expandedNC1={},le.expandedNC1.l=Y([q,le.l]),le.expandedNC1.r=Y([q,le.r]),le.expandedNC2={},le.expandedNC2.l=Y([q,le.expanded.l]),le.expandedNC2.r=Y([q,le.expanded.r]))}return le}function ce(ee,ue){for(var le=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:zh(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Me=Ee.consoleDebug;ue=ce(ue||ne.rules,Ee.context);var R=f(ee,le);R=X(R);for(var q={},Y=R.toString({parenthesis:"all"});!q[Y];){q[Y]=!0,xe=0;var pe=Y;Me&&console.log("Working on: ",Y);for(var ge=0;ge ").concat(ue[ge].r.toString()))),Me){var Be=R.toString({parenthesis:"all"});Be!==pe&&(console.log("Applying",De,"produced",Be),pe=Be)}P(R,Ee.context)}Y=R.toString({parenthesis:"all"})}return R}function we(ee,ue,le){var Ee=ee;if(ee)for(var Me=0;Me1&&(pe=R(ee.args.slice(0,Y))),Me=ee.args.slice(Y),Ee=Me.length===1?Me[0]:R(Me),le.push(R([pe,Ee]))}return le}function He(ee,ue){var le={placeholders:{}};if(!ee.placeholders&&!ue.placeholders)return le;if(ee.placeholders){if(!ue.placeholders)return ee}else return ue;for(var Ee in ee.placeholders)if(tt(ee.placeholders,Ee)&&(le.placeholders[Ee]=ee.placeholders[Ee],tt(ue.placeholders,Ee)&&!ye(ee.placeholders[Ee],ue.placeholders[Ee])))return null;for(var Me in ue.placeholders)tt(ue.placeholders,Me)&&(le.placeholders[Me]=ue.placeholders[Me]);return le}function qe(ee,ue){var le=[];if(ee.length===0||ue.length===0)return le;for(var Ee,Me=0;Me2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var pe=te(ee.args[0],ue.args[1],le);if(pe.length===0)return[];var ge=te(ee.args[1],ue.args[0],le);if(ge.length===0)return[];R=[pe,ge]}Me=J(R)}else if(ue.args.length>=2&&ee.args.length===2){for(var De=Ce(ue,le),Be=[],Pe=0;Pe2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof M){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(de[ee.name]){if(ee.name!==ue.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Me[0].placeholders[ee.name]=ue;break;case"c":case"cl":if(er(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"v":if(!er(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"vl":if(Sn(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"cd":if(AM(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"vd":if(!AM(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"ce":if(Iv(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"ve":if(!Iv(ue))Me[0].placeholders[ee.name]=ue;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!c(ee.value,ue.value))return[]}else return[];return Me}function ye(ee,ue){if(ee instanceof A&&ue instanceof A){if(!c(ee.value,ue.value))return!1}else if(ee instanceof M&&ue instanceof M){if(ee.name!==ue.name)return!1}else if(ee instanceof E&&ue instanceof E||ee instanceof _&&ue instanceof _){if(ee instanceof E){if(ee.op!==ue.op||ee.fn!==ue.fn)return!1}else if(ee instanceof _&&ee.name!==ue.name)return!1;if(ee.args.length!==ue.args.length)return!1;for(var le=0;le{var{typed:e,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:o,ArrayNode:u,ConstantNode:l,FunctionNode:c,IndexNode:f,ObjectNode:h,OperatorNode:p,SymbolNode:v}=t,{isCommutative:m,isAssociative:b,allChildren:y,createMakeNodeFunction:S}=gw({FunctionNode:c,OperatorNode:p,SymbolNode:v}),x=e("simplifyConstant",{Node:H=>C(V(H,{})),"Node, Object":function(I,P){return C(V(I,P))}});function A(H){return ld(H)?H.valueOf():H instanceof Array?H.map(A):dt(H)?i(A(H.valueOf())):H}function _(H,I,P){try{return n[H].apply(null,I)}catch{return I=I.map(A),N(n[H].apply(null,I),P)}}var w=e({Fraction:O,number:function(I){return I<0?M(new l(-I)):new l(I)},BigNumber:function(I){return I<0?M(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new u(I.valueOf().map(P=>w(P)))}});function C(H){return pr(H)?H:w(H)}function E(H,I){var P=I&&I.exactFractions!==!1;if(P&&isFinite(H)&&a){var K=a(H),$=I&&typeof I.fractionsLimit=="number"?I.fractionsLimit:1/0;if(K.valueOf()===H&&K.n<$&&K.d<$)return K}return H}var N=e({"string, Object":function(I,P){if(r.number==="BigNumber")return s===void 0&&sw(),s(I);if(r.number==="Fraction")return a===void 0&&LP(),a(I);var K=parseFloat(I);return E(K,P)},"Fraction, Object":function(I,P){return I},"BigNumber, Object":function(I,P){return I},"number, Object":function(I,P){return E(I,P)},"Complex, Object":function(I,P){return I.im!==0?I:E(I.re,P)},"Matrix, Object":function(I,P){return i(E(I.valueOf()))},"Array, Object":function(I,P){return I.map(E)}});function M(H){return new p("-","unaryMinus",[H])}function O(H){var I,P=H.s*H.n;return P<0?I=new p("-","unaryMinus",[new l(-P)]):I=new l(P),H.d===1?I:new p("/","divide",[I,new l(H.d)])}function F(H,I,P){if(!Nc(I))return new o(C(H),C(I));if(ji(H)||dt(H)){for(var K=Array.from(I.dimensions);K.length>0;)if(er(K[0])&&typeof K[0].value!="string"){var $=N(K.shift().value,P);ji(H)?H=H.items[$-1]:(H=H.valueOf()[$-1],H instanceof Array&&(H=i(H)))}else if(K.length>1&&er(K[1])&&typeof K[1].value!="string"){var se=N(K[1].value,P),he=[],ne=ji(H)?H.items:H.valueOf();for(var X of ne)if(ji(X))he.push(X.items[se-1]);else if(dt(H))he.push(X[se-1]);else break;if(he.length===ne.length)ji(H)?H=new u(he):H=i(he),K.splice(1,1);else break}else break;return K.length===I.dimensions.length?new o(C(H),I):K.length>0?(I=new f(K),new o(C(H),I)):H}if(Cg(H)&&I.dimensions.length===1&&er(I.dimensions[0])){var de=I.dimensions[0].value;return de in H.properties?H.properties[de]:new l}return new o(C(H),I)}function U(H,I,P,K){var $=I.shift(),se=I.reduce((he,ne)=>{if(!pr(ne)){var X=he.pop();if(pr(X))return[X,ne];try{return he.push(_(H,[X,ne],K)),he}catch{he.push(X)}}he.push(C(he.pop()));var de=he.length===1?he[0]:P(he);return[P([de,C(ne)])]},[$]);return se.length===1?se[0]:P([se[0],w(se[1])])}function V(H,I){switch(H.type){case"SymbolNode":return H;case"ConstantNode":switch(typeof H.value){case"number":return N(H.value,I);case"string":return H.value;default:if(!isNaN(H.value))return N(H.value,I)}return H;case"FunctionNode":if(n[H.name]&&n[H.name].rawArgs)return H;{var P=["add","multiply"];if(P.indexOf(H.name)===-1){var K=H.args.map(Ne=>V(Ne,I));if(!K.some(pr))try{return _(H.name,K,I)}catch{}if(H.name==="size"&&K.length===1&&ji(K[0])){for(var $=[],se=K[0];ji(se);)$.push(se.items.length),se=se.items[0];return i($)}return new c(H.name,K.map(C))}}case"OperatorNode":{var he=H.fn.toString(),ne,X,de=S(H);if(tn(H)&&H.isUnary())ne=[V(H.args[0],I)],pr(ne[0])?X=de(ne):X=_(he,ne,I);else if(b(H,I.context))if(ne=y(H,I.context),ne=ne.map(Ne=>V(Ne,I)),m(he,I.context)){for(var Se=[],ce=[],xe=0;xe1?(X=U(he,Se,de,I),ce.unshift(X),X=U(he,ce,de,I)):X=U(he,ne,de,I)}else X=U(he,ne,de,I);else ne=H.args.map(Ne=>V(Ne,I)),X=U(he,ne,de,I);return X}case"ParenthesisNode":return V(H.content,I);case"AccessorNode":return F(V(H.object,I),V(H.index,I),I);case"ArrayNode":{var _e=H.items.map(Ne=>V(Ne,I));return _e.some(pr)?new u(_e.map(C)):i(_e)}case"IndexNode":return new f(H.dimensions.map(Ne=>x(Ne,I)));case"ObjectNode":{var me={};for(var we in H.properties)me[we]=x(H.properties[we],I);return new h(me)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(H.type))}}return x}),NM="simplifyCore",ybe=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],bbe=G(NM,ybe,t=>{var{typed:e,parse:r,equal:n,isZero:i,add:a,subtract:s,multiply:o,divide:u,pow:l,AccessorNode:c,ArrayNode:f,ConstantNode:h,FunctionNode:p,IndexNode:v,ObjectNode:m,OperatorNode:b,ParenthesisNode:y,SymbolNode:S}=t,x=new h(0),A=new h(1),_=new h(!0),w=new h(!1);function C(O){return tn(O)&&["and","not","or"].includes(O.op)}var{hasProperty:E,isCommutative:N}=gw({FunctionNode:p,OperatorNode:b,SymbolNode:S});function M(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=F?F.context:void 0;if(E(O,"trivial",U)){if(Lo(O)&&O.args.length===1)return M(O.args[0],F);var V=!1,H=0;if(O.forEach(ce=>{++H,H===1&&(V=M(ce,F))}),H===1)return V}var I=O;if(Lo(I)){var P=She(I.name);if(P){if(I.args.length>2&&E(I,"associative",U))for(;I.args.length>2;){var K=I.args.pop(),$=I.args.pop();I.args.push(new b(P,I.name,[K,$]))}I=new b(P,I.name,I.args)}else return new p(M(I.fn),I.args.map(ce=>M(ce,F)))}if(tn(I)&&I.isUnary()){var se=M(I.args[0],F);if(I.op==="~"&&tn(se)&&se.isUnary()&&se.op==="~"||I.op==="not"&&tn(se)&&se.isUnary()&&se.op==="not"&&C(se.args[0]))return se.args[0];var he=!0;if(I.op==="-"&&tn(se)&&(se.isBinary()&&se.fn==="subtract"&&(I=new b("-","subtract",[se.args[1],se.args[0]]),he=!1),se.isUnary()&&se.op==="-"))return se.args[0];if(he)return new b(I.op,I.fn,[se])}if(tn(I)&&I.isBinary()){var ne=M(I.args[0],F),X=M(I.args[1],F);if(I.op==="+"){if(er(ne)&&i(ne.value))return X;if(er(X)&&i(X.value))return ne;tn(X)&&X.isUnary()&&X.op==="-"&&(X=X.args[0],I=new b("-","subtract",[ne,X]))}if(I.op==="-")return tn(X)&&X.isUnary()&&X.op==="-"?M(new b("+","add",[ne,X.args[0]]),F):er(ne)&&i(ne.value)?M(new b("-","unaryMinus",[X])):er(X)&&i(X.value)?ne:new b(I.op,I.fn,[ne,X]);if(I.op==="*"){if(er(ne)){if(i(ne.value))return x;if(n(ne.value,1))return X}if(er(X)){if(i(X.value))return x;if(n(X.value,1))return ne;if(N(I,U))return new b(I.op,I.fn,[X,ne],I.implicit)}return new b(I.op,I.fn,[ne,X],I.implicit)}if(I.op==="/")return er(ne)&&i(ne.value)?x:er(X)&&n(X.value,1)?ne:new b(I.op,I.fn,[ne,X]);if(I.op==="^"&&er(X)){if(i(X.value))return A;if(n(X.value,1))return ne}if(I.op==="and"){if(er(ne))if(ne.value){if(C(X))return X}else return w;if(er(X))if(X.value){if(C(ne))return ne}else return w}if(I.op==="or"){if(er(ne)){if(ne.value)return _;if(C(X))return X}if(er(X)){if(X.value)return _;if(C(ne))return ne}}return new b(I.op,I.fn,[ne,X])}if(tn(I))return new b(I.op,I.fn,I.args.map(ce=>M(ce,F)));if(ji(I))return new f(I.items.map(ce=>M(ce,F)));if(Lu(I))return new c(M(I.object,F),M(I.index,F));if(Nc(I))return new v(I.dimensions.map(ce=>M(ce,F)));if(Cg(I)){var de={};for(var Se in I.properties)de[Se]=M(I.properties[Se],F);return new m(de)}return I}return e(NM,{Node:M,"Node,Object":M})}),xbe="resolve",wbe=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Sbe=G(xbe,wbe,t=>{var{typed:e,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=t;function o(u,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return u;if(Sn(u)){if(c.has(u.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var h=l.get(u.name);if(pr(h)){var p=new Set(c);return p.add(u.name),o(h,l,p)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):u}else if(tn(u)){var v=u.args.map(function(b){return o(b,l,c)});return new a(u.op,u.fn,v,u.implicit)}else{if(Hs(u))return new s(o(u.content,l,c));if(Lo(u)){var m=u.args.map(function(b){return o(b,l,c)});return new i(u.name,m)}}return u.map(b=>o(b,l,c))}return e("resolve",{Node:o,"Node, Map | null | undefined":o,"Node, Object":(u,l)=>o(u,Jl(l)),"Array | Matrix":e.referToSelf(u=>l=>l.map(c=>u(c))),"Array | Matrix, null | undefined":e.referToSelf(u=>l=>l.map(c=>u(c))),"Array, Object":e.referTo("Array,Map",u=>(l,c)=>u(l,Jl(c))),"Matrix, Object":e.referTo("Matrix,Map",u=>(l,c)=>u(l,Jl(c))),"Array | Matrix, Map":e.referToSelf(u=>(l,c)=>l.map(f=>u(f,c)))})}),EM="symbolicEqual",_be=["parse","simplify","typed","OperatorNode"],Abe=G(EM,_be,t=>{var{parse:e,simplify:r,typed:n,OperatorNode:i}=t;function a(s,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[s,o]),c=r(l,{},u);return er(c)&&!c.value}return n(EM,{"Node, Node":a,"Node, Node, Object":a})}),CM="derivative",Dbe=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Nbe=G(CM,Dbe,t=>{var{typed:e,config:r,parse:n,simplify:i,equal:a,isZero:s,numeric:o,ConstantNode:u,FunctionNode:l,OperatorNode:c,ParenthesisNode:f,SymbolNode:h}=t;function p(x,A){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},w={};b(w,x,A.name);var C=y(x,w);return _.simplify?i(C):C}e.addConversion({from:"identifier",to:"SymbolNode",convert:n});var v=e(CM,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p});e.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),v._simplify=!0,v.toTex=function(x){return m.apply(null,x.args)};var m=e("_derivTex",{"Node, SymbolNode":function(A,_){return er(A)&&xr(A.value)==="string"?m(n(A.value).toString(),_.toString(),1):m(A.toTex(),_.toString(),1)},"Node, ConstantNode":function(A,_){if(xr(_.value)==="string")return m(A,n(_.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,_,w){return m(A.toString(),_.name,w.value)},"string, string, number":function(A,_,w){var C;return w===1?C="{d\\over d"+_+"}":C="{d^{"+w+"}\\over d"+_+"^{"+w+"}}",C+"\\left[".concat(A,"\\right]")}}),b=e("constTag",{"Object, ConstantNode, string":function(A,_){return A[_]=!0,!0},"Object, SymbolNode, string":function(A,_,w){return _.name!==w?(A[_]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,_,w){return b(A,_.content,w)},"Object, FunctionAssignmentNode, string":function(A,_,w){return _.params.indexOf(w)===-1?(A[_]=!0,!0):b(A,_.expr,w)},"Object, FunctionNode | OperatorNode, string":function(A,_,w){if(_.args.length>0){for(var C=b(A,_.args[0],w),E=1;E<_.args.length;++E)C=b(A,_.args[E],w)&&C;if(C)return A[_]=!0,!0}return!1}}),y=e("_derivative",{"ConstantNode, Object":function(A){return S(0)},"SymbolNode, Object":function(A,_){return _[A]!==void 0?S(0):S(1)},"ParenthesisNode, Object":function(A,_){return new f(y(A.content,_))},"FunctionAssignmentNode, Object":function(A,_){return _[A]!==void 0?S(0):y(A.expr,_)},"FunctionNode, Object":function(A,_){if(_[A]!==void 0)return S(0);var w=A.args[0],C,E=!1,N=!1,M;switch(A.name){case"cbrt":E=!0,M=new c("*","multiply",[S(3),new c("^","pow",[w,new c("/","divide",[S(2),S(3)])])]);break;case"sqrt":case"nthRoot":if(A.args.length===1)E=!0,M=new c("*","multiply",[S(2),new l("sqrt",[w])]);else if(A.args.length===2)return C=new c("/","divide",[S(1),A.args[1]]),_[C]=_[A.args[1]],y(new c("^","pow",[w,C]),_);break;case"log10":C=S(10);case"log":if(!C&&A.args.length===1)M=w.clone(),E=!0;else if(A.args.length===1&&C||A.args.length===2&&_[A.args[1]]!==void 0)M=new c("*","multiply",[w.clone(),new l("log",[C||A.args[1]])]),E=!0;else if(A.args.length===2)return y(new c("/","divide",[new l("log",[w]),new l("log",[A.args[1]])]),_);break;case"pow":if(A.args.length===2)return _[C]=_[A.args[1]],y(new c("^","pow",[w,A.args[1]]),_);break;case"exp":M=new l("exp",[w.clone()]);break;case"sin":M=new l("cos",[w.clone()]);break;case"cos":M=new c("-","unaryMinus",[new l("sin",[w.clone()])]);break;case"tan":M=new c("^","pow",[new l("sec",[w.clone()]),S(2)]);break;case"sec":M=new c("*","multiply",[A,new l("tan",[w.clone()])]);break;case"csc":N=!0,M=new c("*","multiply",[A,new l("cot",[w.clone()])]);break;case"cot":N=!0,M=new c("^","pow",[new l("csc",[w.clone()]),S(2)]);break;case"asin":E=!0,M=new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])]);break;case"acos":E=!0,N=!0,M=new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])]);break;case"atan":E=!0,M=new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)]);break;case"asec":E=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acsc":E=!0,N=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acot":E=!0,N=!0,M=new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)]);break;case"sinh":M=new l("cosh",[w.clone()]);break;case"cosh":M=new l("sinh",[w.clone()]);break;case"tanh":M=new c("^","pow",[new l("sech",[w.clone()]),S(2)]);break;case"sech":N=!0,M=new c("*","multiply",[A,new l("tanh",[w.clone()])]);break;case"csch":N=!0,M=new c("*","multiply",[A,new l("coth",[w.clone()])]);break;case"coth":N=!0,M=new c("^","pow",[new l("csch",[w.clone()]),S(2)]);break;case"asinh":E=!0,M=new l("sqrt",[new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)])]);break;case"acosh":E=!0,M=new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])]);break;case"atanh":E=!0,M=new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])]);break;case"asech":E=!0,N=!0,M=new c("*","multiply",[w.clone(),new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])])]);break;case"acsch":E=!0,N=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acoth":E=!0,N=!0,M=new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])]);break;case"abs":M=new c("/","divide",[new l(new h("abs"),[w.clone()]),w.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+A.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var O,F;E?(O="/",F="divide"):(O="*",F="multiply");var U=y(w,_);return N&&(U=new c("-","unaryMinus",[U])),new c(O,F,[U,M])},"OperatorNode, Object":function(A,_){if(_[A]!==void 0)return S(0);if(A.op==="+")return new c(A.op,A.fn,A.args.map(function(H){return y(H,_)}));if(A.op==="-"){if(A.isUnary())return new c(A.op,A.fn,[y(A.args[0],_)]);if(A.isBinary())return new c(A.op,A.fn,[y(A.args[0],_),y(A.args[1],_)])}if(A.op==="*"){var w=A.args.filter(function(H){return _[H]!==void 0});if(w.length>0){var C=A.args.filter(function(H){return _[H]===void 0}),E=C.length===1?C[0]:new c("*","multiply",C),N=w.concat(y(E,_));return new c("*","multiply",N)}return new c("+","add",A.args.map(function(H){return new c("*","multiply",A.args.map(function(I){return I===H?y(I,_):I.clone()}))}))}if(A.op==="/"&&A.isBinary()){var M=A.args[0],O=A.args[1];return _[O]!==void 0?new c("/","divide",[y(M,_),O]):_[M]!==void 0?new c("*","multiply",[new c("-","unaryMinus",[M]),new c("/","divide",[y(O,_),new c("^","pow",[O.clone(),S(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[y(M,_),O.clone()]),new c("*","multiply",[M.clone(),y(O,_)])]),new c("^","pow",[O.clone(),S(2)])])}if(A.op==="^"&&A.isBinary()){var F=A.args[0],U=A.args[1];if(_[F]!==void 0)return er(F)&&(s(F.value)||a(F.value,1))?S(0):new c("*","multiply",[A,new c("*","multiply",[new l("log",[F.clone()]),y(U.clone(),_)])]);if(_[U]!==void 0){if(er(U)){if(s(U.value))return S(0);if(a(U.value,1))return y(F,_)}var V=new c("^","pow",[F.clone(),new c("-","subtract",[U,S(1)])]);return new c("*","multiply",[U.clone(),new c("*","multiply",[y(F,_),V])])}return new c("*","multiply",[new c("^","pow",[F.clone(),U.clone()]),new c("+","add",[new c("*","multiply",[y(F,_),new c("/","divide",[U.clone(),F.clone()])]),new c("*","multiply",[y(U,_),new l("log",[F.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function S(x,A){return new u(o(x,A||r.number))}return v}),MM="rationalize",Ebe=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Cbe=G(MM,Ebe,t=>{var{config:e,typed:r,equal:n,isZero:i,add:a,subtract:s,multiply:o,divide:u,pow:l,parse:c,simplifyConstant:f,simplifyCore:h,simplify:p,fraction:v,bignumber:m,mathWithTransform:b,matrix:y,AccessorNode:S,ArrayNode:x,ConstantNode:A,FunctionNode:_,IndexNode:w,ObjectNode:C,OperatorNode:E,SymbolNode:N,ParenthesisNode:M}=t;function O(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,$=U(),se=F(I,P,!0,$.firstRules),he=se.variables.length,ne={exactFractions:!1},X={exactFractions:!0};if(I=se.expression,he>=1){I=V(I);var de,Se,ce=!0,xe=!1;I=p(I,$.firstRules,{},ne);for(var _e;Se=ce?$.distrDivRules:$.sucDivRules,I=p(I,Se,{},X),ce=!ce,_e=I.toString(),_e!==de;)xe=!0,de=_e;xe&&(I=p(I,$.firstRulesAgain,{},ne)),I=p(I,$.finalRules,{},ne)}var me=[],we={};return I.type==="OperatorNode"&&I.isBinary()&&I.op==="/"?(he===1&&(I.args[0]=H(I.args[0],me),I.args[1]=H(I.args[1])),K&&(we.numerator=I.args[0],we.denominator=I.args[1])):(he===1&&(I=H(I,me)),K&&(we.numerator=I,we.denominator=null)),K?(we.coefficients=me,we.variables=se.variables,we.expression=I,we):I}return r(MM,{Node:O,"Node, boolean":(I,P)=>O(I,{},P),"Node, Object":O,"Node, Object, boolean":O});function F(I,P,K,$){var se=[],he=p(I,$,P,{exactFractions:!1});K=!!K;var ne="+-*"+(K?"/":"");de(he);var X={};return X.expression=he,X.variables=se,X;function de(Se){var ce=Se.type;if(ce==="FunctionNode")throw new Error("There is an unsolved function call");if(ce==="OperatorNode")if(Se.op==="^"){if(Se.args[1].type!=="ConstantNode"||!ot(parseFloat(Se.args[1].value)))throw new Error("There is a non-integer exponent");de(Se.args[0])}else{if(ne.indexOf(Se.op)===-1)throw new Error("Operator "+Se.op+" invalid in polynomial expression");for(var xe=0;xe1;if($==="OperatorNode"&&I.isBinary()){var he=!1,ne;if(I.op==="^"&&(I.args[0].type==="ParenthesisNode"||I.args[0].type==="OperatorNode")&&I.args[1].type==="ConstantNode"&&(ne=parseFloat(I.args[1].value),he=ne>=2&&ot(ne)),he){if(ne>2){var X=I.args[0],de=new E("^","pow",[I.args[0].cloneDeep(),new A(ne-1)]);I=new E("*","multiply",[X,de])}else I=new E("*","multiply",[I.args[0],I.args[0].cloneDeep()]);se&&(K==="content"?P.content=I:P.args[K]=I)}}if($==="ParenthesisNode")V(I.content,I,"content");else if($!=="ConstantNode"&&$!=="SymbolNode")for(var Se=0;Se=0;X--)if(P[X]!==0){var de=new A(he?P[X]:Math.abs(P[X])),Se=P[X]<0?"-":"+";if(X>0){var ce=new N(se);if(X>1){var xe=new A(X);ce=new E("^","pow",[ce,xe])}P[X]===-1&&he?de=new E("-","unaryMinus",[ce]):Math.abs(P[X])===1?de=ce:de=new E("*","multiply",[de,ce])}he?ne=de:Se==="+"?ne=new E("+","add",[ne,de]):ne=new E("-","subtract",[ne,de]),he=!1}if(he)return new A(0);return ne;function _e(me,we,Ne){var Ce=me.type;if(Ce==="FunctionNode")throw new Error("There is an unsolved function call");if(Ce==="OperatorNode"){if("+-*^".indexOf(me.op)===-1)throw new Error("Operator "+me.op+" invalid");if(we!==null){if((me.fn==="unaryMinus"||me.fn==="pow")&&we.fn!=="add"&&we.fn!=="subtract"&&we.fn!=="multiply")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="multiply")&&we.fn!=="add"&&we.fn!=="subtract")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="unaryMinus")&&Ne.noFil!==0)throw new Error("Invalid "+me.op+" placing")}(me.op==="^"||me.op==="*")&&(Ne.fire=me.op);for(var He=0;He$&&(P[qe]=0),P[qe]+=Ne.cte*(Ne.oper==="+"?1:-1),$=Math.max(qe,$);return}Ne.cte=qe,Ne.fire===""&&(P[0]+=Ne.cte*(Ne.oper==="+"?1:-1))}else throw new Error("Type "+Ce+" is not allowed")}}}),TM="zpk2tf",Mbe=["typed","add","multiply","Complex","number"],Tbe=G(TM,Mbe,t=>{var{typed:e,add:r,multiply:n,Complex:i,number:a}=t;return e(TM,{"Array,Array,number":function(l,c,f){return s(l,c,f)},"Array,Array":function(l,c){return s(l,c,1)},"Matrix,Matrix,number":function(l,c,f){return s(l.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(l,c){return s(l.valueOf(),c.valueOf(),1)}});function s(u,l,c){u.some(S=>S.type==="BigNumber")&&(u=u.map(S=>a(S))),l.some(S=>S.type==="BigNumber")&&(l=l.map(S=>a(S)));for(var f=[i(1,0)],h=[i(1,0)],p=0;p=0&&f-h{var{typed:e,add:r,multiply:n,Complex:i,divide:a,matrix:s}=t;return e(OM,{"Array, Array":function(c,f){var h=u(512);return o(c,f,h)},"Array, Array, Array":function(c,f,h){return o(c,f,h)},"Array, Array, number":function(c,f,h){if(h<0)throw new Error("w must be a positive number");var p=u(h);return o(c,f,p)},"Matrix, Matrix":function(c,f){var h=u(512),{w:p,h:v}=o(c.valueOf(),f.valueOf(),h);return{w:s(p),h:s(v)}},"Matrix, Matrix, Matrix":function(c,f,h){var{h:p}=o(c.valueOf(),f.valueOf(),h.valueOf());return{h:s(p),w:s(h)}},"Matrix, Matrix, number":function(c,f,h){if(h<0)throw new Error("w must be a positive number");var p=u(h),{h:v}=o(c.valueOf(),f.valueOf(),p);return{h:s(v),w:s(p)}}});function o(l,c,f){for(var h=[],p=[],v=0;v{var{classes:e}=t;return function(n,i){var a=e[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}}),Ibe="replacer",kbe=[],Lbe=G(Ibe,kbe,()=>function(e,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:r}),$be="12.4.0",zbe=G("true",[],()=>!0),Ube=G("false",[],()=>!1),qbe=G("null",[],()=>null),Hbe=Pi("Infinity",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1/0):1/0}),Wbe=Pi("NaN",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(NaN):NaN}),Vbe=Pi("pi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?lw(r):nie}),Ybe=Pi("tau",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Nce(r):iie}),jbe=Pi("e",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Ace(r):aie}),Gbe=Pi("phi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Dce(r):sie}),Xbe=Pi("LN2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).ln():Math.LN2}),Zbe=Pi("LN10",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(10).ln():Math.LN10}),Kbe=Pi("LOG2E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),Jbe=Pi("LOG10E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),Qbe=Pi("SQRT1_2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),e1e=Pi("SQRT2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),t1e=Pi("i",["Complex"],t=>{var{Complex:e}=t;return e.I}),tDe=G("PI",["pi"],t=>{var{pi:e}=t;return e}),rDe=G("E",["e"],t=>{var{e}=t;return e}),r1e=G("version",[],()=>$be);function Pi(t,e,r){return G(t,e,r,{recreateOnConfigChange:!0})}var n1e=Dt("speedOfLight","299792458","m s^-1"),i1e=Dt("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),a1e=Dt("planckConstant","6.62607015e-34","J s"),s1e=Dt("reducedPlanckConstant","1.0545718176461565e-34","J s"),o1e=Dt("magneticConstant","1.25663706212e-6","N A^-2"),u1e=Dt("electricConstant","8.8541878128e-12","F m^-1"),l1e=Dt("vacuumImpedance","376.730313667","ohm"),c1e=Dt("coulomb","8.987551792261171e9","N m^2 C^-2"),f1e=Dt("elementaryCharge","1.602176634e-19","C"),h1e=Dt("bohrMagneton","9.2740100783e-24","J T^-1"),d1e=Dt("conductanceQuantum","7.748091729863649e-5","S"),p1e=Dt("inverseConductanceQuantum","12906.403729652257","ohm"),m1e=Dt("magneticFluxQuantum","2.0678338484619295e-15","Wb"),v1e=Dt("nuclearMagneton","5.0507837461e-27","J T^-1"),g1e=Dt("klitzing","25812.807459304513","ohm"),y1e=Dt("bohrRadius","5.29177210903e-11","m"),b1e=Dt("classicalElectronRadius","2.8179403262e-15","m"),x1e=Dt("electronMass","9.1093837015e-31","kg"),w1e=Dt("fermiCoupling","1.1663787e-5","GeV^-2"),S1e=zg("fineStructure",.0072973525693),_1e=Dt("hartreeEnergy","4.3597447222071e-18","J"),A1e=Dt("protonMass","1.67262192369e-27","kg"),D1e=Dt("deuteronMass","3.3435830926e-27","kg"),N1e=Dt("neutronMass","1.6749271613e-27","kg"),E1e=Dt("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),C1e=Dt("rydberg","10973731.568160","m^-1"),M1e=Dt("thomsonCrossSection","6.6524587321e-29","m^2"),T1e=zg("weakMixingAngle",.2229),O1e=zg("efimovFactor",22.7),F1e=Dt("atomicMass","1.66053906660e-27","kg"),R1e=Dt("avogadro","6.02214076e23","mol^-1"),B1e=Dt("boltzmann","1.380649e-23","J K^-1"),P1e=Dt("faraday","96485.33212331001","C mol^-1"),I1e=Dt("firstRadiation","3.7417718521927573e-16","W m^2"),k1e=Dt("loschmidt","2.686780111798444e25","m^-3"),L1e=Dt("gasConstant","8.31446261815324","J K^-1 mol^-1"),$1e=Dt("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),z1e=Dt("molarVolume","0.022413969545014137","m^3 mol^-1"),U1e=zg("sackurTetrode",-1.16487052358),q1e=Dt("secondRadiation","0.014387768775039337","m K"),H1e=Dt("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),W1e=Dt("wienDisplacement","2.897771955e-3","m K"),V1e=Dt("molarMass","0.99999999965e-3","kg mol^-1"),Y1e=Dt("molarMassC12","11.9999999958e-3","kg mol^-1"),j1e=Dt("gravity","9.80665","m s^-2"),G1e=Dt("planckLength","1.616255e-35","m"),X1e=Dt("planckMass","2.176435e-8","kg"),Z1e=Dt("planckTime","5.391245e-44","s"),K1e=Dt("planckCharge","1.87554603778e-18","C"),J1e=Dt("planckTemperature","1.416785e+32","K");function Dt(t,e,r){var n=["config","Unit","BigNumber"];return G(t,n,i=>{var{config:a,Unit:s,BigNumber:o}=i,u=a.number==="BigNumber"?new o(e):parseFloat(e),l=new s(u,r);return l.fixPrefix=!0,l})}function zg(t,e){var r=["config","BigNumber"];return G(t,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(e):e})}var Q1e="apply",exe=["typed","isInteger"],txe=G(Q1e,exe,t=>{var{typed:e,isInteger:r}=t,n=nw({typed:e,isInteger:r});return e("apply",{"...any":function(a){var s=a[1];Ct(s)?a[1]=s-1:Mt(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(o){throw si(o)}}})},{isTransformFunction:!0}),rxe="column",nxe=["typed","Index","matrix","range"],ixe=G(rxe,nxe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t,a=IP({typed:e,Index:r,matrix:n,range:i});return e("column",{"...any":function(o){var u=o.length-1,l=o[u];Ct(l)&&(o[u]=l-1);try{return a.apply(null,o)}catch(c){throw si(c)}}})},{isTransformFunction:!0});function yw(t,e,r){var n=t.filter(function(u){return Sn(u)&&!(u.name in e)&&!r.has(u.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+t+'"');var i=n.name,a=new Map,s=new mB(r,a,new Set([i])),o=t.compile();return function(l){return a.set(i,l),o.evaluate(s)}}var axe="filter",sxe=["typed"],oxe=G(axe,sxe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=yw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("filter",{"Array, function":FM,"Matrix, function":function(a,s){return a.create(FM(a.toArray(),s))},"Array, RegExp":yv,"Matrix, RegExp":function(a,s){return a.create(yv(a.toArray(),s))}});return r},{isTransformFunction:!0});function FM(t,e){return cB(t,function(r,n,i){return Oc(e,r,[n+1],i,"filter")})}var uxe="forEach",lxe=["typed"],cxe=G(uxe,lxe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=yw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("forEach",{"Array | Matrix, function":function(a,s){var o=function u(l,c){if(Array.isArray(l))Tg(l,function(f,h){u(f,c.concat(h+1))});else return Oc(s,l,c,a,"forEach")};o(a.valueOf(),[])}});return r},{isTransformFunction:!0}),fxe="index",hxe=["Index","getMatrixDataType"],dxe=G(fxe,hxe,t=>{var{Index:e,getMatrixDataType:r}=t;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(o&&o.isSet===!0)o=o.map(function(l){return l-1});else if(sr(o)||dt(o))r(o)!=="boolean"&&(o=o.map(function(l){return l-1}));else if(Ct(o))o--;else if(Mt(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=o}var u=new e;return e.apply(u,i),u}},{isTransformFunction:!0}),pxe="map",mxe=["typed"],vxe=G(pxe,mxe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=yw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("map",{"Array, function":function(a,s){return RM(a,s,a)},"Matrix, function":function(a,s){return a.create(RM(a.valueOf(),s,a))}});return r},{isTransformFunction:!0});function RM(t,e,r){function n(i,a){return Array.isArray(i)?zs(i,function(s,o){return n(s,a.concat(o+1))}):Oc(e,i,a,r,"map")}return n(t,[])}function Yo(t){if(t.length===2&&na(t[0])){t=t.slice();var e=t[1];Ct(e)?t[1]=e-1:Mt(e)&&(t[1]=e.minus(1))}return t}var gxe="max",yxe=["typed","config","numeric","larger"],bxe=G(gxe,yxe,t=>{var{typed:e,config:r,numeric:n,larger:i}=t,a=YP({typed:e,config:r,numeric:n,larger:i});return e("max",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),xxe="mean",wxe=["typed","add","divide"],Sxe=G(xxe,wxe,t=>{var{typed:e,add:r,divide:n}=t,i=tI({typed:e,add:r,divide:n});return e("mean",{"...any":function(s){s=Yo(s);try{return i.apply(null,s)}catch(o){throw si(o)}}})},{isTransformFunction:!0}),_xe="min",Axe=["typed","config","numeric","smaller"],Dxe=G(_xe,Axe,t=>{var{typed:e,config:r,numeric:n,smaller:i}=t,a=jP({typed:e,config:r,numeric:n,smaller:i});return e("min",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Nxe="range",Exe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Cxe=G(Nxe,Exe,t=>{var{typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c}=t,f=zP({typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c});return e("range",{"...any":function(p){var v=p.length-1,m=p[v];return typeof m!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Mxe="row",Txe=["typed","Index","matrix","range"],Oxe=G(Mxe,Txe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t,a=UP({typed:e,Index:r,matrix:n,range:i});return e("row",{"...any":function(o){var u=o.length-1,l=o[u];Ct(l)&&(o[u]=l-1);try{return a.apply(null,o)}catch(c){throw si(c)}}})},{isTransformFunction:!0}),Fxe="subset",Rxe=["typed","matrix","zeros","add"],Bxe=G(Fxe,Rxe,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t,a=qP({typed:e,matrix:r,zeros:n,add:i});return e("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Pxe="concat",Ixe=["typed","matrix","isInteger"],kxe=G(Pxe,Ixe,t=>{var{typed:e,matrix:r,isInteger:n}=t,i=PP({typed:e,matrix:r,isInteger:n});return e("concat",{"...any":function(s){var o=s.length-1,u=s[o];Ct(u)?s[o]=u-1:Mt(u)&&(s[o]=u.minus(1));try{return i.apply(null,s)}catch(l){throw si(l)}}})},{isTransformFunction:!0}),BM="diff",Lxe=["typed","matrix","subtract","number","bignumber"],$xe=G(BM,Lxe,t=>{var{typed:e,matrix:r,subtract:n,number:i,bignumber:a}=t,s=kP({typed:e,matrix:r,subtract:n,number:i,bignumber:a});return e(BM,{"...any":function(u){u=Yo(u);try{return s.apply(null,u)}catch(l){throw si(l)}}})},{isTransformFunction:!0}),zxe="std",Uxe=["typed","map","sqrt","variance"],qxe=G(zxe,Uxe,t=>{var{typed:e,map:r,sqrt:n,variance:i}=t,a=iI({typed:e,map:r,sqrt:n,variance:i});return e("std",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),PM="sum",Hxe=["typed","config","add","numeric"],Wxe=G(PM,Hxe,t=>{var{typed:e,config:r,add:n,numeric:i}=t,a=QP({typed:e,config:r,add:n,numeric:i});return e(PM,{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Vxe="quantileSeq",Yxe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],jxe=G(Vxe,Yxe,t=>{var{typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h}=t,p=nI({typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h});return e("quantileSeq",{"Array | Matrix, number | BigNumber":p,"Array | Matrix, number | BigNumber, number":(m,b,y)=>p(m,b,v(y)),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(m,b,y,S)=>p(m,b,y,v(S)),"Array | Matrix, Array | Matrix":p,"Array | Matrix, Array | Matrix, number":(m,b,y)=>p(m,b,v(y)),"Array | Matrix, Array | Matrix, boolean":p,"Array | Matrix, Array | Matrix, boolean, number":(m,b,y,S)=>p(m,b,y,v(S))});function v(m){return Yo([[],m])[1]}},{isTransformFunction:!0}),IM="cumsum",Gxe=["typed","add","unaryPlus"],Xxe=G(IM,Gxe,t=>{var{typed:e,add:r,unaryPlus:n}=t,i=eI({typed:e,add:r,unaryPlus:n});return e(IM,{"...any":function(s){if(s.length===2&&na(s[0])){var o=s[1];Ct(o)?s[1]=o-1:Mt(o)&&(s[1]=o.minus(1))}try{return i.apply(null,s)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),kM="variance",Zxe=["typed","add","subtract","multiply","divide","apply","isNaN"],Kxe=G(kM,Zxe,t=>{var{typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o}=t,u=rI({typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o});return e(kM,{"...any":function(c){c=Yo(c);try{return u.apply(null,c)}catch(f){throw si(f)}}})},{isTransformFunction:!0}),LM="print",Jxe=["typed","matrix","zeros","add"],Qxe=G(LM,Jxe,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t,a=WP({typed:e,matrix:r,zeros:n,add:i});return e(LM,{"string, Object | Array":function(u,l){return a(s(u),l)},"string, Object | Array, number | Object":function(u,l,c){return a(s(u),l,c)}});function s(o){return o.replace(HP,u=>{var l=u.slice(1).split("."),c=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),ewe="and",twe=["typed","matrix","zeros","add","equalScalar","not","concat"],rwe=G(ewe,twe,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=VP({typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s});function u(l,c,f){var h=l[0].compile().evaluate(f);if(!na(h)&&!o(h,!0))return!1;var p=l[1].compile().evaluate(f);return o(h,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),nwe="or",iwe=["typed","matrix","equalScalar","DenseMatrix","concat"],awe=G(nwe,iwe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=BP({typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function o(u,l,c){var f=u[0].compile().evaluate(c);if(!na(f)&&s(f,!1))return!0;var h=u[1].compile().evaluate(c);return s(f,h)}return o.rawArgs=!0,o},{isTransformFunction:!0}),swe="bitAnd",owe=["typed","matrix","zeros","add","equalScalar","not","concat"],uwe=G(swe,owe,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=FP({typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s});function u(l,c,f){var h=l[0].compile().evaluate(f);if(!na(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var p=l[1].compile().evaluate(f);return o(h,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),lwe="bitOr",cwe=["typed","matrix","equalScalar","DenseMatrix","concat"],fwe=G(lwe,cwe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=RP({typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function o(u,l,c){var f=u[0].compile().evaluate(c);if(!na(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var h=u[1].compile().evaluate(c);return s(f,h)}return o.rawArgs=!0,o},{isTransformFunction:!0}),Ge=Fne({config:Re}),wr=Ine({}),$M=jbe({BigNumber:Ge,config:Re}),hwe=Ube({}),dwe=S1e({BigNumber:Ge,config:Re}),Zu=zne({}),oI=t1e({Complex:wr}),pwe=Hbe({BigNumber:Ge,config:Re}),mwe=Zbe({BigNumber:Ge,config:Re}),vwe=Jbe({BigNumber:Ge,config:Re}),Ug=Yne({}),gwe=Wbe({BigNumber:Ge,config:Re}),ywe=qbe({}),bwe=Gbe({BigNumber:Ge,config:Re}),xwe=Hne({}),uI=Ire({}),wwe=Qbe({BigNumber:Ge,config:Re}),Swe=U1e({BigNumber:Ge,config:Re}),lI=Ybe({BigNumber:Ge,config:Re}),_we=zbe({}),Awe=r1e({}),Tt=Zne({Matrix:Ug}),Dwe=O1e({BigNumber:Ge,config:Re}),Nwe=Xbe({BigNumber:Ge,config:Re}),s1=Vbe({BigNumber:Ge,config:Re}),Ewe=Lbe({}),Cwe=e1e({BigNumber:Ge,config:Re}),re=Fre({BigNumber:Ge,Complex:wr,DenseMatrix:Tt,Fraction:Zu}),bw=oae({BigNumber:Ge,config:Re,typed:re}),Mwe=T1e({BigNumber:Ge,config:Re}),oi=lae({typed:re}),Twe=kce({Complex:wr,config:Re,typed:re}),Owe=Uce({BigNumber:Ge,typed:re}),Fwe=Vce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),yn=dae({typed:re}),Rwe=eoe({typed:re}),Bwe=Kce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),Pwe=rfe({typed:re}),cI=afe({typed:re}),Iwe=lfe({Complex:wr,config:Re,typed:re}),Fi=Uie({BigNumber:Ge,typed:re}),kwe=jse({typed:re}),Lwe=Lie({typed:re}),$we=Jne({typed:re}),qg=mye({typed:re}),Hg=Wie({Complex:wr,typed:re}),Ku=roe({typed:re}),xw=ffe({typed:re}),zwe=mfe({BigNumber:Ge,typed:re}),Uwe=bfe({BigNumber:Ge,typed:re}),qwe=Cae({typed:re}),zt=Nie({config:Re,typed:re}),Hwe=Aue({typed:re}),fI=Tae({typed:re}),Wwe=Fae({Complex:wr,typed:re}),Vwe=Soe({typed:re}),Ywe=Noe({typed:re}),pd=Pue({typed:re}),ww=Moe({typed:re}),jwe=Uue({format:pd,typed:re}),Sw=ioe({typed:re}),xi=eie({typed:re}),jo=fie({typed:re}),Ju=gie({typed:re}),Ra=bie({typed:re}),Gwe=Kbe({BigNumber:Ge,config:Re}),Xwe=wye({Complex:wr,typed:re}),Zwe=dse({Complex:wr,config:Re,typed:re}),hI=mse({Complex:wr,config:Re,typed:re}),Qu=Poe({typed:re}),Xr=yse({typed:re}),kv=uoe({typed:re}),Xs=Bie({typed:re}),Kwe=$ue({format:pd,typed:re}),Jwe=Xye({config:Re,typed:re}),Qwe=WP({typed:re}),eSe=Kye({config:Re,typed:re}),_w=soe({typed:re}),tSe=_fe({BigNumber:Ge,typed:re}),dI=Ase({BigNumber:Ge,Fraction:Zu,complex:Hg,typed:re}),Wg=Efe({typed:re}),Zs=Mie({Matrix:Ug,equalScalar:zt,typed:re}),rSe=nae({typed:re}),nSe=Mse({typed:re}),iSe=Iie({typed:re}),ua=mae({typed:re}),aSe=Ofe({typed:re}),pI=_ie({typed:re}),sSe=$ce({Complex:wr,config:Re,typed:re}),oSe=jce({BigNumber:Ge,typed:re}),Aw=nw({isInteger:xi,typed:re}),uSe=Xce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),lSe=kue({format:pd,typed:re}),cSe=gye({typed:re}),fSe=dfe({typed:re}),hSe=wfe({BigNumber:Ge,typed:re}),md=wie({typed:re}),dSe=Yue({typed:re}),pSe=Qye({config:Re,typed:re}),mSe=Dfe({BigNumber:Ge,typed:re}),vSe=Mfe({typed:re}),gSe=Rce({SparseMatrix:Zs,typed:re}),Ba=Ese({Complex:wr,config:Re,typed:re}),ySe=Bfe({typed:re}),ts=aae({typed:re}),bSe=Hce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),xSe=gfe({BigNumber:Ge,typed:re}),Rc=jie({Fraction:Zu,typed:re}),el=die({typed:re}),Ye=Xie({DenseMatrix:Tt,Matrix:Ug,SparseMatrix:Zs,typed:re}),wSe=Kie({isZero:Ra,matrix:Ye,typed:re}),SSe=Oue({isNaN:md,isNumeric:el,typed:re}),Aa=Xue({bignumber:Fi,fraction:Rc,number:Xs}),mI=Rue({config:Re,multiplyScalar:Xr,numeric:Aa,typed:re}),vI=Hoe({isInteger:xi,matrix:Ye,typed:re}),Rn=Qoe({matrix:Ye,config:Re,typed:re}),_Se=tue({matrix:Ye,typed:re}),vd=oue({matrix:Ye,typed:re}),gI=Rse({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),On=fue({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),ASe=Qce({Complex:wr,config:Re,typed:re}),yI=gae({BigNumber:Ge,Complex:wr,Fraction:Zu,config:Re,isNegative:jo,matrix:Ye,typed:re,unaryMinus:ts}),Zt=PP({isInteger:xi,matrix:Ye,typed:re}),DSe=moe({prod:mI,size:Rn,typed:re}),Dw=lue({conj:Ku,transpose:vd,typed:re}),bI=boe({DenseMatrix:Tt,SparseMatrix:Zs,matrix:Ye,typed:re}),Lr=Kue({numeric:Aa,typed:re}),gd=fle({DenseMatrix:Tt,concat:Zt,divideScalar:Lr,equalScalar:zt,matrix:Ye,typed:re}),la=$le({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),yd=Aoe({matrix:Ye,typed:re}),NSe=mie({isNumeric:el,typed:re}),Go=Ooe({BigNumber:Ge,DenseMatrix:Tt,SparseMatrix:Zs,config:Re,matrix:Ye,typed:re}),ESe=Roe({matrix:Ye,multiplyScalar:Xr,typed:re}),Vg=Qle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),CSe=_le({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),xI=dle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),Nw=tae({flatten:yd,matrix:Ye,size:Rn,typed:re}),MSe=Sse({BigNumber:Ge,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),TSe=zoe({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),Ew=vde({addScalar:yn,complex:Hg,conj:Ku,divideScalar:Lr,equal:la,identity:Go,isZero:Ra,matrix:Ye,multiplyScalar:Xr,sign:dI,sqrt:Ba,subtractScalar:ua,typed:re,unaryMinus:ts,zeros:On}),OSe=Yoe({config:Re,matrix:Ye}),FSe=Dle({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),Bc=tle({BigNumber:Ge,DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),ti=Wle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),Gr=Ose({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,subtractScalar:ua,typed:re,unaryMinus:ts}),RSe=Wue({concat:Zt,matrix:Ye,typed:re}),BSe=ice({DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,typed:re}),Cw=mle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),PSe=foe({DenseMatrix:Tt,concat:Zt,matrix:Ye,typed:re}),Ht=rhe({DenseMatrix:Tt,SparseMatrix:Zs,addScalar:yn,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),ISe=ofe({BigNumber:Ge,DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),kSe=FP({concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),LSe=RP({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),$Se=Jse({DenseMatrix:Tt,concat:Zt,matrix:Ye,typed:re}),zSe=abe({addScalar:yn,combinations:qg,divideScalar:Lr,isInteger:xi,isNegative:jo,multiplyScalar:Xr,typed:re}),tl=Tle({BigNumber:Ge,DenseMatrix:Tt,Fraction:Zu,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,typed:re}),wI=kle({concat:Zt,matrix:Ye,typed:re}),USe=eI({add:Ht,typed:re,unaryPlus:bw}),Mw=rce({equal:la,typed:re}),qSe=kP({matrix:Ye,number:Xs,subtract:Gr,typed:re}),HSe=J0e({abs:oi,addScalar:yn,deepEqual:Mw,divideScalar:Lr,multiplyScalar:Xr,sqrt:Ba,subtractScalar:ua,typed:re}),Yg=uhe({addScalar:yn,conj:Ku,multiplyScalar:Xr,size:Rn,typed:re}),WSe=qle({compareText:wI,isZero:Ra,typed:re}),SI=MP({DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,round:Bc,typed:re,zeros:On}),VSe=ose({BigNumber:Ge,DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,round:Bc,typed:re,zeros:On}),YSe=ihe({abs:oi,addScalar:yn,divideScalar:Lr,isPositive:Ju,multiplyScalar:Xr,smaller:ti,sqrt:Ba,typed:re}),_I=pce({DenseMatrix:Tt,smaller:ti}),qn=gce({ImmutableDenseMatrix:_I,getMatrixDataType:ww}),ri=Zle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),Tw=nle({Complex:wr,config:Re,divideScalar:Lr,typed:re}),jSe=gle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),GSe=Qie({flatten:yd,matrix:Ye,size:Rn,typed:re}),XSe=jP({config:Re,numeric:Aa,smaller:ti,typed:re}),AI=TP({DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,round:Bc,typed:re,zeros:On}),lr=xse({addScalar:yn,dot:Yg,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,typed:re}),ZSe=ole({Complex:wr,config:Re,divideScalar:Lr,typed:re}),KSe=BP({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),jg=oce({compare:tl,isNaN:md,isNumeric:el,typed:re}),JSe=Ele({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),DI=zde({SparseMatrix:Zs,abs:oi,add:Ht,divideScalar:Lr,larger:ri,largerEq:Vg,multiply:lr,subtract:Gr,transpose:vd,typed:re}),Ii=qP({add:Ht,matrix:Ye,typed:re,zeros:On}),Ow=QP({add:Ht,config:Re,numeric:Aa,typed:re}),QSe=fhe({add:Ht,matrix:Ye,typed:re}),NI=ble({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),e_e=Tbe({Complex:wr,add:Ht,multiply:lr,number:Xs,typed:re}),Fw=Nae({DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,round:Bc,typed:re,zeros:On}),rs=Ble({compare:tl,typed:re}),t_e=obe({addScalar:yn,combinations:qg,isInteger:xi,isNegative:jo,isPositive:Ju,larger:ri,typed:re}),r_e=goe({matrix:Ye,multiply:lr,subtract:Gr,typed:re}),EI=C0e({divideScalar:Lr,isZero:Ra,matrix:Ye,multiply:lr,subtractScalar:ua,typed:re,unaryMinus:ts}),n_e=$se({concat:Zt,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,typed:re}),CI=xce({larger:ri,smaller:ti}),MI=Pae({Complex:wr,DenseMatrix:Tt,ceil:Fw,equalScalar:zt,floor:SI,matrix:Ye,typed:re,zeros:On}),TI=dhe({Index:qn,typed:re}),i_e=tye({abs:oi,add:Ht,addScalar:yn,config:Re,divideScalar:Lr,equalScalar:zt,flatten:yd,isNumeric:el,isZero:Ra,matrix:Ye,multiply:lr,multiplyScalar:Xr,smaller:ti,subtract:Gr,typed:re}),a_e=Pse({BigNumber:Ge,add:Ht,config:Re,equal:la,isInteger:xi,mod:AI,smaller:ti,typed:re,xgcd:gI}),s_e=fse({concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),o_e=ale({Complex:wr,config:Re,divideScalar:Lr,log:Tw,typed:re}),Rw=YP({config:Re,larger:ri,numeric:Aa,typed:re}),u_e=Ife({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),l_e=zfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),c_e=Wfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),f_e=Gfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),bc=jle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),h_e=lce({compare:tl,compareNatural:rs,matrix:Ye,typed:re}),d_e=VP({concat:Zt,equalScalar:zt,matrix:Ye,not:kv,typed:re,zeros:On}),xc=zP({bignumber:Fi,matrix:Ye,add:Ht,config:Re,isPositive:Ju,larger:ri,largerEq:Vg,smaller:ti,smallerEq:bc,typed:re}),p_e=UP({Index:qn,matrix:Ye,range:xc,typed:re}),OI=Lfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),m_e=Yfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),FI=Jfe({Index:qn,concat:Zt,setDifference:OI,size:Rn,subset:Ii,typed:re}),RI=_ce({FibonacciHeap:CI,addScalar:yn,equalScalar:zt}),BI=IP({Index:qn,matrix:Ye,range:xc,typed:re}),rl=T0e({abs:oi,addScalar:yn,det:EI,divideScalar:Lr,identity:Go,matrix:Ye,multiply:lr,typed:re,unaryMinus:ts}),PI=pde({DenseMatrix:Tt,Spa:RI,SparseMatrix:Zs,abs:oi,addScalar:yn,divideScalar:Lr,equalScalar:zt,larger:ri,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re,unaryMinus:ts}),v_e=F0e({Complex:wr,add:Ht,ctranspose:Dw,deepEqual:Mw,divideScalar:Lr,dot:Yg,dotDivide:gd,equal:la,inv:rl,matrix:Ye,multiply:lr,typed:re}),ca=Que({Complex:wr,config:Re,fraction:Rc,identity:Go,inv:rl,matrix:Ye,multiply:lr,number:Xs,typed:re}),II=qfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),g_e=ehe({Index:qn,concat:Zt,setIntersect:II,setSymDifference:FI,size:Rn,subset:Ii,typed:re}),y_e=U0e({abs:oi,add:Ht,identity:Go,inv:rl,map:Qu,max:Rw,multiply:lr,size:Rn,sqrt:Ba,subtract:Gr,typed:re}),xt=Mce({BigNumber:Ge,Complex:wr,Fraction:Zu,abs:oi,addScalar:yn,config:Re,divideScalar:Lr,equal:la,fix:MI,format:pd,isNumeric:el,multiplyScalar:Xr,number:Xs,pow:ca,round:Bc,subtractScalar:ua}),b_e=l1e({BigNumber:Ge,Unit:xt,config:Re}),x_e=W1e({BigNumber:Ge,Unit:xt,config:Re}),w_e=F1e({BigNumber:Ge,Unit:xt,config:Re}),S_e=h1e({BigNumber:Ge,Unit:xt,config:Re}),__e=B1e({BigNumber:Ge,Unit:xt,config:Re}),A_e=d1e({BigNumber:Ge,Unit:xt,config:Re}),D_e=c1e({BigNumber:Ge,Unit:xt,config:Re}),N_e=D1e({BigNumber:Ge,Unit:xt,config:Re}),E_e=lle({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,pow:ca,typed:re}),C_e=u1e({BigNumber:Ge,Unit:xt,config:Re}),M_e=f1e({BigNumber:Ge,Unit:xt,config:Re}),T_e=$0e({abs:oi,add:Ht,identity:Go,inv:rl,multiply:lr,typed:re}),O_e=P1e({BigNumber:Ge,Unit:xt,config:Re}),kI=due({addScalar:yn,ceil:Fw,conj:Ku,divideScalar:Lr,dotDivide:gd,exp:fI,i:oI,log2:hI,matrix:Ye,multiplyScalar:Xr,pow:ca,tau:lI,typed:re}),Bw=bye({BigNumber:Ge,Complex:wr,config:Re,multiplyScalar:Xr,pow:ca,typed:re}),F_e=i1e({BigNumber:Ge,Unit:xt,config:Re}),R_e=_1e({BigNumber:Ge,Unit:xt,config:Re}),B_e=mue({conj:Ku,dotDivide:gd,fft:kI,typed:re}),P_e=g1e({BigNumber:Ge,Unit:xt,config:Re}),I_e=k1e({BigNumber:Ge,Unit:xt,config:Re}),k_e=o1e({BigNumber:Ge,Unit:xt,config:Re}),L_e=V1e({BigNumber:Ge,Unit:xt,config:Re}),$_e=$1e({BigNumber:Ge,Unit:xt,config:Re}),z_e=N1e({BigNumber:Ge,Unit:xt,config:Re}),U_e=v1e({BigNumber:Ge,Unit:xt,config:Re}),q_e=K1e({BigNumber:Ge,Unit:xt,config:Re}),H_e=G1e({BigNumber:Ge,Unit:xt,config:Re}),W_e=J1e({BigNumber:Ge,Unit:xt,config:Re}),V_e=A1e({BigNumber:Ge,Unit:xt,config:Re}),Y_e=E1e({BigNumber:Ge,Unit:xt,config:Re}),j_e=s1e({BigNumber:Ge,Unit:xt,config:Re}),G_e=C1e({BigNumber:Ge,Unit:xt,config:Re}),X_e=q1e({BigNumber:Ge,Unit:xt,config:Re}),Z_e=n1e({BigNumber:Ge,Unit:xt,config:Re}),K_e=H1e({BigNumber:Ge,Unit:xt,config:Re}),J_e=M1e({BigNumber:Ge,Unit:xt,config:Re}),Q_e=R1e({BigNumber:Ge,Unit:xt,config:Re}),eAe=y1e({BigNumber:Ge,Unit:xt,config:Re}),tAe=Pce({Unit:xt,typed:re}),_n=Z0e({divideScalar:Lr,equalScalar:zt,inv:rl,matrix:Ye,multiply:lr,typed:re}),rAe=x1e({BigNumber:Ge,Unit:xt,config:Re}),bd=_ye({gamma:Bw,typed:re}),nAe=I1e({BigNumber:Ge,Unit:xt,config:Re}),iAe=j1e({BigNumber:Ge,Unit:xt,config:Re}),aAe=p1e({BigNumber:Ge,Unit:xt,config:Re}),LI=qde({DenseMatrix:Tt,lsolve:xI,lup:PI,matrix:Ye,slu:DI,typed:re,usolve:Cw}),sAe=m1e({BigNumber:Ge,Unit:xt,config:Re}),oAe=Y1e({BigNumber:Ge,Unit:xt,config:Re}),uAe=Eye({add:Ht,divide:_n,factorial:bd,isInteger:xi,isPositive:Ju,multiply:lr,typed:re}),lAe=Mye({factorial:bd,typed:re}),cAe=X1e({BigNumber:Ge,Unit:xt,config:Re}),fAe=Wde({add:Ht,cbrt:yI,divide:_n,equalScalar:zt,im:Sw,isZero:Ra,multiply:lr,re:_w,sqrt:Ba,subtract:Gr,typeOf:pI,typed:re,unaryMinus:ts}),hAe=Zfe({compareNatural:rs,typed:re}),dAe=wue({abs:oi,add:Ht,bignumber:Fi,divide:_n,isNegative:jo,isPositive:Ju,larger:ri,map:Qu,matrix:Ye,max:Rw,multiply:lr,smaller:ti,subtract:Gr,typed:re,unaryMinus:ts}),$I=tbe({bignumber:Fi,addScalar:yn,combinations:qg,divideScalar:Lr,factorial:bd,isInteger:xi,isNegative:jo,larger:ri,multiplyScalar:Xr,number:Xs,pow:ca,subtractScalar:ua,typed:re}),pAe=Oce({Unit:xt,typed:re}),mAe=nbe({addScalar:yn,isInteger:xi,isNegative:jo,stirlingS2:$I,typed:re}),zI=k0e({abs:oi,add:Ht,addScalar:yn,atan:cI,bignumber:Fi,column:BI,complex:Hg,config:Re,cos:xw,diag:bI,divideScalar:Lr,dot:Yg,equal:la,flatten:yd,im:Sw,inv:rl,larger:ri,matrix:Ye,matrixFromColumns:Nw,multiply:lr,multiplyScalar:Xr,number:Xs,qr:Ew,re:_w,reshape:vI,sin:Wg,size:Rn,smaller:ti,sqrt:Ba,subtract:Gr,typed:re,usolve:Cw,usolveAll:NI}),vAe=w1e({BigNumber:Ge,Unit:xt,config:Re}),gAe=L1e({BigNumber:Ge,Unit:xt,config:Re}),yAe=Dye({divide:_n,dotDivide:gd,isNumeric:el,log:Tw,map:Qu,matrix:Ye,multiply:lr,sum:Ow,typed:re}),UI=tI({add:Ht,divide:_n,typed:re}),bAe=z1e({BigNumber:Ge,Unit:xt,config:Re}),xAe=a1e({BigNumber:Ge,Unit:xt,config:Re}),wAe=nI({bignumber:Fi,add:Ht,compare:tl,divide:_n,isInteger:xi,larger:ri,multiply:lr,partitionSelect:jg,smaller:ti,smallerEq:bc,subtract:Gr,typed:re}),Pw=rI({add:Ht,apply:Aw,divide:_n,isNaN:md,multiply:lr,subtract:Gr,typed:re}),SAe=b1e({BigNumber:Ge,Unit:xt,config:Re}),qI=sye({add:Ht,compare:tl,divide:_n,partitionSelect:jg,typed:re}),_Ae=dye({add:Ht,divide:_n,matrix:Ye,mean:UI,multiply:lr,pow:ca,sqrt:Ba,subtract:Gr,sum:Ow,typed:re}),AAe=Fbe({Complex:wr,add:Ht,divide:_n,matrix:Ye,multiply:lr,typed:re}),DAe=uye({abs:oi,map:Qu,median:qI,subtract:Gr,typed:re}),NAe=iI({map:Qu,sqrt:Ba,typed:re,variance:Pw}),EAe=Mue({BigNumber:Ge,Complex:wr,add:Ht,config:Re,divide:_n,equal:la,factorial:bd,gamma:Bw,isNegative:jo,multiply:lr,pi:s1,pow:ca,sin:Wg,smallerEq:bc,subtract:Gr,typed:re}),Iw=she({abs:oi,add:Ht,conj:Ku,ctranspose:Dw,eigs:zI,equalScalar:zt,larger:ri,matrix:Ye,multiply:lr,pow:ca,smaller:ti,sqrt:Ba,typed:re}),HI=Zoe({BigNumber:Ge,DenseMatrix:Tt,SparseMatrix:Zs,addScalar:yn,config:Re,cos:xw,matrix:Ye,multiplyScalar:Xr,norm:Iw,sin:Wg,typed:re,unaryMinus:ts}),CAe=Z1e({BigNumber:Ge,Unit:xt,config:Re}),WI=V0e({identity:Go,matrix:Ye,multiply:lr,norm:Iw,qr:Ew,subtract:Gr,typed:re}),MAe=Goe({multiply:lr,rotationMatrix:HI,typed:re}),VI=H0e({abs:oi,add:Ht,concat:Zt,identity:Go,index:TI,lusolve:LI,matrix:Ye,matrixFromColumns:Nw,multiply:lr,range:xc,schur:WI,subset:Ii,subtract:Gr,transpose:vd,typed:re}),TAe=j0e({matrix:Ye,multiply:lr,sylvester:VI,transpose:vd,typed:re}),Pc={},Ic={},YI={},jn=vhe({mathWithTransform:Ic}),kc=qhe({Node:jn}),Ks=Whe({Node:jn}),nl=Yhe({Node:jn}),jI=Zhe({Node:jn}),Lc=xhe({Node:jn}),GI=Nhe({Node:jn,ResultSet:uI}),XI=Che({Node:jn}),Xo=Ihe({Node:jn}),ZI=Ghe({Node:jn}),OAe=Pbe({classes:YI}),kw=Zde({math:Pc,typed:re}),KI=Lhe({Node:jn,typed:re}),Pl=N0e({Chain:kw,typed:re}),$c=zhe({Node:jn,size:Rn}),zc=yhe({Node:jn,subset:Ii}),JI=Ahe({matrix:Ye,Node:jn,subset:Ii}),Zo=Qhe({Unit:xt,Node:jn,math:Pc}),Ko=tde({Node:jn,SymbolNode:Zo,math:Pc}),is=nde({AccessorNode:zc,ArrayNode:Lc,AssignmentNode:JI,BlockNode:GI,ConditionalNode:XI,ConstantNode:Xo,FunctionAssignmentNode:KI,FunctionNode:Ko,IndexNode:$c,ObjectNode:kc,OperatorNode:Ks,ParenthesisNode:nl,RangeNode:ZI,RelationalNode:jI,SymbolNode:Zo,config:Re,numeric:Aa,typed:re}),QI=Sbe({ConstantNode:Xo,FunctionNode:Ko,OperatorNode:Ks,ParenthesisNode:nl,parse:is,typed:re}),Lw=gbe({bignumber:Fi,fraction:Rc,AccessorNode:zc,ArrayNode:Lc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:$c,ObjectNode:kc,OperatorNode:Ks,SymbolNode:Zo,config:Re,mathWithTransform:Ic,matrix:Ye,typed:re}),FAe=ade({parse:is,typed:re}),$w=bbe({AccessorNode:zc,ArrayNode:Lc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:$c,ObjectNode:kc,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,divide:_n,equal:la,isZero:Ra,multiply:lr,parse:is,pow:ca,subtract:Gr,typed:re}),zw=ode({parse:is,typed:re}),ek=jde({evaluate:zw}),tk=cde({evaluate:zw}),Gg=pbe({bignumber:Fi,fraction:Rc,AccessorNode:zc,ArrayNode:Lc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:$c,ObjectNode:kc,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,config:Re,divide:_n,equal:la,isZero:Ra,mathWithTransform:Ic,matrix:Ye,multiply:lr,parse:is,pow:ca,resolve:QI,simplifyConstant:Lw,simplifyCore:$w,subtract:Gr,typed:re}),RAe=Abe({OperatorNode:Ks,parse:is,simplify:Gg,typed:re}),BAe=lbe({parse:is,typed:re}),PAe=hde({Parser:tk,typed:re}),IAe=Cbe({bignumber:Fi,fraction:Rc,AccessorNode:zc,ArrayNode:Lc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:$c,ObjectNode:kc,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,config:Re,divide:_n,equal:la,isZero:Ra,mathWithTransform:Ic,matrix:Ye,multiply:lr,parse:is,pow:ca,simplify:Gg,simplifyConstant:Lw,simplifyCore:$w,subtract:Gr,typed:re}),kAe=Nbe({ConstantNode:Xo,FunctionNode:Ko,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,config:Re,equal:la,isZero:Ra,numeric:Aa,parse:is,simplify:Gg,typed:re}),LAe=A0e({Help:ek,mathWithTransform:Ic,typed:re});dn(Pc,{e:$M,false:hwe,fineStructure:dwe,i:oI,Infinity:pwe,LN10:mwe,LOG10E:vwe,NaN:gwe,null:ywe,phi:bwe,SQRT1_2:wwe,sackurTetrode:Swe,tau:lI,true:_we,E:$M,version:Awe,efimovFactor:Dwe,LN2:Nwe,pi:s1,replacer:Ewe,reviver:OAe,SQRT2:Cwe,typed:re,unaryPlus:bw,PI:s1,weakMixingAngle:Mwe,abs:oi,acos:Twe,acot:Owe,acsc:Fwe,addScalar:yn,arg:Rwe,asech:Bwe,asinh:Pwe,atan:cI,atanh:Iwe,bignumber:Fi,bitNot:kwe,boolean:Lwe,clone:$we,combinations:qg,complex:Hg,conj:Ku,cos:xw,cot:zwe,csc:Uwe,cube:qwe,equalScalar:zt,erf:Hwe,exp:fI,expm1:Wwe,filter:Vwe,forEach:Ywe,format:pd,getMatrixDataType:ww,hex:jwe,im:Sw,isInteger:xi,isNegative:jo,isPositive:Ju,isZero:Ra,LOG2E:Gwe,lgamma:Xwe,log10:Zwe,log2:hI,map:Qu,multiplyScalar:Xr,not:kv,number:Xs,oct:Kwe,pickRandom:Jwe,print:Qwe,random:eSe,re:_w,sec:tSe,sign:dI,sin:Wg,splitUnit:rSe,square:nSe,string:iSe,subtractScalar:ua,tan:aSe,typeOf:pI,acosh:sSe,acsch:oSe,apply:Aw,asec:uSe,bin:lSe,chain:Pl,combinationsWithRep:cSe,cosh:fSe,csch:hSe,isNaN:md,isPrime:dSe,randomInt:pSe,sech:mSe,sinh:vSe,sparse:gSe,sqrt:Ba,tanh:ySe,unaryMinus:ts,acoth:bSe,coth:xSe,fraction:Rc,isNumeric:el,matrix:Ye,matrixFromFunction:wSe,mode:SSe,numeric:Aa,prod:mI,reshape:vI,size:Rn,squeeze:_Se,transpose:vd,xgcd:gI,zeros:On,asin:ASe,cbrt:yI,concat:Zt,count:DSe,ctranspose:Dw,diag:bI,divideScalar:Lr,dotDivide:gd,equal:la,flatten:yd,hasNumericValue:NSe,identity:Go,kron:ESe,largerEq:Vg,leftShift:CSe,lsolve:xI,matrixFromColumns:Nw,nthRoot:MSe,ones:TSe,qr:Ew,resize:OSe,rightArithShift:FSe,round:Bc,smaller:ti,subtract:Gr,to:RSe,unequal:BSe,usolve:Cw,xor:PSe,add:Ht,atan2:ISe,bitAnd:kSe,bitOr:LSe,bitXor:$Se,catalan:zSe,compare:tl,compareText:wI,cumsum:USe,deepEqual:Mw,diff:qSe,distance:HSe,dot:Yg,equalText:WSe,floor:SI,gcd:VSe,hypot:YSe,larger:ri,log:Tw,lsolveAll:jSe,matrixFromRows:GSe,min:XSe,mod:AI,multiply:lr,nthRoots:ZSe,or:KSe,partitionSelect:jg,rightLogShift:JSe,slu:DI,subset:Ii,sum:Ow,trace:QSe,usolveAll:NI,zpk2tf:e_e,ceil:Fw,compareNatural:rs,composition:t_e,cross:r_e,det:EI,dotMultiply:n_e,fix:MI,index:TI,intersect:i_e,invmod:a_e,lcm:s_e,log1p:o_e,max:Rw,setCartesian:u_e,setDistinct:l_e,setIsSubset:c_e,setPowerset:f_e,smallerEq:bc,sort:h_e,and:d_e,range:xc,row:p_e,setDifference:OI,setMultiplicity:m_e,setSymDifference:FI,column:BI,inv:rl,lup:PI,pinv:v_e,pow:ca,setIntersect:II,setUnion:g_e,sqrtm:y_e,vacuumImpedance:b_e,wienDisplacement:x_e,atomicMass:w_e,bohrMagneton:S_e,boltzmann:__e,conductanceQuantum:A_e,coulomb:D_e,deuteronMass:N_e,dotPow:E_e,electricConstant:C_e,elementaryCharge:M_e,expm:T_e,faraday:O_e,fft:kI,gamma:Bw,gravitationConstant:F_e,hartreeEnergy:R_e,ifft:B_e,klitzing:P_e,loschmidt:I_e,magneticConstant:k_e,molarMass:L_e,molarPlanckConstant:$_e,neutronMass:z_e,nuclearMagneton:U_e,planckCharge:q_e,planckLength:H_e,planckTemperature:W_e,protonMass:V_e,quantumOfCirculation:Y_e,reducedPlanckConstant:j_e,rydberg:G_e,secondRadiation:X_e,speedOfLight:Z_e,stefanBoltzmann:K_e,thomsonCrossSection:J_e,avogadro:Q_e,bohrRadius:eAe,createUnit:tAe,divide:_n,electronMass:rAe,factorial:bd,firstRadiation:nAe,gravity:iAe,inverseConductanceQuantum:aAe,lusolve:LI,magneticFluxQuantum:sAe,molarMassC12:oAe,multinomial:uAe,parse:is,permutations:lAe,planckMass:cAe,polynomialRoot:fAe,resolve:QI,setSize:hAe,simplifyConstant:Lw,solveODE:dAe,stirlingS2:$I,unit:pAe,bellNumbers:mAe,compile:FAe,eigs:zI,fermiCoupling:vAe,gasConstant:gAe,kldivergence:yAe,mean:UI,molarVolume:bAe,planckConstant:xAe,quantileSeq:wAe,simplifyCore:$w,variance:Pw,classicalElectronRadius:SAe,evaluate:zw,median:qI,simplify:Gg,symbolicEqual:RAe,corr:_Ae,freqz:AAe,leafCount:BAe,mad:DAe,parser:PAe,rationalize:IAe,std:NAe,zeta:EAe,derivative:kAe,norm:Iw,rotationMatrix:HI,help:LAe,planckTime:CAe,schur:WI,rotate:MAe,sylvester:VI,lyap:TAe,config:Re});dn(Ic,Pc,{filter:oxe({typed:re}),forEach:cxe({typed:re}),map:vxe({typed:re}),apply:txe({isInteger:xi,typed:re}),or:awe({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),and:rwe({add:Ht,concat:Zt,equalScalar:zt,matrix:Ye,not:kv,typed:re,zeros:On}),concat:kxe({isInteger:xi,matrix:Ye,typed:re}),max:bxe({config:Re,larger:ri,numeric:Aa,typed:re}),print:Qxe({add:Ht,matrix:Ye,typed:re,zeros:On}),bitAnd:uwe({add:Ht,concat:Zt,equalScalar:zt,matrix:Ye,not:kv,typed:re,zeros:On}),diff:$xe({bignumber:Fi,matrix:Ye,number:Xs,subtract:Gr,typed:re}),min:Dxe({config:Re,numeric:Aa,smaller:ti,typed:re}),subset:Bxe({add:Ht,matrix:Ye,typed:re,zeros:On}),bitOr:fwe({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),cumsum:Xxe({add:Ht,typed:re,unaryPlus:bw}),index:dxe({Index:qn,getMatrixDataType:ww}),sum:Wxe({add:Ht,config:Re,numeric:Aa,typed:re}),range:Cxe({bignumber:Fi,matrix:Ye,add:Ht,config:Re,isPositive:Ju,larger:ri,largerEq:Vg,smaller:ti,smallerEq:bc,typed:re}),row:Oxe({Index:qn,matrix:Ye,range:xc,typed:re}),column:ixe({Index:qn,matrix:Ye,range:xc,typed:re}),mean:Sxe({add:Ht,divide:_n,typed:re}),quantileSeq:jxe({add:Ht,bignumber:Fi,compare:tl,divide:_n,isInteger:xi,larger:ri,multiply:lr,partitionSelect:jg,smaller:ti,smallerEq:bc,subtract:Gr,typed:re}),variance:Kxe({add:Ht,apply:Aw,divide:_n,isNaN:md,multiply:lr,subtract:Gr,typed:re}),std:qxe({map:Qu,sqrt:Ba,typed:re,variance:Pw})});dn(YI,{BigNumber:Ge,Complex:wr,Fraction:Zu,Matrix:Ug,Node:jn,ObjectNode:kc,OperatorNode:Ks,ParenthesisNode:nl,Range:xwe,RelationalNode:jI,ResultSet:uI,ArrayNode:Lc,BlockNode:GI,ConditionalNode:XI,ConstantNode:Xo,DenseMatrix:Tt,RangeNode:ZI,Chain:kw,FunctionAssignmentNode:KI,SparseMatrix:Zs,IndexNode:$c,ImmutableDenseMatrix:_I,Index:qn,AccessorNode:zc,AssignmentNode:JI,FibonacciHeap:CI,Spa:RI,Unit:xt,SymbolNode:Zo,FunctionNode:Ko,Help:ek,Parser:tk});kw.createProxy(Pc);class ql{static compute(e,r,n){switch(e){case"inclusive":return ql.computeInclusive(r,n);case"exclusive":return ql.computeExclusive(r,n)}}static computeInclusive(e,r){return Pl(Pl(e).divide(Pl(r).add(100).done()).done()).multiply(100).done()}static computeExclusive(e,r){return Pl(e).divide(100).multiply(Pl(r).add(100).done()).done()}static getTaxValue(e,r,n){switch(e){case"inclusive":return r-ql.compute(e,r,n);case"exclusive":return ql.compute(e,r,n)-r}return 0}}window._=L9;window.ChartJS=qO;window.Pusher=z9;window.createApp=Cx;window.moment=Qe;window.Axios=TT;window.__=Hl;window.__m=S$;window.SnackBar=YR;window.FloatingNotice=VR;window.nsHooks=GR();window.popupResolver=Ote,window.popupCloser=Fte,window.countdown=Yi;window.timespan=Rte;window.Axios.defaults.headers.common["x-requested-with"]="XMLHttpRequest";window.Axios.defaults.withCredentials=!0;const $Ae=new WR,rk=new _te,zAe=new YR,UAe=new VR,qAe=new Nte,HAe=new Ete,nDe=window.nsHooks,nk=new class{constructor(){je(this,"breakpoint");this.breakpoint="",this.detectScreenSizes(),Jm(window,"resize").subscribe(t=>this.detectScreenSizes())}detectScreenSizes(){switch(!0){case(window.outerWidth>0&&window.outerWidth<=480):this.breakpoint="xs";break;case(window.outerWidth>480&&window.outerWidth<=640):this.breakpoint="sm";break;case(window.outerWidth>640&&window.outerWidth<=1024):this.breakpoint="md";break;case(window.outerWidth>1024&&window.outerWidth<=1280):this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl";break}}},WAe=new Ate({sidebar:["xs","sm","md"].includes(nk.breakpoint)?"hidden":"visible"});rk.defineClient(TT);window.nsEvent=$Ae;window.nsHttpClient=rk;window.nsSnackBar=zAe;window.nsNotice=UAe;window.nsState=WAe;window.nsUrl=qAe;window.nsScreen=nk;window.ChartJS=qO;window.EventEmitter=WR;window.Popup=Gx;window.RxJS=HG;window.FormValidation=Dte;window.nsCrudHandler=HAe;window.defineComponent=c1;window.defineAsyncComponent=nT;window.markRaw=iT;window.shallowRef=Uv;window.createApp=Cx;window.ns.insertAfterKey=Tte;window.ns.insertBeforeKey=Mte;window.nsCurrency=_$;window.nsAbbreviate=Bte;window.nsRawCurrency=A$;window.nsTruncate=Pte;window.nsTax=ql;export{xhe as $,Ex as A,H1 as B,q3 as C,Hu as D,Pte as E,Dte as F,GY as G,Rte as H,lae as I,yhe as J,kce as K,$ce as L,Uce as M,Hce as N,Vce as O,Gx as P,jce as Q,rhe as R,an as S,ql as T,dae as U,wg as V,VP as W,rwe as X,nw as Y,txe as Z,eoe as _,rk as a,Xxe as a$,Xce as a0,Kce as a1,Qce as a2,rfe as a3,Ahe as a4,afe as a5,ofe as a6,lfe as a7,F1e as a8,R1e as a9,Tle as aA,Ble as aB,kle as aC,ade as aD,Wie as aE,Ine as aF,obe as aG,PP as aH,kxe as aI,Che as aJ,d1e as aK,roe as aL,Ihe as aM,dye as aN,ffe as aO,dfe as aP,mfe as aQ,gfe as aR,c1e as aS,moe as aT,Pce as aU,goe as aV,bfe as aW,wfe as aX,lue as aY,Cae as aZ,eI as a_,nbe as aa,Fne as ab,Uie as ac,kue as ad,FP as ae,uwe as af,jse as ag,RP as ah,fwe as ai,Jse as aj,Nhe as ak,h1e as al,y1e as am,B1e as an,Lie as ao,abe as ap,gae as aq,Nae as ar,N0e as as,Zde as at,b1e as au,Jne as av,IP as aw,ixe as ax,mye as ay,gye as az,zAe as b,Ooe as b$,rce as b0,Zne as b1,Nbe as b2,C0e as b3,D1e as b4,boe as b5,kP as b6,$xe as b7,J0e as b8,Z0e as b9,oxe as bA,S1e as bB,I1e as bC,Pae as bD,Aoe as bE,MP as bF,Noe as bG,cxe as bH,Pue as bI,jie as bJ,zne as bK,Fbe as bL,Lhe as bM,tde as bN,bye as bO,L1e as bP,ose as bQ,Moe as bR,i1e as bS,j1e as bT,_1e as bU,mie as bV,A0e as bW,jde as bX,Uue as bY,ihe as bZ,t1e as b_,Kue as ba,uhe as bb,fle as bc,$se as bd,lle as be,jbe as bf,O1e as bg,k0e as bh,u1e as bi,x1e as bj,f1e as bk,$le as bl,Nie as bm,qle as bn,Aue as bo,ode as bp,Tae as bq,$0e as br,Fae as bs,_ye as bt,Ube as bu,P1e as bv,w1e as bw,due as bx,xce as by,Soe as bz,Cx as c,$1e as c$,mue as c0,ioe as c1,pce as c2,dhe as c3,gce as c4,zhe as c5,dxe as c6,Hbe as c7,tye as c8,T0e as c9,k1e as cA,dle as cB,gle as cC,pde as cD,qde as cE,j0e as cF,uye as cG,o1e as cH,m1e as cI,Poe as cJ,vxe as cK,Xie as cL,Yne as cM,tae as cN,Kie as cO,Qie as cP,YP as cQ,bxe as cR,tI as cS,Sxe as cT,sye as cU,jP as cV,Dxe as cW,TP as cX,Oue as cY,V1e as cZ,Y1e as c_,p1e as ca,Pse as cb,eie as cc,wie as cd,fie as ce,die as cf,gie as cg,Yue as ch,bie as ci,Dye as cj,g1e as ck,Roe as cl,Zbe as cm,Xbe as cn,Jbe as co,Kbe as cp,Zle as cq,Qle as cr,fse as cs,lbe as ct,_le as cu,wye as cv,nle as cw,dse as cx,ale as cy,mse as cz,UAe as d,Pbe as d$,z1e as d0,Eye as d1,xse as d2,yse as d3,Wbe as d4,N1e as d5,vhe as d6,she as d7,uoe as d8,Sse as d9,J1e as dA,Z1e as dB,Wde as dC,Que as dD,WP as dE,Qxe as dF,Rue as dG,A1e as dH,vde as dI,nI as dJ,jxe as dK,E1e as dL,Kye as dM,Qye as dN,zP as dO,Hne as dP,Ghe as dQ,Cxe as dR,Cbe as dS,soe as dT,s1e as dU,Zhe as dV,Lbe as dW,Hoe as dX,Yoe as dY,Sbe as dZ,Ire as d_,ole as da,v1e as db,qbe as dc,Bie as dd,Xue as de,qhe as df,$ue as dg,zoe as dh,Whe as di,BP as dj,awe as dk,Yhe as dl,nde as dm,hde as dn,cde as dp,oce as dq,Mye as dr,Gbe as ds,Vbe as dt,Xye as du,F0e as dv,K1e as dw,a1e as dx,G1e as dy,X1e as dz,$Ae as e,M1e as e$,Dle as e0,Ele as e1,Goe as e2,Zoe as e3,tle as e4,UP as e5,Oxe as e6,C1e as e7,Qbe as e8,e1e as e9,lce as eA,_ce as eB,Rce as eC,Mie as eD,n1e as eE,nae as eF,Ese as eG,U0e as eH,Mse as eI,tue as eJ,iI as eK,qxe as eL,H1e as eM,tbe as eN,Iie as eO,qP as eP,Bxe as eQ,Ose as eR,mae as eS,QP as eT,Wxe as eU,H0e as eV,Qhe as eW,Abe as eX,Ofe as eY,Bfe as eZ,Ybe as e_,U1e as ea,V0e as eb,_fe as ec,Dfe as ed,q1e as ee,Ife as ef,Lfe as eg,zfe as eh,qfe as ei,Wfe as ej,Yfe as ek,Gfe as el,Zfe as em,Jfe as en,ehe as eo,Ase as ep,pbe as eq,gbe as er,bbe as es,Efe as et,Mfe as eu,Qoe as ev,zde as ew,Wle as ex,jle as ey,wue as ez,Pl as f,Lu as f$,Wue as f0,fhe as f1,oue as f2,zbe as f3,_ie as f4,Fre as f5,aae as f6,oae as f7,ice as f8,Mce as f9,Dre as fA,dn as fB,Zx as fC,JAe as fD,$l as fE,KAe as fF,G as fG,XAe as fH,Pt as fI,Ma as fJ,Ct as fK,$n as fL,sr as fM,na as fN,mv as fO,Eu as fP,Kx as fQ,Ng as fR,Ite as fS,kte as fT,XR as fU,Lte as fV,$te as fW,zte as fX,Eg as fY,Ute as fZ,qte as f_,Oce as fa,rDe as fb,tDe as fc,mle as fd,ble as fe,l1e as ff,rI as fg,Kxe as fh,r1e as fi,T1e as fj,W1e as fk,Rse as fl,foe as fm,fue as fn,Mue as fo,Tbe as fp,Gu as fq,tt as fr,eDe as fs,QAe as ft,Gte as fu,Xi as fv,$s as fw,Mt as fx,ld as fy,dt as fz,Fte as g,Owe as g$,ji as g0,Hte as g1,Wte as g2,Vte as g3,er as g4,cd as g5,Lo as g6,Nc as g7,pr as g8,Cg as g9,Nwe as gA,vwe as gB,Gwe as gC,Ug as gD,jn as gE,kc as gF,Ks as gG,nl as gH,tk as gI,xwe as gJ,ZI as gK,jI as gL,uI as gM,wwe as gN,Cwe as gO,RI as gP,Zs as gQ,Zo as gR,xt as gS,pwe as gT,gwe as gU,hwe as gV,ywe as gW,_we as gX,oi as gY,Twe as gZ,sSe as g_,tn as ga,Hs as gb,Yte as gc,jte as gd,Sn as ge,ZR as gf,ZAe as gg,zc as gh,Lc as gi,JI as gj,Ge as gk,GI as gl,kw as gm,wr as gn,XI as go,Xo as gp,Tt as gq,CI as gr,Zu as gs,KI as gt,Ko as gu,ek as gv,_I as gw,qn as gx,$c as gy,mwe as gz,Qe as h,N_e as h$,bSe as h0,Fwe as h1,oSe as h2,Ht as h3,yn as h4,d_e as h5,Aw as h6,Rwe as h7,uSe as h8,Bwe as h9,tl as hA,rs as hB,wI as hC,FAe as hD,Hg as hE,t_e as hF,Zt as hG,A_e as hH,Re as hI,Ku as hJ,_Ae as hK,xw as hL,fSe as hM,zwe as hN,xSe as hO,D_e as hP,DSe as hQ,tAe as hR,r_e as hS,Uwe as hT,hSe as hU,Dw as hV,qwe as hW,USe as hX,Mw as hY,kAe as hZ,EI as h_,ASe as ha,Pwe as hb,cI as hc,ISe as hd,Iwe as he,w_e as hf,Q_e as hg,mAe as hh,Fi as hi,lSe as hj,kSe as hk,kwe as hl,LSe as hm,$Se as hn,S_e as ho,eAe as hp,__e as hq,Lwe as hr,zSe as hs,yI as ht,Fw as hu,SAe as hv,$we as hw,BI as hx,qg as hy,cSe as hz,G3 as i,el as i$,bI as i0,qSe as i1,HSe as i2,_n as i3,Lr as i4,S0e as i5,Yg as i6,gd as i7,n_e as i8,E_e as i9,Ywe as iA,pd as iB,Rc as iC,AAe as iD,Bw as iE,gAe as iF,VSe as iG,ww as iH,F_e as iI,iAe as iJ,R_e as iK,NSe as iL,LAe as iM,jwe as iN,YSe as iO,oI as iP,Go as iQ,B_e as iR,Sw as iS,TI as iT,i_e as iU,rl as iV,aAe as iW,a_e as iX,xi as iY,md as iZ,jo as i_,$M as ia,Dwe as ib,zI as ic,C_e as id,rAe as ie,M_e as ig,la as ih,zt as ii,WSe as ij,Hwe as ik,zw as il,fI as im,T_e as io,Wwe as ip,bd as iq,O_e as ir,vAe as is,kI as it,Vwe as iu,dwe as iv,nAe as iw,MI as ix,yd as iy,SI as iz,Dx as j,xAe as j$,Ju as j0,dSe as j1,Ra as j2,yAe as j3,P_e as j4,ESe as j5,ri as j6,Vg as j7,s_e as j8,BAe as j9,L_e as jA,oAe as jB,$_e as jC,bAe as jD,uAe as jE,lr as jF,Xr as jG,z_e as jH,Iw as jI,kv as jJ,MSe as jK,ZSe as jL,U_e as jM,Xs as jN,Aa as jO,Kwe as jP,TSe as jQ,KSe as jR,is as jS,PAe as jT,jg as jU,lAe as jV,bwe as jW,s1 as jX,Jwe as jY,v_e as jZ,q_e as j_,CSe as ja,Xwe as jb,Tw as jc,Zwe as jd,o_e as je,hI as jf,I_e as jg,xI as jh,jSe as ji,PI as jj,LI as jk,TAe as jl,DAe as jm,k_e as jn,sAe as jo,Qu as jp,Ye as jq,Nw as jr,wSe as js,GSe as jt,Rw as ju,UI as jv,qI as jw,XSe as jx,AI as jy,SSe as jz,NQ as k,_Se as k$,H_e as k0,cAe as k1,W_e as k2,CAe as k3,fAe as k4,ca as k5,Qwe as k6,mI as k7,V_e as k8,Ew as k9,OI as kA,l_e as kB,II as kC,c_e as kD,m_e as kE,f_e as kF,hAe as kG,FI as kH,g_e as kI,dI as kJ,Gg as kK,Lw as kL,$w as kM,Wg as kN,vSe as kO,Rn as kP,DI as kQ,ti as kR,bc as kS,dAe as kT,h_e as kU,gSe as kV,Z_e as kW,rSe as kX,Ba as kY,y_e as kZ,nSe as k_,wAe as ka,Y_e as kb,eSe as kc,pSe as kd,xc as ke,IAe as kf,_w as kg,j_e as kh,Ewe as ki,vI as kj,OSe as kk,QI as kl,OAe as km,FSe as kn,JSe as ko,MAe as kp,HI as kq,Bc as kr,p_e as ks,G_e as kt,Swe as ku,WI as kv,tSe as kw,mSe as kx,X_e as ky,u_e as kz,Z3 as l,NAe as l0,K_e as l1,$I as l2,iSe as l3,Ii as l4,Gr as l5,ua as l6,Ow as l7,VI as l8,RAe as l9,aSe as la,ySe as lb,lI as lc,J_e as ld,RSe as le,QSe as lf,vd as lg,pI as lh,re as li,ts as lj,bw as lk,BSe as ll,pAe as lm,Cw as ln,NI as lo,b_e as lp,Pw as lq,Awe as lr,Mwe as ls,x_e as lt,gI as lu,PSe as lv,On as lw,EAe as lx,e_e as ly,gQ as m,nDe as n,MQ as o,Ote as p,W3 as q,dQ as r,tR as s,TQ as t,Rb as u,av as v,CQ as w,mQ as x,JJ as y,Nx as z}; +In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},Cge={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},Mge={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},Tge={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},Oge={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},Fge={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},Rge={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},Bge={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},Pge={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},Ige={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},kge={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},Lge={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},$ge={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},zge={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},Uge={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},qge={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},Hge={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},Wge={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},Vge={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},Yge={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},jge={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},Gge={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},Xge={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},Zge={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},Kge={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},Jge={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},Qge={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},e0e={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},t0e={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},r0e={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},n0e={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},i0e={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},a0e={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},s0e={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},o0e={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},u0e={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},l0e={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},c0e={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},f0e={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},h0e={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},d0e={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},p0e={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},m0e={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},v0e={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},g0e={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},y0e={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},b0e={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},x0e={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},w0e={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},S0e={bignumber:hpe,boolean:dpe,complex:ppe,createUnit:mpe,fraction:vpe,index:gpe,matrix:ype,number:bpe,sparse:xpe,splitUnit:wpe,string:Spe,unit:_pe,e:qC,E:qC,false:Kde,i:Jde,Infinity:Qde,LN2:tpe,LN10:epe,LOG2E:npe,LOG10E:rpe,NaN:ipe,null:ape,pi:HC,PI:HC,phi:spe,SQRT1_2:ope,SQRT2:upe,tau:lpe,true:cpe,version:fpe,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:Epe,lsolve:Mpe,lsolveAll:Tpe,lup:Ope,lusolve:Fpe,leafCount:Cpe,polynomialRoot:Rpe,resolve:Ipe,simplify:kpe,simplifyConstant:Lpe,simplifyCore:$pe,symbolicEqual:Upe,rationalize:Ppe,slu:zpe,usolve:qpe,usolveAll:Hpe,qr:Bpe,abs:Wpe,add:Vpe,cbrt:Ype,ceil:jpe,cube:Gpe,divide:Xpe,dotDivide:Zpe,dotMultiply:Kpe,dotPow:Jpe,exp:Qpe,expm:eme,expm1:tme,fix:rme,floor:nme,gcd:ime,hypot:ame,lcm:ome,log:ume,log2:fme,log1p:cme,log10:lme,mod:hme,multiply:dme,norm:pme,nthRoot:mme,nthRoots:vme,pow:gme,round:yme,sign:bme,sqrt:xme,sqrtm:wme,square:Dme,subtract:Nme,unaryMinus:Eme,unaryPlus:Cme,xgcd:Mme,invmod:sme,bitAnd:Tme,bitNot:Ome,bitOr:Fme,bitXor:Rme,leftShift:Bme,rightArithShift:Pme,rightLogShift:Ime,bellNumbers:kme,catalan:Lme,composition:$me,stirlingS2:zme,config:Ape,import:Dpe,typed:Npe,arg:Ume,conj:qme,re:Wme,im:Hme,evaluate:Vme,help:Yme,distance:jme,intersect:Gme,and:Xme,not:Zme,or:Kme,xor:Jme,concat:eve,count:tve,cross:rve,column:Qme,ctranspose:nve,det:ive,diag:ave,diff:sve,dot:ove,getMatrixDataType:hve,identity:dve,filter:lve,flatten:cve,forEach:fve,inv:pve,pinv:mve,eigs:uve,kron:vve,matrixFromFunction:bve,matrixFromRows:xve,matrixFromColumns:yve,map:gve,ones:wve,partitionSelect:Sve,range:_ve,resize:Dve,reshape:Ave,rotate:Nve,rotationMatrix:Eve,row:Cve,size:Mve,sort:Tve,squeeze:Ove,subset:Fve,trace:Rve,transpose:Bve,zeros:Pve,fft:Ive,ifft:kve,sylvester:Sme,schur:_me,lyap:Ame,solveODE:w0e,combinations:Lve,combinationsWithRep:$ve,factorial:zve,gamma:Uve,kldivergence:Hve,lgamma:qve,multinomial:Wve,permutations:Vve,pickRandom:Yve,random:jve,randomInt:Gve,compare:Xve,compareNatural:Zve,compareText:Kve,deepEqual:Jve,equal:Qve,equalText:ege,larger:tge,largerEq:rge,smaller:nge,smallerEq:ige,unequal:age,setCartesian:sge,setDifference:oge,setDistinct:uge,setIntersect:lge,setIsSubset:cge,setMultiplicity:fge,setPowerset:hge,setSize:dge,setSymDifference:pge,setUnion:mge,zpk2tf:vge,freqz:gge,erf:yge,zeta:bge,cumsum:Mge,mad:xge,max:wge,mean:Sge,median:_ge,min:Age,mode:Dge,prod:Nge,quantileSeq:Ege,std:Cge,sum:Tge,variance:Oge,corr:Fge,acos:Rge,acosh:Bge,acot:Pge,acoth:Ige,acsc:kge,acsch:Lge,asec:$ge,asech:zge,asin:Uge,asinh:qge,atan:Hge,atanh:Vge,atan2:Wge,cos:Yge,cosh:jge,cot:Gge,coth:Xge,csc:Zge,csch:Kge,sec:Jge,sech:Qge,sin:e0e,sinh:t0e,tan:r0e,tanh:n0e,to:i0e,clone:s0e,format:o0e,bin:a0e,oct:y0e,hex:l0e,isNaN:f0e,isInteger:c0e,isNegative:h0e,isNumeric:d0e,hasNumericValue:u0e,isPositive:p0e,isPrime:m0e,isZero:v0e,print:b0e,typeOf:x0e,numeric:g0e},WC="help",_0e=["typed","mathWithTransform","Help"],A0e=G(WC,_0e,t=>{var{typed:e,mathWithTransform:r,Help:n}=t;return e(WC,{any:function(a){var s,o=a;if(typeof a!="string"){for(s in r)if(tt(r,s)&&a===r[s]){o=s;break}}var u=ei(S0e,o);if(!u){var l=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+l+'"')}return new n(u)}})}),VC="chain",D0e=["typed","Chain"],N0e=G(VC,D0e,t=>{var{typed:e,Chain:r}=t;return e(VC,{"":function(){return new r},any:function(i){return new r(i)}})}),YC="det",E0e=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],C0e=G(YC,E0e,t=>{var{typed:e,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:o}=t;return e(YC,{any:function(c){return vt(c)},"Array | Matrix":function(c){var f;switch(dt(c)?f=c.size():Array.isArray(c)?(c=r(c),f=c.size()):f=[],f.length){case 0:return vt(c);case 1:if(f[0]===1)return vt(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Rt(f)+")");case 2:{var h=f[0],p=f[1];if(h===p)return u(c.clone().valueOf(),h);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Rt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(f)+")")}}});function u(l,c,f){if(c===1)return vt(l[0][0]);if(c===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var h=!1,p=new Array(c).fill(0).map((C,E)=>E),v=0;v{var{typed:e,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:o,identity:u,abs:l}=t;return e(jC,{"Array | Matrix":function(h){var p=dt(h)?h.size():Nt(h);switch(p.length){case 1:if(p[0]===1)return dt(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Rt(p)+")");case 2:{var v=p[0],m=p[1];if(v===m)return dt(h)?r(c(h.valueOf(),v,m),h.storage()):c(h,v,m);throw new RangeError("Matrix must be square (size: "+Rt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(p)+")")}},any:function(h){return n(1,h)}});function c(f,h,p){var v,m,b,y,S;if(h===1){if(y=f[0][0],y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,y)]]}else if(h===2){var x=o(f);if(x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],x),n(s(f[0][1]),x)],[n(s(f[1][0]),x),n(f[0][0],x)]]}else{var A=f.concat();for(v=0;vC&&(C=l(A[v][w]),E=v),v++;if(C===0)throw Error("Cannot calculate inverse, determinant is zero");v=E,v!==w&&(S=A[w],A[w]=A[v],A[v]=S,S=_[w],_[w]=_[v],_[v]=S);var N=A[w],M=_[w];for(v=0;v{var{typed:e,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:o,ctranspose:u,divideScalar:l,multiply:c,add:f,Complex:h}=t;return e(GC,{"Array | Matrix":function(x){var A=dt(x)?x.size():Nt(x);switch(A.length){case 1:return y(x)?u(x):A[0]===1?n(x):s(u(x),o(x,x));case 2:{if(y(x))return u(x);var _=A[0],w=A[1];if(_===w)try{return n(x)}catch(C){if(!(C instanceof Error&&C.message.match(/Cannot calculate inverse, determinant is zero/)))throw C}return dt(x)?r(p(x.valueOf(),_,w),x.storage()):p(x,_,w)}default:throw new RangeError("Matrix must be two dimensional (size: "+Rt(A)+")")}},any:function(x){return a(x,0)?vt(x):l(1,x)}});function p(S,x,A){var{C:_,F:w}=m(S,x,A),C=c(n(c(u(_),_)),u(_)),E=c(u(w),n(c(w,u(w))));return c(E,C)}function v(S,x,A){for(var _=vt(S),w=0,C=0;CE.filter((M,O)=>O!b(o(_[N],_[N])));return{C:w,F:C}}function b(S){return a(f(S,h(1,1)),f(0,h(1,1)))}function y(S){return i(f(S,h(1,1)),f(c(S,0),h(1,1)))}});function R0e(t){var{addScalar:e,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:o,abs:u,bignumber:l,diag:c,size:f,reshape:h,inv:p,qr:v,usolve:m,usolveAll:b,equal:y,complex:S,larger:x,smaller:A,matrixFromColumns:_,dot:w}=t;function C(ne,X,de,Se){var ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,xe=E(ne,X,de,Se,ce);N(ne,X,de,Se,ce,xe);var{values:_e,C:me}=M(ne,X,de,Se,ce);if(ce){var we=O(ne,X,me,xe,_e,de,Se);return{values:_e,eigenvectors:we}}return{values:_e}}function E(ne,X,de,Se,ce){var xe=Se==="BigNumber",_e=Se==="Complex",me=xe?l(0):0,we=xe?l(1):_e?S(1):1,Ne=xe?l(1):1,Ce=xe?l(10):2,He=a(Ce,Ce),qe;ce&&(qe=Array(X).fill(we));for(var J=!1;!J;){J=!0;for(var te=0;te1&&(J=c(Array(Ce-1).fill(me)))),Ce-=1,we.pop();for(var Me=0;Me2&&(J=c(Array(Ce-2).fill(me)))),Ce-=2,we.pop(),we.pop();for(var q=0;q+r(u(ge),u(De))),te>100){var Y=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+Ne.join(", "));throw Y.values=Ne,Y.vectors=[],Y}var pe=ce?i(qe,H(He,X)):void 0;return{values:Ne,C:pe}}function O(ne,X,de,Se,ce,xe,_e){var me=p(de),we=i(me,ne,de),Ne=_e==="BigNumber",Ce=_e==="Complex",He=Ne?l(0):Ce?S(0):0,qe=Ne?l(1):Ce?S(1):1,J=[],te=[];for(var ye of ce){var ee=I(J,ye,y);ee===-1?(J.push(ye),te.push(1)):te[ee]+=1}for(var ue=[],le=J.length,Ee=Array(X).fill(He),Me=c(Array(X).fill(qe)),R=function(){var pe=J[q],ge=r(we,i(pe,Me)),De=b(ge,Ee);for(De.shift();De.lengthi(Pe,Ve)),ue.push(...De.map(Ve=>({value:pe,vector:n(Ve)})))},q=0;q=5)return null;for(me=0;;){var we=m(ne,_e);if(A(se($(_e,[we])),Se))break;if(++me>=10)return null;_e=he(we)}return _e}function K(ne,X,de){var Se=de==="BigNumber",ce=de==="Complex",xe=Array(ne).fill(0).map(_e=>2*Math.random()-1);return Se&&(xe=xe.map(_e=>l(_e))),ce&&(xe=xe.map(_e=>S(_e))),xe=$(xe,X),he(xe,de)}function $(ne,X){var de=f(ne);for(var Se of X)Se=h(Se,de),ne=r(ne,i(s(w(Se,ne),w(Se,Se)),Se));return ne}function se(ne){return u(o(w(ne,ne)))}function he(ne,X){var de=X==="BigNumber",Se=X==="Complex",ce=de?l(1):Se?S(1):1;return i(s(ce,se(ne)),ne)}return C}function B0e(t){var{config:e,addScalar:r,subtract:n,abs:i,atan:a,cos:s,sin:o,multiplyScalar:u,inv:l,bignumber:c,multiply:f,add:h}=t;function p(N,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.epsilon,F=arguments.length>3?arguments[3]:void 0,U=arguments.length>4?arguments[4]:void 0;if(F==="number")return v(N,O,U);if(F==="BigNumber")return m(N,O,U);throw TypeError("Unsupported data type: "+F)}function v(N,M,O){var F=N.length,U=Math.abs(M/F),V,H;if(O){H=new Array(F);for(var I=0;I=Math.abs(U);){var K=P[0][0],$=P[0][1];V=b(N[K][K],N[$][$],N[K][$]),N=_(N,V,K,$),O&&(H=S(H,V,K,$)),P=w(N)}for(var se=Array(F).fill(0),he=0;he=i(U);){var K=P[0][0],$=P[0][1];V=y(N[K][K],N[$][$],N[K][$]),N=A(N,V,K,$),O&&(H=x(H,V,K,$)),P=C(N)}for(var se=Array(F).fill(0),he=0;he({value:U[X],vector:ne}));return{values:U,eigenvectors:he}}return p}var P0e="eigs",I0e=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],k0e=G(P0e,I0e,t=>{var{config:e,typed:r,matrix:n,addScalar:i,subtract:a,equal:s,abs:o,atan:u,cos:l,sin:c,multiplyScalar:f,divideScalar:h,inv:p,bignumber:v,multiply:m,add:b,larger:y,column:S,flatten:x,number:A,complex:_,sqrt:w,diag:C,size:E,reshape:N,qr:M,usolve:O,usolveAll:F,im:U,re:V,smaller:H,matrixFromColumns:I,dot:P}=t,K=B0e({config:e,addScalar:i,subtract:a,column:S,flatten:x,equal:s,abs:o,atan:u,cos:l,sin:c,multiplyScalar:f,inv:p,bignumber:v,complex:_,multiply:m,add:b}),$=R0e({config:e,addScalar:i,subtract:a,multiply:m,multiplyScalar:f,flatten:x,divideScalar:h,sqrt:w,abs:o,bignumber:v,diag:C,size:E,reshape:N,qr:M,inv:p,usolve:O,usolveAll:F,equal:s,complex:_,larger:y,smaller:H,matrixFromColumns:I,dot:P});return r("eigs",{Array:function(xe){return se(n(xe))},"Array, number|BigNumber":function(xe,_e){return se(n(xe),{precision:_e})},"Array, Object"(ce,xe){return se(n(ce),xe)},Matrix:function(xe){return se(xe,{matricize:!0})},"Matrix, number|BigNumber":function(xe,_e){return se(xe,{precision:_e,matricize:!0})},"Matrix, Object":function(xe,_e){var me={matricize:!0};return dn(me,_e),se(xe,me)}});function se(ce){var xe,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me="eigenvectors"in _e?_e.eigenvectors:!0,we=(xe=_e.precision)!==null&&xe!==void 0?xe:e.epsilon,Ne=he(ce,we,me);return _e.matricize&&(Ne.values=n(Ne.values),me&&(Ne.eigenvectors=Ne.eigenvectors.map(Ce=>{var{value:He,vector:qe}=Ce;return{value:He,vector:n(qe)}}))),me&&Object.defineProperty(Ne,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),Ne}function he(ce,xe,_e){var me=ce.toArray(),we=ce.size();if(we.length!==2||we[0]!==we[1])throw new RangeError("Matrix must be square (size: ".concat(Rt(we),")"));var Ne=we[0];if(X(me,Ne,xe)&&(de(me,Ne),ne(me,Ne,xe))){var Ce=Se(ce,me,Ne);return K(me,Ne,xe,Ce,_e)}var He=Se(ce,me,Ne);return $(me,Ne,xe,He,_e)}function ne(ce,xe,_e){for(var me=0;me{var{typed:e,abs:r,add:n,identity:i,inv:a,multiply:s}=t;return e(XC,{Matrix:function(f){var h=f.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Rt(h)+")");for(var p=h[0],v=1e-15,m=o(f),b=u(m,v),y=b.q,S=b.j,x=s(f,Math.pow(2,-S)),A=i(p),_=i(p),w=1,C=x,E=-1,N=1;N<=y;N++)N>1&&(C=s(C,x),E=-E),w=w*(y-N+1)/((2*y-N+1)*N),A=n(A,s(w,C)),_=n(_,s(w*E,C));for(var M=s(a(_),A),O=0;O{var{typed:e,abs:r,add:n,multiply:i,map:a,sqrt:s,subtract:o,inv:u,size:l,max:c,identity:f}=t,h=1e3,p=1e-6;function v(m){var b,y=0,S=m,x=f(l(m));do{var A=S;if(S=i(.5,n(A,u(x))),x=i(.5,n(x,u(A))),b=c(r(o(S,A))),b>p&&++y>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(b>p);return S}return e(ZC,{"Array | Matrix":function(b){var y=dt(b)?b.size():Nt(b);switch(y.length){case 1:if(y[0]===1)return a(b,s);throw new RangeError("Matrix must be square (size: "+Rt(y)+")");case 2:{var S=y[0],x=y[1];if(S===x)return v(b);throw new RangeError("Matrix must be square (size: "+Rt(y)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Rt(y)+")")}}})}),KC="sylvester",q0e=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],H0e=G(KC,q0e,t=>{var{typed:e,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:o,transpose:u,index:l,subset:c,add:f,subtract:h,identity:p,lusolve:v,abs:m}=t;return e(KC,{"Matrix, Matrix, Matrix":b,"Array, Matrix, Matrix":function(S,x,A){return b(i(S),x,A)},"Array, Array, Matrix":function(S,x,A){return b(i(S),i(x),A)},"Array, Matrix, Array":function(S,x,A){return b(i(S),x,i(A))},"Matrix, Array, Matrix":function(S,x,A){return b(S,i(x),A)},"Matrix, Array, Array":function(S,x,A){return b(S,i(x),i(A))},"Matrix, Matrix, Array":function(S,x,A){return b(S,x,i(A))},"Array, Array, Array":function(S,x,A){return b(i(S),i(x),i(A)).toArray()}});function b(y,S,x){for(var A=S.size()[0],_=y.size()[0],w=r(y),C=w.T,E=w.U,N=r(a(-1,S)),M=N.T,O=N.U,F=a(a(u(E),x),O),U=s(0,_),V=[],H=(Ce,He)=>o(Ce,He,1),I=(Ce,He)=>o(Ce,He,0),P=0;P1e-5){for(var K=I(c(F,l(U,P)),c(F,l(U,P+1))),$=0;${var{typed:e,matrix:r,identity:n,multiply:i,qr:a,norm:s,subtract:o}=t;return e(JC,{Array:function(c){var f=u(r(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return u(c)}});function u(l){var c=l.size()[0],f=l,h=n(c),p=0,v;do{v=f;var m=a(f),b=m.Q,y=m.R;if(f=i(y,b),h=i(h,b),p++>100)break}while(s(o(f,v))>1e-4);return{U:h,T:f}}}),QC="lyap",Y0e=["typed","matrix","sylvester","multiply","transpose"],j0e=G(QC,Y0e,t=>{var{typed:e,matrix:r,sylvester:n,multiply:i,transpose:a}=t;return e(QC,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),G0e="divide",X0e=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Z0e=G(G0e,X0e,t=>{var{typed:e,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:s}=t,o=Fn({typed:e,equalScalar:i}),u=Oa({typed:e});return e("divide",QR({"Array | Matrix, Array | Matrix":function(c,f){return n(c,s(f))},"DenseMatrix, any":function(c,f){return u(c,f,a,!1)},"SparseMatrix, any":function(c,f){return o(c,f,a,!1)},"Array, any":function(c,f){return u(r(c),f,a,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,s(f))}},a.signatures))}),eM="distance",K0e=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],J0e=G(eM,K0e,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:o,abs:u}=t;return e(eM,{"Array, Array, Array":function(_,w,C){if(_.length===2&&w.length===2&&C.length===2){if(!c(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(w,C))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(C[1],w[1]),N=n(w[0],C[0]),M=n(i(C[0],w[1]),i(w[0],C[1]));return b(_[0],_[1],E,N,M)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(_,w,C){if(Object.keys(_).length===2&&Object.keys(w).length===2&&Object.keys(C).length===2){if(!c(_))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(w))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(C))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(v(w),v(C)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in _&&"pointY"in _&&"lineOnePtX"in w&&"lineOnePtY"in w&&"lineTwoPtX"in C&&"lineTwoPtY"in C){var E=n(C.lineTwoPtY,w.lineOnePtY),N=n(w.lineOnePtX,C.lineTwoPtX),M=n(i(C.lineTwoPtX,w.lineOnePtY),i(w.lineOnePtX,C.lineTwoPtY));return b(_.pointX,_.pointY,E,N,M)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(_,w){if(_.length===2&&w.length===3){if(!c(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(w))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return b(_[0],_[1],w[0],w[1],w[2])}else if(_.length===3&&w.length===6){if(!f(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!p(w))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(_[0],_[1],_[2],w[0],w[1],w[2],w[3],w[4],w[5])}else if(_.length===w.length&&_.length>0){if(!h(_))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(w))throw new TypeError("All values of an array should be numbers or BigNumbers");return S(_,w)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(_,w){if(Object.keys(_).length===2&&Object.keys(w).length===3){if(!c(_))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(w))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in _&&"pointY"in _&&"xCoeffLine"in w&&"yCoeffLine"in w&&"constant"in w)return b(_.pointX,_.pointY,w.xCoeffLine,w.yCoeffLine,w.constant);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===3&&Object.keys(w).length===6){if(!f(_))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!p(w))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in _&&"pointY"in _&&"x0"in w&&"y0"in w&&"z0"in w&&"a"in w&&"b"in w&&"c"in w)return y(_.pointX,_.pointY,_.pointZ,w.x0,w.y0,w.z0,w.a,w.b,w.c);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===2&&Object.keys(w).length===2){if(!c(_))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(w))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in _&&"pointOneY"in _&&"pointTwoX"in w&&"pointTwoY"in w)return S([_.pointOneX,_.pointOneY],[w.pointTwoX,w.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(_).length===3&&Object.keys(w).length===3){if(!f(_))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(w))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in _&&"pointOneY"in _&&"pointOneZ"in _&&"pointTwoX"in w&&"pointTwoY"in w&&"pointTwoZ"in w)return S([_.pointOneX,_.pointOneY,_.pointOneZ],[w.pointTwoX,w.pointTwoY,w.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(_){if(!m(_))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return x(_)}});function l(A){return typeof A=="number"||Mt(A)}function c(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])}function f(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])&&l(A[2])}function h(A){return Array.isArray(A)||(A=v(A)),A.every(l)}function p(A){return A.constructor!==Array&&(A=v(A)),l(A[0])&&l(A[1])&&l(A[2])&&l(A[3])&&l(A[4])&&l(A[5])}function v(A){for(var _=Object.keys(A),w=[],C=0;C<_.length;C++)w.push(A[_[C]]);return w}function m(A){if(A[0].length===2&&l(A[0][0])&&l(A[0][1])){if(A.some(_=>_.length!==2||!l(_[0])||!l(_[1])))return!1}else if(A[0].length===3&&l(A[0][0])&&l(A[0][1])&&l(A[0][2])){if(A.some(_=>_.length!==3||!l(_[0])||!l(_[1])||!l(_[2])))return!1}else return!1;return!0}function b(A,_,w,C,E){var N=u(r(r(i(w,A),i(C,_)),E)),M=o(r(i(w,w),i(C,C)));return a(N,M)}function y(A,_,w,C,E,N,M,O,F){var U=[n(i(n(E,_),F),i(n(N,w),O)),n(i(n(N,w),M),i(n(C,A),F)),n(i(n(C,A),O),i(n(E,_),M))];U=o(r(r(i(U[0],U[0]),i(U[1],U[1])),i(U[2],U[2])));var V=o(r(r(i(M,M),i(O,O)),i(F,F)));return a(U,V)}function S(A,_){for(var w=A.length,C=0,E=0,N=0;N{var{typed:e,config:r,abs:n,add:i,addScalar:a,matrix:s,multiply:o,multiplyScalar:u,divideScalar:l,subtract:c,smaller:f,equalScalar:h,flatten:p,isZero:v,isNumeric:m}=t;return e("intersect",{"Array, Array, Array":b,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(O,F,U){var V=b(O.valueOf(),F.valueOf(),U.valueOf());return V===null?null:s(V)},"Matrix, Matrix, Matrix, Matrix":function(O,F,U,V){var H=y(O.valueOf(),F.valueOf(),U.valueOf(),V.valueOf());return H===null?null:s(H)}});function b(M,O,F){if(M=S(M),O=S(O),F=S(F),!A(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!_(F))throw new TypeError("Array with 4 numbers expected as third argument");return N(M[0],M[1],M[2],O[0],O[1],O[2],F[0],F[1],F[2],F[3])}function y(M,O,F,U){if(M=S(M),O=S(O),F=S(F),U=S(U),M.length===2){if(!x(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(U))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return w(M,O,F,U)}else if(M.length===3){if(!A(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(F))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return E(M[0],M[1],M[2],O[0],O[1],O[2],F[0],F[1],F[2],U[0],U[1],U[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function S(M){return M.length===1?M[0]:M.length>1&&Array.isArray(M[0])&&M.every(O=>Array.isArray(O)&&O.length===1)?p(M):M}function x(M){return M.length===2&&m(M[0])&&m(M[1])}function A(M){return M.length===3&&m(M[0])&&m(M[1])&&m(M[2])}function _(M){return M.length===4&&m(M[0])&&m(M[1])&&m(M[2])&&m(M[3])}function w(M,O,F,U){var V=M,H=F,I=c(V,O),P=c(H,U),K=c(u(I[0],P[1]),u(P[0],I[1]));if(v(K)||f(n(K),r.epsilon))return null;var $=u(P[0],V[1]),se=u(P[1],V[0]),he=u(P[0],H[1]),ne=u(P[1],H[0]),X=l(a(c(c($,se),he),ne),K);return i(o(I,X),V)}function C(M,O,F,U,V,H,I,P,K,$,se,he){var ne=u(c(M,O),c(F,U)),X=u(c(V,H),c(I,P)),de=u(c(K,$),c(se,he));return a(a(ne,X),de)}function E(M,O,F,U,V,H,I,P,K,$,se,he){var ne=C(M,I,$,I,O,P,se,P,F,K,he,K),X=C($,I,U,M,se,P,V,O,he,K,H,F),de=C(M,I,U,M,O,P,V,O,F,K,H,F),Se=C($,I,$,I,se,P,se,P,he,K,he,K),ce=C(U,M,U,M,V,O,V,O,H,F,H,F),xe=c(u(ne,X),u(de,Se)),_e=c(u(ce,Se),u(X,X));if(v(_e))return null;var me=l(xe,_e),we=l(a(ne,u(me,X)),Se),Ne=a(M,u(me,c(U,M))),Ce=a(O,u(me,c(V,O))),He=a(F,u(me,c(H,F))),qe=a(I,u(we,c($,I))),J=a(P,u(we,c(se,P))),te=a(K,u(we,c(he,K)));return h(Ne,qe)&&h(Ce,J)&&h(He,te)?[Ne,Ce,He]:null}function N(M,O,F,U,V,H,I,P,K,$){var se=u(M,I),he=u(U,I),ne=u(O,P),X=u(V,P),de=u(F,K),Se=u(H,K),ce=c(c(c($,se),ne),de),xe=c(c(c(a(a(he,X),Se),se),ne),de),_e=l(ce,xe),me=a(M,u(_e,c(U,M))),we=a(O,u(_e,c(V,O))),Ne=a(F,u(_e,c(H,F)));return[me,we,Ne]}}),tM="sum",rye=["typed","config","add","numeric"],QP=G(tM,rye,t=>{var{typed:e,config:r,add:n,numeric:i}=t;return e(tM,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(u){if(Nc(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(o){var u;return Ws(o,function(l){try{u=u===void 0?l:n(u,l)}catch(c){throw ii(c,"sum",l)}}),u===void 0&&(u=i(0,r.number)),typeof u=="string"&&(u=i(u,r.number)),u}function s(o,u){try{var l=kg(o,u,n);return l}catch(c){throw ii(c,"sum")}}}),gm="cumsum",nye=["typed","add","unaryPlus"],eI=G(gm,nye,t=>{var{typed:e,add:r,unaryPlus:n}=t;return e(gm,{Array:i,Matrix:function(l){return l.create(i(l.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(l,c){return l.create(s(l.valueOf(),c))},"...":function(l){if(Nc(l))throw new TypeError("All values expected to be scalar in function cumsum");return i(l)}});function i(u){try{return a(u)}catch(l){throw ii(l,gm)}}function a(u){if(u.length===0)return[];for(var l=[n(u[0])],c=1;c=c.length)throw new Ma(l,c.length);try{return o(u,l)}catch(f){throw ii(f,gm)}}function o(u,l){var c,f,h;if(l<=0){var p=u[0][0];if(Array.isArray(p)){for(h=RB(u),f=[],c=0;c{var{typed:e,add:r,divide:n}=t;return e(rM,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Nc(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(s,o){try{var u=kg(s,o,r),l=Array.isArray(s)?Nt(s):s.size();return n(u,l[o])}catch(c){throw ii(c,"mean")}}function a(s){var o,u=0;if(Ws(s,function(l){try{o=o===void 0?l:r(o,l),u++}catch(c){throw ii(c,"mean",l)}}),u===0)throw new Error("Cannot calculate the mean of an empty array");return n(o,u)}}),nM="median",aye=["typed","add","divide","compare","partitionSelect"],sye=G(nM,aye,t=>{var{typed:e,add:r,divide:n,compare:i,partitionSelect:a}=t;function s(l){try{l=tr(l.valueOf());var c=l.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,h=a(l,f+1),p=l[f],v=0;v0&&(p=l[v]);return u(p,h)}else{var m=a(l,(c-1)/2);return o(m)}}catch(b){throw ii(b,"median")}}var o=e({"number | BigNumber | Complex | Unit":function(c){return c}}),u=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(r(c,f),2)}});return e(nM,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Nc(c))throw new TypeError("Scalar values expected in function median");return s(c)}})}),iM="mad",oye=["typed","abs","map","median","subtract"],uye=G(iM,oye,t=>{var{typed:e,abs:r,map:n,median:i,subtract:a}=t;return e(iM,{"Array | Matrix":s,"...":function(u){return s(u)}});function s(o){if(o=tr(o.valueOf()),o.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var u=i(o);return i(n(o,function(l){return r(a(l,u))}))}catch(l){throw l instanceof TypeError&&l.message.indexOf("median")!==-1?new TypeError(l.message.replace("median","mad")):ii(l,"mad")}}}),Zy="unbiased",aM="variance",lye=["typed","add","subtract","multiply","divide","apply","isNaN"],rI=G(aM,lye,t=>{var{typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o}=t;return e(aM,{"Array | Matrix":function(f){return u(f,Zy)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(f,h){return l(f,h,Zy)},"Array | Matrix, number | BigNumber, string":l,"...":function(f){return u(f,Zy)}});function u(c,f){var h,p=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Ws(c,function(b){try{h=h===void 0?b:r(h,b),p++}catch(y){throw ii(y,"variance",b)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var v=a(h,p);if(h=void 0,Ws(c,function(b){var y=n(b,v);h=h===void 0?i(y,y):r(h,i(y,y))}),o(h))return h;switch(f){case"uncorrected":return a(h,p);case"biased":return a(h,p+1);case"unbiased":{var m=Mt(h)?h.mul(0):0;return p===1?m:a(h,p-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(c,f,h){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(c,f,p=>u(p,h))}catch(p){throw ii(p,"variance")}}}),sM="quantileSeq",cye=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],nI=G(sM,cye,t=>{var{typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h}=t,p=dw({typed:e,isInteger:l});return e(sM,{"Array | Matrix, number | BigNumber":(S,x)=>m(S,x,!1),"Array | Matrix, number | BigNumber, number":(S,x,A)=>v(S,x,!1,A,m),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(S,x,A,_)=>v(S,x,A,_,m),"Array | Matrix, Array | Matrix":(S,x)=>b(S,x,!1),"Array | Matrix, Array | Matrix, number":(S,x,A)=>v(S,x,!1,A,b),"Array | Matrix, Array | Matrix, boolean":b,"Array | Matrix, Array | Matrix, boolean, number":(S,x,A,_)=>v(S,x,A,_,b)});function v(S,x,A,_,w){return p(S,_,C=>w(C,x,A))}function m(S,x,A){var _,w=S.valueOf();if(c(x,0))throw new Error("N/prob must be non-negative");if(f(x,1))return Ct(x)?y(w,x,A):r(y(w,x,A));if(h(x,1)){if(!l(x))throw new Error("N must be a positive integer");if(h(x,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var C=n(x,1);_=[];for(var E=0;c(E,x);E++){var N=a(E+1,C);_.push(y(w,N,A))}return Ct(x)?_:r(_)}}function b(S,x,A){for(var _=S.valueOf(),w=x.valueOf(),C=[],E=0;E0&&(M=_[F])}return n(s(M,i(1,N)),s(O,N))}}),oM="std",fye=["typed","map","sqrt","variance"],iI=G(oM,fye,t=>{var{typed:e,map:r,sqrt:n,variance:i}=t;return e(oM,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(s,o){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var u=i.apply(null,arguments);return na(u)?r(u,n):n(u)}catch(l){throw l instanceof TypeError&&l.message.indexOf(" variance")!==-1?new TypeError(l.message.replace(" variance"," std")):l}}}),uM="corr",hye=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],dye=G(uM,hye,t=>{var{typed:e,matrix:r,sqrt:n,sum:i,add:a,subtract:s,multiply:o,pow:u,divide:l}=t;return e(uM,{"Array, Array":function(p,v){return c(p,v)},"Matrix, Matrix":function(p,v){var m=c(p.toArray(),v.toArray());return Array.isArray(m)?r(m):m}});function c(h,p){var v=[];if(Array.isArray(h[0])&&Array.isArray(p[0])){if(h.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var m=0;ma(w,o(C,p[E])),0),S=i(h.map(w=>u(w,2))),x=i(p.map(w=>u(w,2))),A=s(o(v,y),o(m,b)),_=n(o(s(o(v,S),u(m,2)),s(o(v,x),u(b,2))));return l(A,_)}}),lM="combinations",pye=["typed"],mye=G(lM,pye,t=>{var{typed:e}=t;return e(lM,{"number, number":rP,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,o,u=n.minus(i),l=new a(1);if(!cM(n)||!cM(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=l,i.lt(u))for(o=l;o.lte(u);o=o.plus(l))s=s.times(i.plus(o)).dividedBy(o);else for(o=l;o.lte(i);o=o.plus(l))s=s.times(u.plus(o)).dividedBy(o);return s}})});function cM(t){return t.isInteger()&&t.gte(0)}var fM="combinationsWithRep",vye=["typed"],gye=G(fM,vye,t=>{var{typed:e}=t;return e(fM,{"number, number":function(n,i){if(!ot(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!ot(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:e,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=t;function o(l){if(l.im===0)return Ev(l.re);if(l.re<.5){var c=new s(1-l.re,-l.im),f=new s(Math.PI*l.re,Math.PI*l.im);return new s(Math.PI).div(f.sin()).div(o(c))}l=new s(l.re-1,l.im);for(var h=new s(Ql[0],0),p=1;p2;)h-=2,v+=h,p=p.times(v);return new a(p.toPrecision(a.precision))}}),pM="lgamma",xye=["Complex","typed"],wye=G(pM,xye,t=>{var{Complex:e,typed:r}=t,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(pM,{number:Cv,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(l){var c=6.283185307179586,f=1.1447298858494002,h=.1;if(l.isNaN())return new e(NaN,NaN);if(l.im===0)return new e(Cv(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return o(l);if(l.re<=h){var p=dre(c,l.im)*Math.floor(.5*l.re+.25),v=l.mul(Math.PI).sin().log(),m=s(new e(1-l.re,-l.im));return new e(f,p).sub(v).sub(m)}else return l.im>=0?u(l):u(l.conjugate()).conjugate()}function o(l){for(var c=l.sub(.5).mul(l.log()).sub(l).add(uP),f=new e(1,0).div(l),h=f.div(l),p=a[0],v=a[1],m=2*h.re,b=h.re*h.re+h.im*h.im,y=2;y<8;y++){var S=v;v=-b*p+a[y],p=m*p+S}var x=f.mul(h.mul(p).add(v));return c.add(x)}function u(l){var c=0,f=0,h=l;for(l=l.add(1);l.re<=n;){h=h.mul(l);var p=h.im<0?1:0;p!==0&&f===0&&c++,f=p,l=l.add(1)}return o(l).sub(h.log()).sub(new e(0,c*2*Math.PI*1))}}),mM="factorial",Sye=["typed","gamma"],_ye=G(mM,Sye,t=>{var{typed:e,gamma:r}=t;return e(mM,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":e.referToSelf(n=>i=>It(i,n))})}),vM="kldivergence",Aye=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Dye=G(vM,Aye,t=>{var{typed:e,matrix:r,divide:n,sum:i,multiply:a,map:s,dotDivide:o,log:u,isNumeric:l}=t;return e(vM,{"Array, Array":function(h,p){return c(r(h),r(p))},"Matrix, Array":function(h,p){return c(h,r(p))},"Array, Matrix":function(h,p){return c(r(h),p)},"Matrix, Matrix":function(h,p){return c(h,p)}});function c(f,h){var p=h.size().length,v=f.size().length;if(p>1)throw new Error("first object must be one dimensional");if(v>1)throw new Error("second object must be one dimensional");if(p!==v)throw new Error("Length of two vectors must be equal");var m=i(f);if(m===0)throw new Error("Sum of elements in first object must be non zero");var b=i(h);if(b===0)throw new Error("Sum of elements in second object must be non zero");var y=n(f,i(f)),S=n(h,i(h)),x=i(a(y,s(o(y,S),A=>u(A))));return l(x)?x:Number.NaN}}),gM="multinomial",Nye=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Eye=G(gM,Nye,t=>{var{typed:e,add:r,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:o}=t;return e(gM,{"Array | Matrix":function(l){var c=0,f=1;return Ws(l,function(h){if(!s(h)||!o(h))throw new TypeError("Positive integer value expected in function multinomial");c=r(c,h),f=i(f,a(h))}),n(a(c),f)}})}),yM="permutations",Cye=["typed","factorial"],Mye=G(yM,Cye,t=>{var{typed:e,factorial:r}=t;return e(yM,{"number | BigNumber":r,"number, number":function(i,a){if(!ot(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!ot(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Ps(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,o;if(!bM(i)||!bM(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var u=i.mul(0).add(1);for(s=u,o=i.minus(a).plus(1);o.lte(i);o=o.plus(1))s=s.times(o);return s}})});function bM(t){return t.isInteger()&&t.gte(0)}var l1={},Tye={get exports(){return l1},set exports(t){l1=t}};(function(t){(function(e,r,n){function i(u){var l=this,c=o();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=c(" "),l.s1=c(" "),l.s2=c(" "),l.s0-=c(u),l.s0<0&&(l.s0+=1),l.s1-=c(u),l.s1<0&&(l.s1+=1),l.s2-=c(u),l.s2<0&&(l.s2+=1),c=null}function a(u,l){return l.c=u.c,l.s0=u.s0,l.s1=u.s1,l.s2=u.s2,l}function s(u,l){var c=new i(u),f=l&&l.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,f&&(typeof f=="object"&&a(f,c),h.state=function(){return a(c,{})}),h}function o(){var u=4022871197,l=function(c){c=String(c);for(var f=0;f>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.alea=s})(Zi,t,!1)})(Tye);var c1={},Oye={get exports(){return c1},set exports(t){c1=t}};(function(t){(function(e,r,n){function i(o){var u=this,l="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},o===(o|0)?u.x=o:l+=o;for(var c=0;c>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xor128=s})(Zi,t,!1)})(Oye);var f1={},Fye={get exports(){return f1},set exports(t){f1=t}};(function(t){(function(e,r,n){function i(o){var u=this,l="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,o===(o|0)?u.x=o:l+=o;for(var c=0;c>>4),u.next()}function a(o,u){return u.x=o.x,u.y=o.y,u.z=o.z,u.w=o.w,u.v=o.v,u.d=o.d,u}function s(o,u){var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xorwow=s})(Zi,t,!1)})(Fye);var h1={},Rye={get exports(){return h1},set exports(t){h1=t}};(function(t){(function(e,r,n){function i(o){var u=this;u.next=function(){var c=u.x,f=u.i,h,p;return h=c[f],h^=h>>>7,p=h^h<<24,h=c[f+1&7],p^=h^h>>>10,h=c[f+3&7],p^=h^h>>>3,h=c[f+4&7],p^=h^h<<7,h=c[f+7&7],h=h^h<<13,p^=h^h<<9,c[f]=p,u.i=f+1&7,p};function l(c,f){var h,p=[];if(f===(f|0))p[0]=f;else for(f=""+f,h=0;h0;--h)c.next()}l(u,o)}function a(o,u){return u.x=o.x.slice(),u.i=o.i,u}function s(o,u){o==null&&(o=+new Date);var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(c.x&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xorshift7=s})(Zi,t,!1)})(Rye);var d1={},Bye={get exports(){return d1},set exports(t){d1=t}};(function(t){(function(e,r,n){function i(o){var u=this;u.next=function(){var c=u.w,f=u.X,h=u.i,p,v;return u.w=c=c+1640531527|0,v=f[h+34&127],p=f[h=h+1&127],v^=v<<13,p^=p<<17,v^=v>>>15,p^=p>>>12,v=f[h]=v^p,u.i=h,v+(c^c>>>16)|0};function l(c,f){var h,p,v,m,b,y=[],S=128;for(f===(f|0)?(p=f,f=null):(f=f+"\0",p=0,S=Math.max(S,f.length)),v=0,m=-32;m>>15,p^=p<<4,p^=p>>>13,m>=0&&(b=b+1640531527|0,h=y[m&127]^=p+b,v=h==0?v+1:0);for(v>=128&&(y[(f&&f.length||0)&127]=-1),v=127,m=4*128;m>0;--m)p=y[v+34&127],h=y[v=v+1&127],p^=p<<13,h^=h<<17,p^=p>>>15,h^=h>>>12,y[v]=p^h;c.w=b,c.X=y,c.i=v}l(u,o)}function a(o,u){return u.i=o.i,u.w=o.w,u.X=o.X.slice(),u}function s(o,u){o==null&&(o=+new Date);var l=new i(o),c=u&&u.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(c.X&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.xor4096=s})(Zi,t,!1)})(Bye);var p1={},Pye={get exports(){return p1},set exports(t){p1=t}};(function(t){(function(e,r,n){function i(o){var u=this,l="";u.next=function(){var f=u.b,h=u.c,p=u.d,v=u.a;return f=f<<25^f>>>7^h,h=h-p|0,p=p<<24^p>>>8^v,v=v-f|0,u.b=f=f<<20^f>>>12^h,u.c=h=h-p|0,u.d=p<<16^h>>>16^v,u.a=v-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,o===Math.floor(o)?(u.a=o/4294967296|0,u.b=o|0):l+=o;for(var c=0;c>>0)/4294967296};return f.double=function(){do var h=l.next()>>>11,p=(l.next()>>>0)/4294967296,v=(h+p)/(1<<21);while(v===0);return v},f.int32=l.next,f.quick=f,c&&(typeof c=="object"&&a(c,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=s:n&&n.amd?n(function(){return s}):this.tychei=s})(Zi,t,!1)})(Pye);var m1={},Iye={get exports(){return m1},set exports(t){m1=t}};const kye={},Lye=Object.freeze(Object.defineProperty({__proto__:null,default:kye},Symbol.toStringTag,{value:"Module"})),$ye=x$(Lye);(function(t){(function(e,r,n){var i=256,a=6,s=52,o="random",u=n.pow(i,a),l=n.pow(2,s),c=l*2,f=i-1,h;function p(A,_,w){var C=[];_=_==!0?{entropy:!0}:_||{};var E=y(b(_.entropy?[A,x(r)]:A??S(),3),C),N=new v(C),M=function(){for(var O=N.g(a),F=u,U=0;O=c;)O/=2,F/=2,U>>>=1;return(O+U)/F};return M.int32=function(){return N.g(4)|0},M.quick=function(){return N.g(4)/4294967296},M.double=M,y(x(N.S),r),(_.pass||w||function(O,F,U,V){return V&&(V.S&&m(V,N),O.state=function(){return m(N,{})}),U?(n[o]=O,F):O})(M,E,"global"in _?_.global:this==n,_.state)}function v(A){var _,w=A.length,C=this,E=0,N=C.i=C.j=0,M=C.S=[];for(w||(A=[w++]);E{var{typed:e,config:r,on:n}=t,i=gc(r.randomSeed);return n&&n("config",function(s,o){s.randomSeed!==o.randomSeed&&(i=gc(s.randomSeed))}),e(xM,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,l){return a(o,{number:l,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,l){return a(o,{number:u,weights:l})}});function a(s,o){var{number:u,weights:l,elementWise:c=!0}=o,f=typeof u>"u";f&&(u=1);var h=dt(s)?s.create:dt(l)?l.create:null;s=s.valueOf(),l&&(l=l.valueOf()),c===!0&&(s=tr(s),l=tr(l));var p=0;if(typeof l<"u"){if(l.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var v=0,m=l.length;v"u")S=s[Math.floor(i()*b)];else for(var x=i()*p,A=0,_=s.length;A<_;A++)if(x-=l[A],x<0){S=s[A];break}y.push(S)}return f?y[0]:h?h(y):y}});function xw(t,e){var r=[];if(t=t.slice(0),t.length>1)for(var n=0,i=t.shift();n{var{typed:e,config:r,on:n}=t,i=gc(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=gc(o.randomSeed))}),e(wM,{"":()=>s(0,1),number:o=>s(0,o),"number, number":(o,u)=>s(o,u),"Array | Matrix":o=>a(o,0,1),"Array | Matrix, number":(o,u)=>a(o,0,u),"Array | Matrix, number, number":(o,u,l)=>a(o,u,l)});function a(o,u,l){var c=xw(o.valueOf(),()=>s(u,l));return dt(o)?o.create(c):c}function s(o,u){return o+i()*(u-o)}}),SM="randomInt",Kye=["typed","config","?on"],Jye=G(SM,Kye,t=>{var{typed:e,config:r,on:n}=t,i=gc(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=gc(o.randomSeed))}),e(SM,{"":()=>s(0,1),number:o=>s(0,o),"number, number":(o,u)=>s(o,u),"Array | Matrix":o=>a(o,0,1),"Array | Matrix, number":(o,u)=>a(o,0,u),"Array | Matrix, number, number":(o,u,l)=>a(o,u,l)});function a(o,u,l){var c=xw(o.valueOf(),()=>s(u,l));return dt(o)?o.create(c):c}function s(o,u){return Math.floor(o+i()*(u-o))}}),_M="stirlingS2",Qye=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],ebe=G(_M,Qye,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:o,combinations:u,isNegative:l,isInteger:c,number:f,bignumber:h,larger:p}=t,v=[],m=[];return e(_M,{"number | BigNumber, number | BigNumber":function(y,S){if(!c(y)||l(y)||!c(S)||l(S))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(S,y))throw new TypeError("k must be less than or equal to n in function stirlingS2");var x=!(Ct(y)&&Ct(S)),A=x?m:v,_=x?h:f,w=f(y),C=f(S);if(A[w]&&A[w].length>C)return A[w][C];for(var E=0;E<=w;++E)if(A[E]||(A[E]=[_(E===0?1:0)]),E!==0)for(var N=A[E],M=A[E-1],O=N.length;O<=E&&O<=C;++O)O===E?N[O]=1:N[O]=r(i(_(O),M[O]),M[O-1]);return A[w][C]}})}),AM="bellNumbers",tbe=["typed","addScalar","isNegative","isInteger","stirlingS2"],rbe=G(AM,tbe,t=>{var{typed:e,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=t;return e(AM,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,l=0;l<=o;l++)u=r(u,a(o,l));return u}})}),DM="catalan",nbe=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],ibe=G(DM,nbe,t=>{var{typed:e,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:o}=t;return e(DM,{"number | BigNumber":function(l){if(!o(l)||s(l))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(l,2),l),r(l,1))}})}),NM="composition",abe=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],sbe=G(NM,abe,t=>{var{typed:e,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:o}=t;return e(NM,{"number | BigNumber, number | BigNumber":function(l,c){if(!s(l)||!i(l)||!s(c)||!i(c))throw new TypeError("Positive integer value expected in function composition");if(o(c,l))throw new TypeError("k must be less than or equal to n in function composition");return n(r(l,-1),r(c,-1))}})}),EM="leafCount",obe=["parse","typed"],ube=G(EM,obe,t=>{var{parse:e,typed:r}=t;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return r(EM,{Node:function(a){return n(a)}})});function CM(t){return er(t)||tn(t)&&t.isUnary()&&er(t.args[0])}function Lv(t){return!!(er(t)||(Lo(t)||tn(t))&&t.args.every(Lv)||Hs(t)&&Lv(t.content))}function MM(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ky(t){for(var e=1;e{var{FunctionNode:e,OperatorNode:r,SymbolNode:n}=t,i=!0,a=!1,s="defaultF",o={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},u={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function c(x,A){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o,w=s;if(typeof x=="string"?w=x:tn(x)?w=x.fn.toString():Lo(x)?w=x.name:Hs(x)&&(w="paren"),tt(_,w)){var C=_[w];if(tt(C,A))return C[A];if(tt(o,w))return o[w][A]}if(tt(_,s)){var E=_[s];return tt(E,A)?E[A]:o[s][A]}if(tt(o,w)){var N=o[w];if(tt(N,A))return N[A]}return o[s][A]}function f(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return c(x,"commutative",A)}function h(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return c(x,"associative",A)}function p(x,A){var _=Ky({},x);for(var w in A)tt(x,w)?_[w]=Ky(Ky({},A[w]),x[w]):_[w]=A[w];return _}function v(x,A){if(!x.args||x.args.length===0)return x;x.args=m(x,A);for(var _=0;_2&&h(x,A)){for(var E=x.args.pop();x.args.length>0;)E=_([x.args.pop(),E]);x.args=E.args}}}function y(x,A){if(!(!x.args||x.args.length===0)){for(var _=S(x),w=x.args.length,C=0;C2&&h(x,A)){for(var E=x.args.shift();x.args.length>0;)E=_([E,x.args.shift()]);x.args=E.args}}}function S(x){return tn(x)?function(A){try{return new r(x.op,x.fn,A,x.implicit)}catch(_){return console.error(_),[]}}:function(A){return new e(new n(x.name),A)}}return{createMakeNodeFunction:S,hasProperty:c,isCommutative:f,isAssociative:h,mergeContext:p,flatten:v,allChildren:m,unflattenr:b,unflattenl:y,defaultContext:o,realContext:u,positiveContext:l}}),fbe="simplify",hbe=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],dbe=G(fbe,hbe,t=>{var{config:e,typed:r,parse:n,add:i,subtract:a,multiply:s,divide:o,pow:u,isZero:l,equal:c,resolve:f,simplifyConstant:h,simplifyCore:p,fraction:v,bignumber:m,mathWithTransform:b,matrix:y,AccessorNode:S,ArrayNode:x,ConstantNode:A,FunctionNode:_,IndexNode:w,ObjectNode:C,OperatorNode:E,ParenthesisNode:N,SymbolNode:M}=t,{hasProperty:O,isCommutative:F,isAssociative:U,mergeContext:V,flatten:H,unflattenr:I,unflattenl:P,createMakeNodeFunction:K,defaultContext:$,realContext:se,positiveContext:he}=ww({FunctionNode:_,OperatorNode:E,SymbolNode:M});r.addConversion({from:"Object",to:"Map",convert:Jl});var ne=r("simplify",{Node:me,"Node, Map":(ee,ue)=>me(ee,!1,ue),"Node, Map, Object":(ee,ue,le)=>me(ee,!1,ue,le),"Node, Array":me,"Node, Array, Map":me,"Node, Array, Map, Object":me});r.removeConversion({from:"Object",to:"Map",convert:Jl}),ne.defaultContext=$,ne.realContext=se,ne.positiveContext=he;function X(ee){return ee.transform(function(ue,le,Ee){return Hs(ue)?X(ue.content):ue})}var de={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ne.rules=[p,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Se(ee,ue){var le={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)le.l=Ee[0],le.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else le.l=ee.l,le.r=ee.r;le.l=X(n(le.l)),le.r=X(n(le.r));for(var Me of["imposeContext","repeat","assuming"])Me in ee&&(le[Me]=ee[Me]);if(ee.evaluate&&(le.evaluate=n(ee.evaluate)),U(le.l,ue)){var R=!F(le.l,ue),q;R&&(q=_e());var Y=K(le.l),pe=_e();le.expanded={},le.expanded.l=Y([le.l,pe]),H(le.expanded.l,ue),I(le.expanded.l,ue),le.expanded.r=Y([le.r,pe]),R&&(le.expandedNC1={},le.expandedNC1.l=Y([q,le.l]),le.expandedNC1.r=Y([q,le.r]),le.expandedNC2={},le.expandedNC2.l=Y([q,le.expanded.l]),le.expandedNC2.r=Y([q,le.expanded.r]))}return le}function ce(ee,ue){for(var le=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:zh(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Me=Ee.consoleDebug;ue=ce(ue||ne.rules,Ee.context);var R=f(ee,le);R=X(R);for(var q={},Y=R.toString({parenthesis:"all"});!q[Y];){q[Y]=!0,xe=0;var pe=Y;Me&&console.log("Working on: ",Y);for(var ge=0;ge ").concat(ue[ge].r.toString()))),Me){var Be=R.toString({parenthesis:"all"});Be!==pe&&(console.log("Applying",De,"produced",Be),pe=Be)}P(R,Ee.context)}Y=R.toString({parenthesis:"all"})}return R}function we(ee,ue,le){var Ee=ee;if(ee)for(var Me=0;Me1&&(pe=R(ee.args.slice(0,Y))),Me=ee.args.slice(Y),Ee=Me.length===1?Me[0]:R(Me),le.push(R([pe,Ee]))}return le}function He(ee,ue){var le={placeholders:{}};if(!ee.placeholders&&!ue.placeholders)return le;if(ee.placeholders){if(!ue.placeholders)return ee}else return ue;for(var Ee in ee.placeholders)if(tt(ee.placeholders,Ee)&&(le.placeholders[Ee]=ee.placeholders[Ee],tt(ue.placeholders,Ee)&&!ye(ee.placeholders[Ee],ue.placeholders[Ee])))return null;for(var Me in ue.placeholders)tt(ue.placeholders,Me)&&(le.placeholders[Me]=ue.placeholders[Me]);return le}function qe(ee,ue){var le=[];if(ee.length===0||ue.length===0)return le;for(var Ee,Me=0;Me2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var pe=te(ee.args[0],ue.args[1],le);if(pe.length===0)return[];var ge=te(ee.args[1],ue.args[0],le);if(ge.length===0)return[];R=[pe,ge]}Me=J(R)}else if(ue.args.length>=2&&ee.args.length===2){for(var De=Ce(ue,le),Be=[],Pe=0;Pe2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof M){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(de[ee.name]){if(ee.name!==ue.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Me[0].placeholders[ee.name]=ue;break;case"c":case"cl":if(er(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"v":if(!er(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"vl":if(Sn(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"cd":if(CM(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"vd":if(!CM(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"ce":if(Lv(ue))Me[0].placeholders[ee.name]=ue;else return[];break;case"ve":if(!Lv(ue))Me[0].placeholders[ee.name]=ue;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!c(ee.value,ue.value))return[]}else return[];return Me}function ye(ee,ue){if(ee instanceof A&&ue instanceof A){if(!c(ee.value,ue.value))return!1}else if(ee instanceof M&&ue instanceof M){if(ee.name!==ue.name)return!1}else if(ee instanceof E&&ue instanceof E||ee instanceof _&&ue instanceof _){if(ee instanceof E){if(ee.op!==ue.op||ee.fn!==ue.fn)return!1}else if(ee instanceof _&&ee.name!==ue.name)return!1;if(ee.args.length!==ue.args.length)return!1;for(var le=0;le{var{typed:e,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:o,ArrayNode:u,ConstantNode:l,FunctionNode:c,IndexNode:f,ObjectNode:h,OperatorNode:p,SymbolNode:v}=t,{isCommutative:m,isAssociative:b,allChildren:y,createMakeNodeFunction:S}=ww({FunctionNode:c,OperatorNode:p,SymbolNode:v}),x=e("simplifyConstant",{Node:H=>C(V(H,{})),"Node, Object":function(I,P){return C(V(I,P))}});function A(H){return ld(H)?H.valueOf():H instanceof Array?H.map(A):dt(H)?i(A(H.valueOf())):H}function _(H,I,P){try{return n[H].apply(null,I)}catch{return I=I.map(A),N(n[H].apply(null,I),P)}}var w=e({Fraction:O,number:function(I){return I<0?M(new l(-I)):new l(I)},BigNumber:function(I){return I<0?M(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new u(I.valueOf().map(P=>w(P)))}});function C(H){return pr(H)?H:w(H)}function E(H,I){var P=I&&I.exactFractions!==!1;if(P&&isFinite(H)&&a){var K=a(H),$=I&&typeof I.fractionsLimit=="number"?I.fractionsLimit:1/0;if(K.valueOf()===H&&K.n<$&&K.d<$)return K}return H}var N=e({"string, Object":function(I,P){if(r.number==="BigNumber")return s===void 0&&vw(),s(I);if(r.number==="Fraction")return a===void 0&&LP(),a(I);var K=parseFloat(I);return E(K,P)},"Fraction, Object":function(I,P){return I},"BigNumber, Object":function(I,P){return I},"number, Object":function(I,P){return E(I,P)},"Complex, Object":function(I,P){return I.im!==0?I:E(I.re,P)},"Matrix, Object":function(I,P){return i(E(I.valueOf()))},"Array, Object":function(I,P){return I.map(E)}});function M(H){return new p("-","unaryMinus",[H])}function O(H){var I,P=H.s*H.n;return P<0?I=new p("-","unaryMinus",[new l(-P)]):I=new l(P),H.d===1?I:new p("/","divide",[I,new l(H.d)])}function F(H,I,P){if(!Dc(I))return new o(C(H),C(I));if(ji(H)||dt(H)){for(var K=Array.from(I.dimensions);K.length>0;)if(er(K[0])&&typeof K[0].value!="string"){var $=N(K.shift().value,P);ji(H)?H=H.items[$-1]:(H=H.valueOf()[$-1],H instanceof Array&&(H=i(H)))}else if(K.length>1&&er(K[1])&&typeof K[1].value!="string"){var se=N(K[1].value,P),he=[],ne=ji(H)?H.items:H.valueOf();for(var X of ne)if(ji(X))he.push(X.items[se-1]);else if(dt(H))he.push(X[se-1]);else break;if(he.length===ne.length)ji(H)?H=new u(he):H=i(he),K.splice(1,1);else break}else break;return K.length===I.dimensions.length?new o(C(H),I):K.length>0?(I=new f(K),new o(C(H),I)):H}if(Tg(H)&&I.dimensions.length===1&&er(I.dimensions[0])){var de=I.dimensions[0].value;return de in H.properties?H.properties[de]:new l}return new o(C(H),I)}function U(H,I,P,K){var $=I.shift(),se=I.reduce((he,ne)=>{if(!pr(ne)){var X=he.pop();if(pr(X))return[X,ne];try{return he.push(_(H,[X,ne],K)),he}catch{he.push(X)}}he.push(C(he.pop()));var de=he.length===1?he[0]:P(he);return[P([de,C(ne)])]},[$]);return se.length===1?se[0]:P([se[0],w(se[1])])}function V(H,I){switch(H.type){case"SymbolNode":return H;case"ConstantNode":switch(typeof H.value){case"number":return N(H.value,I);case"string":return H.value;default:if(!isNaN(H.value))return N(H.value,I)}return H;case"FunctionNode":if(n[H.name]&&n[H.name].rawArgs)return H;{var P=["add","multiply"];if(P.indexOf(H.name)===-1){var K=H.args.map(Ne=>V(Ne,I));if(!K.some(pr))try{return _(H.name,K,I)}catch{}if(H.name==="size"&&K.length===1&&ji(K[0])){for(var $=[],se=K[0];ji(se);)$.push(se.items.length),se=se.items[0];return i($)}return new c(H.name,K.map(C))}}case"OperatorNode":{var he=H.fn.toString(),ne,X,de=S(H);if(tn(H)&&H.isUnary())ne=[V(H.args[0],I)],pr(ne[0])?X=de(ne):X=_(he,ne,I);else if(b(H,I.context))if(ne=y(H,I.context),ne=ne.map(Ne=>V(Ne,I)),m(he,I.context)){for(var Se=[],ce=[],xe=0;xe1?(X=U(he,Se,de,I),ce.unshift(X),X=U(he,ce,de,I)):X=U(he,ne,de,I)}else X=U(he,ne,de,I);else ne=H.args.map(Ne=>V(Ne,I)),X=U(he,ne,de,I);return X}case"ParenthesisNode":return V(H.content,I);case"AccessorNode":return F(V(H.object,I),V(H.index,I),I);case"ArrayNode":{var _e=H.items.map(Ne=>V(Ne,I));return _e.some(pr)?new u(_e.map(C)):i(_e)}case"IndexNode":return new f(H.dimensions.map(Ne=>x(Ne,I)));case"ObjectNode":{var me={};for(var we in H.properties)me[we]=x(H.properties[we],I);return new h(me)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(H.type))}}return x}),TM="simplifyCore",gbe=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],ybe=G(TM,gbe,t=>{var{typed:e,parse:r,equal:n,isZero:i,add:a,subtract:s,multiply:o,divide:u,pow:l,AccessorNode:c,ArrayNode:f,ConstantNode:h,FunctionNode:p,IndexNode:v,ObjectNode:m,OperatorNode:b,ParenthesisNode:y,SymbolNode:S}=t,x=new h(0),A=new h(1),_=new h(!0),w=new h(!1);function C(O){return tn(O)&&["and","not","or"].includes(O.op)}var{hasProperty:E,isCommutative:N}=ww({FunctionNode:p,OperatorNode:b,SymbolNode:S});function M(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=F?F.context:void 0;if(E(O,"trivial",U)){if(Lo(O)&&O.args.length===1)return M(O.args[0],F);var V=!1,H=0;if(O.forEach(ce=>{++H,H===1&&(V=M(ce,F))}),H===1)return V}var I=O;if(Lo(I)){var P=She(I.name);if(P){if(I.args.length>2&&E(I,"associative",U))for(;I.args.length>2;){var K=I.args.pop(),$=I.args.pop();I.args.push(new b(P,I.name,[K,$]))}I=new b(P,I.name,I.args)}else return new p(M(I.fn),I.args.map(ce=>M(ce,F)))}if(tn(I)&&I.isUnary()){var se=M(I.args[0],F);if(I.op==="~"&&tn(se)&&se.isUnary()&&se.op==="~"||I.op==="not"&&tn(se)&&se.isUnary()&&se.op==="not"&&C(se.args[0]))return se.args[0];var he=!0;if(I.op==="-"&&tn(se)&&(se.isBinary()&&se.fn==="subtract"&&(I=new b("-","subtract",[se.args[1],se.args[0]]),he=!1),se.isUnary()&&se.op==="-"))return se.args[0];if(he)return new b(I.op,I.fn,[se])}if(tn(I)&&I.isBinary()){var ne=M(I.args[0],F),X=M(I.args[1],F);if(I.op==="+"){if(er(ne)&&i(ne.value))return X;if(er(X)&&i(X.value))return ne;tn(X)&&X.isUnary()&&X.op==="-"&&(X=X.args[0],I=new b("-","subtract",[ne,X]))}if(I.op==="-")return tn(X)&&X.isUnary()&&X.op==="-"?M(new b("+","add",[ne,X.args[0]]),F):er(ne)&&i(ne.value)?M(new b("-","unaryMinus",[X])):er(X)&&i(X.value)?ne:new b(I.op,I.fn,[ne,X]);if(I.op==="*"){if(er(ne)){if(i(ne.value))return x;if(n(ne.value,1))return X}if(er(X)){if(i(X.value))return x;if(n(X.value,1))return ne;if(N(I,U))return new b(I.op,I.fn,[X,ne],I.implicit)}return new b(I.op,I.fn,[ne,X],I.implicit)}if(I.op==="/")return er(ne)&&i(ne.value)?x:er(X)&&n(X.value,1)?ne:new b(I.op,I.fn,[ne,X]);if(I.op==="^"&&er(X)){if(i(X.value))return A;if(n(X.value,1))return ne}if(I.op==="and"){if(er(ne))if(ne.value){if(C(X))return X}else return w;if(er(X))if(X.value){if(C(ne))return ne}else return w}if(I.op==="or"){if(er(ne)){if(ne.value)return _;if(C(X))return X}if(er(X)){if(X.value)return _;if(C(ne))return ne}}return new b(I.op,I.fn,[ne,X])}if(tn(I))return new b(I.op,I.fn,I.args.map(ce=>M(ce,F)));if(ji(I))return new f(I.items.map(ce=>M(ce,F)));if($u(I))return new c(M(I.object,F),M(I.index,F));if(Dc(I))return new v(I.dimensions.map(ce=>M(ce,F)));if(Tg(I)){var de={};for(var Se in I.properties)de[Se]=M(I.properties[Se],F);return new m(de)}return I}return e(TM,{Node:M,"Node,Object":M})}),bbe="resolve",xbe=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],wbe=G(bbe,xbe,t=>{var{typed:e,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=t;function o(u,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return u;if(Sn(u)){if(c.has(u.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var h=l.get(u.name);if(pr(h)){var p=new Set(c);return p.add(u.name),o(h,l,p)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):u}else if(tn(u)){var v=u.args.map(function(b){return o(b,l,c)});return new a(u.op,u.fn,v,u.implicit)}else{if(Hs(u))return new s(o(u.content,l,c));if(Lo(u)){var m=u.args.map(function(b){return o(b,l,c)});return new i(u.name,m)}}return u.map(b=>o(b,l,c))}return e("resolve",{Node:o,"Node, Map | null | undefined":o,"Node, Object":(u,l)=>o(u,Jl(l)),"Array | Matrix":e.referToSelf(u=>l=>l.map(c=>u(c))),"Array | Matrix, null | undefined":e.referToSelf(u=>l=>l.map(c=>u(c))),"Array, Object":e.referTo("Array,Map",u=>(l,c)=>u(l,Jl(c))),"Matrix, Object":e.referTo("Matrix,Map",u=>(l,c)=>u(l,Jl(c))),"Array | Matrix, Map":e.referToSelf(u=>(l,c)=>l.map(f=>u(f,c)))})}),OM="symbolicEqual",Sbe=["parse","simplify","typed","OperatorNode"],_be=G(OM,Sbe,t=>{var{parse:e,simplify:r,typed:n,OperatorNode:i}=t;function a(s,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[s,o]),c=r(l,{},u);return er(c)&&!c.value}return n(OM,{"Node, Node":a,"Node, Node, Object":a})}),FM="derivative",Abe=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Dbe=G(FM,Abe,t=>{var{typed:e,config:r,parse:n,simplify:i,equal:a,isZero:s,numeric:o,ConstantNode:u,FunctionNode:l,OperatorNode:c,ParenthesisNode:f,SymbolNode:h}=t;function p(x,A){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},w={};b(w,x,A.name);var C=y(x,w);return _.simplify?i(C):C}e.addConversion({from:"identifier",to:"SymbolNode",convert:n});var v=e(FM,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p});e.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),v._simplify=!0,v.toTex=function(x){return m.apply(null,x.args)};var m=e("_derivTex",{"Node, SymbolNode":function(A,_){return er(A)&&xr(A.value)==="string"?m(n(A.value).toString(),_.toString(),1):m(A.toTex(),_.toString(),1)},"Node, ConstantNode":function(A,_){if(xr(_.value)==="string")return m(A,n(_.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,_,w){return m(A.toString(),_.name,w.value)},"string, string, number":function(A,_,w){var C;return w===1?C="{d\\over d"+_+"}":C="{d^{"+w+"}\\over d"+_+"^{"+w+"}}",C+"\\left[".concat(A,"\\right]")}}),b=e("constTag",{"Object, ConstantNode, string":function(A,_){return A[_]=!0,!0},"Object, SymbolNode, string":function(A,_,w){return _.name!==w?(A[_]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,_,w){return b(A,_.content,w)},"Object, FunctionAssignmentNode, string":function(A,_,w){return _.params.indexOf(w)===-1?(A[_]=!0,!0):b(A,_.expr,w)},"Object, FunctionNode | OperatorNode, string":function(A,_,w){if(_.args.length>0){for(var C=b(A,_.args[0],w),E=1;E<_.args.length;++E)C=b(A,_.args[E],w)&&C;if(C)return A[_]=!0,!0}return!1}}),y=e("_derivative",{"ConstantNode, Object":function(A){return S(0)},"SymbolNode, Object":function(A,_){return _[A]!==void 0?S(0):S(1)},"ParenthesisNode, Object":function(A,_){return new f(y(A.content,_))},"FunctionAssignmentNode, Object":function(A,_){return _[A]!==void 0?S(0):y(A.expr,_)},"FunctionNode, Object":function(A,_){if(_[A]!==void 0)return S(0);var w=A.args[0],C,E=!1,N=!1,M;switch(A.name){case"cbrt":E=!0,M=new c("*","multiply",[S(3),new c("^","pow",[w,new c("/","divide",[S(2),S(3)])])]);break;case"sqrt":case"nthRoot":if(A.args.length===1)E=!0,M=new c("*","multiply",[S(2),new l("sqrt",[w])]);else if(A.args.length===2)return C=new c("/","divide",[S(1),A.args[1]]),_[C]=_[A.args[1]],y(new c("^","pow",[w,C]),_);break;case"log10":C=S(10);case"log":if(!C&&A.args.length===1)M=w.clone(),E=!0;else if(A.args.length===1&&C||A.args.length===2&&_[A.args[1]]!==void 0)M=new c("*","multiply",[w.clone(),new l("log",[C||A.args[1]])]),E=!0;else if(A.args.length===2)return y(new c("/","divide",[new l("log",[w]),new l("log",[A.args[1]])]),_);break;case"pow":if(A.args.length===2)return _[C]=_[A.args[1]],y(new c("^","pow",[w,A.args[1]]),_);break;case"exp":M=new l("exp",[w.clone()]);break;case"sin":M=new l("cos",[w.clone()]);break;case"cos":M=new c("-","unaryMinus",[new l("sin",[w.clone()])]);break;case"tan":M=new c("^","pow",[new l("sec",[w.clone()]),S(2)]);break;case"sec":M=new c("*","multiply",[A,new l("tan",[w.clone()])]);break;case"csc":N=!0,M=new c("*","multiply",[A,new l("cot",[w.clone()])]);break;case"cot":N=!0,M=new c("^","pow",[new l("csc",[w.clone()]),S(2)]);break;case"asin":E=!0,M=new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])]);break;case"acos":E=!0,N=!0,M=new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])]);break;case"atan":E=!0,M=new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)]);break;case"asec":E=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acsc":E=!0,N=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acot":E=!0,N=!0,M=new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)]);break;case"sinh":M=new l("cosh",[w.clone()]);break;case"cosh":M=new l("sinh",[w.clone()]);break;case"tanh":M=new c("^","pow",[new l("sech",[w.clone()]),S(2)]);break;case"sech":N=!0,M=new c("*","multiply",[A,new l("tanh",[w.clone()])]);break;case"csch":N=!0,M=new c("*","multiply",[A,new l("coth",[w.clone()])]);break;case"coth":N=!0,M=new c("^","pow",[new l("csch",[w.clone()]),S(2)]);break;case"asinh":E=!0,M=new l("sqrt",[new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)])]);break;case"acosh":E=!0,M=new l("sqrt",[new c("-","subtract",[new c("^","pow",[w.clone(),S(2)]),S(1)])]);break;case"atanh":E=!0,M=new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])]);break;case"asech":E=!0,N=!0,M=new c("*","multiply",[w.clone(),new l("sqrt",[new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])])])]);break;case"acsch":E=!0,N=!0,M=new c("*","multiply",[new l("abs",[w.clone()]),new l("sqrt",[new c("+","add",[new c("^","pow",[w.clone(),S(2)]),S(1)])])]);break;case"acoth":E=!0,N=!0,M=new c("-","subtract",[S(1),new c("^","pow",[w.clone(),S(2)])]);break;case"abs":M=new c("/","divide",[new l(new h("abs"),[w.clone()]),w.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+A.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var O,F;E?(O="/",F="divide"):(O="*",F="multiply");var U=y(w,_);return N&&(U=new c("-","unaryMinus",[U])),new c(O,F,[U,M])},"OperatorNode, Object":function(A,_){if(_[A]!==void 0)return S(0);if(A.op==="+")return new c(A.op,A.fn,A.args.map(function(H){return y(H,_)}));if(A.op==="-"){if(A.isUnary())return new c(A.op,A.fn,[y(A.args[0],_)]);if(A.isBinary())return new c(A.op,A.fn,[y(A.args[0],_),y(A.args[1],_)])}if(A.op==="*"){var w=A.args.filter(function(H){return _[H]!==void 0});if(w.length>0){var C=A.args.filter(function(H){return _[H]===void 0}),E=C.length===1?C[0]:new c("*","multiply",C),N=w.concat(y(E,_));return new c("*","multiply",N)}return new c("+","add",A.args.map(function(H){return new c("*","multiply",A.args.map(function(I){return I===H?y(I,_):I.clone()}))}))}if(A.op==="/"&&A.isBinary()){var M=A.args[0],O=A.args[1];return _[O]!==void 0?new c("/","divide",[y(M,_),O]):_[M]!==void 0?new c("*","multiply",[new c("-","unaryMinus",[M]),new c("/","divide",[y(O,_),new c("^","pow",[O.clone(),S(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[y(M,_),O.clone()]),new c("*","multiply",[M.clone(),y(O,_)])]),new c("^","pow",[O.clone(),S(2)])])}if(A.op==="^"&&A.isBinary()){var F=A.args[0],U=A.args[1];if(_[F]!==void 0)return er(F)&&(s(F.value)||a(F.value,1))?S(0):new c("*","multiply",[A,new c("*","multiply",[new l("log",[F.clone()]),y(U.clone(),_)])]);if(_[U]!==void 0){if(er(U)){if(s(U.value))return S(0);if(a(U.value,1))return y(F,_)}var V=new c("^","pow",[F.clone(),new c("-","subtract",[U,S(1)])]);return new c("*","multiply",[U.clone(),new c("*","multiply",[y(F,_),V])])}return new c("*","multiply",[new c("^","pow",[F.clone(),U.clone()]),new c("+","add",[new c("*","multiply",[y(F,_),new c("/","divide",[U.clone(),F.clone()])]),new c("*","multiply",[y(U,_),new l("log",[F.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function S(x,A){return new u(o(x,A||r.number))}return v}),RM="rationalize",Nbe=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Ebe=G(RM,Nbe,t=>{var{config:e,typed:r,equal:n,isZero:i,add:a,subtract:s,multiply:o,divide:u,pow:l,parse:c,simplifyConstant:f,simplifyCore:h,simplify:p,fraction:v,bignumber:m,mathWithTransform:b,matrix:y,AccessorNode:S,ArrayNode:x,ConstantNode:A,FunctionNode:_,IndexNode:w,ObjectNode:C,OperatorNode:E,SymbolNode:N,ParenthesisNode:M}=t;function O(I){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,$=U(),se=F(I,P,!0,$.firstRules),he=se.variables.length,ne={exactFractions:!1},X={exactFractions:!0};if(I=se.expression,he>=1){I=V(I);var de,Se,ce=!0,xe=!1;I=p(I,$.firstRules,{},ne);for(var _e;Se=ce?$.distrDivRules:$.sucDivRules,I=p(I,Se,{},X),ce=!ce,_e=I.toString(),_e!==de;)xe=!0,de=_e;xe&&(I=p(I,$.firstRulesAgain,{},ne)),I=p(I,$.finalRules,{},ne)}var me=[],we={};return I.type==="OperatorNode"&&I.isBinary()&&I.op==="/"?(he===1&&(I.args[0]=H(I.args[0],me),I.args[1]=H(I.args[1])),K&&(we.numerator=I.args[0],we.denominator=I.args[1])):(he===1&&(I=H(I,me)),K&&(we.numerator=I,we.denominator=null)),K?(we.coefficients=me,we.variables=se.variables,we.expression=I,we):I}return r(RM,{Node:O,"Node, boolean":(I,P)=>O(I,{},P),"Node, Object":O,"Node, Object, boolean":O});function F(I,P,K,$){var se=[],he=p(I,$,P,{exactFractions:!1});K=!!K;var ne="+-*"+(K?"/":"");de(he);var X={};return X.expression=he,X.variables=se,X;function de(Se){var ce=Se.type;if(ce==="FunctionNode")throw new Error("There is an unsolved function call");if(ce==="OperatorNode")if(Se.op==="^"){if(Se.args[1].type!=="ConstantNode"||!ot(parseFloat(Se.args[1].value)))throw new Error("There is a non-integer exponent");de(Se.args[0])}else{if(ne.indexOf(Se.op)===-1)throw new Error("Operator "+Se.op+" invalid in polynomial expression");for(var xe=0;xe1;if($==="OperatorNode"&&I.isBinary()){var he=!1,ne;if(I.op==="^"&&(I.args[0].type==="ParenthesisNode"||I.args[0].type==="OperatorNode")&&I.args[1].type==="ConstantNode"&&(ne=parseFloat(I.args[1].value),he=ne>=2&&ot(ne)),he){if(ne>2){var X=I.args[0],de=new E("^","pow",[I.args[0].cloneDeep(),new A(ne-1)]);I=new E("*","multiply",[X,de])}else I=new E("*","multiply",[I.args[0],I.args[0].cloneDeep()]);se&&(K==="content"?P.content=I:P.args[K]=I)}}if($==="ParenthesisNode")V(I.content,I,"content");else if($!=="ConstantNode"&&$!=="SymbolNode")for(var Se=0;Se=0;X--)if(P[X]!==0){var de=new A(he?P[X]:Math.abs(P[X])),Se=P[X]<0?"-":"+";if(X>0){var ce=new N(se);if(X>1){var xe=new A(X);ce=new E("^","pow",[ce,xe])}P[X]===-1&&he?de=new E("-","unaryMinus",[ce]):Math.abs(P[X])===1?de=ce:de=new E("*","multiply",[de,ce])}he?ne=de:Se==="+"?ne=new E("+","add",[ne,de]):ne=new E("-","subtract",[ne,de]),he=!1}if(he)return new A(0);return ne;function _e(me,we,Ne){var Ce=me.type;if(Ce==="FunctionNode")throw new Error("There is an unsolved function call");if(Ce==="OperatorNode"){if("+-*^".indexOf(me.op)===-1)throw new Error("Operator "+me.op+" invalid");if(we!==null){if((me.fn==="unaryMinus"||me.fn==="pow")&&we.fn!=="add"&&we.fn!=="subtract"&&we.fn!=="multiply")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="multiply")&&we.fn!=="add"&&we.fn!=="subtract")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="unaryMinus")&&Ne.noFil!==0)throw new Error("Invalid "+me.op+" placing")}(me.op==="^"||me.op==="*")&&(Ne.fire=me.op);for(var He=0;He$&&(P[qe]=0),P[qe]+=Ne.cte*(Ne.oper==="+"?1:-1),$=Math.max(qe,$);return}Ne.cte=qe,Ne.fire===""&&(P[0]+=Ne.cte*(Ne.oper==="+"?1:-1))}else throw new Error("Type "+Ce+" is not allowed")}}}),BM="zpk2tf",Cbe=["typed","add","multiply","Complex","number"],Mbe=G(BM,Cbe,t=>{var{typed:e,add:r,multiply:n,Complex:i,number:a}=t;return e(BM,{"Array,Array,number":function(l,c,f){return s(l,c,f)},"Array,Array":function(l,c){return s(l,c,1)},"Matrix,Matrix,number":function(l,c,f){return s(l.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(l,c){return s(l.valueOf(),c.valueOf(),1)}});function s(u,l,c){u.some(S=>S.type==="BigNumber")&&(u=u.map(S=>a(S))),l.some(S=>S.type==="BigNumber")&&(l=l.map(S=>a(S)));for(var f=[i(1,0)],h=[i(1,0)],p=0;p=0&&f-h{var{typed:e,add:r,multiply:n,Complex:i,divide:a,matrix:s}=t;return e(PM,{"Array, Array":function(c,f){var h=u(512);return o(c,f,h)},"Array, Array, Array":function(c,f,h){return o(c,f,h)},"Array, Array, number":function(c,f,h){if(h<0)throw new Error("w must be a positive number");var p=u(h);return o(c,f,p)},"Matrix, Matrix":function(c,f){var h=u(512),{w:p,h:v}=o(c.valueOf(),f.valueOf(),h);return{w:s(p),h:s(v)}},"Matrix, Matrix, Matrix":function(c,f,h){var{h:p}=o(c.valueOf(),f.valueOf(),h.valueOf());return{h:s(p),w:s(h)}},"Matrix, Matrix, number":function(c,f,h){if(h<0)throw new Error("w must be a positive number");var p=u(h),{h:v}=o(c.valueOf(),f.valueOf(),p);return{h:s(v),w:s(p)}}});function o(l,c,f){for(var h=[],p=[],v=0;v{var{classes:e}=t;return function(n,i){var a=e[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}}),Pbe="replacer",Ibe=[],kbe=G(Pbe,Ibe,()=>function(e,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:r}),Lbe="12.4.0",$be=G("true",[],()=>!0),zbe=G("false",[],()=>!1),Ube=G("null",[],()=>null),qbe=Pi("Infinity",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1/0):1/0}),Hbe=Pi("NaN",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(NaN):NaN}),Wbe=Pi("pi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?bw(r):iie}),Vbe=Pi("tau",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Nce(r):aie}),Ybe=Pi("e",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Ace(r):sie}),jbe=Pi("phi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Dce(r):oie}),Gbe=Pi("LN2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).ln():Math.LN2}),Xbe=Pi("LN10",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(10).ln():Math.LN10}),Zbe=Pi("LOG2E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),Kbe=Pi("LOG10E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),Jbe=Pi("SQRT1_2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),Qbe=Pi("SQRT2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),e1e=Pi("i",["Complex"],t=>{var{Complex:e}=t;return e.I}),eDe=G("PI",["pi"],t=>{var{pi:e}=t;return e}),tDe=G("E",["e"],t=>{var{e}=t;return e}),t1e=G("version",[],()=>Lbe);function Pi(t,e,r){return G(t,e,r,{recreateOnConfigChange:!0})}var r1e=Dt("speedOfLight","299792458","m s^-1"),n1e=Dt("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),i1e=Dt("planckConstant","6.62607015e-34","J s"),a1e=Dt("reducedPlanckConstant","1.0545718176461565e-34","J s"),s1e=Dt("magneticConstant","1.25663706212e-6","N A^-2"),o1e=Dt("electricConstant","8.8541878128e-12","F m^-1"),u1e=Dt("vacuumImpedance","376.730313667","ohm"),l1e=Dt("coulomb","8.987551792261171e9","N m^2 C^-2"),c1e=Dt("elementaryCharge","1.602176634e-19","C"),f1e=Dt("bohrMagneton","9.2740100783e-24","J T^-1"),h1e=Dt("conductanceQuantum","7.748091729863649e-5","S"),d1e=Dt("inverseConductanceQuantum","12906.403729652257","ohm"),p1e=Dt("magneticFluxQuantum","2.0678338484619295e-15","Wb"),m1e=Dt("nuclearMagneton","5.0507837461e-27","J T^-1"),v1e=Dt("klitzing","25812.807459304513","ohm"),g1e=Dt("bohrRadius","5.29177210903e-11","m"),y1e=Dt("classicalElectronRadius","2.8179403262e-15","m"),b1e=Dt("electronMass","9.1093837015e-31","kg"),x1e=Dt("fermiCoupling","1.1663787e-5","GeV^-2"),w1e=qg("fineStructure",.0072973525693),S1e=Dt("hartreeEnergy","4.3597447222071e-18","J"),_1e=Dt("protonMass","1.67262192369e-27","kg"),A1e=Dt("deuteronMass","3.3435830926e-27","kg"),D1e=Dt("neutronMass","1.6749271613e-27","kg"),N1e=Dt("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),E1e=Dt("rydberg","10973731.568160","m^-1"),C1e=Dt("thomsonCrossSection","6.6524587321e-29","m^2"),M1e=qg("weakMixingAngle",.2229),T1e=qg("efimovFactor",22.7),O1e=Dt("atomicMass","1.66053906660e-27","kg"),F1e=Dt("avogadro","6.02214076e23","mol^-1"),R1e=Dt("boltzmann","1.380649e-23","J K^-1"),B1e=Dt("faraday","96485.33212331001","C mol^-1"),P1e=Dt("firstRadiation","3.7417718521927573e-16","W m^2"),I1e=Dt("loschmidt","2.686780111798444e25","m^-3"),k1e=Dt("gasConstant","8.31446261815324","J K^-1 mol^-1"),L1e=Dt("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),$1e=Dt("molarVolume","0.022413969545014137","m^3 mol^-1"),z1e=qg("sackurTetrode",-1.16487052358),U1e=Dt("secondRadiation","0.014387768775039337","m K"),q1e=Dt("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),H1e=Dt("wienDisplacement","2.897771955e-3","m K"),W1e=Dt("molarMass","0.99999999965e-3","kg mol^-1"),V1e=Dt("molarMassC12","11.9999999958e-3","kg mol^-1"),Y1e=Dt("gravity","9.80665","m s^-2"),j1e=Dt("planckLength","1.616255e-35","m"),G1e=Dt("planckMass","2.176435e-8","kg"),X1e=Dt("planckTime","5.391245e-44","s"),Z1e=Dt("planckCharge","1.87554603778e-18","C"),K1e=Dt("planckTemperature","1.416785e+32","K");function Dt(t,e,r){var n=["config","Unit","BigNumber"];return G(t,n,i=>{var{config:a,Unit:s,BigNumber:o}=i,u=a.number==="BigNumber"?new o(e):parseFloat(e),l=new s(u,r);return l.fixPrefix=!0,l})}function qg(t,e){var r=["config","BigNumber"];return G(t,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(e):e})}var J1e="apply",Q1e=["typed","isInteger"],exe=G(J1e,Q1e,t=>{var{typed:e,isInteger:r}=t,n=dw({typed:e,isInteger:r});return e("apply",{"...any":function(a){var s=a[1];Ct(s)?a[1]=s-1:Mt(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(o){throw si(o)}}})},{isTransformFunction:!0}),txe="column",rxe=["typed","Index","matrix","range"],nxe=G(txe,rxe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t,a=IP({typed:e,Index:r,matrix:n,range:i});return e("column",{"...any":function(o){var u=o.length-1,l=o[u];Ct(l)&&(o[u]=l-1);try{return a.apply(null,o)}catch(c){throw si(c)}}})},{isTransformFunction:!0});function Sw(t,e,r){var n=t.filter(function(u){return Sn(u)&&!(u.name in e)&&!r.has(u.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+t+'"');var i=n.name,a=new Map,s=new gB(r,a,new Set([i])),o=t.compile();return function(l){return a.set(i,l),o.evaluate(s)}}var ixe="filter",axe=["typed"],sxe=G(ixe,axe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=Sw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("filter",{"Array, function":IM,"Matrix, function":function(a,s){return a.create(IM(a.toArray(),s))},"Array, RegExp":xv,"Matrix, RegExp":function(a,s){return a.create(xv(a.toArray(),s))}});return r},{isTransformFunction:!0});function IM(t,e){return hB(t,function(r,n,i){return Tc(e,r,[n+1],i,"filter")})}var oxe="forEach",uxe=["typed"],lxe=G(oxe,uxe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=Sw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("forEach",{"Array | Matrix, function":function(a,s){var o=function u(l,c){if(Array.isArray(l))Fg(l,function(f,h){u(f,c.concat(h+1))});else return Tc(s,l,c,a,"forEach")};o(a.valueOf(),[])}});return r},{isTransformFunction:!0}),cxe="index",fxe=["Index","getMatrixDataType"],hxe=G(cxe,fxe,t=>{var{Index:e,getMatrixDataType:r}=t;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(o&&o.isSet===!0)o=o.map(function(l){return l-1});else if(sr(o)||dt(o))r(o)!=="boolean"&&(o=o.map(function(l){return l-1}));else if(Ct(o))o--;else if(Mt(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=o}var u=new e;return e.apply(u,i),u}},{isTransformFunction:!0}),dxe="map",pxe=["typed"],mxe=G(dxe,pxe,t=>{var{typed:e}=t;function r(i,a,s){var o,u;return i[0]&&(o=i[0].compile().evaluate(s)),i[1]&&(Sn(i[1])||cd(i[1])?u=i[1].compile().evaluate(s):u=Sw(i[1],a,s)),n(o,u)}r.rawArgs=!0;var n=e("map",{"Array, function":function(a,s){return kM(a,s,a)},"Matrix, function":function(a,s){return a.create(kM(a.valueOf(),s,a))}});return r},{isTransformFunction:!0});function kM(t,e,r){function n(i,a){return Array.isArray(i)?zs(i,function(s,o){return n(s,a.concat(o+1))}):Tc(e,i,a,r,"map")}return n(t,[])}function Yo(t){if(t.length===2&&na(t[0])){t=t.slice();var e=t[1];Ct(e)?t[1]=e-1:Mt(e)&&(t[1]=e.minus(1))}return t}var vxe="max",gxe=["typed","config","numeric","larger"],yxe=G(vxe,gxe,t=>{var{typed:e,config:r,numeric:n,larger:i}=t,a=YP({typed:e,config:r,numeric:n,larger:i});return e("max",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),bxe="mean",xxe=["typed","add","divide"],wxe=G(bxe,xxe,t=>{var{typed:e,add:r,divide:n}=t,i=tI({typed:e,add:r,divide:n});return e("mean",{"...any":function(s){s=Yo(s);try{return i.apply(null,s)}catch(o){throw si(o)}}})},{isTransformFunction:!0}),Sxe="min",_xe=["typed","config","numeric","smaller"],Axe=G(Sxe,_xe,t=>{var{typed:e,config:r,numeric:n,smaller:i}=t,a=jP({typed:e,config:r,numeric:n,smaller:i});return e("min",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Dxe="range",Nxe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Exe=G(Dxe,Nxe,t=>{var{typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c}=t,f=zP({typed:e,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:o,largerEq:u,add:l,isPositive:c});return e("range",{"...any":function(p){var v=p.length-1,m=p[v];return typeof m!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Cxe="row",Mxe=["typed","Index","matrix","range"],Txe=G(Cxe,Mxe,t=>{var{typed:e,Index:r,matrix:n,range:i}=t,a=UP({typed:e,Index:r,matrix:n,range:i});return e("row",{"...any":function(o){var u=o.length-1,l=o[u];Ct(l)&&(o[u]=l-1);try{return a.apply(null,o)}catch(c){throw si(c)}}})},{isTransformFunction:!0}),Oxe="subset",Fxe=["typed","matrix","zeros","add"],Rxe=G(Oxe,Fxe,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t,a=qP({typed:e,matrix:r,zeros:n,add:i});return e("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Bxe="concat",Pxe=["typed","matrix","isInteger"],Ixe=G(Bxe,Pxe,t=>{var{typed:e,matrix:r,isInteger:n}=t,i=PP({typed:e,matrix:r,isInteger:n});return e("concat",{"...any":function(s){var o=s.length-1,u=s[o];Ct(u)?s[o]=u-1:Mt(u)&&(s[o]=u.minus(1));try{return i.apply(null,s)}catch(l){throw si(l)}}})},{isTransformFunction:!0}),LM="diff",kxe=["typed","matrix","subtract","number","bignumber"],Lxe=G(LM,kxe,t=>{var{typed:e,matrix:r,subtract:n,number:i,bignumber:a}=t,s=kP({typed:e,matrix:r,subtract:n,number:i,bignumber:a});return e(LM,{"...any":function(u){u=Yo(u);try{return s.apply(null,u)}catch(l){throw si(l)}}})},{isTransformFunction:!0}),$xe="std",zxe=["typed","map","sqrt","variance"],Uxe=G($xe,zxe,t=>{var{typed:e,map:r,sqrt:n,variance:i}=t,a=iI({typed:e,map:r,sqrt:n,variance:i});return e("std",{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),$M="sum",qxe=["typed","config","add","numeric"],Hxe=G($M,qxe,t=>{var{typed:e,config:r,add:n,numeric:i}=t,a=QP({typed:e,config:r,add:n,numeric:i});return e($M,{"...any":function(o){o=Yo(o);try{return a.apply(null,o)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),Wxe="quantileSeq",Vxe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Yxe=G(Wxe,Vxe,t=>{var{typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h}=t,p=nI({typed:e,bignumber:r,add:n,subtract:i,divide:a,multiply:s,partitionSelect:o,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:h});return e("quantileSeq",{"Array | Matrix, number | BigNumber":p,"Array | Matrix, number | BigNumber, number":(m,b,y)=>p(m,b,v(y)),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(m,b,y,S)=>p(m,b,y,v(S)),"Array | Matrix, Array | Matrix":p,"Array | Matrix, Array | Matrix, number":(m,b,y)=>p(m,b,v(y)),"Array | Matrix, Array | Matrix, boolean":p,"Array | Matrix, Array | Matrix, boolean, number":(m,b,y,S)=>p(m,b,y,v(S))});function v(m){return Yo([[],m])[1]}},{isTransformFunction:!0}),zM="cumsum",jxe=["typed","add","unaryPlus"],Gxe=G(zM,jxe,t=>{var{typed:e,add:r,unaryPlus:n}=t,i=eI({typed:e,add:r,unaryPlus:n});return e(zM,{"...any":function(s){if(s.length===2&&na(s[0])){var o=s[1];Ct(o)?s[1]=o-1:Mt(o)&&(s[1]=o.minus(1))}try{return i.apply(null,s)}catch(u){throw si(u)}}})},{isTransformFunction:!0}),UM="variance",Xxe=["typed","add","subtract","multiply","divide","apply","isNaN"],Zxe=G(UM,Xxe,t=>{var{typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o}=t,u=rI({typed:e,add:r,subtract:n,multiply:i,divide:a,apply:s,isNaN:o});return e(UM,{"...any":function(c){c=Yo(c);try{return u.apply(null,c)}catch(f){throw si(f)}}})},{isTransformFunction:!0}),qM="print",Kxe=["typed","matrix","zeros","add"],Jxe=G(qM,Kxe,t=>{var{typed:e,matrix:r,zeros:n,add:i}=t,a=WP({typed:e,matrix:r,zeros:n,add:i});return e(qM,{"string, Object | Array":function(u,l){return a(s(u),l)},"string, Object | Array, number | Object":function(u,l,c){return a(s(u),l,c)}});function s(o){return o.replace(HP,u=>{var l=u.slice(1).split("."),c=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),Qxe="and",ewe=["typed","matrix","zeros","add","equalScalar","not","concat"],twe=G(Qxe,ewe,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=VP({typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s});function u(l,c,f){var h=l[0].compile().evaluate(f);if(!na(h)&&!o(h,!0))return!1;var p=l[1].compile().evaluate(f);return o(h,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),rwe="or",nwe=["typed","matrix","equalScalar","DenseMatrix","concat"],iwe=G(rwe,nwe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=BP({typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function o(u,l,c){var f=u[0].compile().evaluate(c);if(!na(f)&&s(f,!1))return!0;var h=u[1].compile().evaluate(c);return s(f,h)}return o.rawArgs=!0,o},{isTransformFunction:!0}),awe="bitAnd",swe=["typed","matrix","zeros","add","equalScalar","not","concat"],owe=G(awe,swe,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s}=t,o=FP({typed:e,matrix:r,equalScalar:n,zeros:i,not:a,concat:s});function u(l,c,f){var h=l[0].compile().evaluate(f);if(!na(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var p=l[1].compile().evaluate(f);return o(h,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),uwe="bitOr",lwe=["typed","matrix","equalScalar","DenseMatrix","concat"],cwe=G(uwe,lwe,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=t,s=RP({typed:e,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function o(u,l,c){var f=u[0].compile().evaluate(c);if(!na(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var h=u[1].compile().evaluate(c);return s(f,h)}return o.rawArgs=!0,o},{isTransformFunction:!0}),Ge=Rne({config:Re}),wr=kne({}),HM=Ybe({BigNumber:Ge,config:Re}),fwe=zbe({}),hwe=w1e({BigNumber:Ge,config:Re}),Zu=Une({}),sI=e1e({Complex:wr}),dwe=qbe({BigNumber:Ge,config:Re}),pwe=Xbe({BigNumber:Ge,config:Re}),mwe=Kbe({BigNumber:Ge,config:Re}),Hg=jne({}),vwe=Hbe({BigNumber:Ge,config:Re}),gwe=Ube({}),ywe=jbe({BigNumber:Ge,config:Re}),bwe=Wne({}),oI=kre({}),xwe=Jbe({BigNumber:Ge,config:Re}),wwe=z1e({BigNumber:Ge,config:Re}),uI=Vbe({BigNumber:Ge,config:Re}),Swe=$be({}),_we=t1e({}),Tt=Kne({Matrix:Hg}),Awe=T1e({BigNumber:Ge,config:Re}),Dwe=Gbe({BigNumber:Ge,config:Re}),v1=Wbe({BigNumber:Ge,config:Re}),Nwe=kbe({}),Ewe=Qbe({BigNumber:Ge,config:Re}),re=Rre({BigNumber:Ge,Complex:wr,DenseMatrix:Tt,Fraction:Zu}),_w=uae({BigNumber:Ge,config:Re,typed:re}),Cwe=M1e({BigNumber:Ge,config:Re}),oi=cae({typed:re}),Mwe=kce({Complex:wr,config:Re,typed:re}),Twe=Uce({BigNumber:Ge,typed:re}),Owe=Vce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),yn=pae({typed:re}),Fwe=toe({typed:re}),Rwe=Kce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),Bwe=rfe({typed:re}),lI=afe({typed:re}),Pwe=lfe({Complex:wr,config:Re,typed:re}),Fi=qie({BigNumber:Ge,typed:re}),Iwe=Gse({typed:re}),kwe=$ie({typed:re}),Lwe=Qne({typed:re}),Wg=mye({typed:re}),Vg=Vie({Complex:wr,typed:re}),Ku=noe({typed:re}),Aw=ffe({typed:re}),$we=mfe({BigNumber:Ge,typed:re}),zwe=bfe({BigNumber:Ge,typed:re}),Uwe=Mae({typed:re}),zt=Eie({config:Re,typed:re}),qwe=Due({typed:re}),cI=Oae({typed:re}),Hwe=Rae({Complex:wr,typed:re}),Wwe=_oe({typed:re}),Vwe=Eoe({typed:re}),pd=Iue({typed:re}),Dw=Toe({typed:re}),Ywe=que({format:pd,typed:re}),Nw=aoe({typed:re}),xi=tie({typed:re}),jo=hie({typed:re}),Ju=yie({typed:re}),Ra=xie({typed:re}),jwe=Zbe({BigNumber:Ge,config:Re}),Gwe=wye({Complex:wr,typed:re}),Xwe=pse({Complex:wr,config:Re,typed:re}),fI=vse({Complex:wr,config:Re,typed:re}),Qu=Ioe({typed:re}),Xr=bse({typed:re}),$v=loe({typed:re}),Xs=Pie({typed:re}),Zwe=zue({format:pd,typed:re}),Kwe=Gye({config:Re,typed:re}),Jwe=WP({typed:re}),Qwe=Zye({config:Re,typed:re}),Ew=ooe({typed:re}),eSe=_fe({BigNumber:Ge,typed:re}),hI=Dse({BigNumber:Ge,Fraction:Zu,complex:Vg,typed:re}),Yg=Efe({typed:re}),Zs=Tie({Matrix:Hg,equalScalar:zt,typed:re}),tSe=iae({typed:re}),rSe=Tse({typed:re}),nSe=kie({typed:re}),ua=vae({typed:re}),iSe=Ofe({typed:re}),dI=Aie({typed:re}),aSe=$ce({Complex:wr,config:Re,typed:re}),sSe=jce({BigNumber:Ge,typed:re}),Cw=dw({isInteger:xi,typed:re}),oSe=Xce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),uSe=Lue({format:pd,typed:re}),lSe=gye({typed:re}),cSe=dfe({typed:re}),fSe=wfe({BigNumber:Ge,typed:re}),md=Sie({typed:re}),hSe=jue({typed:re}),dSe=Jye({config:Re,typed:re}),pSe=Dfe({BigNumber:Ge,typed:re}),mSe=Mfe({typed:re}),vSe=Rce({SparseMatrix:Zs,typed:re}),Ba=Cse({Complex:wr,config:Re,typed:re}),gSe=Bfe({typed:re}),ts=sae({typed:re}),ySe=Hce({BigNumber:Ge,Complex:wr,config:Re,typed:re}),bSe=gfe({BigNumber:Ge,typed:re}),Fc=Gie({Fraction:Zu,typed:re}),el=pie({typed:re}),Ye=Zie({DenseMatrix:Tt,Matrix:Hg,SparseMatrix:Zs,typed:re}),xSe=Jie({isZero:Ra,matrix:Ye,typed:re}),wSe=Fue({isNaN:md,isNumeric:el,typed:re}),Aa=Zue({bignumber:Fi,fraction:Fc,number:Xs}),pI=Bue({config:Re,multiplyScalar:Xr,numeric:Aa,typed:re}),mI=Woe({isInteger:xi,matrix:Ye,typed:re}),Rn=eue({matrix:Ye,config:Re,typed:re}),SSe=rue({matrix:Ye,typed:re}),vd=uue({matrix:Ye,typed:re}),vI=Bse({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),On=hue({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),_Se=Qce({Complex:wr,config:Re,typed:re}),gI=yae({BigNumber:Ge,Complex:wr,Fraction:Zu,config:Re,isNegative:jo,matrix:Ye,typed:re,unaryMinus:ts}),Zt=PP({isInteger:xi,matrix:Ye,typed:re}),ASe=voe({prod:pI,size:Rn,typed:re}),Mw=cue({conj:Ku,transpose:vd,typed:re}),yI=xoe({DenseMatrix:Tt,SparseMatrix:Zs,matrix:Ye,typed:re}),Lr=Jue({numeric:Aa,typed:re}),gd=hle({DenseMatrix:Tt,concat:Zt,divideScalar:Lr,equalScalar:zt,matrix:Ye,typed:re}),la=$le({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),yd=Doe({matrix:Ye,typed:re}),DSe=vie({isNumeric:el,typed:re}),Go=Foe({BigNumber:Ge,DenseMatrix:Tt,SparseMatrix:Zs,config:Re,matrix:Ye,typed:re}),NSe=Boe({matrix:Ye,multiplyScalar:Xr,typed:re}),jg=Qle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),ESe=Ale({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),bI=ple({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),Tw=rae({flatten:yd,matrix:Ye,size:Rn,typed:re}),CSe=_se({BigNumber:Ge,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),MSe=Uoe({BigNumber:Ge,config:Re,matrix:Ye,typed:re}),Ow=vde({addScalar:yn,complex:Vg,conj:Ku,divideScalar:Lr,equal:la,identity:Go,isZero:Ra,matrix:Ye,multiplyScalar:Xr,sign:hI,sqrt:Ba,subtractScalar:ua,typed:re,unaryMinus:ts,zeros:On}),TSe=joe({config:Re,matrix:Ye}),OSe=Nle({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),Rc=rle({BigNumber:Ge,DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),ti=Wle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),Gr=Fse({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,subtractScalar:ua,typed:re,unaryMinus:ts}),FSe=Vue({concat:Zt,matrix:Ye,typed:re}),RSe=ice({DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,typed:re}),Fw=vle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),BSe=hoe({DenseMatrix:Tt,concat:Zt,matrix:Ye,typed:re}),Ht=rhe({DenseMatrix:Tt,SparseMatrix:Zs,addScalar:yn,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),PSe=ofe({BigNumber:Ge,DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),ISe=FP({concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),kSe=RP({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),LSe=Qse({DenseMatrix:Tt,concat:Zt,matrix:Ye,typed:re}),$Se=ibe({addScalar:yn,combinations:Wg,divideScalar:Lr,isInteger:xi,isNegative:jo,multiplyScalar:Xr,typed:re}),tl=Ole({BigNumber:Ge,DenseMatrix:Tt,Fraction:Zu,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,typed:re}),xI=kle({concat:Zt,matrix:Ye,typed:re}),zSe=eI({add:Ht,typed:re,unaryPlus:_w}),Rw=rce({equal:la,typed:re}),USe=kP({matrix:Ye,number:Xs,subtract:Gr,typed:re}),qSe=J0e({abs:oi,addScalar:yn,deepEqual:Rw,divideScalar:Lr,multiplyScalar:Xr,sqrt:Ba,subtractScalar:ua,typed:re}),Gg=uhe({addScalar:yn,conj:Ku,multiplyScalar:Xr,size:Rn,typed:re}),HSe=qle({compareText:xI,isZero:Ra,typed:re}),wI=MP({DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,round:Rc,typed:re,zeros:On}),WSe=use({BigNumber:Ge,DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,round:Rc,typed:re,zeros:On}),VSe=ihe({abs:oi,addScalar:yn,divideScalar:Lr,isPositive:Ju,multiplyScalar:Xr,smaller:ti,sqrt:Ba,typed:re}),SI=pce({DenseMatrix:Tt,smaller:ti}),qn=gce({ImmutableDenseMatrix:SI,getMatrixDataType:Dw}),ri=Zle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),Bw=ile({Complex:wr,config:Re,divideScalar:Lr,typed:re}),YSe=yle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),jSe=eae({flatten:yd,matrix:Ye,size:Rn,typed:re}),GSe=jP({config:Re,numeric:Aa,smaller:ti,typed:re}),_I=TP({DenseMatrix:Tt,concat:Zt,config:Re,equalScalar:zt,matrix:Ye,round:Rc,typed:re,zeros:On}),lr=wse({addScalar:yn,dot:Gg,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,typed:re}),XSe=ule({Complex:wr,config:Re,divideScalar:Lr,typed:re}),ZSe=BP({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),Xg=oce({compare:tl,isNaN:md,isNumeric:el,typed:re}),KSe=Cle({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re,zeros:On}),AI=zde({SparseMatrix:Zs,abs:oi,add:Ht,divideScalar:Lr,larger:ri,largerEq:jg,multiply:lr,subtract:Gr,transpose:vd,typed:re}),Ii=qP({add:Ht,matrix:Ye,typed:re,zeros:On}),Pw=QP({add:Ht,config:Re,numeric:Aa,typed:re}),JSe=fhe({add:Ht,matrix:Ye,typed:re}),DI=xle({DenseMatrix:Tt,divideScalar:Lr,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re}),QSe=Mbe({Complex:wr,add:Ht,multiply:lr,number:Xs,typed:re}),Iw=Eae({DenseMatrix:Tt,config:Re,equalScalar:zt,matrix:Ye,round:Rc,typed:re,zeros:On}),rs=Ble({compare:tl,typed:re}),e_e=sbe({addScalar:yn,combinations:Wg,isInteger:xi,isNegative:jo,isPositive:Ju,larger:ri,typed:re}),t_e=yoe({matrix:Ye,multiply:lr,subtract:Gr,typed:re}),NI=C0e({divideScalar:Lr,isZero:Ra,matrix:Ye,multiply:lr,subtractScalar:ua,typed:re,unaryMinus:ts}),r_e=zse({concat:Zt,equalScalar:zt,matrix:Ye,multiplyScalar:Xr,typed:re}),EI=xce({larger:ri,smaller:ti}),CI=Iae({Complex:wr,DenseMatrix:Tt,ceil:Iw,equalScalar:zt,floor:wI,matrix:Ye,typed:re,zeros:On}),MI=dhe({Index:qn,typed:re}),n_e=tye({abs:oi,add:Ht,addScalar:yn,config:Re,divideScalar:Lr,equalScalar:zt,flatten:yd,isNumeric:el,isZero:Ra,matrix:Ye,multiply:lr,multiplyScalar:Xr,smaller:ti,subtract:Gr,typed:re}),i_e=Ise({BigNumber:Ge,add:Ht,config:Re,equal:la,isInteger:xi,mod:_I,smaller:ti,typed:re,xgcd:vI}),a_e=hse({concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),s_e=sle({Complex:wr,config:Re,divideScalar:Lr,log:Bw,typed:re}),kw=YP({config:Re,larger:ri,numeric:Aa,typed:re}),o_e=Ife({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),u_e=zfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),l_e=Wfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),c_e=Gfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),yc=jle({DenseMatrix:Tt,concat:Zt,config:Re,matrix:Ye,typed:re}),f_e=lce({compare:tl,compareNatural:rs,matrix:Ye,typed:re}),h_e=VP({concat:Zt,equalScalar:zt,matrix:Ye,not:$v,typed:re,zeros:On}),bc=zP({bignumber:Fi,matrix:Ye,add:Ht,config:Re,isPositive:Ju,larger:ri,largerEq:jg,smaller:ti,smallerEq:yc,typed:re}),d_e=UP({Index:qn,matrix:Ye,range:bc,typed:re}),TI=Lfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),p_e=Yfe({Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),OI=Jfe({Index:qn,concat:Zt,setDifference:TI,size:Rn,subset:Ii,typed:re}),FI=_ce({FibonacciHeap:EI,addScalar:yn,equalScalar:zt}),RI=IP({Index:qn,matrix:Ye,range:bc,typed:re}),rl=T0e({abs:oi,addScalar:yn,det:NI,divideScalar:Lr,identity:Go,matrix:Ye,multiply:lr,typed:re,unaryMinus:ts}),BI=pde({DenseMatrix:Tt,Spa:FI,SparseMatrix:Zs,abs:oi,addScalar:yn,divideScalar:Lr,equalScalar:zt,larger:ri,matrix:Ye,multiplyScalar:Xr,subtractScalar:ua,typed:re,unaryMinus:ts}),m_e=F0e({Complex:wr,add:Ht,ctranspose:Mw,deepEqual:Rw,divideScalar:Lr,dot:Gg,dotDivide:gd,equal:la,inv:rl,matrix:Ye,multiply:lr,typed:re}),ca=ele({Complex:wr,config:Re,fraction:Fc,identity:Go,inv:rl,matrix:Ye,multiply:lr,number:Xs,typed:re}),PI=qfe({DenseMatrix:Tt,Index:qn,compareNatural:rs,size:Rn,subset:Ii,typed:re}),v_e=ehe({Index:qn,concat:Zt,setIntersect:PI,setSymDifference:OI,size:Rn,subset:Ii,typed:re}),g_e=U0e({abs:oi,add:Ht,identity:Go,inv:rl,map:Qu,max:kw,multiply:lr,size:Rn,sqrt:Ba,subtract:Gr,typed:re}),xt=Mce({BigNumber:Ge,Complex:wr,Fraction:Zu,abs:oi,addScalar:yn,config:Re,divideScalar:Lr,equal:la,fix:CI,format:pd,isNumeric:el,multiplyScalar:Xr,number:Xs,pow:ca,round:Rc,subtractScalar:ua}),y_e=u1e({BigNumber:Ge,Unit:xt,config:Re}),b_e=H1e({BigNumber:Ge,Unit:xt,config:Re}),x_e=O1e({BigNumber:Ge,Unit:xt,config:Re}),w_e=f1e({BigNumber:Ge,Unit:xt,config:Re}),S_e=R1e({BigNumber:Ge,Unit:xt,config:Re}),__e=h1e({BigNumber:Ge,Unit:xt,config:Re}),A_e=l1e({BigNumber:Ge,Unit:xt,config:Re}),D_e=A1e({BigNumber:Ge,Unit:xt,config:Re}),N_e=cle({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,pow:ca,typed:re}),E_e=o1e({BigNumber:Ge,Unit:xt,config:Re}),C_e=c1e({BigNumber:Ge,Unit:xt,config:Re}),M_e=$0e({abs:oi,add:Ht,identity:Go,inv:rl,multiply:lr,typed:re}),T_e=B1e({BigNumber:Ge,Unit:xt,config:Re}),II=pue({addScalar:yn,ceil:Iw,conj:Ku,divideScalar:Lr,dotDivide:gd,exp:cI,i:sI,log2:fI,matrix:Ye,multiplyScalar:Xr,pow:ca,tau:uI,typed:re}),Lw=bye({BigNumber:Ge,Complex:wr,config:Re,multiplyScalar:Xr,pow:ca,typed:re}),O_e=n1e({BigNumber:Ge,Unit:xt,config:Re}),F_e=S1e({BigNumber:Ge,Unit:xt,config:Re}),R_e=vue({conj:Ku,dotDivide:gd,fft:II,typed:re}),B_e=v1e({BigNumber:Ge,Unit:xt,config:Re}),P_e=I1e({BigNumber:Ge,Unit:xt,config:Re}),I_e=s1e({BigNumber:Ge,Unit:xt,config:Re}),k_e=W1e({BigNumber:Ge,Unit:xt,config:Re}),L_e=L1e({BigNumber:Ge,Unit:xt,config:Re}),$_e=D1e({BigNumber:Ge,Unit:xt,config:Re}),z_e=m1e({BigNumber:Ge,Unit:xt,config:Re}),U_e=Z1e({BigNumber:Ge,Unit:xt,config:Re}),q_e=j1e({BigNumber:Ge,Unit:xt,config:Re}),H_e=K1e({BigNumber:Ge,Unit:xt,config:Re}),W_e=_1e({BigNumber:Ge,Unit:xt,config:Re}),V_e=N1e({BigNumber:Ge,Unit:xt,config:Re}),Y_e=a1e({BigNumber:Ge,Unit:xt,config:Re}),j_e=E1e({BigNumber:Ge,Unit:xt,config:Re}),G_e=U1e({BigNumber:Ge,Unit:xt,config:Re}),X_e=r1e({BigNumber:Ge,Unit:xt,config:Re}),Z_e=q1e({BigNumber:Ge,Unit:xt,config:Re}),K_e=C1e({BigNumber:Ge,Unit:xt,config:Re}),J_e=F1e({BigNumber:Ge,Unit:xt,config:Re}),Q_e=g1e({BigNumber:Ge,Unit:xt,config:Re}),eAe=Pce({Unit:xt,typed:re}),_n=Z0e({divideScalar:Lr,equalScalar:zt,inv:rl,matrix:Ye,multiply:lr,typed:re}),tAe=b1e({BigNumber:Ge,Unit:xt,config:Re}),bd=_ye({gamma:Lw,typed:re}),rAe=P1e({BigNumber:Ge,Unit:xt,config:Re}),nAe=Y1e({BigNumber:Ge,Unit:xt,config:Re}),iAe=d1e({BigNumber:Ge,Unit:xt,config:Re}),kI=qde({DenseMatrix:Tt,lsolve:bI,lup:BI,matrix:Ye,slu:AI,typed:re,usolve:Fw}),aAe=p1e({BigNumber:Ge,Unit:xt,config:Re}),sAe=V1e({BigNumber:Ge,Unit:xt,config:Re}),oAe=Eye({add:Ht,divide:_n,factorial:bd,isInteger:xi,isPositive:Ju,multiply:lr,typed:re}),uAe=Mye({factorial:bd,typed:re}),lAe=G1e({BigNumber:Ge,Unit:xt,config:Re}),cAe=Wde({add:Ht,cbrt:gI,divide:_n,equalScalar:zt,im:Nw,isZero:Ra,multiply:lr,re:Ew,sqrt:Ba,subtract:Gr,typeOf:dI,typed:re,unaryMinus:ts}),fAe=Zfe({compareNatural:rs,typed:re}),hAe=Sue({abs:oi,add:Ht,bignumber:Fi,divide:_n,isNegative:jo,isPositive:Ju,larger:ri,map:Qu,matrix:Ye,max:kw,multiply:lr,smaller:ti,subtract:Gr,typed:re,unaryMinus:ts}),LI=ebe({bignumber:Fi,addScalar:yn,combinations:Wg,divideScalar:Lr,factorial:bd,isInteger:xi,isNegative:jo,larger:ri,multiplyScalar:Xr,number:Xs,pow:ca,subtractScalar:ua,typed:re}),dAe=Oce({Unit:xt,typed:re}),pAe=rbe({addScalar:yn,isInteger:xi,isNegative:jo,stirlingS2:LI,typed:re}),$I=k0e({abs:oi,add:Ht,addScalar:yn,atan:lI,bignumber:Fi,column:RI,complex:Vg,config:Re,cos:Aw,diag:yI,divideScalar:Lr,dot:Gg,equal:la,flatten:yd,im:Nw,inv:rl,larger:ri,matrix:Ye,matrixFromColumns:Tw,multiply:lr,multiplyScalar:Xr,number:Xs,qr:Ow,re:Ew,reshape:mI,sin:Yg,size:Rn,smaller:ti,sqrt:Ba,subtract:Gr,typed:re,usolve:Fw,usolveAll:DI}),mAe=x1e({BigNumber:Ge,Unit:xt,config:Re}),vAe=k1e({BigNumber:Ge,Unit:xt,config:Re}),gAe=Dye({divide:_n,dotDivide:gd,isNumeric:el,log:Bw,map:Qu,matrix:Ye,multiply:lr,sum:Pw,typed:re}),zI=tI({add:Ht,divide:_n,typed:re}),yAe=$1e({BigNumber:Ge,Unit:xt,config:Re}),bAe=i1e({BigNumber:Ge,Unit:xt,config:Re}),xAe=nI({bignumber:Fi,add:Ht,compare:tl,divide:_n,isInteger:xi,larger:ri,multiply:lr,partitionSelect:Xg,smaller:ti,smallerEq:yc,subtract:Gr,typed:re}),$w=rI({add:Ht,apply:Cw,divide:_n,isNaN:md,multiply:lr,subtract:Gr,typed:re}),wAe=y1e({BigNumber:Ge,Unit:xt,config:Re}),UI=sye({add:Ht,compare:tl,divide:_n,partitionSelect:Xg,typed:re}),SAe=dye({add:Ht,divide:_n,matrix:Ye,mean:zI,multiply:lr,pow:ca,sqrt:Ba,subtract:Gr,sum:Pw,typed:re}),_Ae=Obe({Complex:wr,add:Ht,divide:_n,matrix:Ye,multiply:lr,typed:re}),AAe=uye({abs:oi,map:Qu,median:UI,subtract:Gr,typed:re}),DAe=iI({map:Qu,sqrt:Ba,typed:re,variance:$w}),NAe=Tue({BigNumber:Ge,Complex:wr,add:Ht,config:Re,divide:_n,equal:la,factorial:bd,gamma:Lw,isNegative:jo,multiply:lr,pi:v1,pow:ca,sin:Yg,smallerEq:yc,subtract:Gr,typed:re}),zw=she({abs:oi,add:Ht,conj:Ku,ctranspose:Mw,eigs:$I,equalScalar:zt,larger:ri,matrix:Ye,multiply:lr,pow:ca,smaller:ti,sqrt:Ba,typed:re}),qI=Koe({BigNumber:Ge,DenseMatrix:Tt,SparseMatrix:Zs,addScalar:yn,config:Re,cos:Aw,matrix:Ye,multiplyScalar:Xr,norm:zw,sin:Yg,typed:re,unaryMinus:ts}),EAe=X1e({BigNumber:Ge,Unit:xt,config:Re}),HI=V0e({identity:Go,matrix:Ye,multiply:lr,norm:zw,qr:Ow,subtract:Gr,typed:re}),CAe=Xoe({multiply:lr,rotationMatrix:qI,typed:re}),WI=H0e({abs:oi,add:Ht,concat:Zt,identity:Go,index:MI,lusolve:kI,matrix:Ye,matrixFromColumns:Tw,multiply:lr,range:bc,schur:HI,subset:Ii,subtract:Gr,transpose:vd,typed:re}),MAe=j0e({matrix:Ye,multiply:lr,sylvester:WI,transpose:vd,typed:re}),Bc={},Pc={},VI={},jn=vhe({mathWithTransform:Pc}),Ic=qhe({Node:jn}),Ks=Whe({Node:jn}),nl=Yhe({Node:jn}),YI=Zhe({Node:jn}),kc=xhe({Node:jn}),jI=Nhe({Node:jn,ResultSet:oI}),GI=Che({Node:jn}),Xo=Ihe({Node:jn}),XI=Ghe({Node:jn}),TAe=Bbe({classes:VI}),Uw=Zde({math:Bc,typed:re}),ZI=Lhe({Node:jn,typed:re}),Pl=N0e({Chain:Uw,typed:re}),Lc=zhe({Node:jn,size:Rn}),$c=yhe({Node:jn,subset:Ii}),KI=Ahe({matrix:Ye,Node:jn,subset:Ii}),Zo=Qhe({Unit:xt,Node:jn,math:Bc}),Ko=tde({Node:jn,SymbolNode:Zo,math:Bc}),is=nde({AccessorNode:$c,ArrayNode:kc,AssignmentNode:KI,BlockNode:jI,ConditionalNode:GI,ConstantNode:Xo,FunctionAssignmentNode:ZI,FunctionNode:Ko,IndexNode:Lc,ObjectNode:Ic,OperatorNode:Ks,ParenthesisNode:nl,RangeNode:XI,RelationalNode:YI,SymbolNode:Zo,config:Re,numeric:Aa,typed:re}),JI=wbe({ConstantNode:Xo,FunctionNode:Ko,OperatorNode:Ks,ParenthesisNode:nl,parse:is,typed:re}),qw=vbe({bignumber:Fi,fraction:Fc,AccessorNode:$c,ArrayNode:kc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:Lc,ObjectNode:Ic,OperatorNode:Ks,SymbolNode:Zo,config:Re,mathWithTransform:Pc,matrix:Ye,typed:re}),OAe=ade({parse:is,typed:re}),Hw=ybe({AccessorNode:$c,ArrayNode:kc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:Lc,ObjectNode:Ic,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,divide:_n,equal:la,isZero:Ra,multiply:lr,parse:is,pow:ca,subtract:Gr,typed:re}),Ww=ode({parse:is,typed:re}),QI=jde({evaluate:Ww}),ek=cde({evaluate:Ww}),Zg=dbe({bignumber:Fi,fraction:Fc,AccessorNode:$c,ArrayNode:kc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:Lc,ObjectNode:Ic,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,config:Re,divide:_n,equal:la,isZero:Ra,mathWithTransform:Pc,matrix:Ye,multiply:lr,parse:is,pow:ca,resolve:JI,simplifyConstant:qw,simplifyCore:Hw,subtract:Gr,typed:re}),FAe=_be({OperatorNode:Ks,parse:is,simplify:Zg,typed:re}),RAe=ube({parse:is,typed:re}),BAe=hde({Parser:ek,typed:re}),PAe=Ebe({bignumber:Fi,fraction:Fc,AccessorNode:$c,ArrayNode:kc,ConstantNode:Xo,FunctionNode:Ko,IndexNode:Lc,ObjectNode:Ic,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,add:Ht,config:Re,divide:_n,equal:la,isZero:Ra,mathWithTransform:Pc,matrix:Ye,multiply:lr,parse:is,pow:ca,simplify:Zg,simplifyConstant:qw,simplifyCore:Hw,subtract:Gr,typed:re}),IAe=Dbe({ConstantNode:Xo,FunctionNode:Ko,OperatorNode:Ks,ParenthesisNode:nl,SymbolNode:Zo,config:Re,equal:la,isZero:Ra,numeric:Aa,parse:is,simplify:Zg,typed:re}),kAe=A0e({Help:QI,mathWithTransform:Pc,typed:re});dn(Bc,{e:HM,false:fwe,fineStructure:hwe,i:sI,Infinity:dwe,LN10:pwe,LOG10E:mwe,NaN:vwe,null:gwe,phi:ywe,SQRT1_2:xwe,sackurTetrode:wwe,tau:uI,true:Swe,E:HM,version:_we,efimovFactor:Awe,LN2:Dwe,pi:v1,replacer:Nwe,reviver:TAe,SQRT2:Ewe,typed:re,unaryPlus:_w,PI:v1,weakMixingAngle:Cwe,abs:oi,acos:Mwe,acot:Twe,acsc:Owe,addScalar:yn,arg:Fwe,asech:Rwe,asinh:Bwe,atan:lI,atanh:Pwe,bignumber:Fi,bitNot:Iwe,boolean:kwe,clone:Lwe,combinations:Wg,complex:Vg,conj:Ku,cos:Aw,cot:$we,csc:zwe,cube:Uwe,equalScalar:zt,erf:qwe,exp:cI,expm1:Hwe,filter:Wwe,forEach:Vwe,format:pd,getMatrixDataType:Dw,hex:Ywe,im:Nw,isInteger:xi,isNegative:jo,isPositive:Ju,isZero:Ra,LOG2E:jwe,lgamma:Gwe,log10:Xwe,log2:fI,map:Qu,multiplyScalar:Xr,not:$v,number:Xs,oct:Zwe,pickRandom:Kwe,print:Jwe,random:Qwe,re:Ew,sec:eSe,sign:hI,sin:Yg,splitUnit:tSe,square:rSe,string:nSe,subtractScalar:ua,tan:iSe,typeOf:dI,acosh:aSe,acsch:sSe,apply:Cw,asec:oSe,bin:uSe,chain:Pl,combinationsWithRep:lSe,cosh:cSe,csch:fSe,isNaN:md,isPrime:hSe,randomInt:dSe,sech:pSe,sinh:mSe,sparse:vSe,sqrt:Ba,tanh:gSe,unaryMinus:ts,acoth:ySe,coth:bSe,fraction:Fc,isNumeric:el,matrix:Ye,matrixFromFunction:xSe,mode:wSe,numeric:Aa,prod:pI,reshape:mI,size:Rn,squeeze:SSe,transpose:vd,xgcd:vI,zeros:On,asin:_Se,cbrt:gI,concat:Zt,count:ASe,ctranspose:Mw,diag:yI,divideScalar:Lr,dotDivide:gd,equal:la,flatten:yd,hasNumericValue:DSe,identity:Go,kron:NSe,largerEq:jg,leftShift:ESe,lsolve:bI,matrixFromColumns:Tw,nthRoot:CSe,ones:MSe,qr:Ow,resize:TSe,rightArithShift:OSe,round:Rc,smaller:ti,subtract:Gr,to:FSe,unequal:RSe,usolve:Fw,xor:BSe,add:Ht,atan2:PSe,bitAnd:ISe,bitOr:kSe,bitXor:LSe,catalan:$Se,compare:tl,compareText:xI,cumsum:zSe,deepEqual:Rw,diff:USe,distance:qSe,dot:Gg,equalText:HSe,floor:wI,gcd:WSe,hypot:VSe,larger:ri,log:Bw,lsolveAll:YSe,matrixFromRows:jSe,min:GSe,mod:_I,multiply:lr,nthRoots:XSe,or:ZSe,partitionSelect:Xg,rightLogShift:KSe,slu:AI,subset:Ii,sum:Pw,trace:JSe,usolveAll:DI,zpk2tf:QSe,ceil:Iw,compareNatural:rs,composition:e_e,cross:t_e,det:NI,dotMultiply:r_e,fix:CI,index:MI,intersect:n_e,invmod:i_e,lcm:a_e,log1p:s_e,max:kw,setCartesian:o_e,setDistinct:u_e,setIsSubset:l_e,setPowerset:c_e,smallerEq:yc,sort:f_e,and:h_e,range:bc,row:d_e,setDifference:TI,setMultiplicity:p_e,setSymDifference:OI,column:RI,inv:rl,lup:BI,pinv:m_e,pow:ca,setIntersect:PI,setUnion:v_e,sqrtm:g_e,vacuumImpedance:y_e,wienDisplacement:b_e,atomicMass:x_e,bohrMagneton:w_e,boltzmann:S_e,conductanceQuantum:__e,coulomb:A_e,deuteronMass:D_e,dotPow:N_e,electricConstant:E_e,elementaryCharge:C_e,expm:M_e,faraday:T_e,fft:II,gamma:Lw,gravitationConstant:O_e,hartreeEnergy:F_e,ifft:R_e,klitzing:B_e,loschmidt:P_e,magneticConstant:I_e,molarMass:k_e,molarPlanckConstant:L_e,neutronMass:$_e,nuclearMagneton:z_e,planckCharge:U_e,planckLength:q_e,planckTemperature:H_e,protonMass:W_e,quantumOfCirculation:V_e,reducedPlanckConstant:Y_e,rydberg:j_e,secondRadiation:G_e,speedOfLight:X_e,stefanBoltzmann:Z_e,thomsonCrossSection:K_e,avogadro:J_e,bohrRadius:Q_e,createUnit:eAe,divide:_n,electronMass:tAe,factorial:bd,firstRadiation:rAe,gravity:nAe,inverseConductanceQuantum:iAe,lusolve:kI,magneticFluxQuantum:aAe,molarMassC12:sAe,multinomial:oAe,parse:is,permutations:uAe,planckMass:lAe,polynomialRoot:cAe,resolve:JI,setSize:fAe,simplifyConstant:qw,solveODE:hAe,stirlingS2:LI,unit:dAe,bellNumbers:pAe,compile:OAe,eigs:$I,fermiCoupling:mAe,gasConstant:vAe,kldivergence:gAe,mean:zI,molarVolume:yAe,planckConstant:bAe,quantileSeq:xAe,simplifyCore:Hw,variance:$w,classicalElectronRadius:wAe,evaluate:Ww,median:UI,simplify:Zg,symbolicEqual:FAe,corr:SAe,freqz:_Ae,leafCount:RAe,mad:AAe,parser:BAe,rationalize:PAe,std:DAe,zeta:NAe,derivative:IAe,norm:zw,rotationMatrix:qI,help:kAe,planckTime:EAe,schur:HI,rotate:CAe,sylvester:WI,lyap:MAe,config:Re});dn(Pc,Bc,{filter:sxe({typed:re}),forEach:lxe({typed:re}),map:mxe({typed:re}),apply:exe({isInteger:xi,typed:re}),or:iwe({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),and:twe({add:Ht,concat:Zt,equalScalar:zt,matrix:Ye,not:$v,typed:re,zeros:On}),concat:Ixe({isInteger:xi,matrix:Ye,typed:re}),max:yxe({config:Re,larger:ri,numeric:Aa,typed:re}),print:Jxe({add:Ht,matrix:Ye,typed:re,zeros:On}),bitAnd:owe({add:Ht,concat:Zt,equalScalar:zt,matrix:Ye,not:$v,typed:re,zeros:On}),diff:Lxe({bignumber:Fi,matrix:Ye,number:Xs,subtract:Gr,typed:re}),min:Axe({config:Re,numeric:Aa,smaller:ti,typed:re}),subset:Rxe({add:Ht,matrix:Ye,typed:re,zeros:On}),bitOr:cwe({DenseMatrix:Tt,concat:Zt,equalScalar:zt,matrix:Ye,typed:re}),cumsum:Gxe({add:Ht,typed:re,unaryPlus:_w}),index:hxe({Index:qn,getMatrixDataType:Dw}),sum:Hxe({add:Ht,config:Re,numeric:Aa,typed:re}),range:Exe({bignumber:Fi,matrix:Ye,add:Ht,config:Re,isPositive:Ju,larger:ri,largerEq:jg,smaller:ti,smallerEq:yc,typed:re}),row:Txe({Index:qn,matrix:Ye,range:bc,typed:re}),column:nxe({Index:qn,matrix:Ye,range:bc,typed:re}),mean:wxe({add:Ht,divide:_n,typed:re}),quantileSeq:Yxe({add:Ht,bignumber:Fi,compare:tl,divide:_n,isInteger:xi,larger:ri,multiply:lr,partitionSelect:Xg,smaller:ti,smallerEq:yc,subtract:Gr,typed:re}),variance:Zxe({add:Ht,apply:Cw,divide:_n,isNaN:md,multiply:lr,subtract:Gr,typed:re}),std:Uxe({map:Qu,sqrt:Ba,typed:re,variance:$w})});dn(VI,{BigNumber:Ge,Complex:wr,Fraction:Zu,Matrix:Hg,Node:jn,ObjectNode:Ic,OperatorNode:Ks,ParenthesisNode:nl,Range:bwe,RelationalNode:YI,ResultSet:oI,ArrayNode:kc,BlockNode:jI,ConditionalNode:GI,ConstantNode:Xo,DenseMatrix:Tt,RangeNode:XI,Chain:Uw,FunctionAssignmentNode:ZI,SparseMatrix:Zs,IndexNode:Lc,ImmutableDenseMatrix:SI,Index:qn,AccessorNode:$c,AssignmentNode:KI,FibonacciHeap:EI,Spa:FI,Unit:xt,SymbolNode:Zo,FunctionNode:Ko,Help:QI,Parser:ek});Uw.createProxy(Bc);class ql{static compute(e,r,n){switch(e){case"inclusive":return ql.computeInclusive(r,n);case"exclusive":return ql.computeExclusive(r,n)}}static computeInclusive(e,r){return Pl(Pl(e).divide(Pl(r).add(100).done()).done()).multiply(100).done()}static computeExclusive(e,r){return Pl(e).divide(100).multiply(Pl(r).add(100).done()).done()}static getTaxValue(e,r,n){switch(e){case"inclusive":return r-ql.compute(e,r,n);case"exclusive":return ql.compute(e,r,n)-r}return 0}}window._=L9;window.ChartJS=WO;window.Pusher=z9;window.createApp=Lx;window.moment=Qe;window.Axios=FT;window.__=Hl;window.__m=w$;window.SnackBar=GR;window.FloatingNotice=jR;window.nsHooks=ZR();window.popupResolver=Fte,window.popupCloser=Rte,window.countdown=Yi;window.timespan=Bte;window.Axios.defaults.headers.common["x-requested-with"]="XMLHttpRequest";window.Axios.defaults.withCredentials=!0;const LAe=new YR,tk=new Ate,$Ae=new GR,zAe=new jR,UAe=new Ete,qAe=new Cte,rDe=window.nsHooks,rk=new class{constructor(){je(this,"breakpoint");this.breakpoint="",this.detectScreenSizes(),ev(window,"resize").subscribe(t=>this.detectScreenSizes())}detectScreenSizes(){switch(!0){case(window.outerWidth>0&&window.outerWidth<=480):this.breakpoint="xs";break;case(window.outerWidth>480&&window.outerWidth<=640):this.breakpoint="sm";break;case(window.outerWidth>640&&window.outerWidth<=1024):this.breakpoint="md";break;case(window.outerWidth>1024&&window.outerWidth<=1280):this.breakpoint="lg";break;case window.outerWidth>1280:this.breakpoint="xl";break}}},HAe=new Dte({sidebar:["xs","sm","md"].includes(rk.breakpoint)?"hidden":"visible"});tk.defineClient(FT);window.nsEvent=LAe;window.nsHttpClient=tk;window.nsSnackBar=$Ae;window.nsNotice=zAe;window.nsState=HAe;window.nsUrl=UAe;window.nsScreen=rk;window.ChartJS=WO;window.EventEmitter=YR;window.Popup=iw;window.RxJS=WG;window.FormValidation=Nte;window.nsCrudHandler=qAe;window.defineComponent=w1;window.defineAsyncComponent=oT;window.markRaw=uT;window.shallowRef=Hv;window.createApp=Lx;window.ns.insertAfterKey=Ote;window.ns.insertBeforeKey=Tte;window.nsCurrency=S$;window.nsAbbreviate=Pte;window.nsRawCurrency=_$;window.nsTruncate=Ite;window.nsTax=ql;export{xhe as $,kx as A,Q1 as B,W3 as C,Hu as D,Ite as E,Nte as F,XY as G,Bte as H,cae as I,yhe as J,kce as K,$ce as L,Uce as M,Hce as N,Vce as O,iw as P,jce as Q,rhe as R,an as S,ql as T,pae as U,_g as V,VP as W,twe as X,dw as Y,exe as Z,toe as _,tk as a,Gxe as a$,Xce as a0,Kce as a1,Qce as a2,rfe as a3,Ahe as a4,afe as a5,ofe as a6,lfe as a7,O1e as a8,F1e as a9,Ole as aA,Ble as aB,kle as aC,ade as aD,Vie as aE,kne as aF,sbe as aG,PP as aH,Ixe as aI,Che as aJ,h1e as aK,noe as aL,Ihe as aM,dye as aN,ffe as aO,dfe as aP,mfe as aQ,gfe as aR,l1e as aS,voe as aT,Pce as aU,yoe as aV,bfe as aW,wfe as aX,cue as aY,Mae as aZ,eI as a_,rbe as aa,Rne as ab,qie as ac,Lue as ad,FP as ae,owe as af,Gse as ag,RP as ah,cwe as ai,Qse as aj,Nhe as ak,f1e as al,g1e as am,R1e as an,$ie as ao,ibe as ap,yae as aq,Eae as ar,N0e as as,Zde as at,y1e as au,Qne as av,IP as aw,nxe as ax,mye as ay,gye as az,$Ae as b,Foe as b$,rce as b0,Kne as b1,Dbe as b2,C0e as b3,A1e as b4,xoe as b5,kP as b6,Lxe as b7,J0e as b8,Z0e as b9,sxe as bA,w1e as bB,P1e as bC,Iae as bD,Doe as bE,MP as bF,Eoe as bG,lxe as bH,Iue as bI,Gie as bJ,Une as bK,Obe as bL,Lhe as bM,tde as bN,bye as bO,k1e as bP,use as bQ,Toe as bR,n1e as bS,Y1e as bT,S1e as bU,vie as bV,A0e as bW,jde as bX,que as bY,ihe as bZ,e1e as b_,Jue as ba,uhe as bb,hle as bc,zse as bd,cle as be,Ybe as bf,T1e as bg,k0e as bh,o1e as bi,b1e as bj,c1e as bk,$le as bl,Eie as bm,qle as bn,Due as bo,ode as bp,Oae as bq,$0e as br,Rae as bs,_ye as bt,zbe as bu,B1e as bv,x1e as bw,pue as bx,xce as by,_oe as bz,Lx as c,L1e as c$,vue as c0,aoe as c1,pce as c2,dhe as c3,gce as c4,zhe as c5,hxe as c6,qbe as c7,tye as c8,T0e as c9,I1e as cA,ple as cB,yle as cC,pde as cD,qde as cE,j0e as cF,uye as cG,s1e as cH,p1e as cI,Ioe as cJ,mxe as cK,Zie as cL,jne as cM,rae as cN,Jie as cO,eae as cP,YP as cQ,yxe as cR,tI as cS,wxe as cT,sye as cU,jP as cV,Axe as cW,TP as cX,Fue as cY,W1e as cZ,V1e as c_,d1e as ca,Ise as cb,tie as cc,Sie as cd,hie as ce,pie as cf,yie as cg,jue as ch,xie as ci,Dye as cj,v1e as ck,Boe as cl,Xbe as cm,Gbe as cn,Kbe as co,Zbe as cp,Zle as cq,Qle as cr,hse as cs,ube as ct,Ale as cu,wye as cv,ile as cw,pse as cx,sle as cy,vse as cz,zAe as d,Bbe as d$,$1e as d0,Eye as d1,wse as d2,bse as d3,Hbe as d4,D1e as d5,vhe as d6,she as d7,loe as d8,_se as d9,K1e as dA,X1e as dB,Wde as dC,ele as dD,WP as dE,Jxe as dF,Bue as dG,_1e as dH,vde as dI,nI as dJ,Yxe as dK,N1e as dL,Zye as dM,Jye as dN,zP as dO,Wne as dP,Ghe as dQ,Exe as dR,Ebe as dS,ooe as dT,a1e as dU,Zhe as dV,kbe as dW,Woe as dX,joe as dY,wbe as dZ,kre as d_,ule as da,m1e as db,Ube as dc,Pie as dd,Zue as de,qhe as df,zue as dg,Uoe as dh,Whe as di,BP as dj,iwe as dk,Yhe as dl,nde as dm,hde as dn,cde as dp,oce as dq,Mye as dr,jbe as ds,Wbe as dt,Gye as du,F0e as dv,Z1e as dw,i1e as dx,j1e as dy,G1e as dz,LAe as e,C1e as e$,Nle as e0,Cle as e1,Xoe as e2,Koe as e3,rle as e4,UP as e5,Txe as e6,E1e as e7,Jbe as e8,Qbe as e9,lce as eA,_ce as eB,Rce as eC,Tie as eD,r1e as eE,iae as eF,Cse as eG,U0e as eH,Tse as eI,rue as eJ,iI as eK,Uxe as eL,q1e as eM,ebe as eN,kie as eO,qP as eP,Rxe as eQ,Fse as eR,vae as eS,QP as eT,Hxe as eU,H0e as eV,Qhe as eW,_be as eX,Ofe as eY,Bfe as eZ,Vbe as e_,z1e as ea,V0e as eb,_fe as ec,Dfe as ed,U1e as ee,Ife as ef,Lfe as eg,zfe as eh,qfe as ei,Wfe as ej,Yfe as ek,Gfe as el,Zfe as em,Jfe as en,ehe as eo,Dse as ep,dbe as eq,vbe as er,ybe as es,Efe as et,Mfe as eu,eue as ev,zde as ew,Wle as ex,jle as ey,Sue as ez,Pl as f,$u as f$,Vue as f0,fhe as f1,uue as f2,$be as f3,Aie as f4,Rre as f5,sae as f6,uae as f7,ice as f8,Mce as f9,Nre as fA,dn as fB,sw as fC,KAe as fD,$l as fE,ZAe as fF,G as fG,GAe as fH,Pt as fI,Ma as fJ,Ct as fK,$n as fL,sr as fM,na as fN,gv as fO,Eu as fP,ow as fQ,Cg as fR,kte as fS,Lte as fT,KR as fU,$te as fV,zte as fW,Ute as fX,Mg as fY,qte as fZ,Hte as f_,Oce as fa,tDe as fb,eDe as fc,vle as fd,xle as fe,u1e as ff,rI as fg,Zxe as fh,t1e as fi,M1e as fj,H1e as fk,Bse as fl,hoe as fm,hue as fn,Tue as fo,Mbe as fp,Gu as fq,tt as fr,QAe as fs,JAe as ft,Xte as fu,Xi as fv,$s as fw,Mt as fx,ld as fy,dt as fz,Rte as g,Twe as g$,ji as g0,Wte as g1,Vte as g2,Yte as g3,er as g4,cd as g5,Lo as g6,Dc as g7,pr as g8,Tg as g9,Dwe as gA,mwe as gB,jwe as gC,Hg as gD,jn as gE,Ic as gF,Ks as gG,nl as gH,ek as gI,bwe as gJ,XI as gK,YI as gL,oI as gM,xwe as gN,Ewe as gO,FI as gP,Zs as gQ,Zo as gR,xt as gS,dwe as gT,vwe as gU,fwe as gV,gwe as gW,Swe as gX,oi as gY,Mwe as gZ,aSe as g_,tn as ga,Hs as gb,jte as gc,Gte as gd,Sn as ge,JR as gf,XAe as gg,$c as gh,kc as gi,KI as gj,Ge as gk,jI as gl,Uw as gm,wr as gn,GI as go,Xo as gp,Tt as gq,EI as gr,Zu as gs,ZI as gt,Ko as gu,QI as gv,SI as gw,qn as gx,Lc as gy,pwe as gz,Qe as h,D_e as h$,ySe as h0,Owe as h1,sSe as h2,Ht as h3,yn as h4,h_e as h5,Cw as h6,Fwe as h7,oSe as h8,Rwe as h9,tl as hA,rs as hB,xI as hC,OAe as hD,Vg as hE,e_e as hF,Zt as hG,__e as hH,Re as hI,Ku as hJ,SAe as hK,Aw as hL,cSe as hM,$we as hN,bSe as hO,A_e as hP,ASe as hQ,eAe as hR,t_e as hS,zwe as hT,fSe as hU,Mw as hV,Uwe as hW,zSe as hX,Rw as hY,IAe as hZ,NI as h_,_Se as ha,Bwe as hb,lI as hc,PSe as hd,Pwe as he,x_e as hf,J_e as hg,pAe as hh,Fi as hi,uSe as hj,ISe as hk,Iwe as hl,kSe as hm,LSe as hn,w_e as ho,Q_e as hp,S_e as hq,kwe as hr,$Se as hs,gI as ht,Iw as hu,wAe as hv,Lwe as hw,RI as hx,Wg as hy,lSe as hz,Z3 as i,el as i$,yI as i0,USe as i1,qSe as i2,_n as i3,Lr as i4,S0e as i5,Gg as i6,gd as i7,r_e as i8,N_e as i9,Vwe as iA,pd as iB,Fc as iC,_Ae as iD,Lw as iE,vAe as iF,WSe as iG,Dw as iH,O_e as iI,nAe as iJ,F_e as iK,DSe as iL,kAe as iM,Ywe as iN,VSe as iO,sI as iP,Go as iQ,R_e as iR,Nw as iS,MI as iT,n_e as iU,rl as iV,iAe as iW,i_e as iX,xi as iY,md as iZ,jo as i_,HM as ia,Awe as ib,$I as ic,E_e as id,tAe as ie,C_e as ig,la as ih,zt as ii,HSe as ij,qwe as ik,Ww as il,cI as im,M_e as io,Hwe as ip,bd as iq,T_e as ir,mAe as is,II as it,Wwe as iu,hwe as iv,rAe as iw,CI as ix,yd as iy,wI as iz,Px as j,bAe as j$,Ju as j0,hSe as j1,Ra as j2,gAe as j3,B_e as j4,NSe as j5,ri as j6,jg as j7,a_e as j8,RAe as j9,k_e as jA,sAe as jB,L_e as jC,yAe as jD,oAe as jE,lr as jF,Xr as jG,$_e as jH,zw as jI,$v as jJ,CSe as jK,XSe as jL,z_e as jM,Xs as jN,Aa as jO,Zwe as jP,MSe as jQ,ZSe as jR,is as jS,BAe as jT,Xg as jU,uAe as jV,ywe as jW,v1 as jX,Kwe as jY,m_e as jZ,U_e as j_,ESe as ja,Gwe as jb,Bw as jc,Xwe as jd,s_e as je,fI as jf,P_e as jg,bI as jh,YSe as ji,BI as jj,kI as jk,MAe as jl,AAe as jm,I_e as jn,aAe as jo,Qu as jp,Ye as jq,Tw as jr,xSe as js,jSe as jt,kw as ju,zI as jv,UI as jw,GSe as jx,_I as jy,wSe as jz,EQ as k,SSe as k$,q_e as k0,lAe as k1,H_e as k2,EAe as k3,cAe as k4,ca as k5,Jwe as k6,pI as k7,W_e as k8,Ow as k9,TI as kA,u_e as kB,PI as kC,l_e as kD,p_e as kE,c_e as kF,fAe as kG,OI as kH,v_e as kI,hI as kJ,Zg as kK,qw as kL,Hw as kM,Yg as kN,mSe as kO,Rn as kP,AI as kQ,ti as kR,yc as kS,hAe as kT,f_e as kU,vSe as kV,X_e as kW,tSe as kX,Ba as kY,g_e as kZ,rSe as k_,xAe as ka,V_e as kb,Qwe as kc,dSe as kd,bc as ke,PAe as kf,Ew as kg,Y_e as kh,Nwe as ki,mI as kj,TSe as kk,JI as kl,TAe as km,OSe as kn,KSe as ko,CAe as kp,qI as kq,Rc as kr,d_e as ks,j_e as kt,wwe as ku,HI as kv,eSe as kw,pSe as kx,G_e as ky,o_e as kz,J3 as l,DAe as l0,Z_e as l1,LI as l2,nSe as l3,Ii as l4,Gr as l5,ua as l6,Pw as l7,WI as l8,FAe as l9,iSe as la,gSe as lb,uI as lc,K_e as ld,FSe as le,JSe as lf,vd as lg,dI as lh,re as li,ts as lj,_w as lk,RSe as ll,dAe as lm,Fw as ln,DI as lo,y_e as lp,$w as lq,_we as lr,Cwe as ls,b_e as lt,vI as lu,BSe as lv,On as lw,NAe as lx,QSe as ly,yQ as m,rDe as n,TQ as o,Fte as p,Y3 as q,pQ as r,nR as s,OQ as t,Bb as u,ov as v,MQ as w,vQ as x,QJ as y,Ix as z}; diff --git a/public/build/assets/cashier-DKjkAUUa.js b/public/build/assets/cashier-e85f233f.js similarity index 83% rename from public/build/assets/cashier-DKjkAUUa.js rename to public/build/assets/cashier-e85f233f.js index 2d83a77de..ae235705b 100644 --- a/public/build/assets/cashier-DKjkAUUa.js +++ b/public/build/assets/cashier-e85f233f.js @@ -1 +1 @@ -var o=Object.defineProperty;var h=(r,s,e)=>s in r?o(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e;var t=(r,s,e)=>(h(r,typeof s!="symbol"?s+"":s,e),e);import{a,B as p,b as n}from"./bootstrap-CnLEEQCx.js";import{_ as i}from"./currency-lOMYG1Wf.js";import"./runtime-core.esm-bundler-RT2b-_3S.js";class c{constructor(){t(this,"_mysales");t(this,"_reports",{mysales:a.get("/api/reports/cashier-report")});this._mysales=new p({});for(let s in this._reports)this.loadReport(s)}loadReport(s){return this._reports[s].subscribe(e=>{this[`_${s}`].next(e)})}refreshReport(){a.get("/api/reports/cashier-report?refresh=true").subscribe(s=>{this._mysales.next(s),n.success(i("The report has been refreshed."),i("OK")).subscribe()})}get mysales(){return this._mysales}}window.Cashier=new c; +var o=Object.defineProperty;var h=(r,s,e)=>s in r?o(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e;var t=(r,s,e)=>(h(r,typeof s!="symbol"?s+"":s,e),e);import{a,B as p,b as n}from"./bootstrap-8be442b1.js";import{_ as i}from"./currency-f8bd78d1.js";import"./runtime-core.esm-bundler-b48de70a.js";class c{constructor(){t(this,"_mysales");t(this,"_reports",{mysales:a.get("/api/reports/cashier-report")});this._mysales=new p({});for(let s in this._reports)this.loadReport(s)}loadReport(s){return this._reports[s].subscribe(e=>{this[`_${s}`].next(e)})}refreshReport(){a.get("/api/reports/cashier-report?refresh=true").subscribe(s=>{this._mysales.next(s),n.success(i("The report has been refreshed."),i("OK")).subscribe()})}get mysales(){return this._mysales}}window.Cashier=new c; diff --git a/public/build/assets/components-D4w1etK_.js b/public/build/assets/components-ef1ba55f.js similarity index 92% rename from public/build/assets/components-D4w1etK_.js rename to public/build/assets/components-ef1ba55f.js index bf33823e0..d5495ef0c 100644 --- a/public/build/assets/components-D4w1etK_.js +++ b/public/build/assets/components-ef1ba55f.js @@ -1 +1 @@ -import se from"./ns-alert-popup-SVrn5Xft.js";import{_}from"./currency-lOMYG1Wf.js";import{n as ve}from"./ns-avatar-image-CAD6xUGA.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as i,c as a,a as l,t as h,f as T,r as w,A as v,e as u,n as m,F as p,b as D,B as R,i as y,w as M,g as E,d as ke,j as G,C as we,D as ne,E as le,G as xe,H as J,I as ee,h as q,J as De,K as Ce,s as te,L as Me}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{h as x,b as $,v as A,F as ie,g as ae,p as re,P as L,w as Y,i as H,a as U,n as de,j as Te,k as Se,l as oe,e as W,S as $e}from"./bootstrap-CnLEEQCx.js";import{n as V,g as Ee,e as z,b as Re,f as ue,h as Fe,i as Oe,a as Pe,j as Ae,c as je,k as He,d as Ue}from"./ns-prompt-popup-DKRiwYBT.js";import"./index.es-Br67aBEV.js";const Le={methods:{__:_},components:{nsAvatarImage:ve},name:"ns-avatar",data(){return{svg:""}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},props:["url","display-name"]},Ye={class:"flex justify-between items-center flex-shrink-0"},Ve={class:"hidden md:inline-block px-2"},Be={class:"md:hidden px-2"},Ie={class:"px-2"},Ne={class:"overflow-hidden rounded-full bg-gray-600"};function ze(e,t,s,c,d,n){const r=w("ns-avatar-image");return i(),a("div",Ye,[l("span",Ve,h(n.__("Howdy, {name}").replace("{name}",this.displayName)),1),l("span",Be,h(e.displayName),1),l("div",Ie,[l("div",Ne,[T(r,{url:n.avatarUrl,name:e.displayName},null,8,["url","name"])])])])}const qe=C(Le,[["render",ze]]),We={data:()=>({clicked:!1,_save:0}),props:["type","disabled","link","href","routerLink","to","target"],mounted(){},computed:{isDisabled(){return this.disabled&&(this.disabled.length===0||this.disabled==="disabled"||this.disabled)}}},Ge=["disabled"],Ke=["target","href"];function Qe(e,t,s,c,d,n){return i(),a("div",{class:m(["flex ns-button",s.type?s.type:"default"])},[!s.link&&!s.href?(i(),a("button",{key:0,disabled:n.isDisabled,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ge)):u("",!0),s.href?(i(),a("a",{key:1,target:s.target,href:s.href,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ke)):u("",!0)],2)}const Ze=C(We,[["render",Qe]]),Xe={name:"ns-calendar",props:["date","field","visible","range","selected-range","side"],data(){return{calendar:[[]],currentDay:x(),daysOfWeek:new Array(7).fill("").map((e,t)=>t),hours:0,minutes:0,currentView:"days",clickedOnCalendar:!1,moment:x,months:new Array(12).fill("").map((e,t)=>t)}},computed:{momentCopy(){return x()}},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},mounted(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null,""].includes(this.date)?x():x(this.date),this.hours=this.currentDay.hours(),this.minutes=this.currentDay.minutes(),this.build(),this.toggleView("days")},methods:{__:_,handleCalendarClick(){this.clickedOnCalendar=!0},getDayClass({day:e,_dayIndex:t,dayOfWeek:s,_index:c,currentDay:d}){const n=[];return(x(this.date).isSame(e.date,"day")||this.isRangeEdge(e))&&!this.isInvalidRange()?n.push("bg-info-secondary text-primary border-info-secondary text-white"):n.push("hover:bg-numpad-hover"),this.isInvalidRange()&&this.isRangeEdge(e)&&n.push("bg-error-secondary text-white"),c===0&&n.push("border-t border-tab-table-th"),this.isInRange(e)&&!this.isRangeEdge(e)?n.push("bg-info-primary"):e.isDifferentMonth&&!this.isRangeEdge(e)&&n.push("bg-tab-table-th"),n.join(" ")},erase(){this.selectDate({date:x(ns.date.current)})},isInRange(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSameOrAfter(this.range[0])&&x(e.date).isSameOrBefore(this.range[1]):!1},isInvalidRange(){return this.selectedRange&&this.selectedRange.endDate?x(this.selectedRange.startDate).isAfter(x(this.selectedRange.endDate))||x(this.selectedRange.endDate).isBefore(x(this.selectedRange.startDate)):!1},isRangeEdge(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSame(this.range[0],"day")||x(e.date).isSame(this.range[1],"day"):!1},setYear(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.selectDate({date:this.currentDay.clone()}))},subYear(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.selectDate({date:this.currentDay.clone()}))},addYear(){this.currentDay.add(1,"year"),this.selectDate({date:this.currentDay.clone()})},toggleView(e){this.currentView=e,this.currentView==="years"&&setTimeout(()=>{this.$refs.year.select()},100),this.currentView==="days"&&setTimeout(()=>{this.$refs.hours.addEventListener("focus",function(t){this.select()}),this.$refs.minutes.addEventListener("focus",function(t){this.select()})},100)},setMonth(e){this.currentDay.month(e),this.selectDate({date:this.currentDay.clone()})},detectHoursChange(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.selectDate({date:this.currentDay.clone()})},detectMinuteChange(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.selectDate({date:this.currentDay.clone()})},checkClickedItem(e){this.$parent.$el.getAttribute("class").split(" ").includes("picker")&&(!this.$parent.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.visible&&this.$emit("onClickOut",!0),setTimeout(()=>{this.clickedOnCalendar=!1},100))},selectDate(e){if([void 0].includes(e))this.$emit("set",null);else{if(this.side==="left"&&x(this.selectedRange.endDate).isValid()&&e.date.isAfter(this.selectedRange.endDate))return $.error(_("The left range will be invalid.")).subscribe(),!1;if(this.side==="right"&&x(this.selectedRange.startDate).isValid()&&e.date.isBefore(this.selectedRange.startDate))return $.error(_("The right range will be invalid.")).subscribe(),!1;this.currentDay=e.date,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.$emit("set",this.currentDay.format("YYYY-MM-DD HH:mm:ss"))}this.build()},subMonth(){this.currentDay.subtract(1,"month"),this.build()},addMonth(){this.currentDay.add(1,"month"),this.build()},resetCalendar(){this.calendar=[[]]},build(){this.resetCalendar(),this.currentDay.clone().startOf("month");const e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");for(;;){e.day()===0&&this.calendar[0].length>0&&this.calendar.push([]);let s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(x.now(),"day"),isDifferentMonth:!1,isNextMonth:!1,isPreviousMonth:!1}),e.isSame(t,"day"))break;e.add(1,"day")}if(this.calendar[0].length<7){const s=7-this.calendar[0].length,c=this.calendar[0][0].date.clone(),d=[];for(let n=0;nn.handleCalendarClick()),class:"flex bg-box-background flex-col rounded-lg overflow-hidden"},[d.currentView==="years"?(i(),a("div",Je,[l("div",et,[l("div",null,[l("button",{onClick:t[0]||(t[0]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},st)]),l("div",nt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[1]||(t[1]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[2]||(t[2]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[3]||(t[3]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},it)])]),l("div",at,[l("div",rt,[l("button",{onClick:t[4]||(t[4]=r=>n.subYear()),class:"px-2 py-2"},ot),l("div",ut,[l("input",{type:"text",ref:"year",class:"p-2 flex-auto w-full text-center outline-none",onChange:t[5]||(t[5]=r=>n.setYear(r)),value:d.currentDay.format("YYYY")},null,40,ct)]),l("button",{onClick:t[6]||(t[6]=r=>n.addYear()),class:"px-2 py-2"},ft)])]),l("div",mt,[l("button",{onClick:t[7]||(t[7]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error hover:text-white rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="months"?(i(),a("div",gt,[l("div",bt,[l("div",null,[l("button",{onClick:t[8]||(t[8]=r=>n.subYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},pt)]),l("div",yt,[l("span",vt,h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[9]||(t[9]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[10]||(t[10]=r=>n.addYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},wt)])]),l("div",xt,[(i(!0),a(p,null,D(d.months,(r,o)=>(i(),a("div",{key:o,class:"h-8 flex justify-center items-center text-sm border-box-background"},[l("div",Dt,[l("div",{class:m([n.momentCopy.month(r).format("MM")===d.currentDay.format("MM")?"bg-info-secondary text-white":"hover:bg-numpad-hover","h-full w-full border-box-background flex items-center justify-center cursor-pointer"]),onClick:f=>n.setMonth(r)},h(n.momentCopy.format("MMM")),11,Ct)])]))),128))]),l("div",Mt,[l("button",{onClick:t[11]||(t[11]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="days"?(i(),a("div",Tt,[l("div",St,[l("div",null,[l("button",{onClick:t[12]||(t[12]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Et)]),l("div",Rt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[13]||(t[13]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[14]||(t[14]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[15]||(t[15]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Ot)])]),l("div",Pt,[l("div",At,h(n.__("Sun")),1),l("div",jt,h(n.__("Mon")),1),l("div",Ht,h(n.__("Tue")),1),l("div",Ut,h(n.__("Wed")),1),l("div",Lt,h(n.__("Thr")),1),l("div",Yt,h(n.__("Fri")),1),l("div",Vt,h(n.__("Sat")),1)]),(i(!0),a(p,null,D(d.calendar,(r,o)=>(i(),a("div",{key:o,class:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary divide-x divide-y"},[(i(!0),a(p,null,D(d.daysOfWeek,(f,g)=>(i(),a("div",{key:g,class:"md:h-10 h-8 flex justify-center items-center text-sm border-tab-table-th"},[(i(!0),a(p,null,D(r,(b,S)=>(i(),a(p,null,[b.dayOfWeek===f?(i(),a("div",{key:S,class:m([n.getDayClass({day:b,_dayIndex:S,dayOfWeek:f,_index:g,currentDay:d.currentDay}),"h-full w-full flex items-center justify-center cursor-pointer"]),onClick:F=>n.selectDate(b)},[b.isDifferentMonth?u("",!0):(i(),a("span",It,h(b.date.format("DD")),1)),b.isDifferentMonth?(i(),a("span",Nt,h(b.date.format("DD")),1)):u("",!0)],10,Bt)):u("",!0)],64))),256))]))),128))]))),128))])):u("",!0),l("div",zt,[l("div",qt,[l("div",Wt,[l("div",Gt,[l("div",Kt,[l("button",{onClick:t[16]||(t[16]=r=>n.erase()),class:"border ns-inset-button text-sm error rounded md:w-10 w-8 md:h-10 h-8 flex items-center justify-center"},Zt)])])]),l("div",Xt,[d.currentView==="days"?(i(),a("div",Jt,[es,R(l("input",{placeholder:"HH",ref:"hours",onChange:t[17]||(t[17]=r=>n.detectHoursChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[18]||(t[18]=r=>d.hours=r),type:"number"},null,544),[[A,d.hours]]),ts,R(l("input",{placeholder:"mm",ref:"minutes",onChange:t[19]||(t[19]=r=>n.detectMinuteChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[20]||(t[20]=r=>d.minutes=r),type:"number"},null,544),[[A,d.minutes]])])):u("",!0)])])])])}const ce=C(Xe,[["render",ss]]),ls={data:()=>({}),props:["checked","field","label"],computed:{isChecked(){return this.field?this.field.value:this.checked},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0}},methods:{toggleIt(){this.field!==void 0&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}},is={class:"w-6 h-6 flex bg-input-background border-input-edge border-2 items-center justify-center cursor-pointer"},as={key:0,class:"las la-check"};function rs(e,t,s,c,d,n){return i(),a("div",{class:"flex ns-checkbox items-center justify-center cursor-pointer",onClick:t[0]||(t[0]=r=>n.toggleIt())},[l("div",is,[n.isChecked?(i(),a("i",as)):u("",!0)]),s.label?(i(),a("label",{key:0,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.label),3)):u("",!0),s.field?(i(),a("label",{key:1,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.field.label),3)):u("",!0)])}const ds=C(ls,[["render",rs]]),os={name:"ns-close-button",methods:{}},us={class:"outline-none ns-close-button hover:border-transparent border rounded-full h-8 min-w-[2rem] items-center justify-center"},cs=l("i",{class:"las la-times"},null,-1);function hs(e,t,s,c,d,n){return i(),a("button",us,[cs,y(),v(e.$slots,"default")])}const fs=C(os,[["render",hs]]),ms={data(){return{fields:[],validation:new ie}},props:["popup"],methods:{__:_,popupCloser:ae,popupResolver:re,closePopup(){this.popupResolver(!1)},useFilters(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters(){this.fields.forEach(e=>e.value=""),this.popupResolver(null)}},mounted(){this.fields=this.validation.createFields(this.popup.params.queryFilters),this.popupCloser()}},gs={class:"ns-box shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-5/6-screen flex flex-col"},bs={class:"p-2 border-b ns-box-header flex justify-between items-center"},_s={class:"p-2 ns-box-body flex-auto"},ps={class:"p-2 flex justify-between ns-box-footer border-t"};function ys(e,t,s,c,d,n){const r=w("ns-close-button"),o=w("ns-field"),f=w("ns-button");return i(),a("div",gs,[l("div",bs,[l("h3",null,h(n.__("Search Filters")),1),l("div",null,[T(r,{onClick:t[0]||(t[0]=g=>n.closePopup())})])]),l("div",_s,[(i(!0),a(p,null,D(d.fields,(g,b)=>(i(),E(o,{field:g,key:b},null,8,["field"]))),128))]),l("div",ps,[l("div",null,[T(f,{onClick:t[1]||(t[1]=g=>n.clearFilters()),type:"error"},{default:M(()=>[y(h(n.__("Clear Filters")),1)]),_:1})]),l("div",null,[T(f,{onClick:t[2]||(t[2]=g=>n.useFilters()),type:"info"},{default:M(()=>[y(h(n.__("Use Filters")),1)]),_:1})])])])}const vs=C(ms,[["render",ys]]),ks={data:()=>({prependOptions:!1,showOptions:!0,showCheckboxes:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],headerButtons:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}),name:"ns-crud",mounted(){this.identifier!==void 0&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","createUrl","mode","identifier","queryParams","popup"],computed:{getParsedSrc(){return`${this.src}?${this.sortColumn}${this.searchQuery}${this.queryFiltersString}${this.queryPage}${this.getQueryParams()?"&"+this.getQueryParams():""}`},showQueryFilters(){return this.queryFilters.length>0},getSelectedAction(){const e=this.bulkActions.filter(t=>t.identifier===this.bulkAction);return e.length>0?e[0]:!1},pagination(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage(){return this.result?`&page=${this.page}`:""},resultInfo(){return _("displaying {perPage} on {items} items").replace("{perPage}",this.result.per_page||0).replace("{items}",this.result.total||0)},headerButtonsComponents(){return this.headerButtons.map(e=>ke(()=>new Promise(t=>{t(nsExtraComponents[e])})))}},methods:{__:_,getQueryParams(){return this.queryParams?Object.keys(this.queryParams).map(e=>`${e}=${this.queryParams[e]}`).join("&"):""},pageNumbers(e,t){var s=[];t-3>1&&s.push(1,"...");for(let c=1;c<=e;c++)t+3>c&&t-3c>0||typeof c=="string")},downloadContent(){nsHttpClient.post(`${this.src}/export?${this.getParsedSrc}`,{entries:this.selectedEntries.map(e=>e.$id)}).subscribe(e=>{setTimeout(()=>document.location=e.url,300),$.success(_("The document has been generated.")).subscribe()},e=>{$.error(e.message||_("Unexpected error occurred.")).subscribe()})},clearSelectedEntries(){L.show(V,{title:_("Clear Selected Entries ?"),message:_("Would you like to clear all selected entries ?"),onAction:e=>{e&&(this.selectedEntries=[],this.handleGlobalChange(!1))}})},refreshRow(e){if(console.log({row:e}),e.$checked===!0)this.selectedEntries.filter(s=>s.$id===e.$id).length===0&&this.selectedEntries.push(e);else{const t=this.selectedEntries.filter(s=>s.$id===e.$id);if(t.length>0){const s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions(e){this.result.data.forEach(t=>{t.$id!==e.$id&&(t.$toggled=!1)})},handleGlobalChange(e){this.globallyChecked=e,this.result.data.forEach(t=>{t.$checked=e,this.refreshRow(t)})},loadConfig(){nsHttpClient.get(`${this.src}/config?${this.getQueryParams()}`).subscribe(t=>{this.columns=t.columns,this.bulkActions=t.bulkActions,this.queryFilters=t.queryFilters,this.prependOptions=t.prependOptions,this.showOptions=t.showOptions,this.showCheckboxes=t.showCheckboxes,this.headerButtons=t.headerButtons||[],this.refresh()},t=>{$.error(t.message,"OK",{duration:!1}).subscribe()})},cancelSearch(){this.searchInput="",this.search()},search(){this.searchInput?this.searchQuery=`&search=${this.searchInput}`:this.searchQuery="",this.page=1,this.refresh()},sort(e){if(this.columns[e].$sort===!1)return $.error(_("Sorting is explicitely disabled on this column")).subscribe();for(let t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":default:this.columns[e].$direction="asc";break}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn=`active=${e}&direction=${this.columns[e].$direction}`:this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo(){if(this.bulkAction)if(this.selectedEntries.length>0){if(confirm(this.getSelectedAction.confirm||_("Would you like to perform the selected bulk action on the selected entries ?")))return nsHttpClient.post(`${this.src}/bulk-actions`,{action:this.bulkAction,entries:this.selectedEntries.map(e=>e.$id)}).subscribe({next:e=>{$.info(e.message).subscribe(),this.selectedEntries=[],this.refresh()},error:e=>{$.error(e.message).subscribe()}})}else return $.error(_("No selection has been made.")).subscribe();else return $.error(_("No action has been selected.")).subscribe()},async openQueryFilter(){try{const e=await new Promise((t,s)=>{L.show(vs,{resolve:t,reject:s,queryFilters:this.queryFilters})});this.withFilters=!1,this.queryFiltersString="",e!==null&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(e))),this.refresh()}catch{}},refresh(){this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get(`${this.getParsedSrc}`).subscribe(t=>{t.data=t.data.map(s=>(this.selectedEntries.filter(d=>d.$id===s.$id).length>0&&(s.$checked=!0),s)),this.isRefreshing=!1,this.result=t,this.page=t.current_page},t=>{this.isRefreshing=!1,$.error(t.message).subscribe()})}}},ws={key:0,id:"crud-table-header",class:"p-2 border-b flex flex-col md:flex-row justify-between flex-wrap"},xs={id:"crud-search-box",class:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex"},Ds={key:0,class:"px-2 flex items-center justify-center"},Cs=["href"],Ms=l("i",{class:"las la-plus"},null,-1),Ts=[Ms],Ss={class:"px-2"},$s={class:"rounded-full p-1 ns-crud-input flex"},Es=l("i",{class:"las la-search"},null,-1),Rs=[Es],Fs=l("i",{class:"las la-times text-white"},null,-1),Os=[Fs],Ps={class:"px-2 flex items-center justify-center"},As={key:1,class:"px-2 flex items-center"},js={key:0,class:"las la-filter"},Hs={key:1,class:"las la-check"},Us={key:2,class:"ml-1"},Ls={key:3,class:"ml-1"},Ys={key:2,id:"custom-buttons"},Vs={id:"crud-buttons",class:"-mx-1 flex flex-wrap w-full md:w-auto"},Bs={key:0,class:"px-1 flex items-center"},Is=l("i",{class:"lar la-check-square"},null,-1),Ns={class:"px-1 flex items-center"},zs=l("i",{class:"las la-download"},null,-1),qs={class:"flex p-2"},Ws={class:"overflow-x-auto flex-auto"},Gs={key:0,class:"table ns-table w-full"},Ks={key:0,class:"text-center px-2 border w-16 py-2"},Qs={key:1,class:"text-left px-2 py-2 w-16 border"},Zs=["onClick"],Xs={class:"w-full flex justify-between items-center"},Js={class:"flex"},en={class:"h-6 w-6 flex justify-center items-center"},tn={key:0,class:"las la-sort-amount-up"},sn={key:1,class:"las la-sort-amount-down"},nn={key:2,class:"text-left px-2 py-2 w-16 border"},ln={key:1},an=["colspan"],rn={class:"p-2 flex border-t flex-col md:flex-row justify-between footer"},dn={key:0,id:"grouped-actions",class:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1"},on={class:"bg-input-disabled",selected:"",value:""},un=["value"],cn={class:"flex"},hn={class:"items-center flex text-primary mx-4"},fn={id:"pagination",class:"flex items-center -mx-1"},mn=l("i",{class:"las la-angle-double-left"},null,-1),gn=[mn],bn=["onClick"],_n=l("i",{class:"las la-angle-double-right"},null,-1),pn=[_n];function yn(e,t,s,c,d,n){const r=w("ns-checkbox"),o=w("ns-table-row");return i(),a("div",{id:"crud-table",class:m(["w-full rounded-lg",s.mode!=="light"?"shadow mb-8":""])},[s.mode!=="light"?(i(),a("div",ws,[l("div",xs,[s.createUrl?(i(),a("div",Ds,[l("a",{href:s.createUrl||"#",class:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border"},Ts,8,Cs)])):u("",!0),l("div",Ss,[l("div",$s,[R(l("input",{onKeypress:t[0]||(t[0]=Y(f=>n.search(),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=f=>e.searchInput=f),type:"text",class:"w-36 md:w-auto bg-transparent outline-none px-2"},null,544),[[A,e.searchInput]]),l("button",{onClick:t[2]||(t[2]=f=>n.search()),class:"rounded-full w-8 h-8 outline-none ns-crud-input-button"},Rs),e.searchQuery?(i(),a("button",{key:0,onClick:t[3]||(t[3]=f=>n.cancelSearch()),class:"ml-1 rounded-full w-8 h-8 bg-error-secondary outline-none hover:bg-error-tertiary"},Os)):u("",!0)])]),l("div",Ps,[l("button",{onClick:t[4]||(t[4]=f=>n.refresh()),class:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button"},[l("i",{class:m([e.isRefreshing?"animate-spin":"","las la-sync"])},null,2)])]),n.showQueryFilters?(i(),a("div",As,[l("button",{onClick:t[5]||(t[5]=f=>n.openQueryFilter()),class:m([e.withFilters?"table-filters-enabled":"table-filters-disabled","ns-crud-button border rounded-full text-sm h-10 px-3 outline-none"])},[e.withFilters?u("",!0):(i(),a("i",js)),e.withFilters?(i(),a("i",Hs)):u("",!0),e.withFilters?u("",!0):(i(),a("span",Us,h(n.__("Filters")),1)),e.withFilters?(i(),a("span",Ls,h(n.__("Has Filters")),1)):u("",!0)],2)])):u("",!0),n.headerButtonsComponents.length>0?(i(),a("div",Ys,[(i(!0),a(p,null,D(n.headerButtonsComponents,(f,g)=>(i(),E(G(f),{onRefresh:t[6]||(t[6]=b=>n.refresh()),result:e.result,key:g},null,40,["result"]))),128))])):u("",!0)]),l("div",Vs,[e.selectedEntries.length>0?(i(),a("div",Bs,[l("button",{onClick:t[7]||(t[7]=f=>n.clearSelectedEntries()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border"},[Is,y(" "+h(n.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length)),1)])])):u("",!0),l("div",Ns,[l("button",{onClick:t[8]||(t[8]=f=>n.downloadContent()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none"},[zs,y(" "+h(n.__("Download")),1)])])])])):u("",!0),l("div",qs,[l("div",Ws,[Object.values(e.columns).length>0?(i(),a("table",Gs,[l("thead",null,[l("tr",null,[e.showCheckboxes?(i(),a("th",Ks,[T(r,{checked:e.globallyChecked,onChange:t[9]||(t[9]=f=>n.handleGlobalChange(f))},null,8,["checked"])])):u("",!0),e.prependOptions&&e.showOptions?(i(),a("th",Qs)):u("",!0),(i(!0),a(p,null,D(e.columns,(f,g)=>(i(),a("th",{key:g,onClick:b=>n.sort(g),style:we({width:f.width||"auto","max-width":f.maxWidth||"auto","min-width":f.minWidth||"auto"}),class:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2"},[l("div",Xs,[l("span",Js,h(f.label),1),l("span",en,[f.$direction==="desc"?(i(),a("i",tn)):u("",!0),f.$direction==="asc"?(i(),a("i",sn)):u("",!0)])])],12,Zs))),128)),!e.prependOptions&&e.showOptions?(i(),a("th",nn)):u("",!0)])]),l("tbody",null,[e.result.data!==void 0&&e.result.data.length>0?(i(!0),a(p,{key:0},D(e.result.data,(f,g)=>(i(),E(o,{key:g,onUpdated:t[10]||(t[10]=b=>n.refreshRow(b)),columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,showCheckboxes:e.showCheckboxes,row:f,onReload:t[11]||(t[11]=b=>n.refresh()),onToggled:t[12]||(t[12]=b=>n.handleShowOptions(b))},null,8,["columns","prependOptions","showOptions","showCheckboxes","row"]))),128)):u("",!0),!e.result||e.result.data.length===0?(i(),a("tr",ln,[l("td",{colspan:Object.values(e.columns).length+2,class:"text-center border py-3"},h(n.__("There is nothing to display...")),9,an)])):u("",!0)])])):u("",!0)])]),l("div",rn,[e.bulkActions.length>0?(i(),a("div",dn,[R(l("select",{class:"outline-none bg-transparent","onUpdate:modelValue":t[13]||(t[13]=f=>e.bulkAction=f),id:"grouped-actions"},[l("option",on,[v(e.$slots,"bulk-label",{},()=>[y(h(n.__("Bulk Actions")),1)])]),(i(!0),a(p,null,D(e.bulkActions,(f,g)=>(i(),a("option",{class:"bg-input-disabled",key:g,value:f.identifier},h(f.label),9,un))),128))],512),[[H,e.bulkAction]]),l("button",{onClick:t[14]||(t[14]=f=>n.bulkDo()),class:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center"},[v(e.$slots,"bulk-go",{},()=>[y(h(n.__("Apply")),1)])])])):u("",!0),l("div",cn,[l("div",hn,h(n.resultInfo),1),l("div",fn,[e.result.current_page?(i(),a(p,{key:0},[l("a",{href:"javascript:void(0)",onClick:t[15]||(t[15]=f=>{e.page=e.result.first_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},gn),(i(!0),a(p,null,D(n.pagination,(f,g)=>(i(),a(p,null,[e.page!=="..."?(i(),a("a",{key:g,class:m([e.page==f?"bg-info-tertiary border-transparent text-white":"","mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"]),onClick:b=>{e.page=f,n.refresh()},href:"javascript:void(0)"},h(f),11,bn)):u("",!0),e.page==="..."?(i(),a("a",{key:g,href:"javascript:void(0)",class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"},"...")):u("",!0)],64))),256)),l("a",{href:"javascript:void(0)",onClick:t[16]||(t[16]=f=>{e.page=e.result.last_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},pn)],64)):u("",!0)])])])],2)}const vn=C(ks,[["render",yn]]),kn={data:()=>({form:{},globallyChecked:!1,formValidation:new ie,rows:[]}),emits:["updated","saved"],mounted(){this.loadForm()},props:["src","createUrl","fieldClass","returnUrl","submitUrl","submitMethod","disableTabs","queryParams","popup","optionAttributes"],computed:{activeTabFields(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]},activeTabIdentifier(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return e;return{}}},methods:{__:_,popupResolver:re,toggle(e){for(let t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},async handleSaved(e,t,s){this.form.tabs[t].fields.filter(c=>{c.name===s.name&&e.data.entry&&(c.options.push({label:e.data.entry[this.optionAttributes.label],value:e.data.entry[this.optionAttributes.value]}),c.value=e.data.entry.id)})},handleClose(){this.popup&&this.popupResolver(!1)},submit(){if(this.formValidation.validateForm(this.form).length>0)return $.error(_("Unable to proceed the form is not valid"),_("Close")).subscribe();if(this.formValidation.disableForm(this.form),this.submitUrl===void 0)return $.error(_("No submit URL was provided"),_("Okay")).subscribe();U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.appendQueryParamas(this.submitUrl),this.formValidation.extractForm(this.form)).subscribe(e=>{if(e.status==="success")if(this.popup)this.popupResolver(e);else{if(this.submitMethod&&this.submitMethod.toLowerCase()==="post"&&this.returnUrl!==!1)return document.location=e.data.editUrl||this.returnUrl;$.info(e.message,_("Okay"),{duration:3e3}).subscribe(),this.$emit("saved",e)}this.formValidation.enableForm(this.form)},e=>{$.error(e.message,void 0,{duration:5e3}).subscribe(),e.data!==void 0&&this.formValidation.triggerError(this.form,e.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){return new Promise((e,t)=>{U.get(`${this.appendQueryParamas(this.src)}`).subscribe({next:c=>{e(c),this.form=this.parseForm(c.form),de.doAction("ns-crud-form-loaded",this),this.$emit("updated",this.form)},error:c=>{t(c),$.error(c.message,_("Okay"),{duration:0}).subscribe()}})})},appendQueryParamas(e){if(this.queryParams===void 0)return e;const t=Object.keys(this.queryParams).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(this.queryParams[s])}`).join("&");return e.includes("?")?`${e}&${t}`:`${e}?${t}`},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let s in e.tabs)t===0&&(e.tabs[s].active=!0),e.tabs[s].active=e.tabs[s].active===void 0?!1:e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}}},wn={key:0,class:"flex items-center justify-center h-full"},xn={key:0,class:"box-header border-b border-box-edge box-border p-2 flex justify-between items-center"},Dn={class:"text-primary font-bold text-lg"},Cn={class:"flex flex-col"},Mn={key:0,class:"flex justify-between items-center"},Tn={for:"title",class:"font-bold my-2 text-primary"},Sn={key:0},$n={for:"title",class:"text-sm my-2"},En=["href"],Rn=["disabled"],Fn=["disabled"],On={key:0,class:"text-xs text-primary py-1"},Pn={key:0},An={key:1},jn={class:"header flex ml-4",style:{"margin-bottom":"-1px"}},Hn=["onClick"],Un={class:"ns-tab-item"},Ln={class:"border p-4 rounded"},Yn={class:"-mx-4 flex flex-wrap"},Vn={key:0,class:"flex justify-end"},Bn=["disabled"];function In(e,t,s,c,d,n){const r=w("ns-spinner"),o=w("ns-close-button"),f=w("ns-field");return i(),a(p,null,[Object.values(e.form).length===0?(i(),a("div",wn,[T(r)])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(["form flex-auto",s.popup?"bg-box-background w-95vw md:w-2/3-screen":""]),id:"crud-form"},[s.popup?(i(),a("div",xn,[l("h2",Dn,h(s.popup.params.title),1),l("div",null,[T(o,{onClick:t[0]||(t[0]=g=>n.handleClose())})])])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(s.popup?"p-2":"")},[l("div",Cn,[e.form.main?(i(),a("div",Mn,[l("label",Tn,[e.form.main.name?(i(),a("span",Sn,h(e.form.main.label),1)):u("",!0)]),l("div",$n,[s.returnUrl&&!s.popup?(i(),a("a",{key:0,href:s.returnUrl,class:"rounded-full border px-2 py-1 ns-inset-button error"},h(n.__("Go Back")),9,En)):u("",!0)])])):u("",!0),e.form.main.name?(i(),a(p,{key:1},[l("div",{class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[R(l("input",{"onUpdate:modelValue":t[1]||(t[1]=g=>e.form.main.value=g),onKeydown:t[2]||(t[2]=Y(g=>n.submit(),["enter"])),onKeypress:t[3]||(t[3]=g=>e.formValidation.checkField(e.form.main)),onBlur:t[4]||(t[4]=g=>e.formValidation.checkField(e.form.main)),onChange:t[5]||(t[5]=g=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:"flex-auto outline-none h-10 px-2"},null,40,Rn),[[A,e.form.main.value]]),l("button",{disabled:e.form.main.disabled,class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"","outline-none px-4 h-10 text-white"]),onClick:t[6]||(t[6]=g=>n.submit())},h(n.__("Save")),11,Fn)],2),e.form.main.description&&e.form.main.errors.length===0?(i(),a("p",On,h(e.form.main.description),1)):u("",!0),(i(!0),a(p,null,D(e.form.main.errors,(g,b)=>(i(),a("p",{key:b,class:"text-xs py-1 text-error-tertiary"},[g.identifier==="required"?(i(),a("span",Pn,[v(e.$slots,"error-required",{},()=>[y(h(g.identifier),1)])])):u("",!0),g.identifier==="invalid"?(i(),a("span",An,[v(e.$slots,"error-invalid",{},()=>[y(h(g.message),1)])])):u("",!0)]))),128))],64)):u("",!0)]),s.disableTabs!=="true"?(i(),a("div",{key:0,id:"tabs-container",class:m([s.popup?"mt-5":"my-5","ns-tab"])},[l("div",jn,[(i(!0),a(p,null,D(e.form.tabs,(g,b)=>(i(),a("div",{key:b,onClick:S=>n.toggle(b),class:m([g.active?"active border border-b-transparent":"inactive border","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(g.label),11,Hn))),128))]),l("div",Un,[l("div",Ln,[l("div",Yn,[(i(!0),a(p,null,D(n.activeTabFields,(g,b)=>(i(),a("div",{key:`${n.activeTabIdentifier}-${b}`,class:m(s.fieldClass||"px-4 w-full md:w-1/2 lg:w-1/3")},[T(f,{onSaved:S=>n.handleSaved(S,n.activeTabIdentifier,g),onBlur:S=>e.formValidation.checkField(g),onChange:S=>e.formValidation.checkField(g),field:g},null,8,["onSaved","onBlur","onChange","field"])],2))),128))]),e.form.main.name?u("",!0):(i(),a("div",Vn,[l("div",{class:m(["ns-button",e.form.main.disabled?"default":e.form.main.errors.length>0?"error":"info"])},[l("button",{disabled:e.form.main.disabled,onClick:t[7]||(t[7]=g=>n.submit()),class:"outline-none px-4 h-10 border-l"},h(n.__("Save")),9,Bn)],2)]))])])],2)):u("",!0)],2)):u("",!0)],2)):u("",!0)],64)}const Nn=C(kn,[["render",In]]),zn={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},qn={class:"flex flex-auto flex-col mb-2"},Wn=["for"],Gn={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Kn={class:"sm:text-sm sm:leading-5"},Qn=["disabled","id","placeholder"];function Zn(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qn,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wn),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","bg-input-background text-secondary mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Gn,[l("span",Kn,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:"date",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Qn),[[A,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xn=C(zn,[["render",Zn]]),he={isSame:(e,t,s)=>{let c=new Date(e),d=new Date(t);return s==="date"&&(c.setHours(0,0,0,0),d.setHours(0,0,0,0)),c.getTime()===d.getTime()},daysInMonth:(e,t)=>new Date(e,t,0).getDate(),weekNumber:e=>Ee(e),format:(e,t)=>z(e,t),nextMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t},prevMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()-1),t},validateDateRange:(e,t,s)=>{let c=new Date(s),d=new Date(t);return s&&e.getTime()>c.getTime()?c:t&&e.getTime()({...{direction:"ltr",format:"mm/dd/yyyy",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:z.i18n.dayNames.slice(0,7).map(s=>s.substring(0,2)),monthNames:z.i18n.monthNames.slice(0,12),firstDay:0},...e}),yearMonth:e=>{let t=e.getMonth()+1;return e.getFullYear()+(t<10?"0":"")+t},isValidDate:e=>e instanceof Date&&!isNaN(e)},K={props:{dateUtil:{type:[Object,String],default:"native"}},created(){this.$dateUtil=he}},Jn={mixins:[K],name:"calendar",props:{monthDate:Date,localeData:Object,start:Date,end:Date,minDate:Date,maxDate:Date,showDropdowns:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},dateFormat:{type:Function,default:null}},data(){let e=this.monthDate||this.start||new Date;return{currentMonthDate:e,year_text:e.getFullYear()}},methods:{prevMonthClick(){this.changeMonthDate(this.$dateUtil.prevMonth(this.currentMonthDate))},nextMonthClick(){this.changeMonthDate(this.$dateUtil.nextMonth(this.currentMonthDate))},changeMonthDate(e,t=!0){let s=this.$dateUtil.yearMonth(this.currentMonthDate);this.currentMonthDate=this.$dateUtil.validateDateRange(e,this.minDate,this.maxDate),t&&s!==this.$dateUtil.yearMonth(this.currentMonthDate)&&this.$emit("change-month",{month:this.currentMonthDate.getMonth()+1,year:this.currentMonthDate.getFullYear()}),this.checkYear()},dayClass(e){let t=new Date(e);t.setHours(0,0,0,0);let s=new Date(this.start);s.setHours(0,0,0,0);let c=new Date(this.end);c.setHours(0,0,0,0);let d={off:e.getMonth()+1!==this.month,weekend:e.getDay()===6||e.getDay()===0,today:t.setHours(0,0,0,0)==new Date().setHours(0,0,0,0),active:t.setHours(0,0,0,0)==new Date(this.start).setHours(0,0,0,0)||t.setHours(0,0,0,0)==new Date(this.end).setHours(0,0,0,0),"in-range":t>=s&&t<=c,"start-date":t.getTime()===s.getTime(),"end-date":t.getTime()===c.getTime(),disabled:this.minDate&&t.getTime()this.maxDate.getTime()};return this.dateFormat?this.dateFormat(d,e):d},checkYear(){this.$refs.yearSelect!==document.activeElement&&this.$nextTick(()=>{this.year_text=this.monthDate.getFullYear()})}},computed:{monthName(){return this.locale.monthNames[this.currentMonthDate.getMonth()]},year:{get(){return this.year_text},set(e){this.year_text=e;let t=this.$dateUtil.validateDateRange(new Date(e,this.month,1),this.minDate,this.maxDate);this.$dateUtil.isValidDate(t)&&this.$emit("change-month",{month:t.getMonth(),year:t.getFullYear()})}},month:{get(){return this.currentMonthDate.getMonth()+1},set(e){let t=this.$dateUtil.validateDateRange(new Date(this.year,e-1,1),this.minDate,this.maxDate);this.$emit("change-month",{month:t.getMonth()+1,year:t.getFullYear()})}},calendar(){let e=this.month,t=this.currentMonthDate.getFullYear(),s=new Date(t,e-1,1),c=this.$dateUtil.prevMonth(s).getMonth()+1,d=this.$dateUtil.prevMonth(s).getFullYear(),n=new Date(d,e-1,0).getDate(),r=s.getDay(),o=[];for(let b=0;b<6;b++)o[b]=[];let f=n-r+this.locale.firstDay+1;f>n&&(f-=7),r===this.locale.firstDay&&(f=n-6);let g=new Date(d,c-1,f,12,0,0);for(let b=0,S=0,F=0;b<6*7;b++,S++,g.setDate(g.getDate()+1))b>0&&S%7===0&&(S=0,F++),o[F][S]=new Date(g.getTime());return o},months(){let e=this.locale.monthNames.map((t,s)=>({label:t,value:s}));if(this.maxDate&&this.minDate){let t=this.maxDate.getFullYear()-this.minDate.getFullYear();if(t<2){let s=[];if(t<1)for(let c=this.minDate.getMonth();c<=this.maxDate.getMonth();c++)s.push(c);else{for(let c=0;c<=this.maxDate.getMonth();c++)s.push(c);for(let c=this.minDate.getMonth();c<12;c++)s.push(c)}if(s.length>0)return e.filter(c=>s.find(d=>c.value===d)>-1)}}return e},locale(){return this.$dateUtil.localeData(this.localeData)}},watch:{monthDate(e){this.currentMonthDate.getTime()!==e.getTime()&&this.changeMonthDate(e,!1)}}},fe=e=>(ne("data-v-66e2a2e7"),e=e(),le(),e),el={class:"table-condensed"},tl=fe(()=>l("span",null,null,-1)),sl=[tl],nl=["colspan"],ll={class:"row mx-1"},il=["value"],al=["colspan"],rl=fe(()=>l("span",null,null,-1)),dl=[rl],ol={key:0,class:"week"},ul={key:0,class:"week"},cl=["onClick","onMouseover"];function hl(e,t,s,c,d,n){return i(),a("table",el,[l("thead",null,[l("tr",null,[l("th",{class:"prev available",onClick:t[0]||(t[0]=(...r)=>n.prevMonthClick&&n.prevMonthClick(...r)),tabindex:"0"},sl),s.showDropdowns?(i(),a("th",{key:0,colspan:s.showWeekNumbers?6:5,class:"month"},[l("div",ll,[R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>n.month=r),class:"monthselect col"},[(i(!0),a(p,null,D(n.months,r=>(i(),a("option",{key:r.value,value:r.value+1},h(r.label),9,il))),128))],512),[[H,n.month]]),R(l("input",{ref:"yearSelect",type:"number","onUpdate:modelValue":t[2]||(t[2]=r=>n.year=r),onBlur:t[3]||(t[3]=(...r)=>n.checkYear&&n.checkYear(...r)),class:"yearselect col"},null,544),[[A,n.year]])])],8,nl)):(i(),a("th",{key:1,colspan:s.showWeekNumbers?6:5,class:"month"},h(n.monthName)+" "+h(n.year),9,al)),l("th",{class:"next available",onClick:t[4]||(t[4]=(...r)=>n.nextMonthClick&&n.nextMonthClick(...r)),tabindex:"0"},dl)])]),l("tbody",null,[l("tr",null,[s.showWeekNumbers?(i(),a("th",ol,h(n.locale.weekLabel),1)):u("",!0),(i(!0),a(p,null,D(n.locale.daysOfWeek,r=>(i(),a("th",{key:r},h(r),1))),128))]),(i(!0),a(p,null,D(n.calendar,(r,o)=>(i(),a("tr",{key:o},[s.showWeekNumbers&&(o%7||o===0)?(i(),a("td",ul,h(e.$dateUtil.weekNumber(r[0])),1)):u("",!0),(i(!0),a(p,null,D(r,(f,g)=>(i(),a("td",{class:m(n.dayClass(f)),onClick:b=>e.$emit("dateClick",f),onMouseover:b=>e.$emit("hoverDate",f),key:g},[v(e.$slots,"date-slot",{date:f},()=>[y(h(f.getDate()),1)],!0)],42,cl))),128))]))),128))])])}const fl=C(Jn,[["render",hl],["__scopeId","data-v-66e2a2e7"]]),ml={props:{miniuteIncrement:{type:Number,default:5},hour24:{type:Boolean,default:!0},secondPicker:{type:Boolean,default:!1},currentTime:{default(){return new Date}},readonly:{type:Boolean,default:!1}},data(){let e=this.currentTime?this.currentTime:new Date,t=e.getHours();return{hour:this.hour24?t:t%12||12,minute:e.getMinutes()-e.getMinutes()%this.miniuteIncrement,second:e.getSeconds(),ampm:t<12?"AM":"PM"}},computed:{hours(){let e=[],t=this.hour24?24:12;for(let s=0;se<10?"0"+e.toString():e.toString(),getHour(){return this.hour24?this.hour:this.hour===12?this.ampm==="AM"?0:12:this.hour+(this.ampm==="PM"?12:0)},onChange(){this.$emit("update",{hours:this.getHour(),minutes:this.minute,seconds:this.second})}}},gl={class:"calendar-time"},bl=["disabled"],_l=["value"],pl=["disabled"],yl=["value"],vl=["disabled"],kl=["value"],wl=["disabled"],xl=l("option",{value:"AM"},"AM",-1),Dl=l("option",{value:"PM"},"PM",-1),Cl=[xl,Dl];function Ml(e,t,s,c,d,n){return i(),a("div",gl,[R(l("select",{"onUpdate:modelValue":t[0]||(t[0]=r=>d.hour=r),class:"hourselect form-control mr-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.hours,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,_l))),128))],8,bl),[[H,d.hour]]),y(" :"),R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>d.minute=r),class:"minuteselect form-control ml-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.minutes,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,yl))),128))],8,pl),[[H,d.minute]]),s.secondPicker?(i(),a(p,{key:0},[y(" :"),R(l("select",{"onUpdate:modelValue":t[2]||(t[2]=r=>d.second=r),class:"secondselect form-control ml-1",disabled:s.readonly},[(i(),a(p,null,D(60,r=>l("option",{key:r-1,value:r-1},h(n.formatNumber(r-1)),9,kl)),64))],8,vl),[[H,d.second]])],64)):u("",!0),s.hour24?u("",!0):R((i(),a("select",{key:1,"onUpdate:modelValue":t[3]||(t[3]=r=>d.ampm=r),class:"ampmselect",disabled:s.readonly},Cl,8,wl)),[[H,d.ampm]])])}const Tl=C(ml,[["render",Ml]]),Sl={mixins:[K],props:{ranges:Object,selected:Object,localeData:Object,alwaysShowCalendars:Boolean},data(){return{customRangeActive:!1}},methods:{clickRange(e){this.customRangeActive=!1,this.$emit("clickRange",e)},clickCustomRange(){this.customRangeActive=!0,this.$emit("showCustomRange")},range_class(e){return{active:e.selected===!0}}},computed:{listedRanges(){return this.ranges?Object.keys(this.ranges).map(e=>({label:e,value:this.ranges[e],selected:this.$dateUtil.isSame(this.selected.startDate,this.ranges[e][0])&&this.$dateUtil.isSame(this.selected.endDate,this.ranges[e][1])})):!1},selectedRange(){return this.listedRanges.find(e=>e.selected===!0)},showCustomRangeLabel(){return!this.alwaysShowCalendars}}},$l={class:"ranges"},El={key:0},Rl=["onClick","data-range-key"];function Fl(e,t,s,c,d,n){return i(),a("div",$l,[s.ranges?(i(),a("ul",El,[(i(!0),a(p,null,D(n.listedRanges,r=>(i(),a("li",{onClick:o=>n.clickRange(r.value),"data-range-key":r.label,key:r.label,class:m(n.range_class(r)),tabindex:"0"},h(r.label),11,Rl))),128)),n.showCustomRangeLabel?(i(),a("li",{key:0,class:m({active:d.customRangeActive||!n.selectedRange}),onClick:t[0]||(t[0]=(...r)=>n.clickCustomRange&&n.clickCustomRange(...r)),tabindex:"0"},h(s.localeData.customRangeLabel),3)):u("",!0)])):u("",!0)])}const Ol=C(Sl,[["render",Fl]]),Pl={mounted(e,{instance:t}){if(t.appendToBody){const{height:s,top:c,left:d,width:n,right:r}=t.$refs.toggle.getBoundingClientRect();e.unbindPosition=t.calculatePosition(e,t,{width:n,top:window.scrollY+c+s,left:window.scrollX+d,right:r}),document.body.appendChild(e)}else t.$el.appendChild(e)},unmounted(e,{instance:t}){t.appendToBody&&(e.unbindPosition&&typeof e.unbindPosition=="function"&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}},Al={inheritAttrs:!1,components:{Calendar:fl,CalendarTime:Tl,CalendarRanges:Ol},mixins:[K],directives:{appendToBody:Pl},emits:["update:modelValue","toggle","hoverDate","startSelection","select","change-month","finishSelection"],props:{modelValue:{type:Object},minDate:{type:[String,Date],default(){return null}},maxDate:{type:[String,Date],default(){return null}},showWeekNumbers:{type:Boolean,default:!1},linkedCalendars:{type:Boolean,default:!0},singleDatePicker:{type:[Boolean,String],default:!1},showDropdowns:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},timePickerIncrement:{type:Number,default:5},timePicker24Hour:{type:Boolean,default:!0},timePickerSeconds:{type:Boolean,default:!1},autoApply:{type:Boolean,default:!1},localeData:{type:Object,default(){return{}}},dateRange:{type:[Object],default:null,required:!0},ranges:{type:[Object,Boolean],default(){let e=new Date;e.setHours(0,0,0,0);let t=new Date;t.setHours(11,59,59,999);let s=new Date;s.setDate(e.getDate()-1),s.setHours(0,0,0,0);let c=new Date;c.setDate(e.getDate()-1),c.setHours(11,59,59,999);let d=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0,11,59,59,999);return{Today:[e,t],Yesterday:[s,c],"This month":[d,n],"This year":[new Date(e.getFullYear(),0,1),new Date(e.getFullYear(),11,31,11,59,59,999)],"Last month":[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0,11,59,59,999)]}}},opens:{type:String,default:"center"},dateFormat:Function,alwaysShowCalendars:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},controlContainerClass:{type:[Object,String],default:"form-control reportrange-text"},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default(e,t,{width:s,top:c,left:d,right:n}){t.opens==="center"?e.style.left=d+s/2+"px":t.opens==="left"?e.style.right=window.innerWidth-n+"px":t.opens==="right"&&(e.style.left=d+"px"),e.style.top=c+"px"}},closeOnEsc:{type:Boolean,default:!0},readonly:{type:Boolean}},data(){const e=he;let t={locale:e.localeData({...this.localeData})},s=this.dateRange.startDate||null,c=this.dateRange.endDate||null;if(t.monthDate=s?new Date(s):new Date,t.nextMonthDate=e.nextMonth(t.monthDate),t.start=s?new Date(s):null,this.singleDatePicker&&this.singleDatePicker!=="range"?t.end=t.start:t.end=c?new Date(c):null,t.in_selection=!1,t.open=!1,t.showCustomRangeCalendars=!1,t.locale.firstDay!==0){let d=t.locale.firstDay,n=[...t.locale.daysOfWeek];for(;d>0;)n.push(n.shift()),d--;t.locale.daysOfWeek=n}return t},methods:{dateFormatFn(e,t){let s=new Date(t);s.setHours(0,0,0,0);let c=new Date(this.start);c.setHours(0,0,0,0);let d=new Date(this.end);return d.setHours(0,0,0,0),e["in-range"]=s>=c&&s<=d,this.dateFormat?this.dateFormat(e,t):e},changeLeftMonth(e){let t=new Date(e.year,e.month-1,1);this.monthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.monthDate)>=this.$dateUtil.yearMonth(this.nextMonthDate))&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(t),this.minDate,this.maxDate),(!this.singleDatePicker||this.singleDatePicker==="range")&&this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(this.monthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,0)},changeRightMonth(e){let t=new Date(e.year,e.month-1,1);this.nextMonthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.nextMonthDate)<=this.$dateUtil.yearMonth(this.monthDate))&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(t),this.minDate,this.maxDate),this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(this.nextMonthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,1)},normalizeDatetime(e,t){let s=new Date(e);return this.timePicker&&t&&(s.setHours(t.getHours()),s.setMinutes(t.getMinutes()),s.setSeconds(t.getSeconds()),s.setMilliseconds(t.getMilliseconds())),s},dateClick(e){if(this.readonly)return!1;this.in_selection?(this.in_selection=!1,this.end=this.normalizeDatetime(e,this.end),this.end=this.start&&(this.end=t),this.$emit("hoverDate",e)},onClickPicker(){this.disabled||this.togglePicker(null,!0)},togglePicker(e,t){typeof e=="boolean"?this.open=e:this.open=!this.open,t===!0&&this.$emit("toggle",this.open,this.togglePicker)},clickedApply(){this.togglePicker(!1,!0),this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},clickCancel(){if(this.open){let e=this.dateRange.startDate,t=this.dateRange.endDate;this.start=e?new Date(e):null,this.end=t?new Date(t):null,this.in_selection=!1,this.togglePicker(!1,!0)}},onSelect(){this.$emit("select",{startDate:this.start,endDate:this.end})},clickAway(e){e&&e.target&&!this.$el.contains(e.target)&&this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&this.clickCancel()},clickRange(e){this.in_selection=!1,this.$dateUtil.isValidDate(e[0])&&this.$dateUtil.isValidDate(e[1])?(this.start=this.$dateUtil.validateDateRange(new Date(e[0]),this.minDate,this.maxDate),this.end=this.$dateUtil.validateDateRange(new Date(e[1]),this.minDate,this.maxDate),this.changeLeftMonth({month:this.start.getMonth()+1,year:this.start.getFullYear()}),this.linkedCalendars===!1&&this.changeRightMonth({month:this.end.getMonth()+1,year:this.end.getFullYear()})):(this.start=null,this.end=null),this.onSelect(),this.autoApply&&this.clickedApply()},onUpdateStartTime(e){let t=new Date(this.start);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.start=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},onUpdateEndTime(e){let t=new Date(this.end);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.end=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.end})},handleEscape(e){this.open&&e.keyCode===27&&this.closeOnEsc&&this.clickCancel()}},computed:{showRanges(){return this.ranges!==!1&&!this.readonly},showCalendars(){return this.alwaysShowCalendars||this.showCustomRangeCalendars},startText(){return this.start===null?"":this.$dateUtil.format(this.start,this.locale.format)},endText(){return this.end===null?"":this.$dateUtil.format(this.end,this.locale.format)},rangeText(){let e=this.startText;return(!this.singleDatePicker||this.singleDatePicker==="range")&&(e+=this.locale.separator+this.endText),e},min(){return this.minDate?new Date(this.minDate):null},max(){return this.maxDate?new Date(this.maxDate):null},pickerStyles(){return{"show-calendar":this.open||this.opens==="inline","show-ranges":this.showRanges,"show-weeknumbers":this.showWeekNumbers,single:this.singleDatePicker,["opens"+this.opens]:!0,linked:this.linkedCalendars,"hide-calendars":!this.showCalendars}},isClear(){return!this.dateRange.startDate||!this.dateRange.endDate},isDirty(){let e=new Date(this.dateRange.startDate),t=new Date(this.dateRange.endDate);return!this.isClear&&(this.start.getTime()!==e.getTime()||this.end.getTime()!==t.getTime())}},watch:{minDate(){let e=this.$dateUtil.validateDateRange(this.monthDate,this.minDate||new Date,this.maxDate);this.changeLeftMonth({year:e.getFullYear(),month:e.getMonth()+1})},maxDate(){let e=this.$dateUtil.validateDateRange(this.nextMonthDate,this.minDate,this.maxDate||new Date);this.changeRightMonth({year:e.getFullYear(),month:e.getMonth()+1})},"dateRange.startDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.start=e&&!this.isClear&&this.$dateUtil.isValidDate(new Date(e))?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},"dateRange.endDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.end=e&&!this.isClear?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},open:{handler(e){typeof document=="object"&&this.$nextTick(()=>{e?document.body.addEventListener("click",this.clickAway):document.body.removeEventListener("click",this.clickAway),e?document.addEventListener("keydown",this.handleEscape):document.removeEventListener("keydown",this.handleEscape),!this.alwaysShowCalendars&&this.ranges&&(this.showCustomRangeCalendars=!Object.keys(this.ranges).find(t=>this.$dateUtil.isSame(this.start,this.ranges[t][0],"date")&&this.$dateUtil.isSame(this.end,this.ranges[t][1],"date")))})},immediate:!0}}},me=e=>(ne("data-v-577c3804"),e=e(),le(),e),jl=me(()=>l("i",{class:"glyphicon glyphicon-calendar fa fa-calendar"},null,-1)),Hl=me(()=>l("b",{class:"caret"},null,-1)),Ul={class:"calendars"},Ll={key:1,class:"calendars-container"};const Yl={class:"calendar-table"},Vl={key:0,class:"drp-calendar col right"};const Bl={class:"calendar-table"},Il={key:0,class:"drp-buttons"},Nl={key:0,class:"drp-selected"},zl=["disabled"];function ql(e,t,s,c,d,n){const r=w("calendar-ranges"),o=w("calendar"),f=w("calendar-time"),g=xe("append-to-body");return i(),a("div",{class:m(["vue-daterange-picker",{inline:s.opens==="inline"}])},[l("div",{class:m(s.controlContainerClass),onClick:t[0]||(t[0]=(...b)=>n.onClickPicker&&n.onClickPicker(...b)),ref:"toggle"},[v(e.$slots,"input",{startDate:e.start,endDate:e.end,ranges:s.ranges,rangeText:n.rangeText},()=>[jl,y("  "),l("span",null,h(n.rangeText),1),Hl],!0)],2),T(Te,{name:"slide-fade",mode:"out-in"},{default:M(()=>[e.open||s.opens==="inline"?R((i(),a("div",{key:0,class:m(["daterangepicker ltr",n.pickerStyles]),ref:"dropdown"},[v(e.$slots,"header",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},void 0,!0),l("div",Ul,[n.showRanges?v(e.$slots,"ranges",{key:0,startDate:e.start,endDate:e.end,ranges:s.ranges,clickRange:n.clickRange},()=>[T(r,{onClickRange:n.clickRange,onShowCustomRange:t[1]||(t[1]=b=>e.showCustomRangeCalendars=!0),"always-show-calendars":s.alwaysShowCalendars,"locale-data":e.locale,ranges:s.ranges,selected:{startDate:e.start,endDate:e.end}},null,8,["onClickRange","always-show-calendars","locale-data","ranges","selected"])],!0):u("",!0),n.showCalendars?(i(),a("div",Ll,[l("div",{class:m(["drp-calendar col left",{single:s.singleDatePicker}])},[u("",!0),l("div",Yl,[T(o,{monthDate:e.monthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeLeftMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.start?(i(),E(f,{key:1,onUpdate:n.onUpdateStartTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.start,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)],2),s.singleDatePicker?u("",!0):(i(),a("div",Vl,[u("",!0),l("div",Bl,[T(o,{monthDate:e.nextMonthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeRightMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.end?(i(),E(f,{key:1,onUpdate:n.onUpdateEndTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.end,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)]))])):u("",!0)]),v(e.$slots,"footer",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},()=>[s.autoApply?u("",!0):(i(),a("div",Il,[n.showCalendars?(i(),a("span",Nl,h(n.rangeText),1)):u("",!0),s.readonly?u("",!0):(i(),a("button",{key:1,class:"cancelBtn btn btn-sm btn-secondary",type:"button",onClick:t[2]||(t[2]=(...b)=>n.clickCancel&&n.clickCancel(...b))},h(e.locale.cancelLabel),1)),s.readonly?u("",!0):(i(),a("button",{key:2,class:"applyBtn btn btn-sm btn-success",disabled:e.in_selection,type:"button",onClick:t[3]||(t[3]=(...b)=>n.clickedApply&&n.clickedApply(...b))},h(e.locale.applyLabel),9,zl))]))],!0)],2)),[[g]]):u("",!0)]),_:3})],2)}const Wl=C(Al,[["render",ql],["__scopeId","data-v-577c3804"]]),Gl={name:"ns-date-range-picker",data(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:Wl},mounted(){this.field.value!==void 0&&(this.dateRange=this.field.value)},watch:{dateRange(){const e={startDate:x(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:x(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:_,getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Kl={class:"flex flex-auto flex-col mb-2 ns-date-range-picker"},Ql=["for"],Zl={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Xl={class:"text-primary sm:text-sm sm:leading-5"},Jl=l("i",{class:"las la-times"},null,-1),ei=[Jl],ti={class:"flex justify-between items-center w-full py-2"},si={class:"text-xs"},ni={class:"text-xs"};function li(e,t,s,c,d,n){const r=w("date-range-picker"),o=w("ns-field-description");return i(),a("div",Kl,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ql),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm"])},[s.leading?(i(),a("div",Zl,[l("span",Xl,h(s.leading),1)])):u("",!0),l("button",{class:"px-3 outline-none bg-error-secondary font-semibold text-white",onClick:t[0]||(t[0]=f=>n.clearDate())},ei),T(r,{class:"w-full flex items-center bg-input-background",ref:"picker","locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,modelValue:d.dateRange,"onUpdate:modelValue":t[1]||(t[1]=f=>d.dateRange=f),disabled:s.field.disabled,linkedCalendars:!0},{input:M(f=>[l("div",ti,[l("span",si,h(n.__("Range Starts"))+" : "+h(n.getFormattedDate(f.startDate)),1),l("span",ni,h(n.__("Range Ends"))+" : "+h(n.getFormattedDate(f.endDate)),1)])]),_:1},8,["modelValue","disabled"])],2),T(o,{field:s.field},null,8,["field"])])}const ge=C(Gl,[["render",li]]),ii={name:"ns-date-time-picker",props:["field","date"],data(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:x}},computed:{fieldDate(){return this.field?x(this.field.value).isValid()?x(this.field.value):x():this.date?x(this.date):x()}},mounted(){let e=x(this.field.value);e.isValid()?this.setDate(e.format("YYYY-MM-DD HH:mm:ss")):this.setDate(x(ns.date.current).format("YYYY-MM-DD HH:mm:ss"))},methods:{__:_,setDate(e){this.field.value=e}}},ai={class:"picker mb-2"},ri={key:0,class:"block leading-5 font-medium text-primary"},di={class:"ns-button"},oi=l("i",{class:"las la-clock text-xl"},null,-1),ui={key:0,class:"mx-1 text-sm"},ci={key:0},hi={key:1},fi={key:1,class:"mx-1 text-sm"},mi={key:0},gi={key:1},bi={key:1,class:"text-sm text-secondary py-1"},_i={key:2,class:"relative z-10 h-0 w-0"};function pi(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",ai,[s.field&&s.field.label&&s.field.label.length>0?(i(),a("label",ri,h(s.field.label),1)):u("",!0),l("div",di,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:m([s.field&&s.field.label&&s.field.label.length>0?"mt-1 border border-input-edge":"","shadow rounded cursor-pointer w-full p-1 flex items-center text-primary"])},[oi,s.field?(i(),a("span",ui,[[null,"",void 0].includes(s.field.value)?u("",!0):(i(),a("span",ci,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.field.value)?(i(),a("span",hi,"N/A")):u("",!0)])):u("",!0),s.date?(i(),a("span",fi,[[null,"",void 0].includes(s.date)?u("",!0):(i(),a("span",mi,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.date)?(i(),a("span",gi,"N/A")):u("",!0)])):u("",!0)],2)]),s.field?(i(),a("p",bi,h(s.field.description),1)):u("",!0),d.visible?(i(),a("div",_i,[l("div",{class:m([s.field&&s.field.label&&s.field.label.length>0?"-mt-4":"mt-2","absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col"])},[s.field?(i(),E(r,{key:0,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),onSet:t[2]||(t[2]=o=>n.setDate(o)),visible:d.visible,date:s.field.value},null,8,["visible","date"])):u("",!0),s.date?(i(),E(r,{key:1,onOnClickOut:t[3]||(t[3]=o=>d.visible=!1),onSet:t[4]||(t[4]=o=>n.setDate(o)),visible:d.visible,date:s.date},null,8,["visible","date"])):u("",!0)],2)])):u("",!0)])}const be=C(ii,[["render",pi]]),yi={name:"ns-datepicker",components:{nsCalendar:ce},props:["label","date","format"],computed:{formattedDate(){return x(this.date).format(this.format||"YYYY-MM-DD HH:mm:ss")}},data(){return{visible:!1}},mounted(){},methods:{__:_,setDate(e){this.$emit("set",e)}}},vi={class:"picker"},ki={class:"ns-button"},wi=l("i",{class:"las la-clock text-2xl"},null,-1),xi={class:"mx-1 text-sm"},Di={key:0},Ci={key:1},Mi={key:0,class:"relative h-0 w-0 -mb-2"},Ti={class:"w-72 mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col ns-floating-panel"};function Si(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",vi,[l("div",ki,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:"rounded cursor-pointer border border-input-edge shadow w-full px-1 py-1 flex items-center text-primary"},[wi,l("span",xi,[l("span",null,h(s.label||n.__("Date"))+" : ",1),s.date?(i(),a("span",Di,h(n.formattedDate),1)):(i(),a("span",Ci,h(n.__("N/A")),1))])])]),d.visible?(i(),a("div",Mi,[l("div",Ti,[T(r,{visible:d.visible,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),date:s.date,onSet:t[2]||(t[2]=o=>n.setDate(o))},null,8,["visible","date"])])])):u("",!0)])}const $i=C(yi,[["render",Si]]),Ei={name:"ns-daterange-picker",data(){return{leftCalendar:x(),rightCalendar:x().add(1,"months"),rangeViewToggled:!1,clickedOnCalendar:!1}},mounted(){this.field.value||this.clearDate(),document.addEventListener("click",this.checkClickedItem)},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},watch:{leftCalendar(){this.leftCalendar.isSame(this.rightCalendar,"month")&&this.rightCalendar.add(1,"months")},rightCalendar(){this.rightCalendar.isSame(this.leftCalendar,"month")&&this.leftCalendar.sub(1,"months")}},methods:{__:_,setDateRange(e,t){this.field.value[e]=t,x(this.field.value.startDate).isBefore(x(this.field.value.endDate))&&this.$emit("change",this.field)},getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.field.value={startDate:null,endDate:null}},toggleRangeView(){this.rangeViewToggled=!this.rangeViewToggled},handleDateRangeClick(){this.clickedOnCalendar=!0},checkClickedItem(e){this.$el.getAttribute("class").split(" ").includes("ns-daterange-picker")&&(!this.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.rangeViewToggled&&(this.$emit("blur",this.field),this.toggleRangeView()),setTimeout(()=>{this.clickedOnCalendar=!1},100))}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"},startDateFormatted(){return this.field.value!==void 0&&x(this.field.value.startDate).isValid()?x(this.field.value.startDate).format("YYYY-MM-DD HH:mm"):!1},endDateFormatted(){return this.field.value!==void 0&&x(this.field.value.endDate).isValid()?x(this.field.value.endDate).format("YYYY-MM-DD HH:mm"):!1}},props:["placeholder","leading","type","field"]},Ri=["for"],Fi={class:"border border-input-edge rounded-tl rounded-bl flex-auto flex"},Oi={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Pi={class:"text-primary sm:text-sm sm:leading-5"},Ai=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),ji={class:""},Hi=l("span",{class:"mx-2"},"—",-1),Ui=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),Li={class:""},Yi=l("i",{class:"las la-times"},null,-1),Vi=[Yi],Bi={key:0,class:"relative h-0 w-0"},Ii={class:"z-10 absolute md:w-[550px] w-[225px] mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col"},Ni={class:"flex flex-col md:flex-row bg-box-background rounded-lg"},zi=l("div",{class:"flex-auto border-l border-r"},null,-1);function qi(e,t,s,c,d,n){const r=w("ns-calendar"),o=w("ns-field-description");return i(),a("div",{onClick:t[4]||(t[4]=f=>n.handleDateRangeClick()),class:"flex flex-auto flex-col mb-2 ns-daterange-picker"},[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ri),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group bg-input-background rounded overflow-hidden shadow focus:shadow-sm"])},[l("div",Fi,[s.leading?(i(),a("div",Oi,[l("span",Pi,h(s.leading),1)])):u("",!0),l("div",{class:"flex flex-auto p-1 text-primary text-sm items-center cursor-pointer",onClick:t[0]||(t[0]=f=>n.toggleRangeView())},[Ai,l("span",ji,h(n.startDateFormatted||n.__("N/A")),1),Hi,Ui,l("span",Li,h(n.endDateFormatted||n.__("N/A")),1)])]),l("button",{class:"px-3 outline-none font-bold bg-error-tertiary",onClick:t[1]||(t[1]=f=>n.clearDate())},Vi)],2),d.rangeViewToggled?(i(),a("div",Bi,[l("div",Ii,[l("div",Ni,[T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"left",date:s.field.value.startDate,"selected-range":s.field.value,onSet:t[2]||(t[2]=f=>n.setDateRange("startDate",f))},null,8,["range","date","selected-range"]),zi,T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"right",date:s.field.value.endDate,"selected-range":s.field.value,onSet:t[3]||(t[3]=f=>n.setDateRange("endDate",f))},null,8,["range","date","selected-range"])])])])):u("",!0),T(o,{field:s.field},null,8,["field"])])}const Wi=C(Ei,[["render",qi]]),Gi={name:"ns-dropzone",emits:["dropped"],mounted(){},setup(e,{emit:t}){return{dropZone:q(null),handleDrop:d=>{const n=d.dataTransfer.getData("text");t("dropped",n)}}}};function Ki(e,t,s,c,d,n){return i(),a("div",{ref:"dropZone",class:"ns-drop-zone mb-4",onDragover:t[0]||(t[0]=Se(()=>{},["prevent"]))},[v(e.$slots,"default",{},void 0,!0)],544)}const Qi=C(Gi,[["render",Ki],["__scopeId","data-v-0817a409"]]),Zi={emits:["drag-start","drag-end"],name:"ns-draggable",props:{widget:{required:!0}},setup(e,{emit:t}){const s=q(null),c=q(null);let d=null,n=0,r=0,o=0,f=0;const g=F=>{const P=F.srcElement.closest(".ns-draggable-item"),O=P.getBoundingClientRect();d=P.cloneNode(!0),d.setAttribute("class","ns-ghost"),d.style.display="none",d.style.position="fixed",d.style.top=`${O.top}px`,d.style.left=`${O.left}px`,d.style.width=`${O.width}px`,d.style.height=`${O.height}px`,P.closest(".ns-drop-zone").appendChild(d),n=F.clientX-o,r=F.clientY-f,c.value={dom:P},t("drag-start",e.widget)},b=F=>{if(c.value===null)return;const P=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost"),O=P.querySelector("div");Array.from(O.classList).filter(j=>j.startsWith("shadow")).forEach(j=>O.classList.remove(j)),o=F.clientX-n,f=F.clientY-r,O.style.boxShadow="0px 4px 10px 5px rgb(0 0 0 / 48%)",P.style.display="block",P.style.transform=`translate(${o}px, ${f}px)`,P.style.cursor="grabbing",document.querySelectorAll(".ns-drop-zone").forEach(j=>{j.getBoundingClientRect();const{left:I,top:N,right:k,bottom:ye}=j.getBoundingClientRect(),{clientX:Z,clientY:X}=F;Z>=I&&Z<=k&&X>=N&&X<=ye?j.setAttribute("hovered","true"):j.setAttribute("hovered","false")})},S=F=>{if(c.value===null)return;const O=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost");O&&O.remove(),c.value=null,o=0,f=0,F.srcElement.closest(".ns-drop-zone"),t("drag-end",e.widget)};return De(()=>{s.value&&(document.addEventListener("mousemove",F=>b(F)),document.addEventListener("mouseup",F=>S(F)))}),Ce(()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S)}),{draggable:s,startDrag:g}}};function Xi(e,t,s,c,d,n){return i(),a("div",{ref:"draggable",class:"ns-draggable-item",onMousedown:t[0]||(t[0]=(...r)=>c.startDrag&&c.startDrag(...r))},[v(e.$slots,"default")],544)}const Ji=C(Zi,[["render",Xi]]),ea={name:"ns-dragzone",props:["raw-widgets","raw-columns"],components:{nsDropzone:Qi,nsDraggable:Ji},data(){return{widgets:[],theme:ns.theme,dragged:null,columns:[]}},mounted(){this.widgets=this.rawWidgets.map(e=>({name:e.name,"component-name":e["component-name"],"class-name":e["class-name"],component:te(window[e["component-name"]])})),this.columns=this.rawColumns.map(e=>(e.widgets.forEach(t=>{t.component=te(window[t.identifier]),t["class-name"]=t.class_name,t["component-name"]=t.identifier}),e)),setTimeout(()=>{var e=document.querySelectorAll(".widget-placeholder");document.addEventListener("mousemove",t=>{for(var s=0;s=c.left&&t.clientX<=c.right&&t.clientY>=c.top&&t.clientY<=c.bottom){e[s].setAttribute("hovered","true");break}else e[s].setAttribute("hovered","false")}})},10)},computed:{hasUnusedWidgets(){const e=this.columns.map(t=>t.widgets).flat();return this.widgets.filter(t=>!e.map(c=>c["component-name"]).includes(t["component-name"])).length>0}},methods:{__:_,handleEndDragging(e){const t=document.querySelector('.ns-drop-zone[hovered="true"]');if(t){const d=t.closest("[column-name]").getAttribute("column-name"),n=this.columns.filter(O=>O.name===d),r=n[0].widgets.filter(O=>O["component-name"]===t.querySelector(".ns-draggable-item").getAttribute("component-name")),o=document.querySelector(`[component-name="${e["component-name"]}"]`),g=o.closest("[column-name]").getAttribute("column-name"),b=this.columns.filter(O=>O.name===g),S=b[0].widgets.filter(O=>O["component-name"]===o.getAttribute("component-name"));if(S[0]["component-name"]===r[0]["component-name"])return;const F=S[0].position,P=r[0].position;S[0].column=d,S[0].position=P,r[0].column=g,r[0].position=F,n[0].widgets[P]=S[0],b[0].widgets[F]=r[0],this.handleChange(n[0]),this.handleChange(b[0]),t.setAttribute("hovered","false")}const s=document.querySelector('.widget-placeholder[hovered="true"]');if(s){const c=s.closest("[column-name]").getAttribute("column-name");if(e===c){console.log("The widget is already in the same column.");return}const d=this.columns.filter(o=>o.name===e.column)[0],n=d.widgets.indexOf(e);d.widgets.splice(n,1);const r=this.columns.filter(o=>o.name===c)[0];e.position=r.widgets.length,e.column=c,r.widgets.push(e),this.handleChange(d),this.handleChange(r)}},handleChange(e,t){setTimeout(()=>{nsHttpClient.post("/api/users/widgets",{column:e}).subscribe(s=>{},s=>$.error(s.message||_("An unpexpected error occured while using the widget.")).subscribe())},100)},handleRemoveWidget(e,t){const s=t.widgets.indexOf(e);t.widgets.splice(s,1),this.handleChange(t)},async openWidgetAdded(e){try{const t=this.columns.filter(r=>r.name!==e.name?(console.log(r.name),r.widgets.length>0):!1).map(r=>r.widgets).flat(),s=e.widgets.map(r=>r["component-name"]),c=this.widgets.filter(r=>{const o=t.map(f=>f["component-name"]);return o.push(...s),!o.includes(r["component-name"])}).map(r=>({value:r,label:r.name})),d=await new Promise((r,o)=>{const f=c.filter(g=>s.includes(g["component-name"]));Popup.show(Re,{value:f,resolve:r,reject:o,type:"multiselect",options:c,label:_("Choose Widget"),description:_("Select with widget you want to add to the column.")})}),n=this.columns.indexOf(e);this.columns[n].widgets=[...this.columns[n].widgets,...d].map((r,o)=>(r.position=o,r.column=e.name,r)),this.handleChange(this.columns[n])}catch(t){console.log(t)}}}},ta={class:"flex md:-mx-2 flex-wrap"},sa=["column-name"],na=["onClick"],la={class:"text-sm text-primary",type:"info"};function ia(e,t,s,c,d,n){const r=w("ns-draggable"),o=w("ns-dropzone");return i(),a("div",ta,[(i(!0),a(p,null,D(d.columns,(f,g)=>(i(),a("div",{class:"w-full md:px-2 md:w-1/2 lg:w-1/3 xl:1/4","column-name":f.name,key:f.name},[(i(!0),a(p,null,D(f.widgets,b=>(i(),E(o,null,{default:M(()=>[T(r,{"component-name":b["component-name"],onDragEnd:t[0]||(t[0]=S=>n.handleEndDragging(S)),widget:b},{default:M(()=>[(i(),E(G(b.component),{onOnRemove:S=>n.handleRemoveWidget(b,f),widget:b},null,40,["onOnRemove","widget"]))]),_:2},1032,["component-name","widget"])]),_:2},1024))),256)),n.hasUnusedWidgets?(i(),a("div",{key:0,onClick:b=>n.openWidgetAdded(f),class:"widget-placeholder cursor-pointer border-2 border-dashed h-16 flex items-center justify-center"},[l("span",la,h(n.__("Click here to add widgets")),1)],8,na)):u("",!0)],8,sa))),128))])}const aa=C(ea,[["render",ia],["__scopeId","data-v-8fa76ad4"]]),ra={emits:["blur","change","saved","keypress"],data:()=>({}),mounted(){},components:{nsDateRangePicker:ge,nsDateTimePicker:be,nsSwitch:ue},computed:{isInputField(){return["text","password","email","number","tel"].includes(this.field.type)},isHiddenField(){return["hidden"].includes(this.field.type)},isDateField(){return["date"].includes(this.field.type)},isSelectField(){return["select"].includes(this.field.type)},isSearchField(){return["search-select"].includes(this.field.type)},isTextarea(){return["textarea"].includes(this.field.type)},isCheckbox(){return["checkbox"].includes(this.field.type)},isMultiselect(){return["multiselect"].includes(this.field.type)},isInlineMultiselect(){return["inline-multiselect"].includes(this.field.type)},isSelectAudio(){return["select-audio"].includes(this.field.type)},isSwitch(){return["switch"].includes(this.field.type)},isMedia(){return["media"].includes(this.field.type)},isCkEditor(){return["ckeditor"].includes(this.field.type)},isDateTimePicker(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker(){return["daterangepicker"].includes(this.field.type)},isCustom(){return["custom"].includes(this.field.type)}},props:["field"],methods:{handleSaved(e,t){this.$emit("saved",t)},addOption(e){this.field.type==="select"&&this.field.options.forEach(s=>s.selected=!1),e.selected=!0;const t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},changeTouchedState(e,t){t.stopPropagation&&t.stopPropagation(),e.touched=!0,this.$emit("change",e)},refreshMultiselect(){this.field.value=this.field.options.filter(e=>e.selected).map(e=>e.value)},removeOption(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}}},da=["name","value"],oa={key:1,class:"flex flex-auto mb-2"},ua=["innerHTML"],ca=["innerHTML"],ha=["innerHTML"],fa=["innerHTML"],ma=["innerHTML"],ga=["innerHTML"],ba=["innerHTML"],_a=["innerHTML"],pa=["innerHTML"],ya=["innerHTML"],va=["innerHTML"],ka=["innerHTML"],wa=["innerHTML"],xa=["innerHTML"];function Da(e,t,s,c,d,n){const r=w("ns-input"),o=w("ns-date-time-picker"),f=w("ns-date"),g=w("ns-media-input"),b=w("ns-select"),S=w("ns-search-select"),F=w("ns-daterange-picker"),P=w("ns-select-audio"),O=w("ns-textarea"),B=w("ns-checkbox"),Q=w("ns-inline-multiselect"),j=w("ns-multiselect"),I=w("ns-ckeditor"),N=w("ns-switch");return i(),a(p,null,[n.isHiddenField?(i(),a("input",{key:0,type:"hidden",name:s.field.name,value:s.field.value},null,8,da)):u("",!0),n.isHiddenField?u("",!0):(i(),a("div",oa,[n.isInputField?(i(),E(r,{key:0,onKeypress:t[0]||(t[0]=k=>n.changeTouchedState(s.field,k)),onChange:t[1]||(t[1]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ua)]),_:1},8,["field"])):u("",!0),n.isDateTimePicker?(i(),E(o,{key:1,onBlur:t[2]||(t[2]=k=>e.$emit("blur",s.field)),onChange:t[3]||(t[3]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ca)]),_:1},8,["field"])):u("",!0),n.isDateField?(i(),E(f,{key:2,onBlur:t[4]||(t[4]=k=>e.$emit("blur",s.field)),onChange:t[5]||(t[5]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ha)]),_:1},8,["field"])):u("",!0),n.isMedia?(i(),E(g,{key:3,onBlur:t[6]||(t[6]=k=>e.$emit("blur",s.field)),onChange:t[7]||(t[7]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,fa)]),_:1},8,["field"])):u("",!0),n.isSelectField?(i(),E(b,{key:4,onChange:t[8]||(t[8]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ma)]),_:1},8,["field"])):u("",!0),n.isSearchField?(i(),E(S,{key:5,field:s.field,onSaved:t[9]||(t[9]=k=>n.handleSaved(s.field,k)),onChange:t[10]||(t[10]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ga)]),_:1},8,["field"])):u("",!0),n.isDateRangePicker?(i(),E(F,{key:6,onBlur:t[11]||(t[11]=k=>e.$emit("blur",s.field)),onChange:t[12]||(t[12]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ba)]),_:1},8,["field"])):u("",!0),n.isSelectAudio?(i(),E(P,{key:7,onBlur:t[13]||(t[13]=k=>e.$emit("blur",s.field)),onChange:t[14]||(t[14]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,_a)]),_:1},8,["field"])):u("",!0),n.isTextarea?(i(),E(O,{key:8,onBlur:t[15]||(t[15]=k=>e.$emit("blur",s.field)),onChange:t[16]||(t[16]=k=>n.changeTouchedState(s.field,k)),field:s.field},{description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,pa)]),default:M(()=>[l("template",null,[y(h(s.field.label),1)])]),_:1},8,["field"])):u("",!0),n.isCheckbox?(i(),E(B,{key:9,onBlur:t[17]||(t[17]=k=>e.$emit("blur",s.field)),onChange:t[18]||(t[18]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ya)]),_:1},8,["field"])):u("",!0),n.isInlineMultiselect?(i(),E(Q,{key:10,onBlur:t[19]||(t[19]=k=>e.$emit("blur",s.field)),onUpdate:t[20]||(t[20]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,va)]),_:1},8,["field"])):u("",!0),n.isMultiselect?(i(),E(j,{key:11,onAddOption:t[21]||(t[21]=k=>n.addOption(k)),onRemoveOption:t[22]||(t[22]=k=>n.removeOption(k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ka)]),_:1},8,["field"])):u("",!0),n.isCkEditor?(i(),E(I,{key:12,field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,wa)]),_:1},8,["field"])):u("",!0),n.isSwitch?(i(),E(N,{key:13,field:s.field,onChange:t[23]||(t[23]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,xa)]),_:1},8,["field"])):u("",!0),n.isCustom?(i(),E(Me,{key:14},[(i(),E(G(s.field.component),{field:s.field,onBlur:t[24]||(t[24]=k=>e.$emit("blur",s.field)),onChange:t[25]||(t[25]=k=>n.changeTouchedState(s.field,k))},null,40,["field"]))],1024)):u("",!0)]))],64)}const Ca=C(ra,[["render",Da]]),Ma={name:"ns-field-detail",props:["field"],methods:{__:_}},Ta={key:0,class:"text-xs ns-description"};function Sa(e,t,s,c,d,n){return i(),a(p,null,[!s.field.errors||s.field.errors.length===0?(i(),a("p",Ta,h(s.field.description),1)):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs ns-error"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y(h(n.__("This field is required.")),1)]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y(h(n.__("This field must contain a valid email address.")),1)]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0),r.identifier==="same"?v(e.$slots,r.identifier,{key:3},()=>[y(h(n.__('This field must be similar to "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0),r.identifier==="min"?v(e.$slots,r.identifier,{key:4},()=>[y(h(n.__('This field must have at least "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="max"?v(e.$slots,r.identifier,{key:5},()=>[y(h(n.__('This field must have at most "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="different"?v(e.$slots,r.identifier,{key:6},()=>[y(h(n.__('This field must be different from "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0)]))),128))],64)}const $a=C(Ma,[["render",Sa]]),Ea={props:["className","buttonClass","type"]};function Ra(e,t,s,c,d,n){return i(),a("button",{class:m([s.type?s.type:s.buttonClass,"ns-inset-button rounded-full h-8 w-8 border items-center justify-center"])},[l("i",{class:m([s.className,"las"])},null,2)],2)}const Fa=C(Ea,[["render",Ra]]),Oa={name:"ns-input-label",props:["field"],data(){return{tags:[],searchField:"",focused:!1,optionsToKeyValue:{}}},methods:{addOption(e){let t;this.optionSuggestions.length===1&&e===void 0?t=this.optionSuggestions[0]:e!==void 0&&(t=e),t!==void 0&&(this.field.value.filter(c=>c===t.value).length>0||(this.searchField="",this.field.value.push(t.value),this.$emit("change",this.field)))},removeOption(e){const t=this.field.value.filter(s=>s!==e);this.field.value=t}},mounted(){if(this.$refs.searchField.addEventListener("focus",e=>{this.focused=!0}),this.$refs.searchField.addEventListener("blur",e=>{setTimeout(()=>{this.focused=!1},200)}),this.field.value.length===void 0)try{this.field.value=JSON.parse(this.field.value)}catch{this.field.value=[]}this.field.options.forEach(e=>{this.optionsToKeyValue[e.value]=e.label})},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},optionSuggestions(){if(typeof this.field.value.map=="function"){const e=this.field.value.map(t=>t.value);return this.field.options.filter(t=>!e.includes(t.value)&&this.focused>0&&(t.label.search(this.searchField)>-1||t.value.search(this.searchField)>-1))}return[]},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":""}},props:["placeholder","leading","type","field"]},Pa={class:"flex flex-col mb-2 flex-auto ns-input"},Aa=["for"],ja={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Ha={class:"leading sm:text-sm sm:leading-5"},Ua=["disabled","id","type","placeholder"],La={class:"rounded shadow bg-box-elevation-hover flex mr-1 mb-1"},Ya={class:"p-2 flex items-center text-primary"},Va={class:"flex items-center justify-center px-2"},Ba=["onClick"],Ia=l("i",{class:"las la-times-circle"},null,-1),Na=[Ia],za={class:"relative"},qa=["placeholder"],Wa={class:"h-0 absolute w-full z-10"},Ga={class:"shadow bg-box-background absoluve bottom-0 w-full max-h-80 overflow-y-auto"},Ka=["onClick"];function Qa(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Pa,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Aa)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",ja,[l("span",Ha,h(s.leading),1)])):u("",!0),l("div",{disabled:s.field.disabled,id:s.field.name,type:s.field.type,class:m([n.inputClass,"flex sm:text-sm sm:leading-5 p-1 flex-wrap"]),placeholder:s.field.placeholder||""},[(i(!0),a(p,null,D(s.field.value,o=>(i(),a("div",La,[l("div",Ya,h(d.optionsToKeyValue[o]),1),l("div",Va,[l("div",{onClick:f=>n.removeOption(o),class:"cursor-pointer rounded-full bg-error-tertiary h-5 w-5 flex items-center justify-center"},Na,8,Ba)])]))),256)),l("div",za,[R(l("input",{onChange:t[0]||(t[0]=o=>o.stopPropagation()),onKeydown:t[1]||(t[1]=Y(o=>n.addOption(),["enter"])),ref:"searchField","onUpdate:modelValue":t[2]||(t[2]=o=>d.searchField=o),type:"text",class:"w-auto p-2 border-b border-dashed bg-transparent",placeholder:s.field.placeholder||"Start searching here..."},null,40,qa),[[A,d.searchField]]),l("div",Wa,[l("div",Ga,[l("ul",null,[(i(!0),a(p,null,D(n.optionSuggestions,o=>(i(),a("li",{onClick:f=>n.addOption(o),class:"p-2 hover:bg-box-elevation-hover text-primary cursor-pointer"},h(o.label),9,Ka))),256))])])])])],10,Ua)],2),T(r,{field:s.field},null,8,["field"])])}const Za=C(Oa,[["render",Qa]]),Xa={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Ja={class:"flex flex-col mb-2 flex-auto ns-input"},er=["for"],tr={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},sr={class:"leading sm:text-sm sm:leading-5"},nr=["disabled","id","type","placeholder"];function lr(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Ja,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,er)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative overflow-hidden border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",tr,[l("span",sr,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.field.placeholder||""},null,10,nr),[[oe,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ir=C(Xa,[["render",lr]]),ar={data:()=>({clicked:!1,_save:0}),props:["type","to","href","target"],computed:{buttonclass(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}},rr={class:"flex"},dr=["target","href"];function or(e,t,s,c,d,n){return i(),a("div",rr,[s.href?(i(),a("a",{key:0,target:s.target,href:s.href,class:m([n.buttonclass,"rounded cursor-pointer py-2 px-3 font-semibold"])},[v(e.$slots,"default")],10,dr)):u("",!0)])}const ur=C(ar,[["render",or]]),_e={zip:"la-file-archive",tar:"la-file-archive",bz:"la-file-archive","7z":"la-file-archive",css:"la-file-code",js:"la-file-code",json:"la-file-code",docx:"la-file-word",doc:"la-file-word",mp3:"la-file-audio",aac:"la-file-audio",ods:"la-file-audio",pdf:"la-file-pdf",csv:"la-file-csv",avi:"la-file-video",mpeg:"la-file-video",mpkg:"la-file-video",unknown:"la-file"},cr={name:"ns-media",props:["popup"],data(){return{searchFieldDebounce:null,searchField:"",pages:[{label:_("Upload"),name:"upload",selected:!1},{label:_("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},fileIcons:_e,queryPage:1,bulkSelect:!1,files:[]}},mounted(){this.popupCloser();const e=this.pages.filter(t=>t.name==="gallery")[0];this.select(e)},watch:{searchField(){clearTimeout(this.searchFieldDebounce),this.searchFieldDebounce=setTimeout(()=>{this.loadGallery(1)},500)},files:{handler(){this.uploadFiles()},deep:!0}},computed:{postMedia(){return de.applyFilters("http-client-url","/api/medias")},currentPage(){return this.pages.filter(e=>e.selected)[0]},hasOneSelected(){return this.response.data.filter(e=>e.selected).length>0},selectedResource(){return this.response.data.filter(e=>e.selected)[0]},csrf(){return ns.authentication.csrf},isPopup(){return typeof this.popup<"u"},user_id(){return this.isPopup&&this.popup.params.user_id||0},panelOpened(){return!this.bulkSelect&&this.hasOneSelected},popupInstance(){return this.popup}},methods:{popupCloser:ae,__:_,cancelBulkSelect(){this.bulkSelect=!1,this.response.data.forEach(e=>e.selected=!1)},openError(e){L.show(se,{title:_("An error occured"),message:e.error.message||_("An unexpected error occured.")})},deleteSelected(){L.show(V,{title:_("Confirm Your Action"),message:_("You're about to delete selected resources. Would you like to proceed?"),onAction:e=>{e&&U.post("/api/medias/bulk-delete",{ids:this.response.data.filter(t=>t.selected).map(t=>t.id)}).subscribe({next:t=>{$.success(t.message).subscribe(),this.loadGallery()},error:t=>{$.error(t.message).subscribe()}})}})},loadUploadScreen(){setTimeout(()=>{this.setDropZone()},1e3)},setDropZone(){const e=document.getElementById("dropping-zone");e.addEventListener("dragenter",s=>this.preventDefaults(s),!1),e.addEventListener("dragleave",s=>this.preventDefaults(s),!1),e.addEventListener("dragover",s=>this.preventDefaults(s),!1),e.addEventListener("drop",s=>this.preventDefaults(s),!1),["dragenter","dragover"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!0})}),["dragleave","drop"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!1})}),e.addEventListener("drop",s=>this.handleDrop(s),!1),this.$refs.files.addEventListener("change",s=>this.processFiles(s.currentTarget.files))},async uploadFiles(){const e=this.files.filter(t=>t.uploaded===!1&&t.progress===0&&t.failed===!1);for(let t=0;t{const r=new FormData;r.append("file",s.file),U.post("/api/medias",r,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:o=>{s.uploaded=!0,s.progress=100,d(o)},error:o=>{e[t].failed=!0,e[t].error=o}})})}catch{s.failed=!0}}},handleDrop(e){this.processFiles(e.dataTransfer.files),e.preventDefault(),e.stopPropagation()},preventDefaults(e){e.preventDefault(),e.stopPropagation()},getAllParents(e){let t=[];for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!="body";)e=e.parentNode,t.push(e);return t},triggerManualUpload(e){const t=e.target;if(t!==null){const c=this.getAllParents(t).map(d=>{const n=d.getAttribute("class");if(n)return n.split(" ")});if(t.getAttribute("class")){const d=t.getAttribute("class").split(" ");c.push(d)}c.flat().includes("ns-scrollbar")||this.$refs.files.click()}},processFiles(e){Array.from(e).filter(c=>(console.log(this),Object.values(window.ns.medias.mimes).includes(c.type))).forEach(c=>{this.files.unshift({file:c,uploaded:!1,failed:!1,progress:0})})},select(e){this.pages.forEach(t=>t.selected=!1),e.selected=!0,e.name==="gallery"?this.loadGallery():e.name==="upload"&&this.loadUploadScreen()},loadGallery(e=null){e=e===null?this.queryPage:e,this.queryPage=e,U.get(`/api/medias?page=${e}&user_id=${this.user_id}${this.searchField.length>0?`&search=${this.searchField}`:""}`).subscribe(t=>{t.data.forEach(s=>s.selected=!1),this.response=t})},submitChange(e,t){U.put(`/api/medias/${t.id}`,{name:e.srcElement.textContent}).subscribe({next:s=>{t.fileEdit=!1,$.success(s.message,"OK").subscribe()},error:s=>{t.fileEdit=!1,$.success(s.message||_("An unexpected error occured."),"OK").subscribe()}})},useSelectedEntries(){this.popup.params.resolve({event:"use-selected",value:this.response.data.filter(e=>e.selected)}),this.popup.close()},selectResource(e){this.bulkSelect||this.response.data.forEach((t,s)=>{s!==this.response.data.indexOf(e)&&(t.selected=!1)}),e.fileEdit=!1,e.selected=!e.selected},isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)}}},hr={class:"sidebar w-48 md:h-full flex-shrink-0"},fr={class:"text-xl font-bold my-4 text-center"},mr={class:"sidebar-menus flex md:block mt-8"},gr=["onClick"],br={key:0,class:"content flex-auto w-full flex-col overflow-hidden flex"},_r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},pr=l("div",null,null,-1),yr={class:"cursor-pointer text-lg md:text-xl font-bold text-center text-primary mb-4"},vr={style:{display:"none"},type:"file",name:"",multiple:"",ref:"files",id:""},kr={class:"rounded bg-box-background shadow w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},wr={key:0},xr={key:0,class:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},Dr=["onClick"],Cr=l("i",{class:"las la-eye"},null,-1),Mr={class:"ml-2"},Tr={key:1,class:"h-full w-full items-center justify-center flex text-center text-soft-tertiary"},Sr={key:1,class:"content flex-auto flex-col w-full overflow-hidden flex"},$r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},Er=l("div",null,null,-1),Rr={class:"flex flex-auto overflow-hidden"},Fr={class:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},Or={class:"p-2 border-b border-box-background"},Pr={class:"ns-input border-2 rounded border-input-edge bg-input-background flex"},Ar=["placeholder"],jr={key:0,class:"flex items-center justify-center w-20 p-1"},Hr={class:"flex flex-auto"},Ur={class:"p-2 overflow-x-auto"},Lr={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Yr={class:"p-2"},Vr=["onClick"],Br=["src","alt"],Ir={key:1,class:"object-cover h-full flex items-center justify-center"},Nr={key:0,class:"flex flex-auto items-center justify-center"},zr={class:"text-2xl font-bold"},qr={id:"preview",class:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0"},Wr={key:0,class:"h-64 bg-gray-800 flex items-center justify-center"},Gr=["src","alt"],Kr={key:1,class:"object-cover h-full flex items-center justify-center"},Qr={key:1,id:"details",class:"p-4 text-gray-700 text-sm"},Zr={class:"flex flex-col mb-2"},Xr={class:"font-bold block"},Jr=["contenteditable"],ed={class:"flex flex-col mb-2"},td={class:"font-bold block"},sd={class:"flex flex-col mb-2"},nd={class:"font-bold block"},ld={class:"py-2 pr-2 flex ns-media-footer flex-shrink-0 justify-between"},id={class:"flex -mx-2 flex-shrink-0"},ad={key:0,class:"px-2"},rd={class:"ns-button shadow rounded overflow-hidden info"},dd=l("i",{class:"las la-times"},null,-1),od={key:1,class:"px-2"},ud={class:"ns-button shadow rounded overflow-hidden info"},cd=l("i",{class:"las la-check-circle"},null,-1),hd={key:2,class:"px-2"},fd={class:"ns-button shadow rounded overflow-hidden warning"},md=l("i",{class:"las la-trash"},null,-1),gd={class:"flex-shrink-0 -mx-2 flex"},bd={class:"px-2"},_d={class:"rounded shadow overflow-hidden flex text-sm"},pd=["disabled"],yd=l("hr",{class:"border-r border-gray-700"},null,-1),vd=["disabled"],kd={key:0,class:"px-2"},wd={class:"ns-button info"};function xd(e,t,s,c,d,n){const r=w("ns-close-button");return i(),a("div",{class:m(["flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",n.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full"]),id:"ns-media"},[l("div",hr,[l("h3",fr,h(n.__("Medias Manager")),1),l("ul",mr,[(i(!0),a(p,null,D(d.pages,(o,f)=>(i(),a("li",{onClick:g=>n.select(o),class:m(["py-2 px-3 cursor-pointer border-l-8",o.selected?"active":""]),key:f},h(o.label),11,gr))),128))])]),n.currentPage.name==="upload"?(i(),a("div",br,[n.isPopup?(i(),a("div",_r,[pr,l("div",null,[T(r,{onClick:t[0]||(t[0]=o=>n.popupInstance.close())})])])):u("",!0),l("div",{id:"dropping-zone",onClick:t[1]||(t[1]=o=>n.triggerManualUpload(o)),class:m([d.isDragging?"border-dashed border-2":"","flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center"])},[l("h3",yr,h(n.__("Click Here Or Drop Your File To Upload")),1),l("input",vr,null,512),l("div",kr,[d.files.length>0?(i(),a("ul",wr,[(i(!0),a(p,null,D(d.files,(o,f)=>(i(),a("li",{class:m([o.failed===!1?"border-info-secondary":"border-error-secondary","p-2 mb-2 border-b-2 flex items-center justify-between"]),key:f},[l("span",null,h(o.file.name),1),o.failed===!1?(i(),a("span",xr,h(o.progress)+"%",1)):u("",!0),o.failed===!0?(i(),a("div",{key:1,onClick:g=>n.openError(o),class:"rounded bg-error-primary hover:bg-error-secondary hover:text-white flex items-center justify-center text-xs p-2 cursor-pointer"},[Cr,y(),l("span",Mr,h(n.__("See Error")),1)],8,Dr)):u("",!0)],2))),128))])):u("",!0),d.files.length===0?(i(),a("div",Tr,h(n.__("Your uploaded files will displays here.")),1)):u("",!0)])],2)])):u("",!0),n.currentPage.name==="gallery"?(i(),a("div",Sr,[n.isPopup?(i(),a("div",$r,[Er,l("div",null,[T(r,{onClick:t[2]||(t[2]=o=>n.popupInstance.close())})])])):u("",!0),l("div",Rr,[l("div",Fr,[l("div",Or,[l("div",Pr,[R(l("input",{id:"search",type:"text","onUpdate:modelValue":t[3]||(t[3]=o=>d.searchField=o),placeholder:n.__("Search Medias"),class:"px-4 block w-full sm:text-sm sm:leading-5 h-10"},null,8,Ar),[[A,d.searchField]]),d.searchField.length>0?(i(),a("div",jr,[l("button",{onClick:t[4]||(t[4]=o=>d.searchField=""),class:"h-full w-full rounded-tr rounded-br overflow-hidden"},h(n.__("Cancel")),1)])):u("",!0)])]),l("div",Hr,[l("div",Ur,[l("div",Lr,[(i(!0),a(p,null,D(d.response.data,(o,f)=>(i(),a("div",{key:f,class:""},[l("div",Yr,[l("div",{onClick:g=>n.selectResource(o),class:m([o.selected?"ns-media-image-selected ring-4":"","rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center"])},[n.isImage(o)?(i(),a("img",{key:0,class:"object-cover h-full",src:o.sizes.thumb,alt:o.name},null,8,Br)):u("",!0),n.isImage(o)?u("",!0):(i(),a("div",Ir,[l("i",{class:m([d.fileIcons[o.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))],10,Vr)])]))),128))])]),d.response.data.length===0?(i(),a("div",Nr,[l("h3",zr,h(n.__("Nothing has already been uploaded")),1)])):u("",!0)])]),l("div",qr,[n.panelOpened?(i(),a("div",Wr,[n.isImage(n.selectedResource)?(i(),a("img",{key:0,class:"object-cover h-full",src:n.selectedResource.sizes.thumb,alt:n.selectedResource.name},null,8,Gr)):u("",!0),n.isImage(n.selectedResource)?u("",!0):(i(),a("div",Kr,[l("i",{class:m([d.fileIcons[n.selectedResource.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))])):u("",!0),n.panelOpened?(i(),a("div",Qr,[l("p",Zr,[l("strong",Xr,h(n.__("File Name"))+": ",1),l("span",{class:m(["p-2",n.selectedResource.fileEdit?"border-b border-input-edge bg-input-background":""]),onBlur:t[5]||(t[5]=o=>n.submitChange(o,n.selectedResource)),contenteditable:n.selectedResource.fileEdit?"true":"false",onClick:t[6]||(t[6]=o=>n.selectedResource.fileEdit=!0)},h(n.selectedResource.name),43,Jr)]),l("p",ed,[l("strong",td,h(n.__("Uploaded At"))+":",1),l("span",null,h(n.selectedResource.created_at),1)]),l("p",sd,[l("strong",nd,h(n.__("By"))+" :",1),l("span",null,h(n.selectedResource.user.username),1)])])):u("",!0)])]),l("div",ld,[l("div",id,[d.bulkSelect?(i(),a("div",ad,[l("div",rd,[l("button",{onClick:t[7]||(t[7]=o=>n.cancelBulkSelect()),class:"py-2 px-3"},[dd,y(" "+h(n.__("Cancel")),1)])])])):u("",!0),n.hasOneSelected&&!d.bulkSelect?(i(),a("div",od,[l("div",ud,[l("button",{onClick:t[8]||(t[8]=o=>d.bulkSelect=!0),class:"py-2 px-3"},[cd,y(" "+h(n.__("Bulk Select")),1)])])])):u("",!0),n.hasOneSelected?(i(),a("div",hd,[l("div",fd,[l("button",{onClick:t[9]||(t[9]=o=>n.deleteSelected()),class:"py-2 px-3"},[md,y(" "+h(n.__("Delete")),1)])])])):u("",!0)]),l("div",gd,[l("div",bd,[l("div",_d,[l("div",{class:m(["ns-button",d.response.current_page===1?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===1,onClick:t[10]||(t[10]=o=>n.loadGallery(d.response.current_page-1)),class:"p-2"},h(n.__("Previous")),9,pd)],2),yd,l("div",{class:m(["ns-button",d.response.current_page===d.response.last_page?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===d.response.last_page,onClick:t[11]||(t[11]=o=>n.loadGallery(d.response.current_page+1)),class:"p-2"},h(n.__("Next")),9,vd)],2)])]),n.isPopup&&n.hasOneSelected?(i(),a("div",kd,[l("div",wd,[l("button",{class:"rounded shadow p-2 text-sm",onClick:t[12]||(t[12]=o=>n.useSelectedEntries())},h(n.__("Use Selected")),1)])])):u("",!0)])])])):u("",!0)],2)}const pe=C(cr,[["render",xd]]),kc=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"})),Dd={computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},data(){return{fileIcons:_e}},props:["placeholder","leading","type","field"],mounted(){},methods:{isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)},toggleMedia(){new Promise((t,s)=>{L.show(pe,{resolve:t,reject:s,...this.field.data||{}})}).then(t=>{t.event==="use-selected"&&(!this.field.data||this.field.data.type==="url"?this.field.value=t.value[0].sizes.original:!this.field.data||this.field.data.type==="model"?(this.field.value=t.value[0].id,this.field.data.model=t.value[0]):this.field.value=t.value[0].sizes.original,this.$forceUpdate())})}}},Cd={class:"flex flex-col mb-2 flex-auto ns-media"},Md=["for"],Td={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Sd={class:"text-primary sm:text-sm sm:leading-5"},$d={class:"rounded overflow-hidden flex"},Ed={key:0,class:"form-input flex w-full sm:text-sm items-center sm:leading-5 h-10"},Rd=["src","alt"],Fd={key:1,class:"object-cover flex items-center justify-center"},Od={class:"text-xs text-secondary"},Pd=["disabled","id","type","placeholder"],Ad=l("i",{class:"las la-photo-video"},null,-1),jd=[Ad];function Hd(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Cd,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Md),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Td,[l("span",Sd,h(s.leading),1)])):u("",!0),l("div",$d,[s.field.data&&s.field.data.type==="model"?(i(),a("div",Ed,[s.field.value&&s.field.data.model.name?(i(),a(p,{key:0},[n.isImage(s.field.data.model)?(i(),a("img",{key:0,class:"w-8 h-8 m-1",src:s.field.data.model.sizes.thumb,alt:s.field.data.model.name},null,8,Rd)):u("",!0),n.isImage(s.field.data.model)?u("",!0):(i(),a("div",Fd,[l("i",{class:m([d.fileIcons[s.field.data.model.extension]||d.fileIcons.unknown,"las text-3xl"])},null,2)])),l("span",Od,h(s.field.data.model.name),1)],64)):u("",!0)])):u("",!0),!s.field.data||s.field.data.type==="undefined"||s.field.data.type==="url"?R((i(),a("input",{key:1,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),disabled:s.field.disabled,onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Pd)),[[oe,s.field.value]]):u("",!0),l("button",{onClick:t[3]||(t[3]=o=>n.toggleMedia(s.field)),class:"w-10 h-10 flex items-center justify-center border-l-2 outline-none"},jd)])],2),T(r,{field:s.field},null,8,["field"])])}const Ud=C(Dd,[["render",Hd]]),Ld={data:()=>({defaultToggledState:!1,_save:0,hasChildren:!1}),props:["href","to","label","icon","notification","toggled","identifier"],mounted(){this.hasChildren=this.$el.querySelectorAll(".submenu").length>0,this.defaultToggledState=this.toggled!==void 0?this.toggled:this.defaultToggledState,W.subject().subscribe(e=>{e.value!==this.identifier&&(this.defaultToggledState=!1)})},methods:{toggleEmit(){this.toggle().then(e=>{e&&W.emit({identifier:"side-menu.open",value:this.identifier})})},goTo(e,t){return this.$router.push(e),t.preventDefault(),!1},toggle(){return new Promise((e,t)=>{(!this.href||this.href.length===0)&&(this.defaultToggledState=!this.defaultToggledState,e(this.defaultToggledState))})}}},Yd=["href"],Vd={class:"flex items-center"},Bd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"},Id=["href"],Nd={class:"flex items-center"},zd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"};function qd(e,t,s,c,d,n){var r,o;return i(),a("div",null,[s.to&&!e.hasChildren?(i(),a("a",{key:0,onClick:t[0]||(t[0]=f=>n.goTo(s.to,f)),href:s.to,class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Vd,[l("i",{class:m(["las text-lg mr-2",((r=s.icon)==null?void 0:r.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",Bd,h(s.notification),1)):u("",!0)],10,Yd)):(i(),a("a",{key:1,onClick:t[1]||(t[1]=f=>n.toggleEmit()),href:s.href||"javascript:void(0)",class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Nd,[l("i",{class:m(["las text-lg mr-2",((o=s.icon)==null?void 0:o.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",zd,h(s.notification),1)):u("",!0)],10,Id)),l("ul",{class:m([e.defaultToggledState?"":"hidden","submenu-wrapper"])},[v(e.$slots,"default")],2)])}const Wd=C(Ld,[["render",qd]]),Gd={data(){return{showPanel:!1,search:"",eventListener:null}},emits:["change","blur"],props:["field"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},_filtredOptions(){let e=this._options;return this.search.length>0&&(e=this._options.filter(t=>t.label.toLowerCase().search(this.search.toLowerCase())!==-1)),e.filter(t=>t.selected===!1)},_options(){return this.field.options.map(e=>(e.selected=e.selected===void 0?!1:e.selected,this.field.value&&this.field.value.includes(e.value)&&(e.selected=!0),e))}},methods:{__:_,togglePanel(){this.field.disabled||(this.showPanel=!this.showPanel)},selectAvailableOptionIfPossible(){this._filtredOptions.length>0&&this.addOption(this._filtredOptions[0])},addOption(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100))},removeOption(e,t){if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100),!1}},mounted(){this.field.value&&this.field.value.reverse().forEach(t=>{const s=this.field.options.filter(c=>c.value===t);s.length>0&&this.addOption(s[0])}),this.eventListener=document.addEventListener("click",e=>{let s=e.target.parentElement,c=!1;if(this.showPanel){for(;s;){if(s&&s.classList.contains("ns-multiselect")&&!s.classList.contains("arrows")){c=!0;break}s=s.parentElement}c===!1&&this.togglePanel()}})}},Kd={class:"flex flex-col ns-multiselect"},Qd=["for"],Zd={class:"flex flex-col"},Xd={class:"flex -mx-1 -my-1 flex-wrap"},Jd={class:"rounded bg-info-secondary text-white flex justify-between p-1 items-center"},eo={class:"pr-8"},to=["onClick"],so=l("i",{class:"las la-times"},null,-1),no=[so],lo={class:"arrows ml-1"},io={class:"ns-dropdown shadow"},ao={class:"search border-b border-input-option-hover"},ro={class:"h-40 overflow-y-auto"},oo=["onClick"],uo={key:0,class:"las la-check"},co={key:0,class:"p-2 text-center text-primary"},ho={class:"my-2"};function fo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Kd,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-secondary":"text-primary","block mb-1 leading-5 font-medium"])},[v(e.$slots,"default")],10,Qd),l("div",Zd,[l("div",{onClick:t[0]||(t[0]=o=>n.togglePanel()),class:m([s.field.disabled?"bg-input-disabled":"","overflow-y-auto flex select-preview justify-between rounded border-2 border-input-option-hover p-2 items-start"]),style:{"max-height":"150px"}},[l("div",Xd,[(i(!0),a(p,null,D(n._options.filter(o=>o.selected),(o,f)=>(i(),a("div",{key:f,class:"px-1 my-1"},[l("div",Jd,[l("span",eo,h(o.label),1),l("button",{onClick:g=>n.removeOption(o,g),class:"rounded outline-none hover:bg-info-tertiary h-6 w-6 flex items-center justify-center"},no,8,to)])]))),128))]),l("div",lo,[l("i",{class:m(["las la-angle-down",d.showPanel?"hidden":""])},null,2),l("i",{class:m(["las la-angle-up",d.showPanel?"":"hidden"])},null,2)])],2),d.showPanel?(i(),a("div",{key:0,class:m(["h-0 z-10",d.showPanel?"shadow":""])},[l("div",io,[l("div",ao,[R(l("input",{onKeypress:t[1]||(t[1]=Y(o=>n.selectAvailableOptionIfPossible(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=o=>d.search=o),class:"p-2 w-full bg-transparent text-primary outline-none",placeholder:"Search"},null,544),[[A,d.search]])]),l("div",ro,[(i(!0),a(p,null,D(n._filtredOptions,(o,f)=>(i(),a("div",{onClick:g=>n.addOption(o),key:f,class:m([o.selected?"bg-info-secondary text-white":"text-primary","option p-2 flex justify-between cursor-pointer hover:bg-info-tertiary hover:text-white"])},[l("span",null,h(o.label),1),l("span",null,[o.checked?(i(),a("i",uo)):u("",!0)])],10,oo))),128))]),n._options.length===0?(i(),a("div",co,h(n.__("Nothing to display")),1)):u("",!0)])],2)):u("",!0)]),l("div",ho,[T(r,{field:s.field},null,8,["field"])])])}const mo=C(Gd,[["render",fo]]),go={},bo={class:"my-4"},_o={class:"font-bold text-2xl"},po={class:"text-primary"};function yo(e,t){return i(),a("div",bo,[l("h2",_o,[v(e.$slots,"title")]),l("span",po,[v(e.$slots,"description")])])}const vo=C(go,[["render",yo]]),ko={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:_,selectOption(e){this.$emit("select",e),this.searchText="",this.results=[]},renderLabel(e,t){return typeof t=="object"?t.map(s=>e[s]).join(" "):e[t]}},watch:{searchText(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText.length>0&&U[this.method||"post"](this.url,{[this.searchArgument||"search"]:this.searchText}).subscribe({next:e=>{this.results=e},error:e=>{$.error(e.message||_("An unexpected error occurred.")).subscribe()}})},1e3)}},mounted(){}},wo={class:"ns-search"},xo={class:"input-group info border-2"},Do=["placeholder"],Co={class:"relative"},Mo={class:"w-full absolute shadow-lg"},To={key:0,class:"ns-vertical-menu"},So=["onClick"];function $o(e,t,s,c,d,n){return i(),a("div",wo,[l("div",xo,[R(l("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=r=>d.searchText=r),class:"p-2 w-full outline-none",placeholder:s.placeholder||n.__("Search..."),id:""},null,8,Do),[[A,d.searchText]])]),l("div",Co,[l("div",Mo,[d.results.length>0&&d.searchText.length>0?(i(),a("ul",To,[(i(!0),a(p,null,D(d.results,(r,o)=>(i(),a("li",{class:"border-b p-2 cursor-pointer",onClick:f=>n.selectOption(r),key:o},h(n.renderLabel(r,s.label)),9,So))),128))])):u("",!0)])])])}const Eo=C(ko,[["render",$o]]),Ro={data:()=>({searchField:"",showResults:!1}),name:"ns-search-select",emits:["saved","change"],props:["name","placeholder","field","leading"],computed:{selectedOptionLabel(){if(this.field.value===null||this.field.value===void 0)return _("Choose...");const e=this.field.options.filter(t=>t.value===this.field.value);return e.length>0?e[0].label:_("Choose...")},filtredOptions(){return this.searchField.length>0?this.field.options.filter(e=>new RegExp(this.searchField,"i").test(e.label)).splice(0,10):this.field.options},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},watch:{showResults(){this.showResults===!0&&setTimeout(()=>{this.$refs.searchInputField.select()},50)}},mounted(){const e=this.field.options.filter(t=>t.value===this.field.value);e.length>0&&[null,void 0].includes(this.field.value)&&this.selectOption(e[0]),document.addEventListener("click",t=>{this.$el.contains(t.target)===!1&&(this.showResults=!1)})},methods:{__:_,selectFirstOption(){this.filtredOptions.length>0&&this.selectOption(this.filtredOptions[0])},selectOption(e){this.field.value=e.value,this.$emit("change",e.value),this.searchField="",this.showResults=!1},async triggerDynamicComponent(e){try{this.showResults=!1;const t=nsExtraComponents[e.component]||nsComponents[e.component];t===void 0&&$.error(_(`The component ${e.component} cannot be loaded. Make sure it's injected on nsExtraComponents object.`)).subscribe();const s=await new Promise((c,d)=>{const n=L.show(t,{...e.props||{},field:this.field,resolve:c,reject:d})});this.$emit("saved",s)}catch{}}}},Fo={class:"flex flex-col flex-auto ns-select"},Oo=["for"],Po={class:"text-primary text-sm"},Ao=l("i",{class:"las la-plus"},null,-1),jo=[Ao],Ho={key:0,class:"relative"},Uo={class:"w-full overflow-hidden -top-[8px] border-r-2 border-l-2 border-t rounded-b-md border-b-2 border-input-edge bg-input-background shadow z-10 absolute"},Lo={class:"border-b border-input-edge border-dashed p-2"},Yo=["placeholder"],Vo={class:"h-60 overflow-y-auto"},Bo=["onClick"];function Io(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Fo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Oo),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.disabled?"cursor-not-allowed":"cursor-default"),"border-2 mt-1 relative rounded-md shadow-sm mb-1 flex overflow-hidden"])},[l("div",{onClick:t[0]||(t[0]=o=>!s.field.disabled&&(e.showResults=!e.showResults)),class:m([s.field.disabled?"bg-input-disabled":"bg-input-background","flex-auto h-10 sm:leading-5 py-2 px-4 flex items-center"])},[l("span",Po,h(n.selectedOptionLabel),1)],2),s.field.component&&!s.field.disabled?(i(),a("div",{key:0,onClick:t[1]||(t[1]=o=>n.triggerDynamicComponent(s.field)),class:"flex items-center justify-center w-10 hover:cursor-pointer hover:bg-input-button-hover border-l-2 border-input-edge"},jo)):u("",!0)],2),e.showResults?(i(),a("div",Ho,[l("div",Uo,[l("div",Lo,[R(l("input",{onKeypress:t[2]||(t[2]=Y(o=>n.selectFirstOption(),["enter"])),ref:"searchInputField","onUpdate:modelValue":t[3]||(t[3]=o=>e.searchField=o),type:"text",placeholder:n.__("Search result")},null,40,Yo),[[A,e.searchField]])]),l("div",Vo,[l("ul",null,[(i(!0),a(p,null,D(n.filtredOptions,o=>(i(),a("li",{onClick:f=>n.selectOption(o),class:"py-1 px-2 hover:bg-info-primary cursor-pointer text-primary"},h(o.label),9,Bo))),256))])])])])):u("",!0),T(r,{field:s.field},null,8,["field"])])}const No=C(Ro,[["render",Io]]),zo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},mounted(){},methods:{__:_}},qo={class:"flex flex-col flex-auto ns-select"},Wo=["for"],Go=["disabled","name"],Ko={value:null},Qo=["value"];function Zo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wo),l("div",{class:m([n.hasError?"has-error":"is-pristine","border-2 mt-1 relative rounded-md shadow-sm mb-1 overflow-hidden"])},[R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,name:s.field.name,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),class:m([n.inputClass,"form-input block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 appearance-none"])},[l("option",Ko,h(n.__("Choose an option")),1),(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,Qo))),128))],10,Go),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xo=C(zo,[["render",Zo]]),Jo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},methods:{__:_,playSelectedSound(){this.field.value!==null&&this.field.value.length>0&&new Audio(this.field.value).play()}}},eu={class:"flex flex-col flex-auto"},tu=["for"],su=l("button",{class:"w-10 flex item-center justify-center"},[l("i",{class:"las la-play text-2xl"})],-1),nu=[su],lu=["disabled","name"],iu=["value"];function au(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",eu,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,tu),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","border-2 mt-1 flex relative overflow-hidden rounded-md shadow-sm mb-1 form-input"])},[l("div",{onClick:t[0]||(t[0]=o=>n.playSelectedSound()),class:"border-r-2 border-input-edge flex-auto flex items-center justify-center hover:bg-info-tertiary hover:text-white"},nu),R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,onChange:t[1]||(t[1]=o=>e.$emit("change",o)),name:s.field.name,"onUpdate:modelValue":t[2]||(t[2]=o=>s.field.value=o),class:m([n.inputClass,"text-primary block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 outline-none"])},[(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,iu))),128))],42,lu),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ru=C(Jo,[["render",au]]),du={data:()=>({}),mounted(){},computed:{validatedSize(){return this.size||24},validatedBorder(){return this.border||8},validatedAnimation(){return this.animation||"fast"}},props:["color","size","border","animation"]},ou={class:"flex items-center justify-center"};function uu(e,t,s,c,d,n){return i(),a("div",ou,[l("div",{class:m(["loader ease-linear rounded-full border-gray-200",n.validatedAnimation+" border-4 border-t-4 w-"+n.validatedSize+" h-"+n.validatedSize])},null,2)])}const cu=C(du,[["render",uu]]),hu={data:()=>({}),props:["href","label","active","to"],mounted(){},methods:{goTo(e,t){return this.$router.push(e),t.preventDefault(),!1}}},fu={class:"submenu"},mu=["href"],gu=["href"];function bu(e,t,s,c,d,n){return i(),a("div",null,[l("li",fu,[s.href?(i(),a("a",{key:0,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),href:s.href},[v(e.$slots,"default")],10,mu)):s.to?(i(),a("a",{key:1,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),onClick:t[0]||(t[0]=r=>n.goTo(s.to,r)),href:s.to},[v(e.$slots,"default")],10,gu)):u("",!0)])])}const _u=C(hu,[["render",bu]]),pu={props:["options","row","columns","prependOptions","showOptions","showCheckboxes"],data:()=>({optionsToggled:!1}),mounted(){},methods:{__:_,sanitizeHTML(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),c=s.length;c--;)s[c].parentNode.removeChild(s[c]);return t.innerHTML},getElementOffset(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu(e){if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout(()=>{const t=this.$el.querySelectorAll(".relative > .absolute")[0],s=this.$el.querySelectorAll(".relative")[0],c=this.getElementOffset(s);t.style.top=c.top+"px",t.style.left=c.left+"px",s!==void 0&&(s.classList.remove("relative"),s.classList.add("dropdown-holder"))},100);else{const t=this.$el.querySelectorAll(".dropdown-holder")[0];t.classList.remove("dropdown-holder"),t.classList.add("relative")}},handleChanged(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync(e){e.confirm!==null?Popup.show(V,{title:e.confirm.title||_("Confirm Your Action"),message:e.confirm.message||_("Would you like to delete this entry?"),onAction:t=>{t&&U[e.type.toLowerCase()](e.url).subscribe(s=>{$.success(s.message).subscribe(),this.$emit("reload",this.row)},s=>{this.toggleMenu(),$.error(s.message).subscribe()})}}):(W.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup(e,t){const s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((c,d)=>{Popup.show(s,{resolve:c,reject:d,row:t,action:e})}):$.error(_(`Unable to load the component "${e.component}". Make sure the component is registered to "nsExtraComponents".`)).subscribe();this.triggerAsync(e)}}},yu={key:0,class:"font-sans p-2"},vu={key:1,class:"font-sans p-2"},ku={class:""},wu=l("i",{class:"las la-ellipsis-h"},null,-1),xu={class:"relative"},Du={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Cu={class:"rounded-md shadow-xs"},Mu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Tu=["href","innerHTML"],Su=["href","innerHTML"],$u=["onClick","innerHTML"],Eu=["href","innerHTML"],Ru=["innerHTML"],Fu={class:"flex md:-mx-1 md:flex-wrap flex-col md:flex-row text-xs"},Ou={class:"md:px-1 w-full md:w-1/2 lg:w-2/4"},Pu=["innerHTML"],Au={key:2},ju={key:2,class:"font-sans p-2 flex flex-col items-center justify-center"},Hu={class:""},Uu=l("i",{class:"las la-ellipsis-h"},null,-1),Lu={class:"relative"},Yu={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right -ml-28 w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Vu={class:"rounded-md shadow-xs"},Bu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Iu=["href","innerHTML"],Nu=["onClick","innerHTML"];function zu(e,t,s,c,d,n){const r=w("ns-checkbox");return i(),a("tr",{class:m(["ns-table-row border text-sm",s.row.$cssClass?s.row.$cssClass:""])},[s.showCheckboxes?(i(),a("td",yu,[T(r,{onChange:t[0]||(t[0]=o=>n.handleChanged(o)),checked:s.row.$checked},null,8,["checked"])])):u("",!0),s.prependOptions&&s.showOptions?(i(),a("td",vu,[l("div",ku,[l("button",{onClick:t[1]||(t[1]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[wu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[2]||(t[2]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",xu,[s.row.$toggled?(i(),a("div",Du,[l("div",Cu,[l("div",Mu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[o.type==="GOTO"?(i(),a("a",{key:0,href:o.url,class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Tu)):u("",!0),o.type==="TAB"?(i(),a("a",{key:1,href:o.url,target:"_blank",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Su)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:2,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,$u)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0),(i(!0),a(p,null,D(s.columns,(o,f)=>(i(),a("td",{key:f,class:"font-sans p-2"},[s.row[f]&&s.row[f].type&&s.row[f].type==="link"?(i(),a("a",{key:0,target:"_blank",href:s.row[f].href,innerHTML:n.sanitizeHTML(s.row[f].label)},null,8,Eu)):u("",!0),typeof s.row[f]=="string"||typeof s.row[f]=="number"?(i(),a(p,{key:1},[o.attributes&&o.attributes.length>0?(i(),a(p,{key:0},[l("h3",{class:"fond-bold text-lg",innerHTML:n.sanitizeHTML(s.row[f])},null,8,Ru),l("div",Fu,[(i(!0),a(p,null,D(o.attributes,g=>(i(),a("div",Ou,[l("strong",null,h(g.label),1),y(": "+h(s.row[g.column]),1)]))),256))])],64)):(i(),a("div",{key:1,innerHTML:n.sanitizeHTML(s.row[f])},null,8,Pu))],64)):u("",!0),s.row[f]===null?(i(),a("div",Au,h(n.__("Undefined")),1)):u("",!0)]))),128)),!s.prependOptions&&s.showOptions?(i(),a("td",ju,[l("div",Hu,[l("button",{onClick:t[3]||(t[3]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[Uu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[4]||(t[4]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",Lu,[s.row.$toggled?(i(),a("div",Yu,[l("div",Vu,[l("div",Bu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[o.type==="GOTO"?(i(),a("a",{key:0,href:o.url,class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Iu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Nu)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0)],2)}const qu=C(pu,[["render",zu]]),Wu={data(){return{childrens:[],tabState:new $e}},props:["active"],computed:{activeComponent(){const e=this.childrens.filter(t=>t.active);return e.length>0?e[0]:!1}},beforeUnmount(){this.tabState.unsubscribe()},watch:{active(e,t){this.childrens.forEach(s=>{s.active=s.identifier===e,s.active&&this.toggle(s)})}},mounted(){this.buildChildrens(this.active)},methods:{__:_,toggle(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier),this.tabState.next(e)},buildChildrens(e){this.childrens=Array.from(this.$el.querySelectorAll(".ns-tab-item")).map(s=>{const c=s.getAttribute("identifier")||void 0;let d=!0;return s.getAttribute("visible")&&(d=s.getAttribute("visible")==="true"),{el:s,active:!!(e&&e===c),identifier:c,initialized:!1,visible:d,label:s.getAttribute("label")||_("Unamed Tab")}}).filter(s=>s.visible),!(this.childrens.filter(s=>s.active).length>0)&&this.childrens.length>0&&(this.childrens[0].active=!0),this.childrens.forEach(s=>{s.active&&this.toggle(s)})}}},Gu=["selected-tab"],Ku={class:"header ml-4 flex justify-between",style:{"margin-bottom":"-1px"}},Qu={class:"flex flex-auto"},Zu=["onClick"];function Xu(e,t,s,c,d,n){return i(),a("div",{class:"tabs flex flex-col flex-auto ns-tab overflow-hidden","selected-tab":n.activeComponent.identifier},[l("div",Ku,[l("div",Qu,[(i(!0),a(p,null,D(d.childrens,(r,o)=>(i(),a("div",{key:r.identifier,onClick:f=>n.toggle(r),class:m([s.active===r.identifier?"border-b-0 active z-10":"border inactive","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(r.label),11,Zu))),128))]),l("div",null,[v(e.$slots,"extra")])]),v(e.$slots,"default")],8,Gu)}const Ju=C(Wu,[["render",Xu]]),ec={data(){return{selectedTab:{},tabStateSubscriber:null}},computed:{},mounted(){this.tabStateSubscriber=this.$parent.tabState.subscribe(e=>{this.selectedTab=e})},unmounted(){this.tabStateSubscriber.unsubscribe()},props:["label","identifier","padding"]},tc=["label","identifier"];function sc(e,t,s,c,d,n){return i(),a("div",{class:m([d.selectedTab.identifier!==s.identifier?"hidden":"","ns-tab-item flex flex-auto overflow-hidden"]),label:s.label,identifier:s.identifier},[d.selectedTab.identifier===s.identifier?(i(),a("div",{key:0,class:m(["border rounded flex-auto overflow-y-auto",s.padding||"p-4"])},[v(e.$slots,"default")],2)):u("",!0)],10,tc)}const nc=C(ec,[["render",sc]]),lc={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"]},ic={class:"flex flex-col mb-2 flex-auto ns-textarea"},ac=["for"],rc={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},dc={class:"text-secondary sm:text-sm sm:leading-5"},oc=["rows","disabled","id","type","placeholder"],uc={key:0,class:"text-xs text-secondary"};function cc(e,t,s,c,d,n){return i(),a("div",ic,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},h(s.field.label),11,ac),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 overflow-hidden rounded-md focus:shadow-sm mb-1"])},[s.leading?(i(),a("div",rc,[l("span",dc,h(s.leading),1)])):u("",!0),R(l("textarea",{rows:s.field.data&&s.field.data.rows||10,disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=r=>s.field.value=r),onBlur:t[1]||(t[1]=r=>e.$emit("blur",this)),onChange:t[2]||(t[2]=r=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5"]),placeholder:s.placeholder},null,42,oc),[[A,s.field.value]])],2),!s.field.errors||s.field.errors.length===0?(i(),a("p",uc,[v(e.$slots,"description")])):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs text-error-primary"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y("This field is required.")]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y("This field must contain a valid email address.")]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0)]))),128))])}const hc=C(lc,[["render",cc]]),wc=Object.freeze(Object.defineProperty({__proto__:null,nsAlertPopup:se,nsAvatar:qe,nsButton:Ze,nsCalendar:ce,nsCheckbox:ds,nsCkeditor:Fe,nsCloseButton:fs,nsConfirmPopup:V,nsCrud:vn,nsCrudForm:Nn,nsDate:Xn,nsDateRangePicker:ge,nsDateTimePicker:be,nsDatepicker:$i,nsDaterangePicker:Wi,nsDragzone:aa,nsField:Ca,nsFieldDescription:$a,nsIconButton:Fa,nsInlineMultiselect:Za,nsInput:ir,nsLink:ur,nsMediaInput:Ud,nsMenu:Wd,nsMultiselect:mo,nsNotice:Oe,nsNumpad:Pe,nsNumpadPlus:Ae,nsPOSLoadingPopup:je,nsPageTitle:vo,nsPaginate:He,nsPromptPopup:Ue,nsSearch:Eo,nsSearchSelect:No,nsSelect:Xo,nsSelectAudio:ru,nsSpinner:cu,nsSubmenu:_u,nsSwitch:ue,nsTableRow:qu,nsTabs:Ju,nsTabsItem:nc,nsTextarea:hc},Symbol.toStringTag,{value:"Module"}));export{_u as a,wc as b,$i as c,Wi as d,be as e,pe as f,Ca as g,fs as h,kc as i,Wd as n}; +import se from"./ns-alert-popup-5493aad8.js";import{_}from"./currency-f8bd78d1.js";import{n as ve}from"./ns-avatar-image-35303576.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{o as i,c as a,a as l,t as h,f as T,r as w,A as v,e as u,n as m,F as p,b as D,B as R,i as y,w as M,g as E,d as ke,j as G,C as we,D as ne,E as le,G as xe,H as J,I as ee,h as q,J as De,K as Ce,s as te,L as Me}from"./runtime-core.esm-bundler-b48de70a.js";import{h as x,b as $,v as A,F as ie,g as ae,p as re,P as L,w as Y,i as H,a as U,n as de,j as Te,k as Se,l as oe,e as W,S as $e}from"./bootstrap-8be442b1.js";import{n as V,g as Ee,e as z,b as Re,f as ue,h as Fe,i as Oe,a as Pe,j as Ae,c as je,k as He,d as Ue}from"./ns-prompt-popup-100414c5.js";import"./index.es-25aa42ee.js";const Le={methods:{__:_},components:{nsAvatarImage:ve},name:"ns-avatar",data(){return{svg:""}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},props:["url","display-name"]},Ye={class:"flex justify-between items-center flex-shrink-0"},Ve={class:"hidden md:inline-block px-2"},Be={class:"md:hidden px-2"},Ie={class:"px-2"},Ne={class:"overflow-hidden rounded-full bg-gray-600"};function ze(e,t,s,c,d,n){const r=w("ns-avatar-image");return i(),a("div",Ye,[l("span",Ve,h(n.__("Howdy, {name}").replace("{name}",this.displayName)),1),l("span",Be,h(e.displayName),1),l("div",Ie,[l("div",Ne,[T(r,{url:n.avatarUrl,name:e.displayName},null,8,["url","name"])])])])}const qe=C(Le,[["render",ze]]),We={data:()=>({clicked:!1,_save:0}),props:["type","disabled","link","href","routerLink","to","target"],mounted(){},computed:{isDisabled(){return this.disabled&&(this.disabled.length===0||this.disabled==="disabled"||this.disabled)}}},Ge=["disabled"],Ke=["target","href"];function Qe(e,t,s,c,d,n){return i(),a("div",{class:m(["flex ns-button",s.type?s.type:"default"])},[!s.link&&!s.href?(i(),a("button",{key:0,disabled:n.isDisabled,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ge)):u("",!0),s.href?(i(),a("a",{key:1,target:s.target,href:s.href,class:"flex rounded items-center py-2 px-3 font-semibold"},[v(e.$slots,"default")],8,Ke)):u("",!0)],2)}const Ze=C(We,[["render",Qe]]),Xe={name:"ns-calendar",props:["date","field","visible","range","selected-range","side"],data(){return{calendar:[[]],currentDay:x(),daysOfWeek:new Array(7).fill("").map((e,t)=>t),hours:0,minutes:0,currentView:"days",clickedOnCalendar:!1,moment:x,months:new Array(12).fill("").map((e,t)=>t)}},computed:{momentCopy(){return x()}},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},mounted(){document.addEventListener("click",this.checkClickedItem),this.currentDay=[void 0,null,""].includes(this.date)?x():x(this.date),this.hours=this.currentDay.hours(),this.minutes=this.currentDay.minutes(),this.build(),this.toggleView("days")},methods:{__:_,handleCalendarClick(){this.clickedOnCalendar=!0},getDayClass({day:e,_dayIndex:t,dayOfWeek:s,_index:c,currentDay:d}){const n=[];return(x(this.date).isSame(e.date,"day")||this.isRangeEdge(e))&&!this.isInvalidRange()?n.push("bg-info-secondary text-primary border-info-secondary text-white"):n.push("hover:bg-numpad-hover"),this.isInvalidRange()&&this.isRangeEdge(e)&&n.push("bg-error-secondary text-white"),c===0&&n.push("border-t border-tab-table-th"),this.isInRange(e)&&!this.isRangeEdge(e)?n.push("bg-info-primary"):e.isDifferentMonth&&!this.isRangeEdge(e)&&n.push("bg-tab-table-th"),n.join(" ")},erase(){this.selectDate({date:x(ns.date.current)})},isInRange(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSameOrAfter(this.range[0])&&x(e.date).isSameOrBefore(this.range[1]):!1},isInvalidRange(){return this.selectedRange&&this.selectedRange.endDate?x(this.selectedRange.startDate).isAfter(x(this.selectedRange.endDate))||x(this.selectedRange.endDate).isBefore(x(this.selectedRange.startDate)):!1},isRangeEdge(e){return this.range&&this.range.length===2&&this.range[0]&&this.range[1]?x(e.date).isSame(this.range[0],"day")||x(e.date).isSame(this.range[1],"day"):!1},setYear(e){parseInt(e.srcElement.value)>0&&parseInt(e.srcElement.value)<9999&&(this.currentDay.year(e.srcElement.value),this.selectDate({date:this.currentDay.clone()}))},subYear(){parseFloat(this.currentDay.format("YYYY"))>0&&(this.currentDay.subtract(1,"year"),this.selectDate({date:this.currentDay.clone()}))},addYear(){this.currentDay.add(1,"year"),this.selectDate({date:this.currentDay.clone()})},toggleView(e){this.currentView=e,this.currentView==="years"&&setTimeout(()=>{this.$refs.year.select()},100),this.currentView==="days"&&setTimeout(()=>{this.$refs.hours.addEventListener("focus",function(t){this.select()}),this.$refs.minutes.addEventListener("focus",function(t){this.select()})},100)},setMonth(e){this.currentDay.month(e),this.selectDate({date:this.currentDay.clone()})},detectHoursChange(){parseFloat(this.hours)<0&&(this.hours=0),parseFloat(this.hours)>23&&(this.hours=23),this.selectDate({date:this.currentDay.clone()})},detectMinuteChange(){parseFloat(this.minutes)<0&&(this.minutes=0),parseFloat(this.minutes)>59&&(this.minutes=59),this.selectDate({date:this.currentDay.clone()})},checkClickedItem(e){this.$parent.$el.getAttribute("class").split(" ").includes("picker")&&(!this.$parent.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.visible&&this.$emit("onClickOut",!0),setTimeout(()=>{this.clickedOnCalendar=!1},100))},selectDate(e){if([void 0].includes(e))this.$emit("set",null);else{if(this.side==="left"&&x(this.selectedRange.endDate).isValid()&&e.date.isAfter(this.selectedRange.endDate))return $.error(_("The left range will be invalid.")).subscribe(),!1;if(this.side==="right"&&x(this.selectedRange.startDate).isValid()&&e.date.isBefore(this.selectedRange.startDate))return $.error(_("The right range will be invalid.")).subscribe(),!1;this.currentDay=e.date,this.currentDay.hours(this.hours),this.currentDay.minutes(this.minutes),this.$emit("set",this.currentDay.format("YYYY-MM-DD HH:mm:ss"))}this.build()},subMonth(){this.currentDay.subtract(1,"month"),this.build()},addMonth(){this.currentDay.add(1,"month"),this.build()},resetCalendar(){this.calendar=[[]]},build(){this.resetCalendar(),this.currentDay.clone().startOf("month");const e=this.currentDay.clone().startOf("month"),t=this.currentDay.clone().endOf("month");for(;;){e.day()===0&&this.calendar[0].length>0&&this.calendar.push([]);let s=this.calendar.length-1;if(this.calendar[s].push({date:e.clone(),dayOfWeek:e.day(),isToday:e.isSame(x.now(),"day"),isDifferentMonth:!1,isNextMonth:!1,isPreviousMonth:!1}),e.isSame(t,"day"))break;e.add(1,"day")}if(this.calendar[0].length<7){const s=7-this.calendar[0].length,c=this.calendar[0][0].date.clone(),d=[];for(let n=0;nn.handleCalendarClick()),class:"flex bg-box-background flex-col rounded-lg overflow-hidden"},[d.currentView==="years"?(i(),a("div",Je,[l("div",et,[l("div",null,[l("button",{onClick:t[0]||(t[0]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},st)]),l("div",nt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[1]||(t[1]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[2]||(t[2]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[3]||(t[3]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border outline-none text-numpad-text rounded"},it)])]),l("div",at,[l("div",rt,[l("button",{onClick:t[4]||(t[4]=r=>n.subYear()),class:"px-2 py-2"},ot),l("div",ut,[l("input",{type:"text",ref:"year",class:"p-2 flex-auto w-full text-center outline-none",onChange:t[5]||(t[5]=r=>n.setYear(r)),value:d.currentDay.format("YYYY")},null,40,ct)]),l("button",{onClick:t[6]||(t[6]=r=>n.addYear()),class:"px-2 py-2"},ft)])]),l("div",mt,[l("button",{onClick:t[7]||(t[7]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error hover:text-white rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="months"?(i(),a("div",gt,[l("div",bt,[l("div",null,[l("button",{onClick:t[8]||(t[8]=r=>n.subYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},pt)]),l("div",yt,[l("span",vt,h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[9]||(t[9]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[10]||(t[10]=r=>n.addYear()),class:"w-8 h-8 ns-inset-button outline-none border rounded"},wt)])]),l("div",xt,[(i(!0),a(p,null,D(d.months,(r,o)=>(i(),a("div",{key:o,class:"h-8 flex justify-center items-center text-sm border-box-background"},[l("div",Dt,[l("div",{class:m([n.momentCopy.month(r).format("MM")===d.currentDay.format("MM")?"bg-info-secondary text-white":"hover:bg-numpad-hover","h-full w-full border-box-background flex items-center justify-center cursor-pointer"]),onClick:f=>n.setMonth(r)},h(n.momentCopy.format("MMM")),11,Ct)])]))),128))]),l("div",Mt,[l("button",{onClick:t[11]||(t[11]=r=>n.toggleView("days")),class:"p-2 w-full ns-inset-button border text-sm error rounded flex items-center justify-center"},h(n.__("Return To Calendar")),1)])])):u("",!0),d.currentView==="days"?(i(),a("div",Tt,[l("div",St,[l("div",null,[l("button",{onClick:t[12]||(t[12]=r=>n.subMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Et)]),l("div",Rt,[l("span",{class:"mr-2 cursor-pointer border-b border-info-secondary border-dashed",onClick:t[13]||(t[13]=r=>n.toggleView("months"))},h(d.currentDay.format("MMM")),1),l("span",{class:"cursor-pointer border-b border-info-secondary border-dashed",onClick:t[14]||(t[14]=r=>n.toggleView("years"))},h(d.currentDay.format("YYYY")),1)]),l("div",null,[l("button",{onClick:t[15]||(t[15]=r=>n.addMonth()),class:"w-8 h-8 ns-inset-button border rounded"},Ot)])]),l("div",Pt,[l("div",At,h(n.__("Sun")),1),l("div",jt,h(n.__("Mon")),1),l("div",Ht,h(n.__("Tue")),1),l("div",Ut,h(n.__("Wed")),1),l("div",Lt,h(n.__("Thr")),1),l("div",Yt,h(n.__("Fri")),1),l("div",Vt,h(n.__("Sat")),1)]),(i(!0),a(p,null,D(d.calendar,(r,o)=>(i(),a("div",{key:o,class:"grid grid-flow-row grid-cols-7 grid-rows-1 gap-0 text-primary divide-x divide-y"},[(i(!0),a(p,null,D(d.daysOfWeek,(f,g)=>(i(),a("div",{key:g,class:"md:h-10 h-8 flex justify-center items-center text-sm border-tab-table-th"},[(i(!0),a(p,null,D(r,(b,S)=>(i(),a(p,null,[b.dayOfWeek===f?(i(),a("div",{key:S,class:m([n.getDayClass({day:b,_dayIndex:S,dayOfWeek:f,_index:g,currentDay:d.currentDay}),"h-full w-full flex items-center justify-center cursor-pointer"]),onClick:F=>n.selectDate(b)},[b.isDifferentMonth?u("",!0):(i(),a("span",It,h(b.date.format("DD")),1)),b.isDifferentMonth?(i(),a("span",Nt,h(b.date.format("DD")),1)):u("",!0)],10,Bt)):u("",!0)],64))),256))]))),128))]))),128))])):u("",!0),l("div",zt,[l("div",qt,[l("div",Wt,[l("div",Gt,[l("div",Kt,[l("button",{onClick:t[16]||(t[16]=r=>n.erase()),class:"border ns-inset-button text-sm error rounded md:w-10 w-8 md:h-10 h-8 flex items-center justify-center"},Zt)])])]),l("div",Xt,[d.currentView==="days"?(i(),a("div",Jt,[es,R(l("input",{placeholder:"HH",ref:"hours",onChange:t[17]||(t[17]=r=>n.detectHoursChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[18]||(t[18]=r=>d.hours=r),type:"number"},null,544),[[A,d.hours]]),ts,R(l("input",{placeholder:"mm",ref:"minutes",onChange:t[19]||(t[19]=r=>n.detectMinuteChange(r)),class:"w-12 p-1 text-center border border-numpad-edge bg-input-background outline-none text-sm active:border-numpad-edge","onUpdate:modelValue":t[20]||(t[20]=r=>d.minutes=r),type:"number"},null,544),[[A,d.minutes]])])):u("",!0)])])])])}const ce=C(Xe,[["render",ss]]),ls={data:()=>({}),props:["checked","field","label"],computed:{isChecked(){return this.field?this.field.value:this.checked},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0}},methods:{toggleIt(){this.field!==void 0&&(this.field.value=!this.field.value),this.$emit("change",!this.checked)}}},is={class:"w-6 h-6 flex bg-input-background border-input-edge border-2 items-center justify-center cursor-pointer"},as={key:0,class:"las la-check"};function rs(e,t,s,c,d,n){return i(),a("div",{class:"flex ns-checkbox items-center justify-center cursor-pointer",onClick:t[0]||(t[0]=r=>n.toggleIt())},[l("div",is,[n.isChecked?(i(),a("i",as)):u("",!0)]),s.label?(i(),a("label",{key:0,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.label),3)):u("",!0),s.field?(i(),a("label",{key:1,class:m([n.hasError?"has-error":"is-pristine","mx-2"])},h(s.field.label),3)):u("",!0)])}const ds=C(ls,[["render",rs]]),os={name:"ns-close-button",methods:{}},us={class:"outline-none ns-close-button hover:border-transparent border rounded-full h-8 min-w-[2rem] items-center justify-center"},cs=l("i",{class:"las la-times"},null,-1);function hs(e,t,s,c,d,n){return i(),a("button",us,[cs,y(),v(e.$slots,"default")])}const fs=C(os,[["render",hs]]),ms={data(){return{fields:[],validation:new ie}},props:["popup"],methods:{__:_,popupCloser:ae,popupResolver:re,closePopup(){this.popupResolver(!1)},useFilters(){this.popupResolver(this.validation.extractFields(this.fields))},clearFilters(){this.fields.forEach(e=>e.value=""),this.popupResolver(null)}},mounted(){this.fields=this.validation.createFields(this.popup.params.queryFilters),this.popupCloser()}},gs={class:"ns-box shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-5/6-screen flex flex-col"},bs={class:"p-2 border-b ns-box-header flex justify-between items-center"},_s={class:"p-2 ns-box-body flex-auto"},ps={class:"p-2 flex justify-between ns-box-footer border-t"};function ys(e,t,s,c,d,n){const r=w("ns-close-button"),o=w("ns-field"),f=w("ns-button");return i(),a("div",gs,[l("div",bs,[l("h3",null,h(n.__("Search Filters")),1),l("div",null,[T(r,{onClick:t[0]||(t[0]=g=>n.closePopup())})])]),l("div",_s,[(i(!0),a(p,null,D(d.fields,(g,b)=>(i(),E(o,{field:g,key:b},null,8,["field"]))),128))]),l("div",ps,[l("div",null,[T(f,{onClick:t[1]||(t[1]=g=>n.clearFilters()),type:"error"},{default:M(()=>[y(h(n.__("Clear Filters")),1)]),_:1})]),l("div",null,[T(f,{onClick:t[2]||(t[2]=g=>n.useFilters()),type:"info"},{default:M(()=>[y(h(n.__("Use Filters")),1)]),_:1})])])])}const vs=C(ms,[["render",ys]]),ks={data:()=>({prependOptions:!1,showOptions:!0,showCheckboxes:!0,isRefreshing:!1,sortColumn:"",searchInput:"",queryFiltersString:"",searchQuery:"",page:1,bulkAction:"",bulkActions:[],queryFilters:[],headerButtons:[],withFilters:!1,columns:[],selectedEntries:[],globallyChecked:!1,result:{current_page:null,data:[],first_page_url:null,from:null,last_page:null,last_page_url:null,next_page_url:null,path:null,per_page:null,prev_page_url:null,to:null,total:null}}),name:"ns-crud",mounted(){this.identifier!==void 0&&nsCrudHandler.defineInstance(this.identifier,this),this.loadConfig()},props:["src","createUrl","mode","identifier","queryParams","popup"],computed:{getParsedSrc(){return`${this.src}?${this.sortColumn}${this.searchQuery}${this.queryFiltersString}${this.queryPage}${this.getQueryParams()?"&"+this.getQueryParams():""}`},showQueryFilters(){return this.queryFilters.length>0},getSelectedAction(){const e=this.bulkActions.filter(t=>t.identifier===this.bulkAction);return e.length>0?e[0]:!1},pagination(){return this.result?this.pageNumbers(this.result.last_page,this.result.current_page):[]},queryPage(){return this.result?`&page=${this.page}`:""},resultInfo(){return _("displaying {perPage} on {items} items").replace("{perPage}",this.result.per_page||0).replace("{items}",this.result.total||0)},headerButtonsComponents(){return this.headerButtons.map(e=>ke(()=>new Promise(t=>{t(nsExtraComponents[e])})))}},methods:{__:_,getQueryParams(){return this.queryParams?Object.keys(this.queryParams).map(e=>`${e}=${this.queryParams[e]}`).join("&"):""},pageNumbers(e,t){var s=[];t-3>1&&s.push(1,"...");for(let c=1;c<=e;c++)t+3>c&&t-3c>0||typeof c=="string")},downloadContent(){nsHttpClient.post(`${this.src}/export?${this.getParsedSrc}`,{entries:this.selectedEntries.map(e=>e.$id)}).subscribe(e=>{setTimeout(()=>document.location=e.url,300),$.success(_("The document has been generated.")).subscribe()},e=>{$.error(e.message||_("Unexpected error occurred.")).subscribe()})},clearSelectedEntries(){L.show(V,{title:_("Clear Selected Entries ?"),message:_("Would you like to clear all selected entries ?"),onAction:e=>{e&&(this.selectedEntries=[],this.handleGlobalChange(!1))}})},refreshRow(e){if(console.log({row:e}),e.$checked===!0)this.selectedEntries.filter(s=>s.$id===e.$id).length===0&&this.selectedEntries.push(e);else{const t=this.selectedEntries.filter(s=>s.$id===e.$id);if(t.length>0){const s=this.selectedEntries.indexOf(t[0]);this.selectedEntries.splice(s,1)}}},handleShowOptions(e){this.result.data.forEach(t=>{t.$id!==e.$id&&(t.$toggled=!1)})},handleGlobalChange(e){this.globallyChecked=e,this.result.data.forEach(t=>{t.$checked=e,this.refreshRow(t)})},loadConfig(){nsHttpClient.get(`${this.src}/config?${this.getQueryParams()}`).subscribe(t=>{this.columns=t.columns,this.bulkActions=t.bulkActions,this.queryFilters=t.queryFilters,this.prependOptions=t.prependOptions,this.showOptions=t.showOptions,this.showCheckboxes=t.showCheckboxes,this.headerButtons=t.headerButtons||[],this.refresh()},t=>{$.error(t.message,"OK",{duration:!1}).subscribe()})},cancelSearch(){this.searchInput="",this.search()},search(){this.searchInput?this.searchQuery=`&search=${this.searchInput}`:this.searchQuery="",this.page=1,this.refresh()},sort(e){if(this.columns[e].$sort===!1)return $.error(_("Sorting is explicitely disabled on this column")).subscribe();for(let t in this.columns)t!==e&&(this.columns[t].$sorted=!1,this.columns[t].$direction="");switch(this.columns[e].$sorted=!0,this.columns[e].$direction){case"asc":this.columns[e].$direction="desc";break;case"desc":this.columns[e].$direction="";break;case"":default:this.columns[e].$direction="asc";break}["asc","desc"].includes(this.columns[e].$direction)?this.sortColumn=`active=${e}&direction=${this.columns[e].$direction}`:this.sortColumn="",this.$emit("sort",this.columns[e]),this.refresh()},bulkDo(){if(this.bulkAction)if(this.selectedEntries.length>0){if(confirm(this.getSelectedAction.confirm||_("Would you like to perform the selected bulk action on the selected entries ?")))return nsHttpClient.post(`${this.src}/bulk-actions`,{action:this.bulkAction,entries:this.selectedEntries.map(e=>e.$id)}).subscribe({next:e=>{$.info(e.message).subscribe(),this.selectedEntries=[],this.refresh()},error:e=>{$.error(e.message).subscribe()}})}else return $.error(_("No selection has been made.")).subscribe();else return $.error(_("No action has been selected.")).subscribe()},async openQueryFilter(){try{const e=await new Promise((t,s)=>{L.show(vs,{resolve:t,reject:s,queryFilters:this.queryFilters})});this.withFilters=!1,this.queryFiltersString="",e!==null&&(this.withFilters=!0,this.queryFiltersString="&queryFilters="+encodeURIComponent(JSON.stringify(e))),this.refresh()}catch{}},refresh(){this.globallyChecked=!1,this.isRefreshing=!0,nsHttpClient.get(`${this.getParsedSrc}`).subscribe(t=>{t.data=t.data.map(s=>(this.selectedEntries.filter(d=>d.$id===s.$id).length>0&&(s.$checked=!0),s)),this.isRefreshing=!1,this.result=t,this.page=t.current_page},t=>{this.isRefreshing=!1,$.error(t.message).subscribe()})}}},ws={key:0,id:"crud-table-header",class:"p-2 border-b flex flex-col md:flex-row justify-between flex-wrap"},xs={id:"crud-search-box",class:"w-full md:w-auto -mx-2 mb-2 md:mb-0 flex"},Ds={key:0,class:"px-2 flex items-center justify-center"},Cs=["href"],Ms=l("i",{class:"las la-plus"},null,-1),Ts=[Ms],Ss={class:"px-2"},$s={class:"rounded-full p-1 ns-crud-input flex"},Es=l("i",{class:"las la-search"},null,-1),Rs=[Es],Fs=l("i",{class:"las la-times text-white"},null,-1),Os=[Fs],Ps={class:"px-2 flex items-center justify-center"},As={key:1,class:"px-2 flex items-center"},js={key:0,class:"las la-filter"},Hs={key:1,class:"las la-check"},Us={key:2,class:"ml-1"},Ls={key:3,class:"ml-1"},Ys={key:2,id:"custom-buttons"},Vs={id:"crud-buttons",class:"-mx-1 flex flex-wrap w-full md:w-auto"},Bs={key:0,class:"px-1 flex items-center"},Is=l("i",{class:"lar la-check-square"},null,-1),Ns={class:"px-1 flex items-center"},zs=l("i",{class:"las la-download"},null,-1),qs={class:"flex p-2"},Ws={class:"overflow-x-auto flex-auto"},Gs={key:0,class:"table ns-table w-full"},Ks={key:0,class:"text-center px-2 border w-16 py-2"},Qs={key:1,class:"text-left px-2 py-2 w-16 border"},Zs=["onClick"],Xs={class:"w-full flex justify-between items-center"},Js={class:"flex"},en={class:"h-6 w-6 flex justify-center items-center"},tn={key:0,class:"las la-sort-amount-up"},sn={key:1,class:"las la-sort-amount-down"},nn={key:2,class:"text-left px-2 py-2 w-16 border"},ln={key:1},an=["colspan"],rn={class:"p-2 flex border-t flex-col md:flex-row justify-between footer"},dn={key:0,id:"grouped-actions",class:"mb-2 md:mb-0 flex justify-between rounded-full ns-crud-input p-1"},on={class:"bg-input-disabled",selected:"",value:""},un=["value"],cn={class:"flex"},hn={class:"items-center flex text-primary mx-4"},fn={id:"pagination",class:"flex items-center -mx-1"},mn=l("i",{class:"las la-angle-double-left"},null,-1),gn=[mn],bn=["onClick"],_n=l("i",{class:"las la-angle-double-right"},null,-1),pn=[_n];function yn(e,t,s,c,d,n){const r=w("ns-checkbox"),o=w("ns-table-row");return i(),a("div",{id:"crud-table",class:m(["w-full rounded-lg",s.mode!=="light"?"shadow mb-8":""])},[s.mode!=="light"?(i(),a("div",ws,[l("div",xs,[s.createUrl?(i(),a("div",Ds,[l("a",{href:s.createUrl||"#",class:"rounded-full ns-crud-button text-sm h-10 flex items-center justify-center cursor-pointer px-3 outline-none border"},Ts,8,Cs)])):u("",!0),l("div",Ss,[l("div",$s,[R(l("input",{onKeypress:t[0]||(t[0]=Y(f=>n.search(),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=f=>e.searchInput=f),type:"text",class:"w-36 md:w-auto bg-transparent outline-none px-2"},null,544),[[A,e.searchInput]]),l("button",{onClick:t[2]||(t[2]=f=>n.search()),class:"rounded-full w-8 h-8 outline-none ns-crud-input-button"},Rs),e.searchQuery?(i(),a("button",{key:0,onClick:t[3]||(t[3]=f=>n.cancelSearch()),class:"ml-1 rounded-full w-8 h-8 bg-error-secondary outline-none hover:bg-error-tertiary"},Os)):u("",!0)])]),l("div",Ps,[l("button",{onClick:t[4]||(t[4]=f=>n.refresh()),class:"rounded-full text-sm h-10 px-3 outline-none border ns-crud-button"},[l("i",{class:m([e.isRefreshing?"animate-spin":"","las la-sync"])},null,2)])]),n.showQueryFilters?(i(),a("div",As,[l("button",{onClick:t[5]||(t[5]=f=>n.openQueryFilter()),class:m([e.withFilters?"table-filters-enabled":"table-filters-disabled","ns-crud-button border rounded-full text-sm h-10 px-3 outline-none"])},[e.withFilters?u("",!0):(i(),a("i",js)),e.withFilters?(i(),a("i",Hs)):u("",!0),e.withFilters?u("",!0):(i(),a("span",Us,h(n.__("Filters")),1)),e.withFilters?(i(),a("span",Ls,h(n.__("Has Filters")),1)):u("",!0)],2)])):u("",!0),n.headerButtonsComponents.length>0?(i(),a("div",Ys,[(i(!0),a(p,null,D(n.headerButtonsComponents,(f,g)=>(i(),E(G(f),{onRefresh:t[6]||(t[6]=b=>n.refresh()),result:e.result,key:g},null,40,["result"]))),128))])):u("",!0)]),l("div",Vs,[e.selectedEntries.length>0?(i(),a("div",Bs,[l("button",{onClick:t[7]||(t[7]=f=>n.clearSelectedEntries()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 outline-none ns-crud-button border"},[Is,y(" "+h(n.__("{entries} entries selected").replace("{entries}",e.selectedEntries.length)),1)])])):u("",!0),l("div",Ns,[l("button",{onClick:t[8]||(t[8]=f=>n.downloadContent()),class:"flex justify-center items-center rounded-full text-sm h-10 px-3 ns-crud-button border outline-none"},[zs,y(" "+h(n.__("Download")),1)])])])])):u("",!0),l("div",qs,[l("div",Ws,[Object.values(e.columns).length>0?(i(),a("table",Gs,[l("thead",null,[l("tr",null,[e.showCheckboxes?(i(),a("th",Ks,[T(r,{checked:e.globallyChecked,onChange:t[9]||(t[9]=f=>n.handleGlobalChange(f))},null,8,["checked"])])):u("",!0),e.prependOptions&&e.showOptions?(i(),a("th",Qs)):u("",!0),(i(!0),a(p,null,D(e.columns,(f,g)=>(i(),a("th",{key:g,onClick:b=>n.sort(g),style:we({width:f.width||"auto","max-width":f.maxWidth||"auto","min-width":f.minWidth||"auto"}),class:"cursor-pointer justify-betweenw-40 border text-left px-2 py-2"},[l("div",Xs,[l("span",Js,h(f.label),1),l("span",en,[f.$direction==="desc"?(i(),a("i",tn)):u("",!0),f.$direction==="asc"?(i(),a("i",sn)):u("",!0)])])],12,Zs))),128)),!e.prependOptions&&e.showOptions?(i(),a("th",nn)):u("",!0)])]),l("tbody",null,[e.result.data!==void 0&&e.result.data.length>0?(i(!0),a(p,{key:0},D(e.result.data,(f,g)=>(i(),E(o,{key:g,onUpdated:t[10]||(t[10]=b=>n.refreshRow(b)),columns:e.columns,prependOptions:e.prependOptions,showOptions:e.showOptions,showCheckboxes:e.showCheckboxes,row:f,onReload:t[11]||(t[11]=b=>n.refresh()),onToggled:t[12]||(t[12]=b=>n.handleShowOptions(b))},null,8,["columns","prependOptions","showOptions","showCheckboxes","row"]))),128)):u("",!0),!e.result||e.result.data.length===0?(i(),a("tr",ln,[l("td",{colspan:Object.values(e.columns).length+2,class:"text-center border py-3"},h(n.__("There is nothing to display...")),9,an)])):u("",!0)])])):u("",!0)])]),l("div",rn,[e.bulkActions.length>0?(i(),a("div",dn,[R(l("select",{class:"outline-none bg-transparent","onUpdate:modelValue":t[13]||(t[13]=f=>e.bulkAction=f),id:"grouped-actions"},[l("option",on,[v(e.$slots,"bulk-label",{},()=>[y(h(n.__("Bulk Actions")),1)])]),(i(!0),a(p,null,D(e.bulkActions,(f,g)=>(i(),a("option",{class:"bg-input-disabled",key:g,value:f.identifier},h(f.label),9,un))),128))],512),[[H,e.bulkAction]]),l("button",{onClick:t[14]||(t[14]=f=>n.bulkDo()),class:"ns-crud-input-button h-8 px-3 outline-none rounded-full flex items-center justify-center"},[v(e.$slots,"bulk-go",{},()=>[y(h(n.__("Apply")),1)])])])):u("",!0),l("div",cn,[l("div",hn,h(n.resultInfo),1),l("div",fn,[e.result.current_page?(i(),a(p,{key:0},[l("a",{href:"javascript:void(0)",onClick:t[15]||(t[15]=f=>{e.page=e.result.first_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},gn),(i(!0),a(p,null,D(n.pagination,(f,g)=>(i(),a(p,null,[e.page!=="..."?(i(),a("a",{key:g,class:m([e.page==f?"bg-info-tertiary border-transparent text-white":"","mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"]),onClick:b=>{e.page=f,n.refresh()},href:"javascript:void(0)"},h(f),11,bn)):u("",!0),e.page==="..."?(i(),a("a",{key:g,href:"javascript:void(0)",class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border"},"...")):u("",!0)],64))),256)),l("a",{href:"javascript:void(0)",onClick:t[16]||(t[16]=f=>{e.page=e.result.last_page,n.refresh()}),class:"mx-1 flex items-center justify-center h-8 w-8 rounded-full ns-crud-button border shadow"},pn)],64)):u("",!0)])])])],2)}const vn=C(ks,[["render",yn]]),kn={data:()=>({form:{},globallyChecked:!1,formValidation:new ie,rows:[]}),emits:["updated","saved"],mounted(){this.loadForm()},props:["src","createUrl","fieldClass","returnUrl","submitUrl","submitMethod","disableTabs","queryParams","popup","optionAttributes"],computed:{activeTabFields(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return this.form.tabs[e].fields;return[]},activeTabIdentifier(){for(let e in this.form.tabs)if(this.form.tabs[e].active)return e;return{}}},methods:{__:_,popupResolver:re,toggle(e){for(let t in this.form.tabs)this.form.tabs[t].active=!1;this.form.tabs[e].active=!0},async handleSaved(e,t,s){this.form.tabs[t].fields.filter(c=>{c.name===s.name&&e.data.entry&&(c.options.push({label:e.data.entry[this.optionAttributes.label],value:e.data.entry[this.optionAttributes.value]}),c.value=e.data.entry.id)})},handleClose(){this.popup&&this.popupResolver(!1)},submit(){if(this.formValidation.validateForm(this.form).length>0)return $.error(_("Unable to proceed the form is not valid"),_("Close")).subscribe();if(this.formValidation.disableForm(this.form),this.submitUrl===void 0)return $.error(_("No submit URL was provided"),_("Okay")).subscribe();U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.appendQueryParamas(this.submitUrl),this.formValidation.extractForm(this.form)).subscribe(e=>{if(e.status==="success")if(this.popup)this.popupResolver(e);else{if(this.submitMethod&&this.submitMethod.toLowerCase()==="post"&&this.returnUrl!==!1)return document.location=e.data.editUrl||this.returnUrl;$.info(e.message,_("Okay"),{duration:3e3}).subscribe(),this.$emit("saved",e)}this.formValidation.enableForm(this.form)},e=>{$.error(e.message,void 0,{duration:5e3}).subscribe(),e.data!==void 0&&this.formValidation.triggerError(this.form,e.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){return new Promise((e,t)=>{U.get(`${this.appendQueryParamas(this.src)}`).subscribe({next:c=>{e(c),this.form=this.parseForm(c.form),de.doAction("ns-crud-form-loaded",this),this.$emit("updated",this.form)},error:c=>{t(c),$.error(c.message,_("Okay"),{duration:0}).subscribe()}})})},appendQueryParamas(e){if(this.queryParams===void 0)return e;const t=Object.keys(this.queryParams).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(this.queryParams[s])}`).join("&");return e.includes("?")?`${e}&${t}`:`${e}?${t}`},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let s in e.tabs)t===0&&(e.tabs[s].active=!0),e.tabs[s].active=e.tabs[s].active===void 0?!1:e.tabs[s].active,e.tabs[s].fields=this.formValidation.createFields(e.tabs[s].fields),t++;return e}}},wn={key:0,class:"flex items-center justify-center h-full"},xn={key:0,class:"box-header border-b border-box-edge box-border p-2 flex justify-between items-center"},Dn={class:"text-primary font-bold text-lg"},Cn={class:"flex flex-col"},Mn={key:0,class:"flex justify-between items-center"},Tn={for:"title",class:"font-bold my-2 text-primary"},Sn={key:0},$n={for:"title",class:"text-sm my-2"},En=["href"],Rn=["disabled"],Fn=["disabled"],On={key:0,class:"text-xs text-primary py-1"},Pn={key:0},An={key:1},jn={class:"header flex ml-4",style:{"margin-bottom":"-1px"}},Hn=["onClick"],Un={class:"ns-tab-item"},Ln={class:"border p-4 rounded"},Yn={class:"-mx-4 flex flex-wrap"},Vn={key:0,class:"flex justify-end"},Bn=["disabled"];function In(e,t,s,c,d,n){const r=w("ns-spinner"),o=w("ns-close-button"),f=w("ns-field");return i(),a(p,null,[Object.values(e.form).length===0?(i(),a("div",wn,[T(r)])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(["form flex-auto",s.popup?"bg-box-background w-95vw md:w-2/3-screen":""]),id:"crud-form"},[s.popup?(i(),a("div",xn,[l("h2",Dn,h(s.popup.params.title),1),l("div",null,[T(o,{onClick:t[0]||(t[0]=g=>n.handleClose())})])])):u("",!0),Object.values(e.form).length>0?(i(),a("div",{key:1,class:m(s.popup?"p-2":"")},[l("div",Cn,[e.form.main?(i(),a("div",Mn,[l("label",Tn,[e.form.main.name?(i(),a("span",Sn,h(e.form.main.label),1)):u("",!0)]),l("div",$n,[s.returnUrl&&!s.popup?(i(),a("a",{key:0,href:s.returnUrl,class:"rounded-full border px-2 py-1 ns-inset-button error"},h(n.__("Go Back")),9,En)):u("",!0)])])):u("",!0),e.form.main.name?(i(),a(p,{key:1},[l("div",{class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[R(l("input",{"onUpdate:modelValue":t[1]||(t[1]=g=>e.form.main.value=g),onKeydown:t[2]||(t[2]=Y(g=>n.submit(),["enter"])),onKeypress:t[3]||(t[3]=g=>e.formValidation.checkField(e.form.main)),onBlur:t[4]||(t[4]=g=>e.formValidation.checkField(e.form.main)),onChange:t[5]||(t[5]=g=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:"flex-auto outline-none h-10 px-2"},null,40,Rn),[[A,e.form.main.value]]),l("button",{disabled:e.form.main.disabled,class:m([e.form.main.disabled?"disabled":e.form.main.errors.length>0?"error":"","outline-none px-4 h-10 text-white"]),onClick:t[6]||(t[6]=g=>n.submit())},h(n.__("Save")),11,Fn)],2),e.form.main.description&&e.form.main.errors.length===0?(i(),a("p",On,h(e.form.main.description),1)):u("",!0),(i(!0),a(p,null,D(e.form.main.errors,(g,b)=>(i(),a("p",{key:b,class:"text-xs py-1 text-error-tertiary"},[g.identifier==="required"?(i(),a("span",Pn,[v(e.$slots,"error-required",{},()=>[y(h(g.identifier),1)])])):u("",!0),g.identifier==="invalid"?(i(),a("span",An,[v(e.$slots,"error-invalid",{},()=>[y(h(g.message),1)])])):u("",!0)]))),128))],64)):u("",!0)]),s.disableTabs!=="true"?(i(),a("div",{key:0,id:"tabs-container",class:m([s.popup?"mt-5":"my-5","ns-tab"])},[l("div",jn,[(i(!0),a(p,null,D(e.form.tabs,(g,b)=>(i(),a("div",{key:b,onClick:S=>n.toggle(b),class:m([g.active?"active border border-b-transparent":"inactive border","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(g.label),11,Hn))),128))]),l("div",Un,[l("div",Ln,[l("div",Yn,[(i(!0),a(p,null,D(n.activeTabFields,(g,b)=>(i(),a("div",{key:`${n.activeTabIdentifier}-${b}`,class:m(s.fieldClass||"px-4 w-full md:w-1/2 lg:w-1/3")},[T(f,{onSaved:S=>n.handleSaved(S,n.activeTabIdentifier,g),onBlur:S=>e.formValidation.checkField(g),onChange:S=>e.formValidation.checkField(g),field:g},null,8,["onSaved","onBlur","onChange","field"])],2))),128))]),e.form.main.name?u("",!0):(i(),a("div",Vn,[l("div",{class:m(["ns-button",e.form.main.disabled?"default":e.form.main.errors.length>0?"error":"info"])},[l("button",{disabled:e.form.main.disabled,onClick:t[7]||(t[7]=g=>n.submit()),class:"outline-none px-4 h-10 border-l"},h(n.__("Save")),9,Bn)],2)]))])])],2)):u("",!0)],2)):u("",!0)],2)):u("",!0)],64)}const Nn=C(kn,[["render",In]]),zn={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-input-edge cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},qn={class:"flex flex-auto flex-col mb-2"},Wn=["for"],Gn={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Kn={class:"sm:text-sm sm:leading-5"},Qn=["disabled","id","placeholder"];function Zn(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qn,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wn),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","bg-input-background text-secondary mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Gn,[l("span",Kn,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:"date",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Qn),[[A,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xn=C(zn,[["render",Zn]]),he={isSame:(e,t,s)=>{let c=new Date(e),d=new Date(t);return s==="date"&&(c.setHours(0,0,0,0),d.setHours(0,0,0,0)),c.getTime()===d.getTime()},daysInMonth:(e,t)=>new Date(e,t,0).getDate(),weekNumber:e=>Ee(e),format:(e,t)=>z(e,t),nextMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t},prevMonth:e=>{let t=new Date(e.getTime());return t.setDate(1),t.setMonth(t.getMonth()-1),t},validateDateRange:(e,t,s)=>{let c=new Date(s),d=new Date(t);return s&&e.getTime()>c.getTime()?c:t&&e.getTime()({...{direction:"ltr",format:"mm/dd/yyyy",separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:z.i18n.dayNames.slice(0,7).map(s=>s.substring(0,2)),monthNames:z.i18n.monthNames.slice(0,12),firstDay:0},...e}),yearMonth:e=>{let t=e.getMonth()+1;return e.getFullYear()+(t<10?"0":"")+t},isValidDate:e=>e instanceof Date&&!isNaN(e)},K={props:{dateUtil:{type:[Object,String],default:"native"}},created(){this.$dateUtil=he}},Jn={mixins:[K],name:"calendar",props:{monthDate:Date,localeData:Object,start:Date,end:Date,minDate:Date,maxDate:Date,showDropdowns:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},dateFormat:{type:Function,default:null}},data(){let e=this.monthDate||this.start||new Date;return{currentMonthDate:e,year_text:e.getFullYear()}},methods:{prevMonthClick(){this.changeMonthDate(this.$dateUtil.prevMonth(this.currentMonthDate))},nextMonthClick(){this.changeMonthDate(this.$dateUtil.nextMonth(this.currentMonthDate))},changeMonthDate(e,t=!0){let s=this.$dateUtil.yearMonth(this.currentMonthDate);this.currentMonthDate=this.$dateUtil.validateDateRange(e,this.minDate,this.maxDate),t&&s!==this.$dateUtil.yearMonth(this.currentMonthDate)&&this.$emit("change-month",{month:this.currentMonthDate.getMonth()+1,year:this.currentMonthDate.getFullYear()}),this.checkYear()},dayClass(e){let t=new Date(e);t.setHours(0,0,0,0);let s=new Date(this.start);s.setHours(0,0,0,0);let c=new Date(this.end);c.setHours(0,0,0,0);let d={off:e.getMonth()+1!==this.month,weekend:e.getDay()===6||e.getDay()===0,today:t.setHours(0,0,0,0)==new Date().setHours(0,0,0,0),active:t.setHours(0,0,0,0)==new Date(this.start).setHours(0,0,0,0)||t.setHours(0,0,0,0)==new Date(this.end).setHours(0,0,0,0),"in-range":t>=s&&t<=c,"start-date":t.getTime()===s.getTime(),"end-date":t.getTime()===c.getTime(),disabled:this.minDate&&t.getTime()this.maxDate.getTime()};return this.dateFormat?this.dateFormat(d,e):d},checkYear(){this.$refs.yearSelect!==document.activeElement&&this.$nextTick(()=>{this.year_text=this.monthDate.getFullYear()})}},computed:{monthName(){return this.locale.monthNames[this.currentMonthDate.getMonth()]},year:{get(){return this.year_text},set(e){this.year_text=e;let t=this.$dateUtil.validateDateRange(new Date(e,this.month,1),this.minDate,this.maxDate);this.$dateUtil.isValidDate(t)&&this.$emit("change-month",{month:t.getMonth(),year:t.getFullYear()})}},month:{get(){return this.currentMonthDate.getMonth()+1},set(e){let t=this.$dateUtil.validateDateRange(new Date(this.year,e-1,1),this.minDate,this.maxDate);this.$emit("change-month",{month:t.getMonth()+1,year:t.getFullYear()})}},calendar(){let e=this.month,t=this.currentMonthDate.getFullYear(),s=new Date(t,e-1,1),c=this.$dateUtil.prevMonth(s).getMonth()+1,d=this.$dateUtil.prevMonth(s).getFullYear(),n=new Date(d,e-1,0).getDate(),r=s.getDay(),o=[];for(let b=0;b<6;b++)o[b]=[];let f=n-r+this.locale.firstDay+1;f>n&&(f-=7),r===this.locale.firstDay&&(f=n-6);let g=new Date(d,c-1,f,12,0,0);for(let b=0,S=0,F=0;b<6*7;b++,S++,g.setDate(g.getDate()+1))b>0&&S%7===0&&(S=0,F++),o[F][S]=new Date(g.getTime());return o},months(){let e=this.locale.monthNames.map((t,s)=>({label:t,value:s}));if(this.maxDate&&this.minDate){let t=this.maxDate.getFullYear()-this.minDate.getFullYear();if(t<2){let s=[];if(t<1)for(let c=this.minDate.getMonth();c<=this.maxDate.getMonth();c++)s.push(c);else{for(let c=0;c<=this.maxDate.getMonth();c++)s.push(c);for(let c=this.minDate.getMonth();c<12;c++)s.push(c)}if(s.length>0)return e.filter(c=>s.find(d=>c.value===d)>-1)}}return e},locale(){return this.$dateUtil.localeData(this.localeData)}},watch:{monthDate(e){this.currentMonthDate.getTime()!==e.getTime()&&this.changeMonthDate(e,!1)}}},fe=e=>(ne("data-v-66e2a2e7"),e=e(),le(),e),el={class:"table-condensed"},tl=fe(()=>l("span",null,null,-1)),sl=[tl],nl=["colspan"],ll={class:"row mx-1"},il=["value"],al=["colspan"],rl=fe(()=>l("span",null,null,-1)),dl=[rl],ol={key:0,class:"week"},ul={key:0,class:"week"},cl=["onClick","onMouseover"];function hl(e,t,s,c,d,n){return i(),a("table",el,[l("thead",null,[l("tr",null,[l("th",{class:"prev available",onClick:t[0]||(t[0]=(...r)=>n.prevMonthClick&&n.prevMonthClick(...r)),tabindex:"0"},sl),s.showDropdowns?(i(),a("th",{key:0,colspan:s.showWeekNumbers?6:5,class:"month"},[l("div",ll,[R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>n.month=r),class:"monthselect col"},[(i(!0),a(p,null,D(n.months,r=>(i(),a("option",{key:r.value,value:r.value+1},h(r.label),9,il))),128))],512),[[H,n.month]]),R(l("input",{ref:"yearSelect",type:"number","onUpdate:modelValue":t[2]||(t[2]=r=>n.year=r),onBlur:t[3]||(t[3]=(...r)=>n.checkYear&&n.checkYear(...r)),class:"yearselect col"},null,544),[[A,n.year]])])],8,nl)):(i(),a("th",{key:1,colspan:s.showWeekNumbers?6:5,class:"month"},h(n.monthName)+" "+h(n.year),9,al)),l("th",{class:"next available",onClick:t[4]||(t[4]=(...r)=>n.nextMonthClick&&n.nextMonthClick(...r)),tabindex:"0"},dl)])]),l("tbody",null,[l("tr",null,[s.showWeekNumbers?(i(),a("th",ol,h(n.locale.weekLabel),1)):u("",!0),(i(!0),a(p,null,D(n.locale.daysOfWeek,r=>(i(),a("th",{key:r},h(r),1))),128))]),(i(!0),a(p,null,D(n.calendar,(r,o)=>(i(),a("tr",{key:o},[s.showWeekNumbers&&(o%7||o===0)?(i(),a("td",ul,h(e.$dateUtil.weekNumber(r[0])),1)):u("",!0),(i(!0),a(p,null,D(r,(f,g)=>(i(),a("td",{class:m(n.dayClass(f)),onClick:b=>e.$emit("dateClick",f),onMouseover:b=>e.$emit("hoverDate",f),key:g},[v(e.$slots,"date-slot",{date:f},()=>[y(h(f.getDate()),1)],!0)],42,cl))),128))]))),128))])])}const fl=C(Jn,[["render",hl],["__scopeId","data-v-66e2a2e7"]]),ml={props:{miniuteIncrement:{type:Number,default:5},hour24:{type:Boolean,default:!0},secondPicker:{type:Boolean,default:!1},currentTime:{default(){return new Date}},readonly:{type:Boolean,default:!1}},data(){let e=this.currentTime?this.currentTime:new Date,t=e.getHours();return{hour:this.hour24?t:t%12||12,minute:e.getMinutes()-e.getMinutes()%this.miniuteIncrement,second:e.getSeconds(),ampm:t<12?"AM":"PM"}},computed:{hours(){let e=[],t=this.hour24?24:12;for(let s=0;se<10?"0"+e.toString():e.toString(),getHour(){return this.hour24?this.hour:this.hour===12?this.ampm==="AM"?0:12:this.hour+(this.ampm==="PM"?12:0)},onChange(){this.$emit("update",{hours:this.getHour(),minutes:this.minute,seconds:this.second})}}},gl={class:"calendar-time"},bl=["disabled"],_l=["value"],pl=["disabled"],yl=["value"],vl=["disabled"],kl=["value"],wl=["disabled"],xl=l("option",{value:"AM"},"AM",-1),Dl=l("option",{value:"PM"},"PM",-1),Cl=[xl,Dl];function Ml(e,t,s,c,d,n){return i(),a("div",gl,[R(l("select",{"onUpdate:modelValue":t[0]||(t[0]=r=>d.hour=r),class:"hourselect form-control mr-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.hours,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,_l))),128))],8,bl),[[H,d.hour]]),y(" :"),R(l("select",{"onUpdate:modelValue":t[1]||(t[1]=r=>d.minute=r),class:"minuteselect form-control ml-1",disabled:s.readonly},[(i(!0),a(p,null,D(n.minutes,r=>(i(),a("option",{key:r,value:r},h(n.formatNumber(r)),9,yl))),128))],8,pl),[[H,d.minute]]),s.secondPicker?(i(),a(p,{key:0},[y(" :"),R(l("select",{"onUpdate:modelValue":t[2]||(t[2]=r=>d.second=r),class:"secondselect form-control ml-1",disabled:s.readonly},[(i(),a(p,null,D(60,r=>l("option",{key:r-1,value:r-1},h(n.formatNumber(r-1)),9,kl)),64))],8,vl),[[H,d.second]])],64)):u("",!0),s.hour24?u("",!0):R((i(),a("select",{key:1,"onUpdate:modelValue":t[3]||(t[3]=r=>d.ampm=r),class:"ampmselect",disabled:s.readonly},Cl,8,wl)),[[H,d.ampm]])])}const Tl=C(ml,[["render",Ml]]),Sl={mixins:[K],props:{ranges:Object,selected:Object,localeData:Object,alwaysShowCalendars:Boolean},data(){return{customRangeActive:!1}},methods:{clickRange(e){this.customRangeActive=!1,this.$emit("clickRange",e)},clickCustomRange(){this.customRangeActive=!0,this.$emit("showCustomRange")},range_class(e){return{active:e.selected===!0}}},computed:{listedRanges(){return this.ranges?Object.keys(this.ranges).map(e=>({label:e,value:this.ranges[e],selected:this.$dateUtil.isSame(this.selected.startDate,this.ranges[e][0])&&this.$dateUtil.isSame(this.selected.endDate,this.ranges[e][1])})):!1},selectedRange(){return this.listedRanges.find(e=>e.selected===!0)},showCustomRangeLabel(){return!this.alwaysShowCalendars}}},$l={class:"ranges"},El={key:0},Rl=["onClick","data-range-key"];function Fl(e,t,s,c,d,n){return i(),a("div",$l,[s.ranges?(i(),a("ul",El,[(i(!0),a(p,null,D(n.listedRanges,r=>(i(),a("li",{onClick:o=>n.clickRange(r.value),"data-range-key":r.label,key:r.label,class:m(n.range_class(r)),tabindex:"0"},h(r.label),11,Rl))),128)),n.showCustomRangeLabel?(i(),a("li",{key:0,class:m({active:d.customRangeActive||!n.selectedRange}),onClick:t[0]||(t[0]=(...r)=>n.clickCustomRange&&n.clickCustomRange(...r)),tabindex:"0"},h(s.localeData.customRangeLabel),3)):u("",!0)])):u("",!0)])}const Ol=C(Sl,[["render",Fl]]),Pl={mounted(e,{instance:t}){if(t.appendToBody){const{height:s,top:c,left:d,width:n,right:r}=t.$refs.toggle.getBoundingClientRect();e.unbindPosition=t.calculatePosition(e,t,{width:n,top:window.scrollY+c+s,left:window.scrollX+d,right:r}),document.body.appendChild(e)}else t.$el.appendChild(e)},unmounted(e,{instance:t}){t.appendToBody&&(e.unbindPosition&&typeof e.unbindPosition=="function"&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}},Al={inheritAttrs:!1,components:{Calendar:fl,CalendarTime:Tl,CalendarRanges:Ol},mixins:[K],directives:{appendToBody:Pl},emits:["update:modelValue","toggle","hoverDate","startSelection","select","change-month","finishSelection"],props:{modelValue:{type:Object},minDate:{type:[String,Date],default(){return null}},maxDate:{type:[String,Date],default(){return null}},showWeekNumbers:{type:Boolean,default:!1},linkedCalendars:{type:Boolean,default:!0},singleDatePicker:{type:[Boolean,String],default:!1},showDropdowns:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},timePickerIncrement:{type:Number,default:5},timePicker24Hour:{type:Boolean,default:!0},timePickerSeconds:{type:Boolean,default:!1},autoApply:{type:Boolean,default:!1},localeData:{type:Object,default(){return{}}},dateRange:{type:[Object],default:null,required:!0},ranges:{type:[Object,Boolean],default(){let e=new Date;e.setHours(0,0,0,0);let t=new Date;t.setHours(11,59,59,999);let s=new Date;s.setDate(e.getDate()-1),s.setHours(0,0,0,0);let c=new Date;c.setDate(e.getDate()-1),c.setHours(11,59,59,999);let d=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0,11,59,59,999);return{Today:[e,t],Yesterday:[s,c],"This month":[d,n],"This year":[new Date(e.getFullYear(),0,1),new Date(e.getFullYear(),11,31,11,59,59,999)],"Last month":[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0,11,59,59,999)]}}},opens:{type:String,default:"center"},dateFormat:Function,alwaysShowCalendars:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},controlContainerClass:{type:[Object,String],default:"form-control reportrange-text"},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default(e,t,{width:s,top:c,left:d,right:n}){t.opens==="center"?e.style.left=d+s/2+"px":t.opens==="left"?e.style.right=window.innerWidth-n+"px":t.opens==="right"&&(e.style.left=d+"px"),e.style.top=c+"px"}},closeOnEsc:{type:Boolean,default:!0},readonly:{type:Boolean}},data(){const e=he;let t={locale:e.localeData({...this.localeData})},s=this.dateRange.startDate||null,c=this.dateRange.endDate||null;if(t.monthDate=s?new Date(s):new Date,t.nextMonthDate=e.nextMonth(t.monthDate),t.start=s?new Date(s):null,this.singleDatePicker&&this.singleDatePicker!=="range"?t.end=t.start:t.end=c?new Date(c):null,t.in_selection=!1,t.open=!1,t.showCustomRangeCalendars=!1,t.locale.firstDay!==0){let d=t.locale.firstDay,n=[...t.locale.daysOfWeek];for(;d>0;)n.push(n.shift()),d--;t.locale.daysOfWeek=n}return t},methods:{dateFormatFn(e,t){let s=new Date(t);s.setHours(0,0,0,0);let c=new Date(this.start);c.setHours(0,0,0,0);let d=new Date(this.end);return d.setHours(0,0,0,0),e["in-range"]=s>=c&&s<=d,this.dateFormat?this.dateFormat(e,t):e},changeLeftMonth(e){let t=new Date(e.year,e.month-1,1);this.monthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.monthDate)>=this.$dateUtil.yearMonth(this.nextMonthDate))&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(t),this.minDate,this.maxDate),(!this.singleDatePicker||this.singleDatePicker==="range")&&this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(this.monthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,0)},changeRightMonth(e){let t=new Date(e.year,e.month-1,1);this.nextMonthDate=t,(this.linkedCalendars||this.$dateUtil.yearMonth(this.nextMonthDate)<=this.$dateUtil.yearMonth(this.monthDate))&&(this.monthDate=this.$dateUtil.validateDateRange(this.$dateUtil.prevMonth(t),this.minDate,this.maxDate),this.$dateUtil.yearMonth(this.monthDate)===this.$dateUtil.yearMonth(this.nextMonthDate)&&(this.nextMonthDate=this.$dateUtil.validateDateRange(this.$dateUtil.nextMonth(this.nextMonthDate),this.minDate,this.maxDate))),this.$emit("change-month",this.monthDate,1)},normalizeDatetime(e,t){let s=new Date(e);return this.timePicker&&t&&(s.setHours(t.getHours()),s.setMinutes(t.getMinutes()),s.setSeconds(t.getSeconds()),s.setMilliseconds(t.getMilliseconds())),s},dateClick(e){if(this.readonly)return!1;this.in_selection?(this.in_selection=!1,this.end=this.normalizeDatetime(e,this.end),this.end=this.start&&(this.end=t),this.$emit("hoverDate",e)},onClickPicker(){this.disabled||this.togglePicker(null,!0)},togglePicker(e,t){typeof e=="boolean"?this.open=e:this.open=!this.open,t===!0&&this.$emit("toggle",this.open,this.togglePicker)},clickedApply(){this.togglePicker(!1,!0),this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},clickCancel(){if(this.open){let e=this.dateRange.startDate,t=this.dateRange.endDate;this.start=e?new Date(e):null,this.end=t?new Date(t):null,this.in_selection=!1,this.togglePicker(!1,!0)}},onSelect(){this.$emit("select",{startDate:this.start,endDate:this.end})},clickAway(e){e&&e.target&&!this.$el.contains(e.target)&&this.$refs.dropdown&&!this.$refs.dropdown.contains(e.target)&&this.clickCancel()},clickRange(e){this.in_selection=!1,this.$dateUtil.isValidDate(e[0])&&this.$dateUtil.isValidDate(e[1])?(this.start=this.$dateUtil.validateDateRange(new Date(e[0]),this.minDate,this.maxDate),this.end=this.$dateUtil.validateDateRange(new Date(e[1]),this.minDate,this.maxDate),this.changeLeftMonth({month:this.start.getMonth()+1,year:this.start.getFullYear()}),this.linkedCalendars===!1&&this.changeRightMonth({month:this.end.getMonth()+1,year:this.end.getFullYear()})):(this.start=null,this.end=null),this.onSelect(),this.autoApply&&this.clickedApply()},onUpdateStartTime(e){let t=new Date(this.start);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.start=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.singleDatePicker&&this.singleDatePicker!=="range"?this.start:this.end})},onUpdateEndTime(e){let t=new Date(this.end);t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds),this.end=this.$dateUtil.validateDateRange(t,this.minDate,this.maxDate),this.autoApply&&this.$emit("update:modelValue",{startDate:this.start,endDate:this.end})},handleEscape(e){this.open&&e.keyCode===27&&this.closeOnEsc&&this.clickCancel()}},computed:{showRanges(){return this.ranges!==!1&&!this.readonly},showCalendars(){return this.alwaysShowCalendars||this.showCustomRangeCalendars},startText(){return this.start===null?"":this.$dateUtil.format(this.start,this.locale.format)},endText(){return this.end===null?"":this.$dateUtil.format(this.end,this.locale.format)},rangeText(){let e=this.startText;return(!this.singleDatePicker||this.singleDatePicker==="range")&&(e+=this.locale.separator+this.endText),e},min(){return this.minDate?new Date(this.minDate):null},max(){return this.maxDate?new Date(this.maxDate):null},pickerStyles(){return{"show-calendar":this.open||this.opens==="inline","show-ranges":this.showRanges,"show-weeknumbers":this.showWeekNumbers,single:this.singleDatePicker,["opens"+this.opens]:!0,linked:this.linkedCalendars,"hide-calendars":!this.showCalendars}},isClear(){return!this.dateRange.startDate||!this.dateRange.endDate},isDirty(){let e=new Date(this.dateRange.startDate),t=new Date(this.dateRange.endDate);return!this.isClear&&(this.start.getTime()!==e.getTime()||this.end.getTime()!==t.getTime())}},watch:{minDate(){let e=this.$dateUtil.validateDateRange(this.monthDate,this.minDate||new Date,this.maxDate);this.changeLeftMonth({year:e.getFullYear(),month:e.getMonth()+1})},maxDate(){let e=this.$dateUtil.validateDateRange(this.nextMonthDate,this.minDate,this.maxDate||new Date);this.changeRightMonth({year:e.getFullYear(),month:e.getMonth()+1})},"dateRange.startDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.start=e&&!this.isClear&&this.$dateUtil.isValidDate(new Date(e))?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},"dateRange.endDate"(e){this.$dateUtil.isValidDate(new Date(e))&&(this.end=e&&!this.isClear?new Date(e):null,this.isClear?(this.start=null,this.end=null):(this.start=new Date(this.dateRange.startDate),this.end=new Date(this.dateRange.endDate)))},open:{handler(e){typeof document=="object"&&this.$nextTick(()=>{e?document.body.addEventListener("click",this.clickAway):document.body.removeEventListener("click",this.clickAway),e?document.addEventListener("keydown",this.handleEscape):document.removeEventListener("keydown",this.handleEscape),!this.alwaysShowCalendars&&this.ranges&&(this.showCustomRangeCalendars=!Object.keys(this.ranges).find(t=>this.$dateUtil.isSame(this.start,this.ranges[t][0],"date")&&this.$dateUtil.isSame(this.end,this.ranges[t][1],"date")))})},immediate:!0}}},me=e=>(ne("data-v-577c3804"),e=e(),le(),e),jl=me(()=>l("i",{class:"glyphicon glyphicon-calendar fa fa-calendar"},null,-1)),Hl=me(()=>l("b",{class:"caret"},null,-1)),Ul={class:"calendars"},Ll={key:1,class:"calendars-container"};const Yl={class:"calendar-table"},Vl={key:0,class:"drp-calendar col right"};const Bl={class:"calendar-table"},Il={key:0,class:"drp-buttons"},Nl={key:0,class:"drp-selected"},zl=["disabled"];function ql(e,t,s,c,d,n){const r=w("calendar-ranges"),o=w("calendar"),f=w("calendar-time"),g=xe("append-to-body");return i(),a("div",{class:m(["vue-daterange-picker",{inline:s.opens==="inline"}])},[l("div",{class:m(s.controlContainerClass),onClick:t[0]||(t[0]=(...b)=>n.onClickPicker&&n.onClickPicker(...b)),ref:"toggle"},[v(e.$slots,"input",{startDate:e.start,endDate:e.end,ranges:s.ranges,rangeText:n.rangeText},()=>[jl,y("  "),l("span",null,h(n.rangeText),1),Hl],!0)],2),T(Te,{name:"slide-fade",mode:"out-in"},{default:M(()=>[e.open||s.opens==="inline"?R((i(),a("div",{key:0,class:m(["daterangepicker ltr",n.pickerStyles]),ref:"dropdown"},[v(e.$slots,"header",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},void 0,!0),l("div",Ul,[n.showRanges?v(e.$slots,"ranges",{key:0,startDate:e.start,endDate:e.end,ranges:s.ranges,clickRange:n.clickRange},()=>[T(r,{onClickRange:n.clickRange,onShowCustomRange:t[1]||(t[1]=b=>e.showCustomRangeCalendars=!0),"always-show-calendars":s.alwaysShowCalendars,"locale-data":e.locale,ranges:s.ranges,selected:{startDate:e.start,endDate:e.end}},null,8,["onClickRange","always-show-calendars","locale-data","ranges","selected"])],!0):u("",!0),n.showCalendars?(i(),a("div",Ll,[l("div",{class:m(["drp-calendar col left",{single:s.singleDatePicker}])},[u("",!0),l("div",Yl,[T(o,{monthDate:e.monthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeLeftMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.start?(i(),E(f,{key:1,onUpdate:n.onUpdateStartTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.start,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)],2),s.singleDatePicker?u("",!0):(i(),a("div",Vl,[u("",!0),l("div",Bl,[T(o,{monthDate:e.nextMonthDate,"locale-data":e.locale,start:e.start,end:e.end,minDate:n.min,maxDate:n.max,"show-dropdowns":s.showDropdowns,onChangeMonth:n.changeRightMonth,"date-format":n.dateFormatFn,onDateClick:n.dateClick,onHoverDate:n.hoverDate,showWeekNumbers:s.showWeekNumbers},{default:M(()=>[v(e.$slots,"date",J(ee(e.data)),void 0,!0)]),_:3},8,["monthDate","locale-data","start","end","minDate","maxDate","show-dropdowns","onChangeMonth","date-format","onDateClick","onHoverDate","showWeekNumbers"])]),s.timePicker&&e.end?(i(),E(f,{key:1,onUpdate:n.onUpdateEndTime,"miniute-increment":s.timePickerIncrement,hour24:s.timePicker24Hour,"second-picker":s.timePickerSeconds,"current-time":e.end,readonly:s.readonly},null,8,["onUpdate","miniute-increment","hour24","second-picker","current-time","readonly"])):u("",!0)]))])):u("",!0)]),v(e.$slots,"footer",{rangeText:n.rangeText,locale:e.locale,clickCancel:n.clickCancel,clickApply:n.clickedApply,in_selection:e.in_selection,autoApply:s.autoApply},()=>[s.autoApply?u("",!0):(i(),a("div",Il,[n.showCalendars?(i(),a("span",Nl,h(n.rangeText),1)):u("",!0),s.readonly?u("",!0):(i(),a("button",{key:1,class:"cancelBtn btn btn-sm btn-secondary",type:"button",onClick:t[2]||(t[2]=(...b)=>n.clickCancel&&n.clickCancel(...b))},h(e.locale.cancelLabel),1)),s.readonly?u("",!0):(i(),a("button",{key:2,class:"applyBtn btn btn-sm btn-success",disabled:e.in_selection,type:"button",onClick:t[3]||(t[3]=(...b)=>n.clickedApply&&n.clickedApply(...b))},h(e.locale.applyLabel),9,zl))]))],!0)],2)),[[g]]):u("",!0)]),_:3})],2)}const Wl=C(Al,[["render",ql],["__scopeId","data-v-577c3804"]]),Gl={name:"ns-date-range-picker",data(){return{dateRange:{startDate:null,endDate:null}}},components:{DateRangePicker:Wl},mounted(){this.field.value!==void 0&&(this.dateRange=this.field.value)},watch:{dateRange(){const e={startDate:x(this.dateRange.startDate).format("YYYY-MM-DD HH:mm"),endDate:x(this.dateRange.endDate).format("YYYY-MM-DD HH:mm")};this.field.value=e,this.$emit("change",this)}},methods:{__:_,getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.dateRange={startDate:null,endDate:null},this.field.value=void 0}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Kl={class:"flex flex-auto flex-col mb-2 ns-date-range-picker"},Ql=["for"],Zl={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Xl={class:"text-primary sm:text-sm sm:leading-5"},Jl=l("i",{class:"las la-times"},null,-1),ei=[Jl],ti={class:"flex justify-between items-center w-full py-2"},si={class:"text-xs"},ni={class:"text-xs"};function li(e,t,s,c,d,n){const r=w("date-range-picker"),o=w("ns-field-description");return i(),a("div",Kl,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ql),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group border-2 rounded-md overflow-hidden focus:shadow-sm"])},[s.leading?(i(),a("div",Zl,[l("span",Xl,h(s.leading),1)])):u("",!0),l("button",{class:"px-3 outline-none bg-error-secondary font-semibold text-white",onClick:t[0]||(t[0]=f=>n.clearDate())},ei),T(r,{class:"w-full flex items-center bg-input-background",ref:"picker","locale-data":{firstDay:1,format:"yyyy-mm-dd HH:mm:ss"},timePicker:!0,timePicker24Hour:!0,showWeekNumbers:!0,showDropdowns:!0,autoApply:!1,appendToBody:!0,modelValue:d.dateRange,"onUpdate:modelValue":t[1]||(t[1]=f=>d.dateRange=f),disabled:s.field.disabled,linkedCalendars:!0},{input:M(f=>[l("div",ti,[l("span",si,h(n.__("Range Starts"))+" : "+h(n.getFormattedDate(f.startDate)),1),l("span",ni,h(n.__("Range Ends"))+" : "+h(n.getFormattedDate(f.endDate)),1)])]),_:1},8,["modelValue","disabled"])],2),T(o,{field:s.field},null,8,["field"])])}const ge=C(Gl,[["render",li]]),ii={name:"ns-date-time-picker",props:["field","date"],data(){return{visible:!1,hours:0,minutes:0,currentView:"days",currentDay:void 0,moment:x}},computed:{fieldDate(){return this.field?x(this.field.value).isValid()?x(this.field.value):x():this.date?x(this.date):x()}},mounted(){let e=x(this.field.value);e.isValid()?this.setDate(e.format("YYYY-MM-DD HH:mm:ss")):this.setDate(x(ns.date.current).format("YYYY-MM-DD HH:mm:ss"))},methods:{__:_,setDate(e){this.field.value=e}}},ai={class:"picker mb-2"},ri={key:0,class:"block leading-5 font-medium text-primary"},di={class:"ns-button"},oi=l("i",{class:"las la-clock text-xl"},null,-1),ui={key:0,class:"mx-1 text-sm"},ci={key:0},hi={key:1},fi={key:1,class:"mx-1 text-sm"},mi={key:0},gi={key:1},bi={key:1,class:"text-sm text-secondary py-1"},_i={key:2,class:"relative z-10 h-0 w-0"};function pi(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",ai,[s.field&&s.field.label&&s.field.label.length>0?(i(),a("label",ri,h(s.field.label),1)):u("",!0),l("div",di,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:m([s.field&&s.field.label&&s.field.label.length>0?"mt-1 border border-input-edge":"","shadow rounded cursor-pointer w-full p-1 flex items-center text-primary"])},[oi,s.field?(i(),a("span",ui,[[null,"",void 0].includes(s.field.value)?u("",!0):(i(),a("span",ci,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.field.value)?(i(),a("span",hi,"N/A")):u("",!0)])):u("",!0),s.date?(i(),a("span",fi,[[null,"",void 0].includes(s.date)?u("",!0):(i(),a("span",mi,h(n.fieldDate.format("YYYY-MM-DD HH:mm")),1)),[null,"",void 0].includes(s.date)?(i(),a("span",gi,"N/A")):u("",!0)])):u("",!0)],2)]),s.field?(i(),a("p",bi,h(s.field.description),1)):u("",!0),d.visible?(i(),a("div",_i,[l("div",{class:m([s.field&&s.field.label&&s.field.label.length>0?"-mt-4":"mt-2","absolute w-72 shadow-xl rounded ns-box anim-duration-300 zoom-in-entrance flex flex-col"])},[s.field?(i(),E(r,{key:0,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),onSet:t[2]||(t[2]=o=>n.setDate(o)),visible:d.visible,date:s.field.value},null,8,["visible","date"])):u("",!0),s.date?(i(),E(r,{key:1,onOnClickOut:t[3]||(t[3]=o=>d.visible=!1),onSet:t[4]||(t[4]=o=>n.setDate(o)),visible:d.visible,date:s.date},null,8,["visible","date"])):u("",!0)],2)])):u("",!0)])}const be=C(ii,[["render",pi]]),yi={name:"ns-datepicker",components:{nsCalendar:ce},props:["label","date","format"],computed:{formattedDate(){return x(this.date).format(this.format||"YYYY-MM-DD HH:mm:ss")}},data(){return{visible:!1}},mounted(){},methods:{__:_,setDate(e){this.$emit("set",e)}}},vi={class:"picker"},ki={class:"ns-button"},wi=l("i",{class:"las la-clock text-2xl"},null,-1),xi={class:"mx-1 text-sm"},Di={key:0},Ci={key:1},Mi={key:0,class:"relative h-0 w-0 -mb-2"},Ti={class:"w-72 mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col ns-floating-panel"};function Si(e,t,s,c,d,n){const r=w("ns-calendar");return i(),a("div",vi,[l("div",ki,[l("button",{onClick:t[0]||(t[0]=o=>d.visible=!d.visible),class:"rounded cursor-pointer border border-input-edge shadow w-full px-1 py-1 flex items-center text-primary"},[wi,l("span",xi,[l("span",null,h(s.label||n.__("Date"))+" : ",1),s.date?(i(),a("span",Di,h(n.formattedDate),1)):(i(),a("span",Ci,h(n.__("N/A")),1))])])]),d.visible?(i(),a("div",Mi,[l("div",Ti,[T(r,{visible:d.visible,onOnClickOut:t[1]||(t[1]=o=>d.visible=!1),date:s.date,onSet:t[2]||(t[2]=o=>n.setDate(o))},null,8,["visible","date"])])])):u("",!0)])}const $i=C(yi,[["render",Si]]),Ei={name:"ns-daterange-picker",data(){return{leftCalendar:x(),rightCalendar:x().add(1,"months"),rangeViewToggled:!1,clickedOnCalendar:!1}},mounted(){this.field.value||this.clearDate(),document.addEventListener("click",this.checkClickedItem)},beforeUnmount(){document.removeEventListener("click",this.checkClickedItem)},watch:{leftCalendar(){this.leftCalendar.isSame(this.rightCalendar,"month")&&this.rightCalendar.add(1,"months")},rightCalendar(){this.rightCalendar.isSame(this.leftCalendar,"month")&&this.leftCalendar.sub(1,"months")}},methods:{__:_,setDateRange(e,t){this.field.value[e]=t,x(this.field.value.startDate).isBefore(x(this.field.value.endDate))&&this.$emit("change",this.field)},getFormattedDate(e){return e!==null?x(e).format("YYYY-MM-DD HH:mm"):_("N/D")},clearDate(){this.field.value={startDate:null,endDate:null}},toggleRangeView(){this.rangeViewToggled=!this.rangeViewToggled},handleDateRangeClick(){this.clickedOnCalendar=!0},checkClickedItem(e){this.$el.getAttribute("class").split(" ").includes("ns-daterange-picker")&&(!this.$el.contains(e.srcElement)&&!this.clickedOnCalendar&&this.rangeViewToggled&&(this.$emit("blur",this.field),this.toggleRangeView()),setTimeout(()=>{this.clickedOnCalendar=!1},100))}},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"},startDateFormatted(){return this.field.value!==void 0&&x(this.field.value.startDate).isValid()?x(this.field.value.startDate).format("YYYY-MM-DD HH:mm"):!1},endDateFormatted(){return this.field.value!==void 0&&x(this.field.value.endDate).isValid()?x(this.field.value.endDate).format("YYYY-MM-DD HH:mm"):!1}},props:["placeholder","leading","type","field"]},Ri=["for"],Fi={class:"border border-input-edge rounded-tl rounded-bl flex-auto flex"},Oi={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Pi={class:"text-primary sm:text-sm sm:leading-5"},Ai=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),ji={class:""},Hi=l("span",{class:"mx-2"},"—",-1),Ui=l("span",{class:"mr-1"},[l("i",{class:"las la-clock text-2xl"})],-1),Li={class:""},Yi=l("i",{class:"las la-times"},null,-1),Vi=[Yi],Bi={key:0,class:"relative h-0 w-0"},Ii={class:"z-10 absolute md:w-[550px] w-[225px] mt-2 shadow-lg anim-duration-300 zoom-in-entrance flex flex-col"},Ni={class:"flex flex-col md:flex-row bg-box-background rounded-lg"},zi=l("div",{class:"flex-auto border-l border-r"},null,-1);function qi(e,t,s,c,d,n){const r=w("ns-calendar"),o=w("ns-field-description");return i(),a("div",{onClick:t[4]||(t[4]=f=>n.handleDateRangeClick()),class:"flex flex-auto flex-col mb-2 ns-daterange-picker"},[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Ri),l("div",{class:m([n.hasError?"error":"","mt-1 relative flex input-group bg-input-background rounded overflow-hidden shadow focus:shadow-sm"])},[l("div",Fi,[s.leading?(i(),a("div",Oi,[l("span",Pi,h(s.leading),1)])):u("",!0),l("div",{class:"flex flex-auto p-1 text-primary text-sm items-center cursor-pointer",onClick:t[0]||(t[0]=f=>n.toggleRangeView())},[Ai,l("span",ji,h(n.startDateFormatted||n.__("N/A")),1),Hi,Ui,l("span",Li,h(n.endDateFormatted||n.__("N/A")),1)])]),l("button",{class:"px-3 outline-none font-bold bg-error-tertiary",onClick:t[1]||(t[1]=f=>n.clearDate())},Vi)],2),d.rangeViewToggled?(i(),a("div",Bi,[l("div",Ii,[l("div",Ni,[T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"left",date:s.field.value.startDate,"selected-range":s.field.value,onSet:t[2]||(t[2]=f=>n.setDateRange("startDate",f))},null,8,["range","date","selected-range"]),zi,T(r,{class:"md:w-1/2 w-full",range:[n.startDateFormatted,n.endDateFormatted],side:"right",date:s.field.value.endDate,"selected-range":s.field.value,onSet:t[3]||(t[3]=f=>n.setDateRange("endDate",f))},null,8,["range","date","selected-range"])])])])):u("",!0),T(o,{field:s.field},null,8,["field"])])}const Wi=C(Ei,[["render",qi]]),Gi={name:"ns-dropzone",emits:["dropped"],mounted(){},setup(e,{emit:t}){return{dropZone:q(null),handleDrop:d=>{const n=d.dataTransfer.getData("text");t("dropped",n)}}}};function Ki(e,t,s,c,d,n){return i(),a("div",{ref:"dropZone",class:"ns-drop-zone mb-4",onDragover:t[0]||(t[0]=Se(()=>{},["prevent"]))},[v(e.$slots,"default",{},void 0,!0)],544)}const Qi=C(Gi,[["render",Ki],["__scopeId","data-v-0817a409"]]),Zi={emits:["drag-start","drag-end"],name:"ns-draggable",props:{widget:{required:!0}},setup(e,{emit:t}){const s=q(null),c=q(null);let d=null,n=0,r=0,o=0,f=0;const g=F=>{const P=F.srcElement.closest(".ns-draggable-item"),O=P.getBoundingClientRect();d=P.cloneNode(!0),d.setAttribute("class","ns-ghost"),d.style.display="none",d.style.position="fixed",d.style.top=`${O.top}px`,d.style.left=`${O.left}px`,d.style.width=`${O.width}px`,d.style.height=`${O.height}px`,P.closest(".ns-drop-zone").appendChild(d),n=F.clientX-o,r=F.clientY-f,c.value={dom:P},t("drag-start",e.widget)},b=F=>{if(c.value===null)return;const P=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost"),O=P.querySelector("div");Array.from(O.classList).filter(j=>j.startsWith("shadow")).forEach(j=>O.classList.remove(j)),o=F.clientX-n,f=F.clientY-r,O.style.boxShadow="0px 4px 10px 5px rgb(0 0 0 / 48%)",P.style.display="block",P.style.transform=`translate(${o}px, ${f}px)`,P.style.cursor="grabbing",document.querySelectorAll(".ns-drop-zone").forEach(j=>{j.getBoundingClientRect();const{left:I,top:N,right:k,bottom:ye}=j.getBoundingClientRect(),{clientX:Z,clientY:X}=F;Z>=I&&Z<=k&&X>=N&&X<=ye?j.setAttribute("hovered","true"):j.setAttribute("hovered","false")})},S=F=>{if(c.value===null)return;const O=c.value.dom.closest(".ns-drop-zone").querySelector(".ns-ghost");O&&O.remove(),c.value=null,o=0,f=0,F.srcElement.closest(".ns-drop-zone"),t("drag-end",e.widget)};return De(()=>{s.value&&(document.addEventListener("mousemove",F=>b(F)),document.addEventListener("mouseup",F=>S(F)))}),Ce(()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",S)}),{draggable:s,startDrag:g}}};function Xi(e,t,s,c,d,n){return i(),a("div",{ref:"draggable",class:"ns-draggable-item",onMousedown:t[0]||(t[0]=(...r)=>c.startDrag&&c.startDrag(...r))},[v(e.$slots,"default")],544)}const Ji=C(Zi,[["render",Xi]]),ea={name:"ns-dragzone",props:["raw-widgets","raw-columns"],components:{nsDropzone:Qi,nsDraggable:Ji},data(){return{widgets:[],theme:ns.theme,dragged:null,columns:[]}},mounted(){this.widgets=this.rawWidgets.map(e=>({name:e.name,"component-name":e["component-name"],"class-name":e["class-name"],component:te(window[e["component-name"]])})),this.columns=this.rawColumns.map(e=>(e.widgets.forEach(t=>{t.component=te(window[t.identifier]),t["class-name"]=t.class_name,t["component-name"]=t.identifier}),e)),setTimeout(()=>{var e=document.querySelectorAll(".widget-placeholder");document.addEventListener("mousemove",t=>{for(var s=0;s=c.left&&t.clientX<=c.right&&t.clientY>=c.top&&t.clientY<=c.bottom){e[s].setAttribute("hovered","true");break}else e[s].setAttribute("hovered","false")}})},10)},computed:{hasUnusedWidgets(){const e=this.columns.map(t=>t.widgets).flat();return this.widgets.filter(t=>!e.map(c=>c["component-name"]).includes(t["component-name"])).length>0}},methods:{__:_,handleEndDragging(e){const t=document.querySelector('.ns-drop-zone[hovered="true"]');if(t){const d=t.closest("[column-name]").getAttribute("column-name"),n=this.columns.filter(O=>O.name===d),r=n[0].widgets.filter(O=>O["component-name"]===t.querySelector(".ns-draggable-item").getAttribute("component-name")),o=document.querySelector(`[component-name="${e["component-name"]}"]`),g=o.closest("[column-name]").getAttribute("column-name"),b=this.columns.filter(O=>O.name===g),S=b[0].widgets.filter(O=>O["component-name"]===o.getAttribute("component-name"));if(S[0]["component-name"]===r[0]["component-name"])return;const F=S[0].position,P=r[0].position;S[0].column=d,S[0].position=P,r[0].column=g,r[0].position=F,n[0].widgets[P]=S[0],b[0].widgets[F]=r[0],this.handleChange(n[0]),this.handleChange(b[0]),t.setAttribute("hovered","false")}const s=document.querySelector('.widget-placeholder[hovered="true"]');if(s){const c=s.closest("[column-name]").getAttribute("column-name");if(e===c){console.log("The widget is already in the same column.");return}const d=this.columns.filter(o=>o.name===e.column)[0],n=d.widgets.indexOf(e);d.widgets.splice(n,1);const r=this.columns.filter(o=>o.name===c)[0];e.position=r.widgets.length,e.column=c,r.widgets.push(e),this.handleChange(d),this.handleChange(r)}},handleChange(e,t){setTimeout(()=>{nsHttpClient.post("/api/users/widgets",{column:e}).subscribe(s=>{},s=>$.error(s.message||_("An unpexpected error occured while using the widget.")).subscribe())},100)},handleRemoveWidget(e,t){const s=t.widgets.indexOf(e);t.widgets.splice(s,1),this.handleChange(t)},async openWidgetAdded(e){try{const t=this.columns.filter(r=>r.name!==e.name?(console.log(r.name),r.widgets.length>0):!1).map(r=>r.widgets).flat(),s=e.widgets.map(r=>r["component-name"]),c=this.widgets.filter(r=>{const o=t.map(f=>f["component-name"]);return o.push(...s),!o.includes(r["component-name"])}).map(r=>({value:r,label:r.name})),d=await new Promise((r,o)=>{const f=c.filter(g=>s.includes(g["component-name"]));Popup.show(Re,{value:f,resolve:r,reject:o,type:"multiselect",options:c,label:_("Choose Widget"),description:_("Select with widget you want to add to the column.")})}),n=this.columns.indexOf(e);this.columns[n].widgets=[...this.columns[n].widgets,...d].map((r,o)=>(r.position=o,r.column=e.name,r)),this.handleChange(this.columns[n])}catch(t){console.log(t)}}}},ta={class:"flex md:-mx-2 flex-wrap"},sa=["column-name"],na=["onClick"],la={class:"text-sm text-primary",type:"info"};function ia(e,t,s,c,d,n){const r=w("ns-draggable"),o=w("ns-dropzone");return i(),a("div",ta,[(i(!0),a(p,null,D(d.columns,(f,g)=>(i(),a("div",{class:"w-full md:px-2 md:w-1/2 lg:w-1/3 xl:1/4","column-name":f.name,key:f.name},[(i(!0),a(p,null,D(f.widgets,b=>(i(),E(o,null,{default:M(()=>[T(r,{"component-name":b["component-name"],onDragEnd:t[0]||(t[0]=S=>n.handleEndDragging(S)),widget:b},{default:M(()=>[(i(),E(G(b.component),{onOnRemove:S=>n.handleRemoveWidget(b,f),widget:b},null,40,["onOnRemove","widget"]))]),_:2},1032,["component-name","widget"])]),_:2},1024))),256)),n.hasUnusedWidgets?(i(),a("div",{key:0,onClick:b=>n.openWidgetAdded(f),class:"widget-placeholder cursor-pointer border-2 border-dashed h-16 flex items-center justify-center"},[l("span",la,h(n.__("Click here to add widgets")),1)],8,na)):u("",!0)],8,sa))),128))])}const aa=C(ea,[["render",ia],["__scopeId","data-v-8fa76ad4"]]),ra={emits:["blur","change","saved","keypress"],data:()=>({}),mounted(){},components:{nsDateRangePicker:ge,nsDateTimePicker:be,nsSwitch:ue},computed:{isInputField(){return["text","password","email","number","tel"].includes(this.field.type)},isHiddenField(){return["hidden"].includes(this.field.type)},isDateField(){return["date"].includes(this.field.type)},isSelectField(){return["select"].includes(this.field.type)},isSearchField(){return["search-select"].includes(this.field.type)},isTextarea(){return["textarea"].includes(this.field.type)},isCheckbox(){return["checkbox"].includes(this.field.type)},isMultiselect(){return["multiselect"].includes(this.field.type)},isInlineMultiselect(){return["inline-multiselect"].includes(this.field.type)},isSelectAudio(){return["select-audio"].includes(this.field.type)},isSwitch(){return["switch"].includes(this.field.type)},isMedia(){return["media"].includes(this.field.type)},isCkEditor(){return["ckeditor"].includes(this.field.type)},isDateTimePicker(){return["datetimepicker"].includes(this.field.type)},isDateRangePicker(){return["daterangepicker"].includes(this.field.type)},isCustom(){return["custom"].includes(this.field.type)}},props:["field"],methods:{handleSaved(e,t){this.$emit("saved",t)},addOption(e){this.field.type==="select"&&this.field.options.forEach(s=>s.selected=!1),e.selected=!0;const t=this.field.options.indexOf(e);this.field.options.splice(t,1),this.field.options.unshift(e),this.refreshMultiselect(),this.$emit("change",{action:"addOption",option:e})},changeTouchedState(e,t){t.stopPropagation&&t.stopPropagation(),e.touched=!0,this.$emit("change",e)},refreshMultiselect(){this.field.value=this.field.options.filter(e=>e.selected).map(e=>e.value)},removeOption(e){e.selected=!1,this.refreshMultiselect(),this.$emit("change",{action:"removeOption",option:e})}}},da=["name","value"],oa={key:1,class:"flex flex-auto mb-2"},ua=["innerHTML"],ca=["innerHTML"],ha=["innerHTML"],fa=["innerHTML"],ma=["innerHTML"],ga=["innerHTML"],ba=["innerHTML"],_a=["innerHTML"],pa=["innerHTML"],ya=["innerHTML"],va=["innerHTML"],ka=["innerHTML"],wa=["innerHTML"],xa=["innerHTML"];function Da(e,t,s,c,d,n){const r=w("ns-input"),o=w("ns-date-time-picker"),f=w("ns-date"),g=w("ns-media-input"),b=w("ns-select"),S=w("ns-search-select"),F=w("ns-daterange-picker"),P=w("ns-select-audio"),O=w("ns-textarea"),B=w("ns-checkbox"),Q=w("ns-inline-multiselect"),j=w("ns-multiselect"),I=w("ns-ckeditor"),N=w("ns-switch");return i(),a(p,null,[n.isHiddenField?(i(),a("input",{key:0,type:"hidden",name:s.field.name,value:s.field.value},null,8,da)):u("",!0),n.isHiddenField?u("",!0):(i(),a("div",oa,[n.isInputField?(i(),E(r,{key:0,onKeypress:t[0]||(t[0]=k=>n.changeTouchedState(s.field,k)),onChange:t[1]||(t[1]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ua)]),_:1},8,["field"])):u("",!0),n.isDateTimePicker?(i(),E(o,{key:1,onBlur:t[2]||(t[2]=k=>e.$emit("blur",s.field)),onChange:t[3]||(t[3]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ca)]),_:1},8,["field"])):u("",!0),n.isDateField?(i(),E(f,{key:2,onBlur:t[4]||(t[4]=k=>e.$emit("blur",s.field)),onChange:t[5]||(t[5]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ha)]),_:1},8,["field"])):u("",!0),n.isMedia?(i(),E(g,{key:3,onBlur:t[6]||(t[6]=k=>e.$emit("blur",s.field)),onChange:t[7]||(t[7]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,fa)]),_:1},8,["field"])):u("",!0),n.isSelectField?(i(),E(b,{key:4,onChange:t[8]||(t[8]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ma)]),_:1},8,["field"])):u("",!0),n.isSearchField?(i(),E(S,{key:5,field:s.field,onSaved:t[9]||(t[9]=k=>n.handleSaved(s.field,k)),onChange:t[10]||(t[10]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ga)]),_:1},8,["field"])):u("",!0),n.isDateRangePicker?(i(),E(F,{key:6,onBlur:t[11]||(t[11]=k=>e.$emit("blur",s.field)),onChange:t[12]||(t[12]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ba)]),_:1},8,["field"])):u("",!0),n.isSelectAudio?(i(),E(P,{key:7,onBlur:t[13]||(t[13]=k=>e.$emit("blur",s.field)),onChange:t[14]||(t[14]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,_a)]),_:1},8,["field"])):u("",!0),n.isTextarea?(i(),E(O,{key:8,onBlur:t[15]||(t[15]=k=>e.$emit("blur",s.field)),onChange:t[16]||(t[16]=k=>n.changeTouchedState(s.field,k)),field:s.field},{description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,pa)]),default:M(()=>[l("template",null,[y(h(s.field.label),1)])]),_:1},8,["field"])):u("",!0),n.isCheckbox?(i(),E(B,{key:9,onBlur:t[17]||(t[17]=k=>e.$emit("blur",s.field)),onChange:t[18]||(t[18]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ya)]),_:1},8,["field"])):u("",!0),n.isInlineMultiselect?(i(),E(Q,{key:10,onBlur:t[19]||(t[19]=k=>e.$emit("blur",s.field)),onUpdate:t[20]||(t[20]=k=>n.changeTouchedState(s.field,k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,va)]),_:1},8,["field"])):u("",!0),n.isMultiselect?(i(),E(j,{key:11,onAddOption:t[21]||(t[21]=k=>n.addOption(k)),onRemoveOption:t[22]||(t[22]=k=>n.removeOption(k)),field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,ka)]),_:1},8,["field"])):u("",!0),n.isCkEditor?(i(),E(I,{key:12,field:s.field},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,wa)]),_:1},8,["field"])):u("",!0),n.isSwitch?(i(),E(N,{key:13,field:s.field,onChange:t[23]||(t[23]=k=>n.changeTouchedState(s.field,k))},{default:M(()=>[y(h(s.field.label),1)]),description:M(()=>[l("span",{innerHTML:s.field.description||""},null,8,xa)]),_:1},8,["field"])):u("",!0),n.isCustom?(i(),E(Me,{key:14},[(i(),E(G(s.field.component),{field:s.field,onBlur:t[24]||(t[24]=k=>e.$emit("blur",s.field)),onChange:t[25]||(t[25]=k=>n.changeTouchedState(s.field,k))},null,40,["field"]))],1024)):u("",!0)]))],64)}const Ca=C(ra,[["render",Da]]),Ma={name:"ns-field-detail",props:["field"],methods:{__:_}},Ta={key:0,class:"text-xs ns-description"};function Sa(e,t,s,c,d,n){return i(),a(p,null,[!s.field.errors||s.field.errors.length===0?(i(),a("p",Ta,h(s.field.description),1)):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs ns-error"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y(h(n.__("This field is required.")),1)]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y(h(n.__("This field must contain a valid email address.")),1)]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0),r.identifier==="same"?v(e.$slots,r.identifier,{key:3},()=>[y(h(n.__('This field must be similar to "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0),r.identifier==="min"?v(e.$slots,r.identifier,{key:4},()=>[y(h(n.__('This field must have at least "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="max"?v(e.$slots,r.identifier,{key:5},()=>[y(h(n.__('This field must have at most "{length}" characters"').replace("{length}",r.rule.value)),1)]):u("",!0),r.identifier==="different"?v(e.$slots,r.identifier,{key:6},()=>[y(h(n.__('This field must be different from "{other}""').replace("{other}",r.fields.filter(f=>f.name===r.rule.value)[0].label)),1)]):u("",!0)]))),128))],64)}const $a=C(Ma,[["render",Sa]]),Ea={props:["className","buttonClass","type"]};function Ra(e,t,s,c,d,n){return i(),a("button",{class:m([s.type?s.type:s.buttonClass,"ns-inset-button rounded-full h-8 w-8 border items-center justify-center"])},[l("i",{class:m([s.className,"las"])},null,2)],2)}const Fa=C(Ea,[["render",Ra]]),Oa={name:"ns-input-label",props:["field"],data(){return{tags:[],searchField:"",focused:!1,optionsToKeyValue:{}}},methods:{addOption(e){let t;this.optionSuggestions.length===1&&e===void 0?t=this.optionSuggestions[0]:e!==void 0&&(t=e),t!==void 0&&(this.field.value.filter(c=>c===t.value).length>0||(this.searchField="",this.field.value.push(t.value),this.$emit("change",this.field)))},removeOption(e){const t=this.field.value.filter(s=>s!==e);this.field.value=t}},mounted(){if(this.$refs.searchField.addEventListener("focus",e=>{this.focused=!0}),this.$refs.searchField.addEventListener("blur",e=>{setTimeout(()=>{this.focused=!1},200)}),this.field.value.length===void 0)try{this.field.value=JSON.parse(this.field.value)}catch{this.field.value=[]}this.field.options.forEach(e=>{this.optionsToKeyValue[e.value]=e.label})},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},optionSuggestions(){if(typeof this.field.value.map=="function"){const e=this.field.value.map(t=>t.value);return this.field.options.filter(t=>!e.includes(t.value)&&this.focused>0&&(t.label.search(this.searchField)>-1||t.value.search(this.searchField)>-1))}return[]},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":""}},props:["placeholder","leading","type","field"]},Pa={class:"flex flex-col mb-2 flex-auto ns-input"},Aa=["for"],ja={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Ha={class:"leading sm:text-sm sm:leading-5"},Ua=["disabled","id","type","placeholder"],La={class:"rounded shadow bg-box-elevation-hover flex mr-1 mb-1"},Ya={class:"p-2 flex items-center text-primary"},Va={class:"flex items-center justify-center px-2"},Ba=["onClick"],Ia=l("i",{class:"las la-times-circle"},null,-1),Na=[Ia],za={class:"relative"},qa=["placeholder"],Wa={class:"h-0 absolute w-full z-10"},Ga={class:"shadow bg-box-background absoluve bottom-0 w-full max-h-80 overflow-y-auto"},Ka=["onClick"];function Qa(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Pa,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Aa)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",ja,[l("span",Ha,h(s.leading),1)])):u("",!0),l("div",{disabled:s.field.disabled,id:s.field.name,type:s.field.type,class:m([n.inputClass,"flex sm:text-sm sm:leading-5 p-1 flex-wrap"]),placeholder:s.field.placeholder||""},[(i(!0),a(p,null,D(s.field.value,o=>(i(),a("div",La,[l("div",Ya,h(d.optionsToKeyValue[o]),1),l("div",Va,[l("div",{onClick:f=>n.removeOption(o),class:"cursor-pointer rounded-full bg-error-tertiary h-5 w-5 flex items-center justify-center"},Na,8,Ba)])]))),256)),l("div",za,[R(l("input",{onChange:t[0]||(t[0]=o=>o.stopPropagation()),onKeydown:t[1]||(t[1]=Y(o=>n.addOption(),["enter"])),ref:"searchField","onUpdate:modelValue":t[2]||(t[2]=o=>d.searchField=o),type:"text",class:"w-auto p-2 border-b border-dashed bg-transparent",placeholder:s.field.placeholder||"Start searching here..."},null,40,qa),[[A,d.searchField]]),l("div",Wa,[l("div",Ga,[l("ul",null,[(i(!0),a(p,null,D(n.optionSuggestions,o=>(i(),a("li",{onClick:f=>n.addOption(o),class:"p-2 hover:bg-box-elevation-hover text-primary cursor-pointer"},h(o.label),9,Ka))),256))])])])])],10,Ua)],2),T(r,{field:s.field},null,8,["field"])])}const Za=C(Oa,[["render",Qa]]),Xa={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},props:["placeholder","leading","type","field"]},Ja={class:"flex flex-col mb-2 flex-auto ns-input"},er=["for"],tr={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},sr={class:"leading sm:text-sm sm:leading-5"},nr=["disabled","id","type","placeholder"];function lr(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Ja,[s.field.label&&s.field.label.length>0?(i(),a("label",{key:0,for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,er)):u("",!0),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.description||s.field.errors>0?"mb-2":""),"mt-1 relative overflow-hidden border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",tr,[l("span",sr,h(s.leading),1)])):u("",!0),R(l("input",{disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.field.placeholder||""},null,10,nr),[[oe,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ir=C(Xa,[["render",lr]]),ar={data:()=>({clicked:!1,_save:0}),props:["type","to","href","target"],computed:{buttonclass(){switch(this.type){case"info":return"shadow bg-blue-400 text-white";case"success":return"shadow bg-green-400 text-white";case"error":return"shadow bg-red-400 text-white";case"warning":return"shadow bg-orange-400 text-white";default:return"shadow bg-white text-gray-800"}}}},rr={class:"flex"},dr=["target","href"];function or(e,t,s,c,d,n){return i(),a("div",rr,[s.href?(i(),a("a",{key:0,target:s.target,href:s.href,class:m([n.buttonclass,"rounded cursor-pointer py-2 px-3 font-semibold"])},[v(e.$slots,"default")],10,dr)):u("",!0)])}const ur=C(ar,[["render",or]]),_e={zip:"la-file-archive",tar:"la-file-archive",bz:"la-file-archive","7z":"la-file-archive",css:"la-file-code",js:"la-file-code",json:"la-file-code",docx:"la-file-word",doc:"la-file-word",mp3:"la-file-audio",aac:"la-file-audio",ods:"la-file-audio",pdf:"la-file-pdf",csv:"la-file-csv",avi:"la-file-video",mpeg:"la-file-video",mpkg:"la-file-video",unknown:"la-file"},cr={name:"ns-media",props:["popup"],data(){return{searchFieldDebounce:null,searchField:"",pages:[{label:_("Upload"),name:"upload",selected:!1},{label:_("Gallery"),name:"gallery",selected:!0}],resources:[],isDragging:!1,response:{data:[],current_page:0,from:0,to:0,next_page_url:"",prev_page_url:"",path:"",per_page:0,total:0,last_page:0,first_page:0},fileIcons:_e,queryPage:1,bulkSelect:!1,files:[]}},mounted(){this.popupCloser();const e=this.pages.filter(t=>t.name==="gallery")[0];this.select(e)},watch:{searchField(){clearTimeout(this.searchFieldDebounce),this.searchFieldDebounce=setTimeout(()=>{this.loadGallery(1)},500)},files:{handler(){this.uploadFiles()},deep:!0}},computed:{postMedia(){return de.applyFilters("http-client-url","/api/medias")},currentPage(){return this.pages.filter(e=>e.selected)[0]},hasOneSelected(){return this.response.data.filter(e=>e.selected).length>0},selectedResource(){return this.response.data.filter(e=>e.selected)[0]},csrf(){return ns.authentication.csrf},isPopup(){return typeof this.popup<"u"},user_id(){return this.isPopup&&this.popup.params.user_id||0},panelOpened(){return!this.bulkSelect&&this.hasOneSelected},popupInstance(){return this.popup}},methods:{popupCloser:ae,__:_,cancelBulkSelect(){this.bulkSelect=!1,this.response.data.forEach(e=>e.selected=!1)},openError(e){L.show(se,{title:_("An error occured"),message:e.error.message||_("An unexpected error occured.")})},deleteSelected(){L.show(V,{title:_("Confirm Your Action"),message:_("You're about to delete selected resources. Would you like to proceed?"),onAction:e=>{e&&U.post("/api/medias/bulk-delete",{ids:this.response.data.filter(t=>t.selected).map(t=>t.id)}).subscribe({next:t=>{$.success(t.message).subscribe(),this.loadGallery()},error:t=>{$.error(t.message).subscribe()}})}})},loadUploadScreen(){setTimeout(()=>{this.setDropZone()},1e3)},setDropZone(){const e=document.getElementById("dropping-zone");e.addEventListener("dragenter",s=>this.preventDefaults(s),!1),e.addEventListener("dragleave",s=>this.preventDefaults(s),!1),e.addEventListener("dragover",s=>this.preventDefaults(s),!1),e.addEventListener("drop",s=>this.preventDefaults(s),!1),["dragenter","dragover"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!0})}),["dragleave","drop"].forEach(s=>{e.addEventListener(s,()=>{this.isDragging=!1})}),e.addEventListener("drop",s=>this.handleDrop(s),!1),this.$refs.files.addEventListener("change",s=>this.processFiles(s.currentTarget.files))},async uploadFiles(){const e=this.files.filter(t=>t.uploaded===!1&&t.progress===0&&t.failed===!1);for(let t=0;t{const r=new FormData;r.append("file",s.file),U.post("/api/medias",r,{headers:{"Content-Type":"multipart/form-data"}}).subscribe({next:o=>{s.uploaded=!0,s.progress=100,d(o)},error:o=>{e[t].failed=!0,e[t].error=o}})})}catch{s.failed=!0}}},handleDrop(e){this.processFiles(e.dataTransfer.files),e.preventDefault(),e.stopPropagation()},preventDefaults(e){e.preventDefault(),e.stopPropagation()},getAllParents(e){let t=[];for(;e.parentNode&&e.parentNode.nodeName.toLowerCase()!="body";)e=e.parentNode,t.push(e);return t},triggerManualUpload(e){const t=e.target;if(t!==null){const c=this.getAllParents(t).map(d=>{const n=d.getAttribute("class");if(n)return n.split(" ")});if(t.getAttribute("class")){const d=t.getAttribute("class").split(" ");c.push(d)}c.flat().includes("ns-scrollbar")||this.$refs.files.click()}},processFiles(e){Array.from(e).filter(c=>(console.log(this),Object.values(window.ns.medias.mimes).includes(c.type))).forEach(c=>{this.files.unshift({file:c,uploaded:!1,failed:!1,progress:0})})},select(e){this.pages.forEach(t=>t.selected=!1),e.selected=!0,e.name==="gallery"?this.loadGallery():e.name==="upload"&&this.loadUploadScreen()},loadGallery(e=null){e=e===null?this.queryPage:e,this.queryPage=e,U.get(`/api/medias?page=${e}&user_id=${this.user_id}${this.searchField.length>0?`&search=${this.searchField}`:""}`).subscribe(t=>{t.data.forEach(s=>s.selected=!1),this.response=t})},submitChange(e,t){U.put(`/api/medias/${t.id}`,{name:e.srcElement.textContent}).subscribe({next:s=>{t.fileEdit=!1,$.success(s.message,"OK").subscribe()},error:s=>{t.fileEdit=!1,$.success(s.message||_("An unexpected error occured."),"OK").subscribe()}})},useSelectedEntries(){this.popup.params.resolve({event:"use-selected",value:this.response.data.filter(e=>e.selected)}),this.popup.close()},selectResource(e){this.bulkSelect||this.response.data.forEach((t,s)=>{s!==this.response.data.indexOf(e)&&(t.selected=!1)}),e.fileEdit=!1,e.selected=!e.selected},isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)}}},hr={class:"sidebar w-48 md:h-full flex-shrink-0"},fr={class:"text-xl font-bold my-4 text-center"},mr={class:"sidebar-menus flex md:block mt-8"},gr=["onClick"],br={key:0,class:"content flex-auto w-full flex-col overflow-hidden flex"},_r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},pr=l("div",null,null,-1),yr={class:"cursor-pointer text-lg md:text-xl font-bold text-center text-primary mb-4"},vr={style:{display:"none"},type:"file",name:"",multiple:"",ref:"files",id:""},kr={class:"rounded bg-box-background shadow w-full md:w-2/3 text-primary h-56 overflow-y-auto ns-scrollbar p-2"},wr={key:0},xr={key:0,class:"rounded bg-info-primary flex items-center justify-center text-xs p-2"},Dr=["onClick"],Cr=l("i",{class:"las la-eye"},null,-1),Mr={class:"ml-2"},Tr={key:1,class:"h-full w-full items-center justify-center flex text-center text-soft-tertiary"},Sr={key:1,class:"content flex-auto flex-col w-full overflow-hidden flex"},$r={key:0,class:"p-2 flex bg-box-background flex-shrink-0 justify-between"},Er=l("div",null,null,-1),Rr={class:"flex flex-auto overflow-hidden"},Fr={class:"shadow ns-grid flex flex-auto flex-col overflow-y-auto ns-scrollbar"},Or={class:"p-2 border-b border-box-background"},Pr={class:"ns-input border-2 rounded border-input-edge bg-input-background flex"},Ar=["placeholder"],jr={key:0,class:"flex items-center justify-center w-20 p-1"},Hr={class:"flex flex-auto"},Ur={class:"p-2 overflow-x-auto"},Lr={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Yr={class:"p-2"},Vr=["onClick"],Br=["src","alt"],Ir={key:1,class:"object-cover h-full flex items-center justify-center"},Nr={key:0,class:"flex flex-auto items-center justify-center"},zr={class:"text-2xl font-bold"},qr={id:"preview",class:"ns-media-preview-panel hidden lg:block w-64 flex-shrink-0"},Wr={key:0,class:"h-64 bg-gray-800 flex items-center justify-center"},Gr=["src","alt"],Kr={key:1,class:"object-cover h-full flex items-center justify-center"},Qr={key:1,id:"details",class:"p-4 text-gray-700 text-sm"},Zr={class:"flex flex-col mb-2"},Xr={class:"font-bold block"},Jr=["contenteditable"],ed={class:"flex flex-col mb-2"},td={class:"font-bold block"},sd={class:"flex flex-col mb-2"},nd={class:"font-bold block"},ld={class:"py-2 pr-2 flex ns-media-footer flex-shrink-0 justify-between"},id={class:"flex -mx-2 flex-shrink-0"},ad={key:0,class:"px-2"},rd={class:"ns-button shadow rounded overflow-hidden info"},dd=l("i",{class:"las la-times"},null,-1),od={key:1,class:"px-2"},ud={class:"ns-button shadow rounded overflow-hidden info"},cd=l("i",{class:"las la-check-circle"},null,-1),hd={key:2,class:"px-2"},fd={class:"ns-button shadow rounded overflow-hidden warning"},md=l("i",{class:"las la-trash"},null,-1),gd={class:"flex-shrink-0 -mx-2 flex"},bd={class:"px-2"},_d={class:"rounded shadow overflow-hidden flex text-sm"},pd=["disabled"],yd=l("hr",{class:"border-r border-gray-700"},null,-1),vd=["disabled"],kd={key:0,class:"px-2"},wd={class:"ns-button info"};function xd(e,t,s,c,d,n){const r=w("ns-close-button");return i(),a("div",{class:m(["flex md:flex-row flex-col ns-box shadow-xl overflow-hidden",n.isPopup?"w-6/7-screen h-6/7-screen":"w-full h-full"]),id:"ns-media"},[l("div",hr,[l("h3",fr,h(n.__("Medias Manager")),1),l("ul",mr,[(i(!0),a(p,null,D(d.pages,(o,f)=>(i(),a("li",{onClick:g=>n.select(o),class:m(["py-2 px-3 cursor-pointer border-l-8",o.selected?"active":""]),key:f},h(o.label),11,gr))),128))])]),n.currentPage.name==="upload"?(i(),a("div",br,[n.isPopup?(i(),a("div",_r,[pr,l("div",null,[T(r,{onClick:t[0]||(t[0]=o=>n.popupInstance.close())})])])):u("",!0),l("div",{id:"dropping-zone",onClick:t[1]||(t[1]=o=>n.triggerManualUpload(o)),class:m([d.isDragging?"border-dashed border-2":"","flex flex-auto m-2 p-2 flex-col border-info-primary items-center justify-center"])},[l("h3",yr,h(n.__("Click Here Or Drop Your File To Upload")),1),l("input",vr,null,512),l("div",kr,[d.files.length>0?(i(),a("ul",wr,[(i(!0),a(p,null,D(d.files,(o,f)=>(i(),a("li",{class:m([o.failed===!1?"border-info-secondary":"border-error-secondary","p-2 mb-2 border-b-2 flex items-center justify-between"]),key:f},[l("span",null,h(o.file.name),1),o.failed===!1?(i(),a("span",xr,h(o.progress)+"%",1)):u("",!0),o.failed===!0?(i(),a("div",{key:1,onClick:g=>n.openError(o),class:"rounded bg-error-primary hover:bg-error-secondary hover:text-white flex items-center justify-center text-xs p-2 cursor-pointer"},[Cr,y(),l("span",Mr,h(n.__("See Error")),1)],8,Dr)):u("",!0)],2))),128))])):u("",!0),d.files.length===0?(i(),a("div",Tr,h(n.__("Your uploaded files will displays here.")),1)):u("",!0)])],2)])):u("",!0),n.currentPage.name==="gallery"?(i(),a("div",Sr,[n.isPopup?(i(),a("div",$r,[Er,l("div",null,[T(r,{onClick:t[2]||(t[2]=o=>n.popupInstance.close())})])])):u("",!0),l("div",Rr,[l("div",Fr,[l("div",Or,[l("div",Pr,[R(l("input",{id:"search",type:"text","onUpdate:modelValue":t[3]||(t[3]=o=>d.searchField=o),placeholder:n.__("Search Medias"),class:"px-4 block w-full sm:text-sm sm:leading-5 h-10"},null,8,Ar),[[A,d.searchField]]),d.searchField.length>0?(i(),a("div",jr,[l("button",{onClick:t[4]||(t[4]=o=>d.searchField=""),class:"h-full w-full rounded-tr rounded-br overflow-hidden"},h(n.__("Cancel")),1)])):u("",!0)])]),l("div",Hr,[l("div",Ur,[l("div",Lr,[(i(!0),a(p,null,D(d.response.data,(o,f)=>(i(),a("div",{key:f,class:""},[l("div",Yr,[l("div",{onClick:g=>n.selectResource(o),class:m([o.selected?"ns-media-image-selected ring-4":"","rounded-lg aspect-square bg-gray-500 m-2 overflow-hidden flex items-center justify-center"])},[n.isImage(o)?(i(),a("img",{key:0,class:"object-cover h-full",src:o.sizes.thumb,alt:o.name},null,8,Br)):u("",!0),n.isImage(o)?u("",!0):(i(),a("div",Ir,[l("i",{class:m([d.fileIcons[o.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))],10,Vr)])]))),128))])]),d.response.data.length===0?(i(),a("div",Nr,[l("h3",zr,h(n.__("Nothing has already been uploaded")),1)])):u("",!0)])]),l("div",qr,[n.panelOpened?(i(),a("div",Wr,[n.isImage(n.selectedResource)?(i(),a("img",{key:0,class:"object-cover h-full",src:n.selectedResource.sizes.thumb,alt:n.selectedResource.name},null,8,Gr)):u("",!0),n.isImage(n.selectedResource)?u("",!0):(i(),a("div",Kr,[l("i",{class:m([d.fileIcons[n.selectedResource.extension]||d.fileIcons.unknown,"las text-8xl text-white"])},null,2)]))])):u("",!0),n.panelOpened?(i(),a("div",Qr,[l("p",Zr,[l("strong",Xr,h(n.__("File Name"))+": ",1),l("span",{class:m(["p-2",n.selectedResource.fileEdit?"border-b border-input-edge bg-input-background":""]),onBlur:t[5]||(t[5]=o=>n.submitChange(o,n.selectedResource)),contenteditable:n.selectedResource.fileEdit?"true":"false",onClick:t[6]||(t[6]=o=>n.selectedResource.fileEdit=!0)},h(n.selectedResource.name),43,Jr)]),l("p",ed,[l("strong",td,h(n.__("Uploaded At"))+":",1),l("span",null,h(n.selectedResource.created_at),1)]),l("p",sd,[l("strong",nd,h(n.__("By"))+" :",1),l("span",null,h(n.selectedResource.user.username),1)])])):u("",!0)])]),l("div",ld,[l("div",id,[d.bulkSelect?(i(),a("div",ad,[l("div",rd,[l("button",{onClick:t[7]||(t[7]=o=>n.cancelBulkSelect()),class:"py-2 px-3"},[dd,y(" "+h(n.__("Cancel")),1)])])])):u("",!0),n.hasOneSelected&&!d.bulkSelect?(i(),a("div",od,[l("div",ud,[l("button",{onClick:t[8]||(t[8]=o=>d.bulkSelect=!0),class:"py-2 px-3"},[cd,y(" "+h(n.__("Bulk Select")),1)])])])):u("",!0),n.hasOneSelected?(i(),a("div",hd,[l("div",fd,[l("button",{onClick:t[9]||(t[9]=o=>n.deleteSelected()),class:"py-2 px-3"},[md,y(" "+h(n.__("Delete")),1)])])])):u("",!0)]),l("div",gd,[l("div",bd,[l("div",_d,[l("div",{class:m(["ns-button",d.response.current_page===1?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===1,onClick:t[10]||(t[10]=o=>n.loadGallery(d.response.current_page-1)),class:"p-2"},h(n.__("Previous")),9,pd)],2),yd,l("div",{class:m(["ns-button",d.response.current_page===d.response.last_page?"disabled cursor-not-allowed":"info"])},[l("button",{disabled:d.response.current_page===d.response.last_page,onClick:t[11]||(t[11]=o=>n.loadGallery(d.response.current_page+1)),class:"p-2"},h(n.__("Next")),9,vd)],2)])]),n.isPopup&&n.hasOneSelected?(i(),a("div",kd,[l("div",wd,[l("button",{class:"rounded shadow p-2 text-sm",onClick:t[12]||(t[12]=o=>n.useSelectedEntries())},h(n.__("Use Selected")),1)])])):u("",!0)])])])):u("",!0)],2)}const pe=C(cr,[["render",xd]]),vc=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"})),Dd={computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":"ns-enabled"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},data(){return{fileIcons:_e}},props:["placeholder","leading","type","field"],mounted(){},methods:{isImage(e){return Object.keys(ns.medias.imageMimes).includes(e.extension)},toggleMedia(){new Promise((t,s)=>{L.show(pe,{resolve:t,reject:s,...this.field.data||{}})}).then(t=>{t.event==="use-selected"&&(!this.field.data||this.field.data.type==="url"?this.field.value=t.value[0].sizes.original:!this.field.data||this.field.data.type==="model"?(this.field.value=t.value[0].id,this.field.data.model=t.value[0]):this.field.value=t.value[0].sizes.original,this.$forceUpdate())})}}},Cd={class:"flex flex-col mb-2 flex-auto ns-media"},Md=["for"],Td={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},Sd={class:"text-primary sm:text-sm sm:leading-5"},$d={class:"rounded overflow-hidden flex"},Ed={key:0,class:"form-input flex w-full sm:text-sm items-center sm:leading-5 h-10"},Rd=["src","alt"],Fd={key:1,class:"object-cover flex items-center justify-center"},Od={class:"text-xs text-secondary"},Pd=["disabled","id","type","placeholder"],Ad=l("i",{class:"las la-photo-video"},null,-1),jd=[Ad];function Hd(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Cd,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Md),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 rounded-md focus:shadow-sm"])},[s.leading?(i(),a("div",Td,[l("span",Sd,h(s.leading),1)])):u("",!0),l("div",$d,[s.field.data&&s.field.data.type==="model"?(i(),a("div",Ed,[s.field.value&&s.field.data.model.name?(i(),a(p,{key:0},[n.isImage(s.field.data.model)?(i(),a("img",{key:0,class:"w-8 h-8 m-1",src:s.field.data.model.sizes.thumb,alt:s.field.data.model.name},null,8,Rd)):u("",!0),n.isImage(s.field.data.model)?u("",!0):(i(),a("div",Fd,[l("i",{class:m([d.fileIcons[s.field.data.model.extension]||d.fileIcons.unknown,"las text-3xl"])},null,2)])),l("span",Od,h(s.field.data.model.name),1)],64)):u("",!0)])):u("",!0),!s.field.data||s.field.data.type==="undefined"||s.field.data.type==="url"?R((i(),a("input",{key:1,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),disabled:s.field.disabled,onBlur:t[1]||(t[1]=o=>e.$emit("blur",this)),onChange:t[2]||(t[2]=o=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5 h-10"]),placeholder:s.placeholder},null,42,Pd)),[[oe,s.field.value]]):u("",!0),l("button",{onClick:t[3]||(t[3]=o=>n.toggleMedia(s.field)),class:"w-10 h-10 flex items-center justify-center border-l-2 outline-none"},jd)])],2),T(r,{field:s.field},null,8,["field"])])}const Ud=C(Dd,[["render",Hd]]),Ld={data:()=>({defaultToggledState:!1,_save:0,hasChildren:!1}),props:["href","to","label","icon","notification","toggled","identifier"],mounted(){this.hasChildren=this.$el.querySelectorAll(".submenu").length>0,this.defaultToggledState=this.toggled!==void 0?this.toggled:this.defaultToggledState,W.subject().subscribe(e=>{e.value!==this.identifier&&(this.defaultToggledState=!1)})},methods:{toggleEmit(){this.toggle().then(e=>{e&&W.emit({identifier:"side-menu.open",value:this.identifier})})},goTo(e,t){return this.$router.push(e),t.preventDefault(),!1},toggle(){return new Promise((e,t)=>{(!this.href||this.href.length===0)&&(this.defaultToggledState=!this.defaultToggledState,e(this.defaultToggledState))})}}},Yd=["href"],Vd={class:"flex items-center"},Bd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"},Id=["href"],Nd={class:"flex items-center"},zd={key:0,class:"rounded-full notification-label font-bold w-6 h-6 text-xs justify-center items-center flex"};function qd(e,t,s,c,d,n){var r,o;return i(),a("div",null,[s.to&&!e.hasChildren?(i(),a("a",{key:0,onClick:t[0]||(t[0]=f=>n.goTo(s.to,f)),href:s.to,class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Vd,[l("i",{class:m(["las text-lg mr-2",((r=s.icon)==null?void 0:r.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",Bd,h(s.notification),1)):u("",!0)],10,Yd)):(i(),a("a",{key:1,onClick:t[1]||(t[1]=f=>n.toggleEmit()),href:s.href||"javascript:void(0)",class:m([e.defaultToggledState?"toggled":"normal","flex justify-between py-2 border-l-8 px-3 font-bold ns-aside-menu"])},[l("span",Nd,[l("i",{class:m(["las text-lg mr-2",((o=s.icon)==null?void 0:o.length)>0?s.icon:"la-star"])},null,2),y(" "+h(s.label),1)]),s.notification>0?(i(),a("span",zd,h(s.notification),1)):u("",!0)],10,Id)),l("ul",{class:m([e.defaultToggledState?"":"hidden","submenu-wrapper"])},[v(e.$slots,"default")],2)])}const Wd=C(Ld,[["render",qd]]),Gd={data(){return{showPanel:!1,search:"",eventListener:null}},emits:["change","blur"],props:["field"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},_filtredOptions(){let e=this._options;return this.search.length>0&&(e=this._options.filter(t=>t.label.toLowerCase().search(this.search.toLowerCase())!==-1)),e.filter(t=>t.selected===!1)},_options(){return this.field.options.map(e=>(e.selected=e.selected===void 0?!1:e.selected,this.field.value&&this.field.value.includes(e.value)&&(e.selected=!0),e))}},methods:{__:_,togglePanel(){this.field.disabled||(this.showPanel=!this.showPanel)},selectAvailableOptionIfPossible(){this._filtredOptions.length>0&&this.addOption(this._filtredOptions[0])},addOption(e){this.field.disabled||(this.$emit("addOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100))},removeOption(e,t){if(!this.field.disabled)return t.preventDefault(),t.stopPropagation(),this.$emit("removeOption",e),this.$forceUpdate(),setTimeout(()=>{this.search=""},100),!1}},mounted(){this.field.value&&this.field.value.reverse().forEach(t=>{const s=this.field.options.filter(c=>c.value===t);s.length>0&&this.addOption(s[0])}),this.eventListener=document.addEventListener("click",e=>{let s=e.target.parentElement,c=!1;if(this.showPanel){for(;s;){if(s&&s.classList.contains("ns-multiselect")&&!s.classList.contains("arrows")){c=!0;break}s=s.parentElement}c===!1&&this.togglePanel()}})}},Kd={class:"flex flex-col ns-multiselect"},Qd=["for"],Zd={class:"flex flex-col"},Xd={class:"flex -mx-1 -my-1 flex-wrap"},Jd={class:"rounded bg-info-secondary text-white flex justify-between p-1 items-center"},eo={class:"pr-8"},to=["onClick"],so=l("i",{class:"las la-times"},null,-1),no=[so],lo={class:"arrows ml-1"},io={class:"ns-dropdown shadow"},ao={class:"search border-b border-input-option-hover"},ro={class:"h-40 overflow-y-auto"},oo=["onClick"],uo={key:0,class:"las la-check"},co={key:0,class:"p-2 text-center text-primary"},ho={class:"my-2"};function fo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Kd,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-secondary":"text-primary","block mb-1 leading-5 font-medium"])},[v(e.$slots,"default")],10,Qd),l("div",Zd,[l("div",{onClick:t[0]||(t[0]=o=>n.togglePanel()),class:m([s.field.disabled?"bg-input-disabled":"","overflow-y-auto flex select-preview justify-between rounded border-2 border-input-option-hover p-2 items-start"]),style:{"max-height":"150px"}},[l("div",Xd,[(i(!0),a(p,null,D(n._options.filter(o=>o.selected),(o,f)=>(i(),a("div",{key:f,class:"px-1 my-1"},[l("div",Jd,[l("span",eo,h(o.label),1),l("button",{onClick:g=>n.removeOption(o,g),class:"rounded outline-none hover:bg-info-tertiary h-6 w-6 flex items-center justify-center"},no,8,to)])]))),128))]),l("div",lo,[l("i",{class:m(["las la-angle-down",d.showPanel?"hidden":""])},null,2),l("i",{class:m(["las la-angle-up",d.showPanel?"":"hidden"])},null,2)])],2),d.showPanel?(i(),a("div",{key:0,class:m(["h-0 z-10",d.showPanel?"shadow":""])},[l("div",io,[l("div",ao,[R(l("input",{onKeypress:t[1]||(t[1]=Y(o=>n.selectAvailableOptionIfPossible(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=o=>d.search=o),class:"p-2 w-full bg-transparent text-primary outline-none",placeholder:"Search"},null,544),[[A,d.search]])]),l("div",ro,[(i(!0),a(p,null,D(n._filtredOptions,(o,f)=>(i(),a("div",{onClick:g=>n.addOption(o),key:f,class:m([o.selected?"bg-info-secondary text-white":"text-primary","option p-2 flex justify-between cursor-pointer hover:bg-info-tertiary hover:text-white"])},[l("span",null,h(o.label),1),l("span",null,[o.checked?(i(),a("i",uo)):u("",!0)])],10,oo))),128))]),n._options.length===0?(i(),a("div",co,h(n.__("Nothing to display")),1)):u("",!0)])],2)):u("",!0)]),l("div",ho,[T(r,{field:s.field},null,8,["field"])])])}const mo=C(Gd,[["render",fo]]),go={},bo={class:"my-4"},_o={class:"font-bold text-2xl"},po={class:"text-primary"};function yo(e,t){return i(),a("div",bo,[l("h2",_o,[v(e.$slots,"title")]),l("span",po,[v(e.$slots,"description")])])}const vo=C(go,[["render",yo]]),ko={name:"ns-search",props:["url","placeholder","value","label","method","searchArgument"],data(){return{searchText:"",searchTimeout:null,results:[]}},methods:{__:_,selectOption(e){this.$emit("select",e),this.searchText="",this.results=[]},renderLabel(e,t){return typeof t=="object"?t.map(s=>e[s]).join(" "):e[t]}},watch:{searchText(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText.length>0&&U[this.method||"post"](this.url,{[this.searchArgument||"search"]:this.searchText}).subscribe({next:e=>{this.results=e},error:e=>{$.error(e.message||_("An unexpected error occurred.")).subscribe()}})},1e3)}},mounted(){}},wo={class:"ns-search"},xo={class:"input-group info border-2"},Do=["placeholder"],Co={class:"relative"},Mo={class:"w-full absolute shadow-lg"},To={key:0,class:"ns-vertical-menu"},So=["onClick"];function $o(e,t,s,c,d,n){return i(),a("div",wo,[l("div",xo,[R(l("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=r=>d.searchText=r),class:"p-2 w-full outline-none",placeholder:s.placeholder||n.__("Search..."),id:""},null,8,Do),[[A,d.searchText]])]),l("div",Co,[l("div",Mo,[d.results.length>0&&d.searchText.length>0?(i(),a("ul",To,[(i(!0),a(p,null,D(d.results,(r,o)=>(i(),a("li",{class:"border-b p-2 cursor-pointer",onClick:f=>n.selectOption(r),key:o},h(n.renderLabel(r,s.label)),9,So))),128))])):u("",!0)])])])}const Eo=C(ko,[["render",$o]]),Ro={data:()=>({searchField:"",showResults:!1}),name:"ns-search-select",emits:["saved","change"],props:["name","placeholder","field","leading"],computed:{selectedOptionLabel(){if(this.field.value===null||this.field.value===void 0)return _("Choose...");const e=this.field.options.filter(t=>t.value===this.field.value);return e.length>0?e[0].label:_("Choose...")},filtredOptions(){return this.searchField.length>0?this.field.options.filter(e=>new RegExp(this.searchField,"i").test(e.label)).splice(0,10):this.field.options},hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},watch:{showResults(){this.showResults===!0&&setTimeout(()=>{this.$refs.searchInputField.select()},50)}},mounted(){const e=this.field.options.filter(t=>t.value===this.field.value);e.length>0&&[null,void 0].includes(this.field.value)&&this.selectOption(e[0]),document.addEventListener("click",t=>{this.$el.contains(t.target)===!1&&(this.showResults=!1)})},methods:{__:_,selectFirstOption(){this.filtredOptions.length>0&&this.selectOption(this.filtredOptions[0])},selectOption(e){this.field.value=e.value,this.$emit("change",e.value),this.searchField="",this.showResults=!1},async triggerDynamicComponent(e){try{this.showResults=!1;const t=nsExtraComponents[e.component]||nsComponents[e.component];t===void 0&&$.error(_(`The component ${e.component} cannot be loaded. Make sure it's injected on nsExtraComponents object.`)).subscribe();const s=await new Promise((c,d)=>{const n=L.show(t,{...e.props||{},field:this.field,resolve:c,reject:d})});this.$emit("saved",s)}catch{}}}},Fo={class:"flex flex-col flex-auto ns-select"},Oo=["for"],Po={class:"text-primary text-sm"},Ao=l("i",{class:"las la-plus"},null,-1),jo=[Ao],Ho={key:0,class:"relative"},Uo={class:"w-full overflow-hidden -top-[8px] border-r-2 border-l-2 border-t rounded-b-md border-b-2 border-input-edge bg-input-background shadow z-10 absolute"},Lo={class:"border-b border-input-edge border-dashed p-2"},Yo=["placeholder"],Vo={class:"h-60 overflow-y-auto"},Bo=["onClick"];function Io(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",Fo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Oo),l("div",{class:m([(n.hasError?"has-error":"is-pristine")+" "+(s.field.disabled?"cursor-not-allowed":"cursor-default"),"border-2 mt-1 relative rounded-md shadow-sm mb-1 flex overflow-hidden"])},[l("div",{onClick:t[0]||(t[0]=o=>!s.field.disabled&&(e.showResults=!e.showResults)),class:m([s.field.disabled?"bg-input-disabled":"bg-input-background","flex-auto h-10 sm:leading-5 py-2 px-4 flex items-center"])},[l("span",Po,h(n.selectedOptionLabel),1)],2),s.field.component&&!s.field.disabled?(i(),a("div",{key:0,onClick:t[1]||(t[1]=o=>n.triggerDynamicComponent(s.field)),class:"flex items-center justify-center w-10 hover:cursor-pointer hover:bg-input-button-hover border-l-2 border-input-edge"},jo)):u("",!0)],2),e.showResults?(i(),a("div",Ho,[l("div",Uo,[l("div",Lo,[R(l("input",{onKeypress:t[2]||(t[2]=Y(o=>n.selectFirstOption(),["enter"])),ref:"searchInputField","onUpdate:modelValue":t[3]||(t[3]=o=>e.searchField=o),type:"text",placeholder:n.__("Search result")},null,40,Yo),[[A,e.searchField]])]),l("div",Vo,[l("ul",null,[(i(!0),a(p,null,D(n.filtredOptions,o=>(i(),a("li",{onClick:f=>n.selectOption(o),class:"py-1 px-2 hover:bg-info-primary cursor-pointer text-primary"},h(o.label),9,Bo))),256))])])])])):u("",!0),T(r,{field:s.field},null,8,["field"])])}const No=C(Ro,[["render",Io]]),zo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},mounted(){},methods:{__:_}},qo={class:"flex flex-col flex-auto ns-select"},Wo=["for"],Go=["disabled","name"],Ko={value:null},Qo=["value"];function Zo(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",qo,[l("label",{for:s.field.name,class:m([n.hasError?"has-error":"is-pristine","block leading-5 font-medium"])},[v(e.$slots,"default")],10,Wo),l("div",{class:m([n.hasError?"has-error":"is-pristine","border-2 mt-1 relative rounded-md shadow-sm mb-1 overflow-hidden"])},[R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,name:s.field.name,"onUpdate:modelValue":t[0]||(t[0]=o=>s.field.value=o),class:m([n.inputClass,"form-input block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 appearance-none"])},[l("option",Ko,h(n.__("Choose an option")),1),(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,Qo))),128))],10,Go),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const Xo=C(zo,[["render",Zo]]),Jo={data:()=>({}),props:["name","placeholder","field","leading"],computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"bg-gray-200 cursor-not-allowed":"bg-transparent"},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"pl-8":"px-4"}},methods:{__:_,playSelectedSound(){this.field.value!==null&&this.field.value.length>0&&new Audio(this.field.value).play()}}},eu={class:"flex flex-col flex-auto"},tu=["for"],su=l("button",{class:"w-10 flex item-center justify-center"},[l("i",{class:"las la-play text-2xl"})],-1),nu=[su],lu=["disabled","name"],iu=["value"];function au(e,t,s,c,d,n){const r=w("ns-field-description");return i(),a("div",eu,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},[v(e.$slots,"default")],10,tu),l("div",{class:m([n.hasError?"border-error-primary":"border-input-edge","border-2 mt-1 flex relative overflow-hidden rounded-md shadow-sm mb-1 form-input"])},[l("div",{onClick:t[0]||(t[0]=o=>n.playSelectedSound()),class:"border-r-2 border-input-edge flex-auto flex items-center justify-center hover:bg-info-tertiary hover:text-white"},nu),R(l("select",{disabled:s.field.disabled?s.field.disabled:!1,onChange:t[1]||(t[1]=o=>e.$emit("change",o)),name:s.field.name,"onUpdate:modelValue":t[2]||(t[2]=o=>s.field.value=o),class:m([n.inputClass,"text-primary block w-full pl-7 pr-12 sm:text-sm sm:leading-5 h-10 outline-none"])},[(i(!0),a(p,null,D(s.field.options,(o,f)=>(i(),a("option",{key:f,value:o.value,class:"py-2"},h(o.label),9,iu))),128))],42,lu),[[H,s.field.value]])],2),T(r,{field:s.field},null,8,["field"])])}const ru=C(Jo,[["render",au]]),du={data:()=>({}),mounted(){},computed:{validatedSize(){return this.size||24},validatedBorder(){return this.border||8},validatedAnimation(){return this.animation||"fast"}},props:["color","size","border","animation"]},ou={class:"flex items-center justify-center"};function uu(e,t,s,c,d,n){return i(),a("div",ou,[l("div",{class:m(["loader ease-linear rounded-full border-gray-200",n.validatedAnimation+" border-4 border-t-4 w-"+n.validatedSize+" h-"+n.validatedSize])},null,2)])}const cu=C(du,[["render",uu]]),hu={data:()=>({}),props:["href","label","active","to"],mounted(){},methods:{goTo(e,t){return this.$router.push(e),t.preventDefault(),!1}}},fu={class:"submenu"},mu=["href"],gu=["href"];function bu(e,t,s,c,d,n){return i(),a("div",null,[l("li",fu,[s.href?(i(),a("a",{key:0,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),href:s.href},[v(e.$slots,"default")],10,mu)):s.to?(i(),a("a",{key:1,class:m([s.active?"font-bold active":"normal","py-2 border-l-8 px-3 block ns-aside-submenu"]),onClick:t[0]||(t[0]=r=>n.goTo(s.to,r)),href:s.to},[v(e.$slots,"default")],10,gu)):u("",!0)])])}const _u=C(hu,[["render",bu]]),pu={props:["options","row","columns","prependOptions","showOptions","showCheckboxes"],data:()=>({optionsToggled:!1}),mounted(){},methods:{__:_,sanitizeHTML(e){var t=document.createElement("div");t.innerHTML=e;for(var s=t.getElementsByTagName("script"),c=s.length;c--;)s[c].parentNode.removeChild(s[c]);return t.innerHTML},getElementOffset(e){const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}},toggleMenu(e){if(this.row.$toggled=!this.row.$toggled,this.$emit("toggled",this.row),this.row.$toggled)setTimeout(()=>{const t=this.$el.querySelectorAll(".relative > .absolute")[0],s=this.$el.querySelectorAll(".relative")[0],c=this.getElementOffset(s);t.style.top=c.top+"px",t.style.left=c.left+"px",s!==void 0&&(s.classList.remove("relative"),s.classList.add("dropdown-holder"))},100);else{const t=this.$el.querySelectorAll(".dropdown-holder")[0];t.classList.remove("dropdown-holder"),t.classList.add("relative")}},handleChanged(e){this.row.$checked=e,this.$emit("updated",this.row)},triggerAsync(e){e.confirm!==null?Popup.show(V,{title:e.confirm.title||_("Confirm Your Action"),message:e.confirm.message||_("Would you like to delete this entry?"),onAction:t=>{t&&U[e.type.toLowerCase()](e.url).subscribe(s=>{$.success(s.message).subscribe(),this.$emit("reload",this.row)},s=>{this.toggleMenu(),$.error(s.message).subscribe()})}}):(W.emit({identifier:"ns-table-row-action",value:{action:e,row:this.row,component:this}}),this.toggleMenu())},triggerPopup(e,t){const s=window.nsExtraComponents[e.component];if(e.component)return s?new Promise((c,d)=>{Popup.show(s,{resolve:c,reject:d,row:t,action:e})}):$.error(_(`Unable to load the component "${e.component}". Make sure the component is registered to "nsExtraComponents".`)).subscribe();this.triggerAsync(e)}}},yu={key:0,class:"font-sans p-2"},vu={key:1,class:"font-sans p-2"},ku={class:""},wu=l("i",{class:"las la-ellipsis-h"},null,-1),xu={class:"relative"},Du={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Cu={class:"rounded-md shadow-xs"},Mu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Tu=["href","target","innerHTML"],Su=["onClick","innerHTML"],$u=["href","innerHTML"],Eu=["innerHTML"],Ru={class:"flex md:-mx-1 md:flex-wrap flex-col md:flex-row text-xs"},Fu={class:"md:px-1 w-full md:w-1/2 lg:w-2/4"},Ou=["innerHTML"],Pu={key:2},Au={key:2,class:"font-sans p-2 flex flex-col items-center justify-center"},ju={class:""},Hu=l("i",{class:"las la-ellipsis-h"},null,-1),Uu={class:"relative"},Lu={key:0,class:"zoom-in-entrance border border-box-edge anim-duration-300 z-50 origin-bottom-right -ml-28 w-56 mt-2 absolute rounded-md shadow-lg ns-menu-wrapper"},Yu={class:"rounded-md shadow-xs"},Vu={class:"py-1",role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu"},Bu=["href","target","innerHTML"],Iu=["onClick","innerHTML"];function Nu(e,t,s,c,d,n){const r=w("ns-checkbox");return i(),a("tr",{class:m(["ns-table-row border text-sm",s.row.$cssClass?s.row.$cssClass:""])},[s.showCheckboxes?(i(),a("td",yu,[T(r,{onChange:t[0]||(t[0]=o=>n.handleChanged(o)),checked:s.row.$checked},null,8,["checked"])])):u("",!0),s.prependOptions&&s.showOptions?(i(),a("td",vu,[l("div",ku,[l("button",{onClick:t[1]||(t[1]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[wu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[2]||(t[2]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",xu,[s.row.$toggled?(i(),a("div",Du,[l("div",Cu,[l("div",Mu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_self":"_blank",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Tu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Su)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0),(i(!0),a(p,null,D(s.columns,(o,f)=>(i(),a("td",{key:f,class:"font-sans p-2"},[s.row[f]&&s.row[f].type&&s.row[f].type==="link"?(i(),a("a",{key:0,target:"_blank",href:s.row[f].href,innerHTML:n.sanitizeHTML(s.row[f].label)},null,8,$u)):u("",!0),typeof s.row[f]=="string"||typeof s.row[f]=="number"?(i(),a(p,{key:1},[o.attributes&&o.attributes.length>0?(i(),a(p,{key:0},[l("h3",{class:"fond-bold text-lg",innerHTML:n.sanitizeHTML(s.row[f])},null,8,Eu),l("div",Ru,[(i(!0),a(p,null,D(o.attributes,g=>(i(),a("div",Fu,[l("strong",null,h(g.label),1),y(": "+h(s.row[g.column]),1)]))),256))])],64)):(i(),a("div",{key:1,innerHTML:n.sanitizeHTML(s.row[f])},null,8,Ou))],64)):u("",!0),s.row[f]===null?(i(),a("div",Pu,h(n.__("Undefined")),1)):u("",!0)]))),128)),!s.prependOptions&&s.showOptions?(i(),a("td",Au,[l("div",ju,[l("button",{onClick:t[3]||(t[3]=o=>n.toggleMenu(o)),class:m([s.row.$toggled?"active":"","ns-inset-button outline-none rounded-full w-24 text-sm p-1 border"])},[Hu,y(" "+h(n.__("Options")),1)],2),s.row.$toggled?(i(),a("div",{key:0,onClick:t[4]||(t[4]=o=>n.toggleMenu(o)),class:"absolute w-full h-full z-10 top-0 left-0"})):u("",!0),l("div",Uu,[s.row.$toggled?(i(),a("div",Lu,[l("div",Yu,[l("div",Vu,[(i(!0),a(p,null,D(s.row.$actions,(o,f)=>(i(),a(p,{key:f},[["GOTO","TAB"].includes(o.type)?(i(),a("a",{key:0,href:o.url,target:o.type==="TAB"?"_self":"_blank",class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Bu)):u("",!0),["GET","DELETE","POPUP"].includes(o.type)?(i(),a("a",{key:1,href:"javascript:void(0)",onClick:g=>n.triggerAsync(o),class:"ns-action-button block px-4 py-2 text-sm leading-5",role:"menuitem",innerHTML:n.sanitizeHTML(o.label)},null,8,Iu)):u("",!0)],64))),128))])])])):u("",!0)])])])):u("",!0)],2)}const zu=C(pu,[["render",Nu]]),qu={data(){return{childrens:[],tabState:new $e}},props:["active"],computed:{activeComponent(){const e=this.childrens.filter(t=>t.active);return e.length>0?e[0]:!1}},beforeUnmount(){this.tabState.unsubscribe()},watch:{active(e,t){this.childrens.forEach(s=>{s.active=s.identifier===e,s.active&&this.toggle(s)})}},mounted(){this.buildChildrens(this.active)},methods:{__:_,toggle(e){this.$emit("active",e.identifier),this.$emit("changeTab",e.identifier),this.tabState.next(e)},buildChildrens(e){this.childrens=Array.from(this.$el.querySelectorAll(".ns-tab-item")).map(s=>{const c=s.getAttribute("identifier")||void 0;let d=!0;return s.getAttribute("visible")&&(d=s.getAttribute("visible")==="true"),{el:s,active:!!(e&&e===c),identifier:c,initialized:!1,visible:d,label:s.getAttribute("label")||_("Unamed Tab")}}).filter(s=>s.visible),!(this.childrens.filter(s=>s.active).length>0)&&this.childrens.length>0&&(this.childrens[0].active=!0),this.childrens.forEach(s=>{s.active&&this.toggle(s)})}}},Wu=["selected-tab"],Gu={class:"header ml-4 flex justify-between",style:{"margin-bottom":"-1px"}},Ku={class:"flex flex-auto"},Qu=["onClick"];function Zu(e,t,s,c,d,n){return i(),a("div",{class:"tabs flex flex-col flex-auto ns-tab overflow-hidden","selected-tab":n.activeComponent.identifier},[l("div",Gu,[l("div",Ku,[(i(!0),a(p,null,D(d.childrens,(r,o)=>(i(),a("div",{key:r.identifier,onClick:f=>n.toggle(r),class:m([s.active===r.identifier?"border-b-0 active z-10":"border inactive","tab rounded-tl rounded-tr border px-3 py-2 cursor-pointer"]),style:{"margin-right":"-1px"}},h(r.label),11,Qu))),128))]),l("div",null,[v(e.$slots,"extra")])]),v(e.$slots,"default")],8,Wu)}const Xu=C(qu,[["render",Zu]]),Ju={data(){return{selectedTab:{},tabStateSubscriber:null}},computed:{},mounted(){this.tabStateSubscriber=this.$parent.tabState.subscribe(e=>{this.selectedTab=e})},unmounted(){this.tabStateSubscriber.unsubscribe()},props:["label","identifier","padding"]},ec=["label","identifier"];function tc(e,t,s,c,d,n){return i(),a("div",{class:m([d.selectedTab.identifier!==s.identifier?"hidden":"","ns-tab-item flex flex-auto overflow-hidden"]),label:s.label,identifier:s.identifier},[d.selectedTab.identifier===s.identifier?(i(),a("div",{key:0,class:m(["border rounded flex-auto overflow-y-auto",s.padding||"p-4"])},[v(e.$slots,"default")],2)):u("",!0)],10,ec)}const sc=C(Ju,[["render",tc]]),nc={data:()=>({}),mounted(){},computed:{hasError(){return this.field.errors!==void 0&&this.field.errors.length>0},disabledClass(){return this.field.disabled?"ns-disabled cursor-not-allowed":""},inputClass(){return this.disabledClass+" "+this.leadClass},leadClass(){return this.leading?"p-8":"p-2"}},props:["placeholder","leading","type","field"]},lc={class:"flex flex-col mb-2 flex-auto ns-textarea"},ic=["for"],ac={key:0,class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},rc={class:"text-secondary sm:text-sm sm:leading-5"},dc=["rows","disabled","id","type","placeholder"],oc={key:0,class:"text-xs text-secondary"};function uc(e,t,s,c,d,n){return i(),a("div",lc,[l("label",{for:s.field.name,class:m([n.hasError?"text-error-primary":"text-primary","block leading-5 font-medium"])},h(s.field.label),11,ic),l("div",{class:m([n.hasError?"has-error":"is-pristine","mt-1 relative border-2 overflow-hidden rounded-md focus:shadow-sm mb-1"])},[s.leading?(i(),a("div",ac,[l("span",rc,h(s.leading),1)])):u("",!0),R(l("textarea",{rows:s.field.data&&s.field.data.rows||10,disabled:s.field.disabled,"onUpdate:modelValue":t[0]||(t[0]=r=>s.field.value=r),onBlur:t[1]||(t[1]=r=>e.$emit("blur",this)),onChange:t[2]||(t[2]=r=>e.$emit("change",this)),id:s.field.name,type:s.type||s.field.type||"text",class:m([n.inputClass,"form-input block w-full sm:text-sm sm:leading-5"]),placeholder:s.placeholder},null,42,dc),[[A,s.field.value]])],2),!s.field.errors||s.field.errors.length===0?(i(),a("p",oc,[v(e.$slots,"description")])):u("",!0),(i(!0),a(p,null,D(s.field.errors,(r,o)=>(i(),a("p",{key:o,class:"text-xs text-error-primary"},[r.identifier==="required"?v(e.$slots,r.identifier,{key:0},()=>[y("This field is required.")]):u("",!0),r.identifier==="email"?v(e.$slots,r.identifier,{key:1},()=>[y("This field must contain a valid email address.")]):u("",!0),r.identifier==="invalid"?v(e.$slots,r.identifier,{key:2},()=>[y(h(r.message),1)]):u("",!0)]))),128))])}const cc=C(nc,[["render",uc]]),kc=Object.freeze(Object.defineProperty({__proto__:null,nsAlertPopup:se,nsAvatar:qe,nsButton:Ze,nsCalendar:ce,nsCheckbox:ds,nsCkeditor:Fe,nsCloseButton:fs,nsConfirmPopup:V,nsCrud:vn,nsCrudForm:Nn,nsDate:Xn,nsDateRangePicker:ge,nsDateTimePicker:be,nsDatepicker:$i,nsDaterangePicker:Wi,nsDragzone:aa,nsField:Ca,nsFieldDescription:$a,nsIconButton:Fa,nsInlineMultiselect:Za,nsInput:ir,nsLink:ur,nsMediaInput:Ud,nsMenu:Wd,nsMultiselect:mo,nsNotice:Oe,nsNumpad:Pe,nsNumpadPlus:Ae,nsPOSLoadingPopup:je,nsPageTitle:vo,nsPaginate:He,nsPromptPopup:Ue,nsSearch:Eo,nsSearchSelect:No,nsSelect:Xo,nsSelectAudio:ru,nsSpinner:cu,nsSubmenu:_u,nsSwitch:ue,nsTableRow:zu,nsTabs:Xu,nsTabsItem:sc,nsTextarea:cc},Symbol.toStringTag,{value:"Module"}));export{_u as a,kc as b,$i as c,Wi as d,be as e,pe as f,Ca as g,fs as h,vc as i,Wd as n}; diff --git a/public/build/assets/create-coupons-D4ttYNFe.js b/public/build/assets/create-coupons-f729626b.js similarity index 95% rename from public/build/assets/create-coupons-D4ttYNFe.js rename to public/build/assets/create-coupons-f729626b.js index f169ff6ae..6d8ae8896 100644 --- a/public/build/assets/create-coupons-D4ttYNFe.js +++ b/public/build/assets/create-coupons-f729626b.js @@ -1 +1 @@ -import{F as C,b as h,a as p,v as T}from"./bootstrap-CnLEEQCx.js";import{_ as c}from"./currency-lOMYG1Wf.js";import{_ as U}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as g,o as r,c as l,f as k,e as b,F as u,a as i,A as v,i as _,t as m,n as F,B,b as f,g as O}from"./runtime-core.esm-bundler-RT2b-_3S.js";const N={name:"ns-create-coupons",mounted(){this.loadForm()},computed:{validTabs(){if(this.form){const e=[];for(let t in this.form.tabs)["selected_products","selected_categories","selected_groups","selected_customers"].includes(t)&&e.push(this.form.tabs[t]);return e}return[]},activeValidTab(){return this.validTabs.filter(e=>e.active)[0]},generalTab(){const e=[];for(let t in this.form.tabs)["general"].includes(t)&&e.push(this.form.tabs[t]);return e}},data(){return{formValidation:new C,form:{},nsSnackBar:h,nsHttpClient:p,options:new Array(40).fill("").map((e,t)=>({label:"Foo"+t,value:"bar"+t}))}},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,setTabActive(e){this.validTabs.forEach(t=>t.active=!1),e.active=!0},submit(){if(this.formValidation.validateForm(this.form).length>0)return h.error(c("Unable to proceed the form is not valid."),c("Okay")).subscribe();if(this.submitUrl===void 0)return h.error(c("No submit URL was provided"),c("Okay")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form)};p[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe(t=>{if(t.status==="success")return document.location=this.returnUrl;this.formValidation.enableForm(this.form)},t=>{h.error(t.message||c("An unexpected error occurred."),void 0,{duration:5e3}).subscribe(),t.status==="error"&&this.formValidation.triggerError(this.form,t.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){p.get(`${this.src}`).subscribe(t=>{this.form=this.parseForm(t.form)})},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let n in e.tabs)t===1&&e.tabs[n].active===void 0&&(e.tabs[n].active=!0),e.tabs[n].active=e.tabs[n].active===void 0?!1:e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e},addOption(e){const t=this.options.indexOf(e);t>=0&&(this.options[t].selected=!this.options[t].selected)},removeOption({option:e,index:t}){e.selected=!1},getRuleForm(){return this.form.ruleForm},addRule(){this.form.rules.push(this.getRuleForm())},removeRule(e){this.form.rules.splice(e,1)}}},R={class:"form flex-auto flex flex-col",id:"crud-form"},A={key:0,class:"flex items-center justify-center flex-auto"},j={class:"flex flex-col"},E={class:"flex justify-between items-center"},M={for:"title",class:"font-bold my-2 text-primary"},S={for:"title",class:"text-sm my-2"},q=["href"],L=["disabled"],D=["disabled"],z={key:0,class:"text-xs text-primary py-1"},G={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},H={class:"px-4 w-full md:w-1/2"},P={class:"px-4 w-full md:w-1/2"},I={id:"tabbed-card"},J={id:"card-header",class:"flex ml-4 flex-wrap ns-tab"},K=["onClick"],Q={class:"ns-tab-item"},W={class:"shadow p-2 rounded"};function X(e,t,n,Y,s,a){const V=g("ns-spinner"),x=g("ns-field");return r(),l("div",R,[Object.values(s.form).length===0?(r(),l("div",A,[k(V)])):b("",!0),Object.values(s.form).length>0?(r(),l(u,{key:1},[i("div",j,[i("div",E,[i("label",M,[v(e.$slots,"title",{},()=>[_("No title Provided")])]),i("div",S,[n.returnUrl?(r(),l("a",{key:0,href:n.returnUrl,class:"rounded-full border ns-inset-button error px-2 py-1"},m(a.__("Return")),9,q)):b("",!0)])]),i("div",{class:F([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[B(i("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>s.form.main.value=o),onBlur:t[1]||(t[1]=o=>s.formValidation.checkField(s.form.main)),onChange:t[2]||(t[2]=o=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:"flex-auto text-primary outline-none h-10 px-2"},null,40,L),[[T,s.form.main.value]]),i("button",{disabled:s.form.main.disabled,onClick:t[3]||(t[3]=o=>a.submit()),class:"outline-none px-4 h-10"},[v(e.$slots,"save",{},()=>[_(m(a.__("Save")),1)])],8,D)],2),s.form.main.description&&s.form.main.errors.length===0?(r(),l("p",z,m(s.form.main.description),1)):b("",!0),(r(!0),l(u,null,f(s.form.main.errors,(o,d)=>(r(),l("p",{class:"text-xs py-1 text-error-tertiary",key:d},[i("span",null,[v(e.$slots,"error-required",{},()=>[_(m(o.identifier),1)])])]))),128))]),i("div",G,[i("div",H,[(r(!0),l(u,null,f(a.generalTab,(o,d)=>(r(),l("div",{class:"rounded ns-box shadow p-2",key:d},[(r(!0),l(u,null,f(o.fields,(y,w)=>(r(),O(x,{key:w,field:y},null,8,["field"]))),128))]))),128))]),i("div",P,[i("div",I,[i("div",J,[(r(!0),l(u,null,f(a.validTabs,(o,d)=>(r(),l("div",{onClick:y=>a.setTabActive(o),class:F([o.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg"]),key:d},m(o.label),11,K))),128))]),i("div",Q,[i("div",W,[(r(!0),l(u,null,f(a.activeValidTab.fields,(o,d)=>(r(),l("div",{class:"flex flex-col",key:d},[k(x,{field:o},null,8,["field"])]))),128))])])])])])],64)):b("",!0)])}const se=U(N,[["render",X]]);export{se as default}; +import{F as C,b as h,a as p,v as T}from"./bootstrap-8be442b1.js";import{_ as c}from"./currency-f8bd78d1.js";import{_ as U}from"./_plugin-vue_export-helper-c27b6911.js";import{r as g,o as r,c as l,f as k,e as b,F as u,a as i,A as v,i as _,t as m,n as F,B,b as f,g as O}from"./runtime-core.esm-bundler-b48de70a.js";const N={name:"ns-create-coupons",mounted(){this.loadForm()},computed:{validTabs(){if(this.form){const e=[];for(let t in this.form.tabs)["selected_products","selected_categories","selected_groups","selected_customers"].includes(t)&&e.push(this.form.tabs[t]);return e}return[]},activeValidTab(){return this.validTabs.filter(e=>e.active)[0]},generalTab(){const e=[];for(let t in this.form.tabs)["general"].includes(t)&&e.push(this.form.tabs[t]);return e}},data(){return{formValidation:new C,form:{},nsSnackBar:h,nsHttpClient:p,options:new Array(40).fill("").map((e,t)=>({label:"Foo"+t,value:"bar"+t}))}},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,setTabActive(e){this.validTabs.forEach(t=>t.active=!1),e.active=!0},submit(){if(this.formValidation.validateForm(this.form).length>0)return h.error(c("Unable to proceed the form is not valid."),c("Okay")).subscribe();if(this.submitUrl===void 0)return h.error(c("No submit URL was provided"),c("Okay")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form)};p[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe(t=>{if(t.status==="success")return document.location=this.returnUrl;this.formValidation.enableForm(this.form)},t=>{h.error(t.message||c("An unexpected error occurred."),void 0,{duration:5e3}).subscribe(),t.status==="error"&&this.formValidation.triggerError(this.form,t.data),this.formValidation.enableForm(this.form)})},handleGlobalChange(e){this.globallyChecked=e,this.rows.forEach(t=>t.$checked=e)},loadForm(){p.get(`${this.src}`).subscribe(t=>{this.form=this.parseForm(t.form)})},parseForm(e){e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0];let t=0;for(let n in e.tabs)t===1&&e.tabs[n].active===void 0&&(e.tabs[n].active=!0),e.tabs[n].active=e.tabs[n].active===void 0?!1:e.tabs[n].active,e.tabs[n].fields=this.formValidation.createFields(e.tabs[n].fields),t++;return e},addOption(e){const t=this.options.indexOf(e);t>=0&&(this.options[t].selected=!this.options[t].selected)},removeOption({option:e,index:t}){e.selected=!1},getRuleForm(){return this.form.ruleForm},addRule(){this.form.rules.push(this.getRuleForm())},removeRule(e){this.form.rules.splice(e,1)}}},R={class:"form flex-auto flex flex-col",id:"crud-form"},A={key:0,class:"flex items-center justify-center flex-auto"},j={class:"flex flex-col"},E={class:"flex justify-between items-center"},M={for:"title",class:"font-bold my-2 text-primary"},S={for:"title",class:"text-sm my-2"},q=["href"],L=["disabled"],D=["disabled"],z={key:0,class:"text-xs text-primary py-1"},G={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},H={class:"px-4 w-full md:w-1/2"},P={class:"px-4 w-full md:w-1/2"},I={id:"tabbed-card"},J={id:"card-header",class:"flex ml-4 flex-wrap ns-tab"},K=["onClick"],Q={class:"ns-tab-item"},W={class:"shadow p-2 rounded"};function X(e,t,n,Y,s,a){const V=g("ns-spinner"),x=g("ns-field");return r(),l("div",R,[Object.values(s.form).length===0?(r(),l("div",A,[k(V)])):b("",!0),Object.values(s.form).length>0?(r(),l(u,{key:1},[i("div",j,[i("div",E,[i("label",M,[v(e.$slots,"title",{},()=>[_("No title Provided")])]),i("div",S,[n.returnUrl?(r(),l("a",{key:0,href:n.returnUrl,class:"rounded-full border ns-inset-button error px-2 py-1"},m(a.__("Return")),9,q)):b("",!0)])]),i("div",{class:F([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"info","input-group flex border-2 rounded overflow-hidden"])},[B(i("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>s.form.main.value=o),onBlur:t[1]||(t[1]=o=>s.formValidation.checkField(s.form.main)),onChange:t[2]||(t[2]=o=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:"flex-auto text-primary outline-none h-10 px-2"},null,40,L),[[T,s.form.main.value]]),i("button",{disabled:s.form.main.disabled,onClick:t[3]||(t[3]=o=>a.submit()),class:"outline-none px-4 h-10"},[v(e.$slots,"save",{},()=>[_(m(a.__("Save")),1)])],8,D)],2),s.form.main.description&&s.form.main.errors.length===0?(r(),l("p",z,m(s.form.main.description),1)):b("",!0),(r(!0),l(u,null,f(s.form.main.errors,(o,d)=>(r(),l("p",{class:"text-xs py-1 text-error-tertiary",key:d},[i("span",null,[v(e.$slots,"error-required",{},()=>[_(m(o.identifier),1)])])]))),128))]),i("div",G,[i("div",H,[(r(!0),l(u,null,f(a.generalTab,(o,d)=>(r(),l("div",{class:"rounded ns-box shadow p-2",key:d},[(r(!0),l(u,null,f(o.fields,(y,w)=>(r(),O(x,{key:w,field:y},null,8,["field"]))),128))]))),128))]),i("div",P,[i("div",I,[i("div",J,[(r(!0),l(u,null,f(a.validTabs,(o,d)=>(r(),l("div",{onClick:y=>a.setTabActive(o),class:F([o.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg"]),key:d},m(o.label),11,K))),128))]),i("div",Q,[i("div",W,[(r(!0),l(u,null,f(a.activeValidTab.fields,(o,d)=>(r(),l("div",{class:"flex flex-col",key:d},[k(x,{field:o},null,8,["field"])]))),128))])])])])])],64)):b("",!0)])}const se=U(N,[["render",X]]);export{se as default}; diff --git a/public/build/assets/currency-lOMYG1Wf.js b/public/build/assets/currency-f8bd78d1.js similarity index 75% rename from public/build/assets/currency-lOMYG1Wf.js rename to public/build/assets/currency-f8bd78d1.js index eccd2a1e3..f586bf871 100644 --- a/public/build/assets/currency-lOMYG1Wf.js +++ b/public/build/assets/currency-f8bd78d1.js @@ -1,13 +1,13 @@ -var j=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function K(a){if(a.__esModule)return a;var r=a.default;if(typeof r=="function"){var l=function u(){return this instanceof u?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};l.prototype=r.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(a).forEach(function(u){var p=Object.getOwnPropertyDescriptor(a,u);Object.defineProperty(l,u,p.get?p:{enumerable:!0,get:function(){return a[u]}})}),l}const Y=function(a,r="NexoPOS"){return nsLanguage.getEntries(r)&&nsLanguage.getEntries(r)[a]||a},U=function(a,r){return nsLanguage.getEntries(r)&&nsLanguage.getEntries(r)[a]||a};var L={exports:{}};/*! @preserve +var R=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function K(a){if(a.__esModule)return a;var r=a.default;if(typeof r=="function"){var l=function u(){if(this instanceof u){var p=[null];p.push.apply(p,arguments);var b=Function.bind.apply(r,p);return new b}return r.apply(this,arguments)};l.prototype=r.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(a).forEach(function(u){var p=Object.getOwnPropertyDescriptor(a,u);Object.defineProperty(l,u,p.get?p:{enumerable:!0,get:function(){return a[u]}})}),l}const Y=function(a,r="NexoPOS"){return nsLanguage.getEntries(r)&&nsLanguage.getEntries(r)[a]||a},U=function(a,r){return nsLanguage.getEntries(r)&&nsLanguage.getEntries(r)[a]||a};var S={},C={get exports(){return S},set exports(a){S=a}};/*! @preserve * numeral.js * version : 2.0.6 * author : Adam Draper * license : MIT * http://adamwdraper.github.com/Numeral-js/ - */(function(a){(function(r,l){a.exports?a.exports=l():r.numeral=l()})(j,function(){var r,l,u="2.0.6",p={},h={},_={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:_.currentLocale,zeroFormat:_.zeroFormat,nullFormat:_.nullFormat,defaultFormat:_.defaultFormat,scalePercentBy100:_.scalePercentBy100};function w(e,t){this._input=e,this._value=t}return r=function(e){var t,s,i,n;if(r.isNumeral(e))t=e.value();else if(e===0||typeof e>"u")t=0;else if(e===null||l.isNaN(e))t=null;else if(typeof e=="string")if(d.zeroFormat&&e===d.zeroFormat)t=0;else if(d.nullFormat&&e===d.nullFormat||!e.replace(/[^0-9]+/g,"").length)t=null;else{for(s in p)if(n=typeof p[s].regexps.unformat=="function"?p[s].regexps.unformat():p[s].regexps.unformat,n&&e.match(n)){i=p[s].unformat;break}i=i||r._.stringToNumber,t=i(e)}else t=Number(e)||null;return new w(e,t)},r.version=u,r.isNumeral=function(e){return e instanceof w},r._=l={numberToFormat:function(e,t,s){var i=h[r.options.currentLocale],n=!1,o=!1,c=0,f="",b=1e12,m=1e9,y=1e6,O=1e3,v="",E=!1,F,B,g,x,P,V,M;if(e=e||0,B=Math.abs(e),r._.includes(t,"(")?(n=!0,t=t.replace(/[\(|\)]/g,"")):(r._.includes(t,"+")||r._.includes(t,"-"))&&(P=r._.includes(t,"+")?t.indexOf("+"):e<0?t.indexOf("-"):-1,t=t.replace(/[\+|\-]/g,"")),r._.includes(t,"a")&&(F=t.match(/a(k|m|b|t)?/),F=F?F[1]:!1,r._.includes(t," a")&&(f=" "),t=t.replace(new RegExp(f+"a[kmbt]?"),""),B>=b&&!F||F==="t"?(f+=i.abbreviations.trillion,e=e/b):B=m&&!F||F==="b"?(f+=i.abbreviations.billion,e=e/m):B=y&&!F||F==="m"?(f+=i.abbreviations.million,e=e/y):(B=O&&!F||F==="k")&&(f+=i.abbreviations.thousand,e=e/O)),r._.includes(t,"[.]")&&(o=!0,t=t.replace("[.]",".")),g=e.toString().split(".")[0],x=t.split(".")[1],V=t.indexOf(","),c=(t.split(".")[0].split(",")[0].match(/0/g)||[]).length,x?(r._.includes(x,"[")?(x=x.replace("]",""),x=x.split("["),v=r._.toFixed(e,x[0].length+x[1].length,s,x[1].length)):v=r._.toFixed(e,x.length,s),g=v.split(".")[0],r._.includes(v,".")?v=i.delimiters.decimal+v.split(".")[1]:v="",o&&Number(v.slice(1))===0&&(v="")):g=r._.toFixed(e,0,s),f&&!F&&Number(g)>=1e3&&f!==i.abbreviations.trillion)switch(g=String(Number(g)/1e3),f){case i.abbreviations.thousand:f=i.abbreviations.million;break;case i.abbreviations.million:f=i.abbreviations.billion;break;case i.abbreviations.billion:f=i.abbreviations.trillion;break}if(r._.includes(g,"-")&&(g=g.slice(1),E=!0),g.length0;k--)g="0"+g;return V>-1&&(g=g.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+i.delimiters.thousands)),t.indexOf(".")===0&&(g=""),M=g+v+(f||""),n?M=(n&&E?"(":"")+M+(n&&E?")":""):P>=0?M=P===0?(E?"-":"+")+M:M+(E?"-":"+"):E&&(M="-"+M),M},stringToNumber:function(e){var t=h[d.currentLocale],s=e,i={thousand:3,million:6,billion:9,trillion:12},n,o,c;if(d.zeroFormat&&e===d.zeroFormat)o=0;else if(d.nullFormat&&e===d.nullFormat||!e.replace(/[^0-9]+/g,"").length)o=null;else{o=1,t.delimiters.decimal!=="."&&(e=e.replace(/\./g,"").replace(t.delimiters.decimal,"."));for(n in i)if(c=new RegExp("[^a-zA-Z]"+t.abbreviations[n]+"(?:\\)|(\\"+t.currency.symbol+")?(?:\\))?)?$"),s.match(c)){o*=Math.pow(10,i[n]);break}o*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),o*=Number(e)}return o},isNaN:function(e){return typeof e=="number"&&isNaN(e)},includes:function(e,t){return e.indexOf(t)!==-1},insert:function(e,t,s){return e.slice(0,s)+t+e.slice(s)},reduce:function(e,t){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof t!="function")throw new TypeError(t+" is not a function");var s=Object(e),i=s.length>>>0,n=0,o;if(arguments.length===3)o=arguments[2];else{for(;n=i)throw new TypeError("Reduce of empty array with no initial value");o=s[n++]}for(;ni?t:i},1)},toFixed:function(e,t,s,i){var n=e.toString().split("."),o=t-(i||0),c,f,b,m;return n.length===2?c=Math.min(Math.max(n[1].length,o),t):c=o,b=Math.pow(10,c),m=(s(e+"e+"+c)/b).toFixed(c),i>t-c&&(f=new RegExp("\\.?0{1,"+(i-(t-c))+"}$"),m=m.replace(f,"")),m}},r.options=d,r.formats=p,r.locales=h,r.locale=function(e){return e&&(d.currentLocale=e.toLowerCase()),d.currentLocale},r.localeData=function(e){if(!e)return h[d.currentLocale];if(e=e.toLowerCase(),!h[e])throw new Error("Unknown locale : "+e);return h[e]},r.reset=function(){for(var e in _)d[e]=_[e]},r.zeroFormat=function(e){d.zeroFormat=typeof e=="string"?e:null},r.nullFormat=function(e){d.nullFormat=typeof e=="string"?e:null},r.defaultFormat=function(e){d.defaultFormat=typeof e=="string"?e:"0.0"},r.register=function(e,t,s){if(t=t.toLowerCase(),this[e+"s"][t])throw new TypeError(t+" "+e+" already registered.");return this[e+"s"][t]=s,s},r.validate=function(e,t){var s,i,n,o,c,f,b,m;if(typeof e!="string"&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),e.match(/^\d+$/))return!0;if(e==="")return!1;try{b=r.localeData(t)}catch{b=r.localeData(r.locale())}return n=b.currency.symbol,c=b.abbreviations,s=b.delimiters.decimal,b.delimiters.thousands==="."?i="\\.":i=b.delimiters.thousands,m=e.match(/^[^\d]+/),m!==null&&(e=e.substr(1),m[0]!==n)||(m=e.match(/[^\d]+$/),m!==null&&(e=e.slice(0,-1),m[0]!==c.thousand&&m[0]!==c.million&&m[0]!==c.billion&&m[0]!==c.trillion))?!1:(f=new RegExp(i+"{2}"),e.match(/[^\d.,]/g)?!1:(o=e.split(s),o.length>2?!1:o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f):o[0].length===1?!!o[0].match(/^\d+$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/)))},r.fn=w.prototype={clone:function(){return r(this)},format:function(e,t){var s=this._value,i=e||d.defaultFormat,n,o,c;if(t=t||Math.round,s===0&&d.zeroFormat!==null)o=d.zeroFormat;else if(s===null&&d.nullFormat!==null)o=d.nullFormat;else{for(n in p)if(i.match(p[n].regexps.format)){c=p[n].format;break}c=c||r._.numberToFormat,o=c(s,i,t)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var t=l.correctionFactor.call(null,this._value,e);function s(i,n,o,c){return i+Math.round(t*n)}return this._value=l.reduce([this._value,e],s,0)/t,this},subtract:function(e){var t=l.correctionFactor.call(null,this._value,e);function s(i,n,o,c){return i-Math.round(t*n)}return this._value=l.reduce([e],s,Math.round(this._value*t))/t,this},multiply:function(e){function t(s,i,n,o){var c=l.correctionFactor(s,i);return Math.round(s*c)*Math.round(i*c)/Math.round(c*c)}return this._value=l.reduce([this._value,e],t,1),this},divide:function(e){function t(s,i,n,o){var c=l.correctionFactor(s,i);return Math.round(s*c)/Math.round(i*c)}return this._value=l.reduce([this._value,e],t),this},difference:function(e){return Math.abs(r(this._value).subtract(e).value())}},r.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"},currency:{symbol:"$"}}),function(){r.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,t,s){var i=r._.includes(t," BPS")?" ":"",n;return e=e*1e4,t=t.replace(/\s?BPS/,""),n=r._.numberToFormat(e,t,s),r._.includes(n,")")?(n=n.split(""),n.splice(-1,0,i+"BPS"),n=n.join("")):n=n+i+"BPS",n},unformat:function(e){return+(r._.stringToNumber(e)*1e-4).toFixed(15)}})}(),function(){var e={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},t={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},s=e.suffixes.concat(t.suffixes.filter(function(n){return e.suffixes.indexOf(n)<0})),i=s.join("|");i="("+i.replace("B","B(?!PS)")+")",r.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(n,o,c){var f,b=r._.includes(o,"ib")?t:e,m=r._.includes(o," b")||r._.includes(o," ib")?" ":"",y,O,v;for(o=o.replace(/\s?i?b/,""),y=0;y<=b.suffixes.length;y++)if(O=Math.pow(b.base,y),v=Math.pow(b.base,y+1),n===null||n===0||n>=O&&n0&&(n=n/O);break}return f=r._.numberToFormat(n,o,c),f+m},unformat:function(n){var o=r._.stringToNumber(n),c,f;if(o){for(c=e.suffixes.length-1;c>=0;c--){if(r._.includes(n,e.suffixes[c])){f=Math.pow(e.base,c);break}if(r._.includes(n,t.suffixes[c])){f=Math.pow(t.base,c);break}}o*=f||1}return o}})}(),function(){r.register("format","currency",{regexps:{format:/(\$)/},format:function(e,t,s){var i=r.locales[r.options.currentLocale],n={before:t.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:t.match(/([\+|\-|\)|\s|\$]*)$/)[0]},o,c,f;for(t=t.replace(/\s?\$\s?/,""),o=r._.numberToFormat(e,t,s),e>=0?(n.before=n.before.replace(/[\-\(]/,""),n.after=n.after.replace(/[\-\)]/,"")):e<0&&!r._.includes(n.before,"-")&&!r._.includes(n.before,"(")&&(n.before="-"+n.before),f=0;f=0;f--)switch(c=n.after[f],c){case"$":o=f===n.after.length-1?o+i.currency.symbol:r._.insert(o,i.currency.symbol,-(n.after.length-(1+f)));break;case" ":o=f===n.after.length-1?o+" ":r._.insert(o," ",-(n.after.length-(1+f)+i.currency.symbol.length-1));break}return o}})}(),function(){r.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,t,s){var i,n=typeof e=="number"&&!r._.isNaN(e)?e.toExponential():"0e+0",o=n.split("e");return t=t.replace(/e[\+|\-]{1}0/,""),i=r._.numberToFormat(Number(o[0]),t,s),i+"e"+o[1]},unformat:function(e){var t=r._.includes(e,"e+")?e.split("e+"):e.split("e-"),s=Number(t[0]),i=Number(t[1]);i=r._.includes(e,"e-")?i*=-1:i;function n(o,c,f,b){var m=r._.correctionFactor(o,c),y=o*m*(c*m)/(m*m);return y}return r._.reduce([s,Math.pow(10,i)],n,1)}})}(),function(){r.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,t,s){var i=r.locales[r.options.currentLocale],n,o=r._.includes(t," o")?" ":"";return t=t.replace(/\s?o/,""),o+=i.ordinal(e),n=r._.numberToFormat(e,t,s),n+o}})}(),function(){r.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,t,s){var i=r._.includes(t," %")?" ":"",n;return r.options.scalePercentBy100&&(e=e*100),t=t.replace(/\s?\%/,""),n=r._.numberToFormat(e,t,s),r._.includes(n,")")?(n=n.split(""),n.splice(-1,0,i+"%"),n=n.join("")):n=n+i+"%",n},unformat:function(e){var t=r._.stringToNumber(e);return r.options.scalePercentBy100?t*.01:t}})}(),function(){r.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,t,s){var i=Math.floor(e/60/60),n=Math.floor((e-i*60*60)/60),o=Math.round(e-i*60*60-n*60);return i+":"+(n<10?"0"+n:n)+":"+(o<10?"0"+o:o)},unformat:function(e){var t=e.split(":"),s=0;return t.length===3?(s=s+Number(t[0])*60*60,s=s+Number(t[1])*60,s=s+Number(t[2])):t.length===2&&(s=s+Number(t[0])*60,s=s+Number(t[1])),Number(s)}})}(),r})})(L);var I=L.exports;const S=C(I);/*! + */(function(a){(function(r,l){a.exports?a.exports=l():r.numeral=l()})(R,function(){var r,l,u="2.0.6",p={},b={},_={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},d={currentLocale:_.currentLocale,zeroFormat:_.zeroFormat,nullFormat:_.nullFormat,defaultFormat:_.defaultFormat,scalePercentBy100:_.scalePercentBy100};function w(e,t){this._input=e,this._value=t}return r=function(e){var t,s,i,n;if(r.isNumeral(e))t=e.value();else if(e===0||typeof e>"u")t=0;else if(e===null||l.isNaN(e))t=null;else if(typeof e=="string")if(d.zeroFormat&&e===d.zeroFormat)t=0;else if(d.nullFormat&&e===d.nullFormat||!e.replace(/[^0-9]+/g,"").length)t=null;else{for(s in p)if(n=typeof p[s].regexps.unformat=="function"?p[s].regexps.unformat():p[s].regexps.unformat,n&&e.match(n)){i=p[s].unformat;break}i=i||r._.stringToNumber,t=i(e)}else t=Number(e)||null;return new w(e,t)},r.version=u,r.isNumeral=function(e){return e instanceof w},r._=l={numberToFormat:function(e,t,s){var i=b[r.options.currentLocale],n=!1,o=!1,c=0,f="",h=1e12,m=1e9,y=1e6,O=1e3,v="",E=!1,F,B,g,x,P,k,M;if(e=e||0,B=Math.abs(e),r._.includes(t,"(")?(n=!0,t=t.replace(/[\(|\)]/g,"")):(r._.includes(t,"+")||r._.includes(t,"-"))&&(P=r._.includes(t,"+")?t.indexOf("+"):e<0?t.indexOf("-"):-1,t=t.replace(/[\+|\-]/g,"")),r._.includes(t,"a")&&(F=t.match(/a(k|m|b|t)?/),F=F?F[1]:!1,r._.includes(t," a")&&(f=" "),t=t.replace(new RegExp(f+"a[kmbt]?"),""),B>=h&&!F||F==="t"?(f+=i.abbreviations.trillion,e=e/h):B=m&&!F||F==="b"?(f+=i.abbreviations.billion,e=e/m):B=y&&!F||F==="m"?(f+=i.abbreviations.million,e=e/y):(B=O&&!F||F==="k")&&(f+=i.abbreviations.thousand,e=e/O)),r._.includes(t,"[.]")&&(o=!0,t=t.replace("[.]",".")),g=e.toString().split(".")[0],x=t.split(".")[1],k=t.indexOf(","),c=(t.split(".")[0].split(",")[0].match(/0/g)||[]).length,x?(r._.includes(x,"[")?(x=x.replace("]",""),x=x.split("["),v=r._.toFixed(e,x[0].length+x[1].length,s,x[1].length)):v=r._.toFixed(e,x.length,s),g=v.split(".")[0],r._.includes(v,".")?v=i.delimiters.decimal+v.split(".")[1]:v="",o&&Number(v.slice(1))===0&&(v="")):g=r._.toFixed(e,0,s),f&&!F&&Number(g)>=1e3&&f!==i.abbreviations.trillion)switch(g=String(Number(g)/1e3),f){case i.abbreviations.thousand:f=i.abbreviations.million;break;case i.abbreviations.million:f=i.abbreviations.billion;break;case i.abbreviations.billion:f=i.abbreviations.trillion;break}if(r._.includes(g,"-")&&(g=g.slice(1),E=!0),g.length0;L--)g="0"+g;return k>-1&&(g=g.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+i.delimiters.thousands)),t.indexOf(".")===0&&(g=""),M=g+v+(f||""),n?M=(n&&E?"(":"")+M+(n&&E?")":""):P>=0?M=P===0?(E?"-":"+")+M:M+(E?"-":"+"):E&&(M="-"+M),M},stringToNumber:function(e){var t=b[d.currentLocale],s=e,i={thousand:3,million:6,billion:9,trillion:12},n,o,c;if(d.zeroFormat&&e===d.zeroFormat)o=0;else if(d.nullFormat&&e===d.nullFormat||!e.replace(/[^0-9]+/g,"").length)o=null;else{o=1,t.delimiters.decimal!=="."&&(e=e.replace(/\./g,"").replace(t.delimiters.decimal,"."));for(n in i)if(c=new RegExp("[^a-zA-Z]"+t.abbreviations[n]+"(?:\\)|(\\"+t.currency.symbol+")?(?:\\))?)?$"),s.match(c)){o*=Math.pow(10,i[n]);break}o*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),o*=Number(e)}return o},isNaN:function(e){return typeof e=="number"&&isNaN(e)},includes:function(e,t){return e.indexOf(t)!==-1},insert:function(e,t,s){return e.slice(0,s)+t+e.slice(s)},reduce:function(e,t){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof t!="function")throw new TypeError(t+" is not a function");var s=Object(e),i=s.length>>>0,n=0,o;if(arguments.length===3)o=arguments[2];else{for(;n=i)throw new TypeError("Reduce of empty array with no initial value");o=s[n++]}for(;ni?t:i},1)},toFixed:function(e,t,s,i){var n=e.toString().split("."),o=t-(i||0),c,f,h,m;return n.length===2?c=Math.min(Math.max(n[1].length,o),t):c=o,h=Math.pow(10,c),m=(s(e+"e+"+c)/h).toFixed(c),i>t-c&&(f=new RegExp("\\.?0{1,"+(i-(t-c))+"}$"),m=m.replace(f,"")),m}},r.options=d,r.formats=p,r.locales=b,r.locale=function(e){return e&&(d.currentLocale=e.toLowerCase()),d.currentLocale},r.localeData=function(e){if(!e)return b[d.currentLocale];if(e=e.toLowerCase(),!b[e])throw new Error("Unknown locale : "+e);return b[e]},r.reset=function(){for(var e in _)d[e]=_[e]},r.zeroFormat=function(e){d.zeroFormat=typeof e=="string"?e:null},r.nullFormat=function(e){d.nullFormat=typeof e=="string"?e:null},r.defaultFormat=function(e){d.defaultFormat=typeof e=="string"?e:"0.0"},r.register=function(e,t,s){if(t=t.toLowerCase(),this[e+"s"][t])throw new TypeError(t+" "+e+" already registered.");return this[e+"s"][t]=s,s},r.validate=function(e,t){var s,i,n,o,c,f,h,m;if(typeof e!="string"&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),e.match(/^\d+$/))return!0;if(e==="")return!1;try{h=r.localeData(t)}catch{h=r.localeData(r.locale())}return n=h.currency.symbol,c=h.abbreviations,s=h.delimiters.decimal,h.delimiters.thousands==="."?i="\\.":i=h.delimiters.thousands,m=e.match(/^[^\d]+/),m!==null&&(e=e.substr(1),m[0]!==n)||(m=e.match(/[^\d]+$/),m!==null&&(e=e.slice(0,-1),m[0]!==c.thousand&&m[0]!==c.million&&m[0]!==c.billion&&m[0]!==c.trillion))?!1:(f=new RegExp(i+"{2}"),e.match(/[^\d.,]/g)?!1:(o=e.split(s),o.length>2?!1:o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f):o[0].length===1?!!o[0].match(/^\d+$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/)))},r.fn=w.prototype={clone:function(){return r(this)},format:function(e,t){var s=this._value,i=e||d.defaultFormat,n,o,c;if(t=t||Math.round,s===0&&d.zeroFormat!==null)o=d.zeroFormat;else if(s===null&&d.nullFormat!==null)o=d.nullFormat;else{for(n in p)if(i.match(p[n].regexps.format)){c=p[n].format;break}c=c||r._.numberToFormat,o=c(s,i,t)}return o},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var t=l.correctionFactor.call(null,this._value,e);function s(i,n,o,c){return i+Math.round(t*n)}return this._value=l.reduce([this._value,e],s,0)/t,this},subtract:function(e){var t=l.correctionFactor.call(null,this._value,e);function s(i,n,o,c){return i-Math.round(t*n)}return this._value=l.reduce([e],s,Math.round(this._value*t))/t,this},multiply:function(e){function t(s,i,n,o){var c=l.correctionFactor(s,i);return Math.round(s*c)*Math.round(i*c)/Math.round(c*c)}return this._value=l.reduce([this._value,e],t,1),this},divide:function(e){function t(s,i,n,o){var c=l.correctionFactor(s,i);return Math.round(s*c)/Math.round(i*c)}return this._value=l.reduce([this._value,e],t),this},difference:function(e){return Math.abs(r(this._value).subtract(e).value())}},r.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"},currency:{symbol:"$"}}),function(){r.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,t,s){var i=r._.includes(t," BPS")?" ":"",n;return e=e*1e4,t=t.replace(/\s?BPS/,""),n=r._.numberToFormat(e,t,s),r._.includes(n,")")?(n=n.split(""),n.splice(-1,0,i+"BPS"),n=n.join("")):n=n+i+"BPS",n},unformat:function(e){return+(r._.stringToNumber(e)*1e-4).toFixed(15)}})}(),function(){var e={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},t={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},s=e.suffixes.concat(t.suffixes.filter(function(n){return e.suffixes.indexOf(n)<0})),i=s.join("|");i="("+i.replace("B","B(?!PS)")+")",r.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(n,o,c){var f,h=r._.includes(o,"ib")?t:e,m=r._.includes(o," b")||r._.includes(o," ib")?" ":"",y,O,v;for(o=o.replace(/\s?i?b/,""),y=0;y<=h.suffixes.length;y++)if(O=Math.pow(h.base,y),v=Math.pow(h.base,y+1),n===null||n===0||n>=O&&n0&&(n=n/O);break}return f=r._.numberToFormat(n,o,c),f+m},unformat:function(n){var o=r._.stringToNumber(n),c,f;if(o){for(c=e.suffixes.length-1;c>=0;c--){if(r._.includes(n,e.suffixes[c])){f=Math.pow(e.base,c);break}if(r._.includes(n,t.suffixes[c])){f=Math.pow(t.base,c);break}}o*=f||1}return o}})}(),function(){r.register("format","currency",{regexps:{format:/(\$)/},format:function(e,t,s){var i=r.locales[r.options.currentLocale],n={before:t.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:t.match(/([\+|\-|\)|\s|\$]*)$/)[0]},o,c,f;for(t=t.replace(/\s?\$\s?/,""),o=r._.numberToFormat(e,t,s),e>=0?(n.before=n.before.replace(/[\-\(]/,""),n.after=n.after.replace(/[\-\)]/,"")):e<0&&!r._.includes(n.before,"-")&&!r._.includes(n.before,"(")&&(n.before="-"+n.before),f=0;f=0;f--)switch(c=n.after[f],c){case"$":o=f===n.after.length-1?o+i.currency.symbol:r._.insert(o,i.currency.symbol,-(n.after.length-(1+f)));break;case" ":o=f===n.after.length-1?o+" ":r._.insert(o," ",-(n.after.length-(1+f)+i.currency.symbol.length-1));break}return o}})}(),function(){r.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,t,s){var i,n=typeof e=="number"&&!r._.isNaN(e)?e.toExponential():"0e+0",o=n.split("e");return t=t.replace(/e[\+|\-]{1}0/,""),i=r._.numberToFormat(Number(o[0]),t,s),i+"e"+o[1]},unformat:function(e){var t=r._.includes(e,"e+")?e.split("e+"):e.split("e-"),s=Number(t[0]),i=Number(t[1]);i=r._.includes(e,"e-")?i*=-1:i;function n(o,c,f,h){var m=r._.correctionFactor(o,c),y=o*m*(c*m)/(m*m);return y}return r._.reduce([s,Math.pow(10,i)],n,1)}})}(),function(){r.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,t,s){var i=r.locales[r.options.currentLocale],n,o=r._.includes(t," o")?" ":"";return t=t.replace(/\s?o/,""),o+=i.ordinal(e),n=r._.numberToFormat(e,t,s),n+o}})}(),function(){r.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,t,s){var i=r._.includes(t," %")?" ":"",n;return r.options.scalePercentBy100&&(e=e*100),t=t.replace(/\s?\%/,""),n=r._.numberToFormat(e,t,s),r._.includes(n,")")?(n=n.split(""),n.splice(-1,0,i+"%"),n=n.join("")):n=n+i+"%",n},unformat:function(e){var t=r._.stringToNumber(e);return r.options.scalePercentBy100?t*.01:t}})}(),function(){r.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,t,s){var i=Math.floor(e/60/60),n=Math.floor((e-i*60*60)/60),o=Math.round(e-i*60*60-n*60);return i+":"+(n<10?"0"+n:n)+":"+(o<10?"0"+o:o)},unformat:function(e){var t=e.split(":"),s=0;return t.length===3?(s=s+Number(t[0])*60*60,s=s+Number(t[1])*60,s=s+Number(t[2])):t.length===2&&(s=s+Number(t[0])*60,s=s+Number(t[1])),Number(s)}})}(),r})})(C);const T=S;/*! * currency.js - v2.0.4 * http://scurker.github.io/currency.js * * Copyright (c) 2021 Jason Wilson * Released under MIT license - */var z={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:J,fromCents:!1},R=function(r){return Math.round(r)},T=function(r){return Math.pow(10,r)},A=function(r,l){return R(r/l)*l},D=/(\d)(?=(\d{3})+\b)/g,G=/(\d)(?=(\d\d)+\d\b)/g;function N(a,r){var l=this;if(!(l instanceof N))return new N(a,r);var u=Object.assign({},z,r),p=T(u.precision),h=$(a,u);l.intValue=h,l.value=h/p,u.increment=u.increment||1/p,u.useVedic?u.groups=G:u.groups=D,this.s=u,this.p=p}function $(a,r){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=0,p=r.decimal,h=r.errorOnInvalid,_=r.precision,d=r.fromCents,w=T(_),e=typeof a=="number",t=a instanceof N;if(t&&d)return a.intValue;if(e||t)u=t?a.value:a;else if(typeof a=="string"){var s=new RegExp("[^-\\d"+p+"]","g"),i=new RegExp("\\"+p,"g");u=a.replace(/\((.*)\)/,"-$1").replace(s,"").replace(i,"."),u=u||0}else{if(h)throw Error("Invalid Input");u=0}return d||(u*=w,u=u.toFixed(4)),l?R(u):u}function J(a,r){var l=r.pattern,u=r.negativePattern,p=r.symbol,h=r.separator,_=r.decimal,d=r.groups,w=(""+a).replace(/^-/,"").split("."),e=w[0],t=w[1];return(a.value>=0?l:u).replace("!",p).replace("#",e.replace(d,"$1"+h)+(t?_+t:""))}N.prototype={add:function(r){var l=this.intValue,u=this.s,p=this.p;return N((l+=$(r,u))/(u.fromCents?1:p),u)},subtract:function(r){var l=this.intValue,u=this.s,p=this.p;return N((l-=$(r,u))/(u.fromCents?1:p),u)},multiply:function(r){var l=this.intValue,u=this.s;return N((l*=r)/(u.fromCents?1:T(u.precision)),u)},divide:function(r){var l=this.intValue,u=this.s;return N(l/=$(r,u,!1),u)},distribute:function(r){for(var l=this.intValue,u=this.p,p=this.s,h=[],_=Math[l>=0?"floor":"ceil"](l/r),d=Math.abs(l-_*r),w=p.fromCents?1:u;r!==0;r--){var e=N(_/w,p);d-- >0&&(e=e[l>=0?"add":"subtract"](1/w)),h.push(e)}return h},dollars:function(){return~~this.value},cents:function(){var r=this.intValue,l=this.p;return~~(r%l)},format:function(r){var l=this.s;return typeof r=="function"?r(this,l):l.format(this,Object.assign({},l,r))},toString:function(){var r=this.intValue,l=this.p,u=this.s;return A(r/l,u.increment).toFixed(u.precision)},toJSON:function(){return this.value}};const Z=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map(a=>0).join(""),q=(a,r="full",l="en")=>{let u;switch(ns.currency.ns_currency_prefered){case"iso":u=ns.currency.ns_currency_iso;break;case"symbol":u=ns.currency.ns_currency_symbol;break}let p;if(r==="full"){const h={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};p=N(a,h).format()}else p=S(a).format("0.0a");return`${ns.currency.ns_currency_position==="before"?u:""}${p}${ns.currency.ns_currency_position==="after"?u:""}`},H=a=>{const r=`0.${Z}`;return parseFloat(S(a).format(r))},Q=a=>S(a).format("0a");export{Y as _,H as a,C as b,j as c,Q as d,U as e,K as g,q as n}; + */var I={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:G,fromCents:!1},j=function(r){return Math.round(r)},V=function(r){return Math.pow(10,r)},z=function(r,l){return j(r/l)*l},A=/(\d)(?=(\d{3})+\b)/g,D=/(\d)(?=(\d\d)+\d\b)/g;function N(a,r){var l=this;if(!(l instanceof N))return new N(a,r);var u=Object.assign({},I,r),p=V(u.precision),b=$(a,u);l.intValue=b,l.value=b/p,u.increment=u.increment||1/p,u.useVedic?u.groups=D:u.groups=A,this.s=u,this.p=p}function $(a,r){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=0,p=r.decimal,b=r.errorOnInvalid,_=r.precision,d=r.fromCents,w=V(_),e=typeof a=="number",t=a instanceof N;if(t&&d)return a.intValue;if(e||t)u=t?a.value:a;else if(typeof a=="string"){var s=new RegExp("[^-\\d"+p+"]","g"),i=new RegExp("\\"+p,"g");u=a.replace(/\((.*)\)/,"-$1").replace(s,"").replace(i,"."),u=u||0}else{if(b)throw Error("Invalid Input");u=0}return d||(u*=w,u=u.toFixed(4)),l?j(u):u}function G(a,r){var l=r.pattern,u=r.negativePattern,p=r.symbol,b=r.separator,_=r.decimal,d=r.groups,w=(""+a).replace(/^-/,"").split("."),e=w[0],t=w[1];return(a.value>=0?l:u).replace("!",p).replace("#",e.replace(d,"$1"+b)+(t?_+t:""))}N.prototype={add:function(r){var l=this.intValue,u=this.s,p=this.p;return N((l+=$(r,u))/(u.fromCents?1:p),u)},subtract:function(r){var l=this.intValue,u=this.s,p=this.p;return N((l-=$(r,u))/(u.fromCents?1:p),u)},multiply:function(r){var l=this.intValue,u=this.s;return N((l*=r)/(u.fromCents?1:V(u.precision)),u)},divide:function(r){var l=this.intValue,u=this.s;return N(l/=$(r,u,!1),u)},distribute:function(r){for(var l=this.intValue,u=this.p,p=this.s,b=[],_=Math[l>=0?"floor":"ceil"](l/r),d=Math.abs(l-_*r),w=p.fromCents?1:u;r!==0;r--){var e=N(_/w,p);d-- >0&&(e=e[l>=0?"add":"subtract"](1/w)),b.push(e)}return b},dollars:function(){return~~this.value},cents:function(){var r=this.intValue,l=this.p;return~~(r%l)},format:function(r){var l=this.s;return typeof r=="function"?r(this,l):l.format(this,Object.assign({},l,r))},toString:function(){var r=this.intValue,l=this.p,u=this.s;return z(r/l,u.increment).toFixed(u.precision)},toJSON:function(){return this.value}};const J=new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map(a=>0).join(""),q=(a,r="full",l="en")=>{let u;switch(ns.currency.ns_currency_prefered){case"iso":u=ns.currency.ns_currency_iso;break;case"symbol":u=ns.currency.ns_currency_symbol;break}let p;if(r==="full"){const b={decimal:ns.currency.ns_currency_decimal_separator,separator:ns.currency.ns_currency_thousand_separator,precision:parseInt(ns.currency.ns_currency_precision),symbol:""};p=N(a,b).format()}else p=T(a).format("0.0a");return`${ns.currency.ns_currency_position==="before"?u:""}${p}${ns.currency.ns_currency_position==="after"?u:""}`},H=a=>{const r=`0.${J}`;return parseFloat(T(a).format(r))},Q=a=>T(a).format("0a");export{Y as _,H as a,Z as b,R as c,Q as d,U as e,K as g,q as n}; diff --git a/public/build/assets/dark-DLDKNvYK.css b/public/build/assets/dark-95e05480.css similarity index 61% rename from public/build/assets/dark-DLDKNvYK.css rename to public/build/assets/dark-95e05480.css index f5b20d1e7..5060cb1c1 100644 --- a/public/build/assets/dark-DLDKNvYK.css +++ b/public/build/assets/dark-95e05480.css @@ -1 +1 @@ -:root{--typography: 255 255 255;--surface: 15 23 42;--surface-soft: 30 41 59;--surface-hard: 15 23 42;--popup-surface: 51 65 85;--input-edge: 30 41 59;--input-background: 71 85 105;--input-disabled: 30 41 59;--input-button: 71 85 105;--input-button-hover: 59 130 246;--input-button-active: 59 130 246;--input-option-hover: 100 116 139;--box-background: 51 65 85;--box-edge: 71 85 105;--box-elevation-background: 71 85 105;--box-elevation-edge: 100 116 139;--box-elevation-hover: 100 116 139;--crud-button-edge: 71 85 105;--crud-input-background: 30 41 59;--pos-button-edge: 30 41 59;--numpad-background: 71 85 105;--numpad-typography: 250 250 250;--numpad-edge: 71 85 105;--numpad-hover: 71 85 105;--numpad-hover-edge: 71 85 105;--option-hover: 100 116 139;--scroll-thumb: 51 65 85;--scroll-track: 0 0 0;--scroll-popup-thumb: 71 85 105;--pre: 30 41 59;--tab-active: 51 65 85;--tab-active-border: 30 41 59;--tab-inactive: 30 41 59;--tab-table-th: 100 116 139;--tab-table-th-edge: 100 116 139;--table-th: 51 65 85;--table-th-edge: 71 85 105;--floating-menu: 71 85 105;--floating-menu-hover: 100 116 139;--floating-menu-selected: 71 85 105;--floating-menu-edge: 51 65 85;--primary: 226 232 240;--secondary: 203 213 225;--tertiary: 148 163 184;--soft-primary: 75 85 99;--soft-secondary: 107 114 128;--soft-tertiary: 156 163 175;--info-primary: 96 165 250;--info-secondary: 59 130 246;--info-tertiary: 37 99 235;--info-light-primary: 191 219 254;--info-light-secondary: 147 197 253;--info-light-tertiary: 96 165 250;--error-primary: 248 113 113;--error-secondary: 239 68 68;--error-tertiary: 220 38 38;--error-light-primary: 254 202 202;--error-light-secondary: 252 165 165;--error-light-tertiary: 248 113 113;--success-primary: 34 197 94;--success-secondary: 22 163 74;--success-tertiary: 21 128 61;--success-light-primary: 187 247 208;--success-light-secondary: 134 239 172;--success-light-tertiary: 74 222 128;--warning-primary: 251 146 60;--warning-secondary: 249 115 22;--warning-tertiary: 234 88 12;--warning-light-primary: 255 237 213;--warning-light-secondary: 254 215 170;--warning-light-tertiary: 253 186 116;--danger-primary: 202 138 4;--danger-secondary: 161 98 7;--danger-tertiary: 133 77 14;--danger-light-primary: 254 249 195;--danger-light-secondary: 254 240 138;--danger-light-tertiary: 253 224 71;--default-primary: 203 213 225;--default-secondary: 148 163 184;--default-tertiary: 100 116 139;--default-light-primary: 226 232 240;--default-light-secondary: 203 213 225;--default-light-tertiary: 148 163 184}.is-popup .ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-body{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.is-popup .ns-box h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-header,.ns-box .ns-box-body{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.ns-box h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice,.ns-notice h1,.ns-notice h2,.ns-notice h3,.ns-notice h4,.ns-notice h5,.ns-notice p,.ns-notice span,.ns-notice.danger h1,.ns-notice.danger h2,.ns-notice.danger h3,.ns-notice.danger h4,.ns-notice.danger h5,.ns-notice.warning h1,.ns-notice.warning h2,.ns-notice.warning h3,.ns-notice.warning h4,.ns-notice.warning h5,.ns-notice.success h1,.ns-notice.success h2,.ns-notice.success h3,.ns-notice.success h4,.ns-notice.success h5,.ns-notice.info h1,.ns-notice.info h2,.ns-notice.info h3,.ns-notice.info h4,.ns-notice.info h5,.ns-notice.error h1,.ns-notice.error h2,.ns-notice.error h3,.ns-notice.error h4,.ns-notice.error h5{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.danger{--tw-border-opacity: 1;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--danger-primary) / var(--tw-bg-opacity))}.ns-notice.danger p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.danger p>a:hover{text-decoration-line:underline}.ns-notice.danger pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-notice.warning p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.warning p>a:hover{text-decoration-line:underline}.ns-notice.warning pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-notice.success p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.success p>a:hover{text-decoration-line:underline}.ns-notice.success pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.error p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.error p>a:hover{text-decoration-line:underline}.ns-notice.error pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-notice.info p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.info p>a:hover{text-decoration-line:underline}.ns-notice.info pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-normal-text{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.info h2,.ns-floating-notice.info p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.error h2,.ns-floating-notice.error p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.warning h2,.ns-floating-notice.warning p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity))}.ns-floating-notice.success h2,.ns-floating-notice.success p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-switch button.selected{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-switch button.selected:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-switch button.unselected{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.input-group input,.input-group select{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group button{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.input-group button i,.input-group button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group button .disabled{--tw-bg-opacity: 1;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))}.input-group.info{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}.input-group.info input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.info button{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.info button i,.input-group.info button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.error{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.error input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.error button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error button i,.input-group.error button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.warning{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.warning input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.warning button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning button i,.input-group.warning button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.success{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))}.input-group.success input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.success button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success button i,.input-group.success button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-select select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-select select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.ns-select select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input [disabled],.ns-switch [disabled],.ns-select [disabled],.ns-textarea [disabled],.ns-media [disabled],.ns-checkbox [disabled]{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--tertiary) / var(--tw-text-opacity))}.ns-input .ns-enabled,.ns-switch .ns-enabled,.ns-select .ns-enabled,.ns-textarea .ns-enabled,.ns-media .ns-enabled,.ns-checkbox .ns-enabled{background-color:transparent}.ns-input label.has-error,.ns-switch label.has-error,.ns-select label.has-error,.ns-textarea label.has-error,.ns-media label.has-error,.ns-checkbox label.has-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-input label.is-pristine,.ns-switch label.is-pristine,.ns-select label.is-pristine,.ns-textarea label.is-pristine,.ns-media label.is-pristine,.ns-checkbox label.is-pristine{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input div.has-error,.ns-switch div.has-error,.ns-select div.has-error,.ns-textarea div.has-error,.ns-media div.has-error,.ns-checkbox div.has-error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))}.ns-input div.is-pristine,.ns-switch div.is-pristine,.ns-select div.is-pristine,.ns-textarea div.is-pristine,.ns-media div.is-pristine,.ns-checkbox div.is-pristine{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.ns-input .leading,.ns-switch .leading,.ns-select .leading,.ns-textarea .leading,.ns-media .leading,.ns-checkbox .leading{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input input,.ns-input textarea,.ns-switch input,.ns-switch textarea,.ns-select input,.ns-select textarea,.ns-textarea input,.ns-textarea textarea,.ns-media input,.ns-media textarea,.ns-checkbox input,.ns-checkbox textarea{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.ns-input button,.ns-switch button,.ns-select button,.ns-textarea button,.ns-media button,.ns-checkbox button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input button:hover,.ns-switch button:hover,.ns-select button:hover,.ns-textarea button:hover,.ns-media button:hover,.ns-checkbox button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-input p.ns-description,.ns-switch p.ns-description,.ns-select p.ns-description,.ns-textarea p.ns-description,.ns-media p.ns-description,.ns-checkbox p.ns-description{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input p.ns-error,.ns-switch p.ns-error,.ns-select p.ns-error,.ns-textarea p.ns-error,.ns-media p.ns-error,.ns-checkbox p.ns-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input{outline-width:0px}.form-input *[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input label{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity))}.form-input input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input input[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.form-input-invalid label{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input-invalid input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.form-input-invalid p{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button button,.ns-button a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))}.ns-button button:disabled,.ns-button a:disabled{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.ns-button:hover a,.ns-button:hover button{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-button.hover-success:hover button,.ns-button.hover-success:hover a,.ns-button.success button,.ns-button.success a{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-success:hover button span.ns-label,.ns-button.hover-success:hover a span.ns-label,.ns-button.success button span.ns-label,.ns-button.success a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-button.hover-error:hover button,.ns-button.hover-error:hover a,.ns-button.error button,.ns-button.error a{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-error:hover button span.ns-label,.ns-button.hover-error:hover a span.ns-label,.ns-button.error button span.ns-label,.ns-button.error a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button,.ns-button.hover-warning:hover a,.ns-button.warning button,.ns-button.warning a{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button span.ns-label,.ns-button.hover-warning:hover a span.ns-label,.ns-button.warning button span.ns-label,.ns-button.warning a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button,.ns-button.hover-default:hover a,.ns-button.default button,.ns-button.default a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button span.ns-label,.ns-button.hover-default:hover a span.ns-label,.ns-button.default button span.ns-label,.ns-button.default a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button,.ns-button.hover-info:hover a,.ns-button.info button,.ns-button.info a{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button span.ns-label,.ns-button.hover-info:hover a span.ns-label,.ns-button.info button span.ns-label,.ns-button.info a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}.ns-button .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-buttons button.success,.ns-buttons a.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.success span.ns-label,.ns-buttons a.success span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-buttons button.error,.ns-buttons a.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.error span.ns-label,.ns-buttons a.error span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-buttons button.warning,.ns-buttons a.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.warning span.ns-label,.ns-buttons a.warning span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-buttons button.default,.ns-buttons a.default{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--input-disabled) / var(--tw-text-opacity))}.ns-buttons button.default span.ns-label,.ns-buttons a.default span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.info,.ns-buttons a.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.info span.ns-label,.ns-buttons a.info span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button{--tw-border-opacity: 1;border-color:rgb(var(--input-button) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.ns-close-button:hover>i{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button:hover,.ns-floating-panel .ns-inset-button.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.info:hover,.ns-floating-panel .ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.success:hover,.ns-floating-panel .ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.warning:hover,.ns-floating-panel .ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.error:hover,.ns-floating-panel .ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-button) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-inset-button:hover,.ns-inset-button.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.info:hover,.ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.success:hover,.ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.warning:hover,.ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.error:hover,.ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-multiselect .ns-dropdown{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}.ns-daterange-picker .form-control.reportrange-text{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#crud-table #crud-table-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-table .ns-crud-input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-input-background) / var(--tw-bg-opacity))}#crud-table .ns-crud-input input,#crud-table .ns-crud-input select{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-table-row{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}#crud-table .ns-table-row td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-menu-wrapper>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#crud-table .ns-table-row .ns-action-button{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:focus{outline:2px solid transparent;outline-offset:2px}#crud-table .ns-crud-button,#crud-table .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-enabled,#crud-table .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-disabled,#crud-table .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover,#crud-table .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover i,#crud-table .ns-crud-button:hover span,#crud-table .ns-crud-input-button:hover i,#crud-table .ns-crud-input-button:hover span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-form .ns-crud-button,#crud-form .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-enabled,#crud-form .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-disabled,#crud-form .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-form .ns-crud-button:hover,#crud-form .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-background) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-form .ns-crud-input input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#main-container,#page-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.card-widget h1,.card-widget h2,.card-widget h3,.card-widget h4,.card-widget h5,.card-widget h6,.card-widget i{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#dashboard-aside>div{--tw-bg-opacity: 1;background-color:rgb(var(--surface-hard) / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-menu:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.toggled{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.normal{border-color:transparent}#dashboard-aside>div .ns-aside-menu.notification-label{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu.active{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu.normal{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}#dashboard-body{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.ns-toggle-button{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-toggle-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-avatar{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-avatar:hover,.ns-avatar.toggled{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.pending-drag{border-color:transparent}.awaiting-drop,.drag-over{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}#notificaton-wrapper #notification-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-button.panel-visible{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper #notification-button.panel-hidden{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper #notification-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-center>div>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper .clear-all{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .clear-all:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper .notification-card h1{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card .date{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#ns-orders-chart .head,#ns-orders-chart .foot{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-chart .foot>div{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-chart .foot>div span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-chart .foot>div h2{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .title{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-summary .head,#ns-orders-summary .title{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-summary .head h3,#ns-orders-summary .head i,#ns-orders-summary .head h4,#ns-orders-summary .head p,#ns-orders-summary .head span,#ns-orders-summary .title h3,#ns-orders-summary .title i,#ns-orders-summary .title h4,#ns-orders-summary .title p,#ns-orders-summary .title span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .paid-order,#ns-orders-summary .title .paid-order{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .other-order,#ns-orders-summary .title .other-order{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .head .single-order,#ns-orders-summary .title .single-order{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))}#ns-orders-summary .head .paid-currency,#ns-orders-summary .title .paid-currency{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .unpaid-currency,#ns-orders-summary .title .unpaid-currency{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers,#ns-best-cashiers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-best-customers .head,#ns-best-cashiers .head{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body,#ns-best-cashiers .body{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body .entry,#ns-best-cashiers .body .entry{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.ns-scrollbar::-webkit-scrollbar{width:5px}.ns-scrollbar::-webkit-scrollbar-track{background-color:#00000080}.ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-thumb) / var(--tw-bg-opacity))}.is-popup .ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-popup-thumb) / var(--tw-bg-opacity))}ul.ns-vertical-menu{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}ul.ns-vertical-menu li{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}ul.ns-vertical-menu li:hover,ul.ns-vertical-menu li.active{--tw-bg-opacity: 1;background-color:rgb(var(--floating-menu-selected) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup,#confirm-popup,#prompt-popup{--tw-bg-opacity: 1;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))}#alert-popup h2,#confirm-popup h2,#prompt-popup h2{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#alert-popup p,#confirm-popup p,#prompt-popup p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons,#confirm-popup .action-buttons,#prompt-popup .action-buttons{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons button:hover,#confirm-popup .action-buttons button:hover,#prompt-popup .action-buttons button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}#alert-popup .action-buttons hr,#confirm-popup .action-buttons hr,#prompt-popup .action-buttons hr{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.is-popup{background:#0006}.is-popup .elevation-surface{--tw-border-opacity: 1;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.success.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.error.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.info{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.info.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.warning.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#loader{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#loader p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customer-select-popup .purchase-amount{--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));font-weight:600;--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart>span.products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-grid{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div hr{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product:hover{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .price:hover{--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode:hover{background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .product-controls{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer>span{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-price{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart h3{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a:hover{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#pos-container #pos-grid .switch-cart{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-cart .products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-grid{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-header{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button.pos-button-clicked{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));box-shadow:inset 0 0 9px 2px #1e1e1e}#pos-container #pos-grid #grid-container #grid-header>div input{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb ul>li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item .cell-item-label{background:#000000ba}#pos-container #pos-grid #grid-container #grid-items .cell-item:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item i,#pos-container #pos-grid #grid-container #grid-items .cell-item span{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}#ns-pos-customers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-pos-customers .ns-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-pos-customers .ns-header h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customers .ns-body,#ns-order-type{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-order-type h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div>div>i{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#ns-order-type div>div div>p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div h4{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-units-selector .overlay{background:#000000ba}#ns-pos-cash-registers-popup div.alert{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}#ns-payment-popup .ns-pos-screen{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}#ns-payment-popup>div h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li.ns-payment-gateway.ns-visible,#ns-payment-popup>div ul li.ns-payment-list.ns-visible{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li:hover{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-type-button{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-submit-button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-layaway-button{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button .ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-list{--tw-border-opacity: 1;border-top-color:rgb(var(--tab-active) / var(--tw-border-opacity))}#ns-payment-popup>div .ns-payment-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab .tab{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab .tab.active{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab .tab.inactive{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab-item>div{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab-item>div .ns-tab-item-footer{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}h1,h2,h3,h4,h5,h6,i{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.ns-tab-item .ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody td{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table{width:100%}.ns-table thead{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table thead tr.error>th,.ns-table thead tr.error td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.success>th,.ns-table thead tr.success td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.info>th,.ns-table thead tr.info td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.warning>th,.ns-table thead tr.warning td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody,.ns-table tfoot{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tbody td,.ns-table tfoot td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody tr.info,.ns-table tfoot tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.error,.ns-table tfoot tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.success,.ns-table tfoot tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.warning,.ns-table tfoot tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody .ns-inset-button,.ns-table tfoot .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody .ns-inset-button.active,.ns-table tbody .ns-inset-button:hover,.ns-table tfoot .ns-inset-button.active,.ns-table tfoot .ns-inset-button:hover{border-color:transparent}.ns-table td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@keyframes loader-animation{0%{left:-100%}49%{left:100%}50%{left:100%}to{left:-100%}}.ns-loader{height:2px;width:100%;overflow:hidden;margin-top:-1px}.ns-loader .bar{position:relative;height:2px;width:100%;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));animation-name:loader-animation;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ns-numpad-key{--tw-border-opacity: 1;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-numpad-key:hover{--tw-border-opacity: 1;border-color:rgb(var(--numpad-hover-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))}.ns-numpad-key.error:hover,.ns-numpad-key.error.active{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}.ns-numpad-key.success:hover,.ns-numpad-key.success.active{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-numpad-key.info:hover,.ns-numpad-key.info.active{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-numpad-key.warning:hover,.ns-numpad-key.warning.active{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-numpad-key.default:hover,.ns-numpad-key.default.active{--tw-border-opacity: 1;border-color:rgb(var(--default-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--default-primary) / var(--tw-bg-opacity))}#ns-media .sidebar{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .sidebar h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .sidebar .sidebar-menus li{border-color:transparent}#ns-media .sidebar .sidebar-menus li.active,#ns-media .sidebar .sidebar-menus li:hover{--tw-border-opacity: 1;border-color:rgb(var(--tab-active) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .content{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#ns-media .content #ns-grid .ns-media-image-selected{--tw-ring-color: rgb(var(--info-primary) / var(--tw-ring-opacity));--tw-ring-opacity: .5}#ns-media .content .ns-media-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))}#ns-media .content .ns-media-preview-panel{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#crud-table tr.ns-table-row td>a{border-bottom-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))} +:root{--typography: 255 255 255;--surface: 15 23 42;--surface-soft: 30 41 59;--surface-hard: 15 23 42;--popup-surface: 51 65 85;--input-edge: 30 41 59;--input-background: 71 85 105;--input-disabled: 30 41 59;--input-button: 71 85 105;--input-button-hover: 59 130 246;--input-button-active: 59 130 246;--input-option-hover: 100 116 139;--box-background: 51 65 85;--box-edge: 71 85 105;--box-elevation-background: 71 85 105;--box-elevation-edge: 100 116 139;--box-elevation-hover: 100 116 139;--crud-button-edge: 71 85 105;--crud-input-background: 30 41 59;--pos-button-edge: 30 41 59;--numpad-background: 71 85 105;--numpad-typography: 250 250 250;--numpad-edge: 71 85 105;--numpad-hover: 71 85 105;--numpad-hover-edge: 71 85 105;--option-hover: 100 116 139;--scroll-thumb: 51 65 85;--scroll-track: 0 0 0;--scroll-popup-thumb: 71 85 105;--pre: 30 41 59;--tab-active: 51 65 85;--tab-active-border: 30 41 59;--tab-inactive: 30 41 59;--tab-table-th: 100 116 139;--tab-table-th-edge: 100 116 139;--table-th: 51 65 85;--table-th-edge: 71 85 105;--floating-menu: 71 85 105;--floating-menu-hover: 100 116 139;--floating-menu-selected: 71 85 105;--floating-menu-edge: 51 65 85;--primary: 226 232 240;--secondary: 203 213 225;--tertiary: 148 163 184;--soft-primary: 75 85 99;--soft-secondary: 107 114 128;--soft-tertiary: 156 163 175;--info-primary: 96 165 250;--info-secondary: 59 130 246;--info-tertiary: 37 99 235;--info-light-primary: 191 219 254;--info-light-secondary: 147 197 253;--info-light-tertiary: 96 165 250;--error-primary: 248 113 113;--error-secondary: 239 68 68;--error-tertiary: 220 38 38;--error-light-primary: 254 202 202;--error-light-secondary: 252 165 165;--error-light-tertiary: 248 113 113;--success-primary: 34 197 94;--success-secondary: 22 163 74;--success-tertiary: 21 128 61;--success-light-primary: 187 247 208;--success-light-secondary: 134 239 172;--success-light-tertiary: 74 222 128;--warning-primary: 251 146 60;--warning-secondary: 249 115 22;--warning-tertiary: 234 88 12;--warning-light-primary: 255 237 213;--warning-light-secondary: 254 215 170;--warning-light-tertiary: 253 186 116;--danger-primary: 202 138 4;--danger-secondary: 161 98 7;--danger-tertiary: 133 77 14;--danger-light-primary: 254 249 195;--danger-light-secondary: 254 240 138;--danger-light-tertiary: 253 224 71;--default-primary: 203 213 225;--default-secondary: 148 163 184;--default-tertiary: 100 116 139;--default-light-primary: 226 232 240;--default-light-secondary: 203 213 225;--default-light-tertiary: 148 163 184}.is-popup .ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-body{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.is-popup .ns-box h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-header,.ns-box .ns-box-body{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.ns-box h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice,.ns-notice h1,.ns-notice h2,.ns-notice h3,.ns-notice h4,.ns-notice h5,.ns-notice p,.ns-notice span,.ns-notice.danger h1,.ns-notice.danger h2,.ns-notice.danger h3,.ns-notice.danger h4,.ns-notice.danger h5,.ns-notice.warning h1,.ns-notice.warning h2,.ns-notice.warning h3,.ns-notice.warning h4,.ns-notice.warning h5,.ns-notice.success h1,.ns-notice.success h2,.ns-notice.success h3,.ns-notice.success h4,.ns-notice.success h5,.ns-notice.info h1,.ns-notice.info h2,.ns-notice.info h3,.ns-notice.info h4,.ns-notice.info h5,.ns-notice.error h1,.ns-notice.error h2,.ns-notice.error h3,.ns-notice.error h4,.ns-notice.error h5{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.danger{--tw-border-opacity: 1;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--danger-primary) / var(--tw-bg-opacity))}.ns-notice.danger p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.danger p>a:hover{text-decoration-line:underline}.ns-notice.danger pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-notice.warning p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.warning p>a:hover{text-decoration-line:underline}.ns-notice.warning pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-notice.success p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.success p>a:hover{text-decoration-line:underline}.ns-notice.success pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.error p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.error p>a:hover{text-decoration-line:underline}.ns-notice.error pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-notice.info p>a{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.ns-notice.info p>a:hover{text-decoration-line:underline}.ns-notice.info pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-normal-text{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.info h2,.ns-floating-notice.info p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.error h2,.ns-floating-notice.error p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.ns-floating-notice.warning h2,.ns-floating-notice.warning p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity))}.ns-floating-notice.success h2,.ns-floating-notice.success p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-switch button.selected{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-switch button.selected:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-switch button.unselected{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.input-group input,.input-group select{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group button{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.input-group button i,.input-group button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group button .disabled{--tw-bg-opacity: 1;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))}.input-group.info{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}.input-group.info input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.info button{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.info button i,.input-group.info button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.error{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.error input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.error button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error button i,.input-group.error button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.warning{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.warning input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.warning button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning button i,.input-group.warning button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.input-group.success{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))}.input-group.success input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.success button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success button i,.input-group.success button span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-select select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-select select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.ns-select select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input [disabled],.ns-switch [disabled],.ns-select [disabled],.ns-textarea [disabled],.ns-media [disabled],.ns-checkbox [disabled]{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--tertiary) / var(--tw-text-opacity))}.ns-input .ns-enabled,.ns-switch .ns-enabled,.ns-select .ns-enabled,.ns-textarea .ns-enabled,.ns-media .ns-enabled,.ns-checkbox .ns-enabled{background-color:transparent}.ns-input label.has-error,.ns-switch label.has-error,.ns-select label.has-error,.ns-textarea label.has-error,.ns-media label.has-error,.ns-checkbox label.has-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-input label.is-pristine,.ns-switch label.is-pristine,.ns-select label.is-pristine,.ns-textarea label.is-pristine,.ns-media label.is-pristine,.ns-checkbox label.is-pristine{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input div.has-error,.ns-switch div.has-error,.ns-select div.has-error,.ns-textarea div.has-error,.ns-media div.has-error,.ns-checkbox div.has-error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))}.ns-input div.is-pristine,.ns-switch div.is-pristine,.ns-select div.is-pristine,.ns-textarea div.is-pristine,.ns-media div.is-pristine,.ns-checkbox div.is-pristine{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.ns-input .leading,.ns-switch .leading,.ns-select .leading,.ns-textarea .leading,.ns-media .leading,.ns-checkbox .leading{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input input,.ns-input textarea,.ns-switch input,.ns-switch textarea,.ns-select input,.ns-select textarea,.ns-textarea input,.ns-textarea textarea,.ns-media input,.ns-media textarea,.ns-checkbox input,.ns-checkbox textarea{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.ns-input button,.ns-switch button,.ns-select button,.ns-textarea button,.ns-media button,.ns-checkbox button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input button:hover,.ns-switch button:hover,.ns-select button:hover,.ns-textarea button:hover,.ns-media button:hover,.ns-checkbox button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-input p.ns-description,.ns-switch p.ns-description,.ns-select p.ns-description,.ns-textarea p.ns-description,.ns-media p.ns-description,.ns-checkbox p.ns-description{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input p.ns-error,.ns-switch p.ns-error,.ns-select p.ns-error,.ns-textarea p.ns-error,.ns-media p.ns-error,.ns-checkbox p.ns-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input{outline-width:0px}.form-input *[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input label{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity))}.form-input input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input input[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.form-input-invalid label{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input-invalid input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.form-input-invalid p{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button button,.ns-button a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))}.ns-button button:disabled,.ns-button a:disabled{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.ns-button:hover a,.ns-button:hover button{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-button.hover-success:hover button,.ns-button.hover-success:hover a,.ns-button.success button,.ns-button.success a{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-success:hover button span.ns-label,.ns-button.hover-success:hover a span.ns-label,.ns-button.success button span.ns-label,.ns-button.success a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-button.hover-error:hover button,.ns-button.hover-error:hover a,.ns-button.error button,.ns-button.error a{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-error:hover button span.ns-label,.ns-button.hover-error:hover a span.ns-label,.ns-button.error button span.ns-label,.ns-button.error a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button,.ns-button.hover-warning:hover a,.ns-button.warning button,.ns-button.warning a{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button span.ns-label,.ns-button.hover-warning:hover a span.ns-label,.ns-button.warning button span.ns-label,.ns-button.warning a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button,.ns-button.hover-default:hover a,.ns-button.default button,.ns-button.default a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button span.ns-label,.ns-button.hover-default:hover a span.ns-label,.ns-button.default button span.ns-label,.ns-button.default a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button,.ns-button.hover-info:hover a,.ns-button.info button,.ns-button.info a{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button span.ns-label,.ns-button.hover-info:hover a span.ns-label,.ns-button.info button span.ns-label,.ns-button.info a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}.ns-button .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-buttons button.success,.ns-buttons a.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.success span.ns-label,.ns-buttons a.success span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-buttons button.error,.ns-buttons a.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.error span.ns-label,.ns-buttons a.error span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-buttons button.warning,.ns-buttons a.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.warning span.ns-label,.ns-buttons a.warning span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-buttons button.default,.ns-buttons a.default{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--input-disabled) / var(--tw-text-opacity))}.ns-buttons button.default span.ns-label,.ns-buttons a.default span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.info,.ns-buttons a.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-buttons button.info span.ns-label,.ns-buttons a.info span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button{--tw-border-opacity: 1;border-color:rgb(var(--input-button) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.ns-close-button:hover>i{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button:hover,.ns-floating-panel .ns-inset-button.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.info:hover,.ns-floating-panel .ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.success:hover,.ns-floating-panel .ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.warning:hover,.ns-floating-panel .ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.error:hover,.ns-floating-panel .ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-button) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-inset-button:hover,.ns-inset-button.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.info:hover,.ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.success:hover,.ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.warning:hover,.ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.error:hover,.ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-multiselect .ns-dropdown{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}.ns-daterange-picker .form-control.reportrange-text{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#crud-table #crud-table-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-table .ns-crud-input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-input-background) / var(--tw-bg-opacity))}#crud-table .ns-crud-input input,#crud-table .ns-crud-input select{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-table-row{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}#crud-table .ns-table-row td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-menu-wrapper>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#crud-table .ns-table-row .ns-action-button{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:focus{outline:2px solid transparent;outline-offset:2px}#crud-table .ns-crud-button,#crud-table .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-enabled,#crud-table .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-disabled,#crud-table .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover,#crud-table .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover i,#crud-table .ns-crud-button:hover span,#crud-table .ns-crud-input-button:hover i,#crud-table .ns-crud-input-button:hover span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-form .ns-crud-button,#crud-form .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-enabled,#crud-form .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-disabled,#crud-form .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-form .ns-crud-button:hover,#crud-form .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-background) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-form .ns-crud-input input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#main-container,#page-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.card-widget h1,.card-widget h2,.card-widget h3,.card-widget h4,.card-widget h5,.card-widget h6,.card-widget i{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#dashboard-aside>div{--tw-bg-opacity: 1;background-color:rgb(var(--surface-hard) / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-menu:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.toggled{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.normal{border-color:transparent}#dashboard-aside>div .ns-aside-menu.notification-label{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu.active{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu.normal{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}#dashboard-body{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.ns-toggle-button{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-toggle-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-avatar{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-avatar:hover,.ns-avatar.toggled{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.pending-drag{border-color:transparent}.awaiting-drop,.drag-over{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}#notificaton-wrapper #notification-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-button.panel-visible{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper #notification-button.panel-hidden{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper #notification-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-center>div>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper .clear-all{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .clear-all:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper .notification-card h1{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card .date{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#ns-orders-chart .head,#ns-orders-chart .foot{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-chart .foot>div{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-chart .foot>div span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-chart .foot>div h2{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .title{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-summary .head,#ns-orders-summary .title{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-summary .head h3,#ns-orders-summary .head i,#ns-orders-summary .head h4,#ns-orders-summary .head p,#ns-orders-summary .head span,#ns-orders-summary .title h3,#ns-orders-summary .title i,#ns-orders-summary .title h4,#ns-orders-summary .title p,#ns-orders-summary .title span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .paid-order,#ns-orders-summary .title .paid-order{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .other-order,#ns-orders-summary .title .other-order{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .head .single-order,#ns-orders-summary .title .single-order{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))}#ns-orders-summary .head .paid-currency,#ns-orders-summary .title .paid-currency{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .unpaid-currency,#ns-orders-summary .title .unpaid-currency{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers,#ns-best-cashiers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-best-customers .head,#ns-best-cashiers .head{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body,#ns-best-cashiers .body{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body .entry,#ns-best-cashiers .body .entry{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.ns-scrollbar::-webkit-scrollbar{width:5px}.ns-scrollbar::-webkit-scrollbar-track{background-color:#00000080}.ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-thumb) / var(--tw-bg-opacity))}.is-popup .ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-popup-thumb) / var(--tw-bg-opacity))}ul.ns-vertical-menu{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}ul.ns-vertical-menu li{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}ul.ns-vertical-menu li:hover,ul.ns-vertical-menu li.active{--tw-bg-opacity: 1;background-color:rgb(var(--floating-menu-selected) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup,#confirm-popup,#prompt-popup{--tw-bg-opacity: 1;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))}#alert-popup h2,#confirm-popup h2,#prompt-popup h2{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#alert-popup p,#confirm-popup p,#prompt-popup p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons,#confirm-popup .action-buttons,#prompt-popup .action-buttons{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons button:hover,#confirm-popup .action-buttons button:hover,#prompt-popup .action-buttons button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}#alert-popup .action-buttons hr,#confirm-popup .action-buttons hr,#prompt-popup .action-buttons hr{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.is-popup{background:rgba(0,0,0,.4)}.is-popup .elevation-surface{--tw-border-opacity: 1;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.success.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.error.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.info{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.info.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.is-popup .elevation-surface.warning.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#loader{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#loader p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customer-select-popup .purchase-amount{--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));font-weight:600;--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart>span.products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-grid{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div hr{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product:hover{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .price:hover{--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode:hover{background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .product-controls{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer>span{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-price{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart h3{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a:hover{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#pos-container #pos-grid .switch-cart{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-cart .products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-grid{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-header{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button.pos-button-clicked{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));box-shadow:inset 0 0 9px 2px #1e1e1e}#pos-container #pos-grid #grid-container #grid-header>div input{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb ul>li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item .cell-item-label{background:rgba(0,0,0,.73)}#pos-container #pos-grid #grid-container #grid-items .cell-item:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item i,#pos-container #pos-grid #grid-container #grid-items .cell-item span{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}#ns-pos-customers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-pos-customers .ns-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-pos-customers .ns-header h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customers .ns-body,#ns-order-type{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-order-type h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div>div>i{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#ns-order-type div>div div>p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div h4{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-units-selector .overlay{background:rgba(0,0,0,.73)}#ns-pos-cash-registers-popup div.alert{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}#ns-payment-popup .ns-pos-screen{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}#ns-payment-popup>div h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li.ns-payment-gateway.ns-visible,#ns-payment-popup>div ul li.ns-payment-list.ns-visible{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li:hover{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-type-button{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-submit-button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-layaway-button{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button .ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-list{--tw-border-opacity: 1;border-top-color:rgb(var(--tab-active) / var(--tw-border-opacity))}#ns-payment-popup>div .ns-payment-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab .tab{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab .tab.active{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab .tab.inactive{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab-item>div{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab-item>div .ns-tab-item-footer{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}h1,h2,h3,h4,h5,h6,i{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.ns-tab-item .ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody td{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table{width:100%}.ns-table thead{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table thead tr.error>th,.ns-table thead tr.error td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.success>th,.ns-table thead tr.success td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.info>th,.ns-table thead tr.info td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.warning>th,.ns-table thead tr.warning td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody,.ns-table tfoot{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tbody td,.ns-table tfoot td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody tr.info,.ns-table tfoot tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.error,.ns-table tfoot tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.success,.ns-table tfoot tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.warning,.ns-table tfoot tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody .ns-inset-button,.ns-table tfoot .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody .ns-inset-button.active,.ns-table tbody .ns-inset-button:hover,.ns-table tfoot .ns-inset-button.active,.ns-table tfoot .ns-inset-button:hover{border-color:transparent}.ns-table td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@keyframes loader-animation{0%{left:-100%}49%{left:100%}50%{left:100%}to{left:-100%}}.ns-loader{height:2px;width:100%;overflow:hidden;margin-top:-1px}.ns-loader .bar{position:relative;height:2px;width:100%;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));animation-name:loader-animation;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ns-numpad-key{--tw-border-opacity: 1;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-numpad-key:hover{--tw-border-opacity: 1;border-color:rgb(var(--numpad-hover-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))}.ns-numpad-key.error:hover,.ns-numpad-key.error.active{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}.ns-numpad-key.success:hover,.ns-numpad-key.success.active{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-numpad-key.info:hover,.ns-numpad-key.info.active{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))}.ns-numpad-key.warning:hover,.ns-numpad-key.warning.active{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-numpad-key.default:hover,.ns-numpad-key.default.active{--tw-border-opacity: 1;border-color:rgb(var(--default-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--default-primary) / var(--tw-bg-opacity))}#ns-media .sidebar{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .sidebar h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .sidebar .sidebar-menus li{border-color:transparent}#ns-media .sidebar .sidebar-menus li.active,#ns-media .sidebar .sidebar-menus li:hover{--tw-border-opacity: 1;border-color:rgb(var(--tab-active) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .content{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#ns-media .content #ns-grid .ns-media-image-selected{--tw-ring-color: rgb(var(--info-primary) / var(--tw-ring-opacity));--tw-ring-opacity: .5}#ns-media .content .ns-media-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))}#ns-media .content .ns-media-preview-panel{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#crud-table tr.ns-table-row td>a{border-bottom-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))} diff --git a/public/build/assets/dashboard-Dr37fGQI.js b/public/build/assets/dashboard-e07c0864.js similarity index 89% rename from public/build/assets/dashboard-Dr37fGQI.js rename to public/build/assets/dashboard-e07c0864.js index 1d57c63b4..9fc0d0a60 100644 --- a/public/build/assets/dashboard-Dr37fGQI.js +++ b/public/build/assets/dashboard-e07c0864.js @@ -1 +1 @@ -var d=Object.defineProperty;var o=(r,e,s)=>e in r?d(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var t=(r,e,s)=>(o(r,typeof e!="symbol"?e+"":e,s),s);import{a,B as i}from"./bootstrap-CnLEEQCx.js";import"./currency-lOMYG1Wf.js";import"./runtime-core.esm-bundler-RT2b-_3S.js";class n{constructor(){t(this,"_day");t(this,"_bestCustomers");t(this,"_bestCashiers");t(this,"_weeksSummary");t(this,"_recentOrders");t(this,"_reports",{day:a.get("/api/dashboard/day"),bestCustomers:a.get("/api/dashboard/best-customers"),weeksSummary:a.get("/api/dashboard/weeks"),bestCashiers:a.get("/api/dashboard/best-cashiers"),recentOrders:a.get("/api/dashboard/recent-orders")});this._day=new i({}),this._bestCustomers=new i([]),this._weeksSummary=new i({}),this._bestCashiers=new i([]),this._recentOrders=new i([]);for(let e in this._reports)this.loadReport(e)}loadReport(e){return this._reports[e].subscribe(s=>{this[`_${e}`].next(s)})}get day(){return this._day}get bestCustomers(){return this._bestCustomers}get bestCashiers(){return this._bestCashiers}get recentOrders(){return this._recentOrders}get weeksSummary(){return this._weeksSummary}}document.addEventListener("DOMContentLoaded",()=>{window.Dashboard=new n}); +var d=Object.defineProperty;var o=(r,e,s)=>e in r?d(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var t=(r,e,s)=>(o(r,typeof e!="symbol"?e+"":e,s),s);import{a,B as i}from"./bootstrap-8be442b1.js";import"./currency-f8bd78d1.js";import"./runtime-core.esm-bundler-b48de70a.js";class n{constructor(){t(this,"_day");t(this,"_bestCustomers");t(this,"_bestCashiers");t(this,"_weeksSummary");t(this,"_recentOrders");t(this,"_reports",{day:a.get("/api/dashboard/day"),bestCustomers:a.get("/api/dashboard/best-customers"),weeksSummary:a.get("/api/dashboard/weeks"),bestCashiers:a.get("/api/dashboard/best-cashiers"),recentOrders:a.get("/api/dashboard/recent-orders")});this._day=new i({}),this._bestCustomers=new i([]),this._weeksSummary=new i({}),this._bestCashiers=new i([]),this._recentOrders=new i([]);for(let e in this._reports)this.loadReport(e)}loadReport(e){return this._reports[e].subscribe(s=>{this[`_${e}`].next(s)})}get day(){return this._day}get bestCustomers(){return this._bestCustomers}get bestCashiers(){return this._bestCashiers}get recentOrders(){return this._recentOrders}get weeksSummary(){return this._weeksSummary}}document.addEventListener("DOMContentLoaded",()=>{window.Dashboard=new n}); diff --git a/public/build/assets/database-DWdkiGZ_.js b/public/build/assets/database-7955ce82.js similarity index 95% rename from public/build/assets/database-DWdkiGZ_.js rename to public/build/assets/database-7955ce82.js index 93ea3fa2b..fd71f2db7 100644 --- a/public/build/assets/database-DWdkiGZ_.js +++ b/public/build/assets/database-7955ce82.js @@ -1 +1 @@ -import{F as q}from"./bootstrap-CnLEEQCx.js";import{_ as s}from"./currency-lOMYG1Wf.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as b,o as i,c as d,a as t,t as r,e as n,F as h,b as F,g as f,w as p,A as y,i as P,f as w}from"./runtime-core.esm-bundler-RT2b-_3S.js";const C={data:()=>({formValidation:new q,firstPartFields:[],secondPartFields:[],fields:[],isLoading:!1,isCheckingDatabase:!1,__:s}),computed:{form(){return this.formValidation.extractFields([...this.firstPartFields,...this.secondPartFields])},isMySQL(){return this.form.database_driver==="mysql"},isMariaDB(){return this.form.database_driver==="mariadb"},isSqlite(){return this.form.database_driver==="sqlite"}},methods:{validate(){if(this.formValidation.validateFields(this.firstPartFields)&&this.formValidation.validateFields(this.secondPartFields)){this.isLoading=!0,this.formValidation.disableFields(this.firstPartFields),this.formValidation.disableFields(this.secondPartFields);const e={...this.formValidation.getValue(this.firstPartFields),...this.formValidation.getValue(this.secondPartFields)};this.checkDatabase(e).subscribe(o=>{this.formValidation.enableFields(this.firstPartFields),this.formValidation.enableFields(this.secondPartFields),nsRouter.push("configuration"),nsSnackBar.success(o.message,s("OKAY"),{duration:5e3}).subscribe()},o=>{this.formValidation.enableFields(this.firstPartFields),this.formValidation.enableFields(this.secondPartFields),this.isLoading=!1,nsSnackBar.error(o.message,s("OKAY")).subscribe()})}},checkDatabase(e){return nsHttpClient.post("/api/setup/database",e)},checkExisting(){return nsHttpClient.get("/api/setup/check-database")},sliceRange(e,l,o){const v=e.length,u=Math.ceil(v/l);return e.splice(o*u,u)},loadFields(){this.fields=this.formValidation.createFields([{label:s("Driver"),description:s("Set the database driver"),name:"database_driver",value:"mysql",type:"select",options:[{label:"MySQL",value:"mysql"},{label:"MariaDB",value:"mariadb"},{label:"SQLite",value:"sqlite"}],validation:"required"},{label:s("Hostname"),description:s("Provide the database hostname"),name:"hostname",value:"localhost",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Username"),description:s("Username required to connect to the database."),name:"username",value:"root",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Password"),description:s("The username password required to connect."),name:"password",value:"",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Database Name"),description:s("Provide the database name. Leave empty to use default file for SQLite Driver."),name:"database_name",value:"nexopos_v4",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Database Prefix"),description:s("Provide the database prefix."),name:"database_prefix",value:"ns_",validation:"required",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Port"),description:s("Provide the hostname port."),name:"database_port",value:"3306",validation:"required",show:e=>["mysql","mariadb"].includes(e.database_driver)}]),this.firstPartFields=Object.values(this.sliceRange([...this.fields],2,0)),this.secondPartFields=Object.values(this.sliceRange([...this.fields],2,1))}},mounted(){this.isCheckingDatabase=!0,this.checkExisting().subscribe({next:e=>{nsRouter.push("configuration")},error:e=>{this.isCheckingDatabase=!1,this.loadFields()}})}},D={key:0,class:"bg-white rounded shadow my-4"},L={class:"welcome-box border-b border-gray-300 p-3 text-gray-600"},x={class:"border-b pb-4 mb-4"},B={key:0},M={class:"font-bold text-lg"},N={key:1},Q={class:"font-bold text-lg"},O={class:"md:-mx-4 md:flex"},R={class:"md:px-4 md:w-1/2 w-full"},j={class:"md:px-4 md:w-1/2 w-full"},H={class:"bg-gray-200 p-3 flex justify-end"},$={key:1,class:"bg-white shadow rounded p-3 flex justify-center items-center"},A={class:"flex items-center"},E={class:"ml-3"};function Y(e,l,o,v,u,c){const _=b("ns-field"),g=b("ns-spinner"),k=b("ns-button");return i(),d(h,null,[e.isCheckingDatabase?n("",!0):(i(),d("div",D,[t("div",L,[t("div",x,[c.isMySQL?(i(),d("div",B,[t("h3",M,r(e.__("MySQL is selected as database driver")),1),t("p",null,r(e.__("Please provide the credentials to ensure NexoPOS can connect to the database.")),1)])):n("",!0),c.isSqlite?(i(),d("div",N,[t("h3",Q,r(e.__("Sqlite is selected as database driver")),1),t("p",null,r(e.__("Make sure Sqlite module is available for PHP. Your database will be located on the database directory.")),1)])):n("",!0)]),t("div",O,[t("div",R,[(i(!0),d(h,null,F(e.firstPartFields,(a,m)=>(i(),d(h,{key:m},[a.show===void 0||a.show!==void 0&&a.show(c.form)?(i(),f(_,{key:0,field:a,onChange:V=>e.formValidation.validateField(a)},{default:p(()=>[t("span",null,r(a.label),1),y(e.$slots,"description",{},()=>[P(r(a.description),1)])]),_:2},1032,["field","onChange"])):n("",!0)],64))),128))]),t("div",j,[(i(!0),d(h,null,F(e.secondPartFields,(a,m)=>(i(),d(h,{key:m},[a.show===void 0||a.show!==void 0&&a.show(c.form)?(i(),f(_,{key:0,field:a,onChange:V=>e.formValidation.validateField(a)},{default:p(()=>[t("span",null,r(a.label),1),y(e.$slots,"description",{},()=>[P(r(a.description),1)])]),_:2},1032,["field","onChange"])):n("",!0)],64))),128))])])]),t("div",H,[w(k,{disabled:e.isLoading,onClick:l[0]||(l[0]=a=>c.validate()),type:"info"},{default:p(()=>[e.isLoading?(i(),f(g,{key:0,class:"mr-2",size:6})):n("",!0),t("span",null,r(e.__("Save Settings")),1)]),_:1},8,["disabled"])])])),e.isCheckingDatabase?(i(),d("div",$,[t("div",A,[w(g,{size:10}),t("span",E,r(e.__("Checking database connectivity...")),1)])])):n("",!0)],64)}const G=S(C,[["render",Y]]);export{G as default}; +import{F as q}from"./bootstrap-8be442b1.js";import{_ as s}from"./currency-f8bd78d1.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";import{r as b,o as i,c as d,a as t,t as r,e as n,F as h,b as F,g as f,w as p,A as y,i as P,f as w}from"./runtime-core.esm-bundler-b48de70a.js";const C={data:()=>({formValidation:new q,firstPartFields:[],secondPartFields:[],fields:[],isLoading:!1,isCheckingDatabase:!1,__:s}),computed:{form(){return this.formValidation.extractFields([...this.firstPartFields,...this.secondPartFields])},isMySQL(){return this.form.database_driver==="mysql"},isMariaDB(){return this.form.database_driver==="mariadb"},isSqlite(){return this.form.database_driver==="sqlite"}},methods:{validate(){if(this.formValidation.validateFields(this.firstPartFields)&&this.formValidation.validateFields(this.secondPartFields)){this.isLoading=!0,this.formValidation.disableFields(this.firstPartFields),this.formValidation.disableFields(this.secondPartFields);const e={...this.formValidation.getValue(this.firstPartFields),...this.formValidation.getValue(this.secondPartFields)};this.checkDatabase(e).subscribe(o=>{this.formValidation.enableFields(this.firstPartFields),this.formValidation.enableFields(this.secondPartFields),nsRouter.push("configuration"),nsSnackBar.success(o.message,s("OKAY"),{duration:5e3}).subscribe()},o=>{this.formValidation.enableFields(this.firstPartFields),this.formValidation.enableFields(this.secondPartFields),this.isLoading=!1,nsSnackBar.error(o.message,s("OKAY")).subscribe()})}},checkDatabase(e){return nsHttpClient.post("/api/setup/database",e)},checkExisting(){return nsHttpClient.get("/api/setup/check-database")},sliceRange(e,l,o){const v=e.length,u=Math.ceil(v/l);return e.splice(o*u,u)},loadFields(){this.fields=this.formValidation.createFields([{label:s("Driver"),description:s("Set the database driver"),name:"database_driver",value:"mysql",type:"select",options:[{label:"MySQL",value:"mysql"},{label:"MariaDB",value:"mariadb"},{label:"SQLite",value:"sqlite"}],validation:"required"},{label:s("Hostname"),description:s("Provide the database hostname"),name:"hostname",value:"localhost",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Username"),description:s("Username required to connect to the database."),name:"username",value:"root",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Password"),description:s("The username password required to connect."),name:"password",value:"",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Database Name"),description:s("Provide the database name. Leave empty to use default file for SQLite Driver."),name:"database_name",value:"nexopos_v4",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Database Prefix"),description:s("Provide the database prefix."),name:"database_prefix",value:"ns_",validation:"required",show:e=>["mysql","mariadb"].includes(e.database_driver)},{label:s("Port"),description:s("Provide the hostname port."),name:"database_port",value:"3306",validation:"required",show:e=>["mysql","mariadb"].includes(e.database_driver)}]),this.firstPartFields=Object.values(this.sliceRange([...this.fields],2,0)),this.secondPartFields=Object.values(this.sliceRange([...this.fields],2,1))}},mounted(){this.isCheckingDatabase=!0,this.checkExisting().subscribe({next:e=>{nsRouter.push("configuration")},error:e=>{this.isCheckingDatabase=!1,this.loadFields()}})}},D={key:0,class:"bg-white rounded shadow my-4"},L={class:"welcome-box border-b border-gray-300 p-3 text-gray-600"},x={class:"border-b pb-4 mb-4"},B={key:0},M={class:"font-bold text-lg"},N={key:1},Q={class:"font-bold text-lg"},O={class:"md:-mx-4 md:flex"},R={class:"md:px-4 md:w-1/2 w-full"},j={class:"md:px-4 md:w-1/2 w-full"},H={class:"bg-gray-200 p-3 flex justify-end"},$={key:1,class:"bg-white shadow rounded p-3 flex justify-center items-center"},A={class:"flex items-center"},E={class:"ml-3"};function Y(e,l,o,v,u,c){const _=b("ns-field"),g=b("ns-spinner"),k=b("ns-button");return i(),d(h,null,[e.isCheckingDatabase?n("",!0):(i(),d("div",D,[t("div",L,[t("div",x,[c.isMySQL?(i(),d("div",B,[t("h3",M,r(e.__("MySQL is selected as database driver")),1),t("p",null,r(e.__("Please provide the credentials to ensure NexoPOS can connect to the database.")),1)])):n("",!0),c.isSqlite?(i(),d("div",N,[t("h3",Q,r(e.__("Sqlite is selected as database driver")),1),t("p",null,r(e.__("Make sure Sqlite module is available for PHP. Your database will be located on the database directory.")),1)])):n("",!0)]),t("div",O,[t("div",R,[(i(!0),d(h,null,F(e.firstPartFields,(a,m)=>(i(),d(h,{key:m},[a.show===void 0||a.show!==void 0&&a.show(c.form)?(i(),f(_,{key:0,field:a,onChange:V=>e.formValidation.validateField(a)},{default:p(()=>[t("span",null,r(a.label),1),y(e.$slots,"description",{},()=>[P(r(a.description),1)])]),_:2},1032,["field","onChange"])):n("",!0)],64))),128))]),t("div",j,[(i(!0),d(h,null,F(e.secondPartFields,(a,m)=>(i(),d(h,{key:m},[a.show===void 0||a.show!==void 0&&a.show(c.form)?(i(),f(_,{key:0,field:a,onChange:V=>e.formValidation.validateField(a)},{default:p(()=>[t("span",null,r(a.label),1),y(e.$slots,"description",{},()=>[P(r(a.description),1)])]),_:2},1032,["field","onChange"])):n("",!0)],64))),128))])])]),t("div",H,[w(k,{disabled:e.isLoading,onClick:l[0]||(l[0]=a=>c.validate()),type:"info"},{default:p(()=>[e.isLoading?(i(),f(g,{key:0,class:"mr-2",size:6})):n("",!0),t("span",null,r(e.__("Save Settings")),1)]),_:1},8,["disabled"])])])),e.isCheckingDatabase?(i(),d("div",$,[t("div",A,[w(g,{size:10}),t("span",E,r(e.__("Checking database connectivity...")),1)])])):n("",!0)],64)}const G=S(C,[["render",Y]]);export{G as default}; diff --git a/public/build/assets/dev-2K57nxTt.js b/public/build/assets/dev-0f5ad8b1.js similarity index 90% rename from public/build/assets/dev-2K57nxTt.js rename to public/build/assets/dev-0f5ad8b1.js index fc7c4d45a..aa3e31a11 100644 --- a/public/build/assets/dev-2K57nxTt.js +++ b/public/build/assets/dev-0f5ad8b1.js @@ -1 +1 @@ -import{c as A,d as B,e as H,b as h}from"./components-D4w1etK_.js";import{h as $,c as y}from"./bootstrap-CnLEEQCx.js";import{c as G,a as M}from"./vue-router-D26Ko6bT.js";import{_ as d}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";import{r as o,o as u,c as f,f as e,w as l,i as s,F as g,a as D,t as k}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./currency-lOMYG1Wf.js";import"./ns-avatar-image-CAD6xUGA.js";const T={name:"date",components:{nsDatepicker:A},computed:{formattedDate(){return $(this.date).format("YYYY-MM-DD HH:MM:ss")}},data(){return{active:"demo",date:$().format(),field:{label:"Date",name:"range",description:"a date range picker",value:{startDate:$().clone().subtract(1,"week").format(),endDate:$().format()}}}}};function w(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-datepicker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Picker")]),description:l(()=>[s("A simple date picker")]),_:1}),e(p,{active:t.active,onActive:n[1]||(n[1]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onSet:n[0]||(n[0]=i=>t.date=i),date:t.date},null,8,["date"])]),_:1})]),_:1},8,["active"])],64)}const F=d(T,[["render",w]]),P={name:"datepicker",components:{nsDaterangePicker:B},data(){return{active:"demo",field:{label:"Date",name:"range",description:"a date range picker"}}}};function C(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-daterange-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Range Picker")]),description:l(()=>[s("selects a range as a date.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const I=d(P,[["render",C]]),S={components:{nsDateTimePicker:H},data(){return{active:"demo",field:{label:"Date",name:"date",description:"a sample datetime field",value:""}}}};function Y(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-date-time-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Time Picker")]),description:l(()=>[s("A date time picker.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const L=d(S,[["render",Y]]),N={name:"index"};function R(_,n,m,b,t,v){return u(),f("h1",null,"Index")}const V=d(N,[["render",R]]),U={name:"input-label",data(){return{console,active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"inline-multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function E(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-inline-multiselect"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[2]||(n[2]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onChange:n[0]||(n[0]=i=>console.log(i)),onBlur:n[1]||(n[1]=i=>console.log(i)),field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const W=d(U,[["render",E]]),j={},q={class:"p-4 flex flex-col flex-auto"};function z(_,n){const m=o("router-view");return u(),f("div",q,[e(m)])}const J=d(j,[["render",z]]),K={name:"input-label",data(){return{active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function O(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const Q=d(K,[["render",O]]),X={name:"input-label",data(){return{active:"demo",field:{label:"Upload",name:"uploader",type:"upload",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function Z(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const ee=d(X,[["render",Z]]),te=[{path:"/",component:V},{path:"/inputs",component:J,children:[{path:"date",component:F},{path:"daterange",component:I},{path:"datetime",component:L},{path:"inline-multiselect",component:W},{path:"multiselect",component:Q},{path:"upload",component:ee}]}],ne=G({history:M(),routes:te}),x=y({});for(const _ in h)x.component(_,h[_]);x.use(ne);x.mount("#dev-app"); +import{c as A,d as B,e as H,b as h}from"./components-ef1ba55f.js";import{h as $,c as y}from"./bootstrap-8be442b1.js";import{c as G,a as M}from"./vue-router-fe7700e6.js";import{_ as d}from"./_plugin-vue_export-helper-c27b6911.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import{r as o,o as u,c as f,f as e,w as l,i as s,F as g,a as D,t as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./currency-f8bd78d1.js";import"./ns-avatar-image-35303576.js";const T={name:"date",components:{nsDatepicker:A},computed:{formattedDate(){return $(this.date).format("YYYY-MM-DD HH:MM:ss")}},data(){return{active:"demo",date:$().format(),field:{label:"Date",name:"range",description:"a date range picker",value:{startDate:$().clone().subtract(1,"week").format(),endDate:$().format()}}}}};function w(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-datepicker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Picker")]),description:l(()=>[s("A simple date picker")]),_:1}),e(p,{active:t.active,onActive:n[1]||(n[1]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onSet:n[0]||(n[0]=i=>t.date=i),date:t.date},null,8,["date"])]),_:1})]),_:1},8,["active"])],64)}const F=d(T,[["render",w]]),P={name:"datepicker",components:{nsDaterangePicker:B},data(){return{active:"demo",field:{label:"Date",name:"range",description:"a date range picker"}}}};function C(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-daterange-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Range Picker")]),description:l(()=>[s("selects a range as a date.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const I=d(P,[["render",C]]),S={components:{nsDateTimePicker:H},data(){return{active:"demo",field:{label:"Date",name:"date",description:"a sample datetime field",value:""}}}};function Y(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-date-time-picker"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Date Time Picker")]),description:l(()=>[s("A date time picker.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const L=d(S,[["render",Y]]),N={name:"index"};function R(_,n,m,b,t,v){return u(),f("h1",null,"Index")}const V=d(N,[["render",R]]),U={name:"input-label",data(){return{console,active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"inline-multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function E(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-inline-multiselect"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[2]||(n[2]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{onChange:n[0]||(n[0]=i=>console.log(i)),onBlur:n[1]||(n[1]=i=>console.log(i)),field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const W=d(U,[["render",E]]),j={},q={class:"p-4 flex flex-col flex-auto"};function z(_,n){const m=o("router-view");return u(),f("div",q,[e(m)])}const J=d(j,[["render",z]]),K={name:"input-label",data(){return{active:"demo",field:{label:"Tag Selector",name:"tag_selector",type:"multiselect",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function O(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const Q=d(K,[["render",O]]),X={name:"input-label",data(){return{active:"demo",field:{label:"Upload",name:"uploader",type:"upload",value:"",options:[{label:"Home",value:"home"},{label:"Bar",value:"bar"},{label:"Foo",value:"foo"}]}}}};function Z(_,n,m,b,t,v){const c=o("ns-page-title"),a=o("ns-tabs-item"),r=o("ns-field"),p=o("ns-tabs");return u(),f(g,null,[e(c,null,{title:l(()=>[s("Labels")]),description:l(()=>[s("creates a label selector fields.")]),_:1}),e(p,{active:t.active,onActive:n[0]||(n[0]=i=>t.active=i)},{default:l(()=>[e(a,{identifier:"general",label:"General"}),e(a,{identifier:"demo",label:"Demo"},{default:l(()=>[e(r,{field:t.field},null,8,["field"]),D("div",null,k(t.field),1)]),_:1})]),_:1},8,["active"])],64)}const ee=d(X,[["render",Z]]),te=[{path:"/",component:V},{path:"/inputs",component:J,children:[{path:"date",component:F},{path:"daterange",component:I},{path:"datetime",component:L},{path:"inline-multiselect",component:W},{path:"multiselect",component:Q},{path:"upload",component:ee}]}],ne=G({history:M(),routes:te}),x=y({});for(const _ in h)x.component(_,h[_]);x.use(ne);x.mount("#dev-app"); diff --git a/public/build/assets/fonts-DqDFhRvh.css b/public/build/assets/fonts-5cd6fc81.css similarity index 70% rename from public/build/assets/fonts-DqDFhRvh.css rename to public/build/assets/fonts-5cd6fc81.css index 36799bb48..af7df1fe4 100644 --- a/public/build/assets/fonts-DqDFhRvh.css +++ b/public/build/assets/fonts-5cd6fc81.css @@ -1 +1 @@ -@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-lS-xFuVv.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-C-TfKmp4.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-CgntkySV.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-D5gl4VXS.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-m_Q7yMDg.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73oTd4g-DUShLcwS.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:100;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:200;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:300;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:400;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:500;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:600;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:700;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:800;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt5D4hTxM-4487dbb9.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt7j4hTxM-479a0f37.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:italic;font-weight:900;font-display:swap;src:url(./92zUtBhPNqw73oHt4D4h-056b27ea.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:100;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:200;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:300;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:400;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:500;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:600;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:700;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:800;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73oDd4iYl-4e5d24cd.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73ord4iYl-807bd521.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Jost;font-style:normal;font-weight:900;font-display:swap;src:url(./92zatBhPNqw73oTd4g-fd4988cb.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} diff --git a/public/build/assets/grid-BxC3i8lq.css b/public/build/assets/grid-48793d28.css similarity index 100% rename from public/build/assets/grid-BxC3i8lq.css rename to public/build/assets/grid-48793d28.css diff --git a/public/build/assets/index.es-Br67aBEV.js b/public/build/assets/index.es-25aa42ee.js similarity index 87% rename from public/build/assets/index.es-Br67aBEV.js rename to public/build/assets/index.es-25aa42ee.js index 04e8c1d8a..c38349da2 100644 --- a/public/build/assets/index.es-Br67aBEV.js +++ b/public/build/assets/index.es-25aa42ee.js @@ -1,84 +1,84 @@ -import{b as $}from"./currency-lOMYG1Wf.js";function K1(e){for(var t="#",a=1;a * @license MIT - */var f2=function(e){return e!=null&&(v1(e)||d2(e)||!!e._isBuffer)};function v1(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function d2(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&v1(e.slice(0,0))}var p2=f2,h2=Object.prototype.toString,v2=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var a=h2.call(t);return a==="[object RegExp]"?"regexp":a==="[object Date]"?"date":a==="[object Arguments]"?"arguments":a==="[object Error]"?"error":p2(t)?"buffer":a==="[object Set]"?"set":a==="[object WeakSet]"?"weakset":a==="[object Map]"?"map":a==="[object WeakMap]"?"weakmap":a==="[object Symbol]"?"symbol":a==="[object Int8Array]"?"int8array":a==="[object Uint8Array]"?"uint8array":a==="[object Uint8ClampedArray]"?"uint8clampedarray":a==="[object Int16Array]"?"int16array":a==="[object Uint16Array]"?"uint16array":a==="[object Int32Array]"?"int32array":a==="[object Uint32Array]"?"uint32array":a==="[object Float32Array]"?"float32array":a==="[object Float64Array]"?"float64array":"object"},m1={exports:{}};(function(e){(function(){function t(a,r){if(typeof r!="function")return a;var n={};for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[r(i,a[i])||i]=a[i]);return n}e.exports?e.exports=t:window.rename=t})()})(m1);var m2=m1.exports;/*! + */var i2=function(e){return e!=null&&(m1(e)||c2(e)||!!e._isBuffer)};function m1(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function c2(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&m1(e.slice(0,0))}var l2=i2,o2=Object.prototype.toString,u2=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var a=o2.call(t);return a==="[object RegExp]"?"regexp":a==="[object Date]"?"date":a==="[object Arguments]"?"arguments":a==="[object Error]"?"error":l2(t)?"buffer":a==="[object Set]"?"set":a==="[object WeakSet]"?"weakset":a==="[object Map]"?"map":a==="[object WeakMap]"?"weakmap":a==="[object Symbol]"?"symbol":a==="[object Int8Array]"?"int8array":a==="[object Uint8Array]"?"uint8array":a==="[object Uint8ClampedArray]"?"uint8clampedarray":a==="[object Int16Array]"?"int16array":a==="[object Uint16Array]"?"uint16array":a==="[object Int32Array]"?"int32array":a==="[object Uint32Array]"?"uint32array":a==="[object Float32Array]"?"float32array":a==="[object Float64Array]"?"float64array":"object"},K={},s2={get exports(){return K},set exports(e){K=e}};(function(e){(function(){function t(a,r){if(typeof r!="function")return a;var n={};for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[r(i,a[i])||i]=a[i]);return n}e.exports?e.exports=t:window.rename=t})()})(s2);/*! * deep-rename-keys * * Copyright (c) 2015 Jon Schlinkert, contributors. * Licensed under the MIT license. - */var q=v2,y2=m2,g2=function e(t,a){var r=q(t);if(r!=="object"&&r!=="array")throw new Error("expected an object");var n=[];r==="object"&&(t=y2(t,a),n={});for(var i in t)if(t.hasOwnProperty(i)){var c=t[i];q(c)==="object"||q(c)==="array"?n[i]=e(c,a):n[i]=c}return n};const b2=$(g2);var y1={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,a="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(a=!1));function n(c,l,o){this.fn=c,this.context=l,this.once=o||!1}function i(){this._events=new r,this._eventsCount=0}i.prototype.eventNames=function(){var l=[],o,u;if(this._eventsCount===0)return l;for(u in o=this._events)t.call(o,u)&&l.push(a?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(o)):l},i.prototype.listeners=function(l,o){var u=a?a+l:l,p=this._events[u];if(o)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var f=0,b=p.length,s=new Array(b);f":h.gt,'"':h.quote,"'":h.quote,"=":h.equal,"/":h.slash},M2=function(t){return C2[t]||h.char},A2=function(t){var a,r,n,i,c,l,o,u,p,f;t=Object.assign({debug:!1},t);var b=new z2,s=y.data,d="",C="",A="",v="",x="",F="",z=function(k,B){if(!(C[0]==="?"||C[0]==="!")){var H={type:k,value:B};t.debug&&console.log("emit:",H),b.emit("data",H)}};b.stateMachine=(f={},m(f,y.data,(a={},m(a,h.lt,function(){d.trim()&&z(M.text,d),C="",x=!1,s=y.tagBegin}),m(a,h.char,function(g){d+=g}),a)),m(f,y.cdata,m({},h.char,function(g){d+=g,d.substr(-3)==="]]>"&&(z(M.text,d.slice(0,-3)),d="",s=y.data)})),m(f,y.tagBegin,(r={},m(r,h.space,V),m(r,h.char,function(g){C=g,s=y.tagName}),m(r,h.slash,function(){C="",x=!0}),r)),m(f,y.tagName,(n={},m(n,h.space,function(){x?s=y.tagEnd:(s=y.attributeNameStart,z(M.openTag,C))}),m(n,h.gt,function(){z(x?M.closeTag:M.openTag,C),d="",s=y.data}),m(n,h.slash,function(){s=y.tagEnd,z(M.openTag,C)}),m(n,h.char,function(g){C+=g,C==="![CDATA["&&(s=y.cdata,d="",C="")}),n)),m(f,y.tagEnd,(i={},m(i,h.gt,function(){z(M.closeTag,C),d="",s=y.data}),m(i,h.char,V),i)),m(f,y.attributeNameStart,(c={},m(c,h.char,function(g){A=g,s=y.attributeName}),m(c,h.gt,function(){d="",s=y.data}),m(c,h.space,V),m(c,h.slash,function(){x=!0,s=y.tagEnd}),c)),m(f,y.attributeName,(l={},m(l,h.space,function(){s=y.attributeNameEnd}),m(l,h.equal,function(){z(M.attributeName,A),s=y.attributeValueBegin}),m(l,h.gt,function(){v="",z(M.attributeName,A),z(M.attributeValue,v),d="",s=y.data}),m(l,h.slash,function(){x=!0,v="",z(M.attributeName,A),z(M.attributeValue,v),s=y.tagEnd}),m(l,h.char,function(g){A+=g}),l)),m(f,y.attributeNameEnd,(o={},m(o,h.space,V),m(o,h.equal,function(){z(M.attributeName,A),s=y.attributeValueBegin}),m(o,h.gt,function(){v="",z(M.attributeName,A),z(M.attributeValue,v),d="",s=y.data}),m(o,h.char,function(g){v="",z(M.attributeName,A),z(M.attributeValue,v),A=g,s=y.attributeName}),o)),m(f,y.attributeValueBegin,(u={},m(u,h.space,V),m(u,h.quote,function(g){F=g,v="",s=y.attributeValue}),m(u,h.gt,function(){v="",z(M.attributeValue,v),d="",s=y.data}),m(u,h.char,function(g){F="",v=g,s=y.attributeValue}),u)),m(f,y.attributeValue,(p={},m(p,h.space,function(g){F?v+=g:(z(M.attributeValue,v),s=y.attributeNameStart)}),m(p,h.quote,function(g){F===g?(z(M.attributeValue,v),s=y.attributeNameStart):v+=g}),m(p,h.gt,function(g){F?v+=g:(z(M.attributeValue,v),d="",s=y.data)}),m(p,h.slash,function(g){F?v+=g:(z(M.attributeValue,v),x=!0,s=y.tagEnd)}),m(p,h.char,function(g){v+=g}),p)),f);var N=function(k){t.debug&&console.log(s,k);var B=b.stateMachine[s],H=B[M2(k)]||B[h.error]||B[h.char];H(k)};return b.write=function(g){for(var k=g.length,B=0;B".concat(t,""),{parentNodes:!1}),r=a.children&&a.children.length>0&&a.children.every(function(n){return n.name==="svg"});if(r)return a.children.length===1?a.children[0]:a.children;throw Error("nothing to parse")},_2=function(t){return b2(t,function(a){return B2(a)?a:S2(a)})},S2=function(t){return t.replace(/[-|:]([a-z])/gi,function(a,r){return r.toUpperCase()})},B2=function(t){return/^(data|aria)(-\w+)/.test(t)},H2=function(t){if(t){var a=String(t);return/[&<>]/.test(a)?"/,"]]]]>"),"]]>"):a}return""},D2=function(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")},O2=function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.transformNode,n=r===void 0?function(o){return o}:r,i=a.camelcase,c=i===void 0?!1:i,l=function(u){var p;return p=n(u),c&&(p=_2(p)),p};return l(E2(t))},N2=function e(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.transformAttr,n=r===void 0?function(s,d,C){return"".concat(s,'="').concat(C(d),'"')}:r,i=a.transformNode,c=i===void 0?function(s){return s}:i,l=a.selfClose,o=l===void 0?!0:l;if(Array.isArray(t))return t.map(function(s){return e(s,{transformAttr:n,selfClose:o,transformNode:c})}).join("");var u=c(t);if(u.type==="text")return H2(u.value);var p="";for(var f in u.attributes){var b=n(f,u.attributes[f],D2,u.name);p+=b?" ".concat(b):""}return u.children&&u.children.length>0||!o?"<".concat(u.name).concat(p,">").concat(e(u.children,{transformAttr:n,transformNode:c,selfClose:o}),""):"<".concat(u.name).concat(p,"/>")};function d1(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,r)}return a}function O(e){for(var t=1;t=0)&&(a[n]=e[n]);return a}function T2(e,t){if(e==null)return{};var a=V2(e,t),r,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function j2(e){return I2(e)||C1(e)||a1(e)||L2()}function K(e){return $2(e)||C1(e)||a1(e)||R2()}function $2(e){if(Array.isArray(e))return X(e)}function I2(e){if(Array.isArray(e))return e}function C1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a1(e,t){if(e){if(typeof e=="string")return X(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(o){throw o},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,c=!1,l;return{s:function(){a=a.call(e)},n:function(){var o=a.next();return i=o.done,o},e:function(o){c=!0,l=o},f:function(){try{!i&&a.return!=null&&a.return()}finally{if(c)throw l}}}}function P2(e,t){if(typeof e!="object"||e===null)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W2(e){var t=P2(e,"string");return typeof t=="symbol"?t:String(t)}var L=-2147483648,M1=2147483647;function A1(e){return e^=e<<13,e^=e>>17,e^=e<<5,e}function G2(e){for(var t=0,a=0;a0&&arguments[0]!==void 0?arguments[0]:50;return n(0,100)0&&arguments[0]!==void 0?arguments[0]:50;return this.prng.bool(a)}},{key:"integer",value:function(a,r){return this.prng.integer(a,r)}},{key:"pickone",value:function(a){return this.prng.pick(a)}}]),e}(),Y2={50:"#FFF8E1",100:"#FFECB3",200:"#FFE082",300:"#FFB74D",400:"#FFCA28",500:"#FFC107",600:"#FFB300",700:"#FFA000",800:"#FF8F00",900:"#FF6F00"},K2={50:"#E3F2FD",100:"#BBDEFB",200:"#90CAF9",300:"#64B5F6",400:"#42A5F5",500:"#2196F3",600:"#1E88E5",700:"#1976D2",800:"#1565C0",900:"#0D47A1"},X2={50:"#ECEFF1",100:"#CFD8DC",200:"#B0BEC5",300:"#90A4AE",400:"#78909C",500:"#607D8B",600:"#546E7A",700:"#455A64",800:"#37474F",900:"#263238"},Z2={50:"#EFEBE9",100:"#D7CCC8",200:"#BCAAA4",300:"#A1887F",400:"#8D6E63",500:"#795548",600:"#6D4C41",700:"#5D4037",800:"#4E342E",900:"#3E2723"},Q2={50:"#E0F7FA",100:"#B2EBF2",200:"#80DEEA",300:"#4DD0E1",400:"#26C6DA",500:"#00BCD4",600:"#00ACC1",700:"#0097A7",800:"#00838F",900:"#006064"},J2={50:"#FBE9E7",100:"#FFCCBC",200:"#FFAB91",300:"#A1887F",400:"#FF7043",500:"#FF5722",600:"#F4511E",700:"#E64A19",800:"#D84315",900:"#BF360C"},e3={50:"#EDE7F6",100:"#D1C4E9",200:"#B39DDB",300:"#9575CD",400:"#7E57C2",500:"#673AB7",600:"#5E35B1",700:"#512DA8",800:"#4527A0",900:"#311B92"},t3={50:"#E8F5E9",100:"#C8E6C9",200:"#A5D6A7",300:"#81C784",400:"#66BB6A",500:"#4CAF50",600:"#43A047",700:"#388E3C",800:"#2E7D32",900:"#1B5E20"},a3={50:"#FAFAFA",100:"#F5F5F5",200:"#EEEEEE",300:"#E0E0E0",400:"#BDBDBD",500:"#9E9E9E",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},r3={50:"#E8EAF6",100:"#C5CAE9",200:"#9FA8DA",300:"#7986CB",400:"#5C6BC0",500:"#3F51B5",600:"#3949AB",700:"#303F9F",800:"#283593",900:"#1A237E"},n3={50:"#E1F5FE",100:"#B3E5FC",200:"#81D4FA",300:"#4FC3F7",400:"#29B6F6",500:"#03A9F4",600:"#039BE5",700:"#0288D1",800:"#0277BD",900:"#01579B"},i3={50:"#F1F8E9",100:"#DCEDC8",200:"#C5E1A5",300:"#AED581",400:"#9CCC65",500:"#8BC34A",600:"#7CB342",700:"#689F38",800:"#558B2F",900:"#33691E"},c3={50:"#F9FBE7",100:"#F0F4C3",200:"#E6EE9C",300:"#DCE775",400:"#D4E157",500:"#CDDC39",600:"#C0CA33",700:"#AFB42B",800:"#9E9D24",900:"#827717"},l3={50:"#FFF3E0",100:"#FFE0B2",200:"#FFCC80",300:"#FF8A65",400:"#FFA726",500:"#FF9800",600:"#FB8C00",700:"#F57C00",800:"#EF6C00",900:"#E65100"},o3={50:"#FCE4EC",100:"#F8BBD0",200:"#F48FB1",300:"#F06292",400:"#EC407A",500:"#E91E63",600:"#D81B60",700:"#C2185B",800:"#AD1457",900:"#880E4F"},u3={50:"#F3E5F5",100:"#E1BEE7",200:"#CE93D8",300:"#BA68C8",400:"#AB47BC",500:"#9C27B0",600:"#8E24AA",700:"#7B1FA2",800:"#6A1B9A",900:"#4A148C"},s3={50:"#FFEBEE",100:"#FFCDD2",200:"#EF9A9A",300:"#E57373",400:"#EF5350",500:"#F44336",600:"#E53935",700:"#D32F2F",800:"#C62828",900:"#B71C1C"},f3={50:"#E0F2F1",100:"#B2DFDB",200:"#80CBC4",300:"#4DB6AC",400:"#26A69A",500:"#009688",600:"#00897B",700:"#00796B",800:"#00695C",900:"#004D40"},d3={50:"#FFFDE7",100:"#FFF9C4",200:"#FFF59D",300:"#FFF176",400:"#FFEE58",500:"#FFEB3B",600:"#FDD835",700:"#FBC02D",800:"#F9A825",900:"#F57F17"},p3={amber:Y2,blue:K2,blueGrey:X2,brown:Z2,cyan:Q2,deepOrange:J2,deepPurple:e3,green:t3,grey:a3,indigo:r3,lightBlue:n3,lightGreen:i3,lime:c3,orange:l3,pink:o3,purple:u3,red:s3,teal:f3,yellow:d3},w1=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000";if(P(this,e),E(this,"alpha",1),E(this,"color",{}),t[0]=="#")this.hex=t;else{var a=/^(rgb|rgba|hsv)\(([0-9\%\,\.\s]+)\)$/.exec(t.trim());if(a){var r=a[2].split(",").map(function(n){return parseInt(n.trim())});switch(a[1]){case"rgb":this.rgb=r;break;case"rgba":this.rgba=r;break;case"hsv":this.hsv=r;break;default:throw new Error("Unsupported color format: "+t)}}else throw new Error("Unknown color format: "+t)}}return W(e,[{key:"clone",value:function(){return new e("rgb("+this.rgb.join(",")+")")}},{key:"rgb",get:function(){return this.color.rgb=this.color.rgb||(this.color.hex?this.hexToRgb(this.hex):this.hsvToRgb(this.hsv))},set:function(a){if(a.length!=3)throw new Error("An array with a length of 3 is expected.");this.alpha=1,this.color={rgb:a}}},{key:"rgba",get:function(){return[this.rgb[0],this.rgb[1],this.rgb[2],this.alpha]},set:function(a){if(a.length!=4)throw new Error("An array with a length of 3 is expected.");this.rgb=[a[0],a[1],a[2]],this.alpha=a[3]}},{key:"hsv",get:function(){return(this.color.hsv=this.color.hsv||this.rgbToHsv(this.rgb)).slice(0)},set:function(a){if(a.length!=3)throw new Error("An array with a length of 3 is expected.");this.alpha=1,this.color={hsv:a}}},{key:"hex",get:function(){return(this.color.hex=this.color.hex||this.rgbToHex(this.rgb)).slice(0)},set:function(a){this.alpha=1,this.color={hex:a}}},{key:"brighterThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]>=i[2]+r?this:(n[2]=i[2]+r,n[2]>360&&(n[2]=360),this.hsv=n,this)}},{key:"darkerThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]<=i[2]-r?this:(n[2]=i[2]-r,n[2]<0&&(n[2]=0),this.hsv=n,this)}},{key:"brighterOrDarkerThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]<=i[2]?this.darkerThan(a,r):this.brighterThan(a,r)}},{key:"rgbToHex",value:function(a){return l2(a)}},{key:"hexToRgb",value:function(a){return Q1(a).map(function(r){return Math.round(r)})}},{key:"rgbToHsv",value:function(a){return t2(a).map(function(r){return Math.round(r)})}},{key:"hsvToRgb",value:function(a){return s2(a).map(function(r){return Math.round(r)})}}]),e}();E(w1,"collection",p3);var R=function(){function e(){P(this,e)}return W(e,null,[{key:"parse",value:function(a){return typeof a=="string"?O2(a):a}},{key:"stringify",value:function(a){return typeof a=="string"?a:N2(a)}}]),e}();function Z(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")}var h3=Object.freeze({__proto__:null,xml:Z}),x1={type:"object",$schema:"http://json-schema.org/draft-07/schema#",title:"Options",properties:{seed:{title:"Seed",type:"string"},s:{title:"Seed",type:"string"},base64:{title:"Base64",description:"@deprecated use dataUri instead",type:"boolean",default:!1},dataUri:{title:"Data URI",type:"boolean",default:!1},userAgent:{title:"User Agent",description:"@deprecated",type:"string"},flip:{title:"Flip",type:"boolean",default:!1},rotate:{title:"Rotate",type:"integer",minimum:0,maximum:360,default:0},scale:{title:"Scale",type:"integer",minimum:0,maximum:200,default:100},radius:{title:"Radius",type:"integer",minimum:0,maximum:50,default:0},r:{title:"Radius",type:"integer",minimum:0,maximum:50,default:0},width:{title:"Width",description:"@deprecated use size instead",type:"integer",minimum:1},w:{title:"Width",description:"@deprecated use size instead",type:"integer",minimum:1},height:{title:"Height",description:"@deprecated use size instead",type:"integer",minimum:1},h:{title:"Height",description:"@deprecated use size instead",type:"integer",minimum:1},size:{title:"Size",type:"integer",minimum:1},margin:{title:"Margin",description:"@deprecated use scale instead",type:"integer",minimum:0,maximum:25,default:0},m:{title:"Margin",description:"@deprecated use scale instead",type:"integer",minimum:0,maximum:25,default:0},backgroundColor:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}]},background:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}],description:"@deprecated use backgroundColor instead"},b:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}]},translateX:{title:"Translate X%",type:"integer",minimum:-100,maximum:100,default:0},translateY:{title:"Translate Y%",type:"integer",minimum:-100,maximum:100,default:0}},additionalProperties:!1};function r1(e){return e.properties||{}}function Q(e){var t={},a=r1(e);return Object.keys(a).forEach(function(r){var n=a[r];j(n)==="object"&&n.default!==void 0&&(Array.isArray(n.default)?t[r]=K(n.default):j(n.default)==="object"?t[r]=O({},n.default):t[r]=n.default)}),t}function k1(e){var t={},a=r1(e);return Object.keys(a).forEach(function(r){var n=a[r];if(j(n)==="object"){var i=n.title;i&&(t[i]=t[i]||[],t[i].push(r))}}),Object.values(t).filter(function(r){return r.length>1}).map(function(r){return r.sort().sort(function(n,i){return n.length===i.length?0:n.length>i.length?1:-1})})}function J(e){var t=new Map,a=h1(k1(e)),r;try{for(a.s();!(r=a.n()).done;){var n=r.value,i=n.reverse(),c=j2(i),l=c[0],o=c.slice(1),u=h1(o),p;try{for(u.s();!(p=u.n()).done;){var f=p.value;t.set(f,l)}}catch(b){u.e(b)}finally{u.f()}}}catch(b){a.e(b)}finally{a.f()}return t}var v3=Object.freeze({__proto__:null,properties:r1,defaults:Q,aliases:k1,aliasesMap:J});function E1(e,t){e[t];var a=T2(e,[t].map(W2));return a}var m3=Object.freeze({__proto__:null,omit:E1});function n1(e,t){var a=[{seed:Math.random().toString(),userAgent:typeof window<"u"&&window.navigator&&window.navigator.userAgent},Q(x1),Q(e.schema),t],r=_1(e);return a.forEach(function(n){r=Object.assign(r,E1(n,"_aliases"))}),r}function _1(e){var t=new Map([].concat(K(Array.from(J(x1))),K(Array.from(J(e.schema)))));return new Proxy({_aliases:t},{get:function(r,n){var i,c=(i=r._aliases.get(n))!==null&&i!==void 0?i:n;return r[c]},set:function(r,n,i){var c,l=(c=r._aliases.get(n))!==null&&c!==void 0?c:n;return r[l]=i,!0},deleteProperty:function(r,n){var i,c=(i=r._aliases.get(n))!==null&&i!==void 0?i:n;return delete r[c],!0}})}var y3=Object.freeze({__proto__:null,merge:n1,createAliasProxy:_1}),g3={by:{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution"],prohibits:[]},"by-sa":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution","ShareAlike"],prohibits:[]},"by-nd":{permits:["Reproduction","Distribution"],requires:["Notice","Attribution"],prohibits:[]},"by-nc":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution"],prohibits:["CommercialUse"]},"by-nc-sa":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution","ShareAlike"],prohibits:["CommercialUse"]},"by-nc-nd":{permits:["Reproduction","Distribution"],requires:["Notice","Attribution"],prohibits:["CommercialUse"]},zero:{permits:["Reproduction","Distribution","DerivativeWorks"],requires:[],prohibits:[]}};function b3(e){var t=e.children,a=e.x,r=e.y;return'').concat(t,"")}function S1(){return{"xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg"}}function i1(e){return` + */var q=u2,f2=K,d2=function e(t,a){var r=q(t);if(r!=="object"&&r!=="array")throw new Error("expected an object");var n=[];r==="object"&&(t=f2(t,a),n={});for(var i in t)if(t.hasOwnProperty(i)){var c=t[i];q(c)==="object"||q(c)==="array"?n[i]=e(c,a):n[i]=c}return n},R={},p2={get exports(){return R},set exports(e){R=e}};(function(e){var t=Object.prototype.hasOwnProperty,a="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(a=!1));function n(c,l,o){this.fn=c,this.context=l,this.once=o||!1}function i(){this._events=new r,this._eventsCount=0}i.prototype.eventNames=function(){var l=[],o,u;if(this._eventsCount===0)return l;for(u in o=this._events)t.call(o,u)&&l.push(a?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(o)):l},i.prototype.listeners=function(l,o){var u=a?a+l:l,p=this._events[u];if(o)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var f=0,b=p.length,s=new Array(b);f":h.gt,'"':h.quote,"'":h.quote,"=":h.equal,"/":h.slash},m2=function(t){return v2[t]||h.char},y2=function(t){var a,r,n,i,c,l,o,u,p,f;t=Object.assign({debug:!1},t);var b=new h2,s=y.data,d="",C="",A="",v="",k="",F="",z=function(x,B){if(!(C[0]==="?"||C[0]==="!")){var H={type:x,value:B};t.debug&&console.log("emit:",H),b.emit("data",H)}};b.stateMachine=(f={},m(f,y.data,(a={},m(a,h.lt,function(){d.trim()&&z(M.text,d),C="",k=!1,s=y.tagBegin}),m(a,h.char,function(g){d+=g}),a)),m(f,y.cdata,m({},h.char,function(g){d+=g,d.substr(-3)==="]]>"&&(z(M.text,d.slice(0,-3)),d="",s=y.data)})),m(f,y.tagBegin,(r={},m(r,h.space,V),m(r,h.char,function(g){C=g,s=y.tagName}),m(r,h.slash,function(){C="",k=!0}),r)),m(f,y.tagName,(n={},m(n,h.space,function(){k?s=y.tagEnd:(s=y.attributeNameStart,z(M.openTag,C))}),m(n,h.gt,function(){z(k?M.closeTag:M.openTag,C),d="",s=y.data}),m(n,h.slash,function(){s=y.tagEnd,z(M.openTag,C)}),m(n,h.char,function(g){C+=g,C==="![CDATA["&&(s=y.cdata,d="",C="")}),n)),m(f,y.tagEnd,(i={},m(i,h.gt,function(){z(M.closeTag,C),d="",s=y.data}),m(i,h.char,V),i)),m(f,y.attributeNameStart,(c={},m(c,h.char,function(g){A=g,s=y.attributeName}),m(c,h.gt,function(){d="",s=y.data}),m(c,h.space,V),m(c,h.slash,function(){k=!0,s=y.tagEnd}),c)),m(f,y.attributeName,(l={},m(l,h.space,function(){s=y.attributeNameEnd}),m(l,h.equal,function(){z(M.attributeName,A),s=y.attributeValueBegin}),m(l,h.gt,function(){v="",z(M.attributeName,A),z(M.attributeValue,v),d="",s=y.data}),m(l,h.slash,function(){k=!0,v="",z(M.attributeName,A),z(M.attributeValue,v),s=y.tagEnd}),m(l,h.char,function(g){A+=g}),l)),m(f,y.attributeNameEnd,(o={},m(o,h.space,V),m(o,h.equal,function(){z(M.attributeName,A),s=y.attributeValueBegin}),m(o,h.gt,function(){v="",z(M.attributeName,A),z(M.attributeValue,v),d="",s=y.data}),m(o,h.char,function(g){v="",z(M.attributeName,A),z(M.attributeValue,v),A=g,s=y.attributeName}),o)),m(f,y.attributeValueBegin,(u={},m(u,h.space,V),m(u,h.quote,function(g){F=g,v="",s=y.attributeValue}),m(u,h.gt,function(){v="",z(M.attributeValue,v),d="",s=y.data}),m(u,h.char,function(g){F="",v=g,s=y.attributeValue}),u)),m(f,y.attributeValue,(p={},m(p,h.space,function(g){F?v+=g:(z(M.attributeValue,v),s=y.attributeNameStart)}),m(p,h.quote,function(g){F===g?(z(M.attributeValue,v),s=y.attributeNameStart):v+=g}),m(p,h.gt,function(g){F?v+=g:(z(M.attributeValue,v),d="",s=y.data)}),m(p,h.slash,function(g){F?v+=g:(z(M.attributeValue,v),k=!0,s=y.tagEnd)}),m(p,h.char,function(g){v+=g}),p)),f);var N=function(x){t.debug&&console.log(s,x);var B=b.stateMachine[s],H=B[m2(x)]||B[h.error]||B[h.char];H(x)};return b.write=function(g){for(var x=g.length,B=0;B".concat(t,""),{parentNodes:!1}),r=a.children&&a.children.length>0&&a.children.every(function(n){return n.name==="svg"});if(r)return a.children.length===1?a.children[0]:a.children;throw Error("nothing to parse")},A2=function(t){return d2(t,function(a){return w2(a)?a:F2(a)})},F2=function(t){return t.replace(/[-|:]([a-z])/gi,function(a,r){return r.toUpperCase()})},w2=function(t){return/^(data|aria)(-\w+)/.test(t)},k2=function(t){if(t){var a=String(t);return/[&<>]/.test(a)?"/,"]]]]>"),"]]>"):a}return""},x2=function(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")},E2=function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.transformNode,n=r===void 0?function(o){return o}:r,i=a.camelcase,c=i===void 0?!1:i,l=function(u){var p;return p=n(u),c&&(p=A2(p)),p};return l(M2(t))},_2=function e(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.transformAttr,n=r===void 0?function(s,d,C){return"".concat(s,'="').concat(C(d),'"')}:r,i=a.transformNode,c=i===void 0?function(s){return s}:i,l=a.selfClose,o=l===void 0?!0:l;if(Array.isArray(t))return t.map(function(s){return e(s,{transformAttr:n,selfClose:o,transformNode:c})}).join("");var u=c(t);if(u.type==="text")return k2(u.value);var p="";for(var f in u.attributes){var b=n(f,u.attributes[f],x2,u.name);p+=b?" ".concat(b):""}return u.children&&u.children.length>0||!o?"<".concat(u.name).concat(p,">").concat(e(u.children,{transformAttr:n,transformNode:c,selfClose:o}),""):"<".concat(u.name).concat(p,"/>")};function p1(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,r)}return a}function O(e){for(var t=1;t=0)&&(a[n]=e[n]);return a}function B2(e,t){if(e==null)return{};var a=S2(e,t),r,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function H2(e){return O2(e)||b1(e)||r1(e)||V2()}function X(e){return D2(e)||b1(e)||r1(e)||N2()}function D2(e){if(Array.isArray(e))return Z(e)}function O2(e){if(Array.isArray(e))return e}function b1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r1(e,t){if(e){if(typeof e=="string")return Z(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Z(e,t)}}function Z(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(o){throw o},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,c=!1,l;return{s:function(){a=a.call(e)},n:function(){var o=a.next();return i=o.done,o},e:function(o){c=!0,l=o},f:function(){try{!i&&a.return!=null&&a.return()}finally{if(c)throw l}}}}function T2(e,t){if(typeof e!="object"||e===null)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j2(e){var t=T2(e,"string");return typeof t=="symbol"?t:String(t)}var L=-2147483648,z1=2147483647;function C1(e){return e^=e<<13,e^=e>>17,e^=e<<5,e}function $2(e){for(var t=0,a=0;a0&&arguments[0]!==void 0?arguments[0]:50;return n(0,100)0&&arguments[0]!==void 0?arguments[0]:50;return this.prng.bool(a)}},{key:"integer",value:function(a,r){return this.prng.integer(a,r)}},{key:"pickone",value:function(a){return this.prng.pick(a)}}]),e}(),L2={50:"#FFF8E1",100:"#FFECB3",200:"#FFE082",300:"#FFB74D",400:"#FFCA28",500:"#FFC107",600:"#FFB300",700:"#FFA000",800:"#FF8F00",900:"#FF6F00"},P2={50:"#E3F2FD",100:"#BBDEFB",200:"#90CAF9",300:"#64B5F6",400:"#42A5F5",500:"#2196F3",600:"#1E88E5",700:"#1976D2",800:"#1565C0",900:"#0D47A1"},W2={50:"#ECEFF1",100:"#CFD8DC",200:"#B0BEC5",300:"#90A4AE",400:"#78909C",500:"#607D8B",600:"#546E7A",700:"#455A64",800:"#37474F",900:"#263238"},G2={50:"#EFEBE9",100:"#D7CCC8",200:"#BCAAA4",300:"#A1887F",400:"#8D6E63",500:"#795548",600:"#6D4C41",700:"#5D4037",800:"#4E342E",900:"#3E2723"},U2={50:"#E0F7FA",100:"#B2EBF2",200:"#80DEEA",300:"#4DD0E1",400:"#26C6DA",500:"#00BCD4",600:"#00ACC1",700:"#0097A7",800:"#00838F",900:"#006064"},q2={50:"#FBE9E7",100:"#FFCCBC",200:"#FFAB91",300:"#A1887F",400:"#FF7043",500:"#FF5722",600:"#F4511E",700:"#E64A19",800:"#D84315",900:"#BF360C"},Y2={50:"#EDE7F6",100:"#D1C4E9",200:"#B39DDB",300:"#9575CD",400:"#7E57C2",500:"#673AB7",600:"#5E35B1",700:"#512DA8",800:"#4527A0",900:"#311B92"},K2={50:"#E8F5E9",100:"#C8E6C9",200:"#A5D6A7",300:"#81C784",400:"#66BB6A",500:"#4CAF50",600:"#43A047",700:"#388E3C",800:"#2E7D32",900:"#1B5E20"},X2={50:"#FAFAFA",100:"#F5F5F5",200:"#EEEEEE",300:"#E0E0E0",400:"#BDBDBD",500:"#9E9E9E",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},Z2={50:"#E8EAF6",100:"#C5CAE9",200:"#9FA8DA",300:"#7986CB",400:"#5C6BC0",500:"#3F51B5",600:"#3949AB",700:"#303F9F",800:"#283593",900:"#1A237E"},Q2={50:"#E1F5FE",100:"#B3E5FC",200:"#81D4FA",300:"#4FC3F7",400:"#29B6F6",500:"#03A9F4",600:"#039BE5",700:"#0288D1",800:"#0277BD",900:"#01579B"},J2={50:"#F1F8E9",100:"#DCEDC8",200:"#C5E1A5",300:"#AED581",400:"#9CCC65",500:"#8BC34A",600:"#7CB342",700:"#689F38",800:"#558B2F",900:"#33691E"},e3={50:"#F9FBE7",100:"#F0F4C3",200:"#E6EE9C",300:"#DCE775",400:"#D4E157",500:"#CDDC39",600:"#C0CA33",700:"#AFB42B",800:"#9E9D24",900:"#827717"},t3={50:"#FFF3E0",100:"#FFE0B2",200:"#FFCC80",300:"#FF8A65",400:"#FFA726",500:"#FF9800",600:"#FB8C00",700:"#F57C00",800:"#EF6C00",900:"#E65100"},a3={50:"#FCE4EC",100:"#F8BBD0",200:"#F48FB1",300:"#F06292",400:"#EC407A",500:"#E91E63",600:"#D81B60",700:"#C2185B",800:"#AD1457",900:"#880E4F"},r3={50:"#F3E5F5",100:"#E1BEE7",200:"#CE93D8",300:"#BA68C8",400:"#AB47BC",500:"#9C27B0",600:"#8E24AA",700:"#7B1FA2",800:"#6A1B9A",900:"#4A148C"},n3={50:"#FFEBEE",100:"#FFCDD2",200:"#EF9A9A",300:"#E57373",400:"#EF5350",500:"#F44336",600:"#E53935",700:"#D32F2F",800:"#C62828",900:"#B71C1C"},i3={50:"#E0F2F1",100:"#B2DFDB",200:"#80CBC4",300:"#4DB6AC",400:"#26A69A",500:"#009688",600:"#00897B",700:"#00796B",800:"#00695C",900:"#004D40"},c3={50:"#FFFDE7",100:"#FFF9C4",200:"#FFF59D",300:"#FFF176",400:"#FFEE58",500:"#FFEB3B",600:"#FDD835",700:"#FBC02D",800:"#F9A825",900:"#F57F17"},l3={amber:L2,blue:P2,blueGrey:W2,brown:G2,cyan:U2,deepOrange:q2,deepPurple:Y2,green:K2,grey:X2,indigo:Z2,lightBlue:Q2,lightGreen:J2,lime:e3,orange:t3,pink:a3,purple:r3,red:n3,teal:i3,yellow:c3},A1=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000";if(P(this,e),E(this,"alpha",1),E(this,"color",{}),t[0]=="#")this.hex=t;else{var a=/^(rgb|rgba|hsv)\(([0-9\%\,\.\s]+)\)$/.exec(t.trim());if(a){var r=a[2].split(",").map(function(n){return parseInt(n.trim())});switch(a[1]){case"rgb":this.rgb=r;break;case"rgba":this.rgba=r;break;case"hsv":this.hsv=r;break;default:throw new Error("Unsupported color format: "+t)}}else throw new Error("Unknown color format: "+t)}}return W(e,[{key:"clone",value:function(){return new e("rgb("+this.rgb.join(",")+")")}},{key:"rgb",get:function(){return this.color.rgb=this.color.rgb||(this.color.hex?this.hexToRgb(this.hex):this.hsvToRgb(this.hsv))},set:function(a){if(a.length!=3)throw new Error("An array with a length of 3 is expected.");this.alpha=1,this.color={rgb:a}}},{key:"rgba",get:function(){return[this.rgb[0],this.rgb[1],this.rgb[2],this.alpha]},set:function(a){if(a.length!=4)throw new Error("An array with a length of 3 is expected.");this.rgb=[a[0],a[1],a[2]],this.alpha=a[3]}},{key:"hsv",get:function(){return(this.color.hsv=this.color.hsv||this.rgbToHsv(this.rgb)).slice(0)},set:function(a){if(a.length!=3)throw new Error("An array with a length of 3 is expected.");this.alpha=1,this.color={hsv:a}}},{key:"hex",get:function(){return(this.color.hex=this.color.hex||this.rgbToHex(this.rgb)).slice(0)},set:function(a){this.alpha=1,this.color={hex:a}}},{key:"brighterThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]>=i[2]+r?this:(n[2]=i[2]+r,n[2]>360&&(n[2]=360),this.hsv=n,this)}},{key:"darkerThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]<=i[2]-r?this:(n[2]=i[2]-r,n[2]<0&&(n[2]=0),this.hsv=n,this)}},{key:"brighterOrDarkerThan",value:function(a,r){var n=this.hsv,i=a.hsv;return n[2]<=i[2]?this.darkerThan(a,r):this.brighterThan(a,r)}},{key:"rgbToHex",value:function(a){return a2(a)}},{key:"hexToRgb",value:function(a){return K1(a).map(function(r){return Math.round(r)})}},{key:"rgbToHsv",value:function(a){return Z1(a).map(function(r){return Math.round(r)})}},{key:"hsvToRgb",value:function(a){return n2(a).map(function(r){return Math.round(r)})}}]),e}();E(A1,"collection",l3);var I=function(){function e(){P(this,e)}return W(e,null,[{key:"parse",value:function(a){return typeof a=="string"?E2(a):a}},{key:"stringify",value:function(a){return typeof a=="string"?a:_2(a)}}]),e}();function Q(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")}var o3=Object.freeze({__proto__:null,xml:Q}),F1={type:"object",$schema:"http://json-schema.org/draft-07/schema#",title:"Options",properties:{seed:{title:"Seed",type:"string"},s:{title:"Seed",type:"string"},base64:{title:"Base64",description:"@deprecated use dataUri instead",type:"boolean",default:!1},dataUri:{title:"Data URI",type:"boolean",default:!1},userAgent:{title:"User Agent",description:"@deprecated",type:"string"},flip:{title:"Flip",type:"boolean",default:!1},rotate:{title:"Rotate",type:"integer",minimum:0,maximum:360,default:0},scale:{title:"Scale",type:"integer",minimum:0,maximum:200,default:100},radius:{title:"Radius",type:"integer",minimum:0,maximum:50,default:0},r:{title:"Radius",type:"integer",minimum:0,maximum:50,default:0},width:{title:"Width",description:"@deprecated use size instead",type:"integer",minimum:1},w:{title:"Width",description:"@deprecated use size instead",type:"integer",minimum:1},height:{title:"Height",description:"@deprecated use size instead",type:"integer",minimum:1},h:{title:"Height",description:"@deprecated use size instead",type:"integer",minimum:1},size:{title:"Size",type:"integer",minimum:1},margin:{title:"Margin",description:"@deprecated use scale instead",type:"integer",minimum:0,maximum:25,default:0},m:{title:"Margin",description:"@deprecated use scale instead",type:"integer",minimum:0,maximum:25,default:0},backgroundColor:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}]},background:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}],description:"@deprecated use backgroundColor instead"},b:{title:"Background Color",anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"},{type:"array",items:{anyOf:[{type:"string",pattern:"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},{type:"string",pattern:"^[0-9a-zA-Z]+$"}]}}]},translateX:{title:"Translate X%",type:"integer",minimum:-100,maximum:100,default:0},translateY:{title:"Translate Y%",type:"integer",minimum:-100,maximum:100,default:0}},additionalProperties:!1};function n1(e){return e.properties||{}}function J(e){var t={},a=n1(e);return Object.keys(a).forEach(function(r){var n=a[r];j(n)==="object"&&n.default!==void 0&&(Array.isArray(n.default)?t[r]=X(n.default):j(n.default)==="object"?t[r]=O({},n.default):t[r]=n.default)}),t}function w1(e){var t={},a=n1(e);return Object.keys(a).forEach(function(r){var n=a[r];if(j(n)==="object"){var i=n.title;i&&(t[i]=t[i]||[],t[i].push(r))}}),Object.values(t).filter(function(r){return r.length>1}).map(function(r){return r.sort().sort(function(n,i){return n.length===i.length?0:n.length>i.length?1:-1})})}function e1(e){var t=new Map,a=v1(w1(e)),r;try{for(a.s();!(r=a.n()).done;){var n=r.value,i=n.reverse(),c=H2(i),l=c[0],o=c.slice(1),u=v1(o),p;try{for(u.s();!(p=u.n()).done;){var f=p.value;t.set(f,l)}}catch(b){u.e(b)}finally{u.f()}}}catch(b){a.e(b)}finally{a.f()}return t}var u3=Object.freeze({__proto__:null,properties:n1,defaults:J,aliases:w1,aliasesMap:e1});function k1(e,t){e[t];var a=B2(e,[t].map(j2));return a}var s3=Object.freeze({__proto__:null,omit:k1});function i1(e,t){var a=[{seed:Math.random().toString(),userAgent:typeof window<"u"&&window.navigator&&window.navigator.userAgent},J(F1),J(e.schema),t],r=x1(e);return a.forEach(function(n){r=Object.assign(r,k1(n,"_aliases"))}),r}function x1(e){var t=new Map([].concat(X(Array.from(e1(F1))),X(Array.from(e1(e.schema)))));return new Proxy({_aliases:t},{get:function(r,n){var i,c=(i=r._aliases.get(n))!==null&&i!==void 0?i:n;return r[c]},set:function(r,n,i){var c,l=(c=r._aliases.get(n))!==null&&c!==void 0?c:n;return r[l]=i,!0},deleteProperty:function(r,n){var i,c=(i=r._aliases.get(n))!==null&&i!==void 0?i:n;return delete r[c],!0}})}var f3=Object.freeze({__proto__:null,merge:i1,createAliasProxy:x1}),d3={by:{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution"],prohibits:[]},"by-sa":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution","ShareAlike"],prohibits:[]},"by-nd":{permits:["Reproduction","Distribution"],requires:["Notice","Attribution"],prohibits:[]},"by-nc":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution"],prohibits:["CommercialUse"]},"by-nc-sa":{permits:["Reproduction","Distribution","DerivativeWorks"],requires:["Notice","Attribution","ShareAlike"],prohibits:["CommercialUse"]},"by-nc-nd":{permits:["Reproduction","Distribution"],requires:["Notice","Attribution"],prohibits:["CommercialUse"]},zero:{permits:["Reproduction","Distribution","DerivativeWorks"],requires:[],prohibits:[]}};function p3(e){var t=e.children,a=e.x,r=e.y;return'').concat(t,"")}function E1(){return{"xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg"}}function c1(e){return` image/svg+xml -`.concat(B1(e),` +`.concat(_1(e),` +`).concat(S1(e),` +`).concat(B1(e),` `).concat(H1(e),` `).concat(D1(e),` -`).concat(O1(e),` -`).concat(N1(e),` -`).concat(V1(e),` +`).concat(O1(e),` -`)}function B1(e){return e.meta.title?"".concat(e.meta.title,""):""}function H1(e){if(e.meta.creator){var t=Array.isArray(e.meta.creator)?e.meta.creator:[e.meta.creator];return` +`)}function _1(e){return e.meta.title?"".concat(e.meta.title,""):""}function S1(e){if(e.meta.creator){var t=Array.isArray(e.meta.creator)?e.meta.creator:[e.meta.creator];return` -`.concat(c1(t),` +`.concat(l1(t),` -`)}return""}function D1(e){return e.meta.source?"".concat(e.meta.source,""):""}function O1(e){return e.meta.license?''):""}function N1(e){if(e.meta.contributor){var t=Array.isArray(e.meta.contributor)?e.meta.contributor:[e.meta.contributor];return` +`)}return""}function B1(e){return e.meta.source?"".concat(e.meta.source,""):""}function H1(e){return e.meta.license?''):""}function D1(e){if(e.meta.contributor){var t=Array.isArray(e.meta.contributor)?e.meta.contributor:[e.meta.contributor];return` -`.concat(c1(t),` +`.concat(l1(t),` -`)}return""}function c1(e){return e.map(function(t){return` +`)}return""}function l1(e){return e.map(function(t){return` `.concat(t,` -`)})}function V1(e){var t,a=(t=e.meta.license)===null||t===void 0?void 0:t.url.match(/^https?:\/\/creativecommons.org\/(?:licenses|publicdomain)\/([a-z\-]+)\/\d.\d\//);if(a){var r=g3[a[1]];if(r){var n,i="";return r.permits.forEach(function(c){i+='')}),r.requires.forEach(function(c){i+='')}),r.prohibits.forEach(function(c){i+='')}),` +`)})}function O1(e){var t,a=(t=e.meta.license)===null||t===void 0?void 0:t.url.match(/^https?:\/\/creativecommons.org\/(?:licenses|publicdomain)\/([a-z\-]+)\/\d.\d\//);if(a){var r=d3[a[1]];if(r){var n,i="";return r.permits.forEach(function(c){i+='')}),r.requires.forEach(function(c){i+='')}),r.prohibits.forEach(function(c){i+='')}),` `).concat(i,` -`)}}return""}function D(e){var t=e.attributes.viewBox.split(" "),a=parseInt(t[0]),r=parseInt(t[1]),n=parseInt(t[2]),i=parseInt(t[3]);return{x:a,y:r,width:n,height:i}}function T1(e,t){var a,r=typeof t=="number"?t:(a=t.margin)!==null&&a!==void 0?a:0;return l1(e,100-r*2)}function z3(e,t){return t.radius===void 0?e.body:o1(e,t.radius)}function j1(e,t){var a,r=D(e),n=r.width,i=r.height,c=r.x,l=r.y,o=typeof t=="string"?t:(a=t.backgroundColor)!==null&&a!==void 0?a:"transparent";return` +`)}}return""}function D(e){var t=e.attributes.viewBox.split(" "),a=parseInt(t[0]),r=parseInt(t[1]),n=parseInt(t[2]),i=parseInt(t[3]);return{x:a,y:r,width:n,height:i}}function N1(e,t){var a,r=typeof t=="number"?t:(a=t.margin)!==null&&a!==void 0?a:0;return o1(e,100-r*2)}function h3(e,t){return t.radius===void 0?e.body:u1(e,t.radius)}function V1(e,t){var a,r=D(e),n=r.width,i=r.height,c=r.x,l=r.y,o=typeof t=="string"?t:(a=t.backgroundColor)!==null&&a!==void 0?a:"transparent";return` `).concat(e.body,` -`)}function l1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y,l=t?(t-100)/100:0,o=(r/2+i)*l*-1,u=(n/2+c)*l*-1;return` +`)}function o1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y,l=t?(t-100)/100:0,o=(r/2+i)*l*-1,u=(n/2+c)*l*-1;return` `).concat(e.body,` -`)}function $1(e,t,a){var r=D(e),n=(r.width+r.x*2)*((t??0)/100),i=(r.height+r.y*2)*((a??0)/100);return` +`)}function T1(e,t,a){var r=D(e),n=(r.width+r.x*2)*((t??0)/100),i=(r.height+r.y*2)*((a??0)/100);return` `).concat(e.body,` -`)}function I1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y;return` +`)}function j1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y;return` `).concat(e.body,` -`)}function R1(e){var t=D(e),a=t.width,r=t.x;return` +`)}function $1(e){var t=D(e),a=t.width,r=t.x;return` `).concat(e.body,` -`)}function o1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y,l=t?r*t/100:0,o=t?n*t/100:0;return` +`)}function u1(e,t){var a=D(e),r=a.width,n=a.height,i=a.x,c=a.y,l=t?r*t/100:0,o=t?n*t/100:0;return` `).concat(e.body,` -`)}function u1(e){return e=O(O({},S1()),e),Object.keys(e).map(function(t){return"".concat(Z(t),'="').concat(Z(e[t]),'"')}).join(" ")}function L1(e){return e.trim().replace(/\n/g," ").replace(/>\s+<").replace(/\s{2,}/g," ").replace(/<([^\/>]+)><\/[^>]+>/gi,"<$1/>").replace(/\s(\/?>)/g,"$1")}var C3=Object.freeze({__proto__:null,createGroup:b3,getXmlnsAttributes:S1,getMetadata:i1,getMetadataWorkTitle:B1,getMetadataWorkCreator:H1,getMetadataWorkSource:D1,getMetadataWorkLicense:O1,getMetadataWorkContributor:N1,getMetadataWorkAgents:c1,getMetadataLicense:V1,getViewBox:D,addMargin:T1,addRadius:z3,addBackgroundColor:j1,addScale:l1,addTranslate:$1,addRotate:I1,addFlip:R1,addViewboxMask:o1,createAttrString:u1,removeWhitespace:L1});function M3(e){return function(t,a){var r;a=Object.assign(a,n1(e,a));var n=e.create({prng:G(t.seed),options:a});return` - -`).concat(i1(e),` +`)}function s1(e){return e=O(O({},E1()),e),Object.keys(e).map(function(t){return"".concat(Q(t),'="').concat(Q(e[t]),'"')}).join(" ")}function I1(e){return e.trim().replace(/\n/g," ").replace(/>\s+<").replace(/\s{2,}/g," ").replace(/<([^\/>]+)><\/[^>]+>/gi,"<$1/>").replace(/\s(\/?>)/g,"$1")}var v3=Object.freeze({__proto__:null,createGroup:p3,getXmlnsAttributes:E1,getMetadata:c1,getMetadataWorkTitle:_1,getMetadataWorkCreator:S1,getMetadataWorkSource:B1,getMetadataWorkLicense:H1,getMetadataWorkContributor:D1,getMetadataWorkAgents:l1,getMetadataLicense:O1,getViewBox:D,addMargin:N1,addRadius:h3,addBackgroundColor:V1,addScale:o1,addTranslate:T1,addRotate:j1,addFlip:$1,addViewboxMask:u1,createAttrString:s1,removeWhitespace:I1});function m3(e){return function(t,a){var r;a=Object.assign(a,i1(e,a));var n=e.create({prng:G(t.seed),options:a});return` + +`).concat(c1(e),` `).concat((r=n.head)!==null&&r!==void 0?r:"",` `).concat(n.body,` -`)}}var A3=Object.freeze({__proto__:null,createLegacyWrapper:M3}),F3=Object.freeze({__proto__:null,escape:h3,options:y3,prng:q2,svg:C3,style:A3,schema:v3,helper:m3});function w3(e){var t,a,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n=n1(e,n);var i=G(n.seed),c=e.create({prng:i,options:n});if(n.size?(c.attributes.width=n.size.toString(),c.attributes.height=n.size.toString()):(n.width&&(c.attributes.width=n.width.toString()),n.height&&(c.attributes.height=n.height.toString())),n.scale!==void 0&&n.scale!==100?c.body=l1(c,n.scale):n.margin&&(c.body=T1(c,n)),n.flip&&(c.body=R1(c)),n.rotate&&(c.body=I1(c,n.rotate)),(n.translateX||n.translateY)&&(c.body=$1(c,n.translateX,n.translateY)),n.backgroundColor){var l=Array.isArray(n.backgroundColor)?i.pick(n.backgroundColor):n.backgroundColor;c.body=j1(c,l)}c.body=o1(c,(t=n.radius)!==null&&t!==void 0?t:0);var o=!!(!((a=c.head)===null||a===void 0)&&a.match(/]*)>/)),u=L1(` - -`).concat(o?"":i1(e),` +`)}}var y3=Object.freeze({__proto__:null,createLegacyWrapper:m3}),g3=Object.freeze({__proto__:null,escape:o3,options:f3,prng:R2,svg:v3,style:y3,schema:u3,helper:s3});function b3(e){var t,a,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n=i1(e,n);var i=G(n.seed),c=e.create({prng:i,options:n});if(n.size?(c.attributes.width=n.size.toString(),c.attributes.height=n.size.toString()):(n.width&&(c.attributes.width=n.width.toString()),n.height&&(c.attributes.height=n.height.toString())),n.scale!==void 0&&n.scale!==100?c.body=o1(c,n.scale):n.margin&&(c.body=N1(c,n)),n.flip&&(c.body=$1(c)),n.rotate&&(c.body=j1(c,n.rotate)),(n.translateX||n.translateY)&&(c.body=T1(c,n.translateX,n.translateY)),n.backgroundColor){var l=Array.isArray(n.backgroundColor)?i.pick(n.backgroundColor):n.backgroundColor;c.body=V1(c,l)}c.body=u1(c,(t=n.radius)!==null&&t!==void 0?t:0);var o=!!(!((a=c.head)===null||a===void 0)&&a.match(/]*)>/)),u=I1(` + +`).concat(o?"":c1(e),` `).concat((r=c.head)!==null&&r!==void 0?r:"",` `).concat(c.body,` -`));if(n.dataUri)return"data:image/svg+xml;utf8,".concat(encodeURIComponent(u));if(n.base64){var p=encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,function(f,b){return String.fromCharCode(parseInt("0x".concat(b)))});return"data:image/svg+xml;base64,".concat(btoa(p))}return u}var s1=function(){function e(t,a){P(this,e),E(this,"spriteCollection",void 0),E(this,"defaultOptions",void 0),this.spriteCollection=t,this.defaultOptions=a}return W(e,[{key:"create",value:function(a,r){var n=this,i={meta:{},schema:{},create:function(l){var o=l.prng,u=l.options,p=R.parse(n.spriteCollection(new F1(o.seed),u)),f=[],b=[];return p.children.forEach(function(s){n.isBody(s)?b.push(s):f.push(s)}),{attributes:p.attributes,head:f.map(function(s){return R.stringify(s)}).join(""),body:b.map(function(s){return R.stringify(s)}).join("")}}};return w3(i,O(O(O({},this.defaultOptions),r),{},{seed:a}))}},{key:"isBody",value:function(a){return a.type==="element"&&["title","desc","defs","metadata"].indexOf(a.name)===-1}}]),e}();E(s1,"random",F1);E(s1,"color",w1);E(s1,"parser",R);function w(e,t,a){var r=a.mode||"include",n=a[e];if(Array.isArray(n))switch(r){case"include":return n.indexOf(t)!==-1;case"exclude":return n.indexOf(t)===-1}return!0}var x3={kurt:function(t){return` +`));if(n.dataUri)return"data:image/svg+xml;utf8,".concat(encodeURIComponent(u));if(n.base64){var p=encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,function(f,b){return String.fromCharCode(parseInt("0x".concat(b)))});return"data:image/svg+xml;base64,".concat(btoa(p))}return u}var f1=function(){function e(t,a){P(this,e),E(this,"spriteCollection",void 0),E(this,"defaultOptions",void 0),this.spriteCollection=t,this.defaultOptions=a}return W(e,[{key:"create",value:function(a,r){var n=this,i={meta:{},schema:{},create:function(l){var o=l.prng,u=l.options,p=I.parse(n.spriteCollection(new M1(o.seed),u)),f=[],b=[];return p.children.forEach(function(s){n.isBody(s)?b.push(s):f.push(s)}),{attributes:p.attributes,head:f.map(function(s){return I.stringify(s)}).join(""),body:b.map(function(s){return I.stringify(s)}).join("")}}};return b3(i,O(O(O({},this.defaultOptions),r),{},{seed:a}))}},{key:"isBody",value:function(a){return a.type==="element"&&["title","desc","defs","metadata"].indexOf(a.name)===-1}}]),e}();E(f1,"random",M1);E(f1,"color",A1);E(f1,"parser",I);function w(e,t,a){var r=a.mode||"include",n=a[e];if(Array.isArray(n))switch(r){case"include":return n.indexOf(t)!==-1;case"exclude":return n.indexOf(t)===-1}return!0}var z3={kurt:function(t){return` @@ -125,7 +125,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -`)}},k3={blazerAndShirt:function(t){return` +`)}},C3={blazerAndShirt:function(t){return` @@ -157,7 +157,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)},shirtVNeck:function(t){return` -`)}},E3={skullOutline:function(){return` +`)}},M3={skullOutline:function(){return` `},skull:function(){return` @@ -180,7 +180,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},bat:function(){return` -`}},_3={angryNatural:function(){return` +`}},A3={angryNatural:function(){return` `},defaultNatural:function(){return` @@ -208,7 +208,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},upDown:function(){return` -`}},S3={squint:function(){return` +`}},F3={squint:function(){return` `},closed:function(){return` @@ -239,7 +239,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},xDizzy:function(){return` -`}},B3={beardLight:function(t){return` +`}},w3={beardLight:function(t){return` `)},beardMajestic:function(t){return` @@ -249,7 +249,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)},moustacheMagnum:function(t){return` -`)}},H3={concerned:function(){return` +`)}},k3={concerned:function(){return` @@ -287,12 +287,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -`}},D3={default:function(){return` +`}},x3={default:function(){return` -`}},O3={default:function(t){return` +`}},E3={default:function(t){return` -`)}},N3={eyepatch:{path:function(){return` +`)}},_3={eyepatch:{path:function(){return` `},isHat:!0,zIndex:0},turban:{path:function(t){return` @@ -420,8 +420,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)},isHat:!1,zIndex:1},theCaesar:{path:function(t){return` -`)},isHat:!1,zIndex:1}};function _(e){return e.filter(function(t,a,r){return r.indexOf(t)===a})}function V3(e,t){var a=[],r=["kurt","prescription01","prescription02","round","sunglasses","wayfarers"];r.forEach(function(i){w("accessories",i,e)&&a.push(i)});var n=t.pick(_(a));if(t.bool(e.accessoriesChance!==void 0?e.accessoriesChance:10)!==!1)return x3[n]}function S(e){return T3(e)||j3(e)||$3(e)||I3()}function T3(e){if(Array.isArray(e))return e1(e)}function j3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $3(e,t){if(e){if(typeof e=="string")return e1(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e1(e,t)}}function e1(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a0?'').concat(H,""):""},N=z(l.path(l.isHat?x:F),7,0),g=` +`)},isHat:!1,zIndex:1}};function _(e){return e.filter(function(t,a,r){return r.indexOf(t)===a})}function S3(e,t){var a=[],r=["kurt","prescription01","prescription02","round","sunglasses","wayfarers"];r.forEach(function(i){w("accessories",i,e)&&a.push(i)});var n=t.pick(_(a));if(t.bool(e.accessoriesChance!==void 0?e.accessoriesChance:10)!==!1)return z3[n]}function S(e){return B3(e)||H3(e)||D3(e)||O3()}function B3(e){if(Array.isArray(e))return t1(e)}function H3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function D3(e,t){if(e){if(typeof e=="string")return t1(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t1(e,t)}}function t1(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a0?'').concat(H,""):""},N=z(l.path(l.isHat?k:F),7,0),g=` `.concat(z(i(c),40,36),` `).concat(z(p(b,f()),8,170),` `).concat(z(C(),86,134),` @@ -433,8 +433,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `).concat(l.zIndex===1?N:"",` `).concat(A?z(A(v),69,85):"",` `).concat(l.zIndex===2?N:"",` -`);if(r.style==="circle"){var k;g=` - +`);if(r.style==="circle"){var x;g=` + @@ -449,4 +449,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Design by Pablo Stanley - Free for personal and commercial use. * https://avataaars.com/ - */var W1=f1.create,G1=f1.meta,U1=f1.schema,n4=F3.style.createLegacyWrapper({create:W1,meta:G1,schema:U1});const c4=Object.freeze(Object.defineProperty({__proto__:null,create:W1,default:n4,meta:G1,schema:U1},Symbol.toStringTag,{value:"Module"}));export{w3 as c,c4 as s}; + */var L1=d1.create,P1=d1.meta,W1=d1.schema,Q3=g3.style.createLegacyWrapper({create:L1,meta:P1,schema:W1});const J3=Object.freeze(Object.defineProperty({__proto__:null,create:L1,default:Q3,meta:P1,schema:W1},Symbol.toStringTag,{value:"Module"}));export{b3 as c,J3 as s}; diff --git a/public/build/assets/join-array-DPKtuOQJ.js b/public/build/assets/join-array-4b30b096.js similarity index 76% rename from public/build/assets/join-array-DPKtuOQJ.js rename to public/build/assets/join-array-4b30b096.js index 905574d38..2b6047341 100644 --- a/public/build/assets/join-array-DPKtuOQJ.js +++ b/public/build/assets/join-array-4b30b096.js @@ -1 +1 @@ -import{_ as l}from"./currency-lOMYG1Wf.js";function f(e,n=2){if(e.length===0)return"";if(e.length===1)return e[0];if(e.length>n){let t=e.slice(0,n).join(", "),o=e.length-n,i=l("+{count} other").replace("{count}",o);return`${t}, ${i}`}return e.join(", ")}export{f as j}; +import{_ as l}from"./currency-f8bd78d1.js";function f(e,n=2){if(e.length===0)return"";if(e.length===1)return e[0];if(e.length>n){let t=e.slice(0,n).join(", "),o=e.length-n,i=l("+{count} other").replace("{count}",o);return`${t}, ${i}`}return e.join(", ")}export{f as j}; diff --git a/public/build/assets/la-brands-400-D0lxOIwB.woff b/public/build/assets/la-brands-400-14c63377.woff similarity index 100% rename from public/build/assets/la-brands-400-D0lxOIwB.woff rename to public/build/assets/la-brands-400-14c63377.woff diff --git a/public/build/assets/la-brands-400-wsUI3UJ9.svg b/public/build/assets/la-brands-400-4da18191.svg similarity index 100% rename from public/build/assets/la-brands-400-wsUI3UJ9.svg rename to public/build/assets/la-brands-400-4da18191.svg diff --git a/public/build/assets/la-brands-400-LN4CMlGg.eot b/public/build/assets/la-brands-400-c0e32387.eot similarity index 100% rename from public/build/assets/la-brands-400-LN4CMlGg.eot rename to public/build/assets/la-brands-400-c0e32387.eot diff --git a/public/build/assets/la-brands-400-gDglUfU7.ttf b/public/build/assets/la-brands-400-fbc98702.ttf similarity index 100% rename from public/build/assets/la-brands-400-gDglUfU7.ttf rename to public/build/assets/la-brands-400-fbc98702.ttf diff --git a/public/build/assets/la-brands-400-Cq-R4OEF.woff2 b/public/build/assets/la-brands-400-ff70c9bc.woff2 similarity index 100% rename from public/build/assets/la-brands-400-Cq-R4OEF.woff2 rename to public/build/assets/la-brands-400-ff70c9bc.woff2 diff --git a/public/build/assets/la-regular-400-CmnW_RTo.ttf b/public/build/assets/la-regular-400-4b6ab8d0.ttf similarity index 100% rename from public/build/assets/la-regular-400-CmnW_RTo.ttf rename to public/build/assets/la-regular-400-4b6ab8d0.ttf diff --git a/public/build/assets/la-regular-400-DuFMN_sw.woff2 b/public/build/assets/la-regular-400-51ca2c00.woff2 similarity index 100% rename from public/build/assets/la-regular-400-DuFMN_sw.woff2 rename to public/build/assets/la-regular-400-51ca2c00.woff2 diff --git a/public/build/assets/la-regular-400-ehe5HgcS.woff b/public/build/assets/la-regular-400-7711fabc.woff similarity index 100% rename from public/build/assets/la-regular-400-ehe5HgcS.woff rename to public/build/assets/la-regular-400-7711fabc.woff diff --git a/public/build/assets/la-regular-400-Cx6vm3uW.eot b/public/build/assets/la-regular-400-7dc456f0.eot similarity index 100% rename from public/build/assets/la-regular-400-Cx6vm3uW.eot rename to public/build/assets/la-regular-400-7dc456f0.eot diff --git a/public/build/assets/la-regular-400-BmVb34ql.svg b/public/build/assets/la-regular-400-884ce19c.svg similarity index 100% rename from public/build/assets/la-regular-400-BmVb34ql.svg rename to public/build/assets/la-regular-400-884ce19c.svg diff --git a/public/build/assets/la-solid-900-BUOWlSBQ.ttf b/public/build/assets/la-solid-900-07ce3559.ttf similarity index 100% rename from public/build/assets/la-solid-900-BUOWlSBQ.ttf rename to public/build/assets/la-solid-900-07ce3559.ttf diff --git a/public/build/assets/la-solid-900-dtlPMWb8.svg b/public/build/assets/la-solid-900-0ce0cc40.svg similarity index 100% rename from public/build/assets/la-solid-900-dtlPMWb8.svg rename to public/build/assets/la-solid-900-0ce0cc40.svg diff --git a/public/build/assets/la-solid-900-TjMEgv3Q.woff2 b/public/build/assets/la-solid-900-10a68e01.woff2 similarity index 100% rename from public/build/assets/la-solid-900-TjMEgv3Q.woff2 rename to public/build/assets/la-solid-900-10a68e01.woff2 diff --git a/public/build/assets/la-solid-900-DkmX4G2x.eot b/public/build/assets/la-solid-900-8a57f8a9.eot similarity index 100% rename from public/build/assets/la-solid-900-DkmX4G2x.eot rename to public/build/assets/la-solid-900-8a57f8a9.eot diff --git a/public/build/assets/la-solid-900-CR_Kd-su.woff b/public/build/assets/la-solid-900-a0d21b2a.woff similarity index 100% rename from public/build/assets/la-solid-900-CR_Kd-su.woff rename to public/build/assets/la-solid-900-a0d21b2a.woff diff --git a/public/build/assets/lang-loader-Bc41QNge.js b/public/build/assets/lang-loader-2a92cbe8.js similarity index 100% rename from public/build/assets/lang-loader-Bc41QNge.js rename to public/build/assets/lang-loader-2a92cbe8.js diff --git a/public/build/assets/light-R07V6ba6.css b/public/build/assets/light-d9e7cf53.css similarity index 60% rename from public/build/assets/light-R07V6ba6.css rename to public/build/assets/light-d9e7cf53.css index b4e6e02bf..338f4c4dd 100644 --- a/public/build/assets/light-R07V6ba6.css +++ b/public/build/assets/light-d9e7cf53.css @@ -1 +1 @@ -:root{--typography: 55 65 81;--surface: 209 213 219;--surface-soft: 229 231 235;--surface-hard: 250 250 250;--popup-surface: 250 250 250;--input-edge: 156 163 175;--input-background: 229 231 235;--input-disabled: 156 163 175;--input-button: 244 244 245;--input-button-hover: 228 228 231;--input-button-active: 212 212 216;--input-option-hover: 107 114 128;--box-background: 250 250 250;--box-edge: 209 213 219;--box-elevation-background: 241 245 249;--box-elevation-edge: 203 213 225;--box-elevation-hover: 203 213 225;--crud-button-edge: 209 213 219;--crud-input-background: 209 213 219;--pos-button-edge: 209 213 219;--numpad-background: 107 114 128;--numpad-typography: 55 65 81;--numpad-edge: 209 213 219;--numpad-hover: 203 213 225;--numpad-hover-edge: 209 213 219;--option-hover: 107 114 128;--scroll-thumb: 30 64 175;--scroll-track: 0 0 0;--scroll-popup-thumb: 71 85 105;--pre: 107 114 128;--tab-active: 250 250 250;--tab-active-border: 209 213 219;--tab-inactive: 229 231 235;--tab-table-th: 209 213 219;--tab-table-th-edge: 209 213 219;--table-th: 229 231 235;--table-th-edge: 209 213 219;--floating-menu: 255 255 255;--floating-menu-hover: 241 245 249;--floating-menu-selected: 226 232 240;--floating-menu-edge: 226 232 240;--primary: 55 65 81;--secondary: 31 41 55;--tertiary: 17 24 39;--soft-primary: 75 85 99;--soft-secondary: 107 114 128;--soft-tertiary: 156 163 175;--info-primary: 191 219 254;--info-secondary: 96 165 250;--info-tertiary: 37 99 235;--info-light-primary: 191 219 254;--info-light-secondary: 147 197 253;--info-light-tertiary: 96 165 250;--error-primary: 254 202 202;--error-secondary: 248 113 113;--error-tertiary: 220 38 38;--error-light-primary: 254 202 202;--error-light-secondary: 252 165 165;--error-light-tertiary: 248 113 113;--success-primary: 187 247 208;--success-secondary: 74 222 128;--success-tertiary: 22 163 74;--success-light-primary: 187 247 208;--success-light-secondary: 134 239 172;--success-light-tertiary: 74 222 128;--warning-primary: 254 215 170;--warning-secondary: 251 146 60;--warning-tertiary: 234 88 12;--warning-light-primary: 255 237 213;--warning-light-secondary: 254 215 170;--warning-light-tertiary: 253 186 116;--danger-primary: 202 138 4;--danger-secondary: 161 98 7;--danger-tertiary: 133 77 14;--danger-light-primary: 254 249 195;--danger-light-secondary: 254 240 138;--danger-light-tertiary: 253 224 71;--default-primary: 203 213 225;--default-secondary: 148 163 184;--default-tertiary: 107 114 128;--default-light-primary: 226 232 240;--default-light-secondary: 203 213 225;--default-light-tertiary: 148 163 184}.is-popup .ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-body{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.is-popup .ns-box div>h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-header,.ns-box .ns-box-body{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.ns-box div>h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice h1,.ns-notice h2,.ns-notice h3,.ns-notice h4,.ns-notice h5,.ns-notice p,.ns-notice span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.danger h1,.ns-notice.danger h2,.ns-notice.danger h3,.ns-notice.danger h4,.ns-notice.danger h5,.ns-notice.warning h1,.ns-notice.warning h2,.ns-notice.warning h3,.ns-notice.warning h4,.ns-notice.warning h5,.ns-notice.success h1,.ns-notice.success h2,.ns-notice.success h3,.ns-notice.success h4,.ns-notice.success h5,.ns-notice.info h1,.ns-notice.info h2,.ns-notice.info h3,.ns-notice.info h4,.ns-notice.info h5,.ns-notice.error h1,.ns-notice.error h2,.ns-notice.error h3,.ns-notice.error h4,.ns-notice.error h5{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.danger{--tw-border-opacity: 1;border-color:rgb(var(--danger-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--danger-primary) / var(--tw-bg-opacity))}.ns-notice.danger p>a{--tw-text-opacity: 1;color:rgb(var(--danger-tertiary) / var(--tw-text-opacity))}.ns-notice.danger p>a:hover{text-decoration-line:underline}.ns-notice.danger pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-notice.warning p>a{--tw-text-opacity: 1;color:rgb(var(--warning-tertiary) / var(--tw-text-opacity))}.ns-notice.warning p>a:hover{text-decoration-line:underline}.ns-notice.warning pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-notice.success p>a{--tw-text-opacity: 1;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))}.ns-notice.success p>a:hover{text-decoration-line:underline}.ns-notice.success pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error p a{--tw-text-opacity: 1;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))}.ns-notice.error p a:hover{text-decoration-line:underline}.ns-notice.error pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}.ns-notice.info p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.info p>a{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}.ns-notice.info p>a:hover{text-decoration-line:underline}.ns-notice.info pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-normal-text{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))}.ns-floating-notice.info h2,.ns-floating-notice.info p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}.ns-floating-notice.error h2,.ns-floating-notice.error p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-floating-notice.warning h2,.ns-floating-notice.warning p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-floating-notice.success h2,.ns-floating-notice.success p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-switch button.selected{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-switch button.selected:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}.ns-switch button.unselected{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.input-group input,.input-group select{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group button{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.input-group button i,.input-group button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group button .disabled{--tw-bg-opacity: 1;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))}.input-group.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}.input-group.info input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.info button{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.info button i,.input-group.info button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))}.input-group.error input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.error button{--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error button i,.input-group.error button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.warning input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.warning button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning button i,.input-group.warning button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))}.input-group.success input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.success button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success button i,.input-group.success button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-select select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-select select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.ns-select select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input [disabled],.ns-switch [disabled],.ns-select [disabled],.ns-textarea [disabled],.ns-media [disabled],.ns-checkbox [disabled]{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--tertiary) / var(--tw-text-opacity))}.ns-input .ns-enabled,.ns-switch .ns-enabled,.ns-select .ns-enabled,.ns-textarea .ns-enabled,.ns-media .ns-enabled,.ns-checkbox .ns-enabled{background-color:transparent}.ns-input label.has-error,.ns-switch label.has-error,.ns-select label.has-error,.ns-textarea label.has-error,.ns-media label.has-error,.ns-checkbox label.has-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-input label.is-pristine,.ns-switch label.is-pristine,.ns-select label.is-pristine,.ns-textarea label.is-pristine,.ns-media label.is-pristine,.ns-checkbox label.is-pristine{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input div.has-error,.ns-switch div.has-error,.ns-select div.has-error,.ns-textarea div.has-error,.ns-media div.has-error,.ns-checkbox div.has-error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))}.ns-input div.is-pristine,.ns-switch div.is-pristine,.ns-select div.is-pristine,.ns-textarea div.is-pristine,.ns-media div.is-pristine,.ns-checkbox div.is-pristine{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.ns-input .leading,.ns-switch .leading,.ns-select .leading,.ns-textarea .leading,.ns-media .leading,.ns-checkbox .leading{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input input,.ns-input textarea,.ns-switch input,.ns-switch textarea,.ns-select input,.ns-select textarea,.ns-textarea input,.ns-textarea textarea,.ns-media input,.ns-media textarea,.ns-checkbox input,.ns-checkbox textarea{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.ns-input button,.ns-switch button,.ns-select button,.ns-textarea button,.ns-media button,.ns-checkbox button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input button:hover,.ns-switch button:hover,.ns-select button:hover,.ns-textarea button:hover,.ns-media button:hover,.ns-checkbox button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-input p.ns-description,.ns-switch p.ns-description,.ns-select p.ns-description,.ns-textarea p.ns-description,.ns-media p.ns-description,.ns-checkbox p.ns-description{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input p.ns-error,.ns-switch p.ns-error,.ns-select p.ns-error,.ns-textarea p.ns-error,.ns-media p.ns-error,.ns-checkbox p.ns-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input{outline-width:0px}.form-input *[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input label{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity))}.form-input input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input input[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.form-input-invalid label{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input-invalid input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.form-input-invalid p{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button button,.ns-button a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-button:hover a,.ns-button:hover button{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-button.hover-success:hover button,.ns-button.hover-success:hover a,.ns-button.success button,.ns-button.success a{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-success:hover button span.ns-label,.ns-button.hover-success:hover a span.ns-label,.ns-button.success button span.ns-label,.ns-button.success a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-button.hover-error:hover button,.ns-button.hover-error:hover a,.ns-button.error button,.ns-button.error a{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-error:hover button span.ns-label,.ns-button.hover-error:hover a span.ns-label,.ns-button.error button span.ns-label,.ns-button.error a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button,.ns-button.hover-warning:hover a,.ns-button.warning button,.ns-button.warning a{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-warning:hover button span.ns-label,.ns-button.hover-warning:hover a span.ns-label,.ns-button.warning button span.ns-label,.ns-button.warning a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button,.ns-button.hover-default:hover a,.ns-button.default button,.ns-button.default a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button span.ns-label,.ns-button.hover-default:hover a span.ns-label,.ns-button.default button span.ns-label,.ns-button.default a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button,.ns-button.hover-info:hover a,.ns-button.info button,.ns-button.info a{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-info:hover button span.ns-label,.ns-button.hover-info:hover a span.ns-label,.ns-button.info button span.ns-label,.ns-button.info a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}.ns-button>button:disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-button>button:disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-buttons button.success,.ns-buttons a.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.success span.ns-label,.ns-buttons a.success span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))}.ns-buttons button.error,.ns-buttons a.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.error span.ns-label,.ns-buttons a.error span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-buttons button.warning,.ns-buttons a.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.warning span.ns-label,.ns-buttons a.warning span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-buttons button.default,.ns-buttons a.default{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--input-disabled) / var(--tw-text-opacity))}.ns-buttons button.default span.ns-label,.ns-buttons a.default span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.info,.ns-buttons a.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.info span.ns-label,.ns-buttons a.info span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-close-button:hover>i{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button:hover,.ns-floating-panel .ns-inset-button.active,.ns-floating-panel .ns-inset-button.info:hover,.ns-floating-panel .ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.success:hover,.ns-floating-panel .ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.warning:hover,.ns-floating-panel .ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.error:hover,.ns-floating-panel .ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-inset-button:hover,.ns-inset-button.active,.ns-inset-button.info:hover,.ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.success:hover,.ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.warning:hover,.ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.error:hover,.ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-multiselect .ns-dropdown{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.ns-daterange-picker .form-control.reportrange-text{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#crud-table #crud-table-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-table .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table .ns-crud-input input,#crud-table .ns-crud-input select{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-table-row{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}#crud-table .ns-table-row td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-menu-wrapper>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#crud-table .ns-table-row .ns-action-button{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:focus{outline:2px solid transparent;outline-offset:2px}#crud-table .ns-crud-button,#crud-table .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-enabled,#crud-table .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-disabled,#crud-table .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover,#crud-table .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover i,#crud-table .ns-crud-button:hover span,#crud-table .ns-crud-input-button:hover i,#crud-table .ns-crud-input-button:hover span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-form .ns-crud-button,#crud-form .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-enabled,#crud-form .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-disabled,#crud-form .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-form .ns-crud-button:hover,#crud-form .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-background) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-form .ns-crud-input input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#main-container,#page-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.card-widget h1,.card-widget h2,.card-widget h3,.card-widget h4,.card-widget h5,.card-widget h6,.card-widget i{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-menu:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.toggled{--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.normal{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu .notification-label{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu{--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu.active{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu.normal{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}#dashboard-body{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.ns-toggle-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-toggle-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.ns-avatar{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-avatar:hover,.ns-avatar.toggled{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.pending-drag{border-color:transparent}.awaiting-drop{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.drag-over{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity))}#notificaton-wrapper #notification-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-button.panel-visible{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper #notification-button.panel-hidden{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}#notificaton-wrapper #notification-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-center>div>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper .clear-all{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .clear-all:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper .notification-card h1{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card .date{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}#ns-orders-chart .head,#ns-orders-chart .foot{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-chart .foot>div{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-chart .foot>div span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-chart .foot>div h2{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .title{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-summary .head,#ns-orders-summary .title{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-summary .head h3,#ns-orders-summary .head i,#ns-orders-summary .head h4,#ns-orders-summary .head p,#ns-orders-summary .head span,#ns-orders-summary .title h3,#ns-orders-summary .title i,#ns-orders-summary .title h4,#ns-orders-summary .title p,#ns-orders-summary .title span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .paid-order,#ns-orders-summary .title .paid-order{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .other-order,#ns-orders-summary .title .other-order{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .head .single-order,#ns-orders-summary .title .single-order{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))}#ns-orders-summary .head .paid-currency,#ns-orders-summary .title .paid-currency{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .unpaid-currency,#ns-orders-summary .title .unpaid-currency{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers,#ns-best-cashiers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-best-customers .head,#ns-best-cashiers .head{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body,#ns-best-cashiers .body{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body .entry,#ns-best-cashiers .body .entry{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.ns-scrollbar::-webkit-scrollbar{width:5px}.ns-scrollbar::-webkit-scrollbar-track{background-color:#ffffff80}.ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-thumb) / var(--tw-bg-opacity))}.is-popup .ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-popup-thumb) / var(--tw-bg-opacity))}ul.ns-vertical-menu{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}ul.ns-vertical-menu li{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}ul.ns-vertical-menu li:hover,ul.ns-vertical-menu li.active{--tw-bg-opacity: 1;background-color:rgb(var(--floating-menu-selected) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup,#confirm-popup,#prompt-popup{--tw-bg-opacity: 1;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))}#alert-popup h2,#confirm-popup h2,#prompt-popup h2{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#alert-popup p,#confirm-popup p,#prompt-popup p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons,#confirm-popup .action-buttons,#prompt-popup .action-buttons{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons button:hover,#confirm-popup .action-buttons button:hover,#prompt-popup .action-buttons button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#alert-popup .action-buttons hr,#confirm-popup .action-buttons hr,#prompt-popup .action-buttons hr{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.is-popup{background:#0006}.is-popup .elevation-surface{--tw-border-opacity: 1;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.success.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.error.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.info{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.info.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.warning.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#loader{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#loader p,#ns-pos-customer-select-popup .purchase-amount{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));font-weight:600;--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart>span.products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-grid{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div hr{--tw-bg-opacity: 1;background-color:rgb(var(--pos-button-edge) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div .ns-button button{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-table-header{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a:hover{--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product:hover{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .price:hover{--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode:hover{background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .product-controls{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer>span{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-price{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart h3{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a:hover{--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#pos-container #pos-grid .switch-cart{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-cart .products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-grid .switch-grid{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-header{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button.pos-button-clicked{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));box-shadow:inset 0 0 5px #303131}#pos-container #pos-grid #grid-container #grid-header>div input{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb ul>li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item .cell-item-label{background:#fafafaba}#pos-container #pos-grid #grid-container #grid-items .cell-item:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item i,#pos-container #pos-grid #grid-container #grid-items .cell-item span{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#ns-pos-customers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-pos-customers .ns-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-pos-customers .ns-header h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customers .ns-tab-cards h3,#ns-pos-customers .ns-tab-cards h2{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-pos-customers .ns-body,#ns-order-type{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-order-type h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div>div>i{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#ns-order-type div>div div>p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type .ns-box-body>div:hover h4{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-order-type .ns-box-body>div h4{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-units-selector .overlay{background:#fafafaba}#ns-pos-cash-registers-popup div.alert{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#ns-payment-popup .ns-pos-screen{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity))}#ns-payment-popup>div h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li.ns-payment-gateway.ns-visible,#ns-payment-popup>div ul li.ns-payment-list.ns-visible{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li:hover{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li button{--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-type-button{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-submit-button{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-layaway-button{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button .ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-list{--tw-border-opacity: 1;border-top-color:rgb(var(--tab-active) / var(--tw-border-opacity))}#ns-payment-popup>div .ns-payment-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity))}.ns-tab .tab{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab .tab.active{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab .tab.inactive{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab-item>div{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab-item>div .ns-tab-item-footer{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.ns-tab-item .ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody td{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table{width:100%}.ns-table thead{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table thead tr.error>th,.ns-table thead tr.error td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.success>th,.ns-table thead tr.success td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.info>th,.ns-table thead tr.info td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.warning>th,.ns-table thead tr.warning td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody,.ns-table tfoot{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tbody td,.ns-table tfoot td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody tr.info,.ns-table tfoot tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.error,.ns-table tfoot tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.success,.ns-table tfoot tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.warning,.ns-table tfoot tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody .ns-inset-button,.ns-table tfoot .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.ns-table tbody .ns-inset-button.active,.ns-table tbody .ns-inset-button:hover,.ns-table tfoot .ns-inset-button.active,.ns-table tfoot .ns-inset-button:hover{border-color:transparent}.ns-table td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@keyframes loader-animation{0%{left:-100%}49%{left:100%}50%{left:100%}to{left:-100%}}.ns-loader{height:2px;width:100%;overflow:hidden;margin-top:-1px}.ns-loader .bar{position:relative;height:2px;width:100%;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));animation-name:loader-animation;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ns-numpad-key{--tw-border-opacity: 1;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-numpad-key:hover{--tw-border-opacity: 1;border-color:rgb(var(--numpad-hover-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))}.ns-numpad-key.error:hover,.ns-numpad-key.error.active{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.error:hover h1,.ns-numpad-key.error:hover h2,.ns-numpad-key.error:hover h3,.ns-numpad-key.error:hover h4,.ns-numpad-key.error:hover h5,.ns-numpad-key.error:hover h6,.ns-numpad-key.error:hover span,.ns-numpad-key.error.active h1,.ns-numpad-key.error.active h2,.ns-numpad-key.error.active h3,.ns-numpad-key.error.active h4,.ns-numpad-key.error.active h5,.ns-numpad-key.error.active h6,.ns-numpad-key.error.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.success:hover,.ns-numpad-key.success.active{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.success:hover h1,.ns-numpad-key.success:hover h2,.ns-numpad-key.success:hover h3,.ns-numpad-key.success:hover h4,.ns-numpad-key.success:hover h5,.ns-numpad-key.success:hover h6,.ns-numpad-key.success:hover span,.ns-numpad-key.success.active h1,.ns-numpad-key.success.active h2,.ns-numpad-key.success.active h3,.ns-numpad-key.success.active h4,.ns-numpad-key.success.active h5,.ns-numpad-key.success.active h6,.ns-numpad-key.success.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.info:hover,.ns-numpad-key.info.active{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.info:hover h1,.ns-numpad-key.info:hover h2,.ns-numpad-key.info:hover h3,.ns-numpad-key.info:hover h4,.ns-numpad-key.info:hover h5,.ns-numpad-key.info:hover h6,.ns-numpad-key.info:hover span,.ns-numpad-key.info.active h1,.ns-numpad-key.info.active h2,.ns-numpad-key.info.active h3,.ns-numpad-key.info.active h4,.ns-numpad-key.info.active h5,.ns-numpad-key.info.active h6,.ns-numpad-key.info.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.warning:hover,.ns-numpad-key.warning.active{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.warning:hover h1,.ns-numpad-key.warning:hover h2,.ns-numpad-key.warning:hover h3,.ns-numpad-key.warning:hover h4,.ns-numpad-key.warning:hover h5,.ns-numpad-key.warning:hover h6,.ns-numpad-key.warning:hover span,.ns-numpad-key.warning.active h1,.ns-numpad-key.warning.active h2,.ns-numpad-key.warning.active h3,.ns-numpad-key.warning.active h4,.ns-numpad-key.warning.active h5,.ns-numpad-key.warning.active h6,.ns-numpad-key.warning.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.default:hover,.ns-numpad-key.default.active{--tw-border-opacity: 1;border-color:rgb(var(--default-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--default-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.default:hover h1,.ns-numpad-key.default:hover h2,.ns-numpad-key.default:hover h3,.ns-numpad-key.default:hover h4,.ns-numpad-key.default:hover h5,.ns-numpad-key.default:hover h6,.ns-numpad-key.default:hover span,.ns-numpad-key.default.active h1,.ns-numpad-key.default.active h2,.ns-numpad-key.default.active h3,.ns-numpad-key.default.active h4,.ns-numpad-key.default.active h5,.ns-numpad-key.default.active h6,.ns-numpad-key.default.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-media .sidebar{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .sidebar h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .sidebar .sidebar-menus li{border-color:transparent}#ns-media .sidebar .sidebar-menus li.active,#ns-media .sidebar .sidebar-menus li:hover{--tw-border-opacity: 1;border-color:rgb(var(--tab-active) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .content{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#ns-media .content #ns-grid .ns-media-image-selected{--tw-ring-color: rgb(var(--info-primary) / var(--tw-ring-opacity));--tw-ring-opacity: .5}#ns-media .content .ns-media-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item .error{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}#ns-media .content .ns-media-preview-panel{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#crud-table tr.ns-table-row td>a{border-bottom-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))} +:root{--typography: 55 65 81;--surface: 209 213 219;--surface-soft: 229 231 235;--surface-hard: 250 250 250;--popup-surface: 250 250 250;--input-edge: 156 163 175;--input-background: 229 231 235;--input-disabled: 156 163 175;--input-button: 244 244 245;--input-button-hover: 228 228 231;--input-button-active: 212 212 216;--input-option-hover: 107 114 128;--box-background: 250 250 250;--box-edge: 209 213 219;--box-elevation-background: 241 245 249;--box-elevation-edge: 203 213 225;--box-elevation-hover: 203 213 225;--crud-button-edge: 209 213 219;--crud-input-background: 209 213 219;--pos-button-edge: 209 213 219;--numpad-background: 107 114 128;--numpad-typography: 55 65 81;--numpad-edge: 209 213 219;--numpad-hover: 203 213 225;--numpad-hover-edge: 209 213 219;--option-hover: 107 114 128;--scroll-thumb: 30 64 175;--scroll-track: 0 0 0;--scroll-popup-thumb: 71 85 105;--pre: 107 114 128;--tab-active: 250 250 250;--tab-active-border: 209 213 219;--tab-inactive: 229 231 235;--tab-table-th: 209 213 219;--tab-table-th-edge: 209 213 219;--table-th: 229 231 235;--table-th-edge: 209 213 219;--floating-menu: 255 255 255;--floating-menu-hover: 241 245 249;--floating-menu-selected: 226 232 240;--floating-menu-edge: 226 232 240;--primary: 55 65 81;--secondary: 31 41 55;--tertiary: 17 24 39;--soft-primary: 75 85 99;--soft-secondary: 107 114 128;--soft-tertiary: 156 163 175;--info-primary: 191 219 254;--info-secondary: 96 165 250;--info-tertiary: 37 99 235;--info-light-primary: 191 219 254;--info-light-secondary: 147 197 253;--info-light-tertiary: 96 165 250;--error-primary: 254 202 202;--error-secondary: 248 113 113;--error-tertiary: 220 38 38;--error-light-primary: 254 202 202;--error-light-secondary: 252 165 165;--error-light-tertiary: 248 113 113;--success-primary: 187 247 208;--success-secondary: 74 222 128;--success-tertiary: 22 163 74;--success-light-primary: 187 247 208;--success-light-secondary: 134 239 172;--success-light-tertiary: 74 222 128;--warning-primary: 254 215 170;--warning-secondary: 251 146 60;--warning-tertiary: 234 88 12;--warning-light-primary: 255 237 213;--warning-light-secondary: 254 215 170;--warning-light-tertiary: 253 186 116;--danger-primary: 202 138 4;--danger-secondary: 161 98 7;--danger-tertiary: 133 77 14;--danger-light-primary: 254 249 195;--danger-light-secondary: 254 240 138;--danger-light-tertiary: 253 224 71;--default-primary: 203 213 225;--default-secondary: 148 163 184;--default-tertiary: 107 114 128;--default-light-primary: 226 232 240;--default-light-secondary: 203 213 225;--default-light-tertiary: 148 163 184}.is-popup .ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-body{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.is-popup .ns-box div>h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-header,.ns-box .ns-box-body{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-box .ns-box-footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}.ns-box div>h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice h1,.ns-notice h2,.ns-notice h3,.ns-notice h4,.ns-notice h5,.ns-notice p,.ns-notice span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-notice.danger h1,.ns-notice.danger h2,.ns-notice.danger h3,.ns-notice.danger h4,.ns-notice.danger h5,.ns-notice.warning h1,.ns-notice.warning h2,.ns-notice.warning h3,.ns-notice.warning h4,.ns-notice.warning h5,.ns-notice.success h1,.ns-notice.success h2,.ns-notice.success h3,.ns-notice.success h4,.ns-notice.success h5,.ns-notice.info h1,.ns-notice.info h2,.ns-notice.info h3,.ns-notice.info h4,.ns-notice.info h5,.ns-notice.error h1,.ns-notice.error h2,.ns-notice.error h3,.ns-notice.error h4,.ns-notice.error h5{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.danger{--tw-border-opacity: 1;border-color:rgb(var(--danger-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--danger-primary) / var(--tw-bg-opacity))}.ns-notice.danger p>a{--tw-text-opacity: 1;color:rgb(var(--danger-tertiary) / var(--tw-text-opacity))}.ns-notice.danger p>a:hover{text-decoration-line:underline}.ns-notice.danger pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-notice.warning p>a{--tw-text-opacity: 1;color:rgb(var(--warning-tertiary) / var(--tw-text-opacity))}.ns-notice.warning p>a:hover{text-decoration-line:underline}.ns-notice.warning pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-notice.success p>a{--tw-text-opacity: 1;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))}.ns-notice.success p>a:hover{text-decoration-line:underline}.ns-notice.success pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.error p a{--tw-text-opacity: 1;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))}.ns-notice.error p a:hover{text-decoration-line:underline}.ns-notice.error pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}.ns-notice.info p{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-notice.info p>a{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}.ns-notice.info p>a:hover{text-decoration-line:underline}.ns-notice.info pre{--tw-bg-opacity: 1;background-color:rgb(var(--pre) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-normal-text{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))}.ns-floating-notice.info h2,.ns-floating-notice.info p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}.ns-floating-notice.error h2,.ns-floating-notice.error p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity))}.ns-floating-notice.warning h2,.ns-floating-notice.warning p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-notice.success{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))}.ns-floating-notice.success h2,.ns-floating-notice.success p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-switch button.selected{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-switch button.selected:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}.ns-switch button.unselected{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.input-group input,.input-group select{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group button{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.input-group button i,.input-group button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group button .disabled{--tw-bg-opacity: 1;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))}.input-group.info{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}.input-group.info input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.info button{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.info button i,.input-group.info button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error{--tw-border-opacity: 1;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))}.input-group.error input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.error button{--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.error button i,.input-group.error button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}.input-group.warning input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.warning button{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.warning button i,.input-group.warning button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))}.input-group.success input{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.input-group.success button{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.input-group.success button i,.input-group.success button span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-select select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-select select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.ns-select select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-input [disabled],.ns-switch [disabled],.ns-select [disabled],.ns-textarea [disabled],.ns-media [disabled],.ns-checkbox [disabled]{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--tertiary) / var(--tw-text-opacity))}.ns-input .ns-enabled,.ns-switch .ns-enabled,.ns-select .ns-enabled,.ns-textarea .ns-enabled,.ns-media .ns-enabled,.ns-checkbox .ns-enabled{background-color:transparent}.ns-input label.has-error,.ns-switch label.has-error,.ns-select label.has-error,.ns-textarea label.has-error,.ns-media label.has-error,.ns-checkbox label.has-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-input label.is-pristine,.ns-switch label.is-pristine,.ns-select label.is-pristine,.ns-textarea label.is-pristine,.ns-media label.is-pristine,.ns-checkbox label.is-pristine{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input div.has-error,.ns-switch div.has-error,.ns-select div.has-error,.ns-textarea div.has-error,.ns-media div.has-error,.ns-checkbox div.has-error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))}.ns-input div.is-pristine,.ns-switch div.is-pristine,.ns-select div.is-pristine,.ns-textarea div.is-pristine,.ns-media div.is-pristine,.ns-checkbox div.is-pristine{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}.ns-input .leading,.ns-switch .leading,.ns-select .leading,.ns-textarea .leading,.ns-media .leading,.ns-checkbox .leading{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input input,.ns-input textarea,.ns-switch input,.ns-switch textarea,.ns-select input,.ns-select textarea,.ns-textarea input,.ns-textarea textarea,.ns-media input,.ns-media textarea,.ns-checkbox input,.ns-checkbox textarea{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.ns-input button,.ns-switch button,.ns-select button,.ns-textarea button,.ns-media button,.ns-checkbox button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input button:hover,.ns-switch button:hover,.ns-select button:hover,.ns-textarea button:hover,.ns-media button:hover,.ns-checkbox button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-input p.ns-description,.ns-switch p.ns-description,.ns-select p.ns-description,.ns-textarea p.ns-description,.ns-media p.ns-description,.ns-checkbox p.ns-description{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-input p.ns-error,.ns-switch p.ns-error,.ns-select p.ns-error,.ns-textarea p.ns-error,.ns-media p.ns-error,.ns-checkbox p.ns-error{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input{outline-width:0px}.form-input *[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input label{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.form-input select option{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input select option:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-option-hover) / var(--tw-bg-opacity))}.form-input input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}.form-input input[disabled]{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))}.form-input p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.form-input-invalid label{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.form-input-invalid input{border-radius:.25rem;--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}.form-input-invalid p{--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button button,.ns-button a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-button:hover a,.ns-button:hover button{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}.ns-button.hover-success:hover button,.ns-button.hover-success:hover a,.ns-button.success button,.ns-button.success a{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-success:hover button span.ns-label,.ns-button.hover-success:hover a span.ns-label,.ns-button.success button span.ns-label,.ns-button.success a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}.ns-button.hover-error:hover button,.ns-button.hover-error:hover a,.ns-button.error button,.ns-button.error a{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-error:hover button span.ns-label,.ns-button.hover-error:hover a span.ns-label,.ns-button.error button span.ns-label,.ns-button.error a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-button.hover-warning:hover button,.ns-button.hover-warning:hover a,.ns-button.warning button,.ns-button.warning a{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-warning:hover button span.ns-label,.ns-button.hover-warning:hover a span.ns-label,.ns-button.warning button span.ns-label,.ns-button.warning a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button,.ns-button.hover-default:hover a,.ns-button.default button,.ns-button.default a{--tw-bg-opacity: 1;background-color:rgb(var(--input-button) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-button.hover-default:hover button span.ns-label,.ns-button.hover-default:hover a span.ns-label,.ns-button.default button span.ns-label,.ns-button.default a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}.ns-button.hover-info:hover button,.ns-button.hover-info:hover a,.ns-button.info button,.ns-button.info a{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-button.hover-info:hover button span.ns-label,.ns-button.hover-info:hover a span.ns-label,.ns-button.info button span.ns-label,.ns-button.info a span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}.ns-button>button:disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity));--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-button>button:disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ns-buttons button.success,.ns-buttons a.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.success span.ns-label,.ns-buttons a.success span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))}.ns-buttons button.error,.ns-buttons a.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.error span.ns-label,.ns-buttons a.error span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--error-secondary) / var(--tw-text-opacity))}.ns-buttons button.warning,.ns-buttons a.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.warning span.ns-label,.ns-buttons a.warning span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--warning-secondary) / var(--tw-text-opacity))}.ns-buttons button.default,.ns-buttons a.default{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--input-disabled) / var(--tw-text-opacity))}.ns-buttons button.default span.ns-label,.ns-buttons a.default span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.info,.ns-buttons a.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-buttons button.info span.ns-label,.ns-buttons a.info span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled{cursor:not-allowed;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-buttons .ns-disabled span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-close-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-close-button:hover>i{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button:hover,.ns-floating-panel .ns-inset-button.active,.ns-floating-panel .ns-inset-button.info:hover,.ns-floating-panel .ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.success:hover,.ns-floating-panel .ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.warning:hover,.ns-floating-panel .ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-floating-panel .ns-inset-button.error:hover,.ns-floating-panel .ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-inset-button:hover,.ns-inset-button.active,.ns-inset-button.info:hover,.ns-inset-button.info.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.success:hover,.ns-inset-button.success.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.warning:hover,.ns-inset-button.warning.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-inset-button.error:hover,.ns-inset-button.error.active{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-multiselect .ns-dropdown{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.ns-daterange-picker .form-control.reportrange-text{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#crud-table #crud-table-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-table .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-table .ns-crud-input input,#crud-table .ns-crud-input select{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-table-row{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}#crud-table .ns-table-row td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-menu-wrapper>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#crud-table .ns-table-row .ns-action-button{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-table-row .ns-action-button:focus{outline:2px solid transparent;outline-offset:2px}#crud-table .ns-crud-button,#crud-table .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-enabled,#crud-table .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-crud-button.table-filters-disabled,#crud-table .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover,#crud-table .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .ns-crud-button:hover i,#crud-table .ns-crud-button:hover span,#crud-table .ns-crud-input-button:hover i,#crud-table .ns-crud-input-button:hover span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#crud-table .footer{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#crud-form .ns-crud-button,#crud-form .ns-crud-input-button{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-enabled,#crud-form .ns-crud-input-button.table-filters-enabled{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#crud-form .ns-crud-button.table-filters-disabled,#crud-form .ns-crud-input-button.table-filters-disabled{--tw-border-opacity: 1;border-color:rgb(var(--crud-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#crud-form .ns-crud-button:hover,#crud-form .ns-crud-input-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#crud-form .ns-crud-input{--tw-border-opacity: 1;border-color:rgb(var(--input-background) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))}#crud-form .ns-crud-input input{--tw-bg-opacity: 1;background-color:rgb(var(--crud-button-edge) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#main-container,#page-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.card-widget h1,.card-widget h2,.card-widget h3,.card-widget h4,.card-widget h5,.card-widget h6,.card-widget i{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-menu:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.toggled{--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu.normal{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-menu .notification-label{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu{--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}#dashboard-aside>div .ns-aside-submenu.active{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#dashboard-aside>div .ns-aside-submenu.normal{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}#dashboard-body{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}.ns-toggle-button{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-toggle-button:hover{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.ns-avatar{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-avatar:hover,.ns-avatar.toggled{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.pending-drag{border-color:transparent}.awaiting-drop{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.drag-over{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity))}#notificaton-wrapper #notification-button{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-button.panel-visible{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper #notification-button.panel-hidden{--tw-border-opacity: 1;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))}#notificaton-wrapper #notification-button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper #notification-center>div>div{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#notificaton-wrapper .clear-all{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .clear-all:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#notificaton-wrapper .notification-card h1{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#notificaton-wrapper .notification-card .date{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}#ns-orders-chart .head,#ns-orders-chart .foot{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-chart .foot>div{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-chart .foot>div span{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-chart .foot>div h2{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .title{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-orders-summary .head,#ns-orders-summary .title{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-orders-summary .head h3,#ns-orders-summary .head i,#ns-orders-summary .head h4,#ns-orders-summary .head p,#ns-orders-summary .head span,#ns-orders-summary .title h3,#ns-orders-summary .title i,#ns-orders-summary .title h4,#ns-orders-summary .title p,#ns-orders-summary .title span{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .paid-order,#ns-orders-summary .title .paid-order{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .other-order,#ns-orders-summary .title .other-order{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-orders-summary .head .single-order,#ns-orders-summary .title .single-order{--tw-border-opacity: 1;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))}#ns-orders-summary .head .paid-currency,#ns-orders-summary .title .paid-currency{--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#ns-orders-summary .head .unpaid-currency,#ns-orders-summary .title .unpaid-currency{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers,#ns-best-cashiers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-best-customers .head,#ns-best-cashiers .head{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body,#ns-best-cashiers .body{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-best-customers .body .entry,#ns-best-cashiers .body .entry{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.ns-scrollbar::-webkit-scrollbar{width:5px}.ns-scrollbar::-webkit-scrollbar-track{background-color:#ffffff80}.ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-thumb) / var(--tw-bg-opacity))}.is-popup .ns-scrollbar::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(var(--scroll-popup-thumb) / var(--tw-bg-opacity))}ul.ns-vertical-menu{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}ul.ns-vertical-menu li{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}ul.ns-vertical-menu li:hover,ul.ns-vertical-menu li.active{--tw-bg-opacity: 1;background-color:rgb(var(--floating-menu-selected) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup,#confirm-popup,#prompt-popup{--tw-bg-opacity: 1;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))}#alert-popup h2,#confirm-popup h2,#prompt-popup h2{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#alert-popup p,#confirm-popup p,#prompt-popup p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons,#confirm-popup .action-buttons,#prompt-popup .action-buttons{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#alert-popup .action-buttons button:hover,#confirm-popup .action-buttons button:hover,#prompt-popup .action-buttons button:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#alert-popup .action-buttons hr,#confirm-popup .action-buttons hr,#prompt-popup .action-buttons hr{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}.is-popup{background:rgba(0,0,0,.4)}.is-popup .elevation-surface{--tw-border-opacity: 1;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.success{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.success.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.error{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.error.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.info{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.info.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.warning{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.is-popup .elevation-surface.warning.hoverable:hover{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#loader{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#loader p,#ns-pos-customer-select-popup .purchase-amount{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));font-weight:600;--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-cart>span.products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart #tools .switch-grid{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div hr{--tw-bg-opacity: 1;background-color:rgb(var(--pos-button-edge) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-toolbox>div .ns-button button{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-table-header{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-table-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table a:hover{--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product{--tw-border-opacity: 1;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .remove-product:hover{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .price:hover{--tw-text-opacity: 1;color:rgb(var(--info-secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode{--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .wholesale-mode:hover{background-color:transparent;--tw-text-opacity: 1;color:rgb(var(--success-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .normal-mode:hover{--tw-text-opacity: 1;color:rgb(var(--info-primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-item>div .product-controls{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer>span{--tw-border-opacity: 1;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .quantity-changer:hover{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-products-table>div .product-price{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-table .empty-cart h3{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a{--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table td a:hover{--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-products-summary table .summary-line a:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--success-primary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #pay-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #hold-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button{border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #discount-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--input-button-active) / var(--tw-bg-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--typography) / var(--tw-text-opacity))}#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:hover,#pos-container #pos-cart .cart-table #cart-bottom-buttons #void-button:active{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#pos-container #pos-grid .switch-cart{border-color:transparent;--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid .switch-cart .products-count{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#pos-container #pos-grid .switch-grid{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-header{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-header>div{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-header>div button.pos-button-clicked{--tw-bg-opacity: 1;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity));box-shadow:inset 0 0 5px #303131}#pos-container #pos-grid #grid-container #grid-header>div input{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-breadscrumb ul>li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item{--tw-border-opacity: 1;border-color:rgb(var(--pos-button-edge) / var(--tw-border-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item .cell-item-label{background:rgba(250,250,250,.73)}#pos-container #pos-grid #grid-container #grid-items .cell-item:hover{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#pos-container #pos-grid #grid-container #grid-items .cell-item i,#pos-container #pos-grid #grid-container #grid-items .cell-item span{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}#ns-pos-customers{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-pos-customers .ns-header{--tw-border-opacity: 1;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))}#ns-pos-customers .ns-header h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-pos-customers .ns-tab-cards h3,#ns-pos-customers .ns-tab-cards h2{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-pos-customers .ns-body,#ns-order-type{--tw-bg-opacity: 1;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))}#ns-order-type h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type div>div>i{--tw-text-opacity: 1;color:rgb(var(--error-primary) / var(--tw-text-opacity))}#ns-order-type div>div div>p{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-order-type .ns-box-body>div:hover h4{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-order-type .ns-box-body>div h4{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-units-selector .overlay{background:rgba(250,250,250,.73)}#ns-pos-cash-registers-popup div.alert{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))}#ns-payment-popup .ns-pos-screen{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity))}#ns-payment-popup>div h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div ul li.ns-payment-gateway.ns-visible,#ns-payment-popup>div ul li.ns-payment-list.ns-visible{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li:hover{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div ul li span.ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-wrapper ul li button{--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-type-button{--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-submit-button{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-layaway-button{--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-buttons .ns-payment-button .ns-label{--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-payment-popup>div .ns-payment-list{--tw-border-opacity: 1;border-top-color:rgb(var(--tab-active) / var(--tw-border-opacity))}#ns-payment-popup>div .ns-payment-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active-border) / var(--tw-bg-opacity))}.ns-tab .tab{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab .tab.active{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab .tab.inactive{--tw-bg-opacity: 1;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))}.ns-tab-item>div{--tw-border-opacity: 1;border-color:rgb(var(--tab-active-border) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}.ns-tab-item>div .ns-tab-item-footer{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}h1,h2,h3,h4,h5,h6{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}p{--tw-text-opacity: 1;color:rgb(var(--secondary) / var(--tw-text-opacity))}.ns-tab-item .ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-tab-item .ns-table tbody td{--tw-border-opacity: 1;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table{width:100%}.ns-table thead{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table thead th{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--table-th) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table thead tr.error>th,.ns-table thead tr.error td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.success>th,.ns-table thead tr.success td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.info>th,.ns-table thead tr.info td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table thead tr.warning>th,.ns-table thead tr.warning td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-tertiary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody,.ns-table tfoot{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tbody td,.ns-table tfoot td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))}.ns-table tbody tr.info,.ns-table tfoot tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.error,.ns-table tfoot tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.success,.ns-table tfoot tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody tr.warning,.ns-table tfoot tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-primary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tbody .ns-inset-button,.ns-table tfoot .ns-inset-button{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.ns-table tbody .ns-inset-button.active,.ns-table tbody .ns-inset-button:hover,.ns-table tfoot .ns-inset-button.active,.ns-table tfoot .ns-inset-button:hover{border-color:transparent}.ns-table td{--tw-border-opacity: 1;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-table tr.info{--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.error{--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.success{--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-table tr.warning{--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}@keyframes loader-animation{0%{left:-100%}49%{left:100%}50%{left:100%}to{left:-100%}}.ns-loader{height:2px;width:100%;overflow:hidden;margin-top:-1px}.ns-loader .bar{position:relative;height:2px;width:100%;--tw-bg-opacity: 1;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity));animation-name:loader-animation;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ns-numpad-key{--tw-border-opacity: 1;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}.ns-numpad-key:hover{--tw-border-opacity: 1;border-color:rgb(var(--numpad-hover-edge) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))}.ns-numpad-key.error:hover,.ns-numpad-key.error.active{--tw-border-opacity: 1;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.error:hover h1,.ns-numpad-key.error:hover h2,.ns-numpad-key.error:hover h3,.ns-numpad-key.error:hover h4,.ns-numpad-key.error:hover h5,.ns-numpad-key.error:hover h6,.ns-numpad-key.error:hover span,.ns-numpad-key.error.active h1,.ns-numpad-key.error.active h2,.ns-numpad-key.error.active h3,.ns-numpad-key.error.active h4,.ns-numpad-key.error.active h5,.ns-numpad-key.error.active h6,.ns-numpad-key.error.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.success:hover,.ns-numpad-key.success.active{--tw-border-opacity: 1;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.success:hover h1,.ns-numpad-key.success:hover h2,.ns-numpad-key.success:hover h3,.ns-numpad-key.success:hover h4,.ns-numpad-key.success:hover h5,.ns-numpad-key.success:hover h6,.ns-numpad-key.success:hover span,.ns-numpad-key.success.active h1,.ns-numpad-key.success.active h2,.ns-numpad-key.success.active h3,.ns-numpad-key.success.active h4,.ns-numpad-key.success.active h5,.ns-numpad-key.success.active h6,.ns-numpad-key.success.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.info:hover,.ns-numpad-key.info.active{--tw-border-opacity: 1;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.info:hover h1,.ns-numpad-key.info:hover h2,.ns-numpad-key.info:hover h3,.ns-numpad-key.info:hover h4,.ns-numpad-key.info:hover h5,.ns-numpad-key.info:hover h6,.ns-numpad-key.info:hover span,.ns-numpad-key.info.active h1,.ns-numpad-key.info.active h2,.ns-numpad-key.info.active h3,.ns-numpad-key.info.active h4,.ns-numpad-key.info.active h5,.ns-numpad-key.info.active h6,.ns-numpad-key.info.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.warning:hover,.ns-numpad-key.warning.active{--tw-border-opacity: 1;border-color:rgb(var(--warning-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.warning:hover h1,.ns-numpad-key.warning:hover h2,.ns-numpad-key.warning:hover h3,.ns-numpad-key.warning:hover h4,.ns-numpad-key.warning:hover h5,.ns-numpad-key.warning:hover h6,.ns-numpad-key.warning:hover span,.ns-numpad-key.warning.active h1,.ns-numpad-key.warning.active h2,.ns-numpad-key.warning.active h3,.ns-numpad-key.warning.active h4,.ns-numpad-key.warning.active h5,.ns-numpad-key.warning.active h6,.ns-numpad-key.warning.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.default:hover,.ns-numpad-key.default.active{--tw-border-opacity: 1;border-color:rgb(var(--default-secondary) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--default-secondary) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ns-numpad-key.default:hover h1,.ns-numpad-key.default:hover h2,.ns-numpad-key.default:hover h3,.ns-numpad-key.default:hover h4,.ns-numpad-key.default:hover h5,.ns-numpad-key.default:hover h6,.ns-numpad-key.default:hover span,.ns-numpad-key.default.active h1,.ns-numpad-key.default.active h2,.ns-numpad-key.default.active h3,.ns-numpad-key.default.active h4,.ns-numpad-key.default.active h5,.ns-numpad-key.default.active h6,.ns-numpad-key.default.active span{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#ns-media .sidebar{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .sidebar h3{--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .sidebar .sidebar-menus li{border-color:transparent}#ns-media .sidebar .sidebar-menus li.active,#ns-media .sidebar .sidebar-menus li:hover{--tw-border-opacity: 1;border-color:rgb(var(--tab-active) / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(var(--primary) / var(--tw-text-opacity))}#ns-media .content{--tw-bg-opacity: 1;background-color:rgb(var(--surface) / var(--tw-bg-opacity))}#ns-media .content #ns-grid .ns-media-image-selected{--tw-ring-color: rgb(var(--info-primary) / var(--tw-ring-opacity));--tw-ring-opacity: .5}#ns-media .content .ns-media-footer{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item{--tw-bg-opacity: 1;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))}#ns-media .content .ns-media-upload-item .error{--tw-bg-opacity: 1;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))}#ns-media .content .ns-media-preview-panel{--tw-bg-opacity: 1;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))}#crud-table tr.ns-table-row td>a{border-bottom-width:1px;border-style:dashed;--tw-border-opacity: 1;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))} diff --git a/public/build/assets/line-awesome-BsCcXKB-.css b/public/build/assets/line-awesome-00e77db5.css similarity index 98% rename from public/build/assets/line-awesome-BsCcXKB-.css rename to public/build/assets/line-awesome-00e77db5.css index 9a3da5bbd..a82bd24ba 100644 --- a/public/build/assets/line-awesome-BsCcXKB-.css +++ b/public/build/assets/line-awesome-00e77db5.css @@ -1 +1 @@ -.lar,.las,.lab{-moz-osx-font-surface-tertiarying:grayscale;-webkit-font-surface-tertiarying:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}@font-face{font-family:Line Awesome Brands;font-style:normal;font-weight:400;font-display:auto;src:url(./la-brands-400-LN4CMlGg.eot);src:url(./la-brands-400-LN4CMlGg.eot?#iefix) format("embedded-opentype"),url(./la-brands-400-Cq-R4OEF.woff2) format("woff2"),url(./la-brands-400-D0lxOIwB.woff) format("woff"),url(./la-brands-400-gDglUfU7.ttf) format("truetype"),url(./la-brands-400-wsUI3UJ9.svg#lineawesome) format("svg")}.lab{font-family:Line Awesome Brands;font-weight:400}@font-face{font-family:Line Awesome Free;font-style:normal;font-weight:400;font-display:auto;src:url(./la-regular-400-Cx6vm3uW.eot);src:url(./la-regular-400-Cx6vm3uW.eot?#iefix) format("embedded-opentype"),url(./la-regular-400-DuFMN_sw.woff2) format("woff2"),url(./la-regular-400-ehe5HgcS.woff) format("woff"),url(./la-regular-400-CmnW_RTo.ttf) format("truetype"),url(./la-regular-400-BmVb34ql.svg#lineawesome) format("svg")}.lar{font-family:Line Awesome Free;font-weight:400}@font-face{font-family:Line Awesome Free;font-style:normal;font-weight:900;font-display:auto;src:url(./la-solid-900-DkmX4G2x.eot);src:url(./la-solid-900-DkmX4G2x.eot?#iefix) format("embedded-opentype"),url(./la-solid-900-TjMEgv3Q.woff2) format("woff2"),url(./la-solid-900-CR_Kd-su.woff) format("woff"),url(./la-solid-900-BUOWlSBQ.ttf) format("truetype"),url(./la-solid-900-dtlPMWb8.svg#lineawesome) format("svg")}.las{font-family:Line Awesome Free;font-weight:900}.la-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.la-xs{font-size:.75em}.la-2x{font-size:2em}.la-3x{font-size:3em}.la-4x{font-size:4em}.la-5x{font-size:5em}.la-6x{font-size:6em}.la-7x{font-size:7em}.la-8x{font-size:8em}.la-9x{font-size:9em}.la-10x{font-size:10em}.la-fw{width:1.25em;text-align:center}.la-ul{padding-left:0;margin-left:1.4285714286em;list-style-type:none}.la-ul>li{position:relative}.la-li{position:absolute;left:-2em;text-align:center;width:1.4285714286em;line-height:inherit}.la-li.la-lg{left:-1.1428571429em}.la-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.la.la-pull-left{margin-right:.3em}.la.la-pull-right{margin-left:.3em}.la.pull-left{margin-right:.3em}.la.pull-right{margin-left:.3em}.la-pull-left{float:left}.la-pull-right{float:right}.la.la-pull-left,.las.la-pull-left,.lar.la-pull-left,.lal.la-pull-left,.lab.la-pull-left{margin-right:.3em}.la.la-pull-right,.las.la-pull-right,.lar.la-pull-right,.lal.la-pull-right,.lab.la-pull-right{margin-left:.3em}.la-spin{-webkit-animation:la-spin 2s infinite linear;animation:la-spin 2s infinite linear}.la-pulse{-webkit-animation:la-spin 1s infinite steps(8);animation:la-spin 1s infinite steps(8)}@-webkit-keyframes la-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes la-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.la-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.la-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.la-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.la-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1,1);transform:scaleX(-1)}.la-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1,-1);transform:scaleY(-1)}.la-flip-both,.la-flip-horizontal.la-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(-1,-1);transform:scale(-1)}:root .la-rotate-90,:root .la-rotate-180,:root .la-rotate-270,:root .la-flip-horizontal,:root .la-flip-vertical,:root .la-flip-both{-webkit-filter:none;filter:none}.la-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.la-stack-1x,.la-stack-2x{left:0;position:absolute;text-align:center;width:100%}.la-stack-1x{line-height:inherit}.la-stack-2x{font-size:2em}.la-inverse{color:#fff}.la-500px:before{content:""}.la-accessible-icon:before{content:""}.la-accusoft:before{content:""}.la-acquisitions-incorporated:before{content:""}.la-ad:before{content:""}.la-address-book:before{content:""}.la-address-card:before{content:""}.la-adjust:before{content:""}.la-adn:before{content:""}.la-adobe:before{content:""}.la-adversal:before{content:""}.la-affiliatetheme:before{content:""}.la-air-freshener:before{content:""}.la-airbnb:before{content:""}.la-algolia:before{content:""}.la-align-center:before{content:""}.la-align-justify:before{content:""}.la-align-left:before{content:""}.la-align-right:before{content:""}.la-alipay:before{content:""}.la-allergies:before{content:""}.la-amazon:before{content:""}.la-amazon-pay:before{content:""}.la-ambulance:before{content:""}.la-american-sign-language-interpreting:before{content:""}.la-amilia:before{content:""}.la-anchor:before{content:""}.la-android:before{content:""}.la-angellist:before{content:""}.la-angle-double-down:before{content:""}.la-angle-double-left:before{content:""}.la-angle-double-right:before{content:""}.la-angle-double-up:before{content:""}.la-angle-down:before{content:""}.la-angle-left:before{content:""}.la-angle-right:before{content:""}.la-angle-up:before{content:""}.la-angry:before{content:""}.la-angrycreative:before{content:""}.la-angular:before{content:""}.la-ankh:before{content:""}.la-app-store:before{content:""}.la-app-store-ios:before{content:""}.la-apper:before{content:""}.la-apple:before{content:""}.la-apple-alt:before{content:""}.la-apple-pay:before{content:""}.la-archive:before{content:""}.la-archway:before{content:""}.la-arrow-alt-circle-down:before{content:""}.la-arrow-alt-circle-left:before{content:""}.la-arrow-alt-circle-right:before{content:""}.la-arrow-alt-circle-up:before{content:""}.la-arrow-circle-down:before{content:""}.la-arrow-circle-left:before{content:""}.la-arrow-circle-right:before{content:""}.la-arrow-circle-up:before{content:""}.la-arrow-down:before{content:""}.la-arrow-left:before{content:""}.la-arrow-right:before{content:""}.la-arrow-up:before{content:""}.la-arrows-alt:before{content:""}.la-arrows-alt-h:before{content:""}.la-arrows-alt-v:before{content:""}.la-artstation:before{content:""}.la-assistive-listening-systems:before{content:""}.la-asterisk:before{content:""}.la-asymmetrik:before{content:""}.la-at:before{content:""}.la-atlas:before{content:""}.la-atlassian:before{content:""}.la-atom:before{content:""}.la-audible:before{content:""}.la-audio-description:before{content:""}.la-autoprefixer:before{content:""}.la-avianex:before{content:""}.la-aviato:before{content:""}.la-award:before{content:""}.la-aws:before{content:""}.la-baby:before{content:""}.la-baby-carriage:before{content:""}.la-backspace:before{content:""}.la-backward:before{content:""}.la-bacon:before{content:""}.la-balance-scale:before{content:""}.la-balance-scale-left:before{content:""}.la-balance-scale-right:before{content:""}.la-ban:before{content:""}.la-band-aid:before{content:""}.la-bandcamp:before{content:""}.la-barcode:before{content:""}.la-bars:before{content:""}.la-baseball-ball:before{content:""}.la-basketball-ball:before{content:""}.la-bath:before{content:""}.la-battery-empty:before{content:""}.la-battery-full:before{content:""}.la-battery-half:before{content:""}.la-battery-quarter:before{content:""}.la-battery-three-quarters:before{content:""}.la-battle-net:before{content:""}.la-bed:before{content:""}.la-beer:before{content:""}.la-behance:before{content:""}.la-behance-square:before{content:""}.la-bell:before{content:""}.la-bell-slash:before{content:""}.la-bezier-curve:before{content:""}.la-bible:before{content:""}.la-bicycle:before{content:""}.la-biking:before{content:""}.la-bimobject:before{content:""}.la-binoculars:before{content:""}.la-biohazard:before{content:""}.la-birthday-cake:before{content:""}.la-bitbucket:before{content:""}.la-bitcoin:before{content:""}.la-bity:before{content:""}.la-black-tie:before{content:""}.la-blackberry:before{content:""}.la-blender:before{content:""}.la-blender-phone:before{content:""}.la-blind:before{content:""}.la-blog:before{content:""}.la-blogger:before{content:""}.la-blogger-b:before{content:""}.la-bluetooth:before{content:""}.la-bluetooth-b:before{content:""}.la-bold:before{content:""}.la-bolt:before{content:""}.la-bomb:before{content:""}.la-bone:before{content:""}.la-bong:before{content:""}.la-book:before{content:""}.la-book-dead:before{content:""}.la-book-medical:before{content:""}.la-book-open:before{content:""}.la-book-reader:before{content:""}.la-bookmark:before{content:""}.la-bootstrap:before{content:""}.la-border-all:before{content:""}.la-border-none:before{content:""}.la-border-style:before{content:""}.la-bowling-ball:before{content:""}.la-box:before{content:""}.la-box-open:before{content:""}.la-boxes:before{content:""}.la-braille:before{content:""}.la-brain:before{content:""}.la-bread-slice:before{content:""}.la-briefcase:before{content:""}.la-briefcase-medical:before{content:""}.la-broadcast-tower:before{content:""}.la-broom:before{content:""}.la-brush:before{content:""}.la-btc:before{content:""}.la-buffer:before{content:""}.la-bug:before{content:""}.la-building:before{content:""}.la-bullhorn:before{content:""}.la-bullseye:before{content:""}.la-burn:before{content:""}.la-buromobelexperte:before{content:""}.la-bus:before{content:""}.la-bus-alt:before{content:""}.la-business-time:before{content:""}.la-buysellads:before{content:""}.la-calculator:before{content:""}.la-calendar:before{content:""}.la-calendar-alt:before{content:""}.la-calendar-check:before{content:""}.la-calendar-day:before{content:""}.la-calendar-minus:before{content:""}.la-calendar-plus:before{content:""}.la-calendar-times:before{content:""}.la-calendar-week:before{content:""}.la-camera:before{content:""}.la-camera-retro:before{content:""}.la-campground:before{content:""}.la-canadian-maple-leaf:before{content:""}.la-candy-cane:before{content:""}.la-cannabis:before{content:""}.la-capsules:before{content:""}.la-car:before{content:""}.la-car-alt:before{content:""}.la-car-battery:before{content:""}.la-car-crash:before{content:""}.la-car-side:before{content:""}.la-caret-down:before{content:""}.la-caret-left:before{content:""}.la-caret-right:before{content:""}.la-caret-square-down:before{content:""}.la-caret-square-left:before{content:""}.la-caret-square-right:before{content:""}.la-caret-square-up:before{content:""}.la-caret-up:before{content:""}.la-carrot:before{content:""}.la-cart-arrow-down:before{content:""}.la-cart-plus:before{content:""}.la-cash-register:before{content:""}.la-cat:before{content:""}.la-cc-amazon-pay:before{content:""}.la-cc-amex:before{content:""}.la-cc-apple-pay:before{content:""}.la-cc-diners-club:before{content:""}.la-cc-discover:before{content:""}.la-cc-jcb:before{content:""}.la-cc-mastercard:before{content:""}.la-cc-paypal:before{content:""}.la-cc-stripe:before{content:""}.la-cc-visa:before{content:""}.la-centercode:before{content:""}.la-centos:before{content:""}.la-certificate:before{content:""}.la-chair:before{content:""}.la-chalkboard:before{content:""}.la-chalkboard-teacher:before{content:""}.la-charging-station:before{content:""}.la-chart-area:before{content:""}.la-chart-bar:before{content:""}.la-chart-line:before{content:""}.la-chart-pie:before{content:""}.la-check:before{content:""}.la-check-circle:before{content:""}.la-check-double:before{content:""}.la-check-square:before{content:""}.la-cheese:before{content:""}.la-chess:before{content:""}.la-chess-bishop:before{content:""}.la-chess-board:before{content:""}.la-chess-king:before{content:""}.la-chess-knight:before{content:""}.la-chess-pawn:before{content:""}.la-chess-queen:before{content:""}.la-chess-rook:before{content:""}.la-chevron-circle-down:before{content:""}.la-chevron-circle-left:before{content:""}.la-chevron-circle-right:before{content:""}.la-chevron-circle-up:before{content:""}.la-chevron-down:before{content:""}.la-chevron-left:before{content:""}.la-chevron-right:before{content:""}.la-chevron-up:before{content:""}.la-child:before{content:""}.la-chrome:before{content:""}.la-chromecast:before{content:""}.la-church:before{content:""}.la-circle:before{content:""}.la-circle-notch:before{content:""}.la-city:before{content:""}.la-clinic-medical:before{content:""}.la-clipboard:before{content:""}.la-clipboard-check:before{content:""}.la-clipboard-list:before{content:""}.la-clock:before{content:""}.la-clone:before{content:""}.la-closed-captioning:before{content:""}.la-cloud:before{content:""}.la-cloud-download-alt:before{content:""}.la-cloud-meatball:before{content:""}.la-cloud-moon:before{content:""}.la-cloud-moon-rain:before{content:""}.la-cloud-rain:before{content:""}.la-cloud-showers-heavy:before{content:""}.la-cloud-sun:before{content:""}.la-cloud-sun-rain:before{content:""}.la-cloud-upload-alt:before{content:""}.la-cloudscale:before{content:""}.la-cloudsmith:before{content:""}.la-cloudversify:before{content:""}.la-cocktail:before{content:""}.la-code:before{content:""}.la-code-branch:before{content:""}.la-codepen:before{content:""}.la-codiepie:before{content:""}.la-coffee:before{content:""}.la-cog:before{content:""}.la-cogs:before{content:""}.la-coins:before{content:""}.la-columns:before{content:""}.la-comment:before{content:""}.la-comment-alt:before{content:""}.la-comment-dollar:before{content:""}.la-comment-dots:before{content:""}.la-comment-medical:before{content:""}.la-comment-slash:before{content:""}.la-comments:before{content:""}.la-comments-dollar:before{content:""}.la-compact-disc:before{content:""}.la-compass:before{content:""}.la-compress:before{content:""}.la-compress-arrows-alt:before{content:""}.la-concierge-bell:before{content:""}.la-confluence:before{content:""}.la-connectdevelop:before{content:""}.la-contao:before{content:""}.la-cookie:before{content:""}.la-cookie-bite:before{content:""}.la-copy:before{content:""}.la-copyright:before{content:""}.la-cotton-bureau:before{content:""}.la-couch:before{content:""}.la-cpanel:before{content:""}.la-creative-commons:before{content:""}.la-creative-commons-by:before{content:""}.la-creative-commons-nc:before{content:""}.la-creative-commons-nc-eu:before{content:""}.la-creative-commons-nc-jp:before{content:""}.la-creative-commons-nd:before{content:""}.la-creative-commons-pd:before{content:""}.la-creative-commons-pd-alt:before{content:""}.la-creative-commons-remix:before{content:""}.la-creative-commons-sa:before{content:""}.la-creative-commons-sampling:before{content:""}.la-creative-commons-sampling-plus:before{content:""}.la-creative-commons-share:before{content:""}.la-creative-commons-zero:before{content:""}.la-credit-card:before{content:""}.la-critical-role:before{content:""}.la-crop:before{content:""}.la-crop-alt:before{content:""}.la-cross:before{content:""}.la-crosshairs:before{content:""}.la-crow:before{content:""}.la-crown:before{content:""}.la-crutch:before{content:""}.la-css3:before{content:""}.la-css3-alt:before{content:""}.la-cube:before{content:""}.la-cubes:before{content:""}.la-cut:before{content:""}.la-cuttlefish:before{content:""}.la-d-and-d:before{content:""}.la-d-and-d-beyond:before{content:""}.la-dashcube:before{content:""}.la-database:before{content:""}.la-deaf:before{content:""}.la-delicious:before{content:""}.la-democrat:before{content:""}.la-deploydog:before{content:""}.la-deskpro:before{content:""}.la-desktop:before{content:""}.la-dev:before{content:""}.la-deviantart:before{content:""}.la-dharmachakra:before{content:""}.la-dhl:before{content:""}.la-diagnoses:before{content:""}.la-diaspora:before{content:""}.la-dice:before{content:""}.la-dice-d20:before{content:""}.la-dice-d6:before{content:""}.la-dice-five:before{content:""}.la-dice-four:before{content:""}.la-dice-one:before{content:""}.la-dice-six:before{content:""}.la-dice-three:before{content:""}.la-dice-two:before{content:""}.la-digg:before{content:""}.la-digital-ocean:before{content:""}.la-digital-tachograph:before{content:""}.la-directions:before{content:""}.la-discord:before{content:""}.la-discourse:before{content:""}.la-divide:before{content:""}.la-dizzy:before{content:""}.la-dna:before{content:""}.la-dochub:before{content:""}.la-docker:before{content:""}.la-dog:before{content:""}.la-dollar-sign:before{content:""}.la-dolly:before{content:""}.la-dolly-flatbed:before{content:""}.la-donate:before{content:""}.la-door-closed:before{content:""}.la-door-open:before{content:""}.la-dot-circle:before{content:""}.la-dove:before{content:""}.la-download:before{content:""}.la-draft2digital:before{content:""}.la-drafting-compass:before{content:""}.la-dragon:before{content:""}.la-draw-polygon:before{content:""}.la-dribbble:before{content:""}.la-dribbble-square:before{content:""}.la-dropbox:before{content:""}.la-drum:before{content:""}.la-drum-steelpan:before{content:""}.la-drumstick-bite:before{content:""}.la-drupal:before{content:""}.la-dumbbell:before{content:""}.la-dumpster:before{content:""}.la-dumpster-fire:before{content:""}.la-dungeon:before{content:""}.la-dyalog:before{content:""}.la-earlybirds:before{content:""}.la-ebay:before{content:""}.la-edge:before{content:""}.la-edit:before{content:""}.la-egg:before{content:""}.la-eject:before{content:""}.la-elementor:before{content:""}.la-ellipsis-h:before{content:""}.la-ellipsis-v:before{content:""}.la-ello:before{content:""}.la-ember:before{content:""}.la-empire:before{content:""}.la-envelope:before{content:""}.la-envelope-open:before{content:""}.la-envelope-open-text:before{content:""}.la-envelope-square:before{content:""}.la-envira:before{content:""}.la-equals:before{content:""}.la-eraser:before{content:""}.la-erlang:before{content:""}.la-ethereum:before{content:""}.la-ethernet:before{content:""}.la-etsy:before{content:""}.la-euro-sign:before{content:""}.la-evernote:before{content:""}.la-exchange-alt:before{content:""}.la-exclamation:before{content:""}.la-exclamation-circle:before{content:""}.la-exclamation-triangle:before{content:""}.la-expand:before{content:""}.la-expand-arrows-alt:before{content:""}.la-expeditedssl:before{content:""}.la-external-link-alt:before{content:""}.la-external-link-square-alt:before{content:""}.la-eye:before{content:""}.la-eye-dropper:before{content:""}.la-eye-slash:before{content:""}.la-facebook:before{content:""}.la-facebook-f:before{content:""}.la-facebook-messenger:before{content:""}.la-facebook-square:before{content:""}.la-fan:before{content:""}.la-fantasy-flight-games:before{content:""}.la-fast-backward:before{content:""}.la-fast-forward:before{content:""}.la-fax:before{content:""}.la-feather:before{content:""}.la-feather-alt:before{content:""}.la-fedex:before{content:""}.la-fedora:before{content:""}.la-female:before{content:""}.la-fighter-jet:before{content:""}.la-figma:before{content:""}.la-file:before{content:""}.la-file-alt:before{content:""}.la-file-archive:before{content:""}.la-file-audio:before{content:""}.la-file-code:before{content:""}.la-file-contract:before{content:""}.la-file-csv:before{content:""}.la-file-download:before{content:""}.la-file-excel:before{content:""}.la-file-export:before{content:""}.la-file-image:before{content:""}.la-file-import:before{content:""}.la-file-invoice:before{content:""}.la-file-invoice-dollar:before{content:""}.la-file-medical:before{content:""}.la-file-medical-alt:before{content:""}.la-file-pdf:before{content:""}.la-file-powerpoint:before{content:""}.la-file-prescription:before{content:""}.la-file-signature:before{content:""}.la-file-upload:before{content:""}.la-file-video:before{content:""}.la-file-word:before{content:""}.la-fill:before{content:""}.la-fill-drip:before{content:""}.la-film:before{content:""}.la-filter:before{content:""}.la-fingerprint:before{content:""}.la-fire:before{content:""}.la-fire-alt:before{content:""}.la-fire-extinguisher:before{content:""}.la-firefox:before{content:""}.la-first-aid:before{content:""}.la-first-order:before{content:""}.la-first-order-alt:before{content:""}.la-firstdraft:before{content:""}.la-fish:before{content:""}.la-fist-raised:before{content:""}.la-flag:before{content:""}.la-flag-checkered:before{content:""}.la-flag-usa:before{content:""}.la-flask:before{content:""}.la-flickr:before{content:""}.la-flipboard:before{content:""}.la-flushed:before{content:""}.la-fly:before{content:""}.la-folder:before{content:""}.la-folder-minus:before{content:""}.la-folder-open:before{content:""}.la-folder-plus:before{content:""}.la-font:before{content:""}.la-font-awesome:before{content:""}.la-font-awesome-alt:before{content:""}.la-font-awesome-flag:before{content:""}.la-fonticons:before{content:""}.la-fonticons-fi:before{content:""}.la-football-ball:before{content:""}.la-fort-awesome:before{content:""}.la-fort-awesome-alt:before{content:""}.la-forumbee:before{content:""}.la-forward:before{content:""}.la-foursquare:before{content:""}.la-free-code-camp:before{content:""}.la-freebsd:before{content:""}.la-frog:before{content:""}.la-frown:before{content:""}.la-frown-open:before{content:""}.la-fulcrum:before{content:""}.la-funnel-dollar:before{content:""}.la-futbol:before{content:""}.la-galactic-republic:before{content:""}.la-galactic-senate:before{content:""}.la-gamepad:before{content:""}.la-gas-pump:before{content:""}.la-gavel:before{content:""}.la-gem:before{content:""}.la-genderless:before{content:""}.la-get-pocket:before{content:""}.la-gg:before{content:""}.la-gg-circle:before{content:""}.la-ghost:before{content:""}.la-gift:before{content:""}.la-gifts:before{content:""}.la-git:before{content:""}.la-git-alt:before{content:""}.la-git-square:before{content:""}.la-github:before{content:""}.la-github-alt:before{content:""}.la-github-square:before{content:""}.la-gitkraken:before{content:""}.la-gitlab:before{content:""}.la-gitter:before{content:""}.la-glass-cheers:before{content:""}.la-glass-martini:before{content:""}.la-glass-martini-alt:before{content:""}.la-glass-whiskey:before{content:""}.la-glasses:before{content:""}.la-glide:before{content:""}.la-glide-g:before{content:""}.la-globe:before{content:""}.la-globe-africa:before{content:""}.la-globe-americas:before{content:""}.la-globe-asia:before{content:""}.la-globe-europe:before{content:""}.la-gofore:before{content:""}.la-golf-ball:before{content:""}.la-goodreads:before{content:""}.la-goodreads-g:before{content:""}.la-google:before{content:""}.la-google-drive:before{content:""}.la-google-play:before{content:""}.la-google-plus:before{content:""}.la-google-plus-g:before{content:""}.la-google-plus-square:before{content:""}.la-google-wallet:before{content:""}.la-gopuram:before{content:""}.la-graduation-cap:before{content:""}.la-gratipay:before{content:""}.la-grav:before{content:""}.la-greater-than:before{content:""}.la-greater-than-equal:before{content:""}.la-grimace:before{content:""}.la-grin:before{content:""}.la-grin-alt:before{content:""}.la-grin-beam:before{content:""}.la-grin-beam-sweat:before{content:""}.la-grin-hearts:before{content:""}.la-grin-squint:before{content:""}.la-grin-squint-tears:before{content:""}.la-grin-stars:before{content:""}.la-grin-tears:before{content:""}.la-grin-tongue:before{content:""}.la-grin-tongue-squint:before{content:""}.la-grin-tongue-wink:before{content:""}.la-grin-wink:before{content:""}.la-grip-horizontal:before{content:""}.la-grip-lines:before{content:""}.la-grip-lines-vertical:before{content:""}.la-grip-vertical:before{content:""}.la-gripfire:before{content:""}.la-grunt:before{content:""}.la-guitar:before{content:""}.la-gulp:before{content:""}.la-h-square:before{content:""}.la-hacker-news:before{content:""}.la-hacker-news-square:before{content:""}.la-hackerrank:before{content:""}.la-hamburger:before{content:""}.la-hammer:before{content:""}.la-hamsa:before{content:""}.la-hand-holding:before{content:""}.la-hand-holding-heart:before{content:""}.la-hand-holding-usd:before{content:""}.la-hand-lizard:before{content:""}.la-hand-middle-finger:before{content:""}.la-hand-paper:before{content:""}.la-hand-peace:before{content:""}.la-hand-point-down:before{content:""}.la-hand-point-left:before{content:""}.la-hand-point-right:before{content:""}.la-hand-point-up:before{content:""}.la-hand-pointer:before{content:""}.la-hand-rock:before{content:""}.la-hand-scissors:before{content:""}.la-hand-spock:before{content:""}.la-hands:before{content:""}.la-hands-helping:before{content:""}.la-handshake:before{content:""}.la-hanukiah:before{content:""}.la-surface-quaternary-hat:before{content:""}.la-hashtag:before{content:""}.la-hat-wizard:before{content:""}.la-haykal:before{content:""}.la-hdd:before{content:""}.la-heading:before{content:""}.la-headphones:before{content:""}.la-headphones-alt:before{content:""}.la-headset:before{content:""}.la-heart:before{content:""}.la-heart-broken:before{content:""}.la-heartbeat:before{content:""}.la-helicopter:before{content:""}.la-highlighter:before{content:""}.la-hiking:before{content:""}.la-hippo:before{content:""}.la-hips:before{content:""}.la-hire-a-helper:before{content:""}.la-history:before{content:""}.la-hockey-puck:before{content:""}.la-holly-berry:before{content:""}.la-home:before{content:""}.la-hooli:before{content:""}.la-hornbill:before{content:""}.la-horse:before{content:""}.la-horse-head:before{content:""}.la-hospital:before{content:""}.la-hospital-alt:before{content:""}.la-hospital-symbol:before{content:""}.la-hot-tub:before{content:""}.la-hotdog:before{content:""}.la-hotel:before{content:""}.la-hotjar:before{content:""}.la-hourglass:before{content:""}.la-hourglass-end:before{content:""}.la-hourglass-half:before{content:""}.la-hourglass-start:before{content:""}.la-house-damage:before{content:""}.la-houzz:before{content:""}.la-hryvnia:before{content:""}.la-html5:before{content:""}.la-hubspot:before{content:""}.la-i-cursor:before{content:""}.la-ice-cream:before{content:""}.la-icicles:before{content:""}.la-icons:before{content:""}.la-id-badge:before{content:""}.la-id-card:before{content:""}.la-id-card-alt:before{content:""}.la-igloo:before{content:""}.la-image:before{content:""}.la-images:before{content:""}.la-imdb:before{content:""}.la-inbox:before{content:""}.la-indent:before{content:""}.la-industry:before{content:""}.la-infinity:before{content:""}.la-info:before{content:""}.la-info-circle:before{content:""}.la-instagram:before{content:""}.la-intercom:before{content:""}.la-internet-explorer:before{content:""}.la-invision:before{content:""}.la-ioxhost:before{content:""}.la-italic:before{content:""}.la-itch-io:before{content:""}.la-itunes:before{content:""}.la-itunes-note:before{content:""}.la-java:before{content:""}.la-jedi:before{content:""}.la-jedi-order:before{content:""}.la-jenkins:before{content:""}.la-jira:before{content:""}.la-joget:before{content:""}.la-joint:before{content:""}.la-joomla:before{content:""}.la-journal-whills:before{content:""}.la-js:before{content:""}.la-js-square:before{content:""}.la-jsfiddle:before{content:""}.la-kaaba:before{content:""}.la-kaggle:before{content:""}.la-key:before{content:""}.la-keybase:before{content:""}.la-keyboard:before{content:""}.la-keycdn:before{content:""}.la-khanda:before{content:""}.la-kickstarter:before{content:""}.la-kickstarter-k:before{content:""}.la-kiss:before{content:""}.la-kiss-beam:before{content:""}.la-kiss-wink-heart:before{content:""}.la-kiwi-bird:before{content:""}.la-korvue:before{content:""}.la-landmark:before{content:""}.la-language:before{content:""}.la-laptop:before{content:""}.la-laptop-code:before{content:""}.la-laptop-medical:before{content:""}.la-laravel:before{content:""}.la-lastfm:before{content:""}.la-lastfm-square:before{content:""}.la-laugh:before{content:""}.la-laugh-beam:before{content:""}.la-laugh-squint:before{content:""}.la-laugh-wink:before{content:""}.la-layer-group:before{content:""}.la-leaf:before{content:""}.la-leanpub:before{content:""}.la-lemon:before{content:""}.la-less:before{content:""}.la-less-than:before{content:""}.la-less-than-equal:before{content:""}.la-level-down-alt:before{content:""}.la-level-up-alt:before{content:""}.la-life-ring:before{content:""}.la-lightbulb:before{content:""}.la-line:before{content:""}.la-link:before{content:""}.la-linkedin:before{content:""}.la-linkedin-in:before{content:""}.la-linode:before{content:""}.la-linux:before{content:""}.la-lira-sign:before{content:""}.la-list:before{content:""}.la-list-alt:before{content:""}.la-list-ol:before{content:""}.la-list-ul:before{content:""}.la-location-arrow:before{content:""}.la-lock:before{content:""}.la-lock-open:before{content:""}.la-long-arrow-alt-down:before{content:""}.la-long-arrow-alt-left:before{content:""}.la-long-arrow-alt-right:before{content:""}.la-long-arrow-alt-up:before{content:""}.la-low-vision:before{content:""}.la-luggage-cart:before{content:""}.la-lyft:before{content:""}.la-magento:before{content:""}.la-magic:before{content:""}.la-magnet:before{content:""}.la-mail-bulk:before{content:""}.la-mailchimp:before{content:""}.la-male:before{content:""}.la-mandalorian:before{content:""}.la-map:before{content:""}.la-map-marked:before{content:""}.la-map-marked-alt:before{content:""}.la-map-marker:before{content:""}.la-map-marker-alt:before{content:""}.la-map-pin:before{content:""}.la-map-signs:before{content:""}.la-markdown:before{content:""}.la-marker:before{content:""}.la-mars:before{content:""}.la-mars-double:before{content:""}.la-mars-stroke:before{content:""}.la-mars-stroke-h:before{content:""}.la-mars-stroke-v:before{content:""}.la-mask:before{content:""}.la-mastodon:before{content:""}.la-maxcdn:before{content:""}.la-medal:before{content:""}.la-medapps:before{content:""}.la-medium:before{content:""}.la-medium-m:before{content:""}.la-medkit:before{content:""}.la-medrt:before{content:""}.la-meetup:before{content:""}.la-megaport:before{content:""}.la-meh:before{content:""}.la-meh-blank:before{content:""}.la-meh-rolling-eyes:before{content:""}.la-memory:before{content:""}.la-mendeley:before{content:""}.la-menorah:before{content:""}.la-mercury:before{content:""}.la-meteor:before{content:""}.la-microchip:before{content:""}.la-microphone:before{content:""}.la-microphone-alt:before{content:""}.la-microphone-alt-slash:before{content:""}.la-microphone-slash:before{content:""}.la-microscope:before{content:""}.la-microsoft:before{content:""}.la-minus:before{content:""}.la-minus-circle:before{content:""}.la-minus-square:before{content:""}.la-mitten:before{content:""}.la-mix:before{content:""}.la-mixcloud:before{content:""}.la-mizuni:before{content:""}.la-mobile:before{content:""}.la-mobile-alt:before{content:""}.la-modx:before{content:""}.la-monero:before{content:""}.la-money-bill:before{content:""}.la-money-bill-alt:before{content:""}.la-money-bill-wave:before{content:""}.la-money-bill-wave-alt:before{content:""}.la-money-check:before{content:""}.la-money-check-alt:before{content:""}.la-monument:before{content:""}.la-moon:before{content:""}.la-mortar-pestle:before{content:""}.la-mosque:before{content:""}.la-motorcycle:before{content:""}.la-mountain:before{content:""}.la-mouse-pointer:before{content:""}.la-mug-hot:before{content:""}.la-music:before{content:""}.la-napster:before{content:""}.la-neos:before{content:""}.la-network-wired:before{content:""}.la-neuter:before{content:""}.la-newspaper:before{content:""}.la-nimblr:before{content:""}.la-node:before{content:""}.la-node-js:before{content:""}.la-not-equal:before{content:""}.la-notes-medical:before{content:""}.la-npm:before{content:""}.la-ns8:before{content:""}.la-nutritionix:before{content:""}.la-object-group:before{content:""}.la-object-ungroup:before{content:""}.la-odnoklassniki:before{content:""}.la-odnoklassniki-square:before{content:""}.la-oil-can:before{content:""}.la-old-republic:before{content:""}.la-om:before{content:""}.la-opencart:before{content:""}.la-openid:before{content:""}.la-opera:before{content:""}.la-optin-monster:before{content:""}.la-osi:before{content:""}.la-otter:before{content:""}.la-outdent:before{content:""}.la-page4:before{content:""}.la-pagelines:before{content:""}.la-pager:before{content:""}.la-paint-brush:before{content:""}.la-paint-roller:before{content:""}.la-palette:before{content:""}.la-palfed:before{content:""}.la-pallet:before{content:""}.la-paper-plane:before{content:""}.la-paperclip:before{content:""}.la-parachute-box:before{content:""}.la-paragraph:before{content:""}.la-parking:before{content:""}.la-passport:before{content:""}.la-pastafarianism:before{content:""}.la-paste:before{content:""}.la-patreon:before{content:""}.la-pause:before{content:""}.la-pause-circle:before{content:""}.la-paw:before{content:""}.la-paypal:before{content:""}.la-peace:before{content:""}.la-pen:before{content:""}.la-pen-alt:before{content:""}.la-pen-fancy:before{content:""}.la-pen-nib:before{content:""}.la-pen-square:before{content:""}.la-pencil-alt:before{content:""}.la-pencil-ruler:before{content:""}.la-penny-arcade:before{content:""}.la-people-carry:before{content:""}.la-pepper-hot:before{content:""}.la-percent:before{content:""}.la-percentage:before{content:""}.la-periscope:before{content:""}.la-person-booth:before{content:""}.la-phabricator:before{content:""}.la-phoenix-framework:before{content:""}.la-phoenix-squadron:before{content:""}.la-phone:before{content:""}.la-phone-alt:before{content:""}.la-phone-slash:before{content:""}.la-phone-square:before{content:""}.la-phone-square-alt:before{content:""}.la-phone-volume:before{content:""}.la-photo-video:before{content:""}.la-php:before{content:""}.la-pied-piper:before{content:""}.la-pied-piper-alt:before{content:""}.la-pied-piper-hat:before{content:""}.la-pied-piper-pp:before{content:""}.la-piggy-bank:before{content:""}.la-pills:before{content:""}.la-pinterest:before{content:""}.la-pinterest-p:before{content:""}.la-pinterest-square:before{content:""}.la-pizza-slice:before{content:""}.la-place-of-worship:before{content:""}.la-plane:before{content:""}.la-plane-arrival:before{content:""}.la-plane-departure:before{content:""}.la-play:before{content:""}.la-play-circle:before{content:""}.la-playstation:before{content:""}.la-plug:before{content:""}.la-plus:before{content:""}.la-plus-circle:before{content:""}.la-plus-square:before{content:""}.la-podcast:before{content:""}.la-poll:before{content:""}.la-poll-h:before{content:""}.la-poo:before{content:""}.la-poo-storm:before{content:""}.la-poop:before{content:""}.la-portrait:before{content:""}.la-pound-sign:before{content:""}.la-power-off:before{content:""}.la-pray:before{content:""}.la-praying-hands:before{content:""}.la-prescription:before{content:""}.la-prescription-bottle:before{content:""}.la-prescription-bottle-alt:before{content:""}.la-print:before{content:""}.la-procedures:before{content:""}.la-product-hunt:before{content:""}.la-project-diagram:before{content:""}.la-pushed:before{content:""}.la-puzzle-piece:before{content:""}.la-python:before{content:""}.la-qq:before{content:""}.la-qrcode:before{content:""}.la-question:before{content:""}.la-question-circle:before{content:""}.la-quidditch:before{content:""}.la-quinscape:before{content:""}.la-quora:before{content:""}.la-quote-left:before{content:""}.la-quote-right:before{content:""}.la-quran:before{content:""}.la-r-project:before{content:""}.la-radiation:before{content:""}.la-radiation-alt:before{content:""}.la-rainbow:before{content:""}.la-random:before{content:""}.la-raspberry-pi:before{content:""}.la-ravelry:before{content:""}.la-react:before{content:""}.la-reacteurope:before{content:""}.la-readme:before{content:""}.la-rebel:before{content:""}.la-receipt:before{content:""}.la-recycle:before{content:""}.la-red-river:before{content:""}.la-reddit:before{content:""}.la-reddit-alien:before{content:""}.la-reddit-square:before{content:""}.la-redhat:before{content:""}.la-redo:before{content:""}.la-redo-alt:before{content:""}.la-registered:before{content:""}.la-remove-format:before{content:""}.la-renren:before{content:""}.la-reply:before{content:""}.la-reply-all:before{content:""}.la-replyd:before{content:""}.la-republican:before{content:""}.la-researchgate:before{content:""}.la-resolving:before{content:""}.la-restroom:before{content:""}.la-retweet:before{content:""}.la-rev:before{content:""}.la-ribbon:before{content:""}.la-ring:before{content:""}.la-road:before{content:""}.la-robot:before{content:""}.la-rocket:before{content:""}.la-rocketchat:before{content:""}.la-rockrms:before{content:""}.la-route:before{content:""}.la-rss:before{content:""}.la-rss-square:before{content:""}.la-ruble-sign:before{content:""}.la-ruler:before{content:""}.la-ruler-combined:before{content:""}.la-ruler-horizontal:before{content:""}.la-ruler-vertical:before{content:""}.la-running:before{content:""}.la-rupee-sign:before{content:""}.la-sad-cry:before{content:""}.la-sad-tear:before{content:""}.la-safari:before{content:""}.la-salesforce:before{content:""}.la-sass:before{content:""}.la-satellite:before{content:""}.la-satellite-dish:before{content:""}.la-save:before{content:""}.la-schlix:before{content:""}.la-school:before{content:""}.la-screwdriver:before{content:""}.la-scribd:before{content:""}.la-scroll:before{content:""}.la-sd-card:before{content:""}.la-search:before{content:""}.la-search-dollar:before{content:""}.la-search-location:before{content:""}.la-search-minus:before{content:""}.la-search-plus:before{content:""}.la-searchengin:before{content:""}.la-seedling:before{content:""}.la-sellcast:before{content:""}.la-sellsy:before{content:""}.la-server:before{content:""}.la-servicestack:before{content:""}.la-shapes:before{content:""}.la-share:before{content:""}.la-share-alt:before{content:""}.la-share-alt-square:before{content:""}.la-share-square:before{content:""}.la-shekel-sign:before{content:""}.la-shield-alt:before{content:""}.la-ship:before{content:""}.la-shipping-fast:before{content:""}.la-shirtsinbulk:before{content:""}.la-shoe-prints:before{content:""}.la-shopping-bag:before{content:""}.la-shopping-basket:before{content:""}.la-shopping-cart:before{content:""}.la-shopware:before{content:""}.la-shower:before{content:""}.la-shuttle-van:before{content:""}.la-sign:before{content:""}.la-sign-in-alt:before{content:""}.la-sign-language:before{content:""}.la-sign-out-alt:before{content:""}.la-signal:before{content:""}.la-signature:before{content:""}.la-sim-card:before{content:""}.la-simplybuilt:before{content:""}.la-sistrix:before{content:""}.la-sitemap:before{content:""}.la-sith:before{content:""}.la-skating:before{content:""}.la-sketch:before{content:""}.la-skiing:before{content:""}.la-skiing-nordic:before{content:""}.la-skull:before{content:""}.la-skull-crossbones:before{content:""}.la-skyatlas:before{content:""}.la-skype:before{content:""}.la-slack:before{content:""}.la-slack-hash:before{content:""}.la-slash:before{content:""}.la-sleigh:before{content:""}.la-sliders-h:before{content:""}.la-slideshare:before{content:""}.la-smile:before{content:""}.la-smile-beam:before{content:""}.la-smile-wink:before{content:""}.la-smog:before{content:""}.la-smoking:before{content:""}.la-smoking-ban:before{content:""}.la-sms:before{content:""}.la-snapchat:before{content:""}.la-snapchat-ghost:before{content:""}.la-snapchat-square:before{content:""}.la-snowboarding:before{content:""}.la-snowflake:before{content:""}.la-snowman:before{content:""}.la-snowplow:before{content:""}.la-socks:before{content:""}.la-solar-panel:before{content:""}.la-sort:before{content:""}.la-sort-alpha-down:before{content:""}.la-sort-alpha-down-alt:before{content:""}.la-sort-alpha-up:before{content:""}.la-sort-alpha-up-alt:before{content:""}.la-sort-amount-down:before{content:""}.la-sort-amount-down-alt:before{content:""}.la-sort-amount-up:before{content:""}.la-sort-amount-up-alt:before{content:""}.la-sort-down:before{content:""}.la-sort-numeric-down:before{content:""}.la-sort-numeric-down-alt:before{content:""}.la-sort-numeric-up:before{content:""}.la-sort-numeric-up-alt:before{content:""}.la-sort-up:before{content:""}.la-soundcloud:before{content:""}.la-sourcetree:before{content:""}.la-spa:before{content:""}.la-space-shuttle:before{content:""}.la-speakap:before{content:""}.la-speaker-deck:before{content:""}.la-spell-check:before{content:""}.la-spider:before{content:""}.la-spinner:before{content:""}.la-splotch:before{content:""}.la-spotify:before{content:""}.la-spray-can:before{content:""}.la-square:before{content:""}.la-square-full:before{content:""}.la-square-root-alt:before{content:""}.la-squarespace:before{content:""}.la-stack-exchange:before{content:""}.la-stack-overflow:before{content:""}.la-stackpath:before{content:""}.la-stamp:before{content:""}.la-star:before{content:""}.la-star-and-crescent:before{content:""}.la-star-half:before{content:""}.la-star-half-alt:before{content:""}.la-star-of-david:before{content:""}.la-star-of-life:before{content:""}.la-staylinked:before{content:""}.la-steam:before{content:""}.la-steam-square:before{content:""}.la-steam-symbol:before{content:""}.la-step-backward:before{content:""}.la-step-forward:before{content:""}.la-stethoscope:before{content:""}.la-sticker-mule:before{content:""}.la-sticky-note:before{content:""}.la-stop:before{content:""}.la-stop-circle:before{content:""}.la-stopwatch:before{content:""}.la-store:before{content:""}.la-store-alt:before{content:""}.la-strava:before{content:""}.la-stream:before{content:""}.la-street-view:before{content:""}.la-strikethrough:before{content:""}.la-stripe:before{content:""}.la-stripe-s:before{content:""}.la-stroopwafel:before{content:""}.la-studiovinari:before{content:""}.la-stumbleupon:before{content:""}.la-stumbleupon-circle:before{content:""}.la-subscript:before{content:""}.la-subway:before{content:""}.la-suitcase:before{content:""}.la-suitcase-rolling:before{content:""}.la-sun:before{content:""}.la-superpowers:before{content:""}.la-superscript:before{content:""}.la-supple:before{content:""}.la-surprise:before{content:""}.la-suse:before{content:""}.la-swatchbook:before{content:""}.la-swimmer:before{content:""}.la-swimming-pool:before{content:""}.la-symfony:before{content:""}.la-synagogue:before{content:""}.la-sync:before{content:""}.la-sync-alt:before{content:""}.la-syringe:before{content:""}.la-table:before{content:""}.la-table-tennis:before{content:""}.la-tablet:before{content:""}.la-tablet-alt:before{content:""}.la-tablets:before{content:""}.la-tachometer-alt:before{content:""}.la-tag:before{content:""}.la-tags:before{content:""}.la-tape:before{content:""}.la-tasks:before{content:""}.la-taxi:before{content:""}.la-teamspeak:before{content:""}.la-teeth:before{content:""}.la-teeth-open:before{content:""}.la-telegram:before{content:""}.la-telegram-plane:before{content:""}.la-temperature-high:before{content:""}.la-temperature-low:before{content:""}.la-tencent-weibo:before{content:""}.la-tenge:before{content:""}.la-terminal:before{content:""}.la-text-height:before{content:""}.la-text-width:before{content:""}.la-th:before{content:""}.la-th-large:before{content:""}.la-th-list:before{content:""}.la-the-red-yeti:before{content:""}.la-theater-masks:before{content:""}.la-themeco:before{content:""}.la-themeisle:before{content:""}.la-thermometer:before{content:""}.la-thermometer-empty:before{content:""}.la-thermometer-full:before{content:""}.la-thermometer-half:before{content:""}.la-thermometer-quarter:before{content:""}.la-thermometer-three-quarters:before{content:""}.la-think-peaks:before{content:""}.la-thumbs-down:before{content:""}.la-thumbs-up:before{content:""}.la-thumbtack:before{content:""}.la-ticket-alt:before{content:""}.la-times:before{content:""}.la-times-circle:before{content:""}.la-tint:before{content:""}.la-tint-slash:before{content:""}.la-tired:before{content:""}.la-toggle-off:before{content:""}.la-toggle-on:before{content:""}.la-toilet:before{content:""}.la-toilet-paper:before{content:""}.la-toolbox:before{content:""}.la-tools:before{content:""}.la-tooth:before{content:""}.la-torah:before{content:""}.la-torii-gate:before{content:""}.la-tractor:before{content:""}.la-trade-federation:before{content:""}.la-trademark:before{content:""}.la-traffic-light:before{content:""}.la-train:before{content:""}.la-tram:before{content:""}.la-transgender:before{content:""}.la-transgender-alt:before{content:""}.la-trash:before{content:""}.la-trash-alt:before{content:""}.la-trash-restore:before{content:""}.la-trash-restore-alt:before{content:""}.la-tree:before{content:""}.la-trello:before{content:""}.la-tripadvisor:before{content:""}.la-trophy:before{content:""}.la-truck:before{content:""}.la-truck-loading:before{content:""}.la-truck-monster:before{content:""}.la-truck-moving:before{content:""}.la-truck-pickup:before{content:""}.la-tshirt:before{content:""}.la-tty:before{content:""}.la-tumblr:before{content:""}.la-tumblr-square:before{content:""}.la-tv:before{content:""}.la-twitch:before{content:""}.la-twitter:before{content:""}.la-twitter-square:before{content:""}.la-typo3:before{content:""}.la-uber:before{content:""}.la-ubuntu:before{content:""}.la-uikit:before{content:""}.la-umbrella:before{content:""}.la-umbrella-beach:before{content:""}.la-underline:before{content:""}.la-undo:before{content:""}.la-undo-alt:before{content:""}.la-uniregistry:before{content:""}.la-universal-access:before{content:""}.la-university:before{content:""}.la-unlink:before{content:""}.la-unlock:before{content:""}.la-unlock-alt:before{content:""}.la-untappd:before{content:""}.la-upload:before{content:""}.la-ups:before{content:""}.la-usb:before{content:""}.la-user:before{content:""}.la-user-alt:before{content:""}.la-user-alt-slash:before{content:""}.la-user-astronaut:before{content:""}.la-user-check:before{content:""}.la-user-circle:before{content:""}.la-user-clock:before{content:""}.la-user-cog:before{content:""}.la-user-edit:before{content:""}.la-user-friends:before{content:""}.la-user-graduate:before{content:""}.la-user-injured:before{content:""}.la-user-lock:before{content:""}.la-user-md:before{content:""}.la-user-minus:before{content:""}.la-user-ninja:before{content:""}.la-user-nurse:before{content:""}.la-user-plus:before{content:""}.la-user-secret:before{content:""}.la-user-shield:before{content:""}.la-user-slash:before{content:""}.la-user-tag:before{content:""}.la-user-tie:before{content:""}.la-user-times:before{content:""}.la-users:before{content:""}.la-users-cog:before{content:""}.la-usps:before{content:""}.la-ussunnah:before{content:""}.la-utensil-spoon:before{content:""}.la-utensils:before{content:""}.la-vaadin:before{content:""}.la-vector-square:before{content:""}.la-venus:before{content:""}.la-venus-double:before{content:""}.la-venus-mars:before{content:""}.la-viacoin:before{content:""}.la-viadeo:before{content:""}.la-viadeo-square:before{content:""}.la-vial:before{content:""}.la-vials:before{content:""}.la-viber:before{content:""}.la-video:before{content:""}.la-video-slash:before{content:""}.la-vihara:before{content:""}.la-vimeo:before{content:""}.la-vimeo-square:before{content:""}.la-vimeo-v:before{content:""}.la-vine:before{content:""}.la-vk:before{content:""}.la-vnv:before{content:""}.la-voicemail:before{content:""}.la-volleyball-ball:before{content:""}.la-volume-down:before{content:""}.la-volume-mute:before{content:""}.la-volume-off:before{content:""}.la-volume-up:before{content:""}.la-vote-yea:before{content:""}.la-vr-cardboard:before{content:""}.la-vuejs:before{content:""}.la-walking:before{content:""}.la-wallet:before{content:""}.la-warehouse:before{content:""}.la-water:before{content:""}.la-wave-square:before{content:""}.la-waze:before{content:""}.la-weebly:before{content:""}.la-weibo:before{content:""}.la-weight:before{content:""}.la-weight-hanging:before{content:""}.la-weixin:before{content:""}.la-whatsapp:before{content:""}.la-whatsapp-square:before{content:""}.la-wheelchair:before{content:""}.la-whmcs:before{content:""}.la-wifi:before{content:""}.la-wikipedia-w:before{content:""}.la-wind:before{content:""}.la-window-close:before{content:""}.la-window-maximize:before{content:""}.la-window-minimize:before{content:""}.la-window-restore:before{content:""}.la-windows:before{content:""}.la-wine-bottle:before{content:""}.la-wine-glass:before{content:""}.la-wine-glass-alt:before{content:""}.la-wix:before{content:""}.la-wizards-of-the-coast:before{content:""}.la-wolf-pack-battalion:before{content:""}.la-won-sign:before{content:""}.la-wordpress:before{content:""}.la-wordpress-simple:before{content:""}.la-wpbeginner:before{content:""}.la-wpexplorer:before{content:""}.la-wpforms:before{content:""}.la-wpressr:before{content:""}.la-wrench:before{content:""}.la-x-ray:before{content:""}.la-xbox:before{content:""}.la-xing:before{content:""}.la-xing-square:before{content:""}.la-y-combinator:before{content:""}.la-yahoo:before{content:""}.la-yammer:before{content:""}.la-yandex:before{content:""}.la-yandex-international:before{content:""}.la-yarn:before{content:""}.la-yelp:before{content:""}.la-yen-sign:before{content:""}.la-yin-yang:before{content:""}.la-yoast:before{content:""}.la-youtube:before{content:""}.la-youtube-square:before{content:""}.la-zhihu:before{content:""}.la-hat-cowboy:before{content:""}.la-hat-cowboy-side:before{content:""}.la-mdb:before{content:""}.la-mouse:before{content:""}.la-orcid:before{content:""}.la-record-vinyl:before{content:""}.la-swift:before{content:""}.la-umbraco:before{content:""}.la-buy-n-large:before{content:""}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto} +.lar,.las,.lab{-moz-osx-font-surface-tertiarying:grayscale;-webkit-font-surface-tertiarying:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}@font-face{font-family:Line Awesome Brands;font-style:normal;font-weight:400;font-display:auto;src:url(./la-brands-400-c0e32387.eot);src:url(./la-brands-400-c0e32387.eot?#iefix) format("embedded-opentype"),url(./la-brands-400-ff70c9bc.woff2) format("woff2"),url(./la-brands-400-14c63377.woff) format("woff"),url(./la-brands-400-fbc98702.ttf) format("truetype"),url(./la-brands-400-4da18191.svg#lineawesome) format("svg")}.lab{font-family:Line Awesome Brands;font-weight:400}@font-face{font-family:Line Awesome Free;font-style:normal;font-weight:400;font-display:auto;src:url(./la-regular-400-7dc456f0.eot);src:url(./la-regular-400-7dc456f0.eot?#iefix) format("embedded-opentype"),url(./la-regular-400-51ca2c00.woff2) format("woff2"),url(./la-regular-400-7711fabc.woff) format("woff"),url(./la-regular-400-4b6ab8d0.ttf) format("truetype"),url(./la-regular-400-884ce19c.svg#lineawesome) format("svg")}.lar{font-family:Line Awesome Free;font-weight:400}@font-face{font-family:Line Awesome Free;font-style:normal;font-weight:900;font-display:auto;src:url(./la-solid-900-8a57f8a9.eot);src:url(./la-solid-900-8a57f8a9.eot?#iefix) format("embedded-opentype"),url(./la-solid-900-10a68e01.woff2) format("woff2"),url(./la-solid-900-a0d21b2a.woff) format("woff"),url(./la-solid-900-07ce3559.ttf) format("truetype"),url(./la-solid-900-0ce0cc40.svg#lineawesome) format("svg")}.las{font-family:Line Awesome Free;font-weight:900}.la-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.la-xs{font-size:.75em}.la-2x{font-size:2em}.la-3x{font-size:3em}.la-4x{font-size:4em}.la-5x{font-size:5em}.la-6x{font-size:6em}.la-7x{font-size:7em}.la-8x{font-size:8em}.la-9x{font-size:9em}.la-10x{font-size:10em}.la-fw{width:1.25em;text-align:center}.la-ul{padding-left:0;margin-left:1.4285714286em;list-style-type:none}.la-ul>li{position:relative}.la-li{position:absolute;left:-2em;text-align:center;width:1.4285714286em;line-height:inherit}.la-li.la-lg{left:-1.1428571429em}.la-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.la.la-pull-left{margin-right:.3em}.la.la-pull-right{margin-left:.3em}.la.pull-left{margin-right:.3em}.la.pull-right{margin-left:.3em}.la-pull-left{float:left}.la-pull-right{float:right}.la.la-pull-left,.las.la-pull-left,.lar.la-pull-left,.lal.la-pull-left,.lab.la-pull-left{margin-right:.3em}.la.la-pull-right,.las.la-pull-right,.lar.la-pull-right,.lal.la-pull-right,.lab.la-pull-right{margin-left:.3em}.la-spin{-webkit-animation:la-spin 2s infinite linear;animation:la-spin 2s infinite linear}.la-pulse{-webkit-animation:la-spin 1s infinite steps(8);animation:la-spin 1s infinite steps(8)}@-webkit-keyframes la-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes la-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.la-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.la-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.la-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.la-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1,1);transform:scaleX(-1)}.la-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1,-1);transform:scaleY(-1)}.la-flip-both,.la-flip-horizontal.la-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(-1,-1);transform:scale(-1)}:root .la-rotate-90,:root .la-rotate-180,:root .la-rotate-270,:root .la-flip-horizontal,:root .la-flip-vertical,:root .la-flip-both{-webkit-filter:none;filter:none}.la-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.la-stack-1x,.la-stack-2x{left:0;position:absolute;text-align:center;width:100%}.la-stack-1x{line-height:inherit}.la-stack-2x{font-size:2em}.la-inverse{color:#fff}.la-500px:before{content:""}.la-accessible-icon:before{content:""}.la-accusoft:before{content:""}.la-acquisitions-incorporated:before{content:""}.la-ad:before{content:""}.la-address-book:before{content:""}.la-address-card:before{content:""}.la-adjust:before{content:""}.la-adn:before{content:""}.la-adobe:before{content:""}.la-adversal:before{content:""}.la-affiliatetheme:before{content:""}.la-air-freshener:before{content:""}.la-airbnb:before{content:""}.la-algolia:before{content:""}.la-align-center:before{content:""}.la-align-justify:before{content:""}.la-align-left:before{content:""}.la-align-right:before{content:""}.la-alipay:before{content:""}.la-allergies:before{content:""}.la-amazon:before{content:""}.la-amazon-pay:before{content:""}.la-ambulance:before{content:""}.la-american-sign-language-interpreting:before{content:""}.la-amilia:before{content:""}.la-anchor:before{content:""}.la-android:before{content:""}.la-angellist:before{content:""}.la-angle-double-down:before{content:""}.la-angle-double-left:before{content:""}.la-angle-double-right:before{content:""}.la-angle-double-up:before{content:""}.la-angle-down:before{content:""}.la-angle-left:before{content:""}.la-angle-right:before{content:""}.la-angle-up:before{content:""}.la-angry:before{content:""}.la-angrycreative:before{content:""}.la-angular:before{content:""}.la-ankh:before{content:""}.la-app-store:before{content:""}.la-app-store-ios:before{content:""}.la-apper:before{content:""}.la-apple:before{content:""}.la-apple-alt:before{content:""}.la-apple-pay:before{content:""}.la-archive:before{content:""}.la-archway:before{content:""}.la-arrow-alt-circle-down:before{content:""}.la-arrow-alt-circle-left:before{content:""}.la-arrow-alt-circle-right:before{content:""}.la-arrow-alt-circle-up:before{content:""}.la-arrow-circle-down:before{content:""}.la-arrow-circle-left:before{content:""}.la-arrow-circle-right:before{content:""}.la-arrow-circle-up:before{content:""}.la-arrow-down:before{content:""}.la-arrow-left:before{content:""}.la-arrow-right:before{content:""}.la-arrow-up:before{content:""}.la-arrows-alt:before{content:""}.la-arrows-alt-h:before{content:""}.la-arrows-alt-v:before{content:""}.la-artstation:before{content:""}.la-assistive-listening-systems:before{content:""}.la-asterisk:before{content:""}.la-asymmetrik:before{content:""}.la-at:before{content:""}.la-atlas:before{content:""}.la-atlassian:before{content:""}.la-atom:before{content:""}.la-audible:before{content:""}.la-audio-description:before{content:""}.la-autoprefixer:before{content:""}.la-avianex:before{content:""}.la-aviato:before{content:""}.la-award:before{content:""}.la-aws:before{content:""}.la-baby:before{content:""}.la-baby-carriage:before{content:""}.la-backspace:before{content:""}.la-backward:before{content:""}.la-bacon:before{content:""}.la-balance-scale:before{content:""}.la-balance-scale-left:before{content:""}.la-balance-scale-right:before{content:""}.la-ban:before{content:""}.la-band-aid:before{content:""}.la-bandcamp:before{content:""}.la-barcode:before{content:""}.la-bars:before{content:""}.la-baseball-ball:before{content:""}.la-basketball-ball:before{content:""}.la-bath:before{content:""}.la-battery-empty:before{content:""}.la-battery-full:before{content:""}.la-battery-half:before{content:""}.la-battery-quarter:before{content:""}.la-battery-three-quarters:before{content:""}.la-battle-net:before{content:""}.la-bed:before{content:""}.la-beer:before{content:""}.la-behance:before{content:""}.la-behance-square:before{content:""}.la-bell:before{content:""}.la-bell-slash:before{content:""}.la-bezier-curve:before{content:""}.la-bible:before{content:""}.la-bicycle:before{content:""}.la-biking:before{content:""}.la-bimobject:before{content:""}.la-binoculars:before{content:""}.la-biohazard:before{content:""}.la-birthday-cake:before{content:""}.la-bitbucket:before{content:""}.la-bitcoin:before{content:""}.la-bity:before{content:""}.la-black-tie:before{content:""}.la-blackberry:before{content:""}.la-blender:before{content:""}.la-blender-phone:before{content:""}.la-blind:before{content:""}.la-blog:before{content:""}.la-blogger:before{content:""}.la-blogger-b:before{content:""}.la-bluetooth:before{content:""}.la-bluetooth-b:before{content:""}.la-bold:before{content:""}.la-bolt:before{content:""}.la-bomb:before{content:""}.la-bone:before{content:""}.la-bong:before{content:""}.la-book:before{content:""}.la-book-dead:before{content:""}.la-book-medical:before{content:""}.la-book-open:before{content:""}.la-book-reader:before{content:""}.la-bookmark:before{content:""}.la-bootstrap:before{content:""}.la-border-all:before{content:""}.la-border-none:before{content:""}.la-border-style:before{content:""}.la-bowling-ball:before{content:""}.la-box:before{content:""}.la-box-open:before{content:""}.la-boxes:before{content:""}.la-braille:before{content:""}.la-brain:before{content:""}.la-bread-slice:before{content:""}.la-briefcase:before{content:""}.la-briefcase-medical:before{content:""}.la-broadcast-tower:before{content:""}.la-broom:before{content:""}.la-brush:before{content:""}.la-btc:before{content:""}.la-buffer:before{content:""}.la-bug:before{content:""}.la-building:before{content:""}.la-bullhorn:before{content:""}.la-bullseye:before{content:""}.la-burn:before{content:""}.la-buromobelexperte:before{content:""}.la-bus:before{content:""}.la-bus-alt:before{content:""}.la-business-time:before{content:""}.la-buysellads:before{content:""}.la-calculator:before{content:""}.la-calendar:before{content:""}.la-calendar-alt:before{content:""}.la-calendar-check:before{content:""}.la-calendar-day:before{content:""}.la-calendar-minus:before{content:""}.la-calendar-plus:before{content:""}.la-calendar-times:before{content:""}.la-calendar-week:before{content:""}.la-camera:before{content:""}.la-camera-retro:before{content:""}.la-campground:before{content:""}.la-canadian-maple-leaf:before{content:""}.la-candy-cane:before{content:""}.la-cannabis:before{content:""}.la-capsules:before{content:""}.la-car:before{content:""}.la-car-alt:before{content:""}.la-car-battery:before{content:""}.la-car-crash:before{content:""}.la-car-side:before{content:""}.la-caret-down:before{content:""}.la-caret-left:before{content:""}.la-caret-right:before{content:""}.la-caret-square-down:before{content:""}.la-caret-square-left:before{content:""}.la-caret-square-right:before{content:""}.la-caret-square-up:before{content:""}.la-caret-up:before{content:""}.la-carrot:before{content:""}.la-cart-arrow-down:before{content:""}.la-cart-plus:before{content:""}.la-cash-register:before{content:""}.la-cat:before{content:""}.la-cc-amazon-pay:before{content:""}.la-cc-amex:before{content:""}.la-cc-apple-pay:before{content:""}.la-cc-diners-club:before{content:""}.la-cc-discover:before{content:""}.la-cc-jcb:before{content:""}.la-cc-mastercard:before{content:""}.la-cc-paypal:before{content:""}.la-cc-stripe:before{content:""}.la-cc-visa:before{content:""}.la-centercode:before{content:""}.la-centos:before{content:""}.la-certificate:before{content:""}.la-chair:before{content:""}.la-chalkboard:before{content:""}.la-chalkboard-teacher:before{content:""}.la-charging-station:before{content:""}.la-chart-area:before{content:""}.la-chart-bar:before{content:""}.la-chart-line:before{content:""}.la-chart-pie:before{content:""}.la-check:before{content:""}.la-check-circle:before{content:""}.la-check-double:before{content:""}.la-check-square:before{content:""}.la-cheese:before{content:""}.la-chess:before{content:""}.la-chess-bishop:before{content:""}.la-chess-board:before{content:""}.la-chess-king:before{content:""}.la-chess-knight:before{content:""}.la-chess-pawn:before{content:""}.la-chess-queen:before{content:""}.la-chess-rook:before{content:""}.la-chevron-circle-down:before{content:""}.la-chevron-circle-left:before{content:""}.la-chevron-circle-right:before{content:""}.la-chevron-circle-up:before{content:""}.la-chevron-down:before{content:""}.la-chevron-left:before{content:""}.la-chevron-right:before{content:""}.la-chevron-up:before{content:""}.la-child:before{content:""}.la-chrome:before{content:""}.la-chromecast:before{content:""}.la-church:before{content:""}.la-circle:before{content:""}.la-circle-notch:before{content:""}.la-city:before{content:""}.la-clinic-medical:before{content:""}.la-clipboard:before{content:""}.la-clipboard-check:before{content:""}.la-clipboard-list:before{content:""}.la-clock:before{content:""}.la-clone:before{content:""}.la-closed-captioning:before{content:""}.la-cloud:before{content:""}.la-cloud-download-alt:before{content:""}.la-cloud-meatball:before{content:""}.la-cloud-moon:before{content:""}.la-cloud-moon-rain:before{content:""}.la-cloud-rain:before{content:""}.la-cloud-showers-heavy:before{content:""}.la-cloud-sun:before{content:""}.la-cloud-sun-rain:before{content:""}.la-cloud-upload-alt:before{content:""}.la-cloudscale:before{content:""}.la-cloudsmith:before{content:""}.la-cloudversify:before{content:""}.la-cocktail:before{content:""}.la-code:before{content:""}.la-code-branch:before{content:""}.la-codepen:before{content:""}.la-codiepie:before{content:""}.la-coffee:before{content:""}.la-cog:before{content:""}.la-cogs:before{content:""}.la-coins:before{content:""}.la-columns:before{content:""}.la-comment:before{content:""}.la-comment-alt:before{content:""}.la-comment-dollar:before{content:""}.la-comment-dots:before{content:""}.la-comment-medical:before{content:""}.la-comment-slash:before{content:""}.la-comments:before{content:""}.la-comments-dollar:before{content:""}.la-compact-disc:before{content:""}.la-compass:before{content:""}.la-compress:before{content:""}.la-compress-arrows-alt:before{content:""}.la-concierge-bell:before{content:""}.la-confluence:before{content:""}.la-connectdevelop:before{content:""}.la-contao:before{content:""}.la-cookie:before{content:""}.la-cookie-bite:before{content:""}.la-copy:before{content:""}.la-copyright:before{content:""}.la-cotton-bureau:before{content:""}.la-couch:before{content:""}.la-cpanel:before{content:""}.la-creative-commons:before{content:""}.la-creative-commons-by:before{content:""}.la-creative-commons-nc:before{content:""}.la-creative-commons-nc-eu:before{content:""}.la-creative-commons-nc-jp:before{content:""}.la-creative-commons-nd:before{content:""}.la-creative-commons-pd:before{content:""}.la-creative-commons-pd-alt:before{content:""}.la-creative-commons-remix:before{content:""}.la-creative-commons-sa:before{content:""}.la-creative-commons-sampling:before{content:""}.la-creative-commons-sampling-plus:before{content:""}.la-creative-commons-share:before{content:""}.la-creative-commons-zero:before{content:""}.la-credit-card:before{content:""}.la-critical-role:before{content:""}.la-crop:before{content:""}.la-crop-alt:before{content:""}.la-cross:before{content:""}.la-crosshairs:before{content:""}.la-crow:before{content:""}.la-crown:before{content:""}.la-crutch:before{content:""}.la-css3:before{content:""}.la-css3-alt:before{content:""}.la-cube:before{content:""}.la-cubes:before{content:""}.la-cut:before{content:""}.la-cuttlefish:before{content:""}.la-d-and-d:before{content:""}.la-d-and-d-beyond:before{content:""}.la-dashcube:before{content:""}.la-database:before{content:""}.la-deaf:before{content:""}.la-delicious:before{content:""}.la-democrat:before{content:""}.la-deploydog:before{content:""}.la-deskpro:before{content:""}.la-desktop:before{content:""}.la-dev:before{content:""}.la-deviantart:before{content:""}.la-dharmachakra:before{content:""}.la-dhl:before{content:""}.la-diagnoses:before{content:""}.la-diaspora:before{content:""}.la-dice:before{content:""}.la-dice-d20:before{content:""}.la-dice-d6:before{content:""}.la-dice-five:before{content:""}.la-dice-four:before{content:""}.la-dice-one:before{content:""}.la-dice-six:before{content:""}.la-dice-three:before{content:""}.la-dice-two:before{content:""}.la-digg:before{content:""}.la-digital-ocean:before{content:""}.la-digital-tachograph:before{content:""}.la-directions:before{content:""}.la-discord:before{content:""}.la-discourse:before{content:""}.la-divide:before{content:""}.la-dizzy:before{content:""}.la-dna:before{content:""}.la-dochub:before{content:""}.la-docker:before{content:""}.la-dog:before{content:""}.la-dollar-sign:before{content:""}.la-dolly:before{content:""}.la-dolly-flatbed:before{content:""}.la-donate:before{content:""}.la-door-closed:before{content:""}.la-door-open:before{content:""}.la-dot-circle:before{content:""}.la-dove:before{content:""}.la-download:before{content:""}.la-draft2digital:before{content:""}.la-drafting-compass:before{content:""}.la-dragon:before{content:""}.la-draw-polygon:before{content:""}.la-dribbble:before{content:""}.la-dribbble-square:before{content:""}.la-dropbox:before{content:""}.la-drum:before{content:""}.la-drum-steelpan:before{content:""}.la-drumstick-bite:before{content:""}.la-drupal:before{content:""}.la-dumbbell:before{content:""}.la-dumpster:before{content:""}.la-dumpster-fire:before{content:""}.la-dungeon:before{content:""}.la-dyalog:before{content:""}.la-earlybirds:before{content:""}.la-ebay:before{content:""}.la-edge:before{content:""}.la-edit:before{content:""}.la-egg:before{content:""}.la-eject:before{content:""}.la-elementor:before{content:""}.la-ellipsis-h:before{content:""}.la-ellipsis-v:before{content:""}.la-ello:before{content:""}.la-ember:before{content:""}.la-empire:before{content:""}.la-envelope:before{content:""}.la-envelope-open:before{content:""}.la-envelope-open-text:before{content:""}.la-envelope-square:before{content:""}.la-envira:before{content:""}.la-equals:before{content:""}.la-eraser:before{content:""}.la-erlang:before{content:""}.la-ethereum:before{content:""}.la-ethernet:before{content:""}.la-etsy:before{content:""}.la-euro-sign:before{content:""}.la-evernote:before{content:""}.la-exchange-alt:before{content:""}.la-exclamation:before{content:""}.la-exclamation-circle:before{content:""}.la-exclamation-triangle:before{content:""}.la-expand:before{content:""}.la-expand-arrows-alt:before{content:""}.la-expeditedssl:before{content:""}.la-external-link-alt:before{content:""}.la-external-link-square-alt:before{content:""}.la-eye:before{content:""}.la-eye-dropper:before{content:""}.la-eye-slash:before{content:""}.la-facebook:before{content:""}.la-facebook-f:before{content:""}.la-facebook-messenger:before{content:""}.la-facebook-square:before{content:""}.la-fan:before{content:""}.la-fantasy-flight-games:before{content:""}.la-fast-backward:before{content:""}.la-fast-forward:before{content:""}.la-fax:before{content:""}.la-feather:before{content:""}.la-feather-alt:before{content:""}.la-fedex:before{content:""}.la-fedora:before{content:""}.la-female:before{content:""}.la-fighter-jet:before{content:""}.la-figma:before{content:""}.la-file:before{content:""}.la-file-alt:before{content:""}.la-file-archive:before{content:""}.la-file-audio:before{content:""}.la-file-code:before{content:""}.la-file-contract:before{content:""}.la-file-csv:before{content:""}.la-file-download:before{content:""}.la-file-excel:before{content:""}.la-file-export:before{content:""}.la-file-image:before{content:""}.la-file-import:before{content:""}.la-file-invoice:before{content:""}.la-file-invoice-dollar:before{content:""}.la-file-medical:before{content:""}.la-file-medical-alt:before{content:""}.la-file-pdf:before{content:""}.la-file-powerpoint:before{content:""}.la-file-prescription:before{content:""}.la-file-signature:before{content:""}.la-file-upload:before{content:""}.la-file-video:before{content:""}.la-file-word:before{content:""}.la-fill:before{content:""}.la-fill-drip:before{content:""}.la-film:before{content:""}.la-filter:before{content:""}.la-fingerprint:before{content:""}.la-fire:before{content:""}.la-fire-alt:before{content:""}.la-fire-extinguisher:before{content:""}.la-firefox:before{content:""}.la-first-aid:before{content:""}.la-first-order:before{content:""}.la-first-order-alt:before{content:""}.la-firstdraft:before{content:""}.la-fish:before{content:""}.la-fist-raised:before{content:""}.la-flag:before{content:""}.la-flag-checkered:before{content:""}.la-flag-usa:before{content:""}.la-flask:before{content:""}.la-flickr:before{content:""}.la-flipboard:before{content:""}.la-flushed:before{content:""}.la-fly:before{content:""}.la-folder:before{content:""}.la-folder-minus:before{content:""}.la-folder-open:before{content:""}.la-folder-plus:before{content:""}.la-font:before{content:""}.la-font-awesome:before{content:""}.la-font-awesome-alt:before{content:""}.la-font-awesome-flag:before{content:""}.la-fonticons:before{content:""}.la-fonticons-fi:before{content:""}.la-football-ball:before{content:""}.la-fort-awesome:before{content:""}.la-fort-awesome-alt:before{content:""}.la-forumbee:before{content:""}.la-forward:before{content:""}.la-foursquare:before{content:""}.la-free-code-camp:before{content:""}.la-freebsd:before{content:""}.la-frog:before{content:""}.la-frown:before{content:""}.la-frown-open:before{content:""}.la-fulcrum:before{content:""}.la-funnel-dollar:before{content:""}.la-futbol:before{content:""}.la-galactic-republic:before{content:""}.la-galactic-senate:before{content:""}.la-gamepad:before{content:""}.la-gas-pump:before{content:""}.la-gavel:before{content:""}.la-gem:before{content:""}.la-genderless:before{content:""}.la-get-pocket:before{content:""}.la-gg:before{content:""}.la-gg-circle:before{content:""}.la-ghost:before{content:""}.la-gift:before{content:""}.la-gifts:before{content:""}.la-git:before{content:""}.la-git-alt:before{content:""}.la-git-square:before{content:""}.la-github:before{content:""}.la-github-alt:before{content:""}.la-github-square:before{content:""}.la-gitkraken:before{content:""}.la-gitlab:before{content:""}.la-gitter:before{content:""}.la-glass-cheers:before{content:""}.la-glass-martini:before{content:""}.la-glass-martini-alt:before{content:""}.la-glass-whiskey:before{content:""}.la-glasses:before{content:""}.la-glide:before{content:""}.la-glide-g:before{content:""}.la-globe:before{content:""}.la-globe-africa:before{content:""}.la-globe-americas:before{content:""}.la-globe-asia:before{content:""}.la-globe-europe:before{content:""}.la-gofore:before{content:""}.la-golf-ball:before{content:""}.la-goodreads:before{content:""}.la-goodreads-g:before{content:""}.la-google:before{content:""}.la-google-drive:before{content:""}.la-google-play:before{content:""}.la-google-plus:before{content:""}.la-google-plus-g:before{content:""}.la-google-plus-square:before{content:""}.la-google-wallet:before{content:""}.la-gopuram:before{content:""}.la-graduation-cap:before{content:""}.la-gratipay:before{content:""}.la-grav:before{content:""}.la-greater-than:before{content:""}.la-greater-than-equal:before{content:""}.la-grimace:before{content:""}.la-grin:before{content:""}.la-grin-alt:before{content:""}.la-grin-beam:before{content:""}.la-grin-beam-sweat:before{content:""}.la-grin-hearts:before{content:""}.la-grin-squint:before{content:""}.la-grin-squint-tears:before{content:""}.la-grin-stars:before{content:""}.la-grin-tears:before{content:""}.la-grin-tongue:before{content:""}.la-grin-tongue-squint:before{content:""}.la-grin-tongue-wink:before{content:""}.la-grin-wink:before{content:""}.la-grip-horizontal:before{content:""}.la-grip-lines:before{content:""}.la-grip-lines-vertical:before{content:""}.la-grip-vertical:before{content:""}.la-gripfire:before{content:""}.la-grunt:before{content:""}.la-guitar:before{content:""}.la-gulp:before{content:""}.la-h-square:before{content:""}.la-hacker-news:before{content:""}.la-hacker-news-square:before{content:""}.la-hackerrank:before{content:""}.la-hamburger:before{content:""}.la-hammer:before{content:""}.la-hamsa:before{content:""}.la-hand-holding:before{content:""}.la-hand-holding-heart:before{content:""}.la-hand-holding-usd:before{content:""}.la-hand-lizard:before{content:""}.la-hand-middle-finger:before{content:""}.la-hand-paper:before{content:""}.la-hand-peace:before{content:""}.la-hand-point-down:before{content:""}.la-hand-point-left:before{content:""}.la-hand-point-right:before{content:""}.la-hand-point-up:before{content:""}.la-hand-pointer:before{content:""}.la-hand-rock:before{content:""}.la-hand-scissors:before{content:""}.la-hand-spock:before{content:""}.la-hands:before{content:""}.la-hands-helping:before{content:""}.la-handshake:before{content:""}.la-hanukiah:before{content:""}.la-surface-quaternary-hat:before{content:""}.la-hashtag:before{content:""}.la-hat-wizard:before{content:""}.la-haykal:before{content:""}.la-hdd:before{content:""}.la-heading:before{content:""}.la-headphones:before{content:""}.la-headphones-alt:before{content:""}.la-headset:before{content:""}.la-heart:before{content:""}.la-heart-broken:before{content:""}.la-heartbeat:before{content:""}.la-helicopter:before{content:""}.la-highlighter:before{content:""}.la-hiking:before{content:""}.la-hippo:before{content:""}.la-hips:before{content:""}.la-hire-a-helper:before{content:""}.la-history:before{content:""}.la-hockey-puck:before{content:""}.la-holly-berry:before{content:""}.la-home:before{content:""}.la-hooli:before{content:""}.la-hornbill:before{content:""}.la-horse:before{content:""}.la-horse-head:before{content:""}.la-hospital:before{content:""}.la-hospital-alt:before{content:""}.la-hospital-symbol:before{content:""}.la-hot-tub:before{content:""}.la-hotdog:before{content:""}.la-hotel:before{content:""}.la-hotjar:before{content:""}.la-hourglass:before{content:""}.la-hourglass-end:before{content:""}.la-hourglass-half:before{content:""}.la-hourglass-start:before{content:""}.la-house-damage:before{content:""}.la-houzz:before{content:""}.la-hryvnia:before{content:""}.la-html5:before{content:""}.la-hubspot:before{content:""}.la-i-cursor:before{content:""}.la-ice-cream:before{content:""}.la-icicles:before{content:""}.la-icons:before{content:""}.la-id-badge:before{content:""}.la-id-card:before{content:""}.la-id-card-alt:before{content:""}.la-igloo:before{content:""}.la-image:before{content:""}.la-images:before{content:""}.la-imdb:before{content:""}.la-inbox:before{content:""}.la-indent:before{content:""}.la-industry:before{content:""}.la-infinity:before{content:""}.la-info:before{content:""}.la-info-circle:before{content:""}.la-instagram:before{content:""}.la-intercom:before{content:""}.la-internet-explorer:before{content:""}.la-invision:before{content:""}.la-ioxhost:before{content:""}.la-italic:before{content:""}.la-itch-io:before{content:""}.la-itunes:before{content:""}.la-itunes-note:before{content:""}.la-java:before{content:""}.la-jedi:before{content:""}.la-jedi-order:before{content:""}.la-jenkins:before{content:""}.la-jira:before{content:""}.la-joget:before{content:""}.la-joint:before{content:""}.la-joomla:before{content:""}.la-journal-whills:before{content:""}.la-js:before{content:""}.la-js-square:before{content:""}.la-jsfiddle:before{content:""}.la-kaaba:before{content:""}.la-kaggle:before{content:""}.la-key:before{content:""}.la-keybase:before{content:""}.la-keyboard:before{content:""}.la-keycdn:before{content:""}.la-khanda:before{content:""}.la-kickstarter:before{content:""}.la-kickstarter-k:before{content:""}.la-kiss:before{content:""}.la-kiss-beam:before{content:""}.la-kiss-wink-heart:before{content:""}.la-kiwi-bird:before{content:""}.la-korvue:before{content:""}.la-landmark:before{content:""}.la-language:before{content:""}.la-laptop:before{content:""}.la-laptop-code:before{content:""}.la-laptop-medical:before{content:""}.la-laravel:before{content:""}.la-lastfm:before{content:""}.la-lastfm-square:before{content:""}.la-laugh:before{content:""}.la-laugh-beam:before{content:""}.la-laugh-squint:before{content:""}.la-laugh-wink:before{content:""}.la-layer-group:before{content:""}.la-leaf:before{content:""}.la-leanpub:before{content:""}.la-lemon:before{content:""}.la-less:before{content:""}.la-less-than:before{content:""}.la-less-than-equal:before{content:""}.la-level-down-alt:before{content:""}.la-level-up-alt:before{content:""}.la-life-ring:before{content:""}.la-lightbulb:before{content:""}.la-line:before{content:""}.la-link:before{content:""}.la-linkedin:before{content:""}.la-linkedin-in:before{content:""}.la-linode:before{content:""}.la-linux:before{content:""}.la-lira-sign:before{content:""}.la-list:before{content:""}.la-list-alt:before{content:""}.la-list-ol:before{content:""}.la-list-ul:before{content:""}.la-location-arrow:before{content:""}.la-lock:before{content:""}.la-lock-open:before{content:""}.la-long-arrow-alt-down:before{content:""}.la-long-arrow-alt-left:before{content:""}.la-long-arrow-alt-right:before{content:""}.la-long-arrow-alt-up:before{content:""}.la-low-vision:before{content:""}.la-luggage-cart:before{content:""}.la-lyft:before{content:""}.la-magento:before{content:""}.la-magic:before{content:""}.la-magnet:before{content:""}.la-mail-bulk:before{content:""}.la-mailchimp:before{content:""}.la-male:before{content:""}.la-mandalorian:before{content:""}.la-map:before{content:""}.la-map-marked:before{content:""}.la-map-marked-alt:before{content:""}.la-map-marker:before{content:""}.la-map-marker-alt:before{content:""}.la-map-pin:before{content:""}.la-map-signs:before{content:""}.la-markdown:before{content:""}.la-marker:before{content:""}.la-mars:before{content:""}.la-mars-double:before{content:""}.la-mars-stroke:before{content:""}.la-mars-stroke-h:before{content:""}.la-mars-stroke-v:before{content:""}.la-mask:before{content:""}.la-mastodon:before{content:""}.la-maxcdn:before{content:""}.la-medal:before{content:""}.la-medapps:before{content:""}.la-medium:before{content:""}.la-medium-m:before{content:""}.la-medkit:before{content:""}.la-medrt:before{content:""}.la-meetup:before{content:""}.la-megaport:before{content:""}.la-meh:before{content:""}.la-meh-blank:before{content:""}.la-meh-rolling-eyes:before{content:""}.la-memory:before{content:""}.la-mendeley:before{content:""}.la-menorah:before{content:""}.la-mercury:before{content:""}.la-meteor:before{content:""}.la-microchip:before{content:""}.la-microphone:before{content:""}.la-microphone-alt:before{content:""}.la-microphone-alt-slash:before{content:""}.la-microphone-slash:before{content:""}.la-microscope:before{content:""}.la-microsoft:before{content:""}.la-minus:before{content:""}.la-minus-circle:before{content:""}.la-minus-square:before{content:""}.la-mitten:before{content:""}.la-mix:before{content:""}.la-mixcloud:before{content:""}.la-mizuni:before{content:""}.la-mobile:before{content:""}.la-mobile-alt:before{content:""}.la-modx:before{content:""}.la-monero:before{content:""}.la-money-bill:before{content:""}.la-money-bill-alt:before{content:""}.la-money-bill-wave:before{content:""}.la-money-bill-wave-alt:before{content:""}.la-money-check:before{content:""}.la-money-check-alt:before{content:""}.la-monument:before{content:""}.la-moon:before{content:""}.la-mortar-pestle:before{content:""}.la-mosque:before{content:""}.la-motorcycle:before{content:""}.la-mountain:before{content:""}.la-mouse-pointer:before{content:""}.la-mug-hot:before{content:""}.la-music:before{content:""}.la-napster:before{content:""}.la-neos:before{content:""}.la-network-wired:before{content:""}.la-neuter:before{content:""}.la-newspaper:before{content:""}.la-nimblr:before{content:""}.la-node:before{content:""}.la-node-js:before{content:""}.la-not-equal:before{content:""}.la-notes-medical:before{content:""}.la-npm:before{content:""}.la-ns8:before{content:""}.la-nutritionix:before{content:""}.la-object-group:before{content:""}.la-object-ungroup:before{content:""}.la-odnoklassniki:before{content:""}.la-odnoklassniki-square:before{content:""}.la-oil-can:before{content:""}.la-old-republic:before{content:""}.la-om:before{content:""}.la-opencart:before{content:""}.la-openid:before{content:""}.la-opera:before{content:""}.la-optin-monster:before{content:""}.la-osi:before{content:""}.la-otter:before{content:""}.la-outdent:before{content:""}.la-page4:before{content:""}.la-pagelines:before{content:""}.la-pager:before{content:""}.la-paint-brush:before{content:""}.la-paint-roller:before{content:""}.la-palette:before{content:""}.la-palfed:before{content:""}.la-pallet:before{content:""}.la-paper-plane:before{content:""}.la-paperclip:before{content:""}.la-parachute-box:before{content:""}.la-paragraph:before{content:""}.la-parking:before{content:""}.la-passport:before{content:""}.la-pastafarianism:before{content:""}.la-paste:before{content:""}.la-patreon:before{content:""}.la-pause:before{content:""}.la-pause-circle:before{content:""}.la-paw:before{content:""}.la-paypal:before{content:""}.la-peace:before{content:""}.la-pen:before{content:""}.la-pen-alt:before{content:""}.la-pen-fancy:before{content:""}.la-pen-nib:before{content:""}.la-pen-square:before{content:""}.la-pencil-alt:before{content:""}.la-pencil-ruler:before{content:""}.la-penny-arcade:before{content:""}.la-people-carry:before{content:""}.la-pepper-hot:before{content:""}.la-percent:before{content:""}.la-percentage:before{content:""}.la-periscope:before{content:""}.la-person-booth:before{content:""}.la-phabricator:before{content:""}.la-phoenix-framework:before{content:""}.la-phoenix-squadron:before{content:""}.la-phone:before{content:""}.la-phone-alt:before{content:""}.la-phone-slash:before{content:""}.la-phone-square:before{content:""}.la-phone-square-alt:before{content:""}.la-phone-volume:before{content:""}.la-photo-video:before{content:""}.la-php:before{content:""}.la-pied-piper:before{content:""}.la-pied-piper-alt:before{content:""}.la-pied-piper-hat:before{content:""}.la-pied-piper-pp:before{content:""}.la-piggy-bank:before{content:""}.la-pills:before{content:""}.la-pinterest:before{content:""}.la-pinterest-p:before{content:""}.la-pinterest-square:before{content:""}.la-pizza-slice:before{content:""}.la-place-of-worship:before{content:""}.la-plane:before{content:""}.la-plane-arrival:before{content:""}.la-plane-departure:before{content:""}.la-play:before{content:""}.la-play-circle:before{content:""}.la-playstation:before{content:""}.la-plug:before{content:""}.la-plus:before{content:""}.la-plus-circle:before{content:""}.la-plus-square:before{content:""}.la-podcast:before{content:""}.la-poll:before{content:""}.la-poll-h:before{content:""}.la-poo:before{content:""}.la-poo-storm:before{content:""}.la-poop:before{content:""}.la-portrait:before{content:""}.la-pound-sign:before{content:""}.la-power-off:before{content:""}.la-pray:before{content:""}.la-praying-hands:before{content:""}.la-prescription:before{content:""}.la-prescription-bottle:before{content:""}.la-prescription-bottle-alt:before{content:""}.la-print:before{content:""}.la-procedures:before{content:""}.la-product-hunt:before{content:""}.la-project-diagram:before{content:""}.la-pushed:before{content:""}.la-puzzle-piece:before{content:""}.la-python:before{content:""}.la-qq:before{content:""}.la-qrcode:before{content:""}.la-question:before{content:""}.la-question-circle:before{content:""}.la-quidditch:before{content:""}.la-quinscape:before{content:""}.la-quora:before{content:""}.la-quote-left:before{content:""}.la-quote-right:before{content:""}.la-quran:before{content:""}.la-r-project:before{content:""}.la-radiation:before{content:""}.la-radiation-alt:before{content:""}.la-rainbow:before{content:""}.la-random:before{content:""}.la-raspberry-pi:before{content:""}.la-ravelry:before{content:""}.la-react:before{content:""}.la-reacteurope:before{content:""}.la-readme:before{content:""}.la-rebel:before{content:""}.la-receipt:before{content:""}.la-recycle:before{content:""}.la-red-river:before{content:""}.la-reddit:before{content:""}.la-reddit-alien:before{content:""}.la-reddit-square:before{content:""}.la-redhat:before{content:""}.la-redo:before{content:""}.la-redo-alt:before{content:""}.la-registered:before{content:""}.la-remove-format:before{content:""}.la-renren:before{content:""}.la-reply:before{content:""}.la-reply-all:before{content:""}.la-replyd:before{content:""}.la-republican:before{content:""}.la-researchgate:before{content:""}.la-resolving:before{content:""}.la-restroom:before{content:""}.la-retweet:before{content:""}.la-rev:before{content:""}.la-ribbon:before{content:""}.la-ring:before{content:""}.la-road:before{content:""}.la-robot:before{content:""}.la-rocket:before{content:""}.la-rocketchat:before{content:""}.la-rockrms:before{content:""}.la-route:before{content:""}.la-rss:before{content:""}.la-rss-square:before{content:""}.la-ruble-sign:before{content:""}.la-ruler:before{content:""}.la-ruler-combined:before{content:""}.la-ruler-horizontal:before{content:""}.la-ruler-vertical:before{content:""}.la-running:before{content:""}.la-rupee-sign:before{content:""}.la-sad-cry:before{content:""}.la-sad-tear:before{content:""}.la-safari:before{content:""}.la-salesforce:before{content:""}.la-sass:before{content:""}.la-satellite:before{content:""}.la-satellite-dish:before{content:""}.la-save:before{content:""}.la-schlix:before{content:""}.la-school:before{content:""}.la-screwdriver:before{content:""}.la-scribd:before{content:""}.la-scroll:before{content:""}.la-sd-card:before{content:""}.la-search:before{content:""}.la-search-dollar:before{content:""}.la-search-location:before{content:""}.la-search-minus:before{content:""}.la-search-plus:before{content:""}.la-searchengin:before{content:""}.la-seedling:before{content:""}.la-sellcast:before{content:""}.la-sellsy:before{content:""}.la-server:before{content:""}.la-servicestack:before{content:""}.la-shapes:before{content:""}.la-share:before{content:""}.la-share-alt:before{content:""}.la-share-alt-square:before{content:""}.la-share-square:before{content:""}.la-shekel-sign:before{content:""}.la-shield-alt:before{content:""}.la-ship:before{content:""}.la-shipping-fast:before{content:""}.la-shirtsinbulk:before{content:""}.la-shoe-prints:before{content:""}.la-shopping-bag:before{content:""}.la-shopping-basket:before{content:""}.la-shopping-cart:before{content:""}.la-shopware:before{content:""}.la-shower:before{content:""}.la-shuttle-van:before{content:""}.la-sign:before{content:""}.la-sign-in-alt:before{content:""}.la-sign-language:before{content:""}.la-sign-out-alt:before{content:""}.la-signal:before{content:""}.la-signature:before{content:""}.la-sim-card:before{content:""}.la-simplybuilt:before{content:""}.la-sistrix:before{content:""}.la-sitemap:before{content:""}.la-sith:before{content:""}.la-skating:before{content:""}.la-sketch:before{content:""}.la-skiing:before{content:""}.la-skiing-nordic:before{content:""}.la-skull:before{content:""}.la-skull-crossbones:before{content:""}.la-skyatlas:before{content:""}.la-skype:before{content:""}.la-slack:before{content:""}.la-slack-hash:before{content:""}.la-slash:before{content:""}.la-sleigh:before{content:""}.la-sliders-h:before{content:""}.la-slideshare:before{content:""}.la-smile:before{content:""}.la-smile-beam:before{content:""}.la-smile-wink:before{content:""}.la-smog:before{content:""}.la-smoking:before{content:""}.la-smoking-ban:before{content:""}.la-sms:before{content:""}.la-snapchat:before{content:""}.la-snapchat-ghost:before{content:""}.la-snapchat-square:before{content:""}.la-snowboarding:before{content:""}.la-snowflake:before{content:""}.la-snowman:before{content:""}.la-snowplow:before{content:""}.la-socks:before{content:""}.la-solar-panel:before{content:""}.la-sort:before{content:""}.la-sort-alpha-down:before{content:""}.la-sort-alpha-down-alt:before{content:""}.la-sort-alpha-up:before{content:""}.la-sort-alpha-up-alt:before{content:""}.la-sort-amount-down:before{content:""}.la-sort-amount-down-alt:before{content:""}.la-sort-amount-up:before{content:""}.la-sort-amount-up-alt:before{content:""}.la-sort-down:before{content:""}.la-sort-numeric-down:before{content:""}.la-sort-numeric-down-alt:before{content:""}.la-sort-numeric-up:before{content:""}.la-sort-numeric-up-alt:before{content:""}.la-sort-up:before{content:""}.la-soundcloud:before{content:""}.la-sourcetree:before{content:""}.la-spa:before{content:""}.la-space-shuttle:before{content:""}.la-speakap:before{content:""}.la-speaker-deck:before{content:""}.la-spell-check:before{content:""}.la-spider:before{content:""}.la-spinner:before{content:""}.la-splotch:before{content:""}.la-spotify:before{content:""}.la-spray-can:before{content:""}.la-square:before{content:""}.la-square-full:before{content:""}.la-square-root-alt:before{content:""}.la-squarespace:before{content:""}.la-stack-exchange:before{content:""}.la-stack-overflow:before{content:""}.la-stackpath:before{content:""}.la-stamp:before{content:""}.la-star:before{content:""}.la-star-and-crescent:before{content:""}.la-star-half:before{content:""}.la-star-half-alt:before{content:""}.la-star-of-david:before{content:""}.la-star-of-life:before{content:""}.la-staylinked:before{content:""}.la-steam:before{content:""}.la-steam-square:before{content:""}.la-steam-symbol:before{content:""}.la-step-backward:before{content:""}.la-step-forward:before{content:""}.la-stethoscope:before{content:""}.la-sticker-mule:before{content:""}.la-sticky-note:before{content:""}.la-stop:before{content:""}.la-stop-circle:before{content:""}.la-stopwatch:before{content:""}.la-store:before{content:""}.la-store-alt:before{content:""}.la-strava:before{content:""}.la-stream:before{content:""}.la-street-view:before{content:""}.la-strikethrough:before{content:""}.la-stripe:before{content:""}.la-stripe-s:before{content:""}.la-stroopwafel:before{content:""}.la-studiovinari:before{content:""}.la-stumbleupon:before{content:""}.la-stumbleupon-circle:before{content:""}.la-subscript:before{content:""}.la-subway:before{content:""}.la-suitcase:before{content:""}.la-suitcase-rolling:before{content:""}.la-sun:before{content:""}.la-superpowers:before{content:""}.la-superscript:before{content:""}.la-supple:before{content:""}.la-surprise:before{content:""}.la-suse:before{content:""}.la-swatchbook:before{content:""}.la-swimmer:before{content:""}.la-swimming-pool:before{content:""}.la-symfony:before{content:""}.la-synagogue:before{content:""}.la-sync:before{content:""}.la-sync-alt:before{content:""}.la-syringe:before{content:""}.la-table:before{content:""}.la-table-tennis:before{content:""}.la-tablet:before{content:""}.la-tablet-alt:before{content:""}.la-tablets:before{content:""}.la-tachometer-alt:before{content:""}.la-tag:before{content:""}.la-tags:before{content:""}.la-tape:before{content:""}.la-tasks:before{content:""}.la-taxi:before{content:""}.la-teamspeak:before{content:""}.la-teeth:before{content:""}.la-teeth-open:before{content:""}.la-telegram:before{content:""}.la-telegram-plane:before{content:""}.la-temperature-high:before{content:""}.la-temperature-low:before{content:""}.la-tencent-weibo:before{content:""}.la-tenge:before{content:""}.la-terminal:before{content:""}.la-text-height:before{content:""}.la-text-width:before{content:""}.la-th:before{content:""}.la-th-large:before{content:""}.la-th-list:before{content:""}.la-the-red-yeti:before{content:""}.la-theater-masks:before{content:""}.la-themeco:before{content:""}.la-themeisle:before{content:""}.la-thermometer:before{content:""}.la-thermometer-empty:before{content:""}.la-thermometer-full:before{content:""}.la-thermometer-half:before{content:""}.la-thermometer-quarter:before{content:""}.la-thermometer-three-quarters:before{content:""}.la-think-peaks:before{content:""}.la-thumbs-down:before{content:""}.la-thumbs-up:before{content:""}.la-thumbtack:before{content:""}.la-ticket-alt:before{content:""}.la-times:before{content:""}.la-times-circle:before{content:""}.la-tint:before{content:""}.la-tint-slash:before{content:""}.la-tired:before{content:""}.la-toggle-off:before{content:""}.la-toggle-on:before{content:""}.la-toilet:before{content:""}.la-toilet-paper:before{content:""}.la-toolbox:before{content:""}.la-tools:before{content:""}.la-tooth:before{content:""}.la-torah:before{content:""}.la-torii-gate:before{content:""}.la-tractor:before{content:""}.la-trade-federation:before{content:""}.la-trademark:before{content:""}.la-traffic-light:before{content:""}.la-train:before{content:""}.la-tram:before{content:""}.la-transgender:before{content:""}.la-transgender-alt:before{content:""}.la-trash:before{content:""}.la-trash-alt:before{content:""}.la-trash-restore:before{content:""}.la-trash-restore-alt:before{content:""}.la-tree:before{content:""}.la-trello:before{content:""}.la-tripadvisor:before{content:""}.la-trophy:before{content:""}.la-truck:before{content:""}.la-truck-loading:before{content:""}.la-truck-monster:before{content:""}.la-truck-moving:before{content:""}.la-truck-pickup:before{content:""}.la-tshirt:before{content:""}.la-tty:before{content:""}.la-tumblr:before{content:""}.la-tumblr-square:before{content:""}.la-tv:before{content:""}.la-twitch:before{content:""}.la-twitter:before{content:""}.la-twitter-square:before{content:""}.la-typo3:before{content:""}.la-uber:before{content:""}.la-ubuntu:before{content:""}.la-uikit:before{content:""}.la-umbrella:before{content:""}.la-umbrella-beach:before{content:""}.la-underline:before{content:""}.la-undo:before{content:""}.la-undo-alt:before{content:""}.la-uniregistry:before{content:""}.la-universal-access:before{content:""}.la-university:before{content:""}.la-unlink:before{content:""}.la-unlock:before{content:""}.la-unlock-alt:before{content:""}.la-untappd:before{content:""}.la-upload:before{content:""}.la-ups:before{content:""}.la-usb:before{content:""}.la-user:before{content:""}.la-user-alt:before{content:""}.la-user-alt-slash:before{content:""}.la-user-astronaut:before{content:""}.la-user-check:before{content:""}.la-user-circle:before{content:""}.la-user-clock:before{content:""}.la-user-cog:before{content:""}.la-user-edit:before{content:""}.la-user-friends:before{content:""}.la-user-graduate:before{content:""}.la-user-injured:before{content:""}.la-user-lock:before{content:""}.la-user-md:before{content:""}.la-user-minus:before{content:""}.la-user-ninja:before{content:""}.la-user-nurse:before{content:""}.la-user-plus:before{content:""}.la-user-secret:before{content:""}.la-user-shield:before{content:""}.la-user-slash:before{content:""}.la-user-tag:before{content:""}.la-user-tie:before{content:""}.la-user-times:before{content:""}.la-users:before{content:""}.la-users-cog:before{content:""}.la-usps:before{content:""}.la-ussunnah:before{content:""}.la-utensil-spoon:before{content:""}.la-utensils:before{content:""}.la-vaadin:before{content:""}.la-vector-square:before{content:""}.la-venus:before{content:""}.la-venus-double:before{content:""}.la-venus-mars:before{content:""}.la-viacoin:before{content:""}.la-viadeo:before{content:""}.la-viadeo-square:before{content:""}.la-vial:before{content:""}.la-vials:before{content:""}.la-viber:before{content:""}.la-video:before{content:""}.la-video-slash:before{content:""}.la-vihara:before{content:""}.la-vimeo:before{content:""}.la-vimeo-square:before{content:""}.la-vimeo-v:before{content:""}.la-vine:before{content:""}.la-vk:before{content:""}.la-vnv:before{content:""}.la-voicemail:before{content:""}.la-volleyball-ball:before{content:""}.la-volume-down:before{content:""}.la-volume-mute:before{content:""}.la-volume-off:before{content:""}.la-volume-up:before{content:""}.la-vote-yea:before{content:""}.la-vr-cardboard:before{content:""}.la-vuejs:before{content:""}.la-walking:before{content:""}.la-wallet:before{content:""}.la-warehouse:before{content:""}.la-water:before{content:""}.la-wave-square:before{content:""}.la-waze:before{content:""}.la-weebly:before{content:""}.la-weibo:before{content:""}.la-weight:before{content:""}.la-weight-hanging:before{content:""}.la-weixin:before{content:""}.la-whatsapp:before{content:""}.la-whatsapp-square:before{content:""}.la-wheelchair:before{content:""}.la-whmcs:before{content:""}.la-wifi:before{content:""}.la-wikipedia-w:before{content:""}.la-wind:before{content:""}.la-window-close:before{content:""}.la-window-maximize:before{content:""}.la-window-minimize:before{content:""}.la-window-restore:before{content:""}.la-windows:before{content:""}.la-wine-bottle:before{content:""}.la-wine-glass:before{content:""}.la-wine-glass-alt:before{content:""}.la-wix:before{content:""}.la-wizards-of-the-coast:before{content:""}.la-wolf-pack-battalion:before{content:""}.la-won-sign:before{content:""}.la-wordpress:before{content:""}.la-wordpress-simple:before{content:""}.la-wpbeginner:before{content:""}.la-wpexplorer:before{content:""}.la-wpforms:before{content:""}.la-wpressr:before{content:""}.la-wrench:before{content:""}.la-x-ray:before{content:""}.la-xbox:before{content:""}.la-xing:before{content:""}.la-xing-square:before{content:""}.la-y-combinator:before{content:""}.la-yahoo:before{content:""}.la-yammer:before{content:""}.la-yandex:before{content:""}.la-yandex-international:before{content:""}.la-yarn:before{content:""}.la-yelp:before{content:""}.la-yen-sign:before{content:""}.la-yin-yang:before{content:""}.la-yoast:before{content:""}.la-youtube:before{content:""}.la-youtube-square:before{content:""}.la-zhihu:before{content:""}.la-hat-cowboy:before{content:""}.la-hat-cowboy-side:before{content:""}.la-mdb:before{content:""}.la-mouse:before{content:""}.la-orcid:before{content:""}.la-record-vinyl:before{content:""}.la-swift:before{content:""}.la-umbraco:before{content:""}.la-buy-n-large:before{content:""}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto} diff --git a/public/build/assets/manage-products-rGV6ZKw4.js b/public/build/assets/manage-products-bcbb478a.js similarity index 98% rename from public/build/assets/manage-products-rGV6ZKw4.js rename to public/build/assets/manage-products-bcbb478a.js index f681e1a7c..289086cc6 100644 --- a/public/build/assets/manage-products-rGV6ZKw4.js +++ b/public/build/assets/manage-products-bcbb478a.js @@ -1 +1 @@ -import{P as G,b as y,a as U,v as q,i as Q,F as J}from"./bootstrap-CnLEEQCx.js";import{n as L,b as K}from"./ns-prompt-popup-DKRiwYBT.js";import{_ as p,n as I}from"./currency-lOMYG1Wf.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as l,c as a,a as i,B as V,t as c,F as b,b as v,e as m,p as N,r as w,f as k,w as S,i as P,n as F,A as $,g as T}from"./runtime-core.esm-bundler-RT2b-_3S.js";const W={name:"ns-product-group",props:["fields"],watch:{searchValue(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchProducts(this.searchValue)},1e3)},products:{deep:!0,handler(){this.$forceUpdate()}}},computed:{totalProducts(){return this.products.length>0?(this.$emit("update",this.products),this.products.map(e=>parseFloat(e.sale_price)*parseFloat(e.quantity)).reduce((e,t)=>e+t)):0}},mounted(){const e=this.fields.filter(t=>t.name==="product_subitems");e.length>0&&e[0].value!==void 0&&e[0].value.length>0&&(this.products=e[0].value)},data(){return{searchValue:"",searchTimeout:null,results:[],products:[]}},methods:{__:p,nsCurrency:I,setSalePrice(){this.$emit("updateSalePrice",this.totalProducts)},removeProduct(e){G.show(L,{title:p("Delete Sub item"),message:p("Would you like to delete this sub item?"),onAction:t=>{t&&this.products.splice(e,1)}})},toggleUnitField(e){e._unit_toggled||(e._unit_toggled=!e._unit_toggled),setTimeout(()=>{e._unit_toggled&&this.$refs.unitField[0].addEventListener("blur",()=>{e._unit_toggled=!1,this.$forceUpdate()})},200)},toggleQuantityField(e){e._quantity_toggled=!e._quantity_toggled,setTimeout(()=>{e._quantity_toggled&&(this.$refs.quantityField[0].select(),this.$refs.quantityField[0].addEventListener("blur",()=>{this.toggleQuantityField(e),this.$forceUpdate()}))},200)},togglePriceField(e){e._price_toggled=!e._price_toggled,setTimeout(()=>{e._price_toggled&&(this.$refs.priceField[0].select(),this.$refs.priceField[0].addEventListener("blur",()=>{this.togglePriceField(e),this.$forceUpdate()}))},200)},redefineUnit(e){const t=e.unit_quantities.filter(n=>n.id===e.unit_quantity_id);t.length>0&&(e.unit_quantity=t[0],e.unit_id=t[0].unit.id,e.unit=t[0].unit,e.sale_price=t[0].sale_price)},async addResult(e){if(this.searchValue="",e.type==="grouped")return y.error(p("Unable to add a grouped product.")).subscribe();try{const t=await new Promise((d,r)=>{G.show(K,{label:p("Choose The Unit"),options:e.unit_quantities.map(s=>({label:s.unit.name,value:s.id})),resolve:d,reject:r})}),n=e.unit_quantities.filter(d=>parseInt(d.id)===parseInt(t[0].value));this.products.push({name:e.name,unit_quantity_id:t[0].value,unit_quantity:n[0],unit_id:n[0].unit.id,unit:n[0].unit,product_id:n[0].product_id,quantity:1,_price_toggled:!1,_quantity_toggled:!1,_unit_toggled:!1,unit_quantities:e.unit_quantities,sale_price:n[0].sale_price}),this.$emit("update",this.products)}catch(t){console.log(t)}},searchProducts(e){U.post("/api/products/search",{search:e,arguments:{type:{comparison:"<>",value:"grouped"},searchable:{comparison:"in",value:[0,1]}}}).subscribe({next:t=>{this.results=t},error:t=>{y.error(t.message||p("An unexpected error occurred"),p("Ok"),{duration:3e3}).subscribe()}})}}},z={class:"flex flex-col px-4 w-full"},H={class:"md:-mx-4 flex flex-col md:flex-row"},Y={class:"md:px-4 w-full"},X={class:"input-group border-2 rounded info flex w-full"},Z=["placeholder"],ee={key:0,class:"h-0 relative"},te={class:"ns-vertical-menu absolute w-full"},se=["onClick"],ie={class:"my-2"},re={class:"ns-table"},ne={colspan:"2",class:"border"},le={colspan:"2",class:"border p-2"},ae={class:"flex justify-between"},oe={class:"font-bold"},de=["onClick"],ue=["onClick"],ce={class:"input-group"},fe=["onChange","onUpdate:modelValue"],he=["value"],me=["onClick"],pe={key:0,class:"cursor-pointer border-b border-dashed border-info-secondary"},be=["onUpdate:modelValue"],_e=["onClick"],ge={key:0,class:"cursor-pointer border-b border-dashed border-info-secondary"},ve=["onUpdate:modelValue"],ye={key:0},xe={colspan:"2",class:"border p-2 text-center"},we={key:0},ke={class:"w-1/2 border p-2 text-left"},Ue={class:"w-1/2 border p-2 text-right"};function Fe(e,t,n,d,r,s){return l(),a("div",z,[i("div",H,[i("div",Y,[i("div",X,[V(i("input",{placeholder:s.__("Search products..."),"onUpdate:modelValue":t[0]||(t[0]=o=>r.searchValue=o),type:"text",class:"flex-auto p-2 outline-none"},null,8,Z),[[q,r.searchValue]]),i("button",{onClick:t[1]||(t[1]=o=>s.setSalePrice()),class:"px-2"},c(s.__("Set Sale Price")),1)]),r.results.length>0&&r.searchValue.length>0?(l(),a("div",ee,[i("ul",te,[(l(!0),a(b,null,v(r.results,o=>(l(),a("li",{key:o.id,onClick:g=>s.addResult(o),class:"p-2 border-b cursor-pointer"},c(o.name),9,se))),128))])])):m("",!0),i("div",ie,[i("table",re,[i("thead",null,[i("tr",null,[i("th",ne,c(s.__("Products")),1)])]),i("tbody",null,[(l(!0),a(b,null,v(r.products,(o,g)=>(l(),a("tr",{key:g},[i("td",le,[i("div",ae,[i("h3",oe,c(o.name),1),i("span",{onClick:f=>s.removeProduct(g),class:"hover:underline text-error-secondary cursor-pointer"},c(s.__("Remove")),9,de)]),i("ul",null,[i("li",{onClick:f=>s.toggleUnitField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Unit"))+":",1),i("div",ce,[V(i("select",{onChange:f=>s.redefineUnit(o),ref_for:!0,ref:"unitField",type:"text","onUpdate:modelValue":f=>o.unit_quantity_id=f},[(l(!0),a(b,null,v(o.unit_quantities,f=>(l(),a("option",{key:f.id,value:f.id},c(f.unit.name)+" ("+c(f.quantity)+")",9,he))),128))],40,fe),[[Q,o.unit_quantity_id]])])],8,ue),i("li",{onClick:f=>s.toggleQuantityField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Quantity"))+":",1),o._quantity_toggled?m("",!0):(l(),a("span",pe,c(o.quantity),1)),o._quantity_toggled?V((l(),a("input",{key:1,ref_for:!0,ref:"quantityField",type:"text","onUpdate:modelValue":f=>o.quantity=f},null,8,be)),[[q,o.quantity]]):m("",!0)],8,me),i("li",{onClick:f=>s.togglePriceField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Price"))+":",1),o._price_toggled?m("",!0):(l(),a("span",ge,c(s.nsCurrency(o.sale_price)),1)),o._price_toggled?V((l(),a("input",{key:1,ref_for:!0,ref:"priceField",type:"text","onUpdate:modelValue":f=>o.sale_price=f},null,8,ve)),[[q,o.sale_price]]):m("",!0)],8,_e)])])]))),128)),r.products.length===0?(l(),a("tr",ye,[i("td",xe,c(s.__("No product are added to this group.")),1)])):m("",!0)]),r.products.length>0?(l(),a("tfoot",we,[i("tr",null,[i("td",ke,c(s.__("Total")),1),i("td",Ue,c(s.nsCurrency(s.totalProducts)),1)])])):m("",!0)])])])])])}const Ve=M(W,[["render",Fe]]),Ce={components:{nsProductGroup:Ve},data:()=>({formValidation:new J,nsSnackBar:y,nsHttpClient:U,_sampleVariation:null,unitLoaded:!1,unitLoadError:!1,form:N({}),hasLoaded:!1,hasError:!1}),watch:{form:{deep:!0,handler(e){this.form.variations.forEach(t=>{if(this.formValidation.extractFields(t.tabs.identification.fields).type==="grouped"){for(let d in t.tabs)["identification","groups","taxes","units"].includes(d)||(t.tabs[d].visible=!1);t.tabs.groups&&(t.tabs.groups.visible=!0)}else{for(let d in t.tabs)["identification","groups","taxes","units"].includes(d)||(t.tabs[d].visible=!0);t.tabs.groups&&(t.tabs.groups.visible=!1)}})}}},computed:{defaultVariation(){const e=new Object;for(let t in this._sampleVariation.tabs)e[t]=new Object,e[t].label=this._sampleVariation.tabs[t].label,e[t].active=this._sampleVariation.tabs[t].active,e[t].fields=this._sampleVariation.tabs[t].fields.filter(n=>!["category_id","product_type","stock_management","expires"].includes(n.name)).map(n=>((typeof n.value=="string"&&n.value.length===0||n.value===null)&&(n.value=""),n));return{id:"",tabs:e}}},props:["submitMethod","submitUrl","returnUrl","src","units-url"],methods:{__:p,nsCurrency:I,handleUnitGroupFieldChanged(e,t){e.name==="unit_id"&&(t.label=this.getFirstSelectedUnit(t.fields))},async handleSaved(e,t,n,d){e.data.entry&&(await this.loadForm()).form.variations[n].tabs[t].fields.forEach(s=>{s.name===d.name&&(s.value=e.data.entry.id)})},getGroupProducts(e){if(e.groups){const t=e.groups.fields.filter(n=>n.name==="products_subitems");if(t.length>0)return t[0].value}return[]},setProducts(e,t){t.groups.fields.forEach(n=>{n.name==="product_subitems"&&(n.value=e)})},triggerRecompute(e){},getUnitQuantity(e){const t=e.filter(n=>n.name==="quantity").map(n=>n.value);return t.length>0?t[0]:0},removeUnitPriceGroup(e,t){const n=e.fields.filter(d=>d.name==="id"&&d.value!==void 0);Popup.show(L,{title:p("Confirm Your Action"),message:p("Would you like to delete this group ?"),onAction:d=>{if(d)if(n.length>0)this.confirmUnitQuantityDeletion({group:e,groups:t});else{const r=t.indexOf(e);t.splice(r,1)}}})},confirmUnitQuantityDeletion({group:e,groups:t}){Popup.show(L,{title:p("Your Attention Is Required"),size:"w-3/4-screen h-2/5-screen",message:p("The current unit you're about to delete has a reference on the database and it might have already procured stock. Deleting that reference will remove procured stock. Would you proceed ?"),onAction:n=>{if(n){const d=e.fields.filter(r=>r.name==="id").map(r=>r.value)[0];U.delete(`/api/products/units/quantity/${d}`).subscribe({next:r=>{const s=t.indexOf(e);t.splice(s,1),y.success(r.message).subscribe()},error:r=>{nsSnackbar.error(r.message).subscribe()}})}}})},addUnitGroup(e){if(e.options.length===0)return y.error(p("Please select at least one unit group before you proceed.")).subscribe();if(e.options.length>e.groups.length){const t=e.groups;e.groups=[],setTimeout(()=>{e.groups=[...t,{label:this.getFirstSelectedUnit(e.fields),fields:JSON.parse(JSON.stringify(e.fields))}]},1)}else y.error(p("There shoulnd't be more option than there are units.")).subscribe()},handleSaveEvent(e,t){t.options.push({label:e.data.entry[t.props.optionAttributes.label],value:e.data.entry[t.props.optionAttributes.value]}),t.value=e.data.entry[t.props.optionAttributes.value]},loadAvailableUnits(e,t){if(t.name!=="unit_group")return;this.unitLoaded=!1,this.unitLoadError=!1;const n=e.fields.filter(d=>d.name==="unit_group")[0].value;U.get(this.unitsUrl.replace("{id}",n)).subscribe({next:d=>{e.fields.forEach(r=>{r.type==="group"&&(r.options=d,r.fields.forEach(s=>{["unit_id","convert_unit_id"].includes(s.name)&&(s.options=d.map(o=>({label:o.name,value:o.id})))}))}),this.unitLoaded=!0},error:d=>{this.unitLoadError=!0}})},submit(){if(this.formValidation.validateFields([this.form.main]),this.form.variations.map(r=>this.formValidation.validateForm(r)).filter(r=>r.length>0).length>0||Object.values(this.form.main.errors).length>0)return y.error(p("Unable to proceed the form is not valid.")).subscribe();const t=this.form.variations.map((r,s)=>r.tabs.images.groups.filter(o=>o.filter(g=>g.name==="featured"&&g.value===1).length>0));if(t[0]&&t[0].length>1)return y.error(p("Unable to proceed, more than one product is set as featured")).subscribe();const n=[];if(this.form.variations.map((r,s)=>r.tabs.units.fields.filter(o=>o.type==="group").forEach(o=>{o.groups.forEach(g=>{n.push(this.formValidation.validateFields(g.fields))})})),n.length===0)return y.error(p("Either Selling or Purchase unit isn't defined. Unable to proceed.")).subscribe();if(n.filter(r=>r===!1).length>0)return this.$forceUpdate(),y.error(p("Unable to proceed as one of the unit group field is invalid")).subscribe();const d={...this.formValidation.extractForm(this.form),variations:this.form.variations.map((r,s)=>{const o=this.formValidation.extractForm(r);s===0&&(o.$primary=!0),o.images=r.tabs.images.groups.map(f=>this.formValidation.extractFields(f));const g=new Object;return r.tabs.units.fields.filter(f=>f.type==="group").forEach(f=>{g[f.name]=f.groups.map(A=>this.formValidation.extractFields(A.fields))}),o.units={...o.units,...g},o})};this.formValidation.disableForm(this.form),U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,d).subscribe(r=>{if(r.status==="success"){if(this.submitMethod==="POST"&&this.returnUrl!==!1)return document.location=r.data.editUrl||this.returnUrl;y.info(r.message,p("Okay"),{duration:3e3}).subscribe(),this.$emit("saved")}this.formValidation.enableForm(this.form)},r=>{y.error(r.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),r.response&&this.formValidation.triggerError(this.form,r.response.data)})},deleteVariation(e){confirm(p("Would you like to delete this variation ?"))&&this.form.variations.splice(e,1)},setTabActive(e,t){for(let n in t)n!==e&&(t[n].active=!1);if(t[e].active=!0,e==="units"){const n=t[e].fields.filter(d=>d.name==="unit_group");n.length>0&&this.loadAvailableUnits(t[e],n[0])}},duplicate(e){this.form.variations.push(Object.assign({},e))},newVariation(){this.form.variations.push(this.defaultVariation)},getActiveTab(e){for(let t in e)if(e[t].active)return e[t];return!1},getActiveTabKey(e){for(let t in e)if(e[t].active)return t;return!1},parseForm(e){return e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0],e.variations.forEach((t,n)=>{let d=0;for(let r in t.tabs)d===0&&t.tabs[r].active===void 0?(t.tabs[r].active=!0,this._sampleVariation=JSON.parse(JSON.stringify(t)),t.tabs[r].fields&&(t.tabs[r].fields=this.formValidation.createFields(t.tabs[r].fields.filter(s=>s.name!=="name")))):t.tabs[r].fields&&(t.tabs[r].fields=this.formValidation.createFields(t.tabs[r].fields)),t.tabs[r].active=t.tabs[r].active===void 0?!1:t.tabs[r].active,t.tabs[r].visible=t.tabs[r].visible===void 0?!0:t.tabs[r].visible,d++}),e},loadForm(){return new Promise((e,t)=>{const n=U.get(`${this.src}`);this.hasLoaded=!1,this.hasError=!1,n.subscribe({next:d=>{e(d),this.hasLoaded=!0,this.form=N(this.parseForm(d.form))},error:d=>{t(d),this.hasError=!0}})})},addImage(e){e.tabs.images.groups.push(this.formValidation.createFields(JSON.parse(JSON.stringify(e.tabs.images.fields))))},removeImage(e,t){const n=e.tabs.images.groups.indexOf(t);e.tabs.images.groups.splice(n,1)},handleSavedUnitGroupFields(e,t){e.data&&(t.options.push({label:e.data.entry.name,value:e.data.entry.id}),t.value=e.data.entry.id)},getGroupId(e){const t=e.filter(n=>n.name==="id");return t.length>0?t[0].value:!1},getFirstSelectedUnit(e){const t=e.filter(n=>n.name==="unit_id");if(t.length>0){const n=t[0].options.filter(d=>d.value===t[0].value);if(n.length>0)return n[0].label}return p("No Unit Selected")}},async mounted(){await this.loadForm()},name:"ns-manage-products"},Se={class:"form flex-auto",id:"crud-form"},Pe={key:0,class:"flex items-center h-full justify-center flex-auto"},Te={key:1},qe={class:"flex flex-col"},Ae={class:"flex justify-between items-center"},Ee={for:"title",class:"font-bold my-2 text-primary"},je={for:"title",class:"text-sm my-2 text-primary"},Oe=["href"],Le=["disabled"],Ge=["disabled"],Ne={key:0,class:"text-xs text-primary py-1"},$e={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},Ie={class:"px-4 w-full"},Me={id:"card-header",class:"flex flex-wrap justify-between ns-tab ml-4"},Re={class:"flex flex-wrap"},Be=["onClick"],De={key:0,class:"rounded-full bg-error-secondary text-white h-6 w-6 flex font-semibold items-center justify-center"},Qe=i("div",{class:"flex items-center justify-center -mx-1"},null,-1),Je={class:"card-body ns-tab-item"},Ke={class:"rounded shadow p-2"},We={key:0,class:"-mx-4 flex flex-wrap"},ze={key:1,class:"-mx-4 flex flex-wrap text-primary"},He={class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3"},Ye={class:"rounded border border-box-elevation-edge bg-box-elevation-background flex justify-between p-2 items-center"},Xe=["onClick"],Ze=i("i",{class:"las la-plus-circle"},null,-1),et=[Ze],tt={class:"rounded border border-box-elevation-edge flex flex-col overflow-hidden"},st={class:"p-2"},it=["onClick"],rt={key:2,class:"-mx-4 flex flex-wrap text-primary"},nt={key:3,class:"-mx-4 flex flex-wrap"},lt={class:"px-4 w-full md:w-1/2 lg:w-1/3"},at={class:"mb-2"},ot={class:"font-medium text-primary"},dt={class:"py-1 text-sm text-primary"},ut={class:"mb-2"},ct=["onClick"],ft=i("span",{class:"rounded-full border-2 ns-inset-button info h-8 w-8 flex items-center justify-center"},[i("i",{class:"las la-plus-circle"})],-1),ht={class:"shadow rounded overflow-hidden bg-box-elevation-background text-primary"},mt={class:"border-b text-sm p-2 flex justify-between text-primary border-box-elevation-edge"},pt={class:"p-2 mb-2"},bt={class:"md:-mx-2 flex flex-wrap"},_t=["onClick"],gt={key:1,class:"px-4 w-full lg:w-2/3 flex justify-center items-center"},vt={key:2,class:"px-4 w-full md:w-1/2 lg:w-2/3 flex flex-col justify-center items-center"},yt=i("i",{class:"las la-frown text-7xl"},null,-1),xt={class:"w-full md:w-1/3 py-3 text-center text-sm text-primary"};function wt(e,t,n,d,r,s){const o=w("ns-spinner"),g=w("ns-notice"),f=w("ns-field"),A=w("ns-product-group"),R=w("ns-tabs-item"),B=w("ns-tabs");return l(),a("div",Se,[Object.values(e.form).length===0&&e.hasLoaded?(l(),a("div",Pe,[k(o)])):m("",!0),Object.values(e.form).length===0&&e.hasError?(l(),a("div",Te,[k(g,{color:"error"},{title:S(()=>[P(c(s.__("An Error Has Occured")),1)]),description:S(()=>[P(c(s.__("An unexpected error has occured while loading the form. Please check the log or contact the support.")),1)]),_:1})])):m("",!0),Object.values(e.form).length>0?(l(),a(b,{key:2},[i("div",qe,[i("div",Ae,[i("label",Ee,c(e.form.main.label),1),i("div",je,[n.returnUrl?(l(),a("a",{key:0,href:n.returnUrl,class:"rounded-full border ns-inset-button error hover:bg-error-tertiary px-2 py-1"},c(s.__("Return")),9,Oe)):m("",!0)])]),i("div",{class:F([e.form.main.disabled?"":e.form.main.errors.length>0?"border-error-tertiary":"","input-group info flex border-2 rounded overflow-hidden"])},[V(i("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>e.form.main.value=h),onBlur:t[1]||(t[1]=h=>e.formValidation.checkField(e.form.main)),onChange:t[2]||(t[2]=h=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:F([(e.form.main.disabled,""),"flex-auto text-primary outline-none h-10 px-2"])},null,42,Le),[[q,e.form.main.value]]),i("button",{disabled:e.form.main.disabled,class:F([e.form.main.disabled?"":e.form.main.errors.length>0?"bg-error-tertiary":"","outline-none px-4 h-10 rounded-none"]),onClick:t[3]||(t[3]=h=>s.submit())},[$(e.$slots,"save",{},()=>[P(c(s.__("Save")),1)])],10,Ge)],2),e.form.main.description&&e.form.main.errors.length===0?(l(),a("p",Ne,c(e.form.main.description),1)):m("",!0),(l(!0),a(b,null,v(e.form.main.errors,(h,C)=>(l(),a("p",{class:"text-xs py-1 text-error-tertiary",key:C},[i("span",null,[$(e.$slots,"error-required",{},()=>[P(c(h.identifier),1)])])]))),128))]),i("div",$e,[i("div",Ie,[(l(!0),a(b,null,v(e.form.variations,(h,C)=>(l(),a("div",{id:"tabbed-card",class:"mb-8",key:C},[i("div",Me,[i("div",Re,[(l(!0),a(b,null,v(h.tabs,(u,x)=>(l(),a(b,null,[u.visible?(l(),a("div",{onClick:_=>s.setTabActive(x,h.tabs),class:F([u.active?"active":"inactive","tab cursor-pointer text-primary px-4 py-2 rounded-tl-lg rounded-tr-lg flex justify-between"]),key:x},[i("span",{class:F(["block",u.errors&&u.errors.length>0?"mr-2":""])},c(u.label),3),u.errors&&u.errors.length>0?(l(),a("span",De,c(u.errors.length),1)):m("",!0)],10,Be)):m("",!0)],64))),256))]),Qe]),i("div",Je,[i("div",Ke,[["images","units","groups"].includes(s.getActiveTabKey(h.tabs))?m("",!0):(l(),a("div",We,[(l(!0),a(b,null,v(s.getActiveTab(h.tabs).fields,(u,x)=>(l(),a("div",{key:x,class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3"},[k(f,{onSaved:_=>s.handleSaved(_,s.getActiveTabKey(h.tabs),C,u),field:u},null,8,["onSaved","field"])]))),128))])),s.getActiveTabKey(h.tabs)==="images"?(l(),a("div",ze,[i("div",He,[i("div",Ye,[i("span",null,c(s.__("Add Images")),1),i("button",{onClick:u=>s.addImage(h),class:"outline-none rounded-full border flex items-center justify-center w-8 h-8 ns-inset-button info"},et,8,Xe)])]),(l(!0),a(b,null,v(s.getActiveTab(h.tabs).groups,(u,x)=>(l(),a("div",{key:x,class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3 mb-4"},[i("div",tt,[i("div",st,[(l(!0),a(b,null,v(u,(_,E)=>(l(),T(f,{key:E,field:_},null,8,["field"]))),128))]),i("div",{onClick:_=>s.removeImage(h,u),class:"text-center py-2 border-t border-box-elevation-edge text-sm cursor-pointer"},c(s.__("Remove Image")),9,it)])]))),128))])):m("",!0),s.getActiveTabKey(h.tabs)==="groups"?(l(),a("div",rt,[k(A,{onUpdate:u=>s.setProducts(u,h.tabs),onUpdateSalePrice:u=>s.triggerRecompute(u,h.tabs),fields:s.getActiveTab(h.tabs).fields},null,8,["onUpdate","onUpdateSalePrice","fields"])])):m("",!0),s.getActiveTabKey(h.tabs)==="units"?(l(),a("div",nt,[i("div",lt,[(l(!0),a(b,null,v(s.getActiveTab(h.tabs).fields.filter(u=>u.name!=="selling_group"),u=>(l(),T(f,{onSaved:x=>s.handleSaveEvent(x,u),onChange:x=>s.loadAvailableUnits(s.getActiveTab(h.tabs),u),field:u},null,8,["onSaved","onChange","field"]))),256))]),e.unitLoaded?(l(!0),a(b,{key:0},v(s.getActiveTab(h.tabs).fields,(u,x)=>(l(),a(b,null,[u.type==="group"?(l(),a("div",{class:"px-4 w-full lg:w-2/3",key:x},[i("div",at,[i("label",ot,c(u.label),1),i("p",dt,c(u.description),1)]),i("div",ut,[i("div",{onClick:_=>s.addUnitGroup(u),class:"border-dashed border-2 p-1 bg-box-elevation-background border-box-elevation-edge flex justify-between items-center text-primary cursor-pointer rounded-lg"},[ft,i("span",null,c(s.__("New Group")),1)],8,ct)]),u.groups.length>0?(l(),T(B,{key:0,onChangeTab:_=>h.activeUnitTab=_,active:h.activeUnitTab||"tab-0"},{default:S(()=>[(l(!0),a(b,null,v(u.groups,(_,E)=>(l(),T(R,{padding:"p-2",identifier:"tab-"+E,label:_.label},{default:S(()=>[i("div",ht,[i("div",mt,[i("span",null,c(s.__("Available Quantity")),1),i("span",null,c(s.getUnitQuantity(_.fields)),1)]),i("div",pt,[i("div",bt,[(l(!0),a(b,null,v(_.fields,(j,D)=>(l(),a("div",{class:"w-full md:w-1/2 p-2",key:D},[k(f,{onChange:O=>s.handleUnitGroupFieldChanged(O,_),onSaved:O=>s.handleSavedUnitGroupFields(O,j),field:j},null,8,["onChange","onSaved","field"])]))),128))])]),i("div",{onClick:j=>s.removeUnitPriceGroup(_,u.groups),class:"p-1 hover:bg-error-primary border-t border-box-elevation-edge flex items-center justify-center cursor-pointer font-medium"},c(s.__("Delete")),9,_t)])]),_:2},1032,["identifier","label"]))),256))]),_:2},1032,["onChangeTab","active"])):m("",!0)])):m("",!0)],64))),256)):m("",!0),!e.unitLoaded&&!e.unitLoadError?(l(),a("div",gt,[k(o)])):m("",!0),e.unitLoadError&&!e.unitLoaded?(l(),a("div",vt,[yt,i("p",xt,c(s.__("We were not able to load the units. Make sure there are units attached on the unit group selected.")),1)])):m("",!0)])):m("",!0)])])]))),128))])])],64)):m("",!0)])}const St=M(Ce,[["render",wt]]);export{St as default}; +import{P as G,b as y,a as U,v as q,i as Q,F as J}from"./bootstrap-8be442b1.js";import{n as L,b as K}from"./ns-prompt-popup-100414c5.js";import{_ as p,n as I}from"./currency-f8bd78d1.js";import{_ as M}from"./_plugin-vue_export-helper-c27b6911.js";import{o as l,c as a,a as i,B as V,t as c,F as b,b as v,e as m,p as N,r as w,f as k,w as S,i as P,n as F,A as $,g as T}from"./runtime-core.esm-bundler-b48de70a.js";const W={name:"ns-product-group",props:["fields"],watch:{searchValue(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchProducts(this.searchValue)},1e3)},products:{deep:!0,handler(){this.$forceUpdate()}}},computed:{totalProducts(){return this.products.length>0?(this.$emit("update",this.products),this.products.map(e=>parseFloat(e.sale_price)*parseFloat(e.quantity)).reduce((e,t)=>e+t)):0}},mounted(){const e=this.fields.filter(t=>t.name==="product_subitems");e.length>0&&e[0].value!==void 0&&e[0].value.length>0&&(this.products=e[0].value)},data(){return{searchValue:"",searchTimeout:null,results:[],products:[]}},methods:{__:p,nsCurrency:I,setSalePrice(){this.$emit("updateSalePrice",this.totalProducts)},removeProduct(e){G.show(L,{title:p("Delete Sub item"),message:p("Would you like to delete this sub item?"),onAction:t=>{t&&this.products.splice(e,1)}})},toggleUnitField(e){e._unit_toggled||(e._unit_toggled=!e._unit_toggled),setTimeout(()=>{e._unit_toggled&&this.$refs.unitField[0].addEventListener("blur",()=>{e._unit_toggled=!1,this.$forceUpdate()})},200)},toggleQuantityField(e){e._quantity_toggled=!e._quantity_toggled,setTimeout(()=>{e._quantity_toggled&&(this.$refs.quantityField[0].select(),this.$refs.quantityField[0].addEventListener("blur",()=>{this.toggleQuantityField(e),this.$forceUpdate()}))},200)},togglePriceField(e){e._price_toggled=!e._price_toggled,setTimeout(()=>{e._price_toggled&&(this.$refs.priceField[0].select(),this.$refs.priceField[0].addEventListener("blur",()=>{this.togglePriceField(e),this.$forceUpdate()}))},200)},redefineUnit(e){const t=e.unit_quantities.filter(n=>n.id===e.unit_quantity_id);t.length>0&&(e.unit_quantity=t[0],e.unit_id=t[0].unit.id,e.unit=t[0].unit,e.sale_price=t[0].sale_price)},async addResult(e){if(this.searchValue="",e.type==="grouped")return y.error(p("Unable to add a grouped product.")).subscribe();try{const t=await new Promise((d,r)=>{G.show(K,{label:p("Choose The Unit"),options:e.unit_quantities.map(s=>({label:s.unit.name,value:s.id})),resolve:d,reject:r})}),n=e.unit_quantities.filter(d=>parseInt(d.id)===parseInt(t[0].value));this.products.push({name:e.name,unit_quantity_id:t[0].value,unit_quantity:n[0],unit_id:n[0].unit.id,unit:n[0].unit,product_id:n[0].product_id,quantity:1,_price_toggled:!1,_quantity_toggled:!1,_unit_toggled:!1,unit_quantities:e.unit_quantities,sale_price:n[0].sale_price}),this.$emit("update",this.products)}catch(t){console.log(t)}},searchProducts(e){U.post("/api/products/search",{search:e,arguments:{type:{comparison:"<>",value:"grouped"},searchable:{comparison:"in",value:[0,1]}}}).subscribe({next:t=>{this.results=t},error:t=>{y.error(t.message||p("An unexpected error occurred"),p("Ok"),{duration:3e3}).subscribe()}})}}},z={class:"flex flex-col px-4 w-full"},H={class:"md:-mx-4 flex flex-col md:flex-row"},Y={class:"md:px-4 w-full"},X={class:"input-group border-2 rounded info flex w-full"},Z=["placeholder"],ee={key:0,class:"h-0 relative"},te={class:"ns-vertical-menu absolute w-full"},se=["onClick"],ie={class:"my-2"},re={class:"ns-table"},ne={colspan:"2",class:"border"},le={colspan:"2",class:"border p-2"},ae={class:"flex justify-between"},oe={class:"font-bold"},de=["onClick"],ue=["onClick"],ce={class:"input-group"},fe=["onChange","onUpdate:modelValue"],he=["value"],me=["onClick"],pe={key:0,class:"cursor-pointer border-b border-dashed border-info-secondary"},be=["onUpdate:modelValue"],_e=["onClick"],ge={key:0,class:"cursor-pointer border-b border-dashed border-info-secondary"},ve=["onUpdate:modelValue"],ye={key:0},xe={colspan:"2",class:"border p-2 text-center"},we={key:0},ke={class:"w-1/2 border p-2 text-left"},Ue={class:"w-1/2 border p-2 text-right"};function Fe(e,t,n,d,r,s){return l(),a("div",z,[i("div",H,[i("div",Y,[i("div",X,[V(i("input",{placeholder:s.__("Search products..."),"onUpdate:modelValue":t[0]||(t[0]=o=>r.searchValue=o),type:"text",class:"flex-auto p-2 outline-none"},null,8,Z),[[q,r.searchValue]]),i("button",{onClick:t[1]||(t[1]=o=>s.setSalePrice()),class:"px-2"},c(s.__("Set Sale Price")),1)]),r.results.length>0&&r.searchValue.length>0?(l(),a("div",ee,[i("ul",te,[(l(!0),a(b,null,v(r.results,o=>(l(),a("li",{key:o.id,onClick:g=>s.addResult(o),class:"p-2 border-b cursor-pointer"},c(o.name),9,se))),128))])])):m("",!0),i("div",ie,[i("table",re,[i("thead",null,[i("tr",null,[i("th",ne,c(s.__("Products")),1)])]),i("tbody",null,[(l(!0),a(b,null,v(r.products,(o,g)=>(l(),a("tr",{key:g},[i("td",le,[i("div",ae,[i("h3",oe,c(o.name),1),i("span",{onClick:f=>s.removeProduct(g),class:"hover:underline text-error-secondary cursor-pointer"},c(s.__("Remove")),9,de)]),i("ul",null,[i("li",{onClick:f=>s.toggleUnitField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Unit"))+":",1),i("div",ce,[V(i("select",{onChange:f=>s.redefineUnit(o),ref_for:!0,ref:"unitField",type:"text","onUpdate:modelValue":f=>o.unit_quantity_id=f},[(l(!0),a(b,null,v(o.unit_quantities,f=>(l(),a("option",{key:f.id,value:f.id},c(f.unit.name)+" ("+c(f.quantity)+")",9,he))),128))],40,fe),[[Q,o.unit_quantity_id]])])],8,ue),i("li",{onClick:f=>s.toggleQuantityField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Quantity"))+":",1),o._quantity_toggled?m("",!0):(l(),a("span",pe,c(o.quantity),1)),o._quantity_toggled?V((l(),a("input",{key:1,ref_for:!0,ref:"quantityField",type:"text","onUpdate:modelValue":f=>o.quantity=f},null,8,be)),[[q,o.quantity]]):m("",!0)],8,me),i("li",{onClick:f=>s.togglePriceField(o),class:"flex justify-between p-1 hover:bg-box-elevation-hover"},[i("span",null,c(s.__("Price"))+":",1),o._price_toggled?m("",!0):(l(),a("span",ge,c(s.nsCurrency(o.sale_price)),1)),o._price_toggled?V((l(),a("input",{key:1,ref_for:!0,ref:"priceField",type:"text","onUpdate:modelValue":f=>o.sale_price=f},null,8,ve)),[[q,o.sale_price]]):m("",!0)],8,_e)])])]))),128)),r.products.length===0?(l(),a("tr",ye,[i("td",xe,c(s.__("No product are added to this group.")),1)])):m("",!0)]),r.products.length>0?(l(),a("tfoot",we,[i("tr",null,[i("td",ke,c(s.__("Total")),1),i("td",Ue,c(s.nsCurrency(s.totalProducts)),1)])])):m("",!0)])])])])])}const Ve=M(W,[["render",Fe]]),Ce={components:{nsProductGroup:Ve},data:()=>({formValidation:new J,nsSnackBar:y,nsHttpClient:U,_sampleVariation:null,unitLoaded:!1,unitLoadError:!1,form:N({}),hasLoaded:!1,hasError:!1}),watch:{form:{deep:!0,handler(e){this.form.variations.forEach(t=>{if(this.formValidation.extractFields(t.tabs.identification.fields).type==="grouped"){for(let d in t.tabs)["identification","groups","taxes","units"].includes(d)||(t.tabs[d].visible=!1);t.tabs.groups&&(t.tabs.groups.visible=!0)}else{for(let d in t.tabs)["identification","groups","taxes","units"].includes(d)||(t.tabs[d].visible=!0);t.tabs.groups&&(t.tabs.groups.visible=!1)}})}}},computed:{defaultVariation(){const e=new Object;for(let t in this._sampleVariation.tabs)e[t]=new Object,e[t].label=this._sampleVariation.tabs[t].label,e[t].active=this._sampleVariation.tabs[t].active,e[t].fields=this._sampleVariation.tabs[t].fields.filter(n=>!["category_id","product_type","stock_management","expires"].includes(n.name)).map(n=>((typeof n.value=="string"&&n.value.length===0||n.value===null)&&(n.value=""),n));return{id:"",tabs:e}}},props:["submitMethod","submitUrl","returnUrl","src","units-url"],methods:{__:p,nsCurrency:I,handleUnitGroupFieldChanged(e,t){e.name==="unit_id"&&(t.label=this.getFirstSelectedUnit(t.fields))},async handleSaved(e,t,n,d){e.data.entry&&(await this.loadForm()).form.variations[n].tabs[t].fields.forEach(s=>{s.name===d.name&&(s.value=e.data.entry.id)})},getGroupProducts(e){if(e.groups){const t=e.groups.fields.filter(n=>n.name==="products_subitems");if(t.length>0)return t[0].value}return[]},setProducts(e,t){t.groups.fields.forEach(n=>{n.name==="product_subitems"&&(n.value=e)})},triggerRecompute(e){},getUnitQuantity(e){const t=e.filter(n=>n.name==="quantity").map(n=>n.value);return t.length>0?t[0]:0},removeUnitPriceGroup(e,t){const n=e.fields.filter(d=>d.name==="id"&&d.value!==void 0);Popup.show(L,{title:p("Confirm Your Action"),message:p("Would you like to delete this group ?"),onAction:d=>{if(d)if(n.length>0)this.confirmUnitQuantityDeletion({group:e,groups:t});else{const r=t.indexOf(e);t.splice(r,1)}}})},confirmUnitQuantityDeletion({group:e,groups:t}){Popup.show(L,{title:p("Your Attention Is Required"),size:"w-3/4-screen h-2/5-screen",message:p("The current unit you're about to delete has a reference on the database and it might have already procured stock. Deleting that reference will remove procured stock. Would you proceed ?"),onAction:n=>{if(n){const d=e.fields.filter(r=>r.name==="id").map(r=>r.value)[0];U.delete(`/api/products/units/quantity/${d}`).subscribe({next:r=>{const s=t.indexOf(e);t.splice(s,1),y.success(r.message).subscribe()},error:r=>{nsSnackbar.error(r.message).subscribe()}})}}})},addUnitGroup(e){if(e.options.length===0)return y.error(p("Please select at least one unit group before you proceed.")).subscribe();if(e.options.length>e.groups.length){const t=e.groups;e.groups=[],setTimeout(()=>{e.groups=[...t,{label:this.getFirstSelectedUnit(e.fields),fields:JSON.parse(JSON.stringify(e.fields))}]},1)}else y.error(p("There shoulnd't be more option than there are units.")).subscribe()},handleSaveEvent(e,t){t.options.push({label:e.data.entry[t.props.optionAttributes.label],value:e.data.entry[t.props.optionAttributes.value]}),t.value=e.data.entry[t.props.optionAttributes.value]},loadAvailableUnits(e,t){if(t.name!=="unit_group")return;this.unitLoaded=!1,this.unitLoadError=!1;const n=e.fields.filter(d=>d.name==="unit_group")[0].value;U.get(this.unitsUrl.replace("{id}",n)).subscribe({next:d=>{e.fields.forEach(r=>{r.type==="group"&&(r.options=d,r.fields.forEach(s=>{["unit_id","convert_unit_id"].includes(s.name)&&(s.options=d.map(o=>({label:o.name,value:o.id})))}))}),this.unitLoaded=!0},error:d=>{this.unitLoadError=!0}})},submit(){if(this.formValidation.validateFields([this.form.main]),this.form.variations.map(r=>this.formValidation.validateForm(r)).filter(r=>r.length>0).length>0||Object.values(this.form.main.errors).length>0)return y.error(p("Unable to proceed the form is not valid.")).subscribe();const t=this.form.variations.map((r,s)=>r.tabs.images.groups.filter(o=>o.filter(g=>g.name==="featured"&&g.value===1).length>0));if(t[0]&&t[0].length>1)return y.error(p("Unable to proceed, more than one product is set as featured")).subscribe();const n=[];if(this.form.variations.map((r,s)=>r.tabs.units.fields.filter(o=>o.type==="group").forEach(o=>{o.groups.forEach(g=>{n.push(this.formValidation.validateFields(g.fields))})})),n.length===0)return y.error(p("Either Selling or Purchase unit isn't defined. Unable to proceed.")).subscribe();if(n.filter(r=>r===!1).length>0)return this.$forceUpdate(),y.error(p("Unable to proceed as one of the unit group field is invalid")).subscribe();const d={...this.formValidation.extractForm(this.form),variations:this.form.variations.map((r,s)=>{const o=this.formValidation.extractForm(r);s===0&&(o.$primary=!0),o.images=r.tabs.images.groups.map(f=>this.formValidation.extractFields(f));const g=new Object;return r.tabs.units.fields.filter(f=>f.type==="group").forEach(f=>{g[f.name]=f.groups.map(A=>this.formValidation.extractFields(A.fields))}),o.units={...o.units,...g},o})};this.formValidation.disableForm(this.form),U[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,d).subscribe(r=>{if(r.status==="success"){if(this.submitMethod==="POST"&&this.returnUrl!==!1)return document.location=r.data.editUrl||this.returnUrl;y.info(r.message,p("Okay"),{duration:3e3}).subscribe(),this.$emit("saved")}this.formValidation.enableForm(this.form)},r=>{y.error(r.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),r.response&&this.formValidation.triggerError(this.form,r.response.data)})},deleteVariation(e){confirm(p("Would you like to delete this variation ?"))&&this.form.variations.splice(e,1)},setTabActive(e,t){for(let n in t)n!==e&&(t[n].active=!1);if(t[e].active=!0,e==="units"){const n=t[e].fields.filter(d=>d.name==="unit_group");n.length>0&&this.loadAvailableUnits(t[e],n[0])}},duplicate(e){this.form.variations.push(Object.assign({},e))},newVariation(){this.form.variations.push(this.defaultVariation)},getActiveTab(e){for(let t in e)if(e[t].active)return e[t];return!1},getActiveTabKey(e){for(let t in e)if(e[t].active)return t;return!1},parseForm(e){return e.main.value=e.main.value===void 0?"":e.main.value,e.main=this.formValidation.createFields([e.main])[0],e.variations.forEach((t,n)=>{let d=0;for(let r in t.tabs)d===0&&t.tabs[r].active===void 0?(t.tabs[r].active=!0,this._sampleVariation=JSON.parse(JSON.stringify(t)),t.tabs[r].fields&&(t.tabs[r].fields=this.formValidation.createFields(t.tabs[r].fields.filter(s=>s.name!=="name")))):t.tabs[r].fields&&(t.tabs[r].fields=this.formValidation.createFields(t.tabs[r].fields)),t.tabs[r].active=t.tabs[r].active===void 0?!1:t.tabs[r].active,t.tabs[r].visible=t.tabs[r].visible===void 0?!0:t.tabs[r].visible,d++}),e},loadForm(){return new Promise((e,t)=>{const n=U.get(`${this.src}`);this.hasLoaded=!1,this.hasError=!1,n.subscribe({next:d=>{e(d),this.hasLoaded=!0,this.form=N(this.parseForm(d.form))},error:d=>{t(d),this.hasError=!0}})})},addImage(e){e.tabs.images.groups.push(this.formValidation.createFields(JSON.parse(JSON.stringify(e.tabs.images.fields))))},removeImage(e,t){const n=e.tabs.images.groups.indexOf(t);e.tabs.images.groups.splice(n,1)},handleSavedUnitGroupFields(e,t){e.data&&(t.options.push({label:e.data.entry.name,value:e.data.entry.id}),t.value=e.data.entry.id)},getGroupId(e){const t=e.filter(n=>n.name==="id");return t.length>0?t[0].value:!1},getFirstSelectedUnit(e){const t=e.filter(n=>n.name==="unit_id");if(t.length>0){const n=t[0].options.filter(d=>d.value===t[0].value);if(n.length>0)return n[0].label}return p("No Unit Selected")}},async mounted(){await this.loadForm()},name:"ns-manage-products"},Se={class:"form flex-auto",id:"crud-form"},Pe={key:0,class:"flex items-center h-full justify-center flex-auto"},Te={key:1},qe={class:"flex flex-col"},Ae={class:"flex justify-between items-center"},Ee={for:"title",class:"font-bold my-2 text-primary"},je={for:"title",class:"text-sm my-2 text-primary"},Oe=["href"],Le=["disabled"],Ge=["disabled"],Ne={key:0,class:"text-xs text-primary py-1"},$e={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},Ie={class:"px-4 w-full"},Me={id:"card-header",class:"flex flex-wrap justify-between ns-tab ml-4"},Re={class:"flex flex-wrap"},Be=["onClick"],De={key:0,class:"rounded-full bg-error-secondary text-white h-6 w-6 flex font-semibold items-center justify-center"},Qe=i("div",{class:"flex items-center justify-center -mx-1"},null,-1),Je={class:"card-body ns-tab-item"},Ke={class:"rounded shadow p-2"},We={key:0,class:"-mx-4 flex flex-wrap"},ze={key:1,class:"-mx-4 flex flex-wrap text-primary"},He={class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3"},Ye={class:"rounded border border-box-elevation-edge bg-box-elevation-background flex justify-between p-2 items-center"},Xe=["onClick"],Ze=i("i",{class:"las la-plus-circle"},null,-1),et=[Ze],tt={class:"rounded border border-box-elevation-edge flex flex-col overflow-hidden"},st={class:"p-2"},it=["onClick"],rt={key:2,class:"-mx-4 flex flex-wrap text-primary"},nt={key:3,class:"-mx-4 flex flex-wrap"},lt={class:"px-4 w-full md:w-1/2 lg:w-1/3"},at={class:"mb-2"},ot={class:"font-medium text-primary"},dt={class:"py-1 text-sm text-primary"},ut={class:"mb-2"},ct=["onClick"],ft=i("span",{class:"rounded-full border-2 ns-inset-button info h-8 w-8 flex items-center justify-center"},[i("i",{class:"las la-plus-circle"})],-1),ht={class:"shadow rounded overflow-hidden bg-box-elevation-background text-primary"},mt={class:"border-b text-sm p-2 flex justify-between text-primary border-box-elevation-edge"},pt={class:"p-2 mb-2"},bt={class:"md:-mx-2 flex flex-wrap"},_t=["onClick"],gt={key:1,class:"px-4 w-full lg:w-2/3 flex justify-center items-center"},vt={key:2,class:"px-4 w-full md:w-1/2 lg:w-2/3 flex flex-col justify-center items-center"},yt=i("i",{class:"las la-frown text-7xl"},null,-1),xt={class:"w-full md:w-1/3 py-3 text-center text-sm text-primary"};function wt(e,t,n,d,r,s){const o=w("ns-spinner"),g=w("ns-notice"),f=w("ns-field"),A=w("ns-product-group"),R=w("ns-tabs-item"),B=w("ns-tabs");return l(),a("div",Se,[Object.values(e.form).length===0&&e.hasLoaded?(l(),a("div",Pe,[k(o)])):m("",!0),Object.values(e.form).length===0&&e.hasError?(l(),a("div",Te,[k(g,{color:"error"},{title:S(()=>[P(c(s.__("An Error Has Occured")),1)]),description:S(()=>[P(c(s.__("An unexpected error has occured while loading the form. Please check the log or contact the support.")),1)]),_:1})])):m("",!0),Object.values(e.form).length>0?(l(),a(b,{key:2},[i("div",qe,[i("div",Ae,[i("label",Ee,c(e.form.main.label),1),i("div",je,[n.returnUrl?(l(),a("a",{key:0,href:n.returnUrl,class:"rounded-full border ns-inset-button error hover:bg-error-tertiary px-2 py-1"},c(s.__("Return")),9,Oe)):m("",!0)])]),i("div",{class:F([e.form.main.disabled?"":e.form.main.errors.length>0?"border-error-tertiary":"","input-group info flex border-2 rounded overflow-hidden"])},[V(i("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>e.form.main.value=h),onBlur:t[1]||(t[1]=h=>e.formValidation.checkField(e.form.main)),onChange:t[2]||(t[2]=h=>e.formValidation.checkField(e.form.main)),disabled:e.form.main.disabled,type:"text",class:F([(e.form.main.disabled,""),"flex-auto text-primary outline-none h-10 px-2"])},null,42,Le),[[q,e.form.main.value]]),i("button",{disabled:e.form.main.disabled,class:F([e.form.main.disabled?"":e.form.main.errors.length>0?"bg-error-tertiary":"","outline-none px-4 h-10 rounded-none"]),onClick:t[3]||(t[3]=h=>s.submit())},[$(e.$slots,"save",{},()=>[P(c(s.__("Save")),1)])],10,Ge)],2),e.form.main.description&&e.form.main.errors.length===0?(l(),a("p",Ne,c(e.form.main.description),1)):m("",!0),(l(!0),a(b,null,v(e.form.main.errors,(h,C)=>(l(),a("p",{class:"text-xs py-1 text-error-tertiary",key:C},[i("span",null,[$(e.$slots,"error-required",{},()=>[P(c(h.identifier),1)])])]))),128))]),i("div",$e,[i("div",Ie,[(l(!0),a(b,null,v(e.form.variations,(h,C)=>(l(),a("div",{id:"tabbed-card",class:"mb-8",key:C},[i("div",Me,[i("div",Re,[(l(!0),a(b,null,v(h.tabs,(u,x)=>(l(),a(b,null,[u.visible?(l(),a("div",{onClick:_=>s.setTabActive(x,h.tabs),class:F([u.active?"active":"inactive","tab cursor-pointer text-primary px-4 py-2 rounded-tl-lg rounded-tr-lg flex justify-between"]),key:x},[i("span",{class:F(["block",u.errors&&u.errors.length>0?"mr-2":""])},c(u.label),3),u.errors&&u.errors.length>0?(l(),a("span",De,c(u.errors.length),1)):m("",!0)],10,Be)):m("",!0)],64))),256))]),Qe]),i("div",Je,[i("div",Ke,[["images","units","groups"].includes(s.getActiveTabKey(h.tabs))?m("",!0):(l(),a("div",We,[(l(!0),a(b,null,v(s.getActiveTab(h.tabs).fields,(u,x)=>(l(),a("div",{key:x,class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3"},[k(f,{onSaved:_=>s.handleSaved(_,s.getActiveTabKey(h.tabs),C,u),field:u},null,8,["onSaved","field"])]))),128))])),s.getActiveTabKey(h.tabs)==="images"?(l(),a("div",ze,[i("div",He,[i("div",Ye,[i("span",null,c(s.__("Add Images")),1),i("button",{onClick:u=>s.addImage(h),class:"outline-none rounded-full border flex items-center justify-center w-8 h-8 ns-inset-button info"},et,8,Xe)])]),(l(!0),a(b,null,v(s.getActiveTab(h.tabs).groups,(u,x)=>(l(),a("div",{key:x,class:"flex flex-col px-4 w-full md:w-1/2 lg:w-1/3 mb-4"},[i("div",tt,[i("div",st,[(l(!0),a(b,null,v(u,(_,E)=>(l(),T(f,{key:E,field:_},null,8,["field"]))),128))]),i("div",{onClick:_=>s.removeImage(h,u),class:"text-center py-2 border-t border-box-elevation-edge text-sm cursor-pointer"},c(s.__("Remove Image")),9,it)])]))),128))])):m("",!0),s.getActiveTabKey(h.tabs)==="groups"?(l(),a("div",rt,[k(A,{onUpdate:u=>s.setProducts(u,h.tabs),onUpdateSalePrice:u=>s.triggerRecompute(u,h.tabs),fields:s.getActiveTab(h.tabs).fields},null,8,["onUpdate","onUpdateSalePrice","fields"])])):m("",!0),s.getActiveTabKey(h.tabs)==="units"?(l(),a("div",nt,[i("div",lt,[(l(!0),a(b,null,v(s.getActiveTab(h.tabs).fields.filter(u=>u.name!=="selling_group"),u=>(l(),T(f,{onSaved:x=>s.handleSaveEvent(x,u),onChange:x=>s.loadAvailableUnits(s.getActiveTab(h.tabs),u),field:u},null,8,["onSaved","onChange","field"]))),256))]),e.unitLoaded?(l(!0),a(b,{key:0},v(s.getActiveTab(h.tabs).fields,(u,x)=>(l(),a(b,null,[u.type==="group"?(l(),a("div",{class:"px-4 w-full lg:w-2/3",key:x},[i("div",at,[i("label",ot,c(u.label),1),i("p",dt,c(u.description),1)]),i("div",ut,[i("div",{onClick:_=>s.addUnitGroup(u),class:"border-dashed border-2 p-1 bg-box-elevation-background border-box-elevation-edge flex justify-between items-center text-primary cursor-pointer rounded-lg"},[ft,i("span",null,c(s.__("New Group")),1)],8,ct)]),u.groups.length>0?(l(),T(B,{key:0,onChangeTab:_=>h.activeUnitTab=_,active:h.activeUnitTab||"tab-0"},{default:S(()=>[(l(!0),a(b,null,v(u.groups,(_,E)=>(l(),T(R,{padding:"p-2",identifier:"tab-"+E,label:_.label},{default:S(()=>[i("div",ht,[i("div",mt,[i("span",null,c(s.__("Available Quantity")),1),i("span",null,c(s.getUnitQuantity(_.fields)),1)]),i("div",pt,[i("div",bt,[(l(!0),a(b,null,v(_.fields,(j,D)=>(l(),a("div",{class:"w-full md:w-1/2 p-2",key:D},[k(f,{onChange:O=>s.handleUnitGroupFieldChanged(O,_),onSaved:O=>s.handleSavedUnitGroupFields(O,j),field:j},null,8,["onChange","onSaved","field"])]))),128))])]),i("div",{onClick:j=>s.removeUnitPriceGroup(_,u.groups),class:"p-1 hover:bg-error-primary border-t border-box-elevation-edge flex items-center justify-center cursor-pointer font-medium"},c(s.__("Delete")),9,_t)])]),_:2},1032,["identifier","label"]))),256))]),_:2},1032,["onChangeTab","active"])):m("",!0)])):m("",!0)],64))),256)):m("",!0),!e.unitLoaded&&!e.unitLoadError?(l(),a("div",gt,[k(o)])):m("",!0),e.unitLoadError&&!e.unitLoaded?(l(),a("div",vt,[yt,i("p",xt,c(s.__("We were not able to load the units. Make sure there are units attached on the unit group selected.")),1)])):m("",!0)])):m("",!0)])])]))),128))])])],64)):m("",!0)])}const St=M(Ce,[["render",wt]]);export{St as default}; diff --git a/public/build/assets/modules-BnSJ_Yqz.js b/public/build/assets/modules-b5fed665.js similarity index 94% rename from public/build/assets/modules-BnSJ_Yqz.js rename to public/build/assets/modules-b5fed665.js index 0d505938c..fd451daf9 100644 --- a/public/build/assets/modules-BnSJ_Yqz.js +++ b/public/build/assets/modules-b5fed665.js @@ -1 +1 @@ -import{P as w,a as _,b as i,D as M,v as k}from"./bootstrap-CnLEEQCx.js";import{_ as x}from"./currency-lOMYG1Wf.js";import C from"./ns-alert-popup-SVrn5Xft.js";import"./index.es-Br67aBEV.js";import{_ as T}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ns-prompt-popup-DKRiwYBT.js";import{r as P,o as c,c as u,a as e,t as n,B,e as f,F as D,b as E,i as p,g as v,w as m,f as g}from"./runtime-core.esm-bundler-RT2b-_3S.js";const N={name:"ns-modules",props:["url","upload"],data(){return{rawModules:[],searchPlaceholder:x('Press "/" to search modules'),total_enabled:0,total_disabled:0,searchText:"",searchTimeOut:null}},mounted(){this.loadModules().subscribe(),document.addEventListener("keypress",s=>{s.key==="/"&&this.$refs.searchField!==null&&setTimeout(()=>{this.$refs.searchField.select()},1)})},watch:{},computed:{noModules(){return Object.values(this.modules).length===0},modules(){if(this.searchText.length>0){const s=Object.values(this.rawModules).filter(o=>{const a=new RegExp(this.searchText,"gi"),d=o.name.match(a);return d!==null?d.length>0:!1}),l=new Object;for(let o=0;o{const o=async(a,d)=>new Promise((t,h)=>{_.post(`/api/modules/${s.namespace}/migrate`,{file:a,version:d}).subscribe({next:r=>{t(!0)},error:r=>i.error(r.message,null,{duration:4e3}).subscribe()})});if(l=l||s.migrations,l){s.migrating=!0;for(let a in l)for(let d=0;dl&&(a=a.slice(0,l),a.push(o)),a.join(" ")},countWords(s){return s.split(" ").length},refreshModules(){this.loadModules().subscribe()},enableModule(s){const l=`${this.url}/${s.namespace}/enable`;_.put(l).subscribe({next:async o=>{i.success(o.message).subscribe(),this.loadModules().subscribe({next:a=>{document.location.reload()},error:a=>{i.error(a.message).subscribe()}})},error:o=>{i.error(o.message).subscribe()}})},disableModule(s){const l=`${this.url}/${s.namespace}/disable`;_.put(l).subscribe({next:o=>{i.success(o.message).subscribe(),this.loadModules().subscribe({next:a=>{document.location.reload()},error:a=>{i.error(a.message).subscribe()}})},error:o=>{i.error(o.message).subscribe()}})},loadModules(){return _.get(this.url).pipe(M(s=>(this.rawModules=s.modules,this.total_enabled=s.total_enabled,this.total_disabled=s.total_disabled,s)))},removeModule(s){if(confirm(x('Would you like to delete "{module}"? All data created by the module might also be deleted.').replace("{module}",s.name))){const l=`${this.url}/${s.namespace}/delete`;_.delete(l).subscribe({next:o=>{this.loadModules().subscribe({next:a=>{document.location.reload()}})},error:o=>{i.error(o.message,null,{duration:5e3}).subscribe()}})}}}},F={id:"module-wrapper",class:"flex-auto flex flex-col pb-4"},V={class:"flex flex-col md:flex-row md:justify-between md:items-center"},R={class:"flex flex-col md:flex-row md:justify-between md:items-center -mx-2"},W={class:"px-2"},A={class:"ns-button mb-2"},S=e("i",{class:"las la-sync"},null,-1),U={class:"mx-2"},H={class:"px-2"},L={class:"ns-button mb-2"},q=["href"],z=e("i",{class:"las la-angle-right"},null,-1),G={class:"px-2 w-auto"},I={class:"input-group mb-2 shadow border-2 info rounded overflow-hidden"},J=["placeholder"],K={class:"header-tabs flex -mx-4 flex-wrap"},Q={class:"px-4 text-xs text-blue-500 font-semibold hover:underline"},X={href:"#"},Y={class:"px-4 text-xs text-blue-500 font-semibold hover:underline"},Z={href:"#"},j={class:"module-section flex-auto flex flex-wrap -mx-4"},$={key:0,class:"p-4 flex-auto flex"},O={class:"flex h-full flex-auto border-dashed border-2 border-box-edge bg-surface justify-center items-center"},ee={class:"font-bold text-xl text-primary text-center"},se={key:1,class:"p-4 flex-auto flex"},te={class:"flex h-full flex-auto border-dashed border-2 border-box-edge bg-surface justify-center items-center"},le={class:"font-bold text-xl text-primary text-center"},oe={class:"ns-modules rounded shadow overflow-hidden ns-box"},re={class:"module-head h-32 p-2"},ae={class:"font-semibold text-lg"},de={class:"text-xs flex justify-between"},ne={class:"py-2 text-sm"},ie=["onClick"],ce={class:"ns-box-footer border-t p-2 flex justify-between"},ue={class:"flex -mx-1"},he={class:"px-1 flex -mx-1"},_e={class:"px-1 flex"},xe=e("i",{class:"las la-archive"},null,-1),fe={class:"px-1 flex"},be=e("i",{class:"las la-trash"},null,-1);function me(s,l,o,a,d,t){const h=P("ns-button");return c(),u("div",F,[e("div",V,[e("div",R,[e("span",W,[e("div",A,[e("a",{onClick:l[0]||(l[0]=r=>t.refreshModules()),class:"items-center justify-center rounded cursor-pointer shadow flex px-3 py-1"},[S,e("span",U,n(t.__("Refresh")),1)])])]),e("span",H,[e("div",L,[e("a",{href:o.upload,class:"flex items-center justify-center rounded cursor-pointer shadow px-3 py-1"},[e("span",null,n(t.__("Upload")),1),z],8,q)])]),e("div",G,[e("div",I,[B(e("input",{ref:"searchField",placeholder:d.searchPlaceholder,"onUpdate:modelValue":l[1]||(l[1]=r=>d.searchText=r),type:"text",class:"w-full md:w-60 outline-none py-1 px-2"},null,8,J),[[k,d.searchText]])])])]),e("div",K,[e("div",Q,[e("a",X,n(t.__("Enabled"))+"("+n(d.total_enabled)+")",1)]),e("div",Y,[e("a",Z,n(t.__("Disabled"))+" ("+n(d.total_disabled)+")",1)])])]),e("div",j,[t.noModules&&d.searchText.length===0?(c(),u("div",$,[e("div",O,[e("h2",ee,n(t.noModuleMessage),1)])])):f("",!0),t.noModules&&d.searchText.length>0?(c(),u("div",se,[e("div",te,[e("h2",le,n(t.__("No modules matches your search term.")),1)])])):f("",!0),(c(!0),u(D,null,E(t.modules,(r,y)=>(c(),u("div",{class:"px-4 w-full md:w-1/2 lg:w-1/3 xl:1/4 py-4",key:y},[e("div",oe,[e("div",re,[e("h3",ae,n(r.name),1),e("p",de,[e("span",null,n(r.author),1),e("strong",null,"v"+n(r.version),1)]),e("p",ne,[p(n(t.truncateText(r.description,20,"..."))+" ",1),t.countWords(r.description)>20?(c(),u("a",{key:0,class:"text-xs text-info-tertiary hover:underline",onClick:b=>t.openPopupDetails(r),href:"javascript:void(0)"},"["+n(t.__("Read More"))+"]",9,ie)):f("",!0)])]),e("div",ce,[r.enabled?f("",!0):(c(),v(h,{key:0,disabled:r.autoloaded,onClick:b=>t.enableModule(r),type:"info"},{default:m(()=>[p(n(t.__("Enable")),1)]),_:2},1032,["disabled","onClick"])),r.enabled?(c(),v(h,{key:1,disabled:r.autoloaded,onClick:b=>t.disableModule(r),type:"success"},{default:m(()=>[p(n(t.__("Disable")),1)]),_:2},1032,["disabled","onClick"])):f("",!0),e("div",ue,[e("div",he,[e("div",_e,[g(h,{disabled:r.autoloaded,onClick:b=>t.download(r),type:"info"},{default:m(()=>[xe]),_:2},1032,["disabled","onClick"])]),e("div",fe,[g(h,{disabled:r.autoloaded,onClick:b=>t.removeModule(r),type:"error"},{default:m(()=>[be]),_:2},1032,["disabled","onClick"])])])])])])]))),128))])])}const Ce=T(N,[["render",me]]);export{Ce as default}; +import{P as w,a as _,b as i,D as M,v as k}from"./bootstrap-8be442b1.js";import{_ as x}from"./currency-f8bd78d1.js";import C from"./ns-alert-popup-5493aad8.js";import"./index.es-25aa42ee.js";import{_ as T}from"./_plugin-vue_export-helper-c27b6911.js";import"./ns-prompt-popup-100414c5.js";import{r as P,o as c,c as u,a as e,t as n,B,e as f,F as D,b as E,i as p,g as v,w as m,f as g}from"./runtime-core.esm-bundler-b48de70a.js";const N={name:"ns-modules",props:["url","upload"],data(){return{rawModules:[],searchPlaceholder:x('Press "/" to search modules'),total_enabled:0,total_disabled:0,searchText:"",searchTimeOut:null}},mounted(){this.loadModules().subscribe(),document.addEventListener("keypress",s=>{s.key==="/"&&this.$refs.searchField!==null&&setTimeout(()=>{this.$refs.searchField.select()},1)})},watch:{},computed:{noModules(){return Object.values(this.modules).length===0},modules(){if(this.searchText.length>0){const s=Object.values(this.rawModules).filter(o=>{const a=new RegExp(this.searchText,"gi"),d=o.name.match(a);return d!==null?d.length>0:!1}),l=new Object;for(let o=0;o{const o=async(a,d)=>new Promise((t,h)=>{_.post(`/api/modules/${s.namespace}/migrate`,{file:a,version:d}).subscribe({next:r=>{t(!0)},error:r=>i.error(r.message,null,{duration:4e3}).subscribe()})});if(l=l||s.migrations,l){s.migrating=!0;for(let a in l)for(let d=0;dl&&(a=a.slice(0,l),a.push(o)),a.join(" ")},countWords(s){return s.split(" ").length},refreshModules(){this.loadModules().subscribe()},enableModule(s){const l=`${this.url}/${s.namespace}/enable`;_.put(l).subscribe({next:async o=>{i.success(o.message).subscribe(),this.loadModules().subscribe({next:a=>{document.location.reload()},error:a=>{i.error(a.message).subscribe()}})},error:o=>{i.error(o.message).subscribe()}})},disableModule(s){const l=`${this.url}/${s.namespace}/disable`;_.put(l).subscribe({next:o=>{i.success(o.message).subscribe(),this.loadModules().subscribe({next:a=>{document.location.reload()},error:a=>{i.error(a.message).subscribe()}})},error:o=>{i.error(o.message).subscribe()}})},loadModules(){return _.get(this.url).pipe(M(s=>(this.rawModules=s.modules,this.total_enabled=s.total_enabled,this.total_disabled=s.total_disabled,s)))},removeModule(s){if(confirm(x('Would you like to delete "{module}"? All data created by the module might also be deleted.').replace("{module}",s.name))){const l=`${this.url}/${s.namespace}/delete`;_.delete(l).subscribe({next:o=>{this.loadModules().subscribe({next:a=>{document.location.reload()}})},error:o=>{i.error(o.message,null,{duration:5e3}).subscribe()}})}}}},F={id:"module-wrapper",class:"flex-auto flex flex-col pb-4"},V={class:"flex flex-col md:flex-row md:justify-between md:items-center"},R={class:"flex flex-col md:flex-row md:justify-between md:items-center -mx-2"},W={class:"px-2"},A={class:"ns-button mb-2"},S=e("i",{class:"las la-sync"},null,-1),U={class:"mx-2"},H={class:"px-2"},L={class:"ns-button mb-2"},q=["href"],z=e("i",{class:"las la-angle-right"},null,-1),G={class:"px-2 w-auto"},I={class:"input-group mb-2 shadow border-2 info rounded overflow-hidden"},J=["placeholder"],K={class:"header-tabs flex -mx-4 flex-wrap"},Q={class:"px-4 text-xs text-blue-500 font-semibold hover:underline"},X={href:"#"},Y={class:"px-4 text-xs text-blue-500 font-semibold hover:underline"},Z={href:"#"},j={class:"module-section flex-auto flex flex-wrap -mx-4"},$={key:0,class:"p-4 flex-auto flex"},O={class:"flex h-full flex-auto border-dashed border-2 border-box-edge bg-surface justify-center items-center"},ee={class:"font-bold text-xl text-primary text-center"},se={key:1,class:"p-4 flex-auto flex"},te={class:"flex h-full flex-auto border-dashed border-2 border-box-edge bg-surface justify-center items-center"},le={class:"font-bold text-xl text-primary text-center"},oe={class:"ns-modules rounded shadow overflow-hidden ns-box"},re={class:"module-head h-32 p-2"},ae={class:"font-semibold text-lg"},de={class:"text-xs flex justify-between"},ne={class:"py-2 text-sm"},ie=["onClick"],ce={class:"ns-box-footer border-t p-2 flex justify-between"},ue={class:"flex -mx-1"},he={class:"px-1 flex -mx-1"},_e={class:"px-1 flex"},xe=e("i",{class:"las la-archive"},null,-1),fe={class:"px-1 flex"},be=e("i",{class:"las la-trash"},null,-1);function me(s,l,o,a,d,t){const h=P("ns-button");return c(),u("div",F,[e("div",V,[e("div",R,[e("span",W,[e("div",A,[e("a",{onClick:l[0]||(l[0]=r=>t.refreshModules()),class:"items-center justify-center rounded cursor-pointer shadow flex px-3 py-1"},[S,e("span",U,n(t.__("Refresh")),1)])])]),e("span",H,[e("div",L,[e("a",{href:o.upload,class:"flex items-center justify-center rounded cursor-pointer shadow px-3 py-1"},[e("span",null,n(t.__("Upload")),1),z],8,q)])]),e("div",G,[e("div",I,[B(e("input",{ref:"searchField",placeholder:d.searchPlaceholder,"onUpdate:modelValue":l[1]||(l[1]=r=>d.searchText=r),type:"text",class:"w-full md:w-60 outline-none py-1 px-2"},null,8,J),[[k,d.searchText]])])])]),e("div",K,[e("div",Q,[e("a",X,n(t.__("Enabled"))+"("+n(d.total_enabled)+")",1)]),e("div",Y,[e("a",Z,n(t.__("Disabled"))+" ("+n(d.total_disabled)+")",1)])])]),e("div",j,[t.noModules&&d.searchText.length===0?(c(),u("div",$,[e("div",O,[e("h2",ee,n(t.noModuleMessage),1)])])):f("",!0),t.noModules&&d.searchText.length>0?(c(),u("div",se,[e("div",te,[e("h2",le,n(t.__("No modules matches your search term.")),1)])])):f("",!0),(c(!0),u(D,null,E(t.modules,(r,y)=>(c(),u("div",{class:"px-4 w-full md:w-1/2 lg:w-1/3 xl:1/4 py-4",key:y},[e("div",oe,[e("div",re,[e("h3",ae,n(r.name),1),e("p",de,[e("span",null,n(r.author),1),e("strong",null,"v"+n(r.version),1)]),e("p",ne,[p(n(t.truncateText(r.description,20,"..."))+" ",1),t.countWords(r.description)>20?(c(),u("a",{key:0,class:"text-xs text-info-tertiary hover:underline",onClick:b=>t.openPopupDetails(r),href:"javascript:void(0)"},"["+n(t.__("Read More"))+"]",9,ie)):f("",!0)])]),e("div",ce,[r.enabled?f("",!0):(c(),v(h,{key:0,disabled:r.autoloaded,onClick:b=>t.enableModule(r),type:"info"},{default:m(()=>[p(n(t.__("Enable")),1)]),_:2},1032,["disabled","onClick"])),r.enabled?(c(),v(h,{key:1,disabled:r.autoloaded,onClick:b=>t.disableModule(r),type:"success"},{default:m(()=>[p(n(t.__("Disable")),1)]),_:2},1032,["disabled","onClick"])):f("",!0),e("div",ue,[e("div",he,[e("div",_e,[g(h,{disabled:r.autoloaded,onClick:b=>t.download(r),type:"info"},{default:m(()=>[xe]),_:2},1032,["disabled","onClick"])]),e("div",fe,[g(h,{disabled:r.autoloaded,onClick:b=>t.removeModule(r),type:"error"},{default:m(()=>[be]),_:2},1032,["disabled","onClick"])])])])])])]))),128))])])}const Ce=T(N,[["render",me]]);export{Ce as default}; diff --git a/public/build/assets/ns-alert-popup-SVrn5Xft.js b/public/build/assets/ns-alert-popup-5493aad8.js similarity index 83% rename from public/build/assets/ns-alert-popup-SVrn5Xft.js rename to public/build/assets/ns-alert-popup-5493aad8.js index a62ac14d0..2cdf83420 100644 --- a/public/build/assets/ns-alert-popup-SVrn5Xft.js +++ b/public/build/assets/ns-alert-popup-5493aad8.js @@ -1 +1 @@ -import{_ as c}from"./currency-lOMYG1Wf.js";import{_ as l}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as i,c as r,a as s,t as o,e as m,f as u,w as d,n as f,r as _,i as h}from"./runtime-core.esm-bundler-RT2b-_3S.js";const x={data(){return{title:"",message:""}},props:["popup"],computed:{size(){return this.popup.params.size||"h-full w-full"}},mounted(){this.title=this.popup.params.title,this.message=this.popup.params.message},methods:{__:c,emitAction(n){this.popup.params.onAction!==void 0&&this.popup.params.onAction(n),this.popup.close()}}},g={class:"flex items-center justify-center flex-col flex-auto p-4"},w={key:0,class:"text-3xl font-body"},y={class:"py-4 text-center"},b={class:"action-buttons flex border-t justify-end items-center p-2"};function k(n,p,v,A,e,t){const a=_("ns-button");return i(),r("div",{id:"alert-popup",class:f([t.size,"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg"])},[s("div",g,[e.title?(i(),r("h2",w,o(e.title),1)):m("",!0),s("p",y,o(e.message),1)]),s("div",b,[u(a,{onClick:p[0]||(p[0]=C=>t.emitAction(!0)),type:"info"},{default:d(()=>[h(o(t.__("Ok")),1)]),_:1})])],2)}const B=l(x,[["render",k]]);export{B as default}; +import{_ as c}from"./currency-f8bd78d1.js";import{_ as l}from"./_plugin-vue_export-helper-c27b6911.js";import{o as i,c as r,a as s,t as o,e as m,f as u,w as d,n as f,r as _,i as h}from"./runtime-core.esm-bundler-b48de70a.js";const x={data(){return{title:"",message:""}},props:["popup"],computed:{size(){return this.popup.params.size||"h-full w-full"}},mounted(){this.title=this.popup.params.title,this.message=this.popup.params.message},methods:{__:c,emitAction(n){this.popup.params.onAction!==void 0&&this.popup.params.onAction(n),this.popup.close()}}},g={class:"flex items-center justify-center flex-col flex-auto p-4"},w={key:0,class:"text-3xl font-body"},y={class:"py-4 text-center"},b={class:"action-buttons flex border-t justify-end items-center p-2"};function k(n,p,v,A,e,t){const a=_("ns-button");return i(),r("div",{id:"alert-popup",class:f([t.size,"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg"])},[s("div",g,[e.title?(i(),r("h2",w,o(e.title),1)):m("",!0),s("p",y,o(e.message),1)]),s("div",b,[u(a,{onClick:p[0]||(p[0]=C=>t.emitAction(!0)),type:"info"},{default:d(()=>[h(o(t.__("Ok")),1)]),_:1})])],2)}const B=l(x,[["render",k]]);export{B as default}; diff --git a/public/build/assets/ns-avatar-image-CAD6xUGA.js b/public/build/assets/ns-avatar-image-35303576.js similarity index 75% rename from public/build/assets/ns-avatar-image-CAD6xUGA.js rename to public/build/assets/ns-avatar-image-35303576.js index c4fab26f1..dbf2ade1d 100644 --- a/public/build/assets/ns-avatar-image-CAD6xUGA.js +++ b/public/build/assets/ns-avatar-image-35303576.js @@ -1 +1 @@ -import{c as i,s as l}from"./index.es-Br67aBEV.js";import{_ as a}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as n,c as s,e as t,n as c}from"./runtime-core.esm-bundler-RT2b-_3S.js";const u={name:"ns-avatar-image",props:["url","name","size"],data(){return{svg:"",currentSize:8}},mounted(){this.currentSize=this.size||8,this.svg=i(l,{seed:this.name})}},o=["src","alt"],m=["innerHTML"];function _(d,h,e,f,r,v){return n(),s("div",{class:c("h-"+r.currentSize+" w-"+r.currentSize)},[e.url!==""&&e.url!==null?(n(),s("img",{key:0,src:e.url,class:"overflow-hidden rounded-full",alt:e.name,srcset:""},null,8,o)):t("",!0),e.url===""||e.url===null?(n(),s("div",{key:1,class:c("h-"+r.currentSize+" w-"+r.currentSize),innerHTML:r.svg},null,10,m)):t("",!0)],2)}const k=a(u,[["render",_]]);export{k as n}; +import{c as i,s as l}from"./index.es-25aa42ee.js";import{_ as a}from"./_plugin-vue_export-helper-c27b6911.js";import{o as n,c as s,e as t,n as c}from"./runtime-core.esm-bundler-b48de70a.js";const u={name:"ns-avatar-image",props:["url","name","size"],data(){return{svg:"",currentSize:8}},mounted(){this.currentSize=this.size||8,this.svg=i(l,{seed:this.name})}},o=["src","alt"],m=["innerHTML"];function _(d,h,e,f,r,v){return n(),s("div",{class:c("h-"+r.currentSize+" w-"+r.currentSize)},[e.url!==""&&e.url!==null?(n(),s("img",{key:0,src:e.url,class:"overflow-hidden rounded-full",alt:e.name,srcset:""},null,8,o)):t("",!0),e.url===""||e.url===null?(n(),s("div",{key:1,class:c("h-"+r.currentSize+" w-"+r.currentSize),innerHTML:r.svg},null,10,m)):t("",!0)],2)}const k=a(u,[["render",_]]);export{k as n}; diff --git a/public/build/assets/ns-best-cashiers-DG2cE_fd.js b/public/build/assets/ns-best-cashiers-6dc9e947.js similarity index 90% rename from public/build/assets/ns-best-cashiers-DG2cE_fd.js rename to public/build/assets/ns-best-cashiers-6dc9e947.js index eb1ef0c7b..d1ade100a 100644 --- a/public/build/assets/ns-best-cashiers-DG2cE_fd.js +++ b/public/build/assets/ns-best-cashiers-6dc9e947.js @@ -1 +1 @@ -import{_ as m,n as f}from"./currency-lOMYG1Wf.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,o as e,c as t,a as s,t as n,f as _,F as p,b as x,e as l}from"./runtime-core.esm-bundler-RT2b-_3S.js";const y={name:"ns-best-customers",data(){return{subscription:null,cashiers:[],hasLoaded:!1}},mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCashiers.subscribe(c=>{this.hasLoaded=!0,this.cashiers=c})},methods:{__:m,nsCurrency:f},unmounted(){this.subscription.unsubscribe()}},v={id:"ns-best-cashiers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},k={class:"head text-center border-b w-full flex justify-between items-center p-2"},C={class:"body"},w={key:0,class:"table w-full"},j={class:"p-2"},L={class:"-mx-1 flex justify-start items-center"},B=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1),N={class:"px-1 justify-center"},V={class:"font-semibold items-center"},D={class:"flex justify-end p-2"},F={key:0},z={colspan:"2"},E={key:1,class:"h-56 flex items-center justify-center"},R={key:2,class:"h-56 flex items-center justify-center flex-col"},S=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),W={class:"text-sm"};function q(c,a,A,G,o,r){const h=d("ns-close-button"),u=d("ns-spinner");return e(),t("div",v,[s("div",g,[s("div",k,[s("h5",null,n(r.__("Best Cashiers")),1),s("div",null,[_(h,{onClick:a[0]||(a[0]=i=>c.$emit("onRemove"))})])]),s("div",C,[o.cashiers.length>0?(e(),t("table",w,[s("thead",null,[(e(!0),t(p,null,x(o.cashiers,i=>(e(),t("tr",{key:i.id,class:"entry border-b text-sm"},[s("th",j,[s("div",L,[B,s("div",N,[s("h3",V,n(i.username),1)])])]),s("th",D,n(r.nsCurrency(i.total_sales,"abbreviate")),1)]))),128)),o.cashiers.length===0?(e(),t("tr",F,[s("th",z,n(r.__("No result to display.")),1)])):l("",!0)])])):l("",!0),o.hasLoaded?l("",!0):(e(),t("div",E,[_(u,{size:"8",border:"4"})])),o.hasLoaded&&o.cashiers.length===0?(e(),t("div",R,[S,s("p",W,n(r.__("Well.. nothing to show for the meantime.")),1)])):l("",!0)])])])}const K=b(y,[["render",q]]);export{K as default}; +import{_ as m,n as f}from"./currency-f8bd78d1.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";import{r as d,o as e,c as t,a as s,t as n,f as _,F as p,b as x,e as l}from"./runtime-core.esm-bundler-b48de70a.js";const y={name:"ns-best-customers",data(){return{subscription:null,cashiers:[],hasLoaded:!1}},mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCashiers.subscribe(c=>{this.hasLoaded=!0,this.cashiers=c})},methods:{__:m,nsCurrency:f},unmounted(){this.subscription.unsubscribe()}},v={id:"ns-best-cashiers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},k={class:"head text-center border-b w-full flex justify-between items-center p-2"},C={class:"body"},w={key:0,class:"table w-full"},j={class:"p-2"},L={class:"-mx-1 flex justify-start items-center"},B=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1),N={class:"px-1 justify-center"},V={class:"font-semibold items-center"},D={class:"flex justify-end p-2"},F={key:0},z={colspan:"2"},E={key:1,class:"h-56 flex items-center justify-center"},R={key:2,class:"h-56 flex items-center justify-center flex-col"},S=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),W={class:"text-sm"};function q(c,a,A,G,o,r){const h=d("ns-close-button"),u=d("ns-spinner");return e(),t("div",v,[s("div",g,[s("div",k,[s("h5",null,n(r.__("Best Cashiers")),1),s("div",null,[_(h,{onClick:a[0]||(a[0]=i=>c.$emit("onRemove"))})])]),s("div",C,[o.cashiers.length>0?(e(),t("table",w,[s("thead",null,[(e(!0),t(p,null,x(o.cashiers,i=>(e(),t("tr",{key:i.id,class:"entry border-b text-sm"},[s("th",j,[s("div",L,[B,s("div",N,[s("h3",V,n(i.username),1)])])]),s("th",D,n(r.nsCurrency(i.total_sales,"abbreviate")),1)]))),128)),o.cashiers.length===0?(e(),t("tr",F,[s("th",z,n(r.__("No result to display.")),1)])):l("",!0)])])):l("",!0),o.hasLoaded?l("",!0):(e(),t("div",E,[_(u,{size:"8",border:"4"})])),o.hasLoaded&&o.cashiers.length===0?(e(),t("div",R,[S,s("p",W,n(r.__("Well.. nothing to show for the meantime.")),1)])):l("",!0)])])])}const K=b(y,[["render",q]]);export{K as default}; diff --git a/public/build/assets/ns-best-customers-BlaJPhn0.js b/public/build/assets/ns-best-customers-8d476fc5.js similarity index 90% rename from public/build/assets/ns-best-customers-BlaJPhn0.js rename to public/build/assets/ns-best-customers-8d476fc5.js index c115914bb..eaa5b86f1 100644 --- a/public/build/assets/ns-best-customers-BlaJPhn0.js +++ b/public/build/assets/ns-best-customers-8d476fc5.js @@ -1 +1 @@ -import{_ as h,n as f,a as x}from"./currency-lOMYG1Wf.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,o as t,c as o,a as s,t as l,f as u,n as p,e as i,F as y,b as v}from"./runtime-core.esm-bundler-RT2b-_3S.js";const C={mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCustomers.subscribe(r=>{this.hasLoaded=!0,this.customers=r})},methods:{__:h,nsCurrency:f,nsRawCurrency:x},data(){return{customers:[],subscription:null,hasLoaded:!1}},unmounted(){this.subscription.unsubscribe()}},w={id:"ns-best-customers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},j={class:"head text-center flex justify-between items-center border-b w-full p-2"},k={key:0,class:"w-full flex items-center justify-center"},L={key:1,class:"flex items-center justify-center flex-col"},B=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),N={class:"text-sm"},V={key:2,class:"table w-full"},z={class:"p-2"},D={class:"-mx-1 flex justify-start items-center"},F=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1),R={class:"px-1 justify-center"},E={class:"font-semibold items-center"},S={class:"flex justify-end amount p-2"};function W(r,a,q,A,e,c){const _=d("ns-close-button"),m=d("ns-spinner");return t(),o("div",w,[s("div",g,[s("div",j,[s("h5",null,l(c.__("Best Customers")),1),s("div",null,[u(_,{onClick:a[0]||(a[0]=n=>r.$emit("onRemove"))})])]),s("div",{class:p(["body flex flex-col h-64",e.customers.length===0?"body flex items-center justify-center flex-col h-64":""])},[e.hasLoaded?i("",!0):(t(),o("div",k,[u(m,{size:"12",border:"4"})])),e.hasLoaded&&e.customers.length===0?(t(),o("div",L,[B,s("p",N,l(c.__("Well.. nothing to show for the meantime")),1)])):i("",!0),e.customers.length>0?(t(),o("table",V,[s("thead",null,[(t(!0),o(y,null,v(e.customers,n=>(t(),o("tr",{key:n.id,class:"entry border-b text-sm"},[s("th",z,[s("div",D,[F,s("div",R,[s("h3",E,l(n.first_name),1)])])]),s("th",S,l(c.nsCurrency(n.purchases_amount)),1)]))),128))])])):i("",!0)],2)])])}const J=b(C,[["render",W]]);export{J as default}; +import{_ as h,n as f,a as x}from"./currency-f8bd78d1.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";import{r as d,o as t,c as o,a as s,t as l,f as u,n as p,e as i,F as y,b as v}from"./runtime-core.esm-bundler-b48de70a.js";const C={mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCustomers.subscribe(r=>{this.hasLoaded=!0,this.customers=r})},methods:{__:h,nsCurrency:f,nsRawCurrency:x},data(){return{customers:[],subscription:null,hasLoaded:!1}},unmounted(){this.subscription.unsubscribe()}},w={id:"ns-best-customers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},j={class:"head text-center flex justify-between items-center border-b w-full p-2"},k={key:0,class:"w-full flex items-center justify-center"},L={key:1,class:"flex items-center justify-center flex-col"},B=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),N={class:"text-sm"},V={key:2,class:"table w-full"},z={class:"p-2"},D={class:"-mx-1 flex justify-start items-center"},F=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1),R={class:"px-1 justify-center"},E={class:"font-semibold items-center"},S={class:"flex justify-end amount p-2"};function W(r,a,q,A,e,c){const _=d("ns-close-button"),m=d("ns-spinner");return t(),o("div",w,[s("div",g,[s("div",j,[s("h5",null,l(c.__("Best Customers")),1),s("div",null,[u(_,{onClick:a[0]||(a[0]=n=>r.$emit("onRemove"))})])]),s("div",{class:p(["body flex flex-col h-64",e.customers.length===0?"body flex items-center justify-center flex-col h-64":""])},[e.hasLoaded?i("",!0):(t(),o("div",k,[u(m,{size:"12",border:"4"})])),e.hasLoaded&&e.customers.length===0?(t(),o("div",L,[B,s("p",N,l(c.__("Well.. nothing to show for the meantime")),1)])):i("",!0),e.customers.length>0?(t(),o("table",V,[s("thead",null,[(t(!0),o(y,null,v(e.customers,n=>(t(),o("tr",{key:n.id,class:"entry border-b text-sm"},[s("th",z,[s("div",D,[F,s("div",R,[s("h3",E,l(n.first_name),1)])])]),s("th",S,l(c.nsCurrency(n.purchases_amount)),1)]))),128))])])):i("",!0)],2)])])}const J=b(C,[["render",W]]);export{J as default}; diff --git a/public/build/assets/ns-best-products-report-CShWqh07.js b/public/build/assets/ns-best-products-report-9979457f.js similarity index 91% rename from public/build/assets/ns-best-products-report-CShWqh07.js rename to public/build/assets/ns-best-products-report-9979457f.js index 9bec87c30..8b64b16f4 100644 --- a/public/build/assets/ns-best-products-report-CShWqh07.js +++ b/public/build/assets/ns-best-products-report-9979457f.js @@ -1 +1 @@ -import{a as y,b as f}from"./bootstrap-CnLEEQCx.js";import{c as v,e as k}from"./components-D4w1etK_.js";import{_ as l,n as w}from"./currency-lOMYG1Wf.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as b,o as n,c as a,a as e,f as p,t,F,b as C,n as _,e as i,i as u}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";const N={name:"ns-best-products-report",mounted(){},components:{nsDatepicker:v,nsDateTimePicker:k},data(){return{ns:window.ns,startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},report:null,sortField:{name:"sort",type:"select",label:l("Sort Results"),value:"using_quantity_asc",options:[{value:"using_quantity_asc",label:l("Using Quantity Ascending")},{value:"using_quantity_desc",label:l("Using Quantity Descending")},{value:"using_sales_asc",label:l("Using Sales Ascending")},{value:"using_sales_desc",label:l("Using Sales Descending")},{value:"using_name_asc",label:l("Using Name Ascending")},{value:"using_name_desc",label:l("Using Name Descending")}]}}},computed:{totalDebit(){return 0},totalCredit(){return 0}},props:["storeLogo","storeName"],methods:{nsCurrency:w,__:l,printSaleReport(){this.$htmlToPaper("best-products-report")},loadReport(){y.post("/api/reports/products-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,sort:this.sortField.value}).subscribe({next:d=>{d.current.products=Object.values(d.current.products),this.report=d},error:d=>{f.error(d.message).subscribe()}})}}},S={id:"report-section",class:"px-4"},B={class:"flex -mx-2"},P={class:"px-2"},R={class:"px-2"},U={class:"px-2"},q={class:"ns-button"},V=e("i",{class:"las la-sync-alt text-xl"},null,-1),j={class:"pl-2"},L={class:"px-2"},A={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),Q={class:"pl-2"},T={class:"flex -mx-2"},z={class:"px-2"},E={id:"best-products-report",class:"anim-duration-500 fade-in-entrance"},H={class:"flex w-full"},G={class:"my-4 flex justify-between w-full"},I={class:"text-primary"},J={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},M={class:"pb-1 border-b border-dashed"},W=["src","alt"],X={class:"my-4"},Y={class:"shadow ns-box"},Z={class:"ns-box-body"},$={class:"table ns-table border w-full"},ee={class:""},te={class:"p-2 text-left"},se={width:"150",class:"p-2 text-right"},re={width:"150",class:"p-2 text-right"},oe={width:"150",class:"p-2 text-right"},ne={width:"150",class:"p-2 text-right"},ae={key:0,class:""},le={class:"p-2 border"},ie={class:"p-2 border text-right"},de={class:"p-2 border text-right"},ce={class:"flex flex-col"},_e={key:0},ue={class:"p-2 border text-right"},pe={class:"flex flex-col"},he={key:0},me={key:0},be=e("i",{class:"las la-arrow-up"},null,-1),xe={key:1},ge=e("i",{class:"las la-arrow-down"},null,-1),ye={key:0,class:""},fe={colspan:"5",class:"border text-center p-2"},ve={key:1},ke={colspan:"5",class:"text-center p-2 border"},we={key:2,class:"font-semibold"},De=e("td",{colspan:"3",class:"p-2 border"},null,-1),Fe={class:"p-2 border text-right"},Ce=e("td",{class:"p-2 border text-right"},null,-1);function Ne(d,c,h,Se,o,r){const m=b("ns-date-time-picker"),x=b("ns-field");return n(),a("div",S,[e("div",B,[e("div",P,[p(m,{field:o.startDateField},null,8,["field"])]),e("div",R,[p(m,{field:o.endDateField},null,8,["field"])]),e("div",U,[e("div",q,[e("button",{onClick:c[0]||(c[0]=s=>r.loadReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[V,e("span",j,t(r.__("Load")),1)])])]),e("div",L,[e("div",A,[e("button",{onClick:c[1]||(c[1]=s=>r.printSaleReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[O,e("span",Q,t(r.__("Print")),1)])])])]),e("div",T,[e("div",z,[p(x,{field:o.sortField},null,8,["field"])])]),e("div",E,[e("div",H,[e("div",G,[e("div",I,[e("ul",null,[e("li",J,t(r.__("Date Range : {date1} - {date2}").replace("{date1}",o.startDateField.value).replace("{date2}",o.endDateField.value)),1),e("li",K,t(r.__("Document : Best Products")),1),e("li",M,t(r.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:h.storeLogo,alt:h.storeName},null,8,W)])])]),e("div",X,[e("div",Y,[e("div",Z,[e("table",$,[e("thead",ee,[e("tr",null,[e("th",te,t(r.__("Product")),1),e("th",se,t(r.__("Unit")),1),e("th",re,t(r.__("Quantity")),1),e("th",oe,t(r.__("Value")),1),e("th",ne,t(r.__("Progress")),1)])]),o.report?(n(),a("tbody",ae,[(n(!0),a(F,null,C(o.report.current.products,(s,g)=>(n(),a("tr",{key:g,class:_(s.evolution==="progress"?"bg-success-primary":"bg-error-primary")},[e("td",le,t(s.name),1),e("td",ie,t(s.unit_name),1),e("td",de,[e("div",ce,[e("span",null,[e("span",null,t(s.quantity),1)]),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",_e,"+")):i("",!0),u(" "+t(s.quantity-s.old_quantity),1)],2)])]),e("td",ue,[e("div",pe,[e("span",null,t(r.nsCurrency(s.total_price)),1),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",he,"+")):i("",!0),u(" "+t(r.nsCurrency(s.total_price-s.old_total_price)),1)],2)])]),e("td",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-error-light-tertiary","p-2 border text-right"])},[s.evolution==="progress"?(n(),a("span",me,[u(t(s.difference.toFixed(2))+"% ",1),be])):i("",!0),s.evolution==="regress"?(n(),a("span",xe,[u(t(s.difference.toFixed(2))+"% ",1),ge])):i("",!0)],2)],2))),128)),o.report.current.products.length===0?(n(),a("tr",ye,[e("td",fe,t(r.__("No results to show.")),1)])):i("",!0)])):i("",!0),o.report?i("",!0):(n(),a("tbody",ve,[e("tr",null,[e("td",ke,t(r.__("Start by choosing a range and loading the report.")),1)])])),o.report?(n(),a("tfoot",we,[e("tr",null,[De,e("td",Fe,t(r.nsCurrency(o.report.current.total_price)),1),Ce])])):i("",!0)])])])])])])}const Oe=D(N,[["render",Ne]]);export{Oe as default}; +import{a as y,b as f}from"./bootstrap-8be442b1.js";import{c as v,e as k}from"./components-ef1ba55f.js";import{_ as l,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as b,o as n,c as a,a as e,f as p,t,F,b as C,n as _,e as i,i as u}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const N={name:"ns-best-products-report",mounted(){},components:{nsDatepicker:v,nsDateTimePicker:k},data(){return{ns:window.ns,startDateField:{name:"start_date",type:"datetime",value:ns.date.moment.startOf("day").format()},endDateField:{name:"end_date",type:"datetime",value:ns.date.moment.endOf("day").format()},report:null,sortField:{name:"sort",type:"select",label:l("Sort Results"),value:"using_quantity_asc",options:[{value:"using_quantity_asc",label:l("Using Quantity Ascending")},{value:"using_quantity_desc",label:l("Using Quantity Descending")},{value:"using_sales_asc",label:l("Using Sales Ascending")},{value:"using_sales_desc",label:l("Using Sales Descending")},{value:"using_name_asc",label:l("Using Name Ascending")},{value:"using_name_desc",label:l("Using Name Descending")}]}}},computed:{totalDebit(){return 0},totalCredit(){return 0}},props:["storeLogo","storeName"],methods:{nsCurrency:w,__:l,printSaleReport(){this.$htmlToPaper("best-products-report")},loadReport(){y.post("/api/reports/products-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,sort:this.sortField.value}).subscribe({next:d=>{d.current.products=Object.values(d.current.products),this.report=d},error:d=>{f.error(d.message).subscribe()}})}}},S={id:"report-section",class:"px-4"},B={class:"flex -mx-2"},P={class:"px-2"},R={class:"px-2"},U={class:"px-2"},q={class:"ns-button"},V=e("i",{class:"las la-sync-alt text-xl"},null,-1),j={class:"pl-2"},L={class:"px-2"},A={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),Q={class:"pl-2"},T={class:"flex -mx-2"},z={class:"px-2"},E={id:"best-products-report",class:"anim-duration-500 fade-in-entrance"},H={class:"flex w-full"},G={class:"my-4 flex justify-between w-full"},I={class:"text-primary"},J={class:"pb-1 border-b border-dashed"},K={class:"pb-1 border-b border-dashed"},M={class:"pb-1 border-b border-dashed"},W=["src","alt"],X={class:"my-4"},Y={class:"shadow ns-box"},Z={class:"ns-box-body"},$={class:"table ns-table border w-full"},ee={class:""},te={class:"p-2 text-left"},se={width:"150",class:"p-2 text-right"},re={width:"150",class:"p-2 text-right"},oe={width:"150",class:"p-2 text-right"},ne={width:"150",class:"p-2 text-right"},ae={key:0,class:""},le={class:"p-2 border"},ie={class:"p-2 border text-right"},de={class:"p-2 border text-right"},ce={class:"flex flex-col"},_e={key:0},ue={class:"p-2 border text-right"},pe={class:"flex flex-col"},he={key:0},me={key:0},be=e("i",{class:"las la-arrow-up"},null,-1),xe={key:1},ge=e("i",{class:"las la-arrow-down"},null,-1),ye={key:0,class:""},fe={colspan:"5",class:"border text-center p-2"},ve={key:1},ke={colspan:"5",class:"text-center p-2 border"},we={key:2,class:"font-semibold"},De=e("td",{colspan:"3",class:"p-2 border"},null,-1),Fe={class:"p-2 border text-right"},Ce=e("td",{class:"p-2 border text-right"},null,-1);function Ne(d,c,h,Se,o,r){const m=b("ns-date-time-picker"),x=b("ns-field");return n(),a("div",S,[e("div",B,[e("div",P,[p(m,{field:o.startDateField},null,8,["field"])]),e("div",R,[p(m,{field:o.endDateField},null,8,["field"])]),e("div",U,[e("div",q,[e("button",{onClick:c[0]||(c[0]=s=>r.loadReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[V,e("span",j,t(r.__("Load")),1)])])]),e("div",L,[e("div",A,[e("button",{onClick:c[1]||(c[1]=s=>r.printSaleReport()),class:"rounded flex justify-between border-box-background text-primary shadow py-1 items-center px-2"},[O,e("span",Q,t(r.__("Print")),1)])])])]),e("div",T,[e("div",z,[p(x,{field:o.sortField},null,8,["field"])])]),e("div",E,[e("div",H,[e("div",G,[e("div",I,[e("ul",null,[e("li",J,t(r.__("Date Range : {date1} - {date2}").replace("{date1}",o.startDateField.value).replace("{date2}",o.endDateField.value)),1),e("li",K,t(r.__("Document : Best Products")),1),e("li",M,t(r.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:h.storeLogo,alt:h.storeName},null,8,W)])])]),e("div",X,[e("div",Y,[e("div",Z,[e("table",$,[e("thead",ee,[e("tr",null,[e("th",te,t(r.__("Product")),1),e("th",se,t(r.__("Unit")),1),e("th",re,t(r.__("Quantity")),1),e("th",oe,t(r.__("Value")),1),e("th",ne,t(r.__("Progress")),1)])]),o.report?(n(),a("tbody",ae,[(n(!0),a(F,null,C(o.report.current.products,(s,g)=>(n(),a("tr",{key:g,class:_(s.evolution==="progress"?"bg-success-primary":"bg-error-primary")},[e("td",le,t(s.name),1),e("td",ie,t(s.unit_name),1),e("td",de,[e("div",ce,[e("span",null,[e("span",null,t(s.quantity),1)]),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",_e,"+")):i("",!0),u(" "+t(s.quantity-s.old_quantity),1)],2)])]),e("td",ue,[e("div",pe,[e("span",null,t(r.nsCurrency(s.total_price)),1),e("span",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-danger-light-tertiary","text-xs"])},[s.evolution==="progress"?(n(),a("span",he,"+")):i("",!0),u(" "+t(r.nsCurrency(s.total_price-s.old_total_price)),1)],2)])]),e("td",{class:_([s.evolution==="progress"?"text-success-tertiary":"text-error-light-tertiary","p-2 border text-right"])},[s.evolution==="progress"?(n(),a("span",me,[u(t(s.difference.toFixed(2))+"% ",1),be])):i("",!0),s.evolution==="regress"?(n(),a("span",xe,[u(t(s.difference.toFixed(2))+"% ",1),ge])):i("",!0)],2)],2))),128)),o.report.current.products.length===0?(n(),a("tr",ye,[e("td",fe,t(r.__("No results to show.")),1)])):i("",!0)])):i("",!0),o.report?i("",!0):(n(),a("tbody",ve,[e("tr",null,[e("td",ke,t(r.__("Start by choosing a range and loading the report.")),1)])])),o.report?(n(),a("tfoot",we,[e("tr",null,[De,e("td",Fe,t(r.nsCurrency(o.report.current.total_price)),1),Ce])])):i("",!0)])])])])])])}const Oe=D(N,[["render",Ne]]);export{Oe as default}; diff --git a/public/build/assets/ns-cash-flow-report-C_Ru4hUc.js b/public/build/assets/ns-cash-flow-report-d8680316.js similarity index 91% rename from public/build/assets/ns-cash-flow-report-C_Ru4hUc.js rename to public/build/assets/ns-cash-flow-report-d8680316.js index e8119b31d..1340c1a5e 100644 --- a/public/build/assets/ns-cash-flow-report-C_Ru4hUc.js +++ b/public/build/assets/ns-cash-flow-report-d8680316.js @@ -1 +1 @@ -import{h as b,a as y,b as f}from"./bootstrap-CnLEEQCx.js";import{c as x,e as g}from"./components-D4w1etK_.js";import{_ as v,n as w}from"./currency-lOMYG1Wf.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as C,o as a,c as d,a as t,f as u,t as e,F as p,b as m,i as l}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";const F={name:"ns-cash-flow",props:["storeLogo","storeName"],mounted(){},components:{nsDatepicker:x,nsDateTimePicker:g},data(){return{startDateField:{value:b(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},endDateField:{value:b(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},report:new Object,ns:window.ns}},computed:{balance(){return Object.values(this.report).length===0?0:this.report.total_credit-this.report.total_debit},totalDebit(){return 0},totalCredit(){return 0}},methods:{__:v,nsCurrency:w,printSaleReport(){this.$htmlToPaper("report")},loadReport(){y.post("/api/reports/transactions",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:c=>{this.report=c},error:c=>{f.error(c.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},B={class:"px-2"},R={class:"px-2"},S={class:"px-2"},j={class:"ns-button"},H=t("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},L={class:"px-2"},M={class:"ns-button"},O=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},V={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},E={class:"text-primary"},q={class:"pb-1 border-b border-dashed"},z={class:"pb-1 border-b border-dashed"},I={class:"pb-1 border-b border-dashed"},J=["src","alt"],K={class:"shadow rounded my-4"},Q={class:"ns-box"},U={class:"border-b ns-box-body"},W={class:"ns-table table w-full"},X={class:""},Z={class:"border p-2 text-left"},G={width:"150",class:"border border-error-secondary bg-error-primary p-2 text-right"},$={width:"150",class:"text-right border-success-secondary bg-success-primary border p-2"},tt={class:""},et={class:"p-2 border"},st=t("i",{class:"las la-arrow-right"},null,-1),rt={class:"p-2 border border-error-secondary bg-error-primary text-right"},ot={class:"p-2 border text-right border-success-secondary bg-success-primary"},at={class:"p-2 border"},dt=t("i",{class:"las la-arrow-right"},null,-1),ct={class:"p-2 border border-error-secondary bg-error-primary text-right"},nt={class:"p-2 border text-right border-success-secondary bg-success-primary"},lt={class:"font-semibold"},it={class:"p-2 border"},_t={class:"p-2 border border-error-secondary bg-error-primary text-right"},ht={class:"p-2 border text-right border-success-secondary bg-success-primary"},bt={class:"p-2 border"},ut={colspan:"2",class:"p-2 border text-right border-info-secondary bg-info-primary"};function pt(c,n,_,mt,r,s){const h=C("ns-field");return a(),d("div",k,[t("div",Y,[t("div",B,[u(h,{field:r.startDateField},null,8,["field"])]),t("div",R,[u(h,{field:r.endDateField},null,8,["field"])]),t("div",S,[t("div",j,[t("button",{onClick:n[0]||(n[0]=o=>s.loadReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[H,t("span",N,e(s.__("Load")),1)])])]),t("div",L,[t("div",M,[t("button",{onClick:n[1]||(n[1]=o=>s.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,t("span",P,e(s.__("Print")),1)])])])]),t("div",T,[t("div",V,[t("div",A,[t("div",E,[t("ul",null,[t("li",q,e(s.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)),1),t("li",z,e(s.__("Document : Sale By Payment")),1),t("li",I,e(s.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:_.storeLogo,alt:_.storeName},null,8,J)])])]),t("div",K,[t("div",Q,[t("div",U,[t("table",W,[t("thead",X,[t("tr",null,[t("th",Z,e(s.__("Account")),1),t("th",G,e(s.__("Debit")),1),t("th",$,e(s.__("Credit")),1)])]),t("tbody",tt,[(a(!0),d(p,null,m(r.report.creditCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",et,[st,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",rt,e(s.nsCurrency(0)),1),t("td",ot,e(s.nsCurrency(o.total)),1)]))),128)),(a(!0),d(p,null,m(r.report.debitCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",at,[dt,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",ct,e(s.nsCurrency(o.total)),1),t("td",nt,e(s.nsCurrency(0)),1)]))),128))]),t("tfoot",lt,[t("tr",null,[t("td",it,e(s.__("Sub Total")),1),t("td",_t,e(s.nsCurrency(r.report.total_debit?r.report.total_debit:0)),1),t("td",ht,e(s.nsCurrency(r.report.total_credit?r.report.total_credit:0)),1)]),t("tr",null,[t("td",bt,e(s.__("Balance")),1),t("td",ut,e(s.nsCurrency(s.balance)),1)])])])])])])])])}const kt=D(F,[["render",pt]]);export{kt as default}; +import{h as b,a as y,b as f}from"./bootstrap-8be442b1.js";import{c as x,e as g}from"./components-ef1ba55f.js";import{_ as v,n as w}from"./currency-f8bd78d1.js";import{_ as D}from"./_plugin-vue_export-helper-c27b6911.js";import{r as C,o as a,c as d,a as t,f as u,t as e,F as p,b as m,i as l}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const F={name:"ns-cash-flow",props:["storeLogo","storeName"],mounted(){},components:{nsDatepicker:x,nsDateTimePicker:g},data(){return{startDateField:{value:b(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},endDateField:{value:b(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss"),type:"datetimepicker"},report:new Object,ns:window.ns}},computed:{balance(){return Object.values(this.report).length===0?0:this.report.total_credit-this.report.total_debit},totalDebit(){return 0},totalCredit(){return 0}},methods:{__:v,nsCurrency:w,printSaleReport(){this.$htmlToPaper("report")},loadReport(){y.post("/api/reports/transactions",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:c=>{this.report=c},error:c=>{f.error(c.message).subscribe()}})}}},k={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},B={class:"px-2"},R={class:"px-2"},S={class:"px-2"},j={class:"ns-button"},H=t("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},L={class:"px-2"},M={class:"ns-button"},O=t("i",{class:"las la-print text-xl"},null,-1),P={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},V={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},E={class:"text-primary"},q={class:"pb-1 border-b border-dashed"},z={class:"pb-1 border-b border-dashed"},I={class:"pb-1 border-b border-dashed"},J=["src","alt"],K={class:"shadow rounded my-4"},Q={class:"ns-box"},U={class:"border-b ns-box-body"},W={class:"ns-table table w-full"},X={class:""},Z={class:"border p-2 text-left"},G={width:"150",class:"border border-error-secondary bg-error-primary p-2 text-right"},$={width:"150",class:"text-right border-success-secondary bg-success-primary border p-2"},tt={class:""},et={class:"p-2 border"},st=t("i",{class:"las la-arrow-right"},null,-1),rt={class:"p-2 border border-error-secondary bg-error-primary text-right"},ot={class:"p-2 border text-right border-success-secondary bg-success-primary"},at={class:"p-2 border"},dt=t("i",{class:"las la-arrow-right"},null,-1),ct={class:"p-2 border border-error-secondary bg-error-primary text-right"},nt={class:"p-2 border text-right border-success-secondary bg-success-primary"},lt={class:"font-semibold"},it={class:"p-2 border"},_t={class:"p-2 border border-error-secondary bg-error-primary text-right"},ht={class:"p-2 border text-right border-success-secondary bg-success-primary"},bt={class:"p-2 border"},ut={colspan:"2",class:"p-2 border text-right border-info-secondary bg-info-primary"};function pt(c,n,_,mt,r,s){const h=C("ns-field");return a(),d("div",k,[t("div",Y,[t("div",B,[u(h,{field:r.startDateField},null,8,["field"])]),t("div",R,[u(h,{field:r.endDateField},null,8,["field"])]),t("div",S,[t("div",j,[t("button",{onClick:n[0]||(n[0]=o=>s.loadReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[H,t("span",N,e(s.__("Load")),1)])])]),t("div",L,[t("div",M,[t("button",{onClick:n[1]||(n[1]=o=>s.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,t("span",P,e(s.__("Print")),1)])])])]),t("div",T,[t("div",V,[t("div",A,[t("div",E,[t("ul",null,[t("li",q,e(s.__("Range : {date1} — {date2}").replace("{date1}",r.startDateField.value).replace("{date2}",r.endDateField.value)),1),t("li",z,e(s.__("Document : Sale By Payment")),1),t("li",I,e(s.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:_.storeLogo,alt:_.storeName},null,8,J)])])]),t("div",K,[t("div",Q,[t("div",U,[t("table",W,[t("thead",X,[t("tr",null,[t("th",Z,e(s.__("Account")),1),t("th",G,e(s.__("Debit")),1),t("th",$,e(s.__("Credit")),1)])]),t("tbody",tt,[(a(!0),d(p,null,m(r.report.creditCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",et,[st,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",rt,e(s.nsCurrency(0)),1),t("td",ot,e(s.nsCurrency(o.total)),1)]))),128)),(a(!0),d(p,null,m(r.report.debitCashFlow,(o,i)=>(a(),d("tr",{key:i},[t("td",at,[dt,l(),t("strong",null,e(o.account),1),l(" : "+e(o.name),1)]),t("td",ct,e(s.nsCurrency(o.total)),1),t("td",nt,e(s.nsCurrency(0)),1)]))),128))]),t("tfoot",lt,[t("tr",null,[t("td",it,e(s.__("Sub Total")),1),t("td",_t,e(s.nsCurrency(r.report.total_debit?r.report.total_debit:0)),1),t("td",ht,e(s.nsCurrency(r.report.total_credit?r.report.total_credit:0)),1)]),t("tr",null,[t("td",bt,e(s.__("Balance")),1),t("td",ut,e(s.nsCurrency(s.balance)),1)])])])])])])])])}const kt=D(F,[["render",pt]]);export{kt as default}; diff --git a/public/build/assets/ns-customers-statement-report-DWzLJEA5.js b/public/build/assets/ns-customers-statement-report-154a2535.js similarity index 96% rename from public/build/assets/ns-customers-statement-report-DWzLJEA5.js rename to public/build/assets/ns-customers-statement-report-154a2535.js index ea092121d..18b9c787a 100644 --- a/public/build/assets/ns-customers-statement-report-DWzLJEA5.js +++ b/public/build/assets/ns-customers-statement-report-154a2535.js @@ -1 +1 @@ -import{_ as c,n as x}from"./currency-lOMYG1Wf.js";import{_ as p}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as h,o as l,c as n,a as e,f as _,t as s,e as b,F as f,b as g}from"./runtime-core.esm-bundler-RT2b-_3S.js";const y={name:"ns-customers-statement-report",props:["storeLogo","storeName","search-url"],data(){return{startDateField:{type:"datetimepicker",name:"startDate",value:moment(ns.date.current).startOf("day")},endDateField:{type:"datetimepicker",name:"endDate",value:moment(ns.date.current).endOf("day")},selectedCustomer:null,ns:window.ns,report:{total_purchases:0,total_orders:0,account_amount:0,owed_amount:0,credit_limit_amount:0,orders:[],wallet_transactions:[]}}},mounted(){},computed:{selectedCustomerName(){return this.selectedCustomer===null?c("N/A"):`${this.selectedCustomer.first_name} ${this.selectedCustomer.last_name}`}},methods:{__:c,nsCurrency:x,printSaleReport(){this.$htmlToPaper("report")},handleSelectedCustomer(a){this.selectedCustomer=a,nsHttpClient.post(`/api/reports/customers-statement/${a.id}`,{rangeStarts:this.startDateField.value,rangeEnds:this.endDateField.value}).subscribe({next:o=>{this.report=o},error:o=>{nsSnackBar.error(o.message||c("An unexpected error occured")).subscribe()}})}}},v={id:"report-section"},C={class:"flex -mx-2"},w={class:"px-2"},k={class:"px-2"},D={key:0,class:"px-2"},S={class:"ns-button"},F=e("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},B={class:"px-2"},L={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},j={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},P={class:"text-primary"},V={class:"pb-1 border-b border-dashed border-box-edge"},E={class:"pb-1 border-b border-dashed border-box-edge"},H={class:"pb-1 border-b border-dashed border-box-edge"},U={class:"pb-1 border-b border-dashed border-box-edge"},W=["src","alt"],q={class:"shadow rounded"},z={class:"ns-box"},G={class:"text-center ns-box-header p-2"},I={class:"font-bold"},J={class:"border-b ns-box-body"},K={class:"table ns-table w-full"},M={class:"text-primary"},Q={class:""},X={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-box-edge text-white print:text-black"},Y={class:"p-2 border text-right border-box-edge"},Z={class:""},$={width:"200",class:"font-semibold p-2 border text-left bg-warning-secondary border-box-edge text-white print:text-black"},ee={class:"p-2 border text-right border-box-edge"},te={class:""},se={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-box-edge text-white print:text-black"},re={class:"p-2 border text-right border-box-edge"},oe={class:""},de={width:"200",class:"font-semibold p-2 border text-left border-box-edge"},le={class:"p-2 border text-right border-box-edge"},ne={class:""},ae={width:"200",class:"font-semibold p-2 border text-left border-box-edge"},ce={class:"p-2 border text-right border-box-edge"},_e=e("br",null,null,-1),ie=e("br",null,null,-1),ue={key:0,class:"shadow rounded overflow-hidden"},he={class:"ns-box"},be={class:"text-center ns-box-header p-2"},me={class:"font-bold"},xe={class:"border-b ns-box-body"},pe={class:"table ns-table w-full"},fe={class:"p-2 border text-left"},ge={class:"p-2 border text-right"},ye={class:"text-primary"},ve={width:"200",class:"font-semibold p-2 border text-left"},Ce={class:"p-2 border text-right"};function we(a,o,i,ke,r,t){const u=h("ns-field"),m=h("ns-search");return l(),n("div",v,[e("div",C,[e("div",w,[_(u,{field:r.startDateField},null,8,["field"])]),e("div",k,[_(u,{field:r.endDateField},null,8,["field"])]),r.selectedCustomer?(l(),n("div",D,[e("div",S,[e("button",{onClick:o[0]||(o[0]=d=>t.handleSelectedCustomer(r.selectedCustomer)),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[F,e("span",N,s(t.__("Load")),1)])])])):b("",!0),e("div",B,[e("div",L,[e("button",{onClick:o[1]||(o[1]=d=>t.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,e("span",R,s(t.__("Print")),1)])])])]),e("div",null,[_(m,{placeholder:t.__("Search Customer..."),label:["first_name","last_name"],value:"id",onSelect:o[2]||(o[2]=d=>t.handleSelectedCustomer(d)),url:a.searchUrl},null,8,["placeholder","url"])]),e("div",T,[e("div",j,[e("div",A,[e("div",P,[e("ul",null,[e("li",V,s(t.__("Range : {date1} — {date2}").replace("{date1}",this.startDateField.value).replace("{date2}",this.endDateField.value)),1),e("li",E,s(t.__("Document : Customer Statement")),1),e("li",H,s(t.__("Customer : {selectedCustomerName}").replace("{selectedCustomerName}",t.selectedCustomerName)),1),e("li",U,s(t.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,W)])])]),e("div",q,[e("div",z,[e("div",G,[e("h3",I,s(t.__("Summary")),1)]),e("div",J,[e("table",K,[e("tbody",M,[e("tr",Q,[e("td",X,s(t.__("Total Purchases")),1),e("td",Y,s(t.nsCurrency(r.report.purchases_amount)),1)]),e("tr",Z,[e("td",$,s(t.__("Due Amount")),1),e("td",ee,s(t.nsCurrency(r.report.owed_amount)),1)]),e("tr",te,[e("td",se,s(t.__("Wallet Balance")),1),e("td",re,s(t.nsCurrency(r.report.account_amount)),1)]),e("tr",oe,[e("td",de,s(t.__("Credit Limit")),1),e("td",le,s(t.nsCurrency(r.report.credit_limit_amount)),1)]),e("tr",ne,[e("td",ae,s(t.__("Total Orders")),1),e("td",ce,s(r.report.total_orders),1)])])])])])]),_e,ie,r.report.orders.length>0?(l(),n("div",ue,[e("div",he,[e("div",be,[e("h3",me,s(t.__("Orders")),1)]),e("div",xe,[e("table",pe,[e("thead",null,[e("tr",null,[e("th",fe,s(t.__("Order")),1),e("th",ge,s(t.__("Total")),1)])]),e("tbody",ye,[(l(!0),n(f,null,g(r.report.orders,d=>(l(),n("tr",{class:"",key:d.id},[e("td",ve,s(d.code),1),e("td",Ce,s(t.nsCurrency(d.total)),1)]))),128))])])])])])):b("",!0)])])}const Ne=p(y,[["render",we]]);export{Ne as default}; +import{_ as c,n as x}from"./currency-f8bd78d1.js";import{_ as p}from"./_plugin-vue_export-helper-c27b6911.js";import{r as h,o as l,c as n,a as e,f as _,t as s,e as b,F as f,b as g}from"./runtime-core.esm-bundler-b48de70a.js";const y={name:"ns-customers-statement-report",props:["storeLogo","storeName","search-url"],data(){return{startDateField:{type:"datetimepicker",name:"startDate",value:moment(ns.date.current).startOf("day")},endDateField:{type:"datetimepicker",name:"endDate",value:moment(ns.date.current).endOf("day")},selectedCustomer:null,ns:window.ns,report:{total_purchases:0,total_orders:0,account_amount:0,owed_amount:0,credit_limit_amount:0,orders:[],wallet_transactions:[]}}},mounted(){},computed:{selectedCustomerName(){return this.selectedCustomer===null?c("N/A"):`${this.selectedCustomer.first_name} ${this.selectedCustomer.last_name}`}},methods:{__:c,nsCurrency:x,printSaleReport(){this.$htmlToPaper("report")},handleSelectedCustomer(a){this.selectedCustomer=a,nsHttpClient.post(`/api/reports/customers-statement/${a.id}`,{rangeStarts:this.startDateField.value,rangeEnds:this.endDateField.value}).subscribe({next:o=>{this.report=o},error:o=>{nsSnackBar.error(o.message||c("An unexpected error occured")).subscribe()}})}}},v={id:"report-section"},C={class:"flex -mx-2"},w={class:"px-2"},k={class:"px-2"},D={key:0,class:"px-2"},S={class:"ns-button"},F=e("i",{class:"las la-sync-alt text-xl"},null,-1),N={class:"pl-2"},B={class:"px-2"},L={class:"ns-button"},O=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},T={id:"report",class:"anim-duration-500 fade-in-entrance"},j={class:"flex w-full"},A={class:"my-4 flex justify-between w-full"},P={class:"text-primary"},V={class:"pb-1 border-b border-dashed border-box-edge"},E={class:"pb-1 border-b border-dashed border-box-edge"},H={class:"pb-1 border-b border-dashed border-box-edge"},U={class:"pb-1 border-b border-dashed border-box-edge"},W=["src","alt"],q={class:"shadow rounded"},z={class:"ns-box"},G={class:"text-center ns-box-header p-2"},I={class:"font-bold"},J={class:"border-b ns-box-body"},K={class:"table ns-table w-full"},M={class:"text-primary"},Q={class:""},X={width:"200",class:"font-semibold p-2 border text-left bg-success-secondary border-box-edge text-white print:text-black"},Y={class:"p-2 border text-right border-box-edge"},Z={class:""},$={width:"200",class:"font-semibold p-2 border text-left bg-warning-secondary border-box-edge text-white print:text-black"},ee={class:"p-2 border text-right border-box-edge"},te={class:""},se={width:"200",class:"font-semibold p-2 border text-left bg-info-secondary border-box-edge text-white print:text-black"},re={class:"p-2 border text-right border-box-edge"},oe={class:""},de={width:"200",class:"font-semibold p-2 border text-left border-box-edge"},le={class:"p-2 border text-right border-box-edge"},ne={class:""},ae={width:"200",class:"font-semibold p-2 border text-left border-box-edge"},ce={class:"p-2 border text-right border-box-edge"},_e=e("br",null,null,-1),ie=e("br",null,null,-1),ue={key:0,class:"shadow rounded overflow-hidden"},he={class:"ns-box"},be={class:"text-center ns-box-header p-2"},me={class:"font-bold"},xe={class:"border-b ns-box-body"},pe={class:"table ns-table w-full"},fe={class:"p-2 border text-left"},ge={class:"p-2 border text-right"},ye={class:"text-primary"},ve={width:"200",class:"font-semibold p-2 border text-left"},Ce={class:"p-2 border text-right"};function we(a,o,i,ke,r,t){const u=h("ns-field"),m=h("ns-search");return l(),n("div",v,[e("div",C,[e("div",w,[_(u,{field:r.startDateField},null,8,["field"])]),e("div",k,[_(u,{field:r.endDateField},null,8,["field"])]),r.selectedCustomer?(l(),n("div",D,[e("div",S,[e("button",{onClick:o[0]||(o[0]=d=>t.handleSelectedCustomer(r.selectedCustomer)),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[F,e("span",N,s(t.__("Load")),1)])])])):b("",!0),e("div",B,[e("div",L,[e("button",{onClick:o[1]||(o[1]=d=>t.printSaleReport()),class:"rounded flex justify-between text-primary shadow py-1 items-center px-2"},[O,e("span",R,s(t.__("Print")),1)])])])]),e("div",null,[_(m,{placeholder:t.__("Search Customer..."),label:["first_name","last_name"],value:"id",onSelect:o[2]||(o[2]=d=>t.handleSelectedCustomer(d)),url:a.searchUrl},null,8,["placeholder","url"])]),e("div",T,[e("div",j,[e("div",A,[e("div",P,[e("ul",null,[e("li",V,s(t.__("Range : {date1} — {date2}").replace("{date1}",this.startDateField.value).replace("{date2}",this.endDateField.value)),1),e("li",E,s(t.__("Document : Customer Statement")),1),e("li",H,s(t.__("Customer : {selectedCustomerName}").replace("{selectedCustomerName}",t.selectedCustomerName)),1),e("li",U,s(t.__("By : {user}").replace("{user}",r.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,W)])])]),e("div",q,[e("div",z,[e("div",G,[e("h3",I,s(t.__("Summary")),1)]),e("div",J,[e("table",K,[e("tbody",M,[e("tr",Q,[e("td",X,s(t.__("Total Purchases")),1),e("td",Y,s(t.nsCurrency(r.report.purchases_amount)),1)]),e("tr",Z,[e("td",$,s(t.__("Due Amount")),1),e("td",ee,s(t.nsCurrency(r.report.owed_amount)),1)]),e("tr",te,[e("td",se,s(t.__("Wallet Balance")),1),e("td",re,s(t.nsCurrency(r.report.account_amount)),1)]),e("tr",oe,[e("td",de,s(t.__("Credit Limit")),1),e("td",le,s(t.nsCurrency(r.report.credit_limit_amount)),1)]),e("tr",ne,[e("td",ae,s(t.__("Total Orders")),1),e("td",ce,s(r.report.total_orders),1)])])])])])]),_e,ie,r.report.orders.length>0?(l(),n("div",ue,[e("div",he,[e("div",be,[e("h3",me,s(t.__("Orders")),1)]),e("div",xe,[e("table",pe,[e("thead",null,[e("tr",null,[e("th",fe,s(t.__("Order")),1),e("th",ge,s(t.__("Total")),1)])]),e("tbody",ye,[(l(!0),n(f,null,g(r.report.orders,d=>(l(),n("tr",{class:"",key:d.id},[e("td",ve,s(d.code),1),e("td",Ce,s(t.nsCurrency(d.total)),1)]))),128))])])])])])):b("",!0)])])}const Ne=p(y,[["render",we]]);export{Ne as default}; diff --git a/public/build/assets/ns-dashboard-4a768a15.js b/public/build/assets/ns-dashboard-4a768a15.js new file mode 100644 index 000000000..cd6649f36 --- /dev/null +++ b/public/build/assets/ns-dashboard-4a768a15.js @@ -0,0 +1 @@ +import"./bootstrap-8be442b1.js";import{_ as s,n as o,a as t}from"./currency-f8bd78d1.js";import{_ as a}from"./_plugin-vue_export-helper-c27b6911.js";import{A as e}from"./runtime-core.esm-bundler-b48de70a.js";const n={name:"ns-dashboard",data(){return{report:{}}},mounted(){},methods:{__:s,nsCurrency:o,nsRawCurrency:t}};function d(r,m,p,_,c,f){return e(r.$slots,"default")}const l=a(n,[["render",d]]);export{l as default}; diff --git a/public/build/assets/ns-dashboard-BXpytQ25.js b/public/build/assets/ns-dashboard-BXpytQ25.js deleted file mode 100644 index 310dd9541..000000000 --- a/public/build/assets/ns-dashboard-BXpytQ25.js +++ /dev/null @@ -1 +0,0 @@ -import"./bootstrap-CnLEEQCx.js";import{_ as s,n as o,a as t}from"./currency-lOMYG1Wf.js";import{_ as a}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{A as e}from"./runtime-core.esm-bundler-RT2b-_3S.js";const n={name:"ns-dashboard",data(){return{report:{}}},mounted(){},methods:{__:s,nsCurrency:o,nsRawCurrency:t}};function d(r,m,p,_,c,f){return e(r.$slots,"default")}const l=a(n,[["render",d]]);export{l as default}; diff --git a/public/build/assets/ns-hotpress-B_9sUEWO.js b/public/build/assets/ns-hotpress-fbaed768.js similarity index 100% rename from public/build/assets/ns-hotpress-B_9sUEWO.js rename to public/build/assets/ns-hotpress-fbaed768.js diff --git a/public/build/assets/ns-incomplete-sale-card-widget-DHcCVEz0.js b/public/build/assets/ns-incomplete-sale-card-widget-bcb344af.js similarity index 81% rename from public/build/assets/ns-incomplete-sale-card-widget-DHcCVEz0.js rename to public/build/assets/ns-incomplete-sale-card-widget-bcb344af.js index edda37a47..e8f078571 100644 --- a/public/build/assets/ns-incomplete-sale-card-widget-DHcCVEz0.js +++ b/public/build/assets/ns-incomplete-sale-card-widget-bcb344af.js @@ -1 +1 @@ -import{_ as d,n as c}from"./currency-lOMYG1Wf.js";import{_ as a}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as i,o as _,c as f,a as e,t as s,f as m}from"./runtime-core.esm-bundler-RT2b-_3S.js";const u={name:"ns-sale-card-widget",methods:{__:d,nsCurrency:c},data(){return{report:{}}},mounted(){Dashboard.day.subscribe(o=>{this.report=o})}},x={class:"flex card-widget flex-auto flex-col rounded-lg shadow-lg bg-gradient-to-br from-green-400 to-green-600 px-3 py-5"},h={class:"flex flex-row md:flex-col flex-auto"},p={class:"w-1/2 md:w-full flex md:flex-col md:items-start items-center justify-center"},b={class:"flex justify-between w-full items-center"},g={class:"font-bold hidden text-right md:inline-block"},y={class:"text-2xl font-black"},v={class:"w-1/2 md:w-full flex flex-col px-2 justify-end items-end"},w={class:"font-bold inline-block text-right md:hidden"},k={class:"text-xs text-right"};function C(o,n,j,B,r,t){const l=i("ns-close-button");return _(),f("div",x,[e("div",h,[e("div",p,[e("div",b,[e("h6",g,s(t.__("Incomplete Orders")),1),e("div",null,[m(l,{class:"border-success-secondary",onClick:n[0]||(n[0]=I=>o.$emit("onRemove"))})])]),e("h3",y,s(t.nsCurrency(r.report.total_unpaid||0,"abbreviate")),1)]),e("div",v,[e("h6",w,s(t.__("Incomplete Orders")),1),e("h4",k,"+"+s(t.nsCurrency(r.report.today_unpaid||0))+" "+s(t.__("Today")),1)])])])}const S=a(u,[["render",C]]);export{S as default}; +import{_ as d,n as c}from"./currency-f8bd78d1.js";import{_ as a}from"./_plugin-vue_export-helper-c27b6911.js";import{r as i,o as _,c as f,a as e,t as s,f as m}from"./runtime-core.esm-bundler-b48de70a.js";const u={name:"ns-sale-card-widget",methods:{__:d,nsCurrency:c},data(){return{report:{}}},mounted(){Dashboard.day.subscribe(o=>{this.report=o})}},x={class:"flex card-widget flex-auto flex-col rounded-lg shadow-lg bg-gradient-to-br from-green-400 to-green-600 px-3 py-5"},h={class:"flex flex-row md:flex-col flex-auto"},p={class:"w-1/2 md:w-full flex md:flex-col md:items-start items-center justify-center"},b={class:"flex justify-between w-full items-center"},g={class:"font-bold hidden text-right md:inline-block"},y={class:"text-2xl font-black"},v={class:"w-1/2 md:w-full flex flex-col px-2 justify-end items-end"},w={class:"font-bold inline-block text-right md:hidden"},k={class:"text-xs text-right"};function C(o,n,j,B,r,t){const l=i("ns-close-button");return _(),f("div",x,[e("div",h,[e("div",p,[e("div",b,[e("h6",g,s(t.__("Incomplete Orders")),1),e("div",null,[m(l,{class:"border-success-secondary",onClick:n[0]||(n[0]=I=>o.$emit("onRemove"))})])]),e("h3",y,s(t.nsCurrency(r.report.total_unpaid||0,"abbreviate")),1)]),e("div",v,[e("h6",w,s(t.__("Incomplete Orders")),1),e("h4",k,"+"+s(t.nsCurrency(r.report.today_unpaid||0))+" "+s(t.__("Today")),1)])])])}const S=a(u,[["render",C]]);export{S as default}; diff --git a/public/build/assets/ns-login-x3kPrV7g.js b/public/build/assets/ns-login-20974704.js similarity index 93% rename from public/build/assets/ns-login-x3kPrV7g.js rename to public/build/assets/ns-login-20974704.js index f2f3d3511..8109830f7 100644 --- a/public/build/assets/ns-login-x3kPrV7g.js +++ b/public/build/assets/ns-login-20974704.js @@ -1 +1 @@ -import{F as w,G as F,a as d,n as p,b as u,w as S}from"./bootstrap-CnLEEQCx.js";import{_ as a}from"./currency-lOMYG1Wf.js";import{_ as T}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as f,o as s,c as t,a as i,F as V,b as B,g as v,e as l,f as _,t as h,w as y,i as R}from"./runtime-core.esm-bundler-RT2b-_3S.js";const X={name:"ns-login",props:["showRecoveryLink","showRegisterButton"],data(){return{fields:[],xXsrfToken:null,validation:new w,isSubitting:!1}},mounted(){F({login:d.get("/api/fields/ns.login"),csrf:d.get("/sanctum/csrf-cookie")}).subscribe({next:n=>{this.fields=this.validation.createFields(n.login),this.xXsrfToken=d.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>p.doAction("ns-login-mounted",this),100)},error:n=>{u.error(n.message||a("An unexpected error occurred."),a("OK"),{duration:0}).subscribe()}})},methods:{__:a,signIn(){if(!this.validation.validateFields(this.fields))return u.error(a("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),p.applyFilters("ns-login-submit",!0)&&(this.isSubitting=!0,d.post("/auth/sign-in",this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:e=>{document.location=e.data.redirectTo},error:e=>{this.isSubitting=!1,this.validation.enableFields(this.fields),e.data&&this.validation.triggerFieldsErrors(this.fields,e.data),u.error(e.message||a("An unexpected error occured.")).subscribe()}}))}}},N={class:"ns-box rounded shadow overflow-hidden transition-all duration-100"},C={class:"ns-box-body"},K={class:"p-3 -my-2"},j={key:0,class:"flex items-center justify-center py-10"},E={key:1,class:"flex w-full items-center justify-center py-4"},I={href:"/password-lost",class:"hover:underline text-blue-600 text-sm"},L={class:"flex justify-between items-center border-t ns-box-footer p-3"},A={key:0};function O(n,e,m,z,o,r){const k=f("ns-field"),g=f("ns-spinner"),b=f("ns-button");return s(),t("div",N,[i("div",C,[i("div",K,[o.fields.length>0?(s(),t("div",{key:0,class:"py-2 fade-in-entrance anim-duration-300",onKeyup:e[0]||(e[0]=S(c=>r.signIn(),["enter"]))},[(s(!0),t(V,null,B(o.fields,(c,x)=>(s(),v(k,{key:x,field:c},null,8,["field"]))),128))],32)):l("",!0)]),o.fields.length===0?(s(),t("div",j,[_(g,{border:"4",size:"16"})])):l("",!0),m.showRecoveryLink?(s(),t("div",E,[i("a",I,h(r.__("Password Forgotten ?")),1)])):l("",!0)]),i("div",L,[i("div",null,[_(b,{disabled:o.isSubitting,onClick:e[1]||(e[1]=c=>r.signIn()),class:"justify-between",type:"info"},{default:y(()=>[o.isSubitting?(s(),v(g,{key:0,class:"mr-2",size:"6"})):l("",!0),i("span",null,h(r.__("Sign In")),1)]),_:1},8,["disabled"])]),m.showRegisterButton?(s(),t("div",A,[_(b,{link:!0,href:"/sign-up",type:"success"},{default:y(()=>[R(h(r.__("Register")),1)]),_:1})])):l("",!0)])])}const P=T(X,[["render",O]]);export{P as default}; +import{F as w,G as F,a as d,n as p,b as u,w as S}from"./bootstrap-8be442b1.js";import{_ as a}from"./currency-f8bd78d1.js";import{_ as T}from"./_plugin-vue_export-helper-c27b6911.js";import{r as f,o as s,c as t,a as i,F as V,b as B,g as v,e as l,f as _,t as h,w as y,i as R}from"./runtime-core.esm-bundler-b48de70a.js";const X={name:"ns-login",props:["showRecoveryLink","showRegisterButton"],data(){return{fields:[],xXsrfToken:null,validation:new w,isSubitting:!1}},mounted(){F({login:d.get("/api/fields/ns.login"),csrf:d.get("/sanctum/csrf-cookie")}).subscribe({next:n=>{this.fields=this.validation.createFields(n.login),this.xXsrfToken=d.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>p.doAction("ns-login-mounted",this),100)},error:n=>{u.error(n.message||a("An unexpected error occurred."),a("OK"),{duration:0}).subscribe()}})},methods:{__:a,signIn(){if(!this.validation.validateFields(this.fields))return u.error(a("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),p.applyFilters("ns-login-submit",!0)&&(this.isSubitting=!0,d.post("/auth/sign-in",this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe({next:e=>{document.location=e.data.redirectTo},error:e=>{this.isSubitting=!1,this.validation.enableFields(this.fields),e.data&&this.validation.triggerFieldsErrors(this.fields,e.data),u.error(e.message||a("An unexpected error occured.")).subscribe()}}))}}},N={class:"ns-box rounded shadow overflow-hidden transition-all duration-100"},C={class:"ns-box-body"},K={class:"p-3 -my-2"},j={key:0,class:"flex items-center justify-center py-10"},E={key:1,class:"flex w-full items-center justify-center py-4"},I={href:"/password-lost",class:"hover:underline text-blue-600 text-sm"},L={class:"flex justify-between items-center border-t ns-box-footer p-3"},A={key:0};function O(n,e,m,z,o,r){const k=f("ns-field"),g=f("ns-spinner"),b=f("ns-button");return s(),t("div",N,[i("div",C,[i("div",K,[o.fields.length>0?(s(),t("div",{key:0,class:"py-2 fade-in-entrance anim-duration-300",onKeyup:e[0]||(e[0]=S(c=>r.signIn(),["enter"]))},[(s(!0),t(V,null,B(o.fields,(c,x)=>(s(),v(k,{key:x,field:c},null,8,["field"]))),128))],32)):l("",!0)]),o.fields.length===0?(s(),t("div",j,[_(g,{border:"4",size:"16"})])):l("",!0),m.showRecoveryLink?(s(),t("div",E,[i("a",I,h(r.__("Password Forgotten ?")),1)])):l("",!0)]),i("div",L,[i("div",null,[_(b,{disabled:o.isSubitting,onClick:e[1]||(e[1]=c=>r.signIn()),class:"justify-between",type:"info"},{default:y(()=>[o.isSubitting?(s(),v(g,{key:0,class:"mr-2",size:"6"})):l("",!0),i("span",null,h(r.__("Sign In")),1)]),_:1},8,["disabled"])]),m.showRegisterButton?(s(),t("div",A,[_(b,{link:!0,href:"/sign-up",type:"success"},{default:y(()=>[R(h(r.__("Register")),1)]),_:1})])):l("",!0)])])}const P=T(X,[["render",O]]);export{P as default}; diff --git a/public/build/assets/ns-low-stock-report-BeG70sx2.js b/public/build/assets/ns-low-stock-report-585a8342.js similarity index 94% rename from public/build/assets/ns-low-stock-report-BeG70sx2.js rename to public/build/assets/ns-low-stock-report-585a8342.js index 0bef5161b..0e0a804ad 100644 --- a/public/build/assets/ns-low-stock-report-BeG70sx2.js +++ b/public/build/assets/ns-low-stock-report-585a8342.js @@ -1 +1 @@ -import{F as w,a as b,b as m}from"./bootstrap-CnLEEQCx.js";import{c as k,e as R}from"./components-D4w1etK_.js";import{_ as u,n as v}from"./currency-lOMYG1Wf.js";import{k as T,b as x}from"./ns-prompt-popup-DKRiwYBT.js";import{j as N}from"./join-array-DPKtuOQJ.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as P,o as c,c as i,a as e,t as s,e as h,F as y,b as f,f as S}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";const F={name:"ns-low-stock-report",props:["storeLogo","storeName"],mounted(){this.reportType=this.options[0].value,this.loadRelevantReport()},components:{nsDatepicker:k,nsDateTimePicker:R,nsPaginate:T},data(){return{ns:window.ns,products:[],options:[{label:u("Stock Report"),value:"stock_report"},{label:u("Low Stock Report"),value:"low_stock"}],stockReportResult:{},reportType:"",reportTypeName:"",unitNames:"",categoryName:"",categoryIds:[],unitIds:[],validation:new w}},watch:{reportType(){const l=this.options.filter(r=>r.value===this.reportType);l.length>0?this.reportTypeName=l[0].label:this.reportTypeName=u("N/A")}},methods:{__:u,nsCurrency:v,joinArray:N,async selectReport(){try{const l=await new Promise((r,d)=>{Popup.show(x,{label:u("Report Type"),options:this.options,resolve:r,reject:d})});this.reportType=l,this.loadRelevantReport()}catch{}},async selectUnits(){b.get("/api/units").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Units"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.unitNames=this.joinArray(d),this.unitIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the units.")).subscribe()}})},async selectCategories(){b.get("/api/categories").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Categories"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.categoryName=this.joinArray(d),this.categoryIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the categories.")).subscribe()}})},loadRelevantReport(){switch(this.reportType){case"stock_report":this.loadStockReport();break;case"low_stock":this.loadReport();break}},printSaleReport(){this.$htmlToPaper("low-stock-report")},loadStockReport(l=null){b.post(l||"/api/reports/stock-report",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:r=>{this.stockReportResult=r},error:r=>{m.error(r.message).subscribe()}})},totalSum(l,r,d){if(l.data!==void 0){const o=l.data.map(t=>t.unit_quantities).map(t=>{const p=t.map(n=>n[r]*n[d]);return p.length>0?p.reduce((n,_)=>parseFloat(n)+parseFloat(_)):0});if(o.length>0)return o.reduce((t,p)=>parseFloat(t)+parseFloat(p))}return 0},sum(l,r){if(l.data!==void 0){const a=l.data.map(o=>o.unit_quantities).map(o=>{const t=o.map(p=>p[r]);return t.length>0?t.reduce((p,n)=>parseFloat(p)+parseFloat(n)):0});if(a.length>0)return a.reduce((o,t)=>parseFloat(o)+parseFloat(t))}return 0},loadReport(){b.post("/api/reports/low-stock",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:l=>{this.products=l},error:l=>{m.error(l.message).subscribe()}})}}},j={id:"report-section",class:"px-4"},q={class:"flex -mx-2"},A={class:"px-2"},I={class:"ns-button"},L=e("i",{class:"las la-sync-alt text-xl"},null,-1),U={class:"pl-2"},B={class:"px-2"},D={class:"ns-button"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},H={class:"px-2"},z={class:"ns-button"},G=e("i",{class:"las la-filter text-xl"},null,-1),J={class:"pl-2"},K={class:"px-2"},M={class:"ns-button"},O=e("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={class:"px-2"},Y={class:"ns-button"},Z=e("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},$={id:"low-stock-report",class:"anim-duration-500 fade-in-entrance"},ee={class:"flex w-full"},te={class:"my-4 flex justify-between w-full"},se={class:"text-primary"},re={class:"pb-1 border-b border-dashed"},oe={class:"pb-1 border-b border-dashed"},le={class:"pb-1 border-b border-dashed"},ne=["src","alt"],ae={class:"text-primary shadow rounded my-4"},ce={class:"ns-box"},ie={key:0,class:"ns-box-body"},de={class:"table ns-table w-full"},pe={class:"border p-2 text-left"},_e={class:"border p-2 text-left"},ue={width:"150",class:"border p-2 text-right"},he={width:"150",class:"border border-info-secondary bg-info-primary p-2 text-right"},be={width:"150",class:"border border-success-secondary bg-success-primary p-2 text-right"},me={key:0},ye={colspan:"4",class:"p-2 border text-center"},xe={class:"p-2 border"},fe={class:"p-2 border"},ge={class:"p-2 border text-right"},we={class:"p-2 border text-right"},ke={class:"p-2 border border-success-secondary bg-success-primary text-right"},Re={key:1,class:"ns-box-body"},ve={class:"table ns-table w-full"},Te={class:"border p-2 text-left"},Ne={class:"border p-2 text-left"},Ce={width:"150",class:"border p-2 text-right"},Pe={width:"150",class:"border p-2 text-right"},Se={width:"150",class:"border p-2 text-right"},Fe={key:0},je={colspan:"5",class:"p-2 border text-center"},qe={class:"p-2 border"},Ae={class:"flex flex-col"},Ie={class:"p-2 border"},Le={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Be={class:"p-2 border text-right"},De=e("td",{class:"p-2 border"},null,-1),Ve=e("td",{class:"p-2 border"},null,-1),Ee=e("td",{class:"p-2 border"},null,-1),He={class:"p-2 border text-right"},ze={class:"p-2 border text-right"},Ge={key:0,class:"flex justify-end p-2"};function Je(l,r,d,a,o,t){const p=P("ns-paginate");return c(),i("div",j,[e("div",q,[e("div",A,[e("div",I,[e("button",{onClick:r[0]||(r[0]=n=>t.loadRelevantReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[L,e("span",U,s(t.__("Load")),1)])])]),e("div",B,[e("div",D,[e("button",{onClick:r[1]||(r[1]=n=>t.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[V,e("span",E,s(t.__("Print")),1)])])]),e("div",H,[e("div",z,[e("button",{onClick:r[2]||(r[2]=n=>t.selectReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[G,e("span",J,s(t.__("Report Type"))+" : "+s(o.reportTypeName),1)])])]),e("div",K,[e("div",M,[e("button",{onClick:r[3]||(r[3]=n=>t.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[O,e("span",W,s(t.__("Categories"))+" : "+s(o.categoryName||t.__("All Categories")),1)])])]),e("div",X,[e("div",Y,[e("button",{onClick:r[4]||(r[4]=n=>t.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[Z,e("span",Q,s(t.__("Units"))+" : "+s(o.unitNames||t.__("All Units")),1)])])])]),e("div",$,[e("div",ee,[e("div",te,[e("div",se,[e("ul",null,[e("li",re,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",oe,s(t.__("Document : {reportTypeName}").replace("{reportTypeName}",o.reportTypeName)),1),e("li",le,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:d.storeLogo,alt:d.storeName},null,8,ne)])])]),e("div",ae,[e("div",ce,[o.reportType==="low_stock"?(c(),i("div",ie,[e("table",de,[e("thead",null,[e("tr",null,[e("th",pe,s(t.__("Product")),1),e("th",_e,s(t.__("Unit")),1),e("th",ue,s(t.__("Threshold")),1),e("th",he,s(t.__("Quantity")),1),e("th",be,s(t.__("Price")),1)])]),e("tbody",null,[o.products.length===0?(c(),i("tr",me,[e("td",ye,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),(c(!0),i(y,null,f(o.products,(n,_)=>(c(),i("tr",{key:_,class:"text-sm"},[e("td",xe,s(n.product.name),1),e("td",fe,s(n.unit.name),1),e("td",ge,s(n.low_quantity),1),e("td",we,s(n.quantity),1),e("td",ke,s(t.nsCurrency(n.quantity*n.sale_price)),1)]))),128))])])])):h("",!0),o.reportType==="stock_report"?(c(),i("div",Re,[e("table",ve,[e("thead",null,[e("tr",null,[e("th",Te,s(t.__("Product")),1),e("th",Ne,s(t.__("Unit")),1),e("th",Ce,s(t.__("Price")),1),e("th",Pe,s(t.__("Quantity")),1),e("th",Se,s(t.__("Total Price")),1)])]),e("tbody",null,[o.stockReportResult.data===void 0||o.stockReportResult.data.length===0?(c(),i("tr",Fe,[e("td",je,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),o.stockReportResult.data!==void 0?(c(!0),i(y,{key:1},f(o.stockReportResult.data,n=>(c(),i(y,null,[(c(!0),i(y,null,f(n.unit_quantities,(_,g)=>(c(),i("tr",{key:g,class:"text-sm"},[e("td",qe,[e("div",Ae,[e("span",null,s(n.name),1)])]),e("td",Ie,s(_.unit.name),1),e("td",Le,s(t.nsCurrency(_.sale_price)),1),e("td",Ue,s(_.quantity),1),e("td",Be,s(t.nsCurrency(_.quantity*_.sale_price)),1)]))),128))],64))),256)):h("",!0)]),e("tfoot",null,[e("tr",null,[De,Ve,Ee,e("td",He,s(t.sum(o.stockReportResult,"quantity")),1),e("td",ze,s(t.nsCurrency(t.totalSum(o.stockReportResult,"sale_price","quantity"))),1)])])]),o.stockReportResult.data?(c(),i("div",Ge,[S(p,{onLoad:r[5]||(r[5]=n=>t.loadStockReport(n)),pagination:o.stockReportResult},null,8,["pagination"])])):h("",!0)])):h("",!0)])])])])}const tt=C(F,[["render",Je]]);export{tt as default}; +import{F as w,a as b,b as m}from"./bootstrap-8be442b1.js";import{c as k,e as R}from"./components-ef1ba55f.js";import{_ as u,n as v}from"./currency-f8bd78d1.js";import{k as T,b as x}from"./ns-prompt-popup-100414c5.js";import{j as N}from"./join-array-4b30b096.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{r as P,o as c,c as i,a as e,t as s,e as h,F as y,b as f,f as S}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const F={name:"ns-low-stock-report",props:["storeLogo","storeName"],mounted(){this.reportType=this.options[0].value,this.loadRelevantReport()},components:{nsDatepicker:k,nsDateTimePicker:R,nsPaginate:T},data(){return{ns:window.ns,products:[],options:[{label:u("Stock Report"),value:"stock_report"},{label:u("Low Stock Report"),value:"low_stock"}],stockReportResult:{},reportType:"",reportTypeName:"",unitNames:"",categoryName:"",categoryIds:[],unitIds:[],validation:new w}},watch:{reportType(){const l=this.options.filter(r=>r.value===this.reportType);l.length>0?this.reportTypeName=l[0].label:this.reportTypeName=u("N/A")}},methods:{__:u,nsCurrency:v,joinArray:N,async selectReport(){try{const l=await new Promise((r,d)=>{Popup.show(x,{label:u("Report Type"),options:this.options,resolve:r,reject:d})});this.reportType=l,this.loadRelevantReport()}catch{}},async selectUnits(){b.get("/api/units").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Units"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.unitNames=this.joinArray(d),this.unitIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the units.")).subscribe()}})},async selectCategories(){b.get("/api/categories").subscribe({next:async l=>{try{const r=await new Promise((a,o)=>{Popup.show(x,{label:u("Select Categories"),type:"multiselect",options:l.map(t=>({label:t.name,value:t.id})),resolve:a,reject:o})}),d=l.filter(a=>r.includes(a.id)).map(a=>a.name);this.categoryName=this.joinArray(d),this.categoryIds=r,this.loadRelevantReport()}catch(r){console.log(r)}},error:l=>{m.error(u("An error has occured while loading the categories.")).subscribe()}})},loadRelevantReport(){switch(this.reportType){case"stock_report":this.loadStockReport();break;case"low_stock":this.loadReport();break}},printSaleReport(){this.$htmlToPaper("low-stock-report")},loadStockReport(l=null){b.post(l||"/api/reports/stock-report",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:r=>{this.stockReportResult=r},error:r=>{m.error(r.message).subscribe()}})},totalSum(l,r,d){if(l.data!==void 0){const o=l.data.map(t=>t.unit_quantities).map(t=>{const p=t.map(n=>n[r]*n[d]);return p.length>0?p.reduce((n,_)=>parseFloat(n)+parseFloat(_)):0});if(o.length>0)return o.reduce((t,p)=>parseFloat(t)+parseFloat(p))}return 0},sum(l,r){if(l.data!==void 0){const a=l.data.map(o=>o.unit_quantities).map(o=>{const t=o.map(p=>p[r]);return t.length>0?t.reduce((p,n)=>parseFloat(p)+parseFloat(n)):0});if(a.length>0)return a.reduce((o,t)=>parseFloat(o)+parseFloat(t))}return 0},loadReport(){b.post("/api/reports/low-stock",{categories:this.categoryIds,units:this.unitIds}).subscribe({next:l=>{this.products=l},error:l=>{m.error(l.message).subscribe()}})}}},j={id:"report-section",class:"px-4"},q={class:"flex -mx-2"},A={class:"px-2"},I={class:"ns-button"},L=e("i",{class:"las la-sync-alt text-xl"},null,-1),U={class:"pl-2"},B={class:"px-2"},D={class:"ns-button"},V=e("i",{class:"las la-print text-xl"},null,-1),E={class:"pl-2"},H={class:"px-2"},z={class:"ns-button"},G=e("i",{class:"las la-filter text-xl"},null,-1),J={class:"pl-2"},K={class:"px-2"},M={class:"ns-button"},O=e("i",{class:"las la-filter text-xl"},null,-1),W={class:"pl-2"},X={class:"px-2"},Y={class:"ns-button"},Z=e("i",{class:"las la-filter text-xl"},null,-1),Q={class:"pl-2"},$={id:"low-stock-report",class:"anim-duration-500 fade-in-entrance"},ee={class:"flex w-full"},te={class:"my-4 flex justify-between w-full"},se={class:"text-primary"},re={class:"pb-1 border-b border-dashed"},oe={class:"pb-1 border-b border-dashed"},le={class:"pb-1 border-b border-dashed"},ne=["src","alt"],ae={class:"text-primary shadow rounded my-4"},ce={class:"ns-box"},ie={key:0,class:"ns-box-body"},de={class:"table ns-table w-full"},pe={class:"border p-2 text-left"},_e={class:"border p-2 text-left"},ue={width:"150",class:"border p-2 text-right"},he={width:"150",class:"border border-info-secondary bg-info-primary p-2 text-right"},be={width:"150",class:"border border-success-secondary bg-success-primary p-2 text-right"},me={key:0},ye={colspan:"4",class:"p-2 border text-center"},xe={class:"p-2 border"},fe={class:"p-2 border"},ge={class:"p-2 border text-right"},we={class:"p-2 border text-right"},ke={class:"p-2 border border-success-secondary bg-success-primary text-right"},Re={key:1,class:"ns-box-body"},ve={class:"table ns-table w-full"},Te={class:"border p-2 text-left"},Ne={class:"border p-2 text-left"},Ce={width:"150",class:"border p-2 text-right"},Pe={width:"150",class:"border p-2 text-right"},Se={width:"150",class:"border p-2 text-right"},Fe={key:0},je={colspan:"5",class:"p-2 border text-center"},qe={class:"p-2 border"},Ae={class:"flex flex-col"},Ie={class:"p-2 border"},Le={class:"p-2 border text-right"},Ue={class:"p-2 border text-right"},Be={class:"p-2 border text-right"},De=e("td",{class:"p-2 border"},null,-1),Ve=e("td",{class:"p-2 border"},null,-1),Ee=e("td",{class:"p-2 border"},null,-1),He={class:"p-2 border text-right"},ze={class:"p-2 border text-right"},Ge={key:0,class:"flex justify-end p-2"};function Je(l,r,d,a,o,t){const p=P("ns-paginate");return c(),i("div",j,[e("div",q,[e("div",A,[e("div",I,[e("button",{onClick:r[0]||(r[0]=n=>t.loadRelevantReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[L,e("span",U,s(t.__("Load")),1)])])]),e("div",B,[e("div",D,[e("button",{onClick:r[1]||(r[1]=n=>t.printSaleReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[V,e("span",E,s(t.__("Print")),1)])])]),e("div",H,[e("div",z,[e("button",{onClick:r[2]||(r[2]=n=>t.selectReport()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[G,e("span",J,s(t.__("Report Type"))+" : "+s(o.reportTypeName),1)])])]),e("div",K,[e("div",M,[e("button",{onClick:r[3]||(r[3]=n=>t.selectCategories()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[O,e("span",W,s(t.__("Categories"))+" : "+s(o.categoryName||t.__("All Categories")),1)])])]),e("div",X,[e("div",Y,[e("button",{onClick:r[4]||(r[4]=n=>t.selectUnits()),class:"rounded flex justify-between shadow py-1 items-center px-2"},[Z,e("span",Q,s(t.__("Units"))+" : "+s(o.unitNames||t.__("All Units")),1)])])])]),e("div",$,[e("div",ee,[e("div",te,[e("div",se,[e("ul",null,[e("li",re,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",oe,s(t.__("Document : {reportTypeName}").replace("{reportTypeName}",o.reportTypeName)),1),e("li",le,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:d.storeLogo,alt:d.storeName},null,8,ne)])])]),e("div",ae,[e("div",ce,[o.reportType==="low_stock"?(c(),i("div",ie,[e("table",de,[e("thead",null,[e("tr",null,[e("th",pe,s(t.__("Product")),1),e("th",_e,s(t.__("Unit")),1),e("th",ue,s(t.__("Threshold")),1),e("th",he,s(t.__("Quantity")),1),e("th",be,s(t.__("Price")),1)])]),e("tbody",null,[o.products.length===0?(c(),i("tr",me,[e("td",ye,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),(c(!0),i(y,null,f(o.products,(n,_)=>(c(),i("tr",{key:_,class:"text-sm"},[e("td",xe,s(n.product.name),1),e("td",fe,s(n.unit.name),1),e("td",ge,s(n.low_quantity),1),e("td",we,s(n.quantity),1),e("td",ke,s(t.nsCurrency(n.quantity*n.sale_price)),1)]))),128))])])])):h("",!0),o.reportType==="stock_report"?(c(),i("div",Re,[e("table",ve,[e("thead",null,[e("tr",null,[e("th",Te,s(t.__("Product")),1),e("th",Ne,s(t.__("Unit")),1),e("th",Ce,s(t.__("Price")),1),e("th",Pe,s(t.__("Quantity")),1),e("th",Se,s(t.__("Total Price")),1)])]),e("tbody",null,[o.stockReportResult.data===void 0||o.stockReportResult.data.length===0?(c(),i("tr",Fe,[e("td",je,[e("span",null,s(t.__("There is no product to display...")),1)])])):h("",!0),o.stockReportResult.data!==void 0?(c(!0),i(y,{key:1},f(o.stockReportResult.data,n=>(c(),i(y,null,[(c(!0),i(y,null,f(n.unit_quantities,(_,g)=>(c(),i("tr",{key:g,class:"text-sm"},[e("td",qe,[e("div",Ae,[e("span",null,s(n.name),1)])]),e("td",Ie,s(_.unit.name),1),e("td",Le,s(t.nsCurrency(_.sale_price)),1),e("td",Ue,s(_.quantity),1),e("td",Be,s(t.nsCurrency(_.quantity*_.sale_price)),1)]))),128))],64))),256)):h("",!0)]),e("tfoot",null,[e("tr",null,[De,Ve,Ee,e("td",He,s(t.sum(o.stockReportResult,"quantity")),1),e("td",ze,s(t.nsCurrency(t.totalSum(o.stockReportResult,"sale_price","quantity"))),1)])])]),o.stockReportResult.data?(c(),i("div",Ge,[S(p,{onLoad:r[5]||(r[5]=n=>t.loadStockReport(n)),pagination:o.stockReportResult},null,8,["pagination"])])):h("",!0)])):h("",!0)])])])])}const tt=C(F,[["render",Je]]);export{tt as default}; diff --git a/public/build/assets/ns-new-password-DlPed_gF.js b/public/build/assets/ns-new-password-218c1f96.js similarity index 89% rename from public/build/assets/ns-new-password-DlPed_gF.js rename to public/build/assets/ns-new-password-218c1f96.js index 39a57bf05..8896681ed 100644 --- a/public/build/assets/ns-new-password-DlPed_gF.js +++ b/public/build/assets/ns-new-password-218c1f96.js @@ -1 +1 @@ -import{_ as o}from"./currency-lOMYG1Wf.js";import{F as v,G as k,a as r,n as h,b as a}from"./bootstrap-CnLEEQCx.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as l,o as e,c as d,a as i,F,b as x,g as p,e as c,f as _,w as S,t as N}from"./runtime-core.esm-bundler-RT2b-_3S.js";const T={name:"ns-login",props:["token","user"],data(){return{fields:[],xXsrfToken:null,validation:new v,isSubitting:!1}},mounted(){k([r.get("/api/fields/ns.new-password"),r.get("/sanctum/csrf-cookie")]).subscribe(t=>{this.fields=this.validation.createFields(t[0]),this.xXsrfToken=r.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>h.doAction("ns-login-mounted",this),100)},t=>{a.error(t.message||o("An unexpected error occurred."),o("OK"),{duration:0}).subscribe()})},methods:{__:o,submitNewPassword(){if(!this.validation.validateFields(this.fields))return a.error(o("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),h.applyFilters("ns-new-password-submit",!0)&&(this.isSubitting=!0,r.post(`/auth/new-password/${this.user}/${this.token}`,this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe(s=>{a.success(s.message).subscribe(),setTimeout(()=>{document.location=s.data.redirectTo},500)},s=>{this.isSubitting=!1,this.validation.enableFields(this.fields),s.data&&this.validation.triggerFieldsErrors(this.fields,s.data),a.error(s.message).subscribe()}))}}},V={class:"bg-white rounded shadow overflow-hidden transition-all duration-100"},X={class:"p-3 -my-2"},B={key:0,class:"py-2 fade-in-entrance anim-duration-300"},C={key:0,class:"flex items-center justify-center py-10"},E={class:"flex justify-between items-center bg-gray-200 p-3"},P=i("div",null,null,-1);function j(t,s,K,O,n,u){const b=l("ns-field"),f=l("ns-spinner"),g=l("ns-button");return e(),d("div",V,[i("div",X,[n.fields.length>0?(e(),d("div",B,[(e(!0),d(F,null,x(n.fields,(m,w)=>(e(),p(b,{key:w,field:m},null,8,["field"]))),128))])):c("",!0)]),n.fields.length===0?(e(),d("div",C,[_(f,{border:"4",size:"16"})])):c("",!0),i("div",E,[i("div",null,[_(g,{onClick:s[0]||(s[0]=m=>u.submitNewPassword()),class:"justify-between",type:"info"},{default:S(()=>[n.isSubitting?(e(),p(f,{key:0,class:"mr-2",size:"6",border:"2"})):c("",!0),i("span",null,N(u.__("Save Password")),1)]),_:1})]),P])])}const D=y(T,[["render",j]]);export{D as default}; +import{_ as o}from"./currency-f8bd78d1.js";import{F as v,G as k,a as r,n as h,b as a}from"./bootstrap-8be442b1.js";import{_ as y}from"./_plugin-vue_export-helper-c27b6911.js";import{r as l,o as e,c as d,a as i,F,b as x,g as p,e as c,f as _,w as S,t as N}from"./runtime-core.esm-bundler-b48de70a.js";const T={name:"ns-login",props:["token","user"],data(){return{fields:[],xXsrfToken:null,validation:new v,isSubitting:!1}},mounted(){k([r.get("/api/fields/ns.new-password"),r.get("/sanctum/csrf-cookie")]).subscribe(t=>{this.fields=this.validation.createFields(t[0]),this.xXsrfToken=r.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>h.doAction("ns-login-mounted",this),100)},t=>{a.error(t.message||o("An unexpected error occurred."),o("OK"),{duration:0}).subscribe()})},methods:{__:o,submitNewPassword(){if(!this.validation.validateFields(this.fields))return a.error(o("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),h.applyFilters("ns-new-password-submit",!0)&&(this.isSubitting=!0,r.post(`/auth/new-password/${this.user}/${this.token}`,this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe(s=>{a.success(s.message).subscribe(),setTimeout(()=>{document.location=s.data.redirectTo},500)},s=>{this.isSubitting=!1,this.validation.enableFields(this.fields),s.data&&this.validation.triggerFieldsErrors(this.fields,s.data),a.error(s.message).subscribe()}))}}},V={class:"bg-white rounded shadow overflow-hidden transition-all duration-100"},X={class:"p-3 -my-2"},B={key:0,class:"py-2 fade-in-entrance anim-duration-300"},C={key:0,class:"flex items-center justify-center py-10"},E={class:"flex justify-between items-center bg-gray-200 p-3"},P=i("div",null,null,-1);function j(t,s,K,O,n,u){const b=l("ns-field"),f=l("ns-spinner"),g=l("ns-button");return e(),d("div",V,[i("div",X,[n.fields.length>0?(e(),d("div",B,[(e(!0),d(F,null,x(n.fields,(m,w)=>(e(),p(b,{key:w,field:m},null,8,["field"]))),128))])):c("",!0)]),n.fields.length===0?(e(),d("div",C,[_(f,{border:"4",size:"16"})])):c("",!0),i("div",E,[i("div",null,[_(g,{onClick:s[0]||(s[0]=m=>u.submitNewPassword()),class:"justify-between",type:"info"},{default:S(()=>[n.isSubitting?(e(),p(f,{key:0,class:"mr-2",size:"6",border:"2"})):c("",!0),i("span",null,N(u.__("Save Password")),1)]),_:1})]),P])])}const D=y(T,[["render",j]]);export{D as default}; diff --git a/public/build/assets/ns-notifications-sHjb1c-h.js b/public/build/assets/ns-notifications-39f1777d.js similarity index 89% rename from public/build/assets/ns-notifications-sHjb1c-h.js rename to public/build/assets/ns-notifications-39f1777d.js index 7fb790688..68ea3a4b5 100644 --- a/public/build/assets/ns-notifications-sHjb1c-h.js +++ b/public/build/assets/ns-notifications-39f1777d.js @@ -1 +1 @@ -import{H as _,a as d,b}from"./bootstrap-CnLEEQCx.js";import{_ as f,d as p}from"./currency-lOMYG1Wf.js";import{n as v}from"./ns-prompt-popup-DKRiwYBT.js";import{h as x}from"./components-D4w1etK_.js";import{_ as g}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as k,o as c,c as r,a as e,t as a,e as u,n as y,F as w,b as C,f as N}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";const B={name:"ns-notifications",data(){return{notifications:[],visible:!1,interval:null}},components:{nsCloseButton:x},mounted(){document.addEventListener("click",this.checkClickedItem),this.interval=setInterval(()=>{this.loadNotifications()},15e3),this.loadNotifications()},unmounted(){clearInterval(this.interval)},methods:{__:f,timespan:_,nsNumberAbbreviate:p,pushNotificationIfNew(s){this.notifications.filter(i=>i.id===s.id).length>0||this.notifications.push(s)},deleteNotificationIfExists(s){const t=this.notifications.filter(i=>i.id===s.id);if(t.length>0){const i=this.notifications.indexOf(t[0]);this.notifications.splice(i,1)}},deleteAll(){Popup.show(v,{title:f("Confirm Your Action"),message:f("Would you like to clear all the notifications ?"),onAction:s=>{s&&d.delete("/api/notifications/all").subscribe(t=>{b.success(t.message).subscribe()})}})},checkClickedItem(s){let t;document.getElementById("notification-center")?t=document.getElementById("notification-center").contains(s.srcElement):t=!1;const i=document.getElementById("notification-button").contains(s.srcElement);!t&&!i&&this.visible&&(this.visible=!1)},loadNotifications(){d.get("/api/notifications").subscribe(s=>{this.notifications=s})},triggerLink(s){if(s.url!=="url")return window.open(s.url,"_blank")},closeNotice(s,t){d.delete(`/api/notifications/${t.id}`).subscribe(i=>{this.loadNotifications()}),s.stopPropagation()}}},I={id:"notificaton-wrapper"},E={key:0,class:"relative float-right"},j={class:"absolute -ml-6 -mt-8"},A={class:"bg-info-tertiary text-white w-8 h-8 rounded-full text-xs flex items-center justify-center"},L=e("i",{class:"las la-bell"},null,-1),P={key:0,class:"h-0 w-0",id:"notification-center"},V={class:"absolute left-0 top-0 sm:relative w-screen zoom-out-entrance anim-duration-300 h-5/7-screen sm:w-64 sm:h-108 flex flex-row-reverse"},z={class:"z-50 sm:rounded-lg shadow-lg h-full w-full md:mt-2 overflow-y-hidden flex flex-col"},F=e("h3",{class:"font-semibold hover:text-info-primary"},"Close",-1),H=[F],S={class:"overflow-y-auto flex flex-col flex-auto"},D=["onClick"],O={class:"flex items-center justify-between"},W={class:"font-semibold"},Y={class:"py-1 text-sm"},q={class:"flex justify-end"},G={class:"text-xs date"},J={key:0,class:"h-full w-full flex items-center justify-center"},K={class:"flex flex-col items-center"},M=e("i",{class:"las la-laugh-wink text-5xl text-primary"},null,-1),Q={class:"text-secondary text-sm"},R={class:"cursor-pointer clear-all"};function T(s,t,i,U,o,l){const h=k("ns-close-button");return c(),r("div",I,[e("div",{id:"notification-button",onClick:t[0]||(t[0]=n=>o.visible=!o.visible),class:y([o.visible?"panel-visible border-0 shadow-lg":"border panel-hidden","hover:shadow-lg hover:border-opacity-0 rounded-full h-12 w-12 cursor-pointer font-bold text-2xl justify-center items-center flex"])},[o.notifications.length>0?(c(),r("div",E,[e("div",j,[e("div",A,a(l.nsNumberAbbreviate(o.notifications.length,"abbreviate")),1)])])):u("",!0),L],2),o.visible?(c(),r("div",P,[e("div",V,[e("div",z,[e("div",{onClick:t[1]||(t[1]=n=>o.visible=!1),class:"sm:hidden p-2 cursor-pointer flex items-center justify-center border-b border-gray-200"},H),e("div",S,[(c(!0),r(w,null,C(o.notifications,n=>(c(),r("div",{key:n.id,class:"notification-card notice border-b"},[e("div",{class:"p-2 cursor-pointer",onClick:m=>l.triggerLink(n)},[e("div",O,[e("h1",W,a(n.title),1),N(h,{onClick:m=>l.closeNotice(m,n)},null,8,["onClick"])]),e("p",Y,a(n.description),1),e("div",q,[e("span",G,a(l.timespan(n.updated_at)),1)])],8,D)]))),128)),o.notifications.length===0?(c(),r("div",J,[e("div",K,[M,e("p",Q,a(l.__("Nothing to care about !")),1)])])):u("",!0)]),e("div",R,[e("h3",{onClick:t[2]||(t[2]=n=>l.deleteAll()),class:"text-sm p-2 flex items-center justify-center w-full font-semibold"},a(l.__("Clear All")),1)])])])])):u("",!0)])}const le=g(B,[["render",T]]);export{le as default}; +import{H as _,a as d,b}from"./bootstrap-8be442b1.js";import{_ as f,d as p}from"./currency-f8bd78d1.js";import{n as v}from"./ns-prompt-popup-100414c5.js";import{h as x}from"./components-ef1ba55f.js";import{_ as g}from"./_plugin-vue_export-helper-c27b6911.js";import{r as k,o as c,c as r,a as e,t as a,e as u,n as y,F as w,b as C,f as N}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";const B={name:"ns-notifications",data(){return{notifications:[],visible:!1,interval:null}},components:{nsCloseButton:x},mounted(){document.addEventListener("click",this.checkClickedItem),this.interval=setInterval(()=>{this.loadNotifications()},15e3),this.loadNotifications()},unmounted(){clearInterval(this.interval)},methods:{__:f,timespan:_,nsNumberAbbreviate:p,pushNotificationIfNew(s){this.notifications.filter(i=>i.id===s.id).length>0||this.notifications.push(s)},deleteNotificationIfExists(s){const t=this.notifications.filter(i=>i.id===s.id);if(t.length>0){const i=this.notifications.indexOf(t[0]);this.notifications.splice(i,1)}},deleteAll(){Popup.show(v,{title:f("Confirm Your Action"),message:f("Would you like to clear all the notifications ?"),onAction:s=>{s&&d.delete("/api/notifications/all").subscribe(t=>{b.success(t.message).subscribe()})}})},checkClickedItem(s){let t;document.getElementById("notification-center")?t=document.getElementById("notification-center").contains(s.srcElement):t=!1;const i=document.getElementById("notification-button").contains(s.srcElement);!t&&!i&&this.visible&&(this.visible=!1)},loadNotifications(){d.get("/api/notifications").subscribe(s=>{this.notifications=s})},triggerLink(s){if(s.url!=="url")return window.open(s.url,"_blank")},closeNotice(s,t){d.delete(`/api/notifications/${t.id}`).subscribe(i=>{this.loadNotifications()}),s.stopPropagation()}}},I={id:"notificaton-wrapper"},E={key:0,class:"relative float-right"},j={class:"absolute -ml-6 -mt-8"},A={class:"bg-info-tertiary text-white w-8 h-8 rounded-full text-xs flex items-center justify-center"},L=e("i",{class:"las la-bell"},null,-1),P={key:0,class:"h-0 w-0",id:"notification-center"},V={class:"absolute left-0 top-0 sm:relative w-screen zoom-out-entrance anim-duration-300 h-5/7-screen sm:w-64 sm:h-108 flex flex-row-reverse"},z={class:"z-50 sm:rounded-lg shadow-lg h-full w-full md:mt-2 overflow-y-hidden flex flex-col"},F=e("h3",{class:"font-semibold hover:text-info-primary"},"Close",-1),H=[F],S={class:"overflow-y-auto flex flex-col flex-auto"},D=["onClick"],O={class:"flex items-center justify-between"},W={class:"font-semibold"},Y={class:"py-1 text-sm"},q={class:"flex justify-end"},G={class:"text-xs date"},J={key:0,class:"h-full w-full flex items-center justify-center"},K={class:"flex flex-col items-center"},M=e("i",{class:"las la-laugh-wink text-5xl text-primary"},null,-1),Q={class:"text-secondary text-sm"},R={class:"cursor-pointer clear-all"};function T(s,t,i,U,o,l){const h=k("ns-close-button");return c(),r("div",I,[e("div",{id:"notification-button",onClick:t[0]||(t[0]=n=>o.visible=!o.visible),class:y([o.visible?"panel-visible border-0 shadow-lg":"border panel-hidden","hover:shadow-lg hover:border-opacity-0 rounded-full h-12 w-12 cursor-pointer font-bold text-2xl justify-center items-center flex"])},[o.notifications.length>0?(c(),r("div",E,[e("div",j,[e("div",A,a(l.nsNumberAbbreviate(o.notifications.length,"abbreviate")),1)])])):u("",!0),L],2),o.visible?(c(),r("div",P,[e("div",V,[e("div",z,[e("div",{onClick:t[1]||(t[1]=n=>o.visible=!1),class:"sm:hidden p-2 cursor-pointer flex items-center justify-center border-b border-gray-200"},H),e("div",S,[(c(!0),r(w,null,C(o.notifications,n=>(c(),r("div",{key:n.id,class:"notification-card notice border-b"},[e("div",{class:"p-2 cursor-pointer",onClick:m=>l.triggerLink(n)},[e("div",O,[e("h1",W,a(n.title),1),N(h,{onClick:m=>l.closeNotice(m,n)},null,8,["onClick"])]),e("p",Y,a(n.description),1),e("div",q,[e("span",G,a(l.timespan(n.updated_at)),1)])],8,D)]))),128)),o.notifications.length===0?(c(),r("div",J,[e("div",K,[M,e("p",Q,a(l.__("Nothing to care about !")),1)])])):u("",!0)]),e("div",R,[e("h3",{onClick:t[2]||(t[2]=n=>l.deleteAll()),class:"text-sm p-2 flex items-center justify-center w-full font-semibold"},a(l.__("Clear All")),1)])])])])):u("",!0)])}const le=g(B,[["render",T]]);export{le as default}; diff --git a/public/build/assets/ns-order-invoice-DoMLCmH7.js b/public/build/assets/ns-order-invoice-bf57ed55.js similarity index 97% rename from public/build/assets/ns-order-invoice-DoMLCmH7.js rename to public/build/assets/ns-order-invoice-bf57ed55.js index 1523dbfc3..1101116cf 100644 --- a/public/build/assets/ns-order-invoice-DoMLCmH7.js +++ b/public/build/assets/ns-order-invoice-bf57ed55.js @@ -1 +1 @@ -import{_ as h,n as u}from"./currency-lOMYG1Wf.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as m,o as n,c as l,a as t,f as b,w as f,t as e,e as a,F as _,b as c}from"./runtime-core.esm-bundler-RT2b-_3S.js";const p={props:["order","billing","shipping"],methods:{__:h,nsCurrency:u,printTable(){this.$htmlToPaper("invoice-container")}}},v={class:"shadow ns-box"},w={class:"head p-2 ns-box-title flex justify-between border-b"},g={class:"-mx-2 flex flex-wrap"},C={class:"px-2"},k=t("i",{class:"las la-print"},null,-1),j={class:"body flex flex-col px-2",id:"invoice-container"},D={id:"invoice-header",class:"flex -mx-2 flex-wrap"},S={class:"w-full print:w-1/3 md:w-1/3 px-2"},T={class:"p-2"},P={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},N={class:"details"},B={class:"my-1"},E={class:"flex justify-between text-secondary text-sm mb-1"},I={class:"font-semibold"},V={class:"flex justify-between text-secondary text-sm mb-1"},A={class:"font-semibold"},F={class:"flex justify-between text-secondary text-sm mb-1"},O={class:"font-semibold"},q={class:"flex justify-between text-secondary text-sm mb-1"},L={class:"font-semibold"},Q={class:"flex justify-between text-secondary text-sm mb-1"},U={class:"font-semibold"},z={class:"flex justify-between text-secondary text-sm mb-1"},G={class:"font-semibold"},H={key:0,class:"flex justify-between text-secondary text-sm mb-1"},J={class:"font-semibold"},K={class:"w-full print:w-1/3 md:w-1/3 px-2"},M={class:"p-2"},R={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},W={class:"details"},X={class:"my-1"},Y={class:"font-semibold"},Z={class:"w-full print:w-1/3 md:w-1/3 px-2"},$={class:"p-2"},tt={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},et={class:"details"},st={class:"my-1"},rt={class:"font-semibold"},dt={class:"table w-full my-4"},nt={class:"table ns-table w-full"},lt={class:"text-secondary"},at={width:"400",class:"p-2 border"},_t={width:"200",class:"p-2 border"},ct={width:"200",class:"p-2 border"},ot={width:"200",class:"p-2 border"},it={width:"200",class:"p-2 border"},xt={width:"200",class:"p-2 border"},ht={class:"p-2 border"},ut={class:"text-primary"},yt={class:"text-sm text-secondary"},mt={class:"p-2 border text-center text-primary"},bt={class:"p-2 border text-center text-primary"},ft={class:"p-2 border text-center text-primary"},pt={class:"p-2 border text-center text-primary"},vt={class:"p-2 border text-right text-primary"},wt={class:"font-semibold"},gt={class:"p-2 border text-center text-primary",colspan:"2"},Ct={key:0,class:"flex justify-between"},kt=t("td",{class:"p-2 border text-center text-primary",colspan:"2"},null,-1),jt={class:"p-2 border text-primary text-left"},Dt={class:"p-2 border text-right text-primary"},St={key:0},Tt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Pt={class:"p-2 border text-primary text-left"},Nt={class:"p-2 border text-right text-primary"},Bt={key:1},Et=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),It={class:"p-2 border text-left text-primary"},Vt={class:"p-2 border text-right text-primary"},At={key:2},Ft=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Ot={class:"p-2 border text-primary text-left"},qt={class:"p-2 border text-right text-primary"},Lt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Qt={class:"p-2 border text-primary text-left"},Ut={class:"p-2 border text-right text-primary"},zt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Gt={class:"p-2 border text-primary text-left"},Ht={class:"p-2 border text-right text-primary"},Jt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Kt={class:"p-2 border text-primary text-left"},Mt={class:"p-2 border text-right text-primary"},Rt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Wt={class:"p-2 border text-primary text-left"},Xt={class:"p-2 border text-right text-primary"},Yt={key:3,class:"error"},Zt=t("td",{class:"p-2 border text-center",colspan:"4"},null,-1),$t={class:"p-2 border text-left"},te={class:"p-2 border text-right"},ee={key:4},se=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),re={class:"p-2 border text-primary text-left"},de={class:"p-2 border text-right text-primary"};function ne(i,o,r,le,ae,s){const x=m("ns-button");return n(),l("div",v,[t("div",w,[t("div",g,[t("div",C,[b(x,{onClick:o[0]||(o[0]=d=>s.printTable()),type:"info"},{default:f(()=>[k,t("span",null,e(s.__("Print")),1)]),_:1})])])]),t("div",j,[t("div",D,[t("div",S,[t("div",T,[t("h3",P,e(s.__("Store Details")),1),t("div",N,[t("ul",B,[t("li",E,[t("span",I,e(s.__("Order Code")),1),t("span",null,e(r.order.code),1)]),t("li",V,[t("span",A,e(s.__("Cashier")),1),t("span",null,e(r.order.user.username),1)]),t("li",F,[t("span",O,e(s.__("Date")),1),t("span",null,e(r.order.created_at),1)]),t("li",q,[t("span",L,e(s.__("Customer")),1),t("span",null,e(r.order.customer.name),1)]),t("li",Q,[t("span",U,e(s.__("Type")),1),t("span",null,e(r.order.type),1)]),t("li",z,[t("span",G,e(s.__("Payment Status")),1),t("span",null,e(r.order.paymentStatus),1)]),r.order.type==="delivery"?(n(),l("li",H,[t("span",J,e(s.__("Delivery Status")),1),t("span",null,e(r.order.deliveryStatus),1)])):a("",!0)])])])]),t("div",K,[t("div",M,[t("h3",R,e(s.__("Billing Details")),1),t("div",W,[t("ul",X,[(n(!0),l(_,null,c(r.billing,d=>(n(),l("li",{key:d.id,class:"flex justify-between text-secondary text-sm mb-1"},[t("span",Y,e(d.label),1),t("span",null,e(r.order.billing_address[d.name]||"N/A"),1)]))),128))])])])]),t("div",Z,[t("div",$,[t("h3",tt,e(s.__("Shipping Details")),1),t("div",et,[t("ul",st,[(n(!0),l(_,null,c(r.shipping,d=>(n(),l("li",{key:d.id,class:"flex justify-between text-secondary text-sm mb-1"},[t("span",rt,e(d.label),1),t("span",null,e(r.order.shipping_address[d.name]||"N/A"),1)]))),128))])])])])]),t("div",dt,[t("table",nt,[t("thead",lt,[t("tr",null,[t("th",at,e(s.__("Product")),1),t("th",_t,e(s.__("Unit Price")),1),t("th",ct,e(s.__("Quantity")),1),t("th",ot,e(s.__("Discount")),1),t("th",it,e(s.__("Tax")),1),t("th",xt,e(s.__("Total Price")),1)])]),t("tbody",null,[(n(!0),l(_,null,c(r.order.products,d=>(n(),l("tr",{key:d.id},[t("td",ht,[t("h3",ut,e(d.name),1),t("span",yt,e(d.unit),1)]),t("td",mt,e(s.nsCurrency(d.unit_price)),1),t("td",bt,e(d.quantity),1),t("td",ft,e(s.nsCurrency(d.discount)),1),t("td",pt,e(s.nsCurrency(d.tax_value)),1),t("td",vt,e(s.nsCurrency(d.total_price)),1)]))),128))]),t("tfoot",wt,[t("tr",null,[t("td",gt,[["unpaid","partially_paid"].includes(r.order.payment_status)?(n(),l("div",Ct,[t("span",null,e(s.__("Expiration Date")),1),t("span",null,e(r.order.final_payment_date),1)])):a("",!0)]),kt,t("td",jt,e(s.__("Sub Total")),1),t("td",Dt,e(s.nsCurrency(r.order.subtotal)),1)]),r.order.discount>0?(n(),l("tr",St,[Tt,t("td",Pt,e(s.__("Discount")),1),t("td",Nt,e(s.nsCurrency(-r.order.discount)),1)])):a("",!0),r.order.total_coupons>0?(n(),l("tr",Bt,[Et,t("td",It,e(s.__("Coupons")),1),t("td",Vt,e(s.nsCurrency(-r.order.total_coupons)),1)])):a("",!0),r.order.shipping>0?(n(),l("tr",At,[Ft,t("td",Ot,e(s.__("Shipping")),1),t("td",qt,e(s.nsCurrency(r.order.shipping)),1)])):a("",!0),(n(!0),l(_,null,c(r.order.taxes,d=>(n(),l("tr",{key:d.id},[Lt,t("td",Qt,e(d.tax_name)+" — "+e(r.order.tax_type==="inclusive"?s.__("Inclusive"):s.__("Exclusive")),1),t("td",Ut,e(s.nsCurrency(r.order.tax_value)),1)]))),128)),(n(!0),l(_,null,c(r.order.taxes,d=>(n(),l("tr",{key:d.id},[zt,t("td",Gt,e(d.tax_name)+" — "+e(r.order.tax_type==="inclusive"?s.__("Inclusive"):s.__("Exclusive")),1),t("td",Ht,e(d.tax_value|i.currency),1)]))),128)),t("tr",null,[Jt,t("td",Kt,e(s.__("Total")),1),t("td",Mt,e(s.nsCurrency(r.order.total)),1)]),t("tr",null,[Rt,t("td",Wt,e(s.__("Paid")),1),t("td",Xt,e(s.nsCurrency(r.order.tendered)),1)]),["partially_paid","unpaid"].includes(r.order.payment_status)?(n(),l("tr",Yt,[Zt,t("td",$t,e(s.__("Due")),1),t("td",te,e(s.nsCurrency(r.order.change)),1)])):(n(),l("tr",ee,[se,t("td",re,e(s.__("Change")),1),t("td",de,e(s.nsCurrency(r.order.change)),1)]))])])])])])}const ie=y(p,[["render",ne]]);export{ie as default}; +import{_ as h,n as u}from"./currency-f8bd78d1.js";import{_ as y}from"./_plugin-vue_export-helper-c27b6911.js";import{r as m,o as n,c as l,a as t,f as b,w as f,t as e,e as a,F as _,b as c}from"./runtime-core.esm-bundler-b48de70a.js";const p={props:["order","billing","shipping"],methods:{__:h,nsCurrency:u,printTable(){this.$htmlToPaper("invoice-container")}}},v={class:"shadow ns-box"},w={class:"head p-2 ns-box-title flex justify-between border-b"},g={class:"-mx-2 flex flex-wrap"},C={class:"px-2"},k=t("i",{class:"las la-print"},null,-1),j={class:"body flex flex-col px-2",id:"invoice-container"},D={id:"invoice-header",class:"flex -mx-2 flex-wrap"},S={class:"w-full print:w-1/3 md:w-1/3 px-2"},T={class:"p-2"},P={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},N={class:"details"},B={class:"my-1"},E={class:"flex justify-between text-secondary text-sm mb-1"},I={class:"font-semibold"},V={class:"flex justify-between text-secondary text-sm mb-1"},A={class:"font-semibold"},F={class:"flex justify-between text-secondary text-sm mb-1"},O={class:"font-semibold"},q={class:"flex justify-between text-secondary text-sm mb-1"},L={class:"font-semibold"},Q={class:"flex justify-between text-secondary text-sm mb-1"},U={class:"font-semibold"},z={class:"flex justify-between text-secondary text-sm mb-1"},G={class:"font-semibold"},H={key:0,class:"flex justify-between text-secondary text-sm mb-1"},J={class:"font-semibold"},K={class:"w-full print:w-1/3 md:w-1/3 px-2"},M={class:"p-2"},R={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},W={class:"details"},X={class:"my-1"},Y={class:"font-semibold"},Z={class:"w-full print:w-1/3 md:w-1/3 px-2"},$={class:"p-2"},tt={class:"font-semibold text-xl text-primary border-b border-info-primary py-2"},et={class:"details"},st={class:"my-1"},rt={class:"font-semibold"},dt={class:"table w-full my-4"},nt={class:"table ns-table w-full"},lt={class:"text-secondary"},at={width:"400",class:"p-2 border"},_t={width:"200",class:"p-2 border"},ct={width:"200",class:"p-2 border"},ot={width:"200",class:"p-2 border"},it={width:"200",class:"p-2 border"},xt={width:"200",class:"p-2 border"},ht={class:"p-2 border"},ut={class:"text-primary"},yt={class:"text-sm text-secondary"},mt={class:"p-2 border text-center text-primary"},bt={class:"p-2 border text-center text-primary"},ft={class:"p-2 border text-center text-primary"},pt={class:"p-2 border text-center text-primary"},vt={class:"p-2 border text-right text-primary"},wt={class:"font-semibold"},gt={class:"p-2 border text-center text-primary",colspan:"2"},Ct={key:0,class:"flex justify-between"},kt=t("td",{class:"p-2 border text-center text-primary",colspan:"2"},null,-1),jt={class:"p-2 border text-primary text-left"},Dt={class:"p-2 border text-right text-primary"},St={key:0},Tt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Pt={class:"p-2 border text-primary text-left"},Nt={class:"p-2 border text-right text-primary"},Bt={key:1},Et=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),It={class:"p-2 border text-left text-primary"},Vt={class:"p-2 border text-right text-primary"},At={key:2},Ft=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Ot={class:"p-2 border text-primary text-left"},qt={class:"p-2 border text-right text-primary"},Lt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Qt={class:"p-2 border text-primary text-left"},Ut={class:"p-2 border text-right text-primary"},zt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Gt={class:"p-2 border text-primary text-left"},Ht={class:"p-2 border text-right text-primary"},Jt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Kt={class:"p-2 border text-primary text-left"},Mt={class:"p-2 border text-right text-primary"},Rt=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),Wt={class:"p-2 border text-primary text-left"},Xt={class:"p-2 border text-right text-primary"},Yt={key:3,class:"error"},Zt=t("td",{class:"p-2 border text-center",colspan:"4"},null,-1),$t={class:"p-2 border text-left"},te={class:"p-2 border text-right"},ee={key:4},se=t("td",{class:"p-2 border text-center text-primary",colspan:"4"},null,-1),re={class:"p-2 border text-primary text-left"},de={class:"p-2 border text-right text-primary"};function ne(i,o,r,le,ae,s){const x=m("ns-button");return n(),l("div",v,[t("div",w,[t("div",g,[t("div",C,[b(x,{onClick:o[0]||(o[0]=d=>s.printTable()),type:"info"},{default:f(()=>[k,t("span",null,e(s.__("Print")),1)]),_:1})])])]),t("div",j,[t("div",D,[t("div",S,[t("div",T,[t("h3",P,e(s.__("Store Details")),1),t("div",N,[t("ul",B,[t("li",E,[t("span",I,e(s.__("Order Code")),1),t("span",null,e(r.order.code),1)]),t("li",V,[t("span",A,e(s.__("Cashier")),1),t("span",null,e(r.order.user.username),1)]),t("li",F,[t("span",O,e(s.__("Date")),1),t("span",null,e(r.order.created_at),1)]),t("li",q,[t("span",L,e(s.__("Customer")),1),t("span",null,e(r.order.customer.name),1)]),t("li",Q,[t("span",U,e(s.__("Type")),1),t("span",null,e(r.order.type),1)]),t("li",z,[t("span",G,e(s.__("Payment Status")),1),t("span",null,e(r.order.paymentStatus),1)]),r.order.type==="delivery"?(n(),l("li",H,[t("span",J,e(s.__("Delivery Status")),1),t("span",null,e(r.order.deliveryStatus),1)])):a("",!0)])])])]),t("div",K,[t("div",M,[t("h3",R,e(s.__("Billing Details")),1),t("div",W,[t("ul",X,[(n(!0),l(_,null,c(r.billing,d=>(n(),l("li",{key:d.id,class:"flex justify-between text-secondary text-sm mb-1"},[t("span",Y,e(d.label),1),t("span",null,e(r.order.billing_address[d.name]||"N/A"),1)]))),128))])])])]),t("div",Z,[t("div",$,[t("h3",tt,e(s.__("Shipping Details")),1),t("div",et,[t("ul",st,[(n(!0),l(_,null,c(r.shipping,d=>(n(),l("li",{key:d.id,class:"flex justify-between text-secondary text-sm mb-1"},[t("span",rt,e(d.label),1),t("span",null,e(r.order.shipping_address[d.name]||"N/A"),1)]))),128))])])])])]),t("div",dt,[t("table",nt,[t("thead",lt,[t("tr",null,[t("th",at,e(s.__("Product")),1),t("th",_t,e(s.__("Unit Price")),1),t("th",ct,e(s.__("Quantity")),1),t("th",ot,e(s.__("Discount")),1),t("th",it,e(s.__("Tax")),1),t("th",xt,e(s.__("Total Price")),1)])]),t("tbody",null,[(n(!0),l(_,null,c(r.order.products,d=>(n(),l("tr",{key:d.id},[t("td",ht,[t("h3",ut,e(d.name),1),t("span",yt,e(d.unit),1)]),t("td",mt,e(s.nsCurrency(d.unit_price)),1),t("td",bt,e(d.quantity),1),t("td",ft,e(s.nsCurrency(d.discount)),1),t("td",pt,e(s.nsCurrency(d.tax_value)),1),t("td",vt,e(s.nsCurrency(d.total_price)),1)]))),128))]),t("tfoot",wt,[t("tr",null,[t("td",gt,[["unpaid","partially_paid"].includes(r.order.payment_status)?(n(),l("div",Ct,[t("span",null,e(s.__("Expiration Date")),1),t("span",null,e(r.order.final_payment_date),1)])):a("",!0)]),kt,t("td",jt,e(s.__("Sub Total")),1),t("td",Dt,e(s.nsCurrency(r.order.subtotal)),1)]),r.order.discount>0?(n(),l("tr",St,[Tt,t("td",Pt,e(s.__("Discount")),1),t("td",Nt,e(s.nsCurrency(-r.order.discount)),1)])):a("",!0),r.order.total_coupons>0?(n(),l("tr",Bt,[Et,t("td",It,e(s.__("Coupons")),1),t("td",Vt,e(s.nsCurrency(-r.order.total_coupons)),1)])):a("",!0),r.order.shipping>0?(n(),l("tr",At,[Ft,t("td",Ot,e(s.__("Shipping")),1),t("td",qt,e(s.nsCurrency(r.order.shipping)),1)])):a("",!0),(n(!0),l(_,null,c(r.order.taxes,d=>(n(),l("tr",{key:d.id},[Lt,t("td",Qt,e(d.tax_name)+" — "+e(r.order.tax_type==="inclusive"?s.__("Inclusive"):s.__("Exclusive")),1),t("td",Ut,e(s.nsCurrency(r.order.tax_value)),1)]))),128)),(n(!0),l(_,null,c(r.order.taxes,d=>(n(),l("tr",{key:d.id},[zt,t("td",Gt,e(d.tax_name)+" — "+e(r.order.tax_type==="inclusive"?s.__("Inclusive"):s.__("Exclusive")),1),t("td",Ht,e(d.tax_value|i.currency),1)]))),128)),t("tr",null,[Jt,t("td",Kt,e(s.__("Total")),1),t("td",Mt,e(s.nsCurrency(r.order.total)),1)]),t("tr",null,[Rt,t("td",Wt,e(s.__("Paid")),1),t("td",Xt,e(s.nsCurrency(r.order.tendered)),1)]),["partially_paid","unpaid"].includes(r.order.payment_status)?(n(),l("tr",Yt,[Zt,t("td",$t,e(s.__("Due")),1),t("td",te,e(s.nsCurrency(r.order.change)),1)])):(n(),l("tr",ee,[se,t("td",re,e(s.__("Change")),1),t("td",de,e(s.nsCurrency(r.order.change)),1)]))])])])])])}const ie=y(p,[["render",ne]]);export{ie as default}; diff --git a/public/build/assets/ns-orders-chart-Da1FNVnv.js b/public/build/assets/ns-orders-chart-56a999e9.js similarity index 94% rename from public/build/assets/ns-orders-chart-Da1FNVnv.js rename to public/build/assets/ns-orders-chart-56a999e9.js index e3c6d567d..7bf466c02 100644 --- a/public/build/assets/ns-orders-chart-Da1FNVnv.js +++ b/public/build/assets/ns-orders-chart-56a999e9.js @@ -1 +1 @@ -import{_ as i,n as d,a as h}from"./currency-lOMYG1Wf.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as _,o as f,c as u,a as s,t as a,f as p}from"./runtime-core.esm-bundler-RT2b-_3S.js";const m={name:"ns-orders-chart",data(){return{totalWeeklySales:0,totalWeekTaxes:0,totalWeekExpenses:0,totalWeekIncome:0,chartOptions:{theme:{mode:window.ns.theme},chart:{id:"vuechart-example",width:"100%",height:"100%"},stroke:{curve:"smooth",dashArray:[0,8]},xaxis:{categories:[]},colors:["#5f83f3","#AAA"]},series:[{name:i("Current Week"),data:[]},{name:i("Previous Week"),data:[]}],reportSubscription:null,report:null}},methods:{__:i,nsCurrency:d,nsRawCurrency:h},mounted(){this.reportSubscription=Dashboard.weeksSummary.subscribe(n=>{n.result!==void 0&&(this.chartOptions.xaxis.categories=n.result.map(t=>t.label),this.report=n,this.totalWeeklySales=0,this.totalWeekIncome=0,this.totalWeekExpenses=0,this.totalWeekTaxes=0,this.report.result.forEach((t,c)=>{if(t.current!==void 0){const r=t.current.entries.map(e=>e.day_paid_orders);let o=0;r.length>0&&(o=r.reduce((e,l)=>e+l)),this.totalWeekExpenses+=t.current.entries.map(e=>parseFloat(e.day_expenses)).reduce((e,l)=>e+l),this.totalWeekTaxes+=t.current.entries.map(e=>parseFloat(e.day_taxes)).reduce((e,l)=>e+l),this.totalWeekIncome+=t.current.entries.map(e=>parseFloat(e.day_income)).reduce((e,l)=>e+l),this.series[0].data.push(o)}else this.series[0].data.push(0);if(t.previous!==void 0){const r=t.previous.entries.map(e=>e.day_paid_orders);let o=0;r.length>0&&(o=r.reduce((e,l)=>e+l)),this.series[1].data.push(o)}else this.series[1].data.push(0)}),this.totalWeeklySales=this.series[0].data.reduce((t,c)=>t+c))})}},b={id:"ns-orders-chart",class:"flex flex-auto flex-col shadow ns-box rounded-lg overflow-hidden"},k={class:"p-2 flex ns-box-header items-center justify-between border-b"},y={class:"font-semibold"},v=s("div",{class:"head flex-auto flex h-56"},[s("div",{class:"w-full h-full pt-2"})],-1),w={class:"foot p-2 -mx-4 flex flex-wrap"},W={class:"flex w-full lg:w-full border-b lg:border-t lg:py-1 lg:my-1"},g={class:"px-4 w-1/2 lg:w-1/2 flex flex-col items-center justify-center"},C={class:"text-xs"},S={class:"text-lg xl:text-xl font-bold"},E={class:"px-4 w-1/2 lg:w-1/2 flex flex-col items-center justify-center"},j={class:"text-xs"},I={class:"text-lg xl:text-xl font-bold"},T={class:"flex w-full lg:w-full"},A={class:"px-4 w-full lg:w-1/2 flex flex-col items-center justify-center"},O={class:"text-xs"},B={class:"text-lg xl:text-xl font-bold"},F={class:"px-4 w-full lg:w-1/2 flex flex-col items-center justify-center"},N={class:"text-xs"},R={class:"text-lg xl:text-xl font-bold"};function D(n,t,c,r,o,e){const l=_("ns-close-button");return f(),u("div",b,[s("div",k,[s("h3",y,a(e.__("Recents Orders")),1),s("div",null,[p(l,{onClick:t[0]||(t[0]=V=>n.$emit("onRemove"))})])]),v,s("div",w,[s("div",W,[s("div",g,[s("span",C,a(e.__("Weekly Sales")),1),s("h2",S,a(e.nsCurrency(o.totalWeeklySales,"abbreviate")),1)]),s("div",E,[s("span",j,a(e.__("Week Taxes")),1),s("h2",I,a(e.nsCurrency(o.totalWeekTaxes,"abbreviate")),1)])]),s("div",T,[s("div",A,[s("span",O,a(e.__("Net Income")),1),s("h2",B,a(e.nsCurrency(o.totalWeekIncome,"abbreviate")),1)]),s("div",F,[s("span",N,a(e.__("Week Expenses")),1),s("h2",R,a(e.nsCurrency(o.totalWeekExpenses,"abbreviate")),1)])])])])}const G=x(m,[["render",D]]);export{G as default}; +import{_ as i,n as d,a as h}from"./currency-f8bd78d1.js";import{_ as x}from"./_plugin-vue_export-helper-c27b6911.js";import{r as _,o as f,c as u,a as s,t as a,f as p}from"./runtime-core.esm-bundler-b48de70a.js";const m={name:"ns-orders-chart",data(){return{totalWeeklySales:0,totalWeekTaxes:0,totalWeekExpenses:0,totalWeekIncome:0,chartOptions:{theme:{mode:window.ns.theme},chart:{id:"vuechart-example",width:"100%",height:"100%"},stroke:{curve:"smooth",dashArray:[0,8]},xaxis:{categories:[]},colors:["#5f83f3","#AAA"]},series:[{name:i("Current Week"),data:[]},{name:i("Previous Week"),data:[]}],reportSubscription:null,report:null}},methods:{__:i,nsCurrency:d,nsRawCurrency:h},mounted(){this.reportSubscription=Dashboard.weeksSummary.subscribe(n=>{n.result!==void 0&&(this.chartOptions.xaxis.categories=n.result.map(t=>t.label),this.report=n,this.totalWeeklySales=0,this.totalWeekIncome=0,this.totalWeekExpenses=0,this.totalWeekTaxes=0,this.report.result.forEach((t,c)=>{if(t.current!==void 0){const r=t.current.entries.map(e=>e.day_paid_orders);let o=0;r.length>0&&(o=r.reduce((e,l)=>e+l)),this.totalWeekExpenses+=t.current.entries.map(e=>parseFloat(e.day_expenses)).reduce((e,l)=>e+l),this.totalWeekTaxes+=t.current.entries.map(e=>parseFloat(e.day_taxes)).reduce((e,l)=>e+l),this.totalWeekIncome+=t.current.entries.map(e=>parseFloat(e.day_income)).reduce((e,l)=>e+l),this.series[0].data.push(o)}else this.series[0].data.push(0);if(t.previous!==void 0){const r=t.previous.entries.map(e=>e.day_paid_orders);let o=0;r.length>0&&(o=r.reduce((e,l)=>e+l)),this.series[1].data.push(o)}else this.series[1].data.push(0)}),this.totalWeeklySales=this.series[0].data.reduce((t,c)=>t+c))})}},b={id:"ns-orders-chart",class:"flex flex-auto flex-col shadow ns-box rounded-lg overflow-hidden"},k={class:"p-2 flex ns-box-header items-center justify-between border-b"},y={class:"font-semibold"},v=s("div",{class:"head flex-auto flex h-56"},[s("div",{class:"w-full h-full pt-2"})],-1),w={class:"foot p-2 -mx-4 flex flex-wrap"},W={class:"flex w-full lg:w-full border-b lg:border-t lg:py-1 lg:my-1"},g={class:"px-4 w-1/2 lg:w-1/2 flex flex-col items-center justify-center"},C={class:"text-xs"},S={class:"text-lg xl:text-xl font-bold"},E={class:"px-4 w-1/2 lg:w-1/2 flex flex-col items-center justify-center"},j={class:"text-xs"},I={class:"text-lg xl:text-xl font-bold"},T={class:"flex w-full lg:w-full"},A={class:"px-4 w-full lg:w-1/2 flex flex-col items-center justify-center"},O={class:"text-xs"},B={class:"text-lg xl:text-xl font-bold"},F={class:"px-4 w-full lg:w-1/2 flex flex-col items-center justify-center"},N={class:"text-xs"},R={class:"text-lg xl:text-xl font-bold"};function D(n,t,c,r,o,e){const l=_("ns-close-button");return f(),u("div",b,[s("div",k,[s("h3",y,a(e.__("Recents Orders")),1),s("div",null,[p(l,{onClick:t[0]||(t[0]=V=>n.$emit("onRemove"))})])]),v,s("div",w,[s("div",W,[s("div",g,[s("span",C,a(e.__("Weekly Sales")),1),s("h2",S,a(e.nsCurrency(o.totalWeeklySales,"abbreviate")),1)]),s("div",E,[s("span",j,a(e.__("Week Taxes")),1),s("h2",I,a(e.nsCurrency(o.totalWeekTaxes,"abbreviate")),1)])]),s("div",T,[s("div",A,[s("span",O,a(e.__("Net Income")),1),s("h2",B,a(e.nsCurrency(o.totalWeekIncome,"abbreviate")),1)]),s("div",F,[s("span",N,a(e.__("Week Expenses")),1),s("h2",R,a(e.nsCurrency(o.totalWeekExpenses,"abbreviate")),1)])])])])}const G=x(m,[["render",D]]);export{G as default}; diff --git a/public/build/assets/ns-orders-preview-popup-DkNvPnrF.js b/public/build/assets/ns-orders-preview-popup-5ba94079.js similarity index 99% rename from public/build/assets/ns-orders-preview-popup-DkNvPnrF.js rename to public/build/assets/ns-orders-preview-popup-5ba94079.js index 2e8c614cc..af246ba96 100644 --- a/public/build/assets/ns-orders-preview-popup-DkNvPnrF.js +++ b/public/build/assets/ns-orders-preview-popup-5ba94079.js @@ -1 +1 @@ -var M=Object.defineProperty;var H=(r,s,n)=>s in r?M(r,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[s]=n;var U=(r,s,n)=>(H(r,typeof s!="symbol"?s+"":s,n),n);import{F as R,g as I,b as p,a as v,p as q,P as A,i as Y,v as L,G as z}from"./bootstrap-CnLEEQCx.js";import{_ as u,n as V}from"./currency-lOMYG1Wf.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as h,o as d,c as a,a as e,t as i,f as y,F as x,b as w,g as k,e as m,w as P,i as j,B as T,n as G}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{a as $,n as O,b as J,i as K,d as X}from"./ns-prompt-popup-DKRiwYBT.js";import"./index.es-Br67aBEV.js";const Z={props:["popup"],mounted(){this.popuCloser(),this.loadFields(),this.product=this.popup.params.product},data(){return{formValidation:new R,fields:[],product:null}},methods:{__:u,popuCloser:I,close(){this.popup.params.reject(!1),this.popup.close()},addProduct(){if(this.formValidation.validateFields(this.fields),this.formValidation.fieldsValid(this.fields)){const r=this.formValidation.extractFields(this.fields),s={...this.product,...r};return this.popup.params.resolve(s),this.close()}p.error(u("The form is not valid.")).subscribe()},loadFields(){v.get("/api/fields/ns.refund-product").subscribe(r=>{this.fields=this.formValidation.createFields(r),this.fields.forEach(s=>{s.value=this.product[s.name]||""})})}}},ee={class:"shadow-xl ns-box w-95vw md:w-3/5-screen lg:w-3/7-screen h-95vh md:h-3/5-screen lg:h-3/7-screen overflow-hidden flex flex-col"},se={class:"p-2 flex justify-between border-b ns-box-header items-center"},te={class:"text-semibold"},re={class:"flex-auto overflow-y-auto relative ns-scrollbar"},ne={class:"p-2"},ie={key:0,class:"h-full w-full flex items-center justify-center"},oe={class:"p-2 flex justify-between items-center border-t ns-box-body"},le=e("div",null,null,-1);function de(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-field"),c=h("ns-spinner"),g=h("ns-button");return d(),a("div",ee,[e("div",se,[e("h3",te,i(t.__("Products")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=f=>t.close())})])]),e("div",re,[e("div",ne,[(d(!0),a(x,null,w(o.fields,(f,C)=>(d(),k(l,{key:C,field:f},null,8,["field"]))),128))]),o.fields.length===0?(d(),a("div",ie,[y(c)])):m("",!0)]),e("div",oe,[le,e("div",null,[y(g,{onClick:s[1]||(s[1]=f=>t.addProduct()),type:"info"},{default:P(()=>[j(i(t.__("Add Product")),1)]),_:1})])])])}const B=F(Z,[["render",de]]),ae={components:{nsNumpad:$},props:["popup"],data(){return{product:null,seeValue:0,availableQuantity:0}},mounted(){this.product=this.popup.params.product,this.availableQuantity=this.popup.params.availableQuantity,this.seeValue=this.product.quantity},methods:{__:u,popupResolver:q,close(){this.popup.params.reject(!1),this.popup.close()},setChangedValue(r){this.seeValue=r},updateQuantity(r){if(r>this.availableQuantity)return p.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(r),this.popup.params.resolve(this.product),this.popup.close()}}},ce={class:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},ue={class:"p-2 flex justify-between ns-box-header"},_e={class:"font-semibold"},me={key:0,class:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},pe={class:"text-primary text-sm"},fe={key:1,class:"flex-auto overflow-y-auto p-2"};function he(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-numpad");return d(),a("div",ce,[e("div",ue,[e("h3",_e,i(t.__("Quantity")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=c=>t.close())})])]),o.product?(d(),a("div",me,[e("span",null,i(o.seeValue),1),e("span",pe,"("+i(o.availableQuantity)+" "+i(t.__("available"))+")",1)])):m("",!0),o.product?(d(),a("div",fe,[y(l,{value:o.product.quantity,onNext:s[1]||(s[1]=c=>t.updateQuantity(c)),onChanged:s[2]||(s[2]=c=>t.setChangedValue(c))},null,8,["value"])])):m("",!0)])}const be=F(ae,[["render",he]]);class D{constructor({urls:s,options:n}){U(this,"urls");U(this,"options");U(this,"printingURL",{refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"});this.urls=s,this.options=n}processRegularPrinting(s,n){const _=document.querySelector("#printing-section");_&&_.remove();const o=this.urls[this.printingURL[n]].replace("{reference_id}",s),t=document.createElement("iframe");t.id="printing-section",t.className="hidden",t.src=o,document.body.appendChild(t),setTimeout(()=>{document.querySelector("#printing-section").remove()},5e3)}process(s,n,_="aloud"){switch(this.options.ns_pos_printing_gateway){case"default":this.processRegularPrinting(s,n);break;default:this.processCustomPrinting(s,this.options.ns_pos_printing_gateway,n,_);break}}processCustomPrinting(s,n,_,o="aloud"){const t={printed:!1,reference_id:s,gateway:n,document:_,mode:o};nsHooks.applyFilters("ns-custom-print",{params:t,promise:()=>new Promise((l,c)=>{c({status:"error",message:__("The selected print gateway doesn't support this type of printing.","NsPrintAdapter")})})}).promise().then(l=>{nsSnackBar.success(l.message).subscribe()}).catch(l=>{nsSnackBar.error(l.message||__("An error unexpected occured while printing.")).subscribe()})}}const ye={components:{nsNumpad:$},props:["order"],computed:{total(){return this.refundables.length>0?this.refundables.map(r=>parseFloat(r.unit_price)*parseFloat(r.quantity)).reduce((r,s)=>r+s)+this.shippingFees:0+this.shippingFees},shippingFees(){return this.refundShipping?this.order.shipping:0}},data(){return{isSubmitting:!1,formValidation:new R,refundables:[],paymentOptions:[],paymentField:[],print:new D({urls:systemUrls,options:systemOptions}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map(r=>({label:`${r.name} - ${r.unit.name} (x${r.quantity})`,value:r.id})),validation:"required",name:"product_id",label:u("Product"),description:u("Select the product to perform a refund.")}]}},methods:{__:u,nsCurrency:V,updateScreen(r){this.screen=r},toggleRefundShipping(r){this.refundShipping=r,this.refundShipping},proceedPayment(){if(this.selectedPaymentGateway===!1)return p.error(u("Please select a payment gateway before proceeding.")).subscribe();if(this.total===0)return p.error(u("There is nothing to refund.")).subscribe();if(this.screen===0)return p.error(u("Please provide a valid payment amount.")).subscribe();A.show(O,{title:u("Confirm Your Action"),message:u("The refund will be made on the current order."),onAction:r=>{r&&this.doProceed()}})},doProceed(){const r={products:this.refundables,total:this.screen,payment:{identifier:this.selectedPaymentGateway},refund_shipping:this.refundShipping};this.isSubmitting=!0,v.post(`/api/orders/${this.order.id}/refund`,r).subscribe({next:s=>{this.isSubmitting=!1,this.$emit("changed",!0),s.data.order.payment_status==="refunded"&&this.$emit("loadTab","details"),this.print.process(s.data.orderRefund.id,"refund"),p.success(s.message).subscribe()},error:s=>{this.isSubmitting=!1,p.error(s.message).subscribe()}})},addProduct(){if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return p.error(u("Please select a product before proceeding.")).subscribe();const r=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter(t=>t.id===r.product_id),n=this.refundables.filter(t=>t.id===r.product_id);if(n.length>0&&n.map(b=>parseInt(b.quantity)).reduce((b,l)=>b+l)===s[0].quantity)return p.error(u("Not enough quantity to proceed.")).subscribe();if(s[0].quantity===0)return p.error(u("Not enough quantity to proceed.")).subscribe();const _={...s[0],condition:"",description:""};new Promise((t,b)=>{A.show(B,{resolve:t,reject:b,product:_})}).then(t=>{t.quantity=this.getProductOriginalQuantity(t.id)-this.getProductUsedQuantity(t.id),this.refundables.push(t)},t=>t)},getProductOriginalQuantity(r){const s=this.order.products.filter(n=>n.id===r);return s.length>0?s.map(n=>parseFloat(n.quantity)).reduce((n,_)=>n+_):0},getProductUsedQuantity(r){const s=this.refundables.filter(n=>n.id===r);return s.length>0?s.map(_=>parseFloat(_.quantity)).reduce((_,o)=>_+o):0},openSettings(r){new Promise((n,_)=>{A.show(B,{resolve:n,reject:_,product:r})}).then(n=>{const _=this.refundables.indexOf(r);this.$set(this.refundables,_,n)},n=>n)},async selectPaymentGateway(){try{this.selectedPaymentGateway=await new Promise((r,s)=>{A.show(J,{resolve:r,reject:s,value:[this.selectedPaymentOption],...this.paymentField[0]})}),this.selectedPaymentGatewayLabel=this.paymentField[0].options.filter(r=>r.value===this.selectedPaymentGateway)[0].label}catch{p.error(u("An error has occured while seleting the payment gateway.")).subscribe()}},changeQuantity(r){new Promise((n,_)=>{const o=this.getProductOriginalQuantity(r.id)-this.getProductUsedQuantity(r.id)+parseFloat(r.quantity);A.show(be,{resolve:n,reject:_,product:r,availableQuantity:o})}).then(n=>{if(n.quantity>this.getProductUsedQuantity(r.id)-r.quantity){const _=this.refundables.indexOf(r);this.$set(this.refundables,_,n)}})},deleteProduct(r){new Promise((s,n)=>{A.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this product ?"),onAction:_=>{if(_){const o=this.refundables.indexOf(r);this.refundables.splice(o,1)}}})})}},mounted(){this.selectFields=this.formValidation.createFields(this.selectFields),v.get("/api/orders/payments").subscribe(r=>{this.paymentField=r})}},ve={class:"-m-4 flex-auto flex flex-wrap relative"},xe={key:0,class:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},we={class:"px-4 w-full lg:w-1/2"},ge={class:"py-2 border-b-2 text-primary border-info-primary"},ke={class:"my-2"},Pe={class:"border-b border-info-primary flex justify-between items-center mb-2"},Ce={class:"flex-auto flex-col flex"},Se={class:"p-2 flex"},je={class:"flex justify-between p-2"},Oe={class:"flex items-center text-primary"},Ae={key:0,class:"mr-2"},Fe={class:"py-1 border-b-2 text-primary border-info-primary"},Ve={class:"px-2 text-primary flex justify-between flex-auto"},De={class:"flex flex-col"},Ue={class:"py-2"},Te={key:0,class:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},Re={key:1,class:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},Ie={class:"flex items-center justify-center"},qe={class:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},Qe={class:"flex"},$e=["onClick"],Ne=e("i",{class:"las la-cog text-xl"},null,-1),Ye=[Ne],Le=["onClick"],Be=e("i",{class:"las la-trash"},null,-1),Ge=[Be],Ee=["onClick"],We={class:"px-4 w-full lg:w-1/2"},Me={class:"py-2 border-b-2 text-primary border-info-primary"},He={class:"py-2"},ze={class:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},Je={class:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},Ke={class:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"};function Xe(r,s,n,_,o,t){const b=h("ns-spinner"),l=h("ns-field"),c=h("ns-checkbox"),g=h("ns-numpad-plus");return d(),a("div",ve,[o.isSubmitting?(d(),a("div",xe,[y(b)])):m("",!0),e("div",we,[e("h3",ge,i(t.__("Refund With Products")),1),e("div",ke,[e("ul",null,[e("li",Pe,[e("div",Ce,[e("div",Se,[(d(!0),a(x,null,w(o.selectFields,(f,C)=>(d(),k(l,{field:f,key:C},null,8,["field"]))),128))]),e("div",je,[e("div",Oe,[n.order.shipping>0?(d(),a("span",Ae,i(t.__("Refund Shipping")),1)):m("",!0),n.order.shipping>0?(d(),k(c,{key:1,onChange:s[0]||(s[0]=f=>t.toggleRefundShipping(f)),checked:o.refundShipping},null,8,["checked"])):m("",!0)]),e("div",null,[e("button",{onClick:s[1]||(s[1]=f=>t.addProduct()),class:"border rounded-full px-2 py-1 ns-inset-button info"},i(t.__("Add Product")),1)])])])]),e("li",null,[e("h4",Fe,i(t.__("Products")),1)]),(d(!0),a(x,null,w(o.refundables,f=>(d(),a("li",{key:f.id,class:"elevation-surface border flex justify-between items-center mb-2"},[e("div",Ve,[e("div",De,[e("p",Ue,[e("span",null,i(f.name),1),f.condition==="damaged"?(d(),a("span",Te,i(t.__("Damaged")),1)):m("",!0),f.condition==="unspoiled"?(d(),a("span",Re,i(t.__("Unspoiled")),1)):m("",!0)]),e("small",null,i(f.unit.name),1)]),e("div",Ie,[e("span",qe,i(t.nsCurrency(f.unit_price*f.quantity)),1)])]),e("div",Qe,[e("p",{onClick:C=>t.openSettings(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},Ye,8,$e),e("p",{onClick:C=>t.deleteProduct(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},Ge,8,Le),e("p",{onClick:C=>t.changeQuantity(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},i(f.quantity),9,Ee)])]))),128))])])]),e("div",We,[e("h3",Me,i(t.__("Summary")),1),e("div",He,[e("div",ze,[e("span",null,i(t.__("Total")),1),e("span",null,i(t.nsCurrency(t.total)),1)]),e("div",Je,[e("span",null,i(t.__("Paid")),1),e("span",null,i(t.nsCurrency(n.order.tendered)),1)]),e("div",{onClick:s[2]||(s[2]=f=>t.selectPaymentGateway()),class:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer"},[e("span",null,i(t.__("Payment Gateway")),1),e("span",null,i(o.selectedPaymentGateway?r.selectedPaymentGatewayLabel:"N/A"),1)]),e("div",Ke,[e("span",null,i(t.__("Screen")),1),e("span",null,i(t.nsCurrency(o.screen)),1)]),e("div",null,[y(g,{currency:!0,onChanged:s[3]||(s[3]=f=>t.updateScreen(f)),value:o.screen,onNext:s[4]||(s[4]=f=>t.proceedPayment(f))},null,8,["value"])])])])])}const Ze=F(ye,[["render",Xe]]);class N{getTypeLabel(s){const n=typeLabels.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getDeliveryStatus(s){const n=deliveryStatuses.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getProcessingStatus(s){const n=processingStatuses.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getPaymentStatus(s){const n=paymentLabels.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}}const es={props:["order"],data(){return{labels:new N,validation:new R,inputValue:0,print:new D({urls:systemUrls,options:systemOptions}),fields:[],paymentTypes}},computed:{paymentsLabels(){const r=new Object;return this.paymentTypes.forEach(s=>{r[s.value]=s.label}),r}},methods:{__:u,nsCurrency:V,updateValue(r){this.inputValue=r},loadPaymentFields(){v.get("/api/orders/payments").subscribe(r=>{this.fields=this.validation.createFields(r)})},printPaymentReceipt(r){this.print.process(r.id,"payment")},submitPayment(r){if(this.validation.validateFields(this.fields),!this.validation.fieldsValid(this.fields))return p.error(u("Unable to proceed the form is not valid")).subscribe();if(parseFloat(r)==0)return p.error(u("Please provide a valid value")).subscribe();r=parseFloat(r);const s={...this.validation.extractFields(this.fields),value:r};Popup.show(O,{title:u("Confirm Your Action"),message:u("You make a payment for {amount}. A payment can't be canceled. Would you like to proceed ?").replace("{amount}",V(r)),onAction:n=>{n&&v.post(`/api/orders/${this.order.id}/payments`,s).subscribe(_=>{p.success(_.message).subscribe(),this.$emit("changed")},_=>{p.error(_.message).subscribe()})}})}},components:{nsNumpad:$},mounted(){this.loadPaymentFields()}},ss={class:""},ts={class:"flex -mx-4 flex-wrap"},rs={class:"px-2 w-full md:w-1/2"},is={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface info border text-xl font-bold"},os={class:"px-2 w-full md:w-1/2"},ls={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface success border text-xl font-bold"},ds={class:"px-2 w-full md:w-1/2"},as={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface error border text-xl font-bold"},cs={key:0},us={key:1},_s={class:"px-2 w-full md:w-1/2"},ms={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},ps={class:"flex -mx-4 flex-wrap"},fs={class:"px-2 w-full mb-4 md:w-1/2"},hs={key:0},bs={class:"font-semibold border-b-2 border-info-primary py-2"},ys={class:"py-2"},vs={class:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},xs={key:1,class:"flex items-center justify-center h-full"},ws={class:"text-primary font-semibold"},gs={class:"px-2 w-full mb-4 md:w-1/2"},ks={class:"font-semibold border-b-2 border-info-primary py-2 mb-2"},Ps={class:"flex items-center"},Cs=["onClick"],Ss=e("i",{class:"las la-print"},null,-1),js=[Ss];function Os(r,s,n,_,o,t){const b=h("ns-field"),l=h("ns-numpad-plus");return d(),a("div",ss,[e("div",ts,[e("div",rs,[e("div",is,[e("span",null,i(t.__("Total")),1),e("span",null,i(t.nsCurrency(n.order.total)),1)])]),e("div",os,[e("div",ls,[e("span",null,i(t.__("Paid")),1),e("span",null,i(t.nsCurrency(n.order.tendered)),1)])]),e("div",ds,[e("div",as,[e("span",null,i(t.__("Unpaid")),1),n.order.total-n.order.tendered>0?(d(),a("span",cs,i(t.nsCurrency(n.order.total-n.order.tendered)),1)):m("",!0),n.order.total-n.order.tendered<=0?(d(),a("span",us,i(t.nsCurrency(0)),1)):m("",!0)])]),e("div",_s,[e("div",ms,[e("span",null,i(t.__("Customer Account")),1),e("span",null,i(t.nsCurrency(n.order.customer.account_amount)),1)])])]),e("div",ps,[e("div",fs,[n.order.payment_status!=="paid"?(d(),a("div",hs,[e("h3",bs,i(t.__("Payment")),1),e("div",ys,[(d(!0),a(x,null,w(o.fields,(c,g)=>(d(),k(b,{field:c,key:g},null,8,["field"]))),128)),e("div",vs,i(t.nsCurrency(o.inputValue)),1),y(l,{floating:!0,onNext:s[0]||(s[0]=c=>t.submitPayment(c)),onChanged:s[1]||(s[1]=c=>t.updateValue(c)),value:o.inputValue},null,8,["value"])])])):m("",!0),n.order.payment_status==="paid"?(d(),a("div",xs,[e("h3",ws,i(t.__("No payment possible for paid order.")),1)])):m("",!0)]),e("div",gs,[e("h3",ks,i(t.__("Payment History")),1),e("ul",null,[(d(!0),a(x,null,w(n.order.payments,c=>(d(),a("li",{key:c.id,class:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[e("span",Ps,[e("a",{href:"javascript:void(0)",onClick:g=>t.printPaymentReceipt(c),class:"m-1 rounded-full hover:bg-info-tertiary hover:text-white flex items-center justify-center h-8 w-8"},js,8,Cs),j(" "+i(t.paymentsLabels[c.identifier]||t.__("Unknown")),1)]),e("span",null,i(t.nsCurrency(c.value)),1)]))),128))])])])])}const As=F(es,[["render",Os]]),Fs={name:"ns-orders-refund-popup",props:["popup"],data(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,systemUrls,print:new D({urls:systemUrls,options:systemOptions})}},methods:{__:u,nsCurrency:V,popupCloser:I,popupResolver:q,toggleProductView(r){this.view="details",this.previewed=r},loadOrderRefunds(){nsHttpClient.get(`/api/orders/${this.order.id}/refunds`).subscribe(r=>{this.loaded=!0,this.refunds=r.refunds},r=>{p.error(r.message).subscribe()})},close(){this.popup.close()},printRefundReceipt(r){this.print.process(r.id,"refund")}},mounted(){this.order=this.popup.params.order,this.popupCloser(),this.loadOrderRefunds()}},Vs={class:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},Ds={class:"border-b p-2 flex items-center justify-between ns-box-header"},Us={class:"flex"},Ts={class:"overflow-auto flex-auto ns-box-body"},Rs={key:0,class:"flex h-full w-full items-center justify-center"},Is={key:1,class:"flex h-full w-full items-center flex-col justify-center"},qs=e("i",{class:"las la-laugh-wink text-5xl"},null,-1),Qs={class:"md:w-80 text-sm text-secondary text-center"},$s={class:"w-full md:flex-auto p-2"},Ns={class:"font-semibold mb-1"},Ys={class:"flex -mx-1 text-sm text-primary"},Ls={class:"px-1"},Bs={class:"px-1"},Gs=["onClick"],Es=e("i",{class:"las la-eye"},null,-1),Ws=[Es],Ms=["onClick"],Hs=e("i",{class:"las la-print"},null,-1),zs=[Hs],Js={class:"w-full md:flex-auto p-2"},Ks={class:"font-semibold mb-1"},Xs={class:"flex -mx-1 text-sm text-primary"},Zs={class:"px-1"},et={class:"px-1"},st={class:"px-1"};function tt(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-spinner");return d(),a("div",Vs,[e("div",Ds,[e("h3",null,i(t.__("Order Refunds")),1),e("div",Us,[o.view==="details"?(d(),a("div",{key:0,onClick:s[0]||(s[0]=c=>o.view="summary"),class:"flex items-center justify-center cursor-pointer rounded-full px-3 border ns-inset-button mr-1"},i(t.__("Go Back")),1)):m("",!0),y(b,{onClick:s[1]||(s[1]=c=>t.close())})])]),e("div",Ts,[o.view==="summary"?(d(),a(x,{key:0},[o.loaded?m("",!0):(d(),a("div",Rs,[y(l,{size:"24"})])),o.loaded&&o.refunds.length===0?(d(),a("div",Is,[qs,e("p",Qs,i(t.__("No refunds made so far. Good news right?")),1)])):m("",!0),o.loaded&&o.refunds.length>0?(d(!0),a(x,{key:2},w(o.refunds,c=>(d(),a("div",{class:"border-b border-box-edge flex flex-col md:flex-row",key:c.id},[e("div",$s,[e("h3",Ns,i(o.order.code),1),e("div",null,[e("ul",Ys,[e("li",Ls,i(t.__("Total"))+" : "+i(t.nsCurrency(c.total)),1),e("li",Bs,i(t.__("By"))+" : "+i(c.author.username),1)])])]),e("div",{onClick:g=>t.toggleProductView(c),class:"w-full md:w-16 cursor-pointer hover:bg-info-secondary hover:border-info-primary hover:text-white text-lg flex items-center justify-center border-box-edge md:border-l"},Ws,8,Gs),e("div",{onClick:g=>t.printRefundReceipt(c),class:"w-full md:w-16 cursor-pointer hover:bg-info-secondary hover:border-info-primary hover:text-white text-lg flex items-center justify-center border-box-edge md:border-l"},zs,8,Ms)]))),128)):m("",!0)],64)):m("",!0),o.view==="details"?(d(!0),a(x,{key:1},w(o.previewed.refunded_products,c=>(d(),a("div",{class:"border-b border-box-edge flex flex-col md:flex-row",key:c.id},[e("div",Js,[e("h3",Ks,i(c.product.name),1),e("div",null,[e("ul",Xs,[e("li",Zs,i(t.__("Condition"))+" : "+i(c.condition),1),e("li",et,i(t.__("Quantity"))+" : "+i(c.quantity),1),e("li",st,i(t.__("Total"))+" : "+i(t.nsCurrency(c.total_price)),1)])])])]))),128)):m("",!0)])])}const rt=F(Fs,[["render",tt]]),nt={props:["order"],data(){return{processingStatuses,deliveryStatuses,labels:new N,showProcessingSelect:!1,showDeliverySelect:!1,systemUrls}},mounted(){},methods:{__:u,nsCurrency:V,submitProcessingChange(){A.show(O,{title:u("Would you proceed ?"),message:u("The processing status of the order will be changed. Please confirm your action."),onAction:r=>{r&&v.post(`/api/orders/${this.order.id}/processing`,{process_status:this.order.process_status}).subscribe({next:s=>{this.showProcessingSelect=!1,p.success(s.message).subscribe()},error:s=>{p.error(s.message||u("Unexpected error occurred.")).subscribe()}})}})},openRefunds(){try{const r=new Promise((s,n)=>{const _=this.order;A.show(rt,{order:_,resolve:s,reject:n})})}catch{}},submitDeliveryStatus(){A.show(O,{title:u("Would you proceed ?"),message:u("The delivery status of the order will be changed. Please confirm your action."),onAction:r=>{r&&v.post(`/api/orders/${this.order.id}/delivery`,{delivery_status:this.order.delivery_status}).subscribe({next:s=>{this.showDeliverySelect=!1,p.success(s.message).subscribe()},error:s=>{p.error(s.message||u("Unexpected error occurred.")).subscribe()}})}})}}},it={class:"-mx-4 flex flex-wrap"},ot={class:"flex-auto"},lt={class:"w-full mb-2 flex-wrap flex"},dt={class:"w-full mb-2 px-4"},at={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},ct={class:"mb-2 w-full md:w-1/2 px-4"},ut={class:"elevation-surface border p-2 flex justify-between items-start"},_t={class:"text-semibold text-primary"},mt={class:"font-semibold text-secondary"},pt={class:"mb-2 w-full md:w-1/2 px-4"},ft={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},ht={class:"text-semibold"},bt={class:""},yt={key:0,class:"ml-1"},vt={key:1,class:"ml-1"},xt={class:"font-semibold text-primary"},wt={class:"mb-2 w-full md:w-1/2 px-4"},gt={class:"p-2 flex justify-between items-start elevation-surface border"},kt={class:"text-semibold text-primary"},Pt={class:"font-semibold text-secondary"},Ct={class:"mb-2 w-full md:w-1/2 px-4"},St={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},jt={class:"text-semibold"},Ot={class:"font-semibold text-primary"},At={class:"mb-2 w-full md:w-1/2 px-4"},Ft={class:"p-2 flex justify-between items-start border ns-notice success"},Vt={class:"text-semibold"},Dt={class:"font-semibold text-primary"},Ut={class:"mb-2 w-full md:w-1/2 px-4"},Tt={class:"p-2 flex justify-between items-start text-primary elevation-surface info border"},Rt={class:"text-semibold"},It={class:"font-semibold"},qt={class:"mb-2 w-full md:w-1/2 px-4"},Qt={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},$t={class:"text-semibold"},Nt={class:"font-semibold"},Yt={class:"mb-2 w-full md:w-1/2 px-4"},Lt={class:"p-2 flex justify-between items-start elevation-surface border"},Bt={class:"text-semibold"},Gt={class:"font-semibold"},Et={class:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},Wt={class:"mb-2"},Mt={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},Ht={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},zt={class:"text-semibold text-primary"},Jt={key:0,class:"font-semibold text-secondary"},Kt=["href"],Xt={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},Zt={class:"text-semibold text-primary"},er={class:"font-semibold text-secondary"},sr={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},tr={class:"text-semibold text-primary"},rr={class:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},nr={class:"w-full text-center"},ir={key:0,class:"flex-auto flex"},or={class:"ns-select flex items-center justify-center"},lr=["value"],dr={class:"pl-2 flex"},ar={class:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},cr={class:"text-semibold text-primary"},ur={class:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},_r={class:"w-full text-center"},mr={key:0,class:"flex-auto flex"},pr={class:"ns-select flex items-center justify-center"},fr=["value"],hr={class:"pl-2 flex"},br={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},yr={class:"text-semibold text-primary"},vr={class:"font-semibold text-secondary"},xr={class:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},wr={class:"mb-2"},gr={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},kr={class:"text-semibold text-primary"},Pr={class:"text-secondary text-sm"},Cr={class:"font-semibold text-secondary"},Sr={class:"mb-2"},jr={class:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},Or={class:"text-semibold text-primary"},Ar={class:"text-secondary text-sm"},Fr={class:"font-semibold text-secondary"};function Vr(r,s,n,_,o,t){const b=h("ns-close-button");return d(),a("div",it,[e("div",ot,[e("div",lt,[e("div",dt,[e("h3",at,i(t.__("Payment Summary")),1)]),e("div",ct,[e("div",ut,[e("div",null,[e("h4",_t,i(t.__("Sub Total")),1)]),e("div",mt,i(t.nsCurrency(n.order.subtotal)),1)])]),e("div",pt,[e("div",ft,[e("div",null,[e("h4",ht,[e("span",bt,i(t.__("Discount")),1),n.order.discount_type==="percentage"?(d(),a("span",yt,"("+i(n.order.discount_percentage)+"%)",1)):m("",!0),n.order.discount_type==="flat"?(d(),a("span",vt,"(Flat)")):m("",!0)])]),e("div",xt,i(t.nsCurrency(n.order.discount)),1)])]),e("div",wt,[e("div",gt,[e("div",null,[e("h4",kt,i(t.__("Shipping")),1)]),e("div",Pt,i(t.nsCurrency(n.order.shipping)),1)])]),e("div",Ct,[e("div",St,[e("div",null,[e("h4",jt,i(t.__("Coupons")),1)]),e("div",Ot,i(t.nsCurrency(n.order.total_coupons)),1)])]),e("div",At,[e("div",Ft,[e("div",null,[e("h4",Vt,i(t.__("Total")),1)]),e("div",Dt,i(t.nsCurrency(n.order.total)),1)])]),e("div",Ut,[e("div",Tt,[e("div",null,[e("h4",Rt,i(t.__("Taxes")),1)]),e("div",It,i(t.nsCurrency(n.order.tax_value)),1)])]),e("div",qt,[e("div",Qt,[e("div",null,[e("h4",$t,i(t.__("Change")),1)]),e("div",Nt,i(t.nsCurrency(n.order.change)),1)])]),e("div",Yt,[e("div",Lt,[e("div",null,[e("h4",Bt,i(t.__("Paid")),1)]),e("div",Gt,i(t.nsCurrency(n.order.tendered)),1)])])])]),e("div",Et,[e("div",Wt,[e("h3",Mt,i(t.__("Order Status")),1)]),e("div",Ht,[e("div",null,[e("h4",zt,[e("span",null,i(t.__("Customer")),1)])]),n.order?(d(),a("div",Jt,[e("a",{class:"border-b border-dashed border-info-primary",href:o.systemUrls.customer_edit_url.replace("#customer",n.order.customer.id),target:"_blank",rel:"noopener noreferrer"},i(n.order.customer.first_name)+" "+i(n.order.customer.last_name),9,Kt)])):m("",!0)]),e("div",Xt,[e("div",null,[e("h4",Zt,[e("span",null,i(t.__("Type")),1)])]),e("div",er,i(o.labels.getTypeLabel(n.order.type)),1)]),e("div",sr,[e("div",null,[e("h4",tr,[e("span",null,i(t.__("Delivery Status")),1)])]),e("div",rr,[e("div",nr,[o.showDeliverySelect?m("",!0):(d(),a("span",{key:0,onClick:s[0]||(s[0]=l=>o.showDeliverySelect=!0),class:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed"},i(o.labels.getDeliveryStatus(n.order.delivery_status)),1))]),o.showDeliverySelect?(d(),a("div",ir,[e("div",or,[T(e("select",{ref:"process_status",class:"flex-auto border-info-primary rounded-lg","onUpdate:modelValue":s[1]||(s[1]=l=>n.order.delivery_status=l)},[(d(!0),a(x,null,w(o.deliveryStatuses,(l,c)=>(d(),a("option",{key:c,value:l.value},i(l.label),9,lr))),128))],512),[[Y,n.order.delivery_status]])]),e("div",dr,[y(b,{onClick:s[2]||(s[2]=l=>o.showDeliverySelect=!1)}),e("button",{onClick:s[3]||(s[3]=l=>t.submitDeliveryStatus(n.order)),class:"bg-success-primary text-white rounded-full px-2 py-1"},i(t.__("Save")),1)])])):m("",!0)])]),e("div",ar,[e("div",null,[e("h4",cr,[e("span",null,i(t.__("Processing Status")),1)])]),e("div",ur,[e("div",_r,[o.showProcessingSelect?m("",!0):(d(),a("span",{key:0,onClick:s[4]||(s[4]=l=>o.showProcessingSelect=!0),class:"border-b border-info-primary cursor-pointer border-dashed"},i(o.labels.getProcessingStatus(n.order.process_status)),1))]),o.showProcessingSelect?(d(),a("div",mr,[e("div",pr,[T(e("select",{ref:"process_status",class:"flex-auto border-info-primary rounded-lg","onUpdate:modelValue":s[5]||(s[5]=l=>n.order.process_status=l)},[(d(!0),a(x,null,w(o.processingStatuses,(l,c)=>(d(),a("option",{key:c,value:l.value},i(l.label),9,fr))),128))],512),[[Y,n.order.process_status]])]),e("div",hr,[y(b,{onClick:s[6]||(s[6]=l=>o.showProcessingSelect=!1)}),e("button",{onClick:s[7]||(s[7]=l=>t.submitProcessingChange(n.order)),class:"bg-success-primary text-white rounded-full px-2 py-1"},i(t.__("Save")),1)])])):m("",!0)])]),e("div",br,[e("div",null,[e("h4",yr,[e("span",null,i(t.__("Payment Status")),1)])]),e("div",vr,i(o.labels.getPaymentStatus(n.order.payment_status)),1)])]),e("div",xr,[e("div",wr,[e("h3",gr,i(t.__("Products")),1)]),(d(!0),a(x,null,w(n.order.products,l=>(d(),a("div",{key:l.id,class:"p-2 flex justify-between items-start elevation-surface border mb-6"},[e("div",null,[e("h4",kr,i(l.name)+" (x"+i(l.quantity)+")",1),e("p",Pr,i(l.unit.name||"N/A"),1)]),e("div",Cr,i(t.nsCurrency(l.total_price)),1)]))),128)),e("div",Sr,[e("h3",jr,[e("span",null,i(t.__("Refunded Products")),1),e("a",{href:"javascript:void(0)",onClick:s[8]||(s[8]=l=>t.openRefunds()),class:"border-b border-info-primary border-dashed"},i(t.__("All Refunds")),1)])]),(d(!0),a(x,null,w(n.order.refunded_products,(l,c)=>(d(),a("div",{key:c,class:"p-2 flex justify-between items-start elevation-surface border mb-6"},[e("div",null,[e("h4",Or,i(l.order_product.name)+" (x"+i(l.quantity)+")",1),e("p",Ar,[j(i(l.unit.name||"N/A")+" | ",1),e("span",{class:G(["rounded-full px-2",l.condition==="damaged"?"bg-error-tertiary text-white":"bg-info-tertiary text-white"])},i(l.condition),3)])]),e("div",Fr,i(t.nsCurrency(l.total_price)),1)]))),128))])])}const Dr=F(nt,[["render",Vr]]),Ur={name:"ns-order-instalments-payment",props:["popup"],components:{nsNotice:K},data(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:u("Select the payment type that must apply to the current order."),label:u("Payment Type"),validation:"required",options:paymentTypes}],print:new D({urls:systemUrls,options:systemOptions}),validation:new R,order:null,instalment:null}},methods:{__:u,popupResolver:q,popupCloser:I,close(){this.popupResolver(!1)},updateInstalmentAsDue(r){nsHttpClient.put(`/api/orders/${this.order.id}/instalments/${this.instalment.id}/`,{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:s=>{this.submitPayment()},error:s=>{p.error(s.message||u("An unexpected error has occurred")).subscribe()}})},submitPayment(){if(!this.validation.validateFields(this.fields))return p.error(__m("The form is not valid.")).subcribe();nsHttpClient.post(`/api/orders/${this.order.id}/instalments/${this.instalment.id}/pay`,{...this.validation.extractFields(this.fields)}).subscribe({next:r=>{this.popupResolver(!0),this.print.exec(r.data.payment.id,"payment"),p.success(r.message).subscribe()},error:r=>{r.status==="error"&&Popup.show(O,{title:u("Update Instalment Date"),message:u("Would you like to mark that instalment as due today ? If you confirm the instalment will be marked as paid."),onAction:s=>{s&&this.updateInstalmentAsDue(this.instalment)}}),p.error(r.message||u("An unexpected error has occurred")).subscribe()}})}},mounted(){this.popupCloser(),this.order=this.popup.params.order,this.instalment=this.popup.params.instalment,this.fields=this.validation.createFields(this.fields)}},Tr={class:"shadow-lg ns-box w-95vw md:w-2/3-screen lg:w-1/3-screen"},Rr={class:"p-2 flex justify-between border-b items-center"},Ir={class:"p-2 ns-box-body"},qr=e("br",null,null,-1),Qr={class:"border-t ns-box-footer p-2 flex justify-end"};function $r(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-notice"),c=h("ns-field"),g=h("ns-button");return d(),a("div",Tr,[e("div",Rr,[e("h3",null,i(t.__("Payment Method")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=f=>t.close())})])]),e("div",Ir,[y(l,{color:"info",class:"py-2 p-4 text-center border text-primary rounded-lg"},{default:P(()=>[j(i(t.__("Before submitting the payment, choose the payment type used for that order.")),1)]),_:1}),qr,(d(!0),a(x,null,w(o.fields,(f,C)=>(d(),k(c,{key:C,field:f},null,8,["field"]))),128))]),e("div",Qr,[y(g,{onClick:s[1]||(s[1]=f=>t.submitPayment()),type:"info"},{default:P(()=>[j(i(t.__("Submit Payment")),1)]),_:1})])])}const Nr=F(Ur,[["render",$r]]),Yr={props:["order"],name:"ns-order-instalments",data(){return{labels:new N,original:[],instalments:[],print:new D({urls:systemUrls,options:systemOptions,type:"payment"})}},mounted(){this.loadInstalments()},computed:{totalInstalments(){return this.instalments.length>0?this.instalments.map(r=>r.amount).reduce((r,s)=>parseFloat(r)+parseFloat(s)):0}},methods:{__:u,nsCurrency:V,loadInstalments(){v.get(`/api/orders/${this.order.id}/instalments`).subscribe(r=>{this.original=r,this.instalments=r.map(s=>(s.price_clicked=!1,s.date_clicked=!1,s.date=moment(s.date).format("YYYY-MM-DD"),s))})},showReceipt(r){if(r.payment_id===null)return p.error(u("This instalment doesn't have any payment attached.")).subscribe();this.print.process(r.payment_id,"payment")},addInstalment(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to create this instalment ?"),onAction:s=>{s&&v.post(`/api/orders/${this.order.id}/instalments`,{instalment:r}).subscribe({next:n=>{this.loadInstalments(),p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},deleteInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this instalment ?"),onAction:s=>{s&&v.delete(`/api/orders/${this.order.id}/instalments/${r.id}`).subscribe({next:n=>{const _=this.instalments.indexOf(r);this.instalments.splice(_,1),p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},async markAsPaid(r){try{const s=await new Promise((n,_)=>{Popup.show(Nr,{order:this.order,instalment:r,resolve:n,reject:_})});this.loadInstalments()}catch{}},togglePriceEdition(r){r.paid||(r.price_clicked=!r.price_clicked,this.$forceUpdate(),r.price_clicked&&setTimeout(()=>{this.$refs.amount[0].select()},100))},updateInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to update that instalment ?"),onAction:s=>{s&&v.put(`/api/orders/${this.order.id}/instalments/${r.id}`,{instalment:r}).subscribe({next:n=>{p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},toggleDateEdition(r){r.paid||(r.date_clicked=!r.date_clicked,this.$forceUpdate(),r.date_clicked&&setTimeout(()=>{this.$refs.date[0].select()},200))}}},Lr={class:"-mx-4 flex-auto flex flex-wrap"},Br={class:"flex flex-auto"},Gr={class:"w-full mb-2 flex-wrap"},Er={class:"w-full mb-2 px-4"},Wr={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},Mr={class:"px-4"},Hr={class:"border-table-th-edge border-t text-primary"},zr={class:"p-2"},Jr=["onClick"],Kr={key:1},Xr=["onBlur","onUpdate:modelValue"],Zr={class:"flex items-center"},en={class:"flex items-center px-2 h-full border-r"},sn=["onClick"],tn={key:1},rn=["onUpdate:modelValue","onBlur"],nn={key:0,class:"w-36 justify-center flex items-center px-2 h-full border-r"},on={class:"px-2"},ln={class:"px-2"},dn={class:"px-2"},an={key:1,class:"w-36 justify-center flex items-center px-2 h-full border-r"},cn={class:"px-2"},un={class:"ns-button info"},_n=["onClick"],mn=e("i",{class:"las la-plus"},null,-1),pn={key:2,class:"w-36 justify-center flex items-center px-2 h-full"},fn={class:"ns-button info"},hn=["onClick"],bn=e("i",{class:"las la-print"},null,-1),yn={class:"flex justify-between p-2 border-r border-b border-l elevation-surface"},vn={class:"flex items-center justify-center"},xn={class:"ml-1 text-sm"},wn={class:"-mx-2 flex flex-wrap items-center"},gn={class:"px-2"},kn={class:"px-2"},Pn={class:"ns-button info"};function Cn(r,s,n,_,o,t){const b=h("ns-icon-button");return d(),a("div",Lr,[e("div",Br,[e("div",Gr,[e("div",Er,[e("h3",Wr,i(t.__("Instalments")),1)]),e("div",Mr,[e("ul",Hr,[(d(!0),a(x,null,w(o.instalments,l=>(d(),a("li",{class:G([l.paid?"success":"info","border-b border-l flex justify-between elevation-surface"]),key:l.id},[e("span",zr,[l.date_clicked?m("",!0):(d(),a("span",{key:0,onClick:c=>t.toggleDateEdition(l)},i(l.date),9,Jr)),l.date_clicked?(d(),a("span",Kr,[T(e("input",{onBlur:c=>t.toggleDateEdition(l),"onUpdate:modelValue":c=>l.date=c,type:"date",ref_for:!0,ref:"date",class:"border border-info-primary rounded"},null,40,Xr),[[L,l.date]])])):m("",!0)]),e("div",Zr,[e("div",en,[l.price_clicked?m("",!0):(d(),a("span",{key:0,onClick:c=>t.togglePriceEdition(l)},i(t.nsCurrency(l.amount)),9,sn)),l.price_clicked?(d(),a("span",tn,[T(e("input",{ref_for:!0,ref:"amount","onUpdate:modelValue":c=>l.amount=c,onBlur:c=>t.togglePriceEdition(l),type:"text",class:"border border-info-primary p-1"},null,40,rn),[[L,l.amount]])])):m("",!0)]),!l.paid&&l.id?(d(),a("div",nn,[e("div",on,[y(b,{type:"success",onClick:c=>t.markAsPaid(l),className:"la-money-bill-wave-alt"},null,8,["onClick"])]),e("div",ln,[y(b,{type:"info",onClick:c=>t.updateInstalment(l),className:"la-save"},null,8,["onClick"])]),e("div",dn,[y(b,{type:"error",onClick:c=>t.deleteInstalment(l),className:"la-trash-alt"},null,8,["onClick"])])])):m("",!0),!l.paid&&!l.id?(d(),a("div",an,[e("div",cn,[e("div",un,[e("button",{onClick:c=>t.createInstalment(l),class:"px-3 py-1 rounded-full"},[mn,j(" "+i(t.__("Create")),1)],8,_n)])])])):m("",!0),l.paid?(d(),a("div",pn,[e("div",fn,[e("button",{onClick:c=>t.showReceipt(l),class:"px-3 text-xs py-1 rounded-full"},[bn,j(" "+i(t.__("Receipt")),1)],8,hn)])])):m("",!0)])],2))),128)),e("li",yn,[e("div",vn,[e("span",null,i(t.__("Total :"))+" "+i(t.nsCurrency(n.order.total)),1),e("span",xn," ("+i(t.__("Remaining :"))+" "+i(t.nsCurrency(n.order.total-t.totalInstalments))+") ",1)]),e("div",wn,[e("span",gn,i(t.__("Instalments:"))+" "+i(t.nsCurrency(t.totalInstalments)),1),e("span",kn,[e("div",Pn,[e("button",{onClick:s[0]||(s[0]=l=>t.addInstalment()),class:"rounded-full px-3 py-1"},i(t.__("Add Instalment")),1)])])])])])])])])])}const Sn=F(Yr,[["render",Cn]]),jn={name:"ns-orders-preview-popup",props:["popup"],data(){return{active:"details",order:new Object,rawOrder:new Object,products:[],payments:[],options:null,print:new D({urls:systemUrls,options:systemOptions}),settings:null,orderDetailLoaded:!1}},components:{nsOrderRefund:Ze,nsOrderPayment:As,nsOrderDetails:Dr,nsOrderInstalments:Sn},computed:{isVoidable(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble(){return["hold"].includes(this.order.payment_status)}},methods:{__:u,popupResolver:q,popupCloser:I,nsCurrency:V,closePopup(r=!1){this.popupResolver(r)},setActive(r){this.active=r},printOrder(){this.print.process(this.order.id,"sale")},refresh(){this.loadOrderDetails(this.order.id)},loadOrderDetails(r){this.orderDetailLoaded=!1,z([v.get(`/api/orders/${r}`),v.get(`/api/orders/${r}/products`),v.get(`/api/orders/${r}/payments`)]).subscribe(s=>{this.orderDetailLoaded=!0,this.order=s[0],this.products=s[1],this.payments=s[2]})},deleteOrder(){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this order"),onAction:r=>{r&&v.delete(`/api/orders/${this.order.id}`).subscribe({next:s=>{p.success(s.message).subscribe(),this.refreshCrudTable(),this.closePopup(!0)},error:s=>{p.error(s.message).subscribe()}})}})},voidOrder(){try{const r=new Promise((s,n)=>{Popup.show(X,{resolve:s,reject:n,title:u("Confirm Your Action"),message:u("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:_=>{_!==!1&&v.post(`/api/orders/${this.order.id}/void`,{reason:_}).subscribe({next:o=>{p.success(o.message).subscribe(),this.refreshCrudTable(),this.closePopup(!0)},error:o=>{p.error(o.message).subscribe()}})}})})}catch(r){console.log(r)}},refreshCrudTable(){this.popup.params.component.$emit("updated",!0)}},watch:{active(){this.active==="details"&&this.loadOrderDetails(this.rawOrder.id)}},mounted(){this.rawOrder=this.popup.params.order,this.options=systemOptions,this.urls=systemUrls,this.loadOrderDetails(this.rawOrder.id),this.popupCloser()}},On={class:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},An={class:"border-b ns-box-header p-3 flex items-center justify-between"},Fn={class:"p-2 ns-box-body overflow-hidden flex flex-auto"},Vn={key:1,class:"h-full w-full flex items-center justify-center"},Dn={key:0,class:"p-2 flex justify-between border-t ns-box-footer"},Un=e("i",{class:"las la-ban"},null,-1),Tn=e("i",{class:"las la-trash"},null,-1),Rn=e("i",{class:"las la-print"},null,-1);function In(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-order-details"),c=h("ns-tabs-item"),g=h("ns-order-payment"),f=h("ns-order-refund"),C=h("ns-order-instalments"),E=h("ns-tabs"),W=h("ns-spinner"),Q=h("ns-button");return d(),a("div",On,[e("div",An,[e("div",null,[e("h3",null,i(t.__("Order Options")),1)]),e("div",null,[y(b,{onClick:s[0]||(s[0]=S=>t.closePopup(!0))})])]),e("div",Fn,[o.order.id?(d(),k(E,{key:0,active:o.active,onActive:s[5]||(s[5]=S=>t.setActive(S))},{default:P(()=>[y(c,{label:t.__("Details"),identifier:"details",class:"overflow-y-auto"},{default:P(()=>[o.order?(d(),k(l,{key:0,order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["label"]),y(c,{visible:!["order_void","hold","refunded","partially_refunded"].includes(o.order.payment_status),label:t.__("Payments"),identifier:"payments"},{default:P(()=>[o.order?(d(),k(g,{key:0,onChanged:s[1]||(s[1]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"]),y(c,{visible:!["order_void","hold","refunded"].includes(o.order.payment_status),label:t.__("Refund & Return"),identifier:"refund"},{default:P(()=>[o.order?(d(),k(f,{key:0,onLoadTab:s[2]||(s[2]=S=>t.setActive(S)),onChanged:s[3]||(s[3]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"]),y(c,{visible:["partially_paid","unpaid"].includes(o.order.payment_status)&&o.order.support_instalments,label:t.__("Installments"),identifier:"instalments"},{default:P(()=>[o.order?(d(),k(C,{key:0,onChanged:s[4]||(s[4]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"])]),_:1},8,["active"])):m("",!0),o.order.id?m("",!0):(d(),a("div",Vn,[y(W)]))]),o.orderDetailLoaded?(d(),a("div",Dn,[e("div",null,[t.isVoidable?(d(),k(Q,{key:0,onClick:s[6]||(s[6]=S=>t.voidOrder()),type:"error"},{default:P(()=>[Un,j(" "+i(t.__("Void")),1)]),_:1})):m("",!0),t.isDeleteAble?(d(),k(Q,{key:1,onClick:s[7]||(s[7]=S=>t.deleteOrder()),type:"error"},{default:P(()=>[Tn,j(" "+i(t.__("Delete")),1)]),_:1})):m("",!0)]),e("div",null,[y(Q,{onClick:s[8]||(s[8]=S=>t.printOrder()),type:"info"},{default:P(()=>[Rn,j(" "+i(t.__("Print")),1)]),_:1})])])):m("",!0)])}const Gn=F(jn,[["render",In]]);export{D as P,rt as a,Gn as n}; +var M=Object.defineProperty;var H=(r,s,n)=>s in r?M(r,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[s]=n;var U=(r,s,n)=>(H(r,typeof s!="symbol"?s+"":s,n),n);import{F as R,g as I,b as p,a as v,p as q,P as A,i as Y,v as L,G as z}from"./bootstrap-8be442b1.js";import{_ as u,n as V}from"./currency-f8bd78d1.js";import{_ as F}from"./_plugin-vue_export-helper-c27b6911.js";import{r as h,o as d,c as a,a as e,t as i,f as y,F as x,b as w,g as k,e as m,w as P,i as j,B as T,n as G}from"./runtime-core.esm-bundler-b48de70a.js";import{a as $,n as O,b as J,i as K,d as X}from"./ns-prompt-popup-100414c5.js";import"./index.es-25aa42ee.js";const Z={props:["popup"],mounted(){this.popuCloser(),this.loadFields(),this.product=this.popup.params.product},data(){return{formValidation:new R,fields:[],product:null}},methods:{__:u,popuCloser:I,close(){this.popup.params.reject(!1),this.popup.close()},addProduct(){if(this.formValidation.validateFields(this.fields),this.formValidation.fieldsValid(this.fields)){const r=this.formValidation.extractFields(this.fields),s={...this.product,...r};return this.popup.params.resolve(s),this.close()}p.error(u("The form is not valid.")).subscribe()},loadFields(){v.get("/api/fields/ns.refund-product").subscribe(r=>{this.fields=this.formValidation.createFields(r),this.fields.forEach(s=>{s.value=this.product[s.name]||""})})}}},ee={class:"shadow-xl ns-box w-95vw md:w-3/5-screen lg:w-3/7-screen h-95vh md:h-3/5-screen lg:h-3/7-screen overflow-hidden flex flex-col"},se={class:"p-2 flex justify-between border-b ns-box-header items-center"},te={class:"text-semibold"},re={class:"flex-auto overflow-y-auto relative ns-scrollbar"},ne={class:"p-2"},ie={key:0,class:"h-full w-full flex items-center justify-center"},oe={class:"p-2 flex justify-between items-center border-t ns-box-body"},le=e("div",null,null,-1);function de(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-field"),c=h("ns-spinner"),g=h("ns-button");return d(),a("div",ee,[e("div",se,[e("h3",te,i(t.__("Products")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=f=>t.close())})])]),e("div",re,[e("div",ne,[(d(!0),a(x,null,w(o.fields,(f,C)=>(d(),k(l,{key:C,field:f},null,8,["field"]))),128))]),o.fields.length===0?(d(),a("div",ie,[y(c)])):m("",!0)]),e("div",oe,[le,e("div",null,[y(g,{onClick:s[1]||(s[1]=f=>t.addProduct()),type:"info"},{default:P(()=>[j(i(t.__("Add Product")),1)]),_:1})])])])}const B=F(Z,[["render",de]]),ae={components:{nsNumpad:$},props:["popup"],data(){return{product:null,seeValue:0,availableQuantity:0}},mounted(){this.product=this.popup.params.product,this.availableQuantity=this.popup.params.availableQuantity,this.seeValue=this.product.quantity},methods:{__:u,popupResolver:q,close(){this.popup.params.reject(!1),this.popup.close()},setChangedValue(r){this.seeValue=r},updateQuantity(r){if(r>this.availableQuantity)return p.error("Unable to proceed as the quantity provided is exceed the available quantity.").subscribe();this.product.quantity=parseFloat(r),this.popup.params.resolve(this.product),this.popup.close()}}},ce={class:"shadow-xl ns-box overflow-hidden w-95vw md:w-4/6-screen lg:w-3/7-screen"},ue={class:"p-2 flex justify-between ns-box-header"},_e={class:"font-semibold"},me={key:0,class:"border-t border-b ns-box-body py-2 flex items-center justify-center text-2xl font-semibold"},pe={class:"text-primary text-sm"},fe={key:1,class:"flex-auto overflow-y-auto p-2"};function he(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-numpad");return d(),a("div",ce,[e("div",ue,[e("h3",_e,i(t.__("Quantity")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=c=>t.close())})])]),o.product?(d(),a("div",me,[e("span",null,i(o.seeValue),1),e("span",pe,"("+i(o.availableQuantity)+" "+i(t.__("available"))+")",1)])):m("",!0),o.product?(d(),a("div",fe,[y(l,{value:o.product.quantity,onNext:s[1]||(s[1]=c=>t.updateQuantity(c)),onChanged:s[2]||(s[2]=c=>t.setChangedValue(c))},null,8,["value"])])):m("",!0)])}const be=F(ae,[["render",he]]);class D{constructor({urls:s,options:n}){U(this,"urls");U(this,"options");U(this,"printingURL",{refund:"refund_printing_url",sale:"sale_printing_url",payment:"payment_printing_url"});this.urls=s,this.options=n}processRegularPrinting(s,n){const _=document.querySelector("#printing-section");_&&_.remove();const o=this.urls[this.printingURL[n]].replace("{reference_id}",s),t=document.createElement("iframe");t.id="printing-section",t.className="hidden",t.src=o,document.body.appendChild(t),setTimeout(()=>{document.querySelector("#printing-section").remove()},5e3)}process(s,n,_="aloud"){switch(this.options.ns_pos_printing_gateway){case"default":this.processRegularPrinting(s,n);break;default:this.processCustomPrinting(s,this.options.ns_pos_printing_gateway,n,_);break}}processCustomPrinting(s,n,_,o="aloud"){const t={printed:!1,reference_id:s,gateway:n,document:_,mode:o};nsHooks.applyFilters("ns-custom-print",{params:t,promise:()=>new Promise((l,c)=>{c({status:"error",message:__("The selected print gateway doesn't support this type of printing.","NsPrintAdapter")})})}).promise().then(l=>{nsSnackBar.success(l.message).subscribe()}).catch(l=>{nsSnackBar.error(l.message||__("An error unexpected occured while printing.")).subscribe()})}}const ye={components:{nsNumpad:$},props:["order"],computed:{total(){return this.refundables.length>0?this.refundables.map(r=>parseFloat(r.unit_price)*parseFloat(r.quantity)).reduce((r,s)=>r+s)+this.shippingFees:0+this.shippingFees},shippingFees(){return this.refundShipping?this.order.shipping:0}},data(){return{isSubmitting:!1,formValidation:new R,refundables:[],paymentOptions:[],paymentField:[],print:new D({urls:systemUrls,options:systemOptions}),refundShipping:!1,selectedPaymentGateway:!1,screen:0,selectFields:[{type:"select",options:this.order.products.map(r=>({label:`${r.name} - ${r.unit.name} (x${r.quantity})`,value:r.id})),validation:"required",name:"product_id",label:u("Product"),description:u("Select the product to perform a refund.")}]}},methods:{__:u,nsCurrency:V,updateScreen(r){this.screen=r},toggleRefundShipping(r){this.refundShipping=r,this.refundShipping},proceedPayment(){if(this.selectedPaymentGateway===!1)return p.error(u("Please select a payment gateway before proceeding.")).subscribe();if(this.total===0)return p.error(u("There is nothing to refund.")).subscribe();if(this.screen===0)return p.error(u("Please provide a valid payment amount.")).subscribe();A.show(O,{title:u("Confirm Your Action"),message:u("The refund will be made on the current order."),onAction:r=>{r&&this.doProceed()}})},doProceed(){const r={products:this.refundables,total:this.screen,payment:{identifier:this.selectedPaymentGateway},refund_shipping:this.refundShipping};this.isSubmitting=!0,v.post(`/api/orders/${this.order.id}/refund`,r).subscribe({next:s=>{this.isSubmitting=!1,this.$emit("changed",!0),s.data.order.payment_status==="refunded"&&this.$emit("loadTab","details"),this.print.process(s.data.orderRefund.id,"refund"),p.success(s.message).subscribe()},error:s=>{this.isSubmitting=!1,p.error(s.message).subscribe()}})},addProduct(){if(this.formValidation.validateFields(this.selectFields),!this.formValidation.fieldsValid(this.selectFields))return p.error(u("Please select a product before proceeding.")).subscribe();const r=this.formValidation.extractFields(this.selectFields),s=this.order.products.filter(t=>t.id===r.product_id),n=this.refundables.filter(t=>t.id===r.product_id);if(n.length>0&&n.map(b=>parseInt(b.quantity)).reduce((b,l)=>b+l)===s[0].quantity)return p.error(u("Not enough quantity to proceed.")).subscribe();if(s[0].quantity===0)return p.error(u("Not enough quantity to proceed.")).subscribe();const _={...s[0],condition:"",description:""};new Promise((t,b)=>{A.show(B,{resolve:t,reject:b,product:_})}).then(t=>{t.quantity=this.getProductOriginalQuantity(t.id)-this.getProductUsedQuantity(t.id),this.refundables.push(t)},t=>t)},getProductOriginalQuantity(r){const s=this.order.products.filter(n=>n.id===r);return s.length>0?s.map(n=>parseFloat(n.quantity)).reduce((n,_)=>n+_):0},getProductUsedQuantity(r){const s=this.refundables.filter(n=>n.id===r);return s.length>0?s.map(_=>parseFloat(_.quantity)).reduce((_,o)=>_+o):0},openSettings(r){new Promise((n,_)=>{A.show(B,{resolve:n,reject:_,product:r})}).then(n=>{const _=this.refundables.indexOf(r);this.$set(this.refundables,_,n)},n=>n)},async selectPaymentGateway(){try{this.selectedPaymentGateway=await new Promise((r,s)=>{A.show(J,{resolve:r,reject:s,value:[this.selectedPaymentOption],...this.paymentField[0]})}),this.selectedPaymentGatewayLabel=this.paymentField[0].options.filter(r=>r.value===this.selectedPaymentGateway)[0].label}catch{p.error(u("An error has occured while seleting the payment gateway.")).subscribe()}},changeQuantity(r){new Promise((n,_)=>{const o=this.getProductOriginalQuantity(r.id)-this.getProductUsedQuantity(r.id)+parseFloat(r.quantity);A.show(be,{resolve:n,reject:_,product:r,availableQuantity:o})}).then(n=>{if(n.quantity>this.getProductUsedQuantity(r.id)-r.quantity){const _=this.refundables.indexOf(r);this.$set(this.refundables,_,n)}})},deleteProduct(r){new Promise((s,n)=>{A.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this product ?"),onAction:_=>{if(_){const o=this.refundables.indexOf(r);this.refundables.splice(o,1)}}})})}},mounted(){this.selectFields=this.formValidation.createFields(this.selectFields),v.get("/api/orders/payments").subscribe(r=>{this.paymentField=r})}},ve={class:"-m-4 flex-auto flex flex-wrap relative"},xe={key:0,class:"bg-overlay h-full w-full flex items-center justify-center absolute z-30"},we={class:"px-4 w-full lg:w-1/2"},ge={class:"py-2 border-b-2 text-primary border-info-primary"},ke={class:"my-2"},Pe={class:"border-b border-info-primary flex justify-between items-center mb-2"},Ce={class:"flex-auto flex-col flex"},Se={class:"p-2 flex"},je={class:"flex justify-between p-2"},Oe={class:"flex items-center text-primary"},Ae={key:0,class:"mr-2"},Fe={class:"py-1 border-b-2 text-primary border-info-primary"},Ve={class:"px-2 text-primary flex justify-between flex-auto"},De={class:"flex flex-col"},Ue={class:"py-2"},Te={key:0,class:"rounded-full px-2 py-1 text-xs bg-error-tertiary mx-2 text-white"},Re={key:1,class:"rounded-full px-2 py-1 text-xs bg-success-tertiary mx-2 text-white"},Ie={class:"flex items-center justify-center"},qe={class:"py-1 flex items-center cursor-pointer border-b border-dashed border-info-primary"},Qe={class:"flex"},$e=["onClick"],Ne=e("i",{class:"las la-cog text-xl"},null,-1),Ye=[Ne],Le=["onClick"],Be=e("i",{class:"las la-trash"},null,-1),Ge=[Be],Ee=["onClick"],We={class:"px-4 w-full lg:w-1/2"},Me={class:"py-2 border-b-2 text-primary border-info-primary"},He={class:"py-2"},ze={class:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"},Je={class:"elevation-surface border success font-semibold flex mb-2 p-2 justify-between"},Ke={class:"elevation-surface border font-semibold flex mb-2 p-2 justify-between"};function Xe(r,s,n,_,o,t){const b=h("ns-spinner"),l=h("ns-field"),c=h("ns-checkbox"),g=h("ns-numpad-plus");return d(),a("div",ve,[o.isSubmitting?(d(),a("div",xe,[y(b)])):m("",!0),e("div",we,[e("h3",ge,i(t.__("Refund With Products")),1),e("div",ke,[e("ul",null,[e("li",Pe,[e("div",Ce,[e("div",Se,[(d(!0),a(x,null,w(o.selectFields,(f,C)=>(d(),k(l,{field:f,key:C},null,8,["field"]))),128))]),e("div",je,[e("div",Oe,[n.order.shipping>0?(d(),a("span",Ae,i(t.__("Refund Shipping")),1)):m("",!0),n.order.shipping>0?(d(),k(c,{key:1,onChange:s[0]||(s[0]=f=>t.toggleRefundShipping(f)),checked:o.refundShipping},null,8,["checked"])):m("",!0)]),e("div",null,[e("button",{onClick:s[1]||(s[1]=f=>t.addProduct()),class:"border rounded-full px-2 py-1 ns-inset-button info"},i(t.__("Add Product")),1)])])])]),e("li",null,[e("h4",Fe,i(t.__("Products")),1)]),(d(!0),a(x,null,w(o.refundables,f=>(d(),a("li",{key:f.id,class:"elevation-surface border flex justify-between items-center mb-2"},[e("div",Ve,[e("div",De,[e("p",Ue,[e("span",null,i(f.name),1),f.condition==="damaged"?(d(),a("span",Te,i(t.__("Damaged")),1)):m("",!0),f.condition==="unspoiled"?(d(),a("span",Re,i(t.__("Unspoiled")),1)):m("",!0)]),e("small",null,i(f.unit.name),1)]),e("div",Ie,[e("span",qe,i(t.nsCurrency(f.unit_price*f.quantity)),1)])]),e("div",Qe,[e("p",{onClick:C=>t.openSettings(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},Ye,8,$e),e("p",{onClick:C=>t.deleteProduct(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},Ge,8,Le),e("p",{onClick:C=>t.changeQuantity(f),class:"p-2 border-l border-info-primary cursor-pointer text-primary ns-numpad-key w-16 h-16 flex items-center justify-center"},i(f.quantity),9,Ee)])]))),128))])])]),e("div",We,[e("h3",Me,i(t.__("Summary")),1),e("div",He,[e("div",ze,[e("span",null,i(t.__("Total")),1),e("span",null,i(t.nsCurrency(t.total)),1)]),e("div",Je,[e("span",null,i(t.__("Paid")),1),e("span",null,i(t.nsCurrency(n.order.tendered)),1)]),e("div",{onClick:s[2]||(s[2]=f=>t.selectPaymentGateway()),class:"elevation-surface border info font-semibold flex mb-2 p-2 justify-between cursor-pointer"},[e("span",null,i(t.__("Payment Gateway")),1),e("span",null,i(o.selectedPaymentGateway?r.selectedPaymentGatewayLabel:"N/A"),1)]),e("div",Ke,[e("span",null,i(t.__("Screen")),1),e("span",null,i(t.nsCurrency(o.screen)),1)]),e("div",null,[y(g,{currency:!0,onChanged:s[3]||(s[3]=f=>t.updateScreen(f)),value:o.screen,onNext:s[4]||(s[4]=f=>t.proceedPayment(f))},null,8,["value"])])])])])}const Ze=F(ye,[["render",Xe]]);class N{getTypeLabel(s){const n=typeLabels.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getDeliveryStatus(s){const n=deliveryStatuses.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getProcessingStatus(s){const n=processingStatuses.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}getPaymentStatus(s){const n=paymentLabels.filter(_=>_.value===s);return n.length>0?n[0].label:u("Unknown Status")}}const es={props:["order"],data(){return{labels:new N,validation:new R,inputValue:0,print:new D({urls:systemUrls,options:systemOptions}),fields:[],paymentTypes}},computed:{paymentsLabels(){const r=new Object;return this.paymentTypes.forEach(s=>{r[s.value]=s.label}),r}},methods:{__:u,nsCurrency:V,updateValue(r){this.inputValue=r},loadPaymentFields(){v.get("/api/orders/payments").subscribe(r=>{this.fields=this.validation.createFields(r)})},printPaymentReceipt(r){this.print.process(r.id,"payment")},submitPayment(r){if(this.validation.validateFields(this.fields),!this.validation.fieldsValid(this.fields))return p.error(u("Unable to proceed the form is not valid")).subscribe();if(parseFloat(r)==0)return p.error(u("Please provide a valid value")).subscribe();r=parseFloat(r);const s={...this.validation.extractFields(this.fields),value:r};Popup.show(O,{title:u("Confirm Your Action"),message:u("You make a payment for {amount}. A payment can't be canceled. Would you like to proceed ?").replace("{amount}",V(r)),onAction:n=>{n&&v.post(`/api/orders/${this.order.id}/payments`,s).subscribe(_=>{p.success(_.message).subscribe(),this.$emit("changed")},_=>{p.error(_.message).subscribe()})}})}},components:{nsNumpad:$},mounted(){this.loadPaymentFields()}},ss={class:""},ts={class:"flex -mx-4 flex-wrap"},rs={class:"px-2 w-full md:w-1/2"},is={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface info border text-xl font-bold"},os={class:"px-2 w-full md:w-1/2"},ls={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface success border text-xl font-bold"},ds={class:"px-2 w-full md:w-1/2"},as={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface error border text-xl font-bold"},cs={key:0},us={key:1},_s={class:"px-2 w-full md:w-1/2"},ms={class:"my-1 h-12 py-1 px-2 flex justify-between items-center elevation-surface warning border text-xl font-bold"},ps={class:"flex -mx-4 flex-wrap"},fs={class:"px-2 w-full mb-4 md:w-1/2"},hs={key:0},bs={class:"font-semibold border-b-2 border-info-primary py-2"},ys={class:"py-2"},vs={class:"my-2 px-2 h-12 flex justify-end items-center border elevation-surface"},xs={key:1,class:"flex items-center justify-center h-full"},ws={class:"text-primary font-semibold"},gs={class:"px-2 w-full mb-4 md:w-1/2"},ks={class:"font-semibold border-b-2 border-info-primary py-2 mb-2"},Ps={class:"flex items-center"},Cs=["onClick"],Ss=e("i",{class:"las la-print"},null,-1),js=[Ss];function Os(r,s,n,_,o,t){const b=h("ns-field"),l=h("ns-numpad-plus");return d(),a("div",ss,[e("div",ts,[e("div",rs,[e("div",is,[e("span",null,i(t.__("Total")),1),e("span",null,i(t.nsCurrency(n.order.total)),1)])]),e("div",os,[e("div",ls,[e("span",null,i(t.__("Paid")),1),e("span",null,i(t.nsCurrency(n.order.tendered)),1)])]),e("div",ds,[e("div",as,[e("span",null,i(t.__("Unpaid")),1),n.order.total-n.order.tendered>0?(d(),a("span",cs,i(t.nsCurrency(n.order.total-n.order.tendered)),1)):m("",!0),n.order.total-n.order.tendered<=0?(d(),a("span",us,i(t.nsCurrency(0)),1)):m("",!0)])]),e("div",_s,[e("div",ms,[e("span",null,i(t.__("Customer Account")),1),e("span",null,i(t.nsCurrency(n.order.customer.account_amount)),1)])])]),e("div",ps,[e("div",fs,[n.order.payment_status!=="paid"?(d(),a("div",hs,[e("h3",bs,i(t.__("Payment")),1),e("div",ys,[(d(!0),a(x,null,w(o.fields,(c,g)=>(d(),k(b,{field:c,key:g},null,8,["field"]))),128)),e("div",vs,i(t.nsCurrency(o.inputValue)),1),y(l,{floating:!0,onNext:s[0]||(s[0]=c=>t.submitPayment(c)),onChanged:s[1]||(s[1]=c=>t.updateValue(c)),value:o.inputValue},null,8,["value"])])])):m("",!0),n.order.payment_status==="paid"?(d(),a("div",xs,[e("h3",ws,i(t.__("No payment possible for paid order.")),1)])):m("",!0)]),e("div",gs,[e("h3",ks,i(t.__("Payment History")),1),e("ul",null,[(d(!0),a(x,null,w(n.order.payments,c=>(d(),a("li",{key:c.id,class:"p-2 flex items-center justify-between text-shite border elevation-surface mb-2"},[e("span",Ps,[e("a",{href:"javascript:void(0)",onClick:g=>t.printPaymentReceipt(c),class:"m-1 rounded-full hover:bg-info-tertiary hover:text-white flex items-center justify-center h-8 w-8"},js,8,Cs),j(" "+i(t.paymentsLabels[c.identifier]||t.__("Unknown")),1)]),e("span",null,i(t.nsCurrency(c.value)),1)]))),128))])])])])}const As=F(es,[["render",Os]]),Fs={name:"ns-orders-refund-popup",props:["popup"],data(){return{order:null,refunds:[],view:"summary",previewed:null,loaded:!1,options:systemOptions,systemUrls,print:new D({urls:systemUrls,options:systemOptions})}},methods:{__:u,nsCurrency:V,popupCloser:I,popupResolver:q,toggleProductView(r){this.view="details",this.previewed=r},loadOrderRefunds(){nsHttpClient.get(`/api/orders/${this.order.id}/refunds`).subscribe(r=>{this.loaded=!0,this.refunds=r.refunds},r=>{p.error(r.message).subscribe()})},close(){this.popup.close()},printRefundReceipt(r){this.print.process(r.id,"refund")}},mounted(){this.order=this.popup.params.order,this.popupCloser(),this.loadOrderRefunds()}},Vs={class:"shadow-lg w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen ns-box flex flex-col overflow-hidden"},Ds={class:"border-b p-2 flex items-center justify-between ns-box-header"},Us={class:"flex"},Ts={class:"overflow-auto flex-auto ns-box-body"},Rs={key:0,class:"flex h-full w-full items-center justify-center"},Is={key:1,class:"flex h-full w-full items-center flex-col justify-center"},qs=e("i",{class:"las la-laugh-wink text-5xl"},null,-1),Qs={class:"md:w-80 text-sm text-secondary text-center"},$s={class:"w-full md:flex-auto p-2"},Ns={class:"font-semibold mb-1"},Ys={class:"flex -mx-1 text-sm text-primary"},Ls={class:"px-1"},Bs={class:"px-1"},Gs=["onClick"],Es=e("i",{class:"las la-eye"},null,-1),Ws=[Es],Ms=["onClick"],Hs=e("i",{class:"las la-print"},null,-1),zs=[Hs],Js={class:"w-full md:flex-auto p-2"},Ks={class:"font-semibold mb-1"},Xs={class:"flex -mx-1 text-sm text-primary"},Zs={class:"px-1"},et={class:"px-1"},st={class:"px-1"};function tt(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-spinner");return d(),a("div",Vs,[e("div",Ds,[e("h3",null,i(t.__("Order Refunds")),1),e("div",Us,[o.view==="details"?(d(),a("div",{key:0,onClick:s[0]||(s[0]=c=>o.view="summary"),class:"flex items-center justify-center cursor-pointer rounded-full px-3 border ns-inset-button mr-1"},i(t.__("Go Back")),1)):m("",!0),y(b,{onClick:s[1]||(s[1]=c=>t.close())})])]),e("div",Ts,[o.view==="summary"?(d(),a(x,{key:0},[o.loaded?m("",!0):(d(),a("div",Rs,[y(l,{size:"24"})])),o.loaded&&o.refunds.length===0?(d(),a("div",Is,[qs,e("p",Qs,i(t.__("No refunds made so far. Good news right?")),1)])):m("",!0),o.loaded&&o.refunds.length>0?(d(!0),a(x,{key:2},w(o.refunds,c=>(d(),a("div",{class:"border-b border-box-edge flex flex-col md:flex-row",key:c.id},[e("div",$s,[e("h3",Ns,i(o.order.code),1),e("div",null,[e("ul",Ys,[e("li",Ls,i(t.__("Total"))+" : "+i(t.nsCurrency(c.total)),1),e("li",Bs,i(t.__("By"))+" : "+i(c.author.username),1)])])]),e("div",{onClick:g=>t.toggleProductView(c),class:"w-full md:w-16 cursor-pointer hover:bg-info-secondary hover:border-info-primary hover:text-white text-lg flex items-center justify-center border-box-edge md:border-l"},Ws,8,Gs),e("div",{onClick:g=>t.printRefundReceipt(c),class:"w-full md:w-16 cursor-pointer hover:bg-info-secondary hover:border-info-primary hover:text-white text-lg flex items-center justify-center border-box-edge md:border-l"},zs,8,Ms)]))),128)):m("",!0)],64)):m("",!0),o.view==="details"?(d(!0),a(x,{key:1},w(o.previewed.refunded_products,c=>(d(),a("div",{class:"border-b border-box-edge flex flex-col md:flex-row",key:c.id},[e("div",Js,[e("h3",Ks,i(c.product.name),1),e("div",null,[e("ul",Xs,[e("li",Zs,i(t.__("Condition"))+" : "+i(c.condition),1),e("li",et,i(t.__("Quantity"))+" : "+i(c.quantity),1),e("li",st,i(t.__("Total"))+" : "+i(t.nsCurrency(c.total_price)),1)])])])]))),128)):m("",!0)])])}const rt=F(Fs,[["render",tt]]),nt={props:["order"],data(){return{processingStatuses,deliveryStatuses,labels:new N,showProcessingSelect:!1,showDeliverySelect:!1,systemUrls}},mounted(){},methods:{__:u,nsCurrency:V,submitProcessingChange(){A.show(O,{title:u("Would you proceed ?"),message:u("The processing status of the order will be changed. Please confirm your action."),onAction:r=>{r&&v.post(`/api/orders/${this.order.id}/processing`,{process_status:this.order.process_status}).subscribe({next:s=>{this.showProcessingSelect=!1,p.success(s.message).subscribe()},error:s=>{p.error(s.message||u("Unexpected error occurred.")).subscribe()}})}})},openRefunds(){try{const r=new Promise((s,n)=>{const _=this.order;A.show(rt,{order:_,resolve:s,reject:n})})}catch{}},submitDeliveryStatus(){A.show(O,{title:u("Would you proceed ?"),message:u("The delivery status of the order will be changed. Please confirm your action."),onAction:r=>{r&&v.post(`/api/orders/${this.order.id}/delivery`,{delivery_status:this.order.delivery_status}).subscribe({next:s=>{this.showDeliverySelect=!1,p.success(s.message).subscribe()},error:s=>{p.error(s.message||u("Unexpected error occurred.")).subscribe()}})}})}}},it={class:"-mx-4 flex flex-wrap"},ot={class:"flex-auto"},lt={class:"w-full mb-2 flex-wrap flex"},dt={class:"w-full mb-2 px-4"},at={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},ct={class:"mb-2 w-full md:w-1/2 px-4"},ut={class:"elevation-surface border p-2 flex justify-between items-start"},_t={class:"text-semibold text-primary"},mt={class:"font-semibold text-secondary"},pt={class:"mb-2 w-full md:w-1/2 px-4"},ft={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},ht={class:"text-semibold"},bt={class:""},yt={key:0,class:"ml-1"},vt={key:1,class:"ml-1"},xt={class:"font-semibold text-primary"},wt={class:"mb-2 w-full md:w-1/2 px-4"},gt={class:"p-2 flex justify-between items-start elevation-surface border"},kt={class:"text-semibold text-primary"},Pt={class:"font-semibold text-secondary"},Ct={class:"mb-2 w-full md:w-1/2 px-4"},St={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},jt={class:"text-semibold"},Ot={class:"font-semibold text-primary"},At={class:"mb-2 w-full md:w-1/2 px-4"},Ft={class:"p-2 flex justify-between items-start border ns-notice success"},Vt={class:"text-semibold"},Dt={class:"font-semibold text-primary"},Ut={class:"mb-2 w-full md:w-1/2 px-4"},Tt={class:"p-2 flex justify-between items-start text-primary elevation-surface info border"},Rt={class:"text-semibold"},It={class:"font-semibold"},qt={class:"mb-2 w-full md:w-1/2 px-4"},Qt={class:"p-2 flex justify-between items-start text-primary elevation-surface error border"},$t={class:"text-semibold"},Nt={class:"font-semibold"},Yt={class:"mb-2 w-full md:w-1/2 px-4"},Lt={class:"p-2 flex justify-between items-start elevation-surface border"},Bt={class:"text-semibold"},Gt={class:"font-semibold"},Et={class:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},Wt={class:"mb-2"},Mt={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},Ht={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},zt={class:"text-semibold text-primary"},Jt={key:0,class:"font-semibold text-secondary"},Kt=["href"],Xt={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},Zt={class:"text-semibold text-primary"},er={class:"font-semibold text-secondary"},sr={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},tr={class:"text-semibold text-primary"},rr={class:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},nr={class:"w-full text-center"},ir={key:0,class:"flex-auto flex"},or={class:"ns-select flex items-center justify-center"},lr=["value"],dr={class:"pl-2 flex"},ar={class:"mb-2 p-2 flex flex-col md:flex-row justify-between items-center elevation-surface border"},cr={class:"text-semibold text-primary"},ur={class:"font-semibold text-secondary mt-2 md:mt-0 w-full md:w-auto"},_r={class:"w-full text-center"},mr={key:0,class:"flex-auto flex"},pr={class:"ns-select flex items-center justify-center"},fr=["value"],hr={class:"pl-2 flex"},br={class:"mb-2 p-2 flex justify-between items-start elevation-surface border"},yr={class:"text-semibold text-primary"},vr={class:"font-semibold text-secondary"},xr={class:"px-4 w-full md:w-1/2 lg:w-2/4 mb-2"},wr={class:"mb-2"},gr={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},kr={class:"text-semibold text-primary"},Pr={class:"text-secondary text-sm"},Cr={class:"font-semibold text-secondary"},Sr={class:"mb-2"},jr={class:"font-semibold text-secondary pb-2 border-b border-info-primary flex justify-between"},Or={class:"text-semibold text-primary"},Ar={class:"text-secondary text-sm"},Fr={class:"font-semibold text-secondary"};function Vr(r,s,n,_,o,t){const b=h("ns-close-button");return d(),a("div",it,[e("div",ot,[e("div",lt,[e("div",dt,[e("h3",at,i(t.__("Payment Summary")),1)]),e("div",ct,[e("div",ut,[e("div",null,[e("h4",_t,i(t.__("Sub Total")),1)]),e("div",mt,i(t.nsCurrency(n.order.subtotal)),1)])]),e("div",pt,[e("div",ft,[e("div",null,[e("h4",ht,[e("span",bt,i(t.__("Discount")),1),n.order.discount_type==="percentage"?(d(),a("span",yt,"("+i(n.order.discount_percentage)+"%)",1)):m("",!0),n.order.discount_type==="flat"?(d(),a("span",vt,"(Flat)")):m("",!0)])]),e("div",xt,i(t.nsCurrency(n.order.discount)),1)])]),e("div",wt,[e("div",gt,[e("div",null,[e("h4",kt,i(t.__("Shipping")),1)]),e("div",Pt,i(t.nsCurrency(n.order.shipping)),1)])]),e("div",Ct,[e("div",St,[e("div",null,[e("h4",jt,i(t.__("Coupons")),1)]),e("div",Ot,i(t.nsCurrency(n.order.total_coupons)),1)])]),e("div",At,[e("div",Ft,[e("div",null,[e("h4",Vt,i(t.__("Total")),1)]),e("div",Dt,i(t.nsCurrency(n.order.total)),1)])]),e("div",Ut,[e("div",Tt,[e("div",null,[e("h4",Rt,i(t.__("Taxes")),1)]),e("div",It,i(t.nsCurrency(n.order.tax_value)),1)])]),e("div",qt,[e("div",Qt,[e("div",null,[e("h4",$t,i(t.__("Change")),1)]),e("div",Nt,i(t.nsCurrency(n.order.change)),1)])]),e("div",Yt,[e("div",Lt,[e("div",null,[e("h4",Bt,i(t.__("Paid")),1)]),e("div",Gt,i(t.nsCurrency(n.order.tendered)),1)])])])]),e("div",Et,[e("div",Wt,[e("h3",Mt,i(t.__("Order Status")),1)]),e("div",Ht,[e("div",null,[e("h4",zt,[e("span",null,i(t.__("Customer")),1)])]),n.order?(d(),a("div",Jt,[e("a",{class:"border-b border-dashed border-info-primary",href:o.systemUrls.customer_edit_url.replace("#customer",n.order.customer.id),target:"_blank",rel:"noopener noreferrer"},i(n.order.customer.first_name)+" "+i(n.order.customer.last_name),9,Kt)])):m("",!0)]),e("div",Xt,[e("div",null,[e("h4",Zt,[e("span",null,i(t.__("Type")),1)])]),e("div",er,i(o.labels.getTypeLabel(n.order.type)),1)]),e("div",sr,[e("div",null,[e("h4",tr,[e("span",null,i(t.__("Delivery Status")),1)])]),e("div",rr,[e("div",nr,[o.showDeliverySelect?m("",!0):(d(),a("span",{key:0,onClick:s[0]||(s[0]=l=>o.showDeliverySelect=!0),class:"font-semibold text-secondary border-b border-info-primary cursor-pointer border-dashed"},i(o.labels.getDeliveryStatus(n.order.delivery_status)),1))]),o.showDeliverySelect?(d(),a("div",ir,[e("div",or,[T(e("select",{ref:"process_status",class:"flex-auto border-info-primary rounded-lg","onUpdate:modelValue":s[1]||(s[1]=l=>n.order.delivery_status=l)},[(d(!0),a(x,null,w(o.deliveryStatuses,(l,c)=>(d(),a("option",{key:c,value:l.value},i(l.label),9,lr))),128))],512),[[Y,n.order.delivery_status]])]),e("div",dr,[y(b,{onClick:s[2]||(s[2]=l=>o.showDeliverySelect=!1)}),e("button",{onClick:s[3]||(s[3]=l=>t.submitDeliveryStatus(n.order)),class:"bg-success-primary text-white rounded-full px-2 py-1"},i(t.__("Save")),1)])])):m("",!0)])]),e("div",ar,[e("div",null,[e("h4",cr,[e("span",null,i(t.__("Processing Status")),1)])]),e("div",ur,[e("div",_r,[o.showProcessingSelect?m("",!0):(d(),a("span",{key:0,onClick:s[4]||(s[4]=l=>o.showProcessingSelect=!0),class:"border-b border-info-primary cursor-pointer border-dashed"},i(o.labels.getProcessingStatus(n.order.process_status)),1))]),o.showProcessingSelect?(d(),a("div",mr,[e("div",pr,[T(e("select",{ref:"process_status",class:"flex-auto border-info-primary rounded-lg","onUpdate:modelValue":s[5]||(s[5]=l=>n.order.process_status=l)},[(d(!0),a(x,null,w(o.processingStatuses,(l,c)=>(d(),a("option",{key:c,value:l.value},i(l.label),9,fr))),128))],512),[[Y,n.order.process_status]])]),e("div",hr,[y(b,{onClick:s[6]||(s[6]=l=>o.showProcessingSelect=!1)}),e("button",{onClick:s[7]||(s[7]=l=>t.submitProcessingChange(n.order)),class:"bg-success-primary text-white rounded-full px-2 py-1"},i(t.__("Save")),1)])])):m("",!0)])]),e("div",br,[e("div",null,[e("h4",yr,[e("span",null,i(t.__("Payment Status")),1)])]),e("div",vr,i(o.labels.getPaymentStatus(n.order.payment_status)),1)])]),e("div",xr,[e("div",wr,[e("h3",gr,i(t.__("Products")),1)]),(d(!0),a(x,null,w(n.order.products,l=>(d(),a("div",{key:l.id,class:"p-2 flex justify-between items-start elevation-surface border mb-6"},[e("div",null,[e("h4",kr,i(l.name)+" (x"+i(l.quantity)+")",1),e("p",Pr,i(l.unit.name||"N/A"),1)]),e("div",Cr,i(t.nsCurrency(l.total_price)),1)]))),128)),e("div",Sr,[e("h3",jr,[e("span",null,i(t.__("Refunded Products")),1),e("a",{href:"javascript:void(0)",onClick:s[8]||(s[8]=l=>t.openRefunds()),class:"border-b border-info-primary border-dashed"},i(t.__("All Refunds")),1)])]),(d(!0),a(x,null,w(n.order.refunded_products,(l,c)=>(d(),a("div",{key:c,class:"p-2 flex justify-between items-start elevation-surface border mb-6"},[e("div",null,[e("h4",Or,i(l.order_product.name)+" (x"+i(l.quantity)+")",1),e("p",Ar,[j(i(l.unit.name||"N/A")+" | ",1),e("span",{class:G(["rounded-full px-2",l.condition==="damaged"?"bg-error-tertiary text-white":"bg-info-tertiary text-white"])},i(l.condition),3)])]),e("div",Fr,i(t.nsCurrency(l.total_price)),1)]))),128))])])}const Dr=F(nt,[["render",Vr]]),Ur={name:"ns-order-instalments-payment",props:["popup"],components:{nsNotice:K},data(){return{paymentTypes,fields:[{type:"select",name:"payment_type",description:u("Select the payment type that must apply to the current order."),label:u("Payment Type"),validation:"required",options:paymentTypes}],print:new D({urls:systemUrls,options:systemOptions}),validation:new R,order:null,instalment:null}},methods:{__:u,popupResolver:q,popupCloser:I,close(){this.popupResolver(!1)},updateInstalmentAsDue(r){nsHttpClient.put(`/api/orders/${this.order.id}/instalments/${this.instalment.id}/`,{instalment:{date:ns.date.moment.format("YYYY-MM-DD HH:mm:ss")}}).subscribe({next:s=>{this.submitPayment()},error:s=>{p.error(s.message||u("An unexpected error has occurred")).subscribe()}})},submitPayment(){if(!this.validation.validateFields(this.fields))return p.error(__m("The form is not valid.")).subcribe();nsHttpClient.post(`/api/orders/${this.order.id}/instalments/${this.instalment.id}/pay`,{...this.validation.extractFields(this.fields)}).subscribe({next:r=>{this.popupResolver(!0),this.print.exec(r.data.payment.id,"payment"),p.success(r.message).subscribe()},error:r=>{r.status==="error"&&Popup.show(O,{title:u("Update Instalment Date"),message:u("Would you like to mark that instalment as due today ? If you confirm the instalment will be marked as paid."),onAction:s=>{s&&this.updateInstalmentAsDue(this.instalment)}}),p.error(r.message||u("An unexpected error has occurred")).subscribe()}})}},mounted(){this.popupCloser(),this.order=this.popup.params.order,this.instalment=this.popup.params.instalment,this.fields=this.validation.createFields(this.fields)}},Tr={class:"shadow-lg ns-box w-95vw md:w-2/3-screen lg:w-1/3-screen"},Rr={class:"p-2 flex justify-between border-b items-center"},Ir={class:"p-2 ns-box-body"},qr=e("br",null,null,-1),Qr={class:"border-t ns-box-footer p-2 flex justify-end"};function $r(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-notice"),c=h("ns-field"),g=h("ns-button");return d(),a("div",Tr,[e("div",Rr,[e("h3",null,i(t.__("Payment Method")),1),e("div",null,[y(b,{onClick:s[0]||(s[0]=f=>t.close())})])]),e("div",Ir,[y(l,{color:"info",class:"py-2 p-4 text-center border text-primary rounded-lg"},{default:P(()=>[j(i(t.__("Before submitting the payment, choose the payment type used for that order.")),1)]),_:1}),qr,(d(!0),a(x,null,w(o.fields,(f,C)=>(d(),k(c,{key:C,field:f},null,8,["field"]))),128))]),e("div",Qr,[y(g,{onClick:s[1]||(s[1]=f=>t.submitPayment()),type:"info"},{default:P(()=>[j(i(t.__("Submit Payment")),1)]),_:1})])])}const Nr=F(Ur,[["render",$r]]),Yr={props:["order"],name:"ns-order-instalments",data(){return{labels:new N,original:[],instalments:[],print:new D({urls:systemUrls,options:systemOptions,type:"payment"})}},mounted(){this.loadInstalments()},computed:{totalInstalments(){return this.instalments.length>0?this.instalments.map(r=>r.amount).reduce((r,s)=>parseFloat(r)+parseFloat(s)):0}},methods:{__:u,nsCurrency:V,loadInstalments(){v.get(`/api/orders/${this.order.id}/instalments`).subscribe(r=>{this.original=r,this.instalments=r.map(s=>(s.price_clicked=!1,s.date_clicked=!1,s.date=moment(s.date).format("YYYY-MM-DD"),s))})},showReceipt(r){if(r.payment_id===null)return p.error(u("This instalment doesn't have any payment attached.")).subscribe();this.print.process(r.payment_id,"payment")},addInstalment(){this.instalments.push({date:ns.date.moment.format("YYYY-MM-DD"),amount:this.order.total-this.totalInstalments,paid:!1})},createInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to create this instalment ?"),onAction:s=>{s&&v.post(`/api/orders/${this.order.id}/instalments`,{instalment:r}).subscribe({next:n=>{this.loadInstalments(),p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},deleteInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this instalment ?"),onAction:s=>{s&&v.delete(`/api/orders/${this.order.id}/instalments/${r.id}`).subscribe({next:n=>{const _=this.instalments.indexOf(r);this.instalments.splice(_,1),p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},async markAsPaid(r){try{const s=await new Promise((n,_)=>{Popup.show(Nr,{order:this.order,instalment:r,resolve:n,reject:_})});this.loadInstalments()}catch{}},togglePriceEdition(r){r.paid||(r.price_clicked=!r.price_clicked,this.$forceUpdate(),r.price_clicked&&setTimeout(()=>{this.$refs.amount[0].select()},100))},updateInstalment(r){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to update that instalment ?"),onAction:s=>{s&&v.put(`/api/orders/${this.order.id}/instalments/${r.id}`,{instalment:r}).subscribe({next:n=>{p.success(n.message).subscribe()},error:n=>{p.error(n.message||u("An unexpected error has occurred")).subscribe()}})}})},toggleDateEdition(r){r.paid||(r.date_clicked=!r.date_clicked,this.$forceUpdate(),r.date_clicked&&setTimeout(()=>{this.$refs.date[0].select()},200))}}},Lr={class:"-mx-4 flex-auto flex flex-wrap"},Br={class:"flex flex-auto"},Gr={class:"w-full mb-2 flex-wrap"},Er={class:"w-full mb-2 px-4"},Wr={class:"font-semibold text-secondary pb-2 border-b border-info-primary"},Mr={class:"px-4"},Hr={class:"border-table-th-edge border-t text-primary"},zr={class:"p-2"},Jr=["onClick"],Kr={key:1},Xr=["onBlur","onUpdate:modelValue"],Zr={class:"flex items-center"},en={class:"flex items-center px-2 h-full border-r"},sn=["onClick"],tn={key:1},rn=["onUpdate:modelValue","onBlur"],nn={key:0,class:"w-36 justify-center flex items-center px-2 h-full border-r"},on={class:"px-2"},ln={class:"px-2"},dn={class:"px-2"},an={key:1,class:"w-36 justify-center flex items-center px-2 h-full border-r"},cn={class:"px-2"},un={class:"ns-button info"},_n=["onClick"],mn=e("i",{class:"las la-plus"},null,-1),pn={key:2,class:"w-36 justify-center flex items-center px-2 h-full"},fn={class:"ns-button info"},hn=["onClick"],bn=e("i",{class:"las la-print"},null,-1),yn={class:"flex justify-between p-2 border-r border-b border-l elevation-surface"},vn={class:"flex items-center justify-center"},xn={class:"ml-1 text-sm"},wn={class:"-mx-2 flex flex-wrap items-center"},gn={class:"px-2"},kn={class:"px-2"},Pn={class:"ns-button info"};function Cn(r,s,n,_,o,t){const b=h("ns-icon-button");return d(),a("div",Lr,[e("div",Br,[e("div",Gr,[e("div",Er,[e("h3",Wr,i(t.__("Instalments")),1)]),e("div",Mr,[e("ul",Hr,[(d(!0),a(x,null,w(o.instalments,l=>(d(),a("li",{class:G([l.paid?"success":"info","border-b border-l flex justify-between elevation-surface"]),key:l.id},[e("span",zr,[l.date_clicked?m("",!0):(d(),a("span",{key:0,onClick:c=>t.toggleDateEdition(l)},i(l.date),9,Jr)),l.date_clicked?(d(),a("span",Kr,[T(e("input",{onBlur:c=>t.toggleDateEdition(l),"onUpdate:modelValue":c=>l.date=c,type:"date",ref_for:!0,ref:"date",class:"border border-info-primary rounded"},null,40,Xr),[[L,l.date]])])):m("",!0)]),e("div",Zr,[e("div",en,[l.price_clicked?m("",!0):(d(),a("span",{key:0,onClick:c=>t.togglePriceEdition(l)},i(t.nsCurrency(l.amount)),9,sn)),l.price_clicked?(d(),a("span",tn,[T(e("input",{ref_for:!0,ref:"amount","onUpdate:modelValue":c=>l.amount=c,onBlur:c=>t.togglePriceEdition(l),type:"text",class:"border border-info-primary p-1"},null,40,rn),[[L,l.amount]])])):m("",!0)]),!l.paid&&l.id?(d(),a("div",nn,[e("div",on,[y(b,{type:"success",onClick:c=>t.markAsPaid(l),className:"la-money-bill-wave-alt"},null,8,["onClick"])]),e("div",ln,[y(b,{type:"info",onClick:c=>t.updateInstalment(l),className:"la-save"},null,8,["onClick"])]),e("div",dn,[y(b,{type:"error",onClick:c=>t.deleteInstalment(l),className:"la-trash-alt"},null,8,["onClick"])])])):m("",!0),!l.paid&&!l.id?(d(),a("div",an,[e("div",cn,[e("div",un,[e("button",{onClick:c=>t.createInstalment(l),class:"px-3 py-1 rounded-full"},[mn,j(" "+i(t.__("Create")),1)],8,_n)])])])):m("",!0),l.paid?(d(),a("div",pn,[e("div",fn,[e("button",{onClick:c=>t.showReceipt(l),class:"px-3 text-xs py-1 rounded-full"},[bn,j(" "+i(t.__("Receipt")),1)],8,hn)])])):m("",!0)])],2))),128)),e("li",yn,[e("div",vn,[e("span",null,i(t.__("Total :"))+" "+i(t.nsCurrency(n.order.total)),1),e("span",xn," ("+i(t.__("Remaining :"))+" "+i(t.nsCurrency(n.order.total-t.totalInstalments))+") ",1)]),e("div",wn,[e("span",gn,i(t.__("Instalments:"))+" "+i(t.nsCurrency(t.totalInstalments)),1),e("span",kn,[e("div",Pn,[e("button",{onClick:s[0]||(s[0]=l=>t.addInstalment()),class:"rounded-full px-3 py-1"},i(t.__("Add Instalment")),1)])])])])])])])])])}const Sn=F(Yr,[["render",Cn]]),jn={name:"ns-orders-preview-popup",props:["popup"],data(){return{active:"details",order:new Object,rawOrder:new Object,products:[],payments:[],options:null,print:new D({urls:systemUrls,options:systemOptions}),settings:null,orderDetailLoaded:!1}},components:{nsOrderRefund:Ze,nsOrderPayment:As,nsOrderDetails:Dr,nsOrderInstalments:Sn},computed:{isVoidable(){return["paid","partially_paid","unpaid"].includes(this.order.payment_status)},isDeleteAble(){return["hold"].includes(this.order.payment_status)}},methods:{__:u,popupResolver:q,popupCloser:I,nsCurrency:V,closePopup(r=!1){this.popupResolver(r)},setActive(r){this.active=r},printOrder(){this.print.process(this.order.id,"sale")},refresh(){this.loadOrderDetails(this.order.id)},loadOrderDetails(r){this.orderDetailLoaded=!1,z([v.get(`/api/orders/${r}`),v.get(`/api/orders/${r}/products`),v.get(`/api/orders/${r}/payments`)]).subscribe(s=>{this.orderDetailLoaded=!0,this.order=s[0],this.products=s[1],this.payments=s[2]})},deleteOrder(){Popup.show(O,{title:u("Confirm Your Action"),message:u("Would you like to delete this order"),onAction:r=>{r&&v.delete(`/api/orders/${this.order.id}`).subscribe({next:s=>{p.success(s.message).subscribe(),this.refreshCrudTable(),this.closePopup(!0)},error:s=>{p.error(s.message).subscribe()}})}})},voidOrder(){try{const r=new Promise((s,n)=>{Popup.show(X,{resolve:s,reject:n,title:u("Confirm Your Action"),message:u("The current order will be void. This action will be recorded. Consider providing a reason for this operation"),onAction:_=>{_!==!1&&v.post(`/api/orders/${this.order.id}/void`,{reason:_}).subscribe({next:o=>{p.success(o.message).subscribe(),this.refreshCrudTable(),this.closePopup(!0)},error:o=>{p.error(o.message).subscribe()}})}})})}catch(r){console.log(r)}},refreshCrudTable(){this.popup.params.component.$emit("updated",!0)}},watch:{active(){this.active==="details"&&this.loadOrderDetails(this.rawOrder.id)}},mounted(){this.rawOrder=this.popup.params.order,this.options=systemOptions,this.urls=systemUrls,this.loadOrderDetails(this.rawOrder.id),this.popupCloser()}},On={class:"h-95vh w-95vw md:h-6/7-screen md:w-6/7-screen overflow-hidden shadow-xl ns-box flex flex-col"},An={class:"border-b ns-box-header p-3 flex items-center justify-between"},Fn={class:"p-2 ns-box-body overflow-hidden flex flex-auto"},Vn={key:1,class:"h-full w-full flex items-center justify-center"},Dn={key:0,class:"p-2 flex justify-between border-t ns-box-footer"},Un=e("i",{class:"las la-ban"},null,-1),Tn=e("i",{class:"las la-trash"},null,-1),Rn=e("i",{class:"las la-print"},null,-1);function In(r,s,n,_,o,t){const b=h("ns-close-button"),l=h("ns-order-details"),c=h("ns-tabs-item"),g=h("ns-order-payment"),f=h("ns-order-refund"),C=h("ns-order-instalments"),E=h("ns-tabs"),W=h("ns-spinner"),Q=h("ns-button");return d(),a("div",On,[e("div",An,[e("div",null,[e("h3",null,i(t.__("Order Options")),1)]),e("div",null,[y(b,{onClick:s[0]||(s[0]=S=>t.closePopup(!0))})])]),e("div",Fn,[o.order.id?(d(),k(E,{key:0,active:o.active,onActive:s[5]||(s[5]=S=>t.setActive(S))},{default:P(()=>[y(c,{label:t.__("Details"),identifier:"details",class:"overflow-y-auto"},{default:P(()=>[o.order?(d(),k(l,{key:0,order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["label"]),y(c,{visible:!["order_void","hold","refunded","partially_refunded"].includes(o.order.payment_status),label:t.__("Payments"),identifier:"payments"},{default:P(()=>[o.order?(d(),k(g,{key:0,onChanged:s[1]||(s[1]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"]),y(c,{visible:!["order_void","hold","refunded"].includes(o.order.payment_status),label:t.__("Refund & Return"),identifier:"refund"},{default:P(()=>[o.order?(d(),k(f,{key:0,onLoadTab:s[2]||(s[2]=S=>t.setActive(S)),onChanged:s[3]||(s[3]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"]),y(c,{visible:["partially_paid","unpaid"].includes(o.order.payment_status)&&o.order.support_instalments,label:t.__("Installments"),identifier:"instalments"},{default:P(()=>[o.order?(d(),k(C,{key:0,onChanged:s[4]||(s[4]=S=>t.refresh()),order:o.order},null,8,["order"])):m("",!0)]),_:1},8,["visible","label"])]),_:1},8,["active"])):m("",!0),o.order.id?m("",!0):(d(),a("div",Vn,[y(W)]))]),o.orderDetailLoaded?(d(),a("div",Dn,[e("div",null,[t.isVoidable?(d(),k(Q,{key:0,onClick:s[6]||(s[6]=S=>t.voidOrder()),type:"error"},{default:P(()=>[Un,j(" "+i(t.__("Void")),1)]),_:1})):m("",!0),t.isDeleteAble?(d(),k(Q,{key:1,onClick:s[7]||(s[7]=S=>t.deleteOrder()),type:"error"},{default:P(()=>[Tn,j(" "+i(t.__("Delete")),1)]),_:1})):m("",!0)]),e("div",null,[y(Q,{onClick:s[8]||(s[8]=S=>t.printOrder()),type:"info"},{default:P(()=>[Rn,j(" "+i(t.__("Print")),1)]),_:1})])])):m("",!0)])}const Gn=F(jn,[["render",In]]);export{D as P,rt as a,Gn as n}; diff --git a/public/build/assets/ns-orders-summary-PlQm0m_-.js b/public/build/assets/ns-orders-summary-6d8db186.js similarity index 88% rename from public/build/assets/ns-orders-summary-PlQm0m_-.js rename to public/build/assets/ns-orders-summary-6d8db186.js index 3b4c9360f..6413ceddc 100644 --- a/public/build/assets/ns-orders-summary-PlQm0m_-.js +++ b/public/build/assets/ns-orders-summary-6d8db186.js @@ -1 +1 @@ -import"./bootstrap-CnLEEQCx.js";import{_ as f,n as p}from"./currency-lOMYG1Wf.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as c,o,c as n,a as s,t,f as d,e as _,F as b,b as v,n as u}from"./runtime-core.esm-bundler-RT2b-_3S.js";const y={name:"ns-orders-summary",data(){return{orders:[],subscription:null,hasLoaded:!1}},mounted(){this.hasLoaded=!1,this.subscription=Dashboard.recentOrders.subscribe(a=>{this.hasLoaded=!0,this.orders=a})},methods:{__:f,nsCurrency:p},unmounted(){this.subscription.unsubscribe()}},g={id:"ns-orders-summary",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},k={class:"p-2 flex title items-center justify-between border-b"},w={class:"font-semibold"},C={class:"head flex-auto flex-col flex h-64 overflow-y-auto ns-scrollbar"},L={key:0,class:"h-full flex items-center justify-center"},j={key:1,class:"h-full flex items-center justify-center flex-col"},O=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),B={class:"text-sm"},N={class:"text-lg font-semibold"},V={class:"flex -mx-2"},z={class:"px-1"},D={class:"text-semibold text-xs"},F=s("i",{class:"lar la-user-circle"},null,-1),R=s("div",{class:"divide-y-4"},null,-1),S={class:"px-1"},E={class:"text-semibold text-xs"},W=s("i",{class:"las la-clock"},null,-1);function q(a,i,A,G,l,r){const h=c("ns-close-button"),m=c("ns-spinner");return o(),n("div",g,[s("div",k,[s("h3",w,t(r.__("Recents Orders")),1),s("div",null,[d(h,{onClick:i[0]||(i[0]=e=>a.$emit("onRemove"))})])]),s("div",C,[l.hasLoaded?_("",!0):(o(),n("div",L,[d(m,{size:"8",border:"4"})])),l.hasLoaded&&l.orders.length===0?(o(),n("div",j,[O,s("p",B,t(r.__("Well.. nothing to show for the meantime.")),1)])):_("",!0),(o(!0),n(b,null,v(l.orders,e=>(o(),n("div",{key:e.id,class:u([e.payment_status==="paid"?"paid-order":"other-order","border-b single-order p-2 flex justify-between"])},[s("div",null,[s("h3",N,t(r.__("Order"))+" : "+t(e.code),1),s("div",V,[s("div",z,[s("h4",D,[F,s("span",null,t(e.user.username),1)])]),R,s("div",S,[s("h4",E,[W,s("span",null,t(e.created_at),1)])])])]),s("div",null,[s("h2",{class:u([e.payment_status==="paid"?"paid-currency":"unpaid-currency","text-xl font-bold"])},t(r.nsCurrency(e.total)),3)])],2))),128))])])}const M=x(y,[["render",q]]);export{M as default}; +import"./bootstrap-8be442b1.js";import{_ as f,n as p}from"./currency-f8bd78d1.js";import{_ as x}from"./_plugin-vue_export-helper-c27b6911.js";import{r as c,o,c as n,a as s,t,f as d,e as _,F as b,b as v,n as u}from"./runtime-core.esm-bundler-b48de70a.js";const y={name:"ns-orders-summary",data(){return{orders:[],subscription:null,hasLoaded:!1}},mounted(){this.hasLoaded=!1,this.subscription=Dashboard.recentOrders.subscribe(a=>{this.hasLoaded=!0,this.orders=a})},methods:{__:f,nsCurrency:p},unmounted(){this.subscription.unsubscribe()}},g={id:"ns-orders-summary",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},k={class:"p-2 flex title items-center justify-between border-b"},w={class:"font-semibold"},C={class:"head flex-auto flex-col flex h-64 overflow-y-auto ns-scrollbar"},L={key:0,class:"h-full flex items-center justify-center"},j={key:1,class:"h-full flex items-center justify-center flex-col"},O=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1),B={class:"text-sm"},N={class:"text-lg font-semibold"},V={class:"flex -mx-2"},z={class:"px-1"},D={class:"text-semibold text-xs"},F=s("i",{class:"lar la-user-circle"},null,-1),R=s("div",{class:"divide-y-4"},null,-1),S={class:"px-1"},E={class:"text-semibold text-xs"},W=s("i",{class:"las la-clock"},null,-1);function q(a,i,A,G,l,r){const h=c("ns-close-button"),m=c("ns-spinner");return o(),n("div",g,[s("div",k,[s("h3",w,t(r.__("Recents Orders")),1),s("div",null,[d(h,{onClick:i[0]||(i[0]=e=>a.$emit("onRemove"))})])]),s("div",C,[l.hasLoaded?_("",!0):(o(),n("div",L,[d(m,{size:"8",border:"4"})])),l.hasLoaded&&l.orders.length===0?(o(),n("div",j,[O,s("p",B,t(r.__("Well.. nothing to show for the meantime.")),1)])):_("",!0),(o(!0),n(b,null,v(l.orders,e=>(o(),n("div",{key:e.id,class:u([e.payment_status==="paid"?"paid-order":"other-order","border-b single-order p-2 flex justify-between"])},[s("div",null,[s("h3",N,t(r.__("Order"))+" : "+t(e.code),1),s("div",V,[s("div",z,[s("h4",D,[F,s("span",null,t(e.user.username),1)])]),R,s("div",S,[s("h4",E,[W,s("span",null,t(e.created_at),1)])])])]),s("div",null,[s("h2",{class:u([e.payment_status==="paid"?"paid-currency":"unpaid-currency","text-xl font-bold"])},t(r.nsCurrency(e.total)),3)])],2))),128))])])}const M=x(y,[["render",q]]);export{M as default}; diff --git a/public/build/assets/ns-password-lost-Dg5NyGNB.js b/public/build/assets/ns-password-lost-11a5d453.js similarity index 90% rename from public/build/assets/ns-password-lost-Dg5NyGNB.js rename to public/build/assets/ns-password-lost-11a5d453.js index b1e166161..e1cdaba35 100644 --- a/public/build/assets/ns-password-lost-Dg5NyGNB.js +++ b/public/build/assets/ns-password-lost-11a5d453.js @@ -1 +1 @@ -import{_ as r}from"./currency-lOMYG1Wf.js";import{F as x,G as F,a,n as p,b as l}from"./bootstrap-CnLEEQCx.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,o as t,c,a as s,F as T,b as V,g as b,e as u,f,t as _,w as g,i as X}from"./runtime-core.esm-bundler-RT2b-_3S.js";const N={name:"ns-login",data(){return{fields:[],xXsrfToken:null,validation:new x,isSubitting:!1}},mounted(){F([a.get("/api/fields/ns.password-lost"),a.get("/sanctum/csrf-cookie")]).subscribe(i=>{this.fields=this.validation.createFields(i[0]),this.xXsrfToken=a.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>p.doAction("ns-login-mounted",this),100)},i=>{l.error(i.message||r("An unexpected error occurred."),r("OK"),{duration:0}).subscribe()})},methods:{__:r,requestRecovery(){if(!this.validation.validateFields(this.fields))return l.error(r("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),p.applyFilters("ns-password-lost-submit",!0)&&(this.isSubitting=!0,a.post("/auth/password-lost",this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe(e=>{l.success(e.message).subscribe(),setTimeout(()=>{document.location=e.data.redirectTo},500)},e=>{this.isSubitting=!1,this.validation.enableFields(this.fields),e.data&&this.validation.triggerFieldsErrors(this.fields,e.data),l.error(e.message).subscribe()}))}}},R={class:"bg-white rounded shadow overflow-hidden transition-all duration-100"},B={class:"p-3 -my-2"},C={key:0,class:"py-2 fade-in-entrance anim-duration-300"},j={key:0,class:"flex items-center justify-center py-10"},E={class:"flex w-full items-center justify-center py-4"},K={href:"/sign-in",class:"hover:underline text-blue-600 text-sm"},O={class:"flex justify-between items-center bg-gray-200 p-3"};function q(i,e,z,A,n,o){const v=d("ns-field"),m=d("ns-spinner"),y=d("ns-button"),k=d("ns-link");return t(),c("div",R,[s("div",B,[n.fields.length>0?(t(),c("div",C,[(t(!0),c(T,null,V(n.fields,(h,w)=>(t(),b(v,{key:w,field:h},null,8,["field"]))),128))])):u("",!0)]),n.fields.length===0?(t(),c("div",j,[f(m,{border:"4",size:"16"})])):u("",!0),s("div",E,[s("a",K,_(o.__("Remember Your Password ?")),1)]),s("div",O,[s("div",null,[f(y,{onClick:e[0]||(e[0]=h=>o.requestRecovery()),class:"justify-between",type:"info"},{default:g(()=>[n.isSubitting?(t(),b(m,{key:0,class:"mr-2",size:"6",border:"2"})):u("",!0),s("span",null,_(o.__("Submit")),1)]),_:1})]),s("div",null,[f(k,{href:"/sign-up",type:"success"},{default:g(()=>[X(_(o.__("Register")),1)]),_:1})])])])}const G=S(N,[["render",q]]);export{G as default}; +import{_ as r}from"./currency-f8bd78d1.js";import{F as x,G as F,a,n as p,b as l}from"./bootstrap-8be442b1.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";import{r as d,o as t,c,a as s,F as T,b as V,g as b,e as u,f,t as _,w as g,i as X}from"./runtime-core.esm-bundler-b48de70a.js";const N={name:"ns-login",data(){return{fields:[],xXsrfToken:null,validation:new x,isSubitting:!1}},mounted(){F([a.get("/api/fields/ns.password-lost"),a.get("/sanctum/csrf-cookie")]).subscribe(i=>{this.fields=this.validation.createFields(i[0]),this.xXsrfToken=a.response.config.headers["X-XSRF-TOKEN"],setTimeout(()=>p.doAction("ns-login-mounted",this),100)},i=>{l.error(i.message||r("An unexpected error occurred."),r("OK"),{duration:0}).subscribe()})},methods:{__:r,requestRecovery(){if(!this.validation.validateFields(this.fields))return l.error(r("Unable to proceed the form is not valid.")).subscribe();this.validation.disableFields(this.fields),p.applyFilters("ns-password-lost-submit",!0)&&(this.isSubitting=!0,a.post("/auth/password-lost",this.validation.getValue(this.fields),{headers:{"X-XSRF-TOKEN":this.xXsrfToken}}).subscribe(e=>{l.success(e.message).subscribe(),setTimeout(()=>{document.location=e.data.redirectTo},500)},e=>{this.isSubitting=!1,this.validation.enableFields(this.fields),e.data&&this.validation.triggerFieldsErrors(this.fields,e.data),l.error(e.message).subscribe()}))}}},R={class:"bg-white rounded shadow overflow-hidden transition-all duration-100"},B={class:"p-3 -my-2"},C={key:0,class:"py-2 fade-in-entrance anim-duration-300"},j={key:0,class:"flex items-center justify-center py-10"},E={class:"flex w-full items-center justify-center py-4"},K={href:"/sign-in",class:"hover:underline text-blue-600 text-sm"},O={class:"flex justify-between items-center bg-gray-200 p-3"};function q(i,e,z,A,n,o){const v=d("ns-field"),m=d("ns-spinner"),y=d("ns-button"),k=d("ns-link");return t(),c("div",R,[s("div",B,[n.fields.length>0?(t(),c("div",C,[(t(!0),c(T,null,V(n.fields,(h,w)=>(t(),b(v,{key:w,field:h},null,8,["field"]))),128))])):u("",!0)]),n.fields.length===0?(t(),c("div",j,[f(m,{border:"4",size:"16"})])):u("",!0),s("div",E,[s("a",K,_(o.__("Remember Your Password ?")),1)]),s("div",O,[s("div",null,[f(y,{onClick:e[0]||(e[0]=h=>o.requestRecovery()),class:"justify-between",type:"info"},{default:g(()=>[n.isSubitting?(t(),b(m,{key:0,class:"mr-2",size:"6",border:"2"})):u("",!0),s("span",null,_(o.__("Submit")),1)]),_:1})]),s("div",null,[f(k,{href:"/sign-up",type:"success"},{default:g(()=>[X(_(o.__("Register")),1)]),_:1})])])])}const G=S(N,[["render",q]]);export{G as default}; diff --git a/public/build/assets/ns-payment-types-report-CG9D6K6Q.js b/public/build/assets/ns-payment-types-report-3fa90e99.js similarity index 87% rename from public/build/assets/ns-payment-types-report-CG9D6K6Q.js rename to public/build/assets/ns-payment-types-report-3fa90e99.js index 1e197964e..b4c9cb983 100644 --- a/public/build/assets/ns-payment-types-report-CG9D6K6Q.js +++ b/public/build/assets/ns-payment-types-report-3fa90e99.js @@ -1 +1 @@ -import{h as l,b as d,a as h}from"./bootstrap-CnLEEQCx.js";import{c as f,e as x}from"./components-D4w1etK_.js";import{_ as i,n as y}from"./currency-lOMYG1Wf.js";import{_ as v}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as D,o as c,c as _,a as e,f as u,t as s,F as g,b as k}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";const w={name:"ns-payment-types-report",props:["storeName","storeLogo"],data(){return{startDateField:{type:"datetimepicker",value:l(ns.date.current).startOf("day").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:l(ns.date.current).endOf("day").format("YYYY-MM-DD HH:mm:ss")},report:[],ns:window.ns,field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:f,nsDateTimePicker:x},computed:{},mounted(){},methods:{__:i,nsCurrency:y,printSaleReport(){this.$htmlToPaper("sale-report")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(i("Unable to proceed. Select a correct time range.")).subscribe();const p=l(this.startDateField.value);if(l(this.endDateField.value).isBefore(p))return d.error(i("Unable to proceed. The current time range is not valid.")).subscribe();h.post("/api/reports/payment-types",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:r=>{this.report=r},error:r=>{d.error(r.message).subscribe()}})}}},F={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},C={class:"px-2"},M={class:"px-2"},T={class:"px-2"},B=e("i",{class:"las la-sync-alt text-xl"},null,-1),S={class:"pl-2"},H={class:"px-2"},P=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},L={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},N={class:"flex w-full"},j={class:"my-4 flex justify-between w-full"},O={class:"text-secondary"},U={class:"pb-1 border-b border-dashed"},V={class:"pb-1 border-b border-dashed"},E={class:"pb-1 border-b border-dashed"},q=["src","alt"],z={class:"bg-box-background shadow rounded my-4"},A={class:"border-b border-box-edge"},G={class:"table ns-table w-full"},I={class:"text-primary"},J={class:"text-primary border p-2 text-left"},K={width:"150",class:"text-primary border p-2 text-right"},Q={class:"text-primary"},W={class:"p-2 border border-box-edge"},X={class:"p-2 border text-right"},Z={class:"text-primary font-semibold"},$={class:"p-2 border border-box-edge text-primary"},ee={class:"p-2 border text-right"};function te(p,a,r,se,o,t){const m=D("ns-field");return c(),_("div",F,[e("div",Y,[e("div",C,[u(m,{field:o.startDateField},null,8,["field"])]),e("div",M,[u(m,{field:o.endDateField},null,8,["field"])]),e("div",T,[e("button",{onClick:a[0]||(a[0]=n=>t.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[B,e("span",S,s(t.__("Load")),1)])]),e("div",H,[e("button",{onClick:a[1]||(a[1]=n=>t.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[P,e("span",R,s(t.__("Print")),1)])])]),e("div",L,[e("div",N,[e("div",j,[e("div",O,[e("ul",null,[e("li",U,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",V,s(t.__("Document : Payment Type")),1),e("li",E,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:r.storeLogo,alt:r.storeName},null,8,q)])])]),e("div",z,[e("div",A,[e("table",G,[e("thead",I,[e("tr",null,[e("th",J,s(t.__("Summary")),1),e("th",K,s(t.__("Total")),1)])]),e("tbody",Q,[(c(!0),_(g,null,k(o.report.summary,(n,b)=>(c(),_("tr",{key:b,class:"font-semibold"},[e("td",W,s(n.label),1),e("td",X,s(t.nsCurrency(n.total)),1)]))),128))]),e("tfoot",Z,[e("tr",null,[e("td",$,s(t.__("Total")),1),e("td",ee,s(t.nsCurrency(o.report.total)),1)])])])])])])])}const pe=v(w,[["render",te]]);export{pe as default}; +import{h as l,b as d,a as h}from"./bootstrap-8be442b1.js";import{c as f,e as x}from"./components-ef1ba55f.js";import{_ as i,n as y}from"./currency-f8bd78d1.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as D,o as c,c as _,a as e,f as u,t as s,F as g,b as k}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";const w={name:"ns-payment-types-report",props:["storeName","storeLogo"],data(){return{startDateField:{type:"datetimepicker",value:l(ns.date.current).startOf("day").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:l(ns.date.current).endOf("day").format("YYYY-MM-DD HH:mm:ss")},report:[],ns:window.ns,field:{type:"datetimepicker",value:"2021-02-07",name:"date"}}},components:{nsDatepicker:f,nsDateTimePicker:x},computed:{},mounted(){},methods:{__:i,nsCurrency:y,printSaleReport(){this.$htmlToPaper("sale-report")},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return d.error(i("Unable to proceed. Select a correct time range.")).subscribe();const p=l(this.startDateField.value);if(l(this.endDateField.value).isBefore(p))return d.error(i("Unable to proceed. The current time range is not valid.")).subscribe();h.post("/api/reports/payment-types",{startDate:this.startDateField.value,endDate:this.endDateField.value}).subscribe({next:r=>{this.report=r},error:r=>{d.error(r.message).subscribe()}})}}},F={id:"report-section",class:"px-4"},Y={class:"flex -mx-2"},C={class:"px-2"},M={class:"px-2"},T={class:"px-2"},B=e("i",{class:"las la-sync-alt text-xl"},null,-1),S={class:"pl-2"},H={class:"px-2"},P=e("i",{class:"las la-print text-xl"},null,-1),R={class:"pl-2"},L={id:"sale-report",class:"anim-duration-500 fade-in-entrance"},N={class:"flex w-full"},j={class:"my-4 flex justify-between w-full"},O={class:"text-secondary"},U={class:"pb-1 border-b border-dashed"},V={class:"pb-1 border-b border-dashed"},E={class:"pb-1 border-b border-dashed"},q=["src","alt"],z={class:"bg-box-background shadow rounded my-4"},A={class:"border-b border-box-edge"},G={class:"table ns-table w-full"},I={class:"text-primary"},J={class:"text-primary border p-2 text-left"},K={width:"150",class:"text-primary border p-2 text-right"},Q={class:"text-primary"},W={class:"p-2 border border-box-edge"},X={class:"p-2 border text-right"},Z={class:"text-primary font-semibold"},$={class:"p-2 border border-box-edge text-primary"},ee={class:"p-2 border text-right"};function te(p,a,r,se,o,t){const m=D("ns-field");return c(),_("div",F,[e("div",Y,[e("div",C,[u(m,{field:o.startDateField},null,8,["field"])]),e("div",M,[u(m,{field:o.endDateField},null,8,["field"])]),e("div",T,[e("button",{onClick:a[0]||(a[0]=n=>t.loadReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[B,e("span",S,s(t.__("Load")),1)])]),e("div",H,[e("button",{onClick:a[1]||(a[1]=n=>t.printSaleReport()),class:"rounded flex justify-between bg-input-button shadow py-1 items-center text-primary px-2"},[P,e("span",R,s(t.__("Print")),1)])])]),e("div",L,[e("div",N,[e("div",j,[e("div",O,[e("ul",null,[e("li",U,s(t.__("Date : {date}").replace("{date}",o.ns.date.current)),1),e("li",V,s(t.__("Document : Payment Type")),1),e("li",E,s(t.__("By : {user}").replace("{user}",o.ns.user.username)),1)])]),e("div",null,[e("img",{class:"w-24",src:r.storeLogo,alt:r.storeName},null,8,q)])])]),e("div",z,[e("div",A,[e("table",G,[e("thead",I,[e("tr",null,[e("th",J,s(t.__("Summary")),1),e("th",K,s(t.__("Total")),1)])]),e("tbody",Q,[(c(!0),_(g,null,k(o.report.summary,(n,b)=>(c(),_("tr",{key:b,class:"font-semibold"},[e("td",W,s(n.label),1),e("td",X,s(t.nsCurrency(n.total)),1)]))),128))]),e("tfoot",Z,[e("tr",null,[e("td",$,s(t.__("Total")),1),e("td",ee,s(t.nsCurrency(o.report.total)),1)])])])])])])])}const pe=v(w,[["render",te]]);export{pe as default}; diff --git a/public/build/assets/ns-permissions-Vq5RVCAd.js b/public/build/assets/ns-permissions-96631af1.js similarity index 94% rename from public/build/assets/ns-permissions-Vq5RVCAd.js rename to public/build/assets/ns-permissions-96631af1.js index 51d6c62a2..003011127 100644 --- a/public/build/assets/ns-permissions-Vq5RVCAd.js +++ b/public/build/assets/ns-permissions-96631af1.js @@ -1 +1 @@ -import{E as y,b as g,a as m,G as v,v as k}from"./bootstrap-CnLEEQCx.js";import{_ as f}from"./currency-lOMYG1Wf.js";import{_ as w}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as P,o,c as l,a as i,B as j,t as p,e as u,F as h,b,n as C,f as x}from"./runtime-core.esm-bundler-RT2b-_3S.js";const T={name:"ns-permissions",filters:[y],data(){return{permissions:[],toggled:!1,roles:[],searchText:""}},computed:{filteredPermissions(){return this.searchText.length!==0?this.permissions.filter(e=>{const s=new RegExp(this.searchText,"i");return s.test(e.name)||s.test(e.namespace)}):this.permissions}},mounted(){this.loadPermissionsAndRoles(),nsHotPress.create("ns-permissions").whenPressed("shift+/",e=>{this.searchText="",setTimeout(()=>{this.$refs.search.focus()},5)}).whenPressed("/",e=>{this.searchText="",setTimeout(()=>{this.$refs.search.focus()},5)})},methods:{__:f,copyPermisson(e){navigator.clipboard.writeText(e).then(function(){g.success(f("Copied to clipboard"),null,{duration:3e3}).subscribe()},function(s){console.error("Could not copy text: ",s)})},async selectAllPermissions(e){const s=new Object;s[e.namespace]=new Object;let r=!1;if(e.locked&&(r=await new Promise((a,t)=>{Popup.show(nsConfirmPopup,{title:f("Confirm Your Action"),message:f("Would you like to bulk edit a system role ?"),onAction:c=>a(!!c)})})),!e.locked||e.locked&&r){const a=this.filterObjectByKeys(e.fields,this.filteredPermissions.map(t=>t.namespace));for(let t in a)e.fields[t].value=e.field.value,s[e.namespace][t]=e.field.value;this.arrayToObject(this.filteredPermissions,"namespace",t=>s[e.namespace][t.namespace]),m.put("/api/users/roles",s).subscribe(t=>{g.success(t.message,null,{duration:3e3}).subscribe()})}else e.field.value=!e.field.value},filterObjectByKeys(e,s){return Object.fromEntries(Object.entries(e).filter(([r])=>s.includes(r)))},arrayToObject(e,s,r){return Object.assign({},...e.map(a=>({[a[s]]:r(a)})))},submitPermissions(e,s){const r=new Object;r[e.namespace]=new Object,r[e.namespace][s.name]=s.value,m.put("/api/users/roles",r).subscribe(a=>{g.success(a.message,null,{duration:3e3}).subscribe()})},loadPermissionsAndRoles(){return v([m.get("/api/users/roles"),m.get("/api/users/permissions")]).subscribe(e=>{this.permissions=e[1],this.roles=e[0].map(s=>(s.fields={},s.field={type:"checkbox",name:s.namespace,value:!1},this.permissions.forEach(r=>{s.fields[r.namespace]={type:"checkbox",value:s.permissions.filter(a=>a.namespace===r.namespace).length>0,name:r.namespace,label:null}}),s))})}}},O={id:"permission-wrapper"},B={class:"my-2"},A=["placeholder"],E={class:"rounded shadow ns-box flex"},R={id:"permissions",class:"w- bg-gray-800 flex-shrink-0"},V={class:"h-24 py-4 px-2 border-b border-gray-700 text-gray-100 flex justify-between items-center"},N={key:0},D=i("i",{class:"las la-expand"},null,-1),F=[D],H=i("i",{class:"las la-compress"},null,-1),K=[H],S=["onClick","title"],z={key:0},G={key:1},J={class:"flex flex-auto overflow-hidden"},L={class:"overflow-y-auto"},M={class:"text-gray-700 flex"},U={class:"mx-1"},W={class:"mx-1"};function Y(e,s,r,a,t,c){const _=P("ns-checkbox");return o(),l("div",O,[i("div",B,[j(i("input",{ref:"search","onUpdate:modelValue":s[0]||(s[0]=n=>t.searchText=n),type:"text",placeholder:c.__('Press "/" to search permissions'),class:"border-2 p-2 w-full outline-none bg-input-background border-input-edge text-primary"},null,8,A),[[k,t.searchText]])]),i("div",E,[i("div",R,[i("div",V,[t.toggled?u("",!0):(o(),l("span",N,p(c.__("Permissions")),1)),i("div",null,[t.toggled?u("",!0):(o(),l("button",{key:0,onClick:s[1]||(s[1]=n=>t.toggled=!t.toggled),class:"rounded-full bg-white text-gray-700 h-6 w-6 flex items-center justify-center"},F)),t.toggled?(o(),l("button",{key:1,onClick:s[2]||(s[2]=n=>t.toggled=!t.toggled),class:"rounded-full bg-white text-gray-700 h-6 w-6 flex items-center justify-center"},K)):u("",!0)])]),(o(!0),l(h,null,b(c.filteredPermissions,n=>(o(),l("div",{key:n.id,class:C([t.toggled?"w-24":"w-54","p-2 border-b border-gray-700 text-gray-100"])},[i("a",{onClick:d=>c.copyPermisson(n.namespace),href:"javascript:void(0)",title:n.namespace},[t.toggled?u("",!0):(o(),l("span",z,p(n.name),1)),t.toggled?(o(),l("span",G,p(n.name),1)):u("",!0)],8,S)],2))),128))]),i("div",J,[i("div",L,[i("div",M,[(o(!0),l(h,null,b(t.roles,n=>(o(),l("div",{key:n.id,class:"h-24 py-4 px-2 w-56 items-center border-b justify-center flex role flex-shrink-0 border-r border-table-th-edge"},[i("p",U,[i("span",null,p(n.name),1)]),i("span",W,[x(_,{onChange:d=>c.selectAllPermissions(n),field:n.field},null,8,["onChange","field"])])]))),128))]),(o(!0),l(h,null,b(c.filteredPermissions,n=>(o(),l("div",{key:n.id,class:"permission flex"},[(o(!0),l(h,null,b(t.roles,d=>(o(),l("div",{key:d.id,class:"border-b border-table-th-edge w-56 flex-shrink-0 p-2 flex items-center justify-center border-r"},[x(_,{onChange:q=>c.submitPermissions(d,d.fields[n.namespace]),field:d.fields[n.namespace]},null,8,["onChange","field"])]))),128))]))),128))])])])])}const $=w(T,[["render",Y]]);export{$ as default}; +import{E as y,b as g,a as m,G as v,v as k}from"./bootstrap-8be442b1.js";import{_ as f}from"./currency-f8bd78d1.js";import{_ as w}from"./_plugin-vue_export-helper-c27b6911.js";import{r as P,o,c as l,a as i,B as j,t as p,e as u,F as h,b,n as C,f as x}from"./runtime-core.esm-bundler-b48de70a.js";const T={name:"ns-permissions",filters:[y],data(){return{permissions:[],toggled:!1,roles:[],searchText:""}},computed:{filteredPermissions(){return this.searchText.length!==0?this.permissions.filter(e=>{const s=new RegExp(this.searchText,"i");return s.test(e.name)||s.test(e.namespace)}):this.permissions}},mounted(){this.loadPermissionsAndRoles(),nsHotPress.create("ns-permissions").whenPressed("shift+/",e=>{this.searchText="",setTimeout(()=>{this.$refs.search.focus()},5)}).whenPressed("/",e=>{this.searchText="",setTimeout(()=>{this.$refs.search.focus()},5)})},methods:{__:f,copyPermisson(e){navigator.clipboard.writeText(e).then(function(){g.success(f("Copied to clipboard"),null,{duration:3e3}).subscribe()},function(s){console.error("Could not copy text: ",s)})},async selectAllPermissions(e){const s=new Object;s[e.namespace]=new Object;let r=!1;if(e.locked&&(r=await new Promise((a,t)=>{Popup.show(nsConfirmPopup,{title:f("Confirm Your Action"),message:f("Would you like to bulk edit a system role ?"),onAction:c=>a(!!c)})})),!e.locked||e.locked&&r){const a=this.filterObjectByKeys(e.fields,this.filteredPermissions.map(t=>t.namespace));for(let t in a)e.fields[t].value=e.field.value,s[e.namespace][t]=e.field.value;this.arrayToObject(this.filteredPermissions,"namespace",t=>s[e.namespace][t.namespace]),m.put("/api/users/roles",s).subscribe(t=>{g.success(t.message,null,{duration:3e3}).subscribe()})}else e.field.value=!e.field.value},filterObjectByKeys(e,s){return Object.fromEntries(Object.entries(e).filter(([r])=>s.includes(r)))},arrayToObject(e,s,r){return Object.assign({},...e.map(a=>({[a[s]]:r(a)})))},submitPermissions(e,s){const r=new Object;r[e.namespace]=new Object,r[e.namespace][s.name]=s.value,m.put("/api/users/roles",r).subscribe(a=>{g.success(a.message,null,{duration:3e3}).subscribe()})},loadPermissionsAndRoles(){return v([m.get("/api/users/roles"),m.get("/api/users/permissions")]).subscribe(e=>{this.permissions=e[1],this.roles=e[0].map(s=>(s.fields={},s.field={type:"checkbox",name:s.namespace,value:!1},this.permissions.forEach(r=>{s.fields[r.namespace]={type:"checkbox",value:s.permissions.filter(a=>a.namespace===r.namespace).length>0,name:r.namespace,label:null}}),s))})}}},O={id:"permission-wrapper"},B={class:"my-2"},A=["placeholder"],E={class:"rounded shadow ns-box flex"},R={id:"permissions",class:"w- bg-gray-800 flex-shrink-0"},V={class:"h-24 py-4 px-2 border-b border-gray-700 text-gray-100 flex justify-between items-center"},N={key:0},D=i("i",{class:"las la-expand"},null,-1),F=[D],H=i("i",{class:"las la-compress"},null,-1),K=[H],S=["onClick","title"],z={key:0},G={key:1},J={class:"flex flex-auto overflow-hidden"},L={class:"overflow-y-auto"},M={class:"text-gray-700 flex"},U={class:"mx-1"},W={class:"mx-1"};function Y(e,s,r,a,t,c){const _=P("ns-checkbox");return o(),l("div",O,[i("div",B,[j(i("input",{ref:"search","onUpdate:modelValue":s[0]||(s[0]=n=>t.searchText=n),type:"text",placeholder:c.__('Press "/" to search permissions'),class:"border-2 p-2 w-full outline-none bg-input-background border-input-edge text-primary"},null,8,A),[[k,t.searchText]])]),i("div",E,[i("div",R,[i("div",V,[t.toggled?u("",!0):(o(),l("span",N,p(c.__("Permissions")),1)),i("div",null,[t.toggled?u("",!0):(o(),l("button",{key:0,onClick:s[1]||(s[1]=n=>t.toggled=!t.toggled),class:"rounded-full bg-white text-gray-700 h-6 w-6 flex items-center justify-center"},F)),t.toggled?(o(),l("button",{key:1,onClick:s[2]||(s[2]=n=>t.toggled=!t.toggled),class:"rounded-full bg-white text-gray-700 h-6 w-6 flex items-center justify-center"},K)):u("",!0)])]),(o(!0),l(h,null,b(c.filteredPermissions,n=>(o(),l("div",{key:n.id,class:C([t.toggled?"w-24":"w-54","p-2 border-b border-gray-700 text-gray-100"])},[i("a",{onClick:d=>c.copyPermisson(n.namespace),href:"javascript:void(0)",title:n.namespace},[t.toggled?u("",!0):(o(),l("span",z,p(n.name),1)),t.toggled?(o(),l("span",G,p(n.name),1)):u("",!0)],8,S)],2))),128))]),i("div",J,[i("div",L,[i("div",M,[(o(!0),l(h,null,b(t.roles,n=>(o(),l("div",{key:n.id,class:"h-24 py-4 px-2 w-56 items-center border-b justify-center flex role flex-shrink-0 border-r border-table-th-edge"},[i("p",U,[i("span",null,p(n.name),1)]),i("span",W,[x(_,{onChange:d=>c.selectAllPermissions(n),field:n.field},null,8,["onChange","field"])])]))),128))]),(o(!0),l(h,null,b(c.filteredPermissions,n=>(o(),l("div",{key:n.id,class:"permission flex"},[(o(!0),l(h,null,b(t.roles,d=>(o(),l("div",{key:d.id,class:"border-b border-table-th-edge w-56 flex-shrink-0 p-2 flex items-center justify-center border-r"},[x(_,{onChange:q=>c.submitPermissions(d,d.fields[n.namespace]),field:d.fields[n.namespace]},null,8,["onChange","field"])]))),128))]))),128))])])])])}const $=w(T,[["render",Y]]);export{$ as default}; diff --git a/public/build/assets/ns-pos-Bfp50WUL.js b/public/build/assets/ns-pos-982621e4.js similarity index 70% rename from public/build/assets/ns-pos-Bfp50WUL.js rename to public/build/assets/ns-pos-982621e4.js index ef86a1a33..bd0480c23 100644 --- a/public/build/assets/ns-pos-Bfp50WUL.js +++ b/public/build/assets/ns-pos-982621e4.js @@ -1 +1 @@ -import b from"./ns-pos-cart-BIVAfgl2.js";import v from"./ns-pos-grid-BRV51Ubf.js";import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r,o as e,c as o,a as i,F as h,b as x,g as S,j as w,n as l,f as c,e as a}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./bootstrap-CnLEEQCx.js";import"./currency-lOMYG1Wf.js";import"./pos-section-switch-DmfccXVX.js";import"./ns-pos-order-type-popup-BV_7i2Py.js";import"./ns-prompt-popup-DKRiwYBT.js";import"./ns-orders-preview-popup-DkNvPnrF.js";import"./index.es-Br67aBEV.js";import"./ns-pos-shipping-popup-DbqQTrvM.js";const k={name:"ns-pos",computed:{buttons(){return POS.header.buttons}},mounted(){this.visibleSectionSubscriber=POS.visibleSection.subscribe(n=>{this.visibleSection=n});const s=document.getElementById("loader");s.classList.remove("fade-in-entrance"),s.classList.add("fade-out-exit"),setTimeout(()=>{s.remove(),POS.reset()},500)},unmounted(){this.visibleSectionSubscriber.unsubscribe()},data(){return{visibleSection:null,visibleSectionSubscriber:null}},components:{nsPosCart:b,nsPosGrid:v}},g={class:"h-full flex-auto flex flex-col",id:"pos-container"},P={class:"flex overflow-hidden flex-shrink-0 px-2 pt-2"},y={class:"-mx-2 flex overflow-x-auto pb-1"},B={class:"flex-auto overflow-hidden flex p-2"},C={class:"flex flex-auto overflow-hidden -m-2"};function L(s,n,N,O,t,d){const m=r("ns-pos-cart"),u=r("ns-pos-grid");return e(),o("div",g,[i("div",P,[i("div",y,[(e(!0),o(h,null,x(d.buttons,(p,f)=>(e(),o("div",{class:"header-buttons flex px-2 flex-shrink-0",key:f},[(e(),S(w(p)))]))),128))])]),i("div",B,[i("div",C,[["both","cart"].includes(t.visibleSection)?(e(),o("div",{key:0,class:l([t.visibleSection==="both"?"w-1/2":"w-full","flex overflow-hidden p-2"])},[c(m)],2)):a("",!0),["both","grid"].includes(t.visibleSection)?(e(),o("div",{key:1,class:l([t.visibleSection==="both"?"w-1/2":"w-full","p-2 flex overflow-hidden"])},[c(u)],2)):a("",!0)])])])}const J=_(k,[["render",L]]);export{J as default}; +import b from"./ns-pos-cart-64fbf2af.js";import v from"./ns-pos-grid-0d26a576.js";import{_}from"./_plugin-vue_export-helper-c27b6911.js";import{r,o as e,c as o,a as i,F as h,b as x,g as S,j as w,n as l,f as c,e as a}from"./runtime-core.esm-bundler-b48de70a.js";import"./bootstrap-8be442b1.js";import"./currency-f8bd78d1.js";import"./pos-section-switch-0869c4e1.js";import"./ns-pos-order-type-popup-5204386b.js";import"./ns-prompt-popup-100414c5.js";import"./ns-orders-preview-popup-5ba94079.js";import"./index.es-25aa42ee.js";import"./ns-pos-shipping-popup-acf8319e.js";const k={name:"ns-pos",computed:{buttons(){return POS.header.buttons}},mounted(){this.visibleSectionSubscriber=POS.visibleSection.subscribe(n=>{this.visibleSection=n});const s=document.getElementById("loader");s.classList.remove("fade-in-entrance"),s.classList.add("fade-out-exit"),setTimeout(()=>{s.remove(),POS.reset()},500)},unmounted(){this.visibleSectionSubscriber.unsubscribe()},data(){return{visibleSection:null,visibleSectionSubscriber:null}},components:{nsPosCart:b,nsPosGrid:v}},g={class:"h-full flex-auto flex flex-col",id:"pos-container"},P={class:"flex overflow-hidden flex-shrink-0 px-2 pt-2"},y={class:"-mx-2 flex overflow-x-auto pb-1"},B={class:"flex-auto overflow-hidden flex p-2"},C={class:"flex flex-auto overflow-hidden -m-2"};function L(s,n,N,O,t,d){const m=r("ns-pos-cart"),u=r("ns-pos-grid");return e(),o("div",g,[i("div",P,[i("div",y,[(e(!0),o(h,null,x(d.buttons,(p,f)=>(e(),o("div",{class:"header-buttons flex px-2 flex-shrink-0",key:f},[(e(),S(w(p)))]))),128))])]),i("div",B,[i("div",C,[["both","cart"].includes(t.visibleSection)?(e(),o("div",{key:0,class:l([t.visibleSection==="both"?"w-1/2":"w-full","flex overflow-hidden p-2"])},[c(m)],2)):a("",!0),["both","grid"].includes(t.visibleSection)?(e(),o("div",{key:1,class:l([t.visibleSection==="both"?"w-1/2":"w-full","p-2 flex overflow-hidden"])},[c(u)],2)):a("",!0)])])])}const J=_(k,[["render",L]]);export{J as default}; diff --git a/public/build/assets/ns-pos-cart-BIVAfgl2.js b/public/build/assets/ns-pos-cart-64fbf2af.js similarity index 98% rename from public/build/assets/ns-pos-cart-BIVAfgl2.js rename to public/build/assets/ns-pos-cart-64fbf2af.js index 068225dfb..f80d3fe82 100644 --- a/public/build/assets/ns-pos-cart-BIVAfgl2.js +++ b/public/build/assets/ns-pos-cart-64fbf2af.js @@ -1 +1 @@ -import{g as q,v as R,w as A,F as D,p as V,b as v,a as U,G as E,n as I,P as y}from"./bootstrap-CnLEEQCx.js";import{_ as a,n as B}from"./currency-lOMYG1Wf.js";import{s as M}from"./pos-section-switch-DmfccXVX.js";import{a as H,c as Y,n as G,b as $,P as W}from"./ns-pos-order-type-popup-BV_7i2Py.js";import{_ as P}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as i,c as d,a as o,t as r,r as b,f,B as z,F as x,b as C,g as S,w as k,i as O,e as p,h as T,ay as j,n as N,j as L}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{c as K,a as J,j as X,n as F}from"./ns-prompt-popup-DKRiwYBT.js";import Z from"./ns-pos-shipping-popup-DbqQTrvM.js";import"./index.es-Br67aBEV.js";import"./ns-orders-preview-popup-DkNvPnrF.js";const ee={props:["order"],methods:{__,async payOrder(){const e=nsHooks.applyFilters("ns-pay-queue",[ProductsQueue,CustomerQueue,TypeQueue,PaymentQueue]);for(let t in e)try{const l=await new e[t](this.order).run()}catch{return!1}}},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_payment"].includes(e)&&nsHotPress.create("ns_pos_keyboard_payment").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.payOrder()})},unmounted(){nsHotPress.destroy("ns_pos_keyboard_payment")}},te=o("i",{class:"mr-2 text-2xl lg:text-xl las la-cash-register"},null,-1),se={class:"text-lg hidden md:inline lg:text-2xl"};function oe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.payOrder()),id:"pay-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-green-500 text-white hover:bg-green-600 border-r border-green-600 flex-auto"},[te,o("span",se,r(s.__("Pay")),1)])}const re=P(ee,[["render",oe]]),ne={name:"ns-pos-hold-orders",props:["popup"],data(){return{order:{},title:"",show:!0}},mounted(){this.popupCloser(),this.show=POS.getHoldPopupEnabled(),this.show||this.popup.params.resolve({title:this.title}),this.$refs.reference.focus(),this.$refs.reference.select(),this.order=this.popup.params.order,this.title=this.popup.params.order.title||""},methods:{__:a,nsCurrency:B,popupCloser:q,submitHold(){this.popup.close(),this.popup.params.resolve({title:this.title})}}},ie={class:"ns-box shadow-lg w-6/7-screen md:w-3/7-screen lg:w-2/6-screen"},de={class:"p-2 flex ns-box-header justify-between border-b items-center"},le={class:"font-semibold"},ae={class:"flex-auto ns-box-body"},ue={class:"border-b h-16 flex items-center justify-center"},ce={class:"text-5xl text-primary"},pe={class:"p-2"},_e={class:"input-group border-2 info"},he=["placeholder"],be={class:"p-2"},me={class:"text-secondary"},fe={class:"flex ns-box-footer"};function ye(e,t,u,l,c,s){const n=b("ns-close-button");return i(),d("div",ie,[o("div",de,[o("h3",le,r(s.__("Hold Order")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=_=>u.popup.close())})])]),o("div",ae,[o("div",ue,[o("span",ce,r(s.nsCurrency(c.order.total)),1)]),o("div",pe,[o("div",_e,[z(o("input",{onKeyup:t[1]||(t[1]=A(_=>s.submitHold(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=_=>c.title=_),ref:"reference",type:"text",placeholder:s.__("Order Reference"),class:"outline-none rounded border-2 p-2 w-full"},null,40,he),[[R,c.title]])])]),o("div",be,[o("p",me,r(s.__("The current order will be set on hold. You can retrieve this order from the pending order button. Providing a reference to it might help you to identify the order more quickly.")),1)])]),o("div",fe,[o("div",{onClick:t[3]||(t[3]=_=>s.submitHold()),class:"cursor-pointer w-1/2 py-3 flex justify-center items-center bg-green-500 text-white font-semibold"},r(s.__("Confirm")),1),o("div",{onClick:t[4]||(t[4]=_=>u.popup.close()),class:"cursor-pointer w-1/2 py-3 flex justify-center items-center bg-error-secondary text-white font-semibold"},r(s.__("Cancel")),1)])])}const ve=P(ne,[["render",ye]]),xe={props:["order"],methods:{__,async holdOrder(){if(this.order.payment_status!=="hold"&&this.order.payments.length>0)return nsSnackBar.error(__("Unable to hold an order which payment status has been updated already.")).subscribe();const e=nsHooks.applyFilters("ns-hold-queue",[ProductsQueue,CustomerQueue,TypeQueue]);for(let u in e)try{const c=await new e[u](this.order).run()}catch{return!1}nsHooks.applyFilters("ns-override-hold-popup",()=>{new Promise((l,c)=>{Popup.show(ve,{resolve:l,reject:c,order:this.order})}).then(l=>{this.order.title=l.title,this.order.payment_status="hold",POS.order.next(this.order);const c=Popup.show(K);POS.submitOrder().then(s=>{c.close(),nsSnackBar.success(s.message).subscribe()},s=>{c.close(),nsSnackBar.error(s.message).subscribe()})}).catch(l=>{console.log(l)})})()}},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_hold_order"].includes(e)&&nsHotPress.create("ns_pos_keyboard_hold_order").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.holdOrder()})},unmounted(){nsHotPress.destroy("ns_pos_keyboard_hold_order")}},we=o("i",{class:"mr-2 text-2xl lg:text-xl las la-pause"},null,-1),ge={class:"text-lg hidden md:inline lg:text-2xl"};function Pe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.holdOrder()),id:"hold-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-blue-500 text-white border-r hover:bg-blue-600 border-blue-600 flex-auto"},[we,o("span",ge,r(s.__("Hold")),1)])}const ke=P(xe,[["render",Pe]]),Ce={props:["order","settings"],methods:{__,openDiscountPopup(e,t,u=null){if(!this.settings.products_discount&&t==="product")return nsSnackBar.error(__("You're not allowed to add a discount on the product.")).subscribe();if(!this.settings.cart_discount&&t==="cart")return nsSnackBar.error(__("You're not allowed to add a discount on the cart.")).subscribe();Popup.show(H,{reference:e,type:t,onSubmit(l){t==="product"?POS.updateProduct(e,l,u):t==="cart"&&POS.updateCart(e,l)}},{popupClass:"bg-white h:2/3 shadow-lg xl:w-1/4 lg:w-2/5 md:w-2/3 w-full"})}}},Se=o("i",{class:"mr-2 text-2xl lg:text-xl las la-percent"},null,-1),Te={class:"text-lg hidden md:inline lg:text-2xl"};function Oe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.openDiscountPopup(u.order,"cart")),id:"discount-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center border-r border-box-edge flex-auto"},[Se,o("span",Te,r(s.__("Discount")),1)])}const je=P(Ce,[["render",Oe]]),Ne={props:["order","settings"],methods:{__,voidOngoingOrder(){POS.voidOrder(this.order)}}},qe=o("i",{class:"mr-2 text-2xl lg:text-xl las la-trash"},null,-1),De={class:"text-lg hidden md:inline lg:text-2xl"};function Be(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.voidOngoingOrder(u.order)),id:"void-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-red-500 text-white border-box-edge hover:bg-red-600 flex-auto"},[qe,o("span",De,r(s.__("Void")),1)])}const Fe=P(Ne,[["render",Be]]),Ve={name:"ns-pos-note-popup",props:["popup"],data(){return{validation:new D,fields:[{label:a("Note"),name:"note",value:"",description:a("More details about this order"),type:"textarea"},{label:a("Display On Receipt"),name:"note_visibility",value:"",options:[{label:a("Yes"),value:"visible"},{label:a("No"),value:"hidden"}],description:a("Will display the note on the receipt"),type:"switch"}]}},mounted(){this.popupCloser(),this.fields.forEach(e=>{e.name==="note"?e.value=this.popup.params.note:e.name==="note_visibility"&&(e.value=this.popup.params.note_visibility)})},methods:{__:a,popupResolver:V,popupCloser:q,closePopup(){this.popupResolver(!1)},saveNote(){if(!this.validation.validateFields(this.fields)){const e=this.validation.validateFieldsErrors(this.fields);return this.validation.triggerFieldsErrors(this.fields,e),this.$forceUpdate(),v.error(a("Unable to proceed the form is not valid.")).subscribe()}return this.popupResolver(this.validation.extractFields(this.fields))}}},He={class:"shadow-lg ns-box w-95vw md:w-3/5-screen lg:w-2/5-screen"},Qe={class:"p-2 flex justify-between items-center border-b ns-box-header"},Re={class:"font-bold"},Ae={class:"p-2"},Ue={class:"p-2 flex justify-end border-t ns-box-footer"};function Ee(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button");return i(),d("div",He,[o("div",Qe,[o("h3",Re,r(s.__("Order Note")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.closePopup())})])]),o("div",Ae,[(i(!0),d(x,null,C(c.fields,(h,w)=>(i(),S(_,{key:w,field:h},null,8,["field"]))),128))]),o("div",Ue,[f(m,{type:"info",onClick:t[1]||(t[1]=h=>s.saveNote())},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])])}const Ie=P(Ve,[["render",Ee]]),Me={name:"ns-pos-tax-popup",props:["popup"],data(){return{validation:new D,tax_group:[],order:null,orderSubscriber:null,optionsSubscriber:null,options:{},tax_groups:[],activeTab:"",group_fields:[{label:a("Select Tax"),name:"tax_group_id",description:a("Define the tax that apply to the sale."),type:"select",disabled:!0,value:"",validation:"required",options:[]},{label:a("Type"),name:"tax_type",disabled:!0,value:"",description:a("Define how the tax is computed"),type:"select",validation:"required",options:[{label:a("Exclusive"),value:"exclusive"},{label:a("Inclusive"),value:"inclusive"}]}]}},mounted(){this.loadGroups(),this.popupCloser(),this.activeTab=this.popup.params.activeTab||"settings",this.group_fields.forEach(e=>{e.value=this.popup.params[e.name]||void 0}),this.orderSubscriber=POS.order.subscribe(e=>{this.order=e}),this.optionsSubscriber=POS.options.subscribe(e=>{this.options=e,["variable_vat","products_variable_vat"].includes(this.options.ns_pos_vat)&&this.group_fields.forEach(t=>t.disabled=!1)})},unmounted(){this.orderSubscriber.unsubscribe(),this.optionsSubscriber.unsubscribe()},methods:{__:a,nsCurrency:B,popupCloser:q,popupResolver:V,changeActive(e){this.activeTab=e},closePopup(){this.popupResolver(!1)},saveTax(){if(!this.validation.validateFields(this.group_fields))return v.error(a("Unable to proceed the form is not valid.")).subscribe();const e=this.validation.extractFields(this.group_fields);e.tax_groups=[],this.popupResolver(e)},loadGroups(){U.get("/api/taxes/groups").subscribe(e=>{this.groups=e,this.group_fields.forEach(t=>{t.name==="tax_group_id"&&(t.options=this.groups.map(u=>({label:u.name,value:u.id})))})})}}},Ye={class:"ns-box shadow-lg w-95vw md:w-3/5-screen lg:w-2/5-screen"},Ge={class:"p-2 flex justify-between items-center border-b ns-box-header"},$e={class:"text-blog"},We={class:"p-2 ns-box-body"},ze={class:"p-2 border-b ns-box-body"},Le={class:"flex justify-end p-2"},Ke={key:0,class:"p-2"},Je={key:0,class:"p-2 text-center text-primary"},Xe={key:0,class:"p-2"},Ze={class:"border shadow p-2 w-full flex justify-between items-center elevation-surface"};function et(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button"),h=b("ns-tabs-item"),w=b("ns-tabs");return i(),d("div",Ye,[o("div",Ge,[o("h3",$e,r(s.__("Tax & Summary")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=g=>s.closePopup())})])]),o("div",We,[f(w,{active:c.activeTab,onChangeTab:t[2]||(t[2]=g=>s.changeActive(g))},{default:k(()=>[f(h,{padding:"0",label:s.__("Settings"),identifier:"settings",active:!0},{default:k(()=>[o("div",ze,[(i(!0),d(x,null,C(c.group_fields,(g,Q)=>(i(),S(_,{field:g,key:Q},null,8,["field"]))),128))]),o("div",Le,[f(m,{onClick:t[1]||(t[1]=g=>s.saveTax()),type:"info"},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])]),_:1},8,["label"]),f(h,{padding:"0",label:s.__("Summary"),identifier:"summary",active:!1},{default:k(()=>[c.order?(i(),d("div",Ke,[(i(!0),d(x,null,C(c.order.taxes,g=>(i(),d("div",{key:g.id,class:"mb-2 border shadow p-2 w-full flex justify-between items-center elevation-surface"},[o("span",null,r(g.name),1),o("span",null,r(s.nsCurrency(g.tax_value)),1)]))),128)),c.order.taxes.length===0?(i(),d("div",Je,r(s.__("No tax is active")),1)):p("",!0)])):p("",!0)]),_:1},8,["label"]),f(h,{padding:"0",label:s.__("Product Taxes"),identifier:"product_taxes",active:!1},{default:k(()=>[c.order?(i(),d("div",Xe,[o("div",Ze,[o("span",null,r(s.__("Product Taxes")),1),o("span",null,r(s.nsCurrency(c.order.products_tax_value)),1)])])):p("",!0)]),_:1},8,["label"])]),_:1},8,["active"])])])}const tt=P(Me,[["render",et]]),st={name:"ns-pos-order-settings",props:["popup"],mounted(){nsHttpClient.get("/api/fields/ns.pos-order-settings").subscribe(e=>{e.forEach(t=>{t.value=this.popup.params.order[t.name]||""}),this.fields=this.validation.createFields(e)},e=>{}),this.popupCloser()},data(){return{fields:[],validation:new D}},methods:{__,popupCloser,popupResolver,closePopup(){this.popupResolver(!1)},saveSettings(){const e=this.validation.extractFields(this.fields);this.popupResolver(e)}}},ot={class:"shadow-lg flex flex-col ns-box w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen lg:w-2/5-screen"},rt={class:"p-2 border-b ns-box-header items-center flex justify-between"},nt={class:"text-semibold"},it={class:"p-2 flex-auto border-b ns-box-body overflow-y-auto"},dt={class:"p-2 flex justify-end ns-box-footer"};function lt(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button");return i(),d("div",ot,[o("div",rt,[o("h3",nt,r(s.__("Order Settings")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.closePopup())})])]),o("div",it,[(i(!0),d(x,null,C(c.fields,(h,w)=>(i(),S(_,{field:h,key:w},null,8,["field"]))),128))]),o("div",dt,[f(m,{onClick:t[1]||(t[1]=h=>s.saveSettings()),type:"info"},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])])}const at=P(st,[["render",lt]]),ut={name:"ns-pos-product-price-product",props:["popup"],components:{nsNumpad:J,nsNumpadPlus:X},computed:{},data(){return{product:{},optionsSubscription:null,options:{},price:0}},mounted(){this.popupCloser(),this.product=this.popup.params.product,this.optionsSubscription=POS.options.subscribe(e=>{this.options=T(e)})},beforeDestroy(){this.optionsSubscription.unsubscribe()},methods:{popupResolver,popupCloser,nsCurrency:B,__,updateProductPrice(e){this.product.unit_price=e},resolveProductPrice(e){this.popupResolver(this.product.unit_price)}}},ct={class:"ns-box shadow-lg w-95vw md:w-3/5-screen lg:w-2/5-screen"},pt={class:"popup-heading ns-box-header"},_t={class:"flex flex-col ns-box-body"},ht={class:"h-16 flex items-center justify-center elevation-surface info font-bold"},bt={class:"text-2xl"};function mt(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-numpad"),m=b("ns-numpad-plus");return i(),d("div",ct,[o("div",pt,[o("h3",null,r(s.__("Product Price")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.popupResolver(!1))})])]),o("div",_t,[o("div",ht,[o("h2",bt,r(s.nsCurrency(c.product.unit_price)),1)]),c.options.ns_pos_numpad==="default"?(i(),S(_,{key:0,floating:c.options.ns_pos_allow_decimal_quantities,onChanged:t[1]||(t[1]=h=>s.updateProductPrice(h)),onNext:t[2]||(t[2]=h=>s.resolveProductPrice(h)),value:c.product.unit_price},null,8,["floating","value"])):p("",!0),c.options.ns_pos_numpad==="advanced"?(i(),S(m,{key:1,onChanged:t[3]||(t[3]=h=>s.updateProductPrice(h)),onNext:t[4]||(t[4]=h=>s.resolveProductPrice(h)),value:c.product.unit_price},null,8,["value"])):p("",!0)])])}const ft=P(ut,[["render",mt]]),yt={name:"ns-pos-quick-product-popup",props:["popup"],methods:{__:a,popupCloser:q,popupResolver:V,close(){this.popupResolver(!1)},async addProduct(){const e=this.validation.extractFields(this.fields),t=this.fields.filter(s=>typeof s.show>"u"||typeof s.show=="function"&&s.show(e));if(!this.validation.validateFields(t))return v.error(a("Unable to proceed. The form is not valid.")).subscribe();let l=this.validation.extractFields(t);l.$original=()=>({stock_management:"disabled",category_id:0,tax_group:this.tax_groups.filter(s=>parseInt(s.id)===parseInt(l.tax_group_id))[0],tax_group_id:l.tax_group_id,tax_type:l.tax_type}),l.product_type==="product"?(l.unit_name=this.units.filter(s=>s.id===l.unit_id)[0].name,l.quantity=parseFloat(l.quantity),l.unit_price=parseFloat(l.unit_price),l.mode="custom",l.price_with_tax=l.unit_price,l.price_without_tax=l.unit_price,l.tax_value=0):(l.unit_name=a("N/A"),l.unit_price=0,l.quantity=1);const c=await POS.defineQuantities(l,this.units);l.$quantities=()=>c,l=POS.computeProductTax(l),POS.addToCart(l),this.close()},loadData(){this.loaded=!1,E(nsHttpClient.get("/api/units"),nsHttpClient.get("/api/taxes/groups")).subscribe({next:e=>{this.units=e[0],this.tax_groups=e[1],this.fields.filter(t=>{t.name==="tax_group_id"&&(t.options=e[1].map(u=>({label:u.name,value:u.id})),e[1].length>0&&e[1][0].id!==void 0&&(t.value=e[1][0].id||this.options.ns_pos_tax_group)),t.name==="tax_type"&&(t.value=this.options.tax_type||"inclusive"),t.name==="unit_id"&&(t.value=this.options.ns_pos_quick_product_default_unit,t.options=e[0].map(u=>({label:u.name,value:u.id})))}),this.buildForm()},error:e=>{}})},buildForm(){this.fields=this.validation.createFields(this.fields),this.loaded=!0,setTimeout(()=>{this.$el.querySelector("#name").select()},100)}},computed:{form(){return this.validation.extractFields(this.fields)}},data(){return{units:[],options:POS.options.getValue(),tax_groups:[],loaded:!1,validation:new D,fields:[{label:a("Name"),name:"name",type:"text",description:a("Provide a unique name for the product."),validation:"required"},{label:a("Product Type"),name:"product_type",type:"select",description:a("Define the product type."),options:[{label:a("Normal"),value:"product"},{label:a("Dynamic"),value:"dynamic"}],value:"product",validation:"required"},{label:a("Rate"),name:"rate",type:"text",description:a("In case the product is computed based on a percentage, define the rate here."),validation:"required",show(e){return e.product_type==="dynamic"}},{label:a("Unit Price"),name:"unit_price",type:"text",description:a("Define what is the sale price of the item."),validation:"",value:0,show(e){return e.product_type==="product"}},{label:a("Quantity"),name:"quantity",type:"text",value:1,description:a("Set the quantity of the product."),validation:"",show(e){return e.product_type==="product"}},{label:a("Unit"),name:"unit_id",type:"select",options:[],description:a("Assign a unit to the product."),validation:"",show(e){return e.product_type==="product"}},{label:a("Tax Type"),name:"tax_type",type:"select",options:[{label:a("Disabled"),value:""},{label:a("Inclusive"),value:"inclusive"},{label:a("Exclusive"),value:"exclusive"}],description:a("Define what is tax type of the item."),show(e){return e.product_type==="product"}},{label:a("Tax Group"),name:"tax_group_id",type:"select",options:[],description:a("Choose the tax group that should apply to the item."),show(e){return e.product_type==="product"}}]}},mounted(){this.popupCloser(),this.loadData()}},vt={class:"w-95vw flex flex-col h-95vh shadow-lg md:w-3/5-screen lg:w-2/5-screen md:h-3/5-screen ns-box"},xt={class:"header ns-box-header border-b flex justify-between p-2 items-center"},wt={class:"ns-box-body p-2 flex-auto overflow-y-auto"},gt={key:0,class:"h-full w-full flex justify-center items-center"},Pt={class:"ns-box-footer border-t flex justify-between p-2"},kt=o("div",null,null,-1);function Ct(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-spinner"),m=b("ns-field"),h=b("ns-button");return i(),d("div",vt,[o("div",xt,[o("h3",null,r(s.__("Product / Service")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=w=>s.close())})])]),o("div",wt,[c.loaded?p("",!0):(i(),d("div",gt,[f(_)])),c.loaded?(i(!0),d(x,{key:1},C(c.fields,(w,g)=>(i(),d(x,null,[w.show&&w.show(s.form)||!w.show?(i(),S(m,{key:g,field:w},null,8,["field"])):p("",!0)],64))),256)):p("",!0)]),o("div",Pt,[kt,o("div",null,[f(h,{onClick:t[1]||(t[1]=w=>s.addProduct()),type:"info"},{default:k(()=>[O(r(s.__("Create")),1)]),_:1})])])])}const St=P(yt,[["render",Ct]]),Tt={name:"ns-pos-cart",data:()=>({popup:null,cartButtons:{},products:[],defaultCartButtons:{nsPosPayButton:j(re),nsPosHoldButton:j(ke),nsPosDiscountButton:j(je),nsPosVoidButton:j(Fe)},visibleSection:null,visibleSectionSubscriber:null,cartButtonsSubscriber:null,optionsSubscriber:null,options:{},typeSubscribe:null,orderSubscribe:null,productSubscribe:null,settingsSubscribe:null,settings:{},types:[],order:T({})}),computed:{selectedType(){return this.order.type?this.order.type.label:"N/A"},isVisible(){return this.visibleSection==="cart"},customerName(){return this.order.customer?`${this.order.customer.first_name||this.order.customer.last_name?this.getFirstName():this.getUserName()}`:"N/A"},couponName(){return a("Apply Coupon")}},mounted(){this.cartButtonsSubscriber=POS.cartButtons.subscribe(e=>{this.cartButtons=e}),this.optionsSubscriber=POS.options.subscribe(e=>{this.options=e}),this.typeSubscribe=POS.types.subscribe(e=>this.types=e),this.orderSubscribe=POS.order.subscribe(e=>{this.order=T(e)}),this.productSubscribe=POS.products.subscribe(e=>{this.products=T(e)}),this.settingsSubscribe=POS.settings.subscribe(e=>{this.settings=T(e)}),this.visibleSectionSubscriber=POS.visibleSection.subscribe(e=>{this.visibleSection=T(e)}),I.addAction("ns-before-cart-reset","ns-pos-cart-buttons",()=>{POS.cartButtons.next(this.defaultCartButtons)});for(let e in nsShortcuts)["ns_pos_keyboard_shipping"].includes(e)&&nsHotPress.create("ns_pos_keyboard_shipping").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.openShippingPopup()}),["ns_pos_keyboard_note"].includes(e)&&nsHotPress.create("ns_pos_keyboard_note").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.openNotePopup()})},unmounted(){this.visibleSectionSubscriber.unsubscribe(),this.typeSubscribe.unsubscribe(),this.orderSubscribe.unsubscribe(),this.productSubscribe.unsubscribe(),this.settingsSubscribe.unsubscribe(),this.optionsSubscriber.unsubscribe(),this.cartButtonsSubscriber.unsubscribe(),nsHotPress.destroy("ns_pos_keyboard_shipping"),nsHotPress.destroy("ns_pos_keyboard_note")},methods:{__:a,nsCurrency:B,switchTo:M,getFirstName(){return`${this.order.customer.first_name||""} ${this.order.customer.last_name||""}`},getUserName(){return this.order.customer.username},takeRandomClass(){return"border-gray-500 bg-gray-400 text-white hover:bg-gray-500"},openAddQuickProduct(){new Promise((t,u)=>{y.show(St,{resolve:t,reject:u})}).then(t=>{}).catch(t=>{})},summarizeCoupons(){const e=this.order.coupons.map(t=>t.value);return e.length>0?e.reduce((t,u)=>t+u):0},async changeProductPrice(e){if(!this.settings.edit_purchase_price)return v.error(a("You don't have the right to edit the purchase price.")).subscribe();if(e.product_type==="dynamic")return v.error(a("Dynamic product can't have their price updated.")).subscribe();if(this.settings.unit_price_editable)try{const t=await new Promise((l,c)=>y.show(ft,{product:Object.assign({},e),resolve:l,reject:c})),u={...e.$quantities(),custom_price_edit:t};return e.$quantities=()=>u,e.mode="custom",e=POS.computeProductTax(e),POS.recomputeProducts(POS.products.getValue()),POS.refreshCart(),v.success(a("The product price has been updated.")).subscribe()}catch(t){if(t!==!1)throw v.error(t).subscribe(),t}else return v.error(a("The editable price feature is disabled.")).subscribe()},async selectCoupon(){try{const e=await new Promise((t,u)=>{y.show(Y,{resolve:t,reject:u})})}catch{}},async defineOrderSettings(){if(!this.settings.edit_settings)return v.error(a("You're not allowed to edit the order settings.")).subscribe();try{const e=await new Promise((t,u)=>{y.show(at,{resolve:t,reject:u,order:this.order})});POS.order.next({...this.order,...e})}catch{}},async openNotePopup(){try{const e=await new Promise((u,l)=>{const c=this.order.note,s=this.order.note_visibility;y.show(Ie,{resolve:u,reject:l,note:c,note_visibility:s})}),t={...this.order,...e};POS.order.next(t)}catch(e){e!==!1&&v.error(e.message).subscribe()}},async selectTaxGroup(e="settings"){try{const t=await new Promise((l,c)=>{const s=this.order.taxes,n=this.order.tax_group_id,_=this.order.tax_type;y.show(tt,{resolve:l,reject:c,taxes:s,tax_group_id:n,tax_type:_,activeTab:e})}),u={...this.order,...t};POS.order.next(u),POS.refreshCart()}catch{}},openTaxSummary(){this.selectTaxGroup("summary")},selectCustomer(){y.show(G)},openDiscountPopup(e,t){if(!this.settings.products_discount&&t==="product")return v.error(a("You're not allowed to add a discount on the product.")).subscribe();if(!this.settings.cart_discount&&t==="cart")return v.error(a("You're not allowed to add a discount on the cart.")).subscribe();new Promise((u,l)=>{y.show(H,{reference:e,resolve:u,reject:l,type:t,onSubmit(c){t==="product"?POS.updateProduct(e,c):t==="cart"&&POS.updateCart(e,c)}},{popupClass:"bg-white h:2/3 shadow-lg xl:w-1/4 lg:w-2/5 md:w-2/3 w-full"})})},toggleMode(e,t){if(!this.options.ns_pos_allow_wholesale_price)return v.error(a("Unable to change the price mode. This feature has been disabled.")).subscribe();e.mode==="normal"?y.show(F,{title:a("Enable WholeSale Price"),message:a("Would you like to switch to wholesale price ?"),onAction(u){u&&POS.updateProduct(e,{mode:"wholesale"},t)}}):y.show(F,{title:a("Enable Normal Price"),message:a("Would you like to switch to normal price ?"),onAction(u){u&&POS.updateProduct(e,{mode:"normal"},t)}})},removeUsingIndex(e){y.show(F,{title:a("Confirm Your Action"),message:a("Would you like to delete this product ?"),onAction(t){t&&POS.removeProductUsingIndex(e)}})},allowQuantityModification(e){return e.product_type==="product"},changeQuantity(e,t){this.allowQuantityModification(e)&&new W(e).run({unit_quantity_id:e.unit_quantity_id,unit_name:e.unit_name,$quantities:e.$quantities}).then(l=>{POS.updateProduct(e,l,t)})},openOrderType(){y.show($)},openShippingPopup(){y.show(Z)}}},Ot={id:"pos-cart",class:"flex-auto flex flex-col"},jt={key:0,id:"tools",class:"flex pl-2 ns-tab"},Nt={key:0,class:"flex items-center justify-center text-sm rounded-full h-6 w-6 bg-green-500 text-white ml-1"},qt={class:"rounded shadow ns-tab-item flex-auto flex overflow-hidden"},Dt={class:"cart-table flex flex-auto flex-col overflow-hidden"},Bt={id:"cart-toolbox",class:"w-full p-2 border-b"},Ft={class:"border rounded overflow-hidden"},Vt={class:"flex flex-wrap"},Ht={class:"ns-button"},Qt=o("i",{class:"las la-comment"},null,-1),Rt={class:"ml-1 hidden md:inline-block"},At=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Ut={class:"ns-button"},Et=o("i",{class:"las la-balance-scale-left"},null,-1),It={class:"ml-1 hidden md:inline-block"},Mt={key:0,class:"ml-1 rounded-full flex items-center justify-center h-6 w-6 bg-info-secondary text-white"},Yt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Gt={class:"ns-button"},$t=o("i",{class:"las la-tags"},null,-1),Wt={class:"ml-1 hidden md:inline-block"},zt={key:0,class:"ml-1 rounded-full flex items-center justify-center h-6 w-6 bg-info-secondary text-white"},Lt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Kt={class:"ns-button"},Jt=o("i",{class:"las la-tools"},null,-1),Xt={class:"ml-1 hidden md:inline-block"},Zt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),es={key:0,class:"ns-button"},ts=o("i",{class:"las la-plus"},null,-1),ss={class:"ml-1 hidden md:inline-block"},os=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),rs={id:"cart-table-header",class:"w-full text-primary font-semibold flex"},ns={class:"w-full lg:w-4/6 p-2 border border-l-0 border-t-0"},is={class:"hidden lg:flex lg:w-1/6 p-2 border-b border-t-0"},ds={class:"hidden lg:flex lg:w-1/6 p-2 border border-r-0 border-t-0"},ls={id:"cart-products-table",class:"flex flex-auto flex-col overflow-auto"},as={key:0,class:"text-primary flex"},us={class:"w-full text-center py-4 border-b"},cs=["product-index"],ps={class:"w-full lg:w-4/6 p-2 border border-l-0 border-t-0"},_s={class:"flex justify-between product-details mb-1"},hs={class:"font-semibold"},bs={class:"-mx-1 flex product-options"},ms={class:"px-1"},fs=["onClick"],ys=o("i",{class:"las la-trash text-xl"},null,-1),vs=[ys],xs={key:0,class:"px-1"},ws=["onClick"],gs=o("i",{class:"las la-award text-xl"},null,-1),Ps=[gs],ks={class:"flex justify-between product-controls"},Cs={class:"-mx-1 flex flex-wrap"},Ss={class:"px-1 w-1/2 md:w-auto mb-1"},Ts=["onClick"],Os={class:"px-1 w-1/2 md:w-auto mb-1"},js=["onClick"],Ns={key:0},qs={class:"px-1 w-1/2 md:w-auto mb-1 lg:hidden"},Ds=["onClick"],Bs={class:"px-1 w-1/2 md:w-auto mb-1 lg:hidden"},Fs={class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},Vs=["onClick"],Hs={key:0,class:"border-b border-dashed border-info-primary p-2"},Qs={class:"hidden lg:flex w-1/6 p-2 border border-r-0 border-t-0 items-center justify-center"},Rs={id:"cart-products-summary",class:"flex"},As={key:0,class:"table ns-table w-full text-sm"},Us={width:"200",class:"border p-2"},Es={width:"200",class:"border p-2"},Is={width:"200",class:"border p-2 text-right"},Ms={key:0},Ys=o("td",{width:"200",class:"border p-2"},null,-1),Gs={width:"200",class:"border p-2"},$s={width:"200",class:"border p-2 text-right"},Ws={width:"200",class:"border p-2"},zs={width:"200",class:"border p-2"},Ls={key:0},Ks={key:1},Js={width:"200",class:"border p-2 text-right"},Xs={key:1},Zs=o("td",{width:"200",class:"border p-2"},null,-1),eo={width:"200",class:"border p-2"},to={width:"200",class:"border p-2 text-right"},so={class:"success"},oo={width:"200",class:"border p-2"},ro={width:"200",class:"border p-2"},no={width:"200",class:"border p-2 text-right"},io={key:1,class:"table ns-table w-full text-sm"},lo={width:"200",class:"border p-2"},ao={width:"200",class:"border p-2"},uo={class:"flex justify-between"},co={key:0},po=o("td",{width:"200",class:"border p-2"},null,-1),_o={width:"200",class:"border p-2"},ho={width:"200",class:"border p-2 text-right"},bo={width:"200",class:"border p-2"},mo={width:"200",class:"border p-2"},fo={class:"flex justify-between items-center"},yo={key:0},vo={key:1},xo={key:1},wo=o("td",{width:"200",class:"border p-2"},null,-1),go={width:"200",class:"border p-2"},Po=o("span",null,null,-1),ko={class:"success"},Co={width:"200",class:"border p-2"},So={width:"200",class:"border p-2"},To={class:"flex justify-between w-full"},Oo={class:"h-16 flex flex-shrink-0 border-t border-box-edge",id:"cart-bottom-buttons"},jo=o("i",{class:"mx-4 rounded-full bg-slate-300 h-5 w-5"},null,-1),No=o("div",{class:"text-lg mr-4 hidden md:flex md:flex-auto lg:text-2xl"},[o("div",{class:"h-2 flex-auto bg-slate-200 rounded"})],-1),qo=[jo,No];function Do(e,t,u,l,c,s){return i(),d("div",Ot,[e.visibleSection==="cart"?(i(),d("div",jt,[o("div",{onClick:t[0]||(t[0]=n=>s.switchTo("cart")),class:"flex cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 font-semibold active tab"},[o("span",null,r(s.__("Cart")),1),e.order?(i(),d("span",Nt,r(e.order.products.length),1)):p("",!0)]),o("div",{onClick:t[1]||(t[1]=n=>s.switchTo("grid")),class:"cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 border-t border-r border-l inactive tab"},r(s.__("Products")),1)])):p("",!0),o("div",qt,[o("div",Dt,[o("div",Bt,[o("div",Ft,[o("div",Vt,[o("div",Ht,[o("button",{onClick:t[2]||(t[2]=n=>s.openNotePopup()),class:"w-full h-10 px-3 outline-none"},[Qt,o("span",Rt,r(s.__("Comments")),1)])]),At,o("div",Ut,[o("button",{onClick:t[3]||(t[3]=n=>s.selectTaxGroup()),class:"w-full h-10 px-3 outline-none flex items-center"},[Et,o("span",It,r(s.__("Taxes")),1),e.order.taxes&&e.order.taxes.length>0?(i(),d("span",Mt,r(e.order.taxes.length),1)):p("",!0)])]),Yt,o("div",Gt,[o("button",{onClick:t[4]||(t[4]=n=>s.selectCoupon()),class:"w-full h-10 px-3 outline-none flex items-center"},[$t,o("span",Wt,r(s.__("Coupons")),1),e.order.coupons&&e.order.coupons.length>0?(i(),d("span",zt,r(e.order.coupons.length),1)):p("",!0)])]),Lt,o("div",Kt,[o("button",{onClick:t[5]||(t[5]=n=>s.defineOrderSettings()),class:"w-full h-10 px-3 outline-none flex items-center"},[Jt,o("span",Xt,r(s.__("Settings")),1)])]),Zt,e.options.ns_pos_quick_product==="yes"?(i(),d("div",es,[o("button",{onClick:t[6]||(t[6]=n=>s.openAddQuickProduct()),class:"w-full h-10 px-3 outline-none flex items-center"},[ts,o("span",ss,r(s.__("Product")),1)])])):p("",!0),os])])]),o("div",rs,[o("div",ns,r(s.__("Product")),1),o("div",is,r(s.__("Quantity")),1),o("div",ds,r(s.__("Total")),1)]),o("div",ls,[e.products.length===0?(i(),d("div",as,[o("div",us,[o("h3",null,r(s.__("No products added...")),1)])])):p("",!0),(i(!0),d(x,null,C(e.products,(n,_)=>(i(),d("div",{"product-index":_,key:n.barcode,class:"product-item flex"},[o("div",ps,[o("div",_s,[o("h3",hs,r(n.name)+" — "+r(n.unit_name),1),o("div",bs,[o("div",ms,[o("a",{onClick:m=>s.removeUsingIndex(_),class:"hover:text-error-secondary cursor-pointer outline-none border-dashed py-1 border-b border-error-secondary text-sm"},vs,8,fs)]),e.options.ns_pos_allow_wholesale_price&&s.allowQuantityModification(n)?(i(),d("div",xs,[o("a",{class:N([n.mode==="wholesale"?"text-success-secondary border-success-secondary":"border-info-primary","cursor-pointer outline-none border-dashed py-1 border-b text-sm"]),onClick:m=>s.toggleMode(n,_)},Ps,10,ws)])):p("",!0)])]),o("div",ks,[o("div",Cs,[o("div",Ss,[o("a",{onClick:m=>s.changeProductPrice(n),class:N([n.mode==="wholesale"?"text-success-secondary hover:text-success-secondary border-success-secondary":"border-info-primary","cursor-pointer outline-none border-dashed py-1 border-b text-sm"])},r(s.__("Price"))+" : "+r(s.nsCurrency(n.unit_price)),11,Ts)]),o("div",Os,[s.allowQuantityModification(n)?(i(),d("a",{key:0,onClick:m=>s.openDiscountPopup(n,"product",_),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},[O(r(s.__("Discount"))+" ",1),n.discount_type==="percentage"?(i(),d("span",Ns,r(n.discount_percentage)+"%",1)):p("",!0),O(" : "+r(s.nsCurrency(n.discount)),1)],8,js)):p("",!0)]),o("div",qs,[s.allowQuantityModification(n)?(i(),d("a",{key:0,onClick:m=>s.changeQuantity(n,_),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Quantity"))+": "+r(n.quantity),9,Ds)):p("",!0)]),o("div",Bs,[o("span",Fs,r(s.__("Total :"))+" "+r(s.nsCurrency(n.total_price)),1)])])])]),o("div",{onClick:m=>s.changeQuantity(n,_),class:N([s.allowQuantityModification(n)?"cursor-pointer ns-numpad-key":"","hidden lg:flex w-1/6 p-2 border-b items-center justify-center"])},[s.allowQuantityModification(n)?(i(),d("span",Hs,r(n.quantity),1)):p("",!0)],10,Vs),o("div",Qs,r(s.nsCurrency(n.total_price)),1)],8,cs))),128))]),o("div",Rs,[e.visibleSection==="both"?(i(),d("table",As,[o("tr",null,[o("td",Us,[o("a",{onClick:t[7]||(t[7]=n=>s.selectCustomer()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Customer"))+": "+r(s.customerName),1)]),o("td",Es,r(s.__("Sub Total")),1),o("td",Is,r(s.nsCurrency(e.order.subtotal)),1)]),e.order.coupons.length>0?(i(),d("tr",Ms,[Ys,o("td",Gs,[o("a",{onClick:t[8]||(t[8]=n=>s.selectCoupon()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Coupons")),1)]),o("td",$s,r(s.nsCurrency(s.summarizeCoupons())),1)])):p("",!0),o("tr",null,[o("td",Ws,[o("a",{onClick:t[9]||(t[9]=n=>s.openOrderType()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Type"))+": "+r(s.selectedType),1)]),o("td",zs,[o("span",null,r(s.__("Discount")),1),e.order.discount_type==="percentage"?(i(),d("span",Ls,"("+r(e.order.discount_percentage)+"%)",1)):p("",!0),e.order.discount_type==="flat"?(i(),d("span",Ks,"("+r(s.__("Flat"))+")",1)):p("",!0)]),o("td",Js,[o("a",{onClick:t[10]||(t[10]=n=>s.openDiscountPopup(e.order,"cart")),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.nsCurrency(e.order.discount)),1)])]),e.order.type&&e.order.type.identifier==="delivery"?(i(),d("tr",Xs,[Zs,o("td",eo,[o("a",{onClick:t[11]||(t[11]=n=>s.openShippingPopup()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Shipping")),1)]),o("td",to,r(s.nsCurrency(e.order.shipping)),1)])):p("",!0),o("tr",so,[o("td",oo,[e.order&&e.options.ns_pos_tax_type==="exclusive"?(i(),d(x,{key:0},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[12]||(t[12]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[13]||(t[13]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):p("",!0)],64)):e.order&&e.options.ns_pos_tax_type==="inclusive"?(i(),d(x,{key:1},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[14]||(t[14]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+(e.order.products_exclusive_tax_value+e.order.products_inclusive_tax_value))),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[15]||(t[15]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):p("",!0)],64)):p("",!0)]),o("td",ro,r(s.__("Total")),1),o("td",no,r(s.nsCurrency(e.order.total)),1)])])):p("",!0),e.visibleSection==="cart"?(i(),d("table",io,[o("tr",null,[o("td",lo,[o("a",{onClick:t[16]||(t[16]=n=>s.selectCustomer()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Customer"))+": "+r(s.customerName),1)]),o("td",ao,[o("div",uo,[o("span",null,r(s.__("Sub Total")),1),o("span",null,r(s.nsCurrency(e.order.subtotal)),1)])])]),e.order.coupons.length>0?(i(),d("tr",co,[po,o("td",_o,[o("a",{onClick:t[17]||(t[17]=n=>s.selectCoupon()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Coupons")),1)]),o("td",ho,r(s.nsCurrency(s.summarizeCoupons())),1)])):p("",!0),o("tr",null,[o("td",bo,[o("a",{onClick:t[18]||(t[18]=n=>s.openOrderType()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Type"))+": "+r(s.selectedType),1)]),o("td",mo,[o("div",fo,[o("p",null,[o("span",null,r(s.__("Discount")),1),e.order.discount_type==="percentage"?(i(),d("span",yo,"("+r(e.order.discount_percentage)+"%)",1)):p("",!0),e.order.discount_type==="flat"?(i(),d("span",vo,"("+r(s.__("Flat"))+")",1)):p("",!0)]),o("a",{onClick:t[19]||(t[19]=n=>s.openDiscountPopup(e.order,"cart")),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.nsCurrency(e.order.discount)),1)])])]),e.order.type&&e.order.type.identifier==="delivery"?(i(),d("tr",xo,[wo,o("td",go,[o("a",{onClick:t[20]||(t[20]=n=>s.openShippingPopup()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Shipping")),1),Po])])):p("",!0),o("tr",ko,[o("td",Co,[e.order&&e.options.ns_pos_tax_type==="exclusive"?(i(),d(x,{key:0},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[21]||(t[21]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[22]||(t[22]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Inclusive"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):p("",!0)],64)):e.order&&e.options.ns_pos_tax_type==="inclusive"?(i(),d(x,{key:1},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[23]||(t[23]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[24]||(t[24]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):p("",!0)],64)):p("",!0)]),o("td",So,[o("div",To,[o("span",null,r(s.__("Total")),1),o("span",null,r(s.nsCurrency(e.order.total)),1)])])])])):p("",!0)]),o("div",Oo,[Object.keys(e.cartButtons).length===0?(i(!0),d(x,{key:0},C(new Array(4).fill(),n=>(i(),d("div",{class:N([s.takeRandomClass(),"animate-pulse flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center border-r flex-auto"])},qo,2))),256)):p("",!0),(i(!0),d(x,null,C(e.cartButtons,n=>(i(),S(L(n),{order:e.order,settings:e.settings},null,8,["order","settings"]))),256))])])])])}const Mo=P(Tt,[["render",Do]]);export{Mo as default}; +import{g as q,v as R,w as A,F as D,p as V,b as v,a as U,G as E,n as I,P as y}from"./bootstrap-8be442b1.js";import{_ as a,n as B}from"./currency-f8bd78d1.js";import{s as M}from"./pos-section-switch-0869c4e1.js";import{a as H,c as Y,n as G,b as $,P as W}from"./ns-pos-order-type-popup-5204386b.js";import{_ as P}from"./_plugin-vue_export-helper-c27b6911.js";import{o as i,c as d,a as o,t as r,r as b,f,B as z,F as x,b as C,g as S,w as k,i as O,e as p,h as T,ay as j,n as N,j as L}from"./runtime-core.esm-bundler-b48de70a.js";import{c as K,a as J,j as X,n as F}from"./ns-prompt-popup-100414c5.js";import Z from"./ns-pos-shipping-popup-acf8319e.js";import"./index.es-25aa42ee.js";import"./ns-orders-preview-popup-5ba94079.js";const ee={props:["order"],methods:{__,async payOrder(){const e=nsHooks.applyFilters("ns-pay-queue",[ProductsQueue,CustomerQueue,TypeQueue,PaymentQueue]);for(let t in e)try{const l=await new e[t](this.order).run()}catch{return!1}}},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_payment"].includes(e)&&nsHotPress.create("ns_pos_keyboard_payment").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.payOrder()})},unmounted(){nsHotPress.destroy("ns_pos_keyboard_payment")}},te=o("i",{class:"mr-2 text-2xl lg:text-xl las la-cash-register"},null,-1),se={class:"text-lg hidden md:inline lg:text-2xl"};function oe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.payOrder()),id:"pay-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-green-500 text-white hover:bg-green-600 border-r border-green-600 flex-auto"},[te,o("span",se,r(s.__("Pay")),1)])}const re=P(ee,[["render",oe]]),ne={name:"ns-pos-hold-orders",props:["popup"],data(){return{order:{},title:"",show:!0}},mounted(){this.popupCloser(),this.show=POS.getHoldPopupEnabled(),this.show||this.popup.params.resolve({title:this.title}),this.$refs.reference.focus(),this.$refs.reference.select(),this.order=this.popup.params.order,this.title=this.popup.params.order.title||""},methods:{__:a,nsCurrency:B,popupCloser:q,submitHold(){this.popup.close(),this.popup.params.resolve({title:this.title})}}},ie={class:"ns-box shadow-lg w-6/7-screen md:w-3/7-screen lg:w-2/6-screen"},de={class:"p-2 flex ns-box-header justify-between border-b items-center"},le={class:"font-semibold"},ae={class:"flex-auto ns-box-body"},ue={class:"border-b h-16 flex items-center justify-center"},ce={class:"text-5xl text-primary"},pe={class:"p-2"},_e={class:"input-group border-2 info"},he=["placeholder"],be={class:"p-2"},me={class:"text-secondary"},fe={class:"flex ns-box-footer"};function ye(e,t,u,l,c,s){const n=b("ns-close-button");return i(),d("div",ie,[o("div",de,[o("h3",le,r(s.__("Hold Order")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=_=>u.popup.close())})])]),o("div",ae,[o("div",ue,[o("span",ce,r(s.nsCurrency(c.order.total)),1)]),o("div",pe,[o("div",_e,[z(o("input",{onKeyup:t[1]||(t[1]=A(_=>s.submitHold(),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=_=>c.title=_),ref:"reference",type:"text",placeholder:s.__("Order Reference"),class:"outline-none rounded border-2 p-2 w-full"},null,40,he),[[R,c.title]])])]),o("div",be,[o("p",me,r(s.__("The current order will be set on hold. You can retrieve this order from the pending order button. Providing a reference to it might help you to identify the order more quickly.")),1)])]),o("div",fe,[o("div",{onClick:t[3]||(t[3]=_=>s.submitHold()),class:"cursor-pointer w-1/2 py-3 flex justify-center items-center bg-green-500 text-white font-semibold"},r(s.__("Confirm")),1),o("div",{onClick:t[4]||(t[4]=_=>u.popup.close()),class:"cursor-pointer w-1/2 py-3 flex justify-center items-center bg-error-secondary text-white font-semibold"},r(s.__("Cancel")),1)])])}const ve=P(ne,[["render",ye]]),xe={props:["order"],methods:{__,async holdOrder(){if(this.order.payment_status!=="hold"&&this.order.payments.length>0)return nsSnackBar.error(__("Unable to hold an order which payment status has been updated already.")).subscribe();const e=nsHooks.applyFilters("ns-hold-queue",[ProductsQueue,CustomerQueue,TypeQueue]);for(let u in e)try{const c=await new e[u](this.order).run()}catch{return!1}nsHooks.applyFilters("ns-override-hold-popup",()=>{new Promise((l,c)=>{Popup.show(ve,{resolve:l,reject:c,order:this.order})}).then(l=>{this.order.title=l.title,this.order.payment_status="hold",POS.order.next(this.order);const c=Popup.show(K);POS.submitOrder().then(s=>{c.close(),nsSnackBar.success(s.message).subscribe()},s=>{c.close(),nsSnackBar.error(s.message).subscribe()})}).catch(l=>{console.log(l)})})()}},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_hold_order"].includes(e)&&nsHotPress.create("ns_pos_keyboard_hold_order").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.holdOrder()})},unmounted(){nsHotPress.destroy("ns_pos_keyboard_hold_order")}},we=o("i",{class:"mr-2 text-2xl lg:text-xl las la-pause"},null,-1),ge={class:"text-lg hidden md:inline lg:text-2xl"};function Pe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.holdOrder()),id:"hold-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-blue-500 text-white border-r hover:bg-blue-600 border-blue-600 flex-auto"},[we,o("span",ge,r(s.__("Hold")),1)])}const ke=P(xe,[["render",Pe]]),Ce={props:["order","settings"],methods:{__,openDiscountPopup(e,t,u=null){if(!this.settings.products_discount&&t==="product")return nsSnackBar.error(__("You're not allowed to add a discount on the product.")).subscribe();if(!this.settings.cart_discount&&t==="cart")return nsSnackBar.error(__("You're not allowed to add a discount on the cart.")).subscribe();Popup.show(H,{reference:e,type:t,onSubmit(l){t==="product"?POS.updateProduct(e,l,u):t==="cart"&&POS.updateCart(e,l)}},{popupClass:"bg-white h:2/3 shadow-lg xl:w-1/4 lg:w-2/5 md:w-2/3 w-full"})}}},Se=o("i",{class:"mr-2 text-2xl lg:text-xl las la-percent"},null,-1),Te={class:"text-lg hidden md:inline lg:text-2xl"};function Oe(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.openDiscountPopup(u.order,"cart")),id:"discount-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center border-r border-box-edge flex-auto"},[Se,o("span",Te,r(s.__("Discount")),1)])}const je=P(Ce,[["render",Oe]]),Ne={props:["order","settings"],methods:{__,voidOngoingOrder(){POS.voidOrder(this.order)}}},qe=o("i",{class:"mr-2 text-2xl lg:text-xl las la-trash"},null,-1),De={class:"text-lg hidden md:inline lg:text-2xl"};function Be(e,t,u,l,c,s){return i(),d("div",{onClick:t[0]||(t[0]=n=>s.voidOngoingOrder(u.order)),id:"void-button",class:"flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center bg-red-500 text-white border-box-edge hover:bg-red-600 flex-auto"},[qe,o("span",De,r(s.__("Void")),1)])}const Fe=P(Ne,[["render",Be]]),Ve={name:"ns-pos-note-popup",props:["popup"],data(){return{validation:new D,fields:[{label:a("Note"),name:"note",value:"",description:a("More details about this order"),type:"textarea"},{label:a("Display On Receipt"),name:"note_visibility",value:"",options:[{label:a("Yes"),value:"visible"},{label:a("No"),value:"hidden"}],description:a("Will display the note on the receipt"),type:"switch"}]}},mounted(){this.popupCloser(),this.fields.forEach(e=>{e.name==="note"?e.value=this.popup.params.note:e.name==="note_visibility"&&(e.value=this.popup.params.note_visibility)})},methods:{__:a,popupResolver:V,popupCloser:q,closePopup(){this.popupResolver(!1)},saveNote(){if(!this.validation.validateFields(this.fields)){const e=this.validation.validateFieldsErrors(this.fields);return this.validation.triggerFieldsErrors(this.fields,e),this.$forceUpdate(),v.error(a("Unable to proceed the form is not valid.")).subscribe()}return this.popupResolver(this.validation.extractFields(this.fields))}}},He={class:"shadow-lg ns-box w-95vw md:w-3/5-screen lg:w-2/5-screen"},Qe={class:"p-2 flex justify-between items-center border-b ns-box-header"},Re={class:"font-bold"},Ae={class:"p-2"},Ue={class:"p-2 flex justify-end border-t ns-box-footer"};function Ee(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button");return i(),d("div",He,[o("div",Qe,[o("h3",Re,r(s.__("Order Note")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.closePopup())})])]),o("div",Ae,[(i(!0),d(x,null,C(c.fields,(h,w)=>(i(),S(_,{key:w,field:h},null,8,["field"]))),128))]),o("div",Ue,[f(m,{type:"info",onClick:t[1]||(t[1]=h=>s.saveNote())},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])])}const Ie=P(Ve,[["render",Ee]]),Me={name:"ns-pos-tax-popup",props:["popup"],data(){return{validation:new D,tax_group:[],order:null,orderSubscriber:null,optionsSubscriber:null,options:{},tax_groups:[],activeTab:"",group_fields:[{label:a("Select Tax"),name:"tax_group_id",description:a("Define the tax that apply to the sale."),type:"select",disabled:!0,value:"",validation:"required",options:[]},{label:a("Type"),name:"tax_type",disabled:!0,value:"",description:a("Define how the tax is computed"),type:"select",validation:"required",options:[{label:a("Exclusive"),value:"exclusive"},{label:a("Inclusive"),value:"inclusive"}]}]}},mounted(){this.loadGroups(),this.popupCloser(),this.activeTab=this.popup.params.activeTab||"settings",this.group_fields.forEach(e=>{e.value=this.popup.params[e.name]||void 0}),this.orderSubscriber=POS.order.subscribe(e=>{this.order=e}),this.optionsSubscriber=POS.options.subscribe(e=>{this.options=e,["variable_vat","products_variable_vat"].includes(this.options.ns_pos_vat)&&this.group_fields.forEach(t=>t.disabled=!1)})},unmounted(){this.orderSubscriber.unsubscribe(),this.optionsSubscriber.unsubscribe()},methods:{__:a,nsCurrency:B,popupCloser:q,popupResolver:V,changeActive(e){this.activeTab=e},closePopup(){this.popupResolver(!1)},saveTax(){if(!this.validation.validateFields(this.group_fields))return v.error(a("Unable to proceed the form is not valid.")).subscribe();const e=this.validation.extractFields(this.group_fields);e.tax_groups=[],this.popupResolver(e)},loadGroups(){U.get("/api/taxes/groups").subscribe(e=>{this.groups=e,this.group_fields.forEach(t=>{t.name==="tax_group_id"&&(t.options=this.groups.map(u=>({label:u.name,value:u.id})))})})}}},Ye={class:"ns-box shadow-lg w-95vw md:w-3/5-screen lg:w-2/5-screen"},Ge={class:"p-2 flex justify-between items-center border-b ns-box-header"},$e={class:"text-blog"},We={class:"p-2 ns-box-body"},ze={class:"p-2 border-b ns-box-body"},Le={class:"flex justify-end p-2"},Ke={key:0,class:"p-2"},Je={key:0,class:"p-2 text-center text-primary"},Xe={key:0,class:"p-2"},Ze={class:"border shadow p-2 w-full flex justify-between items-center elevation-surface"};function et(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button"),h=b("ns-tabs-item"),w=b("ns-tabs");return i(),d("div",Ye,[o("div",Ge,[o("h3",$e,r(s.__("Tax & Summary")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=g=>s.closePopup())})])]),o("div",We,[f(w,{active:c.activeTab,onChangeTab:t[2]||(t[2]=g=>s.changeActive(g))},{default:k(()=>[f(h,{padding:"0",label:s.__("Settings"),identifier:"settings",active:!0},{default:k(()=>[o("div",ze,[(i(!0),d(x,null,C(c.group_fields,(g,Q)=>(i(),S(_,{field:g,key:Q},null,8,["field"]))),128))]),o("div",Le,[f(m,{onClick:t[1]||(t[1]=g=>s.saveTax()),type:"info"},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])]),_:1},8,["label"]),f(h,{padding:"0",label:s.__("Summary"),identifier:"summary",active:!1},{default:k(()=>[c.order?(i(),d("div",Ke,[(i(!0),d(x,null,C(c.order.taxes,g=>(i(),d("div",{key:g.id,class:"mb-2 border shadow p-2 w-full flex justify-between items-center elevation-surface"},[o("span",null,r(g.name),1),o("span",null,r(s.nsCurrency(g.tax_value)),1)]))),128)),c.order.taxes.length===0?(i(),d("div",Je,r(s.__("No tax is active")),1)):p("",!0)])):p("",!0)]),_:1},8,["label"]),f(h,{padding:"0",label:s.__("Product Taxes"),identifier:"product_taxes",active:!1},{default:k(()=>[c.order?(i(),d("div",Xe,[o("div",Ze,[o("span",null,r(s.__("Product Taxes")),1),o("span",null,r(s.nsCurrency(c.order.products_tax_value)),1)])])):p("",!0)]),_:1},8,["label"])]),_:1},8,["active"])])])}const tt=P(Me,[["render",et]]),st={name:"ns-pos-order-settings",props:["popup"],mounted(){nsHttpClient.get("/api/fields/ns.pos-order-settings").subscribe(e=>{e.forEach(t=>{t.value=this.popup.params.order[t.name]||""}),this.fields=this.validation.createFields(e)},e=>{}),this.popupCloser()},data(){return{fields:[],validation:new D}},methods:{__,popupCloser,popupResolver,closePopup(){this.popupResolver(!1)},saveSettings(){const e=this.validation.extractFields(this.fields);this.popupResolver(e)}}},ot={class:"shadow-lg flex flex-col ns-box w-95vw h-95vh md:w-3/5-screen md:h-3/5-screen lg:w-2/5-screen"},rt={class:"p-2 border-b ns-box-header items-center flex justify-between"},nt={class:"text-semibold"},it={class:"p-2 flex-auto border-b ns-box-body overflow-y-auto"},dt={class:"p-2 flex justify-end ns-box-footer"};function lt(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-field"),m=b("ns-button");return i(),d("div",ot,[o("div",rt,[o("h3",nt,r(s.__("Order Settings")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.closePopup())})])]),o("div",it,[(i(!0),d(x,null,C(c.fields,(h,w)=>(i(),S(_,{field:h,key:w},null,8,["field"]))),128))]),o("div",dt,[f(m,{onClick:t[1]||(t[1]=h=>s.saveSettings()),type:"info"},{default:k(()=>[O(r(s.__("Save")),1)]),_:1})])])}const at=P(st,[["render",lt]]),ut={name:"ns-pos-product-price-product",props:["popup"],components:{nsNumpad:J,nsNumpadPlus:X},computed:{},data(){return{product:{},optionsSubscription:null,options:{},price:0}},mounted(){this.popupCloser(),this.product=this.popup.params.product,this.optionsSubscription=POS.options.subscribe(e=>{this.options=T(e)})},beforeDestroy(){this.optionsSubscription.unsubscribe()},methods:{popupResolver,popupCloser,nsCurrency:B,__,updateProductPrice(e){this.product.unit_price=e},resolveProductPrice(e){this.popupResolver(this.product.unit_price)}}},ct={class:"ns-box shadow-lg w-95vw md:w-3/5-screen lg:w-2/5-screen"},pt={class:"popup-heading ns-box-header"},_t={class:"flex flex-col ns-box-body"},ht={class:"h-16 flex items-center justify-center elevation-surface info font-bold"},bt={class:"text-2xl"};function mt(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-numpad"),m=b("ns-numpad-plus");return i(),d("div",ct,[o("div",pt,[o("h3",null,r(s.__("Product Price")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=h=>s.popupResolver(!1))})])]),o("div",_t,[o("div",ht,[o("h2",bt,r(s.nsCurrency(c.product.unit_price)),1)]),c.options.ns_pos_numpad==="default"?(i(),S(_,{key:0,floating:c.options.ns_pos_allow_decimal_quantities,onChanged:t[1]||(t[1]=h=>s.updateProductPrice(h)),onNext:t[2]||(t[2]=h=>s.resolveProductPrice(h)),value:c.product.unit_price},null,8,["floating","value"])):p("",!0),c.options.ns_pos_numpad==="advanced"?(i(),S(m,{key:1,onChanged:t[3]||(t[3]=h=>s.updateProductPrice(h)),onNext:t[4]||(t[4]=h=>s.resolveProductPrice(h)),value:c.product.unit_price},null,8,["value"])):p("",!0)])])}const ft=P(ut,[["render",mt]]),yt={name:"ns-pos-quick-product-popup",props:["popup"],methods:{__:a,popupCloser:q,popupResolver:V,close(){this.popupResolver(!1)},async addProduct(){const e=this.validation.extractFields(this.fields),t=this.fields.filter(s=>typeof s.show>"u"||typeof s.show=="function"&&s.show(e));if(!this.validation.validateFields(t))return v.error(a("Unable to proceed. The form is not valid.")).subscribe();let l=this.validation.extractFields(t);l.$original=()=>({stock_management:"disabled",category_id:0,tax_group:this.tax_groups.filter(s=>parseInt(s.id)===parseInt(l.tax_group_id))[0],tax_group_id:l.tax_group_id,tax_type:l.tax_type}),l.product_type==="product"?(l.unit_name=this.units.filter(s=>s.id===l.unit_id)[0].name,l.quantity=parseFloat(l.quantity),l.unit_price=parseFloat(l.unit_price),l.mode="custom",l.price_with_tax=l.unit_price,l.price_without_tax=l.unit_price,l.tax_value=0):(l.unit_name=a("N/A"),l.unit_price=0,l.quantity=1);const c=await POS.defineQuantities(l,this.units);l.$quantities=()=>c,l=POS.computeProductTax(l),POS.addToCart(l),this.close()},loadData(){this.loaded=!1,E(nsHttpClient.get("/api/units"),nsHttpClient.get("/api/taxes/groups")).subscribe({next:e=>{this.units=e[0],this.tax_groups=e[1],this.fields.filter(t=>{t.name==="tax_group_id"&&(t.options=e[1].map(u=>({label:u.name,value:u.id})),e[1].length>0&&e[1][0].id!==void 0&&(t.value=e[1][0].id||this.options.ns_pos_tax_group)),t.name==="tax_type"&&(t.value=this.options.tax_type||"inclusive"),t.name==="unit_id"&&(t.value=this.options.ns_pos_quick_product_default_unit,t.options=e[0].map(u=>({label:u.name,value:u.id})))}),this.buildForm()},error:e=>{}})},buildForm(){this.fields=this.validation.createFields(this.fields),this.loaded=!0,setTimeout(()=>{this.$el.querySelector("#name").select()},100)}},computed:{form(){return this.validation.extractFields(this.fields)}},data(){return{units:[],options:POS.options.getValue(),tax_groups:[],loaded:!1,validation:new D,fields:[{label:a("Name"),name:"name",type:"text",description:a("Provide a unique name for the product."),validation:"required"},{label:a("Product Type"),name:"product_type",type:"select",description:a("Define the product type."),options:[{label:a("Normal"),value:"product"},{label:a("Dynamic"),value:"dynamic"}],value:"product",validation:"required"},{label:a("Rate"),name:"rate",type:"text",description:a("In case the product is computed based on a percentage, define the rate here."),validation:"required",show(e){return e.product_type==="dynamic"}},{label:a("Unit Price"),name:"unit_price",type:"text",description:a("Define what is the sale price of the item."),validation:"",value:0,show(e){return e.product_type==="product"}},{label:a("Quantity"),name:"quantity",type:"text",value:1,description:a("Set the quantity of the product."),validation:"",show(e){return e.product_type==="product"}},{label:a("Unit"),name:"unit_id",type:"select",options:[],description:a("Assign a unit to the product."),validation:"",show(e){return e.product_type==="product"}},{label:a("Tax Type"),name:"tax_type",type:"select",options:[{label:a("Disabled"),value:""},{label:a("Inclusive"),value:"inclusive"},{label:a("Exclusive"),value:"exclusive"}],description:a("Define what is tax type of the item."),show(e){return e.product_type==="product"}},{label:a("Tax Group"),name:"tax_group_id",type:"select",options:[],description:a("Choose the tax group that should apply to the item."),show(e){return e.product_type==="product"}}]}},mounted(){this.popupCloser(),this.loadData()}},vt={class:"w-95vw flex flex-col h-95vh shadow-lg md:w-3/5-screen lg:w-2/5-screen md:h-3/5-screen ns-box"},xt={class:"header ns-box-header border-b flex justify-between p-2 items-center"},wt={class:"ns-box-body p-2 flex-auto overflow-y-auto"},gt={key:0,class:"h-full w-full flex justify-center items-center"},Pt={class:"ns-box-footer border-t flex justify-between p-2"},kt=o("div",null,null,-1);function Ct(e,t,u,l,c,s){const n=b("ns-close-button"),_=b("ns-spinner"),m=b("ns-field"),h=b("ns-button");return i(),d("div",vt,[o("div",xt,[o("h3",null,r(s.__("Product / Service")),1),o("div",null,[f(n,{onClick:t[0]||(t[0]=w=>s.close())})])]),o("div",wt,[c.loaded?p("",!0):(i(),d("div",gt,[f(_)])),c.loaded?(i(!0),d(x,{key:1},C(c.fields,(w,g)=>(i(),d(x,null,[w.show&&w.show(s.form)||!w.show?(i(),S(m,{key:g,field:w},null,8,["field"])):p("",!0)],64))),256)):p("",!0)]),o("div",Pt,[kt,o("div",null,[f(h,{onClick:t[1]||(t[1]=w=>s.addProduct()),type:"info"},{default:k(()=>[O(r(s.__("Create")),1)]),_:1})])])])}const St=P(yt,[["render",Ct]]),Tt={name:"ns-pos-cart",data:()=>({popup:null,cartButtons:{},products:[],defaultCartButtons:{nsPosPayButton:j(re),nsPosHoldButton:j(ke),nsPosDiscountButton:j(je),nsPosVoidButton:j(Fe)},visibleSection:null,visibleSectionSubscriber:null,cartButtonsSubscriber:null,optionsSubscriber:null,options:{},typeSubscribe:null,orderSubscribe:null,productSubscribe:null,settingsSubscribe:null,settings:{},types:[],order:T({})}),computed:{selectedType(){return this.order.type?this.order.type.label:"N/A"},isVisible(){return this.visibleSection==="cart"},customerName(){return this.order.customer?`${this.order.customer.first_name||this.order.customer.last_name?this.getFirstName():this.getUserName()}`:"N/A"},couponName(){return a("Apply Coupon")}},mounted(){this.cartButtonsSubscriber=POS.cartButtons.subscribe(e=>{this.cartButtons=e}),this.optionsSubscriber=POS.options.subscribe(e=>{this.options=e}),this.typeSubscribe=POS.types.subscribe(e=>this.types=e),this.orderSubscribe=POS.order.subscribe(e=>{this.order=T(e)}),this.productSubscribe=POS.products.subscribe(e=>{this.products=T(e)}),this.settingsSubscribe=POS.settings.subscribe(e=>{this.settings=T(e)}),this.visibleSectionSubscriber=POS.visibleSection.subscribe(e=>{this.visibleSection=T(e)}),I.addAction("ns-before-cart-reset","ns-pos-cart-buttons",()=>{POS.cartButtons.next(this.defaultCartButtons)});for(let e in nsShortcuts)["ns_pos_keyboard_shipping"].includes(e)&&nsHotPress.create("ns_pos_keyboard_shipping").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.openShippingPopup()}),["ns_pos_keyboard_note"].includes(e)&&nsHotPress.create("ns_pos_keyboard_note").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,t=>{t.preventDefault(),this.openNotePopup()})},unmounted(){this.visibleSectionSubscriber.unsubscribe(),this.typeSubscribe.unsubscribe(),this.orderSubscribe.unsubscribe(),this.productSubscribe.unsubscribe(),this.settingsSubscribe.unsubscribe(),this.optionsSubscriber.unsubscribe(),this.cartButtonsSubscriber.unsubscribe(),nsHotPress.destroy("ns_pos_keyboard_shipping"),nsHotPress.destroy("ns_pos_keyboard_note")},methods:{__:a,nsCurrency:B,switchTo:M,getFirstName(){return`${this.order.customer.first_name||""} ${this.order.customer.last_name||""}`},getUserName(){return this.order.customer.username},takeRandomClass(){return"border-gray-500 bg-gray-400 text-white hover:bg-gray-500"},openAddQuickProduct(){new Promise((t,u)=>{y.show(St,{resolve:t,reject:u})}).then(t=>{}).catch(t=>{})},summarizeCoupons(){const e=this.order.coupons.map(t=>t.value);return e.length>0?e.reduce((t,u)=>t+u):0},async changeProductPrice(e){if(!this.settings.edit_purchase_price)return v.error(a("You don't have the right to edit the purchase price.")).subscribe();if(e.product_type==="dynamic")return v.error(a("Dynamic product can't have their price updated.")).subscribe();if(this.settings.unit_price_editable)try{const t=await new Promise((l,c)=>y.show(ft,{product:Object.assign({},e),resolve:l,reject:c})),u={...e.$quantities(),custom_price_edit:t};return e.$quantities=()=>u,e.mode="custom",e=POS.computeProductTax(e),POS.recomputeProducts(POS.products.getValue()),POS.refreshCart(),v.success(a("The product price has been updated.")).subscribe()}catch(t){if(t!==!1)throw v.error(t).subscribe(),t}else return v.error(a("The editable price feature is disabled.")).subscribe()},async selectCoupon(){try{const e=await new Promise((t,u)=>{y.show(Y,{resolve:t,reject:u})})}catch{}},async defineOrderSettings(){if(!this.settings.edit_settings)return v.error(a("You're not allowed to edit the order settings.")).subscribe();try{const e=await new Promise((t,u)=>{y.show(at,{resolve:t,reject:u,order:this.order})});POS.order.next({...this.order,...e})}catch{}},async openNotePopup(){try{const e=await new Promise((u,l)=>{const c=this.order.note,s=this.order.note_visibility;y.show(Ie,{resolve:u,reject:l,note:c,note_visibility:s})}),t={...this.order,...e};POS.order.next(t)}catch(e){e!==!1&&v.error(e.message).subscribe()}},async selectTaxGroup(e="settings"){try{const t=await new Promise((l,c)=>{const s=this.order.taxes,n=this.order.tax_group_id,_=this.order.tax_type;y.show(tt,{resolve:l,reject:c,taxes:s,tax_group_id:n,tax_type:_,activeTab:e})}),u={...this.order,...t};POS.order.next(u),POS.refreshCart()}catch{}},openTaxSummary(){this.selectTaxGroup("summary")},selectCustomer(){y.show(G)},openDiscountPopup(e,t){if(!this.settings.products_discount&&t==="product")return v.error(a("You're not allowed to add a discount on the product.")).subscribe();if(!this.settings.cart_discount&&t==="cart")return v.error(a("You're not allowed to add a discount on the cart.")).subscribe();new Promise((u,l)=>{y.show(H,{reference:e,resolve:u,reject:l,type:t,onSubmit(c){t==="product"?POS.updateProduct(e,c):t==="cart"&&POS.updateCart(e,c)}},{popupClass:"bg-white h:2/3 shadow-lg xl:w-1/4 lg:w-2/5 md:w-2/3 w-full"})})},toggleMode(e,t){if(!this.options.ns_pos_allow_wholesale_price)return v.error(a("Unable to change the price mode. This feature has been disabled.")).subscribe();e.mode==="normal"?y.show(F,{title:a("Enable WholeSale Price"),message:a("Would you like to switch to wholesale price ?"),onAction(u){u&&POS.updateProduct(e,{mode:"wholesale"},t)}}):y.show(F,{title:a("Enable Normal Price"),message:a("Would you like to switch to normal price ?"),onAction(u){u&&POS.updateProduct(e,{mode:"normal"},t)}})},removeUsingIndex(e){y.show(F,{title:a("Confirm Your Action"),message:a("Would you like to delete this product ?"),onAction(t){t&&POS.removeProductUsingIndex(e)}})},allowQuantityModification(e){return e.product_type==="product"},changeQuantity(e,t){this.allowQuantityModification(e)&&new W(e).run({unit_quantity_id:e.unit_quantity_id,unit_name:e.unit_name,$quantities:e.$quantities}).then(l=>{POS.updateProduct(e,l,t)})},openOrderType(){y.show($)},openShippingPopup(){y.show(Z)}}},Ot={id:"pos-cart",class:"flex-auto flex flex-col"},jt={key:0,id:"tools",class:"flex pl-2 ns-tab"},Nt={key:0,class:"flex items-center justify-center text-sm rounded-full h-6 w-6 bg-green-500 text-white ml-1"},qt={class:"rounded shadow ns-tab-item flex-auto flex overflow-hidden"},Dt={class:"cart-table flex flex-auto flex-col overflow-hidden"},Bt={id:"cart-toolbox",class:"w-full p-2 border-b"},Ft={class:"border rounded overflow-hidden"},Vt={class:"flex flex-wrap"},Ht={class:"ns-button"},Qt=o("i",{class:"las la-comment"},null,-1),Rt={class:"ml-1 hidden md:inline-block"},At=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Ut={class:"ns-button"},Et=o("i",{class:"las la-balance-scale-left"},null,-1),It={class:"ml-1 hidden md:inline-block"},Mt={key:0,class:"ml-1 rounded-full flex items-center justify-center h-6 w-6 bg-info-secondary text-white"},Yt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Gt={class:"ns-button"},$t=o("i",{class:"las la-tags"},null,-1),Wt={class:"ml-1 hidden md:inline-block"},zt={key:0,class:"ml-1 rounded-full flex items-center justify-center h-6 w-6 bg-info-secondary text-white"},Lt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),Kt={class:"ns-button"},Jt=o("i",{class:"las la-tools"},null,-1),Xt={class:"ml-1 hidden md:inline-block"},Zt=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),es={key:0,class:"ns-button"},ts=o("i",{class:"las la-plus"},null,-1),ss={class:"ml-1 hidden md:inline-block"},os=o("hr",{class:"h-10",style:{width:"1px"}},null,-1),rs={id:"cart-table-header",class:"w-full text-primary font-semibold flex"},ns={class:"w-full lg:w-4/6 p-2 border border-l-0 border-t-0"},is={class:"hidden lg:flex lg:w-1/6 p-2 border-b border-t-0"},ds={class:"hidden lg:flex lg:w-1/6 p-2 border border-r-0 border-t-0"},ls={id:"cart-products-table",class:"flex flex-auto flex-col overflow-auto"},as={key:0,class:"text-primary flex"},us={class:"w-full text-center py-4 border-b"},cs=["product-index"],ps={class:"w-full lg:w-4/6 p-2 border border-l-0 border-t-0"},_s={class:"flex justify-between product-details mb-1"},hs={class:"font-semibold"},bs={class:"-mx-1 flex product-options"},ms={class:"px-1"},fs=["onClick"],ys=o("i",{class:"las la-trash text-xl"},null,-1),vs=[ys],xs={key:0,class:"px-1"},ws=["onClick"],gs=o("i",{class:"las la-award text-xl"},null,-1),Ps=[gs],ks={class:"flex justify-between product-controls"},Cs={class:"-mx-1 flex flex-wrap"},Ss={class:"px-1 w-1/2 md:w-auto mb-1"},Ts=["onClick"],Os={class:"px-1 w-1/2 md:w-auto mb-1"},js=["onClick"],Ns={key:0},qs={class:"px-1 w-1/2 md:w-auto mb-1 lg:hidden"},Ds=["onClick"],Bs={class:"px-1 w-1/2 md:w-auto mb-1 lg:hidden"},Fs={class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},Vs=["onClick"],Hs={key:0,class:"border-b border-dashed border-info-primary p-2"},Qs={class:"hidden lg:flex w-1/6 p-2 border border-r-0 border-t-0 items-center justify-center"},Rs={id:"cart-products-summary",class:"flex"},As={key:0,class:"table ns-table w-full text-sm"},Us={width:"200",class:"border p-2"},Es={width:"200",class:"border p-2"},Is={width:"200",class:"border p-2 text-right"},Ms={key:0},Ys=o("td",{width:"200",class:"border p-2"},null,-1),Gs={width:"200",class:"border p-2"},$s={width:"200",class:"border p-2 text-right"},Ws={width:"200",class:"border p-2"},zs={width:"200",class:"border p-2"},Ls={key:0},Ks={key:1},Js={width:"200",class:"border p-2 text-right"},Xs={key:1},Zs=o("td",{width:"200",class:"border p-2"},null,-1),eo={width:"200",class:"border p-2"},to={width:"200",class:"border p-2 text-right"},so={class:"success"},oo={width:"200",class:"border p-2"},ro={width:"200",class:"border p-2"},no={width:"200",class:"border p-2 text-right"},io={key:1,class:"table ns-table w-full text-sm"},lo={width:"200",class:"border p-2"},ao={width:"200",class:"border p-2"},uo={class:"flex justify-between"},co={key:0},po=o("td",{width:"200",class:"border p-2"},null,-1),_o={width:"200",class:"border p-2"},ho={width:"200",class:"border p-2 text-right"},bo={width:"200",class:"border p-2"},mo={width:"200",class:"border p-2"},fo={class:"flex justify-between items-center"},yo={key:0},vo={key:1},xo={key:1},wo=o("td",{width:"200",class:"border p-2"},null,-1),go={width:"200",class:"border p-2"},Po=o("span",null,null,-1),ko={class:"success"},Co={width:"200",class:"border p-2"},So={width:"200",class:"border p-2"},To={class:"flex justify-between w-full"},Oo={class:"h-16 flex flex-shrink-0 border-t border-box-edge",id:"cart-bottom-buttons"},jo=o("i",{class:"mx-4 rounded-full bg-slate-300 h-5 w-5"},null,-1),No=o("div",{class:"text-lg mr-4 hidden md:flex md:flex-auto lg:text-2xl"},[o("div",{class:"h-2 flex-auto bg-slate-200 rounded"})],-1),qo=[jo,No];function Do(e,t,u,l,c,s){return i(),d("div",Ot,[e.visibleSection==="cart"?(i(),d("div",jt,[o("div",{onClick:t[0]||(t[0]=n=>s.switchTo("cart")),class:"flex cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 font-semibold active tab"},[o("span",null,r(s.__("Cart")),1),e.order?(i(),d("span",Nt,r(e.order.products.length),1)):p("",!0)]),o("div",{onClick:t[1]||(t[1]=n=>s.switchTo("grid")),class:"cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 border-t border-r border-l inactive tab"},r(s.__("Products")),1)])):p("",!0),o("div",qt,[o("div",Dt,[o("div",Bt,[o("div",Ft,[o("div",Vt,[o("div",Ht,[o("button",{onClick:t[2]||(t[2]=n=>s.openNotePopup()),class:"w-full h-10 px-3 outline-none"},[Qt,o("span",Rt,r(s.__("Comments")),1)])]),At,o("div",Ut,[o("button",{onClick:t[3]||(t[3]=n=>s.selectTaxGroup()),class:"w-full h-10 px-3 outline-none flex items-center"},[Et,o("span",It,r(s.__("Taxes")),1),e.order.taxes&&e.order.taxes.length>0?(i(),d("span",Mt,r(e.order.taxes.length),1)):p("",!0)])]),Yt,o("div",Gt,[o("button",{onClick:t[4]||(t[4]=n=>s.selectCoupon()),class:"w-full h-10 px-3 outline-none flex items-center"},[$t,o("span",Wt,r(s.__("Coupons")),1),e.order.coupons&&e.order.coupons.length>0?(i(),d("span",zt,r(e.order.coupons.length),1)):p("",!0)])]),Lt,o("div",Kt,[o("button",{onClick:t[5]||(t[5]=n=>s.defineOrderSettings()),class:"w-full h-10 px-3 outline-none flex items-center"},[Jt,o("span",Xt,r(s.__("Settings")),1)])]),Zt,e.options.ns_pos_quick_product==="yes"?(i(),d("div",es,[o("button",{onClick:t[6]||(t[6]=n=>s.openAddQuickProduct()),class:"w-full h-10 px-3 outline-none flex items-center"},[ts,o("span",ss,r(s.__("Product")),1)])])):p("",!0),os])])]),o("div",rs,[o("div",ns,r(s.__("Product")),1),o("div",is,r(s.__("Quantity")),1),o("div",ds,r(s.__("Total")),1)]),o("div",ls,[e.products.length===0?(i(),d("div",as,[o("div",us,[o("h3",null,r(s.__("No products added...")),1)])])):p("",!0),(i(!0),d(x,null,C(e.products,(n,_)=>(i(),d("div",{"product-index":_,key:n.barcode,class:"product-item flex"},[o("div",ps,[o("div",_s,[o("h3",hs,r(n.name)+" — "+r(n.unit_name),1),o("div",bs,[o("div",ms,[o("a",{onClick:m=>s.removeUsingIndex(_),class:"hover:text-error-secondary cursor-pointer outline-none border-dashed py-1 border-b border-error-secondary text-sm"},vs,8,fs)]),e.options.ns_pos_allow_wholesale_price&&s.allowQuantityModification(n)?(i(),d("div",xs,[o("a",{class:N([n.mode==="wholesale"?"text-success-secondary border-success-secondary":"border-info-primary","cursor-pointer outline-none border-dashed py-1 border-b text-sm"]),onClick:m=>s.toggleMode(n,_)},Ps,10,ws)])):p("",!0)])]),o("div",ks,[o("div",Cs,[o("div",Ss,[o("a",{onClick:m=>s.changeProductPrice(n),class:N([n.mode==="wholesale"?"text-success-secondary hover:text-success-secondary border-success-secondary":"border-info-primary","cursor-pointer outline-none border-dashed py-1 border-b text-sm"])},r(s.__("Price"))+" : "+r(s.nsCurrency(n.unit_price)),11,Ts)]),o("div",Os,[s.allowQuantityModification(n)?(i(),d("a",{key:0,onClick:m=>s.openDiscountPopup(n,"product",_),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},[O(r(s.__("Discount"))+" ",1),n.discount_type==="percentage"?(i(),d("span",Ns,r(n.discount_percentage)+"%",1)):p("",!0),O(" : "+r(s.nsCurrency(n.discount)),1)],8,js)):p("",!0)]),o("div",qs,[s.allowQuantityModification(n)?(i(),d("a",{key:0,onClick:m=>s.changeQuantity(n,_),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Quantity"))+": "+r(n.quantity),9,Ds)):p("",!0)]),o("div",Bs,[o("span",Fs,r(s.__("Total :"))+" "+r(s.nsCurrency(n.total_price)),1)])])])]),o("div",{onClick:m=>s.changeQuantity(n,_),class:N([s.allowQuantityModification(n)?"cursor-pointer ns-numpad-key":"","hidden lg:flex w-1/6 p-2 border-b items-center justify-center"])},[s.allowQuantityModification(n)?(i(),d("span",Hs,r(n.quantity),1)):p("",!0)],10,Vs),o("div",Qs,r(s.nsCurrency(n.total_price)),1)],8,cs))),128))]),o("div",Rs,[e.visibleSection==="both"?(i(),d("table",As,[o("tr",null,[o("td",Us,[o("a",{onClick:t[7]||(t[7]=n=>s.selectCustomer()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Customer"))+": "+r(s.customerName),1)]),o("td",Es,r(s.__("Sub Total")),1),o("td",Is,r(s.nsCurrency(e.order.subtotal)),1)]),e.order.coupons.length>0?(i(),d("tr",Ms,[Ys,o("td",Gs,[o("a",{onClick:t[8]||(t[8]=n=>s.selectCoupon()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Coupons")),1)]),o("td",$s,r(s.nsCurrency(s.summarizeCoupons())),1)])):p("",!0),o("tr",null,[o("td",Ws,[o("a",{onClick:t[9]||(t[9]=n=>s.openOrderType()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Type"))+": "+r(s.selectedType),1)]),o("td",zs,[o("span",null,r(s.__("Discount")),1),e.order.discount_type==="percentage"?(i(),d("span",Ls,"("+r(e.order.discount_percentage)+"%)",1)):p("",!0),e.order.discount_type==="flat"?(i(),d("span",Ks,"("+r(s.__("Flat"))+")",1)):p("",!0)]),o("td",Js,[o("a",{onClick:t[10]||(t[10]=n=>s.openDiscountPopup(e.order,"cart")),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.nsCurrency(e.order.discount)),1)])]),e.order.type&&e.order.type.identifier==="delivery"?(i(),d("tr",Xs,[Zs,o("td",eo,[o("a",{onClick:t[11]||(t[11]=n=>s.openShippingPopup()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Shipping")),1)]),o("td",to,r(s.nsCurrency(e.order.shipping)),1)])):p("",!0),o("tr",so,[o("td",oo,[e.order&&e.options.ns_pos_tax_type==="exclusive"?(i(),d(x,{key:0},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[12]||(t[12]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[13]||(t[13]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):p("",!0)],64)):e.order&&e.options.ns_pos_tax_type==="inclusive"?(i(),d(x,{key:1},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[14]||(t[14]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+(e.order.products_exclusive_tax_value+e.order.products_inclusive_tax_value))),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[15]||(t[15]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):p("",!0)],64)):p("",!0)]),o("td",ro,r(s.__("Total")),1),o("td",no,r(s.nsCurrency(e.order.total)),1)])])):p("",!0),e.visibleSection==="cart"?(i(),d("table",io,[o("tr",null,[o("td",lo,[o("a",{onClick:t[16]||(t[16]=n=>s.selectCustomer()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Customer"))+": "+r(s.customerName),1)]),o("td",ao,[o("div",uo,[o("span",null,r(s.__("Sub Total")),1),o("span",null,r(s.nsCurrency(e.order.subtotal)),1)])])]),e.order.coupons.length>0?(i(),d("tr",co,[po,o("td",_o,[o("a",{onClick:t[17]||(t[17]=n=>s.selectCoupon()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Coupons")),1)]),o("td",ho,r(s.nsCurrency(s.summarizeCoupons())),1)])):p("",!0),o("tr",null,[o("td",bo,[o("a",{onClick:t[18]||(t[18]=n=>s.openOrderType()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Type"))+": "+r(s.selectedType),1)]),o("td",mo,[o("div",fo,[o("p",null,[o("span",null,r(s.__("Discount")),1),e.order.discount_type==="percentage"?(i(),d("span",yo,"("+r(e.order.discount_percentage)+"%)",1)):p("",!0),e.order.discount_type==="flat"?(i(),d("span",vo,"("+r(s.__("Flat"))+")",1)):p("",!0)]),o("a",{onClick:t[19]||(t[19]=n=>s.openDiscountPopup(e.order,"cart")),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.nsCurrency(e.order.discount)),1)])])]),e.order.type&&e.order.type.identifier==="delivery"?(i(),d("tr",xo,[wo,o("td",go,[o("a",{onClick:t[20]||(t[20]=n=>s.openShippingPopup()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Shipping")),1),Po])])):p("",!0),o("tr",ko,[o("td",Co,[e.order&&e.options.ns_pos_tax_type==="exclusive"?(i(),d(x,{key:0},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[21]||(t[21]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[22]||(t[22]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Inclusive"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):p("",!0)],64)):e.order&&e.options.ns_pos_tax_type==="inclusive"?(i(),d(x,{key:1},[e.options.ns_pos_price_with_tax==="yes"?(i(),d("a",{key:0,onClick:t[23]||(t[23]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value)),1)):e.options.ns_pos_price_with_tax==="no"?(i(),d("a",{key:1,onClick:t[24]||(t[24]=n=>s.openTaxSummary()),class:"cursor-pointer outline-none border-dashed py-1 border-b border-info-primary text-sm"},r(s.__("Tax Included"))+": "+r(s.nsCurrency(e.order.total_tax_value+e.order.products_tax_value)),1)):p("",!0)],64)):p("",!0)]),o("td",So,[o("div",To,[o("span",null,r(s.__("Total")),1),o("span",null,r(s.nsCurrency(e.order.total)),1)])])])])):p("",!0)]),o("div",Oo,[Object.keys(e.cartButtons).length===0?(i(!0),d(x,{key:0},C(new Array(4).fill(),n=>(i(),d("div",{class:N([s.takeRandomClass(),"animate-pulse flex-shrink-0 w-1/4 flex items-center font-bold cursor-pointer justify-center border-r flex-auto"])},qo,2))),256)):p("",!0),(i(!0),d(x,null,C(e.cartButtons,n=>(i(),S(L(n),{order:e.order,settings:e.settings},null,8,["order","settings"]))),256))])])])])}const Mo=P(Tt,[["render",Do]]);export{Mo as default}; diff --git a/public/build/assets/ns-pos-customers-button-21230a7b.js b/public/build/assets/ns-pos-customers-button-21230a7b.js new file mode 100644 index 000000000..9929ce34c --- /dev/null +++ b/public/build/assets/ns-pos-customers-button-21230a7b.js @@ -0,0 +1 @@ +import{_ as r}from"./preload-helper-41c905a7.js";import{P as n}from"./bootstrap-8be442b1.js";import{_ as a}from"./currency-f8bd78d1.js";import{_ as u}from"./_plugin-vue_export-helper-c27b6911.js";import{d as p,o as _,c,a as t,t as l}from"./runtime-core.esm-bundler-b48de70a.js";const m={name:"ns-pos-customers-button",methods:{__:a,openCustomerPopup(){n.show(p({loader:()=>r(()=>import("./ns-pos-order-type-popup-5204386b.js").then(e=>e.d),["./ns-pos-order-type-popup-5204386b.js","./bootstrap-8be442b1.js","./currency-f8bd78d1.js","./runtime-core.esm-bundler-b48de70a.js","./ns-prompt-popup-100414c5.js","./_plugin-vue_export-helper-c27b6911.js","./ns-prompt-popup-6013118d.css","./ns-orders-preview-popup-5ba94079.js","./index.es-25aa42ee.js"],import.meta.url)}))}},beforeDestroy(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(e)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,s=>{s.preventDefault(),this.openCustomerPopup()})}},i={class:"ns-button default"},d=t("i",{class:"mr-1 text-xl lar la-user-circle"},null,-1);function f(e,s,h,P,x,o){return _(),c("div",i,[t("button",{onClick:s[0]||(s[0]=b=>o.openCustomerPopup()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[d,t("span",null,l(o.__("Customers")),1)])])}const B=u(m,[["render",f]]);export{B as default}; diff --git a/public/build/assets/ns-pos-customers-button-Bs0KmNPr.js b/public/build/assets/ns-pos-customers-button-Bs0KmNPr.js deleted file mode 100644 index 3e6b9614e..000000000 --- a/public/build/assets/ns-pos-customers-button-Bs0KmNPr.js +++ /dev/null @@ -1,7 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./ns-pos-order-type-popup-BV_7i2Py.js","./bootstrap-CnLEEQCx.js","./currency-lOMYG1Wf.js","./runtime-core.esm-bundler-RT2b-_3S.js","./ns-prompt-popup-DKRiwYBT.js","./_plugin-vue_export-helper-DlAUqK2U.js","./ns-prompt-popup-CVxzoclS.css","./ns-orders-preview-popup-DkNvPnrF.js","./index.es-Br67aBEV.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -import{_ as r}from"./preload-helper-BQ24v_F8.js";import{P as n}from"./bootstrap-CnLEEQCx.js";import{_ as a}from"./currency-lOMYG1Wf.js";import{_ as u}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{d as p,o as _,c,a as t,t as l}from"./runtime-core.esm-bundler-RT2b-_3S.js";const m={name:"ns-pos-customers-button",methods:{__:a,openCustomerPopup(){n.show(p({loader:()=>r(()=>import("./ns-pos-order-type-popup-BV_7i2Py.js").then(e=>e.d),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)}))}},beforeDestroy(){nsHotPress.destroy("ns_pos_keyboard_create_customer")},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_create_customer"].includes(e)&&nsHotPress.create("ns_pos_keyboard_create_customer").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,s=>{s.preventDefault(),this.openCustomerPopup()})}},i={class:"ns-button default"},d=t("i",{class:"mr-1 text-xl lar la-user-circle"},null,-1);function f(e,s,h,P,x,o){return _(),c("div",i,[t("button",{onClick:s[0]||(s[0]=b=>o.openCustomerPopup()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[d,t("span",null,l(o.__("Customers")),1)])])}const B=u(m,[["render",f]]);export{B as default}; diff --git a/public/build/assets/ns-pos-dashboard-button-Bw-MsaBT.js b/public/build/assets/ns-pos-dashboard-button-d46d82b6.js similarity index 72% rename from public/build/assets/ns-pos-dashboard-button-Bw-MsaBT.js rename to public/build/assets/ns-pos-dashboard-button-d46d82b6.js index 7c2e9c63a..ec0c7920f 100644 --- a/public/build/assets/ns-pos-dashboard-button-Bw-MsaBT.js +++ b/public/build/assets/ns-pos-dashboard-button-d46d82b6.js @@ -1 +1 @@ -import{_ as a}from"./currency-lOMYG1Wf.js";import{_ as e}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as r,c as n,a as s,t as l}from"./runtime-core.esm-bundler-RT2b-_3S.js";const c={name:"ns-pos-dashboard-button",methods:{__:a,goToDashboard(){return document.location=POS.settings.getValue().urls.dashboard_url}}},d={class:"ns-button success"},u=s("i",{class:"mr-1 text-xl las la-tachometer-alt"},null,-1);function _(i,t,m,p,h,o){return r(),n("div",d,[s("button",{onClick:t[0]||(t[0]=f=>o.goToDashboard()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[u,s("span",null,l(o.__("Dashboard")),1)])])}const D=e(c,[["render",_]]);export{D as default}; +import{_ as a}from"./currency-f8bd78d1.js";import{_ as e}from"./_plugin-vue_export-helper-c27b6911.js";import{o as r,c as n,a as s,t as l}from"./runtime-core.esm-bundler-b48de70a.js";const c={name:"ns-pos-dashboard-button",methods:{__:a,goToDashboard(){return document.location=POS.settings.getValue().urls.dashboard_url}}},d={class:"ns-button success"},u=s("i",{class:"mr-1 text-xl las la-tachometer-alt"},null,-1);function _(i,t,m,p,h,o){return r(),n("div",d,[s("button",{onClick:t[0]||(t[0]=f=>o.goToDashboard()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[u,s("span",null,l(o.__("Dashboard")),1)])])}const D=e(c,[["render",_]]);export{D as default}; diff --git a/public/build/assets/ns-pos-grid-BRV51Ubf.js b/public/build/assets/ns-pos-grid-0d26a576.js similarity index 97% rename from public/build/assets/ns-pos-grid-BRV51Ubf.js rename to public/build/assets/ns-pos-grid-0d26a576.js index bb3e28a0f..6d6069389 100644 --- a/public/build/assets/ns-pos-grid-BRV51Ubf.js +++ b/public/build/assets/ns-pos-grid-0d26a576.js @@ -1 +1 @@ -import{g as P,p as T,a as v,b,v as k,w as I}from"./bootstrap-CnLEEQCx.js";import{s as j}from"./pos-section-switch-DmfccXVX.js";import{_ as p,n as V}from"./currency-lOMYG1Wf.js";import{n as O}from"./ns-prompt-popup-DKRiwYBT.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as x,o as l,c as n,a as s,t as a,f as y,B as S,F as _,b as g,e as d,n as w,i as m,w as L}from"./runtime-core.esm-bundler-RT2b-_3S.js";const H={name:"ns-pos-search-product",props:["popup"],data(){return{searchValue:"",products:[],isLoading:!1,debounce:null}},watch:{searchValue(){clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.search()},500)}},mounted(){this.$refs.searchField.focus(),this.$refs.searchField.addEventListener("keydown",t=>{t.keyCode===27&&this.popupResolver(!1)}),this.popupCloser()},methods:{__:p,popupCloser:P,popupResolver:T,addToCart(t){if(this.popup.close(),parseInt(t.accurate_tracking)===1)return Popup.show(O,{title:p("Unable to add the product"),message:p(`The product "{product}" can't be added from a search field, as "Accurate Tracking" is enabled. Would you like to learn more ?`).replace("{product}",t.name),onAction:e=>{e&&window.open("https://my.nexopos.com/en/documentation/troubleshooting/accurate-tracking","_blank")}});POS.addToCart(t)},search(){this.isLoading=!0,v.post("/api/products/search",{search:this.searchValue}).subscribe({next:t=>{if(this.isLoading=!1,this.products=t,this.products.length===1&&this.addToCart(this.products[0]),this.products.length===0)return b.info(p("No result to result match the search value provided.")).subscribe()},error:t=>{this.isLoading=!1,b.error(t.message).subscribe()}})}}},W={id:"product-search",class:"ns-box shadow-lg w-95vw h-95vh md:h-3/5-screen md:w-2/4-screen flex flex-col overflow-hidden"},B={class:"p-2 border-b ns-box-header flex justify-between items-center"},F={class:"text-primary"},N={class:"flex-auto overflow-hidden flex flex-col"},U={class:"p-2 border-b ns-box-body"},q={class:"flex input-group info border-2 rounded overflow-hidden"},A={class:"overflow-y-auto ns-scrollbar flex-auto relative"},z={class:"ns-vertical-menu"},E=["onClick"],D={class:""},M={class:"text-primary"},G={class:"text-soft-secondary text-xs"},K=s("div",null,null,-1),R={key:0},J={class:"text-primary text-center p-2"},Q={key:1,class:"absolute h-full w-full flex items-center justify-center z-10 top-0",style:{background:"rgb(187 203 214 / 29%)"}};function X(t,e,u,h,o,i){const f=x("ns-close-button"),r=x("ns-spinner");return l(),n("div",W,[s("div",B,[s("h3",F,a(i.__("Search Product")),1),s("div",null,[y(f,{onClick:e[0]||(e[0]=c=>u.popup.close())})])]),s("div",N,[s("div",U,[s("div",q,[S(s("input",{onKeyup:e[1]||(e[1]=I(c=>i.search(),["enter"])),"onUpdate:modelValue":e[2]||(e[2]=c=>o.searchValue=c),ref:"searchField",type:"text",class:"p-2 outline-none flex-auto text-primary"},null,544),[[k,o.searchValue]]),s("button",{onClick:e[3]||(e[3]=c=>i.search()),class:"px-2"},a(i.__("Search")),1)])]),s("div",A,[s("ul",z,[(l(!0),n(_,null,g(o.products,c=>(l(),n("li",{key:c.id,onClick:Je=>i.addToCart(c),class:"cursor-pointer p-2 flex justify-between border-b"},[s("div",D,[s("h2",M,a(c.name),1),s("small",G,a(c.category.name),1)]),K],8,E))),128))]),o.products.length===0?(l(),n("ul",R,[s("li",J,a(i.__("There is nothing to display. Have you started the search ?")),1)])):d("",!0),o.isLoading?(l(),n("div",Q,[y(r)])):d("",!0)])])])}const Y=C(H,[["render",X]]),Z={name:"ns-pos-grid",data(){return{items:Array.from({length:1e3},(t,e)=>({data:"#"+e})),products:[],categories:[],breadcrumbs:[],barcode:"",previousCategory:null,order:null,visibleSection:null,breadcrumbsSubsribe:null,orderSubscription:null,visibleSectionSubscriber:null,currentCategory:null,settings:{},settingsSubscriber:null,options:!1,optionsSubscriber:null,interval:null,searchTimeout:null,gridItemsWidth:0,gridItemsHeight:0,isLoading:!1}},computed:{hasCategories(){return this.categories.length>0},hasProducts(){return this.products.length>0},createCategoryUrl(){return POS.settings.getValue().urls.categories_url}},watch:{options:{handler(){this.options.ns_pos_force_autofocus&&(clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.submitSearch(this.barcode)},200))},deep:!0},barcode(){this.options.ns_pos_force_autofocus&&(clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.submitSearch(this.barcode)},200))}},mounted(){this.loadCategories(),this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t,this.$forceUpdate()}),this.optionsSubscriber=POS.options.subscribe(t=>{this.options=t,this.$forceUpdate()}),this.breadcrumbsSubsribe=POS.breadcrumbs.subscribe(t=>{this.breadcrumbs=t,this.$forceUpdate()}),this.visibleSectionSubscriber=POS.visibleSection.subscribe(t=>{this.visibleSection=t,this.$forceUpdate()}),this.orderSubscription=POS.order.subscribe(t=>this.order=t),this.interval=setInterval(()=>this.checkFocus(),500);for(let t in nsShortcuts)["ns_pos_keyboard_quick_search"].includes(t)&&nsHotPress.create("search-popup").whenNotVisible([".is-popup","#product-search"]).whenPressed(nsShortcuts[t]!==null?nsShortcuts[t].join("+"):null,e=>{e.preventDefault(),this.openSearchPopup()}),["ns_pos_keyboard_toggle_merge"].includes(t)&&nsHotPress.create("toggle-merge").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t]!==null?nsShortcuts[t].join("+"):null,e=>{e.preventDefault(),this.posToggleMerge()})},unmounted(){this.orderSubscription.unsubscribe(),this.breadcrumbsSubsribe.unsubscribe(),this.visibleSectionSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe(),this.optionsSubscriber.unsubscribe(),clearInterval(this.interval),nsHotPress.destroy("search-popup"),nsHotPress.destroy("toggle-merge")},methods:{__:p,nsCurrency:V,switchTo:j,posToggleMerge(){POS.set("ns_pos_items_merge",!this.settings.ns_pos_items_merge)},computeGridWidth(){document.getElementById("grid-items")!==null&&(this.gridItemsWidth=document.getElementById("grid-items").offsetWidth,this.gridItemsHeight=document.getElementById("grid-items").offsetHeight)},cellSizeAndPositionGetter(t,e){const u={xs:{width:this.gridItemsWidth/2,items:2,height:200},sm:{width:this.gridItemsWidth/2,items:2,height:200},md:{width:this.gridItemsWidth/3,items:3,height:150},lg:{width:this.gridItemsWidth/4,items:4,height:150},xl:{width:this.gridItemsWidth/6,items:6,height:150}},h=u[POS.responsive.screenIs].width,o=u[POS.responsive.screenIs].height,i=0;return{width:h-i,height:o,x:e%u[POS.responsive.screenIs].items*h-i,y:parseInt(e/u[POS.responsive.screenIs].items)*o}},openSearchPopup(){Popup.show(Y)},hasNoFeatured(t){return t.galleries&&t.galleries.length>0&&t.galleries.filter(e=>e.featured).length===0},submitSearch(t){t.length>0&&v.get(`/api/products/search/using-barcode/${t}`).subscribe({next:e=>{this.barcode="",POS.addToCart(e.product)},error:e=>{this.barcode="",b.error(e.message).subscribe()}})},checkFocus(){this.options.ns_pos_force_autofocus&&document.querySelectorAll(".is-popup").length===0&&this.$refs.search.focus()},loadCategories(t){this.isLoading=!0,v.get(`/api/categories/pos/${t?t.id:""}`).subscribe({next:e=>{this.categories=e.categories,this.products=e.products,this.previousCategory=e.previousCategory,this.currentCategory=e.currentCategory,this.updateBreadCrumb(this.currentCategory),this.isLoading=!1},error:e=>(this.isLoading=!1,b.error(p("An unexpected error occurred.")).subscribe())})},updateBreadCrumb(t){if(t){const e=this.breadcrumb.filter(u=>u.id===t.id);if(e.length>0){let u=!0;const h=this.breadcrumb.filter(o=>o.id===e[0].id&&u?(u=!1,!0):u);this.breadcrumb=h}else this.breadcrumb.push(t)}else this.breadcrumb=[];POS.breadcrumbs.next(this.breadcrumb)},addToTheCart(t){POS.addToCart(t)}}},$={id:"pos-grid",class:"flex-auto flex flex-col"},ee={key:0,id:"tools",class:"flex pl-2"},se={key:0,class:"products-count flex items-center justify-center text-sm rounded-full h-6 w-6 ml-1"},te={id:"grid-container",class:"rounded shadow overflow-hidden flex-auto flex flex-col"},re={id:"grid-header",class:"p-2 border-b"},ie={class:"border rounded flex overflow-hidden"},oe=["title"],le=s("i",{class:"las la-search"},null,-1),ne=[le],ce=["title"],ae=s("i",{class:"las la-compress-arrows-alt"},null,-1),de=[ae],ue=["title"],he=s("i",{class:"las la-barcode"},null,-1),_e=[he],pe={style:{height:"0px"}},ge={key:0,class:"fade-in-entrance ns-loader"},be=s("div",{class:"bar"},null,-1),fe=[be],me={id:"grid-breadscrumb",class:"p-2"},ve={class:"flex"},xe=s("i",{class:"las la-angle-right"},null,-1),ye=["onClick"],we=s("i",{class:"las la-angle-right"},null,-1),ke={id:"grid-items",class:"overflow-y-auto h-full flex-col flex"},Ce={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Se=["onClick"],Pe={class:"h-full w-full flex items-center justify-center"},Te=["src","alt"],Ie={key:1,class:"las la-image text-6xl"},je={class:"w-full absolute z-10 -bottom-10"},Ve={class:"cell-item-label relative w-full flex items-center justify-center -top-10 h-20 py-2"},Oe={class:"text-sm font-bold py-2 text-center"},Le={key:1,class:"h-full w-full flex flex-col items-center justify-center"},He=s("i",{class:"las la-frown-open text-8xl text-primary"},null,-1),We={class:"w-1/2 md:w-2/3 text-center text-primary"},Be=s("br",null,null,-1),Fe={key:2,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Ne=["onClick"],Ue={class:"h-full w-full flex items-center justify-center overflow-hidden"},qe=["src","alt"],Ae=["src","alt"],ze={key:2,class:"las la-image text-6xl"},Ee={class:"w-full absolute z-10 -bottom-10"},De={class:"cell-item-label relative w-full flex flex-col items-center justify-center -top-10 h-20 p-2"},Me={class:"text-sm text-center w-full"},Ge={key:0,class:"text-sm"},Ke={key:0,class:"text-sm"};function Re(t,e,u,h,o,i){const f=x("ns-link");return l(),n("div",$,[o.visibleSection==="grid"?(l(),n("div",ee,[s("div",{onClick:e[0]||(e[0]=r=>i.switchTo("cart")),class:"switch-cart flex cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 border-t border-r border-l"},[s("span",null,a(i.__("Cart")),1),o.order?(l(),n("span",se,a(o.order.products.length),1)):d("",!0)]),s("div",{onClick:e[1]||(e[1]=r=>i.switchTo("grid")),class:"switch-grid cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 font-semibold"},a(i.__("Products")),1)])):d("",!0),s("div",te,[s("div",re,[s("div",ie,[s("button",{title:i.__("Search for products."),onClick:e[2]||(e[2]=r=>i.openSearchPopup()),class:"w-10 h-10 border-r outline-none"},ne,8,oe),s("button",{title:i.__("Toggle merging similar products."),onClick:e[3]||(e[3]=r=>i.posToggleMerge()),class:w([o.settings.ns_pos_items_merge?"pos-button-clicked":"","outline-none w-10 h-10 border-r"])},de,10,ce),s("button",{title:i.__("Toggle auto focus."),onClick:e[4]||(e[4]=r=>o.options.ns_pos_force_autofocus=!o.options.ns_pos_force_autofocus),class:w([o.options.ns_pos_force_autofocus?"pos-button-clicked":"","outline-none w-10 h-10 border-r"])},_e,10,ue),S(s("input",{ref:"search","onUpdate:modelValue":e[5]||(e[5]=r=>o.barcode=r),type:"text",class:"flex-auto outline-none px-2"},null,512),[[k,o.barcode]])])]),s("div",pe,[o.isLoading?(l(),n("div",ge,fe)):d("",!0)]),s("div",me,[s("ul",ve,[s("li",null,[s("a",{onClick:e[6]||(e[6]=r=>i.loadCategories()),href:"javascript:void(0)",class:"px-3"},a(i.__("Home")),1),m(),xe]),s("li",null,[(l(!0),n(_,null,g(o.breadcrumbs,r=>(l(),n("a",{onClick:c=>i.loadCategories(r),key:r.id,href:"javascript:void(0)",class:"px-3"},[m(a(r.name)+" ",1),we],8,ye))),128))])])]),s("div",ke,[i.hasCategories?(l(),n("div",Ce,[(l(!0),n(_,null,g(o.categories,r=>(l(),n("div",{onClick:c=>i.loadCategories(r),key:r.id,class:"cell-item w-full h-36 cursor-pointer border flex flex-col items-center justify-center overflow-hidden relative"},[s("div",Pe,[r.preview_url?(l(),n("img",{key:0,src:r.preview_url,class:"object-cover h-full",alt:r.name},null,8,Te)):d("",!0),r.preview_url?d("",!0):(l(),n("i",Ie))]),s("div",je,[s("div",Ve,[s("h3",Oe,a(r.name),1)])])],8,Se))),128))])):d("",!0),!i.hasCategories&&!i.hasProducts&&!o.isLoading?(l(),n("div",Le,[He,s("p",We,a(i.__("Looks like there is either no products and no categories. How about creating those first to get started ?")),1),Be,y(f,{target:"blank",type:"info",href:i.createCategoryUrl},{default:L(()=>[m(a(i.__("Create Categories")),1)]),_:1},8,["href"])])):d("",!0),i.hasCategories?d("",!0):(l(),n("div",Fe,[(l(!0),n(_,null,g(o.products,r=>(l(),n("div",{onClick:c=>i.addToTheCart(r),key:r.id,class:"cell-item w-full h-36 cursor-pointer border flex flex-col items-center justify-center overflow-hidden relative"},[s("div",Ue,[r.galleries&&r.galleries.filter(c=>c.featured).length>0?(l(),n("img",{key:0,src:r.galleries.filter(c=>c.featured)[0].url,class:"object-cover h-full",alt:r.name},null,8,qe)):i.hasNoFeatured(r)?(l(),n("img",{key:1,src:r.galleries[0].url,class:"object-cover h-full",alt:r.name},null,8,Ae)):(l(),n("i",ze))]),s("div",Ee,[s("div",De,[s("h3",Me,a(r.name),1),o.options.ns_pos_gross_price_used==="yes"?(l(),n(_,{key:0},[r.unit_quantities&&r.unit_quantities.length===1?(l(),n("span",Ge,a(i.nsCurrency(r.unit_quantities[0].sale_price_without_tax)),1)):d("",!0)],64)):d("",!0),o.options.ns_pos_gross_price_used==="no"?(l(),n(_,{key:1},[r.unit_quantities&&r.unit_quantities.length===1?(l(),n("span",Ke,a(i.nsCurrency(r.unit_quantities[0].sale_price_with_tax)),1)):d("",!0)],64)):d("",!0)])])],8,Ne))),128))]))])])])}const ss=C(Z,[["render",Re]]);export{ss as default}; +import{g as P,p as T,a as v,b,v as k,w as I}from"./bootstrap-8be442b1.js";import{s as j}from"./pos-section-switch-0869c4e1.js";import{_ as p,n as V}from"./currency-f8bd78d1.js";import{n as O}from"./ns-prompt-popup-100414c5.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{r as x,o as l,c as n,a as s,t as a,f as y,B as S,F as _,b as g,e as d,n as w,i as m,w as L}from"./runtime-core.esm-bundler-b48de70a.js";const H={name:"ns-pos-search-product",props:["popup"],data(){return{searchValue:"",products:[],isLoading:!1,debounce:null}},watch:{searchValue(){clearTimeout(this.debounce),this.debounce=setTimeout(()=>{this.search()},500)}},mounted(){this.$refs.searchField.focus(),this.$refs.searchField.addEventListener("keydown",t=>{t.keyCode===27&&this.popupResolver(!1)}),this.popupCloser()},methods:{__:p,popupCloser:P,popupResolver:T,addToCart(t){if(this.popup.close(),parseInt(t.accurate_tracking)===1)return Popup.show(O,{title:p("Unable to add the product"),message:p(`The product "{product}" can't be added from a search field, as "Accurate Tracking" is enabled. Would you like to learn more ?`).replace("{product}",t.name),onAction:e=>{e&&window.open("https://my.nexopos.com/en/documentation/troubleshooting/accurate-tracking","_blank")}});POS.addToCart(t)},search(){this.isLoading=!0,v.post("/api/products/search",{search:this.searchValue}).subscribe({next:t=>{if(this.isLoading=!1,this.products=t,this.products.length===1&&this.addToCart(this.products[0]),this.products.length===0)return b.info(p("No result to result match the search value provided.")).subscribe()},error:t=>{this.isLoading=!1,b.error(t.message).subscribe()}})}}},W={id:"product-search",class:"ns-box shadow-lg w-95vw h-95vh md:h-3/5-screen md:w-2/4-screen flex flex-col overflow-hidden"},B={class:"p-2 border-b ns-box-header flex justify-between items-center"},F={class:"text-primary"},N={class:"flex-auto overflow-hidden flex flex-col"},U={class:"p-2 border-b ns-box-body"},q={class:"flex input-group info border-2 rounded overflow-hidden"},A={class:"overflow-y-auto ns-scrollbar flex-auto relative"},z={class:"ns-vertical-menu"},E=["onClick"],D={class:""},M={class:"text-primary"},G={class:"text-soft-secondary text-xs"},K=s("div",null,null,-1),R={key:0},J={class:"text-primary text-center p-2"},Q={key:1,class:"absolute h-full w-full flex items-center justify-center z-10 top-0",style:{background:"rgb(187 203 214 / 29%)"}};function X(t,e,u,h,o,i){const f=x("ns-close-button"),r=x("ns-spinner");return l(),n("div",W,[s("div",B,[s("h3",F,a(i.__("Search Product")),1),s("div",null,[y(f,{onClick:e[0]||(e[0]=c=>u.popup.close())})])]),s("div",N,[s("div",U,[s("div",q,[S(s("input",{onKeyup:e[1]||(e[1]=I(c=>i.search(),["enter"])),"onUpdate:modelValue":e[2]||(e[2]=c=>o.searchValue=c),ref:"searchField",type:"text",class:"p-2 outline-none flex-auto text-primary"},null,544),[[k,o.searchValue]]),s("button",{onClick:e[3]||(e[3]=c=>i.search()),class:"px-2"},a(i.__("Search")),1)])]),s("div",A,[s("ul",z,[(l(!0),n(_,null,g(o.products,c=>(l(),n("li",{key:c.id,onClick:Je=>i.addToCart(c),class:"cursor-pointer p-2 flex justify-between border-b"},[s("div",D,[s("h2",M,a(c.name),1),s("small",G,a(c.category.name),1)]),K],8,E))),128))]),o.products.length===0?(l(),n("ul",R,[s("li",J,a(i.__("There is nothing to display. Have you started the search ?")),1)])):d("",!0),o.isLoading?(l(),n("div",Q,[y(r)])):d("",!0)])])])}const Y=C(H,[["render",X]]),Z={name:"ns-pos-grid",data(){return{items:Array.from({length:1e3},(t,e)=>({data:"#"+e})),products:[],categories:[],breadcrumbs:[],barcode:"",previousCategory:null,order:null,visibleSection:null,breadcrumbsSubsribe:null,orderSubscription:null,visibleSectionSubscriber:null,currentCategory:null,settings:{},settingsSubscriber:null,options:!1,optionsSubscriber:null,interval:null,searchTimeout:null,gridItemsWidth:0,gridItemsHeight:0,isLoading:!1}},computed:{hasCategories(){return this.categories.length>0},hasProducts(){return this.products.length>0},createCategoryUrl(){return POS.settings.getValue().urls.categories_url}},watch:{options:{handler(){this.options.ns_pos_force_autofocus&&(clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.submitSearch(this.barcode)},200))},deep:!0},barcode(){this.options.ns_pos_force_autofocus&&(clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.submitSearch(this.barcode)},200))}},mounted(){this.loadCategories(),this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t,this.$forceUpdate()}),this.optionsSubscriber=POS.options.subscribe(t=>{this.options=t,this.$forceUpdate()}),this.breadcrumbsSubsribe=POS.breadcrumbs.subscribe(t=>{this.breadcrumbs=t,this.$forceUpdate()}),this.visibleSectionSubscriber=POS.visibleSection.subscribe(t=>{this.visibleSection=t,this.$forceUpdate()}),this.orderSubscription=POS.order.subscribe(t=>this.order=t),this.interval=setInterval(()=>this.checkFocus(),500);for(let t in nsShortcuts)["ns_pos_keyboard_quick_search"].includes(t)&&nsHotPress.create("search-popup").whenNotVisible([".is-popup","#product-search"]).whenPressed(nsShortcuts[t]!==null?nsShortcuts[t].join("+"):null,e=>{e.preventDefault(),this.openSearchPopup()}),["ns_pos_keyboard_toggle_merge"].includes(t)&&nsHotPress.create("toggle-merge").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[t]!==null?nsShortcuts[t].join("+"):null,e=>{e.preventDefault(),this.posToggleMerge()})},unmounted(){this.orderSubscription.unsubscribe(),this.breadcrumbsSubsribe.unsubscribe(),this.visibleSectionSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe(),this.optionsSubscriber.unsubscribe(),clearInterval(this.interval),nsHotPress.destroy("search-popup"),nsHotPress.destroy("toggle-merge")},methods:{__:p,nsCurrency:V,switchTo:j,posToggleMerge(){POS.set("ns_pos_items_merge",!this.settings.ns_pos_items_merge)},computeGridWidth(){document.getElementById("grid-items")!==null&&(this.gridItemsWidth=document.getElementById("grid-items").offsetWidth,this.gridItemsHeight=document.getElementById("grid-items").offsetHeight)},cellSizeAndPositionGetter(t,e){const u={xs:{width:this.gridItemsWidth/2,items:2,height:200},sm:{width:this.gridItemsWidth/2,items:2,height:200},md:{width:this.gridItemsWidth/3,items:3,height:150},lg:{width:this.gridItemsWidth/4,items:4,height:150},xl:{width:this.gridItemsWidth/6,items:6,height:150}},h=u[POS.responsive.screenIs].width,o=u[POS.responsive.screenIs].height,i=0;return{width:h-i,height:o,x:e%u[POS.responsive.screenIs].items*h-i,y:parseInt(e/u[POS.responsive.screenIs].items)*o}},openSearchPopup(){Popup.show(Y)},hasNoFeatured(t){return t.galleries&&t.galleries.length>0&&t.galleries.filter(e=>e.featured).length===0},submitSearch(t){t.length>0&&v.get(`/api/products/search/using-barcode/${t}`).subscribe({next:e=>{this.barcode="",POS.addToCart(e.product)},error:e=>{this.barcode="",b.error(e.message).subscribe()}})},checkFocus(){this.options.ns_pos_force_autofocus&&document.querySelectorAll(".is-popup").length===0&&this.$refs.search.focus()},loadCategories(t){this.isLoading=!0,v.get(`/api/categories/pos/${t?t.id:""}`).subscribe({next:e=>{this.categories=e.categories,this.products=e.products,this.previousCategory=e.previousCategory,this.currentCategory=e.currentCategory,this.updateBreadCrumb(this.currentCategory),this.isLoading=!1},error:e=>(this.isLoading=!1,b.error(p("An unexpected error occurred.")).subscribe())})},updateBreadCrumb(t){if(t){const e=this.breadcrumb.filter(u=>u.id===t.id);if(e.length>0){let u=!0;const h=this.breadcrumb.filter(o=>o.id===e[0].id&&u?(u=!1,!0):u);this.breadcrumb=h}else this.breadcrumb.push(t)}else this.breadcrumb=[];POS.breadcrumbs.next(this.breadcrumb)},addToTheCart(t){POS.addToCart(t)}}},$={id:"pos-grid",class:"flex-auto flex flex-col"},ee={key:0,id:"tools",class:"flex pl-2"},se={key:0,class:"products-count flex items-center justify-center text-sm rounded-full h-6 w-6 ml-1"},te={id:"grid-container",class:"rounded shadow overflow-hidden flex-auto flex flex-col"},re={id:"grid-header",class:"p-2 border-b"},ie={class:"border rounded flex overflow-hidden"},oe=["title"],le=s("i",{class:"las la-search"},null,-1),ne=[le],ce=["title"],ae=s("i",{class:"las la-compress-arrows-alt"},null,-1),de=[ae],ue=["title"],he=s("i",{class:"las la-barcode"},null,-1),_e=[he],pe={style:{height:"0px"}},ge={key:0,class:"fade-in-entrance ns-loader"},be=s("div",{class:"bar"},null,-1),fe=[be],me={id:"grid-breadscrumb",class:"p-2"},ve={class:"flex"},xe=s("i",{class:"las la-angle-right"},null,-1),ye=["onClick"],we=s("i",{class:"las la-angle-right"},null,-1),ke={id:"grid-items",class:"overflow-y-auto h-full flex-col flex"},Ce={key:0,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Se=["onClick"],Pe={class:"h-full w-full flex items-center justify-center"},Te=["src","alt"],Ie={key:1,class:"las la-image text-6xl"},je={class:"w-full absolute z-10 -bottom-10"},Ve={class:"cell-item-label relative w-full flex items-center justify-center -top-10 h-20 py-2"},Oe={class:"text-sm font-bold py-2 text-center"},Le={key:1,class:"h-full w-full flex flex-col items-center justify-center"},He=s("i",{class:"las la-frown-open text-8xl text-primary"},null,-1),We={class:"w-1/2 md:w-2/3 text-center text-primary"},Be=s("br",null,null,-1),Fe={key:2,class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"},Ne=["onClick"],Ue={class:"h-full w-full flex items-center justify-center overflow-hidden"},qe=["src","alt"],Ae=["src","alt"],ze={key:2,class:"las la-image text-6xl"},Ee={class:"w-full absolute z-10 -bottom-10"},De={class:"cell-item-label relative w-full flex flex-col items-center justify-center -top-10 h-20 p-2"},Me={class:"text-sm text-center w-full"},Ge={key:0,class:"text-sm"},Ke={key:0,class:"text-sm"};function Re(t,e,u,h,o,i){const f=x("ns-link");return l(),n("div",$,[o.visibleSection==="grid"?(l(),n("div",ee,[s("div",{onClick:e[0]||(e[0]=r=>i.switchTo("cart")),class:"switch-cart flex cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 border-t border-r border-l"},[s("span",null,a(i.__("Cart")),1),o.order?(l(),n("span",se,a(o.order.products.length),1)):d("",!0)]),s("div",{onClick:e[1]||(e[1]=r=>i.switchTo("grid")),class:"switch-grid cursor-pointer rounded-tl-lg rounded-tr-lg px-3 py-2 font-semibold"},a(i.__("Products")),1)])):d("",!0),s("div",te,[s("div",re,[s("div",ie,[s("button",{title:i.__("Search for products."),onClick:e[2]||(e[2]=r=>i.openSearchPopup()),class:"w-10 h-10 border-r outline-none"},ne,8,oe),s("button",{title:i.__("Toggle merging similar products."),onClick:e[3]||(e[3]=r=>i.posToggleMerge()),class:w([o.settings.ns_pos_items_merge?"pos-button-clicked":"","outline-none w-10 h-10 border-r"])},de,10,ce),s("button",{title:i.__("Toggle auto focus."),onClick:e[4]||(e[4]=r=>o.options.ns_pos_force_autofocus=!o.options.ns_pos_force_autofocus),class:w([o.options.ns_pos_force_autofocus?"pos-button-clicked":"","outline-none w-10 h-10 border-r"])},_e,10,ue),S(s("input",{ref:"search","onUpdate:modelValue":e[5]||(e[5]=r=>o.barcode=r),type:"text",class:"flex-auto outline-none px-2"},null,512),[[k,o.barcode]])])]),s("div",pe,[o.isLoading?(l(),n("div",ge,fe)):d("",!0)]),s("div",me,[s("ul",ve,[s("li",null,[s("a",{onClick:e[6]||(e[6]=r=>i.loadCategories()),href:"javascript:void(0)",class:"px-3"},a(i.__("Home")),1),m(),xe]),s("li",null,[(l(!0),n(_,null,g(o.breadcrumbs,r=>(l(),n("a",{onClick:c=>i.loadCategories(r),key:r.id,href:"javascript:void(0)",class:"px-3"},[m(a(r.name)+" ",1),we],8,ye))),128))])])]),s("div",ke,[i.hasCategories?(l(),n("div",Ce,[(l(!0),n(_,null,g(o.categories,r=>(l(),n("div",{onClick:c=>i.loadCategories(r),key:r.id,class:"cell-item w-full h-36 cursor-pointer border flex flex-col items-center justify-center overflow-hidden relative"},[s("div",Pe,[r.preview_url?(l(),n("img",{key:0,src:r.preview_url,class:"object-cover h-full",alt:r.name},null,8,Te)):d("",!0),r.preview_url?d("",!0):(l(),n("i",Ie))]),s("div",je,[s("div",Ve,[s("h3",Oe,a(r.name),1)])])],8,Se))),128))])):d("",!0),!i.hasCategories&&!i.hasProducts&&!o.isLoading?(l(),n("div",Le,[He,s("p",We,a(i.__("Looks like there is either no products and no categories. How about creating those first to get started ?")),1),Be,y(f,{target:"blank",type:"info",href:i.createCategoryUrl},{default:L(()=>[m(a(i.__("Create Categories")),1)]),_:1},8,["href"])])):d("",!0),i.hasCategories?d("",!0):(l(),n("div",Fe,[(l(!0),n(_,null,g(o.products,r=>(l(),n("div",{onClick:c=>i.addToTheCart(r),key:r.id,class:"cell-item w-full h-36 cursor-pointer border flex flex-col items-center justify-center overflow-hidden relative"},[s("div",Ue,[r.galleries&&r.galleries.filter(c=>c.featured).length>0?(l(),n("img",{key:0,src:r.galleries.filter(c=>c.featured)[0].url,class:"object-cover h-full",alt:r.name},null,8,qe)):i.hasNoFeatured(r)?(l(),n("img",{key:1,src:r.galleries[0].url,class:"object-cover h-full",alt:r.name},null,8,Ae)):(l(),n("i",ze))]),s("div",Ee,[s("div",De,[s("h3",Me,a(r.name),1),o.options.ns_pos_gross_price_used==="yes"?(l(),n(_,{key:0},[r.unit_quantities&&r.unit_quantities.length===1?(l(),n("span",Ge,a(i.nsCurrency(r.unit_quantities[0].sale_price_without_tax)),1)):d("",!0)],64)):d("",!0),o.options.ns_pos_gross_price_used==="no"?(l(),n(_,{key:1},[r.unit_quantities&&r.unit_quantities.length===1?(l(),n("span",Ke,a(i.nsCurrency(r.unit_quantities[0].sale_price_with_tax)),1)):d("",!0)],64)):d("",!0)])])],8,Ne))),128))]))])])])}const ss=C(Z,[["render",Re]]);export{ss as default}; diff --git a/public/build/assets/ns-pos-layaway-popup-Kg1Mj15O.js b/public/build/assets/ns-pos-layaway-popup-f9593185.js similarity index 96% rename from public/build/assets/ns-pos-layaway-popup-Kg1Mj15O.js rename to public/build/assets/ns-pos-layaway-popup-f9593185.js index 2986f0685..7507ba578 100644 --- a/public/build/assets/ns-pos-layaway-popup-Kg1Mj15O.js +++ b/public/build/assets/ns-pos-layaway-popup-f9593185.js @@ -1 +1 @@ -import{F,b as u,a as T}from"./bootstrap-CnLEEQCx.js";import{_ as l,n as V}from"./currency-lOMYG1Wf.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as _,o as c,c as h,a as s,t as i,f,e as g,F as C,b as k,g as I,w as x,i as v}from"./runtime-core.esm-bundler-RT2b-_3S.js";const O={name:"ns-pos-layaway-popup",props:["popup"],data(){return{fields:[],instalments:[],formValidation:new F,subscription:null,totalPayments:0}},mounted(){this.loadFields()},updated(){setTimeout(()=>{document.querySelector(".is-popup #total_instalments").addEventListener("change",()=>{const e=this.formValidation.extractFields(this.fields).total_instalments;this.generatePaymentFields(e)}),document.querySelector(".is-popup #total_instalments").addEventListener("focus",()=>{document.querySelector(".is-popup #total_instalments").select()})},200)},computed:{expectedPayment(){const e=this.order.customer.group.minimal_credit_payment;return nsRawCurrency(this.order.total*e/100)},order(){return this.popup.params.order.instalments=this.popup.params.order.instalments.map(e=>{for(let t in e)if(typeof e[t]!="object"){if(t==="date"){const r={type:"date",name:t,label:l("Date"),disabled:e.paid===1,value:moment(e.date).format("YYYY-MM-DD")};e[t]=r}else if(t==="amount"){const r={type:"number",name:t,label:l("Amount"),disabled:e.paid===1,value:e.amount};e[t]=r}else if(!["paid","id"].includes(t)){const r={type:"hidden",name:t,value:e[t]};e[t]=r}}return e}),this.popup.params.order}},unmounted(){this.subscription.unsubscribe()},methods:{__:l,nsCurrency:V,refreshTotalPayments(){if(this.order.instalments.length>0){const e=nsRawCurrency(this.order.instalments.map(t=>parseFloat(t.amount.value)||0).reduce((t,r)=>parseFloat(t)+parseFloat(r)));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment(e){const t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields(e){this.order.instalments=new Array(parseInt(e)).fill("").map((t,r)=>({date:{type:"date",name:"date",label:"Date",value:r===0?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:r===0?this.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:this.expectedPayment>0&&r===0}})),this.$forceUpdate(),this.refreshTotalPayments()},close(){this.popup.params.reject({status:"error",message:l("You must define layaway settings before proceeding.")}),this.popup.close()},skipInstalments(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.popup.close(),POS.order.next(this.order);const{resolve:e,reject:t}=this.popup.params;return e({order:this.order,skip_layaway:!0})},updateOrder(){if(this.order.instalments.length===0)return u.error(l("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach(n=>this.formValidation.validateField(n)),!this.formValidation.fieldsValid(this.fields))return u.error(l("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();const e=this.order.instalments.map(n=>({amount:parseFloat(n.amount.value),date:n.date.value})),t=nsRawCurrency(e.map(n=>n.amount).reduce((n,m)=>parseFloat(n)+parseFloat(m)));if(e.filter(n=>n.date===void 0||n.date==="").length>0)return u.error(l("One or more instalments has an invalid date.")).subscribe();if(e.filter(n=>!(n.amount>0)).length>0)return u.error(l("One or more instalments has an invalid amount.")).subscribe();if(e.filter(n=>moment(n.date).isBefore(ns.date.moment.startOf("day"))).length>0)return u.error(l("One or more instalments has a date prior to the current date.")).subscribe();const r=e.filter(n=>moment(n.date).isSame(ns.date.moment.startOf("day"),"day"));let y=0;if(r.forEach(n=>{y+=parseFloat(n.amount)}),y{const o=moment(n.date),p=moment(m.date);return o.isBefore(p)?-1:o.isAfter(p)?1:0});const d=this.formValidation.extractFields(this.fields);d.final_payment_date=e.reverse()[0].date,d.total_instalments=e.length;const a={...this.popup.params.order,...d,instalments:e},{resolve:b,reject:w}=this.popup.params;return this.popup.close(),POS.order.next(a),b({order:a,skip_layaway:!1})},loadFields(){T.get("/api/fields/ns.layaway").subscribe(e=>{this.fields=this.formValidation.createFields(e),this.fields.forEach(t=>{t.name==="total_instalments"&&(t.value=this.order.total_instalments||0)})})}}},S={class:"shadow-lg h-95vh md:h-5/6-screen lg:h-5/6-screen w-95vw md:w-4/6-screen lg:w-3/6-screen ns-box flex flex-col"},Y={class:"p-2 border-b ns-box-header flex justify-between items-center"},B={class:"font-semibold"},D={class:"p-2 flex-auto flex flex-col relative overflow-y-auto"},M={key:0,class:"absolute h-full w-full flex items-center justify-center"},E={class:"p-2 elevation-surface info mb-2 text-center text-2xl font-bold flex justify-between"},L={class:"flex flex-col flex-auto overflow-hidden"},q={class:"border-b ns-box-body"},A={class:"text-2xl flex justify-between py-2 text-primary"},N={class:"text-sm"},R={class:"p-2 mb-2 text-center bg-green-200 text-green-700"},U={class:"flex-auto overflow-y-auto"},H={class:"flex flex-auto"},z={class:"px-1 w-full md:w-1/2"},G={class:"px-1 w-full md:w-1/2"},J={class:"flex items-center"},K=["onClick"],Q=s("i",{class:"las la-times"},null,-1),W=[Q],X={key:0,class:"my-2"},Z={class:"p-2 elevation-surface border text-primary text-center"},$={class:"p-2 flex border-t ns-box-footer justify-between flex-shrink-0"},ee={class:"md:-mx-1 flex flex-col md:flex-row"},te={class:"md:px-1"},se={class:"md:-mx-1 flex flex-col md:flex-row"},ne={class:"md:px-1"},ae={class:"md:px-1"};function re(e,t,r,y,d,a){const b=_("ns-close-button"),w=_("ns-spinner"),n=_("ns-field"),m=_("ns-button");return c(),h("div",S,[s("div",Y,[s("h3",B,i(a.__("Layaway Parameters")),1),s("div",null,[f(b,{onClick:t[0]||(t[0]=o=>a.close())})])]),s("div",D,[d.fields.length===0?(c(),h("div",M,[f(w)])):g("",!0),s("div",E,[s("span",null,i(a.__("Minimum Payment")),1),s("span",null,i(a.nsCurrency(a.expectedPayment)),1)]),s("div",null,[(c(!0),h(C,null,k(d.fields,(o,p)=>(c(),I(n,{field:o,key:p},null,8,["field"]))),128))]),s("div",L,[s("div",q,[s("h3",A,[s("span",null,i(a.__("Instalments & Payments")),1),s("p",null,[s("span",N,"("+i(a.nsCurrency(d.totalPayments))+")",1),s("span",null,i(a.nsCurrency(e.total)),1)])]),s("p",R,i(a.__("The final payment date must be the last within the instalments.")),1)]),s("div",U,[(c(!0),h(C,null,k(a.order.instalments,(o,p)=>(c(),h("div",{class:"flex w-full -mx-1 py-2",key:p},[s("div",H,[s("div",z,[f(n,{onChange:t[1]||(t[1]=P=>a.refreshTotalPayments()),field:o.date},null,8,["field"])]),s("div",G,[f(n,{onChange:t[2]||(t[2]=P=>a.refreshTotalPayments()),field:o.amount},null,8,["field"])])]),s("div",J,[s("button",{onClick:P=>a.removeInstalment(o),class:"items-center flex justify-center h-8 w-8 rounded border text-primary ns-inset-button error"},W,8,K)])]))),128)),a.order.instalments.length===0?(c(),h("div",X,[s("p",Z,i(a.__("There is no instalment defined. Please set how many instalments are allowed for this order")),1)])):g("",!0)])])]),s("div",$,[s("div",ee,[s("div",te,[f(m,{onClick:t[3]||(t[3]=o=>a.skipInstalments()),type:"info"},{default:x(()=>[v(i(a.__("Skip Instalments")),1)]),_:1})])]),s("div",se,[s("div",ne,[f(m,{onClick:t[4]||(t[4]=o=>a.close()),type:"error"},{default:x(()=>[v(i(a.__("Cancel")),1)]),_:1})]),s("div",ae,[f(m,{onClick:t[5]||(t[5]=o=>a.updateOrder()),type:"info"},{default:x(()=>[v(i(a.__("Proceed")),1)]),_:1})])])])])}const me=j(O,[["render",re]]);export{me as default}; +import{F,b as u,a as T}from"./bootstrap-8be442b1.js";import{_ as l,n as V}from"./currency-f8bd78d1.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";import{r as _,o as c,c as h,a as s,t as i,f,e as g,F as C,b as k,g as I,w as x,i as v}from"./runtime-core.esm-bundler-b48de70a.js";const O={name:"ns-pos-layaway-popup",props:["popup"],data(){return{fields:[],instalments:[],formValidation:new F,subscription:null,totalPayments:0}},mounted(){this.loadFields()},updated(){setTimeout(()=>{document.querySelector(".is-popup #total_instalments").addEventListener("change",()=>{const e=this.formValidation.extractFields(this.fields).total_instalments;this.generatePaymentFields(e)}),document.querySelector(".is-popup #total_instalments").addEventListener("focus",()=>{document.querySelector(".is-popup #total_instalments").select()})},200)},computed:{expectedPayment(){const e=this.order.customer.group.minimal_credit_payment;return nsRawCurrency(this.order.total*e/100)},order(){return this.popup.params.order.instalments=this.popup.params.order.instalments.map(e=>{for(let t in e)if(typeof e[t]!="object"){if(t==="date"){const r={type:"date",name:t,label:l("Date"),disabled:e.paid===1,value:moment(e.date).format("YYYY-MM-DD")};e[t]=r}else if(t==="amount"){const r={type:"number",name:t,label:l("Amount"),disabled:e.paid===1,value:e.amount};e[t]=r}else if(!["paid","id"].includes(t)){const r={type:"hidden",name:t,value:e[t]};e[t]=r}}return e}),this.popup.params.order}},unmounted(){this.subscription.unsubscribe()},methods:{__:l,nsCurrency:V,refreshTotalPayments(){if(this.order.instalments.length>0){const e=nsRawCurrency(this.order.instalments.map(t=>parseFloat(t.amount.value)||0).reduce((t,r)=>parseFloat(t)+parseFloat(r)));this.totalPayments=this.order.total-e}else this.totalPayments=0},removeInstalment(e){const t=this.order.instalments.indexOf(e);this.order.instalments.splice(t,1),this.$forceUpdate()},generatePaymentFields(e){this.order.instalments=new Array(parseInt(e)).fill("").map((t,r)=>({date:{type:"date",name:"date",label:"Date",value:r===0?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:r===0?this.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:this.expectedPayment>0&&r===0}})),this.$forceUpdate(),this.refreshTotalPayments()},close(){this.popup.params.reject({status:"error",message:l("You must define layaway settings before proceeding.")}),this.popup.close()},skipInstalments(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.popup.close(),POS.order.next(this.order);const{resolve:e,reject:t}=this.popup.params;return e({order:this.order,skip_layaway:!0})},updateOrder(){if(this.order.instalments.length===0)return u.error(l("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach(n=>this.formValidation.validateField(n)),!this.formValidation.fieldsValid(this.fields))return u.error(l("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();const e=this.order.instalments.map(n=>({amount:parseFloat(n.amount.value),date:n.date.value})),t=nsRawCurrency(e.map(n=>n.amount).reduce((n,m)=>parseFloat(n)+parseFloat(m)));if(e.filter(n=>n.date===void 0||n.date==="").length>0)return u.error(l("One or more instalments has an invalid date.")).subscribe();if(e.filter(n=>!(n.amount>0)).length>0)return u.error(l("One or more instalments has an invalid amount.")).subscribe();if(e.filter(n=>moment(n.date).isBefore(ns.date.moment.startOf("day"))).length>0)return u.error(l("One or more instalments has a date prior to the current date.")).subscribe();const r=e.filter(n=>moment(n.date).isSame(ns.date.moment.startOf("day"),"day"));let y=0;if(r.forEach(n=>{y+=parseFloat(n.amount)}),y{const o=moment(n.date),p=moment(m.date);return o.isBefore(p)?-1:o.isAfter(p)?1:0});const d=this.formValidation.extractFields(this.fields);d.final_payment_date=e.reverse()[0].date,d.total_instalments=e.length;const a={...this.popup.params.order,...d,instalments:e},{resolve:b,reject:w}=this.popup.params;return this.popup.close(),POS.order.next(a),b({order:a,skip_layaway:!1})},loadFields(){T.get("/api/fields/ns.layaway").subscribe(e=>{this.fields=this.formValidation.createFields(e),this.fields.forEach(t=>{t.name==="total_instalments"&&(t.value=this.order.total_instalments||0)})})}}},S={class:"shadow-lg h-95vh md:h-5/6-screen lg:h-5/6-screen w-95vw md:w-4/6-screen lg:w-3/6-screen ns-box flex flex-col"},Y={class:"p-2 border-b ns-box-header flex justify-between items-center"},B={class:"font-semibold"},D={class:"p-2 flex-auto flex flex-col relative overflow-y-auto"},M={key:0,class:"absolute h-full w-full flex items-center justify-center"},E={class:"p-2 elevation-surface info mb-2 text-center text-2xl font-bold flex justify-between"},L={class:"flex flex-col flex-auto overflow-hidden"},q={class:"border-b ns-box-body"},A={class:"text-2xl flex justify-between py-2 text-primary"},N={class:"text-sm"},R={class:"p-2 mb-2 text-center bg-green-200 text-green-700"},U={class:"flex-auto overflow-y-auto"},H={class:"flex flex-auto"},z={class:"px-1 w-full md:w-1/2"},G={class:"px-1 w-full md:w-1/2"},J={class:"flex items-center"},K=["onClick"],Q=s("i",{class:"las la-times"},null,-1),W=[Q],X={key:0,class:"my-2"},Z={class:"p-2 elevation-surface border text-primary text-center"},$={class:"p-2 flex border-t ns-box-footer justify-between flex-shrink-0"},ee={class:"md:-mx-1 flex flex-col md:flex-row"},te={class:"md:px-1"},se={class:"md:-mx-1 flex flex-col md:flex-row"},ne={class:"md:px-1"},ae={class:"md:px-1"};function re(e,t,r,y,d,a){const b=_("ns-close-button"),w=_("ns-spinner"),n=_("ns-field"),m=_("ns-button");return c(),h("div",S,[s("div",Y,[s("h3",B,i(a.__("Layaway Parameters")),1),s("div",null,[f(b,{onClick:t[0]||(t[0]=o=>a.close())})])]),s("div",D,[d.fields.length===0?(c(),h("div",M,[f(w)])):g("",!0),s("div",E,[s("span",null,i(a.__("Minimum Payment")),1),s("span",null,i(a.nsCurrency(a.expectedPayment)),1)]),s("div",null,[(c(!0),h(C,null,k(d.fields,(o,p)=>(c(),I(n,{field:o,key:p},null,8,["field"]))),128))]),s("div",L,[s("div",q,[s("h3",A,[s("span",null,i(a.__("Instalments & Payments")),1),s("p",null,[s("span",N,"("+i(a.nsCurrency(d.totalPayments))+")",1),s("span",null,i(a.nsCurrency(e.total)),1)])]),s("p",R,i(a.__("The final payment date must be the last within the instalments.")),1)]),s("div",U,[(c(!0),h(C,null,k(a.order.instalments,(o,p)=>(c(),h("div",{class:"flex w-full -mx-1 py-2",key:p},[s("div",H,[s("div",z,[f(n,{onChange:t[1]||(t[1]=P=>a.refreshTotalPayments()),field:o.date},null,8,["field"])]),s("div",G,[f(n,{onChange:t[2]||(t[2]=P=>a.refreshTotalPayments()),field:o.amount},null,8,["field"])])]),s("div",J,[s("button",{onClick:P=>a.removeInstalment(o),class:"items-center flex justify-center h-8 w-8 rounded border text-primary ns-inset-button error"},W,8,K)])]))),128)),a.order.instalments.length===0?(c(),h("div",X,[s("p",Z,i(a.__("There is no instalment defined. Please set how many instalments are allowed for this order")),1)])):g("",!0)])])]),s("div",$,[s("div",ee,[s("div",te,[f(m,{onClick:t[3]||(t[3]=o=>a.skipInstalments()),type:"info"},{default:x(()=>[v(i(a.__("Skip Instalments")),1)]),_:1})])]),s("div",se,[s("div",ne,[f(m,{onClick:t[4]||(t[4]=o=>a.close()),type:"error"},{default:x(()=>[v(i(a.__("Cancel")),1)]),_:1})]),s("div",ae,[f(m,{onClick:t[5]||(t[5]=o=>a.updateOrder()),type:"info"},{default:x(()=>[v(i(a.__("Proceed")),1)]),_:1})])])])])}const me=j(O,[["render",re]]);export{me as default}; diff --git a/public/build/assets/ns-pos-order-type-button-DAGoltL9.js b/public/build/assets/ns-pos-order-type-button-584f8007.js similarity index 62% rename from public/build/assets/ns-pos-order-type-button-DAGoltL9.js rename to public/build/assets/ns-pos-order-type-button-584f8007.js index 38bc5a1fa..29781d89d 100644 --- a/public/build/assets/ns-pos-order-type-button-DAGoltL9.js +++ b/public/build/assets/ns-pos-order-type-button-584f8007.js @@ -1 +1 @@ -import{P as r}from"./bootstrap-CnLEEQCx.js";import{b as n}from"./ns-pos-order-type-popup-BV_7i2Py.js";import{_ as p}from"./currency-lOMYG1Wf.js";import{_ as a}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{o as l,c as d,a as t,t as i}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-prompt-popup-DKRiwYBT.js";import"./ns-orders-preview-popup-DkNvPnrF.js";import"./index.es-Br67aBEV.js";const _={name:"ns-pos-delivery-button",methods:{__:p,openOrderTypeSelection(){r.show(n)}},beforeDestroy(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_order_type"].includes(e)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,o=>{o.preventDefault(),this.openOrderTypeSelection()})}},c={class:"ns-button default"},u=t("i",{class:"mr-1 text-xl las la-truck"},null,-1);function m(e,o,f,y,h,s){return l(),d("div",c,[t("button",{onClick:o[0]||(o[0]=b=>s.openOrderTypeSelection()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[u,t("span",null,i(s.__("Order Type")),1)])])}const B=a(_,[["render",m]]);export{B as default}; +import{P as r}from"./bootstrap-8be442b1.js";import{b as n}from"./ns-pos-order-type-popup-5204386b.js";import{_ as p}from"./currency-f8bd78d1.js";import{_ as a}from"./_plugin-vue_export-helper-c27b6911.js";import{o as l,c as d,a as t,t as i}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-prompt-popup-100414c5.js";import"./ns-orders-preview-popup-5ba94079.js";import"./index.es-25aa42ee.js";const _={name:"ns-pos-delivery-button",methods:{__:p,openOrderTypeSelection(){r.show(n)}},beforeDestroy(){nsHotPress.destroy("ns_pos_keyboard_order_type")},mounted(){for(let e in nsShortcuts)["ns_pos_keyboard_order_type"].includes(e)&&nsHotPress.create("ns_pos_keyboard_order_type").whenNotVisible([".is-popup"]).whenPressed(nsShortcuts[e]!==null?nsShortcuts[e].join("+"):null,o=>{o.preventDefault(),this.openOrderTypeSelection()})}},c={class:"ns-button default"},u=t("i",{class:"mr-1 text-xl las la-truck"},null,-1);function m(e,o,f,y,h,s){return l(),d("div",c,[t("button",{onClick:o[0]||(o[0]=b=>s.openOrderTypeSelection()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[u,t("span",null,i(s.__("Order Type")),1)])])}const B=a(_,[["render",m]]);export{B as default}; diff --git a/public/build/assets/ns-pos-order-type-popup-BV_7i2Py.js b/public/build/assets/ns-pos-order-type-popup-5204386b.js similarity index 99% rename from public/build/assets/ns-pos-order-type-popup-BV_7i2Py.js rename to public/build/assets/ns-pos-order-type-popup-5204386b.js index 61d757ea9..34a691c33 100644 --- a/public/build/assets/ns-pos-order-type-popup-BV_7i2Py.js +++ b/public/build/assets/ns-pos-order-type-popup-5204386b.js @@ -1 +1 @@ -import{g as T,b as v,P,F as z,a as S,p as j,v as F,w as Q}from"./bootstrap-CnLEEQCx.js";import{_ as h,n as R}from"./currency-lOMYG1Wf.js";import{a as I,j as B,i as E,k as M,n as H}from"./ns-prompt-popup-DKRiwYBT.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as m,o as i,c as l,f as p,e as c,a as e,t as n,g as N,F as g,b as k,w as f,i as w,h as K,B as D,n as L}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{n as Y}from"./ns-orders-preview-popup-DkNvPnrF.js";const G={name:"ns-pos-quantity-popup",props:["popup"],components:{nsNumpad:I,nsNumpadPlus:B},data(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy(){this.optionsSubscription.unsubscribe()},mounted(){this.optionsSubscription=POS.options.subscribe(t=>{this.options=t}),this.popup.params.product.quantity&&(this.finalValue=this.popup.params.product.quantity),this.popupCloser()},unmounted(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:h,popupCloser:T,closePopup(){this.popup.params.reject(!1),this.popup.close()},updateQuantity(t){this.finalValue=t},defineQuantity(t){const{product:o,data:a}=this.popup.params;if(t===0)return v.error(h("Please provide a quantity")).subscribe();if(o.$original().stock_management==="enabled"&&o.$original().type==="materialized"){const b=POS.getStockUsage(o.$original().id,a.unit_quantity_id)-(o.quantity||0);if(t>parseFloat(a.$quantities().quantity)-b)return v.error(h("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",a.$quantities().quantity-b)).subscribe()}this.resolve({quantity:t})},resolve(t){this.popup.params.resolve(t),this.popup.close()}}},J={class:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},X={key:0,id:"loading-overlay",style:{background:"rgb(202 202 202 / 49%)"},class:"flex w-full h-full absolute top-O left-0 items-center justify-center"},Z={class:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},$={class:"text-xl font-bold text-primary text-center"},ee={id:"screen",class:"h-24 primary ns-box-body flex items-center justify-center"},se={class:"font-bold text-3xl"};function te(t,o,a,b,r,s){const x=m("ns-spinner"),u=m("ns-close-button"),y=m("ns-numpad"),C=m("ns-numpad-plus");return i(),l("div",J,[r.isLoading?(i(),l("div",X,[p(x)])):c("",!0),e("div",Z,[e("div",null,[e("h1",$,n(s.__("Define Quantity")),1)]),e("div",null,[p(u,{onClick:o[0]||(o[0]=_=>s.closePopup())})])]),e("div",ee,[e("h1",se,n(r.finalValue),1)]),r.options.ns_pos_numpad==="default"?(i(),N(y,{key:1,floating:r.options.ns_pos_allow_decimal_quantities,onChanged:o[1]||(o[1]=_=>s.updateQuantity(_)),onNext:o[2]||(o[2]=_=>s.defineQuantity(_)),value:r.finalValue},null,8,["floating","value"])):c("",!0),r.options.ns_pos_numpad==="advanced"?(i(),N(C,{key:2,onChanged:o[3]||(o[3]=_=>s.updateQuantity(_)),onNext:o[4]||(o[4]=_=>s.defineQuantity(_)),value:r.finalValue},null,8,["value"])):c("",!0)])}const oe=O(G,[["render",te]]);class Ln{constructor(o){this.product=o}run(o){return new Promise((a,b)=>{const r=this.product;if(POS.options.getValue().ns_pos_show_quantity!==!1||!POS.processingAddQueue)P.show(oe,{resolve:a,reject:b,product:r,data:o});else{if(r.$original().stock_management==="enabled"&&r.$original().type==="materialized"){const u=POS.getStockUsage(r.$original().id,o.unit_quantity_id)-(r.quantity||0);if(1>parseFloat(o.$quantities().quantity)-u)return v.error(h("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(o.$quantities().quantity-u).toString())).subscribe()}a({quantity:1})}})}}const ne={mounted(){this.closeWithOverlayClicked(),this.loadTransactionFields()},props:["popup"],data(){return{fields:[],isSubmiting:!1,formValidation:new z}},methods:{__:h,closeWithOverlayClicked:T,proceed(){const t=this.popup.params.customer,o=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,S.post(`/api/customers/${t.id}/account-history`,o).subscribe({next:a=>{this.isSubmiting=!1,v.success(a.message).subscribe(),this.popup.params.resolve(a),this.popup.close()},error:a=>{this.isSubmiting=!1,v.error(a.message).subscribe(),this.popup.params.reject(a)}})},close(){this.popup.close(),this.popup.params.reject(!1)},loadTransactionFields(){S.get("/api/fields/ns.customers-account").subscribe({next:t=>{this.fields=this.formValidation.createFields(t)}})}}},re={class:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},ie={class:"p-2 border-b ns-box-header flex justify-between items-center"},le={class:"font-semibold"},ce={class:"flex-auto overflow-y-auto"},ue={key:0,class:"h-full w-full flex items-center justify-center"},ae={key:1,class:"p-2"},de={class:"p-2 ns-box-footer justify-between border-t flex"},_e=e("div",null,null,-1),pe={class:"px-1"},he={class:"-mx-2 flex flex-wrap"},fe={class:"px-1"},me={class:"px-1"},be={key:0,class:"h-full w-full absolute flex items-center justify-center",style:{background:"rgb(0 98 171 / 45%)"}};function ye(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-spinner"),y=m("ns-field"),C=m("ns-button");return i(),l("div",re,[e("div",ie,[e("h2",le,n(s.__("New Transaction")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=_=>s.close())})])]),e("div",ce,[r.fields.length===0?(i(),l("div",ue,[p(u)])):c("",!0),r.fields.length>0?(i(),l("div",ae,[(i(!0),l(g,null,k(r.fields,(_,V)=>(i(),N(y,{field:_,key:V},null,8,["field"]))),128))])):c("",!0)]),e("div",de,[_e,e("div",pe,[e("div",he,[e("div",fe,[p(C,{type:"error",onClick:o[1]||(o[1]=_=>s.close())},{default:f(()=>[w(n(s.__("Close")),1)]),_:1})]),e("div",me,[p(C,{type:"info",onClick:o[2]||(o[2]=_=>s.proceed())},{default:f(()=>[w(n(s.__("Proceed")),1)]),_:1})])])])]),r.isSubmiting===0?(i(),l("div",be,[p(u)])):c("",!0)])}const xe=O(ne,[["render",ye]]),ve={name:"ns-pos-coupons-load-popup",props:["popup"],components:{nsNotice:E},data(){return{placeHolder:h("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,coupon:null}},mounted(){this.popupCloser(),this.orderSubscriber=POS.order.subscribe(t=>{this.order=K(t),this.order.coupons.length>0&&(this.activeTab="active-coupons")}),this.popup.params&&this.popup.params.apply_coupon&&(this.couponCode=this.popup.params.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:t=>{this.coupon=t,this.apply()}}))},unmounted(){this.orderSubscriber.unsubscribe()},methods:{__:h,popupCloser:T,popupResolver:j,selectCustomer(){Popup.show(U)},cancel(){this.coupon=null,this.couponCode=null},removeCoupon(t){this.order.coupons.splice(t,1),POS.refreshCart()},apply(){try{if(this.coupon.valid_hours_start!==null&&!ns.date.moment.isAfter(this.coupon.valid_hours_start)&&this.coupon.valid_hours_start.length>0)return v.error(h("The coupon is out from validity date range.")).subscribe();if(this.coupon.valid_hours_end!==null&&!ns.date.moment.isBefore(this.coupon.valid_hours_end)&&this.coupon.valid_hours_end.length>0)return v.error(h("The coupon is out from validity date range.")).subscribe();const t=this.coupon.products;if(t.length>0){const b=t.map(r=>r.product_id);if(this.order.products.filter(r=>b.includes(r.product_id)).length===0)return v.error(h("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}const o=this.coupon.categories;if(o.length>0){const b=o.map(r=>r.category_id);if(this.order.products.filter(r=>b.includes(r.$original().category_id)).length===0)return v.error(h("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}let a={customer_coupon_id:this.coupon.customer_coupon.length>0?this.coupon.customer_coupon[0].id:0,minimum_cart_value:this.coupon.minimum_cart_value,maximum_cart_value:this.coupon.maximum_cart_value,name:this.coupon.name,type:this.coupon.type,value:0,coupon_id:this.coupon.id,limit_usage:this.coupon.limit_usage,code:this.coupon.code,discount_value:this.coupon.discount_value,categories:this.coupon.categories,products:this.coupon.products};this.cancel(),POS.pushCoupon(a),this.activeTab="active-coupons",setTimeout(()=>{this.popupResolver(a)},500),v.success(h("The coupon has applied to the cart.")).subscribe()}catch(t){console.log(t)}},getCouponType(t){switch(t){case"percentage_discount":return h("Percentage");case"flat_discount":return h("Flat");default:return h("Unknown Type")}},getDiscountValue(t){switch(t.type){case"percentage_discount":return t.discount_value+"%";case"flat_discount":return this.$options.filters.currency(t.discount_value)}},closePopup(){this.popupResolver(!1)},setActiveTab(t){this.activeTab=t,t==="apply-coupon"&&setTimeout(()=>{document.querySelector(".coupon-field").select()},10)},getCoupon(t){return!this.order.customer_id>0?v.error(h("You must select a customer before applying a coupon.")):S.post(`/api/customers/coupons/${t}`,{customer_id:this.order.customer_id})},loadCoupon(){const t=this.couponCode;this.getCoupon(t).subscribe({next:o=>{this.coupon=o,v.success(h("The coupon has been loaded.")).subscribe()},error:o=>{v.error(o.message||h("An unexpected error occurred.")).subscribe()}})}}},ge={class:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},we={class:"border-b ns-box-header p-2 flex justify-between items-center"},Ce={class:"font-bold"},ke={class:"p-1 ns-box-body"},Pe={class:"border-2 input-group info rounded flex"},Se=["placeholder"],Te={class:"pt-2"},Oe={key:0,class:"pt-2 flex"},Ve={key:1,class:"pt-2"},je={class:"overflow-hidden"},Le={key:0,class:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},Ne={class:"w-full ns-table"},qe={class:"p-2 w-1/2 border"},Ae={class:"p-2 w-1/2 border"},Re={class:"p-2 w-1/2 border"},He={class:"p-2 w-1/2 border"},Fe={class:"p-2 w-1/2 border"},Qe={class:"p-2 w-1/2 border"},De={class:"p-2 w-1/2 border"},Ue={class:"p-2 w-1/2 border"},We={class:"p-2 w-1/2 border"},ze={class:"p-2 w-1/2 border"},Ie={class:"p-2 w-1/2 border"},Be={class:"p-2 w-1/2 border"},Ee={key:0},Me={class:"p-2 w-1/2 border"},Ke={class:"p-2 w-1/2 border"},Ye={key:0},Ge={key:0},Je={class:"flex-auto"},Xe={class:"font-semibold text-primary p-2 flex justify-between"},Ze={key:0,class:"flex justify-between elevation-surface border items-center p-2"},$e={key:0,class:"flex"};function es(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-notice"),y=m("ns-tabs-item"),C=m("ns-tabs");return i(),l("div",ge,[e("div",we,[e("h3",Ce,n(s.__("Load Coupon")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=_=>s.closePopup())})])]),e("div",ke,[p(C,{onActive:o[5]||(o[5]=_=>s.setActiveTab(_)),active:r.activeTab},{default:f(()=>[p(y,{label:s.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"},{default:f(()=>[e("div",Pe,[D(e("input",{ref:"coupon",onKeyup:o[1]||(o[1]=Q(_=>s.loadCoupon(),["enter"])),"onUpdate:modelValue":o[2]||(o[2]=_=>r.couponCode=_),type:"text",class:"coupon-field w-full text-primary p-2 outline-none",placeholder:r.placeHolder},null,40,Se),[[F,r.couponCode]]),e("button",{onClick:o[3]||(o[3]=_=>s.loadCoupon()),class:"px-3 py-2"},n(s.__("Load")),1)]),e("div",Te,[p(u,{color:"info"},{description:f(()=>[w(n(s.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")),1)]),_:1})]),r.order&&r.order.customer_id===void 0?(i(),l("div",Oe,[e("button",{onClick:o[4]||(o[4]=_=>s.selectCustomer()),class:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center"},n(s.__("Click here to choose a customer.")),1)])):c("",!0),r.order&&r.order.customer_id!==void 0?(i(),l("div",Ve,[p(u,{color:"success"},{description:f(()=>[w(n(s.__("Loading Coupon For : ")+`${r.order.customer.first_name} ${r.order.customer.last_name}`),1)]),_:1})])):c("",!0),e("div",je,[r.coupon?(i(),l("div",Le,[e("table",Ne,[e("tbody",null,[e("tr",null,[e("td",qe,n(s.__("Coupon Name")),1),e("td",Ae,n(r.coupon.name),1)]),e("tr",null,[e("td",Re,n(s.__("Discount"))+" ("+n(s.getCouponType(r.coupon.type))+")",1),e("td",He,n(s.getDiscountValue(r.coupon)),1)]),e("tr",null,[e("td",Fe,n(s.__("Usage")),1),e("td",Qe,n((r.coupon.customer_coupon.length>0?r.coupon.customer_coupon[0].usage:0)+"/"+(r.coupon.limit_usage||s.__("Unlimited"))),1)]),e("tr",null,[e("td",De,n(s.__("Valid From")),1),e("td",Ue,n(r.coupon.valid_hours_start||s.__("N/A")),1)]),e("tr",null,[e("td",We,n(s.__("Valid Till")),1),e("td",ze,n(r.coupon.valid_hours_end||s.__("N/A")),1)]),e("tr",null,[e("td",Ie,n(s.__("Categories")),1),e("td",Be,[e("ul",null,[(i(!0),l(g,null,k(r.coupon.categories,_=>(i(),l("li",{class:"rounded-full px-3 py-1 border",key:_.id},n(_.category.name),1))),128)),r.coupon.categories.length===0?(i(),l("li",Ee,n(s.__("Not applicable")),1)):c("",!0)])])]),e("tr",null,[e("td",Me,n(s.__("Products")),1),e("td",Ke,[e("ul",null,[(i(!0),l(g,null,k(r.coupon.products,_=>(i(),l("li",{class:"rounded-full px-3 py-1 border",key:_.id},n(_.product.name),1))),128)),r.coupon.products.length===0?(i(),l("li",Ye,n(s.__("Not applicable")),1)):c("",!0)])])])])])])):c("",!0)])]),_:1},8,["label"]),p(y,{label:s.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"},{default:f(()=>[r.order?(i(),l("ul",Ge,[(i(!0),l(g,null,k(r.order.coupons,(_,V)=>(i(),l("li",{key:V,class:"flex justify-between elevation-surface border items-center px-2 py-1"},[e("div",Je,[e("h3",Xe,[e("span",null,n(_.name),1),e("span",null,n(s.getDiscountValue(_)),1)])]),e("div",null,[p(x,{onClick:q=>s.removeCoupon(V)},null,8,["onClick"])])]))),128)),r.order.coupons.length===0?(i(),l("li",Ze,n(s.__("No coupons applies to the cart.")),1)):c("",!0)])):c("",!0)]),_:1},8,["label"])]),_:1},8,["active"])]),r.coupon?(i(),l("div",$e,[e("button",{onClick:o[6]||(o[6]=_=>s.apply()),class:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold"},n(s.__("Apply")),1),e("button",{onClick:o[7]||(o[7]=_=>s.cancel()),class:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold"},n(s.__("Cancel")),1)])):c("",!0)])}const ss=O(ve,[["render",es]]),ts={name:"ns-pos-customers",props:["popup"],data(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],userCan:t=>POS.userCan(t),rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:M},unmounted(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted(){this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe(t=>{this.options=t}),this.subscription=POS.order.subscribe(t=>{this.order=t,this.popup.params.customer!==void 0?(this.activeTab="account-payment",this.customer=this.popup.params.customer,this.loadCustomerOrders()):t.customer!==void 0&&(this.activeTab="account-payment",this.customer=t.customer,this.loadCustomerOrders())}),this.popupCloser()},methods:{__:h,nsCurrency:R,reload(){this.loadCustomerOrders()},popupResolver:j,popupCloser:T,getWalletHistoryLabel(t){switch(t){case"add":return h("Crediting");case"deduct":return h("Removing");case"refund":return h("Refunding");case"payment":return h("Payment");default:return h("Unknow")}},getType(t){switch(t){case"percentage_discount":return h("Percentage Discount");case"flat_discount":return h("Flat Discount")}},closeWithOverlayClicked:T,async openOrderOptions(t){try{const o=await new Promise((a,b)=>{P.show(Y,{order:t,resolve:a,reject:b})});this.reload()}catch{v.error(h("An error occurred while opening the order options")).subscribe()}},doChangeTab(t){this.selectedTab=t,t==="coupons"&&this.loadCoupons(),t==="rewards"&&this.loadRewards(),t==="wallet-history"&&this.loadAccounHistory(),t==="orders"&&this.loadCustomerOrders()},loadAccounHistory(){this.isLoadingHistory=!0,S.get(`/api/customers/${this.customer.id}/account-history`).subscribe({next:t=>{this.walletHistories=t.data,this.isLoadingHistory=!1},error:t=>{this.isLoadingHistory=!1}})},loadCoupons(){this.isLoadingCoupons=!0,S.get(`/api/customers/${this.customer.id}/coupons`).subscribe({next:t=>{this.coupons=t,this.isLoadingCoupons=!1},error:t=>{this.isLoadingCoupons=!1}})},loadRewards(t=`/api/customers/${this.customer.id}/rewards`){this.isLoadingRewards=!0,S.get(t).subscribe({next:o=>{this.rewardsResponse=o,this.isLoadingRewards=!1},error:o=>{this.isLoadingRewards=!1}})},prefillForm(t){this.popup.params.name!==void 0&&(t.main.value=this.popup.params.name)},openCustomerSelection(){this.popup.close(t=>{P.show(U)})},loadCustomerOrders(){this.isLoadingOrders=!0,S.get(`/api/customers/${this.customer.id}/orders`).subscribe({next:t=>{this.orders=t,this.isLoadingOrders=!1},error:t=>{this.isLoadingOrders=!1}})},newTransaction(t){new Promise((a,b)=>{P.show(xe,{customer:t,resolve:a,reject:b})}).then(a=>{POS.loadCustomer(t.id).subscribe(b=>{POS.selectCustomer(b)})})},applyCoupon(t){this.order.customer===void 0?P.show(H,{title:h("Use Customer ?"),message:h("No customer is selected. Would you like to proceed with this customer ?"),onAction:o=>{o&&POS.selectCustomer(this.customer).then(a=>{this.proceedApplyingCoupon(t)})}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(t):this.order.customer.id!==this.customer.id&&P.show(H,{title:h("Change Customer ?"),message:h("Would you like to assign this customer to the ongoing order ?"),onAction:o=>{o&&POS.selectCustomer(this.customer).then(a=>{this.proceedApplyingCoupon(t)})}})},proceedApplyingCoupon(t){new Promise((o,a)=>{P.show(ss,{apply_coupon:t.code,resolve:o,reject:a})}).then(o=>{this.popupResolver(!1)}).catch(o=>{})},handleSavedCustomer(t){v.success(t.message).subscribe(),POS.selectCustomer(t.data.entry),this.popup.close()}}},os={id:"ns-pos-customers",class:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden"},rs={class:"ns-header p-2 flex justify-between items-center border-b"},is={class:"font-semibold"},ls={class:"ns-body flex-auto flex p-2 overflow-y-auto"},cs={key:1,class:"h-full flex-col w-full flex items-center justify-center text-primary"},us=e("i",{class:"lar la-hand-paper ns-icon text-6xl"},null,-1),as={class:"font-medium text-2xl"},ds={key:0,class:"flex-auto w-full flex items-center justify-center flex-col p-4"},_s=e("i",{class:"lar la-frown text-6xl"},null,-1),ps={class:"font-medium text-2xl"},hs={class:"my-2"},fs={key:1,class:"flex flex-col flex-auto"},ms={class:"flex-auto p-2 flex flex-col"},bs={class:"flex flex-wrap"},ys={class:"px-4 mb-4 w-full"},xs={class:"font-semibold"},vs={class:"flex flex-wrap ns-tab-cards -mx-2 w-full"},gs={class:"px-2 mb-4 w-full md:w-1/4 flex"},ws={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},Cs={class:"font-medium text-lg"},ks={class:"w-full flex justify-end"},Ps={class:"font-bold"},Ss={class:"px-2 mb-4 w-full md:w-1/4 flex"},Ts={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},Os={class:"font-medium text-lg"},Vs={class:"w-full flex justify-end"},js={class:"font-bold"},Ls={class:"px-2 mb-4 w-full md:w-1/4 flex"},Ns={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},qs={class:"font-medium text-lg"},As={class:"w-full flex justify-end"},Rs={class:"font-bold"},Hs={class:"px-2 mb-4 w-full md:w-1/4 flex"},Fs={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},Qs={class:"font-medium text-lg"},Ds={class:"w-full flex justify-end"},Us={class:"font-bold"},Ws={class:"flex flex-auto flex-col overflow-hidden"},zs={key:0,class:"flex-auto h-full justify-center flex items-center"},Is={class:"py-2 w-full"},Bs={class:"font-semibold text-primary"},Es={class:"flex-auto flex-col flex overflow-hidden"},Ms={class:"flex-auto overflow-y-auto"},Ks={class:"table ns-table w-full"},Ys={class:"text-primary"},Gs={colspan:"3",width:"150",class:"p-2 border font-semibold"},Js={width:"50",class:"p-2 border font-semibold"},Xs={class:"text-primary"},Zs={key:0},$s={class:"border p-2 text-center",colspan:"4"},et={colspan:"3",class:"border p-2 text-center"},st={class:"flex flex-col items-start"},tt={class:"font-bold"},ot={class:"md:-mx-2 w-full flex flex-col md:flex-row"},nt={class:"md:px-2 flex items-start w-full md:w-1/4"},rt={class:"md:px-2 flex items-start w-full md:w-1/4"},it={class:"md:px-2 flex items-start w-full md:w-1/4"},lt={class:"border p-2 text-center"},ct=["onClick"],ut=e("i",{class:"las la-wallet"},null,-1),at={class:"ml-1"},dt={key:0,class:"flex-auto h-full justify-center flex items-center"},_t={class:"py-2 w-full"},pt={class:"font-semibold text-primary"},ht={class:"flex-auto flex-col flex overflow-hidden"},ft={class:"flex-auto overflow-y-auto"},mt={class:"table ns-table w-full"},bt={class:"text-primary"},yt={colspan:"3",width:"150",class:"p-2 border font-semibold"},xt={class:"text-primary"},vt={key:0},gt={class:"border p-2 text-center",colspan:"3"},wt={colspan:"3",class:"border p-2 text-center"},Ct={class:"flex flex-col items-start"},kt={class:"font-bold"},Pt={class:"md:-mx-2 w-full flex flex-col md:flex-row"},St={class:"md:px-2 flex items-start w-full md:w-1/3"},Tt={class:"md:px-2 flex items-start w-full md:w-1/3"},Ot={key:0,class:"flex-auto h-full justify-center flex items-center"},Vt={class:"py-2 w-full"},jt={class:"font-semibold text-primary"},Lt={class:"flex-auto flex-col flex overflow-hidden"},Nt={class:"flex-auto overflow-y-auto"},qt={class:"table ns-table w-full"},At={class:"text-primary"},Rt={width:"150",class:"p-2 border font-semibold"},Ht={class:"p-2 border font-semibold"},Ft=e("th",{class:"p-2 border font-semibold"},null,-1),Qt={class:"text-primary text-sm"},Dt={key:0},Ut={class:"border p-2 text-center",colspan:"4"},Wt={width:"300",class:"border p-2"},zt={class:""},It={class:"-mx-2 flex"},Bt={class:"text-xs text-primary px-2"},Et={class:"text-xs text-primary px-2"},Mt={class:"border p-2 text-center"},Kt={key:0},Yt={key:1},Gt={class:"border p-2 text-right"},Jt={key:0,class:"flex-auto h-full justify-center flex items-center"},Xt={class:"py-2 w-full"},Zt={class:"font-semibold text-primary"},$t={class:"flex-auto flex-col flex overflow-hidden"},eo={class:"flex-auto overflow-y-auto"},so={class:"table ns-table w-full"},to={class:"text-primary"},oo={width:"150",class:"p-2 border font-semibold"},no={class:"p-2 border font-semibold"},ro={class:"p-2 border font-semibold"},io={key:0,class:"text-primary text-sm"},lo={key:0},co={class:"border p-2 text-center",colspan:"4"},uo={width:"300",class:"border p-2"},ao={class:"text-center"},_o={width:"300",class:"border p-2"},po={class:"text-center"},ho={width:"300",class:"border p-2"},fo={class:"text-center"},mo={class:"py-1 flex justify-end"},bo={class:"p-2 border-t border-box-edge flex justify-between"},yo=e("div",null,null,-1);function xo(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-crud-form"),y=m("ns-tabs-item"),C=m("ns-button"),_=m("ns-spinner"),V=m("ns-paginate"),q=m("ns-tabs");return i(),l("div",os,[e("div",rs,[e("h3",is,n(s.__("Customers")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=d=>a.popup.close())})])]),e("div",ls,[p(q,{active:r.activeTab,onActive:o[7]||(o[7]=d=>r.activeTab=d)},{default:f(()=>[p(y,{identifier:"create-customers",label:s.__("New Customer")},{default:f(()=>[r.userCan("nexopos.create.customers")?(i(),N(u,{key:0,onUpdated:o[1]||(o[1]=d=>s.prefillForm(d)),onSave:o[2]||(o[2]=d=>s.handleSavedCustomer(d)),"submit-url":"/api/crud/ns.customers",src:"/api/crud/ns.customers/form-config"},{title:f(()=>[w(n(s.__("Customer Name")),1)]),save:f(()=>[w(n(s.__("Save Customer")),1)]),_:1})):c("",!0),r.userCan("nexopos.create.customers")?c("",!0):(i(),l("div",cs,[us,e("h3",as,n(s.__("Not Authorized")),1),e("p",null,n(s.__("Creating customers has been explicitly disabled from the settings.")),1)]))]),_:1},8,["label"]),p(y,{identifier:"account-payment",label:s.__("Customer Account"),class:"flex",padding:"p-0 flex"},{default:f(()=>[r.customer===null?(i(),l("div",ds,[_s,e("h3",ps,n(s.__("No Customer Selected")),1),e("p",null,n(s.__("In order to see a customer account, you need to select one customer.")),1),e("div",hs,[p(C,{onClick:o[3]||(o[3]=d=>s.openCustomerSelection()),type:"info"},{default:f(()=>[w(n(s.__("Select Customer")),1)]),_:1})])])):c("",!0),r.customer?(i(),l("div",fs,[e("div",ms,[e("div",bs,[e("div",ys,[e("h2",xs,n(s.__("Summary For"))+" : "+n(r.customer.first_name),1)]),e("div",vs,[e("div",gs,[e("div",ws,[e("h3",Cs,n(s.__("Purchases")),1),e("div",ks,[e("h2",Ps,n(s.nsCurrency(r.customer.purchases_amount)),1)])])]),e("div",Ss,[e("div",Ts,[e("h3",Os,n(s.__("Owed")),1),e("div",Vs,[e("h2",js,n(s.nsCurrency(r.customer.owed_amount)),1)])])]),e("div",Ls,[e("div",Ns,[e("h3",qs,n(s.__("Wallet Amount")),1),e("div",As,[e("h2",Rs,n(s.nsCurrency(r.customer.account_amount)),1)])])]),e("div",Hs,[e("div",Fs,[e("h3",Qs,n(s.__("Credit Limit")),1),e("div",Ds,[e("h2",Us,n(s.nsCurrency(r.customer.credit_limit_amount)),1)])])])])]),e("div",Ws,[p(q,{active:r.selectedTab,onChangeTab:o[5]||(o[5]=d=>s.doChangeTab(d))},{default:f(()=>[p(y,{identifier:"orders",label:s.__("Orders")},{default:f(()=>[r.isLoadingOrders?(i(),l("div",zs,[p(_,{size:"36"})])):c("",!0),r.isLoadingOrders?c("",!0):(i(),l(g,{key:1},[e("div",Is,[e("h2",Bs,n(s.__("Last Purchases")),1)]),e("div",Es,[e("div",Ms,[e("table",Ks,[e("thead",null,[e("tr",Ys,[e("th",Gs,n(s.__("Order")),1),e("th",Js,n(s.__("Options")),1)])]),e("tbody",Xs,[r.orders.length===0?(i(),l("tr",Zs,[e("td",$s,n(s.__("No orders...")),1)])):c("",!0),(i(!0),l(g,null,k(r.orders,d=>(i(),l("tr",{key:d.id},[e("td",et,[e("div",st,[e("h3",tt,n(s.__("Code"))+": "+n(d.code),1),e("div",ot,[e("div",nt,[e("small",null,n(s.__("Total"))+": "+n(s.nsCurrency(d.total)),1)]),e("div",rt,[e("small",null,n(s.__("Status"))+": "+n(d.human_status),1)]),e("div",it,[e("small",null,n(s.__("Delivery"))+": "+n(d.human_delivery_status),1)])])])]),e("td",lt,[e("button",{onClick:W=>s.openOrderOptions(d),class:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success"},[ut,e("span",at,n(s.__("Options")),1)],8,ct)])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"wallet-history",label:s.__("Wallet History")},{default:f(()=>[r.isLoadingHistory?(i(),l("div",dt,[p(_,{size:"36"})])):c("",!0),r.isLoadingHistory?c("",!0):(i(),l(g,{key:1},[e("div",_t,[e("h2",pt,n(s.__("Wallet History")),1)]),e("div",ht,[e("div",ft,[e("table",mt,[e("thead",null,[e("tr",bt,[e("th",yt,n(s.__("Transaction")),1)])]),e("tbody",xt,[r.walletHistories.length===0?(i(),l("tr",vt,[e("td",gt,n(s.__("No History...")),1)])):c("",!0),(i(!0),l(g,null,k(r.walletHistories,d=>(i(),l("tr",{key:d.id},[e("td",wt,[e("div",Ct,[e("h3",kt,n(s.__("Transaction"))+": "+n(s.getWalletHistoryLabel(d.operation)),1),e("div",Pt,[e("div",St,[e("small",null,n(s.__("Amount"))+": "+n(s.nsCurrency(t.amount)),1)]),e("div",Tt,[e("small",null,n(s.__("Date"))+": "+n(d.created_at),1)])])])])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"coupons",label:s.__("Coupons")},{default:f(()=>[r.isLoadingCoupons?(i(),l("div",Ot,[p(_,{size:"36"})])):c("",!0),r.isLoadingCoupons?c("",!0):(i(),l(g,{key:1},[e("div",Vt,[e("h2",jt,n(s.__("Coupons")),1)]),e("div",Lt,[e("div",Nt,[e("table",qt,[e("thead",null,[e("tr",At,[e("th",Rt,n(s.__("Name")),1),e("th",Ht,n(s.__("Type")),1),Ft])]),e("tbody",Qt,[r.coupons.length===0?(i(),l("tr",Dt,[e("td",Ut,n(s.__("No coupons for the selected customer...")),1)])):c("",!0),(i(!0),l(g,null,k(r.coupons,d=>(i(),l("tr",{key:d.id},[e("td",Wt,[e("h3",null,n(d.name),1),e("div",zt,[e("ul",It,[e("li",Bt,n(s.__("Usage :"))+" "+n(d.usage)+"/"+n(d.limit_usage),1),e("li",Et,n(s.__("Code :"))+" "+n(d.code),1)])])]),e("td",Mt,[w(n(s.getType(d.coupon.type))+" ",1),d.coupon.type==="percentage_discount"?(i(),l("span",Kt," ("+n(d.coupon.discount_value)+"%) ",1)):c("",!0),d.coupon.type==="flat_discount"?(i(),l("span",Yt," ("+n(s.nsCurrency(t.value))+") ",1)):c("",!0)]),e("td",Gt,[p(C,{onClick:W=>s.applyCoupon(d),type:"info"},{default:f(()=>[w(n(s.__("Use Coupon")),1)]),_:2},1032,["onClick"])])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"rewards",label:s.__("Rewards")},{default:f(()=>[r.isLoadingRewards?(i(),l("div",Jt,[p(_,{size:"36"})])):c("",!0),r.isLoadingRewards?c("",!0):(i(),l(g,{key:1},[e("div",Xt,[e("h2",Zt,n(s.__("Rewards")),1)]),e("div",$t,[e("div",eo,[e("table",so,[e("thead",null,[e("tr",to,[e("th",oo,n(s.__("Name")),1),e("th",no,n(s.__("Points")),1),e("th",ro,n(s.__("Target")),1)])]),r.rewardsResponse.data?(i(),l("tbody",io,[r.rewardsResponse.data.length===0?(i(),l("tr",lo,[e("td",co,n(s.__("No rewards available the selected customer...")),1)])):c("",!0),(i(!0),l(g,null,k(r.rewardsResponse.data,d=>(i(),l("tr",{key:d.id},[e("td",uo,[e("h3",ao,n(d.reward_name),1)]),e("td",_o,[e("h3",po,n(d.points),1)]),e("td",ho,[e("h3",fo,n(d.target),1)])]))),128))])):c("",!0)])])]),e("div",mo,[p(V,{pagination:r.rewardsResponse,onLoad:o[4]||(o[4]=d=>s.loadRewards(d))},null,8,["pagination"])])],64))]),_:1},8,["label"])]),_:1},8,["active"])])]),e("div",bo,[yo,e("div",null,[p(C,{onClick:o[6]||(o[6]=d=>s.newTransaction(r.customer)),type:"info"},{default:f(()=>[w(n(s.__("Account Transaction")),1)]),_:1})])])])):c("",!0)]),_:1},8,["label"])]),_:1},8,["active"])])])}const A=O(ts,[["render",xo]]),Nn=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),vo={props:["popup"],data(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected(){return!1}},watch:{searchCustomerValue(t){clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.searchCustomer(t)},500)}},mounted(){this.orderSubscription=POS.order.subscribe(t=>{this.order=t}),this.getRecentCustomers(),this.$refs.searchField.focus(),this.popupCloser()},unmounted(){this.orderSubscription.unsubscribe()},methods:{__:h,popupCloser:T,nsCurrency:R,resolveIfQueued:j,attemptToChoose(){if(this.customers.length===1)return this.selectCustomer(this.customers[0]);v.info(h("Too many results.")).subscribe()},openCustomerHistory(t,o){o.stopImmediatePropagation(),this.popup.close(),P.show(A,{customer:t,activeTab:"account-payment"})},selectCustomer(t){this.customers.forEach(o=>o.selected=!1),t.selected=!0,this.isLoading=!0,POS.selectCustomer(t).then(o=>{this.isLoading=!1,this.resolveIfQueued(t)}).catch(o=>{this.isLoading=!1})},searchCustomer(t){S.post("/api/customers/search",{search:t}).subscribe(o=>{o.forEach(a=>a.selected=!1),this.customers=o})},createCustomerWithMatch(t){this.resolveIfQueued(!1),P.show(A,{name:t})},getRecentCustomers(){this.isLoading=!0,S.get("/api/customers/recently-active").subscribe({next:t=>{this.isLoading=!1,t.forEach(o=>o.selected=!1),this.customers=t},error:t=>{this.isLoading=!1}})}}},go={id:"ns-pos-customer-select-popup",class:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108"},wo={id:"header",class:"border-b ns-box-header text-center font-semibold text-2xl py-2"},Co={class:"relative"},ko={class:"p-2 border-b ns-box-body items-center flex justify-between"},Po={class:"flex items-center justify-between"},So=e("i",{class:"las la-eye"},null,-1),To=[So],Oo={class:"p-2 border-b ns-box-body flex justify-between text-primary"},Vo={class:"input-group flex-auto border-2 rounded"},jo={class:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},Lo={class:"ns-vertical-menu"},No={key:0,class:"p-2 text-center text-primary"},qo={class:"border-b border-dashed border-info-primary"},Ao=["onClick"],Ro={class:"flex flex-col"},Ho={class:"text-xs text-secondary"},Fo={class:"flex items-center"},Qo={key:0,class:"text-error-primary"},Do={key:1},Uo={class:"purchase-amount"},Wo=["onClick"],zo=e("i",{class:"las la-eye"},null,-1),Io=[zo],Bo={key:0,class:"z-10 top-0 absolute w-full h-full flex items-center justify-center"};function Eo(t,o,a,b,r,s){const x=m("ns-spinner");return i(),l("div",go,[e("div",wo,[e("h2",null,n(s.__("Select Customer")),1)]),e("div",Co,[e("div",ko,[e("span",null,n(s.__("Selected"))+" : ",1),e("div",Po,[e("span",null,n(r.order.customer?`${r.order.customer.first_name} ${r.order.customer.last_name}`:"N/A"),1),r.order.customer?(i(),l("button",{key:0,onClick:o[0]||(o[0]=u=>s.openCustomerHistory(r.order.customer,u)),class:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent"},To)):c("",!0)])]),e("div",Oo,[e("div",Vo,[D(e("input",{ref:"searchField",onKeydown:o[1]||(o[1]=Q(u=>s.attemptToChoose(),["enter"])),"onUpdate:modelValue":o[2]||(o[2]=u=>r.searchCustomerValue=u),placeholder:"Search Customer",type:"text",class:"outline-none w-full p-2"},null,544),[[F,r.searchCustomerValue]])])]),e("div",jo,[e("ul",Lo,[r.customers&&r.customers.length===0?(i(),l("li",No,n(s.__("No customer match your query...")),1)):c("",!0),r.customers&&r.customers.length===0?(i(),l("li",{key:1,onClick:o[3]||(o[3]=u=>s.createCustomerWithMatch(r.searchCustomerValue)),class:"p-2 cursor-pointer text-center text-primary"},[e("span",qo,n(s.__("Create a customer")),1)])):c("",!0),(i(!0),l(g,null,k(r.customers,u=>(i(),l("li",{onClick:y=>s.selectCustomer(u),key:u.id,class:"cursor-pointer p-2 border-b text-primary flex justify-between items-center"},[e("div",Ro,[e("span",null,n(u.first_name)+" "+n(u.last_name),1),e("small",Ho,n(u.group.name),1)]),e("p",Fo,[u.owe_amount>0?(i(),l("span",Qo,"-"+n(s.nsCurrency(u.owe_amount)),1)):c("",!0),u.owe_amount>0?(i(),l("span",Do,"/")):c("",!0),e("span",Uo,n(s.nsCurrency(u.purchases_amount)),1),e("button",{onClick:y=>s.openCustomerHistory(u,y),class:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info"},Io,8,Wo)])],8,Ao))),128))])]),r.isLoading?(i(),l("div",Bo,[p(x,{size:"24",border:"8"})])):c("",!0)])])}const U=O(vo,[["render",Eo]]),Mo={name:"ns-pos-discount-popup",props:["popup"],data(){return{finalValue:1,virtualStock:null,popupSubscription:null,mode:"",type:"",allSelected:!0,isLoading:!1,keys:[...[7,8,9].map(t=>({identifier:t,value:t})),...[4,5,6].map(t=>({identifier:t,value:t})),...[1,2,3].map(t=>({identifier:t,value:t})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},mounted(){this.mode=this.popup.params.reference.discount_type||"percentage",this.type=this.popup.params.type,this.mode==="percentage"?this.finalValue=this.popup.params.reference.discount_percentage||1:this.finalValue=this.popup.params.reference.discount||1,this.popupCloser()},methods:{__:h,nsCurrency:R,popupResolver:j,popupCloser:T,setPercentageType(t){this.mode=t},closePopup(){this.popup.close()},inputValue(t){t.identifier==="next"?(this.popup.params.onSubmit({discount_type:this.mode,discount_percentage:this.mode==="percentage"?this.finalValue:void 0,discount:this.mode==="flat"?this.finalValue:void 0}),this.popup.close()):t.identifier==="backspace"?this.allSelected?(this.finalValue=0,this.allSelected=!1):(this.finalValue=this.finalValue.toString(),this.finalValue=this.finalValue.substr(0,this.finalValue.length-1)||0):this.allSelected?(this.finalValue=t.value,this.finalValue=parseFloat(this.finalValue),this.allSelected=!1):(this.finalValue+=""+t.value,this.finalValue=parseFloat(this.finalValue),this.mode==="percentage"&&(this.finalValue=this.finalValue>100?100:this.finalValue))}}},Ko={id:"discount-popup",class:"ns-box shadow min-h-2/5-screen w-6/7-screen md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen relative"},Yo={class:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},Go={key:0,class:"text-xl font-bold text-primary text-center"},Jo={key:1,class:"text-xl font-bold text-primary text-center"},Xo={id:"screen",class:"h-16 ns-box-body text-white flex items-center justify-center"},Zo={class:"font-bold text-3xl"},$o={key:0},en={key:1},sn={id:"switch-mode",class:"flex"},tn=e("hr",{class:"border-r border-box-edge"},null,-1),on={id:"numpad",class:"grid grid-flow-row grid-cols-3 grid-rows-3"},nn=["onClick"],rn={key:0};function ln(t,o,a,b,r,s){const x=m("ns-close-button");return i(),l("div",Ko,[e("div",Yo,[e("div",null,[r.type==="product"?(i(),l("h1",Go,n(s.__("Product Discount")),1)):c("",!0),r.type==="cart"?(i(),l("h1",Jo,n(s.__("Cart Discount")),1)):c("",!0)]),e("div",null,[p(x,{onClick:o[0]||(o[0]=u=>s.closePopup())})])]),e("div",Xo,[e("h1",Zo,[r.mode==="flat"?(i(),l("span",$o,n(s.nsCurrency(r.finalValue)),1)):c("",!0),r.mode==="percentage"?(i(),l("span",en,n(r.finalValue)+"%",1)):c("",!0)])]),e("div",sn,[e("button",{onClick:o[1]||(o[1]=u=>s.setPercentageType("flat")),class:L([r.mode==="flat"?"bg-tab-active":"bg-tab-inactive text-tertiary","outline-none w-1/2 py-2 flex items-center justify-center"])},n(s.__("Flat")),3),tn,e("button",{onClick:o[2]||(o[2]=u=>s.setPercentageType("percentage")),class:L([r.mode==="percentage"?"bg-tab-active":"bg-tab-inactive text-tertiary","outline-none w-1/2 py-2 flex items-center justify-center"])},n(s.__("Percentage")),3)]),e("div",on,[(i(!0),l(g,null,k(r.keys,(u,y)=>(i(),l("div",{onClick:C=>s.inputValue(u),key:y,class:"text-primary ns-numpad-key info text-xl font-bold border h-24 flex items-center justify-center cursor-pointer"},[u.value!==void 0?(i(),l("span",rn,n(u.value),1)):c("",!0),u.icon?(i(),l("i",{key:1,class:L(["las",u.icon])},null,2)):c("",!0)],8,nn))),128))])])}const qn=O(Mo,[["render",ln]]),cn={data(){return{types:[],settingsSubscription:null,urls:{}}},props:["popup"],mounted(){this.settingsSubscription=POS.settings.subscribe(t=>{this.urls=t.urls}),this.types=POS.types.getValue(),Object.values(this.types).length===1&&this.select(Object.keys(this.types)[0]),this.popupCloser()},methods:{__:h,popupCloser:T,popupResolver:j,resolveIfQueued:j,async select(t){Object.values(this.types).forEach(a=>a.selected=!1),this.types[t].selected=!0;const o=this.types[t];try{const a=await POS.triggerOrderTypeSelection(o);POS.types.next(this.types),this.resolveIfQueued(o)}catch(a){throw a}}}},un={id:"ns-order-type",class:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg"},an={id:"header",class:"h-16 flex justify-center items-center"},dn={class:"font-bold"},_n={key:0,class:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},pn={class:"h-full w-full flex items-center justify-center flex-col"},hn=e("i",{class:"las la-frown text-7xl text-error-tertiary"},null,-1),fn={class:"p-4 md:w-2/3"},mn={class:"text-center"},bn={class:"flex justify-center mt-4 mb-2 -mx-2"},yn={class:"px-2"},xn={class:"px-2"},vn={key:1,class:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},gn=["onClick"],wn=["src"],Cn={class:"font-semibold text-xl my-2"};function kn(t,o,a,b,r,s){const x=m("ns-link");return i(),l("div",un,[e("div",an,[e("h3",dn,n(s.__("Define The Order Type")),1)]),Object.values(r.types).length===0?(i(),l("div",_n,[e("div",pn,[hn,e("div",fn,[e("p",mn,n(s.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")),1),e("div",bn,[e("div",yn,[p(x,{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"},{default:f(()=>[w(n(s.__("Read More")),1)]),_:1})]),e("div",xn,[p(x,{target:"_blank",type:"info",href:r.urls.order_type_url},{default:f(()=>[w(n(s.__("Configure")),1)]),_:1},8,["href"])])])])])])):c("",!0),Object.values(r.types).length>0?(i(),l("div",vn,[(i(!0),l(g,null,k(r.types,u=>(i(),l("div",{onClick:y=>s.select(u.identifier),key:u.identifier,class:L([u.selected?"active":"","ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border"])},[e("img",{src:u.icon,alt:"",class:"w-32 h-32"},null,8,wn),e("h4",Cn,n(u.label),1)],10,gn))),128))])):c("",!0)])}const An=O(cn,[["render",kn]]);export{Ln as P,qn as a,An as b,ss as c,Nn as d,U as n}; +import{g as T,b as v,P,F as z,a as S,p as j,v as F,w as Q}from"./bootstrap-8be442b1.js";import{_ as h,n as R}from"./currency-f8bd78d1.js";import{a as I,j as B,i as E,k as M,n as H}from"./ns-prompt-popup-100414c5.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import{r as m,o as i,c as l,f as p,e as c,a as e,t as n,g as N,F as g,b as k,w as f,i as w,h as K,B as D,n as L}from"./runtime-core.esm-bundler-b48de70a.js";import{n as Y}from"./ns-orders-preview-popup-5ba94079.js";const G={name:"ns-pos-quantity-popup",props:["popup"],components:{nsNumpad:I,nsNumpadPlus:B},data(){return{finalValue:1,virtualStock:null,options:{},optionsSubscription:null,allSelected:!0,isLoading:!1}},beforeDestroy(){this.optionsSubscription.unsubscribe()},mounted(){this.optionsSubscription=POS.options.subscribe(t=>{this.options=t}),this.popup.params.product.quantity&&(this.finalValue=this.popup.params.product.quantity),this.popupCloser()},unmounted(){nsHotPress.destroy("pos-quantity-numpad"),nsHotPress.destroy("pos-quantity-backspace"),nsHotPress.destroy("pos-quantity-enter")},methods:{__:h,popupCloser:T,closePopup(){this.popup.params.reject(!1),this.popup.close()},updateQuantity(t){this.finalValue=t},defineQuantity(t){const{product:o,data:a}=this.popup.params;if(t===0)return v.error(h("Please provide a quantity")).subscribe();if(o.$original().stock_management==="enabled"&&o.$original().type==="materialized"){const b=POS.getStockUsage(o.$original().id,a.unit_quantity_id)-(o.quantity||0);if(t>parseFloat(a.$quantities().quantity)-b)return v.error(h("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",a.$quantities().quantity-b)).subscribe()}this.resolve({quantity:t})},resolve(t){this.popup.params.resolve(t),this.popup.close()}}},J={class:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-2/5-screen xl:w-2/5-screen relative"},X={key:0,id:"loading-overlay",style:{background:"rgb(202 202 202 / 49%)"},class:"flex w-full h-full absolute top-O left-0 items-center justify-center"},Z={class:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},$={class:"text-xl font-bold text-primary text-center"},ee={id:"screen",class:"h-24 primary ns-box-body flex items-center justify-center"},se={class:"font-bold text-3xl"};function te(t,o,a,b,r,s){const x=m("ns-spinner"),u=m("ns-close-button"),y=m("ns-numpad"),C=m("ns-numpad-plus");return i(),l("div",J,[r.isLoading?(i(),l("div",X,[p(x)])):c("",!0),e("div",Z,[e("div",null,[e("h1",$,n(s.__("Define Quantity")),1)]),e("div",null,[p(u,{onClick:o[0]||(o[0]=_=>s.closePopup())})])]),e("div",ee,[e("h1",se,n(r.finalValue),1)]),r.options.ns_pos_numpad==="default"?(i(),N(y,{key:1,floating:r.options.ns_pos_allow_decimal_quantities,onChanged:o[1]||(o[1]=_=>s.updateQuantity(_)),onNext:o[2]||(o[2]=_=>s.defineQuantity(_)),value:r.finalValue},null,8,["floating","value"])):c("",!0),r.options.ns_pos_numpad==="advanced"?(i(),N(C,{key:2,onChanged:o[3]||(o[3]=_=>s.updateQuantity(_)),onNext:o[4]||(o[4]=_=>s.defineQuantity(_)),value:r.finalValue},null,8,["value"])):c("",!0)])}const oe=O(G,[["render",te]]);class Ln{constructor(o){this.product=o}run(o){return new Promise((a,b)=>{const r=this.product;if(POS.options.getValue().ns_pos_show_quantity!==!1||!POS.processingAddQueue)P.show(oe,{resolve:a,reject:b,product:r,data:o});else{if(r.$original().stock_management==="enabled"&&r.$original().type==="materialized"){const u=POS.getStockUsage(r.$original().id,o.unit_quantity_id)-(r.quantity||0);if(1>parseFloat(o.$quantities().quantity)-u)return v.error(h("Unable to add the product, there is not enough stock. Remaining %s").replace("%s",(o.$quantities().quantity-u).toString())).subscribe()}a({quantity:1})}})}}const ne={mounted(){this.closeWithOverlayClicked(),this.loadTransactionFields()},props:["popup"],data(){return{fields:[],isSubmiting:!1,formValidation:new z}},methods:{__:h,closeWithOverlayClicked:T,proceed(){const t=this.popup.params.customer,o=this.formValidation.extractFields(this.fields);this.isSubmiting=!0,S.post(`/api/customers/${t.id}/account-history`,o).subscribe({next:a=>{this.isSubmiting=!1,v.success(a.message).subscribe(),this.popup.params.resolve(a),this.popup.close()},error:a=>{this.isSubmiting=!1,v.error(a.message).subscribe(),this.popup.params.reject(a)}})},close(){this.popup.close(),this.popup.params.reject(!1)},loadTransactionFields(){S.get("/api/fields/ns.customers-account").subscribe({next:t=>{this.fields=this.formValidation.createFields(t)}})}}},re={class:"w-6/7-screen md:w-5/7-screen lg:w-4/7-screen h-6/7-screen md:h-5/7-screen lg:h-5/7-screen overflow-hidden shadow-lg ns-box flex flex-col relative"},ie={class:"p-2 border-b ns-box-header flex justify-between items-center"},le={class:"font-semibold"},ce={class:"flex-auto overflow-y-auto"},ue={key:0,class:"h-full w-full flex items-center justify-center"},ae={key:1,class:"p-2"},de={class:"p-2 ns-box-footer justify-between border-t flex"},_e=e("div",null,null,-1),pe={class:"px-1"},he={class:"-mx-2 flex flex-wrap"},fe={class:"px-1"},me={class:"px-1"},be={key:0,class:"h-full w-full absolute flex items-center justify-center",style:{background:"rgb(0 98 171 / 45%)"}};function ye(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-spinner"),y=m("ns-field"),C=m("ns-button");return i(),l("div",re,[e("div",ie,[e("h2",le,n(s.__("New Transaction")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=_=>s.close())})])]),e("div",ce,[r.fields.length===0?(i(),l("div",ue,[p(u)])):c("",!0),r.fields.length>0?(i(),l("div",ae,[(i(!0),l(g,null,k(r.fields,(_,V)=>(i(),N(y,{field:_,key:V},null,8,["field"]))),128))])):c("",!0)]),e("div",de,[_e,e("div",pe,[e("div",he,[e("div",fe,[p(C,{type:"error",onClick:o[1]||(o[1]=_=>s.close())},{default:f(()=>[w(n(s.__("Close")),1)]),_:1})]),e("div",me,[p(C,{type:"info",onClick:o[2]||(o[2]=_=>s.proceed())},{default:f(()=>[w(n(s.__("Proceed")),1)]),_:1})])])])]),r.isSubmiting===0?(i(),l("div",be,[p(u)])):c("",!0)])}const xe=O(ne,[["render",ye]]),ve={name:"ns-pos-coupons-load-popup",props:["popup"],components:{nsNotice:E},data(){return{placeHolder:h("Coupon Code"),couponCode:null,order:null,activeTab:"apply-coupon",orderSubscriber:null,coupon:null}},mounted(){this.popupCloser(),this.orderSubscriber=POS.order.subscribe(t=>{this.order=K(t),this.order.coupons.length>0&&(this.activeTab="active-coupons")}),this.popup.params&&this.popup.params.apply_coupon&&(this.couponCode=this.popup.params.apply_coupon,this.getCoupon(this.couponCode).subscribe({next:t=>{this.coupon=t,this.apply()}}))},unmounted(){this.orderSubscriber.unsubscribe()},methods:{__:h,popupCloser:T,popupResolver:j,selectCustomer(){Popup.show(U)},cancel(){this.coupon=null,this.couponCode=null},removeCoupon(t){this.order.coupons.splice(t,1),POS.refreshCart()},apply(){try{if(this.coupon.valid_hours_start!==null&&!ns.date.moment.isAfter(this.coupon.valid_hours_start)&&this.coupon.valid_hours_start.length>0)return v.error(h("The coupon is out from validity date range.")).subscribe();if(this.coupon.valid_hours_end!==null&&!ns.date.moment.isBefore(this.coupon.valid_hours_end)&&this.coupon.valid_hours_end.length>0)return v.error(h("The coupon is out from validity date range.")).subscribe();const t=this.coupon.products;if(t.length>0){const b=t.map(r=>r.product_id);if(this.order.products.filter(r=>b.includes(r.product_id)).length===0)return v.error(h("This coupon requires products that aren't available on the cart at the moment.")).subscribe()}const o=this.coupon.categories;if(o.length>0){const b=o.map(r=>r.category_id);if(this.order.products.filter(r=>b.includes(r.$original().category_id)).length===0)return v.error(h("This coupon requires products that belongs to specific categories that aren't included at the moment.").replace("%s")).subscribe()}let a={customer_coupon_id:this.coupon.customer_coupon.length>0?this.coupon.customer_coupon[0].id:0,minimum_cart_value:this.coupon.minimum_cart_value,maximum_cart_value:this.coupon.maximum_cart_value,name:this.coupon.name,type:this.coupon.type,value:0,coupon_id:this.coupon.id,limit_usage:this.coupon.limit_usage,code:this.coupon.code,discount_value:this.coupon.discount_value,categories:this.coupon.categories,products:this.coupon.products};this.cancel(),POS.pushCoupon(a),this.activeTab="active-coupons",setTimeout(()=>{this.popupResolver(a)},500),v.success(h("The coupon has applied to the cart.")).subscribe()}catch(t){console.log(t)}},getCouponType(t){switch(t){case"percentage_discount":return h("Percentage");case"flat_discount":return h("Flat");default:return h("Unknown Type")}},getDiscountValue(t){switch(t.type){case"percentage_discount":return t.discount_value+"%";case"flat_discount":return this.$options.filters.currency(t.discount_value)}},closePopup(){this.popupResolver(!1)},setActiveTab(t){this.activeTab=t,t==="apply-coupon"&&setTimeout(()=>{document.querySelector(".coupon-field").select()},10)},getCoupon(t){return!this.order.customer_id>0?v.error(h("You must select a customer before applying a coupon.")):S.post(`/api/customers/coupons/${t}`,{customer_id:this.order.customer_id})},loadCoupon(){const t=this.couponCode;this.getCoupon(t).subscribe({next:o=>{this.coupon=o,v.success(h("The coupon has been loaded.")).subscribe()},error:o=>{v.error(o.message||h("An unexpected error occurred.")).subscribe()}})}}},ge={class:"shadow-lg ns-box w-95vw md:w-3/6-screen lg:w-2/6-screen"},we={class:"border-b ns-box-header p-2 flex justify-between items-center"},Ce={class:"font-bold"},ke={class:"p-1 ns-box-body"},Pe={class:"border-2 input-group info rounded flex"},Se=["placeholder"],Te={class:"pt-2"},Oe={key:0,class:"pt-2 flex"},Ve={key:1,class:"pt-2"},je={class:"overflow-hidden"},Le={key:0,class:"pt-2 fade-in-entrance anim-duration-500 overflow-y-auto ns-scrollbar h-64"},Ne={class:"w-full ns-table"},qe={class:"p-2 w-1/2 border"},Ae={class:"p-2 w-1/2 border"},Re={class:"p-2 w-1/2 border"},He={class:"p-2 w-1/2 border"},Fe={class:"p-2 w-1/2 border"},Qe={class:"p-2 w-1/2 border"},De={class:"p-2 w-1/2 border"},Ue={class:"p-2 w-1/2 border"},We={class:"p-2 w-1/2 border"},ze={class:"p-2 w-1/2 border"},Ie={class:"p-2 w-1/2 border"},Be={class:"p-2 w-1/2 border"},Ee={key:0},Me={class:"p-2 w-1/2 border"},Ke={class:"p-2 w-1/2 border"},Ye={key:0},Ge={key:0},Je={class:"flex-auto"},Xe={class:"font-semibold text-primary p-2 flex justify-between"},Ze={key:0,class:"flex justify-between elevation-surface border items-center p-2"},$e={key:0,class:"flex"};function es(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-notice"),y=m("ns-tabs-item"),C=m("ns-tabs");return i(),l("div",ge,[e("div",we,[e("h3",Ce,n(s.__("Load Coupon")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=_=>s.closePopup())})])]),e("div",ke,[p(C,{onActive:o[5]||(o[5]=_=>s.setActiveTab(_)),active:r.activeTab},{default:f(()=>[p(y,{label:s.__("Apply A Coupon"),padding:"p-2",identifier:"apply-coupon"},{default:f(()=>[e("div",Pe,[D(e("input",{ref:"coupon",onKeyup:o[1]||(o[1]=Q(_=>s.loadCoupon(),["enter"])),"onUpdate:modelValue":o[2]||(o[2]=_=>r.couponCode=_),type:"text",class:"coupon-field w-full text-primary p-2 outline-none",placeholder:r.placeHolder},null,40,Se),[[F,r.couponCode]]),e("button",{onClick:o[3]||(o[3]=_=>s.loadCoupon()),class:"px-3 py-2"},n(s.__("Load")),1)]),e("div",Te,[p(u,{color:"info"},{description:f(()=>[w(n(s.__("Input the coupon code that should apply to the POS. If a coupon is issued for a customer, that customer must be selected priorly.")),1)]),_:1})]),r.order&&r.order.customer_id===void 0?(i(),l("div",Oe,[e("button",{onClick:o[4]||(o[4]=_=>s.selectCustomer()),class:"w-full border p-2 outline-none ns-numpad-key info cursor-pointer text-center"},n(s.__("Click here to choose a customer.")),1)])):c("",!0),r.order&&r.order.customer_id!==void 0?(i(),l("div",Ve,[p(u,{color:"success"},{description:f(()=>[w(n(s.__("Loading Coupon For : ")+`${r.order.customer.first_name} ${r.order.customer.last_name}`),1)]),_:1})])):c("",!0),e("div",je,[r.coupon?(i(),l("div",Le,[e("table",Ne,[e("tbody",null,[e("tr",null,[e("td",qe,n(s.__("Coupon Name")),1),e("td",Ae,n(r.coupon.name),1)]),e("tr",null,[e("td",Re,n(s.__("Discount"))+" ("+n(s.getCouponType(r.coupon.type))+")",1),e("td",He,n(s.getDiscountValue(r.coupon)),1)]),e("tr",null,[e("td",Fe,n(s.__("Usage")),1),e("td",Qe,n((r.coupon.customer_coupon.length>0?r.coupon.customer_coupon[0].usage:0)+"/"+(r.coupon.limit_usage||s.__("Unlimited"))),1)]),e("tr",null,[e("td",De,n(s.__("Valid From")),1),e("td",Ue,n(r.coupon.valid_hours_start||s.__("N/A")),1)]),e("tr",null,[e("td",We,n(s.__("Valid Till")),1),e("td",ze,n(r.coupon.valid_hours_end||s.__("N/A")),1)]),e("tr",null,[e("td",Ie,n(s.__("Categories")),1),e("td",Be,[e("ul",null,[(i(!0),l(g,null,k(r.coupon.categories,_=>(i(),l("li",{class:"rounded-full px-3 py-1 border",key:_.id},n(_.category.name),1))),128)),r.coupon.categories.length===0?(i(),l("li",Ee,n(s.__("Not applicable")),1)):c("",!0)])])]),e("tr",null,[e("td",Me,n(s.__("Products")),1),e("td",Ke,[e("ul",null,[(i(!0),l(g,null,k(r.coupon.products,_=>(i(),l("li",{class:"rounded-full px-3 py-1 border",key:_.id},n(_.product.name),1))),128)),r.coupon.products.length===0?(i(),l("li",Ye,n(s.__("Not applicable")),1)):c("",!0)])])])])])])):c("",!0)])]),_:1},8,["label"]),p(y,{label:s.__("Active Coupons"),padding:"p-1",identifier:"active-coupons"},{default:f(()=>[r.order?(i(),l("ul",Ge,[(i(!0),l(g,null,k(r.order.coupons,(_,V)=>(i(),l("li",{key:V,class:"flex justify-between elevation-surface border items-center px-2 py-1"},[e("div",Je,[e("h3",Xe,[e("span",null,n(_.name),1),e("span",null,n(s.getDiscountValue(_)),1)])]),e("div",null,[p(x,{onClick:q=>s.removeCoupon(V)},null,8,["onClick"])])]))),128)),r.order.coupons.length===0?(i(),l("li",Ze,n(s.__("No coupons applies to the cart.")),1)):c("",!0)])):c("",!0)]),_:1},8,["label"])]),_:1},8,["active"])]),r.coupon?(i(),l("div",$e,[e("button",{onClick:o[6]||(o[6]=_=>s.apply()),class:"w-1/2 px-3 py-2 bg-success-tertiary text-white font-bold"},n(s.__("Apply")),1),e("button",{onClick:o[7]||(o[7]=_=>s.cancel()),class:"w-1/2 px-3 py-2 bg-error-tertiary text-white font-bold"},n(s.__("Cancel")),1)])):c("",!0)])}const ss=O(ve,[["render",es]]),ts={name:"ns-pos-customers",props:["popup"],data(){return{activeTab:"create-customers",customer:null,subscription:null,orders:[],options:{},optionsSubscriber:null,selectedTab:"orders",isLoadingCoupons:!1,isLoadingRewards:!1,isLoadingHistory:!1,isLoadingOrders:!1,coupons:[],userCan:t=>POS.userCan(t),rewardsResponse:[],order:null,walletHistories:[]}},components:{nsPaginate:M},unmounted(){this.subscription.unsubscribe(),this.optionsSubscriber.unsubscribe()},mounted(){this.closeWithOverlayClicked(),this.optionsSubscriber=POS.options.subscribe(t=>{this.options=t}),this.subscription=POS.order.subscribe(t=>{this.order=t,this.popup.params.customer!==void 0?(this.activeTab="account-payment",this.customer=this.popup.params.customer,this.loadCustomerOrders()):t.customer!==void 0&&(this.activeTab="account-payment",this.customer=t.customer,this.loadCustomerOrders())}),this.popupCloser()},methods:{__:h,nsCurrency:R,reload(){this.loadCustomerOrders()},popupResolver:j,popupCloser:T,getWalletHistoryLabel(t){switch(t){case"add":return h("Crediting");case"deduct":return h("Removing");case"refund":return h("Refunding");case"payment":return h("Payment");default:return h("Unknow")}},getType(t){switch(t){case"percentage_discount":return h("Percentage Discount");case"flat_discount":return h("Flat Discount")}},closeWithOverlayClicked:T,async openOrderOptions(t){try{const o=await new Promise((a,b)=>{P.show(Y,{order:t,resolve:a,reject:b})});this.reload()}catch{v.error(h("An error occurred while opening the order options")).subscribe()}},doChangeTab(t){this.selectedTab=t,t==="coupons"&&this.loadCoupons(),t==="rewards"&&this.loadRewards(),t==="wallet-history"&&this.loadAccounHistory(),t==="orders"&&this.loadCustomerOrders()},loadAccounHistory(){this.isLoadingHistory=!0,S.get(`/api/customers/${this.customer.id}/account-history`).subscribe({next:t=>{this.walletHistories=t.data,this.isLoadingHistory=!1},error:t=>{this.isLoadingHistory=!1}})},loadCoupons(){this.isLoadingCoupons=!0,S.get(`/api/customers/${this.customer.id}/coupons`).subscribe({next:t=>{this.coupons=t,this.isLoadingCoupons=!1},error:t=>{this.isLoadingCoupons=!1}})},loadRewards(t=`/api/customers/${this.customer.id}/rewards`){this.isLoadingRewards=!0,S.get(t).subscribe({next:o=>{this.rewardsResponse=o,this.isLoadingRewards=!1},error:o=>{this.isLoadingRewards=!1}})},prefillForm(t){this.popup.params.name!==void 0&&(t.main.value=this.popup.params.name)},openCustomerSelection(){this.popup.close(t=>{P.show(U)})},loadCustomerOrders(){this.isLoadingOrders=!0,S.get(`/api/customers/${this.customer.id}/orders`).subscribe({next:t=>{this.orders=t,this.isLoadingOrders=!1},error:t=>{this.isLoadingOrders=!1}})},newTransaction(t){new Promise((a,b)=>{P.show(xe,{customer:t,resolve:a,reject:b})}).then(a=>{POS.loadCustomer(t.id).subscribe(b=>{POS.selectCustomer(b)})})},applyCoupon(t){this.order.customer===void 0?P.show(H,{title:h("Use Customer ?"),message:h("No customer is selected. Would you like to proceed with this customer ?"),onAction:o=>{o&&POS.selectCustomer(this.customer).then(a=>{this.proceedApplyingCoupon(t)})}}):this.order.customer.id===this.customer.id?this.proceedApplyingCoupon(t):this.order.customer.id!==this.customer.id&&P.show(H,{title:h("Change Customer ?"),message:h("Would you like to assign this customer to the ongoing order ?"),onAction:o=>{o&&POS.selectCustomer(this.customer).then(a=>{this.proceedApplyingCoupon(t)})}})},proceedApplyingCoupon(t){new Promise((o,a)=>{P.show(ss,{apply_coupon:t.code,resolve:o,reject:a})}).then(o=>{this.popupResolver(!1)}).catch(o=>{})},handleSavedCustomer(t){v.success(t.message).subscribe(),POS.selectCustomer(t.data.entry),this.popup.close()}}},os={id:"ns-pos-customers",class:"shadow-lg rounded w-95vw h-95vh lg:w-3/5-screen flex flex-col overflow-hidden"},rs={class:"ns-header p-2 flex justify-between items-center border-b"},is={class:"font-semibold"},ls={class:"ns-body flex-auto flex p-2 overflow-y-auto"},cs={key:1,class:"h-full flex-col w-full flex items-center justify-center text-primary"},us=e("i",{class:"lar la-hand-paper ns-icon text-6xl"},null,-1),as={class:"font-medium text-2xl"},ds={key:0,class:"flex-auto w-full flex items-center justify-center flex-col p-4"},_s=e("i",{class:"lar la-frown text-6xl"},null,-1),ps={class:"font-medium text-2xl"},hs={class:"my-2"},fs={key:1,class:"flex flex-col flex-auto"},ms={class:"flex-auto p-2 flex flex-col"},bs={class:"flex flex-wrap"},ys={class:"px-4 mb-4 w-full"},xs={class:"font-semibold"},vs={class:"flex flex-wrap ns-tab-cards -mx-2 w-full"},gs={class:"px-2 mb-4 w-full md:w-1/4 flex"},ws={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-success-secondary to-green-700 p-2 flex flex-col text-white"},Cs={class:"font-medium text-lg"},ks={class:"w-full flex justify-end"},Ps={class:"font-bold"},Ss={class:"px-2 mb-4 w-full md:w-1/4 flex"},Ts={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-error-secondary to-red-700 p-2 text-white"},Os={class:"font-medium text-lg"},Vs={class:"w-full flex justify-end"},js={class:"font-bold"},Ls={class:"px-2 mb-4 w-full md:w-1/4 flex"},Ns={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-blue-500 to-blue-700 p-2 text-white"},qs={class:"font-medium text-lg"},As={class:"w-full flex justify-end"},Rs={class:"font-bold"},Hs={class:"px-2 mb-4 w-full md:w-1/4 flex"},Fs={class:"rounded-lg shadow w-full bg-transparent bg-gradient-to-br from-teal-500 to-teal-700 p-2 text-white"},Qs={class:"font-medium text-lg"},Ds={class:"w-full flex justify-end"},Us={class:"font-bold"},Ws={class:"flex flex-auto flex-col overflow-hidden"},zs={key:0,class:"flex-auto h-full justify-center flex items-center"},Is={class:"py-2 w-full"},Bs={class:"font-semibold text-primary"},Es={class:"flex-auto flex-col flex overflow-hidden"},Ms={class:"flex-auto overflow-y-auto"},Ks={class:"table ns-table w-full"},Ys={class:"text-primary"},Gs={colspan:"3",width:"150",class:"p-2 border font-semibold"},Js={width:"50",class:"p-2 border font-semibold"},Xs={class:"text-primary"},Zs={key:0},$s={class:"border p-2 text-center",colspan:"4"},et={colspan:"3",class:"border p-2 text-center"},st={class:"flex flex-col items-start"},tt={class:"font-bold"},ot={class:"md:-mx-2 w-full flex flex-col md:flex-row"},nt={class:"md:px-2 flex items-start w-full md:w-1/4"},rt={class:"md:px-2 flex items-start w-full md:w-1/4"},it={class:"md:px-2 flex items-start w-full md:w-1/4"},lt={class:"border p-2 text-center"},ct=["onClick"],ut=e("i",{class:"las la-wallet"},null,-1),at={class:"ml-1"},dt={key:0,class:"flex-auto h-full justify-center flex items-center"},_t={class:"py-2 w-full"},pt={class:"font-semibold text-primary"},ht={class:"flex-auto flex-col flex overflow-hidden"},ft={class:"flex-auto overflow-y-auto"},mt={class:"table ns-table w-full"},bt={class:"text-primary"},yt={colspan:"3",width:"150",class:"p-2 border font-semibold"},xt={class:"text-primary"},vt={key:0},gt={class:"border p-2 text-center",colspan:"3"},wt={colspan:"3",class:"border p-2 text-center"},Ct={class:"flex flex-col items-start"},kt={class:"font-bold"},Pt={class:"md:-mx-2 w-full flex flex-col md:flex-row"},St={class:"md:px-2 flex items-start w-full md:w-1/3"},Tt={class:"md:px-2 flex items-start w-full md:w-1/3"},Ot={key:0,class:"flex-auto h-full justify-center flex items-center"},Vt={class:"py-2 w-full"},jt={class:"font-semibold text-primary"},Lt={class:"flex-auto flex-col flex overflow-hidden"},Nt={class:"flex-auto overflow-y-auto"},qt={class:"table ns-table w-full"},At={class:"text-primary"},Rt={width:"150",class:"p-2 border font-semibold"},Ht={class:"p-2 border font-semibold"},Ft=e("th",{class:"p-2 border font-semibold"},null,-1),Qt={class:"text-primary text-sm"},Dt={key:0},Ut={class:"border p-2 text-center",colspan:"4"},Wt={width:"300",class:"border p-2"},zt={class:""},It={class:"-mx-2 flex"},Bt={class:"text-xs text-primary px-2"},Et={class:"text-xs text-primary px-2"},Mt={class:"border p-2 text-center"},Kt={key:0},Yt={key:1},Gt={class:"border p-2 text-right"},Jt={key:0,class:"flex-auto h-full justify-center flex items-center"},Xt={class:"py-2 w-full"},Zt={class:"font-semibold text-primary"},$t={class:"flex-auto flex-col flex overflow-hidden"},eo={class:"flex-auto overflow-y-auto"},so={class:"table ns-table w-full"},to={class:"text-primary"},oo={width:"150",class:"p-2 border font-semibold"},no={class:"p-2 border font-semibold"},ro={class:"p-2 border font-semibold"},io={key:0,class:"text-primary text-sm"},lo={key:0},co={class:"border p-2 text-center",colspan:"4"},uo={width:"300",class:"border p-2"},ao={class:"text-center"},_o={width:"300",class:"border p-2"},po={class:"text-center"},ho={width:"300",class:"border p-2"},fo={class:"text-center"},mo={class:"py-1 flex justify-end"},bo={class:"p-2 border-t border-box-edge flex justify-between"},yo=e("div",null,null,-1);function xo(t,o,a,b,r,s){const x=m("ns-close-button"),u=m("ns-crud-form"),y=m("ns-tabs-item"),C=m("ns-button"),_=m("ns-spinner"),V=m("ns-paginate"),q=m("ns-tabs");return i(),l("div",os,[e("div",rs,[e("h3",is,n(s.__("Customers")),1),e("div",null,[p(x,{onClick:o[0]||(o[0]=d=>a.popup.close())})])]),e("div",ls,[p(q,{active:r.activeTab,onActive:o[7]||(o[7]=d=>r.activeTab=d)},{default:f(()=>[p(y,{identifier:"create-customers",label:s.__("New Customer")},{default:f(()=>[r.userCan("nexopos.create.customers")?(i(),N(u,{key:0,onUpdated:o[1]||(o[1]=d=>s.prefillForm(d)),onSave:o[2]||(o[2]=d=>s.handleSavedCustomer(d)),"submit-url":"/api/crud/ns.customers",src:"/api/crud/ns.customers/form-config"},{title:f(()=>[w(n(s.__("Customer Name")),1)]),save:f(()=>[w(n(s.__("Save Customer")),1)]),_:1})):c("",!0),r.userCan("nexopos.create.customers")?c("",!0):(i(),l("div",cs,[us,e("h3",as,n(s.__("Not Authorized")),1),e("p",null,n(s.__("Creating customers has been explicitly disabled from the settings.")),1)]))]),_:1},8,["label"]),p(y,{identifier:"account-payment",label:s.__("Customer Account"),class:"flex",padding:"p-0 flex"},{default:f(()=>[r.customer===null?(i(),l("div",ds,[_s,e("h3",ps,n(s.__("No Customer Selected")),1),e("p",null,n(s.__("In order to see a customer account, you need to select one customer.")),1),e("div",hs,[p(C,{onClick:o[3]||(o[3]=d=>s.openCustomerSelection()),type:"info"},{default:f(()=>[w(n(s.__("Select Customer")),1)]),_:1})])])):c("",!0),r.customer?(i(),l("div",fs,[e("div",ms,[e("div",bs,[e("div",ys,[e("h2",xs,n(s.__("Summary For"))+" : "+n(r.customer.first_name),1)]),e("div",vs,[e("div",gs,[e("div",ws,[e("h3",Cs,n(s.__("Purchases")),1),e("div",ks,[e("h2",Ps,n(s.nsCurrency(r.customer.purchases_amount)),1)])])]),e("div",Ss,[e("div",Ts,[e("h3",Os,n(s.__("Owed")),1),e("div",Vs,[e("h2",js,n(s.nsCurrency(r.customer.owed_amount)),1)])])]),e("div",Ls,[e("div",Ns,[e("h3",qs,n(s.__("Wallet Amount")),1),e("div",As,[e("h2",Rs,n(s.nsCurrency(r.customer.account_amount)),1)])])]),e("div",Hs,[e("div",Fs,[e("h3",Qs,n(s.__("Credit Limit")),1),e("div",Ds,[e("h2",Us,n(s.nsCurrency(r.customer.credit_limit_amount)),1)])])])])]),e("div",Ws,[p(q,{active:r.selectedTab,onChangeTab:o[5]||(o[5]=d=>s.doChangeTab(d))},{default:f(()=>[p(y,{identifier:"orders",label:s.__("Orders")},{default:f(()=>[r.isLoadingOrders?(i(),l("div",zs,[p(_,{size:"36"})])):c("",!0),r.isLoadingOrders?c("",!0):(i(),l(g,{key:1},[e("div",Is,[e("h2",Bs,n(s.__("Last Purchases")),1)]),e("div",Es,[e("div",Ms,[e("table",Ks,[e("thead",null,[e("tr",Ys,[e("th",Gs,n(s.__("Order")),1),e("th",Js,n(s.__("Options")),1)])]),e("tbody",Xs,[r.orders.length===0?(i(),l("tr",Zs,[e("td",$s,n(s.__("No orders...")),1)])):c("",!0),(i(!0),l(g,null,k(r.orders,d=>(i(),l("tr",{key:d.id},[e("td",et,[e("div",st,[e("h3",tt,n(s.__("Code"))+": "+n(d.code),1),e("div",ot,[e("div",nt,[e("small",null,n(s.__("Total"))+": "+n(s.nsCurrency(d.total)),1)]),e("div",rt,[e("small",null,n(s.__("Status"))+": "+n(d.human_status),1)]),e("div",it,[e("small",null,n(s.__("Delivery"))+": "+n(d.human_delivery_status),1)])])])]),e("td",lt,[e("button",{onClick:W=>s.openOrderOptions(d),class:"rounded-full h-8 px-2 flex items-center justify-center border border-gray ns-inset-button success"},[ut,e("span",at,n(s.__("Options")),1)],8,ct)])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"wallet-history",label:s.__("Wallet History")},{default:f(()=>[r.isLoadingHistory?(i(),l("div",dt,[p(_,{size:"36"})])):c("",!0),r.isLoadingHistory?c("",!0):(i(),l(g,{key:1},[e("div",_t,[e("h2",pt,n(s.__("Wallet History")),1)]),e("div",ht,[e("div",ft,[e("table",mt,[e("thead",null,[e("tr",bt,[e("th",yt,n(s.__("Transaction")),1)])]),e("tbody",xt,[r.walletHistories.length===0?(i(),l("tr",vt,[e("td",gt,n(s.__("No History...")),1)])):c("",!0),(i(!0),l(g,null,k(r.walletHistories,d=>(i(),l("tr",{key:d.id},[e("td",wt,[e("div",Ct,[e("h3",kt,n(s.__("Transaction"))+": "+n(s.getWalletHistoryLabel(d.operation)),1),e("div",Pt,[e("div",St,[e("small",null,n(s.__("Amount"))+": "+n(s.nsCurrency(t.amount)),1)]),e("div",Tt,[e("small",null,n(s.__("Date"))+": "+n(d.created_at),1)])])])])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"coupons",label:s.__("Coupons")},{default:f(()=>[r.isLoadingCoupons?(i(),l("div",Ot,[p(_,{size:"36"})])):c("",!0),r.isLoadingCoupons?c("",!0):(i(),l(g,{key:1},[e("div",Vt,[e("h2",jt,n(s.__("Coupons")),1)]),e("div",Lt,[e("div",Nt,[e("table",qt,[e("thead",null,[e("tr",At,[e("th",Rt,n(s.__("Name")),1),e("th",Ht,n(s.__("Type")),1),Ft])]),e("tbody",Qt,[r.coupons.length===0?(i(),l("tr",Dt,[e("td",Ut,n(s.__("No coupons for the selected customer...")),1)])):c("",!0),(i(!0),l(g,null,k(r.coupons,d=>(i(),l("tr",{key:d.id},[e("td",Wt,[e("h3",null,n(d.name),1),e("div",zt,[e("ul",It,[e("li",Bt,n(s.__("Usage :"))+" "+n(d.usage)+"/"+n(d.limit_usage),1),e("li",Et,n(s.__("Code :"))+" "+n(d.code),1)])])]),e("td",Mt,[w(n(s.getType(d.coupon.type))+" ",1),d.coupon.type==="percentage_discount"?(i(),l("span",Kt," ("+n(d.coupon.discount_value)+"%) ",1)):c("",!0),d.coupon.type==="flat_discount"?(i(),l("span",Yt," ("+n(s.nsCurrency(t.value))+") ",1)):c("",!0)]),e("td",Gt,[p(C,{onClick:W=>s.applyCoupon(d),type:"info"},{default:f(()=>[w(n(s.__("Use Coupon")),1)]),_:2},1032,["onClick"])])]))),128))])])])])],64))]),_:1},8,["label"]),p(y,{identifier:"rewards",label:s.__("Rewards")},{default:f(()=>[r.isLoadingRewards?(i(),l("div",Jt,[p(_,{size:"36"})])):c("",!0),r.isLoadingRewards?c("",!0):(i(),l(g,{key:1},[e("div",Xt,[e("h2",Zt,n(s.__("Rewards")),1)]),e("div",$t,[e("div",eo,[e("table",so,[e("thead",null,[e("tr",to,[e("th",oo,n(s.__("Name")),1),e("th",no,n(s.__("Points")),1),e("th",ro,n(s.__("Target")),1)])]),r.rewardsResponse.data?(i(),l("tbody",io,[r.rewardsResponse.data.length===0?(i(),l("tr",lo,[e("td",co,n(s.__("No rewards available the selected customer...")),1)])):c("",!0),(i(!0),l(g,null,k(r.rewardsResponse.data,d=>(i(),l("tr",{key:d.id},[e("td",uo,[e("h3",ao,n(d.reward_name),1)]),e("td",_o,[e("h3",po,n(d.points),1)]),e("td",ho,[e("h3",fo,n(d.target),1)])]))),128))])):c("",!0)])])]),e("div",mo,[p(V,{pagination:r.rewardsResponse,onLoad:o[4]||(o[4]=d=>s.loadRewards(d))},null,8,["pagination"])])],64))]),_:1},8,["label"])]),_:1},8,["active"])])]),e("div",bo,[yo,e("div",null,[p(C,{onClick:o[6]||(o[6]=d=>s.newTransaction(r.customer)),type:"info"},{default:f(()=>[w(n(s.__("Account Transaction")),1)]),_:1})])])])):c("",!0)]),_:1},8,["label"])]),_:1},8,["active"])])])}const A=O(ts,[["render",xo]]),Nn=Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"})),vo={props:["popup"],data(){return{searchCustomerValue:"",orderSubscription:null,order:{},debounceSearch:null,customers:[],isLoading:!1}},computed:{customerSelected(){return!1}},watch:{searchCustomerValue(t){clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.searchCustomer(t)},500)}},mounted(){this.orderSubscription=POS.order.subscribe(t=>{this.order=t}),this.getRecentCustomers(),this.$refs.searchField.focus(),this.popupCloser()},unmounted(){this.orderSubscription.unsubscribe()},methods:{__:h,popupCloser:T,nsCurrency:R,resolveIfQueued:j,attemptToChoose(){if(this.customers.length===1)return this.selectCustomer(this.customers[0]);v.info(h("Too many results.")).subscribe()},openCustomerHistory(t,o){o.stopImmediatePropagation(),this.popup.close(),P.show(A,{customer:t,activeTab:"account-payment"})},selectCustomer(t){this.customers.forEach(o=>o.selected=!1),t.selected=!0,this.isLoading=!0,POS.selectCustomer(t).then(o=>{this.isLoading=!1,this.resolveIfQueued(t)}).catch(o=>{this.isLoading=!1})},searchCustomer(t){S.post("/api/customers/search",{search:t}).subscribe(o=>{o.forEach(a=>a.selected=!1),this.customers=o})},createCustomerWithMatch(t){this.resolveIfQueued(!1),P.show(A,{name:t})},getRecentCustomers(){this.isLoading=!0,S.get("/api/customers/recently-active").subscribe({next:t=>{this.isLoading=!1,t.forEach(o=>o.selected=!1),this.customers=t},error:t=>{this.isLoading=!1}})}}},go={id:"ns-pos-customer-select-popup",class:"ns-box shadow-xl w-4/5-screen md:w-2/5-screen xl:w-108"},wo={id:"header",class:"border-b ns-box-header text-center font-semibold text-2xl py-2"},Co={class:"relative"},ko={class:"p-2 border-b ns-box-body items-center flex justify-between"},Po={class:"flex items-center justify-between"},So=e("i",{class:"las la-eye"},null,-1),To=[So],Oo={class:"p-2 border-b ns-box-body flex justify-between text-primary"},Vo={class:"input-group flex-auto border-2 rounded"},jo={class:"h-3/5-screen xl:h-2/5-screen overflow-y-auto ns-scrollbar"},Lo={class:"ns-vertical-menu"},No={key:0,class:"p-2 text-center text-primary"},qo={class:"border-b border-dashed border-info-primary"},Ao=["onClick"],Ro={class:"flex flex-col"},Ho={class:"text-xs text-secondary"},Fo={class:"flex items-center"},Qo={key:0,class:"text-error-primary"},Do={key:1},Uo={class:"purchase-amount"},Wo=["onClick"],zo=e("i",{class:"las la-eye"},null,-1),Io=[zo],Bo={key:0,class:"z-10 top-0 absolute w-full h-full flex items-center justify-center"};function Eo(t,o,a,b,r,s){const x=m("ns-spinner");return i(),l("div",go,[e("div",wo,[e("h2",null,n(s.__("Select Customer")),1)]),e("div",Co,[e("div",ko,[e("span",null,n(s.__("Selected"))+" : ",1),e("div",Po,[e("span",null,n(r.order.customer?`${r.order.customer.first_name} ${r.order.customer.last_name}`:"N/A"),1),r.order.customer?(i(),l("button",{key:0,onClick:o[0]||(o[0]=u=>s.openCustomerHistory(r.order.customer,u)),class:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button hover:border-transparent"},To)):c("",!0)])]),e("div",Oo,[e("div",Vo,[D(e("input",{ref:"searchField",onKeydown:o[1]||(o[1]=Q(u=>s.attemptToChoose(),["enter"])),"onUpdate:modelValue":o[2]||(o[2]=u=>r.searchCustomerValue=u),placeholder:"Search Customer",type:"text",class:"outline-none w-full p-2"},null,544),[[F,r.searchCustomerValue]])])]),e("div",jo,[e("ul",Lo,[r.customers&&r.customers.length===0?(i(),l("li",No,n(s.__("No customer match your query...")),1)):c("",!0),r.customers&&r.customers.length===0?(i(),l("li",{key:1,onClick:o[3]||(o[3]=u=>s.createCustomerWithMatch(r.searchCustomerValue)),class:"p-2 cursor-pointer text-center text-primary"},[e("span",qo,n(s.__("Create a customer")),1)])):c("",!0),(i(!0),l(g,null,k(r.customers,u=>(i(),l("li",{onClick:y=>s.selectCustomer(u),key:u.id,class:"cursor-pointer p-2 border-b text-primary flex justify-between items-center"},[e("div",Ro,[e("span",null,n(u.first_name)+" "+n(u.last_name),1),e("small",Ho,n(u.group.name),1)]),e("p",Fo,[u.owe_amount>0?(i(),l("span",Qo,"-"+n(s.nsCurrency(u.owe_amount)),1)):c("",!0),u.owe_amount>0?(i(),l("span",Do,"/")):c("",!0),e("span",Uo,n(s.nsCurrency(u.purchases_amount)),1),e("button",{onClick:y=>s.openCustomerHistory(u,y),class:"mx-2 rounded-full h-8 w-8 flex items-center justify-center border ns-inset-button info"},Io,8,Wo)])],8,Ao))),128))])]),r.isLoading?(i(),l("div",Bo,[p(x,{size:"24",border:"8"})])):c("",!0)])])}const U=O(vo,[["render",Eo]]),Mo={name:"ns-pos-discount-popup",props:["popup"],data(){return{finalValue:1,virtualStock:null,popupSubscription:null,mode:"",type:"",allSelected:!0,isLoading:!1,keys:[...[7,8,9].map(t=>({identifier:t,value:t})),...[4,5,6].map(t=>({identifier:t,value:t})),...[1,2,3].map(t=>({identifier:t,value:t})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},mounted(){this.mode=this.popup.params.reference.discount_type||"percentage",this.type=this.popup.params.type,this.mode==="percentage"?this.finalValue=this.popup.params.reference.discount_percentage||1:this.finalValue=this.popup.params.reference.discount||1,this.popupCloser()},methods:{__:h,nsCurrency:R,popupResolver:j,popupCloser:T,setPercentageType(t){this.mode=t},closePopup(){this.popup.close()},inputValue(t){t.identifier==="next"?(this.popup.params.onSubmit({discount_type:this.mode,discount_percentage:this.mode==="percentage"?this.finalValue:void 0,discount:this.mode==="flat"?this.finalValue:void 0}),this.popup.close()):t.identifier==="backspace"?this.allSelected?(this.finalValue=0,this.allSelected=!1):(this.finalValue=this.finalValue.toString(),this.finalValue=this.finalValue.substr(0,this.finalValue.length-1)||0):this.allSelected?(this.finalValue=t.value,this.finalValue=parseFloat(this.finalValue),this.allSelected=!1):(this.finalValue+=""+t.value,this.finalValue=parseFloat(this.finalValue),this.mode==="percentage"&&(this.finalValue=this.finalValue>100?100:this.finalValue))}}},Ko={id:"discount-popup",class:"ns-box shadow min-h-2/5-screen w-6/7-screen md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen relative"},Yo={class:"flex-shrink-0 flex justify-between items-center p-2 border-b ns-box-header"},Go={key:0,class:"text-xl font-bold text-primary text-center"},Jo={key:1,class:"text-xl font-bold text-primary text-center"},Xo={id:"screen",class:"h-16 ns-box-body text-white flex items-center justify-center"},Zo={class:"font-bold text-3xl"},$o={key:0},en={key:1},sn={id:"switch-mode",class:"flex"},tn=e("hr",{class:"border-r border-box-edge"},null,-1),on={id:"numpad",class:"grid grid-flow-row grid-cols-3 grid-rows-3"},nn=["onClick"],rn={key:0};function ln(t,o,a,b,r,s){const x=m("ns-close-button");return i(),l("div",Ko,[e("div",Yo,[e("div",null,[r.type==="product"?(i(),l("h1",Go,n(s.__("Product Discount")),1)):c("",!0),r.type==="cart"?(i(),l("h1",Jo,n(s.__("Cart Discount")),1)):c("",!0)]),e("div",null,[p(x,{onClick:o[0]||(o[0]=u=>s.closePopup())})])]),e("div",Xo,[e("h1",Zo,[r.mode==="flat"?(i(),l("span",$o,n(s.nsCurrency(r.finalValue)),1)):c("",!0),r.mode==="percentage"?(i(),l("span",en,n(r.finalValue)+"%",1)):c("",!0)])]),e("div",sn,[e("button",{onClick:o[1]||(o[1]=u=>s.setPercentageType("flat")),class:L([r.mode==="flat"?"bg-tab-active":"bg-tab-inactive text-tertiary","outline-none w-1/2 py-2 flex items-center justify-center"])},n(s.__("Flat")),3),tn,e("button",{onClick:o[2]||(o[2]=u=>s.setPercentageType("percentage")),class:L([r.mode==="percentage"?"bg-tab-active":"bg-tab-inactive text-tertiary","outline-none w-1/2 py-2 flex items-center justify-center"])},n(s.__("Percentage")),3)]),e("div",on,[(i(!0),l(g,null,k(r.keys,(u,y)=>(i(),l("div",{onClick:C=>s.inputValue(u),key:y,class:"text-primary ns-numpad-key info text-xl font-bold border h-24 flex items-center justify-center cursor-pointer"},[u.value!==void 0?(i(),l("span",rn,n(u.value),1)):c("",!0),u.icon?(i(),l("i",{key:1,class:L(["las",u.icon])},null,2)):c("",!0)],8,nn))),128))])])}const qn=O(Mo,[["render",ln]]),cn={data(){return{types:[],settingsSubscription:null,urls:{}}},props:["popup"],mounted(){this.settingsSubscription=POS.settings.subscribe(t=>{this.urls=t.urls}),this.types=POS.types.getValue(),Object.values(this.types).length===1&&this.select(Object.keys(this.types)[0]),this.popupCloser()},methods:{__:h,popupCloser:T,popupResolver:j,resolveIfQueued:j,async select(t){Object.values(this.types).forEach(a=>a.selected=!1),this.types[t].selected=!0;const o=this.types[t];try{const a=await POS.triggerOrderTypeSelection(o);POS.types.next(this.types),this.resolveIfQueued(o)}catch(a){throw a}}}},un={id:"ns-order-type",class:"h-full w-4/5-screen md:w-2/5-screen lg:w-2/5-screen xl:w-2/6-screen shadow-lg"},an={id:"header",class:"h-16 flex justify-center items-center"},dn={class:"font-bold"},_n={key:0,class:"ns-box-body grid grid-flow-row grid-cols-1 grid-rows-1"},pn={class:"h-full w-full flex items-center justify-center flex-col"},hn=e("i",{class:"las la-frown text-7xl text-error-tertiary"},null,-1),fn={class:"p-4 md:w-2/3"},mn={class:"text-center"},bn={class:"flex justify-center mt-4 mb-2 -mx-2"},yn={class:"px-2"},xn={class:"px-2"},vn={key:1,class:"ns-box-body grid grid-flow-row grid-cols-2 grid-rows-2"},gn=["onClick"],wn=["src"],Cn={class:"font-semibold text-xl my-2"};function kn(t,o,a,b,r,s){const x=m("ns-link");return i(),l("div",un,[e("div",an,[e("h3",dn,n(s.__("Define The Order Type")),1)]),Object.values(r.types).length===0?(i(),l("div",_n,[e("div",pn,[hn,e("div",fn,[e("p",mn,n(s.__("No payment type has been selected on the settings. Please check your POS features and choose the supported order type")),1),e("div",bn,[e("div",yn,[p(x,{target:"_blank",type:"info",href:"https://my.nexopos.com/en/documentation/components/order-types"},{default:f(()=>[w(n(s.__("Read More")),1)]),_:1})]),e("div",xn,[p(x,{target:"_blank",type:"info",href:r.urls.order_type_url},{default:f(()=>[w(n(s.__("Configure")),1)]),_:1},8,["href"])])])])])])):c("",!0),Object.values(r.types).length>0?(i(),l("div",vn,[(i(!0),l(g,null,k(r.types,u=>(i(),l("div",{onClick:y=>s.select(u.identifier),key:u.identifier,class:L([u.selected?"active":"","ns-numpad-key info h-56 flex items-center justify-center flex-col cursor-pointer border"])},[e("img",{src:u.icon,alt:"",class:"w-32 h-32"},null,8,wn),e("h4",Cn,n(u.label),1)],10,gn))),128))])):c("",!0)])}const An=O(cn,[["render",kn]]);export{Ln as P,qn as a,An as b,ss as c,Nn as d,U as n}; diff --git a/public/build/assets/ns-pos-pending-orders-button-CbJwpMtz.js b/public/build/assets/ns-pos-pending-orders-button-b934d686.js similarity index 97% rename from public/build/assets/ns-pos-pending-orders-button-CbJwpMtz.js rename to public/build/assets/ns-pos-pending-orders-button-b934d686.js index 972d8809b..e39151cc4 100644 --- a/public/build/assets/ns-pos-pending-orders-button-CbJwpMtz.js +++ b/public/build/assets/ns-pos-pending-orders-button-b934d686.js @@ -1 +1 @@ -import{a as C,n as P,g as k,v as $,w as F,p as j,P as S}from"./bootstrap-CnLEEQCx.js";import{n as V}from"./ns-prompt-popup-DKRiwYBT.js";import{_,n as L}from"./currency-lOMYG1Wf.js";import{_ as g}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as v,o as l,c as i,a as s,i as h,t as n,e as O,f as u,F as y,b as w,w as x,B as A}from"./runtime-core.esm-bundler-RT2b-_3S.js";const B={data(){return{products:[],isLoading:!1}},props:["popup"],computed:{order(){return this.popup.params.order}},mounted(){this.loadProducts()},methods:{__:_,nsCurrency:L,close(){this.popup.params.reject(!1),this.popup.close()},loadProducts(){this.isLoading=!0;const r=this.popup.params.order.id;C.get(`/api/orders/${r}/products`).subscribe(e=>{this.isLoading=!1,this.products=e})},openOrder(){this.popup.close(),this.popup.params.resolve(this.order)}}},N={class:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},U={class:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},D={class:"font-semibold"},H={key:0},q={class:"flex-auto p-2 overflow-y-auto ns-box-body"},K={key:0,class:"flex-auto relative"},E={class:"h-full w-full flex items-center justify-center"},M={class:"flex-col border-b border-info-primary py-2"},R={class:"title font-semibold text-primary flex justify-between"},Y={class:"text-sm text-primary"},z={class:"flex justify-end p-2 border-t ns-box-footer"},G={class:"px-1"},I={class:"-mx-2 flex"},J={class:"px-1"},Q={class:"px-1"};function W(r,e,a,b,p,t){const d=v("ns-close-button"),c=v("ns-spinner"),f=v("ns-button");return l(),i("div",N,[s("div",U,[s("h3",D,[h(n(t.__("Products"))+" — "+n(t.order.code)+" ",1),t.order.title?(l(),i("span",H,"("+n(t.order.title)+")",1)):O("",!0)]),s("div",null,[u(d,{onClick:e[0]||(e[0]=m=>t.close())})])]),s("div",q,[p.isLoading?(l(),i("div",K,[s("div",E,[u(c)])])):O("",!0),p.isLoading?O("",!0):(l(!0),i(y,{key:1},w(p.products,m=>(l(),i("div",{class:"item",key:m.id},[s("div",M,[s("div",R,[s("span",null,n(m.name)+" (x"+n(m.quantity)+")",1),s("span",null,n(t.nsCurrency(r.price)),1)]),s("div",Y,[s("ul",null,[s("li",null,n(t.__("Unit"))+" : "+n(m.unit.name),1)])])])]))),128))]),s("div",z,[s("div",G,[s("div",I,[s("div",J,[u(f,{onClick:e[1]||(e[1]=m=>t.openOrder()),type:"info"},{default:x(()=>[h(n(t.__("Open")),1)]),_:1})]),s("div",Q,[u(f,{onClick:e[2]||(e[2]=m=>t.close()),type:"error"},{default:x(()=>[h(n(t.__("Close")),1)]),_:1})])])])])])}const X=g(B,[["render",W]]),Z={props:["orders"],data(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders(){this.$nextTick(()=>{P.doAction("ns-pos-pending-orders-refreshed",this.orders.map(r=>({order:r,dom:document.querySelector(`[data-order-id="${r.id}"]`)})))})}},mounted(){this.columns.leftColumn=P.applyFilters("ns-pending-orders-left-column",[{label:_("Code"),value:r=>r.code},{label:_("Cashier"),value:r=>r.user_username},{label:_("Total"),value:r=>r.total},{label:_("Tendered"),value:r=>r.tendered}]),this.columns.rightColumn=P.applyFilters("ns-pending-orders-right-column",[{label:_("Customer"),value:r=>`${r.customer_first_name} ${r.customer_last_name}`},{label:_("Date"),value:r=>r.created_at},{label:_("Type"),value:r=>r.type}]),this.popupCloser()},name:"ns-pos-pending-order",methods:{__:_,popupCloser:k,previewOrder(r){this.$emit("previewOrder",r)},proceedOpenOrder(r){this.$emit("proceedOpenOrder",r)},searchOrder(){this.$emit("searchOrder",this.searchField)},printOrder(r){this.$emit("printOrder",r)}}},ee={class:"flex flex-auto flex-col overflow-hidden"},se={class:"p-1"},re={class:"flex rounded border-2 input-group info"},te=s("i",{class:"las la-search"},null,-1),oe={class:"mr-1 hidden md:visible"},ne={class:"overflow-y-auto flex flex-auto"},de={class:"flex p-2 flex-auto flex-col overflow-y-auto"},le=["data-order-id"],ie={class:"text-primary"},ae={class:"px-2"},pe={class:"flex flex-wrap -mx-4"},ce={class:"w-full md:w-1/2 px-2"},ue={class:"w-full md:w-1/2 px-2"},_e={class:"flex justify-end w-full mt-2"},fe={class:"flex rounded-lg overflow-hidden ns-buttons"},me=["onClick"],he=s("i",{class:"las la-lock-open"},null,-1),ve=["onClick"],xe=s("i",{class:"las la-eye"},null,-1),be=["onClick"],Oe=s("i",{class:"las la-print"},null,-1),ye={key:0,class:"h-full v-full items-center justify-center flex"},we={class:"text-semibold text-primary"};function ge(r,e,a,b,p,t){return l(),i("div",ee,[s("div",se,[s("div",re,[A(s("input",{onKeyup:e[0]||(e[0]=F(d=>t.searchOrder(),["enter"])),"onUpdate:modelValue":e[1]||(e[1]=d=>p.searchField=d),type:"text",class:"p-2 outline-none flex-auto"},null,544),[[$,p.searchField]]),s("button",{onClick:e[2]||(e[2]=d=>t.searchOrder()),class:"w-16 md:w-24"},[te,s("span",oe,n(t.__("Search")),1)])])]),s("div",ne,[s("div",de,[(l(!0),i(y,null,w(a.orders,d=>(l(),i("div",{"data-order-id":d.id,class:"border-b ns-box-body w-full py-2 ns-order-line",key:d.id},[s("h3",ie,n(d.title||"Untitled Order"),1),s("div",ae,[s("div",pe,[s("div",ce,[(l(!0),i(y,null,w(p.columns.leftColumn,(c,f)=>(l(),i("p",{key:f,class:"text-sm text-primary"},[s("strong",null,n(c.label),1),h(" : "+n(c.value(d)),1)]))),128))]),s("div",ue,[(l(!0),i(y,null,w(p.columns.rightColumn,(c,f)=>(l(),i("p",{key:f,class:"text-sm text-primary"},[s("strong",null,n(c.label),1),h(" : "+n(c.value(d)),1)]))),128))])])]),s("div",_e,[s("div",fe,[s("button",{onClick:c=>t.proceedOpenOrder(d),class:"info outline-none px-2 py-1"},[he,h(" "+n(t.__("Open")),1)],8,me),s("button",{onClick:c=>t.previewOrder(d),class:"success outline-none px-2 py-1"},[xe,h(" "+n(t.__("Products")),1)],8,ve),s("button",{onClick:c=>t.printOrder(d),class:"warning outline-none px-2 py-1"},[Oe,h(" "+n(t.__("Print")),1)],8,be)])])],8,le))),128)),a.orders.length===0?(l(),i("div",ye,[s("h3",we,n(t.__("Nothing to display...")),1)])):O("",!0)])])])}const Pe=g(Z,[["render",ge]]),Ce={props:["popup"],components:{nsPosPendingOrders:Pe},methods:{__:_,popupResolver:j,popupCloser:k,searchOrder(r){C.get(`/api/crud/${this.active}?search=${r}`).subscribe(e=>{this.orders=e.data})},setActiveTab(r){this.active=r,this.loadOrderFromType(r)},openOrder(r){POS.loadOrder(r.id),this.popup.close()},loadOrderFromType(r){C.get(`/api/crud/${r}`).subscribe(e=>{this.orders=e.data})},previewOrder(r){new Promise((a,b)=>{Popup.show(X,{order:r,resolve:a,reject:b})}).then(a=>{this.proceedOpenOrder(r)},a=>a)},printOrder(r){POS.print.process(r.id,"sale")},proceedOpenOrder(r){if(POS.products.getValue().length>0)return Popup.show(V,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:a=>{a&&this.openOrder(r)}});this.openOrder(r)}},data(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted(){this.loadOrderFromType(this.active),this.popupCloser()}},ke={class:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},Te={class:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},$e={class:"font-semibold"},Fe={class:"p-2 flex overflow-hidden flex-auto ns-box-body"},je={class:"p-2 flex justify-between ns-box-footer border-t"},Se=s("div",null,null,-1);function Ve(r,e,a,b,p,t){const d=v("ns-close-button"),c=v("ns-pos-pending-orders"),f=v("ns-tabs-item"),m=v("ns-tabs"),T=v("ns-button");return l(),i("div",ke,[s("div",Te,[s("h3",$e,n(t.__("Orders")),1),s("div",null,[u(d,{onClick:e[0]||(e[0]=o=>a.popup.close())})])]),s("div",Fe,[u(m,{active:p.active,onChangeTab:e[13]||(e[13]=o=>t.setActiveTab(o))},{default:x(()=>[u(f,{identifier:"ns.hold-orders",label:t.__("On Hold"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[1]||(e[1]=o=>t.searchOrder(o)),onPreviewOrder:e[2]||(e[2]=o=>t.previewOrder(o)),onPrintOrder:e[3]||(e[3]=o=>t.printOrder(o)),onProceedOpenOrder:e[4]||(e[4]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"]),u(f,{identifier:"ns.unpaid-orders",label:t.__("Unpaid"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[5]||(e[5]=o=>t.searchOrder(o)),onPreviewOrder:e[6]||(e[6]=o=>t.previewOrder(o)),onPrintOrder:e[7]||(e[7]=o=>t.printOrder(o)),onProceedOpenOrder:e[8]||(e[8]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"]),u(f,{identifier:"ns.partially-paid-orders",label:t.__("Partially Paid"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[9]||(e[9]=o=>t.searchOrder(o)),onPreviewOrder:e[10]||(e[10]=o=>t.previewOrder(o)),onPrintOrder:e[11]||(e[11]=o=>t.printOrder(o)),onProceedOpenOrder:e[12]||(e[12]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"])]),_:1},8,["active"])]),s("div",je,[Se,s("div",null,[u(T,{onClick:e[14]||(e[14]=o=>a.popup.close()),type:"info"},{default:x(()=>[h(n(t.__("Close")),1)]),_:1})])])])}const Le=g(Ce,[["render",Ve]]),Ae={name:"ns-pos-pending-orders-button",methods:{__:_,openPendingOrdersPopup(){S.show(Le)}}},Be={class:"ns-button default"},Ne=s("i",{class:"mr-1 text-xl lar la-hand-pointer"},null,-1);function Ue(r,e,a,b,p,t){return l(),i("div",Be,[s("button",{onClick:e[0]||(e[0]=d=>t.openPendingOrdersPopup()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[Ne,s("span",null,n(t.__("Orders")),1)])])}const Me=g(Ae,[["render",Ue]]);export{Me as default}; +import{a as C,n as P,g as k,v as $,w as F,p as j,P as S}from"./bootstrap-8be442b1.js";import{n as V}from"./ns-prompt-popup-100414c5.js";import{_,n as L}from"./currency-f8bd78d1.js";import{_ as g}from"./_plugin-vue_export-helper-c27b6911.js";import{r as v,o as l,c as i,a as s,i as h,t as n,e as O,f as u,F as y,b as w,w as x,B as A}from"./runtime-core.esm-bundler-b48de70a.js";const B={data(){return{products:[],isLoading:!1}},props:["popup"],computed:{order(){return this.popup.params.order}},mounted(){this.loadProducts()},methods:{__:_,nsCurrency:L,close(){this.popup.params.reject(!1),this.popup.close()},loadProducts(){this.isLoading=!0;const r=this.popup.params.order.id;C.get(`/api/orders/${r}/products`).subscribe(e=>{this.isLoading=!1,this.products=e})},openOrder(){this.popup.close(),this.popup.params.resolve(this.order)}}},N={class:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},U={class:"p-2 flex justify-between text-primary items-center border-b ns-box-header"},D={class:"font-semibold"},H={key:0},q={class:"flex-auto p-2 overflow-y-auto ns-box-body"},K={key:0,class:"flex-auto relative"},E={class:"h-full w-full flex items-center justify-center"},M={class:"flex-col border-b border-info-primary py-2"},R={class:"title font-semibold text-primary flex justify-between"},Y={class:"text-sm text-primary"},z={class:"flex justify-end p-2 border-t ns-box-footer"},G={class:"px-1"},I={class:"-mx-2 flex"},J={class:"px-1"},Q={class:"px-1"};function W(r,e,a,b,p,t){const d=v("ns-close-button"),c=v("ns-spinner"),f=v("ns-button");return l(),i("div",N,[s("div",U,[s("h3",D,[h(n(t.__("Products"))+" — "+n(t.order.code)+" ",1),t.order.title?(l(),i("span",H,"("+n(t.order.title)+")",1)):O("",!0)]),s("div",null,[u(d,{onClick:e[0]||(e[0]=m=>t.close())})])]),s("div",q,[p.isLoading?(l(),i("div",K,[s("div",E,[u(c)])])):O("",!0),p.isLoading?O("",!0):(l(!0),i(y,{key:1},w(p.products,m=>(l(),i("div",{class:"item",key:m.id},[s("div",M,[s("div",R,[s("span",null,n(m.name)+" (x"+n(m.quantity)+")",1),s("span",null,n(t.nsCurrency(r.price)),1)]),s("div",Y,[s("ul",null,[s("li",null,n(t.__("Unit"))+" : "+n(m.unit.name),1)])])])]))),128))]),s("div",z,[s("div",G,[s("div",I,[s("div",J,[u(f,{onClick:e[1]||(e[1]=m=>t.openOrder()),type:"info"},{default:x(()=>[h(n(t.__("Open")),1)]),_:1})]),s("div",Q,[u(f,{onClick:e[2]||(e[2]=m=>t.close()),type:"error"},{default:x(()=>[h(n(t.__("Close")),1)]),_:1})])])])])])}const X=g(B,[["render",W]]),Z={props:["orders"],data(){return{searchField:"",columns:{rightColumn:[],leftColumn:[]}}},watch:{orders(){this.$nextTick(()=>{P.doAction("ns-pos-pending-orders-refreshed",this.orders.map(r=>({order:r,dom:document.querySelector(`[data-order-id="${r.id}"]`)})))})}},mounted(){this.columns.leftColumn=P.applyFilters("ns-pending-orders-left-column",[{label:_("Code"),value:r=>r.code},{label:_("Cashier"),value:r=>r.user_username},{label:_("Total"),value:r=>r.total},{label:_("Tendered"),value:r=>r.tendered}]),this.columns.rightColumn=P.applyFilters("ns-pending-orders-right-column",[{label:_("Customer"),value:r=>`${r.customer_first_name} ${r.customer_last_name}`},{label:_("Date"),value:r=>r.created_at},{label:_("Type"),value:r=>r.type}]),this.popupCloser()},name:"ns-pos-pending-order",methods:{__:_,popupCloser:k,previewOrder(r){this.$emit("previewOrder",r)},proceedOpenOrder(r){this.$emit("proceedOpenOrder",r)},searchOrder(){this.$emit("searchOrder",this.searchField)},printOrder(r){this.$emit("printOrder",r)}}},ee={class:"flex flex-auto flex-col overflow-hidden"},se={class:"p-1"},re={class:"flex rounded border-2 input-group info"},te=s("i",{class:"las la-search"},null,-1),oe={class:"mr-1 hidden md:visible"},ne={class:"overflow-y-auto flex flex-auto"},de={class:"flex p-2 flex-auto flex-col overflow-y-auto"},le=["data-order-id"],ie={class:"text-primary"},ae={class:"px-2"},pe={class:"flex flex-wrap -mx-4"},ce={class:"w-full md:w-1/2 px-2"},ue={class:"w-full md:w-1/2 px-2"},_e={class:"flex justify-end w-full mt-2"},fe={class:"flex rounded-lg overflow-hidden ns-buttons"},me=["onClick"],he=s("i",{class:"las la-lock-open"},null,-1),ve=["onClick"],xe=s("i",{class:"las la-eye"},null,-1),be=["onClick"],Oe=s("i",{class:"las la-print"},null,-1),ye={key:0,class:"h-full v-full items-center justify-center flex"},we={class:"text-semibold text-primary"};function ge(r,e,a,b,p,t){return l(),i("div",ee,[s("div",se,[s("div",re,[A(s("input",{onKeyup:e[0]||(e[0]=F(d=>t.searchOrder(),["enter"])),"onUpdate:modelValue":e[1]||(e[1]=d=>p.searchField=d),type:"text",class:"p-2 outline-none flex-auto"},null,544),[[$,p.searchField]]),s("button",{onClick:e[2]||(e[2]=d=>t.searchOrder()),class:"w-16 md:w-24"},[te,s("span",oe,n(t.__("Search")),1)])])]),s("div",ne,[s("div",de,[(l(!0),i(y,null,w(a.orders,d=>(l(),i("div",{"data-order-id":d.id,class:"border-b ns-box-body w-full py-2 ns-order-line",key:d.id},[s("h3",ie,n(d.title||"Untitled Order"),1),s("div",ae,[s("div",pe,[s("div",ce,[(l(!0),i(y,null,w(p.columns.leftColumn,(c,f)=>(l(),i("p",{key:f,class:"text-sm text-primary"},[s("strong",null,n(c.label),1),h(" : "+n(c.value(d)),1)]))),128))]),s("div",ue,[(l(!0),i(y,null,w(p.columns.rightColumn,(c,f)=>(l(),i("p",{key:f,class:"text-sm text-primary"},[s("strong",null,n(c.label),1),h(" : "+n(c.value(d)),1)]))),128))])])]),s("div",_e,[s("div",fe,[s("button",{onClick:c=>t.proceedOpenOrder(d),class:"info outline-none px-2 py-1"},[he,h(" "+n(t.__("Open")),1)],8,me),s("button",{onClick:c=>t.previewOrder(d),class:"success outline-none px-2 py-1"},[xe,h(" "+n(t.__("Products")),1)],8,ve),s("button",{onClick:c=>t.printOrder(d),class:"warning outline-none px-2 py-1"},[Oe,h(" "+n(t.__("Print")),1)],8,be)])])],8,le))),128)),a.orders.length===0?(l(),i("div",ye,[s("h3",we,n(t.__("Nothing to display...")),1)])):O("",!0)])])])}const Pe=g(Z,[["render",ge]]),Ce={props:["popup"],components:{nsPosPendingOrders:Pe},methods:{__:_,popupResolver:j,popupCloser:k,searchOrder(r){C.get(`/api/crud/${this.active}?search=${r}`).subscribe(e=>{this.orders=e.data})},setActiveTab(r){this.active=r,this.loadOrderFromType(r)},openOrder(r){POS.loadOrder(r.id),this.popup.close()},loadOrderFromType(r){C.get(`/api/crud/${r}`).subscribe(e=>{this.orders=e.data})},previewOrder(r){new Promise((a,b)=>{Popup.show(X,{order:r,resolve:a,reject:b})}).then(a=>{this.proceedOpenOrder(r)},a=>a)},printOrder(r){POS.print.process(r.id,"sale")},proceedOpenOrder(r){if(POS.products.getValue().length>0)return Popup.show(V,{title:"Confirm Your Action",message:"The cart is not empty. Opening an order will clear your cart would you proceed ?",onAction:a=>{a&&this.openOrder(r)}});this.openOrder(r)}},data(){return{active:"ns.hold-orders",searchField:"",orders:[]}},mounted(){this.loadOrderFromType(this.active),this.popupCloser()}},ke={class:"shadow-lg ns-box w-6/7-screen md:w-3/5-screen lg:w-2/5-screen h-6/7-screen flex flex-col overflow-hidden"},Te={class:"p-2 flex justify-between text-primary items-center ns-box-header border-b"},$e={class:"font-semibold"},Fe={class:"p-2 flex overflow-hidden flex-auto ns-box-body"},je={class:"p-2 flex justify-between ns-box-footer border-t"},Se=s("div",null,null,-1);function Ve(r,e,a,b,p,t){const d=v("ns-close-button"),c=v("ns-pos-pending-orders"),f=v("ns-tabs-item"),m=v("ns-tabs"),T=v("ns-button");return l(),i("div",ke,[s("div",Te,[s("h3",$e,n(t.__("Orders")),1),s("div",null,[u(d,{onClick:e[0]||(e[0]=o=>a.popup.close())})])]),s("div",Fe,[u(m,{active:p.active,onChangeTab:e[13]||(e[13]=o=>t.setActiveTab(o))},{default:x(()=>[u(f,{identifier:"ns.hold-orders",label:t.__("On Hold"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[1]||(e[1]=o=>t.searchOrder(o)),onPreviewOrder:e[2]||(e[2]=o=>t.previewOrder(o)),onPrintOrder:e[3]||(e[3]=o=>t.printOrder(o)),onProceedOpenOrder:e[4]||(e[4]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"]),u(f,{identifier:"ns.unpaid-orders",label:t.__("Unpaid"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[5]||(e[5]=o=>t.searchOrder(o)),onPreviewOrder:e[6]||(e[6]=o=>t.previewOrder(o)),onPrintOrder:e[7]||(e[7]=o=>t.printOrder(o)),onProceedOpenOrder:e[8]||(e[8]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"]),u(f,{identifier:"ns.partially-paid-orders",label:t.__("Partially Paid"),padding:"p-0",class:"flex flex-col overflow-hidden"},{default:x(()=>[u(c,{orders:p.orders,onSearchOrder:e[9]||(e[9]=o=>t.searchOrder(o)),onPreviewOrder:e[10]||(e[10]=o=>t.previewOrder(o)),onPrintOrder:e[11]||(e[11]=o=>t.printOrder(o)),onProceedOpenOrder:e[12]||(e[12]=o=>t.proceedOpenOrder(o))},null,8,["orders"])]),_:1},8,["label"])]),_:1},8,["active"])]),s("div",je,[Se,s("div",null,[u(T,{onClick:e[14]||(e[14]=o=>a.popup.close()),type:"info"},{default:x(()=>[h(n(t.__("Close")),1)]),_:1})])])])}const Le=g(Ce,[["render",Ve]]),Ae={name:"ns-pos-pending-orders-button",methods:{__:_,openPendingOrdersPopup(){S.show(Le)}}},Be={class:"ns-button default"},Ne=s("i",{class:"mr-1 text-xl lar la-hand-pointer"},null,-1);function Ue(r,e,a,b,p,t){return l(),i("div",Be,[s("button",{onClick:e[0]||(e[0]=d=>t.openPendingOrdersPopup()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[Ne,s("span",null,n(t.__("Orders")),1)])])}const Me=g(Ae,[["render",Ue]]);export{Me as default}; diff --git a/public/build/assets/ns-pos-registers-button-4728e787.js b/public/build/assets/ns-pos-registers-button-4728e787.js new file mode 100644 index 000000000..1ddc6ff2c --- /dev/null +++ b/public/build/assets/ns-pos-registers-button-4728e787.js @@ -0,0 +1 @@ +import{F as O,g as V,p as C,b as y,a as w}from"./bootstrap-8be442b1.js";import{n as $,a as B}from"./ns-prompt-popup-100414c5.js";import{n as k,_ as p}from"./currency-f8bd78d1.js";import{_ as m}from"./_plugin-vue_export-helper-c27b6911.js";import{r as _,o as c,c as a,a as s,t as n,f,e as d,F as v,b as S,g as I,n as R,i as F}from"./runtime-core.esm-bundler-b48de70a.js";const H={components:{},props:["popup"],data(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new O,fields:[],isSubmitting:!1}},mounted(){this.title=this.popup.params.title,this.identifier=this.popup.params.identifier,this.register=this.popup.params.register,this.action=this.popup.params.action,this.register_id=this.popup.params.register_id,this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t}),this.loadFields(),this.popupCloser()},unmounted(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:V,nsCurrency:k,__:p,definedValue(t){this.amount=t},close(){this.popup.close()},loadFields(){this.loaded=!1,nsHttpClient.get(`/api/fields/${this.identifier}`).subscribe(t=>{this.loaded=!0,this.fields=t},t=>(this.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()))},submit(t){Popup.show($,{title:"Confirm Your Action",message:this.popup.params.confirmMessage||"Would you like to confirm your action.",onAction:e=>{e&&this.triggerSubmit()}})},triggerSubmit(){if(this.isSubmitting)return;this.isSubmitting=!0;const t=this.validation.extractFields(this.fields);t.amount=this.amount===""?0:this.amount,nsHttpClient.post(`/api/cash-registers/${this.action}/${this.register_id||this.settings.register.id}`,t).subscribe({next:e=>{this.popup.params.resolve(e),this.popup.close(),nsSnackBar.success(e.message).subscribe(),this.isSubmitting=!1},error:e=>{nsSnackBar.error(e.message).subscribe(),this.isSubmitting=!1}})}}},N={key:0,class:"shadow-lg w-95vw md:w-3/5-screen ns-box"},L={class:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},A={class:"font-semibold"},z={class:"p-2"},D={key:0,class:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},Q={class:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},T={class:"flex flex-col md:flex-row md:-mx-2"},U={class:"md:px-2 md:w-1/2 w-full"},Y={class:"md:px-2 md:w-1/2 w-full"},E={key:1,class:"h-full w-full flex items-center justify-center"};function q(t,e,o,u,r,i){const h=_("ns-close-button"),l=_("ns-numpad"),g=_("ns-field"),P=_("ns-spinner");return c(),a("div",null,[r.loaded?(c(),a("div",N,[s("div",L,[s("h3",A,n(r.title),1),s("div",null,[f(h,{onClick:e[0]||(e[0]=b=>i.close())})])]),s("div",z,[s("div",null,[r.register!==null?(c(),a("div",D,[s("span",null,n(i.__("Balance")),1),s("span",null,n(i.nsCurrency(r.register.balance)),1)])):d("",!0),s("div",Q,[s("span",null,n(i.__("Input")),1),s("span",null,n(i.nsCurrency(r.amount)),1)])]),s("div",T,[s("div",U,[f(l,{floating:!0,onNext:e[1]||(e[1]=b=>i.submit(b)),value:r.amount,onChanged:e[2]||(e[2]=b=>i.definedValue(b))},null,8,["value"])]),s("div",Y,[(c(!0),a(v,null,S(r.fields,(b,j)=>(c(),I(g,{field:b,key:j},null,8,["field"]))),128))])])])])):d("",!0),r.loaded?d("",!0):(c(),a("div",E,[f(P)]))])}const x=m(H,[["render",q]]),K={name:"ns-pos-cash-registers-popup",props:["popup"],components:{nsNumpad:B},data(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new O,amount:0,settings:null,settingsSubscription:null}},mounted(){this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t})},beforeDestroy(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:p,popupResolver:C,async selectRegister(t){if(t.status!=="closed")return y.error(p("Unable to open this register. Only closed register can be opened.")).subscribe();try{const e=await new Promise((o,u)=>{const r=p("Open Register : %s").replace("%s",t.name),i="open",h=t.id,l="ns.cash-registers-opening";Popup.show(x,{resolve:o,reject:u,title:r,identifier:l,register:t,action:i,register_id:h})});this.popupResolver(e)}catch(e){this.popup.reject(e)}},checkUsedRegister(){this.priorVerification=!1,w.get("/api/cash-registers/used").subscribe({next:t=>{this.popup.params.resolve(t),this.popup.close()},error:t=>{this.priorVerification=!0,y.error(t.message).subscribe(),this.loadRegisters()}})},loadRegisters(){this.hasLoadedRegisters=!1,w.get("/api/cash-registers").subscribe(t=>{this.registers=t,this.hasLoadedRegisters=!0})},getClass(t){switch(t.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}},M={key:0,class:"h-full w-full py-10 flex justify-center items-center"},W={class:"title p-2 border-b ns-box-header flex justify-between items-center"},G={class:"font-semibold"},J={key:0},X=["href"],Z={key:0,class:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},ee={key:1,class:"flex-auto overflow-y-auto"},se={class:"grid grid-cols-3"},te=["onClick"],ie=s("i",{class:"las la-cash-register text-6xl"},null,-1),re={class:"text-semibold text-center"},ne={class:"text-sm"},oe={key:0,class:"p-2 alert text-white"},le=["href"];function ce(t,e,o,u,r,i){const h=_("ns-spinner");return c(),a("div",null,[r.priorVerification===!1?(c(),a("div",M,[f(h,{size:"24",border:"8"})])):d("",!0),r.priorVerification?(c(),a("div",{key:1,id:"ns-pos-cash-registers-popup",class:R(["w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",r.priorVerification?"shadow-lg ns-box":""])},[s("div",W,[s("h3",G,n(i.__("Open The Cash Register")),1),r.settings?(c(),a("div",J,[s("a",{href:r.settings.urls.orders_url,class:"rounded-full border ns-close-button px-3 text-sm py-1"},n(i.__("Exit To Orders")),9,X)])):d("",!0)]),r.hasLoadedRegisters?d("",!0):(c(),a("div",Z,[f(h,{size:"16",border:"4"})])),r.hasLoadedRegisters?(c(),a("div",ee,[s("div",se,[(c(!0),a(v,null,S(r.registers,(l,g)=>(c(),a("div",{onClick:P=>i.selectRegister(l),class:R([i.getClass(l),"border flex items-center justify-center flex-col p-3"]),key:g},[ie,s("h3",re,n(l.name),1),s("span",ne,"("+n(l.status_label)+")",1)],10,te))),128))]),r.registers.length===0?(c(),a("div",oe,[F(n(i.__("Looks like there is no registers. At least one register is required to proceed."))+" — ",1),s("a",{class:"font-bold hover:underline",href:r.settings.urls.registers_url},n(i.__("Create Cash Register")),9,le)])):d("",!0)])):d("",!0)],2)):d("",!0)])}const ae=m(K,[["render",ce]]),ue={props:["popup"],data(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted(){this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t}),this.getHistory()},unmounted(){this.settingsSubscription.unsubscribe()},methods:{__:p,nsCurrency:k,popupResolver:C,closePopup(){this.popupResolver({status:"success"})},getHistory(){w.get(`/api/cash-registers/session-history/${this.settings.register.id}`).subscribe(t=>{this.histories=t,this.totalIn=this.histories.filter(e=>["register-opening","register-sale","register-cash-in"].includes(e.action)).map(e=>parseFloat(e.value)).reduce((e,o)=>e+o,0),this.totalOut=this.histories.filter(e=>["register-closing","register-refund","register-cash-out"].includes(e.action)).map(e=>parseFloat(e.value)).reduce((e,o)=>e+o,0)})}}},de={class:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},pe={id:"header",class:"p-2 flex justify-between items-center ns-box-header"},he={class:"font-bold"},ge={class:"flex w-full ns-box-body"},_e={class:"flex flex-auto"},fe={class:"w-full md:w-1/2 text-right bg-success-secondary text-white font-bold text-3xl p-3"},be={class:"w-full md:w-1/2 text-right bg-error-secondary text-white font-bold text-3xl p-3"},me={class:"flex flex-col overflow-y-auto h-120"},xe={class:"p-2 flex-auto"},ve={class:"flex-auto text-right p-2"},ye={class:"p-2 flex-auto"},we={class:"flex-auto text-right p-2"},Ce={class:"p-2 flex-auto"},ke={class:"flex-auto text-right p-2"},Se={class:"p-2 flex-auto"},Pe={class:"flex-auto text-right p-2"};function Re(t,e,o,u,r,i){const h=_("ns-close-button");return c(),a("div",de,[s("div",pe,[s("h3",he,n(i.__("Register History")),1),s("div",null,[f(h,{onClick:i.closePopup},null,8,["onClick"])])]),s("div",ge,[s("div",_e,[s("div",fe,n(i.nsCurrency(r.totalIn)),1),s("div",be,n(i.nsCurrency(r.totalOut)),1)])]),s("div",me,[(c(!0),a(v,null,S(r.histories,l=>(c(),a(v,null,[["register-sale","register-cash-in"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface success"},[s("div",xe,n(l.label),1),s("div",ve,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-opening"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface"},[s("div",ye,n(l.label),1),s("div",we,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-close"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface info"},[s("div",Ce,n(l.label),1),s("div",ke,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-refund","register-cash-out"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface error"},[s("div",Se,n(l.label),1),s("div",Pe,n(i.nsCurrency(l.value)),1)])):d("",!0)],64))),256))])])}const Oe=m(ue,[["render",Re]]),Ve={props:["popup"],mounted(){this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t}),this.popupCloser(),this.loadRegisterSummary()},beforeDestroy(){this.settingsSubscriber.unsubscribe()},data(){return{settings:null,settingsSubscriber:null,register:{}}},methods:{__:p,nsCurrency:k,popupResolver:C,popupCloser:V,loadRegisterSummary(){nsHttpClient.get(`/api/cash-registers/${this.settings.register.id}`).subscribe(t=>{this.register=t})},closePopup(){this.popupResolver({status:"error",button:"close_popup"})},async closeCashRegister(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Close Register"),action:"close",identifier:"ns.cash-registers-closing",register:t,resolve:o,reject:u})});POS.unset("register"),this.popupResolver({button:"close_register",...e})}catch(e){throw e}},async cashIn(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Cash In"),action:"register-cash-in",register:t,identifier:"ns.cash-registers-cashing",resolve:o,reject:u})});this.popupResolver({button:"close_register",...e})}catch(e){console.log({exception:e})}},async cashOut(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Cash Out"),action:"register-cash-out",register:t,identifier:"ns.cash-registers-cashout",resolve:o,reject:u})});this.popupResolver({button:"close_register",...e})}catch(e){throw e}},async historyPopup(t){try{const e=await new Promise((o,u)=>{Popup.show(Oe,{resolve:o,reject:u,register:t})})}catch(e){throw e}}}},je={class:"shadow-lg w-95vw md:w-3/5-screen lg:w-2/4-screen ns-box"},$e={class:"p-2 border-b ns-box-header flex items-center justify-between"},Be={key:0},Ie={class:"h-16 text-3xl elevation-surface info flex items-center justify-between px-3"},Fe={class:""},He={class:"font-bold"},Ne={class:"h-16 text-3xl elevation-surface success flex items-center justify-between px-3"},Le={class:""},Ae={class:"font-bold"},ze={key:1,class:"h-32 ns-box-body border-b py-1 flex items-center justify-center"},De={class:"grid grid-cols-2 text-primary"},Qe=s("i",{class:"las la-sign-out-alt text-6xl"},null,-1),Te={class:"text-xl font-bold"},Ue=s("i",{class:"las la-plus-circle text-6xl"},null,-1),Ye={class:"text-xl font-bold"},Ee=s("i",{class:"las la-minus-circle text-6xl"},null,-1),qe={class:"text-xl font-bold"},Ke=s("i",{class:"las la-history text-6xl"},null,-1),Me={class:"text-xl font-bold"};function We(t,e,o,u,r,i){const h=_("ns-close-button"),l=_("ns-spinner");return c(),a("div",je,[s("div",$e,[s("h3",null,n(i.__("Register Options")),1),s("div",null,[f(h,{onClick:e[0]||(e[0]=g=>i.closePopup())})])]),r.register.total_sale_amount!==void 0&&r.register.balance!==void 0?(c(),a("div",Be,[s("div",Ie,[s("span",Fe,n(i.__("Sales")),1),s("span",He,n(i.nsCurrency(r.register.total_sale_amount)),1)]),s("div",Ne,[s("span",Le,n(i.__("Balance")),1),s("span",Ae,n(i.nsCurrency(r.register.balance)),1)])])):d("",!0),r.register.total_sale_amount===void 0&&r.register.balance===void 0?(c(),a("div",ze,[s("div",null,[f(l,{border:"4",size:"16"})])])):d("",!0),s("div",De,[s("div",{onClick:e[1]||(e[1]=g=>i.closeCashRegister(r.register)),class:"border-r border-b py-4 ns-numpad-key info cursor-pointer px-2 flex items-center justify-center flex-col"},[Qe,s("h3",Te,n(i.__("Close")),1)]),s("div",{onClick:e[2]||(e[2]=g=>i.cashIn(r.register)),class:"ns-numpad-key success border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ue,s("h3",Ye,n(i.__("Cash In")),1)]),s("div",{onClick:e[3]||(e[3]=g=>i.cashOut(r.register)),class:"ns-numpad-key error border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ee,s("h3",qe,n(i.__("Cash Out")),1)]),s("div",{onClick:e[4]||(e[4]=g=>i.historyPopup(r.register)),class:"ns-numpad-key info border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ke,s("h3",Me,n(i.__("History")),1)])])])}const Ge=m(Ve,[["render",We]]),Je={data(){return{order:null,name:"",selectedRegister:null,orderSubscriber:null,settingsSubscriber:null}},watch:{},methods:{__:p,async openRegisterOptions(){try{(await new Promise((e,o)=>{Popup.show(Ge,{resolve:e,reject:o})})).button==="close_register"&&(delete this.settings.register,POS.settings.next(this.settings),POS.reset())}catch(t){Object.keys(t).length>0&&y.error(t.message).subscribe()}},registerInitialQueue(){POS.initialQueue.push(()=>new Promise(async(t,e)=>{try{const o=await new Promise((u,r)=>{if(this.settings.register===void 0)return Popup.show(ae,{resolve:u,reject:r});u({data:{register:this.settings.register}})});POS.set("register",o.data.register),this.setRegister(o.data.register),t(o)}catch(o){if(o===!1)return e({status:"error",message:p("You must choose a register before proceeding.")});e(o)}}))},setButtonName(){if(this.settings.register===void 0)return this.name=p("Cash Register");this.name=p("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister(t){if(t!==void 0){const e=POS.order.getValue();e.register_id=t.id,POS.order.next(e)}}},unmounted(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted(){this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe(t=>{this.order=t}),this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t,this.setRegister(this.settings.register),this.setButtonName()})}},Xe={class:"ns-button default"},Ze=s("i",{class:"mr-1 text-xl las la-cash-register"},null,-1);function es(t,e,o,u,r,i){return c(),a("div",Xe,[s("button",{onClick:e[0]||(e[0]=h=>i.openRegisterOptions()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[Ze,s("span",null,n(r.name),1)])])}const os=m(Je,[["render",es]]);export{os as default}; diff --git a/public/build/assets/ns-pos-registers-button-BtlrbZz2.js b/public/build/assets/ns-pos-registers-button-BtlrbZz2.js deleted file mode 100644 index aed4cd66f..000000000 --- a/public/build/assets/ns-pos-registers-button-BtlrbZz2.js +++ /dev/null @@ -1 +0,0 @@ -import{F as O,g as V,p as C,b as y,a as w}from"./bootstrap-CnLEEQCx.js";import{n as $,a as B}from"./ns-prompt-popup-DKRiwYBT.js";import{n as k,_ as p}from"./currency-lOMYG1Wf.js";import{_ as m}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as _,o as c,c as a,a as s,t as n,f,e as d,F as v,b as S,g as I,n as R,i as F}from"./runtime-core.esm-bundler-RT2b-_3S.js";const H={components:{},props:["popup"],data(){return{amount:0,title:null,identifier:null,settingsSubscription:null,settings:null,action:null,register:null,loaded:!1,register_id:null,validation:new O,fields:[],isSubmitting:!1}},mounted(){this.title=this.popup.params.title,this.identifier=this.popup.params.identifier,this.register=this.popup.params.register,this.action=this.popup.params.action,this.register_id=this.popup.params.register_id,this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t}),this.loadFields(),this.popupCloser()},unmounted(){this.settingsSubscription.unsubscribe()},methods:{popupCloser:V,nsCurrency:k,__:p,definedValue(t){this.amount=t},close(){this.popup.close()},loadFields(){this.loaded=!1,nsHttpClient.get(`/api/fields/${this.identifier}`).subscribe(t=>{this.loaded=!0,this.fields=t},t=>(this.loaded=!0,nsSnackBar.error(t.message,"OKAY",{duration:!1}).subscribe()))},submit(t){Popup.show($,{title:"Confirm Your Action",message:this.popup.params.confirmMessage||"Would you like to confirm your action.",onAction:e=>{e&&this.triggerSubmit()}})},triggerSubmit(){if(this.isSubmitting)return;this.isSubmitting=!0;const t=this.validation.extractFields(this.fields);t.amount=this.amount===""?0:this.amount,nsHttpClient.post(`/api/cash-registers/${this.action}/${this.register_id||this.settings.register.id}`,t).subscribe({next:e=>{this.popup.params.resolve(e),this.popup.close(),nsSnackBar.success(e.message).subscribe(),this.isSubmitting=!1},error:e=>{nsSnackBar.error(e.message).subscribe(),this.isSubmitting=!1}})}}},N={key:0,class:"shadow-lg w-95vw md:w-3/5-screen ns-box"},L={class:"border-b ns-box-header p-2 text-primary flex justify-between items-center"},A={class:"font-semibold"},z={class:"p-2"},D={key:0,class:"mb-2 p-3 elevation-surface font-bold border text-right flex justify-between"},Q={class:"mb-2 p-3 elevation-surface success border font-bold text-right flex justify-between"},T={class:"flex flex-col md:flex-row md:-mx-2"},U={class:"md:px-2 md:w-1/2 w-full"},Y={class:"md:px-2 md:w-1/2 w-full"},E={key:1,class:"h-full w-full flex items-center justify-center"};function q(t,e,o,u,r,i){const h=_("ns-close-button"),l=_("ns-numpad"),g=_("ns-field"),P=_("ns-spinner");return c(),a("div",null,[r.loaded?(c(),a("div",N,[s("div",L,[s("h3",A,n(r.title),1),s("div",null,[f(h,{onClick:e[0]||(e[0]=b=>i.close())})])]),s("div",z,[s("div",null,[r.register!==null?(c(),a("div",D,[s("span",null,n(i.__("Balance")),1),s("span",null,n(i.nsCurrency(r.register.balance)),1)])):d("",!0),s("div",Q,[s("span",null,n(i.__("Input")),1),s("span",null,n(i.nsCurrency(r.amount)),1)])]),s("div",T,[s("div",U,[f(l,{floating:!0,onNext:e[1]||(e[1]=b=>i.submit(b)),value:r.amount,onChanged:e[2]||(e[2]=b=>i.definedValue(b))},null,8,["value"])]),s("div",Y,[(c(!0),a(v,null,S(r.fields,(b,j)=>(c(),I(g,{field:b,key:j},null,8,["field"]))),128))])])])])):d("",!0),r.loaded?d("",!0):(c(),a("div",E,[f(P)]))])}const x=m(H,[["render",q]]),K={name:"ns-pos-cash-registers-popup",props:["popup"],components:{nsNumpad:B},data(){return{registers:[],priorVerification:!1,hasLoadedRegisters:!1,validation:new O,amount:0,settings:null,settingsSubscription:null}},mounted(){this.checkUsedRegister(),this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t})},beforeDestroy(){this.settingsSubscription.unsubscribe()},computed:{},methods:{__:p,popupResolver:C,async selectRegister(t){if(t.status!=="closed")return y.error(p("Unable to open this register. Only closed register can be opened.")).subscribe();try{const e=await new Promise((o,u)=>{const r=p("Open Register : %s").replace("%s",t.name),i="open",h=t.id;Popup.show(x,{resolve:o,reject:u,title:r,identifier:"ns.cash-registers-opening",register:t,action:i,register_id:h})});this.popupResolver(e)}catch(e){this.popup.reject(e)}},checkUsedRegister(){this.priorVerification=!1,w.get("/api/cash-registers/used").subscribe({next:t=>{this.popup.params.resolve(t),this.popup.close()},error:t=>{this.priorVerification=!0,y.error(t.message).subscribe(),this.loadRegisters()}})},loadRegisters(){this.hasLoadedRegisters=!1,w.get("/api/cash-registers").subscribe(t=>{this.registers=t,this.hasLoadedRegisters=!0})},getClass(t){switch(t.status){case"in-use":return"elevation-surface warning cursor-not-allowed";case"disabled":return"elevation-surface cursor-not-allowed";case"available":return"elevation-surface success"}return"elevation-surface hoverable cursor-pointer"}}},M={key:0,class:"h-full w-full py-10 flex justify-center items-center"},W={class:"title p-2 border-b ns-box-header flex justify-between items-center"},G={class:"font-semibold"},J={key:0},X=["href"],Z={key:0,class:"py-10 flex-auto overflow-y-auto flex items-center justify-center"},ee={key:1,class:"flex-auto overflow-y-auto"},se={class:"grid grid-cols-3"},te=["onClick"],ie=s("i",{class:"las la-cash-register text-6xl"},null,-1),re={class:"text-semibold text-center"},ne={class:"text-sm"},oe={key:0,class:"p-2 alert text-white"},le=["href"];function ce(t,e,o,u,r,i){const h=_("ns-spinner");return c(),a("div",null,[r.priorVerification===!1?(c(),a("div",M,[f(h,{size:"24",border:"8"})])):d("",!0),r.priorVerification?(c(),a("div",{key:1,id:"ns-pos-cash-registers-popup",class:R(["w-95vw md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen flex flex-col overflow-hidden",r.priorVerification?"shadow-lg ns-box":""])},[s("div",W,[s("h3",G,n(i.__("Open The Cash Register")),1),r.settings?(c(),a("div",J,[s("a",{href:r.settings.urls.orders_url,class:"rounded-full border ns-close-button px-3 text-sm py-1"},n(i.__("Exit To Orders")),9,X)])):d("",!0)]),r.hasLoadedRegisters?d("",!0):(c(),a("div",Z,[f(h,{size:"16",border:"4"})])),r.hasLoadedRegisters?(c(),a("div",ee,[s("div",se,[(c(!0),a(v,null,S(r.registers,(l,g)=>(c(),a("div",{onClick:P=>i.selectRegister(l),class:R([i.getClass(l),"border flex items-center justify-center flex-col p-3"]),key:g},[ie,s("h3",re,n(l.name),1),s("span",ne,"("+n(l.status_label)+")",1)],10,te))),128))]),r.registers.length===0?(c(),a("div",oe,[F(n(i.__("Looks like there is no registers. At least one register is required to proceed."))+" — ",1),s("a",{class:"font-bold hover:underline",href:r.settings.urls.registers_url},n(i.__("Create Cash Register")),9,le)])):d("",!0)])):d("",!0)],2)):d("",!0)])}const ae=m(K,[["render",ce]]),ue={props:["popup"],data(){return{totalIn:0,totalOut:0,settings:null,settingsSubscription:null,histories:[]}},mounted(){this.settingsSubscription=POS.settings.subscribe(t=>{this.settings=t}),this.getHistory()},unmounted(){this.settingsSubscription.unsubscribe()},methods:{__:p,nsCurrency:k,popupResolver:C,closePopup(){this.popupResolver({status:"success"})},getHistory(){w.get(`/api/cash-registers/session-history/${this.settings.register.id}`).subscribe(t=>{this.histories=t,this.totalIn=this.histories.filter(e=>["register-opening","register-sale","register-cash-in"].includes(e.action)).map(e=>parseFloat(e.value)).reduce((e,o)=>e+o,0),this.totalOut=this.histories.filter(e=>["register-closing","register-refund","register-cash-out"].includes(e.action)).map(e=>parseFloat(e.value)).reduce((e,o)=>e+o,0)})}}},de={class:"ns-box shadow-lg w-95vw md:w-4/6-screen lg:w-half overflow-hidden"},pe={id:"header",class:"p-2 flex justify-between items-center ns-box-header"},he={class:"font-bold"},ge={class:"flex w-full ns-box-body"},_e={class:"flex flex-auto"},fe={class:"w-full md:w-1/2 text-right bg-success-secondary text-white font-bold text-3xl p-3"},be={class:"w-full md:w-1/2 text-right bg-error-secondary text-white font-bold text-3xl p-3"},me={class:"flex flex-col overflow-y-auto h-120"},xe={class:"p-2 flex-auto"},ve={class:"flex-auto text-right p-2"},ye={class:"p-2 flex-auto"},we={class:"flex-auto text-right p-2"},Ce={class:"p-2 flex-auto"},ke={class:"flex-auto text-right p-2"},Se={class:"p-2 flex-auto"},Pe={class:"flex-auto text-right p-2"};function Re(t,e,o,u,r,i){const h=_("ns-close-button");return c(),a("div",de,[s("div",pe,[s("h3",he,n(i.__("Register History")),1),s("div",null,[f(h,{onClick:i.closePopup},null,8,["onClick"])])]),s("div",ge,[s("div",_e,[s("div",fe,n(i.nsCurrency(r.totalIn)),1),s("div",be,n(i.nsCurrency(r.totalOut)),1)])]),s("div",me,[(c(!0),a(v,null,S(r.histories,l=>(c(),a(v,null,[["register-sale","register-cash-in"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface success"},[s("div",xe,n(l.label),1),s("div",ve,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-opening"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface"},[s("div",ye,n(l.label),1),s("div",we,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-close"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface info"},[s("div",Ce,n(l.label),1),s("div",ke,n(i.nsCurrency(l.value)),1)])):d("",!0),["register-refund","register-cash-out"].includes(l.action)?(c(),a("div",{key:l.id,class:"flex border-b elevation-surface error"},[s("div",Se,n(l.label),1),s("div",Pe,n(i.nsCurrency(l.value)),1)])):d("",!0)],64))),256))])])}const Oe=m(ue,[["render",Re]]),Ve={props:["popup"],mounted(){this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t}),this.popupCloser(),this.loadRegisterSummary()},beforeDestroy(){this.settingsSubscriber.unsubscribe()},data(){return{settings:null,settingsSubscriber:null,register:{}}},methods:{__:p,nsCurrency:k,popupResolver:C,popupCloser:V,loadRegisterSummary(){nsHttpClient.get(`/api/cash-registers/${this.settings.register.id}`).subscribe(t=>{this.register=t})},closePopup(){this.popupResolver({status:"error",button:"close_popup"})},async closeCashRegister(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Close Register"),action:"close",identifier:"ns.cash-registers-closing",register:t,resolve:o,reject:u})});POS.unset("register"),this.popupResolver({button:"close_register",...e})}catch(e){throw e}},async cashIn(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Cash In"),action:"register-cash-in",register:t,identifier:"ns.cash-registers-cashing",resolve:o,reject:u})});this.popupResolver({button:"close_register",...e})}catch(e){console.log({exception:e})}},async cashOut(t){try{const e=await new Promise((o,u)=>{Popup.show(x,{title:p("Cash Out"),action:"register-cash-out",register:t,identifier:"ns.cash-registers-cashout",resolve:o,reject:u})});this.popupResolver({button:"close_register",...e})}catch(e){throw e}},async historyPopup(t){try{const e=await new Promise((o,u)=>{Popup.show(Oe,{resolve:o,reject:u,register:t})})}catch(e){throw e}}}},je={class:"shadow-lg w-95vw md:w-3/5-screen lg:w-2/4-screen ns-box"},$e={class:"p-2 border-b ns-box-header flex items-center justify-between"},Be={key:0},Ie={class:"h-16 text-3xl elevation-surface info flex items-center justify-between px-3"},Fe={class:""},He={class:"font-bold"},Ne={class:"h-16 text-3xl elevation-surface success flex items-center justify-between px-3"},Le={class:""},Ae={class:"font-bold"},ze={key:1,class:"h-32 ns-box-body border-b py-1 flex items-center justify-center"},De={class:"grid grid-cols-2 text-primary"},Qe=s("i",{class:"las la-sign-out-alt text-6xl"},null,-1),Te={class:"text-xl font-bold"},Ue=s("i",{class:"las la-plus-circle text-6xl"},null,-1),Ye={class:"text-xl font-bold"},Ee=s("i",{class:"las la-minus-circle text-6xl"},null,-1),qe={class:"text-xl font-bold"},Ke=s("i",{class:"las la-history text-6xl"},null,-1),Me={class:"text-xl font-bold"};function We(t,e,o,u,r,i){const h=_("ns-close-button"),l=_("ns-spinner");return c(),a("div",je,[s("div",$e,[s("h3",null,n(i.__("Register Options")),1),s("div",null,[f(h,{onClick:e[0]||(e[0]=g=>i.closePopup())})])]),r.register.total_sale_amount!==void 0&&r.register.balance!==void 0?(c(),a("div",Be,[s("div",Ie,[s("span",Fe,n(i.__("Sales")),1),s("span",He,n(i.nsCurrency(r.register.total_sale_amount)),1)]),s("div",Ne,[s("span",Le,n(i.__("Balance")),1),s("span",Ae,n(i.nsCurrency(r.register.balance)),1)])])):d("",!0),r.register.total_sale_amount===void 0&&r.register.balance===void 0?(c(),a("div",ze,[s("div",null,[f(l,{border:"4",size:"16"})])])):d("",!0),s("div",De,[s("div",{onClick:e[1]||(e[1]=g=>i.closeCashRegister(r.register)),class:"border-r border-b py-4 ns-numpad-key info cursor-pointer px-2 flex items-center justify-center flex-col"},[Qe,s("h3",Te,n(i.__("Close")),1)]),s("div",{onClick:e[2]||(e[2]=g=>i.cashIn(r.register)),class:"ns-numpad-key success border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ue,s("h3",Ye,n(i.__("Cash In")),1)]),s("div",{onClick:e[3]||(e[3]=g=>i.cashOut(r.register)),class:"ns-numpad-key error border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ee,s("h3",qe,n(i.__("Cash Out")),1)]),s("div",{onClick:e[4]||(e[4]=g=>i.historyPopup(r.register)),class:"ns-numpad-key info border-r border-b py-4 cursor-pointer px-2 flex items-center justify-center flex-col"},[Ke,s("h3",Me,n(i.__("History")),1)])])])}const Ge=m(Ve,[["render",We]]),Je={data(){return{order:null,name:"",selectedRegister:null,orderSubscriber:null,settingsSubscriber:null}},watch:{},methods:{__:p,async openRegisterOptions(){try{(await new Promise((e,o)=>{Popup.show(Ge,{resolve:e,reject:o})})).button==="close_register"&&(delete this.settings.register,POS.settings.next(this.settings),POS.reset())}catch(t){Object.keys(t).length>0&&y.error(t.message).subscribe()}},registerInitialQueue(){POS.initialQueue.push(()=>new Promise(async(t,e)=>{try{const o=await new Promise((u,r)=>{if(this.settings.register===void 0)return Popup.show(ae,{resolve:u,reject:r});u({data:{register:this.settings.register}})});POS.set("register",o.data.register),this.setRegister(o.data.register),t(o)}catch(o){if(o===!1)return e({status:"error",message:p("You must choose a register before proceeding.")});e(o)}}))},setButtonName(){if(this.settings.register===void 0)return this.name=p("Cash Register");this.name=p("Cash Register : {register}").replace("{register}",this.settings.register.name)},setRegister(t){if(t!==void 0){const e=POS.order.getValue();e.register_id=t.id,POS.order.next(e)}}},unmounted(){this.orderSubscriber.unsubscribe(),this.settingsSubscriber.unsubscribe()},mounted(){this.registerInitialQueue(),this.orderSubscriber=POS.order.subscribe(t=>{this.order=t}),this.settingsSubscriber=POS.settings.subscribe(t=>{this.settings=t,this.setRegister(this.settings.register),this.setButtonName()})}},Xe={class:"ns-button default"},Ze=s("i",{class:"mr-1 text-xl las la-cash-register"},null,-1);function es(t,e,o,u,r,i){return c(),a("div",Xe,[s("button",{onClick:e[0]||(e[0]=h=>i.openRegisterOptions()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[Ze,s("span",null,n(r.name),1)])])}const os=m(Je,[["render",es]]);export{os as default}; diff --git a/public/build/assets/ns-pos-reset-button-GSZiA4zh.js b/public/build/assets/ns-pos-reset-button-b79bfbdf.js similarity index 66% rename from public/build/assets/ns-pos-reset-button-GSZiA4zh.js rename to public/build/assets/ns-pos-reset-button-b79bfbdf.js index db1434880..9e18fed90 100644 --- a/public/build/assets/ns-pos-reset-button-GSZiA4zh.js +++ b/public/build/assets/ns-pos-reset-button-b79bfbdf.js @@ -1 +1 @@ -import{g as n,P as a}from"./bootstrap-CnLEEQCx.js";import{_ as e}from"./currency-lOMYG1Wf.js";import{_ as i}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{n as p}from"./ns-prompt-popup-DKRiwYBT.js";import"./index.es-Br67aBEV.js";import{o as l,c,a as t,t as m}from"./runtime-core.esm-bundler-RT2b-_3S.js";const u={name:"ns-pos-reset-button",mounted(){this.popupCloser()},methods:{__:e,popupCloser:n,reset(){a.show(p,{title:e("Confirm Your Action"),message:e("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:s=>{s&&POS.reset()}})}}},d={class:"ns-button error"},f=t("i",{class:"mr-1 text-xl las la-eraser"},null,-1);function _(s,o,x,h,P,r){return l(),c("div",d,[t("button",{onClick:o[0]||(o[0]=k=>r.reset()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[f,t("span",null,m(r.__("Reset")),1)])])}const $=i(u,[["render",_]]);export{$ as default}; +import{g as n,P as a}from"./bootstrap-8be442b1.js";import{_ as e}from"./currency-f8bd78d1.js";import{_ as i}from"./_plugin-vue_export-helper-c27b6911.js";import{n as p}from"./ns-prompt-popup-100414c5.js";import"./index.es-25aa42ee.js";import{o as l,c,a as t,t as m}from"./runtime-core.esm-bundler-b48de70a.js";const u={name:"ns-pos-reset-button",mounted(){this.popupCloser()},methods:{__:e,popupCloser:n,reset(){a.show(p,{title:e("Confirm Your Action"),message:e("The current order will be cleared. But not deleted if it's persistent. Would you like to proceed ?"),onAction:s=>{s&&POS.reset()}})}}},d={class:"ns-button error"},f=t("i",{class:"mr-1 text-xl las la-eraser"},null,-1);function _(s,o,x,h,P,r){return l(),c("div",d,[t("button",{onClick:o[0]||(o[0]=k=>r.reset()),class:"rounded shadow flex-shrink-0 h-12 flex items-center px-2 py-1 text-sm"},[f,t("span",null,m(r.__("Reset")),1)])])}const $=i(u,[["render",_]]);export{$ as default}; diff --git a/public/build/assets/ns-pos-shipping-popup-DbqQTrvM.js b/public/build/assets/ns-pos-shipping-popup-acf8319e.js similarity index 93% rename from public/build/assets/ns-pos-shipping-popup-DbqQTrvM.js rename to public/build/assets/ns-pos-shipping-popup-acf8319e.js index dff6ea865..30a728129 100644 --- a/public/build/assets/ns-pos-shipping-popup-DbqQTrvM.js +++ b/public/build/assets/ns-pos-shipping-popup-acf8319e.js @@ -1 +1 @@ -import{F as v,g as x,p as w,a as y}from"./bootstrap-CnLEEQCx.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as p,o as r,c as l,a as t,t as u,F as h,b,n as f,f as m,w as F,i as S}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./currency-lOMYG1Wf.js";const k={name:"ns-pos-shipping-popup",props:["popup"],computed:{activeTabFields(){if(this.tabs!==null){for(let s in this.tabs)if(this.tabs[s].active)return this.tabs[s].fields}return[]},useBillingInfo(){return this.tabs!==null?this.tabs.billing.fields[0].value:new Object},useShippingInfo(){return this.tabs!==null?this.tabs.shipping.fields[0].value:new Object}},unmounted(){this.orderSubscription.unsubscribe()},mounted(){this.orderSubscription=POS.order.subscribe(s=>this.order=s),this.popupCloser(),this.loadForm()},data(){return{tabs:null,orderSubscription:null,order:null,formValidation:new v}},watch:{useBillingInfo(s){s===1&&this.tabs.billing.fields.forEach(e=>{e.name!=="_use_customer_billing"&&(e.value=this.order.customer.billing?this.order.customer.billing[e.name]:e.value)})},useShippingInfo(s){s===1&&this.tabs.shipping.fields.forEach(e=>{e.name!=="_use_customer_shipping"&&(e.value=this.order.customer.shipping?this.order.customer.shipping[e.name]:e.value)})}},methods:{__,popupCloser:x,resolveIfQueued:w,submitInformations(){const s=this.formValidation.extractForm({tabs:this.tabs});for(let e in s.general)["shipping","shipping_rate"].includes(e)&&(s.general[e]=parseFloat(s.general[e]));this.order={...this.order,...s.general},delete s.general,delete s.shipping._use_customer_shipping,delete s.billing._use_customer_billing,this.order.addresses=s,POS.order.next(this.order),POS.refreshCart(),this.resolveIfQueued(!0)},closePopup(){this.resolveIfQueued(!1)},toggle(s){for(let e in this.tabs)this.tabs[e].active=!1;this.tabs[s].active=!0},loadForm(){y.get("/api/forms/ns.pos-addresses").subscribe(({tabs:s})=>{for(let e in s)e==="general"?s[e].fields.forEach(o=>{o.value=this.order[o.name]||""}):s[e].fields.forEach(o=>{o.value=this.order.addresses[e]?this.order.addresses[e][o.name]:""});this.tabs=this.formValidation.initializeTabs(s)})}}},V={class:"ns-box w-6/7-screen md:w-4/5-screen lg:w-3/5-screen h-6/7-screen md:h-4/5-screen shadow-lg flex flex-col overflow-hidden"},I={class:"p-2 border-b ns-box-header flex justify-between items-center"},B={class:"font-bold text-primary"},P={class:"tools"},j=t("i",{class:"las la-times"},null,-1),E=[j],O={class:"flex-auto ns-box-body p-2 overflow-y-auto ns-tab"},T={id:"tabs-container"},N={class:"header flex",style:{"margin-bottom":"-1px"}},Q=["onClick"],z={class:"border ns-tab-item"},D={class:"px-4"},H={class:"-mx-4 flex flex-wrap"},L={class:"p-2 flex justify-between border-t ns-box-footer"},R=t("div",null,null,-1);function q(s,e,o,A,d,n){const _=p("ns-field"),g=p("ns-button");return r(),l("div",V,[t("div",I,[t("h3",B,u(n.__("Shipping & Billing")),1),t("div",P,[t("button",{onClick:e[0]||(e[0]=i=>n.closePopup()),class:"ns-close-button rounded-full h-8 w-8 border items-center justify-center"},E)])]),t("div",O,[t("div",T,[t("div",N,[(r(!0),l(h,null,b(d.tabs,(i,a)=>(r(),l("div",{key:a,onClick:c=>n.toggle(a),class:f([i.active?"border-b-0 active":"inactive","tab rounded-tl rounded-tr border tab px-3 py-2 text-primary cursor-pointer"]),style:{"margin-right":"-1px"}},u(i.label),11,Q))),128))]),t("div",z,[t("div",D,[t("div",H,[(r(!0),l(h,null,b(n.activeTabFields,(i,a)=>(r(),l("div",{key:a,class:f("p-4 w-full md:w-1/2 lg:w-1/3")},[m(_,{onBlur:c=>d.formValidation.checkField(i),onChange:c=>d.formValidation.checkField(i),field:i},null,8,["onBlur","onChange","field"])]))),128))])])])])]),t("div",L,[R,t("div",null,[m(g,{onClick:e[1]||(e[1]=i=>n.submitInformations()),type:"info"},{default:F(()=>[S(u(n.__("Save")),1)]),_:1})])])])}const U=C(k,[["render",q]]);export{U as default}; +import{F as v,g as x,p as w,a as y}from"./bootstrap-8be442b1.js";import{_ as C}from"./_plugin-vue_export-helper-c27b6911.js";import{r as p,o as r,c as l,a as t,t as u,F as h,b,n as f,f as m,w as F,i as S}from"./runtime-core.esm-bundler-b48de70a.js";import"./currency-f8bd78d1.js";const k={name:"ns-pos-shipping-popup",props:["popup"],computed:{activeTabFields(){if(this.tabs!==null){for(let s in this.tabs)if(this.tabs[s].active)return this.tabs[s].fields}return[]},useBillingInfo(){return this.tabs!==null?this.tabs.billing.fields[0].value:new Object},useShippingInfo(){return this.tabs!==null?this.tabs.shipping.fields[0].value:new Object}},unmounted(){this.orderSubscription.unsubscribe()},mounted(){this.orderSubscription=POS.order.subscribe(s=>this.order=s),this.popupCloser(),this.loadForm()},data(){return{tabs:null,orderSubscription:null,order:null,formValidation:new v}},watch:{useBillingInfo(s){s===1&&this.tabs.billing.fields.forEach(e=>{e.name!=="_use_customer_billing"&&(e.value=this.order.customer.billing?this.order.customer.billing[e.name]:e.value)})},useShippingInfo(s){s===1&&this.tabs.shipping.fields.forEach(e=>{e.name!=="_use_customer_shipping"&&(e.value=this.order.customer.shipping?this.order.customer.shipping[e.name]:e.value)})}},methods:{__,popupCloser:x,resolveIfQueued:w,submitInformations(){const s=this.formValidation.extractForm({tabs:this.tabs});for(let e in s.general)["shipping","shipping_rate"].includes(e)&&(s.general[e]=parseFloat(s.general[e]));this.order={...this.order,...s.general},delete s.general,delete s.shipping._use_customer_shipping,delete s.billing._use_customer_billing,this.order.addresses=s,POS.order.next(this.order),POS.refreshCart(),this.resolveIfQueued(!0)},closePopup(){this.resolveIfQueued(!1)},toggle(s){for(let e in this.tabs)this.tabs[e].active=!1;this.tabs[s].active=!0},loadForm(){y.get("/api/forms/ns.pos-addresses").subscribe(({tabs:s})=>{for(let e in s)e==="general"?s[e].fields.forEach(o=>{o.value=this.order[o.name]||""}):s[e].fields.forEach(o=>{o.value=this.order.addresses[e]?this.order.addresses[e][o.name]:""});this.tabs=this.formValidation.initializeTabs(s)})}}},V={class:"ns-box w-6/7-screen md:w-4/5-screen lg:w-3/5-screen h-6/7-screen md:h-4/5-screen shadow-lg flex flex-col overflow-hidden"},I={class:"p-2 border-b ns-box-header flex justify-between items-center"},B={class:"font-bold text-primary"},P={class:"tools"},j=t("i",{class:"las la-times"},null,-1),E=[j],O={class:"flex-auto ns-box-body p-2 overflow-y-auto ns-tab"},T={id:"tabs-container"},N={class:"header flex",style:{"margin-bottom":"-1px"}},Q=["onClick"],z={class:"border ns-tab-item"},D={class:"px-4"},H={class:"-mx-4 flex flex-wrap"},L={class:"p-2 flex justify-between border-t ns-box-footer"},R=t("div",null,null,-1);function q(s,e,o,A,d,n){const _=p("ns-field"),g=p("ns-button");return r(),l("div",V,[t("div",I,[t("h3",B,u(n.__("Shipping & Billing")),1),t("div",P,[t("button",{onClick:e[0]||(e[0]=i=>n.closePopup()),class:"ns-close-button rounded-full h-8 w-8 border items-center justify-center"},E)])]),t("div",O,[t("div",T,[t("div",N,[(r(!0),l(h,null,b(d.tabs,(i,a)=>(r(),l("div",{key:a,onClick:c=>n.toggle(a),class:f([i.active?"border-b-0 active":"inactive","tab rounded-tl rounded-tr border tab px-3 py-2 text-primary cursor-pointer"]),style:{"margin-right":"-1px"}},u(i.label),11,Q))),128))]),t("div",z,[t("div",D,[t("div",H,[(r(!0),l(h,null,b(n.activeTabFields,(i,a)=>(r(),l("div",{key:a,class:f("p-4 w-full md:w-1/2 lg:w-1/3")},[m(_,{onBlur:c=>d.formValidation.checkField(i),onChange:c=>d.formValidation.checkField(i),field:i},null,8,["onBlur","onChange","field"])]))),128))])])])])]),t("div",L,[R,t("div",null,[m(g,{onClick:e[1]||(e[1]=i=>n.submitInformations()),type:"info"},{default:F(()=>[S(u(n.__("Save")),1)]),_:1})])])])}const U=C(k,[["render",q]]);export{U as default}; diff --git a/public/build/assets/ns-print-label-Ba0cSQu9.js b/public/build/assets/ns-print-label-53077c3e.js similarity index 98% rename from public/build/assets/ns-print-label-Ba0cSQu9.js rename to public/build/assets/ns-print-label-53077c3e.js index ea6ce0e95..b4a79722d 100644 --- a/public/build/assets/ns-print-label-Ba0cSQu9.js +++ b/public/build/assets/ns-print-label-53077c3e.js @@ -1,4 +1,4 @@ -import{_ as x}from"./currency-lOMYG1Wf.js";import{m as P,r as y,o as n,c as l,a as t,C as h,n as k,F as u,b as p,t as o,e as a,B as S,f as v,w as g,i as C,g as w}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{v as $}from"./bootstrap-CnLEEQCx.js";import{_ as U}from"./_plugin-vue_export-helper-DlAUqK2U.js";const F=defineComponent({name:"ns-print-label-settings",props:["popup"],template:` +import{_ as x}from"./currency-f8bd78d1.js";import{m as P,r as y,o as n,c as l,a as t,C as h,n as k,F as u,b as p,t as o,e as a,B as S,f as v,w as g,i as C,g as w}from"./runtime-core.esm-bundler-b48de70a.js";import{v as $}from"./bootstrap-8be442b1.js";import{_ as U}from"./_plugin-vue_export-helper-c27b6911.js";const F=defineComponent({name:"ns-print-label-settings",props:["popup"],template:`
diff --git a/public/build/assets/ns-procurement-ZlaTCRbQ.js b/public/build/assets/ns-procurement-791c80fe.js similarity index 97% rename from public/build/assets/ns-procurement-ZlaTCRbQ.js rename to public/build/assets/ns-procurement-791c80fe.js index 55049b34b..61ff1caf9 100644 --- a/public/build/assets/ns-procurement-ZlaTCRbQ.js +++ b/public/build/assets/ns-procurement-791c80fe.js @@ -1 +1 @@ -import{F as L,b as x,a as g,B as q,d as E,T as N,G as j,P as w,v as U,i as B}from"./bootstrap-CnLEEQCx.js";import R from"./manage-products-rGV6ZKw4.js";import{_ as c,n as D}from"./currency-lOMYG1Wf.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as C,o as l,c as u,a as r,t as d,F as v,b as y,g as I,f as F,w as M,i as T,m as K,h as G,J,u as V,e as m,n as k,B as P,A as S}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{c as z,b as A}from"./ns-prompt-popup-DKRiwYBT.js";import{s as H}from"./select-api-entities-Dz_g0XY5.js";import"./index.es-Br67aBEV.js";import"./join-array-DPKtuOQJ.js";const Q={name:"ns-procurement-product-options",props:["popup"],data(){return{validation:new L,fields:[],rawFields:[{label:c("Expiration Date"),name:"expiration_date",description:c("Define when that specific product should expire."),type:"datetimepicker"},{label:c("Barcode"),name:"barcode",description:c("Renders the automatically generated barcode."),type:"text",disabled:!0},{label:c("Tax Type"),name:"tax_type",description:c("Adjust how tax is calculated on the item."),type:"select",options:[{label:c("Inclusive"),value:"inclusive"},{label:c("Exclusive"),value:"exclusive"}]}]}},methods:{__:c,applyChanges(){if(this.validation.validateFields(this.fields)){const e=this.validation.extractFields(this.fields);return this.popup.params.resolve(e),this.popup.close()}return x.error(c("Unable to proceed. The form is not valid.")).subscribe()}},mounted(){const t=this.rawFields.map(e=>(e.name==="expiration_date"&&(e.value=this.popup.params.product.procurement.expiration_date),e.name==="tax_type"&&(e.value=this.popup.params.product.procurement.tax_type),e.name==="barcode"&&(e.value=this.popup.params.product.procurement.barcode),e));this.fields=this.validation.createFields(t)}},W={class:"ns-box shadow-lg w-6/7-screen md:w-5/7-screen lg:w-3/7-screen"},X={class:"p-2 border-b ns-box-header"},Y={class:"font-semibold"},Z={class:"p-2 border-b ns-box-body"},$={class:"p-2 flex justify-end ns-box-body"};function ee(t,e,n,o,s,i){const h=C("ns-field"),a=C("ns-button");return l(),u("div",W,[r("div",X,[r("h5",Y,d(i.__("Options")),1)]),r("div",Z,[(l(!0),u(v,null,y(s.fields,(p,b)=>(l(),I(h,{class:"w-full",field:p,key:b},null,8,["field"]))),128))]),r("div",$,[F(a,{onClick:e[0]||(e[0]=p=>i.applyChanges()),type:"info"},{default:M(()=>[T(d(i.__("Save")),1)]),_:1})])])}const te=O(Q,[["render",ee]]),re={class:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg bg-popup-surface"},se={class:"flex flex-col"},ie={class:"h-24 font-bold text-4xl text-primary flex justify-center items-center"},oe=K({__name:"ns-numpad-popup",props:["popup"],setup(t){let e=G("");const n=t,o=i=>{e.value=i},s=()=>{n.popup.params.resolve(e.value),n.popup.close()};return J(()=>{e.value=n.popup.params.value}),(i,h)=>{const a=C("ns-numpad-plus");return l(),u("div",re,[r("div",se,[r("div",ie,d(V(e)),1),F(a,{onChanged:h[0]||(h[0]=p=>o(p)),onNext:h[1]||(h[1]=p=>s()),value:V(e)},null,8,["value"])])])}}}),ne={name:"ns-procurement",mounted(){this.reloadEntities(),this.shouldPreventAccidentlRefreshSubscriber=this.shouldPreventAccidentalRefresh.subscribe({next:t=>{t?window.addEventListener("beforeunload",this.addAccidentalCloseListener):window.removeEventListener("beforeunload",this.addAccidentalCloseListener)}})},computed:{activeTab(){return this.validTabs.filter(t=>t.active).length>0?this.validTabs.filter(t=>t.active)[0]:!1}},data(){return{totalTaxValues:0,totalPurchasePrice:0,formValidation:new L,form:{},nsSnackBar:x,fields:[],searchResult:[],searchValue:"",debounceSearch:null,nsHttpClient:g,taxes:[],validTabs:[{label:c("Details"),identifier:"details",active:!0},{label:c("Products"),identifier:"products",active:!1}],reloading:!1,shouldPreventAccidentalRefresh:new q(!1),shouldPreventAccidentlRefreshSubscriber:null,showInfo:!1}},watch:{form:{handler(){this.formValidation.isFormUntouched(this.form)?this.shouldPreventAccidentalRefresh.next(!1):this.shouldPreventAccidentalRefresh.next(!0)},deep:!0},searchValue(t){t&&(clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.doSearch(t)},500))}},components:{nsManageProducts:R},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,nsCurrency:D,addAccidentalCloseListener(t){return t.preventDefault(),!0},async defineConversionOption(t){try{const e=this.form.products[t];if(e.procurement.unit_id===void 0)return E.error(c("An error has occured"),c("Select the procured unit first before selecting the conversion unit."),{actions:{learnMore:{label:c("Learn More"),onClick:o=>{console.log(o)}},close:{label:c("Close"),onClick:o=>{o.close()}}},duration:5e3});const n=await H(`/api/units/${e.procurement.unit_id}/siblings`,c("Convert to unit"),e.procurement.convert_unit_id||null,"select");e.procurement.convert_unit_id=n.values[0],e.procurement.convert_unit_label=n.labels[0]}catch(e){if(e!==!1)return x.error(e.message||c("An unexpected error has occured")).subscribe()}},computeTotal(){this.totalTaxValues=0,this.form.products.length>0&&(this.totalTaxValues=this.form.products.map(t=>t.procurement.tax_value).reduce((t,e)=>t+e)),this.totalPurchasePrice=0,this.form.products.length>0&&(this.totalPurchasePrice=this.form.products.map(t=>parseFloat(t.procurement.total_purchase_price)).reduce((t,e)=>t+e))},updateLine(t){const e=this.form.products[t],n=this.taxes.filter(o=>o.id===e.procurement.tax_group_id);if(parseFloat(e.procurement.purchase_price_edit)>0&&parseFloat(e.procurement.quantity)>0){if(n.length>0){const o=n[0].taxes.map(s=>N.getTaxValue(e.procurement.tax_type,e.procurement.purchase_price_edit,parseFloat(s.rate)));e.procurement.tax_value=o.reduce((s,i)=>s+i),e.procurement.tax_type==="inclusive"?(e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit)-e.procurement.tax_value,e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price)):(e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit)+e.procurement.tax_value,e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price))}else e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.tax_value=0;e.procurement.tax_value=e.procurement.tax_value*parseFloat(e.procurement.quantity),e.procurement.total_purchase_price=e.procurement.purchase_price*parseFloat(e.procurement.quantity)}this.computeTotal(),this.$forceUpdate()},fetchLastPurchasePrice(t){const e=this.form.products[t],n=e.unit_quantities.filter(o=>e.procurement.unit_id===o.unit_id);n.length>0&&(e.procurement.purchase_price_edit=n[0].last_purchase_price||0),this.updateLine(t)},switchTaxType(t,e){t.procurement.tax_type=t.procurement.tax_type==="inclusive"?"exclusive":"inclusive",this.updateLine(e)},doSearch(t){g.post("/api/procurements/products/search-product",{search:t}).subscribe(e=>{e.length===1?this.addProductList(e[0]):e.length>1?this.searchResult=e:x.error(c("No result match your query.")).subscribe()})},reloadEntities(){this.reloading=!0,j([g.get("/api/categories"),g.get("/api/products"),g.get(this.src),g.get("/api/taxes/groups")]).subscribe(t=>{this.reloading=!1,this.categories=t[0],this.products=t[1],this.taxes=t[3],this.form.general&&t[2].tabs.general.fieds.forEach((e,n)=>{e.value=this.form.tabs.general.fields[n].value||""}),this.form=Object.assign(JSON.parse(JSON.stringify(t[2])),this.form),this.form=this.formValidation.createForm(this.form),this.form.tabs&&this.form.tabs.general.fields.forEach((e,n)=>{e.options&&(e.options=t[2].tabs.general.fields[n].options)}),this.form.products.length===0&&(this.form.products=this.form.products.map(e=>(["gross_purchase_price","purchase_price_edit","tax_value","net_purchase_price","purchase_price","total_price","total_purchase_price","quantity","tax_group_id"].forEach(n=>{e[n]===void 0&&(e[n]=e[n]===void 0?0:e[n])}),e.$invalid=e.$invalid||!1,e.purchase_price_edit=e.purchase_price,{name:e.name,purchase_units:e.purchase_units,procurement:e,unit_quantities:e.unit_quantities||[]}))),this.$forceUpdate()})},setTabActive(t){this.validTabs.forEach(e=>e.active=!1),this.$forceUpdate(),this.$nextTick().then(()=>{t.active=!0})},addProductList(t){if(t.unit_quantities===void 0)return x.error(c("Unable to add product which doesn't unit quantities defined.")).subscribe();t.procurement=new Object,t.procurement.gross_purchase_price=0,t.procurement.purchase_price_edit=0,t.procurement.tax_value=0,t.procurement.net_purchase_price=0,t.procurement.purchase_price=0,t.procurement.total_price=0,t.procurement.total_purchase_price=0,t.procurement.quantity=1,t.procurement.expiration_date=null,t.procurement.tax_group_id=t.tax_group_id,t.procurement.tax_type=t.tax_type||"inclusive",t.procurement.unit_id=t.unit_quantities[0].unit_id,t.procurement.product_id=t.id,t.procurement.convert_unit_id=t.unit_quantities[0].convert_unit_id,t.procurement.procurement_id=null,t.procurement.$invalid=!1,this.searchResult=[],this.searchValue="",this.form.products.push(t)},submit(){if(this.form.products.length===0)return x.error(c("Unable to proceed, no product were provided."),c("OK")).subscribe();if(this.form.products.forEach(o=>{parseFloat(o.procurement.quantity)>=1?o.procurement.unit_id===0?o.procurement.$invalid=!0:o.procurement.$invalid=!1:o.procurement.$invalid=!0}),this.form.products.filter(o=>o.procurement.$invalid).length>0)return x.error(c("Unable to proceed, one or more product has incorrect values."),c("OK")).subscribe();if(this.formValidation.validateForm(this.form).length>0)return this.setTabActive(this.activeTab),x.error(c("Unable to proceed, the procurement form is not valid."),c("OK")).subscribe();if(this.submitUrl===void 0)return x.error(c("Unable to submit, no valid submit URL were provided."),c("OK")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form),products:this.form.products.map(o=>o.procurement)},n=w.show(z);g[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe({next:o=>{if(o.status==="success")return this.shouldPreventAccidentalRefresh.next(!1),document.location=this.returnUrl;n.close(),this.formValidation.enableForm(this.form)},error:o=>{n.close(),x.error(o.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),o.errors&&this.formValidation.triggerError(this.form,o.errors)}})},deleteProduct(t){this.form.products.splice(t,1),this.$forceUpdate()},handleGlobalChange(t){this.globallyChecked=t,this.rows.forEach(e=>e.$checked=t)},setProductOptions(t){new Promise((n,o)=>{w.show(te,{product:this.form.products[t],resolve:n,reject:o})}).then(n=>{for(let o in n)this.form.products[t].procurement[o]=n[o];this.updateLine(t)})},async selectUnitForProduct(t){try{const e=this.form.products[t],n=await new Promise((s,i)=>{w.show(A,{label:c("{product}: Purchase Unit").replace("{product}",e.name),description:c("The product will be procured on that unit."),value:e.unit_id,resolve:s,reject:i,options:e.unit_quantities.map(h=>({label:h.unit.name,value:h.unit.id}))})});e.procurement.unit_id=n;const o=e.unit_quantities.filter(s=>parseInt(s.unit_id)===+n);e.procurement.convert_unit_id=o[0].convert_unit_id||void 0,e.procurement.convert_unit_label=await new Promise((s,i)=>{e.procurement.convert_unit_id!==void 0?g.get(`/api/units/${e.procurement.convert_unit_id}`).subscribe({next:h=>{s(h.name)},error:h=>{s(c("Unkown Unit"))}}):s(c("N/A"))}),this.fetchLastPurchasePrice(t)}catch(e){console.log(e)}},async selectTax(t){try{const e=this.form.products[t],n=await new Promise((o,s)=>{w.show(A,{label:c("Choose Tax"),description:c("The tax will be assigned to the procured product."),resolve:o,reject:s,options:this.taxes.map(i=>({label:i.name,value:i.id}))})});e.procurement.tax_group_id=n,this.updateLine(t)}catch{}},async triggerKeyboard(t,e,n){try{const o=await new Promise((s,i)=>{w.show(oe,{value:t[e],resolve:s,reject:i})});t[e]=o,this.updateLine(n)}catch(o){console.log({exception:o})}},getSelectedTax(t){const e=this.form.products[t],n=this.taxes.filter(o=>!!(e.procurement.tax_group_id&&e.procurement.tax_group_id===o.id));return n.length===1?n[0].name:c("N/A")},getSelectedUnit(t){const e=this.form.products[t],o=e.unit_quantities.map(s=>s.unit).filter(s=>e.procurement.unit_id!==void 0?s.id===e.procurement.unit_id:!1);return o.length===1?o[0].name:c("N/A")},handleSavedEvent(t,e){t.data&&(e.options.push({label:t.data.entry.first_name,value:t.data.entry.id}),e.value=t.data.entry.id)}}},ae={class:"form flex-auto flex flex-col",id:"crud-form"},ce={class:"flex flex-col"},le={class:"flex justify-between items-center"},ue={for:"title",class:"font-bold my-2 text-primary"},de={for:"title",class:"text-sm my-2 -mx-1 flex text-primary"},pe={key:0,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},me={key:1,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},he={class:"px-1"},_e=["href"],fe=["disabled"],be=["disabled"],ve={key:0,class:"text-xs text-primary py-1"},xe={key:0,class:"rounded border-2 bg-info-primary border-info-tertiary flex"},ye=r("div",{class:"icon w-16 flex py-4 justify-center"},[r("i",{class:"las la-info-circle text-4xl"})],-1),ge={class:"text flex-auto py-4"},we={class:"font-bold text-lg"},ke=r("i",{class:"las la-hand-point-right"}," ",-1),Ce=r("i",{class:"las la-hand-point-right"}," ",-1),Pe={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},Te={class:"px-4 w-full"},Fe={id:"tabbed-card",class:"ns-tab"},Ue={id:"card-header",class:"flex flex-wrap"},Ve=["onClick"],Se={key:0,class:"ns-tab-item"},Ae={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Le={key:0,class:"-mx-4 flex flex-wrap"},Oe={key:1,class:"ns-tab-item"},qe={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Ee={class:"mb-2"},Ne={class:"input-group info flex border-2 rounded overflow-hidden"},je=["placeholder"],Be={class:"h-0"},Re={class:"shadow bg-floating-menu relative z-10"},De=["onClick"],Ie={class:"block font-bold text-primary"},Me={class:"block text-sm text-priamry"},Ke={class:"block text-sm text-primary"},Ge={class:"overflow-x-auto"},Je={class:"w-full ns-table"},ze={class:""},He={class:"flex"},Qe={class:"flex md:flex-row flex-col md:-mx-1"},We={class:"md:px-1"},Xe=["onClick"],Ye={class:"md:px-1"},Ze=["onClick"],$e={class:"md:px-1"},et=["onClick"],tt={class:"md:px-1"},rt=["onClick"],st={class:"md:px-1"},it=["onClick"],ot=["onClick"],nt={class:"flex justify-center"},at={key:0,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},ct={key:1,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},lt={class:"flex items-start"},ut={class:"input-group rounded border-2"},dt=["onChange","onUpdate:modelValue"],pt=["value"],mt={class:"flex items-start flex-col justify-end"},ht={class:"text-sm text-primary"},_t={class:"text-primary"},ft=["colspan"],bt={class:"p-2 border"},vt=["colspan"],xt={class:"p-2 border"};function yt(t,e,n,o,s,i){const h=C("ns-field");return l(),u("div",ae,[s.form.main?(l(),u(v,{key:0},[r("div",ce,[r("div",le,[r("label",ue,d(s.form.main.label||i.__("No title is provided")),1),r("div",de,[r("div",{class:"px-1",onClick:e[0]||(e[0]=a=>s.showInfo=!s.showInfo)},[s.showInfo?m("",!0):(l(),u("span",pe,d(i.__("Show Details")),1)),s.showInfo?(l(),u("span",me,d(i.__("Hide Details")),1)):m("",!0)]),r("div",he,[n.returnUrl?(l(),u("a",{key:0,href:n.returnUrl,class:"rounded-full ns-inset-button border px-2 py-1"},d(i.__("Go Back")),9,_e)):m("",!0)])])]),r("div",{class:k([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"","flex border-2 rounded input-group info overflow-hidden"])},[P(r("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>s.form.main.value=a),onKeypress:e[2]||(e[2]=a=>s.formValidation.checkField(s.form.main)),onBlur:e[3]||(e[3]=a=>s.formValidation.checkField(s.form.main)),onChange:e[4]||(e[4]=a=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:k([(s.form.main.disabled,""),"flex-auto outline-none h-10 px-2"])},null,42,fe),[[U,s.form.main.value]]),r("button",{disabled:s.form.main.disabled,onClick:e[5]||(e[5]=a=>i.submit()),class:"outline-none px-4 h-10 border-l"},[S(t.$slots,"save",{},()=>[T(d(i.__("Save")),1)])],8,be),r("button",{onClick:e[6]||(e[6]=a=>i.reloadEntities()),class:"outline-none px-4 h-10"},[r("i",{class:k([s.reloading?"animate animate-spin":"","las la-sync"])},null,2)])],2),s.form.main.description&&s.form.main.errors.length===0?(l(),u("p",ve,d(s.form.main.description),1)):m("",!0),(l(!0),u(v,null,y(s.form.main.errors,(a,p)=>(l(),u("p",{class:"text-xs py-1 text-error-primary",key:p},[r("span",null,[S(t.$slots,"error-required",{},()=>[T(d(a.identifier),1)])])]))),128))]),s.showInfo?(l(),u("div",xe,[ye,r("div",ge,[r("h3",we,d(i.__("Important Notes")),1),r("ul",null,[r("li",null,[ke,r("span",null,d(i.__("Stock Management Products.")),1)]),r("li",null,[Ce,r("span",null,d(i.__("Doesn't work with Grouped Product.")),1)])])])])):m("",!0),r("div",Pe,[r("div",Te,[r("div",Fe,[r("div",Ue,[(l(!0),u(v,null,y(s.validTabs,(a,p)=>(l(),u("div",{onClick:b=>i.setTabActive(a),class:k([a.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg text-primary"]),key:p},d(a.label),11,Ve))),128))]),i.activeTab.identifier==="details"?(l(),u("div",Se,[r("div",Ae,[s.form.tabs?(l(),u("div",Le,[(l(!0),u(v,null,y(s.form.tabs.general.fields,(a,p)=>(l(),u("div",{class:"flex px-4 w-full md:w-1/2 lg:w-1/3",key:p},[F(h,{onSaved:b=>i.handleSavedEvent(b,a),field:a},null,8,["onSaved","field"])]))),128))])):m("",!0)])])):m("",!0),i.activeTab.identifier==="products"?(l(),u("div",Oe,[r("div",qe,[r("div",Ee,[r("div",Ne,[P(r("input",{"onUpdate:modelValue":e[7]||(e[7]=a=>s.searchValue=a),type:"text",placeholder:i.__("SKU, Barcode, Name"),class:"flex-auto text-primary outline-none h-10 px-2"},null,8,je),[[U,s.searchValue]])]),r("div",Be,[r("div",Re,[(l(!0),u(v,null,y(s.searchResult,(a,p)=>(l(),u("div",{onClick:b=>i.addProductList(a),key:p,class:"cursor-pointer border border-b hover:bg-floating-menu-hover border-floating-menu-edge p-2 text-primary"},[r("span",Ie,d(a.name),1),r("span",Me,d(i.__("SKU"))+" : "+d(a.sku),1),r("span",Ke,d(i.__("Barcode"))+" : "+d(a.barcode),1)],8,De))),128))])])]),r("div",Ge,[r("table",Je,[r("thead",null,[r("tr",null,[(l(!0),u(v,null,y(s.form.columns,(a,p)=>(l(),u("td",{width:"200",key:p,class:"text-primary p-2 border"},d(a.label),1))),128))])]),r("tbody",null,[(l(!0),u(v,null,y(s.form.products,(a,p)=>(l(),u("tr",{key:p,class:k(a.procurement.$invalid?"error border-2 border-error-primary":"")},[(l(!0),u(v,null,y(s.form.columns,(b,_)=>(l(),u(v,null,[b.type==="name"?(l(),u("td",{key:_,width:"500",class:"p-2 text-primary border"},[r("span",ze,d(a.name),1),r("div",He,[r("div",Qe,[r("div",We,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.deleteProduct(p)},d(i.__("Delete")),9,Xe)]),r("div",Ye,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.setProductOptions(p)},d(i.__("Options")),9,Ze)]),r("div",$e,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.selectUnitForProduct(p)},d(i.__("Unit"))+": "+d(i.getSelectedUnit(p)),9,et)]),r("div",tt,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.selectTax(p)},d(i.__("Tax"))+": "+d(i.getSelectedTax(p)),9,rt)]),r("div",st,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.defineConversionOption(p)},d(i.__("Convert"))+": "+d(a.procurement.convert_unit_id?a.procurement.convert_unit_label:i.__("N/A")),9,it)])])])])):m("",!0),b.type==="text"?(l(),u("td",{key:_,onClick:f=>i.triggerKeyboard(a.procurement,_,p),class:"text-primary border cursor-pointer"},[r("div",nt,[["purchase_price_edit"].includes(_)?(l(),u("span",at,d(i.nsCurrency(a.procurement[_])),1)):m("",!0),["purchase_price_edit"].includes(_)?m("",!0):(l(),u("span",ct,d(a.procurement[_]),1))])],8,ot)):m("",!0),b.type==="custom_select"?(l(),u("td",{key:_,class:"p-2 text-primary border"},[r("div",lt,[r("div",ut,[P(r("select",{onChange:f=>i.updateLine(p),"onUpdate:modelValue":f=>a.procurement[_]=f,class:"p-2"},[(l(!0),u(v,null,y(b.options,f=>(l(),u("option",{key:f.value,value:f.value},d(f.label),9,pt))),128))],40,dt),[[B,a.procurement[_]]])])])])):m("",!0),b.type==="currency"?(l(),u("td",{key:_,class:"p-2 text-primary border"},[r("div",mt,[r("span",ht,d(i.nsCurrency(a.procurement[_])),1)])])):m("",!0)],64))),256))],2))),128)),r("tr",_t,[r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("tax_value")},null,8,ft),r("td",bt,d(i.nsCurrency(s.totalTaxValues)),1),r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("total_purchase_price")-(Object.keys(s.form.columns).indexOf("tax_value")+1)},null,8,vt),r("td",xt,d(i.nsCurrency(s.totalPurchasePrice)),1)])])])])])])):m("",!0)])])])],64)):m("",!0)])}const St=O(ne,[["render",yt]]);export{St as default}; +import{F as L,b as x,a as g,B as q,d as E,T as N,G as j,P as w,v as U,i as B}from"./bootstrap-8be442b1.js";import R from"./manage-products-bcbb478a.js";import{_ as c,n as D}from"./currency-f8bd78d1.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import{r as C,o as l,c as u,a as r,t as d,F as v,b as y,g as I,f as F,w as M,i as T,m as K,h as G,J,u as V,e as m,n as k,B as P,A as S}from"./runtime-core.esm-bundler-b48de70a.js";import{c as z,b as A}from"./ns-prompt-popup-100414c5.js";import{s as H}from"./select-api-entities-c72f4497.js";import"./index.es-25aa42ee.js";import"./join-array-4b30b096.js";const Q={name:"ns-procurement-product-options",props:["popup"],data(){return{validation:new L,fields:[],rawFields:[{label:c("Expiration Date"),name:"expiration_date",description:c("Define when that specific product should expire."),type:"datetimepicker"},{label:c("Barcode"),name:"barcode",description:c("Renders the automatically generated barcode."),type:"text",disabled:!0},{label:c("Tax Type"),name:"tax_type",description:c("Adjust how tax is calculated on the item."),type:"select",options:[{label:c("Inclusive"),value:"inclusive"},{label:c("Exclusive"),value:"exclusive"}]}]}},methods:{__:c,applyChanges(){if(this.validation.validateFields(this.fields)){const e=this.validation.extractFields(this.fields);return this.popup.params.resolve(e),this.popup.close()}return x.error(c("Unable to proceed. The form is not valid.")).subscribe()}},mounted(){const t=this.rawFields.map(e=>(e.name==="expiration_date"&&(e.value=this.popup.params.product.procurement.expiration_date),e.name==="tax_type"&&(e.value=this.popup.params.product.procurement.tax_type),e.name==="barcode"&&(e.value=this.popup.params.product.procurement.barcode),e));this.fields=this.validation.createFields(t)}},W={class:"ns-box shadow-lg w-6/7-screen md:w-5/7-screen lg:w-3/7-screen"},X={class:"p-2 border-b ns-box-header"},Y={class:"font-semibold"},Z={class:"p-2 border-b ns-box-body"},$={class:"p-2 flex justify-end ns-box-body"};function ee(t,e,n,o,s,i){const h=C("ns-field"),a=C("ns-button");return l(),u("div",W,[r("div",X,[r("h5",Y,d(i.__("Options")),1)]),r("div",Z,[(l(!0),u(v,null,y(s.fields,(p,b)=>(l(),I(h,{class:"w-full",field:p,key:b},null,8,["field"]))),128))]),r("div",$,[F(a,{onClick:e[0]||(e[0]=p=>i.applyChanges()),type:"info"},{default:M(()=>[T(d(i.__("Save")),1)]),_:1})])])}const te=O(Q,[["render",ee]]),re={class:"w-6/7-screen md:w-4/7-screen lg:w-3/7-screen flex flex-col shadow-lg bg-popup-surface"},se={class:"flex flex-col"},ie={class:"h-24 font-bold text-4xl text-primary flex justify-center items-center"},oe=K({__name:"ns-numpad-popup",props:["popup"],setup(t){let e=G("");const n=t,o=i=>{e.value=i},s=()=>{n.popup.params.resolve(e.value),n.popup.close()};return J(()=>{e.value=n.popup.params.value}),(i,h)=>{const a=C("ns-numpad-plus");return l(),u("div",re,[r("div",se,[r("div",ie,d(V(e)),1),F(a,{onChanged:h[0]||(h[0]=p=>o(p)),onNext:h[1]||(h[1]=p=>s()),value:V(e)},null,8,["value"])])])}}}),ne={name:"ns-procurement",mounted(){this.reloadEntities(),this.shouldPreventAccidentlRefreshSubscriber=this.shouldPreventAccidentalRefresh.subscribe({next:t=>{t?window.addEventListener("beforeunload",this.addAccidentalCloseListener):window.removeEventListener("beforeunload",this.addAccidentalCloseListener)}})},computed:{activeTab(){return this.validTabs.filter(t=>t.active).length>0?this.validTabs.filter(t=>t.active)[0]:!1}},data(){return{totalTaxValues:0,totalPurchasePrice:0,formValidation:new L,form:{},nsSnackBar:x,fields:[],searchResult:[],searchValue:"",debounceSearch:null,nsHttpClient:g,taxes:[],validTabs:[{label:c("Details"),identifier:"details",active:!0},{label:c("Products"),identifier:"products",active:!1}],reloading:!1,shouldPreventAccidentalRefresh:new q(!1),shouldPreventAccidentlRefreshSubscriber:null,showInfo:!1}},watch:{form:{handler(){this.formValidation.isFormUntouched(this.form)?this.shouldPreventAccidentalRefresh.next(!1):this.shouldPreventAccidentalRefresh.next(!0)},deep:!0},searchValue(t){t&&(clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.doSearch(t)},500))}},components:{nsManageProducts:R},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,nsCurrency:D,addAccidentalCloseListener(t){return t.preventDefault(),!0},async defineConversionOption(t){try{const e=this.form.products[t];if(e.procurement.unit_id===void 0)return E.error(c("An error has occured"),c("Select the procured unit first before selecting the conversion unit."),{actions:{learnMore:{label:c("Learn More"),onClick:o=>{console.log(o)}},close:{label:c("Close"),onClick:o=>{o.close()}}},duration:5e3});const n=await H(`/api/units/${e.procurement.unit_id}/siblings`,c("Convert to unit"),e.procurement.convert_unit_id||null,"select");e.procurement.convert_unit_id=n.values[0],e.procurement.convert_unit_label=n.labels[0]}catch(e){if(e!==!1)return x.error(e.message||c("An unexpected error has occured")).subscribe()}},computeTotal(){this.totalTaxValues=0,this.form.products.length>0&&(this.totalTaxValues=this.form.products.map(t=>t.procurement.tax_value).reduce((t,e)=>t+e)),this.totalPurchasePrice=0,this.form.products.length>0&&(this.totalPurchasePrice=this.form.products.map(t=>parseFloat(t.procurement.total_purchase_price)).reduce((t,e)=>t+e))},updateLine(t){const e=this.form.products[t],n=this.taxes.filter(o=>o.id===e.procurement.tax_group_id);if(parseFloat(e.procurement.purchase_price_edit)>0&&parseFloat(e.procurement.quantity)>0){if(n.length>0){const o=n[0].taxes.map(s=>N.getTaxValue(e.procurement.tax_type,e.procurement.purchase_price_edit,parseFloat(s.rate)));e.procurement.tax_value=o.reduce((s,i)=>s+i),e.procurement.tax_type==="inclusive"?(e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit)-e.procurement.tax_value,e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price)):(e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit)+e.procurement.tax_value,e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price))}else e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.tax_value=0;e.procurement.tax_value=e.procurement.tax_value*parseFloat(e.procurement.quantity),e.procurement.total_purchase_price=e.procurement.purchase_price*parseFloat(e.procurement.quantity)}this.computeTotal(),this.$forceUpdate()},fetchLastPurchasePrice(t){const e=this.form.products[t],n=e.unit_quantities.filter(o=>e.procurement.unit_id===o.unit_id);n.length>0&&(e.procurement.purchase_price_edit=n[0].last_purchase_price||0),this.updateLine(t)},switchTaxType(t,e){t.procurement.tax_type=t.procurement.tax_type==="inclusive"?"exclusive":"inclusive",this.updateLine(e)},doSearch(t){g.post("/api/procurements/products/search-product",{search:t}).subscribe(e=>{e.length===1?this.addProductList(e[0]):e.length>1?this.searchResult=e:x.error(c("No result match your query.")).subscribe()})},reloadEntities(){this.reloading=!0,j([g.get("/api/categories"),g.get("/api/products"),g.get(this.src),g.get("/api/taxes/groups")]).subscribe(t=>{this.reloading=!1,this.categories=t[0],this.products=t[1],this.taxes=t[3],this.form.general&&t[2].tabs.general.fieds.forEach((e,n)=>{e.value=this.form.tabs.general.fields[n].value||""}),this.form=Object.assign(JSON.parse(JSON.stringify(t[2])),this.form),this.form=this.formValidation.createForm(this.form),this.form.tabs&&this.form.tabs.general.fields.forEach((e,n)=>{e.options&&(e.options=t[2].tabs.general.fields[n].options)}),this.form.products.length===0&&(this.form.products=this.form.products.map(e=>(["gross_purchase_price","purchase_price_edit","tax_value","net_purchase_price","purchase_price","total_price","total_purchase_price","quantity","tax_group_id"].forEach(n=>{e[n]===void 0&&(e[n]=e[n]===void 0?0:e[n])}),e.$invalid=e.$invalid||!1,e.purchase_price_edit=e.purchase_price,{name:e.name,purchase_units:e.purchase_units,procurement:e,unit_quantities:e.unit_quantities||[]}))),this.$forceUpdate()})},setTabActive(t){this.validTabs.forEach(e=>e.active=!1),this.$forceUpdate(),this.$nextTick().then(()=>{t.active=!0})},addProductList(t){if(t.unit_quantities===void 0)return x.error(c("Unable to add product which doesn't unit quantities defined.")).subscribe();t.procurement=new Object,t.procurement.gross_purchase_price=0,t.procurement.purchase_price_edit=0,t.procurement.tax_value=0,t.procurement.net_purchase_price=0,t.procurement.purchase_price=0,t.procurement.total_price=0,t.procurement.total_purchase_price=0,t.procurement.quantity=1,t.procurement.expiration_date=null,t.procurement.tax_group_id=t.tax_group_id,t.procurement.tax_type=t.tax_type||"inclusive",t.procurement.unit_id=t.unit_quantities[0].unit_id,t.procurement.product_id=t.id,t.procurement.convert_unit_id=t.unit_quantities[0].convert_unit_id,t.procurement.procurement_id=null,t.procurement.$invalid=!1,this.searchResult=[],this.searchValue="",this.form.products.push(t)},submit(){if(this.form.products.length===0)return x.error(c("Unable to proceed, no product were provided."),c("OK")).subscribe();if(this.form.products.forEach(o=>{parseFloat(o.procurement.quantity)>=1?o.procurement.unit_id===0?o.procurement.$invalid=!0:o.procurement.$invalid=!1:o.procurement.$invalid=!0}),this.form.products.filter(o=>o.procurement.$invalid).length>0)return x.error(c("Unable to proceed, one or more product has incorrect values."),c("OK")).subscribe();if(this.formValidation.validateForm(this.form).length>0)return this.setTabActive(this.activeTab),x.error(c("Unable to proceed, the procurement form is not valid."),c("OK")).subscribe();if(this.submitUrl===void 0)return x.error(c("Unable to submit, no valid submit URL were provided."),c("OK")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form),products:this.form.products.map(o=>o.procurement)},n=w.show(z);g[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe({next:o=>{if(o.status==="success")return this.shouldPreventAccidentalRefresh.next(!1),document.location=this.returnUrl;n.close(),this.formValidation.enableForm(this.form)},error:o=>{n.close(),x.error(o.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),o.errors&&this.formValidation.triggerError(this.form,o.errors)}})},deleteProduct(t){this.form.products.splice(t,1),this.$forceUpdate()},handleGlobalChange(t){this.globallyChecked=t,this.rows.forEach(e=>e.$checked=t)},setProductOptions(t){new Promise((n,o)=>{w.show(te,{product:this.form.products[t],resolve:n,reject:o})}).then(n=>{for(let o in n)this.form.products[t].procurement[o]=n[o];this.updateLine(t)})},async selectUnitForProduct(t){try{const e=this.form.products[t],n=await new Promise((s,i)=>{w.show(A,{label:c("{product}: Purchase Unit").replace("{product}",e.name),description:c("The product will be procured on that unit."),value:e.unit_id,resolve:s,reject:i,options:e.unit_quantities.map(h=>({label:h.unit.name,value:h.unit.id}))})});e.procurement.unit_id=n;const o=e.unit_quantities.filter(s=>parseInt(s.unit_id)===+n);e.procurement.convert_unit_id=o[0].convert_unit_id||void 0,e.procurement.convert_unit_label=await new Promise((s,i)=>{e.procurement.convert_unit_id!==void 0?g.get(`/api/units/${e.procurement.convert_unit_id}`).subscribe({next:h=>{s(h.name)},error:h=>{s(c("Unkown Unit"))}}):s(c("N/A"))}),this.fetchLastPurchasePrice(t)}catch(e){console.log(e)}},async selectTax(t){try{const e=this.form.products[t],n=await new Promise((o,s)=>{w.show(A,{label:c("Choose Tax"),description:c("The tax will be assigned to the procured product."),resolve:o,reject:s,options:this.taxes.map(i=>({label:i.name,value:i.id}))})});e.procurement.tax_group_id=n,this.updateLine(t)}catch{}},async triggerKeyboard(t,e,n){try{const o=await new Promise((s,i)=>{w.show(oe,{value:t[e],resolve:s,reject:i})});t[e]=o,this.updateLine(n)}catch(o){console.log({exception:o})}},getSelectedTax(t){const e=this.form.products[t],n=this.taxes.filter(o=>!!(e.procurement.tax_group_id&&e.procurement.tax_group_id===o.id));return n.length===1?n[0].name:c("N/A")},getSelectedUnit(t){const e=this.form.products[t],o=e.unit_quantities.map(s=>s.unit).filter(s=>e.procurement.unit_id!==void 0?s.id===e.procurement.unit_id:!1);return o.length===1?o[0].name:c("N/A")},handleSavedEvent(t,e){t.data&&(e.options.push({label:t.data.entry.first_name,value:t.data.entry.id}),e.value=t.data.entry.id)}}},ae={class:"form flex-auto flex flex-col",id:"crud-form"},ce={class:"flex flex-col"},le={class:"flex justify-between items-center"},ue={for:"title",class:"font-bold my-2 text-primary"},de={for:"title",class:"text-sm my-2 -mx-1 flex text-primary"},pe={key:0,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},me={key:1,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},he={class:"px-1"},_e=["href"],fe=["disabled"],be=["disabled"],ve={key:0,class:"text-xs text-primary py-1"},xe={key:0,class:"rounded border-2 bg-info-primary border-info-tertiary flex"},ye=r("div",{class:"icon w-16 flex py-4 justify-center"},[r("i",{class:"las la-info-circle text-4xl"})],-1),ge={class:"text flex-auto py-4"},we={class:"font-bold text-lg"},ke=r("i",{class:"las la-hand-point-right"}," ",-1),Ce=r("i",{class:"las la-hand-point-right"}," ",-1),Pe={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},Te={class:"px-4 w-full"},Fe={id:"tabbed-card",class:"ns-tab"},Ue={id:"card-header",class:"flex flex-wrap"},Ve=["onClick"],Se={key:0,class:"ns-tab-item"},Ae={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Le={key:0,class:"-mx-4 flex flex-wrap"},Oe={key:1,class:"ns-tab-item"},qe={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Ee={class:"mb-2"},Ne={class:"input-group info flex border-2 rounded overflow-hidden"},je=["placeholder"],Be={class:"h-0"},Re={class:"shadow bg-floating-menu relative z-10"},De=["onClick"],Ie={class:"block font-bold text-primary"},Me={class:"block text-sm text-priamry"},Ke={class:"block text-sm text-primary"},Ge={class:"overflow-x-auto"},Je={class:"w-full ns-table"},ze={class:""},He={class:"flex"},Qe={class:"flex md:flex-row flex-col md:-mx-1"},We={class:"md:px-1"},Xe=["onClick"],Ye={class:"md:px-1"},Ze=["onClick"],$e={class:"md:px-1"},et=["onClick"],tt={class:"md:px-1"},rt=["onClick"],st={class:"md:px-1"},it=["onClick"],ot=["onClick"],nt={class:"flex justify-center"},at={key:0,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},ct={key:1,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},lt={class:"flex items-start"},ut={class:"input-group rounded border-2"},dt=["onChange","onUpdate:modelValue"],pt=["value"],mt={class:"flex items-start flex-col justify-end"},ht={class:"text-sm text-primary"},_t={class:"text-primary"},ft=["colspan"],bt={class:"p-2 border"},vt=["colspan"],xt={class:"p-2 border"};function yt(t,e,n,o,s,i){const h=C("ns-field");return l(),u("div",ae,[s.form.main?(l(),u(v,{key:0},[r("div",ce,[r("div",le,[r("label",ue,d(s.form.main.label||i.__("No title is provided")),1),r("div",de,[r("div",{class:"px-1",onClick:e[0]||(e[0]=a=>s.showInfo=!s.showInfo)},[s.showInfo?m("",!0):(l(),u("span",pe,d(i.__("Show Details")),1)),s.showInfo?(l(),u("span",me,d(i.__("Hide Details")),1)):m("",!0)]),r("div",he,[n.returnUrl?(l(),u("a",{key:0,href:n.returnUrl,class:"rounded-full ns-inset-button border px-2 py-1"},d(i.__("Go Back")),9,_e)):m("",!0)])])]),r("div",{class:k([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"","flex border-2 rounded input-group info overflow-hidden"])},[P(r("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>s.form.main.value=a),onKeypress:e[2]||(e[2]=a=>s.formValidation.checkField(s.form.main)),onBlur:e[3]||(e[3]=a=>s.formValidation.checkField(s.form.main)),onChange:e[4]||(e[4]=a=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:k([(s.form.main.disabled,""),"flex-auto outline-none h-10 px-2"])},null,42,fe),[[U,s.form.main.value]]),r("button",{disabled:s.form.main.disabled,onClick:e[5]||(e[5]=a=>i.submit()),class:"outline-none px-4 h-10 border-l"},[S(t.$slots,"save",{},()=>[T(d(i.__("Save")),1)])],8,be),r("button",{onClick:e[6]||(e[6]=a=>i.reloadEntities()),class:"outline-none px-4 h-10"},[r("i",{class:k([s.reloading?"animate animate-spin":"","las la-sync"])},null,2)])],2),s.form.main.description&&s.form.main.errors.length===0?(l(),u("p",ve,d(s.form.main.description),1)):m("",!0),(l(!0),u(v,null,y(s.form.main.errors,(a,p)=>(l(),u("p",{class:"text-xs py-1 text-error-primary",key:p},[r("span",null,[S(t.$slots,"error-required",{},()=>[T(d(a.identifier),1)])])]))),128))]),s.showInfo?(l(),u("div",xe,[ye,r("div",ge,[r("h3",we,d(i.__("Important Notes")),1),r("ul",null,[r("li",null,[ke,r("span",null,d(i.__("Stock Management Products.")),1)]),r("li",null,[Ce,r("span",null,d(i.__("Doesn't work with Grouped Product.")),1)])])])])):m("",!0),r("div",Pe,[r("div",Te,[r("div",Fe,[r("div",Ue,[(l(!0),u(v,null,y(s.validTabs,(a,p)=>(l(),u("div",{onClick:b=>i.setTabActive(a),class:k([a.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg text-primary"]),key:p},d(a.label),11,Ve))),128))]),i.activeTab.identifier==="details"?(l(),u("div",Se,[r("div",Ae,[s.form.tabs?(l(),u("div",Le,[(l(!0),u(v,null,y(s.form.tabs.general.fields,(a,p)=>(l(),u("div",{class:"flex px-4 w-full md:w-1/2 lg:w-1/3",key:p},[F(h,{onSaved:b=>i.handleSavedEvent(b,a),field:a},null,8,["onSaved","field"])]))),128))])):m("",!0)])])):m("",!0),i.activeTab.identifier==="products"?(l(),u("div",Oe,[r("div",qe,[r("div",Ee,[r("div",Ne,[P(r("input",{"onUpdate:modelValue":e[7]||(e[7]=a=>s.searchValue=a),type:"text",placeholder:i.__("SKU, Barcode, Name"),class:"flex-auto text-primary outline-none h-10 px-2"},null,8,je),[[U,s.searchValue]])]),r("div",Be,[r("div",Re,[(l(!0),u(v,null,y(s.searchResult,(a,p)=>(l(),u("div",{onClick:b=>i.addProductList(a),key:p,class:"cursor-pointer border border-b hover:bg-floating-menu-hover border-floating-menu-edge p-2 text-primary"},[r("span",Ie,d(a.name),1),r("span",Me,d(i.__("SKU"))+" : "+d(a.sku),1),r("span",Ke,d(i.__("Barcode"))+" : "+d(a.barcode),1)],8,De))),128))])])]),r("div",Ge,[r("table",Je,[r("thead",null,[r("tr",null,[(l(!0),u(v,null,y(s.form.columns,(a,p)=>(l(),u("td",{width:"200",key:p,class:"text-primary p-2 border"},d(a.label),1))),128))])]),r("tbody",null,[(l(!0),u(v,null,y(s.form.products,(a,p)=>(l(),u("tr",{key:p,class:k(a.procurement.$invalid?"error border-2 border-error-primary":"")},[(l(!0),u(v,null,y(s.form.columns,(b,_)=>(l(),u(v,null,[b.type==="name"?(l(),u("td",{key:_,width:"500",class:"p-2 text-primary border"},[r("span",ze,d(a.name),1),r("div",He,[r("div",Qe,[r("div",We,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.deleteProduct(p)},d(i.__("Delete")),9,Xe)]),r("div",Ye,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.setProductOptions(p)},d(i.__("Options")),9,Ze)]),r("div",$e,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.selectUnitForProduct(p)},d(i.__("Unit"))+": "+d(i.getSelectedUnit(p)),9,et)]),r("div",tt,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.selectTax(p)},d(i.__("Tax"))+": "+d(i.getSelectedTax(p)),9,rt)]),r("div",st,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:f=>i.defineConversionOption(p)},d(i.__("Convert"))+": "+d(a.procurement.convert_unit_id?a.procurement.convert_unit_label:i.__("N/A")),9,it)])])])])):m("",!0),b.type==="text"?(l(),u("td",{key:_,onClick:f=>i.triggerKeyboard(a.procurement,_,p),class:"text-primary border cursor-pointer"},[r("div",nt,[["purchase_price_edit"].includes(_)?(l(),u("span",at,d(i.nsCurrency(a.procurement[_])),1)):m("",!0),["purchase_price_edit"].includes(_)?m("",!0):(l(),u("span",ct,d(a.procurement[_]),1))])],8,ot)):m("",!0),b.type==="custom_select"?(l(),u("td",{key:_,class:"p-2 text-primary border"},[r("div",lt,[r("div",ut,[P(r("select",{onChange:f=>i.updateLine(p),"onUpdate:modelValue":f=>a.procurement[_]=f,class:"p-2"},[(l(!0),u(v,null,y(b.options,f=>(l(),u("option",{key:f.value,value:f.value},d(f.label),9,pt))),128))],40,dt),[[B,a.procurement[_]]])])])])):m("",!0),b.type==="currency"?(l(),u("td",{key:_,class:"p-2 text-primary border"},[r("div",mt,[r("span",ht,d(i.nsCurrency(a.procurement[_])),1)])])):m("",!0)],64))),256))],2))),128)),r("tr",_t,[r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("tax_value")},null,8,ft),r("td",bt,d(i.nsCurrency(s.totalTaxValues)),1),r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("total_purchase_price")-(Object.keys(s.form.columns).indexOf("tax_value")+1)},null,8,vt),r("td",xt,d(i.nsCurrency(s.totalPurchasePrice)),1)])])])])])])):m("",!0)])])])],64)):m("",!0)])}const St=O(ne,[["render",yt]]);export{St as default}; diff --git a/public/build/assets/ns-procurement-invoice-DSSNRCNz.js b/public/build/assets/ns-procurement-invoice-b9a1ca34.js similarity index 100% rename from public/build/assets/ns-procurement-invoice-DSSNRCNz.js rename to public/build/assets/ns-procurement-invoice-b9a1ca34.js diff --git a/public/build/assets/ns-procurement-quantity-C_tA1rn-.js b/public/build/assets/ns-procurement-quantity-ecf5ad70.js similarity index 90% rename from public/build/assets/ns-procurement-quantity-C_tA1rn-.js rename to public/build/assets/ns-procurement-quantity-ecf5ad70.js index 483300e96..0d7060694 100644 --- a/public/build/assets/ns-procurement-quantity-C_tA1rn-.js +++ b/public/build/assets/ns-procurement-quantity-ecf5ad70.js @@ -1 +1 @@ -import{b as f}from"./bootstrap-CnLEEQCx.js";import{_ as u}from"./currency-lOMYG1Wf.js";import{_ as h}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as m,o as a,c as n,a as s,t as r,f as _,F as v,b as V,e as c,n as x}from"./runtime-core.esm-bundler-RT2b-_3S.js";const b={name:"ns-procurement-quantity",props:["popup"],data(){return{finalValue:1,virtualStock:null,allSelected:!0,isLoading:!1,keys:[...[1,2,3].map(e=>({identifier:e,value:e})),...[4,5,6].map(e=>({identifier:e,value:e})),...[7,8,9].map(e=>({identifier:e,value:e})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},mounted(){this.popup.params.quantity&&(this.finalValue=this.popup.params.quantity),document.addEventListener("keyup",this.handleKeyPress)},unmounted(){document.removeEventListener("keypress",this.handleKeyPress)},methods:{__:u,handleKeyPress(e){e.keyCode===13&&this.inputValue({identifier:"next"})},closePopup(){this.popup.params.reject(!1),this.popup.close()},inputValue(e){if(e.identifier==="next"){this.popup.params;const i=parseFloat(this.finalValue);if(i===0)return f.error(u("Please provide a quantity")).subscribe();this.resolve({quantity:i})}else e.identifier==="backspace"?this.allSelected?(this.finalValue=0,this.allSelected=!1):(this.finalValue=this.finalValue.toString(),this.finalValue=this.finalValue.substr(0,this.finalValue.length-1)||0):this.allSelected?(this.finalValue=e.value,this.finalValue=parseFloat(this.finalValue),this.allSelected=!1):(this.finalValue+=""+e.value,this.finalValue=parseFloat(this.finalValue))},resolve(e){this.popup.params.resolve(e),this.popup.close()}}},y={class:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen relative"},g={class:"flex-shrink-0 flex p-2 border-b ns-box-header justify-between items-center"},k={class:"text-xl font-bold text-primary text-center"},w={id:"screen",class:"h-16 ns-box-body flex items-center justify-center"},S={class:"font-bold text-3xl"},C={id:"numpad",class:"grid grid-flow-row grid-cols-3 grid-rows-3"},P=["onClick"],q={key:0};function F(e,i,j,B,o,l){const p=m("ns-close-button");return a(),n("div",y,[s("div",g,[s("h1",k,r(l.__("Define Quantity")),1),s("div",null,[_(p,{onClick:i[0]||(i[0]=t=>l.closePopup())})])]),s("div",w,[s("h1",S,r(o.finalValue),1)]),s("div",C,[(a(!0),n(v,null,V(o.keys,(t,d)=>(a(),n("div",{onClick:L=>l.inputValue(t),key:d,class:"text-xl font-bold border ns-numpad-key h-24 flex items-center justify-center cursor-pointer"},[t.value!==void 0?(a(),n("span",q,r(t.value),1)):c("",!0),t.icon?(a(),n("i",{key:1,class:x(["las",t.icon])},null,2)):c("",!0)],8,P))),128))])])}const Q=h(b,[["render",F]]);export{Q as n}; +import{b as f}from"./bootstrap-8be442b1.js";import{_ as u}from"./currency-f8bd78d1.js";import{_ as h}from"./_plugin-vue_export-helper-c27b6911.js";import{r as m,o as a,c as n,a as s,t as r,f as _,F as v,b as V,e as c,n as x}from"./runtime-core.esm-bundler-b48de70a.js";const b={name:"ns-procurement-quantity",props:["popup"],data(){return{finalValue:1,virtualStock:null,allSelected:!0,isLoading:!1,keys:[...[1,2,3].map(e=>({identifier:e,value:e})),...[4,5,6].map(e=>({identifier:e,value:e})),...[7,8,9].map(e=>({identifier:e,value:e})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},mounted(){this.popup.params.quantity&&(this.finalValue=this.popup.params.quantity),document.addEventListener("keyup",this.handleKeyPress)},unmounted(){document.removeEventListener("keypress",this.handleKeyPress)},methods:{__:u,handleKeyPress(e){e.keyCode===13&&this.inputValue({identifier:"next"})},closePopup(){this.popup.params.reject(!1),this.popup.close()},inputValue(e){if(e.identifier==="next"){this.popup.params;const i=parseFloat(this.finalValue);if(i===0)return f.error(u("Please provide a quantity")).subscribe();this.resolve({quantity:i})}else e.identifier==="backspace"?this.allSelected?(this.finalValue=0,this.allSelected=!1):(this.finalValue=this.finalValue.toString(),this.finalValue=this.finalValue.substr(0,this.finalValue.length-1)||0):this.allSelected?(this.finalValue=e.value,this.finalValue=parseFloat(this.finalValue),this.allSelected=!1):(this.finalValue+=""+e.value,this.finalValue=parseFloat(this.finalValue))},resolve(e){this.popup.params.resolve(e),this.popup.close()}}},y={class:"ns-box shadow min-h-2/5-screen w-3/4-screen md:w-3/5-screen lg:w-3/5-screen xl:w-2/5-screen relative"},g={class:"flex-shrink-0 flex p-2 border-b ns-box-header justify-between items-center"},k={class:"text-xl font-bold text-primary text-center"},w={id:"screen",class:"h-16 ns-box-body flex items-center justify-center"},S={class:"font-bold text-3xl"},C={id:"numpad",class:"grid grid-flow-row grid-cols-3 grid-rows-3"},P=["onClick"],q={key:0};function F(e,i,j,B,o,l){const p=m("ns-close-button");return a(),n("div",y,[s("div",g,[s("h1",k,r(l.__("Define Quantity")),1),s("div",null,[_(p,{onClick:i[0]||(i[0]=t=>l.closePopup())})])]),s("div",w,[s("h1",S,r(o.finalValue),1)]),s("div",C,[(a(!0),n(v,null,V(o.keys,(t,d)=>(a(),n("div",{onClick:L=>l.inputValue(t),key:d,class:"text-xl font-bold border ns-numpad-key h-24 flex items-center justify-center cursor-pointer"},[t.value!==void 0?(a(),n("span",q,r(t.value),1)):c("",!0),t.icon?(a(),n("i",{key:1,class:x(["las",t.icon])},null,2)):c("",!0)],8,P))),128))])])}const Q=h(b,[["render",F]]);export{Q as n}; diff --git a/public/build/assets/ns-profile-widget-C1hd8E1M.js b/public/build/assets/ns-profile-widget-cef1ba8a.js similarity index 82% rename from public/build/assets/ns-profile-widget-C1hd8E1M.js rename to public/build/assets/ns-profile-widget-cef1ba8a.js index 7047e3ff5..977b5811d 100644 --- a/public/build/assets/ns-profile-widget-C1hd8E1M.js +++ b/public/build/assets/ns-profile-widget-cef1ba8a.js @@ -1 +1 @@ -import{n as p}from"./ns-avatar-image-CAD6xUGA.js";import{_ as b,n as h}from"./currency-lOMYG1Wf.js";import{_ as v}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as n,o as l,c as i,a as e,t as a,f as d,F as g,b as x}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./index.es-Br67aBEV.js";const w={name:"ns-profile-widget",components:{nsAvatarImage:p},data(){return{svg:"",user:ns.user,profileDetails:[]}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},mounted(){this.loadUserProfileWidget()},methods:{__:b,nsCurrency:h,loadUserProfileWidget(o){nsHttpClient.get(`/api/reports/cashier-report${o?"?refresh=true":""}`).subscribe(s=>{this.profileDetails=s})}}},y={id:"ns-best-cashiers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},k={class:"flex-auto"},C={class:"head text-center border-b w-full flex justify-between items-center p-2"},P={class:"flex -mx-1"},D={class:"px-1"},U={class:"px-1"},W={class:"body"},j={class:"h-40 flex items-center justify-center"},B={class:"rounded-full border-4 border-gray-400 bg-white shadow-lg overflow-hidden"},$={class:"border-t border-box-edge"};function F(o,s,N,V,r,c){const u=n("ns-icon-button"),_=n("ns-close-button"),f=n("ns-avatar-image");return l(),i("div",y,[e("div",k,[e("div",C,[e("h5",null,a(c.__("Profile")),1),e("div",P,[e("div",D,[d(u,{"class-name":"la-sync-alt",onClick:s[0]||(s[0]=t=>c.loadUserProfileWidget(!0))})]),e("div",U,[d(_,{onClick:s[1]||(s[1]=t=>o.$emit("onRemove"))})])])]),e("div",W,[e("div",j,[e("div",B,[d(f,{size:32,url:r.user.attributes.avatar_link,name:r.user.username},null,8,["url","name"])])]),e("div",$,[e("ul",null,[(l(!0),i(g,null,x(r.profileDetails,(t,m)=>(l(),i("li",{key:m,class:"border-b border-box-edge p-2 flex justify-between"},[e("span",null,a(t.label),1),e("span",null,a(t.value),1)]))),128))])])])])])}const L=v(w,[["render",F]]);export{L as default}; +import{n as p}from"./ns-avatar-image-35303576.js";import{_ as b,n as h}from"./currency-f8bd78d1.js";import{_ as v}from"./_plugin-vue_export-helper-c27b6911.js";import{r as n,o as l,c as i,a as e,t as a,f as d,F as g,b as x}from"./runtime-core.esm-bundler-b48de70a.js";import"./index.es-25aa42ee.js";const w={name:"ns-profile-widget",components:{nsAvatarImage:p},data(){return{svg:"",user:ns.user,profileDetails:[]}},computed:{avatarUrl(){return this.url.length===0?"":this.url}},mounted(){this.loadUserProfileWidget()},methods:{__:b,nsCurrency:h,loadUserProfileWidget(o){nsHttpClient.get(`/api/reports/cashier-report${o?"?refresh=true":""}`).subscribe(s=>{this.profileDetails=s})}}},y={id:"ns-best-cashiers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},k={class:"flex-auto"},C={class:"head text-center border-b w-full flex justify-between items-center p-2"},P={class:"flex -mx-1"},D={class:"px-1"},U={class:"px-1"},W={class:"body"},j={class:"h-40 flex items-center justify-center"},B={class:"rounded-full border-4 border-gray-400 bg-white shadow-lg overflow-hidden"},$={class:"border-t border-box-edge"};function F(o,s,N,V,r,c){const u=n("ns-icon-button"),_=n("ns-close-button"),f=n("ns-avatar-image");return l(),i("div",y,[e("div",k,[e("div",C,[e("h5",null,a(c.__("Profile")),1),e("div",P,[e("div",D,[d(u,{"class-name":"la-sync-alt",onClick:s[0]||(s[0]=t=>c.loadUserProfileWidget(!0))})]),e("div",U,[d(_,{onClick:s[1]||(s[1]=t=>o.$emit("onRemove"))})])])]),e("div",W,[e("div",j,[e("div",B,[d(f,{size:32,url:r.user.attributes.avatar_link,name:r.user.username},null,8,["url","name"])])]),e("div",$,[e("ul",null,[(l(!0),i(g,null,x(r.profileDetails,(t,m)=>(l(),i("li",{key:m,class:"border-b border-box-edge p-2 flex justify-between"},[e("span",null,a(t.label),1),e("span",null,a(t.value),1)]))),128))])])])])])}const L=v(w,[["render",F]]);export{L as default}; diff --git a/public/build/assets/ns-profit-report-CeVRN_L-.js b/public/build/assets/ns-profit-report-CeVRN_L-.js deleted file mode 100644 index ac79851a7..000000000 --- a/public/build/assets/ns-profit-report-CeVRN_L-.js +++ /dev/null @@ -1 +0,0 @@ -import{I as ra,J as na,K as ta,L as ia,M as ca,N as oa,O as da,Q as pa,R as la,U as va,W as ua,X as ma,Y as fa,Z as Da,_ as ha,$ as ga,a0 as ba,a1 as xa,a2 as ya,a3 as _a,a4 as Ca,a5 as Sa,a6 as Na,a7 as ka,a8 as Ta,a9 as Fa,aa as Ma,ab as wa,ac as Ea,ad as Ra,ae as ja,af as Aa,ag as Pa,ah as Ia,ai as Oa,aj as qa,ak as La,al as za,am as Ua,an as Ba,ao as Qa,ap as Ha,aq as Wa,ar as Ga,as as Va,at as Ya,au as Za,av as Xa,aw as Ja,ax as Ka,ay as $a,az as es,aA as as,aB as ss,aC as rs,aD as ts,aE as is,aF as cs,aG as os,aH as ds,aI as ps,aJ as ls,aK as vs,aL as us,aM as ms,aN as fs,aO as Ds,aP as hs,aQ as gs,aR as bs,aS as xs,aT as ys,aU as _s,aV as Cs,aW as Ss,aX as Ns,aY as ks,aZ as Ts,a_ as Fs,a$ as Ms,b0 as ws,b1 as Es,b2 as Rs,b3 as js,b4 as As,b5 as Ps,b6 as Is,b7 as Os,b8 as qs,b9 as Ls,ba as zs,bb as Us,bc as Bs,bd as Qs,be as Hs,bf as Ws,bg as Gs,bh as Vs,bi as Ys,bj as Zs,bk as Xs,bl as Js,bm as Ks,bn as $s,bo as er,bp as ar,bq as sr,br as rr,bs as nr,bt as tr,bu as ir,bv as cr,bw as or,bx as dr,by as pr,bz as lr,bA as vr,bB as ur,bC as mr,bD as fr,bE as Dr,bF as hr,bG as gr,bH as br,bI as xr,bJ as yr,bK as _r,bL as Cr,bM as Sr,bN as Nr,bO as kr,bP as Tr,bQ as Fr,bR as Mr,bS as wr,bT as Er,bU as Rr,bV as jr,bW as Ar,bX as Pr,bY as Ir,bZ as Or,b_ as qr,b$ as Lr,c0 as zr,c1 as Ur,c2 as Br,c3 as Qr,c4 as Hr,c5 as Wr,c6 as Gr,c7 as Vr,c8 as Yr,c9 as Zr,ca as Xr,cb as Jr,cc as Kr,cd as $r,ce as en,cf as an,cg as sn,ch as rn,ci as nn,cj as tn,ck as cn,cl as on,cm as dn,cn as pn,co as ln,cp as vn,cq as un,cr as mn,cs as fn,ct as Dn,cu as hn,cv as gn,cw as bn,cx as xn,cy as yn,cz as _n,cA as Cn,cB as Sn,cC as Nn,cD as kn,cE as Tn,cF as Fn,cG as Mn,cH as wn,cI as En,cJ as Rn,cK as jn,cL as An,cM as Pn,cN as In,cO as On,cP as qn,cQ as Ln,cR as zn,cS as Un,cT as Bn,cU as Qn,cV as Hn,cW as Wn,cX as Gn,cY as Vn,cZ as Yn,c_ as Zn,c$ as Xn,d0 as Jn,d1 as Kn,d2 as $n,d3 as et,d4 as at,d5 as st,d6 as rt,d7 as nt,d8 as tt,d9 as it,da as ct,db as ot,dc as dt,dd as pt,de as lt,df as vt,dg as ut,dh as mt,di as ft,dj as Dt,dk as ht,dl as gt,dm as bt,dn as xt,dp as yt,dq as _t,dr as Ct,ds as St,dt as Nt,du as kt,dv as Tt,dw as Ft,dx as Mt,dy as wt,dz as Et,dA as Rt,dB as jt,dC as At,dD as Pt,dE as It,dF as Ot,dG as qt,dH as Lt,dI as zt,dJ as Ut,dK as Bt,dL as Qt,dM as Ht,dN as Wt,dO as Gt,dP as Vt,dQ as Yt,dR as Zt,dS as Xt,dT as Jt,dU as Kt,dV as $t,dW as ei,dX as ai,dY as si,dZ as ri,d_ as ni,d$ as ti,e0 as ii,e1 as ci,e2 as oi,e3 as di,e4 as pi,e5 as li,e6 as vi,e7 as ui,e8 as mi,e9 as fi,ea as Di,eb as hi,ec as gi,ed as bi,ee as xi,ef as yi,eg as _i,eh as Ci,ei as Si,ej as Ni,ek as ki,el as Ti,em as Fi,en as Mi,eo as wi,ep as Ei,eq as Ri,er as ji,es as Ai,et as Pi,eu as Ii,ev as Oi,ew as qi,ex as Li,ey as zi,ez as Ui,eA as Bi,eB as Qi,eC as Hi,eD as Wi,eE as Gi,eF as Vi,eG as Yi,eH as Zi,eI as Xi,eJ as Ji,eK as Ki,eL as $i,eM as ec,eN as ac,eO as sc,eP as rc,eQ as nc,eR as tc,eS as ic,eT as cc,eU as oc,eV as dc,eW as pc,eX as lc,eY as vc,eZ as uc,e_ as mc,e$ as fc,f0 as Dc,f1 as hc,f2 as gc,f3 as bc,f4 as xc,f5 as yc,f6 as _c,f7 as Cc,f8 as Sc,f9 as Nc,fa as kc,fb as Tc,fc as Fc,fd as Mc,fe as wc,ff as Ec,fg as Rc,fh as jc,fi as Ac,fj as Pc,fk as Ic,fl as Oc,fm as qc,fn as Lc,fo as zc,fp as Uc,fq as Bc,fr as _e,fs as Re,ft as xo,fu as $e,fv as Qc,fw as Hc,fx as Wc,fy as Gc,fz as Vc,fA as tp,fB as ip,fC as cp,fD as op,fE as dp,fF as yo,fG as So,fH as pp,fI as No,fJ as ko,fK as To,fL as Fo,fM as Mo,fN as wo,fO as Eo,fP as Ro,fQ as jo,fR as Ao,fS as Po,fT as Io,fU as Oo,fV as qo,fW as Lo,fX as zo,fY as Uo,fZ as Bo,f_ as Qo,f$ as Ho,g0 as Wo,g1 as Go,g2 as Vo,g3 as Yo,g4 as Zo,g5 as Xo,g6 as Jo,g7 as Ko,g8 as $o,g9 as ed,ga as ad,gb as sd,gc as rd,gd as nd,ge as td,gf as id,gg as lp,gh as vp,gi as up,gj as mp,gk as fp,gl as Dp,gm as hp,gn as gp,go as bp,gp as xp,gq as yp,gr as _p,gs as Cp,gt as Sp,gu as Np,gv as kp,gw as Tp,gx as Fp,gy as Mp,gz as wp,gA as Ep,gB as Rp,gC as jp,gD as Ap,gE as Pp,gF as Ip,gG as Op,gH as qp,gI as Lp,gJ as zp,gK as Up,gL as Bp,gM as Qp,gN as Hp,gO as Wp,gP as Gp,gQ as Vp,gR as Yp,gS as Zp,gT as Xp,gU as Jp,gV as Kp,gW as $p,gX as el,gY as al,gZ as sl,g_ as rl,g$ as nl,h0 as tl,h1 as il,h2 as cl,h3 as ol,h4 as dl,h5 as pl,h6 as ll,h7 as vl,h8 as ul,h9 as ml,ha as fl,hb as Dl,hc as hl,hd as gl,he as bl,hf as xl,hg as yl,hh as _l,hi as Cl,hj as Sl,hk as Nl,hl as kl,hm as Tl,hn as Fl,ho as Ml,hp as wl,hq as El,hr as Rl,hs as jl,ht as Al,hu as Pl,f as sa,hv as Il,hw as Ol,hx as ql,hy as Ll,hz as zl,hA as Ul,hB as Bl,hC as Ql,hD as Hl,hE as Wl,hF as Gl,hG as Vl,hH as Yl,hI as Zl,hJ as Xl,hK as Jl,hL as Kl,hM as $l,hN as ev,hO as av,hP as sv,hQ as rv,hR as nv,hS as tv,hT as iv,hU as cv,hV as ov,hW as dv,hX as pv,hY as lv,hZ as vv,h_ as uv,h$ as mv,i0 as fv,i1 as Dv,i2 as hv,i3 as gv,i4 as bv,i5 as xv,i6 as yv,i7 as _v,i8 as Cv,i9 as Sv,ia as Nv,ib as kv,ic as Tv,id as Fv,ie as Mv,ig as wv,ih as Ev,ii as Rv,ij as jv,ik as Av,il as Pv,im as Iv,io as Ov,ip as qv,iq as Lv,ir as zv,is as Uv,it as Bv,iu as Qv,iv as Hv,iw as Wv,ix as Gv,iy as Vv,iz as Yv,iA as Zv,iB as Xv,iC as Jv,iD as Kv,iE as $v,iF as eu,iG as au,iH as su,iI as ru,iJ as nu,iK as tu,iL as iu,iM as cu,iN as ou,iO as du,iP as pu,iQ as lu,iR as vu,iS as uu,iT as mu,iU as fu,iV as Du,iW as hu,iX as gu,iY as bu,iZ as xu,i_ as yu,i$ as _u,j0 as Cu,j1 as Su,j2 as Nu,j3 as ku,j4 as Tu,j5 as Fu,j6 as Mu,j7 as wu,j8 as Eu,j9 as Ru,ja as ju,jb as Au,jc as Pu,jd as Iu,je as Ou,jf as qu,jg as Lu,jh as zu,ji as Uu,jj as Bu,jk as Qu,jl as Hu,jm as Wu,jn as Gu,jo as Vu,jp as Yu,jq as Zu,jr as Xu,js as Ju,jt as Ku,ju as $u,jv as em,jw as am,jx as sm,jy as rm,jz as nm,jA as tm,jB as im,jC as cm,jD as om,jE as dm,jF as pm,jG as lm,jH as vm,jI as um,jJ as mm,jK as fm,jL as Dm,jM as hm,jN as gm,jO as bm,jP as xm,jQ as ym,jR as _m,jS as Cm,jT as Sm,jU as Nm,jV as km,jW as Tm,jX as Fm,jY as Mm,jZ as wm,j_ as Em,j$ as Rm,k0 as jm,k1 as Am,k2 as Pm,k3 as Im,k4 as Om,k5 as qm,k6 as Lm,k7 as zm,k8 as Um,k9 as Bm,ka as Qm,kb as Hm,kc as Wm,kd as Gm,ke as Vm,kf as Ym,kg as Zm,kh as Xm,ki as Jm,kj as Km,kk as $m,kl as ef,km as af,kn as sf,ko as rf,kp as nf,kq as tf,kr as cf,ks as of,kt as df,ku as pf,kv as lf,kw as vf,kx as uf,ky as mf,kz as ff,kA as Df,kB as hf,kC as gf,kD as bf,kE as xf,kF as yf,kG as _f,kH as Cf,kI as Sf,kJ as Nf,kK as kf,kL as Tf,kM as Ff,kN as Mf,kO as wf,kP as Ef,kQ as Rf,kR as jf,kS as Af,kT as Pf,kU as If,kV as Of,kW as qf,kX as Lf,kY as zf,kZ as Uf,k_ as Bf,k$ as Qf,l0 as Hf,l1 as Wf,l2 as Gf,l3 as Vf,l4 as Yf,l5 as Zf,l6 as Xf,l7 as Jf,l8 as Kf,l9 as $f,la as eD,lb as aD,lc as sD,ld as rD,le as nD,lf as tD,lg as iD,lh as cD,li as oD,lj as dD,lk as pD,ll as lD,lm as vD,ln as uD,lo as mD,lp as fD,lq as DD,lr as hD,ls as gD,lt as bD,lu as xD,lv as yD,lw as _D,lx as CD,ly as SD,h as Qe,b as Ee,a as ND}from"./bootstrap-CnLEEQCx.js";import{c as kD,e as TD}from"./components-D4w1etK_.js";import{b as FD,_ as ve,n as MD}from"./currency-lOMYG1Wf.js";import{s as _o}from"./select-api-entities-Dz_g0XY5.js";import{_ as wD}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as ED,o as ea,c as aa,a as t,f as Co,t as g,F as RD,b as jD,n as AD}from"./runtime-core.esm-bundler-RT2b-_3S.js";import"./ns-alert-popup-SVrn5Xft.js";import"./ns-avatar-image-CAD6xUGA.js";import"./index.es-Br67aBEV.js";import"./ns-prompt-popup-DKRiwYBT.js";import"./join-array-DPKtuOQJ.js";const PD=Object.freeze(Object.defineProperty({__proto__:null,createAbs:ra,createAccessorNode:na,createAcos:ta,createAcosh:ia,createAcot:ca,createAcoth:oa,createAcsc:da,createAcsch:pa,createAdd:la,createAddScalar:va,createAnd:ua,createAndTransform:ma,createApply:fa,createApplyTransform:Da,createArg:ha,createArrayNode:ga,createAsec:ba,createAsech:xa,createAsin:ya,createAsinh:_a,createAssignmentNode:Ca,createAtan:Sa,createAtan2:Na,createAtanh:ka,createAtomicMass:Ta,createAvogadro:Fa,createBellNumbers:Ma,createBigNumberClass:wa,createBignumber:Ea,createBin:Ra,createBitAnd:ja,createBitAndTransform:Aa,createBitNot:Pa,createBitOr:Ia,createBitOrTransform:Oa,createBitXor:qa,createBlockNode:La,createBohrMagneton:za,createBohrRadius:Ua,createBoltzmann:Ba,createBoolean:Qa,createCatalan:Ha,createCbrt:Wa,createCeil:Ga,createChain:Va,createChainClass:Ya,createClassicalElectronRadius:Za,createClone:Xa,createColumn:Ja,createColumnTransform:Ka,createCombinations:$a,createCombinationsWithRep:es,createCompare:as,createCompareNatural:ss,createCompareText:rs,createCompile:ts,createComplex:is,createComplexClass:cs,createComposition:os,createConcat:ds,createConcatTransform:ps,createConditionalNode:ls,createConductanceQuantum:vs,createConj:us,createConstantNode:ms,createCorr:fs,createCos:Ds,createCosh:hs,createCot:gs,createCoth:bs,createCoulomb:xs,createCount:ys,createCreateUnit:_s,createCross:Cs,createCsc:Ss,createCsch:Ns,createCtranspose:ks,createCube:Ts,createCumSum:Fs,createCumSumTransform:Ms,createDeepEqual:ws,createDenseMatrixClass:Es,createDerivative:Rs,createDet:js,createDeuteronMass:As,createDiag:Ps,createDiff:Is,createDiffTransform:Os,createDistance:qs,createDivide:Ls,createDivideScalar:zs,createDot:Us,createDotDivide:Bs,createDotMultiply:Qs,createDotPow:Hs,createE:Ws,createEfimovFactor:Gs,createEigs:Vs,createElectricConstant:Ys,createElectronMass:Zs,createElementaryCharge:Xs,createEqual:Js,createEqualScalar:Ks,createEqualText:$s,createErf:er,createEvaluate:ar,createExp:sr,createExpm:rr,createExpm1:nr,createFactorial:tr,createFalse:ir,createFaraday:cr,createFermiCoupling:or,createFft:dr,createFibonacciHeapClass:pr,createFilter:lr,createFilterTransform:vr,createFineStructure:ur,createFirstRadiation:mr,createFix:fr,createFlatten:Dr,createFloor:hr,createForEach:gr,createForEachTransform:br,createFormat:xr,createFraction:yr,createFractionClass:_r,createFreqz:Cr,createFunctionAssignmentNode:Sr,createFunctionNode:Nr,createGamma:kr,createGasConstant:Tr,createGcd:Fr,createGetMatrixDataType:Mr,createGravitationConstant:wr,createGravity:Er,createHartreeEnergy:Rr,createHasNumericValue:jr,createHelp:Ar,createHelpClass:Pr,createHex:Ir,createHypot:Or,createI:qr,createIdentity:Lr,createIfft:zr,createIm:Ur,createImmutableDenseMatrixClass:Br,createIndex:Qr,createIndexClass:Hr,createIndexNode:Wr,createIndexTransform:Gr,createInfinity:Vr,createIntersect:Yr,createInv:Zr,createInverseConductanceQuantum:Xr,createInvmod:Jr,createIsInteger:Kr,createIsNaN:$r,createIsNegative:en,createIsNumeric:an,createIsPositive:sn,createIsPrime:rn,createIsZero:nn,createKldivergence:tn,createKlitzing:cn,createKron:on,createLN10:dn,createLN2:pn,createLOG10E:ln,createLOG2E:vn,createLarger:un,createLargerEq:mn,createLcm:fn,createLeafCount:Dn,createLeftShift:hn,createLgamma:gn,createLog:bn,createLog10:xn,createLog1p:yn,createLog2:_n,createLoschmidt:Cn,createLsolve:Sn,createLsolveAll:Nn,createLup:kn,createLusolve:Tn,createLyap:Fn,createMad:Mn,createMagneticConstant:wn,createMagneticFluxQuantum:En,createMap:Rn,createMapTransform:jn,createMatrix:An,createMatrixClass:Pn,createMatrixFromColumns:In,createMatrixFromFunction:On,createMatrixFromRows:qn,createMax:Ln,createMaxTransform:zn,createMean:Un,createMeanTransform:Bn,createMedian:Qn,createMin:Hn,createMinTransform:Wn,createMod:Gn,createMode:Vn,createMolarMass:Yn,createMolarMassC12:Zn,createMolarPlanckConstant:Xn,createMolarVolume:Jn,createMultinomial:Kn,createMultiply:$n,createMultiplyScalar:et,createNaN:at,createNeutronMass:st,createNode:rt,createNorm:nt,createNot:tt,createNthRoot:it,createNthRoots:ct,createNuclearMagneton:ot,createNull:dt,createNumber:pt,createNumeric:lt,createObjectNode:vt,createOct:ut,createOnes:mt,createOperatorNode:ft,createOr:Dt,createOrTransform:ht,createParenthesisNode:gt,createParse:bt,createParser:xt,createParserClass:yt,createPartitionSelect:_t,createPermutations:Ct,createPhi:St,createPi:Nt,createPickRandom:kt,createPinv:Tt,createPlanckCharge:Ft,createPlanckConstant:Mt,createPlanckLength:wt,createPlanckMass:Et,createPlanckTemperature:Rt,createPlanckTime:jt,createPolynomialRoot:At,createPow:Pt,createPrint:It,createPrintTransform:Ot,createProd:qt,createProtonMass:Lt,createQr:zt,createQuantileSeq:Ut,createQuantileSeqTransform:Bt,createQuantumOfCirculation:Qt,createRandom:Ht,createRandomInt:Wt,createRange:Gt,createRangeClass:Vt,createRangeNode:Yt,createRangeTransform:Zt,createRationalize:Xt,createRe:Jt,createReducedPlanckConstant:Kt,createRelationalNode:$t,createReplacer:ei,createReshape:ai,createResize:si,createResolve:ri,createResultSet:ni,createReviver:ti,createRightArithShift:ii,createRightLogShift:ci,createRotate:oi,createRotationMatrix:di,createRound:pi,createRow:li,createRowTransform:vi,createRydberg:ui,createSQRT1_2:mi,createSQRT2:fi,createSackurTetrode:Di,createSchur:hi,createSec:gi,createSech:bi,createSecondRadiation:xi,createSetCartesian:yi,createSetDifference:_i,createSetDistinct:Ci,createSetIntersect:Si,createSetIsSubset:Ni,createSetMultiplicity:ki,createSetPowerset:Ti,createSetSize:Fi,createSetSymDifference:Mi,createSetUnion:wi,createSign:Ei,createSimplify:Ri,createSimplifyConstant:ji,createSimplifyCore:Ai,createSin:Pi,createSinh:Ii,createSize:Oi,createSlu:qi,createSmaller:Li,createSmallerEq:zi,createSolveODE:Ui,createSort:Bi,createSpaClass:Qi,createSparse:Hi,createSparseMatrixClass:Wi,createSpeedOfLight:Gi,createSplitUnit:Vi,createSqrt:Yi,createSqrtm:Zi,createSquare:Xi,createSqueeze:Ji,createStd:Ki,createStdTransform:$i,createStefanBoltzmann:ec,createStirlingS2:ac,createString:sc,createSubset:rc,createSubsetTransform:nc,createSubtract:tc,createSubtractScalar:ic,createSum:cc,createSumTransform:oc,createSylvester:dc,createSymbolNode:pc,createSymbolicEqual:lc,createTan:vc,createTanh:uc,createTau:mc,createThomsonCrossSection:fc,createTo:Dc,createTrace:hc,createTranspose:gc,createTrue:bc,createTypeOf:xc,createTyped:yc,createUnaryMinus:_c,createUnaryPlus:Cc,createUnequal:Sc,createUnitClass:Nc,createUnitFunction:kc,createUppercaseE:Tc,createUppercasePi:Fc,createUsolve:Mc,createUsolveAll:wc,createVacuumImpedance:Ec,createVariance:Rc,createVarianceTransform:jc,createVersion:Ac,createWeakMixingAngle:Pc,createWienDisplacement:Ic,createXgcd:Oc,createXor:qc,createZeros:Lc,createZeta:zc,createZpk2tf:Uc},Symbol.toStringTag,{value:"Module"}));var s={createBigNumberClass:wa},h={createComplexClass:cs},He={createMatrixClass:Pn},p={MatrixDependencies:He,createDenseMatrixClass:Es},ue={createFractionClass:_r},e={BigNumberDependencies:s,ComplexDependencies:h,DenseMatrixDependencies:p,FractionDependencies:ue,createTyped:yc},A={typedDependencies:e,createAbs:ra},E={createNode:rt},v={typedDependencies:e,createEqualScalar:Ks},ae={MatrixDependencies:He,equalScalarDependencies:v,typedDependencies:e,createSparseMatrixClass:Wi},T={typedDependencies:e,createAddScalar:va},O={typedDependencies:e,createIsInteger:Kr},a={DenseMatrixDependencies:p,MatrixDependencies:He,SparseMatrixDependencies:ae,typedDependencies:e,createMatrix:An},f={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcat:ds},u={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAdd:la},M={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createZeros:Lc},q={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubset:rc},Ce={NodeDependencies:E,subsetDependencies:q,createAccessorNode:na},ID={ComplexDependencies:h,typedDependencies:e,createAcos:ta},OD={ComplexDependencies:h,typedDependencies:e,createAcosh:ia},qD={BigNumberDependencies:s,typedDependencies:e,createAcot:ca},LD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcoth:oa},zD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcsc:da},UD={BigNumberDependencies:s,typedDependencies:e,createAcsch:pa},We={typedDependencies:e,createNot:tt},BD={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:We,typedDependencies:e,zerosDependencies:M,createAnd:ua},QD={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:We,typedDependencies:e,zerosDependencies:M,createAndTransform:ma},Yc={isIntegerDependencies:O,typedDependencies:e,createApply:fa},HD={isIntegerDependencies:O,typedDependencies:e,createApplyTransform:Da},WD={typedDependencies:e,createArg:ha},Se={NodeDependencies:E,createArrayNode:ga},GD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsec:ba},VD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsech:xa},YD={ComplexDependencies:h,typedDependencies:e,createAsin:ya},ZD={typedDependencies:e,createAsinh:_a},cd={matrixDependencies:a,NodeDependencies:E,subsetDependencies:q,createAssignmentNode:Ca},od={typedDependencies:e,createAtan:Sa},XD={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAtan2:Na},JD={ComplexDependencies:h,typedDependencies:e,createAtanh:ka},L={BigNumberDependencies:s,typedDependencies:e,createBignumber:Ea},Ne={FractionDependencies:ue,typedDependencies:e,createFraction:yr},se={typedDependencies:e,createNumber:pt},Z={bignumberDependencies:L,fractionDependencies:Ne,numberDependencies:se,createNumeric:lt},y={numericDependencies:Z,typedDependencies:e,createDivideScalar:zs},B={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createEqual:Js},ke={BigNumberDependencies:s,DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRound:pi},Zc={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createCeil:Ga},dd={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createFloor:hr},pd={ComplexDependencies:h,DenseMatrixDependencies:p,ceilDependencies:Zc,equalScalarDependencies:v,floorDependencies:dd,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createFix:fr},je={typedDependencies:e,createFormat:xr},me={typedDependencies:e,createIsNumeric:an},C={typedDependencies:e,createMultiplyScalar:et},ie={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createIdentity:Lr},X={typedDependencies:e,createIsZero:nn},fe={typedDependencies:e,createConj:us},w={matrixDependencies:a,typedDependencies:e,createSize:Oi},Ge={addScalarDependencies:T,conjDependencies:fe,multiplyScalarDependencies:C,sizeDependencies:w,typedDependencies:e,createDot:Us},D={addScalarDependencies:T,dotDependencies:Ge,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createMultiply:$n},Q={typedDependencies:e,createSubtractScalar:ic},K={typedDependencies:e,createUnaryMinus:_c},ld={divideScalarDependencies:y,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createDet:js},De={absDependencies:A,addScalarDependencies:T,detDependencies:ld,divideScalarDependencies:y,identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,unaryMinusDependencies:K,createInv:Zr},H={ComplexDependencies:h,fractionDependencies:Ne,identityDependencies:ie,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createPow:Pt},c={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalDependencies:B,fixDependencies:pd,formatDependencies:je,isNumericDependencies:me,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,roundDependencies:ke,subtractScalarDependencies:Q,createUnitClass:Nc},KD={BigNumberDependencies:s,UnitDependencies:c,createAtomicMass:Ta},$D={BigNumberDependencies:s,UnitDependencies:c,createAvogadro:Fa},ce={typedDependencies:e,createIsNegative:en},Ve={typedDependencies:e,createCombinations:$a},Xc={BigNumberDependencies:s,ComplexDependencies:h,multiplyScalarDependencies:C,powDependencies:H,typedDependencies:e,createGamma:kr},Ae={gammaDependencies:Xc,typedDependencies:e,createFactorial:tr},P={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLarger:un},vd={bignumberDependencies:L,addScalarDependencies:T,combinationsDependencies:Ve,divideScalarDependencies:y,factorialDependencies:Ae,isIntegerDependencies:O,isNegativeDependencies:ce,largerDependencies:P,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,subtractScalarDependencies:Q,typedDependencies:e,createStirlingS2:ac},eh={addScalarDependencies:T,isIntegerDependencies:O,isNegativeDependencies:ce,stirlingS2Dependencies:vd,typedDependencies:e,createBellNumbers:Ma},ah={formatDependencies:je,typedDependencies:e,createBin:Ra},sh={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitAnd:ja},rh={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:We,typedDependencies:e,zerosDependencies:M,createBitAndTransform:Aa},nh={typedDependencies:e,createBitNot:Pa},th={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOr:Ia},ih={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOrTransform:Oa},ch={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createBitXor:qa},ud={createResultSet:ni},md={NodeDependencies:E,ResultSetDependencies:ud,createBlockNode:La},oh={BigNumberDependencies:s,UnitDependencies:c,createBohrMagneton:za},dh={BigNumberDependencies:s,UnitDependencies:c,createBohrRadius:Ua},ph={BigNumberDependencies:s,UnitDependencies:c,createBoltzmann:Ba},lh={typedDependencies:e,createBoolean:Qa},vh={addScalarDependencies:T,combinationsDependencies:Ve,divideScalarDependencies:y,isIntegerDependencies:O,isNegativeDependencies:ce,multiplyScalarDependencies:C,typedDependencies:e,createCatalan:Ha},fd={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,isNegativeDependencies:ce,matrixDependencies:a,typedDependencies:e,unaryMinusDependencies:K,createCbrt:Wa},Dd={typedDependencies:e,createChainClass:Ya},uh={ChainDependencies:Dd,typedDependencies:e,createChain:Va},mh={BigNumberDependencies:s,UnitDependencies:c,createClassicalElectronRadius:Za},fh={typedDependencies:e,createClone:Xa},I={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmaller:Li},hd={DenseMatrixDependencies:p,smallerDependencies:I,createImmutableDenseMatrixClass:Br},Jc={typedDependencies:e,createGetMatrixDataType:Mr},R={ImmutableDenseMatrixDependencies:hd,getMatrixDataTypeDependencies:Jc,createIndexClass:Hr},he={typedDependencies:e,createIsPositive:sn},Ye={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLargerEq:mn},Te={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmallerEq:zi},Fe={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ye,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRange:Gt},gd={IndexDependencies:R,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumn:Ja},Dh={IndexDependencies:R,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumnTransform:Ka},hh={typedDependencies:e,createCombinationsWithRep:es},ge={BigNumberDependencies:s,DenseMatrixDependencies:p,FractionDependencies:ue,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createCompare:as},$={compareDependencies:ge,typedDependencies:e,createCompareNatural:ss},bd={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createCompareText:rs},xd={NodeDependencies:E,createConditionalNode:ls},oe={NodeDependencies:E,createConstantNode:ms},yd={NodeDependencies:E,typedDependencies:e,createFunctionAssignmentNode:Sr},de={UnitDependencies:c,NodeDependencies:E,createSymbolNode:pc},pe={NodeDependencies:E,SymbolNodeDependencies:de,createFunctionNode:Nr},Me={NodeDependencies:E,sizeDependencies:w,createIndexNode:Wr},we={NodeDependencies:E,createObjectNode:vt},re={NodeDependencies:E,createOperatorNode:ft},be={NodeDependencies:E,createParenthesisNode:gt},_d={NodeDependencies:E,createRangeNode:Yt},Cd={NodeDependencies:E,createRelationalNode:$t},ee={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,AssignmentNodeDependencies:cd,BlockNodeDependencies:md,ConditionalNodeDependencies:xd,ConstantNodeDependencies:oe,FunctionAssignmentNodeDependencies:yd,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,RangeNodeDependencies:_d,RelationalNodeDependencies:Cd,SymbolNodeDependencies:de,numericDependencies:Z,typedDependencies:e,createParse:bt},gh={parseDependencies:ee,typedDependencies:e,createCompile:ts},Ze={ComplexDependencies:h,typedDependencies:e,createComplex:is},bh={addScalarDependencies:T,combinationsDependencies:Ve,isIntegerDependencies:O,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,typedDependencies:e,createComposition:os},xh={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcatTransform:ps},yh={BigNumberDependencies:s,UnitDependencies:c,createConductanceQuantum:vs},F={divideScalarDependencies:y,equalScalarDependencies:v,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createDivide:Ls},Sd={addDependencies:u,divideDependencies:F,typedDependencies:e,createMean:Un},J={ComplexDependencies:h,typedDependencies:e,createSqrt:Yi},S={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createSubtract:tc},Kc={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSum:cc},_h={addDependencies:u,divideDependencies:F,matrixDependencies:a,meanDependencies:Sd,multiplyDependencies:D,powDependencies:H,sqrtDependencies:J,subtractDependencies:S,sumDependencies:Kc,typedDependencies:e,createCorr:fs},$c={typedDependencies:e,createCos:Ds},Ch={typedDependencies:e,createCosh:hs},Sh={BigNumberDependencies:s,typedDependencies:e,createCot:gs},Nh={BigNumberDependencies:s,typedDependencies:e,createCoth:bs},kh={BigNumberDependencies:s,UnitDependencies:c,createCoulomb:xs},Nd={multiplyScalarDependencies:C,numericDependencies:Z,typedDependencies:e,createProd:qt},Th={prodDependencies:Nd,sizeDependencies:w,typedDependencies:e,createCount:ys},Fh={UnitDependencies:c,typedDependencies:e,createCreateUnit:_s},Mh={matrixDependencies:a,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createCross:Cs},wh={BigNumberDependencies:s,typedDependencies:e,createCsc:Ss},Eh={BigNumberDependencies:s,typedDependencies:e,createCsch:Ns},Pe={matrixDependencies:a,typedDependencies:e,createTranspose:gc},eo={conjDependencies:fe,transposeDependencies:Pe,typedDependencies:e,createCtranspose:ks},Rh={typedDependencies:e,createCube:Ts},ao={BigNumberDependencies:s,typedDependencies:e,createUnaryPlus:Cc},jh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:ao,createCumSum:Fs},Ah={addDependencies:u,typedDependencies:e,unaryPlusDependencies:ao,createCumSumTransform:Ms},so={equalDependencies:B,typedDependencies:e,createDeepEqual:ws},kd={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,parseDependencies:ee,typedDependencies:e,createResolve:ri},ro={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,SymbolNodeDependencies:de,matrixDependencies:a,typedDependencies:e,createSimplifyConstant:ji},no={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,subtractDependencies:S,typedDependencies:e,createSimplifyCore:Ai},Xe={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,resolveDependencies:kd,simplifyConstantDependencies:ro,simplifyCoreDependencies:no,subtractDependencies:S,typedDependencies:e,createSimplify:Ri},Ph={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,equalDependencies:B,isZeroDependencies:X,numericDependencies:Z,parseDependencies:ee,simplifyDependencies:Xe,typedDependencies:e,createDerivative:Rs},Ih={BigNumberDependencies:s,UnitDependencies:c,createDeuteronMass:As},Td={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createDiag:Ps},Oh={matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiff:Is},qh={bignumberDependencies:L,matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiffTransform:Os},Lh={absDependencies:A,addScalarDependencies:T,deepEqualDependencies:so,divideScalarDependencies:y,multiplyScalarDependencies:C,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,createDistance:qs},Ie={DenseMatrixDependencies:p,concatDependencies:f,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createDotDivide:Bs},zh={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createDotMultiply:Qs},Uh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,powDependencies:H,typedDependencies:e,createDotPow:Hs},Fd={BigNumberDependencies:s,createE:Ws},Bh={BigNumberDependencies:s,createEfimovFactor:Gs},Oe={matrixDependencies:a,typedDependencies:e,createFlatten:Dr},to={typedDependencies:e,createIm:Ur},io={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromColumns:In},Md={BigNumberDependencies:s,FractionDependencies:ue,complexDependencies:Ze,typedDependencies:e,createSign:Ei},co={addScalarDependencies:T,complexDependencies:Ze,conjDependencies:fe,divideScalarDependencies:y,equalDependencies:B,identityDependencies:ie,isZeroDependencies:X,matrixDependencies:a,multiplyScalarDependencies:C,signDependencies:Md,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,zerosDependencies:M,createQr:zt},oo={typedDependencies:e,createRe:Jt},wd={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createReshape:ai},Je={typedDependencies:e,createSin:Pi},po={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolve:Mc},Ed={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolveAll:wc},Rd={absDependencies:A,addDependencies:u,addScalarDependencies:T,atanDependencies:od,bignumberDependencies:L,columnDependencies:gd,complexDependencies:Ze,cosDependencies:$c,diagDependencies:Td,divideScalarDependencies:y,dotDependencies:Ge,equalDependencies:B,flattenDependencies:Oe,imDependencies:to,invDependencies:De,largerDependencies:P,matrixDependencies:a,matrixFromColumnsDependencies:io,multiplyDependencies:D,multiplyScalarDependencies:C,numberDependencies:se,qrDependencies:co,reDependencies:oo,reshapeDependencies:wd,sinDependencies:Je,sizeDependencies:w,smallerDependencies:I,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,usolveDependencies:po,usolveAllDependencies:Ed,createEigs:Vs},Qh={BigNumberDependencies:s,UnitDependencies:c,createElectricConstant:Ys},Hh={BigNumberDependencies:s,UnitDependencies:c,createElectronMass:Zs},Wh={BigNumberDependencies:s,UnitDependencies:c,createElementaryCharge:Xs},Gh={compareTextDependencies:bd,isZeroDependencies:X,typedDependencies:e,createEqualText:$s},Vh={typedDependencies:e,createErf:er},lo={parseDependencies:ee,typedDependencies:e,createEvaluate:ar},jd={typedDependencies:e,createExp:sr},Yh={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,multiplyDependencies:D,typedDependencies:e,createExpm:rr},Zh={ComplexDependencies:h,typedDependencies:e,createExpm1:nr},Xh={createFalse:ir},Jh={BigNumberDependencies:s,UnitDependencies:c,createFaraday:cr},Kh={BigNumberDependencies:s,UnitDependencies:c,createFermiCoupling:or},Ad={ComplexDependencies:h,createI:qr},Pd={ComplexDependencies:h,typedDependencies:e,createLog2:_n},Id={BigNumberDependencies:s,createTau:mc},Od={addScalarDependencies:T,ceilDependencies:Zc,conjDependencies:fe,divideScalarDependencies:y,dotDivideDependencies:Ie,expDependencies:jd,iDependencies:Ad,log2Dependencies:Pd,matrixDependencies:a,multiplyScalarDependencies:C,powDependencies:H,tauDependencies:Id,typedDependencies:e,createFft:dr},qd={largerDependencies:P,smallerDependencies:I,createFibonacciHeapClass:pr},$h={typedDependencies:e,createFilter:lr},eg={typedDependencies:e,createFilterTransform:vr},ag={BigNumberDependencies:s,createFineStructure:ur},sg={BigNumberDependencies:s,UnitDependencies:c,createFirstRadiation:mr},rg={typedDependencies:e,createForEach:gr},ng={typedDependencies:e,createForEachTransform:br},tg={ComplexDependencies:h,addDependencies:u,divideDependencies:F,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createFreqz:Cr},ig={BigNumberDependencies:s,UnitDependencies:c,createGasConstant:Tr},cg={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createGcd:Fr},og={BigNumberDependencies:s,UnitDependencies:c,createGravitationConstant:wr},dg={BigNumberDependencies:s,UnitDependencies:c,createGravity:Er},pg={BigNumberDependencies:s,UnitDependencies:c,createHartreeEnergy:Rr},lg={isNumericDependencies:me,typedDependencies:e,createHasNumericValue:jr},Ld={evaluateDependencies:lo,createHelpClass:Pr},vg={HelpDependencies:Ld,typedDependencies:e,createHelp:Ar},ug={formatDependencies:je,typedDependencies:e,createHex:Ir},mg={absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,isPositiveDependencies:he,multiplyScalarDependencies:C,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createHypot:Or},fg={conjDependencies:fe,dotDivideDependencies:Ie,fftDependencies:Od,typedDependencies:e,createIfft:zr},zd={IndexDependencies:R,typedDependencies:e,createIndex:Qr},Dg={IndexDependencies:R,getMatrixDataTypeDependencies:Jc,createIndexTransform:Gr},hg={BigNumberDependencies:s,createInfinity:Vr},gg={absDependencies:A,addDependencies:u,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,flattenDependencies:Oe,isNumericDependencies:me,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,multiplyScalarDependencies:C,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,createIntersect:Yr},bg={BigNumberDependencies:s,UnitDependencies:c,createInverseConductanceQuantum:Xr},Ud={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createMod:Gn},Bd={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createXgcd:Oc},xg={BigNumberDependencies:s,addDependencies:u,equalDependencies:B,isIntegerDependencies:O,modDependencies:Ud,smallerDependencies:I,typedDependencies:e,xgcdDependencies:Bd,createInvmod:Jr},qe={typedDependencies:e,createIsNaN:$r},yg={typedDependencies:e,createIsPrime:rn},vo={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createLog:bn},xe={typedDependencies:e,createMap:Rn},_g={divideDependencies:F,dotDivideDependencies:Ie,isNumericDependencies:me,logDependencies:vo,mapDependencies:xe,matrixDependencies:a,multiplyDependencies:D,sumDependencies:Kc,typedDependencies:e,createKldivergence:tn},Cg={BigNumberDependencies:s,UnitDependencies:c,createKlitzing:cn},Sg={matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createKron:on},Ng={BigNumberDependencies:s,createLN10:dn},kg={BigNumberDependencies:s,createLN2:pn},Tg={BigNumberDependencies:s,createLOG10E:ln},Fg={BigNumberDependencies:s,createLOG2E:vn},Mg={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createLcm:fn},wg={parseDependencies:ee,typedDependencies:e,createLeafCount:Dn},Eg={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createLeftShift:hn},Rg={ComplexDependencies:h,typedDependencies:e,createLgamma:gn},jg={ComplexDependencies:h,typedDependencies:e,createLog10:xn},Ag={ComplexDependencies:h,divideScalarDependencies:y,logDependencies:vo,typedDependencies:e,createLog1p:yn},Pg={BigNumberDependencies:s,UnitDependencies:c,createLoschmidt:Cn},Qd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolve:Sn},Ig={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolveAll:Nn},Hd={FibonacciHeapDependencies:qd,addScalarDependencies:T,equalScalarDependencies:v,createSpaClass:Qi},Wd={DenseMatrixDependencies:p,SpaDependencies:Hd,SparseMatrixDependencies:ae,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createLup:kn},Gd={SparseMatrixDependencies:ae,absDependencies:A,addDependencies:u,divideScalarDependencies:y,largerDependencies:P,largerEqDependencies:Ye,multiplyDependencies:D,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSlu:qi},Vd={DenseMatrixDependencies:p,lsolveDependencies:Qd,lupDependencies:Wd,matrixDependencies:a,sluDependencies:Gd,typedDependencies:e,usolveDependencies:po,createLusolve:Tn},uo={absDependencies:A,addDependencies:u,conjDependencies:fe,ctransposeDependencies:eo,eigsDependencies:Rd,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyDependencies:D,powDependencies:H,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createNorm:nt},Yd={identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,normDependencies:uo,qrDependencies:co,subtractDependencies:S,typedDependencies:e,createSchur:hi},Zd={absDependencies:A,addDependencies:u,concatDependencies:f,identityDependencies:ie,indexDependencies:zd,lusolveDependencies:Vd,matrixDependencies:a,matrixFromColumnsDependencies:io,multiplyDependencies:D,rangeDependencies:Fe,schurDependencies:Yd,subsetDependencies:q,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSylvester:dc},Og={matrixDependencies:a,multiplyDependencies:D,sylvesterDependencies:Zd,transposeDependencies:Pe,typedDependencies:e,createLyap:Fn},Ke={compareDependencies:ge,isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createPartitionSelect:_t},Xd={addDependencies:u,compareDependencies:ge,divideDependencies:F,partitionSelectDependencies:Ke,typedDependencies:e,createMedian:Qn},qg={absDependencies:A,mapDependencies:xe,medianDependencies:Xd,subtractDependencies:S,typedDependencies:e,createMad:Mn},Lg={BigNumberDependencies:s,UnitDependencies:c,createMagneticConstant:wn},zg={BigNumberDependencies:s,UnitDependencies:c,createMagneticFluxQuantum:En},Ug={typedDependencies:e,createMapTransform:jn},Bg={isZeroDependencies:X,matrixDependencies:a,typedDependencies:e,createMatrixFromFunction:On},Qg={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromRows:qn},mo={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMax:Ln},Hg={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMaxTransform:zn},Wg={addDependencies:u,divideDependencies:F,typedDependencies:e,createMeanTransform:Bn},Gg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMin:Hn},Vg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMinTransform:Wn},Yg={isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createMode:Vn},Zg={BigNumberDependencies:s,UnitDependencies:c,createMolarMass:Yn},Xg={BigNumberDependencies:s,UnitDependencies:c,createMolarMassC12:Zn},Jg={BigNumberDependencies:s,UnitDependencies:c,createMolarPlanckConstant:Xn},Kg={BigNumberDependencies:s,UnitDependencies:c,createMolarVolume:Jn},$g={addDependencies:u,divideDependencies:F,factorialDependencies:Ae,isIntegerDependencies:O,isPositiveDependencies:he,multiplyDependencies:D,typedDependencies:e,createMultinomial:Kn},eb={BigNumberDependencies:s,createNaN:at},ab={BigNumberDependencies:s,UnitDependencies:c,createNeutronMass:st},sb={BigNumberDependencies:s,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createNthRoot:it},rb={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createNthRoots:ct},nb={BigNumberDependencies:s,UnitDependencies:c,createNuclearMagneton:ot},tb={createNull:dt},ib={formatDependencies:je,typedDependencies:e,createOct:ut},cb={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createOnes:mt},ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOr:Dt},db={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOrTransform:ht},Jd={evaluateDependencies:lo,createParserClass:yt},pb={ParserDependencies:Jd,typedDependencies:e,createParser:xt},lb={factorialDependencies:Ae,typedDependencies:e,createPermutations:Ct},vb={BigNumberDependencies:s,createPhi:St},fo={BigNumberDependencies:s,createPi:Nt},ub={typedDependencies:e,createPickRandom:kt},mb={ComplexDependencies:h,addDependencies:u,ctransposeDependencies:eo,deepEqualDependencies:so,divideScalarDependencies:y,dotDependencies:Ge,dotDivideDependencies:Ie,equalDependencies:B,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createPinv:Tt},fb={BigNumberDependencies:s,UnitDependencies:c,createPlanckCharge:Ft},Db={BigNumberDependencies:s,UnitDependencies:c,createPlanckConstant:Mt},hb={BigNumberDependencies:s,UnitDependencies:c,createPlanckLength:wt},gb={BigNumberDependencies:s,UnitDependencies:c,createPlanckMass:Et},bb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTemperature:Rt},xb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTime:jt},Kd={typedDependencies:e,createTypeOf:xc},yb={addDependencies:u,cbrtDependencies:fd,divideDependencies:F,equalScalarDependencies:v,imDependencies:to,isZeroDependencies:X,multiplyDependencies:D,reDependencies:oo,sqrtDependencies:J,subtractDependencies:S,typeOfDependencies:Kd,typedDependencies:e,unaryMinusDependencies:K,createPolynomialRoot:At},_b={typedDependencies:e,createPrint:It},Cb={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createPrintTransform:Ot},Sb={BigNumberDependencies:s,UnitDependencies:c,createProtonMass:Lt},Nb={bignumberDependencies:L,addDependencies:u,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:Ke,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeq:Ut},kb={addDependencies:u,bignumberDependencies:L,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:Ke,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeqTransform:Bt},Tb={BigNumberDependencies:s,UnitDependencies:c,createQuantumOfCirculation:Qt},Fb={typedDependencies:e,createRandom:Ht},Mb={typedDependencies:e,createRandomInt:Wt},wb={createRangeClass:Vt},Eb={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ye,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRangeTransform:Zt},Rb={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,simplifyDependencies:Xe,simplifyConstantDependencies:ro,simplifyCoreDependencies:no,subtractDependencies:S,typedDependencies:e,createRationalize:Xt},jb={BigNumberDependencies:s,UnitDependencies:c,createReducedPlanckConstant:Kt},Ab={createReplacer:ei},Pb={matrixDependencies:a,createResize:si},Ib={createReviver:ti},Ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightArithShift:ii},qb={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightLogShift:ci},$d={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,cosDependencies:$c,matrixDependencies:a,multiplyScalarDependencies:C,normDependencies:uo,sinDependencies:Je,typedDependencies:e,unaryMinusDependencies:K,createRotationMatrix:di},Lb={multiplyDependencies:D,rotationMatrixDependencies:$d,typedDependencies:e,createRotate:oi},zb={IndexDependencies:R,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRow:li},Ub={IndexDependencies:R,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRowTransform:vi},Bb={BigNumberDependencies:s,UnitDependencies:c,createRydberg:ui},Qb={BigNumberDependencies:s,createSQRT1_2:mi},Hb={BigNumberDependencies:s,createSQRT2:fi},Wb={BigNumberDependencies:s,createSackurTetrode:Di},Gb={BigNumberDependencies:s,typedDependencies:e,createSec:gi},Vb={BigNumberDependencies:s,typedDependencies:e,createSech:bi},Yb={BigNumberDependencies:s,UnitDependencies:c,createSecondRadiation:xi},Zb={DenseMatrixDependencies:p,IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetCartesian:yi},ep={DenseMatrixDependencies:p,IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDifference:_i},Xb={DenseMatrixDependencies:p,IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDistinct:Ci},ap={DenseMatrixDependencies:p,IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIntersect:Si},Jb={IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIsSubset:Ni},Kb={IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetMultiplicity:ki},$b={IndexDependencies:R,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetPowerset:Ti},ex={compareNaturalDependencies:$,typedDependencies:e,createSetSize:Fi},sp={IndexDependencies:R,concatDependencies:f,setDifferenceDependencies:ep,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetSymDifference:Mi},ax={IndexDependencies:R,concatDependencies:f,setIntersectDependencies:ap,setSymDifferenceDependencies:sp,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetUnion:wi},sx={typedDependencies:e,createSinh:Ii},rx={absDependencies:A,addDependencies:u,bignumberDependencies:L,divideDependencies:F,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,mapDependencies:xe,matrixDependencies:a,maxDependencies:mo,multiplyDependencies:D,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,unaryMinusDependencies:K,createSolveODE:Ui},nx={compareDependencies:ge,compareNaturalDependencies:$,matrixDependencies:a,typedDependencies:e,createSort:Bi},tx={SparseMatrixDependencies:ae,typedDependencies:e,createSparse:Hi},ix={BigNumberDependencies:s,UnitDependencies:c,createSpeedOfLight:Gi},cx={typedDependencies:e,createSplitUnit:Vi},ox={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,mapDependencies:xe,maxDependencies:mo,multiplyDependencies:D,sizeDependencies:w,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,createSqrtm:Zi},dx={typedDependencies:e,createSquare:Xi},px={matrixDependencies:a,typedDependencies:e,createSqueeze:Ji},Do={addDependencies:u,applyDependencies:Yc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVariance:Rc},lx={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:Do,createStd:Ki},vx={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:Do,createStdTransform:$i},ux={BigNumberDependencies:s,UnitDependencies:c,createStefanBoltzmann:ec},mx={typedDependencies:e,createString:sc},fx={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubsetTransform:nc},Dx={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSumTransform:oc},hx={OperatorNodeDependencies:re,parseDependencies:ee,simplifyDependencies:Xe,typedDependencies:e,createSymbolicEqual:lc},gx={typedDependencies:e,createTan:vc},bx={typedDependencies:e,createTanh:uc},xx={BigNumberDependencies:s,UnitDependencies:c,createThomsonCrossSection:fc},yx={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createTo:Dc},_x={addDependencies:u,matrixDependencies:a,typedDependencies:e,createTrace:hc},Cx={createTrue:bc},Sx={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createUnequal:Sc},Nx={UnitDependencies:c,typedDependencies:e,createUnitFunction:kc},kx={eDependencies:Fd,createUppercaseE:Tc},Tx={piDependencies:fo,createUppercasePi:Fc},Fx={BigNumberDependencies:s,UnitDependencies:c,createVacuumImpedance:Ec},Mx={addDependencies:u,applyDependencies:Yc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVarianceTransform:jc},wx={createVersion:Ac},Ex={BigNumberDependencies:s,createWeakMixingAngle:Pc},Rx={BigNumberDependencies:s,UnitDependencies:c,createWienDisplacement:Ic},jx={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createXor:qc},Ax={BigNumberDependencies:s,ComplexDependencies:h,addDependencies:u,divideDependencies:F,equalDependencies:B,factorialDependencies:Ae,gammaDependencies:Xc,isNegativeDependencies:ce,multiplyDependencies:D,piDependencies:fo,powDependencies:H,sinDependencies:Je,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createZeta:zc},Px={ComplexDependencies:h,addDependencies:u,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createZpk2tf:Uc},Ix=PD,ho={exports:{}};function go(){}go.prototype={on:function(n,l,i){var o=this.e||(this.e={});return(o[n]||(o[n]=[])).push({fn:l,ctx:i}),this},once:function(n,l,i){var o=this;function x(){o.off(n,x),l.apply(i,arguments)}return x._=l,this.on(n,x,i)},emit:function(n){var l=[].slice.call(arguments,1),i=((this.e||(this.e={}))[n]||[]).slice(),o=0,x=i.length;for(o;oj(ye,np));else if(typeof k=="object")for(var Y in k)_e(k,Y)&&j(ye,k[Y],Y);else if(Re(k)||te!==void 0){var Be=Re(k)?Ue(k)?k.fn+".transform":k.fn:te;if(_e(ye,Be)&&ye[Be]!==k&&!m.silent)throw new Error('Cannot import "'+Be+'" twice');ye[Be]=k}else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}var z={};j(z,r);for(var U in z)if(_e(z,U)){var V=z[U];if(Re(V))ze(V,m);else if(N(V))d(U,V,m);else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}}function d(r,m,b){if(b.wrap&&typeof m=="function"&&(m=Le(m)),le(m)&&(m=n(r,{[m.signature]:m})),n.isTypedFunction(i[r])&&n.isTypedFunction(m)){b.override?m=n(r,m.signatures):m=n(i[r],m),i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(i[r]===void 0||b.override){i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(!b.silent)throw new Error('Cannot import "'+r+'": already exists')}function W(r,m){m&&typeof m.transform=="function"?(i.expression.transform[r]=m.transform,G(r)&&(i.expression.mathWithTransform[r]=m.transform)):(delete i.expression.transform[r],G(r)&&(i.expression.mathWithTransform[r]=m))}function _(r){delete i.expression.transform[r],G(r)?i.expression.mathWithTransform[r]=i[r]:delete i.expression.mathWithTransform[r]}function Le(r){var m=function(){for(var j=[],z=0,U=arguments.length;z2&&arguments[2]!==void 0?arguments[2]:r.fn;if(xo(b,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(b));var j=Ue(r)?i.expression.transform:i,z=b in i.expression.transform,U=_e(j,b)?j[b]:void 0,V=function(){var k={};r.dependencies.map(tp).forEach(Y=>{if(xo(Y,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(Y));Y==="math"?k.math=i:Y==="mathWithTransform"?k.mathWithTransform=i.expression.mathWithTransform:Y==="classes"?k.classes=i:k[Y]=i[Y]});var te=r(k);if(te&&typeof te.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(U===void 0||m.override)return te;if(n.isTypedFunction(U)&&n.isTypedFunction(te))return n(U,te);if(m.silent)return U;throw new Error('Cannot import "'+b+'": already exists')};!r.meta||r.meta.lazy!==!1?($e(j,b,V),U&&z?_(b):(Ue(r)||ne(r))&&$e(i.expression.mathWithTransform,b,()=>j[b])):(j[b]=V(),U&&z?_(b):(Ue(r)||ne(r))&&$e(i.expression.mathWithTransform,b,()=>j[b])),o[b]=r,i.emit("import",b,V)}function N(r){return typeof r=="function"||typeof r=="number"||typeof r=="string"||typeof r=="boolean"||r===null||Qc(r)||Hc(r)||Wc(r)||Gc(r)||Vc(r)||Array.isArray(r)}function le(r){return typeof r=="function"&&typeof r.signature=="string"}function G(r){return!_e(bo,r)}function ne(r){return r.fn.indexOf(".")===-1&&!_e(bo,r.fn)&&(!r.meta||!r.meta.isClass)}function Ue(r){return r!==void 0&&r.meta!==void 0&&r.meta.isTransformFunction===!0||!1}var bo={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return x}function rp(n,l){var i=ip({},cp,l);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var o=Lx({isNumber:To,isComplex:Hc,isBigNumber:Wc,isFraction:Gc,isUnit:Qc,isString:Fo,isArray:Mo,isMatrix:Vc,isCollection:wo,isDenseMatrix:Eo,isSparseMatrix:Ro,isRange:jo,isIndex:Ao,isBoolean:Po,isResultSet:Io,isHelp:Oo,isFunction:qo,isDate:Lo,isRegExp:zo,isObject:Uo,isNull:Bo,isUndefined:Qo,isAccessorNode:Ho,isArrayNode:Wo,isAssignmentNode:Go,isBlockNode:Vo,isConditionalNode:Yo,isConstantNode:Zo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isIndexNode:Ko,isNode:$o,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isRangeNode:rd,isRelationalNode:nd,isSymbolNode:td,isChain:id});o.config=op(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};var x=[],d=[];function W(N){if(Re(N))return N(o);var le=N[Object.keys(N)[0]];if(Re(le))return le(o);if(!lp(N))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",N),new Error("Factory object with properties `type`, `name`, and `factory` expected");var G=x.indexOf(N),ne;return G===-1?(N.math===!0?ne=N.factory(o.type,i,W,o.typed,o):ne=N.factory(o.type,i,W,o.typed),x.push(N),d.push(ne)):ne=d[G],ne}var _={};function Le(){for(var N=arguments.length,le=new Array(N),G=0;G{yo(_).forEach(N=>{N&&N.meta&&N.meta.recreateOnConfigChange&&ze(N,{override:!0})})}),o.create=rp.bind(null,n),o.factory=So,o.import(yo(pp(n))),o.ArgumentsError=Bc,o.DimensionError=No,o.IndexError=ko,o}const Ux=Object.freeze(Object.defineProperty({__proto__:null,AccessorNode:vp,AccessorNodeDependencies:Ce,ArgumentsError:Bc,ArrayNode:up,ArrayNodeDependencies:Se,AssignmentNode:mp,AssignmentNodeDependencies:cd,BigNumber:fp,BigNumberDependencies:s,BlockNode:Dp,BlockNodeDependencies:md,Chain:hp,ChainDependencies:Dd,Complex:gp,ComplexDependencies:h,ConditionalNode:bp,ConditionalNodeDependencies:xd,ConstantNode:xp,ConstantNodeDependencies:oe,DenseMatrix:yp,DenseMatrixDependencies:p,DimensionError:No,EDependencies:kx,FibonacciHeap:_p,FibonacciHeapDependencies:qd,Fraction:Cp,FractionDependencies:ue,FunctionAssignmentNode:Sp,FunctionAssignmentNodeDependencies:yd,FunctionNode:Np,FunctionNodeDependencies:pe,Help:kp,HelpDependencies:Ld,ImmutableDenseMatrix:Tp,ImmutableDenseMatrixDependencies:hd,Index:Fp,IndexDependencies:R,IndexError:ko,IndexNode:Mp,IndexNodeDependencies:Me,InfinityDependencies:hg,LN10:wp,LN10Dependencies:Ng,LN2:Ep,LN2Dependencies:kg,LOG10E:Rp,LOG10EDependencies:Tg,LOG2E:jp,LOG2EDependencies:Fg,Matrix:Ap,MatrixDependencies:He,NaNDependencies:eb,Node:Pp,NodeDependencies:E,ObjectNode:Ip,ObjectNodeDependencies:we,OperatorNode:Op,OperatorNodeDependencies:re,PIDependencies:Tx,ParenthesisNode:qp,ParenthesisNodeDependencies:be,Parser:Lp,ParserDependencies:Jd,Range:zp,RangeDependencies:wb,RangeNode:Up,RangeNodeDependencies:_d,RelationalNode:Bp,RelationalNodeDependencies:Cd,ResultSet:Qp,ResultSetDependencies:ud,SQRT1_2:Hp,SQRT1_2Dependencies:Qb,SQRT2:Wp,SQRT2Dependencies:Hb,Spa:Gp,SpaDependencies:Hd,SparseMatrix:Vp,SparseMatrixDependencies:ae,SymbolNode:Yp,SymbolNodeDependencies:de,Unit:Zp,UnitDependencies:c,_Infinity:Xp,_NaN:Jp,_false:Kp,_null:$p,_true:el,abs:al,absDependencies:A,acos:sl,acosDependencies:ID,acosh:rl,acoshDependencies:OD,acot:nl,acotDependencies:qD,acoth:tl,acothDependencies:LD,acsc:il,acscDependencies:zD,acsch:cl,acschDependencies:UD,add:ol,addDependencies:u,addScalar:dl,addScalarDependencies:T,all:Ix,and:pl,andDependencies:BD,andTransformDependencies:QD,apply:ll,applyDependencies:Yc,applyTransformDependencies:HD,arg:vl,argDependencies:WD,asec:ul,asecDependencies:GD,asech:ml,asechDependencies:VD,asin:fl,asinDependencies:YD,asinh:Dl,asinhDependencies:ZD,atan:hl,atan2:gl,atan2Dependencies:XD,atanDependencies:od,atanh:bl,atanhDependencies:JD,atomicMass:xl,atomicMassDependencies:KD,avogadro:yl,avogadroDependencies:$D,bellNumbers:_l,bellNumbersDependencies:eh,bignumber:Cl,bignumberDependencies:L,bin:Sl,binDependencies:ah,bitAnd:Nl,bitAndDependencies:sh,bitAndTransformDependencies:rh,bitNot:kl,bitNotDependencies:nh,bitOr:Tl,bitOrDependencies:th,bitOrTransformDependencies:ih,bitXor:Fl,bitXorDependencies:ch,bohrMagneton:Ml,bohrMagnetonDependencies:oh,bohrRadius:wl,bohrRadiusDependencies:dh,boltzmann:El,boltzmannDependencies:ph,boolean:Rl,booleanDependencies:lh,catalan:jl,catalanDependencies:vh,cbrt:Al,cbrtDependencies:fd,ceil:Pl,ceilDependencies:Zc,chain:sa,chainDependencies:uh,classicalElectronRadius:Il,classicalElectronRadiusDependencies:mh,clone:Ol,cloneDependencies:fh,column:ql,columnDependencies:gd,columnTransformDependencies:Dh,combinations:Ll,combinationsDependencies:Ve,combinationsWithRep:zl,combinationsWithRepDependencies:hh,compare:Ul,compareDependencies:ge,compareNatural:Bl,compareNaturalDependencies:$,compareText:Ql,compareTextDependencies:bd,compile:Hl,compileDependencies:gh,complex:Wl,complexDependencies:Ze,composition:Gl,compositionDependencies:bh,concat:Vl,concatDependencies:f,concatTransformDependencies:xh,conductanceQuantum:Yl,conductanceQuantumDependencies:yh,config:Zl,conj:Xl,conjDependencies:fe,corr:Jl,corrDependencies:_h,cos:Kl,cosDependencies:$c,cosh:$l,coshDependencies:Ch,cot:ev,cotDependencies:Sh,coth:av,cothDependencies:Nh,coulomb:sv,coulombDependencies:kh,count:rv,countDependencies:Th,create:rp,createAbs:ra,createAccessorNode:na,createAcos:ta,createAcosh:ia,createAcot:ca,createAcoth:oa,createAcsc:da,createAcsch:pa,createAdd:la,createAddScalar:va,createAnd:ua,createAndTransform:ma,createApply:fa,createApplyTransform:Da,createArg:ha,createArrayNode:ga,createAsec:ba,createAsech:xa,createAsin:ya,createAsinh:_a,createAssignmentNode:Ca,createAtan:Sa,createAtan2:Na,createAtanh:ka,createAtomicMass:Ta,createAvogadro:Fa,createBellNumbers:Ma,createBigNumberClass:wa,createBignumber:Ea,createBin:Ra,createBitAnd:ja,createBitAndTransform:Aa,createBitNot:Pa,createBitOr:Ia,createBitOrTransform:Oa,createBitXor:qa,createBlockNode:La,createBohrMagneton:za,createBohrRadius:Ua,createBoltzmann:Ba,createBoolean:Qa,createCatalan:Ha,createCbrt:Wa,createCeil:Ga,createChain:Va,createChainClass:Ya,createClassicalElectronRadius:Za,createClone:Xa,createColumn:Ja,createColumnTransform:Ka,createCombinations:$a,createCombinationsWithRep:es,createCompare:as,createCompareNatural:ss,createCompareText:rs,createCompile:ts,createComplex:is,createComplexClass:cs,createComposition:os,createConcat:ds,createConcatTransform:ps,createConditionalNode:ls,createConductanceQuantum:vs,createConj:us,createConstantNode:ms,createCorr:fs,createCos:Ds,createCosh:hs,createCot:gs,createCoth:bs,createCoulomb:xs,createCount:ys,createCreateUnit:_s,createCross:Cs,createCsc:Ss,createCsch:Ns,createCtranspose:ks,createCube:Ts,createCumSum:Fs,createCumSumTransform:Ms,createDeepEqual:ws,createDenseMatrixClass:Es,createDerivative:Rs,createDet:js,createDeuteronMass:As,createDiag:Ps,createDiff:Is,createDiffTransform:Os,createDistance:qs,createDivide:Ls,createDivideScalar:zs,createDot:Us,createDotDivide:Bs,createDotMultiply:Qs,createDotPow:Hs,createE:Ws,createEfimovFactor:Gs,createEigs:Vs,createElectricConstant:Ys,createElectronMass:Zs,createElementaryCharge:Xs,createEqual:Js,createEqualScalar:Ks,createEqualText:$s,createErf:er,createEvaluate:ar,createExp:sr,createExpm:rr,createExpm1:nr,createFactorial:tr,createFalse:ir,createFaraday:cr,createFermiCoupling:or,createFft:dr,createFibonacciHeapClass:pr,createFilter:lr,createFilterTransform:vr,createFineStructure:ur,createFirstRadiation:mr,createFix:fr,createFlatten:Dr,createFloor:hr,createForEach:gr,createForEachTransform:br,createFormat:xr,createFraction:yr,createFractionClass:_r,createFreqz:Cr,createFunctionAssignmentNode:Sr,createFunctionNode:Nr,createGamma:kr,createGasConstant:Tr,createGcd:Fr,createGetMatrixDataType:Mr,createGravitationConstant:wr,createGravity:Er,createHartreeEnergy:Rr,createHasNumericValue:jr,createHelp:Ar,createHelpClass:Pr,createHex:Ir,createHypot:Or,createI:qr,createIdentity:Lr,createIfft:zr,createIm:Ur,createImmutableDenseMatrixClass:Br,createIndex:Qr,createIndexClass:Hr,createIndexNode:Wr,createIndexTransform:Gr,createInfinity:Vr,createIntersect:Yr,createInv:Zr,createInverseConductanceQuantum:Xr,createInvmod:Jr,createIsInteger:Kr,createIsNaN:$r,createIsNegative:en,createIsNumeric:an,createIsPositive:sn,createIsPrime:rn,createIsZero:nn,createKldivergence:tn,createKlitzing:cn,createKron:on,createLN10:dn,createLN2:pn,createLOG10E:ln,createLOG2E:vn,createLarger:un,createLargerEq:mn,createLcm:fn,createLeafCount:Dn,createLeftShift:hn,createLgamma:gn,createLog:bn,createLog10:xn,createLog1p:yn,createLog2:_n,createLoschmidt:Cn,createLsolve:Sn,createLsolveAll:Nn,createLup:kn,createLusolve:Tn,createLyap:Fn,createMad:Mn,createMagneticConstant:wn,createMagneticFluxQuantum:En,createMap:Rn,createMapTransform:jn,createMatrix:An,createMatrixClass:Pn,createMatrixFromColumns:In,createMatrixFromFunction:On,createMatrixFromRows:qn,createMax:Ln,createMaxTransform:zn,createMean:Un,createMeanTransform:Bn,createMedian:Qn,createMin:Hn,createMinTransform:Wn,createMod:Gn,createMode:Vn,createMolarMass:Yn,createMolarMassC12:Zn,createMolarPlanckConstant:Xn,createMolarVolume:Jn,createMultinomial:Kn,createMultiply:$n,createMultiplyScalar:et,createNaN:at,createNeutronMass:st,createNode:rt,createNorm:nt,createNot:tt,createNthRoot:it,createNthRoots:ct,createNuclearMagneton:ot,createNull:dt,createNumber:pt,createNumeric:lt,createObjectNode:vt,createOct:ut,createOnes:mt,createOperatorNode:ft,createOr:Dt,createOrTransform:ht,createParenthesisNode:gt,createParse:bt,createParser:xt,createParserClass:yt,createPartitionSelect:_t,createPermutations:Ct,createPhi:St,createPi:Nt,createPickRandom:kt,createPinv:Tt,createPlanckCharge:Ft,createPlanckConstant:Mt,createPlanckLength:wt,createPlanckMass:Et,createPlanckTemperature:Rt,createPlanckTime:jt,createPolynomialRoot:At,createPow:Pt,createPrint:It,createPrintTransform:Ot,createProd:qt,createProtonMass:Lt,createQr:zt,createQuantileSeq:Ut,createQuantileSeqTransform:Bt,createQuantumOfCirculation:Qt,createRandom:Ht,createRandomInt:Wt,createRange:Gt,createRangeClass:Vt,createRangeNode:Yt,createRangeTransform:Zt,createRationalize:Xt,createRe:Jt,createReducedPlanckConstant:Kt,createRelationalNode:$t,createReplacer:ei,createReshape:ai,createResize:si,createResolve:ri,createResultSet:ni,createReviver:ti,createRightArithShift:ii,createRightLogShift:ci,createRotate:oi,createRotationMatrix:di,createRound:pi,createRow:li,createRowTransform:vi,createRydberg:ui,createSQRT1_2:mi,createSQRT2:fi,createSackurTetrode:Di,createSchur:hi,createSec:gi,createSech:bi,createSecondRadiation:xi,createSetCartesian:yi,createSetDifference:_i,createSetDistinct:Ci,createSetIntersect:Si,createSetIsSubset:Ni,createSetMultiplicity:ki,createSetPowerset:Ti,createSetSize:Fi,createSetSymDifference:Mi,createSetUnion:wi,createSign:Ei,createSimplify:Ri,createSimplifyConstant:ji,createSimplifyCore:Ai,createSin:Pi,createSinh:Ii,createSize:Oi,createSlu:qi,createSmaller:Li,createSmallerEq:zi,createSolveODE:Ui,createSort:Bi,createSpaClass:Qi,createSparse:Hi,createSparseMatrixClass:Wi,createSpeedOfLight:Gi,createSplitUnit:Vi,createSqrt:Yi,createSqrtm:Zi,createSquare:Xi,createSqueeze:Ji,createStd:Ki,createStdTransform:$i,createStefanBoltzmann:ec,createStirlingS2:ac,createString:sc,createSubset:rc,createSubsetTransform:nc,createSubtract:tc,createSubtractScalar:ic,createSum:cc,createSumTransform:oc,createSylvester:dc,createSymbolNode:pc,createSymbolicEqual:lc,createTan:vc,createTanh:uc,createTau:mc,createThomsonCrossSection:fc,createTo:Dc,createTrace:hc,createTranspose:gc,createTrue:bc,createTypeOf:xc,createTyped:yc,createUnaryMinus:_c,createUnaryPlus:Cc,createUnequal:Sc,createUnit:nv,createUnitClass:Nc,createUnitDependencies:Fh,createUnitFunction:kc,createUppercaseE:Tc,createUppercasePi:Fc,createUsolve:Mc,createUsolveAll:wc,createVacuumImpedance:Ec,createVariance:Rc,createVarianceTransform:jc,createVersion:Ac,createWeakMixingAngle:Pc,createWienDisplacement:Ic,createXgcd:Oc,createXor:qc,createZeros:Lc,createZeta:zc,createZpk2tf:Uc,cross:tv,crossDependencies:Mh,csc:iv,cscDependencies:wh,csch:cv,cschDependencies:Eh,ctranspose:ov,ctransposeDependencies:eo,cube:dv,cubeDependencies:Rh,cumsum:pv,cumsumDependencies:jh,cumsumTransformDependencies:Ah,deepEqual:lv,deepEqualDependencies:so,derivative:vv,derivativeDependencies:Ph,det:uv,detDependencies:ld,deuteronMass:mv,deuteronMassDependencies:Ih,diag:fv,diagDependencies:Td,diff:Dv,diffDependencies:Oh,diffTransformDependencies:qh,distance:hv,distanceDependencies:Lh,divide:gv,divideDependencies:F,divideScalar:bv,divideScalarDependencies:y,docs:xv,dot:yv,dotDependencies:Ge,dotDivide:_v,dotDivideDependencies:Ie,dotMultiply:Cv,dotMultiplyDependencies:zh,dotPow:Sv,dotPowDependencies:Uh,e:Nv,eDependencies:Fd,efimovFactor:kv,efimovFactorDependencies:Bh,eigs:Tv,eigsDependencies:Rd,electricConstant:Fv,electricConstantDependencies:Qh,electronMass:Mv,electronMassDependencies:Hh,elementaryCharge:wv,elementaryChargeDependencies:Wh,equal:Ev,equalDependencies:B,equalScalar:Rv,equalScalarDependencies:v,equalText:jv,equalTextDependencies:Gh,erf:Av,erfDependencies:Vh,evaluate:Pv,evaluateDependencies:lo,exp:Iv,expDependencies:jd,expm:Ov,expm1:qv,expm1Dependencies:Zh,expmDependencies:Yh,factorial:Lv,factorialDependencies:Ae,factory:So,falseDependencies:Xh,faraday:zv,faradayDependencies:Jh,fermiCoupling:Uv,fermiCouplingDependencies:Kh,fft:Bv,fftDependencies:Od,filter:Qv,filterDependencies:$h,filterTransformDependencies:eg,fineStructure:Hv,fineStructureDependencies:ag,firstRadiation:Wv,firstRadiationDependencies:sg,fix:Gv,fixDependencies:pd,flatten:Vv,flattenDependencies:Oe,floor:Yv,floorDependencies:dd,forEach:Zv,forEachDependencies:rg,forEachTransformDependencies:ng,format:Xv,formatDependencies:je,fraction:Jv,fractionDependencies:Ne,freqz:Kv,freqzDependencies:tg,gamma:$v,gammaDependencies:Xc,gasConstant:eu,gasConstantDependencies:ig,gcd:au,gcdDependencies:cg,getMatrixDataType:su,getMatrixDataTypeDependencies:Jc,gravitationConstant:ru,gravitationConstantDependencies:og,gravity:nu,gravityDependencies:dg,hartreeEnergy:tu,hartreeEnergyDependencies:pg,hasNumericValue:iu,hasNumericValueDependencies:lg,help:cu,helpDependencies:vg,hex:ou,hexDependencies:ug,hypot:du,hypotDependencies:mg,i:pu,iDependencies:Ad,identity:lu,identityDependencies:ie,ifft:vu,ifftDependencies:fg,im:uu,imDependencies:to,index:mu,indexDependencies:zd,indexTransformDependencies:Dg,intersect:fu,intersectDependencies:gg,inv:Du,invDependencies:De,inverseConductanceQuantum:hu,inverseConductanceQuantumDependencies:bg,invmod:gu,invmodDependencies:xg,isAccessorNode:Ho,isArray:Mo,isArrayNode:Wo,isAssignmentNode:Go,isBigNumber:Wc,isBlockNode:Vo,isBoolean:Po,isChain:id,isCollection:wo,isComplex:Hc,isConditionalNode:Yo,isConstantNode:Zo,isDate:Lo,isDenseMatrix:Eo,isFraction:Gc,isFunction:qo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isHelp:Oo,isIndex:Ao,isIndexNode:Ko,isInteger:bu,isIntegerDependencies:O,isMatrix:Vc,isNaN:xu,isNaNDependencies:qe,isNegative:yu,isNegativeDependencies:ce,isNode:$o,isNull:Bo,isNumber:To,isNumeric:_u,isNumericDependencies:me,isObject:Uo,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isPositive:Cu,isPositiveDependencies:he,isPrime:Su,isPrimeDependencies:yg,isRange:jo,isRangeNode:rd,isRegExp:zo,isRelationalNode:nd,isResultSet:Io,isSparseMatrix:Ro,isString:Fo,isSymbolNode:td,isUndefined:Qo,isUnit:Qc,isZero:Nu,isZeroDependencies:X,kldivergence:ku,kldivergenceDependencies:_g,klitzing:Tu,klitzingDependencies:Cg,kron:Fu,kronDependencies:Sg,larger:Mu,largerDependencies:P,largerEq:wu,largerEqDependencies:Ye,lcm:Eu,lcmDependencies:Mg,leafCount:Ru,leafCountDependencies:wg,leftShift:ju,leftShiftDependencies:Eg,lgamma:Au,lgammaDependencies:Rg,log:Pu,log10:Iu,log10Dependencies:jg,log1p:Ou,log1pDependencies:Ag,log2:qu,log2Dependencies:Pd,logDependencies:vo,loschmidt:Lu,loschmidtDependencies:Pg,lsolve:zu,lsolveAll:Uu,lsolveAllDependencies:Ig,lsolveDependencies:Qd,lup:Bu,lupDependencies:Wd,lusolve:Qu,lusolveDependencies:Vd,lyap:Hu,lyapDependencies:Og,mad:Wu,madDependencies:qg,magneticConstant:Gu,magneticConstantDependencies:Lg,magneticFluxQuantum:Vu,magneticFluxQuantumDependencies:zg,map:Yu,mapDependencies:xe,mapTransformDependencies:Ug,matrix:Zu,matrixDependencies:a,matrixFromColumns:Xu,matrixFromColumnsDependencies:io,matrixFromFunction:Ju,matrixFromFunctionDependencies:Bg,matrixFromRows:Ku,matrixFromRowsDependencies:Qg,max:$u,maxDependencies:mo,maxTransformDependencies:Hg,mean:em,meanDependencies:Sd,meanTransformDependencies:Wg,median:am,medianDependencies:Xd,min:sm,minDependencies:Gg,minTransformDependencies:Vg,mod:rm,modDependencies:Ud,mode:nm,modeDependencies:Yg,molarMass:tm,molarMassC12:im,molarMassC12Dependencies:Xg,molarMassDependencies:Zg,molarPlanckConstant:cm,molarPlanckConstantDependencies:Jg,molarVolume:om,molarVolumeDependencies:Kg,multinomial:dm,multinomialDependencies:$g,multiply:pm,multiplyDependencies:D,multiplyScalar:lm,multiplyScalarDependencies:C,neutronMass:vm,neutronMassDependencies:ab,norm:um,normDependencies:uo,not:mm,notDependencies:We,nthRoot:fm,nthRootDependencies:sb,nthRoots:Dm,nthRootsDependencies:rb,nuclearMagneton:hm,nuclearMagnetonDependencies:nb,nullDependencies:tb,number:gm,numberDependencies:se,numeric:bm,numericDependencies:Z,oct:xm,octDependencies:ib,ones:ym,onesDependencies:cb,or:_m,orDependencies:ob,orTransformDependencies:db,parse:Cm,parseDependencies:ee,parser:Sm,parserDependencies:pb,partitionSelect:Nm,partitionSelectDependencies:Ke,permutations:km,permutationsDependencies:lb,phi:Tm,phiDependencies:vb,pi:Fm,piDependencies:fo,pickRandom:Mm,pickRandomDependencies:ub,pinv:wm,pinvDependencies:mb,planckCharge:Em,planckChargeDependencies:fb,planckConstant:Rm,planckConstantDependencies:Db,planckLength:jm,planckLengthDependencies:hb,planckMass:Am,planckMassDependencies:gb,planckTemperature:Pm,planckTemperatureDependencies:bb,planckTime:Im,planckTimeDependencies:xb,polynomialRoot:Om,polynomialRootDependencies:yb,pow:qm,powDependencies:H,print:Lm,printDependencies:_b,printTransformDependencies:Cb,prod:zm,prodDependencies:Nd,protonMass:Um,protonMassDependencies:Sb,qr:Bm,qrDependencies:co,quantileSeq:Qm,quantileSeqDependencies:Nb,quantileSeqTransformDependencies:kb,quantumOfCirculation:Hm,quantumOfCirculationDependencies:Tb,random:Wm,randomDependencies:Fb,randomInt:Gm,randomIntDependencies:Mb,range:Vm,rangeDependencies:Fe,rangeTransformDependencies:Eb,rationalize:Ym,rationalizeDependencies:Rb,re:Zm,reDependencies:oo,reducedPlanckConstant:Xm,reducedPlanckConstantDependencies:jb,replacer:Jm,replacerDependencies:Ab,reshape:Km,reshapeDependencies:wd,resize:$m,resizeDependencies:Pb,resolve:ef,resolveDependencies:kd,reviver:af,reviverDependencies:Ib,rightArithShift:sf,rightArithShiftDependencies:Ob,rightLogShift:rf,rightLogShiftDependencies:qb,rotate:nf,rotateDependencies:Lb,rotationMatrix:tf,rotationMatrixDependencies:$d,round:cf,roundDependencies:ke,row:of,rowDependencies:zb,rowTransformDependencies:Ub,rydberg:df,rydbergDependencies:Bb,sackurTetrode:pf,sackurTetrodeDependencies:Wb,schur:lf,schurDependencies:Yd,sec:vf,secDependencies:Gb,sech:uf,sechDependencies:Vb,secondRadiation:mf,secondRadiationDependencies:Yb,setCartesian:ff,setCartesianDependencies:Zb,setDifference:Df,setDifferenceDependencies:ep,setDistinct:hf,setDistinctDependencies:Xb,setIntersect:gf,setIntersectDependencies:ap,setIsSubset:bf,setIsSubsetDependencies:Jb,setMultiplicity:xf,setMultiplicityDependencies:Kb,setPowerset:yf,setPowersetDependencies:$b,setSize:_f,setSizeDependencies:ex,setSymDifference:Cf,setSymDifferenceDependencies:sp,setUnion:Sf,setUnionDependencies:ax,sign:Nf,signDependencies:Md,simplify:kf,simplifyConstant:Tf,simplifyConstantDependencies:ro,simplifyCore:Ff,simplifyCoreDependencies:no,simplifyDependencies:Xe,sin:Mf,sinDependencies:Je,sinh:wf,sinhDependencies:sx,size:Ef,sizeDependencies:w,slu:Rf,sluDependencies:Gd,smaller:jf,smallerDependencies:I,smallerEq:Af,smallerEqDependencies:Te,solveODE:Pf,solveODEDependencies:rx,sort:If,sortDependencies:nx,sparse:Of,sparseDependencies:tx,speedOfLight:qf,speedOfLightDependencies:ix,splitUnit:Lf,splitUnitDependencies:cx,sqrt:zf,sqrtDependencies:J,sqrtm:Uf,sqrtmDependencies:ox,square:Bf,squareDependencies:dx,squeeze:Qf,squeezeDependencies:px,std:Hf,stdDependencies:lx,stdTransformDependencies:vx,stefanBoltzmann:Wf,stefanBoltzmannDependencies:ux,stirlingS2:Gf,stirlingS2Dependencies:vd,string:Vf,stringDependencies:mx,subset:Yf,subsetDependencies:q,subsetTransformDependencies:fx,subtract:Zf,subtractDependencies:S,subtractScalar:Xf,subtractScalarDependencies:Q,sum:Jf,sumDependencies:Kc,sumTransformDependencies:Dx,sylvester:Kf,sylvesterDependencies:Zd,symbolicEqual:$f,symbolicEqualDependencies:hx,tan:eD,tanDependencies:gx,tanh:aD,tanhDependencies:bx,tau:sD,tauDependencies:Id,thomsonCrossSection:rD,thomsonCrossSectionDependencies:xx,to:nD,toDependencies:yx,trace:tD,traceDependencies:_x,transpose:iD,transposeDependencies:Pe,trueDependencies:Cx,typeOf:cD,typeOfDependencies:Kd,typed:oD,typedDependencies:e,unaryMinus:dD,unaryMinusDependencies:K,unaryPlus:pD,unaryPlusDependencies:ao,unequal:lD,unequalDependencies:Sx,unit:vD,unitDependencies:Nx,usolve:uD,usolveAll:mD,usolveAllDependencies:Ed,usolveDependencies:po,vacuumImpedance:fD,vacuumImpedanceDependencies:Fx,variance:DD,varianceDependencies:Do,varianceTransformDependencies:Mx,version:hD,versionDependencies:wx,weakMixingAngle:gD,weakMixingAngleDependencies:Ex,wienDisplacement:bD,wienDisplacementDependencies:Rx,xgcd:xD,xgcdDependencies:Bd,xor:yD,xorDependencies:jx,zeros:_D,zerosDependencies:M,zeta:CD,zetaDependencies:Ax,zpk2tf:SD,zpk2tfDependencies:Px},Symbol.toStringTag,{value:"Module"})),Bx={name:"ns-profit-report",props:["storeLogo","storeName"],data(){return{categoryNames:"",unitNames:"",startDateField:{type:"datetimepicker",value:Qe(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:Qe(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{value:[],label:ve("Filter by Category")},unitField:{value:[],label:ve("Filter by Units")},products:[],ns:window.ns,math:Ux}},components:{nsDatepicker:kD,nsDateTimePicker:TD},computed:{totalQuantities(){return this.products.length>0?this.products.map(n=>n.quantity).reduce((n,l)=>n+l):0},totalPurchasePrice(){return this.products.length>0?this.products.map(n=>n.total_purchase_price).reduce((n,l)=>n+l):0},totalSalePrice(){return this.products.length>0?this.products.map(n=>n.total_price).reduce((n,l)=>n+l):0},totalProfit(){return this.products.length>0?this.products.map(n=>sa(n.total_price).subtract(sa(n.total_purchase_price).add(n.tax_value).done())).reduce((n,l)=>n+l):0},totalTax(){return this.products.length>0?this.products.map(n=>n.tax_value).reduce((n,l)=>n+l):0}},methods:{__:ve,nsCurrency:MD,printSaleReport(){this.$htmlToPaper("profit-report")},setStartDate(n){this.startDate=n.format()},async selectCategories(){try{const n=await _o("/api/categories",this.categoryField.label,this.categoryField.value);this.categoryField.value=n.values,this.categoryNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Ee.error(ve("An error has occured while loading the categories")).subscribe()}},async selectUnit(){try{const n=await _o("/api/units",this.unitField.label,this.unitField.value);this.unitField.value=n.values,this.unitNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Ee.error(ve("An error has occured while loading the units")).subscribe()}},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return Ee.error(ve("Unable to proceed. Select a correct time range.")).subscribe();const n=Qe(this.startDateField.value);if(Qe(this.endDateField.value).isBefore(n))return Ee.error(ve("Unable to proceed. The current time range is not valid.")).subscribe();ND.post("/api/reports/profit-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:i=>{this.products=i},error:i=>{Ee.error(i.message).subscribe()}})},setEndDate(n){this.endDate=n.format()}}},Qx={id:"report-section",class:"px-4"},Hx={class:"flex -mx-2"},Wx={class:"px-2"},Gx={class:"px-2"},Vx={class:"px-2"},Yx=t("i",{class:"las la-sync-alt text-xl"},null,-1),Zx={class:"pl-2"},Xx={class:"px-2"},Jx=t("i",{class:"las la-print text-xl"},null,-1),Kx={class:"pl-2"},$x={class:"px-2"},ey=t("i",{class:"las la-filter text-xl"},null,-1),ay={class:"pl-2"},sy={class:"px-2"},ry=t("i",{class:"las la-filter text-xl"},null,-1),ny={class:"pl-2"},ty={id:"profit-report",class:"anim-duration-500 fade-in-entrance"},iy={class:"flex w-full"},cy={class:"my-4 flex justify-between w-full"},oy={class:"text-secondary"},dy={class:"pb-1 border-b border-dashed"},py={class:"pb-1 border-b border-dashed"},ly={class:"pb-1 border-b border-dashed"},vy=["src","alt"],uy={class:"shadow rounded my-4"},my={class:"ns-box"},fy={class:"border-b ns-box-body"},Dy={class:"table ns-table w-full"},hy={class:"border p-2 text-left"},gy={width:"110",class:"text-right border p-2"},by={width:"110",class:"text-right border p-2"},xy={width:"110",class:"text-right border p-2"},yy={width:"110",class:"text-right border p-2"},_y={width:"110",class:"text-right border p-2"},Cy={width:"110",class:"text-right border p-2"},Sy={class:"p-2 border border-box-edge"},Ny={class:"p-2 border text-right border-box-edge"},ky={class:"p-2 border text-right border-box-edge"},Ty={class:"p-2 border text-right border-box-edge"},Fy={class:"p-2 border text-right border-box-edge"},My={class:"p-2 border text-right border-box-edge"},wy={class:"p-2 border text-right border-box-edge"},Ey={class:"font-semibold"},Ry=t("td",{colspan:"2",class:"p-2 border"},null,-1),jy={class:"p-2 border text-right"},Ay={class:"p-2 border text-right"},Py={class:"p-2 border text-right"},Iy={class:"p-2 border text-right"},Oy={class:"p-2 border text-right"};function qy(n,l,i,o,x,d){const W=ED("ns-field");return ea(),aa("div",Qx,[t("div",Hx,[t("div",Wx,[Co(W,{field:x.startDateField},null,8,["field"])]),t("div",Gx,[Co(W,{field:x.endDateField},null,8,["field"])]),t("div",Vx,[t("button",{onClick:l[0]||(l[0]=_=>d.loadReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Yx,t("span",Zx,g(d.__("Load")),1)])]),t("div",Xx,[t("button",{onClick:l[1]||(l[1]=_=>d.printSaleReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Jx,t("span",Kx,g(d.__("Print")),1)])]),t("div",$x,[t("button",{onClick:l[2]||(l[2]=_=>d.selectCategories()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[ey,t("span",ay,g(d.__("Category"))+": "+g(x.categoryNames||d.__("All Categories")),1)])]),t("div",sy,[t("button",{onClick:l[3]||(l[3]=_=>d.selectUnit()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[ry,t("span",ny,g(d.__("Unit"))+": "+g(x.unitNames||d.__("All Units")),1)])])]),t("div",ty,[t("div",iy,[t("div",cy,[t("div",oy,[t("ul",null,[t("li",dy,g(d.__("Range : {date1} — {date2}").replace("{date1}",x.startDateField.value).replace("{date2}",x.endDateField.value)),1),t("li",py,g(d.__("Document : Profit Report")),1),t("li",ly,g(d.__("By : {user}").replace("{user}",x.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,vy)])])]),t("div",uy,[t("div",my,[t("div",fy,[t("table",Dy,[t("thead",null,[t("tr",null,[t("th",hy,g(d.__("Product")),1),t("th",gy,g(d.__("Unit")),1),t("th",by,g(d.__("Quantity")),1),t("th",xy,g(d.__("COGS")),1),t("th",yy,g(d.__("Sale Price")),1),t("th",_y,g(d.__("Taxes")),1),t("th",Cy,g(d.__("Profit")),1)])]),t("tbody",null,[(ea(!0),aa(RD,null,jD(x.products,_=>(ea(),aa("tr",{key:_.id,class:AD(_.total_price-_.total_purchase_price<0?"bg-error-primary":"bg-box-background")},[t("td",Sy,g(_.name),1),t("td",Ny,g(_.unit_name),1),t("td",ky,g(_.quantity),1),t("td",Ty,g(d.nsCurrency(_.total_purchase_price)),1),t("td",Fy,g(d.nsCurrency(_.total_price)),1),t("td",My,g(d.nsCurrency(_.tax_value)),1),t("td",wy,g(d.nsCurrency(x.math.chain(_.total_price).subtract(x.math.chain(_.total_purchase_price).add(_.tax_value).done()).done())),1)],2))),128))]),t("tfoot",Ey,[t("tr",null,[Ry,t("td",jy,g(d.totalQuantities),1),t("td",Ay,g(d.nsCurrency(d.totalPurchasePrice)),1),t("td",Py,g(d.nsCurrency(d.totalSalePrice)),1),t("td",Iy,g(d.nsCurrency(d.totalTax)),1),t("td",Oy,g(d.nsCurrency(d.totalProfit)),1)])])])])])])])])}const Xy=wD(Bx,[["render",qy]]);export{Xy as default}; diff --git a/public/build/assets/ns-profit-report-a9e68261.js b/public/build/assets/ns-profit-report-a9e68261.js new file mode 100644 index 000000000..b38cc8627 --- /dev/null +++ b/public/build/assets/ns-profit-report-a9e68261.js @@ -0,0 +1 @@ +import{I as na,J as ta,K as ia,L as ca,M as oa,N as da,O as pa,Q as la,R as va,U as ua,W as ma,X as fa,Y as Da,Z as ha,_ as ga,$ as ba,a0 as xa,a1 as ya,a2 as _a,a3 as Ca,a4 as Sa,a5 as Na,a6 as ka,a7 as Ta,a8 as Fa,a9 as Ma,aa as wa,ab as Ra,ac as Ea,ad as ja,ae as Aa,af as Pa,ag as Ia,ah as Oa,ai as qa,aj as La,ak as za,al as Ua,am as Ba,an as Qa,ao as Ha,ap as Wa,aq as Ga,ar as Va,as as Ya,at as Za,au as Xa,av as Ja,aw as Ka,ax as $a,ay as es,az as as,aA as ss,aB as rs,aC as ts,aD as is,aE as cs,aF as os,aG as ds,aH as ps,aI as ls,aJ as vs,aK as us,aL as ms,aM as fs,aN as Ds,aO as hs,aP as gs,aQ as bs,aR as xs,aS as ys,aT as _s,aU as Cs,aV as Ss,aW as Ns,aX as ks,aY as Ts,aZ as Fs,a_ as Ms,a$ as ws,b0 as Rs,b1 as Es,b2 as js,b3 as As,b4 as Ps,b5 as Is,b6 as Os,b7 as qs,b8 as Ls,b9 as zs,ba as Us,bb as Bs,bc as Qs,bd as Hs,be as Ws,bf as Gs,bg as Vs,bh as Ys,bi as Zs,bj as Xs,bk as Js,bl as Ks,bm as $s,bn as er,bo as ar,bp as sr,bq as rr,br as nr,bs as tr,bt as ir,bu as cr,bv as or,bw as dr,bx as pr,by as lr,bz as vr,bA as ur,bB as mr,bC as fr,bD as Dr,bE as hr,bF as gr,bG as br,bH as xr,bI as yr,bJ as _r,bK as Cr,bL as Sr,bM as Nr,bN as kr,bO as Tr,bP as Fr,bQ as Mr,bR as wr,bS as Rr,bT as Er,bU as jr,bV as Ar,bW as Pr,bX as Ir,bY as Or,bZ as qr,b_ as Lr,b$ as zr,c0 as Ur,c1 as Br,c2 as Qr,c3 as Hr,c4 as Wr,c5 as Gr,c6 as Vr,c7 as Yr,c8 as Zr,c9 as Xr,ca as Jr,cb as Kr,cc as $r,cd as en,ce as an,cf as sn,cg as rn,ch as nn,ci as tn,cj as cn,ck as on,cl as dn,cm as pn,cn as ln,co as vn,cp as un,cq as mn,cr as fn,cs as Dn,ct as hn,cu as gn,cv as bn,cw as xn,cx as yn,cy as _n,cz as Cn,cA as Sn,cB as Nn,cC as kn,cD as Tn,cE as Fn,cF as Mn,cG as wn,cH as Rn,cI as En,cJ as jn,cK as An,cL as Pn,cM as In,cN as On,cO as qn,cP as Ln,cQ as zn,cR as Un,cS as Bn,cT as Qn,cU as Hn,cV as Wn,cW as Gn,cX as Vn,cY as Yn,cZ as Zn,c_ as Xn,c$ as Jn,d0 as Kn,d1 as $n,d2 as et,d3 as at,d4 as st,d5 as rt,d6 as nt,d7 as tt,d8 as it,d9 as ct,da as ot,db as dt,dc as pt,dd as lt,de as vt,df as ut,dg as mt,dh as ft,di as Dt,dj as ht,dk as gt,dl as bt,dm as xt,dn as yt,dp as _t,dq as Ct,dr as St,ds as Nt,dt as kt,du as Tt,dv as Ft,dw as Mt,dx as wt,dy as Rt,dz as Et,dA as jt,dB as At,dC as Pt,dD as It,dE as Ot,dF as qt,dG as Lt,dH as zt,dI as Ut,dJ as Bt,dK as Qt,dL as Ht,dM as Wt,dN as Gt,dO as Vt,dP as Yt,dQ as Zt,dR as Xt,dS as Jt,dT as Kt,dU as $t,dV as ei,dW as ai,dX as si,dY as ri,dZ as ni,d_ as ti,d$ as ii,e0 as ci,e1 as oi,e2 as di,e3 as pi,e4 as li,e5 as vi,e6 as ui,e7 as mi,e8 as fi,e9 as Di,ea as hi,eb as gi,ec as bi,ed as xi,ee as yi,ef as _i,eg as Ci,eh as Si,ei as Ni,ej as ki,ek as Ti,el as Fi,em as Mi,en as wi,eo as Ri,ep as Ei,eq as ji,er as Ai,es as Pi,et as Ii,eu as Oi,ev as qi,ew as Li,ex as zi,ey as Ui,ez as Bi,eA as Qi,eB as Hi,eC as Wi,eD as Gi,eE as Vi,eF as Yi,eG as Zi,eH as Xi,eI as Ji,eJ as Ki,eK as $i,eL as ec,eM as ac,eN as sc,eO as rc,eP as nc,eQ as tc,eR as ic,eS as cc,eT as oc,eU as dc,eV as pc,eW as lc,eX as vc,eY as uc,eZ as mc,e_ as fc,e$ as Dc,f0 as hc,f1 as gc,f2 as bc,f3 as xc,f4 as yc,f5 as _c,f6 as Cc,f7 as Sc,f8 as Nc,f9 as kc,fa as Tc,fb as Fc,fc as Mc,fd as wc,fe as Rc,ff as Ec,fg as jc,fh as Ac,fi as Pc,fj as Ic,fk as Oc,fl as qc,fm as Lc,fn as zc,fo as Uc,fp as Bc,fq as Qc,fr as _e,fs as Ee,ft as xo,fu as ea,fv as Hc,fw as Wc,fx as Gc,fy as Vc,fz as Yc,fA as tp,fB as ip,fC as cp,fD as op,fE as dp,fF as yo,fG as So,fH as pp,fI as No,fJ as ko,fK as To,fL as Fo,fM as Mo,fN as wo,fO as Ro,fP as Eo,fQ as jo,fR as Ao,fS as Po,fT as Io,fU as Oo,fV as qo,fW as Lo,fX as zo,fY as Uo,fZ as Bo,f_ as Qo,f$ as Ho,g0 as Wo,g1 as Go,g2 as Vo,g3 as Yo,g4 as Zo,g5 as Xo,g6 as Jo,g7 as Ko,g8 as $o,g9 as ed,ga as ad,gb as sd,gc as rd,gd as nd,ge as td,gf as id,gg as lp,gh as vp,gi as up,gj as mp,gk as fp,gl as Dp,gm as hp,gn as gp,go as bp,gp as xp,gq as yp,gr as _p,gs as Cp,gt as Sp,gu as Np,gv as kp,gw as Tp,gx as Fp,gy as Mp,gz as wp,gA as Rp,gB as Ep,gC as jp,gD as Ap,gE as Pp,gF as Ip,gG as Op,gH as qp,gI as Lp,gJ as zp,gK as Up,gL as Bp,gM as Qp,gN as Hp,gO as Wp,gP as Gp,gQ as Vp,gR as Yp,gS as Zp,gT as Xp,gU as Jp,gV as Kp,gW as $p,gX as el,gY as al,gZ as sl,g_ as rl,g$ as nl,h0 as tl,h1 as il,h2 as cl,h3 as ol,h4 as dl,h5 as pl,h6 as ll,h7 as vl,h8 as ul,h9 as ml,ha as fl,hb as Dl,hc as hl,hd as gl,he as bl,hf as xl,hg as yl,hh as _l,hi as Cl,hj as Sl,hk as Nl,hl as kl,hm as Tl,hn as Fl,ho as Ml,hp as wl,hq as Rl,hr as El,hs as jl,ht as Al,hu as Pl,f as ra,hv as Il,hw as Ol,hx as ql,hy as Ll,hz as zl,hA as Ul,hB as Bl,hC as Ql,hD as Hl,hE as Wl,hF as Gl,hG as Vl,hH as Yl,hI as Zl,hJ as Xl,hK as Jl,hL as Kl,hM as $l,hN as ev,hO as av,hP as sv,hQ as rv,hR as nv,hS as tv,hT as iv,hU as cv,hV as ov,hW as dv,hX as pv,hY as lv,hZ as vv,h_ as uv,h$ as mv,i0 as fv,i1 as Dv,i2 as hv,i3 as gv,i4 as bv,i5 as xv,i6 as yv,i7 as _v,i8 as Cv,i9 as Sv,ia as Nv,ib as kv,ic as Tv,id as Fv,ie as Mv,ig as wv,ih as Rv,ii as Ev,ij as jv,ik as Av,il as Pv,im as Iv,io as Ov,ip as qv,iq as Lv,ir as zv,is as Uv,it as Bv,iu as Qv,iv as Hv,iw as Wv,ix as Gv,iy as Vv,iz as Yv,iA as Zv,iB as Xv,iC as Jv,iD as Kv,iE as $v,iF as eu,iG as au,iH as su,iI as ru,iJ as nu,iK as tu,iL as iu,iM as cu,iN as ou,iO as du,iP as pu,iQ as lu,iR as vu,iS as uu,iT as mu,iU as fu,iV as Du,iW as hu,iX as gu,iY as bu,iZ as xu,i_ as yu,i$ as _u,j0 as Cu,j1 as Su,j2 as Nu,j3 as ku,j4 as Tu,j5 as Fu,j6 as Mu,j7 as wu,j8 as Ru,j9 as Eu,ja as ju,jb as Au,jc as Pu,jd as Iu,je as Ou,jf as qu,jg as Lu,jh as zu,ji as Uu,jj as Bu,jk as Qu,jl as Hu,jm as Wu,jn as Gu,jo as Vu,jp as Yu,jq as Zu,jr as Xu,js as Ju,jt as Ku,ju as $u,jv as em,jw as am,jx as sm,jy as rm,jz as nm,jA as tm,jB as im,jC as cm,jD as om,jE as dm,jF as pm,jG as lm,jH as vm,jI as um,jJ as mm,jK as fm,jL as Dm,jM as hm,jN as gm,jO as bm,jP as xm,jQ as ym,jR as _m,jS as Cm,jT as Sm,jU as Nm,jV as km,jW as Tm,jX as Fm,jY as Mm,jZ as wm,j_ as Rm,j$ as Em,k0 as jm,k1 as Am,k2 as Pm,k3 as Im,k4 as Om,k5 as qm,k6 as Lm,k7 as zm,k8 as Um,k9 as Bm,ka as Qm,kb as Hm,kc as Wm,kd as Gm,ke as Vm,kf as Ym,kg as Zm,kh as Xm,ki as Jm,kj as Km,kk as $m,kl as ef,km as af,kn as sf,ko as rf,kp as nf,kq as tf,kr as cf,ks as of,kt as df,ku as pf,kv as lf,kw as vf,kx as uf,ky as mf,kz as ff,kA as Df,kB as hf,kC as gf,kD as bf,kE as xf,kF as yf,kG as _f,kH as Cf,kI as Sf,kJ as Nf,kK as kf,kL as Tf,kM as Ff,kN as Mf,kO as wf,kP as Rf,kQ as Ef,kR as jf,kS as Af,kT as Pf,kU as If,kV as Of,kW as qf,kX as Lf,kY as zf,kZ as Uf,k_ as Bf,k$ as Qf,l0 as Hf,l1 as Wf,l2 as Gf,l3 as Vf,l4 as Yf,l5 as Zf,l6 as Xf,l7 as Jf,l8 as Kf,l9 as $f,la as eD,lb as aD,lc as sD,ld as rD,le as nD,lf as tD,lg as iD,lh as cD,li as oD,lj as dD,lk as pD,ll as lD,lm as vD,ln as uD,lo as mD,lp as fD,lq as DD,lr as hD,ls as gD,lt as bD,lu as xD,lv as yD,lw as _D,lx as CD,ly as SD,h as Qe,b as Re,a as ND}from"./bootstrap-8be442b1.js";import{c as kD,e as TD}from"./components-ef1ba55f.js";import{_ as ve,n as FD}from"./currency-f8bd78d1.js";import{s as _o}from"./select-api-entities-c72f4497.js";import{_ as MD}from"./_plugin-vue_export-helper-c27b6911.js";import{r as wD,o as aa,c as sa,a as t,f as Co,t as g,F as RD,b as ED,n as jD}from"./runtime-core.esm-bundler-b48de70a.js";import"./ns-alert-popup-5493aad8.js";import"./ns-avatar-image-35303576.js";import"./index.es-25aa42ee.js";import"./ns-prompt-popup-100414c5.js";import"./join-array-4b30b096.js";const AD=Object.freeze(Object.defineProperty({__proto__:null,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnitClass:kc,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc},Symbol.toStringTag,{value:"Module"}));var s={createBigNumberClass:Ra},h={createComplexClass:os},We={createMatrixClass:In},p={MatrixDependencies:We,createDenseMatrixClass:Es},ue={createFractionClass:Cr},e={BigNumberDependencies:s,ComplexDependencies:h,DenseMatrixDependencies:p,FractionDependencies:ue,createTyped:_c},A={typedDependencies:e,createAbs:na},R={createNode:nt},v={typedDependencies:e,createEqualScalar:$s},ae={MatrixDependencies:We,equalScalarDependencies:v,typedDependencies:e,createSparseMatrixClass:Gi},T={typedDependencies:e,createAddScalar:ua},O={typedDependencies:e,createIsInteger:$r},a={DenseMatrixDependencies:p,MatrixDependencies:We,SparseMatrixDependencies:ae,typedDependencies:e,createMatrix:Pn},f={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcat:ps},u={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAdd:va},M={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createZeros:zc},q={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubset:nc},Ce={NodeDependencies:R,subsetDependencies:q,createAccessorNode:ta},PD={ComplexDependencies:h,typedDependencies:e,createAcos:ia},ID={ComplexDependencies:h,typedDependencies:e,createAcosh:ca},OD={BigNumberDependencies:s,typedDependencies:e,createAcot:oa},qD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcoth:da},LD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAcsc:pa},zD={BigNumberDependencies:s,typedDependencies:e,createAcsch:la},Ge={typedDependencies:e,createNot:it},UD={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAnd:ma},BD={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createAndTransform:fa},Zc={isIntegerDependencies:O,typedDependencies:e,createApply:Da},QD={isIntegerDependencies:O,typedDependencies:e,createApplyTransform:ha},HD={typedDependencies:e,createArg:ga},Se={NodeDependencies:R,createArrayNode:ba},WD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsec:xa},GD={BigNumberDependencies:s,ComplexDependencies:h,typedDependencies:e,createAsech:ya},VD={ComplexDependencies:h,typedDependencies:e,createAsin:_a},YD={typedDependencies:e,createAsinh:Ca},cd={matrixDependencies:a,NodeDependencies:R,subsetDependencies:q,createAssignmentNode:Sa},od={typedDependencies:e,createAtan:Na},ZD={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createAtan2:ka},XD={ComplexDependencies:h,typedDependencies:e,createAtanh:Ta},L={BigNumberDependencies:s,typedDependencies:e,createBignumber:Ea},Ne={FractionDependencies:ue,typedDependencies:e,createFraction:_r},se={typedDependencies:e,createNumber:lt},Z={bignumberDependencies:L,fractionDependencies:Ne,numberDependencies:se,createNumeric:vt},y={numericDependencies:Z,typedDependencies:e,createDivideScalar:Us},B={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createEqual:Ks},ke={BigNumberDependencies:s,DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRound:li},Xc={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createCeil:Va},dd={DenseMatrixDependencies:p,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createFloor:gr},pd={ComplexDependencies:h,DenseMatrixDependencies:p,ceilDependencies:Xc,equalScalarDependencies:v,floorDependencies:dd,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createFix:Dr},je={typedDependencies:e,createFormat:yr},me={typedDependencies:e,createIsNumeric:sn},C={typedDependencies:e,createMultiplyScalar:at},ie={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createIdentity:zr},X={typedDependencies:e,createIsZero:tn},fe={typedDependencies:e,createConj:ms},w={matrixDependencies:a,typedDependencies:e,createSize:qi},Ve={addScalarDependencies:T,conjDependencies:fe,multiplyScalarDependencies:C,sizeDependencies:w,typedDependencies:e,createDot:Bs},D={addScalarDependencies:T,dotDependencies:Ve,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createMultiply:et},Q={typedDependencies:e,createSubtractScalar:cc},K={typedDependencies:e,createUnaryMinus:Cc},ld={divideScalarDependencies:y,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createDet:As},De={absDependencies:A,addScalarDependencies:T,detDependencies:ld,divideScalarDependencies:y,identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,unaryMinusDependencies:K,createInv:Xr},H={ComplexDependencies:h,fractionDependencies:Ne,identityDependencies:ie,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createPow:It},c={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalDependencies:B,fixDependencies:pd,formatDependencies:je,isNumericDependencies:me,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,roundDependencies:ke,subtractScalarDependencies:Q,createUnitClass:kc},JD={BigNumberDependencies:s,UnitDependencies:c,createAtomicMass:Fa},KD={BigNumberDependencies:s,UnitDependencies:c,createAvogadro:Ma},ce={typedDependencies:e,createIsNegative:an},Ye={typedDependencies:e,createCombinations:es},Jc={BigNumberDependencies:s,ComplexDependencies:h,multiplyScalarDependencies:C,powDependencies:H,typedDependencies:e,createGamma:Tr},Ae={gammaDependencies:Jc,typedDependencies:e,createFactorial:ir},P={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLarger:mn},vd={bignumberDependencies:L,addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,factorialDependencies:Ae,isIntegerDependencies:O,isNegativeDependencies:ce,largerDependencies:P,multiplyScalarDependencies:C,numberDependencies:se,powDependencies:H,subtractScalarDependencies:Q,typedDependencies:e,createStirlingS2:sc},$D={addScalarDependencies:T,isIntegerDependencies:O,isNegativeDependencies:ce,stirlingS2Dependencies:vd,typedDependencies:e,createBellNumbers:wa},eh={formatDependencies:je,typedDependencies:e,createBin:ja},ah={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitAnd:Aa},sh={addDependencies:u,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,notDependencies:Ge,typedDependencies:e,zerosDependencies:M,createBitAndTransform:Pa},rh={typedDependencies:e,createBitNot:Ia},nh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOr:Oa},th={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createBitOrTransform:qa},ih={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createBitXor:La},ud={createResultSet:ti},md={NodeDependencies:R,ResultSetDependencies:ud,createBlockNode:za},ch={BigNumberDependencies:s,UnitDependencies:c,createBohrMagneton:Ua},oh={BigNumberDependencies:s,UnitDependencies:c,createBohrRadius:Ba},dh={BigNumberDependencies:s,UnitDependencies:c,createBoltzmann:Qa},ph={typedDependencies:e,createBoolean:Ha},lh={addScalarDependencies:T,combinationsDependencies:Ye,divideScalarDependencies:y,isIntegerDependencies:O,isNegativeDependencies:ce,multiplyScalarDependencies:C,typedDependencies:e,createCatalan:Wa},fd={BigNumberDependencies:s,ComplexDependencies:h,FractionDependencies:ue,isNegativeDependencies:ce,matrixDependencies:a,typedDependencies:e,unaryMinusDependencies:K,createCbrt:Ga},Dd={typedDependencies:e,createChainClass:Za},vh={ChainDependencies:Dd,typedDependencies:e,createChain:Ya},uh={BigNumberDependencies:s,UnitDependencies:c,createClassicalElectronRadius:Xa},mh={typedDependencies:e,createClone:Ja},I={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmaller:zi},hd={DenseMatrixDependencies:p,smallerDependencies:I,createImmutableDenseMatrixClass:Qr},Kc={typedDependencies:e,createGetMatrixDataType:wr},E={ImmutableDenseMatrixDependencies:hd,getMatrixDataTypeDependencies:Kc,createIndexClass:Wr},he={typedDependencies:e,createIsPositive:rn},Ze={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createLargerEq:fn},Te={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createSmallerEq:Ui},Fe={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRange:Vt},gd={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumn:Ka},fh={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createColumnTransform:$a},Dh={typedDependencies:e,createCombinationsWithRep:as},ge={BigNumberDependencies:s,DenseMatrixDependencies:p,FractionDependencies:ue,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createCompare:ss},$={compareDependencies:ge,typedDependencies:e,createCompareNatural:rs},bd={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createCompareText:ts},xd={NodeDependencies:R,createConditionalNode:vs},oe={NodeDependencies:R,createConstantNode:fs},yd={NodeDependencies:R,typedDependencies:e,createFunctionAssignmentNode:Nr},de={UnitDependencies:c,NodeDependencies:R,createSymbolNode:lc},pe={NodeDependencies:R,SymbolNodeDependencies:de,createFunctionNode:kr},Me={NodeDependencies:R,sizeDependencies:w,createIndexNode:Gr},we={NodeDependencies:R,createObjectNode:ut},re={NodeDependencies:R,createOperatorNode:Dt},be={NodeDependencies:R,createParenthesisNode:bt},_d={NodeDependencies:R,createRangeNode:Zt},Cd={NodeDependencies:R,createRelationalNode:ei},ee={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,AssignmentNodeDependencies:cd,BlockNodeDependencies:md,ConditionalNodeDependencies:xd,ConstantNodeDependencies:oe,FunctionAssignmentNodeDependencies:yd,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,RangeNodeDependencies:_d,RelationalNodeDependencies:Cd,SymbolNodeDependencies:de,numericDependencies:Z,typedDependencies:e,createParse:xt},hh={parseDependencies:ee,typedDependencies:e,createCompile:is},Xe={ComplexDependencies:h,typedDependencies:e,createComplex:cs},gh={addScalarDependencies:T,combinationsDependencies:Ye,isIntegerDependencies:O,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,typedDependencies:e,createComposition:ds},bh={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createConcatTransform:ls},xh={BigNumberDependencies:s,UnitDependencies:c,createConductanceQuantum:us},F={divideScalarDependencies:y,equalScalarDependencies:v,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createDivide:zs},Sd={addDependencies:u,divideDependencies:F,typedDependencies:e,createMean:Bn},J={ComplexDependencies:h,typedDependencies:e,createSqrt:Zi},S={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createSubtract:ic},$c={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSum:oc},yh={addDependencies:u,divideDependencies:F,matrixDependencies:a,meanDependencies:Sd,multiplyDependencies:D,powDependencies:H,sqrtDependencies:J,subtractDependencies:S,sumDependencies:$c,typedDependencies:e,createCorr:Ds},eo={typedDependencies:e,createCos:hs},_h={typedDependencies:e,createCosh:gs},Ch={BigNumberDependencies:s,typedDependencies:e,createCot:bs},Sh={BigNumberDependencies:s,typedDependencies:e,createCoth:xs},Nh={BigNumberDependencies:s,UnitDependencies:c,createCoulomb:ys},Nd={multiplyScalarDependencies:C,numericDependencies:Z,typedDependencies:e,createProd:Lt},kh={prodDependencies:Nd,sizeDependencies:w,typedDependencies:e,createCount:_s},Th={UnitDependencies:c,typedDependencies:e,createCreateUnit:Cs},Fh={matrixDependencies:a,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createCross:Ss},Mh={BigNumberDependencies:s,typedDependencies:e,createCsc:Ns},wh={BigNumberDependencies:s,typedDependencies:e,createCsch:ks},Pe={matrixDependencies:a,typedDependencies:e,createTranspose:bc},ao={conjDependencies:fe,transposeDependencies:Pe,typedDependencies:e,createCtranspose:Ts},Rh={typedDependencies:e,createCube:Fs},so={BigNumberDependencies:s,typedDependencies:e,createUnaryPlus:Sc},Eh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSum:Ms},jh={addDependencies:u,typedDependencies:e,unaryPlusDependencies:so,createCumSumTransform:ws},ro={equalDependencies:B,typedDependencies:e,createDeepEqual:Rs},kd={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,parseDependencies:ee,typedDependencies:e,createResolve:ni},no={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,SymbolNodeDependencies:de,matrixDependencies:a,typedDependencies:e,createSimplifyConstant:Ai},to={AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,subtractDependencies:S,typedDependencies:e,createSimplifyCore:Pi},Je={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,resolveDependencies:kd,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createSimplify:ji},Ah={ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,equalDependencies:B,isZeroDependencies:X,numericDependencies:Z,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createDerivative:js},Ph={BigNumberDependencies:s,UnitDependencies:c,createDeuteronMass:Ps},Td={DenseMatrixDependencies:p,SparseMatrixDependencies:ae,matrixDependencies:a,typedDependencies:e,createDiag:Is},Ih={matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiff:Os},Oh={bignumberDependencies:L,matrixDependencies:a,numberDependencies:se,subtractDependencies:S,typedDependencies:e,createDiffTransform:qs},qh={absDependencies:A,addScalarDependencies:T,deepEqualDependencies:ro,divideScalarDependencies:y,multiplyScalarDependencies:C,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,createDistance:Ls},Ie={DenseMatrixDependencies:p,concatDependencies:f,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createDotDivide:Qs},Lh={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createDotMultiply:Hs},zh={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,powDependencies:H,typedDependencies:e,createDotPow:Ws},Fd={BigNumberDependencies:s,createE:Gs},Uh={BigNumberDependencies:s,createEfimovFactor:Vs},Oe={matrixDependencies:a,typedDependencies:e,createFlatten:hr},io={typedDependencies:e,createIm:Br},co={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromColumns:On},Md={BigNumberDependencies:s,FractionDependencies:ue,complexDependencies:Xe,typedDependencies:e,createSign:Ei},oo={addScalarDependencies:T,complexDependencies:Xe,conjDependencies:fe,divideScalarDependencies:y,equalDependencies:B,identityDependencies:ie,isZeroDependencies:X,matrixDependencies:a,multiplyScalarDependencies:C,signDependencies:Md,sqrtDependencies:J,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,zerosDependencies:M,createQr:Ut},po={typedDependencies:e,createRe:Kt},wd={isIntegerDependencies:O,matrixDependencies:a,typedDependencies:e,createReshape:si},Ke={typedDependencies:e,createSin:Ii},lo={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolve:wc},Rd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createUsolveAll:Rc},Ed={absDependencies:A,addDependencies:u,addScalarDependencies:T,atanDependencies:od,bignumberDependencies:L,columnDependencies:gd,complexDependencies:Xe,cosDependencies:eo,diagDependencies:Td,divideScalarDependencies:y,dotDependencies:Ve,equalDependencies:B,flattenDependencies:Oe,imDependencies:io,invDependencies:De,largerDependencies:P,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,multiplyScalarDependencies:C,numberDependencies:se,qrDependencies:oo,reDependencies:po,reshapeDependencies:wd,sinDependencies:Ke,sizeDependencies:w,smallerDependencies:I,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,usolveDependencies:lo,usolveAllDependencies:Rd,createEigs:Ys},Bh={BigNumberDependencies:s,UnitDependencies:c,createElectricConstant:Zs},Qh={BigNumberDependencies:s,UnitDependencies:c,createElectronMass:Xs},Hh={BigNumberDependencies:s,UnitDependencies:c,createElementaryCharge:Js},Wh={compareTextDependencies:bd,isZeroDependencies:X,typedDependencies:e,createEqualText:er},Gh={typedDependencies:e,createErf:ar},vo={parseDependencies:ee,typedDependencies:e,createEvaluate:sr},jd={typedDependencies:e,createExp:rr},Vh={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,multiplyDependencies:D,typedDependencies:e,createExpm:nr},Yh={ComplexDependencies:h,typedDependencies:e,createExpm1:tr},Zh={createFalse:cr},Xh={BigNumberDependencies:s,UnitDependencies:c,createFaraday:or},Jh={BigNumberDependencies:s,UnitDependencies:c,createFermiCoupling:dr},Ad={ComplexDependencies:h,createI:Lr},Pd={ComplexDependencies:h,typedDependencies:e,createLog2:Cn},Id={BigNumberDependencies:s,createTau:fc},Od={addScalarDependencies:T,ceilDependencies:Xc,conjDependencies:fe,divideScalarDependencies:y,dotDivideDependencies:Ie,expDependencies:jd,iDependencies:Ad,log2Dependencies:Pd,matrixDependencies:a,multiplyScalarDependencies:C,powDependencies:H,tauDependencies:Id,typedDependencies:e,createFft:pr},qd={largerDependencies:P,smallerDependencies:I,createFibonacciHeapClass:lr},Kh={typedDependencies:e,createFilter:vr},$h={typedDependencies:e,createFilterTransform:ur},eg={BigNumberDependencies:s,createFineStructure:mr},ag={BigNumberDependencies:s,UnitDependencies:c,createFirstRadiation:fr},sg={typedDependencies:e,createForEach:br},rg={typedDependencies:e,createForEachTransform:xr},ng={ComplexDependencies:h,addDependencies:u,divideDependencies:F,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createFreqz:Sr},tg={BigNumberDependencies:s,UnitDependencies:c,createGasConstant:Fr},ig={BigNumberDependencies:s,DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createGcd:Mr},cg={BigNumberDependencies:s,UnitDependencies:c,createGravitationConstant:Rr},og={BigNumberDependencies:s,UnitDependencies:c,createGravity:Er},dg={BigNumberDependencies:s,UnitDependencies:c,createHartreeEnergy:jr},pg={isNumericDependencies:me,typedDependencies:e,createHasNumericValue:Ar},Ld={evaluateDependencies:vo,createHelpClass:Ir},lg={HelpDependencies:Ld,typedDependencies:e,createHelp:Pr},vg={formatDependencies:je,typedDependencies:e,createHex:Or},ug={absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,isPositiveDependencies:he,multiplyScalarDependencies:C,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createHypot:qr},mg={conjDependencies:fe,dotDivideDependencies:Ie,fftDependencies:Od,typedDependencies:e,createIfft:Ur},zd={IndexDependencies:E,typedDependencies:e,createIndex:Hr},fg={IndexDependencies:E,getMatrixDataTypeDependencies:Kc,createIndexTransform:Vr},Dg={BigNumberDependencies:s,createInfinity:Yr},hg={absDependencies:A,addDependencies:u,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,flattenDependencies:Oe,isNumericDependencies:me,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,multiplyScalarDependencies:C,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,createIntersect:Zr},gg={BigNumberDependencies:s,UnitDependencies:c,createInverseConductanceQuantum:Jr},Ud={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,roundDependencies:ke,typedDependencies:e,zerosDependencies:M,createMod:Vn},Bd={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createXgcd:qc},bg={BigNumberDependencies:s,addDependencies:u,equalDependencies:B,isIntegerDependencies:O,modDependencies:Ud,smallerDependencies:I,typedDependencies:e,xgcdDependencies:Bd,createInvmod:Kr},qe={typedDependencies:e,createIsNaN:en},xg={typedDependencies:e,createIsPrime:nn},uo={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createLog:xn},xe={typedDependencies:e,createMap:jn},yg={divideDependencies:F,dotDivideDependencies:Ie,isNumericDependencies:me,logDependencies:uo,mapDependencies:xe,matrixDependencies:a,multiplyDependencies:D,sumDependencies:$c,typedDependencies:e,createKldivergence:cn},_g={BigNumberDependencies:s,UnitDependencies:c,createKlitzing:on},Cg={matrixDependencies:a,multiplyScalarDependencies:C,typedDependencies:e,createKron:dn},Sg={BigNumberDependencies:s,createLN10:pn},Ng={BigNumberDependencies:s,createLN2:ln},kg={BigNumberDependencies:s,createLOG10E:vn},Tg={BigNumberDependencies:s,createLOG2E:un},Fg={concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createLcm:Dn},Mg={parseDependencies:ee,typedDependencies:e,createLeafCount:hn},wg={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createLeftShift:gn},Rg={ComplexDependencies:h,typedDependencies:e,createLgamma:bn},Eg={ComplexDependencies:h,typedDependencies:e,createLog10:yn},jg={ComplexDependencies:h,divideScalarDependencies:y,logDependencies:uo,typedDependencies:e,createLog1p:_n},Ag={BigNumberDependencies:s,UnitDependencies:c,createLoschmidt:Sn},Qd={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolve:Nn},Pg={DenseMatrixDependencies:p,divideScalarDependencies:y,equalScalarDependencies:v,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,createLsolveAll:kn},Hd={FibonacciHeapDependencies:qd,addScalarDependencies:T,equalScalarDependencies:v,createSpaClass:Hi},Wd={DenseMatrixDependencies:p,SpaDependencies:Hd,SparseMatrixDependencies:ae,absDependencies:A,addScalarDependencies:T,divideScalarDependencies:y,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyScalarDependencies:C,subtractScalarDependencies:Q,typedDependencies:e,unaryMinusDependencies:K,createLup:Tn},Gd={SparseMatrixDependencies:ae,absDependencies:A,addDependencies:u,divideScalarDependencies:y,largerDependencies:P,largerEqDependencies:Ze,multiplyDependencies:D,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSlu:Li},Vd={DenseMatrixDependencies:p,lsolveDependencies:Qd,lupDependencies:Wd,matrixDependencies:a,sluDependencies:Gd,typedDependencies:e,usolveDependencies:lo,createLusolve:Fn},mo={absDependencies:A,addDependencies:u,conjDependencies:fe,ctransposeDependencies:ao,eigsDependencies:Ed,equalScalarDependencies:v,largerDependencies:P,matrixDependencies:a,multiplyDependencies:D,powDependencies:H,smallerDependencies:I,sqrtDependencies:J,typedDependencies:e,createNorm:tt},Yd={identityDependencies:ie,matrixDependencies:a,multiplyDependencies:D,normDependencies:mo,qrDependencies:oo,subtractDependencies:S,typedDependencies:e,createSchur:gi},Zd={absDependencies:A,addDependencies:u,concatDependencies:f,identityDependencies:ie,indexDependencies:zd,lusolveDependencies:Vd,matrixDependencies:a,matrixFromColumnsDependencies:co,multiplyDependencies:D,rangeDependencies:Fe,schurDependencies:Yd,subsetDependencies:q,subtractDependencies:S,transposeDependencies:Pe,typedDependencies:e,createSylvester:pc},Ig={matrixDependencies:a,multiplyDependencies:D,sylvesterDependencies:Zd,transposeDependencies:Pe,typedDependencies:e,createLyap:Mn},$e={compareDependencies:ge,isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createPartitionSelect:Ct},Xd={addDependencies:u,compareDependencies:ge,divideDependencies:F,partitionSelectDependencies:$e,typedDependencies:e,createMedian:Hn},Og={absDependencies:A,mapDependencies:xe,medianDependencies:Xd,subtractDependencies:S,typedDependencies:e,createMad:wn},qg={BigNumberDependencies:s,UnitDependencies:c,createMagneticConstant:Rn},Lg={BigNumberDependencies:s,UnitDependencies:c,createMagneticFluxQuantum:En},zg={typedDependencies:e,createMapTransform:An},Ug={isZeroDependencies:X,matrixDependencies:a,typedDependencies:e,createMatrixFromFunction:qn},Bg={flattenDependencies:Oe,matrixDependencies:a,sizeDependencies:w,typedDependencies:e,createMatrixFromRows:Ln},fo={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMax:zn},Qg={largerDependencies:P,numericDependencies:Z,typedDependencies:e,createMaxTransform:Un},Hg={addDependencies:u,divideDependencies:F,typedDependencies:e,createMeanTransform:Qn},Wg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMin:Wn},Gg={numericDependencies:Z,smallerDependencies:I,typedDependencies:e,createMinTransform:Gn},Vg={isNaNDependencies:qe,isNumericDependencies:me,typedDependencies:e,createMode:Yn},Yg={BigNumberDependencies:s,UnitDependencies:c,createMolarMass:Zn},Zg={BigNumberDependencies:s,UnitDependencies:c,createMolarMassC12:Xn},Xg={BigNumberDependencies:s,UnitDependencies:c,createMolarPlanckConstant:Jn},Jg={BigNumberDependencies:s,UnitDependencies:c,createMolarVolume:Kn},Kg={addDependencies:u,divideDependencies:F,factorialDependencies:Ae,isIntegerDependencies:O,isPositiveDependencies:he,multiplyDependencies:D,typedDependencies:e,createMultinomial:$n},$g={BigNumberDependencies:s,createNaN:st},eb={BigNumberDependencies:s,UnitDependencies:c,createNeutronMass:rt},ab={BigNumberDependencies:s,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createNthRoot:ct},sb={ComplexDependencies:h,divideScalarDependencies:y,typedDependencies:e,createNthRoots:ot},rb={BigNumberDependencies:s,UnitDependencies:c,createNuclearMagneton:dt},nb={createNull:pt},tb={formatDependencies:je,typedDependencies:e,createOct:mt},ib={BigNumberDependencies:s,matrixDependencies:a,typedDependencies:e,createOnes:ft},cb={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOr:ht},ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createOrTransform:gt},Jd={evaluateDependencies:vo,createParserClass:_t},db={ParserDependencies:Jd,typedDependencies:e,createParser:yt},pb={factorialDependencies:Ae,typedDependencies:e,createPermutations:St},lb={BigNumberDependencies:s,createPhi:Nt},Do={BigNumberDependencies:s,createPi:kt},vb={typedDependencies:e,createPickRandom:Tt},ub={ComplexDependencies:h,addDependencies:u,ctransposeDependencies:ao,deepEqualDependencies:ro,divideScalarDependencies:y,dotDependencies:Ve,dotDivideDependencies:Ie,equalDependencies:B,invDependencies:De,matrixDependencies:a,multiplyDependencies:D,typedDependencies:e,createPinv:Ft},mb={BigNumberDependencies:s,UnitDependencies:c,createPlanckCharge:Mt},fb={BigNumberDependencies:s,UnitDependencies:c,createPlanckConstant:wt},Db={BigNumberDependencies:s,UnitDependencies:c,createPlanckLength:Rt},hb={BigNumberDependencies:s,UnitDependencies:c,createPlanckMass:Et},gb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTemperature:jt},bb={BigNumberDependencies:s,UnitDependencies:c,createPlanckTime:At},Kd={typedDependencies:e,createTypeOf:yc},xb={addDependencies:u,cbrtDependencies:fd,divideDependencies:F,equalScalarDependencies:v,imDependencies:io,isZeroDependencies:X,multiplyDependencies:D,reDependencies:po,sqrtDependencies:J,subtractDependencies:S,typeOfDependencies:Kd,typedDependencies:e,unaryMinusDependencies:K,createPolynomialRoot:Pt},yb={typedDependencies:e,createPrint:Ot},_b={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createPrintTransform:qt},Cb={BigNumberDependencies:s,UnitDependencies:c,createProtonMass:zt},Sb={bignumberDependencies:L,addDependencies:u,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeq:Bt},Nb={addDependencies:u,bignumberDependencies:L,compareDependencies:ge,divideDependencies:F,isIntegerDependencies:O,largerDependencies:P,multiplyDependencies:D,partitionSelectDependencies:$e,smallerDependencies:I,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createQuantileSeqTransform:Qt},kb={BigNumberDependencies:s,UnitDependencies:c,createQuantumOfCirculation:Ht},Tb={typedDependencies:e,createRandom:Wt},Fb={typedDependencies:e,createRandomInt:Gt},Mb={createRangeClass:Yt},wb={bignumberDependencies:L,matrixDependencies:a,addDependencies:u,isPositiveDependencies:he,largerDependencies:P,largerEqDependencies:Ze,smallerDependencies:I,smallerEqDependencies:Te,typedDependencies:e,createRangeTransform:Xt},Rb={bignumberDependencies:L,fractionDependencies:Ne,AccessorNodeDependencies:Ce,ArrayNodeDependencies:Se,ConstantNodeDependencies:oe,FunctionNodeDependencies:pe,IndexNodeDependencies:Me,ObjectNodeDependencies:we,OperatorNodeDependencies:re,ParenthesisNodeDependencies:be,SymbolNodeDependencies:de,addDependencies:u,divideDependencies:F,equalDependencies:B,isZeroDependencies:X,matrixDependencies:a,multiplyDependencies:D,parseDependencies:ee,powDependencies:H,simplifyDependencies:Je,simplifyConstantDependencies:no,simplifyCoreDependencies:to,subtractDependencies:S,typedDependencies:e,createRationalize:Jt},Eb={BigNumberDependencies:s,UnitDependencies:c,createReducedPlanckConstant:$t},jb={createReplacer:ai},Ab={matrixDependencies:a,createResize:ri},Pb={createReviver:ii},Ib={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightArithShift:ci},Ob={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createRightLogShift:oi},$d={BigNumberDependencies:s,DenseMatrixDependencies:p,SparseMatrixDependencies:ae,addScalarDependencies:T,cosDependencies:eo,matrixDependencies:a,multiplyScalarDependencies:C,normDependencies:mo,sinDependencies:Ke,typedDependencies:e,unaryMinusDependencies:K,createRotationMatrix:pi},qb={multiplyDependencies:D,rotationMatrixDependencies:$d,typedDependencies:e,createRotate:di},Lb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRow:vi},zb={IndexDependencies:E,matrixDependencies:a,rangeDependencies:Fe,typedDependencies:e,createRowTransform:ui},Ub={BigNumberDependencies:s,UnitDependencies:c,createRydberg:mi},Bb={BigNumberDependencies:s,createSQRT1_2:fi},Qb={BigNumberDependencies:s,createSQRT2:Di},Hb={BigNumberDependencies:s,createSackurTetrode:hi},Wb={BigNumberDependencies:s,typedDependencies:e,createSec:bi},Gb={BigNumberDependencies:s,typedDependencies:e,createSech:xi},Vb={BigNumberDependencies:s,UnitDependencies:c,createSecondRadiation:yi},Yb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetCartesian:_i},ep={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDifference:Ci},Zb={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetDistinct:Si},ap={DenseMatrixDependencies:p,IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIntersect:Ni},Xb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetIsSubset:ki},Jb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetMultiplicity:Ti},Kb={IndexDependencies:E,compareNaturalDependencies:$,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetPowerset:Fi},$b={compareNaturalDependencies:$,typedDependencies:e,createSetSize:Mi},sp={IndexDependencies:E,concatDependencies:f,setDifferenceDependencies:ep,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetSymDifference:wi},ex={IndexDependencies:E,concatDependencies:f,setIntersectDependencies:ap,setSymDifferenceDependencies:sp,sizeDependencies:w,subsetDependencies:q,typedDependencies:e,createSetUnion:Ri},ax={typedDependencies:e,createSinh:Oi},sx={absDependencies:A,addDependencies:u,bignumberDependencies:L,divideDependencies:F,isNegativeDependencies:ce,isPositiveDependencies:he,largerDependencies:P,mapDependencies:xe,matrixDependencies:a,maxDependencies:fo,multiplyDependencies:D,smallerDependencies:I,subtractDependencies:S,typedDependencies:e,unaryMinusDependencies:K,createSolveODE:Bi},rx={compareDependencies:ge,compareNaturalDependencies:$,matrixDependencies:a,typedDependencies:e,createSort:Qi},nx={SparseMatrixDependencies:ae,typedDependencies:e,createSparse:Wi},tx={BigNumberDependencies:s,UnitDependencies:c,createSpeedOfLight:Vi},ix={typedDependencies:e,createSplitUnit:Yi},cx={absDependencies:A,addDependencies:u,identityDependencies:ie,invDependencies:De,mapDependencies:xe,maxDependencies:fo,multiplyDependencies:D,sizeDependencies:w,sqrtDependencies:J,subtractDependencies:S,typedDependencies:e,createSqrtm:Xi},ox={typedDependencies:e,createSquare:Ji},dx={matrixDependencies:a,typedDependencies:e,createSqueeze:Ki},ho={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVariance:jc},px={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStd:$i},lx={mapDependencies:xe,sqrtDependencies:J,typedDependencies:e,varianceDependencies:ho,createStdTransform:ec},vx={BigNumberDependencies:s,UnitDependencies:c,createStefanBoltzmann:ac},ux={typedDependencies:e,createString:rc},mx={addDependencies:u,matrixDependencies:a,typedDependencies:e,zerosDependencies:M,createSubsetTransform:tc},fx={addDependencies:u,numericDependencies:Z,typedDependencies:e,createSumTransform:dc},Dx={OperatorNodeDependencies:re,parseDependencies:ee,simplifyDependencies:Je,typedDependencies:e,createSymbolicEqual:vc},hx={typedDependencies:e,createTan:uc},gx={typedDependencies:e,createTanh:mc},bx={BigNumberDependencies:s,UnitDependencies:c,createThomsonCrossSection:Dc},xx={concatDependencies:f,matrixDependencies:a,typedDependencies:e,createTo:hc},yx={addDependencies:u,matrixDependencies:a,typedDependencies:e,createTrace:gc},_x={createTrue:xc},Cx={DenseMatrixDependencies:p,concatDependencies:f,equalScalarDependencies:v,matrixDependencies:a,typedDependencies:e,createUnequal:Nc},Sx={UnitDependencies:c,typedDependencies:e,createUnitFunction:Tc},Nx={eDependencies:Fd,createUppercaseE:Fc},kx={piDependencies:Do,createUppercasePi:Mc},Tx={BigNumberDependencies:s,UnitDependencies:c,createVacuumImpedance:Ec},Fx={addDependencies:u,applyDependencies:Zc,divideDependencies:F,isNaNDependencies:qe,multiplyDependencies:D,subtractDependencies:S,typedDependencies:e,createVarianceTransform:Ac},Mx={createVersion:Pc},wx={BigNumberDependencies:s,createWeakMixingAngle:Ic},Rx={BigNumberDependencies:s,UnitDependencies:c,createWienDisplacement:Oc},Ex={DenseMatrixDependencies:p,concatDependencies:f,matrixDependencies:a,typedDependencies:e,createXor:Lc},jx={BigNumberDependencies:s,ComplexDependencies:h,addDependencies:u,divideDependencies:F,equalDependencies:B,factorialDependencies:Ae,gammaDependencies:Jc,isNegativeDependencies:ce,multiplyDependencies:D,piDependencies:Do,powDependencies:H,sinDependencies:Ke,smallerEqDependencies:Te,subtractDependencies:S,typedDependencies:e,createZeta:Uc},Ax={ComplexDependencies:h,addDependencies:u,multiplyDependencies:D,numberDependencies:se,typedDependencies:e,createZpk2tf:Bc},Px=AD,He={},Ix={get exports(){return He},set exports(n){He=n}};function go(){}go.prototype={on:function(n,l,i){var o=this.e||(this.e={});return(o[n]||(o[n]=[])).push({fn:l,ctx:i}),this},once:function(n,l,i){var o=this;function x(){o.off(n,x),l.apply(i,arguments)}return x._=l,this.on(n,x,i)},emit:function(n){var l=[].slice.call(arguments,1),i=((this.e||(this.e={}))[n]||[]).slice(),o=0,x=i.length;for(o;oj(ye,np));else if(typeof k=="object")for(var Y in k)_e(k,Y)&&j(ye,k[Y],Y);else if(Ee(k)||te!==void 0){var Be=Ee(k)?Ue(k)?k.fn+".transform":k.fn:te;if(_e(ye,Be)&&ye[Be]!==k&&!m.silent)throw new Error('Cannot import "'+Be+'" twice');ye[Be]=k}else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}var z={};j(z,r);for(var U in z)if(_e(z,U)){var V=z[U];if(Ee(V))ze(V,m);else if(N(V))d(U,V,m);else if(!m.silent)throw new TypeError("Factory, Object, or Array expected")}}function d(r,m,b){if(b.wrap&&typeof m=="function"&&(m=Le(m)),le(m)&&(m=n(r,{[m.signature]:m})),n.isTypedFunction(i[r])&&n.isTypedFunction(m)){b.override?m=n(r,m.signatures):m=n(i[r],m),i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(i[r]===void 0||b.override){i[r]=m,delete o[r],W(r,m),i.emit("import",r,function(){return m});return}if(!b.silent)throw new Error('Cannot import "'+r+'": already exists')}function W(r,m){m&&typeof m.transform=="function"?(i.expression.transform[r]=m.transform,G(r)&&(i.expression.mathWithTransform[r]=m.transform)):(delete i.expression.transform[r],G(r)&&(i.expression.mathWithTransform[r]=m))}function _(r){delete i.expression.transform[r],G(r)?i.expression.mathWithTransform[r]=i[r]:delete i.expression.mathWithTransform[r]}function Le(r){var m=function(){for(var j=[],z=0,U=arguments.length;z2&&arguments[2]!==void 0?arguments[2]:r.fn;if(xo(b,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(b));var j=Ue(r)?i.expression.transform:i,z=b in i.expression.transform,U=_e(j,b)?j[b]:void 0,V=function(){var k={};r.dependencies.map(tp).forEach(Y=>{if(xo(Y,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(Y));Y==="math"?k.math=i:Y==="mathWithTransform"?k.mathWithTransform=i.expression.mathWithTransform:Y==="classes"?k.classes=i:k[Y]=i[Y]});var te=r(k);if(te&&typeof te.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(U===void 0||m.override)return te;if(n.isTypedFunction(U)&&n.isTypedFunction(te))return n(U,te);if(m.silent)return U;throw new Error('Cannot import "'+b+'": already exists')};!r.meta||r.meta.lazy!==!1?(ea(j,b,V),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])):(j[b]=V(),U&&z?_(b):(Ue(r)||ne(r))&&ea(i.expression.mathWithTransform,b,()=>j[b])),o[b]=r,i.emit("import",b,V)}function N(r){return typeof r=="function"||typeof r=="number"||typeof r=="string"||typeof r=="boolean"||r===null||Hc(r)||Wc(r)||Gc(r)||Vc(r)||Yc(r)||Array.isArray(r)}function le(r){return typeof r=="function"&&typeof r.signature=="string"}function G(r){return!_e(bo,r)}function ne(r){return r.fn.indexOf(".")===-1&&!_e(bo,r.fn)&&(!r.meta||!r.meta.isClass)}function Ue(r){return r!==void 0&&r.meta!==void 0&&r.meta.isTransformFunction===!0||!1}var bo={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return x}function rp(n,l){var i=ip({},cp,l);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var o=Ox({isNumber:To,isComplex:Wc,isBigNumber:Gc,isFraction:Vc,isUnit:Hc,isString:Fo,isArray:Mo,isMatrix:Yc,isCollection:wo,isDenseMatrix:Ro,isSparseMatrix:Eo,isRange:jo,isIndex:Ao,isBoolean:Po,isResultSet:Io,isHelp:Oo,isFunction:qo,isDate:Lo,isRegExp:zo,isObject:Uo,isNull:Bo,isUndefined:Qo,isAccessorNode:Ho,isArrayNode:Wo,isAssignmentNode:Go,isBlockNode:Vo,isConditionalNode:Yo,isConstantNode:Zo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isIndexNode:Ko,isNode:$o,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isRangeNode:rd,isRelationalNode:nd,isSymbolNode:td,isChain:id});o.config=op(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};var x=[],d=[];function W(N){if(Ee(N))return N(o);var le=N[Object.keys(N)[0]];if(Ee(le))return le(o);if(!lp(N))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",N),new Error("Factory object with properties `type`, `name`, and `factory` expected");var G=x.indexOf(N),ne;return G===-1?(N.math===!0?ne=N.factory(o.type,i,W,o.typed,o):ne=N.factory(o.type,i,W,o.typed),x.push(N),d.push(ne)):ne=d[G],ne}var _={};function Le(){for(var N=arguments.length,le=new Array(N),G=0;G{yo(_).forEach(N=>{N&&N.meta&&N.meta.recreateOnConfigChange&&ze(N,{override:!0})})}),o.create=rp.bind(null,n),o.factory=So,o.import(yo(pp(n))),o.ArgumentsError=Qc,o.DimensionError=No,o.IndexError=ko,o}const Lx=Object.freeze(Object.defineProperty({__proto__:null,AccessorNode:vp,AccessorNodeDependencies:Ce,ArgumentsError:Qc,ArrayNode:up,ArrayNodeDependencies:Se,AssignmentNode:mp,AssignmentNodeDependencies:cd,BigNumber:fp,BigNumberDependencies:s,BlockNode:Dp,BlockNodeDependencies:md,Chain:hp,ChainDependencies:Dd,Complex:gp,ComplexDependencies:h,ConditionalNode:bp,ConditionalNodeDependencies:xd,ConstantNode:xp,ConstantNodeDependencies:oe,DenseMatrix:yp,DenseMatrixDependencies:p,DimensionError:No,EDependencies:Nx,FibonacciHeap:_p,FibonacciHeapDependencies:qd,Fraction:Cp,FractionDependencies:ue,FunctionAssignmentNode:Sp,FunctionAssignmentNodeDependencies:yd,FunctionNode:Np,FunctionNodeDependencies:pe,Help:kp,HelpDependencies:Ld,ImmutableDenseMatrix:Tp,ImmutableDenseMatrixDependencies:hd,Index:Fp,IndexDependencies:E,IndexError:ko,IndexNode:Mp,IndexNodeDependencies:Me,InfinityDependencies:Dg,LN10:wp,LN10Dependencies:Sg,LN2:Rp,LN2Dependencies:Ng,LOG10E:Ep,LOG10EDependencies:kg,LOG2E:jp,LOG2EDependencies:Tg,Matrix:Ap,MatrixDependencies:We,NaNDependencies:$g,Node:Pp,NodeDependencies:R,ObjectNode:Ip,ObjectNodeDependencies:we,OperatorNode:Op,OperatorNodeDependencies:re,PIDependencies:kx,ParenthesisNode:qp,ParenthesisNodeDependencies:be,Parser:Lp,ParserDependencies:Jd,Range:zp,RangeDependencies:Mb,RangeNode:Up,RangeNodeDependencies:_d,RelationalNode:Bp,RelationalNodeDependencies:Cd,ResultSet:Qp,ResultSetDependencies:ud,SQRT1_2:Hp,SQRT1_2Dependencies:Bb,SQRT2:Wp,SQRT2Dependencies:Qb,Spa:Gp,SpaDependencies:Hd,SparseMatrix:Vp,SparseMatrixDependencies:ae,SymbolNode:Yp,SymbolNodeDependencies:de,Unit:Zp,UnitDependencies:c,_Infinity:Xp,_NaN:Jp,_false:Kp,_null:$p,_true:el,abs:al,absDependencies:A,acos:sl,acosDependencies:PD,acosh:rl,acoshDependencies:ID,acot:nl,acotDependencies:OD,acoth:tl,acothDependencies:qD,acsc:il,acscDependencies:LD,acsch:cl,acschDependencies:zD,add:ol,addDependencies:u,addScalar:dl,addScalarDependencies:T,all:Px,and:pl,andDependencies:UD,andTransformDependencies:BD,apply:ll,applyDependencies:Zc,applyTransformDependencies:QD,arg:vl,argDependencies:HD,asec:ul,asecDependencies:WD,asech:ml,asechDependencies:GD,asin:fl,asinDependencies:VD,asinh:Dl,asinhDependencies:YD,atan:hl,atan2:gl,atan2Dependencies:ZD,atanDependencies:od,atanh:bl,atanhDependencies:XD,atomicMass:xl,atomicMassDependencies:JD,avogadro:yl,avogadroDependencies:KD,bellNumbers:_l,bellNumbersDependencies:$D,bignumber:Cl,bignumberDependencies:L,bin:Sl,binDependencies:eh,bitAnd:Nl,bitAndDependencies:ah,bitAndTransformDependencies:sh,bitNot:kl,bitNotDependencies:rh,bitOr:Tl,bitOrDependencies:nh,bitOrTransformDependencies:th,bitXor:Fl,bitXorDependencies:ih,bohrMagneton:Ml,bohrMagnetonDependencies:ch,bohrRadius:wl,bohrRadiusDependencies:oh,boltzmann:Rl,boltzmannDependencies:dh,boolean:El,booleanDependencies:ph,catalan:jl,catalanDependencies:lh,cbrt:Al,cbrtDependencies:fd,ceil:Pl,ceilDependencies:Xc,chain:ra,chainDependencies:vh,classicalElectronRadius:Il,classicalElectronRadiusDependencies:uh,clone:Ol,cloneDependencies:mh,column:ql,columnDependencies:gd,columnTransformDependencies:fh,combinations:Ll,combinationsDependencies:Ye,combinationsWithRep:zl,combinationsWithRepDependencies:Dh,compare:Ul,compareDependencies:ge,compareNatural:Bl,compareNaturalDependencies:$,compareText:Ql,compareTextDependencies:bd,compile:Hl,compileDependencies:hh,complex:Wl,complexDependencies:Xe,composition:Gl,compositionDependencies:gh,concat:Vl,concatDependencies:f,concatTransformDependencies:bh,conductanceQuantum:Yl,conductanceQuantumDependencies:xh,config:Zl,conj:Xl,conjDependencies:fe,corr:Jl,corrDependencies:yh,cos:Kl,cosDependencies:eo,cosh:$l,coshDependencies:_h,cot:ev,cotDependencies:Ch,coth:av,cothDependencies:Sh,coulomb:sv,coulombDependencies:Nh,count:rv,countDependencies:kh,create:rp,createAbs:na,createAccessorNode:ta,createAcos:ia,createAcosh:ca,createAcot:oa,createAcoth:da,createAcsc:pa,createAcsch:la,createAdd:va,createAddScalar:ua,createAnd:ma,createAndTransform:fa,createApply:Da,createApplyTransform:ha,createArg:ga,createArrayNode:ba,createAsec:xa,createAsech:ya,createAsin:_a,createAsinh:Ca,createAssignmentNode:Sa,createAtan:Na,createAtan2:ka,createAtanh:Ta,createAtomicMass:Fa,createAvogadro:Ma,createBellNumbers:wa,createBigNumberClass:Ra,createBignumber:Ea,createBin:ja,createBitAnd:Aa,createBitAndTransform:Pa,createBitNot:Ia,createBitOr:Oa,createBitOrTransform:qa,createBitXor:La,createBlockNode:za,createBohrMagneton:Ua,createBohrRadius:Ba,createBoltzmann:Qa,createBoolean:Ha,createCatalan:Wa,createCbrt:Ga,createCeil:Va,createChain:Ya,createChainClass:Za,createClassicalElectronRadius:Xa,createClone:Ja,createColumn:Ka,createColumnTransform:$a,createCombinations:es,createCombinationsWithRep:as,createCompare:ss,createCompareNatural:rs,createCompareText:ts,createCompile:is,createComplex:cs,createComplexClass:os,createComposition:ds,createConcat:ps,createConcatTransform:ls,createConditionalNode:vs,createConductanceQuantum:us,createConj:ms,createConstantNode:fs,createCorr:Ds,createCos:hs,createCosh:gs,createCot:bs,createCoth:xs,createCoulomb:ys,createCount:_s,createCreateUnit:Cs,createCross:Ss,createCsc:Ns,createCsch:ks,createCtranspose:Ts,createCube:Fs,createCumSum:Ms,createCumSumTransform:ws,createDeepEqual:Rs,createDenseMatrixClass:Es,createDerivative:js,createDet:As,createDeuteronMass:Ps,createDiag:Is,createDiff:Os,createDiffTransform:qs,createDistance:Ls,createDivide:zs,createDivideScalar:Us,createDot:Bs,createDotDivide:Qs,createDotMultiply:Hs,createDotPow:Ws,createE:Gs,createEfimovFactor:Vs,createEigs:Ys,createElectricConstant:Zs,createElectronMass:Xs,createElementaryCharge:Js,createEqual:Ks,createEqualScalar:$s,createEqualText:er,createErf:ar,createEvaluate:sr,createExp:rr,createExpm:nr,createExpm1:tr,createFactorial:ir,createFalse:cr,createFaraday:or,createFermiCoupling:dr,createFft:pr,createFibonacciHeapClass:lr,createFilter:vr,createFilterTransform:ur,createFineStructure:mr,createFirstRadiation:fr,createFix:Dr,createFlatten:hr,createFloor:gr,createForEach:br,createForEachTransform:xr,createFormat:yr,createFraction:_r,createFractionClass:Cr,createFreqz:Sr,createFunctionAssignmentNode:Nr,createFunctionNode:kr,createGamma:Tr,createGasConstant:Fr,createGcd:Mr,createGetMatrixDataType:wr,createGravitationConstant:Rr,createGravity:Er,createHartreeEnergy:jr,createHasNumericValue:Ar,createHelp:Pr,createHelpClass:Ir,createHex:Or,createHypot:qr,createI:Lr,createIdentity:zr,createIfft:Ur,createIm:Br,createImmutableDenseMatrixClass:Qr,createIndex:Hr,createIndexClass:Wr,createIndexNode:Gr,createIndexTransform:Vr,createInfinity:Yr,createIntersect:Zr,createInv:Xr,createInverseConductanceQuantum:Jr,createInvmod:Kr,createIsInteger:$r,createIsNaN:en,createIsNegative:an,createIsNumeric:sn,createIsPositive:rn,createIsPrime:nn,createIsZero:tn,createKldivergence:cn,createKlitzing:on,createKron:dn,createLN10:pn,createLN2:ln,createLOG10E:vn,createLOG2E:un,createLarger:mn,createLargerEq:fn,createLcm:Dn,createLeafCount:hn,createLeftShift:gn,createLgamma:bn,createLog:xn,createLog10:yn,createLog1p:_n,createLog2:Cn,createLoschmidt:Sn,createLsolve:Nn,createLsolveAll:kn,createLup:Tn,createLusolve:Fn,createLyap:Mn,createMad:wn,createMagneticConstant:Rn,createMagneticFluxQuantum:En,createMap:jn,createMapTransform:An,createMatrix:Pn,createMatrixClass:In,createMatrixFromColumns:On,createMatrixFromFunction:qn,createMatrixFromRows:Ln,createMax:zn,createMaxTransform:Un,createMean:Bn,createMeanTransform:Qn,createMedian:Hn,createMin:Wn,createMinTransform:Gn,createMod:Vn,createMode:Yn,createMolarMass:Zn,createMolarMassC12:Xn,createMolarPlanckConstant:Jn,createMolarVolume:Kn,createMultinomial:$n,createMultiply:et,createMultiplyScalar:at,createNaN:st,createNeutronMass:rt,createNode:nt,createNorm:tt,createNot:it,createNthRoot:ct,createNthRoots:ot,createNuclearMagneton:dt,createNull:pt,createNumber:lt,createNumeric:vt,createObjectNode:ut,createOct:mt,createOnes:ft,createOperatorNode:Dt,createOr:ht,createOrTransform:gt,createParenthesisNode:bt,createParse:xt,createParser:yt,createParserClass:_t,createPartitionSelect:Ct,createPermutations:St,createPhi:Nt,createPi:kt,createPickRandom:Tt,createPinv:Ft,createPlanckCharge:Mt,createPlanckConstant:wt,createPlanckLength:Rt,createPlanckMass:Et,createPlanckTemperature:jt,createPlanckTime:At,createPolynomialRoot:Pt,createPow:It,createPrint:Ot,createPrintTransform:qt,createProd:Lt,createProtonMass:zt,createQr:Ut,createQuantileSeq:Bt,createQuantileSeqTransform:Qt,createQuantumOfCirculation:Ht,createRandom:Wt,createRandomInt:Gt,createRange:Vt,createRangeClass:Yt,createRangeNode:Zt,createRangeTransform:Xt,createRationalize:Jt,createRe:Kt,createReducedPlanckConstant:$t,createRelationalNode:ei,createReplacer:ai,createReshape:si,createResize:ri,createResolve:ni,createResultSet:ti,createReviver:ii,createRightArithShift:ci,createRightLogShift:oi,createRotate:di,createRotationMatrix:pi,createRound:li,createRow:vi,createRowTransform:ui,createRydberg:mi,createSQRT1_2:fi,createSQRT2:Di,createSackurTetrode:hi,createSchur:gi,createSec:bi,createSech:xi,createSecondRadiation:yi,createSetCartesian:_i,createSetDifference:Ci,createSetDistinct:Si,createSetIntersect:Ni,createSetIsSubset:ki,createSetMultiplicity:Ti,createSetPowerset:Fi,createSetSize:Mi,createSetSymDifference:wi,createSetUnion:Ri,createSign:Ei,createSimplify:ji,createSimplifyConstant:Ai,createSimplifyCore:Pi,createSin:Ii,createSinh:Oi,createSize:qi,createSlu:Li,createSmaller:zi,createSmallerEq:Ui,createSolveODE:Bi,createSort:Qi,createSpaClass:Hi,createSparse:Wi,createSparseMatrixClass:Gi,createSpeedOfLight:Vi,createSplitUnit:Yi,createSqrt:Zi,createSqrtm:Xi,createSquare:Ji,createSqueeze:Ki,createStd:$i,createStdTransform:ec,createStefanBoltzmann:ac,createStirlingS2:sc,createString:rc,createSubset:nc,createSubsetTransform:tc,createSubtract:ic,createSubtractScalar:cc,createSum:oc,createSumTransform:dc,createSylvester:pc,createSymbolNode:lc,createSymbolicEqual:vc,createTan:uc,createTanh:mc,createTau:fc,createThomsonCrossSection:Dc,createTo:hc,createTrace:gc,createTranspose:bc,createTrue:xc,createTypeOf:yc,createTyped:_c,createUnaryMinus:Cc,createUnaryPlus:Sc,createUnequal:Nc,createUnit:nv,createUnitClass:kc,createUnitDependencies:Th,createUnitFunction:Tc,createUppercaseE:Fc,createUppercasePi:Mc,createUsolve:wc,createUsolveAll:Rc,createVacuumImpedance:Ec,createVariance:jc,createVarianceTransform:Ac,createVersion:Pc,createWeakMixingAngle:Ic,createWienDisplacement:Oc,createXgcd:qc,createXor:Lc,createZeros:zc,createZeta:Uc,createZpk2tf:Bc,cross:tv,crossDependencies:Fh,csc:iv,cscDependencies:Mh,csch:cv,cschDependencies:wh,ctranspose:ov,ctransposeDependencies:ao,cube:dv,cubeDependencies:Rh,cumsum:pv,cumsumDependencies:Eh,cumsumTransformDependencies:jh,deepEqual:lv,deepEqualDependencies:ro,derivative:vv,derivativeDependencies:Ah,det:uv,detDependencies:ld,deuteronMass:mv,deuteronMassDependencies:Ph,diag:fv,diagDependencies:Td,diff:Dv,diffDependencies:Ih,diffTransformDependencies:Oh,distance:hv,distanceDependencies:qh,divide:gv,divideDependencies:F,divideScalar:bv,divideScalarDependencies:y,docs:xv,dot:yv,dotDependencies:Ve,dotDivide:_v,dotDivideDependencies:Ie,dotMultiply:Cv,dotMultiplyDependencies:Lh,dotPow:Sv,dotPowDependencies:zh,e:Nv,eDependencies:Fd,efimovFactor:kv,efimovFactorDependencies:Uh,eigs:Tv,eigsDependencies:Ed,electricConstant:Fv,electricConstantDependencies:Bh,electronMass:Mv,electronMassDependencies:Qh,elementaryCharge:wv,elementaryChargeDependencies:Hh,equal:Rv,equalDependencies:B,equalScalar:Ev,equalScalarDependencies:v,equalText:jv,equalTextDependencies:Wh,erf:Av,erfDependencies:Gh,evaluate:Pv,evaluateDependencies:vo,exp:Iv,expDependencies:jd,expm:Ov,expm1:qv,expm1Dependencies:Yh,expmDependencies:Vh,factorial:Lv,factorialDependencies:Ae,factory:So,falseDependencies:Zh,faraday:zv,faradayDependencies:Xh,fermiCoupling:Uv,fermiCouplingDependencies:Jh,fft:Bv,fftDependencies:Od,filter:Qv,filterDependencies:Kh,filterTransformDependencies:$h,fineStructure:Hv,fineStructureDependencies:eg,firstRadiation:Wv,firstRadiationDependencies:ag,fix:Gv,fixDependencies:pd,flatten:Vv,flattenDependencies:Oe,floor:Yv,floorDependencies:dd,forEach:Zv,forEachDependencies:sg,forEachTransformDependencies:rg,format:Xv,formatDependencies:je,fraction:Jv,fractionDependencies:Ne,freqz:Kv,freqzDependencies:ng,gamma:$v,gammaDependencies:Jc,gasConstant:eu,gasConstantDependencies:tg,gcd:au,gcdDependencies:ig,getMatrixDataType:su,getMatrixDataTypeDependencies:Kc,gravitationConstant:ru,gravitationConstantDependencies:cg,gravity:nu,gravityDependencies:og,hartreeEnergy:tu,hartreeEnergyDependencies:dg,hasNumericValue:iu,hasNumericValueDependencies:pg,help:cu,helpDependencies:lg,hex:ou,hexDependencies:vg,hypot:du,hypotDependencies:ug,i:pu,iDependencies:Ad,identity:lu,identityDependencies:ie,ifft:vu,ifftDependencies:mg,im:uu,imDependencies:io,index:mu,indexDependencies:zd,indexTransformDependencies:fg,intersect:fu,intersectDependencies:hg,inv:Du,invDependencies:De,inverseConductanceQuantum:hu,inverseConductanceQuantumDependencies:gg,invmod:gu,invmodDependencies:bg,isAccessorNode:Ho,isArray:Mo,isArrayNode:Wo,isAssignmentNode:Go,isBigNumber:Gc,isBlockNode:Vo,isBoolean:Po,isChain:id,isCollection:wo,isComplex:Wc,isConditionalNode:Yo,isConstantNode:Zo,isDate:Lo,isDenseMatrix:Ro,isFraction:Vc,isFunction:qo,isFunctionAssignmentNode:Xo,isFunctionNode:Jo,isHelp:Oo,isIndex:Ao,isIndexNode:Ko,isInteger:bu,isIntegerDependencies:O,isMatrix:Yc,isNaN:xu,isNaNDependencies:qe,isNegative:yu,isNegativeDependencies:ce,isNode:$o,isNull:Bo,isNumber:To,isNumeric:_u,isNumericDependencies:me,isObject:Uo,isObjectNode:ed,isOperatorNode:ad,isParenthesisNode:sd,isPositive:Cu,isPositiveDependencies:he,isPrime:Su,isPrimeDependencies:xg,isRange:jo,isRangeNode:rd,isRegExp:zo,isRelationalNode:nd,isResultSet:Io,isSparseMatrix:Eo,isString:Fo,isSymbolNode:td,isUndefined:Qo,isUnit:Hc,isZero:Nu,isZeroDependencies:X,kldivergence:ku,kldivergenceDependencies:yg,klitzing:Tu,klitzingDependencies:_g,kron:Fu,kronDependencies:Cg,larger:Mu,largerDependencies:P,largerEq:wu,largerEqDependencies:Ze,lcm:Ru,lcmDependencies:Fg,leafCount:Eu,leafCountDependencies:Mg,leftShift:ju,leftShiftDependencies:wg,lgamma:Au,lgammaDependencies:Rg,log:Pu,log10:Iu,log10Dependencies:Eg,log1p:Ou,log1pDependencies:jg,log2:qu,log2Dependencies:Pd,logDependencies:uo,loschmidt:Lu,loschmidtDependencies:Ag,lsolve:zu,lsolveAll:Uu,lsolveAllDependencies:Pg,lsolveDependencies:Qd,lup:Bu,lupDependencies:Wd,lusolve:Qu,lusolveDependencies:Vd,lyap:Hu,lyapDependencies:Ig,mad:Wu,madDependencies:Og,magneticConstant:Gu,magneticConstantDependencies:qg,magneticFluxQuantum:Vu,magneticFluxQuantumDependencies:Lg,map:Yu,mapDependencies:xe,mapTransformDependencies:zg,matrix:Zu,matrixDependencies:a,matrixFromColumns:Xu,matrixFromColumnsDependencies:co,matrixFromFunction:Ju,matrixFromFunctionDependencies:Ug,matrixFromRows:Ku,matrixFromRowsDependencies:Bg,max:$u,maxDependencies:fo,maxTransformDependencies:Qg,mean:em,meanDependencies:Sd,meanTransformDependencies:Hg,median:am,medianDependencies:Xd,min:sm,minDependencies:Wg,minTransformDependencies:Gg,mod:rm,modDependencies:Ud,mode:nm,modeDependencies:Vg,molarMass:tm,molarMassC12:im,molarMassC12Dependencies:Zg,molarMassDependencies:Yg,molarPlanckConstant:cm,molarPlanckConstantDependencies:Xg,molarVolume:om,molarVolumeDependencies:Jg,multinomial:dm,multinomialDependencies:Kg,multiply:pm,multiplyDependencies:D,multiplyScalar:lm,multiplyScalarDependencies:C,neutronMass:vm,neutronMassDependencies:eb,norm:um,normDependencies:mo,not:mm,notDependencies:Ge,nthRoot:fm,nthRootDependencies:ab,nthRoots:Dm,nthRootsDependencies:sb,nuclearMagneton:hm,nuclearMagnetonDependencies:rb,nullDependencies:nb,number:gm,numberDependencies:se,numeric:bm,numericDependencies:Z,oct:xm,octDependencies:tb,ones:ym,onesDependencies:ib,or:_m,orDependencies:cb,orTransformDependencies:ob,parse:Cm,parseDependencies:ee,parser:Sm,parserDependencies:db,partitionSelect:Nm,partitionSelectDependencies:$e,permutations:km,permutationsDependencies:pb,phi:Tm,phiDependencies:lb,pi:Fm,piDependencies:Do,pickRandom:Mm,pickRandomDependencies:vb,pinv:wm,pinvDependencies:ub,planckCharge:Rm,planckChargeDependencies:mb,planckConstant:Em,planckConstantDependencies:fb,planckLength:jm,planckLengthDependencies:Db,planckMass:Am,planckMassDependencies:hb,planckTemperature:Pm,planckTemperatureDependencies:gb,planckTime:Im,planckTimeDependencies:bb,polynomialRoot:Om,polynomialRootDependencies:xb,pow:qm,powDependencies:H,print:Lm,printDependencies:yb,printTransformDependencies:_b,prod:zm,prodDependencies:Nd,protonMass:Um,protonMassDependencies:Cb,qr:Bm,qrDependencies:oo,quantileSeq:Qm,quantileSeqDependencies:Sb,quantileSeqTransformDependencies:Nb,quantumOfCirculation:Hm,quantumOfCirculationDependencies:kb,random:Wm,randomDependencies:Tb,randomInt:Gm,randomIntDependencies:Fb,range:Vm,rangeDependencies:Fe,rangeTransformDependencies:wb,rationalize:Ym,rationalizeDependencies:Rb,re:Zm,reDependencies:po,reducedPlanckConstant:Xm,reducedPlanckConstantDependencies:Eb,replacer:Jm,replacerDependencies:jb,reshape:Km,reshapeDependencies:wd,resize:$m,resizeDependencies:Ab,resolve:ef,resolveDependencies:kd,reviver:af,reviverDependencies:Pb,rightArithShift:sf,rightArithShiftDependencies:Ib,rightLogShift:rf,rightLogShiftDependencies:Ob,rotate:nf,rotateDependencies:qb,rotationMatrix:tf,rotationMatrixDependencies:$d,round:cf,roundDependencies:ke,row:of,rowDependencies:Lb,rowTransformDependencies:zb,rydberg:df,rydbergDependencies:Ub,sackurTetrode:pf,sackurTetrodeDependencies:Hb,schur:lf,schurDependencies:Yd,sec:vf,secDependencies:Wb,sech:uf,sechDependencies:Gb,secondRadiation:mf,secondRadiationDependencies:Vb,setCartesian:ff,setCartesianDependencies:Yb,setDifference:Df,setDifferenceDependencies:ep,setDistinct:hf,setDistinctDependencies:Zb,setIntersect:gf,setIntersectDependencies:ap,setIsSubset:bf,setIsSubsetDependencies:Xb,setMultiplicity:xf,setMultiplicityDependencies:Jb,setPowerset:yf,setPowersetDependencies:Kb,setSize:_f,setSizeDependencies:$b,setSymDifference:Cf,setSymDifferenceDependencies:sp,setUnion:Sf,setUnionDependencies:ex,sign:Nf,signDependencies:Md,simplify:kf,simplifyConstant:Tf,simplifyConstantDependencies:no,simplifyCore:Ff,simplifyCoreDependencies:to,simplifyDependencies:Je,sin:Mf,sinDependencies:Ke,sinh:wf,sinhDependencies:ax,size:Rf,sizeDependencies:w,slu:Ef,sluDependencies:Gd,smaller:jf,smallerDependencies:I,smallerEq:Af,smallerEqDependencies:Te,solveODE:Pf,solveODEDependencies:sx,sort:If,sortDependencies:rx,sparse:Of,sparseDependencies:nx,speedOfLight:qf,speedOfLightDependencies:tx,splitUnit:Lf,splitUnitDependencies:ix,sqrt:zf,sqrtDependencies:J,sqrtm:Uf,sqrtmDependencies:cx,square:Bf,squareDependencies:ox,squeeze:Qf,squeezeDependencies:dx,std:Hf,stdDependencies:px,stdTransformDependencies:lx,stefanBoltzmann:Wf,stefanBoltzmannDependencies:vx,stirlingS2:Gf,stirlingS2Dependencies:vd,string:Vf,stringDependencies:ux,subset:Yf,subsetDependencies:q,subsetTransformDependencies:mx,subtract:Zf,subtractDependencies:S,subtractScalar:Xf,subtractScalarDependencies:Q,sum:Jf,sumDependencies:$c,sumTransformDependencies:fx,sylvester:Kf,sylvesterDependencies:Zd,symbolicEqual:$f,symbolicEqualDependencies:Dx,tan:eD,tanDependencies:hx,tanh:aD,tanhDependencies:gx,tau:sD,tauDependencies:Id,thomsonCrossSection:rD,thomsonCrossSectionDependencies:bx,to:nD,toDependencies:xx,trace:tD,traceDependencies:yx,transpose:iD,transposeDependencies:Pe,trueDependencies:_x,typeOf:cD,typeOfDependencies:Kd,typed:oD,typedDependencies:e,unaryMinus:dD,unaryMinusDependencies:K,unaryPlus:pD,unaryPlusDependencies:so,unequal:lD,unequalDependencies:Cx,unit:vD,unitDependencies:Sx,usolve:uD,usolveAll:mD,usolveAllDependencies:Rd,usolveDependencies:lo,vacuumImpedance:fD,vacuumImpedanceDependencies:Tx,variance:DD,varianceDependencies:ho,varianceTransformDependencies:Fx,version:hD,versionDependencies:Mx,weakMixingAngle:gD,weakMixingAngleDependencies:wx,wienDisplacement:bD,wienDisplacementDependencies:Rx,xgcd:xD,xgcdDependencies:Bd,xor:yD,xorDependencies:Ex,zeros:_D,zerosDependencies:M,zeta:CD,zetaDependencies:jx,zpk2tf:SD,zpk2tfDependencies:Ax},Symbol.toStringTag,{value:"Module"})),zx={name:"ns-profit-report",props:["storeLogo","storeName"],data(){return{categoryNames:"",unitNames:"",startDateField:{type:"datetimepicker",value:Qe(ns.date.current).startOf("month").format("YYYY-MM-DD HH:mm:ss")},endDateField:{type:"datetimepicker",value:Qe(ns.date.current).endOf("month").format("YYYY-MM-DD HH:mm:ss")},categoryField:{value:[],label:ve("Filter by Category")},unitField:{value:[],label:ve("Filter by Units")},products:[],ns:window.ns,math:Lx}},components:{nsDatepicker:kD,nsDateTimePicker:TD},computed:{totalQuantities(){return this.products.length>0?this.products.map(n=>n.quantity).reduce((n,l)=>n+l):0},totalPurchasePrice(){return this.products.length>0?this.products.map(n=>n.total_purchase_price).reduce((n,l)=>n+l):0},totalSalePrice(){return this.products.length>0?this.products.map(n=>n.total_price).reduce((n,l)=>n+l):0},totalProfit(){return this.products.length>0?this.products.map(n=>ra(n.total_price).subtract(ra(n.total_purchase_price).add(n.tax_value).done())).reduce((n,l)=>n+l):0},totalTax(){return this.products.length>0?this.products.map(n=>n.tax_value).reduce((n,l)=>n+l):0}},methods:{__:ve,nsCurrency:FD,printSaleReport(){this.$htmlToPaper("profit-report")},setStartDate(n){this.startDate=n.format()},async selectCategories(){try{const n=await _o("/api/categories",this.categoryField.label,this.categoryField.value);this.categoryField.value=n.values,this.categoryNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the categories")).subscribe()}},async selectUnit(){try{const n=await _o("/api/units",this.unitField.label,this.unitField.value);this.unitField.value=n.values,this.unitNames=n.labels,this.loadReport()}catch(n){if(n!==!1)return Re.error(ve("An error has occured while loading the units")).subscribe()}},loadReport(){if(this.startDateField.value===null||this.endDateField.value===null)return Re.error(ve("Unable to proceed. Select a correct time range.")).subscribe();const n=Qe(this.startDateField.value);if(Qe(this.endDateField.value).isBefore(n))return Re.error(ve("Unable to proceed. The current time range is not valid.")).subscribe();ND.post("/api/reports/profit-report",{startDate:this.startDateField.value,endDate:this.endDateField.value,categories:this.categoryField.value,units:this.unitField.value}).subscribe({next:i=>{this.products=i},error:i=>{Re.error(i.message).subscribe()}})},setEndDate(n){this.endDate=n.format()}}},Ux={id:"report-section",class:"px-4"},Bx={class:"flex -mx-2"},Qx={class:"px-2"},Hx={class:"px-2"},Wx={class:"px-2"},Gx=t("i",{class:"las la-sync-alt text-xl"},null,-1),Vx={class:"pl-2"},Yx={class:"px-2"},Zx=t("i",{class:"las la-print text-xl"},null,-1),Xx={class:"pl-2"},Jx={class:"px-2"},Kx=t("i",{class:"las la-filter text-xl"},null,-1),$x={class:"pl-2"},ey={class:"px-2"},ay=t("i",{class:"las la-filter text-xl"},null,-1),sy={class:"pl-2"},ry={id:"profit-report",class:"anim-duration-500 fade-in-entrance"},ny={class:"flex w-full"},ty={class:"my-4 flex justify-between w-full"},iy={class:"text-secondary"},cy={class:"pb-1 border-b border-dashed"},oy={class:"pb-1 border-b border-dashed"},dy={class:"pb-1 border-b border-dashed"},py=["src","alt"],ly={class:"shadow rounded my-4"},vy={class:"ns-box"},uy={class:"border-b ns-box-body"},my={class:"table ns-table w-full"},fy={class:"border p-2 text-left"},Dy={width:"110",class:"text-right border p-2"},hy={width:"110",class:"text-right border p-2"},gy={width:"110",class:"text-right border p-2"},by={width:"110",class:"text-right border p-2"},xy={width:"110",class:"text-right border p-2"},yy={width:"110",class:"text-right border p-2"},_y={class:"p-2 border border-box-edge"},Cy={class:"p-2 border text-right border-box-edge"},Sy={class:"p-2 border text-right border-box-edge"},Ny={class:"p-2 border text-right border-box-edge"},ky={class:"p-2 border text-right border-box-edge"},Ty={class:"p-2 border text-right border-box-edge"},Fy={class:"p-2 border text-right border-box-edge"},My={class:"font-semibold"},wy=t("td",{colspan:"2",class:"p-2 border"},null,-1),Ry={class:"p-2 border text-right"},Ey={class:"p-2 border text-right"},jy={class:"p-2 border text-right"},Ay={class:"p-2 border text-right"},Py={class:"p-2 border text-right"};function Iy(n,l,i,o,x,d){const W=wD("ns-field");return aa(),sa("div",Ux,[t("div",Bx,[t("div",Qx,[Co(W,{field:x.startDateField},null,8,["field"])]),t("div",Hx,[Co(W,{field:x.endDateField},null,8,["field"])]),t("div",Wx,[t("button",{onClick:l[0]||(l[0]=_=>d.loadReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Gx,t("span",Vx,g(d.__("Load")),1)])]),t("div",Yx,[t("button",{onClick:l[1]||(l[1]=_=>d.printSaleReport()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Zx,t("span",Xx,g(d.__("Print")),1)])]),t("div",Jx,[t("button",{onClick:l[2]||(l[2]=_=>d.selectCategories()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[Kx,t("span",$x,g(d.__("Category"))+": "+g(x.categoryNames||d.__("All Categories")),1)])]),t("div",ey,[t("button",{onClick:l[3]||(l[3]=_=>d.selectUnit()),class:"rounded flex justify-between bg-input-background hover:bg-input-button-hover shadow py-1 items-center text-primary px-2"},[ay,t("span",sy,g(d.__("Unit"))+": "+g(x.unitNames||d.__("All Units")),1)])])]),t("div",ry,[t("div",ny,[t("div",ty,[t("div",iy,[t("ul",null,[t("li",cy,g(d.__("Range : {date1} — {date2}").replace("{date1}",x.startDateField.value).replace("{date2}",x.endDateField.value)),1),t("li",oy,g(d.__("Document : Profit Report")),1),t("li",dy,g(d.__("By : {user}").replace("{user}",x.ns.user.username)),1)])]),t("div",null,[t("img",{class:"w-24",src:i.storeLogo,alt:i.storeName},null,8,py)])])]),t("div",ly,[t("div",vy,[t("div",uy,[t("table",my,[t("thead",null,[t("tr",null,[t("th",fy,g(d.__("Product")),1),t("th",Dy,g(d.__("Unit")),1),t("th",hy,g(d.__("Quantity")),1),t("th",gy,g(d.__("COGS")),1),t("th",by,g(d.__("Sale Price")),1),t("th",xy,g(d.__("Taxes")),1),t("th",yy,g(d.__("Profit")),1)])]),t("tbody",null,[(aa(!0),sa(RD,null,ED(x.products,_=>(aa(),sa("tr",{key:_.id,class:jD(_.total_price-_.total_purchase_price<0?"bg-error-primary":"bg-box-background")},[t("td",_y,g(_.name),1),t("td",Cy,g(_.unit_name),1),t("td",Sy,g(_.quantity),1),t("td",Ny,g(d.nsCurrency(_.total_purchase_price)),1),t("td",ky,g(d.nsCurrency(_.total_price)),1),t("td",Ty,g(d.nsCurrency(_.tax_value)),1),t("td",Fy,g(d.nsCurrency(x.math.chain(_.total_price).subtract(x.math.chain(_.total_purchase_price).add(_.tax_value).done()).done())),1)],2))),128))]),t("tfoot",My,[t("tr",null,[wy,t("td",Ry,g(d.totalQuantities),1),t("td",Ey,g(d.nsCurrency(d.totalPurchasePrice)),1),t("td",jy,g(d.nsCurrency(d.totalSalePrice)),1),t("td",Ay,g(d.nsCurrency(d.totalTax)),1),t("td",Py,g(d.nsCurrency(d.totalProfit)),1)])])])])])])])])}const Yy=MD(zx,[["render",Iy]]);export{Yy as default}; diff --git a/public/build/assets/ns-prompt-popup-DKRiwYBT.js b/public/build/assets/ns-prompt-popup-100414c5.js similarity index 74% rename from public/build/assets/ns-prompt-popup-DKRiwYBT.js rename to public/build/assets/ns-prompt-popup-100414c5.js index b2c6d6219..57db3cdf5 100644 --- a/public/build/assets/ns-prompt-popup-DKRiwYBT.js +++ b/public/build/assets/ns-prompt-popup-100414c5.js @@ -1,11 +1,11 @@ -import{g as m5,c as _n,b as xk,_ as $n}from"./currency-lOMYG1Wf.js";import{j as f5,m as k5,V as b5,c as w5,o as A5,q as C5,r as _5,s as v5,t as y5,u as x5,x as E5,y as D5,z as I5,l as S5,A as T5,i as M5,v as Ek,C as B5,w as Dk,k as N5,p as P5,g as Ik}from"./bootstrap-CnLEEQCx.js";import{M as O5,N as L5,O as z5,P as R5,Q as j5,R as F5,S as V5,F as He,L as H5,T as U5,U as q5,V as G5,W as W5,X as K5,Y as $5,Z as Y5,_ as Q5,$ as Z5,a0 as J5,a1 as X5,a2 as tD,a3 as eD,a4 as nD,v as oD,g as Sk,e as te,c as lt,a as it,a5 as iD,a6 as rD,a7 as sD,a8 as aD,a9 as cD,i as Ja,f as vo,aa as lD,d as dD,m as hD,ab as uD,ac as gD,ad as pD,ae as mD,af as fD,ag as kD,ah as bD,ai as wD,aj as AD,ak as CD,al as _D,am as vD,I as yD,x as xD,an as ED,ao as DD,ap as ID,q as SD,aq as TD,ar as MD,as as BD,at as ND,au as PD,av as OD,aw as LD,ax as zD,ay as RD,az as jD,aA as FD,aB as VD,l as HD,n as ee,H as UD,C as qD,aC as GD,aD as WD,aE as KD,aF as $D,aG as YD,aH as QD,J as ZD,aI as JD,aJ as XD,aK as tI,aL as eI,K as nI,aM as oI,o as ct,E as iI,y as rI,aN as sI,D as aI,aO as cI,p as lI,aP as dI,h as hI,aQ as uI,b as dn,A as Ve,r as Kn,G as gI,j as pI,aR as mI,aS as fI,aT as kI,aU as bI,aV as wI,k as AI,aW as CI,s as _I,aX as vI,aY as yI,aZ as xI,t as Ht,a_ as EI,a$ as DI,b0 as II,b1 as SI,b2 as TI,b3 as MI,b4 as BI,b5 as NI,u as PI,b6 as OI,b7 as LI,b8 as zI,b9 as RI,ba as jI,bb as FI,bc as VI,z as HI,bd as UI,be as qI,bf as GI,bg as WI,w as Tk,bh as KI,B as Mk,bi as $I,bj as YI}from"./runtime-core.esm-bundler-RT2b-_3S.js";import{_ as Ze}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** +import{g as p5,c as _n,b as m5,_ as $n}from"./currency-f8bd78d1.js";import{j as f5,m as k5,V as b5,c as w5,o as A5,q as C5,r as _5,s as v5,t as y5,u as x5,x as E5,y as D5,z as I5,l as S5,A as T5,i as M5,v as Ek,C as B5,w as Dk,k as N5,p as P5,g as Ik}from"./bootstrap-8be442b1.js";import{M as O5,N as L5,O as z5,P as R5,Q as j5,R as F5,S as V5,F as He,L as H5,T as U5,U as q5,V as G5,W as W5,X as K5,Y as $5,Z as Y5,_ as Q5,$ as Z5,a0 as J5,a1 as X5,a2 as tD,a3 as eD,a4 as nD,v as oD,g as Sk,e as te,c as lt,a as it,a5 as iD,a6 as rD,a7 as sD,a8 as aD,a9 as cD,i as Xa,f as vo,aa as lD,d as dD,m as hD,ab as uD,ac as gD,ad as pD,ae as mD,af as fD,ag as kD,ah as bD,ai as wD,aj as AD,ak as CD,al as _D,am as vD,I as yD,x as xD,an as ED,ao as DD,ap as ID,q as SD,aq as TD,ar as MD,as as BD,at as ND,au as PD,av as OD,aw as LD,ax as zD,ay as RD,az as jD,aA as FD,aB as VD,l as HD,n as ee,H as UD,C as qD,aC as GD,aD as WD,aE as KD,aF as $D,aG as YD,aH as QD,J as ZD,aI as JD,aJ as XD,aK as tI,aL as eI,K as nI,aM as oI,o as ct,E as iI,y as rI,aN as sI,D as aI,aO as cI,p as lI,aP as dI,h as hI,aQ as uI,b as dn,A as Ve,r as Kn,G as gI,j as pI,aR as mI,aS as fI,aT as kI,aU as bI,aV as wI,k as AI,aW as CI,s as _I,aX as vI,aY as yI,aZ as xI,t as Ht,a_ as EI,a$ as DI,b0 as II,b1 as SI,b2 as TI,b3 as MI,b4 as BI,b5 as NI,u as PI,b6 as OI,b7 as LI,b8 as zI,b9 as RI,ba as jI,bb as FI,bc as VI,z as HI,bd as UI,be as qI,bf as GI,bg as WI,w as Tk,bh as KI,B as Mk,bi as $I,bj as YI}from"./runtime-core.esm-bundler-b48de70a.js";import{_ as Ze}from"./_plugin-vue_export-helper-c27b6911.js";/** * vue v3.4.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const QI=()=>{},ZI=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:O5,BaseTransitionPropsValidators:L5,Comment:z5,DeprecationTypes:R5,EffectScope:j5,ErrorCodes:F5,ErrorTypeStrings:V5,Fragment:He,KeepAlive:H5,ReactiveEffect:U5,Static:q5,Suspense:G5,Teleport:W5,Text:K5,TrackOpTypes:$5,Transition:f5,TransitionGroup:k5,TriggerOpTypes:Y5,VueElement:b5,assertNumber:Q5,callWithAsyncErrorHandling:Z5,callWithErrorHandling:J5,camelize:X5,capitalize:tD,cloneVNode:eD,compatUtils:nD,compile:QI,computed:oD,createApp:w5,createBlock:Sk,createCommentVNode:te,createElementBlock:lt,createElementVNode:it,createHydrationRenderer:iD,createPropsRestProxy:rD,createRenderer:sD,createSSRApp:A5,createSlots:aD,createStaticVNode:cD,createTextVNode:Ja,createVNode:vo,customRef:lD,defineAsyncComponent:dD,defineComponent:hD,defineCustomElement:C5,defineEmits:uD,defineExpose:gD,defineModel:pD,defineOptions:mD,defineProps:fD,defineSSRCustomElement:_5,defineSlots:kD,devtools:bD,effect:wD,effectScope:AD,getCurrentInstance:CD,getCurrentScope:_D,getTransitionRawChildren:vD,guardReactiveProps:yD,h:xD,handleError:ED,hasInjectionContext:DD,hydrate:v5,initCustomFormatter:ID,initDirectivesForSSR:y5,inject:SD,isMemoSame:TD,isProxy:MD,isReactive:BD,isReadonly:ND,isRef:PD,isRuntimeOnly:OD,isShallow:LD,isVNode:zD,markRaw:RD,mergeDefaults:jD,mergeModels:FD,mergeProps:VD,nextTick:HD,normalizeClass:ee,normalizeProps:UD,normalizeStyle:qD,onActivated:GD,onBeforeMount:WD,onBeforeUnmount:KD,onBeforeUpdate:$D,onDeactivated:YD,onErrorCaptured:QD,onMounted:ZD,onRenderTracked:JD,onRenderTriggered:XD,onScopeDispose:tI,onServerPrefetch:eI,onUnmounted:nI,onUpdated:oI,openBlock:ct,popScopeId:iI,provide:rI,proxyRefs:sI,pushScopeId:aI,queuePostFlushCb:cI,reactive:lI,readonly:dI,ref:hI,registerRuntimeCompiler:uI,render:x5,renderList:dn,renderSlot:Ve,resolveComponent:Kn,resolveDirective:gI,resolveDynamicComponent:pI,resolveFilter:mI,resolveTransitionHooks:fI,setBlockTracking:kI,setDevtoolsHook:bI,setTransitionHooks:wI,shallowReactive:AI,shallowReadonly:CI,shallowRef:_I,ssrContextKey:vI,ssrUtils:yI,stop:xI,toDisplayString:Ht,toHandlerKey:EI,toHandlers:DI,toRaw:II,toRef:SI,toRefs:TI,toValue:MI,transformVNodeArgs:BI,triggerRef:NI,unref:PI,useAttrs:OI,useCssModule:E5,useCssVars:D5,useModel:LI,useSSRContext:zI,useSlots:RI,useTransitionState:jI,vModelCheckbox:I5,vModelDynamic:S5,vModelRadio:T5,vModelSelect:M5,vModelText:Ek,vShow:B5,version:FI,warn:VI,watch:HI,watchEffect:UI,watchPostEffect:qI,watchSyncEffect:GI,withAsyncContext:WI,withCtx:Tk,withDefaults:KI,withDirectives:Mk,withKeys:Dk,withMemo:$I,withModifiers:N5,withScopeId:YI},Symbol.toStringTag,{value:"Module"}));var Bk={exports:{}};const JI=m5(ZI);/*! +**/const QI=()=>{},ZI=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:O5,BaseTransitionPropsValidators:L5,Comment:z5,DeprecationTypes:R5,EffectScope:j5,ErrorCodes:F5,ErrorTypeStrings:V5,Fragment:He,KeepAlive:H5,ReactiveEffect:U5,Static:q5,Suspense:G5,Teleport:W5,Text:K5,TrackOpTypes:$5,Transition:f5,TransitionGroup:k5,TriggerOpTypes:Y5,VueElement:b5,assertNumber:Q5,callWithAsyncErrorHandling:Z5,callWithErrorHandling:J5,camelize:X5,capitalize:tD,cloneVNode:eD,compatUtils:nD,compile:QI,computed:oD,createApp:w5,createBlock:Sk,createCommentVNode:te,createElementBlock:lt,createElementVNode:it,createHydrationRenderer:iD,createPropsRestProxy:rD,createRenderer:sD,createSSRApp:A5,createSlots:aD,createStaticVNode:cD,createTextVNode:Xa,createVNode:vo,customRef:lD,defineAsyncComponent:dD,defineComponent:hD,defineCustomElement:C5,defineEmits:uD,defineExpose:gD,defineModel:pD,defineOptions:mD,defineProps:fD,defineSSRCustomElement:_5,defineSlots:kD,devtools:bD,effect:wD,effectScope:AD,getCurrentInstance:CD,getCurrentScope:_D,getTransitionRawChildren:vD,guardReactiveProps:yD,h:xD,handleError:ED,hasInjectionContext:DD,hydrate:v5,initCustomFormatter:ID,initDirectivesForSSR:y5,inject:SD,isMemoSame:TD,isProxy:MD,isReactive:BD,isReadonly:ND,isRef:PD,isRuntimeOnly:OD,isShallow:LD,isVNode:zD,markRaw:RD,mergeDefaults:jD,mergeModels:FD,mergeProps:VD,nextTick:HD,normalizeClass:ee,normalizeProps:UD,normalizeStyle:qD,onActivated:GD,onBeforeMount:WD,onBeforeUnmount:KD,onBeforeUpdate:$D,onDeactivated:YD,onErrorCaptured:QD,onMounted:ZD,onRenderTracked:JD,onRenderTriggered:XD,onScopeDispose:tI,onServerPrefetch:eI,onUnmounted:nI,onUpdated:oI,openBlock:ct,popScopeId:iI,provide:rI,proxyRefs:sI,pushScopeId:aI,queuePostFlushCb:cI,reactive:lI,readonly:dI,ref:hI,registerRuntimeCompiler:uI,render:x5,renderList:dn,renderSlot:Ve,resolveComponent:Kn,resolveDirective:gI,resolveDynamicComponent:pI,resolveFilter:mI,resolveTransitionHooks:fI,setBlockTracking:kI,setDevtoolsHook:bI,setTransitionHooks:wI,shallowReactive:AI,shallowReadonly:CI,shallowRef:_I,ssrContextKey:vI,ssrUtils:yI,stop:xI,toDisplayString:Ht,toHandlerKey:EI,toHandlers:DI,toRaw:II,toRef:SI,toRefs:TI,toValue:MI,transformVNodeArgs:BI,triggerRef:NI,unref:PI,useAttrs:OI,useCssModule:E5,useCssVars:D5,useModel:LI,useSSRContext:zI,useSlots:RI,useTransitionState:jI,vModelCheckbox:I5,vModelDynamic:S5,vModelRadio:T5,vModelSelect:M5,vModelText:Ek,vShow:B5,version:FI,warn:VI,watch:HI,watchEffect:UI,watchPostEffect:qI,watchSyncEffect:GI,withAsyncContext:WI,withCtx:Tk,withDefaults:KI,withDirectives:Mk,withKeys:Dk,withMemo:$I,withModifiers:N5,withScopeId:YI},Symbol.toStringTag,{value:"Module"}));var Ja={},JI={get exports(){return Ja},set exports(N){Ja=N}};const XI=p5(ZI);/*! * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. - */(function(P,F){(function(Y,J){P.exports=J(JI)})(self,Y=>(()=>{var J={976:x=>{x.exports=Y}},N={};function K(x){var m=N[x];if(m!==void 0)return m.exports;var y=N[x]={exports:{}};return J[x](y,y.exports,K),y.exports}K.d=(x,m)=>{for(var y in m)K.o(m,y)&&!K.o(x,y)&&Object.defineProperty(x,y,{enumerable:!0,get:m[y]})},K.o=(x,m)=>Object.prototype.hasOwnProperty.call(x,m);var v={};return(()=>{K.d(v,{default:()=>xo});var x=K(976);const m=function(U){var ht=typeof U;return U!=null&&(ht=="object"||ht=="function")},y=typeof _n=="object"&&_n&&_n.Object===Object&&_n;var D=typeof self=="object"&&self&&self.Object===Object&&self;const C=y||D||Function("return this")(),f=function(){return C.Date.now()};var w=/\s/;const I=function(U){for(var ht=U.length;ht--&&w.test(U.charAt(ht)););return ht};var S=/^\s+/;const T=function(U){return U&&U.slice(0,I(U)+1).replace(S,"")},O=C.Symbol;var j=Object.prototype,H=j.hasOwnProperty,W=j.toString,X=O?O.toStringTag:void 0;const At=function(U){var ht=H.call(U,X),Lt=U[X];try{U[X]=void 0;var ne=!0}catch{}var Te=W.call(U);return ne&&(ht?U[X]=Lt:delete U[X]),Te};var Z=Object.prototype.toString;const rt=function(U){return Z.call(U)};var _=O?O.toStringTag:void 0;const Q=function(U){return U==null?U===void 0?"[object Undefined]":"[object Null]":_&&_ in Object(U)?At(U):rt(U)},Dt=function(U){return U!=null&&typeof U=="object"},Nt=function(U){return typeof U=="symbol"||Dt(U)&&Q(U)=="[object Symbol]"};var Tt=/^[-+]0x[0-9a-f]+$/i,Ue=/^0b[01]+$/i,Ie=/^0o[0-7]+$/i,fe=parseInt;const Je=function(U){if(typeof U=="number")return U;if(Nt(U))return NaN;if(m(U)){var ht=typeof U.valueOf=="function"?U.valueOf():U;U=m(ht)?ht+"":ht}if(typeof U!="string")return U===0?U:+U;U=T(U);var Lt=Ue.test(U);return Lt||Ie.test(U)?fe(U.slice(2),Lt?2:8):Tt.test(U)?NaN:+U};var Se=Math.max,bi=Math.min;const kt=function(U,ht,Lt){var ne,Te,bt,qe,Yt,ke,be=0,Eo=!1,vn=!1,ft=!0;if(typeof U!="function")throw new TypeError("Expected a function");function yn(jt){var Mt=ne,Gt=Te;return ne=Te=void 0,be=jt,qe=U.apply(Gt,Mt)}function jr(jt){return be=jt,Yt=setTimeout(xn,ht),Eo?yn(jt):qe}function wi(jt){var Mt=jt-ke;return ke===void 0||Mt>=ht||Mt<0||vn&&jt-be>=bt}function xn(){var jt=f();if(wi(jt))return Do(jt);Yt=setTimeout(xn,function(Mt){var Gt=ht-(Mt-ke);return vn?bi(Gt,bt-(Mt-be)):Gt}(jt))}function Do(jt){return Yt=void 0,ft&&ne?yn(jt):(ne=Te=void 0,qe)}function Io(){var jt=f(),Mt=wi(jt);if(ne=arguments,Te=this,ke=jt,Mt){if(Yt===void 0)return jr(ke);if(vn)return clearTimeout(Yt),Yt=setTimeout(xn,ht),yn(ke)}return Yt===void 0&&(Yt=setTimeout(xn,ht)),qe}return ht=Je(ht)||0,m(Lt)&&(Eo=!!Lt.leading,bt=(vn="maxWait"in Lt)?Se(Je(Lt.maxWait)||0,ht):bt,ft="trailing"in Lt?!!Lt.trailing:ft),Io.cancel=function(){Yt!==void 0&&clearTimeout(Yt),be=0,ne=ke=Te=Yt=void 0},Io.flush=function(){return Yt===void 0?qe:Do(f())},Io},yo=(0,x.defineComponent)({name:"Ckeditor",model:{prop:"modelValue",event:"update:modelValue"},props:{editor:{type:Function,required:!0},config:{type:Object,default:()=>({})},modelValue:{type:String,default:""},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1},disableTwoWayDataBinding:{type:Boolean,default:!1}},emits:["ready","destroy","blur","focus","input","update:modelValue"],data:()=>({instance:null,lastEditorData:null}),watch:{modelValue(U){this.instance&&U!==this.lastEditorData&&this.instance.data.set(U)},disabled(U){U?this.instance.enableReadOnlyMode("Integration Sample"):this.instance.disableReadOnlyMode("Integration Sample")}},created(){const{CKEDITOR_VERSION:U}=window;if(U){const[ht]=U.split(".").map(Number);ht<37&&console.warn("The component requires using CKEditor 5 in version 37 or higher.")}else console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.')},mounted(){const U=Object.assign({},this.config);this.modelValue&&(U.initialData=this.modelValue),this.editor.create(this.$el,U).then(ht=>{this.instance=(0,x.markRaw)(ht),this.setUpEditorEvents(),this.modelValue!==U.initialData&&ht.data.set(this.modelValue),this.disabled&&ht.enableReadOnlyMode("Integration Sample"),this.$emit("ready",ht)}).catch(ht=>{console.error(ht)})},beforeUnmount(){this.instance&&(this.instance.destroy(),this.instance=null),this.$emit("destroy",this.instance)},methods:{setUpEditorEvents(){const U=this.instance,ht=kt(Lt=>{if(this.disableTwoWayDataBinding)return;const ne=this.lastEditorData=U.data.get();this.$emit("update:modelValue",ne,Lt,U),this.$emit("input",ne,Lt,U)},300,{leading:!0});U.model.document.on("change:data",ht),U.editing.view.document.on("focus",Lt=>{this.$emit("focus",Lt,U)}),U.editing.view.document.on("blur",Lt=>{this.$emit("blur",Lt,U)})}},render(){return(0,x.h)(this.tagName)}});if(!x.version||!x.version.startsWith("3."))throw new Error("The CKEditor plugin works only with Vue 3+. For more information, please refer to https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html");const xo={install(U){U.component("Ckeditor",yo)},component:yo}})(),v=v.default})())})(Bk);var XI=Bk.exports;const tS=xk(XI);var Rr={exports:{}};Rr.exports;(function(P,F){(function(Y){const J=Y.en=Y.en||{};J.dictionary=Object.assign(J.dictionary||{},{"(may require Fn)":"(may require Fn)","%0 of %1":"%0 of %1",Accept:"Accept","Accessibility help":"Accessibility help","Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",Aquamarine:"Aquamarine",Background:"Background","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"Below, you can find a list of keyboard shortcuts that can be used in the editor.",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bold text":"Bold text",Border:"Border","Break text":"Break text","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cannot access default workspace.":"Cannot access default workspace.","Cannot determine a category for the uploaded file.":"Cannot determine a category for the uploaded file.","Cannot upload file:":"Cannot upload file:","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Cell properties":"Cell properties","Center table":"Center table","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Circle:"Circle",Clear:"Clear","Click to edit block":"Click to edit block",Close:"Close","Close contextual balloons, dropdowns, and dialogs":"Close contextual balloons, dropdowns, and dialogs",Code:"Code",Color:"Color","Color picker":"Color picker",Column:"Column","Content editing keystrokes":"Content editing keystrokes","Copy selected content":"Copy selected content","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Create link":"Create link",Dashed:"Dashed",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease indent":"Decrease indent","Decrease list item indent":"Decrease list item indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Dimensions:"Dimensions",Disc:"Disc",Dotted:"Dotted",Double:"Double",Downloadable:"Downloadable","Drag to move":"Drag to move","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit image":"Edit image","Edit link":"Edit link","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor dialog":"Editor dialog","Editor editing area: %0":"Editor editing area: %0","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Enter table caption":"Enter table caption","Execute the currently focused button":"Execute the currently focused button","Failed to determine category of edited image.":"Failed to determine category of edited image.","Full size image":"Full size image",Green:"Green",Grey:"Grey",Groove:"Groove","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Height:"Height","Help Contents. To close this dialog press ESC.":"Help Contents. To close this dialog press ESC.",HEX:"HEX","Horizontal text alignment toolbar":"Horizontal text alignment toolbar","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Increase list item indent":"Increase list item indent",Insert:"Insert","Insert a hard break (a new paragraph)":"Insert a hard break (a new paragraph)","Insert a new paragraph directly after a widget":"Insert a new paragraph directly after a widget","Insert a new paragraph directly before a widget":"Insert a new paragraph directly before a widget","Insert a new table row (when in the last cell of a table)":"Insert a new table row (when in the last cell of a table)","Insert a soft break (a <br> element)":"Insert a soft break (a <br> element)","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert image via URL":"Insert image via URL","Insert image with file manager":"Insert image with file manager","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Insert with file manager":"Insert with file manager","Inserting image failed":"Inserting image failed",Inset:"Inset","Invalid start index value.":"Invalid start index value.",Italic:"Italic","Italic text":"Italic text","Justify cell text":"Justify cell text","Keystrokes that can be used in a list":"Keystrokes that can be used in a list","Keystrokes that can be used in a table cell":"Keystrokes that can be used in a table cell","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"Keystrokes that can be used when a widget is selected (for example: image, table, etc.)","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","List properties":"List properties","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Move focus between form fields (inputs, buttons, etc.)":"Move focus between form fields (inputs, buttons, etc.)","Move focus in and out of an active dialog window":"Move focus in and out of an active dialog window","Move focus to the toolbar, navigate between toolbars":"Move focus to the toolbar, navigate between toolbars","Move out of a link":"Move out of a link","Move out of an inline code style":"Move out of an inline code style","Move the caret to allow typing directly after a widget":"Move the caret to allow typing directly after a widget","Move the caret to allow typing directly before a widget":"Move the caret to allow typing directly before a widget","Move the selection to the next cell":"Move the selection to the next cell","Move the selection to the previous cell":"Move the selection to the previous cell","Navigate through the table":"Navigate through the table","Navigate through the toolbar":"Navigate through the toolbar",Next:"Next","No results found":"No results found","No searchable items":"No searchable items",None:"None","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Open file manager":"Open file manager","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","Open media in new tab":"Open media in new tab","Open the accessibility help dialog":"Open the accessibility help dialog",Orange:"Orange",Original:"Original",Outset:"Outset",Padding:"Padding",Paragraph:"Paragraph","Paste content":"Paste content","Paste content as plain text":"Paste content as plain text","Paste the media URL in the input.":"Paste the media URL in the input.","Press %0 for help.":"Press %0 for help.","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous","Processing the edited image.":"Processing the edited image.",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Replace from computer":"Replace from computer","Replace image":"Replace image","Replace image from computer":"Replace image from computer","Replace image with file manager":"Replace image with file manager","Replace with file manager":"Replace with file manager","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Restore default":"Restore default","Reversed order":"Reversed order","Revert autoformatting action":"Revert autoformatting action","Rich Text Editor":"Rich Text Editor",Ridge:"Ridge","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Server failed to process the image.":"Server failed to process the image.","Show more items":"Show more items","Side image":"Side image",Solid:"Solid","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Square:"Square","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.",Strikethrough:"Strikethrough","Strikethrough text":"Strikethrough text",Style:"Style",Subscript:"Subscript",Superscript:"Superscript","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table properties":"Table properties","Table toolbar":"Table toolbar","Text alternative":"Text alternative",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',"The URL must not be empty.":"The URL must not be empty.",'The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"These keyboard shortcuts allow for quick access to content editing features.":"These keyboard shortcuts allow for quick access to content editing features.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style",Turquoise:"Turquoise","Type or paste your content here.":"Type or paste your content here.","Type your title":"Type your title",Underline:"Underline","Underline text":"Underline text",Undo:"Undo",Unlink:"Unlink",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Upload from computer":"Upload from computer","Upload image from computer":"Upload image from computer","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.","User interface and content navigation keystrokes":"User interface and content navigation keystrokes","Vertical text alignment toolbar":"Vertical text alignment toolbar",White:"White","Widget toolbar":"Widget toolbar",Width:"Width","Wrap text":"Wrap text",Yellow:"Yellow"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(Y,J){P.exports=J()}(self,()=>(()=>{var Y={9246:(v,x,m)=>{const y=m(6931),D={};for(const f of Object.keys(y))D[y[f]]=f;const C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};v.exports=C;for(const f of Object.keys(C)){if(!("channels"in C[f]))throw new Error("missing channels property: "+f);if(!("labels"in C[f]))throw new Error("missing channel labels property: "+f);if(C[f].labels.length!==C[f].channels)throw new Error("channel and label counts mismatch: "+f);const{channels:w,labels:I}=C[f];delete C[f].channels,delete C[f].labels,Object.defineProperty(C[f],"channels",{value:w}),Object.defineProperty(C[f],"labels",{value:I})}C.rgb.hsl=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.min(w,I,S),O=Math.max(w,I,S),j=O-T;let H,W;O===T?H=0:w===O?H=(I-S)/j:I===O?H=2+(S-w)/j:S===O&&(H=4+(w-I)/j),H=Math.min(60*H,360),H<0&&(H+=360);const X=(T+O)/2;return W=O===T?0:X<=.5?j/(O+T):j/(2-O-T),[H,100*W,100*X]},C.rgb.hsv=function(f){let w,I,S,T,O;const j=f[0]/255,H=f[1]/255,W=f[2]/255,X=Math.max(j,H,W),At=X-Math.min(j,H,W),Z=function(rt){return(X-rt)/6/At+.5};return At===0?(T=0,O=0):(O=At/X,w=Z(j),I=Z(H),S=Z(W),j===X?T=S-I:H===X?T=.3333333333333333+w-S:W===X&&(T=.6666666666666666+I-w),T<0?T+=1:T>1&&(T-=1)),[360*T,100*O,100*X]},C.rgb.hwb=function(f){const w=f[0],I=f[1];let S=f[2];const T=C.rgb.hsl(f)[0],O=1/255*Math.min(w,Math.min(I,S));return S=1-.00392156862745098*Math.max(w,Math.max(I,S)),[T,100*O,100*S]},C.rgb.cmyk=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.min(1-w,1-I,1-S);return[100*((1-w-T)/(1-T)||0),100*((1-I-T)/(1-T)||0),100*((1-S-T)/(1-T)||0),100*T]},C.rgb.keyword=function(f){const w=D[f];if(w)return w;let I,S=1/0;for(const j of Object.keys(y)){const H=y[j],W=(O=H,((T=f)[0]-O[0])**2+(T[1]-O[1])**2+(T[2]-O[2])**2);W.04045?((w+.055)/1.055)**2.4:w/12.92,I=I>.04045?((I+.055)/1.055)**2.4:I/12.92,S=S>.04045?((S+.055)/1.055)**2.4:S/12.92,[100*(.4124*w+.3576*I+.1805*S),100*(.2126*w+.7152*I+.0722*S),100*(.0193*w+.1192*I+.9505*S)]},C.rgb.lab=function(f){const w=C.rgb.xyz(f);let I=w[0],S=w[1],T=w[2];return I/=95.047,S/=100,T/=108.883,I=I>.008856?I**.3333333333333333:7.787*I+.13793103448275862,S=S>.008856?S**.3333333333333333:7.787*S+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,[116*S-16,500*(I-S),200*(S-T)]},C.hsl.rgb=function(f){const w=f[0]/360,I=f[1]/100,S=f[2]/100;let T,O,j;if(I===0)return j=255*S,[j,j,j];T=S<.5?S*(1+I):S+I-S*I;const H=2*S-T,W=[0,0,0];for(let X=0;X<3;X++)O=w+.3333333333333333*-(X-1),O<0&&O++,O>1&&O--,j=6*O<1?H+6*(T-H)*O:2*O<1?T:3*O<2?H+(T-H)*(.6666666666666666-O)*6:H,W[X]=255*j;return W},C.hsl.hsv=function(f){const w=f[0];let I=f[1]/100,S=f[2]/100,T=I;const O=Math.max(S,.01);return S*=2,I*=S<=1?S:2-S,T*=O<=1?O:2-O,[w,100*(S===0?2*T/(O+T):2*I/(S+I)),100*((S+I)/2)]},C.hsv.rgb=function(f){const w=f[0]/60,I=f[1]/100;let S=f[2]/100;const T=Math.floor(w)%6,O=w-Math.floor(w),j=255*S*(1-I),H=255*S*(1-I*O),W=255*S*(1-I*(1-O));switch(S*=255,T){case 0:return[S,W,j];case 1:return[H,S,j];case 2:return[j,S,W];case 3:return[j,H,S];case 4:return[W,j,S];case 5:return[S,j,H]}},C.hsv.hsl=function(f){const w=f[0],I=f[1]/100,S=f[2]/100,T=Math.max(S,.01);let O,j;j=(2-I)*S;const H=(2-I)*T;return O=I*T,O/=H<=1?H:2-H,O=O||0,j/=2,[w,100*O,100*j]},C.hwb.rgb=function(f){const w=f[0]/360;let I=f[1]/100,S=f[2]/100;const T=I+S;let O;T>1&&(I/=T,S/=T);const j=Math.floor(6*w),H=1-S;O=6*w-j,1&j&&(O=1-O);const W=I+O*(H-I);let X,At,Z;switch(j){default:case 6:case 0:X=H,At=W,Z=I;break;case 1:X=W,At=H,Z=I;break;case 2:X=I,At=H,Z=W;break;case 3:X=I,At=W,Z=H;break;case 4:X=W,At=I,Z=H;break;case 5:X=H,At=I,Z=W}return[255*X,255*At,255*Z]},C.cmyk.rgb=function(f){const w=f[0]/100,I=f[1]/100,S=f[2]/100,T=f[3]/100;return[255*(1-Math.min(1,w*(1-T)+T)),255*(1-Math.min(1,I*(1-T)+T)),255*(1-Math.min(1,S*(1-T)+T))]},C.xyz.rgb=function(f){const w=f[0]/100,I=f[1]/100,S=f[2]/100;let T,O,j;return T=3.2406*w+-1.5372*I+-.4986*S,O=-.9689*w+1.8758*I+.0415*S,j=.0557*w+-.204*I+1.057*S,T=T>.0031308?1.055*T**.4166666666666667-.055:12.92*T,O=O>.0031308?1.055*O**.4166666666666667-.055:12.92*O,j=j>.0031308?1.055*j**.4166666666666667-.055:12.92*j,T=Math.min(Math.max(0,T),1),O=Math.min(Math.max(0,O),1),j=Math.min(Math.max(0,j),1),[255*T,255*O,255*j]},C.xyz.lab=function(f){let w=f[0],I=f[1],S=f[2];return w/=95.047,I/=100,S/=108.883,w=w>.008856?w**.3333333333333333:7.787*w+.13793103448275862,I=I>.008856?I**.3333333333333333:7.787*I+.13793103448275862,S=S>.008856?S**.3333333333333333:7.787*S+.13793103448275862,[116*I-16,500*(w-I),200*(I-S)]},C.lab.xyz=function(f){let w,I,S;I=(f[0]+16)/116,w=f[1]/500+I,S=I-f[2]/200;const T=I**3,O=w**3,j=S**3;return I=T>.008856?T:(I-.13793103448275862)/7.787,w=O>.008856?O:(w-.13793103448275862)/7.787,S=j>.008856?j:(S-.13793103448275862)/7.787,w*=95.047,I*=100,S*=108.883,[w,I,S]},C.lab.lch=function(f){const w=f[0],I=f[1],S=f[2];let T;return T=360*Math.atan2(S,I)/2/Math.PI,T<0&&(T+=360),[w,Math.sqrt(I*I+S*S),T]},C.lch.lab=function(f){const w=f[0],I=f[1],S=f[2]/360*2*Math.PI;return[w,I*Math.cos(S),I*Math.sin(S)]},C.rgb.ansi16=function(f,w=null){const[I,S,T]=f;let O=w===null?C.rgb.hsv(f)[2]:w;if(O=Math.round(O/50),O===0)return 30;let j=30+(Math.round(T/255)<<2|Math.round(S/255)<<1|Math.round(I/255));return O===2&&(j+=60),j},C.hsv.ansi16=function(f){return C.rgb.ansi16(C.hsv.rgb(f),f[2])},C.rgb.ansi256=function(f){const w=f[0],I=f[1],S=f[2];return w===I&&I===S?w<8?16:w>248?231:Math.round((w-8)/247*24)+232:16+36*Math.round(w/255*5)+6*Math.round(I/255*5)+Math.round(S/255*5)},C.ansi16.rgb=function(f){let w=f%10;if(w===0||w===7)return f>50&&(w+=3.5),w=w/10.5*255,[w,w,w];const I=.5*(1+~~(f>50));return[(1&w)*I*255,(w>>1&1)*I*255,(w>>2&1)*I*255]},C.ansi256.rgb=function(f){if(f>=232){const I=10*(f-232)+8;return[I,I,I]}let w;return f-=16,[Math.floor(f/36)/5*255,Math.floor((w=f%36)/6)/5*255,w%6/5*255]},C.rgb.hex=function(f){const w=(((255&Math.round(f[0]))<<16)+((255&Math.round(f[1]))<<8)+(255&Math.round(f[2]))).toString(16).toUpperCase();return"000000".substring(w.length)+w},C.hex.rgb=function(f){const w=f.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!w)return[0,0,0];let I=w[0];w[0].length===3&&(I=I.split("").map(T=>T+T).join(""));const S=parseInt(I,16);return[S>>16&255,S>>8&255,255&S]},C.rgb.hcg=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.max(Math.max(w,I),S),O=Math.min(Math.min(w,I),S),j=T-O;let H,W;return H=j<1?O/(1-j):0,W=j<=0?0:T===w?(I-S)/j%6:T===I?2+(S-w)/j:4+(w-I)/j,W/=6,W%=1,[360*W,100*j,100*H]},C.hsl.hcg=function(f){const w=f[1]/100,I=f[2]/100,S=I<.5?2*w*I:2*w*(1-I);let T=0;return S<1&&(T=(I-.5*S)/(1-S)),[f[0],100*S,100*T]},C.hsv.hcg=function(f){const w=f[1]/100,I=f[2]/100,S=w*I;let T=0;return S<1&&(T=(I-S)/(1-S)),[f[0],100*S,100*T]},C.hcg.rgb=function(f){const w=f[0]/360,I=f[1]/100,S=f[2]/100;if(I===0)return[255*S,255*S,255*S];const T=[0,0,0],O=w%1*6,j=O%1,H=1-j;let W=0;switch(Math.floor(O)){case 0:T[0]=1,T[1]=j,T[2]=0;break;case 1:T[0]=H,T[1]=1,T[2]=0;break;case 2:T[0]=0,T[1]=1,T[2]=j;break;case 3:T[0]=0,T[1]=H,T[2]=1;break;case 4:T[0]=j,T[1]=0,T[2]=1;break;default:T[0]=1,T[1]=0,T[2]=H}return W=(1-I)*S,[255*(I*T[0]+W),255*(I*T[1]+W),255*(I*T[2]+W)]},C.hcg.hsv=function(f){const w=f[1]/100,I=w+f[2]/100*(1-w);let S=0;return I>0&&(S=w/I),[f[0],100*S,100*I]},C.hcg.hsl=function(f){const w=f[1]/100,I=f[2]/100*(1-w)+.5*w;let S=0;return I>0&&I<.5?S=w/(2*I):I>=.5&&I<1&&(S=w/(2*(1-I))),[f[0],100*S,100*I]},C.hcg.hwb=function(f){const w=f[1]/100,I=w+f[2]/100*(1-w);return[f[0],100*(I-w),100*(1-I)]},C.hwb.hcg=function(f){const w=f[1]/100,I=1-f[2]/100,S=I-w;let T=0;return S<1&&(T=(I-S)/(1-S)),[f[0],100*S,100*T]},C.apple.rgb=function(f){return[f[0]/65535*255,f[1]/65535*255,f[2]/65535*255]},C.rgb.apple=function(f){return[f[0]/255*65535,f[1]/255*65535,f[2]/255*65535]},C.gray.rgb=function(f){return[f[0]/100*255,f[0]/100*255,f[0]/100*255]},C.gray.hsl=function(f){return[0,0,f[0]]},C.gray.hsv=C.gray.hsl,C.gray.hwb=function(f){return[0,100,f[0]]},C.gray.cmyk=function(f){return[0,0,0,f[0]]},C.gray.lab=function(f){return[f[0],0,0]},C.gray.hex=function(f){const w=255&Math.round(f[0]/100*255),I=((w<<16)+(w<<8)+w).toString(16).toUpperCase();return"000000".substring(I.length)+I},C.rgb.gray=function(f){return[(f[0]+f[1]+f[2])/3/255*100]}},9047:(v,x,m)=>{const y=m(9246),D=m(802),C={};Object.keys(y).forEach(f=>{C[f]={},Object.defineProperty(C[f],"channels",{value:y[f].channels}),Object.defineProperty(C[f],"labels",{value:y[f].labels});const w=D(f);Object.keys(w).forEach(I=>{const S=w[I];C[f][I]=function(T){const O=function(...j){const H=j[0];if(H==null)return H;H.length>1&&(j=H);const W=T(j);if(typeof W=="object")for(let X=W.length,At=0;At1&&(j=H),T(j))};return"conversion"in T&&(O.conversion=T.conversion),O}(S)})}),v.exports=C},802:(v,x,m)=>{const y=m(9246);function D(w){const I=function(){const T={},O=Object.keys(y);for(let j=O.length,H=0;H{v.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},4199:(v,x,m)=>{m.d(x,{A:()=>w});var y=m(9372),D=m.n(y),C=m(935),f=m.n(C)()(D());f.push([v.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./../ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:[`/* + */(function(N,F){(function(Y,J){N.exports=J(XI)})(self,Y=>(()=>{var J={976:x=>{x.exports=Y}},P={};function K(x){var m=P[x];if(m!==void 0)return m.exports;var y=P[x]={exports:{}};return J[x](y,y.exports,K),y.exports}K.d=(x,m)=>{for(var y in m)K.o(m,y)&&!K.o(x,y)&&Object.defineProperty(x,y,{enumerable:!0,get:m[y]})},K.o=(x,m)=>Object.prototype.hasOwnProperty.call(x,m);var v={};return(()=>{K.d(v,{default:()=>xo});var x=K(976);const m=function(U){var ht=typeof U;return U!=null&&(ht=="object"||ht=="function")},y=typeof _n=="object"&&_n&&_n.Object===Object&&_n;var D=typeof self=="object"&&self&&self.Object===Object&&self;const C=y||D||Function("return this")(),f=function(){return C.Date.now()};var w=/\s/;const I=function(U){for(var ht=U.length;ht--&&w.test(U.charAt(ht)););return ht};var S=/^\s+/;const T=function(U){return U&&U.slice(0,I(U)+1).replace(S,"")},O=C.Symbol;var j=Object.prototype,H=j.hasOwnProperty,W=j.toString,X=O?O.toStringTag:void 0;const At=function(U){var ht=H.call(U,X),Lt=U[X];try{U[X]=void 0;var ne=!0}catch{}var Te=W.call(U);return ne&&(ht?U[X]=Lt:delete U[X]),Te};var Z=Object.prototype.toString;const rt=function(U){return Z.call(U)};var _=O?O.toStringTag:void 0;const Q=function(U){return U==null?U===void 0?"[object Undefined]":"[object Null]":_&&_ in Object(U)?At(U):rt(U)},Dt=function(U){return U!=null&&typeof U=="object"},Nt=function(U){return typeof U=="symbol"||Dt(U)&&Q(U)=="[object Symbol]"};var Tt=/^[-+]0x[0-9a-f]+$/i,Ue=/^0b[01]+$/i,Ie=/^0o[0-7]+$/i,fe=parseInt;const Je=function(U){if(typeof U=="number")return U;if(Nt(U))return NaN;if(m(U)){var ht=typeof U.valueOf=="function"?U.valueOf():U;U=m(ht)?ht+"":ht}if(typeof U!="string")return U===0?U:+U;U=T(U);var Lt=Ue.test(U);return Lt||Ie.test(U)?fe(U.slice(2),Lt?2:8):Tt.test(U)?NaN:+U};var Se=Math.max,bi=Math.min;const kt=function(U,ht,Lt){var ne,Te,bt,qe,Yt,ke,be=0,Eo=!1,vn=!1,ft=!0;if(typeof U!="function")throw new TypeError("Expected a function");function yn(jt){var Mt=ne,Gt=Te;return ne=Te=void 0,be=jt,qe=U.apply(Gt,Mt)}function jr(jt){return be=jt,Yt=setTimeout(xn,ht),Eo?yn(jt):qe}function wi(jt){var Mt=jt-ke;return ke===void 0||Mt>=ht||Mt<0||vn&&jt-be>=bt}function xn(){var jt=f();if(wi(jt))return Do(jt);Yt=setTimeout(xn,function(Mt){var Gt=ht-(Mt-ke);return vn?bi(Gt,bt-(Mt-be)):Gt}(jt))}function Do(jt){return Yt=void 0,ft&&ne?yn(jt):(ne=Te=void 0,qe)}function Io(){var jt=f(),Mt=wi(jt);if(ne=arguments,Te=this,ke=jt,Mt){if(Yt===void 0)return jr(ke);if(vn)return clearTimeout(Yt),Yt=setTimeout(xn,ht),yn(ke)}return Yt===void 0&&(Yt=setTimeout(xn,ht)),qe}return ht=Je(ht)||0,m(Lt)&&(Eo=!!Lt.leading,bt=(vn="maxWait"in Lt)?Se(Je(Lt.maxWait)||0,ht):bt,ft="trailing"in Lt?!!Lt.trailing:ft),Io.cancel=function(){Yt!==void 0&&clearTimeout(Yt),be=0,ne=ke=Te=Yt=void 0},Io.flush=function(){return Yt===void 0?qe:Do(f())},Io},yo=(0,x.defineComponent)({name:"Ckeditor",model:{prop:"modelValue",event:"update:modelValue"},props:{editor:{type:Function,required:!0},config:{type:Object,default:()=>({})},modelValue:{type:String,default:""},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1},disableTwoWayDataBinding:{type:Boolean,default:!1}},emits:["ready","destroy","blur","focus","input","update:modelValue"],data:()=>({instance:null,lastEditorData:null}),watch:{modelValue(U){this.instance&&U!==this.lastEditorData&&this.instance.data.set(U)},disabled(U){U?this.instance.enableReadOnlyMode("Integration Sample"):this.instance.disableReadOnlyMode("Integration Sample")}},created(){const{CKEDITOR_VERSION:U}=window;if(U){const[ht]=U.split(".").map(Number);ht<37&&console.warn("The component requires using CKEditor 5 in version 37 or higher.")}else console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.')},mounted(){const U=Object.assign({},this.config);this.modelValue&&(U.initialData=this.modelValue),this.editor.create(this.$el,U).then(ht=>{this.instance=(0,x.markRaw)(ht),this.setUpEditorEvents(),this.modelValue!==U.initialData&&ht.data.set(this.modelValue),this.disabled&&ht.enableReadOnlyMode("Integration Sample"),this.$emit("ready",ht)}).catch(ht=>{console.error(ht)})},beforeUnmount(){this.instance&&(this.instance.destroy(),this.instance=null),this.$emit("destroy",this.instance)},methods:{setUpEditorEvents(){const U=this.instance,ht=kt(Lt=>{if(this.disableTwoWayDataBinding)return;const ne=this.lastEditorData=U.data.get();this.$emit("update:modelValue",ne,Lt,U),this.$emit("input",ne,Lt,U)},300,{leading:!0});U.model.document.on("change:data",ht),U.editing.view.document.on("focus",Lt=>{this.$emit("focus",Lt,U)}),U.editing.view.document.on("blur",Lt=>{this.$emit("blur",Lt,U)})}},render(){return(0,x.h)(this.tagName)}});if(!x.version||!x.version.startsWith("3."))throw new Error("The CKEditor plugin works only with Vue 3+. For more information, please refer to https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html");const xo={install(U){U.component("Ckeditor",yo)},component:yo}})(),v=v.default})())})(JI);const tS=Ja;var Rr={},eS={get exports(){return Rr},set exports(N){Rr=N}};(function(N,F){(function(Y){const J=Y.en=Y.en||{};J.dictionary=Object.assign(J.dictionary||{},{"(may require Fn)":"(may require Fn)","%0 of %1":"%0 of %1",Accept:"Accept","Accessibility help":"Accessibility help","Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",Aquamarine:"Aquamarine",Background:"Background","Below, you can find a list of keyboard shortcuts that can be used in the editor.":"Below, you can find a list of keyboard shortcuts that can be used in the editor.",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bold text":"Bold text",Border:"Border","Break text":"Break text","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cannot access default workspace.":"Cannot access default workspace.","Cannot determine a category for the uploaded file.":"Cannot determine a category for the uploaded file.","Cannot upload file:":"Cannot upload file:","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Cell properties":"Cell properties","Center table":"Center table","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Circle:"Circle",Clear:"Clear","Click to edit block":"Click to edit block",Close:"Close","Close contextual balloons, dropdowns, and dialogs":"Close contextual balloons, dropdowns, and dialogs",Code:"Code",Color:"Color","Color picker":"Color picker",Column:"Column","Content editing keystrokes":"Content editing keystrokes","Copy selected content":"Copy selected content","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Create link":"Create link",Dashed:"Dashed",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease indent":"Decrease indent","Decrease list item indent":"Decrease list item indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Dimensions:"Dimensions",Disc:"Disc",Dotted:"Dotted",Double:"Double",Downloadable:"Downloadable","Drag to move":"Drag to move","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit image":"Edit image","Edit link":"Edit link","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor dialog":"Editor dialog","Editor editing area: %0":"Editor editing area: %0","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Enter table caption":"Enter table caption","Execute the currently focused button":"Execute the currently focused button","Failed to determine category of edited image.":"Failed to determine category of edited image.","Full size image":"Full size image",Green:"Green",Grey:"Grey",Groove:"Groove","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Height:"Height","Help Contents. To close this dialog press ESC.":"Help Contents. To close this dialog press ESC.",HEX:"HEX","Horizontal text alignment toolbar":"Horizontal text alignment toolbar","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Increase list item indent":"Increase list item indent",Insert:"Insert","Insert a hard break (a new paragraph)":"Insert a hard break (a new paragraph)","Insert a new paragraph directly after a widget":"Insert a new paragraph directly after a widget","Insert a new paragraph directly before a widget":"Insert a new paragraph directly before a widget","Insert a new table row (when in the last cell of a table)":"Insert a new table row (when in the last cell of a table)","Insert a soft break (a <br> element)":"Insert a soft break (a <br> element)","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert image via URL":"Insert image via URL","Insert image with file manager":"Insert image with file manager","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Insert with file manager":"Insert with file manager","Inserting image failed":"Inserting image failed",Inset:"Inset","Invalid start index value.":"Invalid start index value.",Italic:"Italic","Italic text":"Italic text","Justify cell text":"Justify cell text","Keystrokes that can be used in a list":"Keystrokes that can be used in a list","Keystrokes that can be used in a table cell":"Keystrokes that can be used in a table cell","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"Keystrokes that can be used when a widget is selected (for example: image, table, etc.)","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","List properties":"List properties","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Move focus between form fields (inputs, buttons, etc.)":"Move focus between form fields (inputs, buttons, etc.)","Move focus in and out of an active dialog window":"Move focus in and out of an active dialog window","Move focus to the toolbar, navigate between toolbars":"Move focus to the toolbar, navigate between toolbars","Move out of a link":"Move out of a link","Move out of an inline code style":"Move out of an inline code style","Move the caret to allow typing directly after a widget":"Move the caret to allow typing directly after a widget","Move the caret to allow typing directly before a widget":"Move the caret to allow typing directly before a widget","Move the selection to the next cell":"Move the selection to the next cell","Move the selection to the previous cell":"Move the selection to the previous cell","Navigate through the table":"Navigate through the table","Navigate through the toolbar":"Navigate through the toolbar",Next:"Next","No results found":"No results found","No searchable items":"No searchable items",None:"None","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Open file manager":"Open file manager","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","Open media in new tab":"Open media in new tab","Open the accessibility help dialog":"Open the accessibility help dialog",Orange:"Orange",Original:"Original",Outset:"Outset",Padding:"Padding",Paragraph:"Paragraph","Paste content":"Paste content","Paste content as plain text":"Paste content as plain text","Paste the media URL in the input.":"Paste the media URL in the input.","Press %0 for help.":"Press %0 for help.","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous","Processing the edited image.":"Processing the edited image.",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Replace from computer":"Replace from computer","Replace image":"Replace image","Replace image from computer":"Replace image from computer","Replace image with file manager":"Replace image with file manager","Replace with file manager":"Replace with file manager","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Restore default":"Restore default","Reversed order":"Reversed order","Revert autoformatting action":"Revert autoformatting action","Rich Text Editor":"Rich Text Editor",Ridge:"Ridge","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Server failed to process the image.":"Server failed to process the image.","Show more items":"Show more items","Side image":"Side image",Solid:"Solid","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Square:"Square","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.",Strikethrough:"Strikethrough","Strikethrough text":"Strikethrough text",Style:"Style",Subscript:"Subscript",Superscript:"Superscript","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table properties":"Table properties","Table toolbar":"Table toolbar","Text alternative":"Text alternative",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',"The URL must not be empty.":"The URL must not be empty.",'The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"These keyboard shortcuts allow for quick access to content editing features.":"These keyboard shortcuts allow for quick access to content editing features.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style",Turquoise:"Turquoise","Type or paste your content here.":"Type or paste your content here.","Type your title":"Type your title",Underline:"Underline","Underline text":"Underline text",Undo:"Undo",Unlink:"Unlink",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Upload from computer":"Upload from computer","Upload image from computer":"Upload image from computer","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.":"Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface.","User interface and content navigation keystrokes":"User interface and content navigation keystrokes","Vertical text alignment toolbar":"Vertical text alignment toolbar",White:"White","Widget toolbar":"Widget toolbar",Width:"Width","Wrap text":"Wrap text",Yellow:"Yellow"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(Y,J){N.exports=J()}(self,()=>(()=>{var Y={9246:(v,x,m)=>{const y=m(6931),D={};for(const f of Object.keys(y))D[y[f]]=f;const C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};v.exports=C;for(const f of Object.keys(C)){if(!("channels"in C[f]))throw new Error("missing channels property: "+f);if(!("labels"in C[f]))throw new Error("missing channel labels property: "+f);if(C[f].labels.length!==C[f].channels)throw new Error("channel and label counts mismatch: "+f);const{channels:w,labels:I}=C[f];delete C[f].channels,delete C[f].labels,Object.defineProperty(C[f],"channels",{value:w}),Object.defineProperty(C[f],"labels",{value:I})}C.rgb.hsl=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.min(w,I,S),O=Math.max(w,I,S),j=O-T;let H,W;O===T?H=0:w===O?H=(I-S)/j:I===O?H=2+(S-w)/j:S===O&&(H=4+(w-I)/j),H=Math.min(60*H,360),H<0&&(H+=360);const X=(T+O)/2;return W=O===T?0:X<=.5?j/(O+T):j/(2-O-T),[H,100*W,100*X]},C.rgb.hsv=function(f){let w,I,S,T,O;const j=f[0]/255,H=f[1]/255,W=f[2]/255,X=Math.max(j,H,W),At=X-Math.min(j,H,W),Z=function(rt){return(X-rt)/6/At+.5};return At===0?(T=0,O=0):(O=At/X,w=Z(j),I=Z(H),S=Z(W),j===X?T=S-I:H===X?T=.3333333333333333+w-S:W===X&&(T=.6666666666666666+I-w),T<0?T+=1:T>1&&(T-=1)),[360*T,100*O,100*X]},C.rgb.hwb=function(f){const w=f[0],I=f[1];let S=f[2];const T=C.rgb.hsl(f)[0],O=1/255*Math.min(w,Math.min(I,S));return S=1-.00392156862745098*Math.max(w,Math.max(I,S)),[T,100*O,100*S]},C.rgb.cmyk=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.min(1-w,1-I,1-S);return[100*((1-w-T)/(1-T)||0),100*((1-I-T)/(1-T)||0),100*((1-S-T)/(1-T)||0),100*T]},C.rgb.keyword=function(f){const w=D[f];if(w)return w;let I,S=1/0;for(const j of Object.keys(y)){const H=y[j],W=(O=H,((T=f)[0]-O[0])**2+(T[1]-O[1])**2+(T[2]-O[2])**2);W.04045?((w+.055)/1.055)**2.4:w/12.92,I=I>.04045?((I+.055)/1.055)**2.4:I/12.92,S=S>.04045?((S+.055)/1.055)**2.4:S/12.92,[100*(.4124*w+.3576*I+.1805*S),100*(.2126*w+.7152*I+.0722*S),100*(.0193*w+.1192*I+.9505*S)]},C.rgb.lab=function(f){const w=C.rgb.xyz(f);let I=w[0],S=w[1],T=w[2];return I/=95.047,S/=100,T/=108.883,I=I>.008856?I**.3333333333333333:7.787*I+.13793103448275862,S=S>.008856?S**.3333333333333333:7.787*S+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,[116*S-16,500*(I-S),200*(S-T)]},C.hsl.rgb=function(f){const w=f[0]/360,I=f[1]/100,S=f[2]/100;let T,O,j;if(I===0)return j=255*S,[j,j,j];T=S<.5?S*(1+I):S+I-S*I;const H=2*S-T,W=[0,0,0];for(let X=0;X<3;X++)O=w+.3333333333333333*-(X-1),O<0&&O++,O>1&&O--,j=6*O<1?H+6*(T-H)*O:2*O<1?T:3*O<2?H+(T-H)*(.6666666666666666-O)*6:H,W[X]=255*j;return W},C.hsl.hsv=function(f){const w=f[0];let I=f[1]/100,S=f[2]/100,T=I;const O=Math.max(S,.01);return S*=2,I*=S<=1?S:2-S,T*=O<=1?O:2-O,[w,100*(S===0?2*T/(O+T):2*I/(S+I)),100*((S+I)/2)]},C.hsv.rgb=function(f){const w=f[0]/60,I=f[1]/100;let S=f[2]/100;const T=Math.floor(w)%6,O=w-Math.floor(w),j=255*S*(1-I),H=255*S*(1-I*O),W=255*S*(1-I*(1-O));switch(S*=255,T){case 0:return[S,W,j];case 1:return[H,S,j];case 2:return[j,S,W];case 3:return[j,H,S];case 4:return[W,j,S];case 5:return[S,j,H]}},C.hsv.hsl=function(f){const w=f[0],I=f[1]/100,S=f[2]/100,T=Math.max(S,.01);let O,j;j=(2-I)*S;const H=(2-I)*T;return O=I*T,O/=H<=1?H:2-H,O=O||0,j/=2,[w,100*O,100*j]},C.hwb.rgb=function(f){const w=f[0]/360;let I=f[1]/100,S=f[2]/100;const T=I+S;let O;T>1&&(I/=T,S/=T);const j=Math.floor(6*w),H=1-S;O=6*w-j,1&j&&(O=1-O);const W=I+O*(H-I);let X,At,Z;switch(j){default:case 6:case 0:X=H,At=W,Z=I;break;case 1:X=W,At=H,Z=I;break;case 2:X=I,At=H,Z=W;break;case 3:X=I,At=W,Z=H;break;case 4:X=W,At=I,Z=H;break;case 5:X=H,At=I,Z=W}return[255*X,255*At,255*Z]},C.cmyk.rgb=function(f){const w=f[0]/100,I=f[1]/100,S=f[2]/100,T=f[3]/100;return[255*(1-Math.min(1,w*(1-T)+T)),255*(1-Math.min(1,I*(1-T)+T)),255*(1-Math.min(1,S*(1-T)+T))]},C.xyz.rgb=function(f){const w=f[0]/100,I=f[1]/100,S=f[2]/100;let T,O,j;return T=3.2406*w+-1.5372*I+-.4986*S,O=-.9689*w+1.8758*I+.0415*S,j=.0557*w+-.204*I+1.057*S,T=T>.0031308?1.055*T**.4166666666666667-.055:12.92*T,O=O>.0031308?1.055*O**.4166666666666667-.055:12.92*O,j=j>.0031308?1.055*j**.4166666666666667-.055:12.92*j,T=Math.min(Math.max(0,T),1),O=Math.min(Math.max(0,O),1),j=Math.min(Math.max(0,j),1),[255*T,255*O,255*j]},C.xyz.lab=function(f){let w=f[0],I=f[1],S=f[2];return w/=95.047,I/=100,S/=108.883,w=w>.008856?w**.3333333333333333:7.787*w+.13793103448275862,I=I>.008856?I**.3333333333333333:7.787*I+.13793103448275862,S=S>.008856?S**.3333333333333333:7.787*S+.13793103448275862,[116*I-16,500*(w-I),200*(I-S)]},C.lab.xyz=function(f){let w,I,S;I=(f[0]+16)/116,w=f[1]/500+I,S=I-f[2]/200;const T=I**3,O=w**3,j=S**3;return I=T>.008856?T:(I-.13793103448275862)/7.787,w=O>.008856?O:(w-.13793103448275862)/7.787,S=j>.008856?j:(S-.13793103448275862)/7.787,w*=95.047,I*=100,S*=108.883,[w,I,S]},C.lab.lch=function(f){const w=f[0],I=f[1],S=f[2];let T;return T=360*Math.atan2(S,I)/2/Math.PI,T<0&&(T+=360),[w,Math.sqrt(I*I+S*S),T]},C.lch.lab=function(f){const w=f[0],I=f[1],S=f[2]/360*2*Math.PI;return[w,I*Math.cos(S),I*Math.sin(S)]},C.rgb.ansi16=function(f,w=null){const[I,S,T]=f;let O=w===null?C.rgb.hsv(f)[2]:w;if(O=Math.round(O/50),O===0)return 30;let j=30+(Math.round(T/255)<<2|Math.round(S/255)<<1|Math.round(I/255));return O===2&&(j+=60),j},C.hsv.ansi16=function(f){return C.rgb.ansi16(C.hsv.rgb(f),f[2])},C.rgb.ansi256=function(f){const w=f[0],I=f[1],S=f[2];return w===I&&I===S?w<8?16:w>248?231:Math.round((w-8)/247*24)+232:16+36*Math.round(w/255*5)+6*Math.round(I/255*5)+Math.round(S/255*5)},C.ansi16.rgb=function(f){let w=f%10;if(w===0||w===7)return f>50&&(w+=3.5),w=w/10.5*255,[w,w,w];const I=.5*(1+~~(f>50));return[(1&w)*I*255,(w>>1&1)*I*255,(w>>2&1)*I*255]},C.ansi256.rgb=function(f){if(f>=232){const I=10*(f-232)+8;return[I,I,I]}let w;return f-=16,[Math.floor(f/36)/5*255,Math.floor((w=f%36)/6)/5*255,w%6/5*255]},C.rgb.hex=function(f){const w=(((255&Math.round(f[0]))<<16)+((255&Math.round(f[1]))<<8)+(255&Math.round(f[2]))).toString(16).toUpperCase();return"000000".substring(w.length)+w},C.hex.rgb=function(f){const w=f.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!w)return[0,0,0];let I=w[0];w[0].length===3&&(I=I.split("").map(T=>T+T).join(""));const S=parseInt(I,16);return[S>>16&255,S>>8&255,255&S]},C.rgb.hcg=function(f){const w=f[0]/255,I=f[1]/255,S=f[2]/255,T=Math.max(Math.max(w,I),S),O=Math.min(Math.min(w,I),S),j=T-O;let H,W;return H=j<1?O/(1-j):0,W=j<=0?0:T===w?(I-S)/j%6:T===I?2+(S-w)/j:4+(w-I)/j,W/=6,W%=1,[360*W,100*j,100*H]},C.hsl.hcg=function(f){const w=f[1]/100,I=f[2]/100,S=I<.5?2*w*I:2*w*(1-I);let T=0;return S<1&&(T=(I-.5*S)/(1-S)),[f[0],100*S,100*T]},C.hsv.hcg=function(f){const w=f[1]/100,I=f[2]/100,S=w*I;let T=0;return S<1&&(T=(I-S)/(1-S)),[f[0],100*S,100*T]},C.hcg.rgb=function(f){const w=f[0]/360,I=f[1]/100,S=f[2]/100;if(I===0)return[255*S,255*S,255*S];const T=[0,0,0],O=w%1*6,j=O%1,H=1-j;let W=0;switch(Math.floor(O)){case 0:T[0]=1,T[1]=j,T[2]=0;break;case 1:T[0]=H,T[1]=1,T[2]=0;break;case 2:T[0]=0,T[1]=1,T[2]=j;break;case 3:T[0]=0,T[1]=H,T[2]=1;break;case 4:T[0]=j,T[1]=0,T[2]=1;break;default:T[0]=1,T[1]=0,T[2]=H}return W=(1-I)*S,[255*(I*T[0]+W),255*(I*T[1]+W),255*(I*T[2]+W)]},C.hcg.hsv=function(f){const w=f[1]/100,I=w+f[2]/100*(1-w);let S=0;return I>0&&(S=w/I),[f[0],100*S,100*I]},C.hcg.hsl=function(f){const w=f[1]/100,I=f[2]/100*(1-w)+.5*w;let S=0;return I>0&&I<.5?S=w/(2*I):I>=.5&&I<1&&(S=w/(2*(1-I))),[f[0],100*S,100*I]},C.hcg.hwb=function(f){const w=f[1]/100,I=w+f[2]/100*(1-w);return[f[0],100*(I-w),100*(1-I)]},C.hwb.hcg=function(f){const w=f[1]/100,I=1-f[2]/100,S=I-w;let T=0;return S<1&&(T=(I-S)/(1-S)),[f[0],100*S,100*T]},C.apple.rgb=function(f){return[f[0]/65535*255,f[1]/65535*255,f[2]/65535*255]},C.rgb.apple=function(f){return[f[0]/255*65535,f[1]/255*65535,f[2]/255*65535]},C.gray.rgb=function(f){return[f[0]/100*255,f[0]/100*255,f[0]/100*255]},C.gray.hsl=function(f){return[0,0,f[0]]},C.gray.hsv=C.gray.hsl,C.gray.hwb=function(f){return[0,100,f[0]]},C.gray.cmyk=function(f){return[0,0,0,f[0]]},C.gray.lab=function(f){return[f[0],0,0]},C.gray.hex=function(f){const w=255&Math.round(f[0]/100*255),I=((w<<16)+(w<<8)+w).toString(16).toUpperCase();return"000000".substring(I.length)+I},C.rgb.gray=function(f){return[(f[0]+f[1]+f[2])/3/255*100]}},9047:(v,x,m)=>{const y=m(9246),D=m(802),C={};Object.keys(y).forEach(f=>{C[f]={},Object.defineProperty(C[f],"channels",{value:y[f].channels}),Object.defineProperty(C[f],"labels",{value:y[f].labels});const w=D(f);Object.keys(w).forEach(I=>{const S=w[I];C[f][I]=function(T){const O=function(...j){const H=j[0];if(H==null)return H;H.length>1&&(j=H);const W=T(j);if(typeof W=="object")for(let X=W.length,At=0;At1&&(j=H),T(j))};return"conversion"in T&&(O.conversion=T.conversion),O}(S)})}),v.exports=C},802:(v,x,m)=>{const y=m(9246);function D(w){const I=function(){const T={},O=Object.keys(y);for(let j=O.length,H=0;H{v.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},4199:(v,x,m)=>{m.d(x,{A:()=>w});var y=m(9372),D=m.n(y),C=m(935),f=m.n(C)()(D());f.push([v.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./../ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:[`/* * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ @@ -7521,14 +7521,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)}return[C].join(` `)}},2591:(v,x,m)=>{var y,D=function(){return y===void 0&&(y=!!(window&&document&&document.all&&!window.atob)),y},C=function(){var Z={};return function(rt){if(Z[rt]===void 0){var _=document.querySelector(rt);if(window.HTMLIFrameElement&&_ instanceof window.HTMLIFrameElement)try{_=_.contentDocument.head}catch{_=null}Z[rt]=_}return Z[rt]}}(),f=[];function w(Z){for(var rt=-1,_=0;_{var x=v&&v.__esModule?()=>v.default:()=>v;return N.d(x,{a:x}),x},N.d=(v,x)=>{for(var m in x)N.o(x,m)&&!N.o(v,m)&&Object.defineProperty(v,m,{enumerable:!0,get:x[m]})},N.o=(v,x)=>Object.prototype.hasOwnProperty.call(v,x),N.nc=void 0;var K={};return(()=>{function v({emitter:o,activator:t,callback:e,contextElements:n}){o.listenTo(document,"mousedown",(i,r)=>{if(!t())return;const s=typeof r.composedPath=="function"?r.composedPath():[],a=typeof n=="function"?n():n;for(const c of a)if(c.contains(r.target)||s.includes(c))return;e()})}function x(o){return class extends o{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...t){super(...t),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function m({view:o}){o.listenTo(o.element,"submit",(t,e)=>{e.preventDefault(),o.fire("submit")},{useCapture:!0})}function y({keystrokeHandler:o,focusTracker:t,gridItems:e,numberOfColumns:n,uiLanguageDirection:i}){const r=typeof n=="number"?()=>n:n;function s(l){return d=>{const h=e.find(p=>p.element===t.focusedElement),u=e.getIndex(h),g=l(u,e);e.get(g).focus(),d.stopPropagation(),d.preventDefault()}}function a(l,d){return l===d-1?0:l+1}function c(l,d){return l===0?d-1:l-1}o.set("arrowright",s((l,d)=>i==="rtl"?c(l,d.length):a(l,d.length))),o.set("arrowleft",s((l,d)=>i==="rtl"?a(l,d.length):c(l,d.length))),o.set("arrowup",s((l,d)=>{let h=l-r();return h<0&&(h=l+r()*Math.floor(d.length/r()),h>d.length-1&&(h-=r())),h})),o.set("arrowdown",s((l,d)=>{let h=l+r();return h>d.length-1&&(h=l%r()),h}))}N.d(K,{default:()=>Za});const D=function(){try{return navigator.userAgent.toLowerCase()}catch{return""}}();var C;const f={isMac:w(D),isWindows:(C=D,C.indexOf("windows")>-1),isGecko:function(o){return!!o.match(/gecko\/\d+/)}(D),isSafari:function(o){return o.indexOf(" applewebkit/")>-1&&o.indexOf("chrome")===-1}(D),isiOS:function(o){return!!o.match(/iphone|ipad/i)||w(o)&&navigator.maxTouchPoints>0}(D),isAndroid:function(o){return o.indexOf("android")>-1}(D),isBlink:function(o){return o.indexOf("chrome/")>-1&&o.indexOf("edge/")<0}(D),features:{isRegExpUnicodePropertySupported:function(){let o=!1;try{o="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return o}()}};function w(o){return o.indexOf("macintosh")>-1}function I(o,t,e,n){e=e||function(c,l){return c===l};const i=Array.isArray(o)?o:Array.prototype.slice.call(o),r=Array.isArray(t)?t:Array.prototype.slice.call(t),s=function(c,l,d){const h=S(c,l,d);if(h===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const u=T(c,h),g=T(l,h),p=S(u,g,d),k=c.length-p,b=l.length-p;return{firstIndex:h,lastIndexOld:k,lastIndexNew:b}}(i,r,e);return n?function(c,l){const{firstIndex:d,lastIndexOld:h,lastIndexNew:u}=c;if(d===-1)return Array(l).fill("equal");let g=[];return d>0&&(g=g.concat(Array(d).fill("equal"))),u-d>0&&(g=g.concat(Array(u-d).fill("insert"))),h-d>0&&(g=g.concat(Array(h-d).fill("delete"))),u0&&d.push({index:h,type:"insert",values:c.slice(h,g)}),u-h>0&&d.push({index:h+(g-h),type:"delete",howMany:u-h}),d}(r,s)}function S(o,t,e){for(let n=0;n200||i>200||n+i>300)return O.fastDiff(o,t,e,!0);let r,s;if(iA?-1:1;d[k+E]&&(d[k]=d[k+E].slice(0)),d[k]||(d[k]=[]),d[k].push(b>A?r:s);let M=Math.max(b,A),z=M-k;for(;zl;g--)h[g]=u(g);h[l]=u(l),p++}while(h[l]!==c);return d[l].slice(1)}O.fastDiff=I;const j=function(){return function o(){o.called=!0}};class H{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=j(),this.off=j()}}const W=new Array(256).fill("").map((o,t)=>("0"+t.toString(16)).slice(-2));function X(){const o=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+W[o>>0&255]+W[o>>8&255]+W[o>>16&255]+W[o>>24&255]+W[t>>0&255]+W[t>>8&255]+W[t>>16&255]+W[t>>24&255]+W[e>>0&255]+W[e>>8&255]+W[e>>16&255]+W[e>>24&255]+W[n>>0&255]+W[n>>8&255]+W[n>>16&255]+W[n>>24&255]}const At={get(o="normal"){return typeof o!="number"?this[o]||this.normal:o},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function Z(o,t){const e=At.get(t.priority);for(let n=0;n{if(typeof h=="object"&&h!==null){if(s.has(h))return`[object ${h.constructor.name}]`;s.add(h)}return h},c=r?` ${JSON.stringify(r,a)}`:"",l=Nt(i);return i+c+l}(t,n)),this.name="CKEditorError",this.context=e,this.data=n}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const n=new _(t.message,e);throw n.stack=t.stack,n}}function Q(o,t){console.warn(...Tt(o,t))}function Dt(o,t){console.error(...Tt(o,t))}function Nt(o){return` -Read more: ${rt}#error-${o}`}function Tt(o,t){const e=Nt(o);return t?[o,t,e]:[o,e]}const Ue="41.2.0",Ie=new Date(2024,2,6);if(globalThis.CKEDITOR_VERSION)throw new _("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=Ue;const fe=Symbol("listeningTo"),Je=Symbol("emitterId"),Se=Symbol("delegations"),bi=kt(Object);function kt(o){return o?class extends o{on(t,e,n){this.listenTo(this,t,e,n)}once(t,e,n){let i=!1;this.listenTo(this,t,(r,...s)=>{i||(i=!0,r.off(),e.call(this,r,...s))},n)}off(t,e){this.stopListening(this,t,e)}listenTo(t,e,n,i={}){let r,s;this[fe]||(this[fe]={});const a=this[fe];xo(t)||yo(t);const c=xo(t);(r=a[c])||(r=a[c]={emitter:t,callbacks:{}}),(s=r.callbacks[e])||(s=r.callbacks[e]=[]),s.push(n),function(l,d,h,u,g){d._addEventListener?d._addEventListener(h,u,g):l._addEventListener.call(d,h,u,g)}(this,t,e,n,i)}stopListening(t,e,n){const i=this[fe];let r=t&&xo(t);const s=i&&r?i[r]:void 0,a=s&&e?s.callbacks[e]:void 0;if(!(!i||t&&!s||e&&!a))if(n)Te(this,t,e,n),a.indexOf(n)!==-1&&(a.length===1?delete s.callbacks[e]:Te(this,t,e,n));else if(a){for(;n=a.pop();)Te(this,t,e,n);delete s.callbacks[e]}else if(s){for(e in s.callbacks)this.stopListening(t,e);delete i[r]}else{for(r in i)this.stopListening(i[r].emitter);delete this[fe]}}fire(t,...e){try{const n=t instanceof H?t:new H(this,t),i=n.name;let r=Lt(this,i);if(n.path.push(this),r){const a=[n,...e];r=Array.from(r);for(let c=0;c{this[Se]||(this[Se]=new Map),t.forEach(i=>{const r=this[Se].get(i);r?r.set(e,n):this[Se].set(i,new Map([[e,n]]))})}}}stopDelegating(t,e){if(this[Se])if(t)if(e){const n=this[Se].get(t);n&&n.delete(e)}else this[Se].delete(t);else this[Se].clear()}_addEventListener(t,e,n){(function(s,a){const c=U(s);if(c[a])return;let l=a,d=null;const h=[];for(;l!==""&&!c[l];)c[l]={callbacks:[],childEvents:[]},h.push(c[l]),d&&c[l].childEvents.push(d),d=l,l=l.substr(0,l.lastIndexOf(":"));if(l!==""){for(const u of h)u.callbacks=c[l].callbacks.slice();c[l].childEvents.push(d)}})(this,t);const i=ht(this,t),r={callback:e,priority:At.get(n.priority)};for(const s of i)Z(s,r)}_removeEventListener(t,e){const n=ht(this,t);for(const i of n)for(let r=0;r-1?Lt(o,t.substr(0,t.lastIndexOf(":"))):null}function ne(o,t,e){for(let[n,i]of o){i?typeof i=="function"&&(i=i(t.name)):i=t.name;const r=new H(t.source,i);r.path=[...t.path],n.fire(r,...e)}}function Te(o,t,e,n){t._removeEventListener?t._removeEventListener(e,n):o._removeEventListener.call(t,e,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{kt[o]=bi.prototype[o]});const bt=function(o){var t=typeof o;return o!=null&&(t=="object"||t=="function")},qe=Symbol("observableProperties"),Yt=Symbol("boundObservables"),ke=Symbol("boundProperties"),be=Symbol("decoratedMethods"),Eo=Symbol("decoratedOriginal"),vn=ft(kt());function ft(o){return o?class extends o{set(t,e){if(bt(t))return void Object.keys(t).forEach(i=>{this.set(i,t[i])},this);yn(this);const n=this[qe];if(t in this&&!n.has(t))throw new _("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(i){const r=n.get(t);let s=this.fire(`set:${t}`,t,i,r);s===void 0&&(s=i),r===s&&n.has(t)||(n.set(t,s),this.fire(`change:${t}`,t,s,r))}}),this[t]=e}bind(...t){if(!t.length||!xn(t))throw new _("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new _("observable-bind-duplicate-properties",this);yn(this);const e=this[ke];t.forEach(i=>{if(e.has(i))throw new _("observable-bind-rebind",this)});const n=new Map;return t.forEach(i=>{const r={property:i,to:[]};e.set(i,r),n.set(i,r)}),{to:jr,toMany:wi,_observable:this,_bindProperties:t,_to:[],_bindings:n}}unbind(...t){if(!this[qe])return;const e=this[ke],n=this[Yt];if(t.length){if(!xn(t))throw new _("observable-unbind-wrong-properties",this);t.forEach(i=>{const r=e.get(i);r&&(r.to.forEach(([s,a])=>{const c=n.get(s),l=c[a];l.delete(r),l.size||delete c[a],Object.keys(c).length||(n.delete(s),this.stopListening(s,"change"))}),e.delete(i))})}else n.forEach((i,r)=>{this.stopListening(r,"change")}),n.clear(),e.clear()}decorate(t){yn(this);const e=this[t];if(!e)throw new _("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(n,i)=>{n.return=e.apply(this,i)}),this[t]=function(...n){return this.fire(t,n)},this[t][Eo]=e,this[be]||(this[be]=[]),this[be].push(t)}stopListening(t,e,n){if(!t&&this[be]){for(const i of this[be])this[i]=this[i][Eo];delete this[be]}super.stopListening(t,e,n)}}:vn}function yn(o){o[qe]||(Object.defineProperty(o,qe,{value:new Map}),Object.defineProperty(o,Yt,{value:new Map}),Object.defineProperty(o,ke,{value:new Map}))}function jr(...o){const t=function(...r){if(!r.length)throw new _("observable-bind-to-parse-error",null);const s={to:[]};let a;return typeof r[r.length-1]=="function"&&(s.callback=r.pop()),r.forEach(c=>{if(typeof c=="string")a.properties.push(c);else{if(typeof c!="object")throw new _("observable-bind-to-parse-error",null);a={observable:c,properties:[]},s.to.push(a)}}),s}(...o),e=Array.from(this._bindings.keys()),n=e.length;if(!t.callback&&t.to.length>1)throw new _("observable-bind-to-no-callback",this);if(n>1&&t.callback)throw new _("observable-bind-to-extra-callback",this);var i;t.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new _("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(e[0]).callback=t.callback),i=this._observable,this._to.forEach(r=>{const s=i[Yt];let a;s.get(r.observable)||i.listenTo(r.observable,"change",(c,l)=>{a=s.get(r.observable)[l],a&&a.forEach(d=>{Do(i,d.property)})})}),function(r){let s;r._bindings.forEach((a,c)=>{r._to.forEach(l=>{s=l.properties[a.callback?0:r._bindProperties.indexOf(c)],a.to.push([l.observable,s]),function(d,h,u,g){const p=d[Yt],k=p.get(u),b=k||{};b[g]||(b[g]=new Set),b[g].add(h),k||p.set(u,b)}(r._observable,a,l.observable,s)})})}(this),this._bindProperties.forEach(r=>{Do(this._observable,r)})}function wi(o,t,e){if(this._bindings.size>1)throw new _("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const r=n.map(s=>[s,i]);return Array.prototype.concat.apply([],r)}(o,t),e)}function xn(o){return o.every(t=>typeof t=="string")}function Do(o,t){const e=o[ke].get(t);let n;e.callback?n=e.callback.apply(o,e.to.map(i=>i[0][i[1]])):(n=e.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(o,t)?o[t]=n:o.set(t,n)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{ft[o]=vn.prototype[o]});class Io{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}function jt(o){let t=0;for(const e of o)t++;return t}function Mt(o,t){const e=Math.min(o.length,t.length);for(let n=0;n-1},$k=function(o,t){var e=this.__data__,n=Ai(e,o);return n<0?(++this.size,e.push([o,t])):e[n][1]=t,this};function Yn(o){var t=-1,e=o==null?0:o.length;for(this.clear();++t-1&&o%1==0&&o-1&&o%1==0&&o<=9007199254740991};var Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;const Tb=function(o){return we(o)&&Ur(o.length)&&!!Bt[hn(o)]},qr=function(o){return function(t){return o(t)}};var uc=F&&!F.nodeType&&F,Po=uc&&!0&&P&&!P.nodeType&&P,Gr=Po&&Po.exports===uc&&Xa.process;const eo=function(){try{var o=Po&&Po.require&&Po.require("util").types;return o||Gr&&Gr.binding&&Gr.binding("util")}catch{}}();var gc=eo&&eo.isTypedArray;const Wr=gc?qr(gc):Tb;var Mb=Object.prototype.hasOwnProperty;const pc=function(o,t){var e=le(o),n=!e&&Ei(o),i=!e&&!n&&No(o),r=!e&&!n&&!i&&Wr(o),s=e||n||i||r,a=s?xb(o.length,String):[],c=a.length;for(var l in o)!t&&!Mb.call(o,l)||s&&(l=="length"||i&&(l=="offset"||l=="parent")||r&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Di(l,c))||a.push(l);return a};var Bb=Object.prototype;const Kr=function(o){var t=o&&o.constructor;return o===(typeof t=="function"&&t.prototype||Bb)},Nb=oc(Object.keys,Object);var Pb=Object.prototype.hasOwnProperty;const Ob=function(o){if(!Kr(o))return Nb(o);var t=[];for(var e in Object(o))Pb.call(o,e)&&e!="constructor"&&t.push(e);return t},Ii=function(o){return o!=null&&Ur(o.length)&&!En(o)},Oo=function(o){return Ii(o)?pc(o):Ob(o)},Lb=function(o,t){return o&&to(t,Oo(t),o)},zb=function(o){var t=[];if(o!=null)for(var e in Object(o))t.push(e);return t};var Rb=Object.prototype.hasOwnProperty;const jb=function(o){if(!bt(o))return zb(o);var t=Kr(o),e=[];for(var n in o)(n!="constructor"||!t&&Rb.call(o,n))&&e.push(n);return e},no=function(o){return Ii(o)?pc(o,!0):jb(o)},Fb=function(o,t){return o&&to(t,no(t),o)};var mc=F&&!F.nodeType&&F,fc=mc&&!0&&P&&!P.nodeType&&P,kc=fc&&fc.exports===mc?Me.Buffer:void 0,bc=kc?kc.allocUnsafe:void 0;const wc=function(o,t){if(t)return o.slice();var e=o.length,n=bc?bc(e):new o.constructor(e);return o.copy(n),n},Ac=function(o,t){var e=-1,n=o.length;for(t||(t=Array(n));++e{this._setToTarget(t,i,e[i],n)})}}function Hc(o){return os(o,lw)}function lw(o){return Tn(o)||typeof o=="function"?o:void 0}function un(o){if(o){if(o.defaultView)return o instanceof o.defaultView.Document;if(o.ownerDocument&&o.ownerDocument.defaultView)return o instanceof o.ownerDocument.defaultView.Node}return!1}function Ti(o){const t=Object.prototype.toString.apply(o);return t=="[object Window]"||t=="[object global]"}const Uc=Ce(kt());function Ce(o){return o?class extends o{listenTo(t,e,n,i={}){if(un(t)||Ti(t)){const r={capture:!!i.useCapture,passive:!!i.usePassive},s=this._getProxyEmitter(t,r)||new dw(t,r);this.listenTo(s,e,n,i)}else super.listenTo(t,e,n,i)}stopListening(t,e,n){if(un(t)||Ti(t)){const i=this._getAllProxyEmitters(t);for(const r of i)this.stopListening(r,e,n)}else super.stopListening(t,e,n)}_getProxyEmitter(t,e){return function(n,i){const r=n[fe];return r&&r[i]?r[i].emitter:null}(this,qc(t,e))}_getAllProxyEmitters(t){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(e=>this._getProxyEmitter(t,e)).filter(e=>!!e)}}:Uc}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{Ce[o]=Uc.prototype[o]});class dw extends kt(){constructor(t,e){super(),yo(this,qc(t,e)),this._domNode=t,this._options=e}attach(t){if(this._domListeners&&this._domListeners[t])return;const e=this._createDomListener(t);this._domNode.addEventListener(t,e,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=e}detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()}_addEventListener(t,e,n){this.attach(t),kt().prototype._addEventListener.call(this,t,e,n)}_removeEventListener(t,e){kt().prototype._removeEventListener.call(this,t,e),this.detach(t)}_createDomListener(t){const e=n=>{this.fire(t,n)};return e.removeListener=()=>{this._domNode.removeEventListener(t,e,this._options),delete this._domListeners[t]},e}}function qc(o,t){let e=function(n){return n["data-ck-expando"]||(n["data-ck-expando"]=X())}(o);for(const n of Object.keys(t).sort())t[n]&&(e+="-"+n);return e}let is;try{is={window,document}}catch{is={window:{},document:{}}}const $=is;function Gc(o){const t=o.ownerDocument.defaultView.getComputedStyle(o);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function Ft(o){return Object.prototype.toString.call(o)=="[object Text]"}function Mi(o){return Object.prototype.toString.apply(o)=="[object Range]"}function Wc(o){return o&&o.parentNode?o.offsetParent===$.document.body?null:o.offsetParent:null}const Kc=["top","right","bottom","left","width","height"];class dt{constructor(t){const e=Mi(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),rs(t)||e)if(e){const n=dt.getDomRangeRects(t);Bi(this,dt.getBoundingRect(n))}else Bi(this,t.getBoundingClientRect());else if(Ti(t)){const{innerWidth:n,innerHeight:i}=t;Bi(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else Bi(this,t)}clone(){return new dt(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0)return null;{const n=new dt(e);return n._source=this._source,n}}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if($c(t))return e;let n,i=t,r=t.parentNode||t.commonAncestorContainer;for(;r&&!$c(r);){const a=((s=r)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible")==="visible";i instanceof HTMLElement&&Yc(i)==="absolute"&&(n=i);const c=Yc(r);if(a||n&&(c==="relative"&&a||c!=="relative")){i=r,r=r.parentNode;continue}const l=new dt(r),d=e.getIntersection(l);if(!d)return null;d.getArea(){for(const t of o){const e=zt._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}};let zo=zt;function Qc(o,t){o instanceof HTMLTextAreaElement&&(o.value=t),o.innerHTML=t}function oo(o){return t=>t+o}function Ni(o){let t=0;for(;o.previousSibling;)o=o.previousSibling,t++;return t}function Zc(o,t,e){o.insertBefore(e,o.childNodes[t]||null)}function Ro(o){return o&&o.nodeType===Node.COMMENT_NODE}function Mn(o){return!!(o&&o.getClientRects&&o.getClientRects().length)}zo._observerInstance=null,zo._elementCallbacks=null;var Jc=Math.pow;function ss({element:o,target:t,positions:e,limiter:n,fitInViewport:i,viewportOffsetConfig:r}){En(t)&&(t=t()),En(n)&&(n=n());const s=Wc(o),a=function(u){u=Object.assign({top:0,bottom:0,left:0,right:0},u);const g=new dt($.window);return g.top+=u.top,g.height-=u.top,g.bottom-=u.bottom,g.height-=u.bottom,g}(r),c=new dt(o),l=Xc(t,a);let d;if(!l||!a.getIntersection(l))return null;const h={targetRect:l,elementRect:c,positionedElementAncestor:s,viewportRect:a};if(n||i){if(n){const u=Xc(n,a);u&&(h.limiterRect=u)}d=function(u,g){const{elementRect:p}=g,k=p.getArea(),b=u.map(M=>new tl(M,g)).filter(M=>!!M.name);let A=0,E=null;for(const M of b){const{limiterIntersectionArea:z,viewportIntersectionArea:G}=M;if(z===k)return M;const tt=Jc(G,2)+Jc(z,2);tt>A&&(A=tt,E=M)}return E}(e,h)}else d=new tl(e[0],h);return d}function Xc(o,t){const e=new dt(o).getVisible();return e?e.getIntersection(t):null}class tl{constructor(t,e){const n=t(e.targetRect,e.elementRect,e.viewportRect,e.limiterRect);if(!n)return;const{left:i,top:r,name:s,config:a}=n;this.name=s,this.config=a,this._positioningFunctionCoordinates={left:i,top:r},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;return t?t.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function el(o){const t=o.parentNode;t&&t.removeChild(o)}function hw({window:o,rect:t,alignToTop:e,forceScroll:n,viewportOffset:i}){const r=t.clone().moveBy(0,i.bottom),s=t.clone().moveBy(0,-i.top),a=new dt(o).excludeScrollbarsAndBorders(),c=e&&n,l=[s,r].every(p=>a.contains(p));let{scrollX:d,scrollY:h}=o;const u=d,g=h;c?h-=a.top-t.top+i.top:l||(ol(s,a)?h-=a.top-t.top+i.top:nl(r,a)&&(h+=e?t.top-a.top-i.top:t.bottom-a.bottom+i.bottom)),l||(il(t,a)?d-=a.left-t.left+i.left:rl(t,a)&&(d+=t.right-a.right+i.right)),d==u&&h===g||o.scrollTo(d,h)}function uw({parent:o,getRect:t,alignToTop:e,forceScroll:n,ancestorOffset:i=0,limiterElement:r}){const s=as(o),a=e&&n;let c,l,d;const h=r||s.document.body;for(;o!=h;)l=t(),c=new dt(o).excludeScrollbarsAndBorders(),d=c.contains(l),a?o.scrollTop-=c.top-l.top+i:d||(ol(l,c)?o.scrollTop-=c.top-l.top+i:nl(l,c)&&(o.scrollTop+=e?l.top-c.top-i:l.bottom-c.bottom+i)),d||(il(l,c)?o.scrollLeft-=c.left-l.left+i:rl(l,c)&&(o.scrollLeft+=l.right-c.right+i)),o=o.parentNode}function nl(o,t){return o.bottom>t.bottom}function ol(o,t){return o.topt.right}function as(o){return Mi(o)?o.startContainer.ownerDocument.defaultView:o.ownerDocument.defaultView}function gw(o){if(Mi(o)){let t=o.commonAncestorContainer;return Ft(t)&&(t=t.parentNode),t}return o.parentNode}function sl(o,t){const e=as(o),n=new dt(o);if(e===t)return n;{let i=e;for(;i!=t;){const r=i.frameElement,s=new dt(r).excludeScrollbarsAndBorders();n.moveBy(s.left,s.top),i=i.parent}}return n}const pw={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},mw={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},al={37:"←",38:"↑",39:"→",40:"↓",9:"⇥"},ut=function(){const o={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++)o[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)o[t-48]=t;for(let t=112;t<=123;t++)o["f"+(t-111)]=t;return Object.assign(o,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),o}(),fw=Object.fromEntries(Object.entries(ut).map(([o,t])=>{let e;return e=t in al?al[t]:o.charAt(0).toUpperCase()+o.slice(1),[t,e]}));function io(o){let t;if(typeof o=="string"){if(t=ut[o.toLowerCase()],!t)throw new _("keyboard-unknown-key",null,{key:o})}else t=o.keyCode+(o.altKey?ut.alt:0)+(o.ctrlKey?ut.ctrl:0)+(o.shiftKey?ut.shift:0)+(o.metaKey?ut.cmd:0);return t}function jo(o){return typeof o=="string"&&(o=function(t){return t.split("+").map(e=>e.trim())}(o)),o.map(t=>typeof t=="string"?function(e){if(e.endsWith("!"))return io(e.slice(0,-1));const n=io(e);return(f.isMac||f.isiOS)&&n==ut.ctrl?ut.cmd:n}(t):t).reduce((t,e)=>e+t,0)}function Pi(o){let t=jo(o);return Object.entries(f.isMac||f.isiOS?pw:mw).reduce((e,[n,i])=>(t&ut[n]&&(t&=~ut[n],e+=i),e),"")+(t?fw[t]:"")}function cs(o,t){const e=t==="ltr";switch(o){case ut.arrowleft:return e?"left":"right";case ut.arrowright:return e?"right":"left";case ut.arrowup:return"up";case ut.arrowdown:return"down"}}function Et(o){return Array.isArray(o)?o:[o]}const ls=function(o,t,e){(e!==void 0&&!To(o[t],e)||e===void 0&&!(t in o))&&xi(o,t,e)},cl=function(o){return function(t,e,n){for(var i=-1,r=Object(t),s=n(t),a=s.length;a--;){var c=s[o?a:++i];if(e(r[c],c,r)===!1)break}return t}}(),kw=function(o){return we(o)&&Ii(o)},ds=function(o,t){if((t!=="constructor"||typeof o[t]!="function")&&t!="__proto__")return o[t]},bw=function(o){return to(o,no(o))},ww=function(o,t,e,n,i,r,s){var a=ds(o,e),c=ds(t,e),l=s.get(c);if(l)ls(o,e,l);else{var d=r?r(a,c,e+"",o,t,s):void 0,h=d===void 0;if(h){var u=le(c),g=!u&&No(c),p=!u&&!g&&Wr(c);d=c,u||g||p?le(a)?d=a:kw(a)?d=Ac(a):g?(h=!1,d=wc(c,!0)):p?(h=!1,d=Nc(c,!0)):d=[]:de(c)||Ei(c)?(d=a,Ei(a)?d=bw(a):bt(a)&&!En(a)||(d=Oc(c))):h=!1}h&&(s.set(c,d),i(d,c,n,r,s),s.delete(c)),ls(o,e,d)}},Aw=function o(t,e,n,i,r){t!==e&&cl(e,function(s,a){if(r||(r=new Xn),bt(s))ww(t,e,a,n,o,i,r);else{var c=i?i(ds(t,a),s,a+"",t,e,r):void 0;c===void 0&&(c=s),ls(t,a,c)}},no)},gn=function(o){return o},Cw=function(o,t,e){switch(e.length){case 0:return o.call(t);case 1:return o.call(t,e[0]);case 2:return o.call(t,e[0],e[1]);case 3:return o.call(t,e[0],e[1],e[2])}return o.apply(t,e)};var ll=Math.max;const _w=function(o,t,e){return t=ll(t===void 0?o.length-1:t,0),function(){for(var n=arguments,i=-1,r=ll(n.length-t,0),s=Array(r);++i0){if(++t>=800)return arguments[0]}else t=0;return o.apply(void 0,arguments)}}(yw),Dw=function(o,t){return Ew(_w(o,t,gn),o+"")},Iw=function(o,t,e){if(!bt(e))return!1;var n=typeof t;return!!(n=="number"?Ii(e)&&Di(t,e.length):n=="string"&&t in e)&&To(e[t],o)},dl=function(o){return Dw(function(t,e){var n=-1,i=e.length,r=i>1?e[i-1]:void 0,s=i>2?e[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,s&&Iw(e[0],e[1],s)&&(r=i<3?void 0:r,i=1),t=Object(t);++nd===1?0:1),l=a[s];return typeof l=="string"?l:l[Number(c(e))]}$.window.CKEDITOR_TRANSLATIONS||($.window.CKEDITOR_TRANSLATIONS={});const Tw=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function hl(o){return Tw.includes(o)?"rtl":"ltr"}class Mw{constructor({uiLanguage:t="en",contentLanguage:e,translations:n}={}){this.uiLanguage=t,this.contentLanguage=e||this.uiLanguage,this.uiLanguageDirection=hl(this.uiLanguage),this.contentLanguageDirection=hl(this.contentLanguage),this.translations=function(i){return Array.isArray(i)?i.reduce((r,s)=>hs(r,s)):i}(n),this.t=(i,r)=>this._t(i,r)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=Et(e),typeof t=="string"&&(t={string:t});const n=t.plural?e[0]:1;return function(i,r){return i.replace(/%(\d+)/g,(s,a)=>athis._items.length||e<0)throw new _("collection-add-item-invalid-index",this);let n=0;for(const i of t){const r=this._getItemIdBeforeAdding(i),s=e+n;this._items.splice(s,0,i),this._itemMap.set(r,i),this.fire("add",i,s),n++}return this.fire("change",{added:t,removed:[],index:e}),this}get(t){let e;if(typeof t=="string")e=this._itemMap.get(t);else{if(typeof t!="number")throw new _("collection-get-invalid-arg",this);e=this._items[t]}return e||null}has(t){if(typeof t=="string")return this._itemMap.has(t);{const e=t[this._idProperty];return e&&this._itemMap.has(e)}}getIndex(t){let e;return e=typeof t=="string"?this._itemMap.get(t):t,e?this._items.indexOf(e):-1}remove(t){const[e,n]=this._remove(t);return this.fire("change",{added:[],removed:[e],index:n}),e}map(t,e){return this._items.map(t,e)}forEach(t,e){this._items.forEach(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new _("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:e=>{this._setUpBindToBinding(n=>new e(n))},using:e=>{typeof e=="function"?this._setUpBindToBinding(e):this._setUpBindToBinding(n=>n[e])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(i,r,s)=>{const a=e._bindToCollection==this,c=e._bindToInternalToExternalMap.get(r);if(a&&c)this._bindToExternalToInternalMap.set(r,c),this._bindToInternalToExternalMap.set(c,r);else{const l=t(r);if(!l)return void this._skippedIndexesFromExternal.push(s);let d=s;for(const h of this._skippedIndexesFromExternal)s>h&&d--;for(const h of e._skippedIndexesFromExternal)d>=h&&d++;this._bindToExternalToInternalMap.set(r,l),this._bindToInternalToExternalMap.set(l,r),this.add(l,d);for(let h=0;h{const a=this._bindToExternalToInternalMap.get(r);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((c,l)=>(sl&&c.push(l),c),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let n;if(e in t){if(n=t[e],typeof n!="string")throw new _("collection-add-invalid-id",this);if(this.get(n))throw new _("collection-add-item-already-exists",this)}else t[e]=n=X();return n}_remove(t){let e,n,i,r=!1;const s=this._idProperty;if(typeof t=="string"?(n=t,i=this._itemMap.get(n),r=!i,i&&(e=this._items.indexOf(i))):typeof t=="number"?(e=t,i=this._items[e],r=!i,i&&(n=i[s])):(i=t,n=i[s],e=this._items.indexOf(i),r=e==-1||!this._itemMap.get(n)),r)throw new _("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(n);const a=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(a),this.fire("remove",i,e),[i,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Wt(o){const t=o.next();return t.done?null:t.value}class Qt extends Ce(ft()){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(t){if(this._elements.has(t))throw new _("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}class oe{constructor(){this._listener=new(Ce())}listenTo(t){this._listener.listenTo(t,"keydown",(e,n)=>{this._listener.fire("_keydown:"+io(n),n)})}set(t,e,n={}){const i=jo(t),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(s,a)=>{e(a,()=>{a.preventDefault(),a.stopPropagation(),s.stop()}),s.return=!0},{priority:r})}press(t){return!!this._listener.fire("_keydown:"+io(t),t)}stopListening(t){this._listener.stopListening(t)}destroy(){this.stopListening()}}function We(o){return Gt(o)?new Map(o):function(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}(o)}function us(o,t){let e;function n(...i){n.cancel(),e=setTimeout(()=>o(...i),t)}return n.cancel=()=>{clearTimeout(e)},n}function gs(o,t){return!!(e=o.charAt(t-1))&&e.length==1&&/[\ud800-\udbff]/.test(e)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(o.charAt(t));var e}function ps(o,t){return!!(e=o.charAt(t))&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e);var e}const Bw=function(){const o=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],t=new RegExp("\\p{Regional_Indicator}{2}","u").source,e="(?:"+o.map(n=>n.source).join("|")+")";return new RegExp(`${t}|${e}(?:‍${e})*`,"ug")}();function ul(o,t){const e=String(o).matchAll(Bw);return Array.from(e).some(n=>n.index{this.refresh()}),this.listenTo(t,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",e=>{if(!this.affectsData)return;const n=t.model.document.selection,i=n.getFirstPosition().root.rootName!="$graveyard"&&t.model.canEditAt(n);(t.isReadOnly||this._isEnabledBasedOnSelection&&!i)&&(e.return=!1,e.stop())},{priority:"highest"}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(t){this._affectsData=t}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),this._disableStack.size==1&&(this.on("set:isEnabled",pl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),this._disableStack.size==0&&(this.off("set:isEnabled",pl),this.refresh())}execute(...t){}destroy(){this.stopListening()}}function pl(o){o.return=!1,o.stop()}class ml extends st{constructor(){super(...arguments),this._childCommandsDefinitions=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return!!e&&e.execute(t)}registerChildCommand(t,e={}){Z(this._childCommandsDefinitions,{command:t,priority:e.priority||"normal"}),t.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const t=this._childCommandsDefinitions.find(({command:e})=>e.isEnabled);return t&&t.command}}class fl extends kt(){constructor(t,e=[],n=[]){super(),this._plugins=new Map,this._context=t,this._availablePlugins=new Map;for(const i of e)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,r]of n)this._contextPlugins.set(i,r),this._contextPlugins.set(r,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const t of this._plugins)typeof t[0]=="function"&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let n=t;throw typeof t=="function"&&(n=t.pluginName||t.name),new _("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return e}has(t){return this._plugins.has(t)}init(t,e=[],n=[]){const i=this,r=this._context;(function p(k,b=new Set){k.forEach(A=>{c(A)&&(b.has(A)||(b.add(A),A.pluginName&&!i._availablePlugins.has(A.pluginName)&&i._availablePlugins.set(A.pluginName,A),A.requires&&p(A.requires,b)))})})(t),u(t);const s=[...function p(k,b=new Set){return k.map(A=>c(A)?A:i._availablePlugins.get(A)).reduce((A,E)=>b.has(E)?A:(b.add(E),E.requires&&(u(E.requires,E),p(E.requires,b).forEach(M=>A.add(M))),A.add(E)),new Set)}(t.filter(p=>!d(p,e)))];(function(p,k){for(const b of k){if(typeof b!="function")throw new _("plugincollection-replace-plugin-invalid-type",null,{pluginItem:b});const A=b.pluginName;if(!A)throw new _("plugincollection-replace-plugin-missing-name",null,{pluginItem:b});if(b.requires&&b.requires.length)throw new _("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:A});const E=i._availablePlugins.get(A);if(!E)throw new _("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:A});const M=p.indexOf(E);if(M===-1){if(i._contextPlugins.has(E))return;throw new _("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:A})}if(E.requires&&E.requires.length)throw new _("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:A});p.splice(M,1,b),i._availablePlugins.set(A,b)}})(s,n);const a=s.map(p=>{let k=i._contextPlugins.get(p);return k=k||new p(r),i._add(p,k),k});return g(a,"init").then(()=>g(a,"afterInit")).then(()=>a);function c(p){return typeof p=="function"}function l(p){return c(p)&&!!p.isContextPlugin}function d(p,k){return k.some(b=>b===p||h(p)===b||h(b)===p)}function h(p){return c(p)?p.pluginName||p.name:p}function u(p,k=null){p.map(b=>c(b)?b:i._availablePlugins.get(b)||b).forEach(b=>{(function(A,E){if(!c(A))throw E?new _("plugincollection-soft-required",r,{missingPlugin:A,requiredBy:h(E)}):new _("plugincollection-plugin-not-found",r,{plugin:A})})(b,k),function(A,E){if(l(E)&&!l(A))throw new _("plugincollection-context-required",r,{plugin:h(A),requiredBy:h(E)})}(b,k),function(A,E){if(E&&d(A,e))throw new _("plugincollection-required",r,{plugin:h(A),requiredBy:h(E)})}(b,k)})}function g(p,k){return p.reduce((b,A)=>A[k]?i._contextPlugins.has(A)?b:b.then(A[k].bind(A)):b,Promise.resolve())}}destroy(){const t=[];for(const[,e]of this)typeof e.destroy!="function"||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(n){if(this._plugins.has(n))throw new _("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t});this._plugins.set(n,e)}}}var kl=Object.getOwnPropertySymbols,Nw=Object.prototype.hasOwnProperty,Pw=Object.prototype.propertyIsEnumerable;class bl{constructor(t){this._contextOwner=null;const e=t||{},{translations:n}=e,i=((a,c)=>{var l={};for(var d in a)Nw.call(a,d)&&c.indexOf(d)<0&&(l[d]=a[d]);if(a!=null&&kl)for(var d of kl(a))c.indexOf(d)<0&&Pw.call(a,d)&&(l[d]=a[d]);return l})(e,["translations"]);this.config=new Vc(i,this.constructor.defaultConfig);const r=this.constructor.builtinPlugins;this.config.define("plugins",r),this.plugins=new fl(this,r);const s=this.config.get("language")||{};this.locale=new Mw({uiLanguage:typeof s=="string"?s:s.ui,contentLanguage:this.config.get("language.content"),translations:n}),this.t=this.locale.t,this.editors=new Be}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const n of t.concat(e)){if(typeof n!="function")throw new _("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new _("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new _("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const n=new this(t);e(n.initPlugins().then(()=>n))})}}class Oi extends ft(){constructor(t){super(),this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}class Ow extends oe{constructor(t){super(),this.editor=t}set(t,e,n={}){if(typeof e=="string"){const i=e;e=(r,s)=>{this.editor.execute(i),s()}}super.set(t,e,n)}}var Lw=N(2591),q=N.n(Lw),wl=N(4098),zw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(wl.A,zw),wl.A.locals;const Li=new WeakMap;let Al=!1;function Cl({view:o,element:t,text:e,isDirectHost:n=!0,keepOnFocus:i=!1}){const r=o.document;function s(a){Li.get(r).set(t,{text:a,isDirectHost:n,keepOnFocus:i,hostElement:n?t:null}),o.change(c=>ms(r,c))}Li.has(r)||(Li.set(r,new Map),r.registerPostFixer(a=>ms(r,a)),r.on("change:isComposing",()=>{o.change(a=>ms(r,a))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(a,c,l)=>{s(l)}),t.placeholder?s(t.placeholder):e&&s(e),e&&function(){Al||Q("enableplaceholder-deprecated-text-option"),Al=!0}()}function Rw(o,t){return!t.hasClass("ck-placeholder")&&(o.addClass("ck-placeholder",t),!0)}function jw(o,t){return!!t.hasClass("ck-placeholder")&&(o.removeClass("ck-placeholder",t),!0)}function Fw(o,t){if(!o.isAttached()||Array.from(o.getChildren()).some(i=>!i.is("uiElement")))return!1;const e=o.document,n=e.selection.anchor;return(!e.isComposing||!n||n.parent!==o)&&(!!t||!e.isFocused||!!n&&n.parent!==o)}function ms(o,t){const e=Li.get(o),n=[];let i=!1;for(const[r,s]of e)s.isDirectHost&&(n.push(r),_l(t,r,s)&&(i=!0));for(const[r,s]of e){if(s.isDirectHost)continue;const a=Vw(r);a&&(n.includes(a)||(s.hostElement=a,_l(t,r,s)&&(i=!0)))}return i}function _l(o,t,e){const{text:n,isDirectHost:i,hostElement:r}=e;let s=!1;return r.getAttribute("data-placeholder")!==n&&(o.setAttribute("data-placeholder",n,r),s=!0),(i||t.childCount==1)&&Fw(r,e.keepOnFocus)?Rw(o,r)&&(s=!0):jw(o,r)&&(s=!0),s}function Vw(o){if(o.childCount){const t=o.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class Bn{is(){throw new Error("is() method is abstract")}}const vl=function(o){return es(o,4)};class Nn extends kt(Bn){constructor(t){super(),this.document=t,this.parent=null}get index(){let t;if(!this.parent)return null;if((t=this.parent.getChildIndex(this))==-1)throw new _("view-node-not-found-in-parent",this);return t}get nextSibling(){const t=this.index;return t!==null&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return t!==null&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(t){if(this==t||this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=Mt(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i]t.data.length)throw new _("view-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.data.length)throw new _("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(t={}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;n!==null;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}Ke.prototype.is=function(o){return o==="$textProxy"||o==="view:$textProxy"||o==="textProxy"||o==="view:textProxy"};class Ne{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)(typeof e=="string"||e instanceof RegExp)&&(e={name:e}),this._patterns.push(e)}match(...t){for(const e of t)for(const n of this._patterns){const i=yl(e,n);if(i)return{element:e,pattern:n,match:i}}return null}matchAll(...t){const e=[];for(const n of t)for(const i of this._patterns){const r=yl(n,i);r&&e.push({element:n,pattern:i,match:r})}return e.length>0?e:null}getElementName(){if(this._patterns.length!==1)return null;const t=this._patterns[0],e=t.name;return typeof t=="function"||!e||e instanceof RegExp?null:e}}function yl(o,t){if(typeof t=="function")return t(o);const e={};return t.name&&(e.name=function(n,i){return n instanceof RegExp?!!i.match(n):n===i}(t.name,o.name),!e.name)||t.attributes&&(e.attributes=function(n,i){const r=new Set(i.getAttributeKeys());return de(n)?(n.style!==void 0&&Q("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Q("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),fs(n,r,s=>i.getAttribute(s))}(t.attributes,o),!e.attributes)||t.classes&&(e.classes=function(n,i){return fs(n,i.getClassNames(),()=>{})}(t.classes,o),!e.classes)||t.styles&&(e.styles=function(n,i){return fs(n,i.getStyleNames(!0),r=>i.getStyle(r))}(t.styles,o),!e.styles)?null:e}function fs(o,t,e){const n=function(s){return Array.isArray(s)?s.map(a=>de(a)?(a.key!==void 0&&a.value!==void 0||Q("matcher-pattern-missing-key-or-value",a),[a.key,a.value]):[a,!0]):de(s)?Object.entries(s):[[s,!0]]}(o),i=Array.from(t),r=[];if(n.forEach(([s,a])=>{i.forEach(c=>{(function(l,d){return l===!0||l===d||l instanceof RegExp&&d.match(l)})(s,c)&&function(l,d,h){if(l===!0)return!0;const u=h(d);return l===u||l instanceof RegExp&&!!String(u).match(l)}(a,c,e)&&r.push(c)})}),n.length&&!(r.lengthi?0:i+t),(e=e>i?i:e)<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var r=Array(i);++nn===t);return Array.isArray(e)}set(t,e){if(bt(t))for(const[n,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=_s(t);e0(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!bt(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([n])=>n===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(t=!1){return this.isEmpty?[]:t?this._styleProcessor.getStyleNames(this._styles):this.getStylesEntries().map(([e])=>e)}clear(){this._styles={}}getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const n of e)t.push(...this._styleProcessor.getReducedForm(n,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const n=e.splice(0,e.length-1).join("."),i=Fo(this._styles,n);i&&!Object.keys(i).length&&this.remove(n)}}class i0{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,n){if(bt(e))vs(n,_s(t),e);else if(this._normalizers.has(t)){const i=this._normalizers.get(t),{path:r,value:s}=i(e);vs(n,r,s)}else vs(n,t,e)}getNormalized(t,e){if(!t)return hs({},e);if(e[t]!==void 0)return e[t];if(this._extractors.has(t)){const n=this._extractors.get(t);if(typeof n=="string")return Fo(e,n);const i=n(t,e);if(i)return i}return Fo(e,_s(t))}getReducedForm(t,e){const n=this.getNormalized(t,e);return n===void 0?[]:this._reducers.has(t)?this._reducers.get(t)(n):[[t,n]]}getStyleNames(t){const e=Array.from(this._consumables.keys()).filter(i=>{const r=this.getNormalized(i,t);return r&&typeof r=="object"?Object.keys(r).length:r}),n=new Set([...e,...Object.keys(t)]);return Array.from(n)}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const n of e)this._mapStyleNames(n,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function _s(o){return o.replace("-",".")}function vs(o,t,e){let n=e;bt(e)&&(n=hs({},Fo(o,t),e)),o0(o,t,n)}class he extends Nn{constructor(t,e,n,i){if(super(t),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=e,this._attrs=function(r){const s=We(r);for(const[a,c]of s)c===null?s.delete(a):typeof c!="string"&&s.set(a,String(c));return s}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");Il(this._classes,r),this._attrs.delete("class")}this._styles=new Cs(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if(t=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(t=="style"){const e=this._styles.toString();return e==""?void 0:e}return this._attrs.get(t)}hasAttribute(t){return t=="class"?this._classes.size>0:t=="style"?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof he))return!1;if(this===t)return!0;if(this.name!=t.name||this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(t){return this._styles.getStyleNames(t)}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Ne(...t);let n=this.parent;for(;n&&!n.is("documentFragment");){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(t==""?"":` class="${t}"`)+(e?` style="${e}"`:"")+(n==""?"":` ${n}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const n=new this.constructor(this.document,this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._unsafeAttributesToRender=this._unsafeAttributesToRender,n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new vt(r,s)]:(Gt(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new vt(r,a):a instanceof Ke?new vt(r,a.data):a))}(this.document,e);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(t,0,r),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n0&&(this._classes.clear(),!0):t=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Et(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Et(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),typeof t!="string"?this._styles.set(t):this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Et(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Il(o,t){const e=t.split(/\s+/);o.clear(),e.forEach(n=>o.add(n))}he.prototype.is=function(o,t){return t?t===this.name&&(o==="element"||o==="view:element"):o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Vo extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=r0}}function r0(){const o=[...this.getChildren()],t=o[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const e of o)if(!e.is("uiElement"))return null;return this.childCount}Vo.prototype.is=function(o,t){return t?t===this.name&&(o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class ji extends ft(Vo){constructor(t,e,n,i){super(t,e,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",r=>r&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}destroy(){this.stopListening()}}ji.prototype.is=function(o,t){return t?t===this.name&&(o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};const Sl=Symbol("rootName");class Tl extends ji{constructor(t,e){super(t,e),this.rootName="main"}get rootName(){return this.getCustomProperty(Sl)}set rootName(t){this._setCustomProperty(Sl,t)}set _name(t){this.name=t}}Tl.prototype.is=function(o,t){return t?t===this.name&&(o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Pn{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new _("view-tree-walker-no-start-position",null);if(t.direction&&t.direction!="forward"&&t.direction!="backward")throw new _("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this._position=V._createAt(t.startPosition):this._position=V._createAt(t.boundaries[t.direction=="backward"?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,n;do n=this.position,e=this.next();while(!e.done&&t(e.value));e.done||(this._position=n)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,n=t.parent;if(n.parent===null&&t.offset===n.childCount)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let i;if(n instanceof vt){if(t.isAtEnd)return this._position=V._createAfter(n),this._next();i=n.data[t.offset]}else i=n.getChild(t.offset);if(i instanceof he){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t=new V(i,0);return this._position=t,this._formatReturnValue("elementStart",i,e,t,1)}if(i instanceof vt){if(this.singleCharacters)return t=new V(i,0),this._position=t,this._next();let r,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,r=new Ke(i,0,s),t=V._createAfter(r)):(r=new Ke(i,0,i.data.length),t.offset++),this._position=t,this._formatReturnValue("text",r,e,t,s)}if(typeof i=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset;const s=new Ke(n,t.offset,r);return t.offset+=r,this._position=t,this._formatReturnValue("text",s,e,t,r)}return t=V._createAfter(n),this._position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=this.position.clone();const e=this.position,n=t.parent;if(n.parent===null&&t.offset===0)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let i;if(n instanceof vt){if(t.isAtStart)return this._position=V._createBefore(n),this._previous();i=n.data[t.offset-1]}else i=n.getChild(t.offset-1);if(i instanceof he)return this.shallow?(t.offset--,this._position=t,this._formatReturnValue("elementStart",i,e,t,1)):(t=new V(i,i.childCount),this._position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,e,t));if(i instanceof vt){if(this.singleCharacters)return t=new V(i,i.data.length),this._position=t,this._previous();let r,s=i.data.length;if(i==this._boundaryStartParent){const a=this.boundaries.start.offset;r=new Ke(i,a,i.data.length-a),s=r.data.length,t=V._createBefore(r)}else r=new Ke(i,0,i.data.length),t.offset--;return this._position=t,this._formatReturnValue("text",r,e,t,s)}if(typeof i=="string"){let r;if(this.singleCharacters)r=1;else{const a=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=t.offset-a}t.offset-=r;const s=new Ke(n,t.offset,r);return this._position=t,this._formatReturnValue("text",s,e,t,r)}return t=V._createBefore(n),this._position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,i,r){return e instanceof Ke&&(e.offsetInText+e.data.length==e.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=V._createAfter(e.textNode):(i=V._createAfter(e.textNode),this._position=i)),e.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=V._createBefore(e.textNode):(i=V._createBefore(e.textNode),this._position=i))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:r}}}}class V extends Bn{constructor(t,e){super(),this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof ji);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=V._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Pn(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let i=0;for(;e[i]==n[i]&&e[i];)i++;return i===0?null:e[i-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return this.compareWith(t)=="before"}isAfter(t){return this.compareWith(t)=="after"}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const i=Mt(e,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return e[i]0?new this(n,i):new this(i,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(V._createBefore(t),e)}}function Fi(o){return!(!o.item.is("attributeElement")&&!o.item.is("uiElement"))}nt.prototype.is=function(o){return o==="range"||o==="view:range"};class Pe extends kt(Bn){constructor(...t){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",t.length&&this.setTo(...t)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake||this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel||this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=jt(this.getRanges());if(e!=jt(t.getRanges()))return!1;if(e==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let r of t.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...t){let[e,n,i]=t;if(typeof n=="object"&&(i=n,n=void 0),e===null)this._setRanges([]),this._setFakeOptions(i);else if(e instanceof Pe||e instanceof ys)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof nt)this._setRanges([e],i&&i.backward),this._setFakeOptions(i);else if(e instanceof V)this._setRanges([new nt(e)]),this._setFakeOptions(i);else if(e instanceof Nn){const r=!!i&&!!i.backward;let s;if(n===void 0)throw new _("view-selection-setto-required-second-parameter",this);s=n=="in"?nt._createIn(e):n=="on"?nt._createOn(e):new nt(V._createAt(e,n)),this._setRanges([s],r),this._setFakeOptions(i)}else{if(!Gt(e))throw new _("view-selection-setto-not-selectable",this);this._setRanges(e,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(t,e){if(this.anchor===null)throw new _("view-selection-setfocus-no-ranges",this);const n=V._createAt(t,e);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new nt(n,i),!0):this._addRange(new nt(i,n)),this.fire("change")}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const n of t)this._addRange(n);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof nt))throw new _("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new _("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new nt(t.start,t.end))}}Pe.prototype.is=function(o){return o==="selection"||o==="view:selection"};class ys extends kt(Bn){constructor(...t){super(),this._selection=new Pe,this._selection.delegate("change").to(this),t.length&&this._selection.setTo(...t)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}_setTo(...t){this._selection.setTo(...t)}_setFocus(t,e){this._selection.setFocus(t,e)}}ys.prototype.is=function(o){return o==="selection"||o=="documentSelection"||o=="view:selection"||o=="view:documentSelection"};class so extends H{constructor(t,e,n){super(t,e),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const xs=Symbol("bubbling contexts");function Es(o){return class extends o{fire(t,...e){try{const n=t instanceof H?t:new H(this,t),i=Ds(this);if(!i.size)return;if(Ho(n,"capturing",this),ao(i,"$capture",n,...e))return n.return;const r=n.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&!!Ml(i,s);let c=s||function(l){if(!l)return null;const d=l.start.parent,h=l.end.parent,u=d.getPath(),g=h.getPath();return u.length>g.length?d:h}(r);if(Ho(n,"atTarget",c),!a){if(ao(i,"$text",n,...e))return n.return;Ho(n,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(ao(i,"$root",n,...e))return n.return}else if(c.is("element")&&ao(i,c.name,n,...e))return n.return;if(ao(i,c,n,...e))return n.return;c=c.parent,Ho(n,"bubbling",c)}return Ho(n,"bubbling",this),ao(i,"$document",n,...e),n.return}catch(n){_.rethrowUnexpectedError(n,this)}}_addEventListener(t,e,n){const i=Et(n.context||"$document"),r=Ds(this);for(const s of i){let a=r.get(s);a||(a=new(kt()),r.set(s,a)),this.listenTo(a,t,e,n)}}_removeEventListener(t,e){const n=Ds(this);for(const i of n.values())this.stopListening(i,t,e)}}}{const o=Es(Object);["fire","_addEventListener","_removeEventListener"].forEach(t=>{Es[t]=o.prototype[t]})}function Ho(o,t,e){o instanceof so&&(o._eventPhase=t,o._currentTarget=e)}function ao(o,t,e,...n){const i=typeof t=="string"?o.get(t):Ml(o,t);return!!i&&(i.fire(e,...n),e.stop.called)}function Ml(o,t){for(const[e,n]of o)if(typeof e=="function"&&e(t))return n;return null}function Ds(o){return o[xs]||(o[xs]=new Map),o[xs]}class Vi extends Es(ft()){constructor(t){super(),this._postFixers=new Set,this.selection=new ys,this.roots=new Be({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.forEach(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do for(const n of this._postFixers)if(e=n(t),e)break;while(e)}}class On extends he{constructor(t,e,n,i){super(t,e,n,i),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=s0}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new _("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(t){return this.id!==null||t.id!==null?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t=!1){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function s0(){if(Is(this))return null;let o=this.parent;for(;o&&o.is("attributeElement");){if(Is(o)>1)return null;o=o.parent}return!o||Is(o)>1?null:this.childCount}function Is(o){return Array.from(o.getChildren()).filter(t=>!t.is("uiElement")).length}On.DEFAULT_PRIORITY=10,On.prototype.is=function(o,t){return t?t===this.name&&(o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"):o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ss extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=a0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-emptyelement-cannot-add",[this,e]);return 0}}function a0(){return null}Ss.prototype.is=function(o,t){return t?t===this.name&&(o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"):o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Hi extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=l0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-uielement-cannot-add",[this,e]);return 0}render(t,e){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const n of this.getAttributeKeys())e.setAttribute(n,this.getAttribute(n));return e}}function c0(o){o.document.on("arrowKey",(t,e)=>function(n,i,r){if(i.keyCode==ut.arrowright){const s=i.domTarget.ownerDocument.defaultView.getSelection(),a=s.rangeCount==1&&s.getRangeAt(0).collapsed;if(a||i.shiftKey){const c=s.focusNode,l=s.focusOffset,d=r.domPositionToView(c,l);if(d===null)return;let h=!1;const u=d.getLastMatchingPosition(g=>(g.item.is("uiElement")&&(h=!0),!(!g.item.is("uiElement")&&!g.item.is("attributeElement"))));if(h){const g=r.viewPositionToDom(u);a?s.collapse(g.parent,g.offset):s.extend(g.parent,g.offset)}}}}(0,e,o.domConverter),{priority:"low"})}function l0(){return null}Hi.prototype.is=function(o,t){return t?t===this.name&&(o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"):o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ts extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=d0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-rawelement-cannot-add",[this,e]);return 0}render(t,e){}}function d0(){return null}Ts.prototype.is=function(o,t){return t?t===this.name&&(o==="rawElement"||o==="view:rawElement"||o==="element"||o==="view:element"):o==="rawElement"||o==="view:rawElement"||o===this.name||o==="view:"+this.name||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ln extends kt(Bn){constructor(t,e){super(),this._children=[],this._customProperties=new Map,this.document=t,e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new vt(r,s)]:(Gt(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new vt(r,a):a instanceof Ke?new vt(r,a.data):a))}(this.document,e);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(t,0,r),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n{const c=s[s.length-1],l=!a.is("uiElement");return c&&c.breakAttributes==l?c.nodes.push(a):s.push({breakAttributes:l,nodes:[a]}),s},[]);let i=null,r=t;for(const{nodes:s,breakAttributes:a}of n){const c=this._insertNodes(r,s,a);i||(i=c.start),r=c.end}return i?new nt(i,r):new nt(t)}remove(t){const e=t instanceof nt?t:nt._createOn(t);if(Uo(e,this.document),e.isCollapsed)return new Ln(this.document);const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,s=i.offset-n.offset,a=r._removeChildren(n.offset,s);for(const l of a)this._removeFromClonedElementsGroup(l);const c=this.mergeAttributes(n);return e.start=c,e.end=c.clone(),new Ln(this.document,a)}clear(t,e){Uo(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const r=i.item;let s;if(r.is("element")&&e.isSimilar(r))s=nt._createOn(r);else if(!i.nextPosition.isAfter(t.start)&&r.is("$textProxy")){const a=r.getAncestors().find(c=>c.is("element")&&e.isSimilar(c));a&&(s=nt._createIn(a))}s&&(s.end.isAfter(t.end)&&(s.end=t.end),s.start.isBefore(t.start)&&(s.start=t.start),this.remove(s))}}move(t,e){let n;if(e.isAfter(t.end)){const i=(e=this._breakAttributes(e,!0)).parent,r=i.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=i.childCount-r}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof On))throw new _("view-writer-wrap-invalid-attribute",this.document);if(Uo(t,this.document),t.isCollapsed){let i=t.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(s=>!s.is("uiElement")))&&(i=i.getLastMatchingPosition(s=>s.item.is("uiElement"))),i=this._wrapPosition(i,e);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(t.start)&&this.setSelection(i),new nt(i)}return this._wrapRange(t,e);var n}unwrap(t,e){if(!(e instanceof On))throw new _("view-writer-unwrap-invalid-attribute",this.document);if(Uo(t,this.document),t.isCollapsed)return t;const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,s=this._unwrapChildren(r,n.offset,i.offset,e),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const c=this.mergeAttributes(s.end);return new nt(a,c)}rename(t,e){const n=new Vo(this.document,t,e.getAttributes());return this.insert(V._createAfter(e),n),this.move(nt._createIn(e),V._createAt(n,0)),this.remove(nt._createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}createSlot(t="children"){if(!this._slotFactory)throw new _("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,t)}_registerSlotFactory(t){this._slotFactory=t}_clearSlotFactory(){this._slotFactory=null}_insertNodes(t,e,n){let i,r;if(i=n?Ms(t):t.parent.is("$text")?t.parent.parent:t.parent,!i)throw new _("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(t,!0):t.parent.is("$text")?Bs(t):t;const s=i._insertChild(r.offset,e);for(const d of e)this._addToClonedElementsGroup(d);const a=r.getShiftedBy(s),c=this.mergeAttributes(r);c.isEqual(r)||a.offset--;const l=this.mergeAttributes(a);return new nt(c,l)}_wrapChildren(t,e,n,i){let r=e;const s=[];for(;r!1,t.parent._insertChild(t.offset,n);const i=new nt(t,t.getShiftedBy(1));this.wrap(i,e);const r=new V(n.parent,n.index);n._remove();const s=r.nodeBefore,a=r.nodeAfter;return s instanceof vt&&a instanceof vt?Pl(s,a):Nl(r)}_wrapAttributeElement(t,e){if(!Ll(t,e)||t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if(n!=="class"&&n!=="style"&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())n!=="class"&&n!=="style"&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!Ll(t,e)||t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,i=t.end;if(Uo(t,this.document),t.isCollapsed){const c=this._breakAttributes(t.start,e);return new nt(c,c)}const r=this._breakAttributes(i,e),s=r.parent.childCount,a=this._breakAttributes(n,e);return r.offset+=r.parent.childCount-s,new nt(a,r)}_breakAttributes(t,e=!1){const n=t.offset,i=t.parent;if(t.parent.is("emptyElement"))throw new _("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new _("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new _("view-writer-cannot-break-raw-element",this.document);if(!e&&i.is("$text")&&Ns(i.parent)||Ns(i))return t.clone();if(i.is("$text"))return this._breakAttributes(Bs(t),e);if(n==i.childCount){const r=new V(i.parent,i.index+1);return this._breakAttributes(r,e)}if(n===0){const r=new V(i.parent,i.index);return this._breakAttributes(r,e)}{const r=i.index+1,s=i._clone();i.parent._insertChild(r,s),this._addToClonedElementsGroup(s);const a=i.childCount-n,c=i._removeChildren(n,a);s._appendChild(c);const l=new V(i.parent,r);return this._breakAttributes(l,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const i of t.getChildren())this._addToClonedElementsGroup(i);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const i of t.getChildren())this._removeFromClonedElementsGroup(i);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}function Ms(o){let t=o.parent;for(;!Ns(t);){if(!t)return;t=t.parent}return t}function h0(o,t){return o.priorityt.priority)&&o.getIdentity()e instanceof n))throw new _("view-writer-insert-invalid-node-type",t);e.is("$text")||Ol(e.getChildren(),t)}}function Ns(o){return o&&(o.is("containerElement")||o.is("documentFragment"))}function Uo(o,t){const e=Ms(o.start),n=Ms(o.end);if(!e||!n||e!==n)throw new _("view-writer-invalid-range-container",t)}function Ll(o,t){return o.id===null&&t.id===null}const zl=o=>o.createTextNode(" "),Rl=o=>{const t=o.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},jl=o=>{const t=o.createElement("br");return t.dataset.ckeFiller="true",t},Oe=7,qo="⁠".repeat(Oe);function ue(o){return typeof o=="string"?o.substr(0,Oe)===qo:Ft(o)&&o.data.substr(0,Oe)===qo}function Go(o){return o.data.length==Oe&&ue(o)}function Fl(o){const t=typeof o=="string"?o:o.data;return ue(o)?t.slice(Oe):t}function g0(o,t){if(t.keyCode==ut.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(e.rangeCount==1&&e.getRangeAt(0).collapsed){const n=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;ue(n)&&i<=Oe&&e.collapse(n,0)}}}var Vl=N(8264),p0={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Vl.A,p0),Vl.A.locals;class m0 extends ft(){constructor(t,e){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=t,this.selection=e,this.set("isFocused",!1),this.set("isSelecting",!1),f.isBlink&&!f.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this.set("isComposing",!1),this.on("change:isComposing",()=>{this.isComposing||this.render()})}markToSync(t,e){if(t==="text")this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if(t==="attributes")this.markedAttributes.add(e);else{if(t!=="children")throw new _("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){if(this.isComposing&&!f.isAndroid)return;let t=null;const e=!(f.isBlink&&!f.isAndroid)||!this.isSelecting;for(const n of this.markedChildren)this._updateChildrenMappings(n);e?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(t=this.domConverter.domPositionToView(this._inlineFiller),t&&t.parent.is("$text")&&(t=V._createBefore(t.parent)));for(const n of this.markedAttributes)this._updateAttrs(n);for(const n of this.markedChildren)this._updateChildren(n,{inlineFillerPosition:t});for(const n of this.markedTexts)!this.markedChildren.has(n.parent)&&this.domConverter.mapViewToDom(n.parent)&&this._updateText(n,{inlineFillerPosition:t});if(e)if(t){const n=this.domConverter.viewPositionToDom(t),i=n.parent.ownerDocument;ue(n.parent)?this._inlineFiller=n.parent:this._inlineFiller=Hl(i,n.parent,n.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.childNodes),i=Array.from(this.domConverter.viewChildrenToDom(t,{withChildren:!1})),r=this._diffNodeLists(n,i),s=this._findUpdateActions(r,n,i,f0);if(s.indexOf("update")!==-1){const a={equal:0,insert:0,delete:0};for(const c of s)if(c==="update"){const l=a.equal+a.insert,d=a.equal+a.delete,h=t.getChild(l);!h||h.is("uiElement")||h.is("rawElement")||this._updateElementMappings(h,n[d]),el(i[l]),a.equal++}else a[c]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?V._createBefore(t.parent):t}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Ft(e.parent)&&ue(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!ue(t))throw new _("view-renderer-filler-was-lost",this);Go(t)?t.remove():t.data=t.data.substr(Oe),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root)||!e.is("element")||!function(s){if(s.getAttribute("contenteditable")=="false")return!1;const a=s.findAncestor(c=>c.hasAttribute("contenteditable"));return!a||a.getAttribute("contenteditable")=="true"}(e)||n===e.getFillerOffset())return!1;const i=t.nodeBefore,r=t.nodeAfter;return!(i instanceof vt||r instanceof vt)&&(!f.isAndroid||!i&&!r)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t);let i=this.domConverter.viewToDom(t).data;const r=e.inlineFillerPosition;r&&r.parent==t.parent&&r.offset==t.index&&(i=qo+i),Ul(n,i)}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(r=>r.name),i=t.getAttributeKeys();for(const r of i)this.domConverter.setDomElementAttribute(e,r,t.getAttribute(r),t);for(const r of n)t.hasAttribute(r)||this.domConverter.removeDomElementAttribute(e,r)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;if(f.isAndroid){let h=null;for(const u of Array.from(n.childNodes)){if(h&&Ft(h)&&Ft(u)){n.normalize();break}h=u}}const i=e.inlineFillerPosition,r=n.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(t,{bind:!0}));i&&i.parent===t&&Hl(n.ownerDocument,s,i.offset);const a=this._diffNodeLists(r,s),c=this._findUpdateActions(a,r,s,k0);let l=0;const d=new Set;for(const h of c)h==="delete"?(d.add(r[l]),el(r[l])):h!=="equal"&&h!=="update"||l++;l=0;for(const h of c)h==="insert"?(Zc(n,l,s[l]),l++):h==="update"?(Ul(r[l],s[l].data),l++):h==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const h of d)h.parentNode||this.domConverter.unbindDomElement(h)}_diffNodeLists(t,e){return t=function(n,i){const r=Array.from(n);return r.length==0||!i||r[r.length-1]==i&&r.pop(),r}(t,this._fakeSelectionContainer),O(t,e,b0.bind(null,this.domConverter))}_findUpdateActions(t,e,n,i){if(t.indexOf("insert")===-1||t.indexOf("delete")===-1)return t;let r=[],s=[],a=[];const c={equal:0,insert:0,delete:0};for(const l of t)l==="insert"?a.push(n[c.equal+c.insert]):l==="delete"?s.push(e[c.equal+c.delete]):(r=r.concat(O(s,a,i).map(d=>d==="equal"?"update":d)),r.push("equal"),s=[],a=[]),c[l]++;return r.concat(O(s,a,i).map(l=>l==="equal"?"update":l))}_markDescendantTextToSync(t){if(t){if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}}_updateSelection(){if(f.isBlink&&!f.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(t)):this.isComposing&&f.isAndroid||this._updateDomSelection(t))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(s){const a=s.createElement("div");return a.className="ck-fake-selection-container",Object.assign(a.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),a.textContent=" ",a}(e));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(t))return;n.parentElement&&n.parentElement==t||t.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=e.getSelection(),r=e.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);e.setBaseAndExtent(n.parent,n.offset,i.parent,i.offset),f.isGecko&&function(r,s){const a=r.parent;if(a.nodeType!=Node.ELEMENT_NODE||r.offset!=a.childNodes.length-1)return;const c=a.childNodes[r.offset];c&&c.tagName=="BR"&&s.addRange(s.getRangeAt(0))}(i,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,n=t.ownerDocument.getSelection();return!e||e.parentElement!==t||n.anchorNode!==e&&!e.contains(n.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const t of this.domDocuments){const e=t.getSelection();if(e.rangeCount){const n=t.activeElement,i=this.domConverter.mapDomToView(n);n&&i&&e.removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Hl(o,t,e){const n=t instanceof Array?t:t.childNodes,i=n[e];if(Ft(i))return i.data=qo+i.data,i;{const r=o.createTextNode(qo);return Array.isArray(t)?n.splice(e,0,r):Zc(t,e,r),r}}function f0(o,t){return un(o)&&un(t)&&!Ft(o)&&!Ft(t)&&!Ro(o)&&!Ro(t)&&o.tagName.toLowerCase()===t.tagName.toLowerCase()}function k0(o,t){return un(o)&&un(t)&&Ft(o)&&Ft(t)}function b0(o,t,e){return t===e||(Ft(t)&&Ft(e)?t.data===e.data:!(!o.isBlockFiller(t)||!o.isBlockFiller(e)))}function Ul(o,t){const e=o.data;if(e==t)return;const n=I(e,t);for(const i of n)i.type==="insert"?o.insertData(i.index,i.values.join("")):o.deleteData(i.index,i.howMany)}const w0=jl($.document),A0=zl($.document),C0=Rl($.document),Ui="data-ck-unsafe-attribute-",ql="data-ck-unsafe-element";class qi{constructor(t,{blockFillerMode:e,renderingMode:n="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Ne,this._inlineObjectElementMatcher=new Ne,this._elementsWithTemporaryCustomProperties=new Set,this.document=t,this.renderingMode=n,this.blockFillerMode=e||(n==="editing"?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?$.document:$.document.implementation.createHTMLDocument("")}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Pe(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const n of Array.from(t.children))this.unbindDomElement(n)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e,n){return this.renderingMode==="data"||!(t=t.toLowerCase()).startsWith("on")&&(t!=="srcdoc"||!e.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&(n==="img"&&(t==="src"||t==="srcset")||n==="source"&&t==="srcset"||!e.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(t,e){if(this.renderingMode==="data")return void(t.innerHTML=e);const n=new DOMParser().parseFromString(e,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);const s=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),a=[];let c;for(;c=s.nextNode();)a.push(c);for(const l of a){for(const h of l.getAttributeNames())this.setDomElementAttribute(l,h,l.getAttribute(h));const d=l.tagName.toLowerCase();this._shouldRenameElement(d)&&(Kl(d),l.replaceWith(this._createReplacementDomElement(d,l)))}for(;t.firstChild;)t.firstChild.remove();t.append(i)}viewToDom(t,e={}){if(t.is("$text")){const n=this._processDataFromViewText(t);return this._domDocument.createTextNode(n)}{const n=t;if(this.mapViewToDom(n)){if(!n.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(n);this._elementsWithTemporaryCustomProperties.add(n)}let i;if(n.is("documentFragment"))i=this._domDocument.createDocumentFragment(),e.bind&&this.bindDocumentFragments(i,n);else{if(n.is("uiElement"))return i=n.name==="$comment"?this._domDocument.createComment(n.getCustomProperty("$rawContent")):n.render(this._domDocument,this),e.bind&&this.bindElements(i,n),i;this._shouldRenameElement(n.name)?(Kl(n.name),i=this._createReplacementDomElement(n.name)):i=n.hasAttribute("xmlns")?this._domDocument.createElementNS(n.getAttribute("xmlns"),n.name):this._domDocument.createElement(n.name),n.is("rawElement")&&n.render(i,this),e.bind&&this.bindElements(i,n);for(const r of n.getAttributeKeys())this.setDomElementAttribute(i,r,n.getAttribute(r),n)}if(e.withChildren!==!1)for(const r of this.viewChildrenToDom(n,e))i.appendChild(r);return i}}setDomElementAttribute(t,e,n,i){const r=this.shouldRenderAttribute(e,n,t.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(e);r||Q("domconverter-unsafe-attribute-detected",{domElement:t,key:e,value:n}),function(s){try{$.document.createAttribute(s)}catch{return!1}return!0}(e)?(t.hasAttribute(e)&&!r?t.removeAttribute(e):t.hasAttribute(Ui+e)&&r&&t.removeAttribute(Ui+e),t.setAttribute(r?e:Ui+e,n)):Q("domconverter-invalid-attribute-detected",{domElement:t,key:e,value:n})}removeDomElementAttribute(t,e){e!=ql&&(t.removeAttribute(e),t.removeAttribute(Ui+e))}*viewChildrenToDom(t,e={}){const n=t.getFillerOffset&&t.getFillerOffset();let i=0;for(const r of t.getChildren()){n===i&&(yield this._getBlockFiller());const s=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!Wt(r.getAttributes());s&&this.renderingMode=="data"?yield*this.viewChildrenToDom(r,e):(s&&Q("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,e)),i++}n===i&&(yield this._getBlockFiller())}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),i=this._domDocument.createRange();return i.setStart(e.parent,e.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let i=t.offset;return ue(n)&&(i+=Oe),{parent:n,offset:i}}{let n,i,r;if(t.offset===0){if(n=this.mapViewToDom(e),!n)return null;r=n.childNodes[0]}else{const s=t.nodeBefore;if(i=s.is("$text")?this.findCorrespondingDomText(s):this.mapViewToDom(s),!i)return null;n=i.parentNode,r=i.nextSibling}return Ft(r)&&ue(r)?{parent:r,offset:Oe}:{parent:n,offset:i?Ni(i)+1:0}}}domToView(t,e={}){const n=[],i=this._domToView(t,e,n),r=i.next().value;return r?(i.next(),this._processDomInlineNodes(null,n,e),r.is("$text")&&r.data.length==0?null:r):null}*domChildrenToView(t,e={},n=[]){for(let i=0;i{const{scrollLeft:a,scrollTop:c}=s;r.push([a,c])}),e.focus(),Gl(e,s=>{const[a,c]=r.shift();s.scrollLeft=a,s.scrollTop=c}),$.window.scrollTo(n,i)}}_clearDomSelection(){const t=this.mapViewToDom(this.document.selection.editableElement);if(!t)return;const e=t.ownerDocument.defaultView.getSelection(),n=this.domSelectionToView(e);n&&n.rangeCount>0&&e.removeAllRanges()}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(t){return this.blockFillerMode=="br"?t.isEqualNode(w0):!(t.tagName!=="BR"||!Wl(t,this.blockElements)||t.parentNode.childNodes.length!==1)||t.isEqualNode(C0)||function(e,n){return e.isEqualNode(A0)&&Wl(e,n)&&e.parentNode.childNodes.length===1}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=this._domDocument.createRange();try{e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset)}catch{return!1}const n=e.collapsed;return e.detach(),n}getHostViewElement(t){const e=function(n){const i=[];let r=n;for(;r&&r.nodeType!=Node.DOCUMENT_NODE;)i.unshift(r),r=r.parentNode;return i}(t);for(e.pop();e.length;){const n=e.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}registerInlineObjectMatcher(t){this._inlineObjectElementMatcher.add(t)}_clearTemporaryCustomProperties(){for(const t of this._elementsWithTemporaryCustomProperties)t._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return zl(this._domDocument);case"markedNbsp":return Rl(this._domDocument);case"br":return jl(this._domDocument)}}_isDomSelectionPositionCorrect(t,e){if(Ft(t)&&ue(t)&&e0?e[r-1]:null,d=r+1this.preElements.includes(n.name)))return e;if(e.charAt(0)==" "){const n=this._getTouchingInlineViewNode(t,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(e=" "+e.substr(1))}if(e.charAt(e.length-1)==" "){const n=this._getTouchingInlineViewNode(t,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";e.charAt(e.length-2)!=" "&&n&&!i||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const e=this._processDataFromViewText(t);return e.charAt(e.length-1)==" "}_getTouchingInlineViewNode(t,e){const n=new Pn({startPosition:e?V._createAfter(t):V._createBefore(t),direction:e?"forward":"backward"});for(const i of n){if(i.item.is("element","br"))return null;if(this._isInlineObjectElement(i.item))return i.item;if(i.item.is("containerElement"))return null;if(i.item.is("$textProxy"))return i.item}return null}_isBlockDomElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isBlockViewElement(t){return t.is("element")&&this.blockElements.includes(t.name)}_isInlineObjectElement(t){return!!t.is("element")&&(t.name=="br"||this.inlineObjectElements.includes(t.name)||!!this._inlineObjectElementMatcher.match(t))}_createViewElement(t,e){if(Ro(t))return new Hi(this.document,"$comment");const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new he(this.document,n)}_isViewElementWithRawContent(t,e){return e.withChildren!==!1&&t.is("element")&&!!this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){const e=t.toLowerCase();return this.renderingMode==="editing"&&this.unsafeElements.includes(e)}_createReplacementDomElement(t,e){const n=this._domDocument.createElement("span");if(n.setAttribute(ql,t),e){for(;e.firstChild;)n.appendChild(e.firstChild);for(const i of e.getAttributeNames())n.setAttribute(i,e.getAttribute(i))}return n}}function _0(o,t){return o.getAncestors().some(e=>e.is("element")&&t.includes(e.name))}function Gl(o,t){let e=o;for(;e;)t(e),e=e.parentElement}function Wl(o,t){const e=o.parentNode;return!!e&&!!e.tagName&&t.includes(e.tagName.toLowerCase())}function Kl(o){o==="script"&&Q("domconverter-unsafe-script-element-detected"),o==="style"&&Q("domconverter-unsafe-style-element-detected")}class $e extends Ce(){constructor(t){super(),this._isEnabled=!1,this.view=t,this.document=t.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&t.nodeType===3&&(t=t.parentNode),!(!t||t.nodeType!==1)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}const $l=dl(function(o,t){to(t,no(t),o)});class co{constructor(t,e,n){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,$l(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class pn extends $e{constructor(){super(...arguments),this.useCapture=!1}observe(t){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}stopObserving(t){this.stopListening(t)}fire(t,e,n){this.isEnabled&&this.document.fire(t,new co(this.view,e,n))}}class v0 extends pn{constructor(){super(...arguments),this.domEventType=["keydown","keyup"]}onDomEvent(t){const e={keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return io(this)}};this.fire(t.type,t,e)}}const Ps=function(){return Me.Date.now()};var y0=/\s/;const x0=function(o){for(var t=o.length;t--&&y0.test(o.charAt(t)););return t};var E0=/^\s+/;const D0=function(o){return o&&o.slice(0,x0(o)+1).replace(E0,"")};var I0=/^[-+]0x[0-9a-f]+$/i,S0=/^0b[01]+$/i,T0=/^0o[0-7]+$/i,M0=parseInt;const Yl=function(o){if(typeof o=="number")return o;if(zi(o))return NaN;if(bt(o)){var t=typeof o.valueOf=="function"?o.valueOf():o;o=bt(t)?t+"":t}if(typeof o!="string")return o===0?o:+o;o=D0(o);var e=S0.test(o);return e||T0.test(o)?M0(o.slice(2),e?2:8):I0.test(o)?NaN:+o};var B0=Math.max,N0=Math.min;const Wo=function(o,t,e){var n,i,r,s,a,c,l=0,d=!1,h=!1,u=!0;if(typeof o!="function")throw new TypeError("Expected a function");function g(E){var M=n,z=i;return n=i=void 0,l=E,s=o.apply(z,M)}function p(E){var M=E-c;return c===void 0||M>=t||M<0||h&&E-l>=r}function k(){var E=Ps();if(p(E))return b(E);a=setTimeout(k,function(M){var z=t-(M-c);return h?N0(z,r-(M-l)):z}(E))}function b(E){return a=void 0,u&&n?g(E):(n=i=void 0,s)}function A(){var E=Ps(),M=p(E);if(n=arguments,i=this,c=E,M){if(a===void 0)return function(z){return l=z,a=setTimeout(k,t),d?g(z):s}(c);if(h)return clearTimeout(a),a=setTimeout(k,t),g(c)}return a===void 0&&(a=setTimeout(k,t)),s}return t=Yl(t)||0,bt(e)&&(d=!!e.leading,r=(h="maxWait"in e)?B0(Yl(e.maxWait)||0,t):r,u="trailing"in e?!!e.trailing:u),A.cancel=function(){a!==void 0&&clearTimeout(a),l=0,n=c=i=a=void 0},A.flush=function(){return a===void 0?s:b(Ps())},A};class P0 extends $e{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Wo(e=>{this.document.fire("selectionChangeDone",e)},200)}observe(){const t=this.document;t.on("arrowKey",(e,n)=>{t.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),t.on("arrowKey",(e,n)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new Pe(e.getRanges(),{backward:e.isBackward,fake:!1});t!=ut.arrowleft&&t!=ut.arrowup||n.setTo(n.getFirstPosition()),t!=ut.arrowright&&t!=ut.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}const O0=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this},L0=function(o){return this.__data__.has(o)};function Gi(o){var t=-1,e=o==null?0:o.length;for(this.__data__=new vi;++ta))return!1;var l=r.get(o),d=r.get(t);if(l&&d)return l==t&&d==o;var h=-1,u=!0,g=2&e?new z0:void 0;for(r.set(o,t),r.set(t,o);++h{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this.flush(),t.change(()=>{})},50)}),e.on("blur",(n,i)=>{const r=e.selection.editableElement;r!==null&&r!==i.target||(e.isFocused=!1,this._isFocusChanging=!1,t.change(()=>{}))})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class $0 extends $e{constructor(t){super(t),this.mutationObserver=t.getObserver(ed),this.focusObserver=t.getObserver($i),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Wo(e=>{this.document.fire("selectionChangeDone",e)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Wo(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument,n=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,e),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(t,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(t,"keydown",n,{priority:"highest",useCapture:!0}),this.listenTo(t,"keyup",n,{priority:"highest",useCapture:!0}),this._documents.has(e)||(this.listenTo(e,"mouseup",n,{priority:"highest",useCapture:!0}),this.listenTo(e,"selectionchange",(i,r)=>{this.document.isComposing&&!f.isAndroid||(this._handleSelectionChange(r,e),this._documentIsSelectingInactivityTimeoutDebounced())}),this._documents.add(e))}stopObserving(t){this.stopListening(t)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(t,e){if(!this.isEnabled)return;const n=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(n))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.selection.isSimilar(i))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Y0 extends pn{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0},{priority:"low"}),e.on("compositionend",()=>{e.isComposing=!1},{priority:"low"})}onDomEvent(t){this.fire(t.type,t,{data:t.data})}}class nd{constructor(t,e={}){this._files=e.cacheFiles?od(t):null,this._native=t}get files(){return this._files||(this._files=od(this._native)),this._files}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}setDragImage(t,e,n){this._native.setDragImage(t,e,n)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function od(o){const t=Array.from(o.files||[]),e=Array.from(o.items||[]);return t.length?t:e.filter(n=>n.kind==="file").map(n=>n.getAsFile())}class Q0 extends pn{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(t){const e=t.getTargetRanges(),n=this.view,i=n.document;let r=null,s=null,a=[];if(t.dataTransfer&&(r=new nd(t.dataTransfer)),t.data!==null?s=t.data:r&&(s=r.getData("text/plain")),i.selection.isFake)a=Array.from(i.selection.getRanges());else if(e.length)a=e.map(c=>{const l=n.domConverter.domPositionToView(c.startContainer,c.startOffset),d=n.domConverter.domPositionToView(c.endContainer,c.endOffset);return l?n.createRange(l,d):d?n.createRange(d):void 0}).filter(c=>!!c);else if(f.isAndroid){const c=t.target.ownerDocument.defaultView.getSelection();a=Array.from(n.domConverter.domSelectionToView(c).getRanges())}if(f.isAndroid&&t.inputType=="insertCompositionText"&&s&&s.endsWith(` +/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(Nt))))," */")),Z.styleSheet)Z.styleSheet.cssText=Q;else{for(;Z.firstChild;)Z.removeChild(Z.firstChild);Z.appendChild(document.createTextNode(Q))}}var W=null,X=0;function At(Z,rt){var _,Q,Dt;if(rt.singleton){var Nt=X++;_=W||(W=S(rt)),Q=j.bind(null,_,Nt,!1),Dt=j.bind(null,_,Nt,!0)}else _=S(rt),Q=H.bind(null,_,rt),Dt=function(){(function(Tt){if(Tt.parentNode===null)return!1;Tt.parentNode.removeChild(Tt)})(_)};return Q(Z),function(Tt){if(Tt){if(Tt.css===Z.css&&Tt.media===Z.media&&Tt.sourceMap===Z.sourceMap)return;Q(Z=Tt)}else Dt()}}v.exports=function(Z,rt){(rt=rt||{}).singleton||typeof rt.singleton=="boolean"||(rt.singleton=D());var _=I(Z=Z||[],rt);return function(Q){if(Q=Q||[],Object.prototype.toString.call(Q)==="[object Array]"){for(var Dt=0;Dt<_.length;Dt++){var Nt=w(_[Dt]);f[Nt].references--}for(var Tt=I(Q,rt),Ue=0;Ue<_.length;Ue++){var Ie=w(_[Ue]);f[Ie].references===0&&(f[Ie].updater(),f.splice(Ie,1))}_=Tt}}}}},J={};function P(v){var x=J[v];if(x!==void 0)return x.exports;var m=J[v]={id:v,exports:{}};return Y[v](m,m.exports,P),m.exports}P.n=v=>{var x=v&&v.__esModule?()=>v.default:()=>v;return P.d(x,{a:x}),x},P.d=(v,x)=>{for(var m in x)P.o(x,m)&&!P.o(v,m)&&Object.defineProperty(v,m,{enumerable:!0,get:x[m]})},P.o=(v,x)=>Object.prototype.hasOwnProperty.call(v,x),P.nc=void 0;var K={};return(()=>{function v({emitter:o,activator:t,callback:e,contextElements:n}){o.listenTo(document,"mousedown",(i,r)=>{if(!t())return;const s=typeof r.composedPath=="function"?r.composedPath():[],a=typeof n=="function"?n():n;for(const c of a)if(c.contains(r.target)||s.includes(c))return;e()})}function x(o){return class extends o{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...t){super(...t),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function m({view:o}){o.listenTo(o.element,"submit",(t,e)=>{e.preventDefault(),o.fire("submit")},{useCapture:!0})}function y({keystrokeHandler:o,focusTracker:t,gridItems:e,numberOfColumns:n,uiLanguageDirection:i}){const r=typeof n=="number"?()=>n:n;function s(l){return d=>{const h=e.find(p=>p.element===t.focusedElement),u=e.getIndex(h),g=l(u,e);e.get(g).focus(),d.stopPropagation(),d.preventDefault()}}function a(l,d){return l===d-1?0:l+1}function c(l,d){return l===0?d-1:l-1}o.set("arrowright",s((l,d)=>i==="rtl"?c(l,d.length):a(l,d.length))),o.set("arrowleft",s((l,d)=>i==="rtl"?a(l,d.length):c(l,d.length))),o.set("arrowup",s((l,d)=>{let h=l-r();return h<0&&(h=l+r()*Math.floor(d.length/r()),h>d.length-1&&(h-=r())),h})),o.set("arrowdown",s((l,d)=>{let h=l+r();return h>d.length-1&&(h=l%r()),h}))}P.d(K,{default:()=>Za});const D=function(){try{return navigator.userAgent.toLowerCase()}catch{return""}}();var C;const f={isMac:w(D),isWindows:(C=D,C.indexOf("windows")>-1),isGecko:function(o){return!!o.match(/gecko\/\d+/)}(D),isSafari:function(o){return o.indexOf(" applewebkit/")>-1&&o.indexOf("chrome")===-1}(D),isiOS:function(o){return!!o.match(/iphone|ipad/i)||w(o)&&navigator.maxTouchPoints>0}(D),isAndroid:function(o){return o.indexOf("android")>-1}(D),isBlink:function(o){return o.indexOf("chrome/")>-1&&o.indexOf("edge/")<0}(D),features:{isRegExpUnicodePropertySupported:function(){let o=!1;try{o="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return o}()}};function w(o){return o.indexOf("macintosh")>-1}function I(o,t,e,n){e=e||function(c,l){return c===l};const i=Array.isArray(o)?o:Array.prototype.slice.call(o),r=Array.isArray(t)?t:Array.prototype.slice.call(t),s=function(c,l,d){const h=S(c,l,d);if(h===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const u=T(c,h),g=T(l,h),p=S(u,g,d),k=c.length-p,b=l.length-p;return{firstIndex:h,lastIndexOld:k,lastIndexNew:b}}(i,r,e);return n?function(c,l){const{firstIndex:d,lastIndexOld:h,lastIndexNew:u}=c;if(d===-1)return Array(l).fill("equal");let g=[];return d>0&&(g=g.concat(Array(d).fill("equal"))),u-d>0&&(g=g.concat(Array(u-d).fill("insert"))),h-d>0&&(g=g.concat(Array(h-d).fill("delete"))),u0&&d.push({index:h,type:"insert",values:c.slice(h,g)}),u-h>0&&d.push({index:h+(g-h),type:"delete",howMany:u-h}),d}(r,s)}function S(o,t,e){for(let n=0;n200||i>200||n+i>300)return O.fastDiff(o,t,e,!0);let r,s;if(iA?-1:1;d[k+E]&&(d[k]=d[k+E].slice(0)),d[k]||(d[k]=[]),d[k].push(b>A?r:s);let M=Math.max(b,A),z=M-k;for(;zl;g--)h[g]=u(g);h[l]=u(l),p++}while(h[l]!==c);return d[l].slice(1)}O.fastDiff=I;const j=function(){return function o(){o.called=!0}};class H{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=j(),this.off=j()}}const W=new Array(256).fill("").map((o,t)=>("0"+t.toString(16)).slice(-2));function X(){const o=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+W[o>>0&255]+W[o>>8&255]+W[o>>16&255]+W[o>>24&255]+W[t>>0&255]+W[t>>8&255]+W[t>>16&255]+W[t>>24&255]+W[e>>0&255]+W[e>>8&255]+W[e>>16&255]+W[e>>24&255]+W[n>>0&255]+W[n>>8&255]+W[n>>16&255]+W[n>>24&255]}const At={get(o="normal"){return typeof o!="number"?this[o]||this.normal:o},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function Z(o,t){const e=At.get(t.priority);for(let n=0;n{if(typeof h=="object"&&h!==null){if(s.has(h))return`[object ${h.constructor.name}]`;s.add(h)}return h},c=r?` ${JSON.stringify(r,a)}`:"",l=Nt(i);return i+c+l}(t,n)),this.name="CKEditorError",this.context=e,this.data=n}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const n=new _(t.message,e);throw n.stack=t.stack,n}}function Q(o,t){console.warn(...Tt(o,t))}function Dt(o,t){console.error(...Tt(o,t))}function Nt(o){return` +Read more: ${rt}#error-${o}`}function Tt(o,t){const e=Nt(o);return t?[o,t,e]:[o,e]}const Ue="41.2.0",Ie=new Date(2024,2,6);if(globalThis.CKEDITOR_VERSION)throw new _("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=Ue;const fe=Symbol("listeningTo"),Je=Symbol("emitterId"),Se=Symbol("delegations"),bi=kt(Object);function kt(o){return o?class extends o{on(t,e,n){this.listenTo(this,t,e,n)}once(t,e,n){let i=!1;this.listenTo(this,t,(r,...s)=>{i||(i=!0,r.off(),e.call(this,r,...s))},n)}off(t,e){this.stopListening(this,t,e)}listenTo(t,e,n,i={}){let r,s;this[fe]||(this[fe]={});const a=this[fe];xo(t)||yo(t);const c=xo(t);(r=a[c])||(r=a[c]={emitter:t,callbacks:{}}),(s=r.callbacks[e])||(s=r.callbacks[e]=[]),s.push(n),function(l,d,h,u,g){d._addEventListener?d._addEventListener(h,u,g):l._addEventListener.call(d,h,u,g)}(this,t,e,n,i)}stopListening(t,e,n){const i=this[fe];let r=t&&xo(t);const s=i&&r?i[r]:void 0,a=s&&e?s.callbacks[e]:void 0;if(!(!i||t&&!s||e&&!a))if(n)Te(this,t,e,n),a.indexOf(n)!==-1&&(a.length===1?delete s.callbacks[e]:Te(this,t,e,n));else if(a){for(;n=a.pop();)Te(this,t,e,n);delete s.callbacks[e]}else if(s){for(e in s.callbacks)this.stopListening(t,e);delete i[r]}else{for(r in i)this.stopListening(i[r].emitter);delete this[fe]}}fire(t,...e){try{const n=t instanceof H?t:new H(this,t),i=n.name;let r=Lt(this,i);if(n.path.push(this),r){const a=[n,...e];r=Array.from(r);for(let c=0;c{this[Se]||(this[Se]=new Map),t.forEach(i=>{const r=this[Se].get(i);r?r.set(e,n):this[Se].set(i,new Map([[e,n]]))})}}}stopDelegating(t,e){if(this[Se])if(t)if(e){const n=this[Se].get(t);n&&n.delete(e)}else this[Se].delete(t);else this[Se].clear()}_addEventListener(t,e,n){(function(s,a){const c=U(s);if(c[a])return;let l=a,d=null;const h=[];for(;l!==""&&!c[l];)c[l]={callbacks:[],childEvents:[]},h.push(c[l]),d&&c[l].childEvents.push(d),d=l,l=l.substr(0,l.lastIndexOf(":"));if(l!==""){for(const u of h)u.callbacks=c[l].callbacks.slice();c[l].childEvents.push(d)}})(this,t);const i=ht(this,t),r={callback:e,priority:At.get(n.priority)};for(const s of i)Z(s,r)}_removeEventListener(t,e){const n=ht(this,t);for(const i of n)for(let r=0;r-1?Lt(o,t.substr(0,t.lastIndexOf(":"))):null}function ne(o,t,e){for(let[n,i]of o){i?typeof i=="function"&&(i=i(t.name)):i=t.name;const r=new H(t.source,i);r.path=[...t.path],n.fire(r,...e)}}function Te(o,t,e,n){t._removeEventListener?t._removeEventListener(e,n):o._removeEventListener.call(t,e,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{kt[o]=bi.prototype[o]});const bt=function(o){var t=typeof o;return o!=null&&(t=="object"||t=="function")},qe=Symbol("observableProperties"),Yt=Symbol("boundObservables"),ke=Symbol("boundProperties"),be=Symbol("decoratedMethods"),Eo=Symbol("decoratedOriginal"),vn=ft(kt());function ft(o){return o?class extends o{set(t,e){if(bt(t))return void Object.keys(t).forEach(i=>{this.set(i,t[i])},this);yn(this);const n=this[qe];if(t in this&&!n.has(t))throw new _("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(i){const r=n.get(t);let s=this.fire(`set:${t}`,t,i,r);s===void 0&&(s=i),r===s&&n.has(t)||(n.set(t,s),this.fire(`change:${t}`,t,s,r))}}),this[t]=e}bind(...t){if(!t.length||!xn(t))throw new _("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new _("observable-bind-duplicate-properties",this);yn(this);const e=this[ke];t.forEach(i=>{if(e.has(i))throw new _("observable-bind-rebind",this)});const n=new Map;return t.forEach(i=>{const r={property:i,to:[]};e.set(i,r),n.set(i,r)}),{to:jr,toMany:wi,_observable:this,_bindProperties:t,_to:[],_bindings:n}}unbind(...t){if(!this[qe])return;const e=this[ke],n=this[Yt];if(t.length){if(!xn(t))throw new _("observable-unbind-wrong-properties",this);t.forEach(i=>{const r=e.get(i);r&&(r.to.forEach(([s,a])=>{const c=n.get(s),l=c[a];l.delete(r),l.size||delete c[a],Object.keys(c).length||(n.delete(s),this.stopListening(s,"change"))}),e.delete(i))})}else n.forEach((i,r)=>{this.stopListening(r,"change")}),n.clear(),e.clear()}decorate(t){yn(this);const e=this[t];if(!e)throw new _("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(n,i)=>{n.return=e.apply(this,i)}),this[t]=function(...n){return this.fire(t,n)},this[t][Eo]=e,this[be]||(this[be]=[]),this[be].push(t)}stopListening(t,e,n){if(!t&&this[be]){for(const i of this[be])this[i]=this[i][Eo];delete this[be]}super.stopListening(t,e,n)}}:vn}function yn(o){o[qe]||(Object.defineProperty(o,qe,{value:new Map}),Object.defineProperty(o,Yt,{value:new Map}),Object.defineProperty(o,ke,{value:new Map}))}function jr(...o){const t=function(...r){if(!r.length)throw new _("observable-bind-to-parse-error",null);const s={to:[]};let a;return typeof r[r.length-1]=="function"&&(s.callback=r.pop()),r.forEach(c=>{if(typeof c=="string")a.properties.push(c);else{if(typeof c!="object")throw new _("observable-bind-to-parse-error",null);a={observable:c,properties:[]},s.to.push(a)}}),s}(...o),e=Array.from(this._bindings.keys()),n=e.length;if(!t.callback&&t.to.length>1)throw new _("observable-bind-to-no-callback",this);if(n>1&&t.callback)throw new _("observable-bind-to-extra-callback",this);var i;t.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new _("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(e[0]).callback=t.callback),i=this._observable,this._to.forEach(r=>{const s=i[Yt];let a;s.get(r.observable)||i.listenTo(r.observable,"change",(c,l)=>{a=s.get(r.observable)[l],a&&a.forEach(d=>{Do(i,d.property)})})}),function(r){let s;r._bindings.forEach((a,c)=>{r._to.forEach(l=>{s=l.properties[a.callback?0:r._bindProperties.indexOf(c)],a.to.push([l.observable,s]),function(d,h,u,g){const p=d[Yt],k=p.get(u),b=k||{};b[g]||(b[g]=new Set),b[g].add(h),k||p.set(u,b)}(r._observable,a,l.observable,s)})})}(this),this._bindProperties.forEach(r=>{Do(this._observable,r)})}function wi(o,t,e){if(this._bindings.size>1)throw new _("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const r=n.map(s=>[s,i]);return Array.prototype.concat.apply([],r)}(o,t),e)}function xn(o){return o.every(t=>typeof t=="string")}function Do(o,t){const e=o[ke].get(t);let n;e.callback?n=e.callback.apply(o,e.to.map(i=>i[0][i[1]])):(n=e.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(o,t)?o[t]=n:o.set(t,n)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{ft[o]=vn.prototype[o]});class Io{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}function jt(o){let t=0;for(const e of o)t++;return t}function Mt(o,t){const e=Math.min(o.length,t.length);for(let n=0;n-1},Kk=function(o,t){var e=this.__data__,n=Ai(e,o);return n<0?(++this.size,e.push([o,t])):e[n][1]=t,this};function Yn(o){var t=-1,e=o==null?0:o.length;for(this.clear();++t-1&&o%1==0&&o-1&&o%1==0&&o<=9007199254740991};var Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;const Sb=function(o){return we(o)&&Ur(o.length)&&!!Bt[hn(o)]},qr=function(o){return function(t){return o(t)}};var gc=F&&!F.nodeType&&F,Po=gc&&!0&&N&&!N.nodeType&&N,Gr=Po&&Po.exports===gc&&tc.process;const eo=function(){try{var o=Po&&Po.require&&Po.require("util").types;return o||Gr&&Gr.binding&&Gr.binding("util")}catch{}}();var pc=eo&&eo.isTypedArray;const Wr=pc?qr(pc):Sb;var Tb=Object.prototype.hasOwnProperty;const mc=function(o,t){var e=le(o),n=!e&&Ei(o),i=!e&&!n&&No(o),r=!e&&!n&&!i&&Wr(o),s=e||n||i||r,a=s?yb(o.length,String):[],c=a.length;for(var l in o)!t&&!Tb.call(o,l)||s&&(l=="length"||i&&(l=="offset"||l=="parent")||r&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Di(l,c))||a.push(l);return a};var Mb=Object.prototype;const Kr=function(o){var t=o&&o.constructor;return o===(typeof t=="function"&&t.prototype||Mb)},Bb=ic(Object.keys,Object);var Nb=Object.prototype.hasOwnProperty;const Pb=function(o){if(!Kr(o))return Bb(o);var t=[];for(var e in Object(o))Nb.call(o,e)&&e!="constructor"&&t.push(e);return t},Ii=function(o){return o!=null&&Ur(o.length)&&!En(o)},Oo=function(o){return Ii(o)?mc(o):Pb(o)},Ob=function(o,t){return o&&to(t,Oo(t),o)},Lb=function(o){var t=[];if(o!=null)for(var e in Object(o))t.push(e);return t};var zb=Object.prototype.hasOwnProperty;const Rb=function(o){if(!bt(o))return Lb(o);var t=Kr(o),e=[];for(var n in o)(n!="constructor"||!t&&zb.call(o,n))&&e.push(n);return e},no=function(o){return Ii(o)?mc(o,!0):Rb(o)},jb=function(o,t){return o&&to(t,no(t),o)};var fc=F&&!F.nodeType&&F,kc=fc&&!0&&N&&!N.nodeType&&N,bc=kc&&kc.exports===fc?Me.Buffer:void 0,wc=bc?bc.allocUnsafe:void 0;const Ac=function(o,t){if(t)return o.slice();var e=o.length,n=wc?wc(e):new o.constructor(e);return o.copy(n),n},Cc=function(o,t){var e=-1,n=o.length;for(t||(t=Array(n));++e{this._setToTarget(t,i,e[i],n)})}}function Uc(o){return os(o,cw)}function cw(o){return Tn(o)||typeof o=="function"?o:void 0}function un(o){if(o){if(o.defaultView)return o instanceof o.defaultView.Document;if(o.ownerDocument&&o.ownerDocument.defaultView)return o instanceof o.ownerDocument.defaultView.Node}return!1}function Ti(o){const t=Object.prototype.toString.apply(o);return t=="[object Window]"||t=="[object global]"}const qc=Ce(kt());function Ce(o){return o?class extends o{listenTo(t,e,n,i={}){if(un(t)||Ti(t)){const r={capture:!!i.useCapture,passive:!!i.usePassive},s=this._getProxyEmitter(t,r)||new lw(t,r);this.listenTo(s,e,n,i)}else super.listenTo(t,e,n,i)}stopListening(t,e,n){if(un(t)||Ti(t)){const i=this._getAllProxyEmitters(t);for(const r of i)this.stopListening(r,e,n)}else super.stopListening(t,e,n)}_getProxyEmitter(t,e){return function(n,i){const r=n[fe];return r&&r[i]?r[i].emitter:null}(this,Gc(t,e))}_getAllProxyEmitters(t){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(e=>this._getProxyEmitter(t,e)).filter(e=>!!e)}}:qc}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach(o=>{Ce[o]=qc.prototype[o]});class lw extends kt(){constructor(t,e){super(),yo(this,Gc(t,e)),this._domNode=t,this._options=e}attach(t){if(this._domListeners&&this._domListeners[t])return;const e=this._createDomListener(t);this._domNode.addEventListener(t,e,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=e}detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()}_addEventListener(t,e,n){this.attach(t),kt().prototype._addEventListener.call(this,t,e,n)}_removeEventListener(t,e){kt().prototype._removeEventListener.call(this,t,e),this.detach(t)}_createDomListener(t){const e=n=>{this.fire(t,n)};return e.removeListener=()=>{this._domNode.removeEventListener(t,e,this._options),delete this._domListeners[t]},e}}function Gc(o,t){let e=function(n){return n["data-ck-expando"]||(n["data-ck-expando"]=X())}(o);for(const n of Object.keys(t).sort())t[n]&&(e+="-"+n);return e}let is;try{is={window,document}}catch{is={window:{},document:{}}}const $=is;function Wc(o){const t=o.ownerDocument.defaultView.getComputedStyle(o);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function Ft(o){return Object.prototype.toString.call(o)=="[object Text]"}function Mi(o){return Object.prototype.toString.apply(o)=="[object Range]"}function Kc(o){return o&&o.parentNode?o.offsetParent===$.document.body?null:o.offsetParent:null}const $c=["top","right","bottom","left","width","height"];class dt{constructor(t){const e=Mi(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),rs(t)||e)if(e){const n=dt.getDomRangeRects(t);Bi(this,dt.getBoundingRect(n))}else Bi(this,t.getBoundingClientRect());else if(Ti(t)){const{innerWidth:n,innerHeight:i}=t;Bi(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else Bi(this,t)}clone(){return new dt(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0)return null;{const n=new dt(e);return n._source=this._source,n}}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(Yc(t))return e;let n,i=t,r=t.parentNode||t.commonAncestorContainer;for(;r&&!Yc(r);){const a=((s=r)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible")==="visible";i instanceof HTMLElement&&Qc(i)==="absolute"&&(n=i);const c=Qc(r);if(a||n&&(c==="relative"&&a||c!=="relative")){i=r,r=r.parentNode;continue}const l=new dt(r),d=e.getIntersection(l);if(!d)return null;d.getArea(){for(const t of o){const e=zt._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}};let zo=zt;function Zc(o,t){o instanceof HTMLTextAreaElement&&(o.value=t),o.innerHTML=t}function oo(o){return t=>t+o}function Ni(o){let t=0;for(;o.previousSibling;)o=o.previousSibling,t++;return t}function Jc(o,t,e){o.insertBefore(e,o.childNodes[t]||null)}function Ro(o){return o&&o.nodeType===Node.COMMENT_NODE}function Mn(o){return!!(o&&o.getClientRects&&o.getClientRects().length)}zo._observerInstance=null,zo._elementCallbacks=null;var Xc=Math.pow;function ss({element:o,target:t,positions:e,limiter:n,fitInViewport:i,viewportOffsetConfig:r}){En(t)&&(t=t()),En(n)&&(n=n());const s=Kc(o),a=function(u){u=Object.assign({top:0,bottom:0,left:0,right:0},u);const g=new dt($.window);return g.top+=u.top,g.height-=u.top,g.bottom-=u.bottom,g.height-=u.bottom,g}(r),c=new dt(o),l=tl(t,a);let d;if(!l||!a.getIntersection(l))return null;const h={targetRect:l,elementRect:c,positionedElementAncestor:s,viewportRect:a};if(n||i){if(n){const u=tl(n,a);u&&(h.limiterRect=u)}d=function(u,g){const{elementRect:p}=g,k=p.getArea(),b=u.map(M=>new el(M,g)).filter(M=>!!M.name);let A=0,E=null;for(const M of b){const{limiterIntersectionArea:z,viewportIntersectionArea:G}=M;if(z===k)return M;const tt=Xc(G,2)+Xc(z,2);tt>A&&(A=tt,E=M)}return E}(e,h)}else d=new el(e[0],h);return d}function tl(o,t){const e=new dt(o).getVisible();return e?e.getIntersection(t):null}class el{constructor(t,e){const n=t(e.targetRect,e.elementRect,e.viewportRect,e.limiterRect);if(!n)return;const{left:i,top:r,name:s,config:a}=n;this.name=s,this.config=a,this._positioningFunctionCoordinates={left:i,top:r},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;return t?t.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function nl(o){const t=o.parentNode;t&&t.removeChild(o)}function dw({window:o,rect:t,alignToTop:e,forceScroll:n,viewportOffset:i}){const r=t.clone().moveBy(0,i.bottom),s=t.clone().moveBy(0,-i.top),a=new dt(o).excludeScrollbarsAndBorders(),c=e&&n,l=[s,r].every(p=>a.contains(p));let{scrollX:d,scrollY:h}=o;const u=d,g=h;c?h-=a.top-t.top+i.top:l||(il(s,a)?h-=a.top-t.top+i.top:ol(r,a)&&(h+=e?t.top-a.top-i.top:t.bottom-a.bottom+i.bottom)),l||(rl(t,a)?d-=a.left-t.left+i.left:sl(t,a)&&(d+=t.right-a.right+i.right)),d==u&&h===g||o.scrollTo(d,h)}function hw({parent:o,getRect:t,alignToTop:e,forceScroll:n,ancestorOffset:i=0,limiterElement:r}){const s=as(o),a=e&&n;let c,l,d;const h=r||s.document.body;for(;o!=h;)l=t(),c=new dt(o).excludeScrollbarsAndBorders(),d=c.contains(l),a?o.scrollTop-=c.top-l.top+i:d||(il(l,c)?o.scrollTop-=c.top-l.top+i:ol(l,c)&&(o.scrollTop+=e?l.top-c.top-i:l.bottom-c.bottom+i)),d||(rl(l,c)?o.scrollLeft-=c.left-l.left+i:sl(l,c)&&(o.scrollLeft+=l.right-c.right+i)),o=o.parentNode}function ol(o,t){return o.bottom>t.bottom}function il(o,t){return o.topt.right}function as(o){return Mi(o)?o.startContainer.ownerDocument.defaultView:o.ownerDocument.defaultView}function uw(o){if(Mi(o)){let t=o.commonAncestorContainer;return Ft(t)&&(t=t.parentNode),t}return o.parentNode}function al(o,t){const e=as(o),n=new dt(o);if(e===t)return n;{let i=e;for(;i!=t;){const r=i.frameElement,s=new dt(r).excludeScrollbarsAndBorders();n.moveBy(s.left,s.top),i=i.parent}}return n}const gw={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},pw={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},cl={37:"←",38:"↑",39:"→",40:"↓",9:"⇥"},ut=function(){const o={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++)o[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)o[t-48]=t;for(let t=112;t<=123;t++)o["f"+(t-111)]=t;return Object.assign(o,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),o}(),mw=Object.fromEntries(Object.entries(ut).map(([o,t])=>{let e;return e=t in cl?cl[t]:o.charAt(0).toUpperCase()+o.slice(1),[t,e]}));function io(o){let t;if(typeof o=="string"){if(t=ut[o.toLowerCase()],!t)throw new _("keyboard-unknown-key",null,{key:o})}else t=o.keyCode+(o.altKey?ut.alt:0)+(o.ctrlKey?ut.ctrl:0)+(o.shiftKey?ut.shift:0)+(o.metaKey?ut.cmd:0);return t}function jo(o){return typeof o=="string"&&(o=function(t){return t.split("+").map(e=>e.trim())}(o)),o.map(t=>typeof t=="string"?function(e){if(e.endsWith("!"))return io(e.slice(0,-1));const n=io(e);return(f.isMac||f.isiOS)&&n==ut.ctrl?ut.cmd:n}(t):t).reduce((t,e)=>e+t,0)}function Pi(o){let t=jo(o);return Object.entries(f.isMac||f.isiOS?gw:pw).reduce((e,[n,i])=>(t&ut[n]&&(t&=~ut[n],e+=i),e),"")+(t?mw[t]:"")}function cs(o,t){const e=t==="ltr";switch(o){case ut.arrowleft:return e?"left":"right";case ut.arrowright:return e?"right":"left";case ut.arrowup:return"up";case ut.arrowdown:return"down"}}function Et(o){return Array.isArray(o)?o:[o]}const ls=function(o,t,e){(e!==void 0&&!To(o[t],e)||e===void 0&&!(t in o))&&xi(o,t,e)},ll=function(o){return function(t,e,n){for(var i=-1,r=Object(t),s=n(t),a=s.length;a--;){var c=s[o?a:++i];if(e(r[c],c,r)===!1)break}return t}}(),fw=function(o){return we(o)&&Ii(o)},ds=function(o,t){if((t!=="constructor"||typeof o[t]!="function")&&t!="__proto__")return o[t]},kw=function(o){return to(o,no(o))},bw=function(o,t,e,n,i,r,s){var a=ds(o,e),c=ds(t,e),l=s.get(c);if(l)ls(o,e,l);else{var d=r?r(a,c,e+"",o,t,s):void 0,h=d===void 0;if(h){var u=le(c),g=!u&&No(c),p=!u&&!g&&Wr(c);d=c,u||g||p?le(a)?d=a:fw(a)?d=Cc(a):g?(h=!1,d=Ac(c,!0)):p?(h=!1,d=Pc(c,!0)):d=[]:de(c)||Ei(c)?(d=a,Ei(a)?d=kw(a):bt(a)&&!En(a)||(d=Lc(c))):h=!1}h&&(s.set(c,d),i(d,c,n,r,s),s.delete(c)),ls(o,e,d)}},ww=function o(t,e,n,i,r){t!==e&&ll(e,function(s,a){if(r||(r=new Xn),bt(s))bw(t,e,a,n,o,i,r);else{var c=i?i(ds(t,a),s,a+"",t,e,r):void 0;c===void 0&&(c=s),ls(t,a,c)}},no)},gn=function(o){return o},Aw=function(o,t,e){switch(e.length){case 0:return o.call(t);case 1:return o.call(t,e[0]);case 2:return o.call(t,e[0],e[1]);case 3:return o.call(t,e[0],e[1],e[2])}return o.apply(t,e)};var dl=Math.max;const Cw=function(o,t,e){return t=dl(t===void 0?o.length-1:t,0),function(){for(var n=arguments,i=-1,r=dl(n.length-t,0),s=Array(r);++i0){if(++t>=800)return arguments[0]}else t=0;return o.apply(void 0,arguments)}}(vw),Ew=function(o,t){return xw(Cw(o,t,gn),o+"")},Dw=function(o,t,e){if(!bt(e))return!1;var n=typeof t;return!!(n=="number"?Ii(e)&&Di(t,e.length):n=="string"&&t in e)&&To(e[t],o)},hl=function(o){return Ew(function(t,e){var n=-1,i=e.length,r=i>1?e[i-1]:void 0,s=i>2?e[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,s&&Dw(e[0],e[1],s)&&(r=i<3?void 0:r,i=1),t=Object(t);++nd===1?0:1),l=a[s];return typeof l=="string"?l:l[Number(c(e))]}$.window.CKEDITOR_TRANSLATIONS||($.window.CKEDITOR_TRANSLATIONS={});const Sw=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function ul(o){return Sw.includes(o)?"rtl":"ltr"}class Tw{constructor({uiLanguage:t="en",contentLanguage:e,translations:n}={}){this.uiLanguage=t,this.contentLanguage=e||this.uiLanguage,this.uiLanguageDirection=ul(this.uiLanguage),this.contentLanguageDirection=ul(this.contentLanguage),this.translations=function(i){return Array.isArray(i)?i.reduce((r,s)=>hs(r,s)):i}(n),this.t=(i,r)=>this._t(i,r)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=Et(e),typeof t=="string"&&(t={string:t});const n=t.plural?e[0]:1;return function(i,r){return i.replace(/%(\d+)/g,(s,a)=>athis._items.length||e<0)throw new _("collection-add-item-invalid-index",this);let n=0;for(const i of t){const r=this._getItemIdBeforeAdding(i),s=e+n;this._items.splice(s,0,i),this._itemMap.set(r,i),this.fire("add",i,s),n++}return this.fire("change",{added:t,removed:[],index:e}),this}get(t){let e;if(typeof t=="string")e=this._itemMap.get(t);else{if(typeof t!="number")throw new _("collection-get-invalid-arg",this);e=this._items[t]}return e||null}has(t){if(typeof t=="string")return this._itemMap.has(t);{const e=t[this._idProperty];return e&&this._itemMap.has(e)}}getIndex(t){let e;return e=typeof t=="string"?this._itemMap.get(t):t,e?this._items.indexOf(e):-1}remove(t){const[e,n]=this._remove(t);return this.fire("change",{added:[],removed:[e],index:n}),e}map(t,e){return this._items.map(t,e)}forEach(t,e){this._items.forEach(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new _("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:e=>{this._setUpBindToBinding(n=>new e(n))},using:e=>{typeof e=="function"?this._setUpBindToBinding(e):this._setUpBindToBinding(n=>n[e])}}}_setUpBindToBinding(t){const e=this._bindToCollection,n=(i,r,s)=>{const a=e._bindToCollection==this,c=e._bindToInternalToExternalMap.get(r);if(a&&c)this._bindToExternalToInternalMap.set(r,c),this._bindToInternalToExternalMap.set(c,r);else{const l=t(r);if(!l)return void this._skippedIndexesFromExternal.push(s);let d=s;for(const h of this._skippedIndexesFromExternal)s>h&&d--;for(const h of e._skippedIndexesFromExternal)d>=h&&d++;this._bindToExternalToInternalMap.set(r,l),this._bindToInternalToExternalMap.set(l,r),this.add(l,d);for(let h=0;h{const a=this._bindToExternalToInternalMap.get(r);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((c,l)=>(sl&&c.push(l),c),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let n;if(e in t){if(n=t[e],typeof n!="string")throw new _("collection-add-invalid-id",this);if(this.get(n))throw new _("collection-add-item-already-exists",this)}else t[e]=n=X();return n}_remove(t){let e,n,i,r=!1;const s=this._idProperty;if(typeof t=="string"?(n=t,i=this._itemMap.get(n),r=!i,i&&(e=this._items.indexOf(i))):typeof t=="number"?(e=t,i=this._items[e],r=!i,i&&(n=i[s])):(i=t,n=i[s],e=this._items.indexOf(i),r=e==-1||!this._itemMap.get(n)),r)throw new _("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(n);const a=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(a),this.fire("remove",i,e),[i,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Wt(o){const t=o.next();return t.done?null:t.value}class Qt extends Ce(ft()){constructor(){super(),this._elements=new Set,this._nextEventLoopTimeout=null,this.set("isFocused",!1),this.set("focusedElement",null)}add(t){if(this._elements.has(t))throw new _("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}class oe{constructor(){this._listener=new(Ce())}listenTo(t){this._listener.listenTo(t,"keydown",(e,n)=>{this._listener.fire("_keydown:"+io(n),n)})}set(t,e,n={}){const i=jo(t),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(s,a)=>{e(a,()=>{a.preventDefault(),a.stopPropagation(),s.stop()}),s.return=!0},{priority:r})}press(t){return!!this._listener.fire("_keydown:"+io(t),t)}stopListening(t){this._listener.stopListening(t)}destroy(){this.stopListening()}}function We(o){return Gt(o)?new Map(o):function(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}(o)}function us(o,t){let e;function n(...i){n.cancel(),e=setTimeout(()=>o(...i),t)}return n.cancel=()=>{clearTimeout(e)},n}function gs(o,t){return!!(e=o.charAt(t-1))&&e.length==1&&/[\ud800-\udbff]/.test(e)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(o.charAt(t));var e}function ps(o,t){return!!(e=o.charAt(t))&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e);var e}const Mw=function(){const o=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],t=new RegExp("\\p{Regional_Indicator}{2}","u").source,e="(?:"+o.map(n=>n.source).join("|")+")";return new RegExp(`${t}|${e}(?:‍${e})*`,"ug")}();function gl(o,t){const e=String(o).matchAll(Mw);return Array.from(e).some(n=>n.index{this.refresh()}),this.listenTo(t,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",e=>{if(!this.affectsData)return;const n=t.model.document.selection,i=n.getFirstPosition().root.rootName!="$graveyard"&&t.model.canEditAt(n);(t.isReadOnly||this._isEnabledBasedOnSelection&&!i)&&(e.return=!1,e.stop())},{priority:"highest"}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(t){this._affectsData=t}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),this._disableStack.size==1&&(this.on("set:isEnabled",ml,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),this._disableStack.size==0&&(this.off("set:isEnabled",ml),this.refresh())}execute(...t){}destroy(){this.stopListening()}}function ml(o){o.return=!1,o.stop()}class fl extends st{constructor(){super(...arguments),this._childCommandsDefinitions=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return!!e&&e.execute(t)}registerChildCommand(t,e={}){Z(this._childCommandsDefinitions,{command:t,priority:e.priority||"normal"}),t.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const t=this._childCommandsDefinitions.find(({command:e})=>e.isEnabled);return t&&t.command}}class kl extends kt(){constructor(t,e=[],n=[]){super(),this._plugins=new Map,this._context=t,this._availablePlugins=new Map;for(const i of e)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,r]of n)this._contextPlugins.set(i,r),this._contextPlugins.set(r,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const t of this._plugins)typeof t[0]=="function"&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let n=t;throw typeof t=="function"&&(n=t.pluginName||t.name),new _("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return e}has(t){return this._plugins.has(t)}init(t,e=[],n=[]){const i=this,r=this._context;(function p(k,b=new Set){k.forEach(A=>{c(A)&&(b.has(A)||(b.add(A),A.pluginName&&!i._availablePlugins.has(A.pluginName)&&i._availablePlugins.set(A.pluginName,A),A.requires&&p(A.requires,b)))})})(t),u(t);const s=[...function p(k,b=new Set){return k.map(A=>c(A)?A:i._availablePlugins.get(A)).reduce((A,E)=>b.has(E)?A:(b.add(E),E.requires&&(u(E.requires,E),p(E.requires,b).forEach(M=>A.add(M))),A.add(E)),new Set)}(t.filter(p=>!d(p,e)))];(function(p,k){for(const b of k){if(typeof b!="function")throw new _("plugincollection-replace-plugin-invalid-type",null,{pluginItem:b});const A=b.pluginName;if(!A)throw new _("plugincollection-replace-plugin-missing-name",null,{pluginItem:b});if(b.requires&&b.requires.length)throw new _("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:A});const E=i._availablePlugins.get(A);if(!E)throw new _("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:A});const M=p.indexOf(E);if(M===-1){if(i._contextPlugins.has(E))return;throw new _("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:A})}if(E.requires&&E.requires.length)throw new _("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:A});p.splice(M,1,b),i._availablePlugins.set(A,b)}})(s,n);const a=s.map(p=>{let k=i._contextPlugins.get(p);return k=k||new p(r),i._add(p,k),k});return g(a,"init").then(()=>g(a,"afterInit")).then(()=>a);function c(p){return typeof p=="function"}function l(p){return c(p)&&!!p.isContextPlugin}function d(p,k){return k.some(b=>b===p||h(p)===b||h(b)===p)}function h(p){return c(p)?p.pluginName||p.name:p}function u(p,k=null){p.map(b=>c(b)?b:i._availablePlugins.get(b)||b).forEach(b=>{(function(A,E){if(!c(A))throw E?new _("plugincollection-soft-required",r,{missingPlugin:A,requiredBy:h(E)}):new _("plugincollection-plugin-not-found",r,{plugin:A})})(b,k),function(A,E){if(l(E)&&!l(A))throw new _("plugincollection-context-required",r,{plugin:h(A),requiredBy:h(E)})}(b,k),function(A,E){if(E&&d(A,e))throw new _("plugincollection-required",r,{plugin:h(A),requiredBy:h(E)})}(b,k)})}function g(p,k){return p.reduce((b,A)=>A[k]?i._contextPlugins.has(A)?b:b.then(A[k].bind(A)):b,Promise.resolve())}}destroy(){const t=[];for(const[,e]of this)typeof e.destroy!="function"||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const n=t.pluginName;if(n){if(this._plugins.has(n))throw new _("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t});this._plugins.set(n,e)}}}var bl=Object.getOwnPropertySymbols,Bw=Object.prototype.hasOwnProperty,Nw=Object.prototype.propertyIsEnumerable;class wl{constructor(t){this._contextOwner=null;const e=t||{},{translations:n}=e,i=((a,c)=>{var l={};for(var d in a)Bw.call(a,d)&&c.indexOf(d)<0&&(l[d]=a[d]);if(a!=null&&bl)for(var d of bl(a))c.indexOf(d)<0&&Nw.call(a,d)&&(l[d]=a[d]);return l})(e,["translations"]);this.config=new Hc(i,this.constructor.defaultConfig);const r=this.constructor.builtinPlugins;this.config.define("plugins",r),this.plugins=new kl(this,r);const s=this.config.get("language")||{};this.locale=new Tw({uiLanguage:typeof s=="string"?s:s.ui,contentLanguage:this.config.get("language.content"),translations:n}),this.t=this.locale.t,this.editors=new Be}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const n of t.concat(e)){if(typeof n!="function")throw new _("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new _("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new _("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const n=new this(t);e(n.initPlugins().then(()=>n))})}}class Oi extends ft(){constructor(t){super(),this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}class Pw extends oe{constructor(t){super(),this.editor=t}set(t,e,n={}){if(typeof e=="string"){const i=e;e=(r,s)=>{this.editor.execute(i),s()}}super.set(t,e,n)}}var Ow=P(2591),q=P.n(Ow),Al=P(4098),Lw={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Al.A,Lw),Al.A.locals;const Li=new WeakMap;let Cl=!1;function _l({view:o,element:t,text:e,isDirectHost:n=!0,keepOnFocus:i=!1}){const r=o.document;function s(a){Li.get(r).set(t,{text:a,isDirectHost:n,keepOnFocus:i,hostElement:n?t:null}),o.change(c=>ms(r,c))}Li.has(r)||(Li.set(r,new Map),r.registerPostFixer(a=>ms(r,a)),r.on("change:isComposing",()=>{o.change(a=>ms(r,a))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(a,c,l)=>{s(l)}),t.placeholder?s(t.placeholder):e&&s(e),e&&function(){Cl||Q("enableplaceholder-deprecated-text-option"),Cl=!0}()}function zw(o,t){return!t.hasClass("ck-placeholder")&&(o.addClass("ck-placeholder",t),!0)}function Rw(o,t){return!!t.hasClass("ck-placeholder")&&(o.removeClass("ck-placeholder",t),!0)}function jw(o,t){if(!o.isAttached()||Array.from(o.getChildren()).some(i=>!i.is("uiElement")))return!1;const e=o.document,n=e.selection.anchor;return(!e.isComposing||!n||n.parent!==o)&&(!!t||!e.isFocused||!!n&&n.parent!==o)}function ms(o,t){const e=Li.get(o),n=[];let i=!1;for(const[r,s]of e)s.isDirectHost&&(n.push(r),vl(t,r,s)&&(i=!0));for(const[r,s]of e){if(s.isDirectHost)continue;const a=Fw(r);a&&(n.includes(a)||(s.hostElement=a,vl(t,r,s)&&(i=!0)))}return i}function vl(o,t,e){const{text:n,isDirectHost:i,hostElement:r}=e;let s=!1;return r.getAttribute("data-placeholder")!==n&&(o.setAttribute("data-placeholder",n,r),s=!0),(i||t.childCount==1)&&jw(r,e.keepOnFocus)?zw(o,r)&&(s=!0):Rw(o,r)&&(s=!0),s}function Fw(o){if(o.childCount){const t=o.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}class Bn{is(){throw new Error("is() method is abstract")}}const yl=function(o){return es(o,4)};class Nn extends kt(Bn){constructor(t){super(),this.document=t,this.parent=null}get index(){let t;if(!this.parent)return null;if((t=this.parent.getChildIndex(this))==-1)throw new _("view-node-not-found-in-parent",this);return t}get nextSibling(){const t=this.index;return t!==null&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return t!==null&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(t){if(this==t||this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=Mt(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i]t.data.length)throw new _("view-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.data.length)throw new _("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(t={}){const e=[];let n=t.includeSelf?this.textNode:this.parent;for(;n!==null;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}}Ke.prototype.is=function(o){return o==="$textProxy"||o==="view:$textProxy"||o==="textProxy"||o==="view:textProxy"};class Ne{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)(typeof e=="string"||e instanceof RegExp)&&(e={name:e}),this._patterns.push(e)}match(...t){for(const e of t)for(const n of this._patterns){const i=xl(e,n);if(i)return{element:e,pattern:n,match:i}}return null}matchAll(...t){const e=[];for(const n of t)for(const i of this._patterns){const r=xl(n,i);r&&e.push({element:n,pattern:i,match:r})}return e.length>0?e:null}getElementName(){if(this._patterns.length!==1)return null;const t=this._patterns[0],e=t.name;return typeof t=="function"||!e||e instanceof RegExp?null:e}}function xl(o,t){if(typeof t=="function")return t(o);const e={};return t.name&&(e.name=function(n,i){return n instanceof RegExp?!!i.match(n):n===i}(t.name,o.name),!e.name)||t.attributes&&(e.attributes=function(n,i){const r=new Set(i.getAttributeKeys());return de(n)?(n.style!==void 0&&Q("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Q("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),fs(n,r,s=>i.getAttribute(s))}(t.attributes,o),!e.attributes)||t.classes&&(e.classes=function(n,i){return fs(n,i.getClassNames(),()=>{})}(t.classes,o),!e.classes)||t.styles&&(e.styles=function(n,i){return fs(n,i.getStyleNames(!0),r=>i.getStyle(r))}(t.styles,o),!e.styles)?null:e}function fs(o,t,e){const n=function(s){return Array.isArray(s)?s.map(a=>de(a)?(a.key!==void 0&&a.value!==void 0||Q("matcher-pattern-missing-key-or-value",a),[a.key,a.value]):[a,!0]):de(s)?Object.entries(s):[[s,!0]]}(o),i=Array.from(t),r=[];if(n.forEach(([s,a])=>{i.forEach(c=>{(function(l,d){return l===!0||l===d||l instanceof RegExp&&d.match(l)})(s,c)&&function(l,d,h){if(l===!0)return!0;const u=h(d);return l===u||l instanceof RegExp&&!!String(u).match(l)}(a,c,e)&&r.push(c)})}),n.length&&!(r.lengthi?0:i+t),(e=e>i?i:e)<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var r=Array(i);++nn===t);return Array.isArray(e)}set(t,e){if(bt(t))for(const[n,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=_s(t);t0(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!bt(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([n])=>n===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(t=!1){return this.isEmpty?[]:t?this._styleProcessor.getStyleNames(this._styles):this.getStylesEntries().map(([e])=>e)}clear(){this._styles={}}getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const n of e)t.push(...this._styleProcessor.getReducedForm(n,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const n=e.splice(0,e.length-1).join("."),i=Fo(this._styles,n);i&&!Object.keys(i).length&&this.remove(n)}}class o0{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,n){if(bt(e))vs(n,_s(t),e);else if(this._normalizers.has(t)){const i=this._normalizers.get(t),{path:r,value:s}=i(e);vs(n,r,s)}else vs(n,t,e)}getNormalized(t,e){if(!t)return hs({},e);if(e[t]!==void 0)return e[t];if(this._extractors.has(t)){const n=this._extractors.get(t);if(typeof n=="string")return Fo(e,n);const i=n(t,e);if(i)return i}return Fo(e,_s(t))}getReducedForm(t,e){const n=this.getNormalized(t,e);return n===void 0?[]:this._reducers.has(t)?this._reducers.get(t)(n):[[t,n]]}getStyleNames(t){const e=Array.from(this._consumables.keys()).filter(i=>{const r=this.getNormalized(i,t);return r&&typeof r=="object"?Object.keys(r).length:r}),n=new Set([...e,...Object.keys(t)]);return Array.from(n)}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const n of e)this._mapStyleNames(n,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function _s(o){return o.replace("-",".")}function vs(o,t,e){let n=e;bt(e)&&(n=hs({},Fo(o,t),e)),n0(o,t,n)}class he extends Nn{constructor(t,e,n,i){if(super(t),this._unsafeAttributesToRender=[],this._customProperties=new Map,this.name=e,this._attrs=function(r){const s=We(r);for(const[a,c]of s)c===null?s.delete(a):typeof c!="string"&&s.set(a,String(c));return s}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");Sl(this._classes,r),this._attrs.delete("class")}this._styles=new Cs(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if(t=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(t=="style"){const e=this._styles.toString();return e==""?void 0:e}return this._attrs.get(t)}hasAttribute(t){return t=="class"?this._classes.size>0:t=="style"?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof he))return!1;if(this===t)return!0;if(this.name!=t.name||this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,n]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==n)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(t){return this._styles.getStyleNames(t)}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Ne(...t);let n=this.parent;for(;n&&!n.is("documentFragment");){if(e.match(n))return n;n=n.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(t==""?"":` class="${t}"`)+(e?` style="${e}"`:"")+(n==""?"":` ${n}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const n=new this.constructor(this.document,this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._unsafeAttributesToRender=this._unsafeAttributesToRender,n}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new vt(r,s)]:(Gt(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new vt(r,a):a instanceof Ke?new vt(r,a.data):a))}(this.document,e);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(t,0,r),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n0&&(this._classes.clear(),!0):t=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of Et(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of Et(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),typeof t!="string"?this._styles.set(t):this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of Et(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Sl(o,t){const e=t.split(/\s+/);o.clear(),e.forEach(n=>o.add(n))}he.prototype.is=function(o,t){return t?t===this.name&&(o==="element"||o==="view:element"):o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Vo extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=i0}}function i0(){const o=[...this.getChildren()],t=o[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const e of o)if(!e.is("uiElement"))return null;return this.childCount}Vo.prototype.is=function(o,t){return t?t===this.name&&(o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class ji extends ft(Vo){constructor(t,e,n,i){super(t,e,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",r=>r&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}destroy(){this.stopListening()}}ji.prototype.is=function(o,t){return t?t===this.name&&(o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};const Tl=Symbol("rootName");class Ml extends ji{constructor(t,e){super(t,e),this.rootName="main"}get rootName(){return this.getCustomProperty(Tl)}set rootName(t){this._setCustomProperty(Tl,t)}set _name(t){this.name=t}}Ml.prototype.is=function(o,t){return t?t===this.name&&(o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"):o==="rootElement"||o==="view:rootElement"||o==="editableElement"||o==="view:editableElement"||o==="containerElement"||o==="view:containerElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Pn{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new _("view-tree-walker-no-start-position",null);if(t.direction&&t.direction!="forward"&&t.direction!="backward")throw new _("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this._position=V._createAt(t.startPosition):this._position=V._createAt(t.boundaries[t.direction=="backward"?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,n;do n=this.position,e=this.next();while(!e.done&&t(e.value));e.done||(this._position=n)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,n=t.parent;if(n.parent===null&&t.offset===n.childCount)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let i;if(n instanceof vt){if(t.isAtEnd)return this._position=V._createAfter(n),this._next();i=n.data[t.offset]}else i=n.getChild(t.offset);if(i instanceof he){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t=new V(i,0);return this._position=t,this._formatReturnValue("elementStart",i,e,t,1)}if(i instanceof vt){if(this.singleCharacters)return t=new V(i,0),this._position=t,this._next();let r,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,r=new Ke(i,0,s),t=V._createAfter(r)):(r=new Ke(i,0,i.data.length),t.offset++),this._position=t,this._formatReturnValue("text",r,e,t,s)}if(typeof i=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset;const s=new Ke(n,t.offset,r);return t.offset+=r,this._position=t,this._formatReturnValue("text",s,e,t,r)}return t=V._createAfter(n),this._position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,e,t)}_previous(){let t=this.position.clone();const e=this.position,n=t.parent;if(n.parent===null&&t.offset===0)return{done:!0,value:void 0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let i;if(n instanceof vt){if(t.isAtStart)return this._position=V._createBefore(n),this._previous();i=n.data[t.offset-1]}else i=n.getChild(t.offset-1);if(i instanceof he)return this.shallow?(t.offset--,this._position=t,this._formatReturnValue("elementStart",i,e,t,1)):(t=new V(i,i.childCount),this._position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,e,t));if(i instanceof vt){if(this.singleCharacters)return t=new V(i,i.data.length),this._position=t,this._previous();let r,s=i.data.length;if(i==this._boundaryStartParent){const a=this.boundaries.start.offset;r=new Ke(i,a,i.data.length-a),s=r.data.length,t=V._createBefore(r)}else r=new Ke(i,0,i.data.length),t.offset--;return this._position=t,this._formatReturnValue("text",r,e,t,s)}if(typeof i=="string"){let r;if(this.singleCharacters)r=1;else{const a=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=t.offset-a}t.offset-=r;const s=new Ke(n,t.offset,r);return this._position=t,this._formatReturnValue("text",s,e,t,r)}return t=V._createBefore(n),this._position=t,this._formatReturnValue("elementStart",n,e,t,1)}_formatReturnValue(t,e,n,i,r){return e instanceof Ke&&(e.offsetInText+e.data.length==e.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=V._createAfter(e.textNode):(i=V._createAfter(e.textNode),this._position=i)),e.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=V._createBefore(e.textNode):(i=V._createBefore(e.textNode),this._position=i))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:r}}}}class V extends Bn{constructor(t,e){super(),this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof ji);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=V._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const n=new Pn(e);return n.skip(t),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),n=t.getAncestors();let i=0;for(;e[i]==n[i]&&e[i];)i++;return i===0?null:e[i-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return this.compareWith(t)=="before"}isAfter(t){return this.compareWith(t)=="after"}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],n=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);const i=Mt(e,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return e[i]0?new this(n,i):new this(i,n)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(V._createBefore(t),e)}}function Fi(o){return!(!o.item.is("attributeElement")&&!o.item.is("uiElement"))}nt.prototype.is=function(o){return o==="range"||o==="view:range"};class Pe extends kt(Bn){constructor(...t){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",t.length&&this.setTo(...t)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake||this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel||this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=jt(this.getRanges());if(e!=jt(t.getRanges()))return!1;if(e==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let r of t.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...t){let[e,n,i]=t;if(typeof n=="object"&&(i=n,n=void 0),e===null)this._setRanges([]),this._setFakeOptions(i);else if(e instanceof Pe||e instanceof ys)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof nt)this._setRanges([e],i&&i.backward),this._setFakeOptions(i);else if(e instanceof V)this._setRanges([new nt(e)]),this._setFakeOptions(i);else if(e instanceof Nn){const r=!!i&&!!i.backward;let s;if(n===void 0)throw new _("view-selection-setto-required-second-parameter",this);s=n=="in"?nt._createIn(e):n=="on"?nt._createOn(e):new nt(V._createAt(e,n)),this._setRanges([s],r),this._setFakeOptions(i)}else{if(!Gt(e))throw new _("view-selection-setto-not-selectable",this);this._setRanges(e,i&&i.backward),this._setFakeOptions(i)}this.fire("change")}setFocus(t,e){if(this.anchor===null)throw new _("view-selection-setfocus-no-ranges",this);const n=V._createAt(t,e);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new nt(n,i),!0):this._addRange(new nt(i,n)),this.fire("change")}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const n of t)this._addRange(n);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof nt))throw new _("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new _("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new nt(t.start,t.end))}}Pe.prototype.is=function(o){return o==="selection"||o==="view:selection"};class ys extends kt(Bn){constructor(...t){super(),this._selection=new Pe,this._selection.delegate("change").to(this),t.length&&this._selection.setTo(...t)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}_setTo(...t){this._selection.setTo(...t)}_setFocus(t,e){this._selection.setFocus(t,e)}}ys.prototype.is=function(o){return o==="selection"||o=="documentSelection"||o=="view:selection"||o=="view:documentSelection"};class so extends H{constructor(t,e,n){super(t,e),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const xs=Symbol("bubbling contexts");function Es(o){return class extends o{fire(t,...e){try{const n=t instanceof H?t:new H(this,t),i=Ds(this);if(!i.size)return;if(Ho(n,"capturing",this),ao(i,"$capture",n,...e))return n.return;const r=n.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&!!Bl(i,s);let c=s||function(l){if(!l)return null;const d=l.start.parent,h=l.end.parent,u=d.getPath(),g=h.getPath();return u.length>g.length?d:h}(r);if(Ho(n,"atTarget",c),!a){if(ao(i,"$text",n,...e))return n.return;Ho(n,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(ao(i,"$root",n,...e))return n.return}else if(c.is("element")&&ao(i,c.name,n,...e))return n.return;if(ao(i,c,n,...e))return n.return;c=c.parent,Ho(n,"bubbling",c)}return Ho(n,"bubbling",this),ao(i,"$document",n,...e),n.return}catch(n){_.rethrowUnexpectedError(n,this)}}_addEventListener(t,e,n){const i=Et(n.context||"$document"),r=Ds(this);for(const s of i){let a=r.get(s);a||(a=new(kt()),r.set(s,a)),this.listenTo(a,t,e,n)}}_removeEventListener(t,e){const n=Ds(this);for(const i of n.values())this.stopListening(i,t,e)}}}{const o=Es(Object);["fire","_addEventListener","_removeEventListener"].forEach(t=>{Es[t]=o.prototype[t]})}function Ho(o,t,e){o instanceof so&&(o._eventPhase=t,o._currentTarget=e)}function ao(o,t,e,...n){const i=typeof t=="string"?o.get(t):Bl(o,t);return!!i&&(i.fire(e,...n),e.stop.called)}function Bl(o,t){for(const[e,n]of o)if(typeof e=="function"&&e(t))return n;return null}function Ds(o){return o[xs]||(o[xs]=new Map),o[xs]}class Vi extends Es(ft()){constructor(t){super(),this._postFixers=new Set,this.selection=new ys,this.roots=new Be({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.forEach(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do for(const n of this._postFixers)if(e=n(t),e)break;while(e)}}class On extends he{constructor(t,e,n,i){super(t,e,n,i),this._priority=10,this._id=null,this._clonesGroup=null,this.getFillerOffset=r0}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new _("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(t){return this.id!==null||t.id!==null?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t=!1){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function r0(){if(Is(this))return null;let o=this.parent;for(;o&&o.is("attributeElement");){if(Is(o)>1)return null;o=o.parent}return!o||Is(o)>1?null:this.childCount}function Is(o){return Array.from(o.getChildren()).filter(t=>!t.is("uiElement")).length}On.DEFAULT_PRIORITY=10,On.prototype.is=function(o,t){return t?t===this.name&&(o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"):o==="attributeElement"||o==="view:attributeElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ss extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=s0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-emptyelement-cannot-add",[this,e]);return 0}}function s0(){return null}Ss.prototype.is=function(o,t){return t?t===this.name&&(o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"):o==="emptyElement"||o==="view:emptyElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Hi extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=c0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-uielement-cannot-add",[this,e]);return 0}render(t,e){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const n of this.getAttributeKeys())e.setAttribute(n,this.getAttribute(n));return e}}function a0(o){o.document.on("arrowKey",(t,e)=>function(n,i,r){if(i.keyCode==ut.arrowright){const s=i.domTarget.ownerDocument.defaultView.getSelection(),a=s.rangeCount==1&&s.getRangeAt(0).collapsed;if(a||i.shiftKey){const c=s.focusNode,l=s.focusOffset,d=r.domPositionToView(c,l);if(d===null)return;let h=!1;const u=d.getLastMatchingPosition(g=>(g.item.is("uiElement")&&(h=!0),!(!g.item.is("uiElement")&&!g.item.is("attributeElement"))));if(h){const g=r.viewPositionToDom(u);a?s.collapse(g.parent,g.offset):s.extend(g.parent,g.offset)}}}}(0,e,o.domConverter),{priority:"low"})}function c0(){return null}Hi.prototype.is=function(o,t){return t?t===this.name&&(o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"):o==="uiElement"||o==="view:uiElement"||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ts extends he{constructor(t,e,n,i){super(t,e,n,i),this.getFillerOffset=l0}_insertChild(t,e){if(e&&(e instanceof Nn||Array.from(e).length>0))throw new _("view-rawelement-cannot-add",[this,e]);return 0}render(t,e){}}function l0(){return null}Ts.prototype.is=function(o,t){return t?t===this.name&&(o==="rawElement"||o==="view:rawElement"||o==="element"||o==="view:element"):o==="rawElement"||o==="view:rawElement"||o===this.name||o==="view:"+this.name||o==="element"||o==="view:element"||o==="node"||o==="view:node"};class Ln extends kt(Bn){constructor(t,e){super(),this._children=[],this._customProperties=new Map,this.document=t,e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let n=0;const i=function(r,s){return typeof s=="string"?[new vt(r,s)]:(Gt(s)||(s=[s]),Array.from(s).map(a=>typeof a=="string"?new vt(r,a):a instanceof Ke?new vt(r,a.data):a))}(this.document,e);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(t,0,r),t++,n++;return n}_removeChildren(t,e=1){this._fireChange("children",this);for(let n=t;n{const c=s[s.length-1],l=!a.is("uiElement");return c&&c.breakAttributes==l?c.nodes.push(a):s.push({breakAttributes:l,nodes:[a]}),s},[]);let i=null,r=t;for(const{nodes:s,breakAttributes:a}of n){const c=this._insertNodes(r,s,a);i||(i=c.start),r=c.end}return i?new nt(i,r):new nt(t)}remove(t){const e=t instanceof nt?t:nt._createOn(t);if(Uo(e,this.document),e.isCollapsed)return new Ln(this.document);const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,s=i.offset-n.offset,a=r._removeChildren(n.offset,s);for(const l of a)this._removeFromClonedElementsGroup(l);const c=this.mergeAttributes(n);return e.start=c,e.end=c.clone(),new Ln(this.document,a)}clear(t,e){Uo(t,this.document);const n=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const r=i.item;let s;if(r.is("element")&&e.isSimilar(r))s=nt._createOn(r);else if(!i.nextPosition.isAfter(t.start)&&r.is("$textProxy")){const a=r.getAncestors().find(c=>c.is("element")&&e.isSimilar(c));a&&(s=nt._createIn(a))}s&&(s.end.isAfter(t.end)&&(s.end=t.end),s.start.isBefore(t.start)&&(s.start=t.start),this.remove(s))}}move(t,e){let n;if(e.isAfter(t.end)){const i=(e=this._breakAttributes(e,!0)).parent,r=i.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=i.childCount-r}else n=this.remove(t);return this.insert(e,n)}wrap(t,e){if(!(e instanceof On))throw new _("view-writer-wrap-invalid-attribute",this.document);if(Uo(t,this.document),t.isCollapsed){let i=t.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(s=>!s.is("uiElement")))&&(i=i.getLastMatchingPosition(s=>s.item.is("uiElement"))),i=this._wrapPosition(i,e);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(t.start)&&this.setSelection(i),new nt(i)}return this._wrapRange(t,e);var n}unwrap(t,e){if(!(e instanceof On))throw new _("view-writer-unwrap-invalid-attribute",this.document);if(Uo(t,this.document),t.isCollapsed)return t;const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,s=this._unwrapChildren(r,n.offset,i.offset,e),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const c=this.mergeAttributes(s.end);return new nt(a,c)}rename(t,e){const n=new Vo(this.document,t,e.getAttributes());return this.insert(V._createAfter(e),n),this.move(nt._createIn(e),V._createAt(n,0)),this.remove(nt._createOn(e)),n}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}createSlot(t="children"){if(!this._slotFactory)throw new _("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,t)}_registerSlotFactory(t){this._slotFactory=t}_clearSlotFactory(){this._slotFactory=null}_insertNodes(t,e,n){let i,r;if(i=n?Ms(t):t.parent.is("$text")?t.parent.parent:t.parent,!i)throw new _("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(t,!0):t.parent.is("$text")?Bs(t):t;const s=i._insertChild(r.offset,e);for(const d of e)this._addToClonedElementsGroup(d);const a=r.getShiftedBy(s),c=this.mergeAttributes(r);c.isEqual(r)||a.offset--;const l=this.mergeAttributes(a);return new nt(c,l)}_wrapChildren(t,e,n,i){let r=e;const s=[];for(;r!1,t.parent._insertChild(t.offset,n);const i=new nt(t,t.getShiftedBy(1));this.wrap(i,e);const r=new V(n.parent,n.index);n._remove();const s=r.nodeBefore,a=r.nodeAfter;return s instanceof vt&&a instanceof vt?Ol(s,a):Pl(r)}_wrapAttributeElement(t,e){if(!zl(t,e)||t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if(n!=="class"&&n!=="style"&&e.hasAttribute(n)&&e.getAttribute(n)!==t.getAttribute(n))return!1;for(const n of t.getStyleNames())if(e.hasStyle(n)&&e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())n!=="class"&&n!=="style"&&(e.hasAttribute(n)||this.setAttribute(n,t.getAttribute(n),e));for(const n of t.getStyleNames())e.hasStyle(n)||this.setStyle(n,t.getStyle(n),e);for(const n of t.getClassNames())e.hasClass(n)||this.addClass(n,e);return!0}_unwrapAttributeElement(t,e){if(!zl(t,e)||t.name!==e.name||t.priority!==e.priority)return!1;for(const n of t.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!e.hasAttribute(n)||e.getAttribute(n)!==t.getAttribute(n)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const n of t.getStyleNames())if(!e.hasStyle(n)||e.getStyle(n)!==t.getStyle(n))return!1;for(const n of t.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const n=t.start,i=t.end;if(Uo(t,this.document),t.isCollapsed){const c=this._breakAttributes(t.start,e);return new nt(c,c)}const r=this._breakAttributes(i,e),s=r.parent.childCount,a=this._breakAttributes(n,e);return r.offset+=r.parent.childCount-s,new nt(a,r)}_breakAttributes(t,e=!1){const n=t.offset,i=t.parent;if(t.parent.is("emptyElement"))throw new _("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new _("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new _("view-writer-cannot-break-raw-element",this.document);if(!e&&i.is("$text")&&Ns(i.parent)||Ns(i))return t.clone();if(i.is("$text"))return this._breakAttributes(Bs(t),e);if(n==i.childCount){const r=new V(i.parent,i.index+1);return this._breakAttributes(r,e)}if(n===0){const r=new V(i.parent,i.index);return this._breakAttributes(r,e)}{const r=i.index+1,s=i._clone();i.parent._insertChild(r,s),this._addToClonedElementsGroup(s);const a=i.childCount-n,c=i._removeChildren(n,a);s._appendChild(c);const l=new V(i.parent,r);return this._breakAttributes(l,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const i of t.getChildren())this._addToClonedElementsGroup(i);const e=t.id;if(!e)return;let n=this._cloneGroups.get(e);n||(n=new Set,this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const i of t.getChildren())this._removeFromClonedElementsGroup(i);const e=t.id;if(!e)return;const n=this._cloneGroups.get(e);n&&n.delete(t)}}function Ms(o){let t=o.parent;for(;!Ns(t);){if(!t)return;t=t.parent}return t}function d0(o,t){return o.priorityt.priority)&&o.getIdentity()e instanceof n))throw new _("view-writer-insert-invalid-node-type",t);e.is("$text")||Ll(e.getChildren(),t)}}function Ns(o){return o&&(o.is("containerElement")||o.is("documentFragment"))}function Uo(o,t){const e=Ms(o.start),n=Ms(o.end);if(!e||!n||e!==n)throw new _("view-writer-invalid-range-container",t)}function zl(o,t){return o.id===null&&t.id===null}const Rl=o=>o.createTextNode(" "),jl=o=>{const t=o.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},Fl=o=>{const t=o.createElement("br");return t.dataset.ckeFiller="true",t},Oe=7,qo="⁠".repeat(Oe);function ue(o){return typeof o=="string"?o.substr(0,Oe)===qo:Ft(o)&&o.data.substr(0,Oe)===qo}function Go(o){return o.data.length==Oe&&ue(o)}function Vl(o){const t=typeof o=="string"?o:o.data;return ue(o)?t.slice(Oe):t}function u0(o,t){if(t.keyCode==ut.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(e.rangeCount==1&&e.getRangeAt(0).collapsed){const n=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;ue(n)&&i<=Oe&&e.collapse(n,0)}}}var Hl=P(8264),g0={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Hl.A,g0),Hl.A.locals;class p0 extends ft(){constructor(t,e){super(),this.domDocuments=new Set,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this._inlineFiller=null,this._fakeSelectionContainer=null,this.domConverter=t,this.selection=e,this.set("isFocused",!1),this.set("isSelecting",!1),f.isBlink&&!f.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this.set("isComposing",!1),this.on("change:isComposing",()=>{this.isComposing||this.render()})}markToSync(t,e){if(t==="text")this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if(t==="attributes")this.markedAttributes.add(e);else{if(t!=="children")throw new _("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){if(this.isComposing&&!f.isAndroid)return;let t=null;const e=!(f.isBlink&&!f.isAndroid)||!this.isSelecting;for(const n of this.markedChildren)this._updateChildrenMappings(n);e?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(t=this.domConverter.domPositionToView(this._inlineFiller),t&&t.parent.is("$text")&&(t=V._createBefore(t.parent)));for(const n of this.markedAttributes)this._updateAttrs(n);for(const n of this.markedChildren)this._updateChildren(n,{inlineFillerPosition:t});for(const n of this.markedTexts)!this.markedChildren.has(n.parent)&&this.domConverter.mapViewToDom(n.parent)&&this._updateText(n,{inlineFillerPosition:t});if(e)if(t){const n=this.domConverter.viewPositionToDom(t),i=n.parent.ownerDocument;ue(n.parent)?this._inlineFiller=n.parent:this._inlineFiller=Ul(i,n.parent,n.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.childNodes),i=Array.from(this.domConverter.viewChildrenToDom(t,{withChildren:!1})),r=this._diffNodeLists(n,i),s=this._findUpdateActions(r,n,i,m0);if(s.indexOf("update")!==-1){const a={equal:0,insert:0,delete:0};for(const c of s)if(c==="update"){const l=a.equal+a.insert,d=a.equal+a.delete,h=t.getChild(l);!h||h.is("uiElement")||h.is("rawElement")||this._updateElementMappings(h,n[d]),nl(i[l]),a.equal++}else a[c]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?V._createBefore(t.parent):t}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Ft(e.parent)&&ue(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!ue(t))throw new _("view-renderer-filler-was-lost",this);Go(t)?t.remove():t.data=t.data.substr(Oe),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root)||!e.is("element")||!function(s){if(s.getAttribute("contenteditable")=="false")return!1;const a=s.findAncestor(c=>c.hasAttribute("contenteditable"));return!a||a.getAttribute("contenteditable")=="true"}(e)||n===e.getFillerOffset())return!1;const i=t.nodeBefore,r=t.nodeAfter;return!(i instanceof vt||r instanceof vt)&&(!f.isAndroid||!i&&!r)}_updateText(t,e){const n=this.domConverter.findCorrespondingDomText(t);let i=this.domConverter.viewToDom(t).data;const r=e.inlineFillerPosition;r&&r.parent==t.parent&&r.offset==t.index&&(i=qo+i),ql(n,i)}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const n=Array.from(e.attributes).map(r=>r.name),i=t.getAttributeKeys();for(const r of i)this.domConverter.setDomElementAttribute(e,r,t.getAttribute(r),t);for(const r of n)t.hasAttribute(r)||this.domConverter.removeDomElementAttribute(e,r)}_updateChildren(t,e){const n=this.domConverter.mapViewToDom(t);if(!n)return;if(f.isAndroid){let h=null;for(const u of Array.from(n.childNodes)){if(h&&Ft(h)&&Ft(u)){n.normalize();break}h=u}}const i=e.inlineFillerPosition,r=n.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(t,{bind:!0}));i&&i.parent===t&&Ul(n.ownerDocument,s,i.offset);const a=this._diffNodeLists(r,s),c=this._findUpdateActions(a,r,s,f0);let l=0;const d=new Set;for(const h of c)h==="delete"?(d.add(r[l]),nl(r[l])):h!=="equal"&&h!=="update"||l++;l=0;for(const h of c)h==="insert"?(Jc(n,l,s[l]),l++):h==="update"?(ql(r[l],s[l].data),l++):h==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const h of d)h.parentNode||this.domConverter.unbindDomElement(h)}_diffNodeLists(t,e){return t=function(n,i){const r=Array.from(n);return r.length==0||!i||r[r.length-1]==i&&r.pop(),r}(t,this._fakeSelectionContainer),O(t,e,k0.bind(null,this.domConverter))}_findUpdateActions(t,e,n,i){if(t.indexOf("insert")===-1||t.indexOf("delete")===-1)return t;let r=[],s=[],a=[];const c={equal:0,insert:0,delete:0};for(const l of t)l==="insert"?a.push(n[c.equal+c.insert]):l==="delete"?s.push(e[c.equal+c.delete]):(r=r.concat(O(s,a,i).map(d=>d==="equal"?"update":d)),r.push("equal"),s=[],a=[]),c[l]++;return r.concat(O(s,a,i).map(l=>l==="equal"?"update":l))}_markDescendantTextToSync(t){if(t){if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}}_updateSelection(){if(f.isBlink&&!f.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(t)):this.isComposing&&f.isAndroid||this._updateDomSelection(t))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(s){const a=s.createElement("div");return a.className="ck-fake-selection-container",Object.assign(a.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),a.textContent=" ",a}(e));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(t))return;n.parentElement&&n.parentElement==t||t.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=e.getSelection(),r=e.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);e.setBaseAndExtent(n.parent,n.offset,i.parent,i.offset),f.isGecko&&function(r,s){const a=r.parent;if(a.nodeType!=Node.ELEMENT_NODE||r.offset!=a.childNodes.length-1)return;const c=a.childNodes[r.offset];c&&c.tagName=="BR"&&s.addRange(s.getRangeAt(0))}(i,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,n=t.ownerDocument.getSelection();return!e||e.parentElement!==t||n.anchorNode!==e&&!e.contains(n.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const t of this.domDocuments){const e=t.getSelection();if(e.rangeCount){const n=t.activeElement,i=this.domConverter.mapDomToView(n);n&&i&&e.removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Ul(o,t,e){const n=t instanceof Array?t:t.childNodes,i=n[e];if(Ft(i))return i.data=qo+i.data,i;{const r=o.createTextNode(qo);return Array.isArray(t)?n.splice(e,0,r):Jc(t,e,r),r}}function m0(o,t){return un(o)&&un(t)&&!Ft(o)&&!Ft(t)&&!Ro(o)&&!Ro(t)&&o.tagName.toLowerCase()===t.tagName.toLowerCase()}function f0(o,t){return un(o)&&un(t)&&Ft(o)&&Ft(t)}function k0(o,t,e){return t===e||(Ft(t)&&Ft(e)?t.data===e.data:!(!o.isBlockFiller(t)||!o.isBlockFiller(e)))}function ql(o,t){const e=o.data;if(e==t)return;const n=I(e,t);for(const i of n)i.type==="insert"?o.insertData(i.index,i.values.join("")):o.deleteData(i.index,i.howMany)}const b0=Fl($.document),w0=Rl($.document),A0=jl($.document),Ui="data-ck-unsafe-attribute-",Gl="data-ck-unsafe-element";class qi{constructor(t,{blockFillerMode:e,renderingMode:n="editing"}={}){this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Ne,this._inlineObjectElementMatcher=new Ne,this._elementsWithTemporaryCustomProperties=new Set,this.document=t,this.renderingMode=n,this.blockFillerMode=e||(n==="editing"?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?$.document:$.document.implementation.createHTMLDocument("")}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Pe(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const n of Array.from(t.children))this.unbindDomElement(n)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e,n){return this.renderingMode==="data"||!(t=t.toLowerCase()).startsWith("on")&&(t!=="srcdoc"||!e.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&(n==="img"&&(t==="src"||t==="srcset")||n==="source"&&t==="srcset"||!e.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(t,e){if(this.renderingMode==="data")return void(t.innerHTML=e);const n=new DOMParser().parseFromString(e,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);const s=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),a=[];let c;for(;c=s.nextNode();)a.push(c);for(const l of a){for(const h of l.getAttributeNames())this.setDomElementAttribute(l,h,l.getAttribute(h));const d=l.tagName.toLowerCase();this._shouldRenameElement(d)&&($l(d),l.replaceWith(this._createReplacementDomElement(d,l)))}for(;t.firstChild;)t.firstChild.remove();t.append(i)}viewToDom(t,e={}){if(t.is("$text")){const n=this._processDataFromViewText(t);return this._domDocument.createTextNode(n)}{const n=t;if(this.mapViewToDom(n)){if(!n.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(n);this._elementsWithTemporaryCustomProperties.add(n)}let i;if(n.is("documentFragment"))i=this._domDocument.createDocumentFragment(),e.bind&&this.bindDocumentFragments(i,n);else{if(n.is("uiElement"))return i=n.name==="$comment"?this._domDocument.createComment(n.getCustomProperty("$rawContent")):n.render(this._domDocument,this),e.bind&&this.bindElements(i,n),i;this._shouldRenameElement(n.name)?($l(n.name),i=this._createReplacementDomElement(n.name)):i=n.hasAttribute("xmlns")?this._domDocument.createElementNS(n.getAttribute("xmlns"),n.name):this._domDocument.createElement(n.name),n.is("rawElement")&&n.render(i,this),e.bind&&this.bindElements(i,n);for(const r of n.getAttributeKeys())this.setDomElementAttribute(i,r,n.getAttribute(r),n)}if(e.withChildren!==!1)for(const r of this.viewChildrenToDom(n,e))i.appendChild(r);return i}}setDomElementAttribute(t,e,n,i){const r=this.shouldRenderAttribute(e,n,t.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(e);r||Q("domconverter-unsafe-attribute-detected",{domElement:t,key:e,value:n}),function(s){try{$.document.createAttribute(s)}catch{return!1}return!0}(e)?(t.hasAttribute(e)&&!r?t.removeAttribute(e):t.hasAttribute(Ui+e)&&r&&t.removeAttribute(Ui+e),t.setAttribute(r?e:Ui+e,n)):Q("domconverter-invalid-attribute-detected",{domElement:t,key:e,value:n})}removeDomElementAttribute(t,e){e!=Gl&&(t.removeAttribute(e),t.removeAttribute(Ui+e))}*viewChildrenToDom(t,e={}){const n=t.getFillerOffset&&t.getFillerOffset();let i=0;for(const r of t.getChildren()){n===i&&(yield this._getBlockFiller());const s=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!Wt(r.getAttributes());s&&this.renderingMode=="data"?yield*this.viewChildrenToDom(r,e):(s&&Q("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,e)),i++}n===i&&(yield this._getBlockFiller())}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),i=this._domDocument.createRange();return i.setStart(e.parent,e.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const n=this.findCorrespondingDomText(e);if(!n)return null;let i=t.offset;return ue(n)&&(i+=Oe),{parent:n,offset:i}}{let n,i,r;if(t.offset===0){if(n=this.mapViewToDom(e),!n)return null;r=n.childNodes[0]}else{const s=t.nodeBefore;if(i=s.is("$text")?this.findCorrespondingDomText(s):this.mapViewToDom(s),!i)return null;n=i.parentNode,r=i.nextSibling}return Ft(r)&&ue(r)?{parent:r,offset:Oe}:{parent:n,offset:i?Ni(i)+1:0}}}domToView(t,e={}){const n=[],i=this._domToView(t,e,n),r=i.next().value;return r?(i.next(),this._processDomInlineNodes(null,n,e),r.is("$text")&&r.data.length==0?null:r):null}*domChildrenToView(t,e={},n=[]){for(let i=0;i{const{scrollLeft:a,scrollTop:c}=s;r.push([a,c])}),e.focus(),Wl(e,s=>{const[a,c]=r.shift();s.scrollLeft=a,s.scrollTop=c}),$.window.scrollTo(n,i)}}_clearDomSelection(){const t=this.mapViewToDom(this.document.selection.editableElement);if(!t)return;const e=t.ownerDocument.defaultView.getSelection(),n=this.domSelectionToView(e);n&&n.rangeCount>0&&e.removeAllRanges()}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(t){return this.blockFillerMode=="br"?t.isEqualNode(b0):!(t.tagName!=="BR"||!Kl(t,this.blockElements)||t.parentNode.childNodes.length!==1)||t.isEqualNode(A0)||function(e,n){return e.isEqualNode(w0)&&Kl(e,n)&&e.parentNode.childNodes.length===1}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=this._domDocument.createRange();try{e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset)}catch{return!1}const n=e.collapsed;return e.detach(),n}getHostViewElement(t){const e=function(n){const i=[];let r=n;for(;r&&r.nodeType!=Node.DOCUMENT_NODE;)i.unshift(r),r=r.parentNode;return i}(t);for(e.pop();e.length;){const n=e.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}registerInlineObjectMatcher(t){this._inlineObjectElementMatcher.add(t)}_clearTemporaryCustomProperties(){for(const t of this._elementsWithTemporaryCustomProperties)t._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return Rl(this._domDocument);case"markedNbsp":return jl(this._domDocument);case"br":return Fl(this._domDocument)}}_isDomSelectionPositionCorrect(t,e){if(Ft(t)&&ue(t)&&e0?e[r-1]:null,d=r+1this.preElements.includes(n.name)))return e;if(e.charAt(0)==" "){const n=this._getTouchingInlineViewNode(t,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(e=" "+e.substr(1))}if(e.charAt(e.length-1)==" "){const n=this._getTouchingInlineViewNode(t,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";e.charAt(e.length-2)!=" "&&n&&!i||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const e=this._processDataFromViewText(t);return e.charAt(e.length-1)==" "}_getTouchingInlineViewNode(t,e){const n=new Pn({startPosition:e?V._createAfter(t):V._createBefore(t),direction:e?"forward":"backward"});for(const i of n){if(i.item.is("element","br"))return null;if(this._isInlineObjectElement(i.item))return i.item;if(i.item.is("containerElement"))return null;if(i.item.is("$textProxy"))return i.item}return null}_isBlockDomElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isBlockViewElement(t){return t.is("element")&&this.blockElements.includes(t.name)}_isInlineObjectElement(t){return!!t.is("element")&&(t.name=="br"||this.inlineObjectElements.includes(t.name)||!!this._inlineObjectElementMatcher.match(t))}_createViewElement(t,e){if(Ro(t))return new Hi(this.document,"$comment");const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new he(this.document,n)}_isViewElementWithRawContent(t,e){return e.withChildren!==!1&&t.is("element")&&!!this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){const e=t.toLowerCase();return this.renderingMode==="editing"&&this.unsafeElements.includes(e)}_createReplacementDomElement(t,e){const n=this._domDocument.createElement("span");if(n.setAttribute(Gl,t),e){for(;e.firstChild;)n.appendChild(e.firstChild);for(const i of e.getAttributeNames())n.setAttribute(i,e.getAttribute(i))}return n}}function C0(o,t){return o.getAncestors().some(e=>e.is("element")&&t.includes(e.name))}function Wl(o,t){let e=o;for(;e;)t(e),e=e.parentElement}function Kl(o,t){const e=o.parentNode;return!!e&&!!e.tagName&&t.includes(e.tagName.toLowerCase())}function $l(o){o==="script"&&Q("domconverter-unsafe-script-element-detected"),o==="style"&&Q("domconverter-unsafe-style-element-detected")}class $e extends Ce(){constructor(t){super(),this._isEnabled=!1,this.view=t,this.document=t.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&t.nodeType===3&&(t=t.parentNode),!(!t||t.nodeType!==1)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}const Yl=hl(function(o,t){to(t,no(t),o)});class co{constructor(t,e,n){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,Yl(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class pn extends $e{constructor(){super(...arguments),this.useCapture=!1}observe(t){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}stopObserving(t){this.stopListening(t)}fire(t,e,n){this.isEnabled&&this.document.fire(t,new co(this.view,e,n))}}class _0 extends pn{constructor(){super(...arguments),this.domEventType=["keydown","keyup"]}onDomEvent(t){const e={keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return io(this)}};this.fire(t.type,t,e)}}const Ps=function(){return Me.Date.now()};var v0=/\s/;const y0=function(o){for(var t=o.length;t--&&v0.test(o.charAt(t)););return t};var x0=/^\s+/;const E0=function(o){return o&&o.slice(0,y0(o)+1).replace(x0,"")};var D0=/^[-+]0x[0-9a-f]+$/i,I0=/^0b[01]+$/i,S0=/^0o[0-7]+$/i,T0=parseInt;const Ql=function(o){if(typeof o=="number")return o;if(zi(o))return NaN;if(bt(o)){var t=typeof o.valueOf=="function"?o.valueOf():o;o=bt(t)?t+"":t}if(typeof o!="string")return o===0?o:+o;o=E0(o);var e=I0.test(o);return e||S0.test(o)?T0(o.slice(2),e?2:8):D0.test(o)?NaN:+o};var M0=Math.max,B0=Math.min;const Wo=function(o,t,e){var n,i,r,s,a,c,l=0,d=!1,h=!1,u=!0;if(typeof o!="function")throw new TypeError("Expected a function");function g(E){var M=n,z=i;return n=i=void 0,l=E,s=o.apply(z,M)}function p(E){var M=E-c;return c===void 0||M>=t||M<0||h&&E-l>=r}function k(){var E=Ps();if(p(E))return b(E);a=setTimeout(k,function(M){var z=t-(M-c);return h?B0(z,r-(M-l)):z}(E))}function b(E){return a=void 0,u&&n?g(E):(n=i=void 0,s)}function A(){var E=Ps(),M=p(E);if(n=arguments,i=this,c=E,M){if(a===void 0)return function(z){return l=z,a=setTimeout(k,t),d?g(z):s}(c);if(h)return clearTimeout(a),a=setTimeout(k,t),g(c)}return a===void 0&&(a=setTimeout(k,t)),s}return t=Ql(t)||0,bt(e)&&(d=!!e.leading,r=(h="maxWait"in e)?M0(Ql(e.maxWait)||0,t):r,u="trailing"in e?!!e.trailing:u),A.cancel=function(){a!==void 0&&clearTimeout(a),l=0,n=c=i=a=void 0},A.flush=function(){return a===void 0?s:b(Ps())},A};class N0 extends $e{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Wo(e=>{this.document.fire("selectionChangeDone",e)},200)}observe(){const t=this.document;t.on("arrowKey",(e,n)=>{t.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),t.on("arrowKey",(e,n)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,n=new Pe(e.getRanges(),{backward:e.isBackward,fake:!1});t!=ut.arrowleft&&t!=ut.arrowup||n.setTo(n.getFirstPosition()),t!=ut.arrowright&&t!=ut.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}const P0=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this},O0=function(o){return this.__data__.has(o)};function Gi(o){var t=-1,e=o==null?0:o.length;for(this.__data__=new vi;++ta))return!1;var l=r.get(o),d=r.get(t);if(l&&d)return l==t&&d==o;var h=-1,u=!0,g=2&e?new L0:void 0;for(r.set(o,t),r.set(t,o);++h{this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this.flush(),t.change(()=>{})},50)}),e.on("blur",(n,i)=>{const r=e.selection.editableElement;r!==null&&r!==i.target||(e.isFocused=!1,this._isFocusChanging=!1,t.change(()=>{}))})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class K0 extends $e{constructor(t){super(t),this.mutationObserver=t.getObserver(nd),this.focusObserver=t.getObserver($i),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Wo(e=>{this.document.fire("selectionChangeDone",e)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=Wo(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument,n=()=>{this.document.isSelecting&&(this._handleSelectionChange(null,e),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(t,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(t,"keydown",n,{priority:"highest",useCapture:!0}),this.listenTo(t,"keyup",n,{priority:"highest",useCapture:!0}),this._documents.has(e)||(this.listenTo(e,"mouseup",n,{priority:"highest",useCapture:!0}),this.listenTo(e,"selectionchange",(i,r)=>{this.document.isComposing&&!f.isAndroid||(this._handleSelectionChange(r,e),this._documentIsSelectingInactivityTimeoutDebounced())}),this._documents.add(e))}stopObserving(t){this.stopListening(t)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(t,e){if(!this.isEnabled)return;const n=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(n))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.selection.isSimilar(i))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class $0 extends pn{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0},{priority:"low"}),e.on("compositionend",()=>{e.isComposing=!1},{priority:"low"})}onDomEvent(t){this.fire(t.type,t,{data:t.data})}}class od{constructor(t,e={}){this._files=e.cacheFiles?id(t):null,this._native=t}get files(){return this._files||(this._files=id(this._native)),this._files}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}setDragImage(t,e,n){this._native.setDragImage(t,e,n)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function id(o){const t=Array.from(o.files||[]),e=Array.from(o.items||[]);return t.length?t:e.filter(n=>n.kind==="file").map(n=>n.getAsFile())}class Y0 extends pn{constructor(){super(...arguments),this.domEventType="beforeinput"}onDomEvent(t){const e=t.getTargetRanges(),n=this.view,i=n.document;let r=null,s=null,a=[];if(t.dataTransfer&&(r=new od(t.dataTransfer)),t.data!==null?s=t.data:r&&(s=r.getData("text/plain")),i.selection.isFake)a=Array.from(i.selection.getRanges());else if(e.length)a=e.map(c=>{const l=n.domConverter.domPositionToView(c.startContainer,c.startOffset),d=n.domConverter.domPositionToView(c.endContainer,c.endOffset);return l?n.createRange(l,d):d?n.createRange(d):void 0}).filter(c=>!!c);else if(f.isAndroid){const c=t.target.ownerDocument.defaultView.getSelection();a=Array.from(n.domConverter.domSelectionToView(c).getRanges())}if(f.isAndroid&&t.inputType=="insertCompositionText"&&s&&s.endsWith(` `))this.fire(t.type,t,{inputType:"insertParagraph",targetRanges:[n.createRange(a[0].end)]});else if(t.inputType=="insertText"&&s&&s.includes(` -`)){const c=s.split(/\n{1,2}/g);let l=a;for(let d=0;d{if(this.isEnabled&&((i=n.keyCode)==ut.arrowright||i==ut.arrowleft||i==ut.arrowup||i==ut.arrowdown)){const r=new so(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&e.stop()}var i})}observe(){}stopObserving(){}}class J0 extends $e{constructor(t){super(t);const e=this.document;e.on("keydown",(n,i)=>{if(!this.isEnabled||i.keyCode!=ut.tab||i.ctrlKey)return;const r=new so(e,"tab",e.selection.getFirstRange());e.fire(r,i),r.stop.called&&n.stop()})}observe(){}stopObserving(){}}const mn=function(o){return es(o,5)};class X0 extends ft(){constructor(t){super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new Vi(t),this.domConverter=new qi(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new m0(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Bl(this.document),this.addObserver(ed),this.addObserver($i),this.addObserver($0),this.addObserver(v0),this.addObserver(P0),this.addObserver(Y0),this.addObserver(Z0),this.addObserver(Q0),this.addObserver(J0),this.document.on("arrowKey",g0,{priority:"low"}),c0(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),f.isiOS&&this.listenTo(this.document,"blur",(e,n)=>{this.domConverter.mapDomToView(n.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const i={};for(const{name:s,value:a}of Array.from(t.attributes))i[s]=a,s==="class"?this._writer.addClass(a.split(" "),n):this._writer.setAttribute(s,a,n);this._initialDomRootAttributes.set(t,i);const r=()=>{this._writer.setAttribute("contenteditable",(!n.isReadOnly).toString(),n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(s,a)=>this._renderer.markToSync("children",a)),n.on("change:attributes",(s,a)=>this._renderer.markToSync("attributes",a)),n.on("change:text",(s,a)=>this._renderer.markToSync("text",a)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:i})=>e.removeAttribute(i));const n=this._initialDomRootAttributes.get(e);for(const i in n)e.setAttribute(i,n[i]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e);for(const i of this._observers.values())i.stopObserving(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[n,i]of this.domRoots)e.observe(i,n);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection({alignToTop:t,forceScroll:e,viewportOffset:n=20,ancestorOffset:i=20}={}){const r=this.document.selection.getFirstRange();if(!r)return;const s=mn({alignToTop:t,forceScroll:e,viewportOffset:n,ancestorOffset:i});typeof n=="number"&&(n={top:n,bottom:n,left:n,right:n});const a={target:this.domConverter.viewRangeToDom(r),viewportOffset:n,ancestorOffset:i,alignToTop:t,forceScroll:e};this.fire("scrollToTheSelection",a,s),function({target:c,viewportOffset:l=0,ancestorOffset:d=0,alignToTop:h,forceScroll:u}){const g=as(c);let p=g,k=null;for(l=function(b){return typeof b=="number"?{top:b,bottom:b,left:b,right:b}:b}(l);p;){let b;b=gw(p==g?c:k),uw({parent:b,getRect:()=>sl(c,p),alignToTop:h,ancestorOffset:d,forceScroll:u});const A=sl(c,p);if(hw({window:p,rect:A,viewportOffset:l,alignToTop:h,forceScroll:u}),p.parent!=p){if(k=p.frameElement,p=p.parent,!k)return}else p=null}}(a)}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new _("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(e){_.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver($i).flush(),this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}_disableRendering(t){this._renderingDisabled=t,t==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class fn{is(){throw new Error("is() method is abstract")}}class zn extends fn{constructor(t){super(),this.parent=null,this._attrs=We(t)}get document(){return null}get index(){let t;if(!this.parent)return null;if((t=this.parent.getChildIndex(this))===null)throw new _("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if((t=this.parent.getChildStartOffset(this))===null)throw new _("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return t!==null&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return t!==null&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.parent!==null&&this.root.isAttached()}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(t){if(this==t||this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=Mt(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i](e[n[0]]=n[1],e),{})),t}_clone(t){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=We(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}zn.prototype.is=function(o){return o==="node"||o==="model:node"};class Ko{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return e==-1?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return e===null?null:this._nodes.slice(0,e).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new _("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&t1e4)return n.slice(0,r).concat(i).concat(n.slice(r+s,n.length));{const a=Array.from(n);return a.splice(r,s,...i),a}}(this._nodes,Array.from(e),t,0)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class yt extends zn{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new yt(this.data,this.getAttributes())}static fromJSON(t){return new yt(t.data,t.attributes)}}yt.prototype.is=function(o){return o==="$text"||o==="model:$text"||o==="text"||o==="model:text"||o==="node"||o==="model:node"};class Le extends fn{constructor(t,e,n){if(super(),this.textNode=t,e<0||e>t.offsetSize)throw new _("model-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.offsetSize)throw new _("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}Le.prototype.is=function(o){return o==="$textProxy"||o==="model:$textProxy"||o==="textProxy"||o==="model:textProxy"};class Ct extends zn{constructor(t,e,n){super(e),this._children=new Ko,this.name=t,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}findAncestor(t,e={}){let n=e.includeSelf?this:this.parent;for(;n;){if(n.name===t)return n;n=n.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(n=>n._clone(!0)):void 0;return new Ct(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(i){return typeof i=="string"?[new yt(i)]:(Gt(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new yt(r):r instanceof Le?new yt(r.data,r.getAttributes()):r))}(e);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}static fromJSON(t){let e;if(t.children){e=[];for(const n of t.children)n.name?e.push(Ct.fromJSON(n)):e.push(yt.fromJSON(n))}return new Ct(t.name,t.attributes,e)}}Ct.prototype.is=function(o,t){return t?t===this.name&&(o==="element"||o==="model:element"):o==="element"||o==="model:element"||o==="node"||o==="model:node"};class Xe{constructor(t){if(!t||!t.boundaries&&!t.startPosition)throw new _("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if(e!="forward"&&e!="backward")throw new _("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this._position=t.startPosition.clone():this._position=L._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,n,i,r;do i=this.position,r=this._visitedParent,{done:e,value:n}=this.next();while(!e&&t(n));e||(this._position=i,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(n.parent===null&&e.offset===n.maxOffset)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const i=$o(e,n),r=i||id(e,n,i);if(r instanceof Ct){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e.path.push(0),this._visitedParent=r;return this._position=e,Rn("elementStart",r,t,e,1)}if(r instanceof yt){let s;if(this.singleCharacters)s=1;else{let l=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetd&&(d=this.boundaries.start.offset),a=e.offset-d}const c=e.offset-s.startOffset,l=new Le(s,c-a,a);return e.offset-=a,this._position=e,Rn("text",l,t,e,a)}return e.path.pop(),this._position=e,this._visitedParent=n.parent,Rn("elementStart",n,t,e,1)}}function Rn(o,t,e,n,i){return{done:!1,value:{type:o,item:t,previousPosition:e,nextPosition:n,length:i}}}class L extends fn{constructor(t,e,n="toNone"){if(super(),!t.is("element")&&!t.is("documentFragment"))throw new _("model-position-root-invalid",t);if(!(e instanceof Array)||e.length===0)throw new _("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e1)return!1;if(i===1)return sd(t,this,n);if(i===-1)return sd(this,t,n)}return this.path.length===t.path.length||(this.path.length>t.path.length?Ls(this.path,e):Ls(t.path,e))}hasSameParentAs(t){return this.root!==t.root?!1:Mt(this.getParentPath(),t.getParentPath())=="same"}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=L._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?L._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=L._createAt(this);if(this.root!=t.root)return n;if(Mt(t.getParentPath(),this.getParentPath())=="same"){if(t.offsetthis.offset)return null;n.offset-=e}}else if(Mt(t.getParentPath(),this.getParentPath())=="prefix"){const i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+e>this.path[i])return null;n.path[i]-=e}}return n}_getTransformedByInsertion(t,e){const n=L._createAt(this);if(this.root!=t.root)return n;if(Mt(t.getParentPath(),this.getParentPath())=="same")(t.offset=i;){if(n.path[s]+a!==r.maxOffset)return!1;a=1,s--,r=r.parent}return!0}(o,e+1)}function Ls(o,t){for(;te+1;){const r=i.maxOffset-n.offset;r!==0&&t.push(new B(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],s=r-n.offset;s!==0&&t.push(new B(n,n.getShiftedBy(s))),n.offset=r,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Xe(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Xe(t);for(const n of e)yield n.item}*getPositions(t={}){t.boundaries=this;const e=new Xe(t);yield e.position;for(const n of e)yield n.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new B(this.start,this.end)]}getTransformedByOperations(t){const e=[new B(this.start,this.end)];for(const n of t)for(let i=0;i0?new this(n,i):new this(i,n)}static _createIn(t){return new this(L._createAt(t,0),L._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(L._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(t.length===0)throw new _("range-create-from-ranges-empty-array",null);if(t.length==1)return t[0].clone();const e=t[0];t.sort((r,s)=>r.start.isAfter(s.start)?1:-1);const n=t.indexOf(e),i=new this(e.start,e.end);if(n>0)for(let r=n-1;t[r].end.isEqual(i.start);r++)i.start=L._createAt(t[r].start);for(let r=n+1;r{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);if(!n)throw new _("mapping-model-position-view-parent-not-found",this,{modelPosition:e.modelPosition});e.viewPosition=this.findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const n=this.findMappedViewAncestor(e.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=L._createAt(i,r)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t,e={}){const n=this.toModelElement(t);if(this._elementToMarkerNames.has(t))for(const i of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(i);e.defer?this._deferredBindingRemovals.set(t,t.root):(this._viewToModelMapping.delete(t),this._modelToViewMapping.get(n)==t&&this._modelToViewMapping.delete(n))}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const i=this._elementToMarkerNames.get(t)||new Set;i.add(e),this._markerNameToElements.set(e,n),this._elementToMarkerNames.set(t,i)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);n&&(n.delete(t),n.size==0&&this._markerNameToElements.delete(e));const i=this._elementToMarkerNames.get(t);i&&(i.delete(e),i.size==0&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}flushDeferredBindings(){for(const[t,e]of this._deferredBindingRemovals)t.root==e&&this.unbindViewElement(t);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new B(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new nt(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const i of e)if(i.is("attributeElement"))for(const r of i.getElementsWithSameId())n.add(r);else n.add(i);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,n){if(n!=t)return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t);if(t.is("$text"))return e;let i=0;for(let r=0;r1?t[0]+":"+t[1]:t[0]}var eA=Object.defineProperty,nA=Object.defineProperties,oA=Object.getOwnPropertyDescriptors,cd=Object.getOwnPropertySymbols,iA=Object.prototype.hasOwnProperty,rA=Object.prototype.propertyIsEnumerable,ld=(o,t,e)=>t in o?eA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,zs=(o,t)=>{for(var e in t||(t={}))iA.call(t,e)&&ld(o,e,t[e]);if(cd)for(var e of cd(t))rA.call(t,e)&&ld(o,e,t[e]);return o},dd=(o,t)=>nA(o,oA(t));class hd extends kt(){constructor(t){super(),this._conversionApi=zs({dispatcher:this},t),this._firedEventsMap=new WeakMap}convertChanges(t,e,n){const i=this._createConversionApi(n,t.getRefreshedItems());for(const s of t.getMarkersToRemove())this._convertMarkerRemove(s.name,s.range,i);const r=this._reduceChanges(t.getChanges());for(const s of r)s.type==="insert"?this._convertInsert(B._createFromPositionAndShift(s.position,s.length),i):s.type==="reinsert"?this._convertReinsert(B._createFromPositionAndShift(s.position,s.length),i):s.type==="remove"?this._convertRemove(s.position,s.length,s.name,i):this._convertAttribute(s.range,s.attributeKey,s.attributeOldValue,s.attributeNewValue,i);i.mapper.flushDeferredBindings();for(const s of i.mapper.flushUnboundMarkerNames()){const a=e.get(s).getRange();this._convertMarkerRemove(s,a,i),this._convertMarkerAdd(s,a,i)}for(const s of t.getMarkersToAdd())this._convertMarkerAdd(s.name,s.range,i);i.consumable.verifyAllConsumed("insert")}convert(t,e,n,i={}){const r=this._createConversionApi(n,void 0,i);this._convertInsert(t,r);for(const[s,a]of e)this._convertMarkerAdd(s,a,r);r.consumable.verifyAllConsumed("insert")}convertSelection(t,e,n){const i=this._createConversionApi(n);this.fire("cleanSelection",{selection:t},i);const r=t.getFirstPosition().root;if(!i.mapper.toViewElement(r))return;const s=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this._addConsumablesForSelection(i.consumable,t,s),this.fire("selection",{selection:t},i),t.isCollapsed){for(const a of s)if(i.consumable.test(t,"addMarker:"+a.name)){const c=a.getRange();if(!sA(t.getFirstPosition(),a,i.mapper))continue;const l={item:t,markerName:a.name,markerRange:c};this.fire(`addMarker:${a.name}`,l,i)}for(const a of t.getAttributeKeys())if(i.consumable.test(t,"attribute:"+a)){const c={item:t,range:t.getFirstRange(),attributeKey:a,attributeOldValue:null,attributeNewValue:t.getAttribute(a)};this.fire(`attribute:${a}:$text`,c,i)}}}_convertInsert(t,e,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(e.consumable,t);for(const i of Array.from(t.getWalker({shallow:!0})).map(ud))this._testAndFire("insert",i,e)}_convertRemove(t,e,n,i){this.fire(`remove:${n}`,{position:t,length:e},i)}_convertAttribute(t,e,n,i,r){this._addConsumablesForRange(r.consumable,t,`attribute:${e}`);for(const s of t){const a={item:s.item,range:B._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${e}`,a,r)}}_convertReinsert(t,e){const n=Array.from(t.getWalker({shallow:!0}));this._addConsumablesForInsert(e.consumable,n);for(const i of n.map(ud))this._testAndFire("insert",dd(zs({},i),{reconversion:!0}),e)}_convertMarkerAdd(t,e,n){if(e.root.rootName=="$graveyard")return;const i=`addMarker:${t}`;if(n.consumable.add(e,i),this.fire(i,{markerName:t,markerRange:e},n),n.consumable.consume(e,i)){this._addConsumablesForRange(n.consumable,e,i);for(const r of e.getItems()){if(!n.consumable.test(r,i))continue;const s={item:r,range:B._createOn(r),markerName:t,markerRange:e};this.fire(i,s,n)}}}_convertMarkerRemove(t,e,n){e.root.rootName!="$graveyard"&&this.fire(`removeMarker:${t}`,{markerName:t,markerRange:e},n)}_reduceChanges(t){const e={changes:t};return this.fire("reduceChanges",e),e.changes}_addConsumablesForInsert(t,e){for(const n of e){const i=n.item;if(t.test(i,"insert")===null){t.add(i,"insert");for(const r of i.getAttributeKeys())t.add(i,"attribute:"+r)}}return t}_addConsumablesForRange(t,e,n){for(const i of e.getItems())t.add(i,n);return t}_addConsumablesForSelection(t,e,n){t.add(e,"selection");for(const i of n)t.add(e,"addMarker:"+i.name);for(const i of e.getAttributeKeys())t.add(e,"attribute:"+i);return t}_testAndFire(t,e,n){const i=function(c,l){const d=l.item.is("element")?l.item.name:"$text";return`${c}:${d}`}(t,e),r=e.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(e.item):e.item,s=this._firedEventsMap.get(n),a=s.get(r);if(a){if(a.has(i))return;a.add(i)}else s.set(r,new Set([i]));this.fire(i,e,n)}_testAndFireAddAttributes(t,e){const n={item:t,range:B._createOn(t)};for(const i of n.item.getAttributeKeys())n.attributeKey=i,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(i),this._testAndFire(`attribute:${i}`,n,e)}_createConversionApi(t,e=new Set,n={}){const i=dd(zs({},this._conversionApi),{consumable:new tA,writer:t,options:n,convertItem:r=>this._convertInsert(B._createOn(r),i),convertChildren:r=>this._convertInsert(B._createIn(r),i,{doNotAddConsumables:!0}),convertAttributes:r=>this._testAndFireAddAttributes(r,i),canReuseView:r=>!e.has(i.mapper.toModelElement(r))});return this._firedEventsMap.set(i,new Map),i}}function sA(o,t,e){const n=t.getRange(),i=Array.from(o.getAncestors());return i.shift(),i.reverse(),!i.some(r=>{if(n.containsItem(r))return!!e.toViewElement(r).getCustomProperty("addHighlight")})}function ud(o){return{item:o.item,range:B._createFromPositionAndShift(o.previousPosition,o.length)}}class ge extends kt(fn){constructor(...t){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],t.length&&this.setTo(...t)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new B(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new B(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new B(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(...t){let[e,n,i]=t;if(typeof n=="object"&&(i=n,n=void 0),e===null)this._setRanges([]);else if(e instanceof ge)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof B)this._setRanges([e],!!i&&!!i.backward);else if(e instanceof L)this._setRanges([new B(e)]);else if(e instanceof zn){const r=!!i&&!!i.backward;let s;if(n=="in")s=B._createIn(e);else if(n=="on")s=B._createOn(e);else{if(n===void 0)throw new _("model-selection-setto-required-second-parameter",[this,e]);s=new B(L._createAt(e,n))}this._setRanges([s],r)}else{if(!Gt(e))throw new _("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,i&&!!i.backward)}}_setRanges(t,e=!1){const n=Array.from(t),i=n.some(r=>{if(!(r instanceof B))throw new _("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(s=>!s.isEqual(r))});(n.length!==this._ranges.length||i)&&(this._replaceAllRanges(n),this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0}))}setFocus(t,e){if(this.anchor===null)throw new _("model-selection-setfocus-no-ranges",[this,t]);const n=L._createAt(t,e);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new B(n,i)),this._lastRangeBackward=!0):(this._pushRange(new B(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=pd(e.start,t);cA(n,e)&&(yield n);for(const r of e.getWalker()){const s=r.item;r.type=="elementEnd"&&aA(s,t,e)&&(yield s)}const i=pd(e.end,t);lA(i,e)&&(yield i)}}containsEntireContent(t=this.anchor.root){const e=L._createAt(t,0),n=L._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new B(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function gd(o,t){return!t.has(o)&&(t.add(o),o.root.document.model.schema.isBlock(o)&&!!o.parent)}function aA(o,t,e){return gd(o,t)&&Rs(o,e)}function pd(o,t){const e=o.parent.root.document.model.schema,n=o.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=n.find(s=>!i&&(i=e.isLimit(s),!i&&gd(s,t)));return n.forEach(s=>t.add(s)),r}function Rs(o,t){const e=function(n){const i=n.root.document.model.schema;let r=n.parent;for(;r;){if(i.isBlock(r))return r;r=r.parent}}(o);return e?!t.containsRange(B._createOn(e),!0):!0}function cA(o,t){return!!o&&(!(!t.isCollapsed&&!o.isEmpty)||!t.start.isTouching(L._createAt(o,o.maxOffset))&&Rs(o,t))}function lA(o,t){return!!o&&(!(!t.isCollapsed&&!o.isEmpty)||!t.end.isTouching(L._createAt(o,0))&&Rs(o,t))}ge.prototype.is=function(o){return o==="selection"||o==="model:selection"};class pe extends kt(B){constructor(t,e){super(t,e),dA.call(this)}detach(){this.stopListening()}toRange(){return new B(this.start,this.end)}static fromRange(t){return new pe(t.start,t.end)}}function dA(){this.listenTo(this.root.document.model,"applyOperation",(o,t)=>{const e=t[0];e.isDocumentOperation&&hA.call(this,e)},{priority:"low"})}function hA(o){const t=this.getTransformedByOperation(o),e=B._createFromRanges(t),n=!e.isEqual(this),i=function(s,a){switch(a.type){case"insert":return s.containsPosition(a.position);case"move":case"remove":case"reinsert":case"merge":return s.containsPosition(a.sourcePosition)||s.start.isEqual(a.sourcePosition)||s.containsPosition(a.targetPosition);case"split":return s.containsPosition(a.splitPosition)||s.containsPosition(a.insertionPosition)}return!1}(this,o);let r=null;if(n){e.root.rootName=="$graveyard"&&(r=o.type=="remove"?o.sourcePosition:o.deletionPosition);const s=this.toRange();this.start=e.start,this.end=e.end,this.fire("change:range",s,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}pe.prototype.is=function(o){return o==="liveRange"||o==="model:liveRange"||o=="range"||o==="model:range"};const Qi="selection:";class ze extends kt(fn){constructor(t){super(),this._selection=new uA(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(...t){this._selection.setTo(...t)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return Qi+t}static _isStoreAttributeKey(t){return t.startsWith(Qi)}}ze.prototype.is=function(o){return o==="selection"||o=="model:selection"||o=="documentSelection"||o=="model:documentSelection"};class uA extends ge{constructor(t){super(),this.markers=new Be({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=t.model,this._document=t,this.listenTo(this._model,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(e,n,i,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(e,n)=>{(function(i,r){const s=i.document.differ;for(const a of s.getChanges()){if(a.type!="insert")continue;const c=a.position.parent;a.length===c.maxOffset&&i.enqueueChange(r,l=>{const d=Array.from(c.getAttributeKeys()).filter(h=>h.startsWith(Qi));for(const h of d)l.removeAttribute(h,c)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const s=this._ranges.indexOf(e);this._ranges.splice(s,1),e.detach()}}),e}updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const i of this._model.markers){const r=i.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const s=i.getRange();for(const a of this.getRanges())s.containsRange(a,!a.isCollapsed)&&t.push(i)}const n=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(t,e){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),s=this.markers.has(t);if(e){let a=!1;for(const c of this.getRanges())if(e.containsRange(c,!c.isCollapsed)){a=!0;break}a&&!s?(this.markers.add(t),i=!0):!a&&s&&(this.markers.remove(t),i=!0)}else s&&(this.markers.remove(t),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(t){const e=We(this._getSurroundingAttributes()),n=We(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,s]of this._attributePriority)s=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(e);const i=[];for(const[r,s]of this.getAttributes())n.has(r)&&n.get(r)===s||i.push(r);for(const[r]of n)this.hasAttribute(r)||i.push(r);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(t,e,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(t)=="normal"?!1:super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,i),!0)}_removeAttribute(t,e=!0){const n=e?"normal":"low";return(n!="low"||this._attributePriority.get(t)!="normal")&&(this._attributePriority.set(t,n),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[n,i]of this.getAttributes())t.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of t)this._setAttribute(n,i,!1)&&e.add(n);return e}*getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())e.startsWith(Qi)&&(yield[e.substr(10),t.getAttribute(e)])}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;if(t.root.rootName=="$graveyard")return null;let n=null;if(this.isCollapsed){const i=t.textNode?t.textNode:t.nodeBefore,r=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=Yo(i,e)),n||(n=Yo(r,e)),!this.isGravityOverridden&&!n){let s=i;for(;s&&!n;)s=s.previousSibling,n=Yo(s,e)}if(!n){let s=r;for(;s&&!n;)s=s.nextSibling,n=Yo(s,e)}n||(n=this.getStoredAttributes())}else{const i=this.getFirstRange();for(const r of i){if(r.item.is("element")&&e.isObject(r.item)){n=Yo(r.item,e);break}if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Yo(o,t){if(!o)return null;if(o instanceof Le||o instanceof yt)return o.getAttributes();if(!t.isInline(o))return null;if(!t.isObject(o))return[];const e=[];for(const[n,i]of o.getAttributes())t.checkAttribute("$text",n)&&t.getAttributeProperties(n).copyFromObject!==!1&&e.push([n,i]);return e}class md{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}class gA extends md{elementToElement(t){return this.add(function(e){const n=bd(e.model),i=Qo(e.view,"container");return n.attributes.length&&(n.children=!0),r=>{r.on(`insert:${n.name}`,function(s,a=mA){return(c,l,d)=>{if(!a(l.item,d.consumable,{preflight:!0}))return;const h=s(l.item,d,l);if(!h)return;a(l.item,d.consumable);const u=d.mapper.toViewPosition(l.range.start);d.mapper.bindElements(l.item,h),d.writer.insert(u,h),d.convertAttributes(l.item),vd(h,l.item.getChildren(),d,{reconversion:l.reconversion})}}(i,_d(n)),{priority:e.converterPriority||"normal"}),(n.children||n.attributes.length)&&r.on("reduceChanges",Cd(n),{priority:"low"})}}(t))}elementToStructure(t){return this.add(function(e){const n=bd(e.model),i=Qo(e.view,"container");return n.children=!0,r=>{if(r._conversionApi.schema.checkChild(n.name,"$text"))throw new _("conversion-element-to-structure-disallowed-text",r,{elementName:n.name});var s,a;r.on(`insert:${n.name}`,(s=i,a=_d(n),(c,l,d)=>{if(!a(l.item,d.consumable,{preflight:!0}))return;const h=new Map;d.writer._registerSlotFactory(function(p,k,b){return(A,E)=>{const M=A.createContainerElement("$slot");let z=null;if(E==="children")z=Array.from(p.getChildren());else{if(typeof E!="function")throw new _("conversion-slot-mode-unknown",b.dispatcher,{modeOrFilter:E});z=Array.from(p.getChildren()).filter(G=>E(G))}return k.set(M,z),M}}(l.item,h,d));const u=s(l.item,d,l);if(d.writer._clearSlotFactory(),!u)return;(function(p,k,b){const A=Array.from(k.values()).flat(),E=new Set(A);if(E.size!=A.length)throw new _("conversion-slot-filter-overlap",b.dispatcher,{element:p});if(E.size!=p.childCount)throw new _("conversion-slot-filter-incomplete",b.dispatcher,{element:p})})(l.item,h,d),a(l.item,d.consumable);const g=d.mapper.toViewPosition(l.range.start);d.mapper.bindElements(l.item,u),d.writer.insert(g,u),d.convertAttributes(l.item),function(p,k,b,A){b.mapper.on("modelToViewPosition",z,{priority:"highest"});let E=null,M=null;for([E,M]of k)vd(p,M,b,A),b.writer.move(b.writer.createRangeIn(E),b.writer.createPositionBefore(E)),b.writer.remove(E);function z(G,tt){const at=tt.modelPosition.nodeAfter,St=M.indexOf(at);St<0||(tt.viewPosition=tt.mapper.findPositionIn(E,St))}b.mapper.off("modelToViewPosition",z)}(u,h,d,{reconversion:l.reconversion})}),{priority:e.converterPriority||"normal"}),r.on("reduceChanges",Cd(n),{priority:"low"})}}(t))}attributeToElement(t){return this.add(function(e){e=mn(e);let n=e.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)e.view[s]=Qo(e.view[s],"attribute");else e.view=Qo(e.view,"attribute");const r=wd(e);return s=>{s.on(i,function(a){return(c,l,d)=>{if(!d.consumable.test(l.item,c.name))return;const h=a(l.attributeOldValue,d,l),u=a(l.attributeNewValue,d,l);if(!h&&!u)return;d.consumable.consume(l.item,c.name);const g=d.writer,p=g.document.selection;if(l.item instanceof ge||l.item instanceof ze)g.wrap(p.getFirstRange(),u);else{let k=d.mapper.toViewRange(l.range);l.attributeOldValue!==null&&h&&(k=g.unwrap(k,h)),l.attributeNewValue!==null&&u&&g.wrap(k,u)}}}(r),{priority:e.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(e){e=mn(e);let n=e.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)e.view[s]=Ad(e.view[s]);else e.view=Ad(e.view);const r=wd(e);return s=>{var a;s.on(i,(a=r,(c,l,d)=>{if(!d.consumable.test(l.item,c.name))return;const h=a(l.attributeOldValue,d,l),u=a(l.attributeNewValue,d,l);if(!h&&!u)return;d.consumable.consume(l.item,c.name);const g=d.mapper.toViewElement(l.item),p=d.writer;if(!g)throw new _("conversion-attribute-to-attribute-on-text",d.dispatcher,l);if(l.attributeOldValue!==null&&h)if(h.key=="class"){const k=typeof h.value=="string"?h.value.split(/\s+/):h.value;for(const b of k)p.removeClass(b,g)}else if(h.key=="style")if(typeof h.value=="string"){const k=new Cs(p.document.stylesProcessor);k.setTo(h.value);for(const[b]of k.getStylesEntries())p.removeStyle(b,g)}else{const k=Object.keys(h.value);for(const b of k)p.removeStyle(b,g)}else p.removeAttribute(h.key,g);if(l.attributeNewValue!==null&&u)if(u.key=="class"){const k=typeof u.value=="string"?u.value.split(/\s+/):u.value;for(const b of k)p.addClass(b,g)}else if(u.key=="style")if(typeof u.value=="string"){const k=new Cs(p.document.stylesProcessor);k.setTo(u.value);for(const[b,A]of k.getStylesEntries())p.setStyle(b,A,g)}else{const k=Object.keys(u.value);for(const b of k)p.setStyle(b,u.value[b],g)}else p.setAttribute(u.key,u.value,g)}),{priority:e.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(e){const n=Qo(e.view,"ui");return i=>{var r;i.on(`addMarker:${e.model}`,(r=n,(s,a,c)=>{a.isOpening=!0;const l=r(a,c);a.isOpening=!1;const d=r(a,c);if(!l||!d)return;const h=a.markerRange;if(h.isCollapsed&&!c.consumable.consume(h,s.name))return;for(const p of h)if(!c.consumable.consume(p.item,s.name))return;const u=c.mapper,g=c.writer;g.insert(u.toViewPosition(h.start),l),c.mapper.bindElementToMarker(l,a.markerName),h.isCollapsed||(g.insert(u.toViewPosition(h.end),d),c.mapper.bindElementToMarker(d,a.markerName)),s.stop()}),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,(s,a,c)=>{const l=c.mapper.markerNameToElements(a.markerName);if(l){for(const d of l)c.mapper.unbindElementFromMarkerName(d,a.markerName),c.writer.clear(c.writer.createRangeOn(d),d);c.writer.clearClonedElementsGroup(a.markerName),s.stop()}},{priority:e.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(e){return n=>{var i;n.on(`addMarker:${e.model}`,(i=e.view,(r,s,a)=>{if(!s.item||!(s.item instanceof ge||s.item instanceof ze||s.item.is("$textProxy")))return;const c=js(i,s,a);if(!c||!a.consumable.consume(s.item,r.name))return;const l=a.writer,d=fd(l,c),h=l.document.selection;if(s.item instanceof ge||s.item instanceof ze)l.wrap(h.getFirstRange(),d);else{const u=a.mapper.toViewRange(s.range),g=l.wrap(u,d);for(const p of g.getItems())if(p.is("attributeElement")&&p.isSimilar(d)){a.mapper.bindElementToMarker(p,s.markerName);break}}}),{priority:e.converterPriority||"normal"}),n.on(`addMarker:${e.model}`,function(r){return(s,a,c)=>{if(!a.item||!(a.item instanceof Ct))return;const l=js(r,a,c);if(!l||!c.consumable.test(a.item,s.name))return;const d=c.mapper.toViewElement(a.item);if(d&&d.getCustomProperty("addHighlight")){c.consumable.consume(a.item,s.name);for(const h of B._createIn(a.item))c.consumable.consume(h.item,s.name);d.getCustomProperty("addHighlight")(d,l,c.writer),c.mapper.bindElementToMarker(d,a.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),n.on(`removeMarker:${e.model}`,function(r){return(s,a,c)=>{if(a.markerRange.isCollapsed)return;const l=js(r,a,c);if(!l)return;const d=fd(c.writer,l),h=c.mapper.markerNameToElements(a.markerName);if(h){for(const u of h)c.mapper.unbindElementFromMarkerName(u,a.markerName),u.is("attributeElement")?c.writer.unwrap(c.writer.createRangeOn(u),d):u.getCustomProperty("removeHighlight")(u,l.id,c.writer);c.writer.clearClonedElementsGroup(a.markerName),s.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(e){e=mn(e);const n=e.model;let i=e.view;return i||(i=r=>({group:n,name:r.substr(e.model.length+1)})),r=>{var s;r.on(`addMarker:${n}`,(s=i,(a,c,l)=>{const d=s(c.markerName,l);if(!d)return;const h=c.markerRange;l.consumable.consume(h,a.name)&&(kd(h,!1,l,c,d),kd(h,!0,l,c,d),a.stop())}),{priority:e.converterPriority||"normal"}),r.on(`removeMarker:${n}`,function(a){return(c,l,d)=>{const h=a(l.markerName,d);if(!h)return;const u=d.mapper.markerNameToElements(l.markerName);if(u){for(const p of u)d.mapper.unbindElementFromMarkerName(p,l.markerName),p.is("containerElement")?(g(`data-${h.group}-start-before`,p),g(`data-${h.group}-start-after`,p),g(`data-${h.group}-end-before`,p),g(`data-${h.group}-end-after`,p)):d.writer.clear(d.writer.createRangeOn(p),p);d.writer.clearClonedElementsGroup(l.markerName),c.stop()}function g(p,k){if(k.hasAttribute(p)){const b=new Set(k.getAttribute(p).split(","));b.delete(h.name),b.size==0?d.writer.removeAttribute(p,k):d.writer.setAttribute(p,Array.from(b).join(","),k)}}}}(i),{priority:e.converterPriority||"normal"})}}(t))}}function fd(o,t){const e=o.createAttributeElement("span",t.attributes);return t.classes&&e._addClass(t.classes),typeof t.priority=="number"&&(e._priority=t.priority),e._id=t.id,e}function kd(o,t,e,n,i){const r=t?o.start:o.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let c,l;t&&s||!t&&!a?(c=s,l=!0):(c=a,l=!1);const d=e.mapper.toViewElement(c);if(d)return void function(h,u,g,p,k,b){const A=`data-${b.group}-${u?"start":"end"}-${g?"before":"after"}`,E=h.hasAttribute(A)?h.getAttribute(A).split(","):[];E.unshift(b.name),p.writer.setAttribute(A,E.join(","),h),p.mapper.bindElementToMarker(h,k.markerName)}(d,t,l,e,n,i)}(function(c,l,d,h,u){const g=`${u.group}-${l?"start":"end"}`,p=u.name?{name:u.name}:null,k=d.writer.createUIElement(g,p);d.writer.insert(c,k),d.mapper.bindElementToMarker(k,h.markerName)})(e.mapper.toViewPosition(r),t,e,n,i)}function bd(o){return typeof o=="string"&&(o={name:o}),{name:o.name,attributes:o.attributes?Et(o.attributes):[],children:!!o.children}}function Qo(o,t){return typeof o=="function"?o:(e,n)=>function(i,r,s){typeof i=="string"&&(i={name:i});let a;const c=r.writer,l=Object.assign({},i.attributes);if(s=="container")a=c.createContainerElement(i.name,l);else if(s=="attribute"){const d={priority:i.priority||On.DEFAULT_PRIORITY};a=c.createAttributeElement(i.name,l,d)}else a=c.createUIElement(i.name,l);if(i.styles){const d=Object.keys(i.styles);for(const h of d)c.setStyle(h,i.styles[h],a)}if(i.classes){const d=i.classes;if(typeof d=="string")c.addClass(d,a);else for(const h of d)c.addClass(h,a)}return a}(o,n,t)}function wd(o){return o.model.values?(t,e,n)=>{const i=o.view[t];return i?i(t,e,n):null}:o.view}function Ad(o){return typeof o=="string"?t=>({key:o,value:t}):typeof o=="object"?o.value?()=>o:t=>({key:o.key,value:t}):o}function js(o,t,e){const n=typeof o=="function"?o(t,e):o;return n?(n.priority||(n.priority=10),n.id||(n.id=t.markerName),n):null}function Cd(o){const t=function(e){return(n,i)=>{if(!n.is("element",e.name))return!1;if(i.type=="attribute"){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(o);return(e,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const r of n.changes){const s=r.type=="attribute"?r.range.start.nodeAfter:r.position.parent;if(s&&t(s,r)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const a=L._createBefore(s);let c=i.length;for(let l=i.length-1;l>=0;l--){const d=i[l],h=(d.type=="attribute"?d.range.start:d.position).compareWith(a);if(h=="before"||d.type=="remove"&&h=="same")break;c=l}i.splice(c,0,{type:"remove",name:s.name,position:a,length:1},{type:"reinsert",name:s.name,position:a,length:1})}}else i.push(r)}n.changes=i}}function _d(o){return(t,e,n={})=>{const i=["insert"];for(const r of o.attributes)t.hasAttribute(r)&&i.push(`attribute:${r}`);return!!i.every(r=>e.test(t,r))&&(n.preflight||i.forEach(r=>e.consume(t,r)),!0)}}function vd(o,t,e,n){for(const i of t)pA(o.root,i,e,n)||e.convertItem(i)}function pA(o,t,e,n){const{writer:i,mapper:r}=e;if(!n.reconversion)return!1;const s=r.toViewElement(t);return!(!s||s.root==o)&&!!e.canReuseView(s)&&(i.move(i.createRangeOn(s),r.toViewPosition(L._createBefore(t))),!0)}function mA(o,t,{preflight:e}={}){return e?t.test(o,"insert"):t.consume(o,"insert")}function yd(o){const{schema:t,document:e}=o.model;for(const n of e.getRoots())if(n.isEmpty&&!t.checkChild(n,"$text")&&t.checkChild(n,"paragraph"))return o.insertElement("paragraph",n),!0;return!1}function xd(o,t,e){const n=e.createContext(o);return!!e.checkChild(n,"paragraph")&&!!e.checkChild(n.push("paragraph"),t)}function Ed(o,t){const e=t.createElement("paragraph");return t.insert(e,o),t.createPositionAt(e,0)}var fA=Object.defineProperty,kA=Object.defineProperties,bA=Object.getOwnPropertyDescriptors,Dd=Object.getOwnPropertySymbols,wA=Object.prototype.hasOwnProperty,AA=Object.prototype.propertyIsEnumerable,Id=(o,t,e)=>t in o?fA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class CA extends md{elementToElement(t){return this.add(Sd(t))}elementToAttribute(t){return this.add(function(e){e=mn(e),Td(e);const n=Md(e,!1),i=Fs(e.view),r=i?`element:${i}`:"element";return s=>{s.on(r,n,{priority:e.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(e){e=mn(e);let n=null;(typeof e.view=="string"||e.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const s=r.view.key,a=r.view.value===void 0?/[\s\S]*/:r.view.value;let c;return s=="class"||s=="style"?c={[s=="class"?"classes":"styles"]:a}:c={attributes:{[s]:a}},r.view.name&&(c.name=r.view.name),r.view=c,s}(e)),Td(e,n);const i=Md(e,!0);return r=>{r.on("element",i,{priority:e.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(e){const n=function(s){return(a,c)=>{const l=typeof s=="string"?s:s(a,c);return c.writer.createElement("$marker",{"data-name":l})}}(e.model);return Sd((i=((s,a)=>{for(var c in a||(a={}))wA.call(a,c)&&Id(s,c,a[c]);if(Dd)for(var c of Dd(a))AA.call(a,c)&&Id(s,c,a[c]);return s})({},e),r={model:n},kA(i,bA(r))));var i,r}(t))}dataToMarker(t){return this.add(function(e){e=mn(e),e.model||(e.model=s=>s?e.view+":"+s:e.view);const n={view:e.view,model:e.model},i=Vs(Bd(n,"start")),r=Vs(Bd(n,"end"));return s=>{s.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),s.on(`element:${e.view}-end`,r,{priority:e.converterPriority||"normal"});const a=At.low,c=At.highest,l=At.get(e.converterPriority)/c;s.on("element",function(d){return(h,u,g)=>{const p=`data-${d.view}`;function k(b,A){for(const E of A){const M=d.model(E,g),z=g.writer.createElement("$marker",{"data-name":M});g.writer.insert(z,b),u.modelCursor.isEqual(b)?u.modelCursor=u.modelCursor.getShiftedBy(1):u.modelCursor=u.modelCursor._getTransformedByInsertion(b,1),u.modelRange=u.modelRange._getTransformedByInsertion(b,1)[0]}}(g.consumable.test(u.viewItem,{attributes:p+"-end-after"})||g.consumable.test(u.viewItem,{attributes:p+"-start-after"})||g.consumable.test(u.viewItem,{attributes:p+"-end-before"})||g.consumable.test(u.viewItem,{attributes:p+"-start-before"}))&&(u.modelRange||Object.assign(u,g.convertChildren(u.viewItem,u.modelCursor)),g.consumable.consume(u.viewItem,{attributes:p+"-end-after"})&&k(u.modelRange.end,u.viewItem.getAttribute(p+"-end-after").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-start-after"})&&k(u.modelRange.end,u.viewItem.getAttribute(p+"-start-after").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-end-before"})&&k(u.modelRange.start,u.viewItem.getAttribute(p+"-end-before").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-start-before"})&&k(u.modelRange.start,u.viewItem.getAttribute(p+"-start-before").split(",")))}}(n),{priority:a+l})}}(t))}}function Sd(o){const t=Vs(o=mn(o)),e=Fs(o.view),n=e?`element:${e}`:"element";return i=>{i.on(n,t,{priority:o.converterPriority||"normal"})}}function Fs(o){return typeof o=="string"?o:typeof o=="object"&&typeof o.name=="string"?o.name:null}function Vs(o){const t=new Ne(o.view);return(e,n,i)=>{const r=t.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!i.consumable.test(n.viewItem,s))return;const a=function(c,l,d){return c instanceof Function?c(l,d):d.writer.createElement(c)}(o.model,n.viewItem,i);a&&i.safeInsert(a,n.modelCursor)&&(i.consumable.consume(n.viewItem,s),i.convertChildren(n.viewItem,a),i.updateConversionResult(a,n))}}function Td(o,t=null){const e=t===null||(r=>r.getAttribute(t)),n=typeof o.model!="object"?o.model:o.model.key,i=typeof o.model!="object"||o.model.value===void 0?e:o.model.value;o.model={key:n,value:i}}function Md(o,t){const e=new Ne(o.view);return(n,i,r)=>{if(!i.modelRange&&t)return;const s=e.match(i.viewItem);if(!s||(function(d,h){const u=typeof d=="function"?d(h):d;return typeof u=="object"&&!Fs(u)?!1:!u.classes&&!u.attributes&&!u.styles}(o.view,i.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(i.viewItem,s.match)))return;const a=o.model.key,c=typeof o.model.value=="function"?o.model.value(i.viewItem,r):o.model.value;if(c===null)return;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),function(d,h,u,g){let p=!1;for(const k of Array.from(d.getItems({shallow:u})))g.schema.checkAttribute(k,h.key)&&(p=!0,k.hasAttribute(h.key)||g.writer.setAttribute(h.key,h.value,k));return p}(i.modelRange,{key:a,value:c},t,r)&&(r.consumable.test(i.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(i.viewItem,s.match))}}function Bd(o,t){return{view:`${o.view}-${t}`,model:(e,n)=>{const i=e.getAttribute("name"),r=o.model(i,n);return n.writer.createElement("$marker",{"data-name":r})}}}function _A(o){o.document.registerPostFixer(t=>function(e,n){const i=n.document.selection,r=n.schema,s=[];let a=!1;for(const c of i.getRanges()){const l=Nd(c,r);l&&!l.isEqual(c)?(s.push(l),a=!0):s.push(c)}return a&&e.setSelection(function(c){const l=[...c],d=new Set;let h=1;for(;h!d.has(g))}(s),{backward:i.isBackward}),!1}(t,o))}function Nd(o,t){return o.isCollapsed?function(e,n){const i=e.start,r=n.getNearestSelectionRange(i);if(!r){const a=i.getAncestors().reverse().find(c=>n.isObject(c));return a?B._createOn(a):null}if(!r.isCollapsed)return r;const s=r.start;return i.isEqual(s)?null:new B(s)}(o,t):function(e,n){const{start:i,end:r}=e,s=n.checkChild(i,"$text"),a=n.checkChild(r,"$text"),c=n.getLimitElement(i),l=n.getLimitElement(r);if(c===l){if(s&&a)return null;if(function(u,g,p){const k=u.nodeAfter&&!p.isLimit(u.nodeAfter)||p.checkChild(u,"$text"),b=g.nodeBefore&&!p.isLimit(g.nodeBefore)||p.checkChild(g,"$text");return k||b}(i,r,n)){const u=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),g=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),p=u?u.start:i,k=g?g.end:r;return new B(p,k)}}const d=c&&!c.is("rootElement"),h=l&&!l.is("rootElement");if(d||h){const u=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,g=d&&(!u||!Od(i.nodeAfter,n)),p=h&&(!u||!Od(r.nodeBefore,n));let k=i,b=r;return g&&(k=L._createBefore(Pd(c,n))),p&&(b=L._createAfter(Pd(l,n))),new B(k,b)}return null}(o,t)}function Pd(o,t){let e=o,n=e;for(;t.isLimit(n)&&n.parent;)e=n,n=n.parent;return e}function Od(o,t){return o&&t.isSelectable(o)}class vA extends ft(){constructor(t,e){super(),this.model=t,this.view=new X0(e),this.mapper=new ad,this.downcastDispatcher=new hd({mapper:this.mapper,schema:t.schema});const n=this.model.document,i=n.selection,r=this.model.markers;var s,a,c;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(l=>{this.downcastDispatcher.convertChanges(n.differ,r,l),this.downcastDispatcher.convertSelection(i,r,l)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(l,d){return(h,u)=>{const g=u.newSelection,p=[];for(const b of g.getRanges())p.push(d.toModelRange(b));const k=l.createSelection(p,{backward:g.isBackward});k.isEqual(l.document.selection)||l.change(b=>{b.setSelection(k)})}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,a=this.model.schema,c=this.view,(l,d)=>{if(!c.document.isComposing||f.isAndroid)for(let h=0;h{if(!h.consumable.consume(d.item,l.name))return;const u=h.writer,g=h.mapper.toViewPosition(d.range.start),p=u.createText(d.item.data);u.insert(g,p)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(l,d,h)=>{h.convertAttributes(d.item),d.reconversion||!d.item.is("element")||d.item.isEmpty||h.convertChildren(d.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(l,d,h)=>{const u=h.mapper.toViewPosition(d.position),g=d.position.getShiftedBy(d.length),p=h.mapper.toViewPosition(g,{isPhantom:!0}),k=h.writer.createRange(u,p),b=h.writer.remove(k.getTrimmed());for(const A of h.writer.createRangeIn(b).getItems())h.mapper.unbindViewElement(A,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("cleanSelection",(l,d,h)=>{const u=h.writer,g=u.document.selection;for(const p of g.getRanges())p.isCollapsed&&p.end.parent.isAttached()&&h.writer.mergeAttributes(p.start);u.setSelection(null)}),this.downcastDispatcher.on("selection",(l,d,h)=>{const u=d.selection;if(u.isCollapsed||!h.consumable.consume(u,"selection"))return;const g=[];for(const p of u.getRanges())g.push(h.mapper.toViewRange(p));h.writer.setSelection(g,{backward:u.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(l,d,h)=>{const u=d.selection;if(!u.isCollapsed||!h.consumable.consume(u,"selection"))return;const g=h.writer,p=u.getFirstPosition(),k=h.mapper.toViewPosition(p),b=g.breakAttributes(k);g.setSelection(b)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(l=>{if(l.rootName=="$graveyard")return null;const d=new Tl(this.view.document,l.name);return d.rootName=l.rootName,this.mapper.bindElements(l,d),d})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(t){const e=typeof t=="string"?t:t.name,n=this.model.markers.get(e);if(!n)throw new _("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:e});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(t){this.model.change(()=>{this.model.document.differ._refreshItem(t)})}}class Zo{constructor(){this._consumables=new Map}add(t,e){let n;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new yA(t),this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return n===void 0?null:t.is("$text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);n!==void 0&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const s of n)s!="style"&&s!="class"&&e.attributes.push(s);const i=t.getClassNames();for(const s of i)e.classes.push(s);const r=t.getStyleNames();for(const s of r)e.styles.push(s);return e}static createFrom(t,e){if(e||(e=new Zo),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Zo.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=Zo.createFrom(n,e);return e}}const Zi=["attributes","classes","styles"];class yA{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e of Zi)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e of Zi)if(e in t){const n=this._test(e,t[e]);if(n!==!0)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e of Zi)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e of Zi)e in t&&this._revert(e,t[e])}_add(t,e){const n=Et(e),i=this._consumables[t];for(const r of n){if(t==="attributes"&&(r==="class"||r==="style"))throw new _("viewconsumable-invalid-attribute",this);if(i.set(r,!0),t==="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!0)}}_test(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style"){const s=i.get(r);if(s===void 0)return null;if(!s)return!1}else{const s=r=="class"?"classes":"styles",a=this._test(s,[...this._consumables[s].keys()]);if(a!==!0)return a}return!0}_consume(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style"){if(i.set(r,!1),t=="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!1)}else{const s=r=="class"?"classes":"styles";this._consume(s,[...this._consumables[s].keys()])}}_revert(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style")i.get(r)===!1&&i.set(r,!0);else{const s=r=="class"?"classes":"styles";this._revert(s,[...this._consumables[s].keys()])}}}class xA extends ft(){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new jn(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new jn(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new _("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new _("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e=typeof t=="string"?t:"is"in t&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e){if(t instanceof L){const n=t.nodeBefore,i=t.nodeAfter;if(!(n instanceof Ct))throw new _("schema-check-merge-no-element-before",this);if(!(i instanceof Ct))throw new _("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,i])=>{if(!i)return;const r=t(n,i);typeof r=="boolean"&&(e.stop(),e.return=r)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,i])=>{const r=t(n,i);typeof r=="boolean"&&(e.stop(),e.return=r)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;for(t instanceof L?e=t.parent:e=(t instanceof B?[t]:Array.from(t.getRanges())).reduce((n,i)=>{const r=i.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new yt("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const i of n)for(const r of i)if(this.checkAttribute(r.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}getNearestSelectionRange(t,e="both"){if(t.root.rootName=="$graveyard")return null;if(this.checkChild(t,"$text"))return new B(t);let n,i;const r=t.getAncestors().reverse().find(s=>this.isLimit(s))||t.root;e!="both"&&e!="backward"||(n=new Xe({boundaries:B._createIn(r),startPosition:t,direction:"backward"})),e!="both"&&e!="forward"||(i=new Xe({boundaries:B._createIn(r),startPosition:t}));for(const s of function*(a,c){let l=!1;for(;!l;){if(l=!0,a){const d=a.next();d.done||(l=!1,yield{walker:a,value:d.value})}if(c){const d=c.next();d.done||(l=!1,yield{walker:c,value:d.value})}}}(n,i)){const a=s.walker==n?"elementEnd":"elementStart",c=s.value;if(c.type==a&&this.isObject(c.item))return B._createOn(c.item);if(this.checkChild(c.nextPosition,"$text"))return new B(c.nextPosition)}return null}findAllowedParent(t,e){let n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(t,e,n){const i=n.model;for(const[r,s]of Object.entries(e))i.schema.checkAttribute(t,r)&&n.setAttribute(r,s,t)}removeDisallowedAttributes(t,e){for(const n of t)if(n.is("$text"))Ld(this,n,e);else{const i=B._createIn(n).getPositions();for(const r of i)Ld(this,r.nodeBefore||r.parent,e)}}getAttributesWithProperty(t,e,n){const i={};for(const[r,s]of t.getAttributes()){const a=this.getAttributeProperties(r);a[e]!==void 0&&(n!==void 0&&n!==a[e]||(i[r]=s))}return i}createContext(t){return new jn(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const i of n)t[i]=EA(e[i],i);for(const i of n)DA(t,i);for(const i of n)IA(t,i);for(const i of n)SA(t,i);for(const i of n)TA(t,i),MA(t,i);for(const i of n)BA(t,i),NA(t,i),PA(t,i);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const i=e.getItem(n);if(t.allowIn.includes(i.name)){if(n==0)return!0;{const r=this.getDefinition(i);return this._checkContextMatch(r,e,n-1)}}return!1}*_getValidRangesForRange(t,e){let n=t.start,i=t.start;for(const r of t.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(B._createIn(r),e)),this.checkAttribute(r,e)||(n.isEqual(i)||(yield new B(n,i)),n=L._createAfter(r)),i=L._createAfter(r);n.isEqual(i)||(yield new B(n,i))}findOptimalInsertionRange(t,e){const n=t.getSelectedElement();if(n&&this.isObject(n)&&!this.isInline(n))return e=="before"||e=="after"?new B(L._createAt(n,e)):B._createOn(n);const i=Wt(t.getSelectedBlocks());if(!i)return new B(t.focus);if(i.isEmpty)return new B(L._createAt(i,0));const r=L._createAfter(i);return t.focus.isTouching(r)?new B(r):new B(L._createBefore(i))}}class jn{constructor(t){if(t instanceof jn)return t;let e;e=typeof t=="string"?[t]:Array.isArray(t)?t:t.getAncestors({includeSelf:!0}),this._items=e.map(LA)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new jn([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function EA(o,t){const e={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const r of n){const s=Object.keys(r).filter(a=>a.startsWith("is"));for(const a of s)i[a]=!!r[a]}}(o,e),Fn(o,e,"allowIn"),Fn(o,e,"allowContentOf"),Fn(o,e,"allowWhere"),Fn(o,e,"allowAttributes"),Fn(o,e,"allowAttributesOf"),Fn(o,e,"allowChildren"),Fn(o,e,"inheritTypesFrom"),function(n,i){for(const r of n){const s=r.inheritAllFrom;s&&(i.allowContentOf.push(s),i.allowWhere.push(s),i.allowAttributesOf.push(s),i.inheritTypesFrom.push(s))}}(o,e),e}function DA(o,t){const e=o[t];for(const n of e.allowChildren){const i=o[n];i&&i.allowIn.push(t)}e.allowChildren.length=0}function IA(o,t){for(const e of o[t].allowContentOf)o[e]&&OA(o,e).forEach(n=>{n.allowIn.push(t)});delete o[t].allowContentOf}function SA(o,t){for(const e of o[t].allowWhere){const n=o[e];if(n){const i=n.allowIn;o[t].allowIn.push(...i)}}delete o[t].allowWhere}function TA(o,t){for(const e of o[t].allowAttributesOf){const n=o[e];if(n){const i=n.allowAttributes;o[t].allowAttributes.push(...i)}}delete o[t].allowAttributesOf}function MA(o,t){const e=o[t];for(const n of e.inheritTypesFrom){const i=o[n];if(i){const r=Object.keys(i).filter(s=>s.startsWith("is"));for(const s of r)s in e||(e[s]=i[s])}}delete e.inheritTypesFrom}function BA(o,t){const e=o[t],n=e.allowIn.filter(i=>o[i]);e.allowIn=Array.from(new Set(n))}function NA(o,t){const e=o[t];for(const n of e.allowIn)o[n].allowChildren.push(t)}function PA(o,t){const e=o[t];e.allowAttributes=Array.from(new Set(e.allowAttributes))}function Fn(o,t,e){for(const n of o){const i=n[e];typeof i=="string"?t[e].push(i):Array.isArray(i)&&t[e].push(...i)}}function OA(o,t){const e=o[t];return(n=o,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(e.name));var n}function LA(o){return typeof o=="string"||o.is("documentFragment")?{name:typeof o=="string"?o:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:o.is("element")?o.name:"$text",*getAttributeKeys(){yield*o.getAttributeKeys()},getAttribute:t=>o.getAttribute(t)}}function Ld(o,t,e){for(const n of t.getAttributeKeys())o.checkAttribute(t,n)||e.removeAttribute(n,t)}var zA=Object.defineProperty,RA=Object.defineProperties,jA=Object.getOwnPropertyDescriptors,zd=Object.getOwnPropertySymbols,FA=Object.prototype.hasOwnProperty,VA=Object.prototype.propertyIsEnumerable,Rd=(o,t,e)=>t in o?zA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class HA extends kt(){constructor(t){var e;super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=(e=((n,i)=>{for(var r in i||(i={}))FA.call(i,r)&&Rd(n,r,i[r]);if(zd)for(var r of zd(i))VA.call(i,r)&&Rd(n,r,i[r]);return n})({},t),RA(e,jA({consumable:null,writer:null,store:null,convertItem:(n,i)=>this._convertItem(n,i),convertChildren:(n,i)=>this._convertChildren(n,i),safeInsert:(n,i)=>this._safeInsert(n,i),updateConversionResult:(n,i)=>this._updateConversionResult(n,i),splitToAllowedParent:(n,i)=>this._splitToAllowedParent(n,i),getSplitParts:n=>this._getSplitParts(n),keepEmptyElement:n=>this._keepEmptyElement(n)})))}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(s,a){let c;for(const l of new jn(s)){const d={};for(const u of l.getAttributeKeys())d[u]=l.getAttribute(u);const h=a.createElement(l.name,d);c&&a.insert(h,c),c=L._createAt(h,0)}return c}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Zo.createFrom(t),this.conversionApi.store={};const{modelRange:i}=this._convertItem(t,this._modelCursor),r=e.createDocumentFragment();if(i){this._removeEmptyElements();for(const s of Array.from(this._modelCursor.parent.getChildren()))e.append(s,r);r.markers=function(s,a){const c=new Set,l=new Map,d=B._createIn(s).getItems();for(const h of d)h.is("element","$marker")&&c.add(h);for(const h of c){const u=h.getAttribute("data-name"),g=a.createPositionBefore(h);l.has(u)?l.get(u).end=g.clone():l.set(u,new B(g.clone())),a.remove(h)}return l}(r,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(t,e){const n={viewItem:t,modelCursor:e,modelRange:null};if(t.is("element")?this.fire(`element:${t.name}`,n,this.conversionApi):t.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof B))throw new _("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){let n=e.is("position")?e:L._createAt(e,0);const i=new B(n);for(const r of Array.from(t.getChildren())){const s=this._convertItem(r,n);s.modelRange instanceof B&&(i.end=s.modelRange.end,n=s.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(t,e){const n=this._splitToAllowedParent(t,e);return!!n&&(this.conversionApi.writer.insert(t,n.position),!0)}_updateConversionResult(t,e){const n=this._getSplitParts(t),i=this.conversionApi.writer;e.modelRange||(e.modelRange=i.createRange(i.createPositionBefore(t),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(t);e.modelCursor=r?i.createPositionAt(r,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(e,t);if(r){if(r===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return xd(e,t,n)?{position:Ed(e,i)}:null;const s=this.conversionApi.writer.split(e,r),a=[];for(const l of s.range.getWalker())if(l.type=="elementEnd")a.push(l.item);else{const d=a.pop(),h=l.item;this._registerSplitPair(d,h)}const c=s.range.end.parent;return this._cursorParents.set(t,c),{position:s.position,cursorParent:c}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const n=this._splitParts.get(t);this._splitParts.set(e,n),n.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_keepEmptyElement(t){this._emptyElementsToKeep.add(t)}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&!this._emptyElementsToKeep.has(e)&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}class UA{getHtml(t){const e=$.document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class qA{constructor(t){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new qi(t,{renderingMode:"data"}),this.htmlWriter=new UA}toData(t){const e=this.domConverter.viewToDom(t);return this.htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this.domConverter.domToView(e,{skipComments:this.skipComments})}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode=t=="marked"?"markedNbsp":"nbsp"}_toDom(t){t.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(t=`${t}`);const e=this.domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),i=e.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class GA extends kt(){constructor(t,e){super(),this.model=t,this.mapper=new ad,this.downcastDispatcher=new hd({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewPosition(i.range.start),c=s.createText(i.item.data);s.insert(a,c)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(n,i,r)=>{r.convertAttributes(i.item),i.reconversion||!i.item.is("element")||i.item.isEmpty||r.convertChildren(i.item)},{priority:"lowest"}),this.upcastDispatcher=new HA({schema:t.schema}),this.viewDocument=new Vi(e),this.stylesProcessor=e,this.htmlProcessor=new qA(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Bl(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:r,consumable:s,writer:a})=>{let c=i.modelCursor;if(!s.test(i.viewItem))return;if(!r.checkChild(c,"$text")){if(!xd(c,"$text",r)||i.viewItem.data.trim().length==0)return;const d=c.nodeBefore;c=Ed(c,a),d&&d.is("element","$marker")&&(a.move(a.createRangeOn(d),c),c=a.createPositionAfter(d))}s.consume(i.viewItem);const l=a.createText(i.viewItem.data);a.insert(l,c),i.modelRange=a.createRange(c,c.getShiftedBy(l.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),ft().prototype.decorate.call(this,"init"),ft().prototype.decorate.call(this,"set"),ft().prototype.decorate.call(this,"get"),ft().prototype.decorate.call(this,"toView"),ft().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},yd)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:n="empty"}=t;if(!this._checkIfRootsExists([e]))throw new _("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(e);return i.isAttached()||Q("datacontroller-get-detached-root",this),n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,t):""}stringify(t,e={}){const n=this.toView(t,e);return this.processor.toData(n)}toView(t,e={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=B._createIn(t),s=new Ln(n);this.mapper.bindElements(t,s);const a=t.is("documentFragment")?t.markers:function(c){const l=[],d=c.root.document;if(!d)return new Map;const h=B._createIn(c);for(const u of d.model.markers){const g=u.getRange(),p=g.isCollapsed,k=g.start.isEqual(h.start)||g.end.isEqual(h.end);if(p&&k)l.push([u.name,g]);else{const b=h.getIntersection(g);b&&l.push([u.name,b])}}return l.sort(([u,g],[p,k])=>{if(g.end.compareWith(k.start)!=="after")return 1;if(g.start.compareWith(k.end)!=="before")return-1;switch(g.start.compareWith(k.start)){case"before":return 1;case"after":return-1;default:switch(g.end.compareWith(k.end)){case"before":return 1;case"after":return-1;default:return p.localeCompare(u)}}}),new Map(l)}(t);return this.downcastDispatcher.convert(r,a,i,e),s}init(t){if(this.model.document.version)throw new _("datacontroller-init-document-not-empty",this);let e={};if(typeof t=="string"?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new _("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},n=>{for(const i of Object.keys(e)){const r=this.model.document.getRoot(i);n.insert(this.parse(e[i],r),r,0)}}),Promise.resolve()}set(t,e={}){let n={};if(typeof t=="string"?n.main=t:n=t,!this._checkIfRootsExists(Object.keys(n)))throw new _("datacontroller-set-non-existent-root",this);this.model.enqueueChange(e.batchType||{},i=>{i.setSelection(null),i.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const r of Object.keys(n)){const s=this.model.document.getRoot(r);i.remove(i.createRangeIn(s)),i.insert(this.parse(n[r],s),s,0)}})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRoot(e))return!1;return!0}}class WA{constructor(t,e){this._helpers=new Map,this._downcast=Et(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Et(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new _("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t))throw new _("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").attributeToAttribute({view:n,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t))throw new _("conversion-group-exists",this);const i=n?new gA(e):new CA(e);this._helpers.set(t,i)}}function*Hs(o){if(o.model.values)for(const t of o.model.values){const e={key:o.model.key,value:t},n=o.view[t],i=o.upcastAlso?o.upcastAlso[t]:void 0;yield*jd(e,n,i)}else yield*jd(o.model,o.view,o.upcastAlso)}function*jd(o,t,e){if(yield{model:o,view:t},e)for(const n of Et(e))yield{model:o,view:n}}class me{constructor(t){this.baseVersion=t,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t,e){return new this(t.baseVersion)}}function Us(o,t){const e=Vd(t),n=e.reduce((s,a)=>s+a.offsetSize,0),i=o.parent;ti(o);const r=o.index;return i._insertChild(r,e),Xo(i,r+e.length),Xo(i,r),new B(o,o.getShiftedBy(n))}function Fd(o){if(!o.isFlat)throw new _("operation-utils-remove-range-not-flat",this);const t=o.start.parent;ti(o.start),ti(o.end);const e=t._removeChildren(o.start.index,o.end.index-o.start.index);return Xo(t,o.start.index),e}function Jo(o,t){if(!o.isFlat)throw new _("operation-utils-move-range-not-flat",this);const e=Fd(o);return Us(t=t._getTransformedByDeletion(o.start,o.end.offset-o.start.offset),e)}function Vd(o){const t=[];(function e(n){if(typeof n=="string")t.push(new yt(n));else if(n instanceof Le)t.push(new yt(n.data,n.getAttributes()));else if(n instanceof zn)t.push(n);else if(Gt(n))for(const i of n)e(i)})(o);for(let e=1;et.maxOffset)throw new _("move-operation-nodes-do-not-exist",this);if(t===e&&n=n&&this.targetPosition.path[r]n._clone(!0))),e=new Kt(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new L(t,[0]);return new pt(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsete._clone(!0))),Us(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const r of t.nodes)r.name?n.push(Ct.fromJSON(r)):n.push(yt.fromJSON(r));const i=new Kt(L.fromJSON(t.position,e),n,t.baseVersion);return i.shouldReceiveAttributes=t.shouldReceiveAttributes,i}}class xt extends me{constructor(t,e,n,i,r){super(r),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new L(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new B(this.splitPosition,t)}get affectedSelectable(){const t=[B._createFromPositionAndShift(this.splitPosition,0),B._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&t.push(B._createFromPositionAndShift(this.graveyardPosition,0)),t}clone(){return new xt(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new L(t,[0]);return new Pt(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset0&&(t.sourcePosition.isEqual(e.sourcePosition.getShiftedBy(e.howMany))&&this._setRelation(t,e,"mergeSourceAffected"),t.targetPosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeTargetWasBefore"));else if(t instanceof ie){const n=t.newRange;if(!n)return;if(e instanceof pt){const i=B._createFromPositionAndShift(e.sourcePosition,e.howMany),r=i.containsPosition(n.start)||i.start.isEqual(n.start),s=i.containsPosition(n.end)||i.end.isEqual(n.end);!r&&!s||i.containsRange(n)||this._setRelation(t,e,{side:r?"left":"right",path:r?n.start.path.slice():n.end.path.slice()})}else if(e instanceof Pt){const i=n.start.isEqual(e.targetPosition),r=n.start.isEqual(e.deletionPosition),s=n.end.isEqual(e.deletionPosition),a=n.end.isEqual(e.sourcePosition);(i||r||s||a)&&this._setRelation(t,e,{wasInLeftElement:i,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:s,wasInRightElement:a})}}}getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const n=this.originalOperations.get(e),i=this._history.getUndoneOperation(n);if(!i)return null;const r=this.originalOperations.get(t),s=this._relations.get(r);return s&&s.get(i)||null}_setRelation(t,e,n){const i=this.originalOperations.get(t),r=this.originalOperations.get(e);let s=this._relations.get(i);s||(s=new Map,this._relations.set(i,s)),s.set(r,n)}}function Gd(o,t){for(const e of o)e.baseVersion=t++}function Wd(o,t){for(let e=0;e{if(o.key===t.key&&o.range.start.hasSameParentAs(t.range.start)){const n=o.range.getDifference(t.range).map(r=>new Rt(r,o.key,o.oldValue,o.newValue,0)),i=o.range.getIntersection(t.range);return i&&e.aIsStrong&&n.push(new Rt(i,t.key,t.newValue,o.newValue,0)),n.length==0?[new Vt(0)]:n}return[o]}),gt(Rt,Kt,(o,t)=>{if(o.range.start.hasSameParentAs(t.position)&&o.range.containsPosition(t.position)){const e=o.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(n=>new Rt(n,o.key,o.oldValue,o.newValue,o.baseVersion));if(t.shouldReceiveAttributes){const n=Kd(t,o.key,o.oldValue);n&&e.unshift(n)}return e}return o.range=o.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[o]}),gt(Rt,Pt,(o,t)=>{const e=[];o.range.start.hasSameParentAs(t.deletionPosition)&&(o.range.containsPosition(t.deletionPosition)||o.range.start.isEqual(t.deletionPosition))&&e.push(B._createFromPositionAndShift(t.graveyardPosition,1));const n=o.range._getTransformedByMergeOperation(t);return n.isCollapsed||e.push(n),e.map(i=>new Rt(i,o.key,o.oldValue,o.newValue,o.baseVersion))}),gt(Rt,pt,(o,t)=>function(n,i){const r=B._createFromPositionAndShift(i.sourcePosition,i.howMany);let s=null,a=[];r.containsRange(n,!0)?s=n:n.start.hasSameParentAs(r.start)?(a=n.getDifference(r),s=n.getIntersection(r)):a=[n];const c=[];for(let l of a){l=l._getTransformedByDeletion(i.sourcePosition,i.howMany);const d=i.getMovedRangeStart(),h=l.start.hasSameParentAs(d),u=l._getTransformedByInsertion(d,i.howMany,h);c.push(...u)}return s&&c.push(s._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany,!1)[0]),c}(o.range,t).map(n=>new Rt(n,o.key,o.oldValue,o.newValue,o.baseVersion))),gt(Rt,xt,(o,t)=>{if(o.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||o.range.end.offset++,[o];if(o.range.start.hasSameParentAs(t.splitPosition)&&o.range.containsPosition(t.splitPosition)){const e=o.clone();return e.range=new B(t.moveTargetPosition.clone(),o.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),o.range.end=t.splitPosition.clone(),o.range.end.stickiness="toPrevious",[o,e]}return o.range=o.range._getTransformedBySplitOperation(t),[o]}),gt(Kt,Rt,(o,t)=>{const e=[o];if(o.shouldReceiveAttributes&&o.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(o.position)){const n=Kd(o,t.key,t.newValue);n&&e.push(n)}return e}),gt(Kt,Kt,(o,t,e)=>(o.position.isEqual(t.position)&&e.aIsStrong||(o.position=o.position._getTransformedByInsertOperation(t)),[o])),gt(Kt,pt,(o,t)=>(o.position=o.position._getTransformedByMoveOperation(t),[o])),gt(Kt,xt,(o,t)=>(o.position=o.position._getTransformedBySplitOperation(t),[o])),gt(Kt,Pt,(o,t)=>(o.position=o.position._getTransformedByMergeOperation(t),[o])),gt(ie,Kt,(o,t)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByInsertOperation(t)[0]),o.newRange&&(o.newRange=o.newRange._getTransformedByInsertOperation(t)[0]),[o])),gt(ie,ie,(o,t,e)=>{if(o.name==t.name){if(!e.aIsStrong)return[new Vt(0)];o.oldRange=t.newRange?t.newRange.clone():null}return[o]}),gt(ie,Pt,(o,t)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByMergeOperation(t)),o.newRange&&(o.newRange=o.newRange._getTransformedByMergeOperation(t)),[o])),gt(ie,pt,(o,t,e)=>{if(o.oldRange&&(o.oldRange=B._createFromRanges(o.oldRange._getTransformedByMoveOperation(t))),o.newRange){if(e.abRelation){const n=B._createFromRanges(o.newRange._getTransformedByMoveOperation(t));if(e.abRelation.side=="left"&&t.targetPosition.isEqual(o.newRange.start))return o.newRange.end=n.end,o.newRange.start.path=e.abRelation.path,[o];if(e.abRelation.side=="right"&&t.targetPosition.isEqual(o.newRange.end))return o.newRange.start=n.start,o.newRange.end.path=e.abRelation.path,[o]}o.newRange=B._createFromRanges(o.newRange._getTransformedByMoveOperation(t))}return[o]}),gt(ie,xt,(o,t,e)=>{if(o.oldRange&&(o.oldRange=o.oldRange._getTransformedBySplitOperation(t)),o.newRange){if(e.abRelation){const n=o.newRange._getTransformedBySplitOperation(t);return o.newRange.start.isEqual(t.splitPosition)&&e.abRelation.wasStartBeforeMergedElement?o.newRange.start=L._createAt(t.insertionPosition):o.newRange.start.isEqual(t.splitPosition)&&!e.abRelation.wasInLeftElement&&(o.newRange.start=L._createAt(t.moveTargetPosition)),o.newRange.end.isEqual(t.splitPosition)&&e.abRelation.wasInRightElement?o.newRange.end=L._createAt(t.moveTargetPosition):o.newRange.end.isEqual(t.splitPosition)&&e.abRelation.wasEndBeforeMergedElement?o.newRange.end=L._createAt(t.insertionPosition):o.newRange.end=n.end,[o]}o.newRange=o.newRange._getTransformedBySplitOperation(t)}return[o]}),gt(Pt,Kt,(o,t)=>(o.sourcePosition.hasSameParentAs(t.position)&&(o.howMany+=t.howMany),o.sourcePosition=o.sourcePosition._getTransformedByInsertOperation(t),o.targetPosition=o.targetPosition._getTransformedByInsertOperation(t),[o])),gt(Pt,Pt,(o,t,e)=>{if(o.sourcePosition.isEqual(t.sourcePosition)&&o.targetPosition.isEqual(t.targetPosition)){if(e.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),o.sourcePosition=new L(t.graveyardPosition.root,n),o.howMany=0,[o]}return[new Vt(0)]}if(o.sourcePosition.isEqual(t.sourcePosition)&&!o.targetPosition.isEqual(t.targetPosition)&&!e.bWasUndone&&e.abRelation!="splitAtSource"){const n=o.targetPosition.root.rootName=="$graveyard",i=t.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&e.aIsStrong){const r=t.targetPosition._getTransformedByMergeOperation(t),s=o.targetPosition._getTransformedByMergeOperation(t);return[new pt(r,o.howMany,s,0)]}return[new Vt(0)]}return o.sourcePosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMergeOperation(t),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),o.graveyardPosition.isEqual(t.graveyardPosition)&&e.aIsStrong||(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(t)),[o]}),gt(Pt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(t.sourcePosition,t.howMany);return t.type=="remove"&&!e.bWasUndone&&!e.forceWeakRemove&&o.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(o.sourcePosition)?[new Vt(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(o.sourcePosition)?o.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(o.sourcePosition)&&e.abRelation=="mergeSourceAffected"?o.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(o.targetPosition)?(o.targetPosition.stickiness="toNone",o.howMany-=t.howMany):t.targetPosition.isEqual(o.targetPosition)&&e.abRelation=="mergeTargetWasBefore"?(o.targetPosition.stickiness="toPrevious",o.howMany+=t.howMany):(o.sourcePosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.sourcePosition.hasSameParentAs(t.sourcePosition)&&(o.howMany-=t.howMany)),o.sourcePosition=o.sourcePosition._getTransformedByMoveOperation(t),o.targetPosition=o.targetPosition._getTransformedByMoveOperation(t),o.sourcePosition.stickiness="toPrevious",o.targetPosition.stickiness="toNext",o.graveyardPosition.isEqual(t.targetPosition)||(o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(t)),[o])}),gt(Pt,xt,(o,t,e)=>{if(t.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),o.deletionPosition.isEqual(t.graveyardPosition)&&(o.howMany=t.howMany)),o.targetPosition.isEqual(t.splitPosition)){const n=t.howMany!=0,i=t.graveyardPosition&&o.deletionPosition.isEqual(t.graveyardPosition);if(n||i||e.abRelation=="mergeTargetNotMoved")return o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(t),[o]}if(o.sourcePosition.isEqual(t.splitPosition)){if(e.abRelation=="mergeSourceNotMoved")return o.howMany=0,o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o];if(e.abRelation=="mergeSameElement"||o.sourcePosition.offset>0)return o.sourcePosition=t.moveTargetPosition.clone(),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o]}return o.sourcePosition.hasSameParentAs(t.splitPosition)&&(o.howMany=t.splitPosition.offset),o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(t),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o]}),gt(pt,Kt,(o,t)=>{const e=B._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByInsertOperation(t,!1)[0];return o.sourcePosition=e.start,o.howMany=e.end.offset-e.start.offset,o.targetPosition.isEqual(t.position)||(o.targetPosition=o.targetPosition._getTransformedByInsertOperation(t)),[o]}),gt(pt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(o.sourcePosition,o.howMany),i=B._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=e.aIsStrong,a=!e.aIsStrong;if(e.abRelation=="insertBefore"||e.baRelation=="insertAfter"?a=!0:e.abRelation!="insertAfter"&&e.baRelation!="insertBefore"||(a=!1),r=o.targetPosition.isEqual(t.targetPosition)&&a?o.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):o.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),$d(o,t)&&$d(t,o))return[t.getReversed()];if(n.containsPosition(t.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),lo([n],r);if(i.containsPosition(o.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),lo([n],r);const c=Mt(o.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(c=="prefix"||c=="extension")return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),lo([n],r);o.type!="remove"||t.type=="remove"||e.aWasUndone||e.forceWeakRemove?o.type=="remove"||t.type!="remove"||e.bWasUndone||e.forceWeakRemove||(s=!1):s=!0;const l=[],d=n.getDifference(i);for(const u of d){u.start=u.start._getTransformedByDeletion(t.sourcePosition,t.howMany),u.end=u.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const g=Mt(u.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same",p=u._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,g);l.push(...p)}const h=n.getIntersection(i);return h!==null&&s&&(h.start=h.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),h.end=h.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),l.length===0?l.push(h):l.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),l.length===0?[new Vt(o.baseVersion)]:lo(l,r)}),gt(pt,xt,(o,t,e)=>{let n=o.targetPosition.clone();o.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&e.abRelation!="moveTargetAfter"||(n=o.targetPosition._getTransformedBySplitOperation(t));const i=B._createFromPositionAndShift(o.sourcePosition,o.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||o.howMany++,o.targetPosition=n,[o];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let s=new B(t.splitPosition,i.end);return s=s._getTransformedBySplitOperation(t),lo([new B(i.start,t.splitPosition),s],n)}o.targetPosition.isEqual(t.splitPosition)&&e.abRelation=="insertAtSource"&&(n=t.moveTargetPosition),o.targetPosition.isEqual(t.insertionPosition)&&e.abRelation=="insertBetween"&&(n=o.targetPosition);const r=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const s=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);o.howMany>1&&s&&!e.aWasUndone&&r.push(B._createFromPositionAndShift(t.insertionPosition,1))}return lo(r,n)}),gt(pt,Pt,(o,t,e)=>{const n=B._createFromPositionAndShift(o.sourcePosition,o.howMany);if(t.deletionPosition.hasSameParentAs(o.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(o.type!="remove"||e.forceWeakRemove){if(o.howMany==1)return e.bWasUndone?(o.sourcePosition=t.graveyardPosition.clone(),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),[o]):[new Vt(0)]}else if(!e.aWasUndone){const r=[];let s=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t);o.howMany>1&&(r.push(new pt(o.sourcePosition,o.howMany-1,o.targetPosition,0)),s=s._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1),a=a._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1));const c=t.deletionPosition._getCombined(o.sourcePosition,o.targetPosition),l=new pt(s,1,c,0),d=l.getMovedRangeStart().path.slice();d.push(0);const h=new L(l.targetPosition.root,d);a=a._getTransformedByMove(s,c,1);const u=new pt(a,t.howMany,h,0);return r.push(l),r.push(u),r}}const i=B._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByMergeOperation(t);return o.sourcePosition=i.start,o.howMany=i.end.offset-i.start.offset,o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),[o]}),gt(re,Kt,(o,t)=>(o.position=o.position._getTransformedByInsertOperation(t),[o])),gt(re,Pt,(o,t)=>o.position.isEqual(t.deletionPosition)?(o.position=t.graveyardPosition.clone(),o.position.stickiness="toNext",[o]):(o.position=o.position._getTransformedByMergeOperation(t),[o])),gt(re,pt,(o,t)=>(o.position=o.position._getTransformedByMoveOperation(t),[o])),gt(re,re,(o,t,e)=>{if(o.position.isEqual(t.position)){if(!e.aIsStrong)return[new Vt(0)];o.oldName=t.newName}return[o]}),gt(re,xt,(o,t)=>{if(Mt(o.position.path,t.splitPosition.getParentPath())=="same"&&!t.graveyardPosition){const e=new re(o.position.getShiftedBy(1),o.oldName,o.newName,0);return[o,e]}return o.position=o.position._getTransformedBySplitOperation(t),[o]}),gt(tn,tn,(o,t,e)=>{if(o.root===t.root&&o.key===t.key){if(!e.aIsStrong||o.newValue===t.newValue)return[new Vt(0)];o.oldValue=t.newValue}return[o]}),gt(Ye,Ye,(o,t)=>o.rootName===t.rootName&&o.isAdd===t.isAdd?[new Vt(0)]:[o]),gt(xt,Kt,(o,t)=>(o.splitPosition.hasSameParentAs(t.position)&&o.splitPosition.offset{if(!o.graveyardPosition&&!e.bWasUndone&&o.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new L(t.graveyardPosition.root,n),r=xt.getInsertionPosition(new L(t.graveyardPosition.root,n)),s=new xt(i,0,r,null,0);return o.splitPosition=o.splitPosition._getTransformedByMergeOperation(t),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),o.graveyardPosition=s.insertionPosition.clone(),o.graveyardPosition.stickiness="toNext",[s,o]}return o.splitPosition.hasSameParentAs(t.deletionPosition)&&!o.splitPosition.isAfter(t.deletionPosition)&&o.howMany--,o.splitPosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.splitPosition=o.splitPosition._getTransformedByMergeOperation(t),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(t)),[o]}),gt(xt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.graveyardPosition){const r=n.start.isEqual(o.graveyardPosition)||n.containsPosition(o.graveyardPosition);if(!e.bWasUndone&&r){const s=o.splitPosition._getTransformedByMoveOperation(t),a=o.graveyardPosition._getTransformedByMoveOperation(t),c=a.path.slice();c.push(0);const l=new L(a.root,c);return[new pt(s,o.howMany,l,0)]}o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(t)}const i=o.splitPosition.isEqual(t.targetPosition);if(i&&(e.baRelation=="insertAtSource"||e.abRelation=="splitBefore"))return o.howMany+=t.howMany,o.splitPosition=o.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),[o];if(i&&e.abRelation&&e.abRelation.howMany){const{howMany:r,offset:s}=e.abRelation;return o.howMany+=r,o.splitPosition=o.splitPosition.getShiftedBy(s),[o]}if(o.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(o.splitPosition)){const r=t.howMany-(o.splitPosition.offset-t.sourcePosition.offset);return o.howMany-=r,o.splitPosition.hasSameParentAs(t.targetPosition)&&o.splitPosition.offset{if(o.splitPosition.isEqual(t.splitPosition)){if(!o.graveyardPosition&&!t.graveyardPosition)return[new Vt(0)];if(o.graveyardPosition&&t.graveyardPosition&&o.graveyardPosition.isEqual(t.graveyardPosition))return[new Vt(0)];if(e.abRelation=="splitBefore")return o.howMany=0,o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(t),[o]}if(o.graveyardPosition&&t.graveyardPosition&&o.graveyardPosition.isEqual(t.graveyardPosition)){const n=o.splitPosition.root.rootName=="$graveyard",i=t.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&e.aIsStrong){const r=[];return t.howMany&&r.push(new pt(t.moveTargetPosition,t.howMany,t.splitPosition,0)),o.howMany&&r.push(new pt(o.splitPosition,o.howMany,o.moveTargetPosition,0)),r}return[new Vt(0)]}if(o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(t)),o.splitPosition.isEqual(t.insertionPosition)&&e.abRelation=="splitBefore")return o.howMany++,[o];if(t.splitPosition.isEqual(o.insertionPosition)&&e.baRelation=="splitBefore"){const n=t.insertionPosition.path.slice();n.push(0);const i=new L(t.insertionPosition.root,n);return[o,new pt(o.insertionPosition,1,i,0)]}return o.splitPosition.hasSameParentAs(t.splitPosition)&&o.splitPosition.offset{const e=t[0];e.isDocumentOperation&&JA.call(this,e)},{priority:"low"})}function JA(o){const t=this.getTransformedByOperation(o);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Zt.prototype.is=function(o){return o==="livePosition"||o==="model:livePosition"||o=="position"||o==="model:position"};class ho{constructor(t={}){typeof t=="string"&&(t=t==="transparent"?{isUndoable:!1}:{},Q("batch-constructor-deprecated-string-type"));const{isUndoable:e=!0,isLocal:n=!0,isUndo:i=!1,isTyping:r=!1}=t;this.operations=[],this.isUndoable=e,this.isLocal=n,this.isUndo=i,this.isTyping=r}get type(){return Q("batch-type-deprecated"),"default"}get baseVersion(){for(const t of this.operations)if(t.baseVersion!==null)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}var XA=Object.defineProperty,tC=Object.defineProperties,eC=Object.getOwnPropertyDescriptors,Yd=Object.getOwnPropertySymbols,nC=Object.prototype.hasOwnProperty,oC=Object.prototype.propertyIsEnumerable,Qd=(o,t,e)=>t in o?XA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Zd=(o,t)=>{for(var e in t||(t={}))nC.call(t,e)&&Qd(o,e,t[e]);if(Yd)for(var e of Yd(t))oC.call(t,e)&&Qd(o,e,t[e]);return o};class iC{constructor(t){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changedRoots=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=t}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(t){const e=t;switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const n of e.range.getItems({shallow:!0}))this._isInInsertedElement(n.parent)||this._markAttribute(n);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const n=this._isInInsertedElement(e.sourcePosition.parent),i=this._isInInsertedElement(e.targetPosition.parent);n||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),i||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const n=B._createFromPositionAndShift(e.position,1);for(const i of this._markerCollection.getMarkersIntersectingRange(n)){const r=i.getData();this.bufferMarkerChange(i.name,r,r)}break}case"split":{const n=e.splitPosition.parent;this._isInInsertedElement(n)||this._markRemove(n,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const n=e.sourcePosition.parent;this._isInInsertedElement(n.parent)||this._markRemove(n.parent,n.startOffset,1);const i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const r=e.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,e.targetPosition.offset,n.maxOffset);break}case"detachRoot":case"addRoot":{const n=e.affectedSelectable;if(!n._isLoaded||n.isAttached()==e.isAdd)return;this._bufferRootStateChange(e.rootName,e.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!e.root._isLoaded)return;const n=e.root.rootName;this._bufferRootAttributeChange(n,e.key,e.oldValue,e.newValue);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n){e.range&&e.range.root.is("rootElement")&&!e.range.root._isLoaded&&(e.range=null),n.range&&n.range.root.is("rootElement")&&!n.range.root._isLoaded&&(n.range=null);let i=this._changedMarkers.get(t);i?i.newMarkerData=n:(i={newMarkerData:n,oldMarkerData:e},this._changedMarkers.set(t,i)),i.oldMarkerData.range==null&&n.range==null&&this._changedMarkers.delete(t)}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)n.oldMarkerData.range!=null&&t.push({name:e,range:n.oldMarkerData.range});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)n.newMarkerData.range!=null&&t.push({name:e,range:n.newMarkerData.range});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(([t,e])=>({name:t,data:{oldRange:e.oldMarkerData.range,newRange:e.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0||this._changedRoots.size>0)return!0;for(const{newMarkerData:t,oldMarkerData:e}of this._changedMarkers.values()){if(t.affectsData!==e.affectsData)return!0;if(t.affectsData){const n=t.range&&!e.range,i=!t.range&&e.range,r=t.range&&e.range&&!t.range.isEqual(e.range);if(n||i||r)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((d,h)=>d.offset===h.offset?d.type!=h.type?d.type=="remove"?-1:1:0:d.offsetn.position.root!=i.position.root?n.position.root.rootNamen);for(const n of e)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e,this._cachedChanges=e.filter(sC),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(t=>{const e=Zd({},t);return e.state!==void 0&&delete e.attributes,e})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_bufferRootStateChange(t,e){if(!this._changedRoots.has(t))return void this._changedRoots.set(t,{name:t,state:e?"attached":"detached"});const n=this._changedRoots.get(t);n.state!==void 0?(delete n.state,n.attributes===void 0&&this._changedRoots.delete(t)):n.state=e?"attached":"detached"}_bufferRootAttributeChange(t,e,n,i){const r=this._changedRoots.get(t)||{name:t},s=r.attributes||{};if(s[e]){const a=s[e];i===a.oldValue?delete s[e]:a.newValue=i}else s[e]={oldValue:n,newValue:i};Object.entries(s).length===0?(delete r.attributes,r.state===void 0&&this._changedRoots.delete(t)):(r.attributes=s,this._changedRoots.set(t,r))}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t);const e=B._createOn(t);for(const n of this._markerCollection.getMarkersIntersectingRange(e)){const i=n.getData();this.bufferMarkerChange(n.name,i,i)}this._cachedChanges=null}_bufferRootLoad(t){if(t.isAttached()){this._bufferRootStateChange(t.rootName,!0),this._markInsert(t,0,t.maxOffset);for(const n of t.getAttributeKeys())this._bufferRootAttributeChange(t.rootName,n,null,t.getAttribute(n));for(const n of this._markerCollection)if(n.getRange().root==t){const i=n.getData();this.bufferMarkerChange(n.name,(e=Zd({},i),tC(e,eC({range:null}))),i)}var e}}_markInsert(t,e,n){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const i={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i)}_markRemove(t,e,n){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const i={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i),this._removeAllNestedChanges(t,e,n)}_markAttribute(t){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n),n.push(e);for(let i=0;in.offset){if(i>r){const s={type:"attribute",offset:r,howMany:i-r,count:this._changeCount++};this._handleChange(s,e),e.push(s)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offsetr?(t.nodesToHandle=i-r,t.offset=r):t.nodesToHandle=0);if(n.type=="remove"&&t.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,e),e.push(s),t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}n.type=="attribute"&&(t.offset>=n.offset&&i<=r?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&i>=r&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:L._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,_element:n.element}}_getRemoveDiff(t,e,n){return{type:"remove",position:L._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,_element:n.element}}_getAttributesDiff(t,e,n){const i=[];n=new Map(n);for(const[r,s]of e){const a=n.has(r)?n.get(r):null;a!==s&&i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:s,attributeNewValue:a,changeCount:this._changeCount++}),n.delete(r)}for(const[r,s]of n)i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),i=t.startOffset;if(n){for(const r of n)if(r.type=="insert"&&i>=r.offset&&in){for(let s=0;sthis._version+1&&this._gaps.set(this._version,t),this._version=t}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(t){if(t.baseVersion!==this.version)throw new _("model-document-history-addoperation-incorrect-version",this,{operation:t,historyVersion:this.version});this._operations.push(t),this._version++,this._baseVersionToOperationIndex.set(t.baseVersion,this._operations.length-1)}getOperations(t,e=this.version){if(!this._operations.length)return[];const n=this._operations[0];t===void 0&&(t=n.baseVersion);let i=e-1;for(const[a,c]of this._gaps)t>a&&ta&&ithis.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(t);r===void 0&&(r=0);let s=this._baseVersionToOperationIndex.get(i);return s===void 0&&(s=this._operations.length-1),this._operations.slice(r,s+1)}getOperation(t){const e=this._baseVersionToOperationIndex.get(t);if(e!==void 0)return this._operations[e]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Ji extends Ct{constructor(t,e,n="main"){super(e),this._isAttached=!0,this._isLoaded=!0,this._document=t,this.rootName=n}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Ji.prototype.is=function(o,t){return t?t===this.name&&(o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"):o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"||o==="node"||o==="model:node"};var cC=Object.defineProperty,lC=Object.defineProperties,dC=Object.getOwnPropertyDescriptors,Xd=Object.getOwnPropertySymbols,hC=Object.prototype.hasOwnProperty,uC=Object.prototype.propertyIsEnumerable,th=(o,t,e)=>t in o?cC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,eh=(o,t)=>{for(var e in t||(t={}))hC.call(t,e)&&th(o,e,t[e]);if(Xd)for(var e of Xd(t))uC.call(t,e)&&th(o,e,t[e]);return o},nh=(o,t)=>lC(o,dC(t));const oh="$graveyard";class gC extends kt(){constructor(t){super(),this.model=t,this.history=new aC,this.selection=new ze(this),this.roots=new Be({idProperty:"rootName"}),this.differ=new iC(t.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",oh),this.listenTo(t,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&this.history.addOperation(i)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(e,n,i,r,s)=>{const a=nh(eh({},n.getData()),{range:r});this.differ.bufferMarkerChange(n.name,s,a),i===null&&n.on("change",(c,l)=>{const d=n.getData();this.differ.bufferMarkerChange(n.name,nh(eh({},d),{range:l}),d)})}),this.registerPostFixer(e=>{let n=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),n=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),n=!0);return n})}get version(){return this.history.version}set version(t){this.history.version=t}get graveyard(){return this.getRoot(oh)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new _("model-document-createroot-name-exists",this,{name:e});const n=new Ji(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(t=!1){return this.getRoots(t).map(e=>e.rootName)}getRoots(t=!1){return this.roots.filter(e=>e!=this.graveyard&&(t||e.isAttached())&&e._isLoaded)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=vl(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const t=this.getRoots();return t.length?t[0]:this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,n=e.schema,i=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(i)||e.createRange(i)}_validateSelectionRange(t){return ih(t.start)&&ih(t.end)}_callPostFixers(t){let e=!1;do for(const n of this._postFixers)if(this.selection.refresh(),e=n(t),e)break;while(e)}}function ih(o){const t=o.textNode;if(t){const e=t.data,n=o.offset-t.startOffset;return!gs(e,n)&&!ps(e,n)}return!0}var pC=Object.defineProperty,mC=Object.defineProperties,fC=Object.getOwnPropertyDescriptors,rh=Object.getOwnPropertySymbols,kC=Object.prototype.hasOwnProperty,bC=Object.prototype.propertyIsEnumerable,sh=(o,t,e)=>t in o?pC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class wC extends kt(){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){const e=t instanceof uo?t.name:t;return this._markers.has(e)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,i=!1){const r=t instanceof uo?t.name:t;if(r.includes(","))throw new _("markercollection-incorrect-marker-name",this);const s=this._markers.get(r);if(s){const d=s.getData(),h=s.getRange();let u=!1;return h.isEqual(e)||(s._attachLiveRange(pe.fromRange(e)),u=!0),n!=s.managedUsingOperations&&(s._managedUsingOperations=n,u=!0),typeof i=="boolean"&&i!=s.affectsData&&(s._affectsData=i,u=!0),u&&this.fire(`update:${r}`,s,h,e,d),s}const a=pe.fromRange(e),c=new uo(r,a,n,i);var l;return this._markers.set(r,c),this.fire(`update:${r}`,c,null,e,(l=((d,h)=>{for(var u in h||(h={}))kC.call(h,u)&&sh(d,u,h[u]);if(rh)for(var u of rh(h))bC.call(h,u)&&sh(d,u,h[u]);return d})({},c.getData()),mC(l,fC({range:null})))),c}_remove(t){const e=t instanceof uo?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire(`update:${e}`,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(t){const e=t instanceof uo?t.name:t,n=this._markers.get(e);if(!n)throw new _("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire(`update:${e}`,n,i,i,n.getData())}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)e.getRange().getIntersection(t)!==null&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}class uo extends kt(fn){constructor(t,e,n,i){super(),this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}uo.prototype.is=function(o){return o==="marker"||o==="model:marker"};class AC extends me{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new _("detach-operation-on-document-node",this)}_execute(){Fd(B._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class en extends fn{constructor(t){super(),this.markers=new Map,this._children=new Ko,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(Ct.fromJSON(n)):e.push(yt.fromJSON(n));return new en(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(i){return typeof i=="string"?[new yt(i)]:(Gt(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new yt(r):r instanceof Le?new yt(r.data,r.getAttributes()):r))}(e);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}}en.prototype.is=function(o){return o==="documentFragment"||o==="model:documentFragment"};class CC{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new yt(t,e)}createElement(t,e){return new Ct(t,e)}createDocumentFragment(){return new en}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,n=0){if(this._assertWriterUsedCorrectly(),t instanceof yt&&t.data=="")return;const i=L._createAt(e,n);if(t.parent){if(lh(t.root,i.root))return void this.move(B._createOn(t),i);if(t.root.document)throw new _("model-writer-insert-forbidden-move",this);this.remove(t)}const r=i.root.document?i.root.document.version:null,s=new Kt(i,t,r);if(t instanceof yt&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),t instanceof en)for(const[a,c]of t.markers){const l=L._createAt(c.root,0),d={range:new B(c.start._getCombined(l,i),c.end._getCombined(l,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,d):this.addMarker(a,d)}}insertText(t,e,n,i){e instanceof en||e instanceof Ct||e instanceof L?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,i)}insertElement(t,e,n,i){e instanceof en||e instanceof Ct||e instanceof L?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,i)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof en||e instanceof Ct?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof en||e instanceof Ct?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof B){const i=n.getMinimalFlatRanges();for(const r of i)ah(this,t,e,r)}else ch(this,t,e,n)}setAttributes(t,e){for(const[n,i]of We(t))this.setAttribute(n,i,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof B){const n=e.getMinimalFlatRanges();for(const i of n)ah(this,t,null,i)}else ch(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(t instanceof B)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof B))throw new _("writer-move-invalid-range",this);if(!t.isFlat)throw new _("writer-move-range-not-flat",this);const i=L._createAt(e,n);if(i.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!lh(t.root,i.root))throw new _("writer-move-different-document",this);const r=t.root.document?t.root.document.version:null,s=new pt(t.start,t.end.offset-t.start.offset,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof B?t:B._createOn(t)).getMinimalFlatRanges().reverse();for(const n of e)this._addOperationForAffectedMarkers("move",n),_C(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Ct))throw new _("writer-merge-no-element-before",this);if(!(n instanceof Ct))throw new _("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(...t){return this.model.createSelection(...t)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move(B._createIn(n),L._createAt(e,"end")),this.remove(n)}_merge(t){const e=L._createAt(t.nodeBefore,"end"),n=L._createAt(t.nodeAfter,0),i=t.root.document.graveyard,r=new L(i,[0]),s=t.root.document.version,a=new Pt(n,t.nodeAfter.maxOffset,e,r,s);this.batch.addOperation(a),this.model.applyOperation(a)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Ct))throw new _("writer-rename-not-element-instance",this);const n=t.root.document?t.root.document.version:null,i=new re(L._createBefore(t),t.name,e,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(t,e){this._assertWriterUsedCorrectly();let n,i,r=t.parent;if(!r.parent)throw new _("writer-split-element-no-parent",this);if(e||(e=r.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new _("writer-split-invalid-limit-element",this);do{const s=r.root.document?r.root.document.version:null,a=r.maxOffset-t.offset,c=xt.getInsertionPosition(t),l=new xt(t,a,c,null,s);this.batch.addOperation(l),this.model.applyOperation(l),n||i||(n=r,i=t.parent.nextSibling),r=(t=this.createPositionAfter(t.parent)).parent}while(r!==e);return{position:t,range:new B(L._createAt(n,"end"),L._createAt(i,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new _("writer-wrap-range-not-flat",this);const n=e instanceof Ct?e:new Ct(e);if(n.childCount>0)throw new _("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new _("writer-wrap-element-attached",this);this.insert(n,t.start);const i=new B(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(i,L._createAt(n,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),t.parent===null)throw new _("writer-unwrap-element-no-parent",this);this.move(B._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||typeof e.usingOperation!="boolean")throw new _("writer-addmarker-no-usingoperation",this);const n=e.usingOperation,i=e.range,r=e.affectsData!==void 0&&e.affectsData;if(this.model.markers.has(t))throw new _("writer-addmarker-marker-exists",this);if(!i)throw new _("writer-addmarker-no-range",this);return n?(ei(this,t,null,i,r),this.model.markers.get(t)):this.model.markers._set(t,i,n,r)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n=typeof t=="string"?t:t.name,i=this.model.markers.get(n);if(!i)throw new _("writer-updatemarker-marker-not-exists",this);if(!e)return Q("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const r=typeof e.usingOperation=="boolean",s=typeof e.affectsData=="boolean",a=s?e.affectsData:i.affectsData;if(!r&&!e.range&&!s)throw new _("writer-updatemarker-wrong-options",this);const c=i.getRange(),l=e.range?e.range:c;r&&e.usingOperation!==i.managedUsingOperations?e.usingOperation?ei(this,n,null,l,a):(ei(this,n,c,null,a),this.model.markers._set(n,l,void 0,a)):i.managedUsingOperations?ei(this,n,c,l,a):this.model.markers._set(n,l,void 0,a)}removeMarker(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?t:t.name;if(!this.model.markers.has(e))throw new _("writer-removemarker-no-marker",this);const n=this.model.markers.get(e);if(!n.managedUsingOperations)return void this.model.markers._remove(e);ei(this,e,n.getRange(),null,n.affectsData)}addRoot(t,e="$root"){this._assertWriterUsedCorrectly();const n=this.model.document.getRoot(t);if(n&&n.isAttached())throw new _("writer-addroot-root-exists",this);const i=this.model.document,r=new Ye(t,e,!0,i,i.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(t)}detachRoot(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?this.model.document.getRoot(t):t;if(!e||!e.isAttached())throw new _("writer-detachroot-no-root",this);for(const r of this.model.markers)r.getRange().root===e&&this.removeMarker(r);for(const r of e.getAttributeKeys())this.removeAttribute(r,e);this.remove(this.createRangeIn(e));const n=this.model.document,i=new Ye(e.rootName,e.name,!1,n,n.version);this.batch.addOperation(i),this.model.applyOperation(i)}setSelection(...t){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...t)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._setSelectionAttribute(t,e);else for(const[n,i]of We(t))this._setSelectionAttribute(n,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=ze._getStoreAttributeKey(t);this.setAttribute(i,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=ze._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new _("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if(t==="move"){const s=e;r=s.containsPosition(i.start)||s.start.isEqual(i.start)||s.containsPosition(i.end)||s.end.isEqual(i.end)}else{const s=e,a=s.nodeBefore,c=s.nodeAfter,l=i.start.parent==a&&i.start.isAtEnd,d=i.end.parent==c&&i.end.offset==0,h=i.end.nodeAfter==c,u=i.start.nodeAfter==c;r=l||d||h||u}r&&this.updateMarker(n.name,{range:i})}}}function ah(o,t,e,n){const i=o.model,r=i.document;let s,a,c,l=n.start;for(const h of n.getWalker({shallow:!0}))c=h.item.getAttribute(t),s&&a!=c&&(a!=e&&d(),l=s),s=h.nextPosition,a=c;function d(){const h=new B(l,s),u=h.root.document?r.version:null,g=new Rt(h,t,a,e,u);o.batch.addOperation(g),i.applyOperation(g)}s instanceof L&&s!=l&&a!=e&&d()}function ch(o,t,e,n){const i=o.model,r=i.document,s=n.getAttribute(t);let a,c;if(s!=e){if(n.root===n){const l=n.document?r.version:null;c=new tn(n,t,s,e,l)}else{a=new B(L._createBefore(n),o.createPositionAfter(n));const l=a.root.document?r.version:null;c=new Rt(a,t,s,e,l)}o.batch.addOperation(c),i.applyOperation(c)}}function ei(o,t,e,n,i){const r=o.model,s=r.document,a=new ie(t,e,n,r.markers,!!i,s.version);o.batch.addOperation(a),r.applyOperation(a)}function _C(o,t,e,n){let i;if(o.root.document){const r=n.document,s=new L(r.graveyard,[0]);i=new pt(o,t,s,r.version)}else i=new AC(o,t);e.addOperation(i),n.applyOperation(i)}function lh(o,t){return o===t||o instanceof Ji&&t instanceof Ji}function vC(o,t,e={}){if(t.isCollapsed)return;const n=t.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=o.schema;o.change(r=>{if(!e.doNotResetEntireContent&&function(l,d){const h=l.getLimitElement(d);if(!d.containsEntireContent(h))return!1;const u=d.getFirstRange();return u.start.parent==u.end.parent?!1:l.checkChild(h,"paragraph")}(i,t))return void function(l,d){const h=l.model.schema.getLimitElement(d);l.remove(l.createRangeIn(h)),uh(l,l.createPositionAt(h,0),d)}(r,t);const s={};if(!e.doNotAutoparagraph){const l=t.getSelectedElement();l&&Object.assign(s,i.getAttributesWithProperty(l,"copyOnReplace",!0))}const[a,c]=function(l){const d=l.root.document.model,h=l.start;let u=l.end;if(d.hasContent(l,{ignoreMarkers:!0})){const g=function(p){const k=p.parent,b=k.root.document.model.schema,A=k.getAncestors({parentFirst:!0,includeSelf:!0});for(const E of A){if(b.isLimit(E))return null;if(b.isBlock(E))return E}}(u);if(g&&u.isTouching(d.createPositionAt(g,0))){const p=d.createSelection(l);d.modifySelection(p,{direction:"backward"});const k=p.getLastPosition(),b=d.createRange(k,u);d.hasContent(b,{ignoreMarkers:!0})||(u=k)}}return[Zt.fromPosition(h,"toPrevious"),Zt.fromPosition(u,"toNext")]}(n);a.isTouching(c)||r.remove(r.createRange(a,c)),e.leaveUnmerged||(function(l,d,h){const u=l.model;if(!Gs(l.model.schema,d,h))return;const[g,p]=function(k,b){const A=k.getAncestors(),E=b.getAncestors();let M=0;for(;A[M]&&A[M]==E[M];)M++;return[A[M],E[M]]}(d,h);!g||!p||(!u.hasContent(g,{ignoreMarkers:!0})&&u.hasContent(p,{ignoreMarkers:!0})?hh(l,d,h,g.parent):dh(l,d,h,g.parent))}(r,a,c),i.removeDisallowedAttributes(a.parent.getChildren(),r)),gh(r,t,a),!e.doNotAutoparagraph&&function(l,d){const h=l.checkChild(d,"$text"),u=l.checkChild(d,"paragraph");return!h&&u}(i,a)&&uh(r,a,t,s),a.detach(),c.detach()})}function dh(o,t,e,n){const i=t.parent,r=e.parent;if(i!=n&&r!=n){for(t=o.createPositionAfter(i),(e=o.createPositionBefore(r)).isEqual(t)||o.insert(r,t),o.merge(t);e.parent.isEmpty;){const s=e.parent;e=o.createPositionBefore(s),o.remove(s)}Gs(o.model.schema,t,e)&&dh(o,t,e,n)}}function hh(o,t,e,n){const i=t.parent,r=e.parent;if(i!=n&&r!=n){for(t=o.createPositionAfter(i),(e=o.createPositionBefore(r)).isEqual(t)||o.insert(i,e);t.parent.isEmpty;){const s=t.parent;t=o.createPositionBefore(s),o.remove(s)}e=o.createPositionBefore(r),function(s,a){const c=a.nodeBefore,l=a.nodeAfter;c.name!=l.name&&s.rename(c,l.name),s.clearAttributes(c),s.setAttributes(Object.fromEntries(l.getAttributes()),c),s.merge(a)}(o,e),Gs(o.model.schema,t,e)&&hh(o,t,e,n)}}function Gs(o,t,e){const n=t.parent,i=e.parent;return n!=i&&!o.isLimit(n)&&!o.isLimit(i)&&function(r,s,a){const c=new B(r,s);for(const l of c.getWalker())if(a.isLimit(l.item))return!1;return!0}(t,e,o)}function uh(o,t,e,n={}){const i=o.createElement("paragraph");o.model.schema.setAllowedAttributes(i,n,o),o.insert(i,t),gh(o,e,o.createPositionAt(i,0))}function gh(o,t,e){t instanceof ze?o.setSelection(e):t.setTo(e)}function ph(o,t){const e=[];Array.from(o.getItems({direction:"backward"})).map(n=>t.createRangeOn(n)).filter(n=>(n.start.isAfter(o.start)||n.start.isEqual(o.start))&&(n.end.isBefore(o.end)||n.end.isEqual(o.end))).forEach(n=>{e.push(n.start.parent),t.remove(n)}),e.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const r=t.createRangeOn(i);i=i.parent,t.remove(r)}})}class yC{constructor(t,e,n){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0)}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(t);if(n.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new _("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?B._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new B(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=Zt.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new _("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=t:this._nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=Zt.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Zt.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Ct)||!this._canMergeLeft(t))return;const e=Zt._createBefore(t);e.stickiness="toNext";const n=Zt.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=Zt._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Zt._createAt(e.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Ct)||!this._canMergeRight(t))return;const e=Zt._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new _("insertcontent-invalid-insertion-position",this);this.position=L._createAt(e.nodeBefore,"end");const n=Zt.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=Zt._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Zt._createAt(e.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Ct&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Ct&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,e)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===e&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(t,e){return this.schema.checkChild(t,e)?t:this.schema.isLimit(t)?null:this._getAllowedIn(t.parent,e)}}function xC(o,t,e,n={}){if(!o.schema.isObject(t))throw new _("insertobject-element-not-an-object",o,{object:t});const i=e||o.document.selection;let r=i;n.findOptimalPosition&&o.schema.isBlock(t)&&(r=o.createSelection(o.schema.findOptimalInsertionRange(i,n.findOptimalPosition)));const s=Wt(i.getSelectedBlocks()),a={};return s&&Object.assign(a,o.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),o.change(c=>{r.isCollapsed||o.deleteContent(r,{doNotAutoparagraph:!0});let l=t;const d=r.anchor.parent;!o.schema.checkChild(d,t)&&o.schema.checkChild(d,"paragraph")&&o.schema.checkChild("paragraph",t)&&(l=c.createElement("paragraph"),c.insert(t,l)),o.schema.setAllowedAttributes(l,a,c);const h=o.insertContent(l,r);return h.isCollapsed||n.setSelection&&function(u,g,p,k){const b=u.model;if(p=="on")return void u.setSelection(g,"on");if(p!="after")throw new _("insertobject-invalid-place-parameter-value",b);let A=g.nextSibling;if(b.schema.isInline(g))return void u.setSelection(g,"after");!(A&&b.schema.checkChild(A,"$text"))&&b.schema.checkChild(g.parent,"paragraph")&&(A=u.createElement("paragraph"),b.schema.setAllowedAttributes(A,k,u),b.insertContent(A,u.createPositionAfter(g))),A&&u.setSelection(A,0)}(c,t,n.setSelection,a),h})}const EC=' ,.?!:;"-()';function DC(o,t){const{isForward:e,walker:n,unit:i,schema:r,treatEmojiAsSingleUnit:s}=o,{type:a,item:c,nextPosition:l}=t;if(a=="text")return o.unit==="word"?function(d,h){let u=d.position.textNode;for(u||(u=h?d.position.nodeAfter:d.position.nodeBefore);u&&u.is("$text");){const g=d.position.offset-u.startOffset;if(TC(u,g,h))u=h?d.position.nodeAfter:d.position.nodeBefore;else{if(SC(u.data,g,h))break;d.next()}}return d.position}(n,e):function(d,h,u){const g=d.position.textNode;if(g){const p=g.data;let k=d.position.offset-g.startOffset;for(;gs(p,k)||h=="character"&&ps(p,k)||u&&ul(p,k);)d.next(),k=d.position.offset-g.startOffset}return d.position}(n,i,s);if(a==(e?"elementStart":"elementEnd")){if(r.isSelectable(c))return L._createAt(c,e?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(c))return void n.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function IC(o,t){const e=o.root,n=L._createAt(e,t?"end":0);return t?new B(o,n):new B(n,o)}function SC(o,t,e){const n=t+(e?0:-1);return EC.includes(o.charAt(n))}function TC(o,t,e){return t===(e?o.offsetSize:0)}class MC extends ft(){constructor(){super(),this.markers=new wC,this.document=new gC(this),this.schema=new xA,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if(e.name==="$marker")return!0}),_A(this),this.document.registerPostFixer(yd),this.on("insertContent",(t,[e,n])=>{t.return=function(i,r,s){return i.change(a=>{const c=s||i.document.selection;c.isCollapsed||i.deleteContent(c,{doNotAutoparagraph:!0});const l=new yC(i,a,c.anchor),d=[];let h;if(r.is("documentFragment")){if(r.markers.size){const p=[];for(const[k,b]of r.markers){const{start:A,end:E}=b,M=A.isEqual(E);p.push({position:A,name:k,isCollapsed:M},{position:E,name:k,isCollapsed:M})}p.sort(({position:k},{position:b})=>k.isBefore(b)?1:-1);for(const{position:k,name:b,isCollapsed:A}of p){let E=null,M=null;const z=k.parent===r&&k.isAtStart,G=k.parent===r&&k.isAtEnd;z||G?A&&(M=z?"start":"end"):(E=a.createElement("$marker"),a.insert(E,k)),d.push({name:b,element:E,collapsed:M})}}h=r.getChildren()}else h=[r];l.handleNodes(h);let u=l.getSelectionRange();if(r.is("documentFragment")&&d.length){const p=u?pe.fromRange(u):null,k={};for(let b=d.length-1;b>=0;b--){const{name:A,element:E,collapsed:M}=d[b],z=!k[A];if(z&&(k[A]=[]),E){const G=a.createPositionAt(E,"before");k[A].push(G),a.remove(E)}else{const G=l.getAffectedRange();if(!G){M&&k[A].push(l.position);continue}M?k[A].push(G[M]):k[A].push(z?G.start:G.end)}}for(const[b,[A,E]]of Object.entries(k))A&&E&&A.root===E.root&&A.root.document&&a.addMarker(b,{usingOperation:!0,affectsData:!0,range:new B(A,E)});p&&(u=p.toRange(),p.detach())}u&&(c instanceof ze?a.setSelection(u):c.setTo(u));const g=l.getAffectedRange()||i.createRange(c.anchor);return l.destroy(),g})}(this,e,n)}),this.on("insertObject",(t,[e,n,i])=>{t.return=xC(this,e,n,i)}),this.on("canEditAt",t=>{const e=!this.document.isReadOnly;t.return=e,e||t.stop()})}change(t){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new ho,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(e){_.rethrowUnexpectedError(e,this)}}enqueueChange(t,e){try{t?typeof t=="function"?(e=t,t=new ho):t instanceof ho||(t=new ho(t)):t=new ho,this._pendingChanges.push({batch:t,callback:e}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){_.rethrowUnexpectedError(n,this)}}applyOperation(t){t._execute()}insertContent(t,e,n,...i){const r=Ws(e,n);return this.fire("insertContent",[t,r,n,...i])}insertObject(t,e,n,i,...r){const s=Ws(e,n);return this.fire("insertObject",[t,s,i,i,...r])}deleteContent(t,e){vC(this,t,e)}modifySelection(t,e){(function(n,i,r={}){const s=n.schema,a=r.direction!="backward",c=r.unit?r.unit:"character",l=!!r.treatEmojiAsSingleUnit,d=i.focus,h=new Xe({boundaries:IC(d,a),singleCharacters:!0,direction:a?"forward":"backward"}),u={walker:h,schema:s,isForward:a,unit:c,treatEmojiAsSingleUnit:l};let g;for(;g=h.next();){if(g.done)return;const p=DC(u,g.value);if(p)return void(i instanceof ze?n.change(k=>{k.setSelectionFocus(p)}):i.setFocus(p))}})(this,t,e)}getSelectedContent(t){return function(e,n){return e.change(i=>{const r=i.createDocumentFragment(),s=n.getFirstRange();if(!s||s.isCollapsed)return r;const a=s.start.root,c=s.start.getCommonPath(s.end),l=a.getNodeByPath(c);let d;d=s.start.parent==s.end.parent?s:i.createRange(i.createPositionAt(l,s.start.path[c.length]),i.createPositionAt(l,s.end.path[c.length]+1));const h=d.end.offset-d.start.offset;for(const u of d.getItems({shallow:!0}))u.is("$textProxy")?i.appendText(u.data,u.getAttributes(),r):i.append(i.cloneElement(u,!0),r);if(d!=s){const u=s._getTransformedByMove(d.start,i.createPositionAt(r,0),h)[0],g=i.createRange(i.createPositionAt(r,0),u.start);ph(i.createRange(u.end,i.createPositionAt(r,"end")),i),ph(g,i)}return r})}(this,t)}hasContent(t,e={}){const n=t instanceof B?t:B._createIn(t);if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=e;if(!r){for(const s of this.markers.getMarkersIntersectingRange(n))if(s.affectsData)return!0}for(const s of n.getItems())if(this.schema.isContent(s)&&(!s.is("$textProxy")||!i||s.data.search(/\S/)!==-1))return!0;return!1}canEditAt(t){const e=Ws(t);return this.fire("canEditAt",[e])}createPositionFromPath(t,e,n){return new L(t,e,n)}createPositionAt(t,e){return L._createAt(t,e)}createPositionAfter(t){return L._createAfter(t)}createPositionBefore(t){return L._createBefore(t)}createRange(t,e){return new B(t,e)}createRangeIn(t){return B._createIn(t)}createRangeOn(t){return B._createOn(t)}createSelection(...t){return new ge(...t)}createBatch(t){return new ho(t)}createOperationFromJSON(t){return KA.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new CC(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return t}}function Ws(o,t){if(o)return o instanceof ge||o instanceof ze?o:o instanceof zn?t||t===0?new ge(o,t):o.is("rootElement")?new ge(o,"in"):new ge(o,"on"):new ge(o)}class BC extends pn{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}class Ks extends pn{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(t){this.fire(t.type,t)}}class nn{constructor(t){this.document=t}createDocumentFragment(t){return new Ln(this.document,t)}createElement(t,e,n){return new he(this.document,t,e,n)}createText(t){return new vt(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,n){return n._insertChild(t,e)}removeChildren(t,e,n){return n._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const n=t.parent;if(n){const i=n.getChildIndex(t);return this.removeChildren(i,1,n),this.insertChild(i,e,n),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const n=e.getChildIndex(t);this.remove(t),this.insertChild(n,t.getChildren(),e)}}rename(t,e){const n=new he(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){de(t)&&n===void 0?e._setStyle(t):n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}}class NC{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new _("commandcollection-command-not-found",this,{commandName:t});return n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}var PC=Object.defineProperty,mh=Object.getOwnPropertySymbols,OC=Object.prototype.hasOwnProperty,LC=Object.prototype.propertyIsEnumerable,fh=(o,t,e)=>t in o?PC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;const $s="contentEditing",kh="common";class zC{constructor(t){this.keystrokeInfos=new Map,this._editor=t;const e=t.locale.t;this.addKeystrokeInfoCategory({id:$s,label:e("Content editing keystrokes"),description:e("These keyboard shortcuts allow for quick access to content editing features.")}),this.addKeystrokeInfoCategory({id:"navigation",label:e("User interface and content navigation keystrokes"),description:e("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:[{label:e("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:e("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:e("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:e("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:e("Navigate through the toolbar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:e("Execute the currently focused button"),keystroke:[["Enter"],["Space"]]}]}]})}addKeystrokeInfoCategory({id:t,label:e,description:n,groups:i}){this.keystrokeInfos.set(t,{id:t,label:e,description:n,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:t,id:kh}),i&&i.forEach(r=>{this.addKeystrokeInfoGroup(((s,a)=>{for(var c in a||(a={}))OC.call(a,c)&&fh(s,c,a[c]);if(mh)for(var c of mh(a))LC.call(a,c)&&fh(s,c,a[c]);return s})({categoryId:t},r))})}addKeystrokeInfoGroup({categoryId:t=$s,id:e,label:n,keystrokes:i}){const r=this.keystrokeInfos.get(t);if(!r)throw new _("accessibility-unknown-keystroke-info-category",this._editor,{groupId:e,categoryId:t});r.groups.set(e,{id:e,label:n,keystrokes:i||[]})}addKeystrokeInfos({categoryId:t=$s,groupId:e=kh,keystrokes:n}){if(!this.keystrokeInfos.has(t))throw new _("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:t,keystrokes:n});const i=this.keystrokeInfos.get(t);if(!i.groups.has(e))throw new _("accessibility-unknown-keystroke-info-group",this._editor,{groupId:e,categoryId:t,keystrokes:n});i.groups.get(e).keystrokes.push(...n)}}var bh=Object.getOwnPropertySymbols,RC=Object.prototype.hasOwnProperty,jC=Object.prototype.propertyIsEnumerable,wh=(o,t)=>{var e={};for(var n in o)RC.call(o,n)&&t.indexOf(n)<0&&(e[n]=o[n]);if(o!=null&&bh)for(var n of bh(o))t.indexOf(n)<0&&jC.call(o,n)&&(e[n]=o[n]);return e};class FC extends ft(){constructor(t={}){super();const e=this.constructor,n=e.defaultConfig||{},{translations:i}=n,r=wh(n,["translations"]),s=t,{translations:a=i}=s,c=wh(s,["translations"]),l=t.language||r.language;this._context=t.context||new bl({language:l,translations:a}),this._context._addEditor(this,!t.context);const d=Array.from(e.builtinPlugins||[]);this.config=new Vc(c,r),this.config.define("plugins",d),this.config.define(this._context._getEditorConfig()),this.plugins=new fl(this,d,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new NC,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new MC,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const h=new i0;this.data=new GA(this.model,h),this.editing=new vA(this.model,h),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new WA([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ow(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new zC(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(t){throw new _("editor-isreadonly-has-no-setter")}enableReadOnlyMode(t){if(typeof t!="string"&&typeof t!="symbol")throw new _("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)||(this._readOnlyLocks.add(t),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(t){if(typeof t!="string"&&typeof t!="symbol")throw new _("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)&&(this._readOnlyLocks.delete(t),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(t){this.data.set(t)}getData(t){return this.data.get(t)}initPlugins(){const t=this.config,e=t.get("plugins"),n=t.get("removePlugins")||[],i=t.get("extraPlugins")||[],r=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(i),n,r)}destroy(){let t=Promise.resolve();return this.state=="initializing"&&(t=new Promise(e=>this.once("ready",e))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(t,...e){try{return this.commands.execute(t,...e)}catch(n){_.rethrowUnexpectedError(n,this)}}focus(){this.editing.view.focus()}static create(...t){throw new Error("This is an abstract method.")}}function Ys(o){return class extends o{updateSourceElement(t){if(!this.sourceElement)throw new _("editor-missing-sourceelement",this);const e=this.config.get("updateSourceElementOnDestroy"),n=this.sourceElement instanceof HTMLTextAreaElement;if(!e&&!n)return void Qc(this.sourceElement,"");const i=typeof t=="string"?t:this.data.get();Qc(this.sourceElement,i)}}}Ys.updateSourceElement=Ys(Object).prototype.updateSourceElement;class Ah extends Oi{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Be({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if(typeof t!="string")throw new _("pendingactions-add-invalid-message",this);const e=new(ft());return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const ot={bold:'',cancel:'',caption:'',check:'',cog:'',colorPalette:'',eraser:'',history:'',image:'',imageUpload:'',imageAssetManager:'',imageUrl:'',lowVision:'',textAlternative:'',loupe:'',previousArrow:'',nextArrow:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:'',dragIndicator:'',redo:'',undo:'',bulletedList:'',numberedList:'',todoList:'',codeBlock:'',browseFiles:'',heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:'',horizontalLine:'',html:'',indent:'',outdent:'',table:''};class ve extends Be{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(e,n,i)=>{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(e,n)=>{n.element&&this._parentElement&&n.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...t){if(!t.length||!t.every(e=>typeof e=="string"))throw new _("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const n of this)for(const i of t)n.delegate(i).to(e);this.on("add",(n,i)=>{for(const r of t)i.delegate(r).to(e)}),this.on("remove",(n,i)=>{for(const r of t)i.stopDelegating(r,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}remove(t){return super.remove(t)}}class Re extends kt(){constructor(t){super(),Object.assign(this,yh(vh(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,intoFragment:!1,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new _("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)tr(n)?yield n:Qs(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,i)=>new VC({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:i}),if:(n,i,r)=>new Ch({observable:t,emitter:e,attribute:n,valueIfTrue:i,callback:r})}}static extend(t,e){if(t._isRendered)throw new _("template-extend-render",[this,t]);Ih(t,yh(vh(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new _("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),Xi(this.text)?this._bindToObservable({schema:this.text,updater:HC(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){if(!this.attributes)return;const e=t.node,n=t.revertData;for(const i in this.attributes){const r=e.getAttribute(i),s=this.attributes[i];n&&(n.attributes[i]=r);const a=Sh(s)?s[0].ns:null;if(Xi(s)){const c=Sh(s)?s[0].value:s;n&&Th(i)&&c.unshift(r),this._bindToObservable({schema:c,updater:UC(e,i,a),data:t})}else if(i=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],t);else{n&&r&&Th(i)&&s.unshift(r);const c=s.map(l=>l&&l.value||l).reduce((l,d)=>l.concat(d),[]).reduce(Eh,"");go(c)||e.setAttributeNS(a,i,c)}}}_renderStyleAttribute(t,e){const n=e.node;for(const i in t){const r=t[i];Xi(r)?this._bindToObservable({schema:[r],updater:qC(n,i),data:e}):n.style[i]=r}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,i=t.isApplying;let r=0;for(const s of this.children)if(Zs(s)){if(!i){s.setParent(e);for(const a of s)n.appendChild(a.element)}}else if(tr(s))i||(s.isRendered||s.render(),n.appendChild(s.element));else if(un(s))n.appendChild(s);else if(i){const a={children:[],bindings:[],attributes:{}};t.revertData.children.push(a),s._renderNode({intoFragment:!1,node:n.childNodes[r++],isApplying:!0,revertData:a})}else n.appendChild(s.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(i=>{const[r,s]=e.split("@");return i.activateDomEventListener(r,s,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const i=n.revertData;_h(t,e,n);const r=t.filter(s=>!go(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(t,e,n));i&&i.bindings.push(r)}_revertTemplateFromNode(t,e){for(const i of e.bindings)for(const r of i)r();if(e.text)return void(t.textContent=e.text);const n=t;for(const i in e.attributes){const r=e.attributes[i];r===null?n.removeAttribute(i):n.setAttribute(i,r)}for(let i=0;i_h(t,e,n);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class VC extends ni{constructor(t){super(t),this.eventNameOrFunction=t.eventNameOrFunction}activateDomEventListener(t,e,n){const i=(r,s)=>{e&&!s.target.matches(e)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(n.node,t,i),()=>{this.emitter.stopListening(n.node,t,i)}}}class Ch extends ni{constructor(t){super(t),this.valueIfTrue=t.valueIfTrue}getValue(t){return!go(super.getValue(t))&&(this.valueIfTrue||!0)}}function Xi(o){return!!o&&(o.value&&(o=o.value),Array.isArray(o)?o.some(Xi):o instanceof ni)}function _h(o,t,{node:e}){const n=function(r,s){return r.map(a=>a instanceof ni?a.getValue(s):a)}(o,e);let i;i=o.length==1&&o[0]instanceof Ch?n[0]:n.reduce(Eh,""),go(i)?t.remove():t.set(i)}function HC(o){return{set(t){o.textContent=t},remove(){o.textContent=""}}}function UC(o,t,e){return{set(n){o.setAttributeNS(e,t,n)},remove(){o.removeAttributeNS(e,t)}}}function qC(o,t){return{set(e){o.style[t]=e},remove(){o.style[t]=null}}}function vh(o){return os(o,t=>{if(t&&(t instanceof ni||Qs(t)||tr(t)||Zs(t)))return t})}function yh(o){if(typeof o=="string"?o=function(t){return{text:[t]}}(o):o.text&&function(t){t.text=Et(t.text)}(o),o.on&&(o.eventListeners=function(t){for(const e in t)xh(t,e);return t}(o.on),delete o.on),!o.text){o.attributes&&function(e){for(const n in e)e[n].value&&(e[n].value=Et(e[n].value)),xh(e,n)}(o.attributes);const t=[];if(o.children)if(Zs(o.children))t.push(o.children);else for(const e of o.children)Qs(e)||tr(e)||un(e)?t.push(e):t.push(new Re(e));o.children=t}return o}function xh(o,t){o[t]=Et(o[t])}function Eh(o,t){return go(t)?o:go(o)?t:`${o} ${t}`}function Dh(o,t){for(const e in t)o[e]?o[e].push(...t[e]):o[e]=t[e]}function Ih(o,t){if(t.attributes&&(o.attributes||(o.attributes={}),Dh(o.attributes,t.attributes)),t.eventListeners&&(o.eventListeners||(o.eventListeners={}),Dh(o.eventListeners,t.eventListeners)),t.text&&o.text.push(...t.text),t.children&&t.children.length){if(o.children.length!=t.children.length)throw new _("ui-template-extend-children-mismatch",o);let e=0;for(const n of t.children)Ih(o.children[e++],n)}}function go(o){return!o&&o!==0}function tr(o){return o instanceof et}function Qs(o){return o instanceof Re}function Zs(o){return o instanceof ve}function Sh(o){return bt(o[0])&&o[0].ns}function Th(o){return o=="class"||o=="style"}var Mh=N(7676),GC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Mh.A,GC),Mh.A.locals;class et extends Ce(ft()){constructor(t){super(),this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Be,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t,n.t=t&&t.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Re.bind(this,this)}createCollection(t){const e=new ve(t);return this._viewCollections.add(e),e}registerChild(t){Gt(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){Gt(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new Re(t)}extendTemplate(t){Re.extend(this.template,t)}render(){if(this.isRendered)throw new _("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}var Bh=N(7801),WC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Bh.A,WC),Bh.A.locals;class er extends et{constructor(t){super(t),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${X()}`;const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class KC extends et{constructor(t,e){super(t);const n=t.t,i=new er;i.text=n("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":i.id,role:"document",tabindex:-1},children:[Ae(document,"p",{},n("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(e.values())),i]})}focus(){this.element.focus()}_createCategories(t){return t.map(e=>{const n=[Ae(document,"h3",{},e.label),...Array.from(e.groups.values()).map(i=>this._createGroup(i)).flat()];return e.description&&n.splice(1,0,Ae(document,"p",{},e.description)),Ae(document,"section",{},n)})}_createGroup(t){const e=t.keystrokes.sort((i,r)=>i.label.localeCompare(r.label)).map(i=>this._createGroupRow(i)).flat(),n=[Ae(document,"dl",{},e)];return t.label&&n.unshift(Ae(document,"h4",{},t.label)),n}_createGroupRow(t){const e=this.locale.t,n=Ae(document,"dt"),i=Ae(document,"dd"),r=function(a){return typeof a=="string"?[[a]]:typeof a[0]=="string"?[a]:a}(t.keystroke),s=[];for(const a of r)s.push(a.map($C).join(""));return n.innerHTML=t.label,i.innerHTML=s.join(", ")+(t.mayRequireFn&&f.isMac?` ${e("(may require Fn)")}`:""),[n,i]}}function $C(o){return Pi(o).split("+").map(t=>`${t}`).join("+")}const Nh='';var Ph=N(8527),YC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ph.A,YC),Ph.A.locals;class QC extends R{constructor(){super(...arguments),this.contentView=null}static get requires(){return[rn]}static get pluginName(){return"AccessibilityHelp"}init(){const t=this.editor,e=t.locale.t;t.ui.componentFactory.add("accessibilityHelp",n=>{const i=new wt(n);return i.set({label:e("Accessibility help"),tooltip:!0,withText:!1,keystroke:"Alt+0",icon:Nh}),i.on("execute",()=>this._showDialog()),i}),t.keystrokes.set("Alt+0",(n,i)=>{this._showDialog(),i()}),this._setupRootLabels()}_setupRootLabels(){const t=this.editor,e=t.editing.view,n=t.t;function i(r,s){const a=`${s.getAttribute("aria-label")}. ${n("Press %0 for help.",[Pi("Alt+0")])}`;r.setAttribute("aria-label",a,s)}t.ui.on("ready",()=>{e.change(r=>{for(const s of e.document.roots)i(r,s)}),t.on("addRoot",(r,s)=>{const a=t.editing.view.document.getRoot(s.rootName);e.change(c=>i(c,a))},{priority:"low"})})}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),n=t.locale.t;this.contentView||(this.contentView=new KC(t.locale,t.accessibility.keystrokeInfos)),e.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:n("Accessibility help"),icon:Nh,hasCloseButton:!0,content:this.contentView})}}class ZC extends ve{constructor(t,e=[]){super(e),this.locale=t}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new Re({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=Ae(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&t.childElementCount==0&&t.remove()}}var Oh=N(7621),JC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Oh.A,JC),Oh.A.locals;const Lh=class extends et{constructor(){super();const o=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",o.if("isVisible","ck-hidden",t=>!t),"ck-reset_all-excluded",o.if("isColorInherited","ck-icon_inherit-color")],viewBox:o.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const o=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=o.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:e,value:n}of Array.from(o.attributes))Lh.presentationalAttributeNames.includes(e)&&this.element.setAttribute(e,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;o.childNodes.length>0;)this.element.appendChild(o.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(o=>{o.style.fill=this.fillColor})}};let kn=Lh;kn.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];class XC extends et{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:t.to("style"),id:t.to("id")},children:[{text:t.to("text")}]})}}var zh=N(9715),t_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(zh.A,t_),zh.A.locals;class wt extends et{constructor(t,e=new XC){super(t),this._focusDelayed=null;const n=this.bindTemplate,i=X();this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${i}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(e),this.iconView=new kn,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const r={tag:"button",attributes:{class:["ck","ck-button",n.to("class"),n.if("isEnabled","ck-disabled",s=>!s),n.if("isVisible","ck-hidden",s=>!s),n.to("isOn",s=>s?"ck-on":"ck-off"),n.if("withText","ck-button_with-text"),n.if("withKeystroke","ck-button_with-keystroke")],role:n.to("role"),type:n.to("type",s=>s||"button"),tabindex:n.to("tabindex"),"aria-label":n.to("ariaLabel"),"aria-labelledby":n.to("ariaLabelledBy"),"aria-disabled":n.if("isEnabled",!0,s=>!s),"aria-pressed":n.to("isOn",s=>!!this.isToggleable&&String(!!s)),"data-cke-tooltip-text":n.to("_tooltipString"),"data-cke-tooltip-position":n.to("tooltipPosition")},children:this.children,on:{click:n.to(s=>{this.isEnabled?this.fire("execute"):s.preventDefault()})}};f.isSafari&&(this._focusDelayed||(this._focusDelayed=us(()=>this.focus(),0)),r.on.mousedown=n.to(()=>{this._focusDelayed()}),r.on.mouseup=n.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(t){return t.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),t}_createKeystrokeView(){const t=new et;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Pi(e))}]}),t}_getTooltipString(t,e,n){return t?typeof t=="string"?t:(n&&(n=Pi(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}var Rh=N(4391),e_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Rh.A,e_),Rh.A.locals;class nr extends wt{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new et;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}const Js='';var jh=N(25),n_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(jh.A,n_),jh.A.locals;class o_ extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),e&&this.children.addMany(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",n.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:n.if("isCollapsed","hidden"),"aria-labelledby":n.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const t=new wt(this.locale),e=t.bindTemplate;return t.set({withText:!0,icon:Js}),t.extendTemplate({attributes:{"aria-expanded":e.to("isOn",n=>String(n))}}),t.bind("label").to(this),t.bind("isOn").to(this,"isCollapsed",n=>!n),t.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),t}}var Fh=N(7317),i_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Fh.A,i_),Fh.A.locals,N(6931),N(9047);var Vh=N(4962),r_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Vh.A,r_),Vh.A.locals;class or extends et{constructor(t,e){super(t);const n=`ck-labeled-field-view-${X()}`,i=`ck-labeled-field-view-status-${X()}`;this.fieldView=e(this,n,i),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,a)=>s||a);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",s=>!s),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(t){const e=new er(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new et(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),e}focus(t){this.fieldView.focus(t)}}class s_ extends et{constructor(t){super(t),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new Qt,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to((...n)=>{this.fire("input",...n),this._updateIsEmpty()}),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||t===0?t:""}}var Hh=N(253),a_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Hh.A,a_),Hh.A.locals;class c_ extends s_{constructor(t){super(t),this.set("inputMode","text");const e=this.bindTemplate;this.extendTemplate({attributes:{inputmode:e.to("inputMode")}})}}class l_ extends c_{constructor(t){super(t),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var Uh=N(1671),d_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Uh.A,d_),Uh.A.locals;class h_ extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",n=>`ck-dropdown__panel_${n}`),e.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:e.to(n=>{n.target.tagName.toLocaleLowerCase()!=="input"&&n.preventDefault()})}})}focus(){if(this.children.length){const t=this.children.first;typeof t.focus=="function"?t.focus():Q("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const t=this.children.last;typeof t.focusLast=="function"?t.focusLast():t.focus()}}}var qh=N(8149),u_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(qh.A,u_),qh.A.locals;const Xs=class extends et{constructor(o,t,e){super(o);const n=this.bindTemplate;this.buttonView=t,this.panelView=e,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new oe,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",i=>!i)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,e]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(t,e,n)=>{if(n)if(this.panelPosition==="auto"){const i=Xs._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=i?i.name:this._panelPositions[0].name}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const o=(t,e)=>{this.isOpen&&(this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",o),this.keystrokes.set("esc",o)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:o,north:t,southEast:e,southWest:n,northEast:i,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=Xs.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[e,n,s,a,o,i,r,c,l,t]:[n,e,a,s,o,r,i,l,c,t]}};let ta=Xs;ta.defaultPanelPositions={south:(o,t)=>({top:o.bottom,left:o.left-(t.width-o.width)/2,name:"s"}),southEast:o=>({top:o.bottom,left:o.left,name:"se"}),southWest:(o,t)=>({top:o.bottom,left:o.left-t.width+o.width,name:"sw"}),southMiddleEast:(o,t)=>({top:o.bottom,left:o.left-(t.width-o.width)/4,name:"sme"}),southMiddleWest:(o,t)=>({top:o.bottom,left:o.left-3*(t.width-o.width)/4,name:"smw"}),north:(o,t)=>({top:o.top-t.height,left:o.left-(t.width-o.width)/2,name:"n"}),northEast:(o,t)=>({top:o.top-t.height,left:o.left,name:"ne"}),northWest:(o,t)=>({top:o.top-t.height,left:o.left-t.width+o.width,name:"nw"}),northMiddleEast:(o,t)=>({top:o.top-t.height,left:o.left-(t.width-o.width)/4,name:"nme"}),northMiddleWest:(o,t)=>({top:o.top-t.height,left:o.left-3*(t.width-o.width)/4,name:"nmw"})},ta._getOptimalPosition=ss;class g_ extends wt{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new kn;return t.content=Js,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}class ye extends kt(){constructor(t){if(super(),this.focusables=t.focusables,this.focusTracker=t.focusTracker,this.keystrokeHandler=t.keystrokeHandler,this.actions=t.actions,t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];typeof n=="string"&&(n=[n]);for(const i of n)t.keystrokeHandler.set(i,(r,s)=>{this[e](),s()})}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(ea)||null}get last(){return this.focusables.filter(ea).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let t=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((e,n)=>{const i=e.element===this.focusTracker.focusedElement;return i&&(t=n),i}),t)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const t=this.next;t&&this.focusables.getIndex(t)===this.current||t===this.first?this.fire("forwardCycle"):this._focus(t,1)}focusPrevious(){const t=this.previous;t&&this.focusables.getIndex(t)===this.current||t===this.last?this.fire("backwardCycle"):this._focus(t,-1)}_focus(t,e){t&&this.focusTracker.focusedElement!==t.element&&t.focus(e)}_getDomFocusableItem(t){const e=this.focusables.length;if(!e)return null;const n=this.current;if(n===null)return this[t===1?"first":"last"];let i=this.focusables.get(n),r=(n+e+t)%e;do{const s=this.focusables.get(r);if(ea(s)){i=s;break}r=(r+e+t)%e}while(r!==n);return i}}function ea(o){return oi(o)&&Mn(o.element)}function oi(o){return!(!("focus"in o)||typeof o.focus!="function")}class Gh extends et{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class p_ extends et{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}var m_=Object.defineProperty,Wh=Object.getOwnPropertySymbols,f_=Object.prototype.hasOwnProperty,k_=Object.prototype.propertyIsEnumerable,Kh=(o,t,e)=>t in o?m_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,$h=(o,t)=>{for(var e in t||(t={}))f_.call(t,e)&&Kh(o,e,t[e]);if(Wh)for(var e of Wh(t))k_.call(t,e)&&Kh(o,e,t[e]);return o};function Yh(o){if(Array.isArray(o))return{items:o,removeItems:[]};const t={items:[],removeItems:[]};return o?$h($h({},t),o):t}var Qh=N(9677),b_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Qh.A,b_),Qh.A.locals;const{threeVerticalDots:Zh}=ot,w_={alignLeft:ot.alignLeft,bold:ot.bold,importExport:ot.importExport,paragraph:ot.paragraph,plus:ot.plus,text:ot.text,threeVerticalDots:ot.threeVerticalDots,pilcrow:ot.pilcrow,dragIndicator:ot.dragIndicator};class na extends et{constructor(t,e){super(t);const n=this.bindTemplate,i=this.t;this.options=e||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new oe,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new A_(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=t.uiLanguageDirection==="rtl";this._focusCycler=new ye({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var a;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(a=this,a.bindTemplate.to(c=>{c.target===a.element&&c.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new v_(this):new C_(this)}render(){super.render(),this.focusTracker.add(this.element);for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e,n){this.items.addMany(this._buildItemsFromConfig(t,e,n))}_buildItemsFromConfig(t,e,n){const i=Yh(t),r=n||i.removeItems;return this._cleanItemsConfiguration(i.items,e,r).map(s=>bt(s)?this._createNestedToolbarDropdown(s,e,r):s==="|"?new Gh:s==="-"?new p_:e.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(t,e,n){const i=t.filter((r,s,a)=>r==="|"||n.indexOf(r)===-1&&(r==="-"?!this.options.shouldGroupWhenFull||(Q("toolbarview-line-break-ignored-when-grouping-items",a),!1):!(!bt(r)&&!e.has(r))||(Q("toolbarview-item-unavailable",{item:r}),!1)));return this._cleanSeparatorsAndLineBreaks(i)}_cleanSeparatorsAndLineBreaks(t){const e=s=>s!=="-"&&s!=="|",n=t.length,i=t.findIndex(e);if(i===-1)return[];const r=n-t.slice().reverse().findIndex(e);return t.slice(i,r).filter((s,a,c)=>e(s)?!0:!(a>0&&c[a-1]===s))}_createNestedToolbarDropdown(t,e,n){let{label:i,icon:r,items:s,tooltip:a=!0,withText:c=!1}=t;if(s=this._cleanItemsConfiguration(s,e,n),!s.length)return null;const l=on(this.locale);return i||Q("toolbarview-nested-toolbar-dropdown-missing-label",t),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:i,tooltip:a,withText:!!c}),r!==!1?l.buttonView.icon=w_[r]||r||Zh:l.buttonView.withText=!0,oa(l,()=>l.toolbarView._buildItemsFromConfig(s,e,n)),l}}class A_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class C_{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(n=>n),t.focusables.bindTo(t.items).using(n=>oi(n)?n:null),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class v_{constructor(t){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),t.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),t.children.on("change",this._updateFocusCyclableItems.bind(this)),t.items.on("change",(e,n)=>{const i=n.index,r=Array.from(n.added);for(const s of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=i;sthis.ungroupedItems.length?this.groupedItems.add(a,s-this.ungroupedItems.length):this.ungroupedItems.add(a,s)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!Mn(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,n=new dt(t.lastChild),i=new dt(t);if(!this.cachedPadding){const r=$.window.getComputedStyle(t),s=e==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[s])}return e==="ltr"?n.right>i.right-this.cachedPadding:n.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Gh),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,n=on(t);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=t.uiLanguageDirection==="ltr"?"sw":"se",oa(n,this.groupedItems),n.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:t.uiLanguageDirection==="rtl"?"se":"sw",icon:Zh}),n}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{oi(t)&&this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class ir extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",e.if("isVisible","ck-hidden",n=>!n)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class Jh extends et{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class rr extends et{constructor(t,e=new er){super(t);const n=this.bindTemplate,i=new tu(t);this.set({label:"",isVisible:!0}),this.labelView=e,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,i]),i.set({role:"group",ariaLabelledBy:e.id}),i.focusTracker.destroy(),i.keystrokes.destroy(),this.items=i.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",n.if("isVisible","ck-hidden",r=>!r)]},children:this.children})}focus(){if(this.items){const t=this.items.find(e=>!(e instanceof Jh));t&&t.focus()}}}var Xh=N(5199),y_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Xh.A,y_),Xh.A.locals;class tu extends et{constructor(t){super(t),this._listItemGroupToChangeListeners=new WeakMap;const e=this.bindTemplate;this.focusables=new ve,this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusCycler=new ye({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:e.to("role"),"aria-label":e.to("ariaLabel"),"aria-labelledby":e.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const t of this.items)t instanceof rr?this._registerFocusableItemsGroup(t):t instanceof ir&&this._registerFocusableListItem(t);this.items.on("change",(t,e)=>{for(const n of e.removed)n instanceof rr?this._deregisterFocusableItemsGroup(n):n instanceof ir&&this._deregisterFocusableListItem(n);for(const n of Array.from(e.added).reverse())n instanceof rr?this._registerFocusableItemsGroup(n,e.index):this._registerFocusableListItem(n,e.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(t,e){this.focusTracker.add(t.element),this.focusables.add(t,e)}_deregisterFocusableListItem(t){this.focusTracker.remove(t.element),this.focusables.remove(t)}_getOnGroupItemsChangeCallback(t){return(e,n)=>{for(const i of n.removed)this._deregisterFocusableListItem(i);for(const i of Array.from(n.added).reverse())this._registerFocusableListItem(i,this.items.getIndex(t)+n.index)}}_registerFocusableItemsGroup(t,e){Array.from(t.items).forEach((i,r)=>{const s=e!==void 0?e+r:void 0;this._registerFocusableListItem(i,s)});const n=this._getOnGroupItemsChangeCallback(t);this._listItemGroupToChangeListeners.set(t,n),t.items.on("change",n)}_deregisterFocusableItemsGroup(t){for(const e of t.items)this._deregisterFocusableListItem(e);t.items.off("change",this._listItemGroupToChangeListeners.get(t)),this._listItemGroupToChangeListeners.delete(t)}}var eu=N(1792),x_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(eu.A,x_),eu.A.locals;class sr extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(e),this.arrowView=this._createArrowView(),this.keystrokes=new oe,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",n.to("class"),n.if("isVisible","ck-hidden",i=>!i),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(t){const e=t||new wt;return t||e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const t=new wt,e=t.bindTemplate;return t.icon=Js,t.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":e.to("isOn"),"aria-haspopup":!0,"aria-expanded":e.to("isOn",n=>String(n))}}),t.bind("isEnabled").to(this),t.bind("label").to(this),t.bind("tooltip").to(this),t.delegate("execute").to(this,"open"),t}}var nu=N(1666),E_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(nu.A,E_),nu.A.locals;var ou=N(3629),D_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ou.A,D_),ou.A.locals;function on(o,t=g_){const e=typeof t=="function"?new t(o):t,n=new h_(o),i=new ta(o,e,n);return e.bind("isEnabled").to(i),e instanceof sr?e.arrowView.bind("isOn").to(i,"isOpen"):e.bind("isOn").to(i,"isOpen"),function(r){(function(s){s.on("render",()=>{v({emitter:s,activator:()=>s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...s.focusTracker._elements]})})})(r),function(s){s.on("execute",a=>{a.source instanceof nr||(s.isOpen=!1)})}(r),function(s){s.focusTracker.on("change:isFocused",(a,c,l)=>{s.isOpen&&!l&&(s.isOpen=!1)})}(r),function(s){s.keystrokes.set("arrowdown",(a,c)=>{s.isOpen&&(s.panelView.focus(),c())}),s.keystrokes.set("arrowup",(a,c)=>{s.isOpen&&(s.panelView.focusLast(),c())})}(r),function(s){s.on("change:isOpen",(a,c,l)=>{if(l)return;const d=s.panelView.element;d&&d.contains($.document.activeElement)&&s.buttonView.focus()})}(r),function(s){s.on("change:isOpen",(a,c,l)=>{l&&s.panelView.focus()},{priority:"low"})}(r)}(i),i}function oa(o,t,e={}){o.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),o.isOpen?iu(o,t,e):o.once("change:isOpen",()=>iu(o,t,e),{priority:"highest"}),e.enableActiveItemFocusOnDropdownOpen&&au(o,()=>o.toolbarView.items.find(n=>n.isOn))}function iu(o,t,e){const n=o.locale,i=n.t,r=o.toolbarView=new na(n),s=typeof t=="function"?t():t;r.ariaLabel=e.ariaLabel||i("Dropdown toolbar"),e.maxWidth&&(r.maxWidth=e.maxWidth),e.class&&(r.class=e.class),e.isCompact&&(r.isCompact=e.isCompact),e.isVertical&&(r.isVertical=!0),s instanceof ve?r.items.bindTo(s).using(a=>a):r.items.addMany(s),o.panelView.children.add(r),r.items.delegate("execute").to(o)}function ru(o,t,e={}){o.isOpen?su(o,t,e):o.once("change:isOpen",()=>su(o,t,e),{priority:"highest"}),au(o,()=>o.listView.items.find(n=>n instanceof ir&&n.children.first.isOn))}function su(o,t,e){const n=o.locale,i=o.listView=new tu(n),r=typeof t=="function"?t():t;i.ariaLabel=e.ariaLabel,i.role=e.role,cu(o,i.items,r,n),o.panelView.children.add(i),i.items.delegate("execute").to(o)}function au(o,t){o.on("change:isOpen",()=>{if(!o.isOpen)return;const e=t();e&&(typeof e.focus=="function"?e.focus():Q("ui-dropdown-focus-child-on-open-child-missing-focus",{view:e}))},{priority:At.low-10})}function cu(o,t,e,n){t.bindTo(e).using(i=>{if(i.type==="separator")return new Jh(n);if(i.type==="group"){const r=new rr(n);return r.set({label:i.label}),cu(o,r.items,i.items,n),r.items.delegate("execute").to(o),r}if(i.type==="button"||i.type==="switchbutton"){const r=new ir(n);let s;return i.type==="button"?(s=new wt(n),s.extendTemplate({attributes:{"aria-checked":s.bindTemplate.to("isOn")}})):s=new nr(n),s.bind(...Object.keys(i.model)).to(i.model),s.delegate("execute").to(r),r.children.add(s),r}return null})}const ar=(o,t,e)=>{const n=new l_(o.locale);return n.set({id:t,ariaDescribedById:e}),n.bind("isReadOnly").to(o,"isEnabled",i=>!i),n.bind("hasError").to(o,"errorText",i=>!!i),n.on("input",()=>{o.errorText=null}),o.bind("isEmpty","isFocused","placeholder").to(n),n};var lu=N(1905),I_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(lu.A,I_),lu.A.locals;var du=N(6309),S_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(du.A,S_),du.A.locals;class T_{constructor(t){this._components=new Map,this.editor=t}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(ia(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new _("componentfactory-item-missing",this,{name:t});return this._components.get(ia(t)).callback(this.editor.locale)}has(t){return this._components.has(ia(t))}}function ia(o){return String(o).toLowerCase()}var hu=N(7913),M_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(hu.A,M_),hu.A.locals;class B_ extends et{constructor(t,e={}){super(t);const n=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",n.to("class")]},children:this.children}),e.icon&&(this.iconView=new kn,this.iconView.content=e.icon,this.children.add(this.iconView));const i=new et(t);i.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:n.to("label")}]}),this.children.add(i)}}var uu=N(9822),N_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(uu.A,N_),uu.A.locals;class P_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.keystrokes=new oe,this._focusTracker=new Qt,this._focusables=new ve,this.focusCycler=new ye({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(t){for(const e of t){const n=new wt(this.locale);let i;for(i in n.on("execute",()=>e.onExecute()),e.onCreate&&e.onCreate(n),e)i!="onExecute"&&i!="onCreate"&&n.set(i,e[i]);this.children.add(n)}this._updateFocusCyclableItems()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(t=>{this._focusables.add(t),this._focusTracker.add(t.element)})}}class O_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}var gu=N(9819),L_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(gu.A,L_),gu.A.locals;const cr="screen-center",pu="editor-center",z_="editor-top-side",R_="editor-top-center",j_="editor-bottom-center",F_="editor-above-center",V_="editor-below-center",mu=oo("px"),fu=class extends function(o){return class extends o{constructor(...t){super(...t),this._onDragBound=this._onDrag.bind(this),this._onDragEndBound=this._onDragEnd.bind(this),this._lastDraggingCoordinates={x:0,y:0},this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo($.document,"mouseup",this._onDragEndBound),this.listenTo($.document,"touchend",this._onDragEndBound),this.listenTo($.document,"mousemove",this._onDragBound),this.listenTo($.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening($.document,"mouseup",this._onDragEndBound),this.stopListening($.document,"touchend",this._onDragEndBound),this.stopListening($.document,"mousemove",this._onDragBound),this.stopListening($.document,"touchmove",this._onDragBound)}_onDragStart(t,e){if(!this._isHandleElementPressed(e))return;this._attachDragListeners();let n=0,i=0;e instanceof MouseEvent?(n=e.clientX,i=e.clientY):(n=e.touches[0].clientX,i=e.touches[0].clientY),this._lastDraggingCoordinates={x:n,y:i},this.isDragging=!0}_onDrag(t,e){if(!this.isDragging)return void this._detachDragListeners();let n=0,i=0;e instanceof MouseEvent?(n=e.clientX,i=e.clientY):(n=e.touches[0].clientX,i=e.touches[0].clientY),e.preventDefault(),this.fire("drag",{deltaX:Math.round(n-this._lastDraggingCoordinates.x),deltaY:Math.round(i-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:n,y:i}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(t){return!!this.dragHandleElement&&(this.dragHandleElement===t.target||t.target instanceof HTMLElement&&this.dragHandleElement.contains(t.target))}}}(et){constructor(o,{getCurrentDomRoot:t,getViewportOffset:e}){super(o),this.wasMoved=!1;const n=this.bindTemplate,i=o.t;this.set("className",""),this.set("ariaLabel",i("Editor dialog")),this.set("isModal",!1),this.set("position",cr),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=e,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new oe,this.focusTracker=new Qt,this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",r=>!r),n.if("_isVisible","ck-hidden",r=>!r)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",r=>mu(r)),left:n.to("_left",r=>mu(r)),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(o,t)=>{this.fire("close",{source:"escKeyPress"}),t()}),this.on("drag",(o,{deltaX:t,deltaY:e})=>{this.wasMoved=!0,this.moveBy(t,e)}),this.listenTo($.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo($.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(o,t,e)=>{e&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView?this.headerView.element:null}setupParts({icon:o,title:t,hasCloseButton:e=!0,content:n,actionButtons:i}){t&&(this.headerView=new B_(this.locale,{icon:o}),e&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),n&&(n instanceof et&&(n=[n]),this.contentView=new O_(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),i&&(this.actionsView=new P_(this.locale),this.actionsView.setButtons(i),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(o,t){const e=this._getViewportRect(),n=this._getDialogRect();o+n.width>e.right&&(o=e.right-n.width),o{var e;this._focusables.add(t),this.focusTracker.add(t.element),oi(e=t)&&"focusCycler"in e&&e.focusCycler instanceof ye&&(this.listenTo(t.focusCycler,"forwardCycle",n=>{this._focusCycler.focusNext(),this._focusCycler.next!==this._focusCycler.focusables.get(this._focusCycler.current)&&n.stop()}),this.listenTo(t.focusCycler,"backwardCycle",n=>{this._focusCycler.focusPrevious(),this._focusCycler.previous!==this._focusCycler.focusables.get(this._focusCycler.current)&&n.stop()}))})}_createCloseButton(){const o=new wt(this.locale),t=this.locale.t;return o.set({label:t("Close"),tooltip:!0,icon:ot.cancel}),o.on("execute",()=>this.fire("close",{source:"closeButton"})),o}};let lr=fu;lr.defaultOffset=15;class rn extends R{constructor(t){super(t);const e=t.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set("id",null),t.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:e("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}static get pluginName(){return"Dialog"}_initShowHideListeners(){this.on("show",(t,e)=>{this._show(e)}),this.on("show",(t,e)=>{e.onShow&&e.onShow(this)},{priority:"low"}),this.on("hide",()=>{rn._visibleDialogPlugin&&rn._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const t=this.editor;t.keystrokes.set("Ctrl+F6",(e,n)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?t.editing.view.focus():this.view.focus(),n())})}_initMultiRootIntegration(){const t=this.editor.model;t.document.on("change:data",()=>{if(!this.view)return;const e=t.document.differ.getChangedRoots();for(const n of e)n.state&&this.view.updatePosition()})}show(t){this.hide(),this.fire(`show:${t.id}`,t)}_show({id:t,icon:e,title:n,hasCloseButton:i=!0,content:r,actionButtons:s,className:a,isModal:c,position:l,onHide:d}){const h=this.editor;this.view=new lr(h.locale,{getCurrentDomRoot:()=>h.editing.view.getDomRoot(h.model.document.selection.anchor.root.rootName),getViewportOffset:()=>h.ui.viewportOffset});const u=this.view;u.on("close",()=>{this.hide()}),h.ui.view.body.add(u),h.ui.focusTracker.add(u.element),h.keystrokes.listenTo(u.element),l||(l=c?cr:pu),u.set({position:l,_isVisible:!0,className:a,isModal:c}),u.setupParts({icon:e,title:n,hasCloseButton:i,content:r,actionButtons:s}),this.id=t,d&&(this._onHide=d),this.isOpen=!0,rn._visibleDialogPlugin=this}hide(){rn._visibleDialogPlugin&&rn._visibleDialogPlugin.fire(`hide:${rn._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const t=this.editor,e=this.view;e.contentView&&e.contentView.reset(),t.ui.view.body.remove(e),t.ui.focusTracker.remove(e.element),t.keystrokes.stopListening(e.element),e.destroy(),t.editing.view.focus(),this.id=null,this.isOpen=!1,rn._visibleDialogPlugin=null}}var ku=N(3710),H_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ku.A,H_),ku.A.locals;var U_=Object.defineProperty,bu=Object.getOwnPropertySymbols,q_=Object.prototype.hasOwnProperty,G_=Object.prototype.propertyIsEnumerable,wu=(o,t,e)=>t in o?U_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,mt=(o,t)=>{for(var e in t||(t={}))q_.call(t,e)&&wu(o,e,t[e]);if(bu)for(var e of bu(t))G_.call(t,e)&&wu(o,e,t[e]);return o};const Au=oo("px"),Cu=$.document.body,W_={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}},ra=class extends et{constructor(o){super(o);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Au),left:t.to("left",Au)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(o){this.show();const t=ra.defaultPositions,e=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast,t.viewportStickyNorth],limiter:Cu,fitInViewport:!0},o),n=ra._getOptimalPosition(e)||W_,i=parseInt(n.left),r=parseInt(n.top),s=n.name,a=n.config||{},{withArrow:c=!0}=a;this.top=r,this.left=i,this.position=s,this.withArrow=c}pin(o){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(o):this._stopPinning()},this._startPinning(o),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(o){this.attachTo(o);const t=sa(o.target),e=o.limiter?sa(o.limiter):Cu;this.listenTo($.document,"scroll",(n,i)=>{const r=i.target,s=t&&r.contains(t),a=e&&r.contains(e);!s&&!a&&t&&e||this.attachTo(o)},{useCapture:!0}),this.listenTo($.window,"resize",()=>{this.attachTo(o)})}_stopPinning(){this.stopListening($.document,"scroll"),this.stopListening($.window,"resize")}};let se=ra;function sa(o){return Tn(o)?o:Mi(o)?o.commonAncestorContainer:typeof o=="function"?sa(o()):null}function _u(o={}){const{sideOffset:t=se.arrowSideOffset,heightOffset:e=se.arrowHeightOffset,stickyVerticalOffset:n=se.stickyVerticalOffset,config:i}=o;return{northWestArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.left-t,name:"arrow_sw"},i&&{config:i}),northWestArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.left-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northWestArrowSouth:(a,c)=>mt({top:r(a,c),left:a.left-c.width/2,name:"arrow_s"},i&&{config:i}),northWestArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.left-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northWestArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.left-c.width+t,name:"arrow_se"},i&&{config:i}),northArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-t,name:"arrow_sw"},i&&{config:i}),northArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northArrowSouth:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-c.width/2,name:"arrow_s"},i&&{config:i}),northArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-c.width+t,name:"arrow_se"},i&&{config:i}),northEastArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.right-t,name:"arrow_sw"},i&&{config:i}),northEastArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.right-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northEastArrowSouth:(a,c)=>mt({top:r(a,c),left:a.right-c.width/2,name:"arrow_s"},i&&{config:i}),northEastArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.right-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northEastArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.right-c.width+t,name:"arrow_se"},i&&{config:i}),southWestArrowNorthWest:a=>mt({top:s(a),left:a.left-t,name:"arrow_nw"},i&&{config:i}),southWestArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.left-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southWestArrowNorth:(a,c)=>mt({top:s(a),left:a.left-c.width/2,name:"arrow_n"},i&&{config:i}),southWestArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.left-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southWestArrowNorthEast:(a,c)=>mt({top:s(a),left:a.left-c.width+t,name:"arrow_ne"},i&&{config:i}),southArrowNorthWest:a=>mt({top:s(a),left:a.left+a.width/2-t,name:"arrow_nw"},i&&{config:i}),southArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.left+a.width/2-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southArrowNorth:(a,c)=>mt({top:s(a),left:a.left+a.width/2-c.width/2,name:"arrow_n"},i&&{config:i}),southArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.left+a.width/2-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southArrowNorthEast:(a,c)=>mt({top:s(a),left:a.left+a.width/2-c.width+t,name:"arrow_ne"},i&&{config:i}),southEastArrowNorthWest:a=>mt({top:s(a),left:a.right-t,name:"arrow_nw"},i&&{config:i}),southEastArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.right-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southEastArrowNorth:(a,c)=>mt({top:s(a),left:a.right-c.width/2,name:"arrow_n"},i&&{config:i}),southEastArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.right-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southEastArrowNorthEast:(a,c)=>mt({top:s(a),left:a.right-c.width+t,name:"arrow_ne"},i&&{config:i}),westArrowEast:(a,c)=>mt({top:a.top+a.height/2-c.height/2,left:a.left-c.width-e,name:"arrow_e"},i&&{config:i}),eastArrowWest:(a,c)=>mt({top:a.top+a.height/2-c.height/2,left:a.right+e,name:"arrow_w"},i&&{config:i}),viewportStickyNorth:(a,c,l,d)=>{const h=d||l;return a.getIntersection(h)?h.height-a.height>n?null:{top:h.top+n,left:a.left+a.width/2-c.width/2,name:"arrowless",config:mt({withArrow:!1},i)}:null}};function r(a,c){return a.top-c.height-e}function s(a){return a.bottom+e}}se.arrowSideOffset=25,se.arrowHeightOffset=10,se.stickyVerticalOffset=20,se._getOptimalPosition=ss,se.defaultPositions=_u();var vu=N(9205),K_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(vu.A,K_),vu.A.locals;const yu="ck-tooltip",ae=class extends Ce(){constructor(o){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver=null,this._mutationObserver=null,ae._editors.add(o),ae._instance)return ae._instance;ae._instance=this,this.tooltipTextView=new et(o.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new se(o.locale),this.balloonPanelView.class=yu,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(t){const e=new MutationObserver(()=>{t()});return{attach(n){e.observe(n,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=Wo(this._pinTooltip,600),this.listenTo($.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo($.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo($.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo($.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo($.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(o){const t=o.ui.view&&o.ui.view.body;ae._editors.delete(o),this.stopListening(o.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),ae._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),ae._instance=null)}static getPositioningFunctions(o){const t=ae.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[o]}_onEnterOrFocus(o,{target:t}){const e=aa(t);e&&e!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(e,xu(e)))}_onLeaveOrBlur(o,{target:t,relatedTarget:e}){if(o.name==="mouseleave"){if(!Tn(t)||this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const n=aa(t),i=aa(e);n&&n!==i&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(o,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(o,{text:t,position:e,cssClass:n}){const i=Wt(ae._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.pin({target:o,positions:ae.getPositioningFunctions(e)}),this._resizeObserver=new zo(o,()=>{Mn(o)||this._unpinTooltip()}),this._mutationObserver.attach(o),this.balloonPanelView.class=[yu,n].filter(r=>r).join(" ");for(const r of ae._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=o,this._currentTooltipPosition=e}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const o of ae._editors)this.stopListening(o.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy(),this._mutationObserver.detach()}_updateTooltipPosition(){const o=xu(this._currentElementWithTooltip);Mn(this._currentElementWithTooltip)&&o.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:ae.getPositioningFunctions(o.position)}):this._unpinTooltip()}};let dr=ae;function aa(o){return Tn(o)?o.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function xu(o){return{text:o.dataset.ckeTooltipText,position:o.dataset.ckeTooltipPosition||"s",cssClass:o.dataset.ckeTooltipClass||""}}dr.defaultBalloonPositions=_u({heightOffset:5,sideOffset:13}),dr._editors=new Set,dr._instance=null;const hr=function(o,t,e){var n=!0,i=!0;if(typeof o!="function")throw new TypeError("Expected a function");return bt(e)&&(n="leading"in e?!!e.leading:n,i="trailing"in e?!!e.trailing:i),Wo(o,t,{leading:n,maxWait:t,trailing:i})};var $_=Object.defineProperty,Eu=Object.getOwnPropertySymbols,Y_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,Du=(o,t,e)=>t in o?$_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Z_=(o,t)=>{for(var e in t||(t={}))Y_.call(t,e)&&Du(o,e,t[e]);if(Eu)for(var e of Eu(t))Q_.call(t,e)&&Du(o,e,t[e]);return o};const J_=50,X_=350,tv="Powered by";class ev extends Ce(){constructor(t){super(),this.editor=t,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=hr(this._showBalloon.bind(this),50,{leading:!0}),t.on("ready",this._handleEditorReady.bind(this))}destroy(){const t=this._balloonView;t&&(t.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const t=this.editor;(t.config.get("ui.poweredBy.forceVisible")||function(e){function n(g){return g.length>=40&&g.length<=255?"VALID":"INVALID"}if(!e)return"INVALID";let i="";try{i=atob(e)}catch{return"INVALID"}const r=i.split("-"),s=r[0],a=r[1];if(!a)return n(e);try{atob(a)}catch{try{if(atob(s),!atob(s).length)return n(e)}catch{return n(e)}}if(s.length<40||s.length>255)return"INVALID";let c="";try{atob(s),c=atob(a)}catch{return"INVALID"}if(c.length!==8)return"INVALID";const l=Number(c.substring(0,4)),d=Number(c.substring(4,6))-1,h=Number(c.substring(6,8)),u=new Date(l,d,h);return u{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),t.ui.focusTracker.on("change:focusedElement",(e,n,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),t.ui.on("update",()=>{this._showBalloonThrottled()}))}_createBalloonView(){const t=this.editor,e=this._balloonView=new se,n=Su(t),i=new nv(t.locale,n.label);e.content.add(i),e.set({class:"ck-powered-by-balloon"}),t.ui.view.body.add(e),t.ui.focusTracker.add(e.element),this._balloonView=e}_showBalloon(){if(!this._lastFocusedEditableElement)return;const t=function(e,n){const i=Su(e),r=i.side==="right"?function(s,a){return Iu(s,a,(c,l)=>c.left+c.width-l.width-a.horizontalOffset)}(n,i):function(s,a){return Iu(s,a,c=>c.left+a.horizontalOffset)}(n,i);return{target:n,positions:[r]}}(this.editor,this._lastFocusedEditableElement);t&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(t))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){const t=this.editor,e=t.ui.focusTracker.isFocused,n=t.ui.focusTracker.focusedElement;if(!e||!n)return void(this._lastFocusedEditableElement=null);const i=Array.from(t.ui.getEditableElementsNames()).map(r=>t.ui.getEditableElement(r));i.includes(n)?this._lastFocusedEditableElement=n:this._lastFocusedEditableElement=i[0]}}class nv extends et{constructor(t,e){super(t);const n=new kn,i=this.bindTemplate;n.set({content:` -`,isColorInherited:!1}),n.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...e?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[e]}]:[],n],on:{dragstart:i.to(r=>r.preventDefault())}}]})}}function Iu(o,t,e){return(n,i)=>{const r=new dt(o);if(r.widths.regionName===t);r||(r=new sv(this.view.locale),this.view.regionViews.add(r)),r.set({regionName:t,text:e,politeness:n})}}class rv extends et{constructor(t){super(t),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class sv extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("regionName",""),this.set("text",""),this.set("politeness",Mu),this.setTemplate({tag:"div",attributes:{role:"region","data-region":e.to("regionName"),"aria-live":e.to("politeness")},children:[{text:e.to("text")}]})}}var av=Object.defineProperty,Bu=Object.getOwnPropertySymbols,cv=Object.prototype.hasOwnProperty,lv=Object.prototype.propertyIsEnumerable,Nu=(o,t,e)=>t in o?av(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class dv extends ft(){constructor(t){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[];const e=t.editing.view;this.editor=t,this.componentFactory=new T_(t),this.focusTracker=new Qt,this.tooltipManager=new dr(t),this.poweredBy=new ev(t),this.ariaLiveAnnouncer=new iv(t),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",()=>{this.isReady=!0}),this.listenTo(e.document,"layoutChanged",this.update.bind(this)),this.listenTo(e,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null,this.editor.keystrokes.stopListening(t);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor),this.focusTracker.add(e);const n=()=>{this.editor.editing.view.getDomRoot(t)||this.editor.keystrokes.listenTo(e)};this.isReady?n():this.once("ready",n)}removeEditableElement(t){const e=this._editableElementsMap.get(t);e&&(this._editableElementsMap.delete(t),this.editor.keystrokes.stopListening(e),this.focusTracker.remove(e),e.ckeditorInstance=null)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(t,e={}){t.isRendered?(this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)):t.once("render",()=>{this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)}),this._focusableToolbarDefinitions.push({toolbarView:t,options:e})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const t=this.editor,e=t.config.get("ui.viewportOffset");if(e)return e;const n=t.config.get("toolbar.viewportTopOffset");return n?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:n}):{top:0}}_initFocusTracking(){const t=this.editor,e=t.editing.view;let n,i;t.keystrokes.set("Alt+F10",(r,s)=>{const a=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(a)&&!Array.from(e.domRoots.values()).includes(a)&&(n=a);const c=this._getCurrentFocusedToolbarDefinition();c&&i||(i=this._getFocusableCandidateToolbarDefinitions());for(let l=0;l{const a=this._getCurrentFocusedToolbarDefinition();a&&(n?(n.focus(),n=null):t.editing.view.focus(),a.options.afterBlur&&a.options.afterBlur(),s())})}_getFocusableCandidateToolbarDefinitions(){const t=[];for(const e of this._focusableToolbarDefinitions){const{toolbarView:n,options:i}=e;(Mn(n.element)||i.beforeFocus)&&t.push(e)}return t.sort((e,n)=>Pu(e)-Pu(n)),t}_getCurrentFocusedToolbarDefinition(){for(const t of this._focusableToolbarDefinitions)if(t.toolbarView.element&&t.toolbarView.element.contains(this.focusTracker.focusedElement))return t;return null}_focusFocusableCandidateToolbar(t){const{toolbarView:e,options:{beforeFocus:n}}=t;return n&&n(),!!Mn(e.element)&&(e.focus(),!0)}_handleScrollToTheSelection(t,e){const n=((i,r)=>{for(var s in r||(r={}))cv.call(r,s)&&Nu(i,s,r[s]);if(Bu)for(var s of Bu(r))lv.call(r,s)&&Nu(i,s,r[s]);return i})({top:0,bottom:0,left:0,right:0},this.viewportOffset);e.viewportOffset.top+=n.top,e.viewportOffset.bottom+=n.bottom,e.viewportOffset.left+=n.left,e.viewportOffset.right+=n.right}}function Pu(o){const{toolbarView:t,options:e}=o;let n=10;return Mn(t.element)&&n--,e.isContextual&&n--,n}var Ou=N(1185),hv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ou.A,hv),Ou.A.locals;class uv extends et{constructor(t){super(t),this.body=new ZC(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class gv extends uv{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new er;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class pv extends et{constructor(t,e,n){super(t),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const t=this._editingView;function e(n){t.change(i=>{const r=t.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}t.isRenderingInProgress?function n(i){t.once("change:isRenderingInProgress",(r,s,a)=>{a?n(i):e(i)})}(this):e(this)}}class mv extends pv{constructor(t,e,n,i={}){super(t,e,n);const r=t.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=i.label||(()=>r("Editor editing area: %0",this.name))}render(){super.render();const t=this._editingView;t.change(e=>{const n=t.document.getRoot(this.name);e.setAttribute("aria-label",this._generateLabel(this),n)})}}class ca extends Oi{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=t.namespace?`show:${t.type}:${t.namespace}`:`show:${t.type}`;this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class Lu extends ft(){constructor(t,e){super(),e&&$l(this,e),t&&this.set(t)}}var zu=N(991),fv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(zu.A,fv),zu.A.locals;var Ru=N(5380),kv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ru.A,kv),Ru.A.locals;const ur=oo("px");class gr extends R{constructor(t){super(t),this._viewToStack=new Map,this._idToStack=new Map,this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const e=this.editor.editing.view,n=e.document.selection.editableElement;return n?e.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}static get pluginName(){return"ContextualBalloon"}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this._view||this._createPanelView(),this.hasView(t.view))throw new _("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const n=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),n.set(t.view,t),this._viewToStack.set(t.view,n),n===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new _("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(e.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),e.size===1?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new _("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}_createPanelView(){this._view=new se(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new bv(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[r,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new wv(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,n)=>!n&&e>=2?Math.min(e-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=e,this.view.withArrow=n,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&(t.limiter||(t=Object.assign({},t,{limiter:this.positionLimiter})),t=Object.assign({},t,{viewportOffsetConfig:this.editor.ui.viewportOffset})),t}}class bv extends et{constructor(t){super(t);const e=t.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Qt,this.buttonPrevView=this._createButtonView(e("Previous"),ot.previousArrow),this.buttonNextView=this._createButtonView(e("Next"),ot.nextArrow),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const n=new wt(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n}}class wv extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",ur),left:n.to("left",ur),width:n.to("width",ur),height:n.to("height",ur)}},children:this.content}),this.on("change:numberOfPanels",(i,r,s,a)=>{s>a?this._addPanels(s-a):this._removePanels(a-s),this.updatePosition()})}_addPanels(t){for(;t--;){const e=new et;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(t){for(;t--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:n,height:i}=new dt(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:n,height:i})}}}var ju=N(8298),Av={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ju.A,Av),ju.A.locals;const po=oo("px");class Cv extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new Re({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",n=>n?"block":"none"),height:e.to("isSticky",n=>n?po(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new Re({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",n=>n?po(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_stickyTopOffset",n=>n&&po(n)),bottom:e.to("_stickyBottomOffset",n=>n&&po(n)),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo($.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()})}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new dt(this.limiterElement);let e=t.getVisible();if(e){const n=new dt($.window);n.top+=this.viewportTopOffset,n.height-=this.viewportTopOffset,e=e.getIntersection(n)}if(e&&t.tope.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset{this.reset(),this.focus(),this.fire("reset")}),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",r=>!r),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class vv extends et{constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",t.if("isVisible","ck-hidden",e=>!e)],tabindex:-1},children:[{tag:"span",children:[{text:[t.to("primaryText")]}]},{tag:"span",children:[{text:[t.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class yv extends et{constructor(t){super(t),this.children=this.createCollection(),this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new ye({focusables:this.children,focusTracker:this.focusTracker})}render(){super.render();for(const t of this.children)this.focusTracker.add(t.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}var Fu=/[\\^$.*+?()[\]{}|]/g,xv=RegExp(Fu.source);const Vu=function(o){return(o=ws(o))&&xv.test(o)?o.replace(Fu,"\\$&"):o};var Hu=N(8107),Ev={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Hu.A,Ev),Hu.A.locals;var Dv=Object.defineProperty,Uu=Object.getOwnPropertySymbols,Iv=Object.prototype.hasOwnProperty,Sv=Object.prototype.propertyIsEnumerable,qu=(o,t,e)=>t in o?Dv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Tv extends et{constructor(t,e){super(t),this._config=e,this.filteredView=e.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new Qt,this.keystrokes=new oe,this.resultsView=new yv(t),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),e.infoView&&e.infoView.instance?this.infoView=e.infoView.instance:(this.infoView=new vv,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new ye({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(n,{resultsCount:i,totalItemsCount:r})=>{this.resultsCount=i,this.totalItemsCount=r}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",e.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);const t=e=>e.stopPropagation();for(const e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search("")}search(t){const e=t?new RegExp(Vu(t),"ig"):null,n=this.filteredView.filter(e);this.fire("search",((i,r)=>{for(var s in r||(r={}))Iv.call(r,s)&&qu(i,s,r[s]);if(Uu)for(var s of Uu(r))Sv.call(r,s)&&qu(i,s,r[s]);return i})({query:t},n))}_createSearchTextQueryView(){const t=new _v(this.locale,this._config.queryView);return this.listenTo(t.fieldView,"input",()=>{this.search(t.fieldView.element.value)}),t.on("reset",()=>this.reset()),t.bind("isEnabled").to(this),t}_enableDefaultInfoViewBehavior(){const t=this.locale.t,e=this.infoView;function n(i,{query:r,resultsCount:s,totalItemsCount:a}){return typeof i=="function"?i(r,s,a):i}this.on("search",(i,r)=>{if(r.resultsCount)e.set({isVisible:!1});else{const s=this._config.infoView&&this._config.infoView.text;let a,c;r.totalItemsCount?s&&s.notFound?(a=s.notFound.primary,c=s.notFound.secondary):(a=t("No results found"),c=""):s&&s.noSearchableItems?(a=s.noSearchableItems.primary,c=s.noSearchableItems.secondary):(a=t("No searchable items"),c=""),e.set({primaryText:n(a,r),secondaryText:n(c,r),isVisible:!0})}})}}var Gu=N(5727),Mv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Gu.A,Mv),Gu.A.locals;const la=class extends Tv{constructor(o,t){super(o,t),this._config=t;const e=oo("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});const n=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[n.if("isVisible","ck-hidden",i=>!i),n.to("_position",i=>`ck-search__results_${i}`)],style:{width:n.to("_width",e)}}}),this.focusTracker.on("change:isFocused",(i,r,s)=>{this._updateResultsVisibility(),s?this.resultsView.element.scrollTop=0:t.resetOnBlur&&this.queryView.reset()}),this.on("search",()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()}),this.keystrokes.set("esc",(i,r)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,r())}),this.listenTo($.document,"scroll",()=>{this._updateResultsViewWidthAndPosition()}),this.on("change:isEnabled",()=>{this._updateResultsVisibility()}),this.filteredView.on("execute",(i,{value:r})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=r,this.resultsView.isVisible=!1}),this.resultsView.on("change:isVisible",()=>{this._updateResultsViewWidthAndPosition()})}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new dt(this.queryView.fieldView.element).width;const o=la._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:la.defaultResultsPositions});this.resultsView._position=o?o.name:"s"}_updateResultsVisibility(){const o=this._config.queryMinChars===void 0?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=o}};let Wu=la;Wu.defaultResultsPositions=[o=>({top:o.bottom,left:o.left,name:"s"}),(o,t)=>({top:o.top-t.height,left:o.left,name:"n"})],Wu._getOptimalPosition=ss;var Ku=N(9529),Bv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ku.A,Bv),Ku.A.locals;var $u=N(109),Nv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()($u.A,Nv),$u.A.locals;var Yu=N(2710),Pv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Yu.A,Pv),Yu.A.locals;class Ov extends dv{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Yh(t.config.get("toolbar")),this._elementReplacer=new Io,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,n=this.view,i=e.editing.view,r=n.editable,s=i.document.getRoot();r.name=s.rootName,n.render();const a=r.element;this.setEditableElement(r.name,a),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(a),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({top:e})=>e||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,e=t.editing.view,n=e.document.getRoot(),i=t.sourceElement;let r;const s=t.config.get("placeholder");s&&(r=typeof s=="string"?s:s[this.view.editable.name]),!r&&i&&i.tagName.toLowerCase()==="textarea"&&(r=i.getAttribute("placeholder")),r&&(n.placeholder=r),Cl({view:e,element:n,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,n){const i=this.view.stickyPanel;if(i.isSticky){const r=new dt(i.element).height;e.viewportOffset.top+=r}else{const r=()=>{this.editor.editing.view.scrollToTheSelection(n)};this.listenTo(i,"change:isSticky",r),setTimeout(()=>{this.stopListening(i,"change:isSticky",r)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,e=this.editor.plugins.get("Dialog");e.on("show",()=>{const n=e.view;n.on("moveTo",(i,r)=>{if(!t.isSticky||n.wasMoved)return;const s=new dt(t.contentPanelElement);r[1]{const n="error"in e?e.error:e.reason;n instanceof Error&&this._handleError(n,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(n=>n!==e)}_fire(t,...e){const n=this._listeners[t]||[];for(const i of n)i.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e instanceof ErrorEvent?e.filename:void 0,lineno:e instanceof ErrorEvent?e.lineno:void 0,colno:e instanceof ErrorEvent?e.colno:void 0,date:this._now()});const n=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:n}),n?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&t.context!==void 0&&t.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(t)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function da(o,t=new Set){const e=[o],n=new Set;let i=0;for(;e.length>i;){const r=e[i++];if(!n.has(r)&&Rv(r)&&!t.has(r))if(n.add(r),Symbol.iterator in r)try{for(const s of r)e.push(s)}catch{}else for(const s in r)s!=="defaultValue"&&e.push(r[s])}return n}function Rv(o){const t=Object.prototype.toString.call(o),e=typeof o;return!(e==="number"||e==="boolean"||e==="string"||e==="symbol"||e==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||o==null||o._watchdogExcluded||o instanceof EventTarget||o instanceof Event)}function Ju(o,t,e=new Set){if(o===t&&typeof(n=o)=="object"&&n!==null)return!0;var n;const i=da(o,e),r=da(t,e);for(const s of i)if(r.has(s))return!0;return!1}var jv=Object.defineProperty,Fv=Object.defineProperties,Vv=Object.getOwnPropertyDescriptors,pr=Object.getOwnPropertySymbols,Xu=Object.prototype.hasOwnProperty,tg=Object.prototype.propertyIsEnumerable,eg=(o,t,e)=>t in o?jv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,ha=(o,t)=>{for(var e in t||(t={}))Xu.call(t,e)&&eg(o,e,t[e]);if(pr)for(var e of pr(t))tg.call(t,e)&&eg(o,e,t[e]);return o};class ng extends Zu{constructor(t,e={}){super(e),this._editor=null,this._initUsingData=!0,this._editables={},this._throttledSave=hr(this._save.bind(this),typeof e.saveInterval=="number"?e.saveInterval:5e3),t&&(this._creator=(n,i)=>t.create(n,i)),this._destructor=n=>n.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(t=>{console.error("An error happened during the editor destroying.",t)}).then(()=>{const t={},e=[],n=this._config.rootsAttributes||{},i={};for(const[c,l]of Object.entries(this._data.roots))l.isLoaded?(t[c]="",i[c]=n[c]||{}):e.push(c);const r=(s=ha({},this._config),a={extraPlugins:this._config.extraPlugins||[],lazyRoots:e,rootsAttributes:i,_watchdogInitialData:this._data},Fv(s,Vv(a)));var s,a;return delete r.initialData,r.extraPlugins.push(Hv),this._initUsingData?this.create(t,r,r.context):Tn(this._elementOrData)?this.create(this._elementOrData,r,r.context):this.create(this._editables,r,r.context)}).then(()=>{this._fire("restart")})}create(t=this._elementOrData,e=this._config,n){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=t,this._initUsingData=typeof t=="string"||Object.keys(t).length>0&&typeof Object.values(t)[0]=="string",this._config=this._cloneEditorConfiguration(e)||{},this._config.context=n,this._creator(t,this._config))).then(i=>{this._editor=i,i.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=i.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const t=this._editor;return this._editor=null,t.model.document.off("change:data",this._throttledSave),this._destructor(t)})}_save(){const t=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=t}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(t){this._excludedProps=t}_getData(){const t=this._editor,e=t.model.document.roots.filter(a=>a.isAttached()&&a.rootName!="$graveyard"),{plugins:n}=t,i=n.has("CommentsRepository")&&n.get("CommentsRepository"),r=n.has("TrackChanges")&&n.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};e.forEach(a=>{s.roots[a.rootName]={content:JSON.stringify(Array.from(a.getChildren())),attributes:JSON.stringify(Array.from(a.getAttributes())),isLoaded:a._isLoaded}});for(const a of t.model.markers)a._affectsData&&(s.markers[a.name]={rangeJSON:a.getRange().toJSON(),usingOperation:a._managedUsingOperations,affectsData:a._affectsData});return i&&(s.commentThreads=JSON.stringify(i.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),r&&(s.suggestions=JSON.stringify(r.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const t={};for(const e of this.editor.model.document.getRootNames()){const n=this.editor.ui.getEditableElement(e);n&&(t[e]=n)}return t}_isErrorComingFromThisItem(t){return Ju(this._editor,t.context,this._excludedProps)}_cloneEditorConfiguration(t){return os(t,(e,n)=>Tn(e)||n==="context"?e:void 0)}}class Hv{constructor(t){this.editor=t,this._data=t.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",t=>{t.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:999})}_createNode(t,e){if("name"in e){const n=t.createElement(e.name,e.attributes);if(e.children)for(const i of e.children)n._appendChild(this._createNode(t,i));return n}return t.createText(e.data,e.attributes)}_restoreEditorData(t){const e=this.editor;Object.entries(this._data.roots).forEach(([n,{content:i,attributes:r}])=>{const s=JSON.parse(i),a=JSON.parse(r),c=e.model.document.getRoot(n);for(const[l,d]of a)t.setAttribute(l,d,c);for(const l of s){const d=this._createNode(t,l);t.insert(d,c,"end")}}),Object.entries(this._data.markers).forEach(([n,i])=>{const{document:r}=e.model,s=i,{rangeJSON:{start:a,end:c}}=s,l=((p,k)=>{var b={};for(var A in p)Xu.call(p,A)&&k.indexOf(A)<0&&(b[A]=p[A]);if(p!=null&&pr)for(var A of pr(p))k.indexOf(A)<0&&tg.call(p,A)&&(b[A]=p[A]);return b})(s,["rangeJSON"]),d=r.getRoot(a.root),h=t.createPositionFromPath(d,a.path,a.stickiness),u=t.createPositionFromPath(d,c.path,c.stickiness),g=t.createRange(h,u);t.addMarker(n,ha({range:g},l))})}_restoreCollaborationData(){const t=JSON.parse(this._data.commentThreads),e=JSON.parse(this._data.suggestions);t.forEach(n=>{const i=this.editor.config.get("collaboration.channelId"),r=this.editor.plugins.get("CommentsRepository");r.hasCommentThread(n.threadId)&&r.getCommentThread(n.threadId).remove(),r.addCommentThread(ha({channelId:i},n))}),e.forEach(n=>{const i=this.editor.plugins.get("TrackChangesEditing");i.hasSuggestion(n.id)?i.getSuggestion(n.id).attributes=n.attributes:i.addSuggestionData(n)})}}const ii=Symbol("MainQueueId");class Uv{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t,e){const n=t===ii;this._activeActions++,this._queues.get(t)||this._queues.set(t,Promise.resolve());const i=(n?Promise.all(this._queues.values()):Promise.all([this._queues.get(ii),this._queues.get(t)])).then(e),r=i.catch(()=>{});return this._queues.set(t,r),i.finally(()=>{this._activeActions--,this._queues.get(t)===r&&this._activeActions===0&&this._onEmptyCallbacks.forEach(s=>s())})}}function og(o){return Array.isArray(o)?o:[o]}class mr extends Ys(FC){constructor(t,e={}){if(!fr(t)&&e.initialData!==void 0)throw new _("editor-create-initial-data",null);super(e),this.config.get("initialData")===void 0&&this.config.set("initialData",function(r){return fr(r)?(s=r,s instanceof HTMLTextAreaElement?s.value:s.innerHTML):r;var s}(t)),fr(t)&&(this.sourceElement=t),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new zv(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new Ov(this,i),function(r){if(!En(r.updateSourceElement))throw new _("attachtoform-missing-elementapi-interface",r);const s=r.sourceElement;if(function(a){return!!a&&a.tagName.toLowerCase()==="textarea"}(s)&&s.form){let a;const c=s.form,l=()=>r.updateSourceElement();En(c.submit)&&(a=c.submit,c.submit=()=>{l(),a.apply(c)}),c.addEventListener("submit",l),r.on("destroy",()=>{c.removeEventListener("submit",l),a&&(c.submit=a)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(n=>{const i=new this(t,e);n(i.initPlugins().then(()=>i.ui.init(fr(t)?t:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}function fr(o){return Tn(o)}mr.Context=bl,mr.EditorWatchdog=ng,mr.ContextWatchdog=class extends Zu{constructor(o,t={}){super(t),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new Uv,this._watchdogConfig=t,this._creator=e=>o.create(e),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(o){this._creator=o}setDestructor(o){this._destructor=o}get context(){return this._context}create(o={}){return this._actionQueues.enqueue(ii,()=>(this._contextConfig=o,this._create()))}getItem(o){return this._getWatchdog(o)._item}getItemState(o){return this._getWatchdog(o).state}add(o){const t=og(o);return Promise.all(t.map(e=>this._actionQueues.enqueue(e.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let n;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if(e.type==="editor")return n=new ng(null,this._watchdogConfig),n.setCreator(e.creator),n._setExcludedProperties(this._contextProps),e.destructor&&n.setDestructor(e.destructor),this._watchdogs.set(e.id,n),n.on("error",(i,{error:r,causesRestart:s})=>{this._fire("itemError",{itemId:e.id,error:r}),s&&this._actionQueues.enqueue(e.id,()=>new Promise(a=>{const c=()=>{n.off("restart",c),this._fire("itemRestart",{itemId:e.id}),a()};n.on("restart",c)}))}),n.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))}remove(o){const t=og(o);return Promise.all(t.map(e=>this._actionQueues.enqueue(e,()=>{const n=this._getWatchdog(e);return this._watchdogs.delete(e),n.destroy()})))}destroy(){return this._actionQueues.enqueue(ii,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(ii,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(o=>{console.error("An error happened during destroying the context or items.",o)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(o=>(this._context=o,this._contextProps=da(this._context),Promise.all(Array.from(this._watchdogs.values()).map(t=>(t._setExcludedProperties(this._contextProps),t.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const o=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(t=>t.destroy())).then(()=>this._destructor(o))})}_getWatchdog(o){const t=this._watchdogs.get(o);if(!t)throw new Error(`Item with the given id was not registered: ${o}.`);return t}_isErrorComingFromThisItem(o){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(o))return!1;return Ju(this._context,o.context)}};class ri extends pn{constructor(t){super(t),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const e=this.document;function n(i){return(r,s)=>{s.preventDefault();const a=s.dropRange?[s.dropRange]:null,c=new H(e,i);e.fire(c,{dataTransfer:s.dataTransfer,method:r.name,targetRanges:a,target:s.target,domEvent:s.domEvent}),c.stop.called&&s.stopPropagation()}}this.listenTo(e,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(e,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(e,"dragover",n("dragging"),{priority:"low"})}onDomEvent(t){const e="clipboardData"in t?t.clipboardData:t.dataTransfer,n=t.type=="drop"||t.type=="paste",i={dataTransfer:new nd(e,{cacheFiles:n})};t.type!="drop"&&t.type!="dragover"||(i.dropRange=function(r,s){const a=s.target.ownerDocument,c=s.clientX,l=s.clientY;let d;return a.caretRangeFromPoint&&a.caretRangeFromPoint(c,l)?d=a.caretRangeFromPoint(c,l):s.rangeParent&&(d=a.createRange(),d.setStart(s.rangeParent,s.rangeOffset),d.collapse(!0)),d?r.domConverter.domRangeToView(d):null}(this.view,t)),this.fire(t.type,t,i)}}const ig=["figcaption","li"],rg=["ol","ul"];function sg(o){if(o.is("$text")||o.is("$textProxy"))return o.data;if(o.is("element","img")&&o.hasAttribute("alt"))return o.getAttribute("alt");if(o.is("element","br"))return` -`;let t="",e=null;for(const n of o.getChildren())t+=qv(n,e)+sg(n),e=n;return t}function qv(o,t){return t?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||rg.includes(o.name)&&rg.includes(t.name)?` +`)){const c=s.split(/\n{1,2}/g);let l=a;for(let d=0;d{if(this.isEnabled&&((i=n.keyCode)==ut.arrowright||i==ut.arrowleft||i==ut.arrowup||i==ut.arrowdown)){const r=new so(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&e.stop()}var i})}observe(){}stopObserving(){}}class Z0 extends $e{constructor(t){super(t);const e=this.document;e.on("keydown",(n,i)=>{if(!this.isEnabled||i.keyCode!=ut.tab||i.ctrlKey)return;const r=new so(e,"tab",e.selection.getFirstRange());e.fire(r,i),r.stop.called&&n.stop()})}observe(){}stopObserving(){}}const mn=function(o){return es(o,5)};class J0 extends ft(){constructor(t){super(),this.domRoots=new Map,this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this.document=new Vi(t),this.domConverter=new qi(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new p0(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new Nl(this.document),this.addObserver(nd),this.addObserver($i),this.addObserver(K0),this.addObserver(_0),this.addObserver(N0),this.addObserver($0),this.addObserver(Q0),this.addObserver(Y0),this.addObserver(Z0),this.document.on("arrowKey",u0,{priority:"low"}),a0(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),f.isiOS&&this.listenTo(this.document,"blur",(e,n)=>{this.domConverter.mapDomToView(n.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})}attachDomRoot(t,e="main"){const n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();const i={};for(const{name:s,value:a}of Array.from(t.attributes))i[s]=a,s==="class"?this._writer.addClass(a.split(" "),n):this._writer.setAttribute(s,a,n);this._initialDomRootAttributes.set(t,i);const r=()=>{this._writer.setAttribute("contenteditable",(!n.isReadOnly).toString(),n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(t.ownerDocument),n.on("change:children",(s,a)=>this._renderer.markToSync("children",a)),n.on("change:attributes",(s,a)=>this._renderer.markToSync("attributes",a)),n.on("change:text",(s,a)=>this._renderer.markToSync("text",a)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:i})=>e.removeAttribute(i));const n=this._initialDomRootAttributes.get(e);for(const i in n)e.setAttribute(i,n[i]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e);for(const i of this._observers.values())i.stopObserving(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[n,i]of this.domRoots)e.observe(i,n);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection({alignToTop:t,forceScroll:e,viewportOffset:n=20,ancestorOffset:i=20}={}){const r=this.document.selection.getFirstRange();if(!r)return;const s=mn({alignToTop:t,forceScroll:e,viewportOffset:n,ancestorOffset:i});typeof n=="number"&&(n={top:n,bottom:n,left:n,right:n});const a={target:this.domConverter.viewRangeToDom(r),viewportOffset:n,ancestorOffset:i,alignToTop:t,forceScroll:e};this.fire("scrollToTheSelection",a,s),function({target:c,viewportOffset:l=0,ancestorOffset:d=0,alignToTop:h,forceScroll:u}){const g=as(c);let p=g,k=null;for(l=function(b){return typeof b=="number"?{top:b,bottom:b,left:b,right:b}:b}(l);p;){let b;b=uw(p==g?c:k),hw({parent:b,getRect:()=>al(c,p),alignToTop:h,ancestorOffset:d,forceScroll:u});const A=al(c,p);if(dw({window:p,rect:A,viewportOffset:l,alignToTop:h,forceScroll:u}),p.parent!=p){if(k=p.frameElement,p=p.parent,!k)return}else p=null}}(a)}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new _("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(e){_.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver($i).flush(),this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}_disableRendering(t){this._renderingDisabled=t,t==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class fn{is(){throw new Error("is() method is abstract")}}class zn extends fn{constructor(t){super(),this.parent=null,this._attrs=We(t)}get document(){return null}get index(){let t;if(!this.parent)return null;if((t=this.parent.getChildIndex(this))===null)throw new _("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if((t=this.parent.getChildStartOffset(this))===null)throw new _("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return t!==null&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return t!==null&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.parent!==null&&this.root.isAttached()}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}getCommonAncestor(t,e={}){const n=this.getAncestors(e),i=t.getAncestors(e);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(t){if(this==t||this.root!==t.root)return!1;const e=this.getPath(),n=t.getPath(),i=Mt(e,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return e[i](e[n[0]]=n[1],e),{})),t}_clone(t){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=We(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}zn.prototype.is=function(o){return o==="node"||o==="model:node"};class Ko{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return e==-1?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return e===null?null:this._nodes.slice(0,e).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new _("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const n of this._nodes){if(t>=e&&t1e4)return n.slice(0,r).concat(i).concat(n.slice(r+s,n.length));{const a=Array.from(n);return a.splice(r,s,...i),a}}(this._nodes,Array.from(e),t,0)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class yt extends zn{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new yt(this.data,this.getAttributes())}static fromJSON(t){return new yt(t.data,t.attributes)}}yt.prototype.is=function(o){return o==="$text"||o==="model:$text"||o==="text"||o==="model:text"||o==="node"||o==="model:node"};class Le extends fn{constructor(t,e,n){if(super(),this.textNode=t,e<0||e>t.offsetSize)throw new _("model-textproxy-wrong-offsetintext",this);if(n<0||e+n>t.offsetSize)throw new _("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+n),this.offsetInText=e}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={}){const e=[];let n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?"push":"unshift"](n),n=n.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}Le.prototype.is=function(o){return o==="$textProxy"||o==="model:$textProxy"||o==="textProxy"||o==="model:textProxy"};class Ct extends zn{constructor(t,e,n){super(e),this._children=new Ko,this.name=t,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}findAncestor(t,e={}){let n=e.includeSelf?this:this.parent;for(;n;){if(n.name===t)return n;n=n.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(n=>n._clone(!0)):void 0;return new Ct(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(i){return typeof i=="string"?[new yt(i)]:(Gt(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new yt(r):r instanceof Le?new yt(r.data,r.getAttributes()):r))}(e);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}static fromJSON(t){let e;if(t.children){e=[];for(const n of t.children)n.name?e.push(Ct.fromJSON(n)):e.push(yt.fromJSON(n))}return new Ct(t.name,t.attributes,e)}}Ct.prototype.is=function(o,t){return t?t===this.name&&(o==="element"||o==="model:element"):o==="element"||o==="model:element"||o==="node"||o==="model:node"};class Xe{constructor(t){if(!t||!t.boundaries&&!t.startPosition)throw new _("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if(e!="forward"&&e!="backward")throw new _("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this._position=t.startPosition.clone():this._position=L._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,n,i,r;do i=this.position,r=this._visitedParent,{done:e,value:n}=this.next();while(!e&&t(n));e||(this._position=i,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),n=this._visitedParent;if(n.parent===null&&e.offset===n.maxOffset)return{done:!0,value:void 0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const i=$o(e,n),r=i||rd(e,n,i);if(r instanceof Ct){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e.path.push(0),this._visitedParent=r;return this._position=e,Rn("elementStart",r,t,e,1)}if(r instanceof yt){let s;if(this.singleCharacters)s=1;else{let l=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsetd&&(d=this.boundaries.start.offset),a=e.offset-d}const c=e.offset-s.startOffset,l=new Le(s,c-a,a);return e.offset-=a,this._position=e,Rn("text",l,t,e,a)}return e.path.pop(),this._position=e,this._visitedParent=n.parent,Rn("elementStart",n,t,e,1)}}function Rn(o,t,e,n,i){return{done:!1,value:{type:o,item:t,previousPosition:e,nextPosition:n,length:i}}}class L extends fn{constructor(t,e,n="toNone"){if(super(),!t.is("element")&&!t.is("documentFragment"))throw new _("model-position-root-invalid",t);if(!(e instanceof Array)||e.length===0)throw new _("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e1)return!1;if(i===1)return ad(t,this,n);if(i===-1)return ad(this,t,n)}return this.path.length===t.path.length||(this.path.length>t.path.length?Ls(this.path,e):Ls(t.path,e))}hasSameParentAs(t){return this.root!==t.root?!1:Mt(this.getParentPath(),t.getParentPath())=="same"}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=L._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?L._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,e){const n=L._createAt(this);if(this.root!=t.root)return n;if(Mt(t.getParentPath(),this.getParentPath())=="same"){if(t.offsetthis.offset)return null;n.offset-=e}}else if(Mt(t.getParentPath(),this.getParentPath())=="prefix"){const i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+e>this.path[i])return null;n.path[i]-=e}}return n}_getTransformedByInsertion(t,e){const n=L._createAt(this);if(this.root!=t.root)return n;if(Mt(t.getParentPath(),this.getParentPath())=="same")(t.offset=i;){if(n.path[s]+a!==r.maxOffset)return!1;a=1,s--,r=r.parent}return!0}(o,e+1)}function Ls(o,t){for(;te+1;){const r=i.maxOffset-n.offset;r!==0&&t.push(new B(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],s=r-n.offset;s!==0&&t.push(new B(n,n.getShiftedBy(s))),n.offset=r,n.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Xe(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new Xe(t);for(const n of e)yield n.item}*getPositions(t={}){t.boundaries=this;const e=new Xe(t);yield e.position;for(const n of e)yield n.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new B(this.start,this.end)]}getTransformedByOperations(t){const e=[new B(this.start,this.end)];for(const n of t)for(let i=0;i0?new this(n,i):new this(i,n)}static _createIn(t){return new this(L._createAt(t,0),L._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(L._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(t.length===0)throw new _("range-create-from-ranges-empty-array",null);if(t.length==1)return t[0].clone();const e=t[0];t.sort((r,s)=>r.start.isAfter(s.start)?1:-1);const n=t.indexOf(e),i=new this(e.start,e.end);if(n>0)for(let r=n-1;t[r].end.isEqual(i.start);r++)i.start=L._createAt(t[r].start);for(let r=n+1;r{if(e.viewPosition)return;const n=this._modelToViewMapping.get(e.modelPosition.parent);if(!n)throw new _("mapping-model-position-view-parent-not-found",this,{modelPosition:e.modelPosition});e.viewPosition=this.findPositionIn(n,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const n=this.findMappedViewAncestor(e.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,n);e.modelPosition=L._createAt(i,r)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t,e={}){const n=this.toModelElement(t);if(this._elementToMarkerNames.has(t))for(const i of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(i);e.defer?this._deferredBindingRemovals.set(t,t.root):(this._viewToModelMapping.delete(t),this._modelToViewMapping.get(n)==t&&this._modelToViewMapping.delete(n))}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const n=this._markerNameToElements.get(e)||new Set;n.add(t);const i=this._elementToMarkerNames.get(t)||new Set;i.add(e),this._markerNameToElements.set(e,n),this._elementToMarkerNames.set(t,i)}unbindElementFromMarkerName(t,e){const n=this._markerNameToElements.get(e);n&&(n.delete(t),n.size==0&&this._markerNameToElements.delete(e));const i=this._elementToMarkerNames.get(t);i&&(i.delete(e),i.size==0&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}flushDeferredBindings(){for(const[t,e]of this._deferredBindingRemovals)t.root==e&&this.unbindViewElement(t);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new B(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new nt(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={}){const n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const n=new Set;for(const i of e)if(i.is("attributeElement"))for(const r of i.getElementsWithSameId())n.add(r);else n.add(i);return n}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,n){if(n!=t)return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t);if(t.is("$text"))return e;let i=0;for(let r=0;r1?t[0]+":"+t[1]:t[0]}var tA=Object.defineProperty,eA=Object.defineProperties,nA=Object.getOwnPropertyDescriptors,ld=Object.getOwnPropertySymbols,oA=Object.prototype.hasOwnProperty,iA=Object.prototype.propertyIsEnumerable,dd=(o,t,e)=>t in o?tA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,zs=(o,t)=>{for(var e in t||(t={}))oA.call(t,e)&&dd(o,e,t[e]);if(ld)for(var e of ld(t))iA.call(t,e)&&dd(o,e,t[e]);return o},hd=(o,t)=>eA(o,nA(t));class ud extends kt(){constructor(t){super(),this._conversionApi=zs({dispatcher:this},t),this._firedEventsMap=new WeakMap}convertChanges(t,e,n){const i=this._createConversionApi(n,t.getRefreshedItems());for(const s of t.getMarkersToRemove())this._convertMarkerRemove(s.name,s.range,i);const r=this._reduceChanges(t.getChanges());for(const s of r)s.type==="insert"?this._convertInsert(B._createFromPositionAndShift(s.position,s.length),i):s.type==="reinsert"?this._convertReinsert(B._createFromPositionAndShift(s.position,s.length),i):s.type==="remove"?this._convertRemove(s.position,s.length,s.name,i):this._convertAttribute(s.range,s.attributeKey,s.attributeOldValue,s.attributeNewValue,i);i.mapper.flushDeferredBindings();for(const s of i.mapper.flushUnboundMarkerNames()){const a=e.get(s).getRange();this._convertMarkerRemove(s,a,i),this._convertMarkerAdd(s,a,i)}for(const s of t.getMarkersToAdd())this._convertMarkerAdd(s.name,s.range,i);i.consumable.verifyAllConsumed("insert")}convert(t,e,n,i={}){const r=this._createConversionApi(n,void 0,i);this._convertInsert(t,r);for(const[s,a]of e)this._convertMarkerAdd(s,a,r);r.consumable.verifyAllConsumed("insert")}convertSelection(t,e,n){const i=this._createConversionApi(n);this.fire("cleanSelection",{selection:t},i);const r=t.getFirstPosition().root;if(!i.mapper.toViewElement(r))return;const s=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this._addConsumablesForSelection(i.consumable,t,s),this.fire("selection",{selection:t},i),t.isCollapsed){for(const a of s)if(i.consumable.test(t,"addMarker:"+a.name)){const c=a.getRange();if(!rA(t.getFirstPosition(),a,i.mapper))continue;const l={item:t,markerName:a.name,markerRange:c};this.fire(`addMarker:${a.name}`,l,i)}for(const a of t.getAttributeKeys())if(i.consumable.test(t,"attribute:"+a)){const c={item:t,range:t.getFirstRange(),attributeKey:a,attributeOldValue:null,attributeNewValue:t.getAttribute(a)};this.fire(`attribute:${a}:$text`,c,i)}}}_convertInsert(t,e,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(e.consumable,t);for(const i of Array.from(t.getWalker({shallow:!0})).map(gd))this._testAndFire("insert",i,e)}_convertRemove(t,e,n,i){this.fire(`remove:${n}`,{position:t,length:e},i)}_convertAttribute(t,e,n,i,r){this._addConsumablesForRange(r.consumable,t,`attribute:${e}`);for(const s of t){const a={item:s.item,range:B._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${e}`,a,r)}}_convertReinsert(t,e){const n=Array.from(t.getWalker({shallow:!0}));this._addConsumablesForInsert(e.consumable,n);for(const i of n.map(gd))this._testAndFire("insert",hd(zs({},i),{reconversion:!0}),e)}_convertMarkerAdd(t,e,n){if(e.root.rootName=="$graveyard")return;const i=`addMarker:${t}`;if(n.consumable.add(e,i),this.fire(i,{markerName:t,markerRange:e},n),n.consumable.consume(e,i)){this._addConsumablesForRange(n.consumable,e,i);for(const r of e.getItems()){if(!n.consumable.test(r,i))continue;const s={item:r,range:B._createOn(r),markerName:t,markerRange:e};this.fire(i,s,n)}}}_convertMarkerRemove(t,e,n){e.root.rootName!="$graveyard"&&this.fire(`removeMarker:${t}`,{markerName:t,markerRange:e},n)}_reduceChanges(t){const e={changes:t};return this.fire("reduceChanges",e),e.changes}_addConsumablesForInsert(t,e){for(const n of e){const i=n.item;if(t.test(i,"insert")===null){t.add(i,"insert");for(const r of i.getAttributeKeys())t.add(i,"attribute:"+r)}}return t}_addConsumablesForRange(t,e,n){for(const i of e.getItems())t.add(i,n);return t}_addConsumablesForSelection(t,e,n){t.add(e,"selection");for(const i of n)t.add(e,"addMarker:"+i.name);for(const i of e.getAttributeKeys())t.add(e,"attribute:"+i);return t}_testAndFire(t,e,n){const i=function(c,l){const d=l.item.is("element")?l.item.name:"$text";return`${c}:${d}`}(t,e),r=e.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(e.item):e.item,s=this._firedEventsMap.get(n),a=s.get(r);if(a){if(a.has(i))return;a.add(i)}else s.set(r,new Set([i]));this.fire(i,e,n)}_testAndFireAddAttributes(t,e){const n={item:t,range:B._createOn(t)};for(const i of n.item.getAttributeKeys())n.attributeKey=i,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(i),this._testAndFire(`attribute:${i}`,n,e)}_createConversionApi(t,e=new Set,n={}){const i=hd(zs({},this._conversionApi),{consumable:new X0,writer:t,options:n,convertItem:r=>this._convertInsert(B._createOn(r),i),convertChildren:r=>this._convertInsert(B._createIn(r),i,{doNotAddConsumables:!0}),convertAttributes:r=>this._testAndFireAddAttributes(r,i),canReuseView:r=>!e.has(i.mapper.toModelElement(r))});return this._firedEventsMap.set(i,new Map),i}}function rA(o,t,e){const n=t.getRange(),i=Array.from(o.getAncestors());return i.shift(),i.reverse(),!i.some(r=>{if(n.containsItem(r))return!!e.toViewElement(r).getCustomProperty("addHighlight")})}function gd(o){return{item:o.item,range:B._createFromPositionAndShift(o.previousPosition,o.length)}}class ge extends kt(fn){constructor(...t){super(),this._lastRangeBackward=!1,this._attrs=new Map,this._ranges=[],t.length&&this.setTo(...t)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let n=!1;for(const i of t._ranges)if(e.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new B(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new B(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new B(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(...t){let[e,n,i]=t;if(typeof n=="object"&&(i=n,n=void 0),e===null)this._setRanges([]);else if(e instanceof ge)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof B)this._setRanges([e],!!i&&!!i.backward);else if(e instanceof L)this._setRanges([new B(e)]);else if(e instanceof zn){const r=!!i&&!!i.backward;let s;if(n=="in")s=B._createIn(e);else if(n=="on")s=B._createOn(e);else{if(n===void 0)throw new _("model-selection-setto-required-second-parameter",[this,e]);s=new B(L._createAt(e,n))}this._setRanges([s],r)}else{if(!Gt(e))throw new _("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,i&&!!i.backward)}}_setRanges(t,e=!1){const n=Array.from(t),i=n.some(r=>{if(!(r instanceof B))throw new _("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(s=>!s.isEqual(r))});(n.length!==this._ranges.length||i)&&(this._replaceAllRanges(n),this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0}))}setFocus(t,e){if(this.anchor===null)throw new _("model-selection-setfocus-no-ranges",[this,t]);const n=L._createAt(t,e);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new B(n,i)),this._lastRangeBackward=!0):(this._pushRange(new B(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const n=md(e.start,t);aA(n,e)&&(yield n);for(const r of e.getWalker()){const s=r.item;r.type=="elementEnd"&&sA(s,t,e)&&(yield s)}const i=md(e.end,t);cA(i,e)&&(yield i)}}containsEntireContent(t=this.anchor.root){const e=L._createAt(t,0),n=L._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new B(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function pd(o,t){return!t.has(o)&&(t.add(o),o.root.document.model.schema.isBlock(o)&&!!o.parent)}function sA(o,t,e){return pd(o,t)&&Rs(o,e)}function md(o,t){const e=o.parent.root.document.model.schema,n=o.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=n.find(s=>!i&&(i=e.isLimit(s),!i&&pd(s,t)));return n.forEach(s=>t.add(s)),r}function Rs(o,t){const e=function(n){const i=n.root.document.model.schema;let r=n.parent;for(;r;){if(i.isBlock(r))return r;r=r.parent}}(o);return e?!t.containsRange(B._createOn(e),!0):!0}function aA(o,t){return!!o&&(!(!t.isCollapsed&&!o.isEmpty)||!t.start.isTouching(L._createAt(o,o.maxOffset))&&Rs(o,t))}function cA(o,t){return!!o&&(!(!t.isCollapsed&&!o.isEmpty)||!t.end.isTouching(L._createAt(o,0))&&Rs(o,t))}ge.prototype.is=function(o){return o==="selection"||o==="model:selection"};class pe extends kt(B){constructor(t,e){super(t,e),lA.call(this)}detach(){this.stopListening()}toRange(){return new B(this.start,this.end)}static fromRange(t){return new pe(t.start,t.end)}}function lA(){this.listenTo(this.root.document.model,"applyOperation",(o,t)=>{const e=t[0];e.isDocumentOperation&&dA.call(this,e)},{priority:"low"})}function dA(o){const t=this.getTransformedByOperation(o),e=B._createFromRanges(t),n=!e.isEqual(this),i=function(s,a){switch(a.type){case"insert":return s.containsPosition(a.position);case"move":case"remove":case"reinsert":case"merge":return s.containsPosition(a.sourcePosition)||s.start.isEqual(a.sourcePosition)||s.containsPosition(a.targetPosition);case"split":return s.containsPosition(a.splitPosition)||s.containsPosition(a.insertionPosition)}return!1}(this,o);let r=null;if(n){e.root.rootName=="$graveyard"&&(r=o.type=="remove"?o.sourcePosition:o.deletionPosition);const s=this.toRange();this.start=e.start,this.end=e.end,this.fire("change:range",s,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}pe.prototype.is=function(o){return o==="liveRange"||o==="model:liveRange"||o=="range"||o==="model:range"};const Qi="selection:";class ze extends kt(fn){constructor(t){super(),this._selection=new hA(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(...t){this._selection.setTo(...t)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return Qi+t}static _isStoreAttributeKey(t){return t.startsWith(Qi)}}ze.prototype.is=function(o){return o==="selection"||o=="model:selection"||o=="documentSelection"||o=="model:documentSelection"};class hA extends ge{constructor(t){super(),this.markers=new Be({idProperty:"name"}),this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this._model=t.model,this._document=t,this.listenTo(this._model,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(e,n,i,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(e,n)=>{(function(i,r){const s=i.document.differ;for(const a of s.getChanges()){if(a.type!="insert")continue;const c=a.position.parent;a.length===c.maxOffset&&i.enqueueChange(r,l=>{const d=Array.from(c.getAttributeKeys()).filter(h=>h.startsWith(Qi));for(const h of d)l.removeAttribute(h,c)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const s=this._ranges.indexOf(e);this._ranges.splice(s,1),e.detach()}}),e}updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const i of this._model.markers){const r=i.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const s=i.getRange();for(const a of this.getRanges())s.containsRange(a,!a.isCollapsed)&&t.push(i)}const n=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(t,e){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),s=this.markers.has(t);if(e){let a=!1;for(const c of this.getRanges())if(e.containsRange(c,!c.isCollapsed)){a=!0;break}a&&!s?(this.markers.add(t),i=!0):!a&&s&&(this.markers.remove(t),i=!0)}else s&&(this.markers.remove(t),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(t){const e=We(this._getSurroundingAttributes()),n=We(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,s]of this._attributePriority)s=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(e);const i=[];for(const[r,s]of this.getAttributes())n.has(r)&&n.get(r)===s||i.push(r);for(const[r]of n)this.hasAttribute(r)||i.push(r);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(t,e,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(t)=="normal"?!1:super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,i),!0)}_removeAttribute(t,e=!0){const n=e?"normal":"low";return(n!="low"||this._attributePriority.get(t)!="normal")&&(this._attributePriority.set(t,n),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[n,i]of this.getAttributes())t.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of t)this._setAttribute(n,i,!1)&&e.add(n);return e}*getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())e.startsWith(Qi)&&(yield[e.substr(10),t.getAttribute(e)])}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;if(t.root.rootName=="$graveyard")return null;let n=null;if(this.isCollapsed){const i=t.textNode?t.textNode:t.nodeBefore,r=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=Yo(i,e)),n||(n=Yo(r,e)),!this.isGravityOverridden&&!n){let s=i;for(;s&&!n;)s=s.previousSibling,n=Yo(s,e)}if(!n){let s=r;for(;s&&!n;)s=s.nextSibling,n=Yo(s,e)}n||(n=this.getStoredAttributes())}else{const i=this.getFirstRange();for(const r of i){if(r.item.is("element")&&e.isObject(r.item)){n=Yo(r.item,e);break}if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Yo(o,t){if(!o)return null;if(o instanceof Le||o instanceof yt)return o.getAttributes();if(!t.isInline(o))return null;if(!t.isObject(o))return[];const e=[];for(const[n,i]of o.getAttributes())t.checkAttribute("$text",n)&&t.getAttributeProperties(n).copyFromObject!==!1&&e.push([n,i]);return e}class fd{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}class uA extends fd{elementToElement(t){return this.add(function(e){const n=wd(e.model),i=Qo(e.view,"container");return n.attributes.length&&(n.children=!0),r=>{r.on(`insert:${n.name}`,function(s,a=pA){return(c,l,d)=>{if(!a(l.item,d.consumable,{preflight:!0}))return;const h=s(l.item,d,l);if(!h)return;a(l.item,d.consumable);const u=d.mapper.toViewPosition(l.range.start);d.mapper.bindElements(l.item,h),d.writer.insert(u,h),d.convertAttributes(l.item),yd(h,l.item.getChildren(),d,{reconversion:l.reconversion})}}(i,vd(n)),{priority:e.converterPriority||"normal"}),(n.children||n.attributes.length)&&r.on("reduceChanges",_d(n),{priority:"low"})}}(t))}elementToStructure(t){return this.add(function(e){const n=wd(e.model),i=Qo(e.view,"container");return n.children=!0,r=>{if(r._conversionApi.schema.checkChild(n.name,"$text"))throw new _("conversion-element-to-structure-disallowed-text",r,{elementName:n.name});var s,a;r.on(`insert:${n.name}`,(s=i,a=vd(n),(c,l,d)=>{if(!a(l.item,d.consumable,{preflight:!0}))return;const h=new Map;d.writer._registerSlotFactory(function(p,k,b){return(A,E)=>{const M=A.createContainerElement("$slot");let z=null;if(E==="children")z=Array.from(p.getChildren());else{if(typeof E!="function")throw new _("conversion-slot-mode-unknown",b.dispatcher,{modeOrFilter:E});z=Array.from(p.getChildren()).filter(G=>E(G))}return k.set(M,z),M}}(l.item,h,d));const u=s(l.item,d,l);if(d.writer._clearSlotFactory(),!u)return;(function(p,k,b){const A=Array.from(k.values()).flat(),E=new Set(A);if(E.size!=A.length)throw new _("conversion-slot-filter-overlap",b.dispatcher,{element:p});if(E.size!=p.childCount)throw new _("conversion-slot-filter-incomplete",b.dispatcher,{element:p})})(l.item,h,d),a(l.item,d.consumable);const g=d.mapper.toViewPosition(l.range.start);d.mapper.bindElements(l.item,u),d.writer.insert(g,u),d.convertAttributes(l.item),function(p,k,b,A){b.mapper.on("modelToViewPosition",z,{priority:"highest"});let E=null,M=null;for([E,M]of k)yd(p,M,b,A),b.writer.move(b.writer.createRangeIn(E),b.writer.createPositionBefore(E)),b.writer.remove(E);function z(G,tt){const at=tt.modelPosition.nodeAfter,St=M.indexOf(at);St<0||(tt.viewPosition=tt.mapper.findPositionIn(E,St))}b.mapper.off("modelToViewPosition",z)}(u,h,d,{reconversion:l.reconversion})}),{priority:e.converterPriority||"normal"}),r.on("reduceChanges",_d(n),{priority:"low"})}}(t))}attributeToElement(t){return this.add(function(e){e=mn(e);let n=e.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)e.view[s]=Qo(e.view[s],"attribute");else e.view=Qo(e.view,"attribute");const r=Ad(e);return s=>{s.on(i,function(a){return(c,l,d)=>{if(!d.consumable.test(l.item,c.name))return;const h=a(l.attributeOldValue,d,l),u=a(l.attributeNewValue,d,l);if(!h&&!u)return;d.consumable.consume(l.item,c.name);const g=d.writer,p=g.document.selection;if(l.item instanceof ge||l.item instanceof ze)g.wrap(p.getFirstRange(),u);else{let k=d.mapper.toViewRange(l.range);l.attributeOldValue!==null&&h&&(k=g.unwrap(k,h)),l.attributeNewValue!==null&&u&&g.wrap(k,u)}}}(r),{priority:e.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(e){e=mn(e);let n=e.model;typeof n=="string"&&(n={key:n});let i=`attribute:${n.key}`;if(n.name&&(i+=":"+n.name),n.values)for(const s of n.values)e.view[s]=Cd(e.view[s]);else e.view=Cd(e.view);const r=Ad(e);return s=>{var a;s.on(i,(a=r,(c,l,d)=>{if(!d.consumable.test(l.item,c.name))return;const h=a(l.attributeOldValue,d,l),u=a(l.attributeNewValue,d,l);if(!h&&!u)return;d.consumable.consume(l.item,c.name);const g=d.mapper.toViewElement(l.item),p=d.writer;if(!g)throw new _("conversion-attribute-to-attribute-on-text",d.dispatcher,l);if(l.attributeOldValue!==null&&h)if(h.key=="class"){const k=typeof h.value=="string"?h.value.split(/\s+/):h.value;for(const b of k)p.removeClass(b,g)}else if(h.key=="style")if(typeof h.value=="string"){const k=new Cs(p.document.stylesProcessor);k.setTo(h.value);for(const[b]of k.getStylesEntries())p.removeStyle(b,g)}else{const k=Object.keys(h.value);for(const b of k)p.removeStyle(b,g)}else p.removeAttribute(h.key,g);if(l.attributeNewValue!==null&&u)if(u.key=="class"){const k=typeof u.value=="string"?u.value.split(/\s+/):u.value;for(const b of k)p.addClass(b,g)}else if(u.key=="style")if(typeof u.value=="string"){const k=new Cs(p.document.stylesProcessor);k.setTo(u.value);for(const[b,A]of k.getStylesEntries())p.setStyle(b,A,g)}else{const k=Object.keys(u.value);for(const b of k)p.setStyle(b,u.value[b],g)}else p.setAttribute(u.key,u.value,g)}),{priority:e.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(e){const n=Qo(e.view,"ui");return i=>{var r;i.on(`addMarker:${e.model}`,(r=n,(s,a,c)=>{a.isOpening=!0;const l=r(a,c);a.isOpening=!1;const d=r(a,c);if(!l||!d)return;const h=a.markerRange;if(h.isCollapsed&&!c.consumable.consume(h,s.name))return;for(const p of h)if(!c.consumable.consume(p.item,s.name))return;const u=c.mapper,g=c.writer;g.insert(u.toViewPosition(h.start),l),c.mapper.bindElementToMarker(l,a.markerName),h.isCollapsed||(g.insert(u.toViewPosition(h.end),d),c.mapper.bindElementToMarker(d,a.markerName)),s.stop()}),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,(s,a,c)=>{const l=c.mapper.markerNameToElements(a.markerName);if(l){for(const d of l)c.mapper.unbindElementFromMarkerName(d,a.markerName),c.writer.clear(c.writer.createRangeOn(d),d);c.writer.clearClonedElementsGroup(a.markerName),s.stop()}},{priority:e.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(e){return n=>{var i;n.on(`addMarker:${e.model}`,(i=e.view,(r,s,a)=>{if(!s.item||!(s.item instanceof ge||s.item instanceof ze||s.item.is("$textProxy")))return;const c=js(i,s,a);if(!c||!a.consumable.consume(s.item,r.name))return;const l=a.writer,d=kd(l,c),h=l.document.selection;if(s.item instanceof ge||s.item instanceof ze)l.wrap(h.getFirstRange(),d);else{const u=a.mapper.toViewRange(s.range),g=l.wrap(u,d);for(const p of g.getItems())if(p.is("attributeElement")&&p.isSimilar(d)){a.mapper.bindElementToMarker(p,s.markerName);break}}}),{priority:e.converterPriority||"normal"}),n.on(`addMarker:${e.model}`,function(r){return(s,a,c)=>{if(!a.item||!(a.item instanceof Ct))return;const l=js(r,a,c);if(!l||!c.consumable.test(a.item,s.name))return;const d=c.mapper.toViewElement(a.item);if(d&&d.getCustomProperty("addHighlight")){c.consumable.consume(a.item,s.name);for(const h of B._createIn(a.item))c.consumable.consume(h.item,s.name);d.getCustomProperty("addHighlight")(d,l,c.writer),c.mapper.bindElementToMarker(d,a.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),n.on(`removeMarker:${e.model}`,function(r){return(s,a,c)=>{if(a.markerRange.isCollapsed)return;const l=js(r,a,c);if(!l)return;const d=kd(c.writer,l),h=c.mapper.markerNameToElements(a.markerName);if(h){for(const u of h)c.mapper.unbindElementFromMarkerName(u,a.markerName),u.is("attributeElement")?c.writer.unwrap(c.writer.createRangeOn(u),d):u.getCustomProperty("removeHighlight")(u,l.id,c.writer);c.writer.clearClonedElementsGroup(a.markerName),s.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(e){e=mn(e);const n=e.model;let i=e.view;return i||(i=r=>({group:n,name:r.substr(e.model.length+1)})),r=>{var s;r.on(`addMarker:${n}`,(s=i,(a,c,l)=>{const d=s(c.markerName,l);if(!d)return;const h=c.markerRange;l.consumable.consume(h,a.name)&&(bd(h,!1,l,c,d),bd(h,!0,l,c,d),a.stop())}),{priority:e.converterPriority||"normal"}),r.on(`removeMarker:${n}`,function(a){return(c,l,d)=>{const h=a(l.markerName,d);if(!h)return;const u=d.mapper.markerNameToElements(l.markerName);if(u){for(const p of u)d.mapper.unbindElementFromMarkerName(p,l.markerName),p.is("containerElement")?(g(`data-${h.group}-start-before`,p),g(`data-${h.group}-start-after`,p),g(`data-${h.group}-end-before`,p),g(`data-${h.group}-end-after`,p)):d.writer.clear(d.writer.createRangeOn(p),p);d.writer.clearClonedElementsGroup(l.markerName),c.stop()}function g(p,k){if(k.hasAttribute(p)){const b=new Set(k.getAttribute(p).split(","));b.delete(h.name),b.size==0?d.writer.removeAttribute(p,k):d.writer.setAttribute(p,Array.from(b).join(","),k)}}}}(i),{priority:e.converterPriority||"normal"})}}(t))}}function kd(o,t){const e=o.createAttributeElement("span",t.attributes);return t.classes&&e._addClass(t.classes),typeof t.priority=="number"&&(e._priority=t.priority),e._id=t.id,e}function bd(o,t,e,n,i){const r=t?o.start:o.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let c,l;t&&s||!t&&!a?(c=s,l=!0):(c=a,l=!1);const d=e.mapper.toViewElement(c);if(d)return void function(h,u,g,p,k,b){const A=`data-${b.group}-${u?"start":"end"}-${g?"before":"after"}`,E=h.hasAttribute(A)?h.getAttribute(A).split(","):[];E.unshift(b.name),p.writer.setAttribute(A,E.join(","),h),p.mapper.bindElementToMarker(h,k.markerName)}(d,t,l,e,n,i)}(function(c,l,d,h,u){const g=`${u.group}-${l?"start":"end"}`,p=u.name?{name:u.name}:null,k=d.writer.createUIElement(g,p);d.writer.insert(c,k),d.mapper.bindElementToMarker(k,h.markerName)})(e.mapper.toViewPosition(r),t,e,n,i)}function wd(o){return typeof o=="string"&&(o={name:o}),{name:o.name,attributes:o.attributes?Et(o.attributes):[],children:!!o.children}}function Qo(o,t){return typeof o=="function"?o:(e,n)=>function(i,r,s){typeof i=="string"&&(i={name:i});let a;const c=r.writer,l=Object.assign({},i.attributes);if(s=="container")a=c.createContainerElement(i.name,l);else if(s=="attribute"){const d={priority:i.priority||On.DEFAULT_PRIORITY};a=c.createAttributeElement(i.name,l,d)}else a=c.createUIElement(i.name,l);if(i.styles){const d=Object.keys(i.styles);for(const h of d)c.setStyle(h,i.styles[h],a)}if(i.classes){const d=i.classes;if(typeof d=="string")c.addClass(d,a);else for(const h of d)c.addClass(h,a)}return a}(o,n,t)}function Ad(o){return o.model.values?(t,e,n)=>{const i=o.view[t];return i?i(t,e,n):null}:o.view}function Cd(o){return typeof o=="string"?t=>({key:o,value:t}):typeof o=="object"?o.value?()=>o:t=>({key:o.key,value:t}):o}function js(o,t,e){const n=typeof o=="function"?o(t,e):o;return n?(n.priority||(n.priority=10),n.id||(n.id=t.markerName),n):null}function _d(o){const t=function(e){return(n,i)=>{if(!n.is("element",e.name))return!1;if(i.type=="attribute"){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(o);return(e,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const r of n.changes){const s=r.type=="attribute"?r.range.start.nodeAfter:r.position.parent;if(s&&t(s,r)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const a=L._createBefore(s);let c=i.length;for(let l=i.length-1;l>=0;l--){const d=i[l],h=(d.type=="attribute"?d.range.start:d.position).compareWith(a);if(h=="before"||d.type=="remove"&&h=="same")break;c=l}i.splice(c,0,{type:"remove",name:s.name,position:a,length:1},{type:"reinsert",name:s.name,position:a,length:1})}}else i.push(r)}n.changes=i}}function vd(o){return(t,e,n={})=>{const i=["insert"];for(const r of o.attributes)t.hasAttribute(r)&&i.push(`attribute:${r}`);return!!i.every(r=>e.test(t,r))&&(n.preflight||i.forEach(r=>e.consume(t,r)),!0)}}function yd(o,t,e,n){for(const i of t)gA(o.root,i,e,n)||e.convertItem(i)}function gA(o,t,e,n){const{writer:i,mapper:r}=e;if(!n.reconversion)return!1;const s=r.toViewElement(t);return!(!s||s.root==o)&&!!e.canReuseView(s)&&(i.move(i.createRangeOn(s),r.toViewPosition(L._createBefore(t))),!0)}function pA(o,t,{preflight:e}={}){return e?t.test(o,"insert"):t.consume(o,"insert")}function xd(o){const{schema:t,document:e}=o.model;for(const n of e.getRoots())if(n.isEmpty&&!t.checkChild(n,"$text")&&t.checkChild(n,"paragraph"))return o.insertElement("paragraph",n),!0;return!1}function Ed(o,t,e){const n=e.createContext(o);return!!e.checkChild(n,"paragraph")&&!!e.checkChild(n.push("paragraph"),t)}function Dd(o,t){const e=t.createElement("paragraph");return t.insert(e,o),t.createPositionAt(e,0)}var mA=Object.defineProperty,fA=Object.defineProperties,kA=Object.getOwnPropertyDescriptors,Id=Object.getOwnPropertySymbols,bA=Object.prototype.hasOwnProperty,wA=Object.prototype.propertyIsEnumerable,Sd=(o,t,e)=>t in o?mA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class AA extends fd{elementToElement(t){return this.add(Td(t))}elementToAttribute(t){return this.add(function(e){e=mn(e),Md(e);const n=Bd(e,!1),i=Fs(e.view),r=i?`element:${i}`:"element";return s=>{s.on(r,n,{priority:e.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(e){e=mn(e);let n=null;(typeof e.view=="string"||e.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const s=r.view.key,a=r.view.value===void 0?/[\s\S]*/:r.view.value;let c;return s=="class"||s=="style"?c={[s=="class"?"classes":"styles"]:a}:c={attributes:{[s]:a}},r.view.name&&(c.name=r.view.name),r.view=c,s}(e)),Md(e,n);const i=Bd(e,!0);return r=>{r.on("element",i,{priority:e.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(e){const n=function(s){return(a,c)=>{const l=typeof s=="string"?s:s(a,c);return c.writer.createElement("$marker",{"data-name":l})}}(e.model);return Td((i=((s,a)=>{for(var c in a||(a={}))bA.call(a,c)&&Sd(s,c,a[c]);if(Id)for(var c of Id(a))wA.call(a,c)&&Sd(s,c,a[c]);return s})({},e),r={model:n},fA(i,kA(r))));var i,r}(t))}dataToMarker(t){return this.add(function(e){e=mn(e),e.model||(e.model=s=>s?e.view+":"+s:e.view);const n={view:e.view,model:e.model},i=Vs(Nd(n,"start")),r=Vs(Nd(n,"end"));return s=>{s.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),s.on(`element:${e.view}-end`,r,{priority:e.converterPriority||"normal"});const a=At.low,c=At.highest,l=At.get(e.converterPriority)/c;s.on("element",function(d){return(h,u,g)=>{const p=`data-${d.view}`;function k(b,A){for(const E of A){const M=d.model(E,g),z=g.writer.createElement("$marker",{"data-name":M});g.writer.insert(z,b),u.modelCursor.isEqual(b)?u.modelCursor=u.modelCursor.getShiftedBy(1):u.modelCursor=u.modelCursor._getTransformedByInsertion(b,1),u.modelRange=u.modelRange._getTransformedByInsertion(b,1)[0]}}(g.consumable.test(u.viewItem,{attributes:p+"-end-after"})||g.consumable.test(u.viewItem,{attributes:p+"-start-after"})||g.consumable.test(u.viewItem,{attributes:p+"-end-before"})||g.consumable.test(u.viewItem,{attributes:p+"-start-before"}))&&(u.modelRange||Object.assign(u,g.convertChildren(u.viewItem,u.modelCursor)),g.consumable.consume(u.viewItem,{attributes:p+"-end-after"})&&k(u.modelRange.end,u.viewItem.getAttribute(p+"-end-after").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-start-after"})&&k(u.modelRange.end,u.viewItem.getAttribute(p+"-start-after").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-end-before"})&&k(u.modelRange.start,u.viewItem.getAttribute(p+"-end-before").split(",")),g.consumable.consume(u.viewItem,{attributes:p+"-start-before"})&&k(u.modelRange.start,u.viewItem.getAttribute(p+"-start-before").split(",")))}}(n),{priority:a+l})}}(t))}}function Td(o){const t=Vs(o=mn(o)),e=Fs(o.view),n=e?`element:${e}`:"element";return i=>{i.on(n,t,{priority:o.converterPriority||"normal"})}}function Fs(o){return typeof o=="string"?o:typeof o=="object"&&typeof o.name=="string"?o.name:null}function Vs(o){const t=new Ne(o.view);return(e,n,i)=>{const r=t.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!i.consumable.test(n.viewItem,s))return;const a=function(c,l,d){return c instanceof Function?c(l,d):d.writer.createElement(c)}(o.model,n.viewItem,i);a&&i.safeInsert(a,n.modelCursor)&&(i.consumable.consume(n.viewItem,s),i.convertChildren(n.viewItem,a),i.updateConversionResult(a,n))}}function Md(o,t=null){const e=t===null||(r=>r.getAttribute(t)),n=typeof o.model!="object"?o.model:o.model.key,i=typeof o.model!="object"||o.model.value===void 0?e:o.model.value;o.model={key:n,value:i}}function Bd(o,t){const e=new Ne(o.view);return(n,i,r)=>{if(!i.modelRange&&t)return;const s=e.match(i.viewItem);if(!s||(function(d,h){const u=typeof d=="function"?d(h):d;return typeof u=="object"&&!Fs(u)?!1:!u.classes&&!u.attributes&&!u.styles}(o.view,i.viewItem)?s.match.name=!0:delete s.match.name,!r.consumable.test(i.viewItem,s.match)))return;const a=o.model.key,c=typeof o.model.value=="function"?o.model.value(i.viewItem,r):o.model.value;if(c===null)return;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),function(d,h,u,g){let p=!1;for(const k of Array.from(d.getItems({shallow:u})))g.schema.checkAttribute(k,h.key)&&(p=!0,k.hasAttribute(h.key)||g.writer.setAttribute(h.key,h.value,k));return p}(i.modelRange,{key:a,value:c},t,r)&&(r.consumable.test(i.viewItem,{name:!0})&&(s.match.name=!0),r.consumable.consume(i.viewItem,s.match))}}function Nd(o,t){return{view:`${o.view}-${t}`,model:(e,n)=>{const i=e.getAttribute("name"),r=o.model(i,n);return n.writer.createElement("$marker",{"data-name":r})}}}function CA(o){o.document.registerPostFixer(t=>function(e,n){const i=n.document.selection,r=n.schema,s=[];let a=!1;for(const c of i.getRanges()){const l=Pd(c,r);l&&!l.isEqual(c)?(s.push(l),a=!0):s.push(c)}return a&&e.setSelection(function(c){const l=[...c],d=new Set;let h=1;for(;h!d.has(g))}(s),{backward:i.isBackward}),!1}(t,o))}function Pd(o,t){return o.isCollapsed?function(e,n){const i=e.start,r=n.getNearestSelectionRange(i);if(!r){const a=i.getAncestors().reverse().find(c=>n.isObject(c));return a?B._createOn(a):null}if(!r.isCollapsed)return r;const s=r.start;return i.isEqual(s)?null:new B(s)}(o,t):function(e,n){const{start:i,end:r}=e,s=n.checkChild(i,"$text"),a=n.checkChild(r,"$text"),c=n.getLimitElement(i),l=n.getLimitElement(r);if(c===l){if(s&&a)return null;if(function(u,g,p){const k=u.nodeAfter&&!p.isLimit(u.nodeAfter)||p.checkChild(u,"$text"),b=g.nodeBefore&&!p.isLimit(g.nodeBefore)||p.checkChild(g,"$text");return k||b}(i,r,n)){const u=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),g=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),p=u?u.start:i,k=g?g.end:r;return new B(p,k)}}const d=c&&!c.is("rootElement"),h=l&&!l.is("rootElement");if(d||h){const u=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,g=d&&(!u||!Ld(i.nodeAfter,n)),p=h&&(!u||!Ld(r.nodeBefore,n));let k=i,b=r;return g&&(k=L._createBefore(Od(c,n))),p&&(b=L._createAfter(Od(l,n))),new B(k,b)}return null}(o,t)}function Od(o,t){let e=o,n=e;for(;t.isLimit(n)&&n.parent;)e=n,n=n.parent;return e}function Ld(o,t){return o&&t.isSelectable(o)}class _A extends ft(){constructor(t,e){super(),this.model=t,this.view=new J0(e),this.mapper=new cd,this.downcastDispatcher=new ud({mapper:this.mapper,schema:t.schema});const n=this.model.document,i=n.selection,r=this.model.markers;var s,a,c;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(l=>{this.downcastDispatcher.convertChanges(n.differ,r,l),this.downcastDispatcher.convertSelection(i,r,l)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(l,d){return(h,u)=>{const g=u.newSelection,p=[];for(const b of g.getRanges())p.push(d.toModelRange(b));const k=l.createSelection(p,{backward:g.isBackward});k.isEqual(l.document.selection)||l.change(b=>{b.setSelection(k)})}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,a=this.model.schema,c=this.view,(l,d)=>{if(!c.document.isComposing||f.isAndroid)for(let h=0;h{if(!h.consumable.consume(d.item,l.name))return;const u=h.writer,g=h.mapper.toViewPosition(d.range.start),p=u.createText(d.item.data);u.insert(g,p)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(l,d,h)=>{h.convertAttributes(d.item),d.reconversion||!d.item.is("element")||d.item.isEmpty||h.convertChildren(d.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(l,d,h)=>{const u=h.mapper.toViewPosition(d.position),g=d.position.getShiftedBy(d.length),p=h.mapper.toViewPosition(g,{isPhantom:!0}),k=h.writer.createRange(u,p),b=h.writer.remove(k.getTrimmed());for(const A of h.writer.createRangeIn(b).getItems())h.mapper.unbindViewElement(A,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("cleanSelection",(l,d,h)=>{const u=h.writer,g=u.document.selection;for(const p of g.getRanges())p.isCollapsed&&p.end.parent.isAttached()&&h.writer.mergeAttributes(p.start);u.setSelection(null)}),this.downcastDispatcher.on("selection",(l,d,h)=>{const u=d.selection;if(u.isCollapsed||!h.consumable.consume(u,"selection"))return;const g=[];for(const p of u.getRanges())g.push(h.mapper.toViewRange(p));h.writer.setSelection(g,{backward:u.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(l,d,h)=>{const u=d.selection;if(!u.isCollapsed||!h.consumable.consume(u,"selection"))return;const g=h.writer,p=u.getFirstPosition(),k=h.mapper.toViewPosition(p),b=g.breakAttributes(k);g.setSelection(b)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(l=>{if(l.rootName=="$graveyard")return null;const d=new Ml(this.view.document,l.name);return d.rootName=l.rootName,this.mapper.bindElements(l,d),d})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(t){const e=typeof t=="string"?t:t.name,n=this.model.markers.get(e);if(!n)throw new _("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:e});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(t){this.model.change(()=>{this.model.document.differ._refreshItem(t)})}}class Zo{constructor(){this._consumables=new Map}add(t,e){let n;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?n=this._consumables.get(t):(n=new vA(t),this._consumables.set(t,n)),n.add(e))}test(t,e){const n=this._consumables.get(t);return n===void 0?null:t.is("$text")||t.is("documentFragment")?n:n.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const n=this._consumables.get(t);n!==void 0&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):n.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},n=t.getAttributeKeys();for(const s of n)s!="style"&&s!="class"&&e.attributes.push(s);const i=t.getClassNames();for(const s of i)e.classes.push(s);const r=t.getStyleNames();for(const s of r)e.styles.push(s);return e}static createFrom(t,e){if(e||(e=new Zo),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,Zo.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const n of t.getChildren())e=Zo.createFrom(n,e);return e}}const Zi=["attributes","classes","styles"];class vA{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e of Zi)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e of Zi)if(e in t){const n=this._test(e,t[e]);if(n!==!0)return n}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e of Zi)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e of Zi)e in t&&this._revert(e,t[e])}_add(t,e){const n=Et(e),i=this._consumables[t];for(const r of n){if(t==="attributes"&&(r==="class"||r==="style"))throw new _("viewconsumable-invalid-attribute",this);if(i.set(r,!0),t==="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!0)}}_test(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style"){const s=i.get(r);if(s===void 0)return null;if(!s)return!1}else{const s=r=="class"?"classes":"styles",a=this._test(s,[...this._consumables[s].keys()]);if(a!==!0)return a}return!0}_consume(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style"){if(i.set(r,!1),t=="styles")for(const s of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(s,!1)}else{const s=r=="class"?"classes":"styles";this._consume(s,[...this._consumables[s].keys()])}}_revert(t,e){const n=Et(e),i=this._consumables[t];for(const r of n)if(t!=="attributes"||r!=="class"&&r!=="style")i.get(r)===!1&&i.set(r,!0);else{const s=r=="class"?"classes":"styles";this._revert(s,[...this._consumables[s].keys()])}}}class yA extends ft(){constructor(){super(),this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new jn(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new jn(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new _("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new _("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e=typeof t=="string"?t:"is"in t&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const n=this.getDefinition(t.last);return!!n&&n.allowAttributes.includes(e)}checkMerge(t,e){if(t instanceof L){const n=t.nodeBefore,i=t.nodeAfter;if(!(n instanceof Ct))throw new _("schema-check-merge-no-element-before",this);if(!(i instanceof Ct))throw new _("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of e.getChildren())if(!this.checkChild(t,n))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[n,i])=>{if(!i)return;const r=t(n,i);typeof r=="boolean"&&(e.stop(),e.return=r)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[n,i])=>{const r=t(n,i);typeof r=="boolean"&&(e.stop(),e.return=r)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;for(t instanceof L?e=t.parent:e=(t instanceof B?[t]:Array.from(t.getRanges())).reduce((n,i)=>{const r=i.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const n=[...t.getFirstPosition().getAncestors(),new yt("",t.getAttributes())];return this.checkAttribute(n,e)}{const n=t.getRanges();for(const i of n)for(const r of i)if(this.checkAttribute(r.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(t);for(const n of t)yield*this._getValidRangesForRange(n,e)}getNearestSelectionRange(t,e="both"){if(t.root.rootName=="$graveyard")return null;if(this.checkChild(t,"$text"))return new B(t);let n,i;const r=t.getAncestors().reverse().find(s=>this.isLimit(s))||t.root;e!="both"&&e!="backward"||(n=new Xe({boundaries:B._createIn(r),startPosition:t,direction:"backward"})),e!="both"&&e!="forward"||(i=new Xe({boundaries:B._createIn(r),startPosition:t}));for(const s of function*(a,c){let l=!1;for(;!l;){if(l=!0,a){const d=a.next();d.done||(l=!1,yield{walker:a,value:d.value})}if(c){const d=c.next();d.done||(l=!1,yield{walker:c,value:d.value})}}}(n,i)){const a=s.walker==n?"elementEnd":"elementStart",c=s.value;if(c.type==a&&this.isObject(c.item))return B._createOn(c.item);if(this.checkChild(c.nextPosition,"$text"))return new B(c.nextPosition)}return null}findAllowedParent(t,e){let n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(t,e,n){const i=n.model;for(const[r,s]of Object.entries(e))i.schema.checkAttribute(t,r)&&n.setAttribute(r,s,t)}removeDisallowedAttributes(t,e){for(const n of t)if(n.is("$text"))zd(this,n,e);else{const i=B._createIn(n).getPositions();for(const r of i)zd(this,r.nodeBefore||r.parent,e)}}getAttributesWithProperty(t,e,n){const i={};for(const[r,s]of t.getAttributes()){const a=this.getAttributeProperties(r);a[e]!==void 0&&(n!==void 0&&n!==a[e]||(i[r]=s))}return i}createContext(t){return new jn(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,n=Object.keys(e);for(const i of n)t[i]=xA(e[i],i);for(const i of n)EA(t,i);for(const i of n)DA(t,i);for(const i of n)IA(t,i);for(const i of n)SA(t,i),TA(t,i);for(const i of n)MA(t,i),BA(t,i),NA(t,i);this._compiledDefinitions=t}_checkContextMatch(t,e,n=e.length-1){const i=e.getItem(n);if(t.allowIn.includes(i.name)){if(n==0)return!0;{const r=this.getDefinition(i);return this._checkContextMatch(r,e,n-1)}}return!1}*_getValidRangesForRange(t,e){let n=t.start,i=t.start;for(const r of t.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(B._createIn(r),e)),this.checkAttribute(r,e)||(n.isEqual(i)||(yield new B(n,i)),n=L._createAfter(r)),i=L._createAfter(r);n.isEqual(i)||(yield new B(n,i))}findOptimalInsertionRange(t,e){const n=t.getSelectedElement();if(n&&this.isObject(n)&&!this.isInline(n))return e=="before"||e=="after"?new B(L._createAt(n,e)):B._createOn(n);const i=Wt(t.getSelectedBlocks());if(!i)return new B(t.focus);if(i.isEmpty)return new B(L._createAt(i,0));const r=L._createAfter(i);return t.focus.isTouching(r)?new B(r):new B(L._createBefore(i))}}class jn{constructor(t){if(t instanceof jn)return t;let e;e=typeof t=="string"?[t]:Array.isArray(t)?t:t.getAncestors({includeSelf:!0}),this._items=e.map(OA)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new jn([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function xA(o,t){const e={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const r of n){const s=Object.keys(r).filter(a=>a.startsWith("is"));for(const a of s)i[a]=!!r[a]}}(o,e),Fn(o,e,"allowIn"),Fn(o,e,"allowContentOf"),Fn(o,e,"allowWhere"),Fn(o,e,"allowAttributes"),Fn(o,e,"allowAttributesOf"),Fn(o,e,"allowChildren"),Fn(o,e,"inheritTypesFrom"),function(n,i){for(const r of n){const s=r.inheritAllFrom;s&&(i.allowContentOf.push(s),i.allowWhere.push(s),i.allowAttributesOf.push(s),i.inheritTypesFrom.push(s))}}(o,e),e}function EA(o,t){const e=o[t];for(const n of e.allowChildren){const i=o[n];i&&i.allowIn.push(t)}e.allowChildren.length=0}function DA(o,t){for(const e of o[t].allowContentOf)o[e]&&PA(o,e).forEach(n=>{n.allowIn.push(t)});delete o[t].allowContentOf}function IA(o,t){for(const e of o[t].allowWhere){const n=o[e];if(n){const i=n.allowIn;o[t].allowIn.push(...i)}}delete o[t].allowWhere}function SA(o,t){for(const e of o[t].allowAttributesOf){const n=o[e];if(n){const i=n.allowAttributes;o[t].allowAttributes.push(...i)}}delete o[t].allowAttributesOf}function TA(o,t){const e=o[t];for(const n of e.inheritTypesFrom){const i=o[n];if(i){const r=Object.keys(i).filter(s=>s.startsWith("is"));for(const s of r)s in e||(e[s]=i[s])}}delete e.inheritTypesFrom}function MA(o,t){const e=o[t],n=e.allowIn.filter(i=>o[i]);e.allowIn=Array.from(new Set(n))}function BA(o,t){const e=o[t];for(const n of e.allowIn)o[n].allowChildren.push(t)}function NA(o,t){const e=o[t];e.allowAttributes=Array.from(new Set(e.allowAttributes))}function Fn(o,t,e){for(const n of o){const i=n[e];typeof i=="string"?t[e].push(i):Array.isArray(i)&&t[e].push(...i)}}function PA(o,t){const e=o[t];return(n=o,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(e.name));var n}function OA(o){return typeof o=="string"||o.is("documentFragment")?{name:typeof o=="string"?o:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:o.is("element")?o.name:"$text",*getAttributeKeys(){yield*o.getAttributeKeys()},getAttribute:t=>o.getAttribute(t)}}function zd(o,t,e){for(const n of t.getAttributeKeys())o.checkAttribute(t,n)||e.removeAttribute(n,t)}var LA=Object.defineProperty,zA=Object.defineProperties,RA=Object.getOwnPropertyDescriptors,Rd=Object.getOwnPropertySymbols,jA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,jd=(o,t,e)=>t in o?LA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class VA extends kt(){constructor(t){var e;super(),this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=(e=((n,i)=>{for(var r in i||(i={}))jA.call(i,r)&&jd(n,r,i[r]);if(Rd)for(var r of Rd(i))FA.call(i,r)&&jd(n,r,i[r]);return n})({},t),zA(e,RA({consumable:null,writer:null,store:null,convertItem:(n,i)=>this._convertItem(n,i),convertChildren:(n,i)=>this._convertChildren(n,i),safeInsert:(n,i)=>this._safeInsert(n,i),updateConversionResult:(n,i)=>this._updateConversionResult(n,i),splitToAllowedParent:(n,i)=>this._splitToAllowedParent(n,i),getSplitParts:n=>this._getSplitParts(n),keepEmptyElement:n=>this._keepEmptyElement(n)})))}convert(t,e,n=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(s,a){let c;for(const l of new jn(s)){const d={};for(const u of l.getAttributeKeys())d[u]=l.getAttribute(u);const h=a.createElement(l.name,d);c&&a.insert(h,c),c=L._createAt(h,0)}return c}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Zo.createFrom(t),this.conversionApi.store={};const{modelRange:i}=this._convertItem(t,this._modelCursor),r=e.createDocumentFragment();if(i){this._removeEmptyElements();for(const s of Array.from(this._modelCursor.parent.getChildren()))e.append(s,r);r.markers=function(s,a){const c=new Set,l=new Map,d=B._createIn(s).getItems();for(const h of d)h.is("element","$marker")&&c.add(h);for(const h of c){const u=h.getAttribute("data-name"),g=a.createPositionBefore(h);l.has(u)?l.get(u).end=g.clone():l.set(u,new B(g.clone())),a.remove(h)}return l}(r,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(t,e){const n={viewItem:t,modelCursor:e,modelRange:null};if(t.is("element")?this.fire(`element:${t.name}`,n,this.conversionApi):t.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof B))throw new _("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(t,e){let n=e.is("position")?e:L._createAt(e,0);const i=new B(n);for(const r of Array.from(t.getChildren())){const s=this._convertItem(r,n);s.modelRange instanceof B&&(i.end=s.modelRange.end,n=s.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(t,e){const n=this._splitToAllowedParent(t,e);return!!n&&(this.conversionApi.writer.insert(t,n.position),!0)}_updateConversionResult(t,e){const n=this._getSplitParts(t),i=this.conversionApi.writer;e.modelRange||(e.modelRange=i.createRange(i.createPositionBefore(t),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(t);e.modelCursor=r?i.createPositionAt(r,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(e,t);if(r){if(r===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return Ed(e,t,n)?{position:Dd(e,i)}:null;const s=this.conversionApi.writer.split(e,r),a=[];for(const l of s.range.getWalker())if(l.type=="elementEnd")a.push(l.item);else{const d=a.pop(),h=l.item;this._registerSplitPair(d,h)}const c=s.range.end.parent;return this._cursorParents.set(t,c),{position:s.position,cursorParent:c}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const n=this._splitParts.get(t);this._splitParts.set(e,n),n.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_keepEmptyElement(t){this._emptyElementsToKeep.add(t)}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&!this._emptyElementsToKeep.has(e)&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}class HA{getHtml(t){const e=$.document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class UA{constructor(t){this.skipComments=!0,this.domParser=new DOMParser,this.domConverter=new qi(t,{renderingMode:"data"}),this.htmlWriter=new HA}toData(t){const e=this.domConverter.viewToDom(t);return this.htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this.domConverter.domToView(e,{skipComments:this.skipComments})}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode=t=="marked"?"markedNbsp":"nbsp"}_toDom(t){t.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(t=`${t}`);const e=this.domParser.parseFromString(t,"text/html"),n=e.createDocumentFragment(),i=e.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class qA extends kt(){constructor(t,e){super(),this.model=t,this.mapper=new cd,this.downcastDispatcher=new ud({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewPosition(i.range.start),c=s.createText(i.item.data);s.insert(a,c)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(n,i,r)=>{r.convertAttributes(i.item),i.reconversion||!i.item.is("element")||i.item.isEmpty||r.convertChildren(i.item)},{priority:"lowest"}),this.upcastDispatcher=new VA({schema:t.schema}),this.viewDocument=new Vi(e),this.stylesProcessor=e,this.htmlProcessor=new UA(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Nl(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:r,consumable:s,writer:a})=>{let c=i.modelCursor;if(!s.test(i.viewItem))return;if(!r.checkChild(c,"$text")){if(!Ed(c,"$text",r)||i.viewItem.data.trim().length==0)return;const d=c.nodeBefore;c=Dd(c,a),d&&d.is("element","$marker")&&(a.move(a.createRangeOn(d),c),c=a.createPositionAfter(d))}s.consume(i.viewItem);const l=a.createText(i.viewItem.data);a.insert(l,c),i.modelRange=a.createRange(c,c.getShiftedBy(l.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:s,modelCursor:a}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=s,i.modelCursor=a}},{priority:"lowest"}),ft().prototype.decorate.call(this,"init"),ft().prototype.decorate.call(this,"set"),ft().prototype.decorate.call(this,"get"),ft().prototype.decorate.call(this,"toView"),ft().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},xd)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:n="empty"}=t;if(!this._checkIfRootsExists([e]))throw new _("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(e);return i.isAttached()||Q("datacontroller-get-detached-root",this),n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,t):""}stringify(t,e={}){const n=this.toView(t,e);return this.processor.toData(n)}toView(t,e={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=B._createIn(t),s=new Ln(n);this.mapper.bindElements(t,s);const a=t.is("documentFragment")?t.markers:function(c){const l=[],d=c.root.document;if(!d)return new Map;const h=B._createIn(c);for(const u of d.model.markers){const g=u.getRange(),p=g.isCollapsed,k=g.start.isEqual(h.start)||g.end.isEqual(h.end);if(p&&k)l.push([u.name,g]);else{const b=h.getIntersection(g);b&&l.push([u.name,b])}}return l.sort(([u,g],[p,k])=>{if(g.end.compareWith(k.start)!=="after")return 1;if(g.start.compareWith(k.end)!=="before")return-1;switch(g.start.compareWith(k.start)){case"before":return 1;case"after":return-1;default:switch(g.end.compareWith(k.end)){case"before":return 1;case"after":return-1;default:return p.localeCompare(u)}}}),new Map(l)}(t);return this.downcastDispatcher.convert(r,a,i,e),s}init(t){if(this.model.document.version)throw new _("datacontroller-init-document-not-empty",this);let e={};if(typeof t=="string"?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new _("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},n=>{for(const i of Object.keys(e)){const r=this.model.document.getRoot(i);n.insert(this.parse(e[i],r),r,0)}}),Promise.resolve()}set(t,e={}){let n={};if(typeof t=="string"?n.main=t:n=t,!this._checkIfRootsExists(Object.keys(n)))throw new _("datacontroller-set-non-existent-root",this);this.model.enqueueChange(e.batchType||{},i=>{i.setSelection(null),i.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const r of Object.keys(n)){const s=this.model.document.getRoot(r);i.remove(i.createRangeIn(s)),i.insert(this.parse(n[r],s),s,0)}})}parse(t,e="$root"){const n=this.processor.toView(t);return this.toModel(n,e)}toModel(t,e="$root"){return this.model.change(n=>this.upcastDispatcher.convert(t,n,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRoot(e))return!1;return!0}}class GA{constructor(t,e){this._helpers=new Map,this._downcast=Et(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Et(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new _("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n})}for(t){if(!this._helpers.has(t))throw new _("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").elementToElement({model:e,view:n,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").elementToAttribute({view:n,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:n}of Hs(t))this.for("upcast").attributeToAttribute({view:n,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:n}){if(this._helpers.has(t))throw new _("conversion-group-exists",this);const i=n?new uA(e):new AA(e);this._helpers.set(t,i)}}function*Hs(o){if(o.model.values)for(const t of o.model.values){const e={key:o.model.key,value:t},n=o.view[t],i=o.upcastAlso?o.upcastAlso[t]:void 0;yield*Fd(e,n,i)}else yield*Fd(o.model,o.view,o.upcastAlso)}function*Fd(o,t,e){if(yield{model:o,view:t},e)for(const n of Et(e))yield{model:o,view:n}}class me{constructor(t){this.baseVersion=t,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t,e){return new this(t.baseVersion)}}function Us(o,t){const e=Hd(t),n=e.reduce((s,a)=>s+a.offsetSize,0),i=o.parent;ti(o);const r=o.index;return i._insertChild(r,e),Xo(i,r+e.length),Xo(i,r),new B(o,o.getShiftedBy(n))}function Vd(o){if(!o.isFlat)throw new _("operation-utils-remove-range-not-flat",this);const t=o.start.parent;ti(o.start),ti(o.end);const e=t._removeChildren(o.start.index,o.end.index-o.start.index);return Xo(t,o.start.index),e}function Jo(o,t){if(!o.isFlat)throw new _("operation-utils-move-range-not-flat",this);const e=Vd(o);return Us(t=t._getTransformedByDeletion(o.start,o.end.offset-o.start.offset),e)}function Hd(o){const t=[];(function e(n){if(typeof n=="string")t.push(new yt(n));else if(n instanceof Le)t.push(new yt(n.data,n.getAttributes()));else if(n instanceof zn)t.push(n);else if(Gt(n))for(const i of n)e(i)})(o);for(let e=1;et.maxOffset)throw new _("move-operation-nodes-do-not-exist",this);if(t===e&&n=n&&this.targetPosition.path[r]n._clone(!0))),e=new Kt(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new L(t,[0]);return new pt(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsete._clone(!0))),Us(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const n=[];for(const r of t.nodes)r.name?n.push(Ct.fromJSON(r)):n.push(yt.fromJSON(r));const i=new Kt(L.fromJSON(t.position,e),n,t.baseVersion);return i.shouldReceiveAttributes=t.shouldReceiveAttributes,i}}class xt extends me{constructor(t,e,n,i,r){super(r),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new L(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new B(this.splitPosition,t)}get affectedSelectable(){const t=[B._createFromPositionAndShift(this.splitPosition,0),B._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&t.push(B._createFromPositionAndShift(this.graveyardPosition,0)),t}clone(){return new xt(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new L(t,[0]);return new Pt(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset0&&(t.sourcePosition.isEqual(e.sourcePosition.getShiftedBy(e.howMany))&&this._setRelation(t,e,"mergeSourceAffected"),t.targetPosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeTargetWasBefore"));else if(t instanceof ie){const n=t.newRange;if(!n)return;if(e instanceof pt){const i=B._createFromPositionAndShift(e.sourcePosition,e.howMany),r=i.containsPosition(n.start)||i.start.isEqual(n.start),s=i.containsPosition(n.end)||i.end.isEqual(n.end);!r&&!s||i.containsRange(n)||this._setRelation(t,e,{side:r?"left":"right",path:r?n.start.path.slice():n.end.path.slice()})}else if(e instanceof Pt){const i=n.start.isEqual(e.targetPosition),r=n.start.isEqual(e.deletionPosition),s=n.end.isEqual(e.deletionPosition),a=n.end.isEqual(e.sourcePosition);(i||r||s||a)&&this._setRelation(t,e,{wasInLeftElement:i,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:s,wasInRightElement:a})}}}getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const n=this.originalOperations.get(e),i=this._history.getUndoneOperation(n);if(!i)return null;const r=this.originalOperations.get(t),s=this._relations.get(r);return s&&s.get(i)||null}_setRelation(t,e,n){const i=this.originalOperations.get(t),r=this.originalOperations.get(e);let s=this._relations.get(i);s||(s=new Map,this._relations.set(i,s)),s.set(r,n)}}function Wd(o,t){for(const e of o)e.baseVersion=t++}function Kd(o,t){for(let e=0;e{if(o.key===t.key&&o.range.start.hasSameParentAs(t.range.start)){const n=o.range.getDifference(t.range).map(r=>new Rt(r,o.key,o.oldValue,o.newValue,0)),i=o.range.getIntersection(t.range);return i&&e.aIsStrong&&n.push(new Rt(i,t.key,t.newValue,o.newValue,0)),n.length==0?[new Vt(0)]:n}return[o]}),gt(Rt,Kt,(o,t)=>{if(o.range.start.hasSameParentAs(t.position)&&o.range.containsPosition(t.position)){const e=o.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(n=>new Rt(n,o.key,o.oldValue,o.newValue,o.baseVersion));if(t.shouldReceiveAttributes){const n=$d(t,o.key,o.oldValue);n&&e.unshift(n)}return e}return o.range=o.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[o]}),gt(Rt,Pt,(o,t)=>{const e=[];o.range.start.hasSameParentAs(t.deletionPosition)&&(o.range.containsPosition(t.deletionPosition)||o.range.start.isEqual(t.deletionPosition))&&e.push(B._createFromPositionAndShift(t.graveyardPosition,1));const n=o.range._getTransformedByMergeOperation(t);return n.isCollapsed||e.push(n),e.map(i=>new Rt(i,o.key,o.oldValue,o.newValue,o.baseVersion))}),gt(Rt,pt,(o,t)=>function(n,i){const r=B._createFromPositionAndShift(i.sourcePosition,i.howMany);let s=null,a=[];r.containsRange(n,!0)?s=n:n.start.hasSameParentAs(r.start)?(a=n.getDifference(r),s=n.getIntersection(r)):a=[n];const c=[];for(let l of a){l=l._getTransformedByDeletion(i.sourcePosition,i.howMany);const d=i.getMovedRangeStart(),h=l.start.hasSameParentAs(d),u=l._getTransformedByInsertion(d,i.howMany,h);c.push(...u)}return s&&c.push(s._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany,!1)[0]),c}(o.range,t).map(n=>new Rt(n,o.key,o.oldValue,o.newValue,o.baseVersion))),gt(Rt,xt,(o,t)=>{if(o.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||o.range.end.offset++,[o];if(o.range.start.hasSameParentAs(t.splitPosition)&&o.range.containsPosition(t.splitPosition)){const e=o.clone();return e.range=new B(t.moveTargetPosition.clone(),o.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),o.range.end=t.splitPosition.clone(),o.range.end.stickiness="toPrevious",[o,e]}return o.range=o.range._getTransformedBySplitOperation(t),[o]}),gt(Kt,Rt,(o,t)=>{const e=[o];if(o.shouldReceiveAttributes&&o.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(o.position)){const n=$d(o,t.key,t.newValue);n&&e.push(n)}return e}),gt(Kt,Kt,(o,t,e)=>(o.position.isEqual(t.position)&&e.aIsStrong||(o.position=o.position._getTransformedByInsertOperation(t)),[o])),gt(Kt,pt,(o,t)=>(o.position=o.position._getTransformedByMoveOperation(t),[o])),gt(Kt,xt,(o,t)=>(o.position=o.position._getTransformedBySplitOperation(t),[o])),gt(Kt,Pt,(o,t)=>(o.position=o.position._getTransformedByMergeOperation(t),[o])),gt(ie,Kt,(o,t)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByInsertOperation(t)[0]),o.newRange&&(o.newRange=o.newRange._getTransformedByInsertOperation(t)[0]),[o])),gt(ie,ie,(o,t,e)=>{if(o.name==t.name){if(!e.aIsStrong)return[new Vt(0)];o.oldRange=t.newRange?t.newRange.clone():null}return[o]}),gt(ie,Pt,(o,t)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByMergeOperation(t)),o.newRange&&(o.newRange=o.newRange._getTransformedByMergeOperation(t)),[o])),gt(ie,pt,(o,t,e)=>{if(o.oldRange&&(o.oldRange=B._createFromRanges(o.oldRange._getTransformedByMoveOperation(t))),o.newRange){if(e.abRelation){const n=B._createFromRanges(o.newRange._getTransformedByMoveOperation(t));if(e.abRelation.side=="left"&&t.targetPosition.isEqual(o.newRange.start))return o.newRange.end=n.end,o.newRange.start.path=e.abRelation.path,[o];if(e.abRelation.side=="right"&&t.targetPosition.isEqual(o.newRange.end))return o.newRange.start=n.start,o.newRange.end.path=e.abRelation.path,[o]}o.newRange=B._createFromRanges(o.newRange._getTransformedByMoveOperation(t))}return[o]}),gt(ie,xt,(o,t,e)=>{if(o.oldRange&&(o.oldRange=o.oldRange._getTransformedBySplitOperation(t)),o.newRange){if(e.abRelation){const n=o.newRange._getTransformedBySplitOperation(t);return o.newRange.start.isEqual(t.splitPosition)&&e.abRelation.wasStartBeforeMergedElement?o.newRange.start=L._createAt(t.insertionPosition):o.newRange.start.isEqual(t.splitPosition)&&!e.abRelation.wasInLeftElement&&(o.newRange.start=L._createAt(t.moveTargetPosition)),o.newRange.end.isEqual(t.splitPosition)&&e.abRelation.wasInRightElement?o.newRange.end=L._createAt(t.moveTargetPosition):o.newRange.end.isEqual(t.splitPosition)&&e.abRelation.wasEndBeforeMergedElement?o.newRange.end=L._createAt(t.insertionPosition):o.newRange.end=n.end,[o]}o.newRange=o.newRange._getTransformedBySplitOperation(t)}return[o]}),gt(Pt,Kt,(o,t)=>(o.sourcePosition.hasSameParentAs(t.position)&&(o.howMany+=t.howMany),o.sourcePosition=o.sourcePosition._getTransformedByInsertOperation(t),o.targetPosition=o.targetPosition._getTransformedByInsertOperation(t),[o])),gt(Pt,Pt,(o,t,e)=>{if(o.sourcePosition.isEqual(t.sourcePosition)&&o.targetPosition.isEqual(t.targetPosition)){if(e.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),o.sourcePosition=new L(t.graveyardPosition.root,n),o.howMany=0,[o]}return[new Vt(0)]}if(o.sourcePosition.isEqual(t.sourcePosition)&&!o.targetPosition.isEqual(t.targetPosition)&&!e.bWasUndone&&e.abRelation!="splitAtSource"){const n=o.targetPosition.root.rootName=="$graveyard",i=t.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&e.aIsStrong){const r=t.targetPosition._getTransformedByMergeOperation(t),s=o.targetPosition._getTransformedByMergeOperation(t);return[new pt(r,o.howMany,s,0)]}return[new Vt(0)]}return o.sourcePosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMergeOperation(t),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),o.graveyardPosition.isEqual(t.graveyardPosition)&&e.aIsStrong||(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(t)),[o]}),gt(Pt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(t.sourcePosition,t.howMany);return t.type=="remove"&&!e.bWasUndone&&!e.forceWeakRemove&&o.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(o.sourcePosition)?[new Vt(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(o.sourcePosition)?o.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(o.sourcePosition)&&e.abRelation=="mergeSourceAffected"?o.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(o.targetPosition)?(o.targetPosition.stickiness="toNone",o.howMany-=t.howMany):t.targetPosition.isEqual(o.targetPosition)&&e.abRelation=="mergeTargetWasBefore"?(o.targetPosition.stickiness="toPrevious",o.howMany+=t.howMany):(o.sourcePosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.sourcePosition.hasSameParentAs(t.sourcePosition)&&(o.howMany-=t.howMany)),o.sourcePosition=o.sourcePosition._getTransformedByMoveOperation(t),o.targetPosition=o.targetPosition._getTransformedByMoveOperation(t),o.sourcePosition.stickiness="toPrevious",o.targetPosition.stickiness="toNext",o.graveyardPosition.isEqual(t.targetPosition)||(o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(t)),[o])}),gt(Pt,xt,(o,t,e)=>{if(t.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),o.deletionPosition.isEqual(t.graveyardPosition)&&(o.howMany=t.howMany)),o.targetPosition.isEqual(t.splitPosition)){const n=t.howMany!=0,i=t.graveyardPosition&&o.deletionPosition.isEqual(t.graveyardPosition);if(n||i||e.abRelation=="mergeTargetNotMoved")return o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(t),[o]}if(o.sourcePosition.isEqual(t.splitPosition)){if(e.abRelation=="mergeSourceNotMoved")return o.howMany=0,o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o];if(e.abRelation=="mergeSameElement"||o.sourcePosition.offset>0)return o.sourcePosition=t.moveTargetPosition.clone(),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o]}return o.sourcePosition.hasSameParentAs(t.splitPosition)&&(o.howMany=t.splitPosition.offset),o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(t),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(t),[o]}),gt(pt,Kt,(o,t)=>{const e=B._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByInsertOperation(t,!1)[0];return o.sourcePosition=e.start,o.howMany=e.end.offset-e.start.offset,o.targetPosition.isEqual(t.position)||(o.targetPosition=o.targetPosition._getTransformedByInsertOperation(t)),[o]}),gt(pt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(o.sourcePosition,o.howMany),i=B._createFromPositionAndShift(t.sourcePosition,t.howMany);let r,s=e.aIsStrong,a=!e.aIsStrong;if(e.abRelation=="insertBefore"||e.baRelation=="insertAfter"?a=!0:e.abRelation!="insertAfter"&&e.baRelation!="insertBefore"||(a=!1),r=o.targetPosition.isEqual(t.targetPosition)&&a?o.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):o.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Yd(o,t)&&Yd(t,o))return[t.getReversed()];if(n.containsPosition(t.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),lo([n],r);if(i.containsPosition(o.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),lo([n],r);const c=Mt(o.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(c=="prefix"||c=="extension")return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),lo([n],r);o.type!="remove"||t.type=="remove"||e.aWasUndone||e.forceWeakRemove?o.type=="remove"||t.type!="remove"||e.bWasUndone||e.forceWeakRemove||(s=!1):s=!0;const l=[],d=n.getDifference(i);for(const u of d){u.start=u.start._getTransformedByDeletion(t.sourcePosition,t.howMany),u.end=u.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const g=Mt(u.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same",p=u._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,g);l.push(...p)}const h=n.getIntersection(i);return h!==null&&s&&(h.start=h.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),h.end=h.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),l.length===0?l.push(h):l.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),l.length===0?[new Vt(o.baseVersion)]:lo(l,r)}),gt(pt,xt,(o,t,e)=>{let n=o.targetPosition.clone();o.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&e.abRelation!="moveTargetAfter"||(n=o.targetPosition._getTransformedBySplitOperation(t));const i=B._createFromPositionAndShift(o.sourcePosition,o.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||o.howMany++,o.targetPosition=n,[o];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){let s=new B(t.splitPosition,i.end);return s=s._getTransformedBySplitOperation(t),lo([new B(i.start,t.splitPosition),s],n)}o.targetPosition.isEqual(t.splitPosition)&&e.abRelation=="insertAtSource"&&(n=t.moveTargetPosition),o.targetPosition.isEqual(t.insertionPosition)&&e.abRelation=="insertBetween"&&(n=o.targetPosition);const r=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const s=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);o.howMany>1&&s&&!e.aWasUndone&&r.push(B._createFromPositionAndShift(t.insertionPosition,1))}return lo(r,n)}),gt(pt,Pt,(o,t,e)=>{const n=B._createFromPositionAndShift(o.sourcePosition,o.howMany);if(t.deletionPosition.hasSameParentAs(o.sourcePosition)&&n.containsPosition(t.sourcePosition)){if(o.type!="remove"||e.forceWeakRemove){if(o.howMany==1)return e.bWasUndone?(o.sourcePosition=t.graveyardPosition.clone(),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),[o]):[new Vt(0)]}else if(!e.aWasUndone){const r=[];let s=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t);o.howMany>1&&(r.push(new pt(o.sourcePosition,o.howMany-1,o.targetPosition,0)),s=s._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1),a=a._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1));const c=t.deletionPosition._getCombined(o.sourcePosition,o.targetPosition),l=new pt(s,1,c,0),d=l.getMovedRangeStart().path.slice();d.push(0);const h=new L(l.targetPosition.root,d);a=a._getTransformedByMove(s,c,1);const u=new pt(a,t.howMany,h,0);return r.push(l),r.push(u),r}}const i=B._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByMergeOperation(t);return o.sourcePosition=i.start,o.howMany=i.end.offset-i.start.offset,o.targetPosition=o.targetPosition._getTransformedByMergeOperation(t),[o]}),gt(re,Kt,(o,t)=>(o.position=o.position._getTransformedByInsertOperation(t),[o])),gt(re,Pt,(o,t)=>o.position.isEqual(t.deletionPosition)?(o.position=t.graveyardPosition.clone(),o.position.stickiness="toNext",[o]):(o.position=o.position._getTransformedByMergeOperation(t),[o])),gt(re,pt,(o,t)=>(o.position=o.position._getTransformedByMoveOperation(t),[o])),gt(re,re,(o,t,e)=>{if(o.position.isEqual(t.position)){if(!e.aIsStrong)return[new Vt(0)];o.oldName=t.newName}return[o]}),gt(re,xt,(o,t)=>{if(Mt(o.position.path,t.splitPosition.getParentPath())=="same"&&!t.graveyardPosition){const e=new re(o.position.getShiftedBy(1),o.oldName,o.newName,0);return[o,e]}return o.position=o.position._getTransformedBySplitOperation(t),[o]}),gt(tn,tn,(o,t,e)=>{if(o.root===t.root&&o.key===t.key){if(!e.aIsStrong||o.newValue===t.newValue)return[new Vt(0)];o.oldValue=t.newValue}return[o]}),gt(Ye,Ye,(o,t)=>o.rootName===t.rootName&&o.isAdd===t.isAdd?[new Vt(0)]:[o]),gt(xt,Kt,(o,t)=>(o.splitPosition.hasSameParentAs(t.position)&&o.splitPosition.offset{if(!o.graveyardPosition&&!e.bWasUndone&&o.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new L(t.graveyardPosition.root,n),r=xt.getInsertionPosition(new L(t.graveyardPosition.root,n)),s=new xt(i,0,r,null,0);return o.splitPosition=o.splitPosition._getTransformedByMergeOperation(t),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),o.graveyardPosition=s.insertionPosition.clone(),o.graveyardPosition.stickiness="toNext",[s,o]}return o.splitPosition.hasSameParentAs(t.deletionPosition)&&!o.splitPosition.isAfter(t.deletionPosition)&&o.howMany--,o.splitPosition.hasSameParentAs(t.targetPosition)&&(o.howMany+=t.howMany),o.splitPosition=o.splitPosition._getTransformedByMergeOperation(t),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(t)),[o]}),gt(xt,pt,(o,t,e)=>{const n=B._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.graveyardPosition){const r=n.start.isEqual(o.graveyardPosition)||n.containsPosition(o.graveyardPosition);if(!e.bWasUndone&&r){const s=o.splitPosition._getTransformedByMoveOperation(t),a=o.graveyardPosition._getTransformedByMoveOperation(t),c=a.path.slice();c.push(0);const l=new L(a.root,c);return[new pt(s,o.howMany,l,0)]}o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(t)}const i=o.splitPosition.isEqual(t.targetPosition);if(i&&(e.baRelation=="insertAtSource"||e.abRelation=="splitBefore"))return o.howMany+=t.howMany,o.splitPosition=o.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),o.insertionPosition=xt.getInsertionPosition(o.splitPosition),[o];if(i&&e.abRelation&&e.abRelation.howMany){const{howMany:r,offset:s}=e.abRelation;return o.howMany+=r,o.splitPosition=o.splitPosition.getShiftedBy(s),[o]}if(o.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(o.splitPosition)){const r=t.howMany-(o.splitPosition.offset-t.sourcePosition.offset);return o.howMany-=r,o.splitPosition.hasSameParentAs(t.targetPosition)&&o.splitPosition.offset{if(o.splitPosition.isEqual(t.splitPosition)){if(!o.graveyardPosition&&!t.graveyardPosition)return[new Vt(0)];if(o.graveyardPosition&&t.graveyardPosition&&o.graveyardPosition.isEqual(t.graveyardPosition))return[new Vt(0)];if(e.abRelation=="splitBefore")return o.howMany=0,o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(t),[o]}if(o.graveyardPosition&&t.graveyardPosition&&o.graveyardPosition.isEqual(t.graveyardPosition)){const n=o.splitPosition.root.rootName=="$graveyard",i=t.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&e.aIsStrong){const r=[];return t.howMany&&r.push(new pt(t.moveTargetPosition,t.howMany,t.splitPosition,0)),o.howMany&&r.push(new pt(o.splitPosition,o.howMany,o.moveTargetPosition,0)),r}return[new Vt(0)]}if(o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(t)),o.splitPosition.isEqual(t.insertionPosition)&&e.abRelation=="splitBefore")return o.howMany++,[o];if(t.splitPosition.isEqual(o.insertionPosition)&&e.baRelation=="splitBefore"){const n=t.insertionPosition.path.slice();n.push(0);const i=new L(t.insertionPosition.root,n);return[o,new pt(o.insertionPosition,1,i,0)]}return o.splitPosition.hasSameParentAs(t.splitPosition)&&o.splitPosition.offset{const e=t[0];e.isDocumentOperation&&ZA.call(this,e)},{priority:"low"})}function ZA(o){const t=this.getTransformedByOperation(o);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Zt.prototype.is=function(o){return o==="livePosition"||o==="model:livePosition"||o=="position"||o==="model:position"};class ho{constructor(t={}){typeof t=="string"&&(t=t==="transparent"?{isUndoable:!1}:{},Q("batch-constructor-deprecated-string-type"));const{isUndoable:e=!0,isLocal:n=!0,isUndo:i=!1,isTyping:r=!1}=t;this.operations=[],this.isUndoable=e,this.isLocal=n,this.isUndo=i,this.isTyping=r}get type(){return Q("batch-type-deprecated"),"default"}get baseVersion(){for(const t of this.operations)if(t.baseVersion!==null)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}var JA=Object.defineProperty,XA=Object.defineProperties,tC=Object.getOwnPropertyDescriptors,Qd=Object.getOwnPropertySymbols,eC=Object.prototype.hasOwnProperty,nC=Object.prototype.propertyIsEnumerable,Zd=(o,t,e)=>t in o?JA(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Jd=(o,t)=>{for(var e in t||(t={}))eC.call(t,e)&&Zd(o,e,t[e]);if(Qd)for(var e of Qd(t))nC.call(t,e)&&Zd(o,e,t[e]);return o};class oC{constructor(t){this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changedRoots=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set,this._markerCollection=t}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(t){const e=t;switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const n of e.range.getItems({shallow:!0}))this._isInInsertedElement(n.parent)||this._markAttribute(n);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const n=this._isInInsertedElement(e.sourcePosition.parent),i=this._isInInsertedElement(e.targetPosition.parent);n||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),i||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const n=B._createFromPositionAndShift(e.position,1);for(const i of this._markerCollection.getMarkersIntersectingRange(n)){const r=i.getData();this.bufferMarkerChange(i.name,r,r)}break}case"split":{const n=e.splitPosition.parent;this._isInInsertedElement(n)||this._markRemove(n,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const n=e.sourcePosition.parent;this._isInInsertedElement(n.parent)||this._markRemove(n.parent,n.startOffset,1);const i=e.graveyardPosition.parent;this._markInsert(i,e.graveyardPosition.offset,1);const r=e.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,e.targetPosition.offset,n.maxOffset);break}case"detachRoot":case"addRoot":{const n=e.affectedSelectable;if(!n._isLoaded||n.isAttached()==e.isAdd)return;this._bufferRootStateChange(e.rootName,e.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!e.root._isLoaded)return;const n=e.root.rootName;this._bufferRootAttributeChange(n,e.key,e.oldValue,e.newValue);break}}this._cachedChanges=null}bufferMarkerChange(t,e,n){e.range&&e.range.root.is("rootElement")&&!e.range.root._isLoaded&&(e.range=null),n.range&&n.range.root.is("rootElement")&&!n.range.root._isLoaded&&(n.range=null);let i=this._changedMarkers.get(t);i?i.newMarkerData=n:(i={newMarkerData:n,oldMarkerData:e},this._changedMarkers.set(t,i)),i.oldMarkerData.range==null&&n.range==null&&this._changedMarkers.delete(t)}getMarkersToRemove(){const t=[];for(const[e,n]of this._changedMarkers)n.oldMarkerData.range!=null&&t.push({name:e,range:n.oldMarkerData.range});return t}getMarkersToAdd(){const t=[];for(const[e,n]of this._changedMarkers)n.newMarkerData.range!=null&&t.push({name:e,range:n.newMarkerData.range});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(([t,e])=>({name:t,data:{oldRange:e.oldMarkerData.range,newRange:e.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0||this._changedRoots.size>0)return!0;for(const{newMarkerData:t,oldMarkerData:e}of this._changedMarkers.values()){if(t.affectsData!==e.affectsData)return!0;if(t.affectsData){const n=t.range&&!e.range,i=!t.range&&e.range,r=t.range&&e.range&&!t.range.isEqual(e.range);if(n||i||r)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((d,h)=>d.offset===h.offset?d.type!=h.type?d.type=="remove"?-1:1:0:d.offsetn.position.root!=i.position.root?n.position.root.rootNamen);for(const n of e)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e,this._cachedChanges=e.filter(rC),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(t=>{const e=Jd({},t);return e.state!==void 0&&delete e.attributes,e})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_bufferRootStateChange(t,e){if(!this._changedRoots.has(t))return void this._changedRoots.set(t,{name:t,state:e?"attached":"detached"});const n=this._changedRoots.get(t);n.state!==void 0?(delete n.state,n.attributes===void 0&&this._changedRoots.delete(t)):n.state=e?"attached":"detached"}_bufferRootAttributeChange(t,e,n,i){const r=this._changedRoots.get(t)||{name:t},s=r.attributes||{};if(s[e]){const a=s[e];i===a.oldValue?delete s[e]:a.newValue=i}else s[e]={oldValue:n,newValue:i};Object.entries(s).length===0?(delete r.attributes,r.state===void 0&&this._changedRoots.delete(t)):(r.attributes=s,this._changedRoots.set(t,r))}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t);const e=B._createOn(t);for(const n of this._markerCollection.getMarkersIntersectingRange(e)){const i=n.getData();this.bufferMarkerChange(n.name,i,i)}this._cachedChanges=null}_bufferRootLoad(t){if(t.isAttached()){this._bufferRootStateChange(t.rootName,!0),this._markInsert(t,0,t.maxOffset);for(const n of t.getAttributeKeys())this._bufferRootAttributeChange(t.rootName,n,null,t.getAttribute(n));for(const n of this._markerCollection)if(n.getRange().root==t){const i=n.getData();this.bufferMarkerChange(n.name,(e=Jd({},i),XA(e,tC({range:null}))),i)}var e}}_markInsert(t,e,n){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const i={type:"insert",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i)}_markRemove(t,e,n){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const i={type:"remove",offset:e,howMany:n,count:this._changeCount++};this._markChange(t,i),this._removeAllNestedChanges(t,e,n)}_markAttribute(t){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const n=this._getChangesForElement(t);this._handleChange(e,n),n.push(e);for(let i=0;in.offset){if(i>r){const s={type:"attribute",offset:r,howMany:i-r,count:this._changeCount++};this._handleChange(s,e),e.push(s)}t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=n.offset&&t.offsetr?(t.nodesToHandle=i-r,t.offset=r):t.nodesToHandle=0);if(n.type=="remove"&&t.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,e),e.push(s),t.nodesToHandle=n.offset-t.offset,t.howMany=t.nodesToHandle}n.type=="attribute"&&(t.offset>=n.offset&&i<=r?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=n.offset&&i>=r&&(n.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,n){return{type:"insert",position:L._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,_element:n.element}}_getRemoveDiff(t,e,n){return{type:"remove",position:L._createAt(t,e),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,_element:n.element}}_getAttributesDiff(t,e,n){const i=[];n=new Map(n);for(const[r,s]of e){const a=n.has(r)?n.get(r):null;a!==s&&i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:s,attributeNewValue:a,changeCount:this._changeCount++}),n.delete(r)}for(const[r,s]of n)i.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const n=this._changesInElement.get(e),i=t.startOffset;if(n){for(const r of n)if(r.type=="insert"&&i>=r.offset&&in){for(let s=0;sthis._version+1&&this._gaps.set(this._version,t),this._version=t}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(t){if(t.baseVersion!==this.version)throw new _("model-document-history-addoperation-incorrect-version",this,{operation:t,historyVersion:this.version});this._operations.push(t),this._version++,this._baseVersionToOperationIndex.set(t.baseVersion,this._operations.length-1)}getOperations(t,e=this.version){if(!this._operations.length)return[];const n=this._operations[0];t===void 0&&(t=n.baseVersion);let i=e-1;for(const[a,c]of this._gaps)t>a&&ta&&ithis.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(t);r===void 0&&(r=0);let s=this._baseVersionToOperationIndex.get(i);return s===void 0&&(s=this._operations.length-1),this._operations.slice(r,s+1)}getOperation(t){const e=this._baseVersionToOperationIndex.get(t);if(e!==void 0)return this._operations[e]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class Ji extends Ct{constructor(t,e,n="main"){super(e),this._isAttached=!0,this._isLoaded=!0,this._document=t,this.rootName=n}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}Ji.prototype.is=function(o,t){return t?t===this.name&&(o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"):o==="rootElement"||o==="model:rootElement"||o==="element"||o==="model:element"||o==="node"||o==="model:node"};var aC=Object.defineProperty,cC=Object.defineProperties,lC=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,dC=Object.prototype.hasOwnProperty,hC=Object.prototype.propertyIsEnumerable,eh=(o,t,e)=>t in o?aC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,nh=(o,t)=>{for(var e in t||(t={}))dC.call(t,e)&&eh(o,e,t[e]);if(th)for(var e of th(t))hC.call(t,e)&&eh(o,e,t[e]);return o},oh=(o,t)=>cC(o,lC(t));const ih="$graveyard";class uC extends kt(){constructor(t){super(),this.model=t,this.history=new sC,this.selection=new ze(this),this.roots=new Be({idProperty:"rootName"}),this.differ=new oC(t.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",ih),this.listenTo(t,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(e,n)=>{const i=n[0];i.isDocumentOperation&&this.history.addOperation(i)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(e,n,i,r,s)=>{const a=oh(nh({},n.getData()),{range:r});this.differ.bufferMarkerChange(n.name,s,a),i===null&&n.on("change",(c,l)=>{const d=n.getData();this.differ.bufferMarkerChange(n.name,oh(nh({},d),{range:l}),d)})}),this.registerPostFixer(e=>{let n=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),n=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),n=!0);return n})}get version(){return this.history.version}set version(t){this.history.version=t}get graveyard(){return this.getRoot(ih)}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new _("model-document-createroot-name-exists",this,{name:e});const n=new Ji(this,t,e);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(t=!1){return this.getRoots(t).map(e=>e.rootName)}getRoots(t=!1){return this.roots.filter(e=>e!=this.graveyard&&(t||e.isAttached())&&e._isLoaded)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=yl(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const t=this.getRoots();return t.length?t[0]:this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,n=e.schema,i=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(i)||e.createRange(i)}_validateSelectionRange(t){return rh(t.start)&&rh(t.end)}_callPostFixers(t){let e=!1;do for(const n of this._postFixers)if(this.selection.refresh(),e=n(t),e)break;while(e)}}function rh(o){const t=o.textNode;if(t){const e=t.data,n=o.offset-t.startOffset;return!gs(e,n)&&!ps(e,n)}return!0}var gC=Object.defineProperty,pC=Object.defineProperties,mC=Object.getOwnPropertyDescriptors,sh=Object.getOwnPropertySymbols,fC=Object.prototype.hasOwnProperty,kC=Object.prototype.propertyIsEnumerable,ah=(o,t,e)=>t in o?gC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class bC extends kt(){constructor(){super(...arguments),this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){const e=t instanceof uo?t.name:t;return this._markers.has(e)}get(t){return this._markers.get(t)||null}_set(t,e,n=!1,i=!1){const r=t instanceof uo?t.name:t;if(r.includes(","))throw new _("markercollection-incorrect-marker-name",this);const s=this._markers.get(r);if(s){const d=s.getData(),h=s.getRange();let u=!1;return h.isEqual(e)||(s._attachLiveRange(pe.fromRange(e)),u=!0),n!=s.managedUsingOperations&&(s._managedUsingOperations=n,u=!0),typeof i=="boolean"&&i!=s.affectsData&&(s._affectsData=i,u=!0),u&&this.fire(`update:${r}`,s,h,e,d),s}const a=pe.fromRange(e),c=new uo(r,a,n,i);var l;return this._markers.set(r,c),this.fire(`update:${r}`,c,null,e,(l=((d,h)=>{for(var u in h||(h={}))fC.call(h,u)&&ah(d,u,h[u]);if(sh)for(var u of sh(h))kC.call(h,u)&&ah(d,u,h[u]);return d})({},c.getData()),pC(l,mC({range:null})))),c}_remove(t){const e=t instanceof uo?t.name:t,n=this._markers.get(e);return!!n&&(this._markers.delete(e),this.fire(`update:${e}`,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(t){const e=t instanceof uo?t.name:t,n=this._markers.get(e);if(!n)throw new _("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire(`update:${e}`,n,i,i,n.getData())}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)e.getRange().getIntersection(t)!==null&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}class uo extends kt(fn){constructor(t,e,n,i){super(),this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new _("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}uo.prototype.is=function(o){return o==="marker"||o==="model:marker"};class wC extends me{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new _("detach-operation-on-document-node",this)}_execute(){Vd(B._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class en extends fn{constructor(t){super(),this.markers=new Map,this._children=new Ko,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const n of t)e=e.getChild(e.offsetToIndex(n));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const n of t)n.name?e.push(Ct.fromJSON(n)):e.push(yt.fromJSON(n));return new en(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const n=function(i){return typeof i=="string"?[new yt(i)]:(Gt(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new yt(r):r instanceof Le?new yt(r.data,r.getAttributes()):r))}(e);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(t,n)}_removeChildren(t,e=1){const n=this._children._removeNodes(t,e);for(const i of n)i.parent=null;return n}}en.prototype.is=function(o){return o==="documentFragment"||o==="model:documentFragment"};class AC{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new yt(t,e)}createElement(t,e){return new Ct(t,e)}createDocumentFragment(){return new en}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,n=0){if(this._assertWriterUsedCorrectly(),t instanceof yt&&t.data=="")return;const i=L._createAt(e,n);if(t.parent){if(dh(t.root,i.root))return void this.move(B._createOn(t),i);if(t.root.document)throw new _("model-writer-insert-forbidden-move",this);this.remove(t)}const r=i.root.document?i.root.document.version:null,s=new Kt(i,t,r);if(t instanceof yt&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),t instanceof en)for(const[a,c]of t.markers){const l=L._createAt(c.root,0),d={range:new B(c.start._getCombined(l,i),c.end._getCombined(l,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,d):this.addMarker(a,d)}}insertText(t,e,n,i){e instanceof en||e instanceof Ct||e instanceof L?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,i)}insertElement(t,e,n,i){e instanceof en||e instanceof Ct||e instanceof L?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,i)}append(t,e){this.insert(t,e,"end")}appendText(t,e,n){e instanceof en||e instanceof Ct?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),n,"end")}appendElement(t,e,n){e instanceof en||e instanceof Ct?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),n,"end")}setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof B){const i=n.getMinimalFlatRanges();for(const r of i)ch(this,t,e,r)}else lh(this,t,e,n)}setAttributes(t,e){for(const[n,i]of We(t))this.setAttribute(n,i,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof B){const n=e.getMinimalFlatRanges();for(const i of n)ch(this,t,null,i)}else lh(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(t instanceof B)for(const n of t.getItems())e(n);else e(t)}move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof B))throw new _("writer-move-invalid-range",this);if(!t.isFlat)throw new _("writer-move-range-not-flat",this);const i=L._createAt(e,n);if(i.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!dh(t.root,i.root))throw new _("writer-move-different-document",this);const r=t.root.document?t.root.document.version:null,s=new pt(t.start,t.end.offset-t.start.offset,i,r);this.batch.addOperation(s),this.model.applyOperation(s)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof B?t:B._createOn(t)).getMinimalFlatRanges().reverse();for(const n of e)this._addOperationForAffectedMarkers("move",n),CC(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Ct))throw new _("writer-merge-no-element-before",this);if(!(n instanceof Ct))throw new _("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(...t){return this.model.createSelection(...t)}_mergeDetached(t){const e=t.nodeBefore,n=t.nodeAfter;this.move(B._createIn(n),L._createAt(e,"end")),this.remove(n)}_merge(t){const e=L._createAt(t.nodeBefore,"end"),n=L._createAt(t.nodeAfter,0),i=t.root.document.graveyard,r=new L(i,[0]),s=t.root.document.version,a=new Pt(n,t.nodeAfter.maxOffset,e,r,s);this.batch.addOperation(a),this.model.applyOperation(a)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Ct))throw new _("writer-rename-not-element-instance",this);const n=t.root.document?t.root.document.version:null,i=new re(L._createBefore(t),t.name,e,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(t,e){this._assertWriterUsedCorrectly();let n,i,r=t.parent;if(!r.parent)throw new _("writer-split-element-no-parent",this);if(e||(e=r.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new _("writer-split-invalid-limit-element",this);do{const s=r.root.document?r.root.document.version:null,a=r.maxOffset-t.offset,c=xt.getInsertionPosition(t),l=new xt(t,a,c,null,s);this.batch.addOperation(l),this.model.applyOperation(l),n||i||(n=r,i=t.parent.nextSibling),r=(t=this.createPositionAfter(t.parent)).parent}while(r!==e);return{position:t,range:new B(L._createAt(n,"end"),L._createAt(i,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new _("writer-wrap-range-not-flat",this);const n=e instanceof Ct?e:new Ct(e);if(n.childCount>0)throw new _("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new _("writer-wrap-element-attached",this);this.insert(n,t.start);const i=new B(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(i,L._createAt(n,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),t.parent===null)throw new _("writer-unwrap-element-no-parent",this);this.move(B._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||typeof e.usingOperation!="boolean")throw new _("writer-addmarker-no-usingoperation",this);const n=e.usingOperation,i=e.range,r=e.affectsData!==void 0&&e.affectsData;if(this.model.markers.has(t))throw new _("writer-addmarker-marker-exists",this);if(!i)throw new _("writer-addmarker-no-range",this);return n?(ei(this,t,null,i,r),this.model.markers.get(t)):this.model.markers._set(t,i,n,r)}updateMarker(t,e){this._assertWriterUsedCorrectly();const n=typeof t=="string"?t:t.name,i=this.model.markers.get(n);if(!i)throw new _("writer-updatemarker-marker-not-exists",this);if(!e)return Q("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const r=typeof e.usingOperation=="boolean",s=typeof e.affectsData=="boolean",a=s?e.affectsData:i.affectsData;if(!r&&!e.range&&!s)throw new _("writer-updatemarker-wrong-options",this);const c=i.getRange(),l=e.range?e.range:c;r&&e.usingOperation!==i.managedUsingOperations?e.usingOperation?ei(this,n,null,l,a):(ei(this,n,c,null,a),this.model.markers._set(n,l,void 0,a)):i.managedUsingOperations?ei(this,n,c,l,a):this.model.markers._set(n,l,void 0,a)}removeMarker(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?t:t.name;if(!this.model.markers.has(e))throw new _("writer-removemarker-no-marker",this);const n=this.model.markers.get(e);if(!n.managedUsingOperations)return void this.model.markers._remove(e);ei(this,e,n.getRange(),null,n.affectsData)}addRoot(t,e="$root"){this._assertWriterUsedCorrectly();const n=this.model.document.getRoot(t);if(n&&n.isAttached())throw new _("writer-addroot-root-exists",this);const i=this.model.document,r=new Ye(t,e,!0,i,i.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(t)}detachRoot(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?this.model.document.getRoot(t):t;if(!e||!e.isAttached())throw new _("writer-detachroot-no-root",this);for(const r of this.model.markers)r.getRange().root===e&&this.removeMarker(r);for(const r of e.getAttributeKeys())this.removeAttribute(r,e);this.remove(this.createRangeIn(e));const n=this.model.document,i=new Ye(e.rootName,e.name,!1,n,n.version);this.batch.addOperation(i),this.model.applyOperation(i)}setSelection(...t){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...t)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._setSelectionAttribute(t,e);else for(const[n,i]of We(t))this._setSelectionAttribute(n,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=ze._getStoreAttributeKey(t);this.setAttribute(i,e,n.anchor.parent)}n._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const n=ze._getStoreAttributeKey(t);this.removeAttribute(n,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new _("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if(t==="move"){const s=e;r=s.containsPosition(i.start)||s.start.isEqual(i.start)||s.containsPosition(i.end)||s.end.isEqual(i.end)}else{const s=e,a=s.nodeBefore,c=s.nodeAfter,l=i.start.parent==a&&i.start.isAtEnd,d=i.end.parent==c&&i.end.offset==0,h=i.end.nodeAfter==c,u=i.start.nodeAfter==c;r=l||d||h||u}r&&this.updateMarker(n.name,{range:i})}}}function ch(o,t,e,n){const i=o.model,r=i.document;let s,a,c,l=n.start;for(const h of n.getWalker({shallow:!0}))c=h.item.getAttribute(t),s&&a!=c&&(a!=e&&d(),l=s),s=h.nextPosition,a=c;function d(){const h=new B(l,s),u=h.root.document?r.version:null,g=new Rt(h,t,a,e,u);o.batch.addOperation(g),i.applyOperation(g)}s instanceof L&&s!=l&&a!=e&&d()}function lh(o,t,e,n){const i=o.model,r=i.document,s=n.getAttribute(t);let a,c;if(s!=e){if(n.root===n){const l=n.document?r.version:null;c=new tn(n,t,s,e,l)}else{a=new B(L._createBefore(n),o.createPositionAfter(n));const l=a.root.document?r.version:null;c=new Rt(a,t,s,e,l)}o.batch.addOperation(c),i.applyOperation(c)}}function ei(o,t,e,n,i){const r=o.model,s=r.document,a=new ie(t,e,n,r.markers,!!i,s.version);o.batch.addOperation(a),r.applyOperation(a)}function CC(o,t,e,n){let i;if(o.root.document){const r=n.document,s=new L(r.graveyard,[0]);i=new pt(o,t,s,r.version)}else i=new wC(o,t);e.addOperation(i),n.applyOperation(i)}function dh(o,t){return o===t||o instanceof Ji&&t instanceof Ji}function _C(o,t,e={}){if(t.isCollapsed)return;const n=t.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=o.schema;o.change(r=>{if(!e.doNotResetEntireContent&&function(l,d){const h=l.getLimitElement(d);if(!d.containsEntireContent(h))return!1;const u=d.getFirstRange();return u.start.parent==u.end.parent?!1:l.checkChild(h,"paragraph")}(i,t))return void function(l,d){const h=l.model.schema.getLimitElement(d);l.remove(l.createRangeIn(h)),gh(l,l.createPositionAt(h,0),d)}(r,t);const s={};if(!e.doNotAutoparagraph){const l=t.getSelectedElement();l&&Object.assign(s,i.getAttributesWithProperty(l,"copyOnReplace",!0))}const[a,c]=function(l){const d=l.root.document.model,h=l.start;let u=l.end;if(d.hasContent(l,{ignoreMarkers:!0})){const g=function(p){const k=p.parent,b=k.root.document.model.schema,A=k.getAncestors({parentFirst:!0,includeSelf:!0});for(const E of A){if(b.isLimit(E))return null;if(b.isBlock(E))return E}}(u);if(g&&u.isTouching(d.createPositionAt(g,0))){const p=d.createSelection(l);d.modifySelection(p,{direction:"backward"});const k=p.getLastPosition(),b=d.createRange(k,u);d.hasContent(b,{ignoreMarkers:!0})||(u=k)}}return[Zt.fromPosition(h,"toPrevious"),Zt.fromPosition(u,"toNext")]}(n);a.isTouching(c)||r.remove(r.createRange(a,c)),e.leaveUnmerged||(function(l,d,h){const u=l.model;if(!Gs(l.model.schema,d,h))return;const[g,p]=function(k,b){const A=k.getAncestors(),E=b.getAncestors();let M=0;for(;A[M]&&A[M]==E[M];)M++;return[A[M],E[M]]}(d,h);!g||!p||(!u.hasContent(g,{ignoreMarkers:!0})&&u.hasContent(p,{ignoreMarkers:!0})?uh(l,d,h,g.parent):hh(l,d,h,g.parent))}(r,a,c),i.removeDisallowedAttributes(a.parent.getChildren(),r)),ph(r,t,a),!e.doNotAutoparagraph&&function(l,d){const h=l.checkChild(d,"$text"),u=l.checkChild(d,"paragraph");return!h&&u}(i,a)&&gh(r,a,t,s),a.detach(),c.detach()})}function hh(o,t,e,n){const i=t.parent,r=e.parent;if(i!=n&&r!=n){for(t=o.createPositionAfter(i),(e=o.createPositionBefore(r)).isEqual(t)||o.insert(r,t),o.merge(t);e.parent.isEmpty;){const s=e.parent;e=o.createPositionBefore(s),o.remove(s)}Gs(o.model.schema,t,e)&&hh(o,t,e,n)}}function uh(o,t,e,n){const i=t.parent,r=e.parent;if(i!=n&&r!=n){for(t=o.createPositionAfter(i),(e=o.createPositionBefore(r)).isEqual(t)||o.insert(i,e);t.parent.isEmpty;){const s=t.parent;t=o.createPositionBefore(s),o.remove(s)}e=o.createPositionBefore(r),function(s,a){const c=a.nodeBefore,l=a.nodeAfter;c.name!=l.name&&s.rename(c,l.name),s.clearAttributes(c),s.setAttributes(Object.fromEntries(l.getAttributes()),c),s.merge(a)}(o,e),Gs(o.model.schema,t,e)&&uh(o,t,e,n)}}function Gs(o,t,e){const n=t.parent,i=e.parent;return n!=i&&!o.isLimit(n)&&!o.isLimit(i)&&function(r,s,a){const c=new B(r,s);for(const l of c.getWalker())if(a.isLimit(l.item))return!1;return!0}(t,e,o)}function gh(o,t,e,n={}){const i=o.createElement("paragraph");o.model.schema.setAllowedAttributes(i,n,o),o.insert(i,t),ph(o,e,o.createPositionAt(i,0))}function ph(o,t,e){t instanceof ze?o.setSelection(e):t.setTo(e)}function mh(o,t){const e=[];Array.from(o.getItems({direction:"backward"})).map(n=>t.createRangeOn(n)).filter(n=>(n.start.isAfter(o.start)||n.start.isEqual(o.start))&&(n.end.isBefore(o.end)||n.end.isEqual(o.end))).forEach(n=>{e.push(n.start.parent),t.remove(n)}),e.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const r=t.createRangeOn(i);i=i.parent,t.remove(r)}})}class vC{constructor(t,e,n){this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null,this._nodeToSelect=null,this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0)}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(t);if(n.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new _("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?B._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new B(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=Zt.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new _("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=t:this._nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=Zt.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Zt.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Ct)||!this._canMergeLeft(t))return;const e=Zt._createBefore(t);e.stickiness="toNext";const n=Zt.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=Zt._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Zt._createAt(e.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Ct)||!this._canMergeRight(t))return;const e=Zt._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new _("insertcontent-invalid-insertion-position",this);this.position=L._createAt(e.nodeBefore,"end");const n=Zt.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=Zt._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Zt._createAt(e.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Ct&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Ct&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,e)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===e&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(t,e){return this.schema.checkChild(t,e)?t:this.schema.isLimit(t)?null:this._getAllowedIn(t.parent,e)}}function yC(o,t,e,n={}){if(!o.schema.isObject(t))throw new _("insertobject-element-not-an-object",o,{object:t});const i=e||o.document.selection;let r=i;n.findOptimalPosition&&o.schema.isBlock(t)&&(r=o.createSelection(o.schema.findOptimalInsertionRange(i,n.findOptimalPosition)));const s=Wt(i.getSelectedBlocks()),a={};return s&&Object.assign(a,o.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),o.change(c=>{r.isCollapsed||o.deleteContent(r,{doNotAutoparagraph:!0});let l=t;const d=r.anchor.parent;!o.schema.checkChild(d,t)&&o.schema.checkChild(d,"paragraph")&&o.schema.checkChild("paragraph",t)&&(l=c.createElement("paragraph"),c.insert(t,l)),o.schema.setAllowedAttributes(l,a,c);const h=o.insertContent(l,r);return h.isCollapsed||n.setSelection&&function(u,g,p,k){const b=u.model;if(p=="on")return void u.setSelection(g,"on");if(p!="after")throw new _("insertobject-invalid-place-parameter-value",b);let A=g.nextSibling;if(b.schema.isInline(g))return void u.setSelection(g,"after");!(A&&b.schema.checkChild(A,"$text"))&&b.schema.checkChild(g.parent,"paragraph")&&(A=u.createElement("paragraph"),b.schema.setAllowedAttributes(A,k,u),b.insertContent(A,u.createPositionAfter(g))),A&&u.setSelection(A,0)}(c,t,n.setSelection,a),h})}const xC=' ,.?!:;"-()';function EC(o,t){const{isForward:e,walker:n,unit:i,schema:r,treatEmojiAsSingleUnit:s}=o,{type:a,item:c,nextPosition:l}=t;if(a=="text")return o.unit==="word"?function(d,h){let u=d.position.textNode;for(u||(u=h?d.position.nodeAfter:d.position.nodeBefore);u&&u.is("$text");){const g=d.position.offset-u.startOffset;if(SC(u,g,h))u=h?d.position.nodeAfter:d.position.nodeBefore;else{if(IC(u.data,g,h))break;d.next()}}return d.position}(n,e):function(d,h,u){const g=d.position.textNode;if(g){const p=g.data;let k=d.position.offset-g.startOffset;for(;gs(p,k)||h=="character"&&ps(p,k)||u&&gl(p,k);)d.next(),k=d.position.offset-g.startOffset}return d.position}(n,i,s);if(a==(e?"elementStart":"elementEnd")){if(r.isSelectable(c))return L._createAt(c,e?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(c))return void n.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function DC(o,t){const e=o.root,n=L._createAt(e,t?"end":0);return t?new B(o,n):new B(n,o)}function IC(o,t,e){const n=t+(e?0:-1);return xC.includes(o.charAt(n))}function SC(o,t,e){return t===(e?o.offsetSize:0)}class TC extends ft(){constructor(){super(),this.markers=new bC,this.document=new uC(this),this.schema=new yA,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if(e.name==="$marker")return!0}),CA(this),this.document.registerPostFixer(xd),this.on("insertContent",(t,[e,n])=>{t.return=function(i,r,s){return i.change(a=>{const c=s||i.document.selection;c.isCollapsed||i.deleteContent(c,{doNotAutoparagraph:!0});const l=new vC(i,a,c.anchor),d=[];let h;if(r.is("documentFragment")){if(r.markers.size){const p=[];for(const[k,b]of r.markers){const{start:A,end:E}=b,M=A.isEqual(E);p.push({position:A,name:k,isCollapsed:M},{position:E,name:k,isCollapsed:M})}p.sort(({position:k},{position:b})=>k.isBefore(b)?1:-1);for(const{position:k,name:b,isCollapsed:A}of p){let E=null,M=null;const z=k.parent===r&&k.isAtStart,G=k.parent===r&&k.isAtEnd;z||G?A&&(M=z?"start":"end"):(E=a.createElement("$marker"),a.insert(E,k)),d.push({name:b,element:E,collapsed:M})}}h=r.getChildren()}else h=[r];l.handleNodes(h);let u=l.getSelectionRange();if(r.is("documentFragment")&&d.length){const p=u?pe.fromRange(u):null,k={};for(let b=d.length-1;b>=0;b--){const{name:A,element:E,collapsed:M}=d[b],z=!k[A];if(z&&(k[A]=[]),E){const G=a.createPositionAt(E,"before");k[A].push(G),a.remove(E)}else{const G=l.getAffectedRange();if(!G){M&&k[A].push(l.position);continue}M?k[A].push(G[M]):k[A].push(z?G.start:G.end)}}for(const[b,[A,E]]of Object.entries(k))A&&E&&A.root===E.root&&A.root.document&&a.addMarker(b,{usingOperation:!0,affectsData:!0,range:new B(A,E)});p&&(u=p.toRange(),p.detach())}u&&(c instanceof ze?a.setSelection(u):c.setTo(u));const g=l.getAffectedRange()||i.createRange(c.anchor);return l.destroy(),g})}(this,e,n)}),this.on("insertObject",(t,[e,n,i])=>{t.return=yC(this,e,n,i)}),this.on("canEditAt",t=>{const e=!this.document.isReadOnly;t.return=e,e||t.stop()})}change(t){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new ho,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(e){_.rethrowUnexpectedError(e,this)}}enqueueChange(t,e){try{t?typeof t=="function"?(e=t,t=new ho):t instanceof ho||(t=new ho(t)):t=new ho,this._pendingChanges.push({batch:t,callback:e}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){_.rethrowUnexpectedError(n,this)}}applyOperation(t){t._execute()}insertContent(t,e,n,...i){const r=Ws(e,n);return this.fire("insertContent",[t,r,n,...i])}insertObject(t,e,n,i,...r){const s=Ws(e,n);return this.fire("insertObject",[t,s,i,i,...r])}deleteContent(t,e){_C(this,t,e)}modifySelection(t,e){(function(n,i,r={}){const s=n.schema,a=r.direction!="backward",c=r.unit?r.unit:"character",l=!!r.treatEmojiAsSingleUnit,d=i.focus,h=new Xe({boundaries:DC(d,a),singleCharacters:!0,direction:a?"forward":"backward"}),u={walker:h,schema:s,isForward:a,unit:c,treatEmojiAsSingleUnit:l};let g;for(;g=h.next();){if(g.done)return;const p=EC(u,g.value);if(p)return void(i instanceof ze?n.change(k=>{k.setSelectionFocus(p)}):i.setFocus(p))}})(this,t,e)}getSelectedContent(t){return function(e,n){return e.change(i=>{const r=i.createDocumentFragment(),s=n.getFirstRange();if(!s||s.isCollapsed)return r;const a=s.start.root,c=s.start.getCommonPath(s.end),l=a.getNodeByPath(c);let d;d=s.start.parent==s.end.parent?s:i.createRange(i.createPositionAt(l,s.start.path[c.length]),i.createPositionAt(l,s.end.path[c.length]+1));const h=d.end.offset-d.start.offset;for(const u of d.getItems({shallow:!0}))u.is("$textProxy")?i.appendText(u.data,u.getAttributes(),r):i.append(i.cloneElement(u,!0),r);if(d!=s){const u=s._getTransformedByMove(d.start,i.createPositionAt(r,0),h)[0],g=i.createRange(i.createPositionAt(r,0),u.start);mh(i.createRange(u.end,i.createPositionAt(r,"end")),i),mh(g,i)}return r})}(this,t)}hasContent(t,e={}){const n=t instanceof B?t:B._createIn(t);if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=e;if(!r){for(const s of this.markers.getMarkersIntersectingRange(n))if(s.affectsData)return!0}for(const s of n.getItems())if(this.schema.isContent(s)&&(!s.is("$textProxy")||!i||s.data.search(/\S/)!==-1))return!0;return!1}canEditAt(t){const e=Ws(t);return this.fire("canEditAt",[e])}createPositionFromPath(t,e,n){return new L(t,e,n)}createPositionAt(t,e){return L._createAt(t,e)}createPositionAfter(t){return L._createAfter(t)}createPositionBefore(t){return L._createBefore(t)}createRange(t,e){return new B(t,e)}createRangeIn(t){return B._createIn(t)}createRangeOn(t){return B._createOn(t)}createSelection(...t){return new ge(...t)}createBatch(t){return new ho(t)}createOperationFromJSON(t){return WA.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new AC(this,e);const n=this._pendingChanges[0].callback(this._currentWriter);t.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return t}}function Ws(o,t){if(o)return o instanceof ge||o instanceof ze?o:o instanceof zn?t||t===0?new ge(o,t):o.is("rootElement")?new ge(o,"in"):new ge(o,"on"):new ge(o)}class MC extends pn{constructor(){super(...arguments),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}class Ks extends pn{constructor(){super(...arguments),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(t){this.fire(t.type,t)}}class nn{constructor(t){this.document=t}createDocumentFragment(t){return new Ln(this.document,t)}createElement(t,e,n){return new he(this.document,t,e,n)}createText(t){return new vt(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,n){return n._insertChild(t,e)}removeChildren(t,e,n){return n._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const n=t.parent;if(n){const i=n.getChildIndex(t);return this.removeChildren(i,1,n),this.insertChild(i,e,n),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const n=e.getChildIndex(t);this.remove(t),this.insertChild(n,t.getChildren(),e)}}rename(t,e){const n=new he(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null}setAttribute(t,e,n){n._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,n){de(t)&&n===void 0?e._setStyle(t):n._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,n){n._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return V._createAt(t,e)}createPositionAfter(t){return V._createAfter(t)}createPositionBefore(t){return V._createBefore(t)}createRange(t,e){return new nt(t,e)}createRangeOn(t){return nt._createOn(t)}createRangeIn(t){return nt._createIn(t)}createSelection(...t){return new Pe(...t)}}class BC{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const n=this.get(t);if(!n)throw new _("commandcollection-command-not-found",this,{commandName:t});return n.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}var NC=Object.defineProperty,fh=Object.getOwnPropertySymbols,PC=Object.prototype.hasOwnProperty,OC=Object.prototype.propertyIsEnumerable,kh=(o,t,e)=>t in o?NC(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;const $s="contentEditing",bh="common";class LC{constructor(t){this.keystrokeInfos=new Map,this._editor=t;const e=t.locale.t;this.addKeystrokeInfoCategory({id:$s,label:e("Content editing keystrokes"),description:e("These keyboard shortcuts allow for quick access to content editing features.")}),this.addKeystrokeInfoCategory({id:"navigation",label:e("User interface and content navigation keystrokes"),description:e("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:[{label:e("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:e("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:e("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:e("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:e("Navigate through the toolbar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:e("Execute the currently focused button"),keystroke:[["Enter"],["Space"]]}]}]})}addKeystrokeInfoCategory({id:t,label:e,description:n,groups:i}){this.keystrokeInfos.set(t,{id:t,label:e,description:n,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:t,id:bh}),i&&i.forEach(r=>{this.addKeystrokeInfoGroup(((s,a)=>{for(var c in a||(a={}))PC.call(a,c)&&kh(s,c,a[c]);if(fh)for(var c of fh(a))OC.call(a,c)&&kh(s,c,a[c]);return s})({categoryId:t},r))})}addKeystrokeInfoGroup({categoryId:t=$s,id:e,label:n,keystrokes:i}){const r=this.keystrokeInfos.get(t);if(!r)throw new _("accessibility-unknown-keystroke-info-category",this._editor,{groupId:e,categoryId:t});r.groups.set(e,{id:e,label:n,keystrokes:i||[]})}addKeystrokeInfos({categoryId:t=$s,groupId:e=bh,keystrokes:n}){if(!this.keystrokeInfos.has(t))throw new _("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:t,keystrokes:n});const i=this.keystrokeInfos.get(t);if(!i.groups.has(e))throw new _("accessibility-unknown-keystroke-info-group",this._editor,{groupId:e,categoryId:t,keystrokes:n});i.groups.get(e).keystrokes.push(...n)}}var wh=Object.getOwnPropertySymbols,zC=Object.prototype.hasOwnProperty,RC=Object.prototype.propertyIsEnumerable,Ah=(o,t)=>{var e={};for(var n in o)zC.call(o,n)&&t.indexOf(n)<0&&(e[n]=o[n]);if(o!=null&&wh)for(var n of wh(o))t.indexOf(n)<0&&RC.call(o,n)&&(e[n]=o[n]);return e};class jC extends ft(){constructor(t={}){super();const e=this.constructor,n=e.defaultConfig||{},{translations:i}=n,r=Ah(n,["translations"]),s=t,{translations:a=i}=s,c=Ah(s,["translations"]),l=t.language||r.language;this._context=t.context||new wl({language:l,translations:a}),this._context._addEditor(this,!t.context);const d=Array.from(e.builtinPlugins||[]);this.config=new Hc(c,r),this.config.define("plugins",d),this.config.define(this._context._getEditorConfig()),this.plugins=new kl(this,d,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new BC,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new TC,this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const h=new o0;this.data=new qA(this.model,h),this.editing=new _A(this.model,h),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new GA([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Pw(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new LC(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(t){throw new _("editor-isreadonly-has-no-setter")}enableReadOnlyMode(t){if(typeof t!="string"&&typeof t!="symbol")throw new _("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)||(this._readOnlyLocks.add(t),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(t){if(typeof t!="string"&&typeof t!="symbol")throw new _("editor-read-only-lock-id-invalid",null,{lockId:t});this._readOnlyLocks.has(t)&&(this._readOnlyLocks.delete(t),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(t){this.data.set(t)}getData(t){return this.data.get(t)}initPlugins(){const t=this.config,e=t.get("plugins"),n=t.get("removePlugins")||[],i=t.get("extraPlugins")||[],r=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(i),n,r)}destroy(){let t=Promise.resolve();return this.state=="initializing"&&(t=new Promise(e=>this.once("ready",e))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(t,...e){try{return this.commands.execute(t,...e)}catch(n){_.rethrowUnexpectedError(n,this)}}focus(){this.editing.view.focus()}static create(...t){throw new Error("This is an abstract method.")}}function Ys(o){return class extends o{updateSourceElement(t){if(!this.sourceElement)throw new _("editor-missing-sourceelement",this);const e=this.config.get("updateSourceElementOnDestroy"),n=this.sourceElement instanceof HTMLTextAreaElement;if(!e&&!n)return void Zc(this.sourceElement,"");const i=typeof t=="string"?t:this.data.get();Zc(this.sourceElement,i)}}}Ys.updateSourceElement=Ys(Object).prototype.updateSourceElement;class Ch extends Oi{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Be({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if(typeof t!="string")throw new _("pendingactions-add-invalid-message",this);const e=new(ft());return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const ot={bold:'',cancel:'',caption:'',check:'',cog:'',colorPalette:'',eraser:'',history:'',image:'',imageUpload:'',imageAssetManager:'',imageUrl:'',lowVision:'',textAlternative:'',loupe:'',previousArrow:'',nextArrow:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:'',dragIndicator:'',redo:'',undo:'',bulletedList:'',numberedList:'',todoList:'',codeBlock:'',browseFiles:'',heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:'',horizontalLine:'',html:'',indent:'',outdent:'',table:''};class ve extends Be{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(e,n,i)=>{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(e,n)=>{n.element&&this._parentElement&&n.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...t){if(!t.length||!t.every(e=>typeof e=="string"))throw new _("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const n of this)for(const i of t)n.delegate(i).to(e);this.on("add",(n,i)=>{for(const r of t)i.delegate(r).to(e)}),this.on("remove",(n,i)=>{for(const r of t)i.stopDelegating(r,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}remove(t){return super.remove(t)}}class Re extends kt(){constructor(t){super(),Object.assign(this,xh(yh(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,intoFragment:!1,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new _("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const n of e.children)tr(n)?yield n:Qs(n)&&(yield*t(n))}(this)}static bind(t,e){return{to:(n,i)=>new FC({eventNameOrFunction:n,attribute:n,observable:t,emitter:e,callback:i}),if:(n,i,r)=>new _h({observable:t,emitter:e,attribute:n,valueIfTrue:i,callback:r})}}static extend(t,e){if(t._isRendered)throw new _("template-extend-render",[this,t]);Sh(t,xh(yh(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new _("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),Xi(this.text)?this._bindToObservable({schema:this.text,updater:VC(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){if(!this.attributes)return;const e=t.node,n=t.revertData;for(const i in this.attributes){const r=e.getAttribute(i),s=this.attributes[i];n&&(n.attributes[i]=r);const a=Th(s)?s[0].ns:null;if(Xi(s)){const c=Th(s)?s[0].value:s;n&&Mh(i)&&c.unshift(r),this._bindToObservable({schema:c,updater:HC(e,i,a),data:t})}else if(i=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],t);else{n&&r&&Mh(i)&&s.unshift(r);const c=s.map(l=>l&&l.value||l).reduce((l,d)=>l.concat(d),[]).reduce(Dh,"");go(c)||e.setAttributeNS(a,i,c)}}}_renderStyleAttribute(t,e){const n=e.node;for(const i in t){const r=t[i];Xi(r)?this._bindToObservable({schema:[r],updater:UC(n,i),data:e}):n.style[i]=r}}_renderElementChildren(t){const e=t.node,n=t.intoFragment?document.createDocumentFragment():e,i=t.isApplying;let r=0;for(const s of this.children)if(Zs(s)){if(!i){s.setParent(e);for(const a of s)n.appendChild(a.element)}}else if(tr(s))i||(s.isRendered||s.render(),n.appendChild(s.element));else if(un(s))n.appendChild(s);else if(i){const a={children:[],bindings:[],attributes:{}};t.revertData.children.push(a),s._renderNode({intoFragment:!1,node:n.childNodes[r++],isApplying:!0,revertData:a})}else n.appendChild(s.render());t.intoFragment&&e.appendChild(n)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const n=this.eventListeners[e].map(i=>{const[r,s]=e.split("@");return i.activateDomEventListener(r,s,t)});t.revertData&&t.revertData.bindings.push(n)}}_bindToObservable({schema:t,updater:e,data:n}){const i=n.revertData;vh(t,e,n);const r=t.filter(s=>!go(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(t,e,n));i&&i.bindings.push(r)}_revertTemplateFromNode(t,e){for(const i of e.bindings)for(const r of i)r();if(e.text)return void(t.textContent=e.text);const n=t;for(const i in e.attributes){const r=e.attributes[i];r===null?n.removeAttribute(i):n.setAttribute(i,r)}for(let i=0;ivh(t,e,n);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,i),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,i)}}}class FC extends ni{constructor(t){super(t),this.eventNameOrFunction=t.eventNameOrFunction}activateDomEventListener(t,e,n){const i=(r,s)=>{e&&!s.target.matches(e)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(n.node,t,i),()=>{this.emitter.stopListening(n.node,t,i)}}}class _h extends ni{constructor(t){super(t),this.valueIfTrue=t.valueIfTrue}getValue(t){return!go(super.getValue(t))&&(this.valueIfTrue||!0)}}function Xi(o){return!!o&&(o.value&&(o=o.value),Array.isArray(o)?o.some(Xi):o instanceof ni)}function vh(o,t,{node:e}){const n=function(r,s){return r.map(a=>a instanceof ni?a.getValue(s):a)}(o,e);let i;i=o.length==1&&o[0]instanceof _h?n[0]:n.reduce(Dh,""),go(i)?t.remove():t.set(i)}function VC(o){return{set(t){o.textContent=t},remove(){o.textContent=""}}}function HC(o,t,e){return{set(n){o.setAttributeNS(e,t,n)},remove(){o.removeAttributeNS(e,t)}}}function UC(o,t){return{set(e){o.style[t]=e},remove(){o.style[t]=null}}}function yh(o){return os(o,t=>{if(t&&(t instanceof ni||Qs(t)||tr(t)||Zs(t)))return t})}function xh(o){if(typeof o=="string"?o=function(t){return{text:[t]}}(o):o.text&&function(t){t.text=Et(t.text)}(o),o.on&&(o.eventListeners=function(t){for(const e in t)Eh(t,e);return t}(o.on),delete o.on),!o.text){o.attributes&&function(e){for(const n in e)e[n].value&&(e[n].value=Et(e[n].value)),Eh(e,n)}(o.attributes);const t=[];if(o.children)if(Zs(o.children))t.push(o.children);else for(const e of o.children)Qs(e)||tr(e)||un(e)?t.push(e):t.push(new Re(e));o.children=t}return o}function Eh(o,t){o[t]=Et(o[t])}function Dh(o,t){return go(t)?o:go(o)?t:`${o} ${t}`}function Ih(o,t){for(const e in t)o[e]?o[e].push(...t[e]):o[e]=t[e]}function Sh(o,t){if(t.attributes&&(o.attributes||(o.attributes={}),Ih(o.attributes,t.attributes)),t.eventListeners&&(o.eventListeners||(o.eventListeners={}),Ih(o.eventListeners,t.eventListeners)),t.text&&o.text.push(...t.text),t.children&&t.children.length){if(o.children.length!=t.children.length)throw new _("ui-template-extend-children-mismatch",o);let e=0;for(const n of t.children)Sh(o.children[e++],n)}}function go(o){return!o&&o!==0}function tr(o){return o instanceof et}function Qs(o){return o instanceof Re}function Zs(o){return o instanceof ve}function Th(o){return bt(o[0])&&o[0].ns}function Mh(o){return o=="class"||o=="style"}var Bh=P(7676),qC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Bh.A,qC),Bh.A.locals;class et extends Ce(ft()){constructor(t){super(),this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new Be,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,n)=>{n.locale=t,n.t=t&&t.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Re.bind(this,this)}createCollection(t){const e=new ve(t);return this._viewCollections.add(e),e}registerChild(t){Gt(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){Gt(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new Re(t)}extendTemplate(t){Re.extend(this.template,t)}render(){if(this.isRendered)throw new _("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}var Nh=P(7801),GC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Nh.A,GC),Nh.A.locals;class er extends et{constructor(t){super(t),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${X()}`;const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class WC extends et{constructor(t,e){super(t);const n=t.t,i=new er;i.text=n("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":i.id,role:"document",tabindex:-1},children:[Ae(document,"p",{},n("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(e.values())),i]})}focus(){this.element.focus()}_createCategories(t){return t.map(e=>{const n=[Ae(document,"h3",{},e.label),...Array.from(e.groups.values()).map(i=>this._createGroup(i)).flat()];return e.description&&n.splice(1,0,Ae(document,"p",{},e.description)),Ae(document,"section",{},n)})}_createGroup(t){const e=t.keystrokes.sort((i,r)=>i.label.localeCompare(r.label)).map(i=>this._createGroupRow(i)).flat(),n=[Ae(document,"dl",{},e)];return t.label&&n.unshift(Ae(document,"h4",{},t.label)),n}_createGroupRow(t){const e=this.locale.t,n=Ae(document,"dt"),i=Ae(document,"dd"),r=function(a){return typeof a=="string"?[[a]]:typeof a[0]=="string"?[a]:a}(t.keystroke),s=[];for(const a of r)s.push(a.map(KC).join(""));return n.innerHTML=t.label,i.innerHTML=s.join(", ")+(t.mayRequireFn&&f.isMac?` ${e("(may require Fn)")}`:""),[n,i]}}function KC(o){return Pi(o).split("+").map(t=>`${t}`).join("+")}const Ph='';var Oh=P(8527),$C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Oh.A,$C),Oh.A.locals;class YC extends R{constructor(){super(...arguments),this.contentView=null}static get requires(){return[rn]}static get pluginName(){return"AccessibilityHelp"}init(){const t=this.editor,e=t.locale.t;t.ui.componentFactory.add("accessibilityHelp",n=>{const i=new wt(n);return i.set({label:e("Accessibility help"),tooltip:!0,withText:!1,keystroke:"Alt+0",icon:Ph}),i.on("execute",()=>this._showDialog()),i}),t.keystrokes.set("Alt+0",(n,i)=>{this._showDialog(),i()}),this._setupRootLabels()}_setupRootLabels(){const t=this.editor,e=t.editing.view,n=t.t;function i(r,s){const a=`${s.getAttribute("aria-label")}. ${n("Press %0 for help.",[Pi("Alt+0")])}`;r.setAttribute("aria-label",a,s)}t.ui.on("ready",()=>{e.change(r=>{for(const s of e.document.roots)i(r,s)}),t.on("addRoot",(r,s)=>{const a=t.editing.view.document.getRoot(s.rootName);e.change(c=>i(c,a))},{priority:"low"})})}_showDialog(){const t=this.editor,e=t.plugins.get("Dialog"),n=t.locale.t;this.contentView||(this.contentView=new WC(t.locale,t.accessibility.keystrokeInfos)),e.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:n("Accessibility help"),icon:Ph,hasCloseButton:!0,content:this.contentView})}}class QC extends ve{constructor(t,e=[]){super(e),this.locale=t}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new Re({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=Ae(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&t.childElementCount==0&&t.remove()}}var Lh=P(7621),ZC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Lh.A,ZC),Lh.A.locals;const zh=class extends et{constructor(){super();const o=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",o.if("isVisible","ck-hidden",t=>!t),"ck-reset_all-excluded",o.if("isColorInherited","ck-icon_inherit-color")],viewBox:o.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const o=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=o.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:e,value:n}of Array.from(o.attributes))zh.presentationalAttributeNames.includes(e)&&this.element.setAttribute(e,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;o.childNodes.length>0;)this.element.appendChild(o.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(o=>{o.style.fill=this.fillColor})}};let kn=zh;kn.presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];class JC extends et{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:t.to("style"),id:t.to("id")},children:[{text:t.to("text")}]})}}var Rh=P(9715),XC={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Rh.A,XC),Rh.A.locals;class wt extends et{constructor(t,e=new JC){super(t),this._focusDelayed=null;const n=this.bindTemplate,i=X();this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${i}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(e),this.iconView=new kn,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const r={tag:"button",attributes:{class:["ck","ck-button",n.to("class"),n.if("isEnabled","ck-disabled",s=>!s),n.if("isVisible","ck-hidden",s=>!s),n.to("isOn",s=>s?"ck-on":"ck-off"),n.if("withText","ck-button_with-text"),n.if("withKeystroke","ck-button_with-keystroke")],role:n.to("role"),type:n.to("type",s=>s||"button"),tabindex:n.to("tabindex"),"aria-label":n.to("ariaLabel"),"aria-labelledby":n.to("ariaLabelledBy"),"aria-disabled":n.if("isEnabled",!0,s=>!s),"aria-pressed":n.to("isOn",s=>!!this.isToggleable&&String(!!s)),"data-cke-tooltip-text":n.to("_tooltipString"),"data-cke-tooltip-position":n.to("tooltipPosition")},children:this.children,on:{click:n.to(s=>{this.isEnabled?this.fire("execute"):s.preventDefault()})}};f.isSafari&&(this._focusDelayed||(this._focusDelayed=us(()=>this.focus(),0)),r.on.mousedown=n.to(()=>{this._focusDelayed()}),r.on.mouseup=n.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(t){return t.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),t}_createKeystrokeView(){const t=new et;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Pi(e))}]}),t}_getTooltipString(t,e,n){return t?typeof t=="string"?t:(n&&(n=Pi(n)),t instanceof Function?t(e,n):`${e}${n?` (${n})`:""}`):""}}var jh=P(4391),t_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(jh.A,t_),jh.A.locals;class nr extends wt{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new et;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}const Js='';var Fh=P(25),e_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Fh.A,e_),Fh.A.locals;class n_ extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),e&&this.children.addMany(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",n.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:n.if("isCollapsed","hidden"),"aria-labelledby":n.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const t=new wt(this.locale),e=t.bindTemplate;return t.set({withText:!0,icon:Js}),t.extendTemplate({attributes:{"aria-expanded":e.to("isOn",n=>String(n))}}),t.bind("label").to(this),t.bind("isOn").to(this,"isCollapsed",n=>!n),t.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),t}}var Vh=P(7317),o_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Vh.A,o_),Vh.A.locals,P(6931),P(9047);var Hh=P(4962),i_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Hh.A,i_),Hh.A.locals;class or extends et{constructor(t,e){super(t);const n=`ck-labeled-field-view-${X()}`,i=`ck-labeled-field-view-status-${X()}`;this.fieldView=e(this,n,i),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,a)=>s||a);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",s=>!s),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(t){const e=new er(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new et(this.locale),n=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:t,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),e}focus(t){this.fieldView.focus(t)}}class r_ extends et{constructor(t){super(t),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.focusTracker=new Qt,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to((...n)=>{this.fire("input",...n),this._updateIsEmpty()}),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||t===0?t:""}}var Uh=P(253),s_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Uh.A,s_),Uh.A.locals;class a_ extends r_{constructor(t){super(t),this.set("inputMode","text");const e=this.bindTemplate;this.extendTemplate({attributes:{inputmode:e.to("inputMode")}})}}class c_ extends a_{constructor(t){super(t),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var qh=P(1671),l_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(qh.A,l_),qh.A.locals;class d_ extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",n=>`ck-dropdown__panel_${n}`),e.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:e.to(n=>{n.target.tagName.toLocaleLowerCase()!=="input"&&n.preventDefault()})}})}focus(){if(this.children.length){const t=this.children.first;typeof t.focus=="function"?t.focus():Q("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const t=this.children.last;typeof t.focusLast=="function"?t.focusLast():t.focus()}}}var Gh=P(8149),h_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Gh.A,h_),Gh.A.locals;const Xs=class extends et{constructor(o,t,e){super(o);const n=this.bindTemplate;this.buttonView=t,this.panelView=e,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new oe,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",i=>!i)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,e]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(t,e,n)=>{if(n)if(this.panelPosition==="auto"){const i=Xs._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=i?i.name:this._panelPositions[0].name}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const o=(t,e)=>{this.isOpen&&(this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",o),this.keystrokes.set("esc",o)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:o,north:t,southEast:e,southWest:n,northEast:i,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:c,northMiddleWest:l}=Xs.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[e,n,s,a,o,i,r,c,l,t]:[n,e,a,s,o,r,i,l,c,t]}};let ta=Xs;ta.defaultPanelPositions={south:(o,t)=>({top:o.bottom,left:o.left-(t.width-o.width)/2,name:"s"}),southEast:o=>({top:o.bottom,left:o.left,name:"se"}),southWest:(o,t)=>({top:o.bottom,left:o.left-t.width+o.width,name:"sw"}),southMiddleEast:(o,t)=>({top:o.bottom,left:o.left-(t.width-o.width)/4,name:"sme"}),southMiddleWest:(o,t)=>({top:o.bottom,left:o.left-3*(t.width-o.width)/4,name:"smw"}),north:(o,t)=>({top:o.top-t.height,left:o.left-(t.width-o.width)/2,name:"n"}),northEast:(o,t)=>({top:o.top-t.height,left:o.left,name:"ne"}),northWest:(o,t)=>({top:o.top-t.height,left:o.left-t.width+o.width,name:"nw"}),northMiddleEast:(o,t)=>({top:o.top-t.height,left:o.left-(t.width-o.width)/4,name:"nme"}),northMiddleWest:(o,t)=>({top:o.top-t.height,left:o.left-3*(t.width-o.width)/4,name:"nmw"})},ta._getOptimalPosition=ss;class u_ extends wt{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new kn;return t.content=Js,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}class ye extends kt(){constructor(t){if(super(),this.focusables=t.focusables,this.focusTracker=t.focusTracker,this.keystrokeHandler=t.keystrokeHandler,this.actions=t.actions,t.actions&&t.keystrokeHandler)for(const e in t.actions){let n=t.actions[e];typeof n=="string"&&(n=[n]);for(const i of n)t.keystrokeHandler.set(i,(r,s)=>{this[e](),s()})}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(ea)||null}get last(){return this.focusables.filter(ea).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let t=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((e,n)=>{const i=e.element===this.focusTracker.focusedElement;return i&&(t=n),i}),t)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const t=this.next;t&&this.focusables.getIndex(t)===this.current||t===this.first?this.fire("forwardCycle"):this._focus(t,1)}focusPrevious(){const t=this.previous;t&&this.focusables.getIndex(t)===this.current||t===this.last?this.fire("backwardCycle"):this._focus(t,-1)}_focus(t,e){t&&this.focusTracker.focusedElement!==t.element&&t.focus(e)}_getDomFocusableItem(t){const e=this.focusables.length;if(!e)return null;const n=this.current;if(n===null)return this[t===1?"first":"last"];let i=this.focusables.get(n),r=(n+e+t)%e;do{const s=this.focusables.get(r);if(ea(s)){i=s;break}r=(r+e+t)%e}while(r!==n);return i}}function ea(o){return oi(o)&&Mn(o.element)}function oi(o){return!(!("focus"in o)||typeof o.focus!="function")}class Wh extends et{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class g_ extends et{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}var p_=Object.defineProperty,Kh=Object.getOwnPropertySymbols,m_=Object.prototype.hasOwnProperty,f_=Object.prototype.propertyIsEnumerable,$h=(o,t,e)=>t in o?p_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Yh=(o,t)=>{for(var e in t||(t={}))m_.call(t,e)&&$h(o,e,t[e]);if(Kh)for(var e of Kh(t))f_.call(t,e)&&$h(o,e,t[e]);return o};function Qh(o){if(Array.isArray(o))return{items:o,removeItems:[]};const t={items:[],removeItems:[]};return o?Yh(Yh({},t),o):t}var Zh=P(9677),k_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Zh.A,k_),Zh.A.locals;const{threeVerticalDots:Jh}=ot,b_={alignLeft:ot.alignLeft,bold:ot.bold,importExport:ot.importExport,paragraph:ot.paragraph,plus:ot.plus,text:ot.text,threeVerticalDots:ot.threeVerticalDots,pilcrow:ot.pilcrow,dragIndicator:ot.dragIndicator};class na extends et{constructor(t,e){super(t);const n=this.bindTemplate,i=this.t;this.options=e||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new oe,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new w_(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=t.uiLanguageDirection==="rtl";this._focusCycler=new ye({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var a;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(a=this,a.bindTemplate.to(c=>{c.target===a.element&&c.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new C_(this):new A_(this)}render(){super.render(),this.focusTracker.add(this.element);for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e,n){this.items.addMany(this._buildItemsFromConfig(t,e,n))}_buildItemsFromConfig(t,e,n){const i=Qh(t),r=n||i.removeItems;return this._cleanItemsConfiguration(i.items,e,r).map(s=>bt(s)?this._createNestedToolbarDropdown(s,e,r):s==="|"?new Wh:s==="-"?new g_:e.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(t,e,n){const i=t.filter((r,s,a)=>r==="|"||n.indexOf(r)===-1&&(r==="-"?!this.options.shouldGroupWhenFull||(Q("toolbarview-line-break-ignored-when-grouping-items",a),!1):!(!bt(r)&&!e.has(r))||(Q("toolbarview-item-unavailable",{item:r}),!1)));return this._cleanSeparatorsAndLineBreaks(i)}_cleanSeparatorsAndLineBreaks(t){const e=s=>s!=="-"&&s!=="|",n=t.length,i=t.findIndex(e);if(i===-1)return[];const r=n-t.slice().reverse().findIndex(e);return t.slice(i,r).filter((s,a,c)=>e(s)?!0:!(a>0&&c[a-1]===s))}_createNestedToolbarDropdown(t,e,n){let{label:i,icon:r,items:s,tooltip:a=!0,withText:c=!1}=t;if(s=this._cleanItemsConfiguration(s,e,n),!s.length)return null;const l=on(this.locale);return i||Q("toolbarview-nested-toolbar-dropdown-missing-label",t),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:i,tooltip:a,withText:!!c}),r!==!1?l.buttonView.icon=b_[r]||r||Jh:l.buttonView.withText=!0,oa(l,()=>l.toolbarView._buildItemsFromConfig(s,e,n)),l}}class w_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class A_{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(n=>n),t.focusables.bindTo(t.items).using(n=>oi(n)?n:null),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class C_{constructor(t){this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),t.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),t.children.on("change",this._updateFocusCyclableItems.bind(this)),t.items.on("change",(e,n)=>{const i=n.index,r=Array.from(n.added);for(const s of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=i;sthis.ungroupedItems.length?this.groupedItems.add(a,s-this.ungroupedItems.length):this.ungroupedItems.add(a,s)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!Mn(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,n=new dt(t.lastChild),i=new dt(t);if(!this.cachedPadding){const r=$.window.getComputedStyle(t),s=e==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[s])}return e==="ltr"?n.right>i.right-this.cachedPadding:n.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Wh),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,n=on(t);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=t.uiLanguageDirection==="ltr"?"sw":"se",oa(n,this.groupedItems),n.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:t.uiLanguageDirection==="rtl"?"se":"sw",icon:Jh}),n}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{oi(t)&&this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class ir extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",e.if("isVisible","ck-hidden",n=>!n)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class Xh extends et{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class rr extends et{constructor(t,e=new er){super(t);const n=this.bindTemplate,i=new eu(t);this.set({label:"",isVisible:!0}),this.labelView=e,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,i]),i.set({role:"group",ariaLabelledBy:e.id}),i.focusTracker.destroy(),i.keystrokes.destroy(),this.items=i.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",n.if("isVisible","ck-hidden",r=>!r)]},children:this.children})}focus(){if(this.items){const t=this.items.find(e=>!(e instanceof Xh));t&&t.focus()}}}var tu=P(5199),v_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(tu.A,v_),tu.A.locals;class eu extends et{constructor(t){super(t),this._listItemGroupToChangeListeners=new WeakMap;const e=this.bindTemplate;this.focusables=new ve,this.items=this.createCollection(),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusCycler=new ye({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:e.to("role"),"aria-label":e.to("ariaLabel"),"aria-labelledby":e.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const t of this.items)t instanceof rr?this._registerFocusableItemsGroup(t):t instanceof ir&&this._registerFocusableListItem(t);this.items.on("change",(t,e)=>{for(const n of e.removed)n instanceof rr?this._deregisterFocusableItemsGroup(n):n instanceof ir&&this._deregisterFocusableListItem(n);for(const n of Array.from(e.added).reverse())n instanceof rr?this._registerFocusableItemsGroup(n,e.index):this._registerFocusableListItem(n,e.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(t,e){this.focusTracker.add(t.element),this.focusables.add(t,e)}_deregisterFocusableListItem(t){this.focusTracker.remove(t.element),this.focusables.remove(t)}_getOnGroupItemsChangeCallback(t){return(e,n)=>{for(const i of n.removed)this._deregisterFocusableListItem(i);for(const i of Array.from(n.added).reverse())this._registerFocusableListItem(i,this.items.getIndex(t)+n.index)}}_registerFocusableItemsGroup(t,e){Array.from(t.items).forEach((i,r)=>{const s=e!==void 0?e+r:void 0;this._registerFocusableListItem(i,s)});const n=this._getOnGroupItemsChangeCallback(t);this._listItemGroupToChangeListeners.set(t,n),t.items.on("change",n)}_deregisterFocusableItemsGroup(t){for(const e of t.items)this._deregisterFocusableListItem(e);t.items.off("change",this._listItemGroupToChangeListeners.get(t)),this._listItemGroupToChangeListeners.delete(t)}}var nu=P(1792),y_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(nu.A,y_),nu.A.locals;class sr extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(e),this.arrowView=this._createArrowView(),this.keystrokes=new oe,this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",n.to("class"),n.if("isVisible","ck-hidden",i=>!i),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(t){const e=t||new wt;return t||e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const t=new wt,e=t.bindTemplate;return t.icon=Js,t.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":e.to("isOn"),"aria-haspopup":!0,"aria-expanded":e.to("isOn",n=>String(n))}}),t.bind("isEnabled").to(this),t.bind("label").to(this),t.bind("tooltip").to(this),t.delegate("execute").to(this,"open"),t}}var ou=P(1666),x_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ou.A,x_),ou.A.locals;var iu=P(3629),E_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(iu.A,E_),iu.A.locals;function on(o,t=u_){const e=typeof t=="function"?new t(o):t,n=new d_(o),i=new ta(o,e,n);return e.bind("isEnabled").to(i),e instanceof sr?e.arrowView.bind("isOn").to(i,"isOpen"):e.bind("isOn").to(i,"isOpen"),function(r){(function(s){s.on("render",()=>{v({emitter:s,activator:()=>s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...s.focusTracker._elements]})})})(r),function(s){s.on("execute",a=>{a.source instanceof nr||(s.isOpen=!1)})}(r),function(s){s.focusTracker.on("change:isFocused",(a,c,l)=>{s.isOpen&&!l&&(s.isOpen=!1)})}(r),function(s){s.keystrokes.set("arrowdown",(a,c)=>{s.isOpen&&(s.panelView.focus(),c())}),s.keystrokes.set("arrowup",(a,c)=>{s.isOpen&&(s.panelView.focusLast(),c())})}(r),function(s){s.on("change:isOpen",(a,c,l)=>{if(l)return;const d=s.panelView.element;d&&d.contains($.document.activeElement)&&s.buttonView.focus()})}(r),function(s){s.on("change:isOpen",(a,c,l)=>{l&&s.panelView.focus()},{priority:"low"})}(r)}(i),i}function oa(o,t,e={}){o.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),o.isOpen?ru(o,t,e):o.once("change:isOpen",()=>ru(o,t,e),{priority:"highest"}),e.enableActiveItemFocusOnDropdownOpen&&cu(o,()=>o.toolbarView.items.find(n=>n.isOn))}function ru(o,t,e){const n=o.locale,i=n.t,r=o.toolbarView=new na(n),s=typeof t=="function"?t():t;r.ariaLabel=e.ariaLabel||i("Dropdown toolbar"),e.maxWidth&&(r.maxWidth=e.maxWidth),e.class&&(r.class=e.class),e.isCompact&&(r.isCompact=e.isCompact),e.isVertical&&(r.isVertical=!0),s instanceof ve?r.items.bindTo(s).using(a=>a):r.items.addMany(s),o.panelView.children.add(r),r.items.delegate("execute").to(o)}function su(o,t,e={}){o.isOpen?au(o,t,e):o.once("change:isOpen",()=>au(o,t,e),{priority:"highest"}),cu(o,()=>o.listView.items.find(n=>n instanceof ir&&n.children.first.isOn))}function au(o,t,e){const n=o.locale,i=o.listView=new eu(n),r=typeof t=="function"?t():t;i.ariaLabel=e.ariaLabel,i.role=e.role,lu(o,i.items,r,n),o.panelView.children.add(i),i.items.delegate("execute").to(o)}function cu(o,t){o.on("change:isOpen",()=>{if(!o.isOpen)return;const e=t();e&&(typeof e.focus=="function"?e.focus():Q("ui-dropdown-focus-child-on-open-child-missing-focus",{view:e}))},{priority:At.low-10})}function lu(o,t,e,n){t.bindTo(e).using(i=>{if(i.type==="separator")return new Xh(n);if(i.type==="group"){const r=new rr(n);return r.set({label:i.label}),lu(o,r.items,i.items,n),r.items.delegate("execute").to(o),r}if(i.type==="button"||i.type==="switchbutton"){const r=new ir(n);let s;return i.type==="button"?(s=new wt(n),s.extendTemplate({attributes:{"aria-checked":s.bindTemplate.to("isOn")}})):s=new nr(n),s.bind(...Object.keys(i.model)).to(i.model),s.delegate("execute").to(r),r.children.add(s),r}return null})}const ar=(o,t,e)=>{const n=new c_(o.locale);return n.set({id:t,ariaDescribedById:e}),n.bind("isReadOnly").to(o,"isEnabled",i=>!i),n.bind("hasError").to(o,"errorText",i=>!!i),n.on("input",()=>{o.errorText=null}),o.bind("isEmpty","isFocused","placeholder").to(n),n};var du=P(1905),D_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(du.A,D_),du.A.locals;var hu=P(6309),I_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(hu.A,I_),hu.A.locals;class S_{constructor(t){this._components=new Map,this.editor=t}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(ia(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new _("componentfactory-item-missing",this,{name:t});return this._components.get(ia(t)).callback(this.editor.locale)}has(t){return this._components.has(ia(t))}}function ia(o){return String(o).toLowerCase()}var uu=P(7913),T_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(uu.A,T_),uu.A.locals;class M_ extends et{constructor(t,e={}){super(t);const n=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",n.to("class")]},children:this.children}),e.icon&&(this.iconView=new kn,this.iconView.content=e.icon,this.children.add(this.iconView));const i=new et(t);i.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:n.to("label")}]}),this.children.add(i)}}var gu=P(9822),B_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(gu.A,B_),gu.A.locals;class N_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.keystrokes=new oe,this._focusTracker=new Qt,this._focusables=new ve,this.focusCycler=new ye({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(t){for(const e of t){const n=new wt(this.locale);let i;for(i in n.on("execute",()=>e.onExecute()),e.onCreate&&e.onCreate(n),e)i!="onExecute"&&i!="onCreate"&&n.set(i,e[i]);this.children.add(n)}this._updateFocusCyclableItems()}focus(t){t===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(t=>{this._focusables.add(t),this._focusTracker.add(t.element)})}}class P_ extends et{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}var pu=P(9819),O_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(pu.A,O_),pu.A.locals;const cr="screen-center",mu="editor-center",L_="editor-top-side",z_="editor-top-center",R_="editor-bottom-center",j_="editor-above-center",F_="editor-below-center",fu=oo("px"),ku=class extends function(o){return class extends o{constructor(...t){super(...t),this._onDragBound=this._onDrag.bind(this),this._onDragEndBound=this._onDragEnd.bind(this),this._lastDraggingCoordinates={x:0,y:0},this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo($.document,"mouseup",this._onDragEndBound),this.listenTo($.document,"touchend",this._onDragEndBound),this.listenTo($.document,"mousemove",this._onDragBound),this.listenTo($.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening($.document,"mouseup",this._onDragEndBound),this.stopListening($.document,"touchend",this._onDragEndBound),this.stopListening($.document,"mousemove",this._onDragBound),this.stopListening($.document,"touchmove",this._onDragBound)}_onDragStart(t,e){if(!this._isHandleElementPressed(e))return;this._attachDragListeners();let n=0,i=0;e instanceof MouseEvent?(n=e.clientX,i=e.clientY):(n=e.touches[0].clientX,i=e.touches[0].clientY),this._lastDraggingCoordinates={x:n,y:i},this.isDragging=!0}_onDrag(t,e){if(!this.isDragging)return void this._detachDragListeners();let n=0,i=0;e instanceof MouseEvent?(n=e.clientX,i=e.clientY):(n=e.touches[0].clientX,i=e.touches[0].clientY),e.preventDefault(),this.fire("drag",{deltaX:Math.round(n-this._lastDraggingCoordinates.x),deltaY:Math.round(i-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:n,y:i}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(t){return!!this.dragHandleElement&&(this.dragHandleElement===t.target||t.target instanceof HTMLElement&&this.dragHandleElement.contains(t.target))}}}(et){constructor(o,{getCurrentDomRoot:t,getViewportOffset:e}){super(o),this.wasMoved=!1;const n=this.bindTemplate,i=o.t;this.set("className",""),this.set("ariaLabel",i("Editor dialog")),this.set("isModal",!1),this.set("position",cr),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=e,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new oe,this.focusTracker=new Qt,this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",r=>!r),n.if("_isVisible","ck-hidden",r=>!r)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",r=>fu(r)),left:n.to("_left",r=>fu(r)),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(o,t)=>{this.fire("close",{source:"escKeyPress"}),t()}),this.on("drag",(o,{deltaX:t,deltaY:e})=>{this.wasMoved=!0,this.moveBy(t,e)}),this.listenTo($.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo($.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(o,t,e)=>{e&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView?this.headerView.element:null}setupParts({icon:o,title:t,hasCloseButton:e=!0,content:n,actionButtons:i}){t&&(this.headerView=new M_(this.locale,{icon:o}),e&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),n&&(n instanceof et&&(n=[n]),this.contentView=new P_(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),i&&(this.actionsView=new N_(this.locale),this.actionsView.setButtons(i),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(o,t){const e=this._getViewportRect(),n=this._getDialogRect();o+n.width>e.right&&(o=e.right-n.width),o{var e;this._focusables.add(t),this.focusTracker.add(t.element),oi(e=t)&&"focusCycler"in e&&e.focusCycler instanceof ye&&(this.listenTo(t.focusCycler,"forwardCycle",n=>{this._focusCycler.focusNext(),this._focusCycler.next!==this._focusCycler.focusables.get(this._focusCycler.current)&&n.stop()}),this.listenTo(t.focusCycler,"backwardCycle",n=>{this._focusCycler.focusPrevious(),this._focusCycler.previous!==this._focusCycler.focusables.get(this._focusCycler.current)&&n.stop()}))})}_createCloseButton(){const o=new wt(this.locale),t=this.locale.t;return o.set({label:t("Close"),tooltip:!0,icon:ot.cancel}),o.on("execute",()=>this.fire("close",{source:"closeButton"})),o}};let lr=ku;lr.defaultOffset=15;class rn extends R{constructor(t){super(t);const e=t.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set("id",null),t.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:e("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}static get pluginName(){return"Dialog"}_initShowHideListeners(){this.on("show",(t,e)=>{this._show(e)}),this.on("show",(t,e)=>{e.onShow&&e.onShow(this)},{priority:"low"}),this.on("hide",()=>{rn._visibleDialogPlugin&&rn._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const t=this.editor;t.keystrokes.set("Ctrl+F6",(e,n)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?t.editing.view.focus():this.view.focus(),n())})}_initMultiRootIntegration(){const t=this.editor.model;t.document.on("change:data",()=>{if(!this.view)return;const e=t.document.differ.getChangedRoots();for(const n of e)n.state&&this.view.updatePosition()})}show(t){this.hide(),this.fire(`show:${t.id}`,t)}_show({id:t,icon:e,title:n,hasCloseButton:i=!0,content:r,actionButtons:s,className:a,isModal:c,position:l,onHide:d}){const h=this.editor;this.view=new lr(h.locale,{getCurrentDomRoot:()=>h.editing.view.getDomRoot(h.model.document.selection.anchor.root.rootName),getViewportOffset:()=>h.ui.viewportOffset});const u=this.view;u.on("close",()=>{this.hide()}),h.ui.view.body.add(u),h.ui.focusTracker.add(u.element),h.keystrokes.listenTo(u.element),l||(l=c?cr:mu),u.set({position:l,_isVisible:!0,className:a,isModal:c}),u.setupParts({icon:e,title:n,hasCloseButton:i,content:r,actionButtons:s}),this.id=t,d&&(this._onHide=d),this.isOpen=!0,rn._visibleDialogPlugin=this}hide(){rn._visibleDialogPlugin&&rn._visibleDialogPlugin.fire(`hide:${rn._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const t=this.editor,e=this.view;e.contentView&&e.contentView.reset(),t.ui.view.body.remove(e),t.ui.focusTracker.remove(e.element),t.keystrokes.stopListening(e.element),e.destroy(),t.editing.view.focus(),this.id=null,this.isOpen=!1,rn._visibleDialogPlugin=null}}var bu=P(3710),V_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(bu.A,V_),bu.A.locals;var H_=Object.defineProperty,wu=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,q_=Object.prototype.propertyIsEnumerable,Au=(o,t,e)=>t in o?H_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,mt=(o,t)=>{for(var e in t||(t={}))U_.call(t,e)&&Au(o,e,t[e]);if(wu)for(var e of wu(t))q_.call(t,e)&&Au(o,e,t[e]);return o};const Cu=oo("px"),_u=$.document.body,G_={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}},ra=class extends et{constructor(o){super(o);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Cu),left:t.to("left",Cu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(o){this.show();const t=ra.defaultPositions,e=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast,t.viewportStickyNorth],limiter:_u,fitInViewport:!0},o),n=ra._getOptimalPosition(e)||G_,i=parseInt(n.left),r=parseInt(n.top),s=n.name,a=n.config||{},{withArrow:c=!0}=a;this.top=r,this.left=i,this.position=s,this.withArrow=c}pin(o){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(o):this._stopPinning()},this._startPinning(o),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(o){this.attachTo(o);const t=sa(o.target),e=o.limiter?sa(o.limiter):_u;this.listenTo($.document,"scroll",(n,i)=>{const r=i.target,s=t&&r.contains(t),a=e&&r.contains(e);!s&&!a&&t&&e||this.attachTo(o)},{useCapture:!0}),this.listenTo($.window,"resize",()=>{this.attachTo(o)})}_stopPinning(){this.stopListening($.document,"scroll"),this.stopListening($.window,"resize")}};let se=ra;function sa(o){return Tn(o)?o:Mi(o)?o.commonAncestorContainer:typeof o=="function"?sa(o()):null}function vu(o={}){const{sideOffset:t=se.arrowSideOffset,heightOffset:e=se.arrowHeightOffset,stickyVerticalOffset:n=se.stickyVerticalOffset,config:i}=o;return{northWestArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.left-t,name:"arrow_sw"},i&&{config:i}),northWestArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.left-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northWestArrowSouth:(a,c)=>mt({top:r(a,c),left:a.left-c.width/2,name:"arrow_s"},i&&{config:i}),northWestArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.left-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northWestArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.left-c.width+t,name:"arrow_se"},i&&{config:i}),northArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-t,name:"arrow_sw"},i&&{config:i}),northArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northArrowSouth:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-c.width/2,name:"arrow_s"},i&&{config:i}),northArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.left+a.width/2-c.width+t,name:"arrow_se"},i&&{config:i}),northEastArrowSouthWest:(a,c)=>mt({top:r(a,c),left:a.right-t,name:"arrow_sw"},i&&{config:i}),northEastArrowSouthMiddleWest:(a,c)=>mt({top:r(a,c),left:a.right-.25*c.width-t,name:"arrow_smw"},i&&{config:i}),northEastArrowSouth:(a,c)=>mt({top:r(a,c),left:a.right-c.width/2,name:"arrow_s"},i&&{config:i}),northEastArrowSouthMiddleEast:(a,c)=>mt({top:r(a,c),left:a.right-.75*c.width+t,name:"arrow_sme"},i&&{config:i}),northEastArrowSouthEast:(a,c)=>mt({top:r(a,c),left:a.right-c.width+t,name:"arrow_se"},i&&{config:i}),southWestArrowNorthWest:a=>mt({top:s(a),left:a.left-t,name:"arrow_nw"},i&&{config:i}),southWestArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.left-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southWestArrowNorth:(a,c)=>mt({top:s(a),left:a.left-c.width/2,name:"arrow_n"},i&&{config:i}),southWestArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.left-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southWestArrowNorthEast:(a,c)=>mt({top:s(a),left:a.left-c.width+t,name:"arrow_ne"},i&&{config:i}),southArrowNorthWest:a=>mt({top:s(a),left:a.left+a.width/2-t,name:"arrow_nw"},i&&{config:i}),southArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.left+a.width/2-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southArrowNorth:(a,c)=>mt({top:s(a),left:a.left+a.width/2-c.width/2,name:"arrow_n"},i&&{config:i}),southArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.left+a.width/2-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southArrowNorthEast:(a,c)=>mt({top:s(a),left:a.left+a.width/2-c.width+t,name:"arrow_ne"},i&&{config:i}),southEastArrowNorthWest:a=>mt({top:s(a),left:a.right-t,name:"arrow_nw"},i&&{config:i}),southEastArrowNorthMiddleWest:(a,c)=>mt({top:s(a),left:a.right-.25*c.width-t,name:"arrow_nmw"},i&&{config:i}),southEastArrowNorth:(a,c)=>mt({top:s(a),left:a.right-c.width/2,name:"arrow_n"},i&&{config:i}),southEastArrowNorthMiddleEast:(a,c)=>mt({top:s(a),left:a.right-.75*c.width+t,name:"arrow_nme"},i&&{config:i}),southEastArrowNorthEast:(a,c)=>mt({top:s(a),left:a.right-c.width+t,name:"arrow_ne"},i&&{config:i}),westArrowEast:(a,c)=>mt({top:a.top+a.height/2-c.height/2,left:a.left-c.width-e,name:"arrow_e"},i&&{config:i}),eastArrowWest:(a,c)=>mt({top:a.top+a.height/2-c.height/2,left:a.right+e,name:"arrow_w"},i&&{config:i}),viewportStickyNorth:(a,c,l,d)=>{const h=d||l;return a.getIntersection(h)?h.height-a.height>n?null:{top:h.top+n,left:a.left+a.width/2-c.width/2,name:"arrowless",config:mt({withArrow:!1},i)}:null}};function r(a,c){return a.top-c.height-e}function s(a){return a.bottom+e}}se.arrowSideOffset=25,se.arrowHeightOffset=10,se.stickyVerticalOffset=20,se._getOptimalPosition=ss,se.defaultPositions=vu();var yu=P(9205),W_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(yu.A,W_),yu.A.locals;const xu="ck-tooltip",ae=class extends Ce(){constructor(o){if(super(),this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver=null,this._mutationObserver=null,ae._editors.add(o),ae._instance)return ae._instance;ae._instance=this,this.tooltipTextView=new et(o.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new se(o.locale),this.balloonPanelView.class=xu,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(t){const e=new MutationObserver(()=>{t()});return{attach(n){e.observe(n,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=Wo(this._pinTooltip,600),this.listenTo($.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo($.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo($.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo($.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo($.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(o){const t=o.ui.view&&o.ui.view.body;ae._editors.delete(o),this.stopListening(o.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),ae._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),ae._instance=null)}static getPositioningFunctions(o){const t=ae.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[o]}_onEnterOrFocus(o,{target:t}){const e=aa(t);e&&e!==this._currentElementWithTooltip&&(this._unpinTooltip(),this._pinTooltipDebounced(e,Eu(e)))}_onLeaveOrBlur(o,{target:t,relatedTarget:e}){if(o.name==="mouseleave"){if(!Tn(t)||this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const n=aa(t),i=aa(e);n&&n!==i&&this._unpinTooltip()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltip()}}_onScroll(o,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(o,{text:t,position:e,cssClass:n}){const i=Wt(ae._editors.values()).ui.view.body;i.has(this.balloonPanelView)||i.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.pin({target:o,positions:ae.getPositioningFunctions(e)}),this._resizeObserver=new zo(o,()=>{Mn(o)||this._unpinTooltip()}),this._mutationObserver.attach(o),this.balloonPanelView.class=[xu,n].filter(r=>r).join(" ");for(const r of ae._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=o,this._currentTooltipPosition=e}_unpinTooltip(){this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const o of ae._editors)this.stopListening(o.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this._resizeObserver&&this._resizeObserver.destroy(),this._mutationObserver.detach()}_updateTooltipPosition(){const o=Eu(this._currentElementWithTooltip);Mn(this._currentElementWithTooltip)&&o.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:ae.getPositioningFunctions(o.position)}):this._unpinTooltip()}};let dr=ae;function aa(o){return Tn(o)?o.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function Eu(o){return{text:o.dataset.ckeTooltipText,position:o.dataset.ckeTooltipPosition||"s",cssClass:o.dataset.ckeTooltipClass||""}}dr.defaultBalloonPositions=vu({heightOffset:5,sideOffset:13}),dr._editors=new Set,dr._instance=null;const hr=function(o,t,e){var n=!0,i=!0;if(typeof o!="function")throw new TypeError("Expected a function");return bt(e)&&(n="leading"in e?!!e.leading:n,i="trailing"in e?!!e.trailing:i),Wo(o,t,{leading:n,maxWait:t,trailing:i})};var K_=Object.defineProperty,Du=Object.getOwnPropertySymbols,$_=Object.prototype.hasOwnProperty,Y_=Object.prototype.propertyIsEnumerable,Iu=(o,t,e)=>t in o?K_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Q_=(o,t)=>{for(var e in t||(t={}))$_.call(t,e)&&Iu(o,e,t[e]);if(Du)for(var e of Du(t))Y_.call(t,e)&&Iu(o,e,t[e]);return o};const Z_=50,J_=350,X_="Powered by";class tv extends Ce(){constructor(t){super(),this.editor=t,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=hr(this._showBalloon.bind(this),50,{leading:!0}),t.on("ready",this._handleEditorReady.bind(this))}destroy(){const t=this._balloonView;t&&(t.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const t=this.editor;(t.config.get("ui.poweredBy.forceVisible")||function(e){function n(g){return g.length>=40&&g.length<=255?"VALID":"INVALID"}if(!e)return"INVALID";let i="";try{i=atob(e)}catch{return"INVALID"}const r=i.split("-"),s=r[0],a=r[1];if(!a)return n(e);try{atob(a)}catch{try{if(atob(s),!atob(s).length)return n(e)}catch{return n(e)}}if(s.length<40||s.length>255)return"INVALID";let c="";try{atob(s),c=atob(a)}catch{return"INVALID"}if(c.length!==8)return"INVALID";const l=Number(c.substring(0,4)),d=Number(c.substring(4,6))-1,h=Number(c.substring(6,8)),u=new Date(l,d,h);return u{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),t.ui.focusTracker.on("change:focusedElement",(e,n,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),t.ui.on("update",()=>{this._showBalloonThrottled()}))}_createBalloonView(){const t=this.editor,e=this._balloonView=new se,n=Tu(t),i=new ev(t.locale,n.label);e.content.add(i),e.set({class:"ck-powered-by-balloon"}),t.ui.view.body.add(e),t.ui.focusTracker.add(e.element),this._balloonView=e}_showBalloon(){if(!this._lastFocusedEditableElement)return;const t=function(e,n){const i=Tu(e),r=i.side==="right"?function(s,a){return Su(s,a,(c,l)=>c.left+c.width-l.width-a.horizontalOffset)}(n,i):function(s,a){return Su(s,a,c=>c.left+a.horizontalOffset)}(n,i);return{target:n,positions:[r]}}(this.editor,this._lastFocusedEditableElement);t&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(t))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){const t=this.editor,e=t.ui.focusTracker.isFocused,n=t.ui.focusTracker.focusedElement;if(!e||!n)return void(this._lastFocusedEditableElement=null);const i=Array.from(t.ui.getEditableElementsNames()).map(r=>t.ui.getEditableElement(r));i.includes(n)?this._lastFocusedEditableElement=n:this._lastFocusedEditableElement=i[0]}}class ev extends et{constructor(t,e){super(t);const n=new kn,i=this.bindTemplate;n.set({content:` +`,isColorInherited:!1}),n.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...e?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[e]}]:[],n],on:{dragstart:i.to(r=>r.preventDefault())}}]})}}function Su(o,t,e){return(n,i)=>{const r=new dt(o);if(r.widths.regionName===t);r||(r=new rv(this.view.locale),this.view.regionViews.add(r)),r.set({regionName:t,text:e,politeness:n})}}class iv extends et{constructor(t){super(t),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class rv extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("regionName",""),this.set("text",""),this.set("politeness",Bu),this.setTemplate({tag:"div",attributes:{role:"region","data-region":e.to("regionName"),"aria-live":e.to("politeness")},children:[{text:e.to("text")}]})}}var sv=Object.defineProperty,Nu=Object.getOwnPropertySymbols,av=Object.prototype.hasOwnProperty,cv=Object.prototype.propertyIsEnumerable,Pu=(o,t,e)=>t in o?sv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class lv extends ft(){constructor(t){super(),this.isReady=!1,this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[];const e=t.editing.view;this.editor=t,this.componentFactory=new S_(t),this.focusTracker=new Qt,this.tooltipManager=new dr(t),this.poweredBy=new tv(t),this.ariaLiveAnnouncer=new ov(t),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",()=>{this.isReady=!0}),this.listenTo(e.document,"layoutChanged",this.update.bind(this)),this.listenTo(e,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null,this.editor.keystrokes.stopListening(t);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor),this.focusTracker.add(e);const n=()=>{this.editor.editing.view.getDomRoot(t)||this.editor.keystrokes.listenTo(e)};this.isReady?n():this.once("ready",n)}removeEditableElement(t){const e=this._editableElementsMap.get(t);e&&(this._editableElementsMap.delete(t),this.editor.keystrokes.stopListening(e),this.focusTracker.remove(e),e.ckeditorInstance=null)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(t,e={}){t.isRendered?(this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)):t.once("render",()=>{this.focusTracker.add(t.element),this.editor.keystrokes.listenTo(t.element)}),this._focusableToolbarDefinitions.push({toolbarView:t,options:e})}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const t=this.editor,e=t.config.get("ui.viewportOffset");if(e)return e;const n=t.config.get("toolbar.viewportTopOffset");return n?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:n}):{top:0}}_initFocusTracking(){const t=this.editor,e=t.editing.view;let n,i;t.keystrokes.set("Alt+F10",(r,s)=>{const a=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(a)&&!Array.from(e.domRoots.values()).includes(a)&&(n=a);const c=this._getCurrentFocusedToolbarDefinition();c&&i||(i=this._getFocusableCandidateToolbarDefinitions());for(let l=0;l{const a=this._getCurrentFocusedToolbarDefinition();a&&(n?(n.focus(),n=null):t.editing.view.focus(),a.options.afterBlur&&a.options.afterBlur(),s())})}_getFocusableCandidateToolbarDefinitions(){const t=[];for(const e of this._focusableToolbarDefinitions){const{toolbarView:n,options:i}=e;(Mn(n.element)||i.beforeFocus)&&t.push(e)}return t.sort((e,n)=>Ou(e)-Ou(n)),t}_getCurrentFocusedToolbarDefinition(){for(const t of this._focusableToolbarDefinitions)if(t.toolbarView.element&&t.toolbarView.element.contains(this.focusTracker.focusedElement))return t;return null}_focusFocusableCandidateToolbar(t){const{toolbarView:e,options:{beforeFocus:n}}=t;return n&&n(),!!Mn(e.element)&&(e.focus(),!0)}_handleScrollToTheSelection(t,e){const n=((i,r)=>{for(var s in r||(r={}))av.call(r,s)&&Pu(i,s,r[s]);if(Nu)for(var s of Nu(r))cv.call(r,s)&&Pu(i,s,r[s]);return i})({top:0,bottom:0,left:0,right:0},this.viewportOffset);e.viewportOffset.top+=n.top,e.viewportOffset.bottom+=n.bottom,e.viewportOffset.left+=n.left,e.viewportOffset.right+=n.right}}function Ou(o){const{toolbarView:t,options:e}=o;let n=10;return Mn(t.element)&&n--,e.isContextual&&n--,n}var Lu=P(1185),dv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Lu.A,dv),Lu.A.locals;class hv extends et{constructor(t){super(t),this.body=new QC(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class uv extends hv{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new er;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class gv extends et{constructor(t,e,n){super(t),this.name=null,this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const t=this._editingView;function e(n){t.change(i=>{const r=t.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}t.isRenderingInProgress?function n(i){t.once("change:isRenderingInProgress",(r,s,a)=>{a?n(i):e(i)})}(this):e(this)}}class pv extends gv{constructor(t,e,n,i={}){super(t,e,n);const r=t.t;this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}}),this._generateLabel=i.label||(()=>r("Editor editing area: %0",this.name))}render(){super.render();const t=this._editingView;t.change(e=>{const n=t.document.getRoot(this.name);e.setAttribute("aria-label",this._generateLabel(this),n)})}}class ca extends Oi{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=t.namespace?`show:${t.type}:${t.namespace}`:`show:${t.type}`;this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class zu extends ft(){constructor(t,e){super(),e&&Yl(this,e),t&&this.set(t)}}var Ru=P(991),mv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ru.A,mv),Ru.A.locals;var ju=P(5380),fv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ju.A,fv),ju.A.locals;const ur=oo("px");class gr extends R{constructor(t){super(t),this._viewToStack=new Map,this._idToStack=new Map,this._view=null,this._rotatorView=null,this._fakePanelsView=null,this.positionLimiter=()=>{const e=this.editor.editing.view,n=e.document.selection.editableElement;return n?e.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}static get pluginName(){return"ContextualBalloon"}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this._view||this._createPanelView(),this.hasView(t.view))throw new _("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const n=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),n.set(t.view,t),this._viewToStack.set(t.view,n),n===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new _("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(e.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),e.size===1?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new _("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}_createPanelView(){this._view=new se(this.editor.locale),this.editor.ui.view.body.add(this._view),this.editor.ui.focusTracker.add(this._view.element),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new kv(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[r,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new bv(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,n)=>!n&&e>=2?Math.min(e-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=e,this.view.withArrow=n,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&(t.limiter||(t=Object.assign({},t,{limiter:this.positionLimiter})),t=Object.assign({},t,{viewportOffsetConfig:this.editor.ui.viewportOffset})),t}}class kv extends et{constructor(t){super(t);const e=t.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Qt,this.buttonPrevView=this._createButtonView(e("Previous"),ot.previousArrow),this.buttonNextView=this._createButtonView(e("Next"),ot.nextArrow),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const n=new wt(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n}}class bv extends et{constructor(t,e){super(t);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",ur),left:n.to("left",ur),width:n.to("width",ur),height:n.to("height",ur)}},children:this.content}),this.on("change:numberOfPanels",(i,r,s,a)=>{s>a?this._addPanels(s-a):this._removePanels(a-s),this.updatePosition()})}_addPanels(t){for(;t--;){const e=new et;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(t){for(;t--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:n,height:i}=new dt(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:n,height:i})}}}var Fu=P(8298),wv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Fu.A,wv),Fu.A.locals;const po=oo("px");class Av extends et{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new Re({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",n=>n?"block":"none"),height:e.to("isSticky",n=>n?po(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new Re({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",n=>n?po(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_stickyTopOffset",n=>n&&po(n)),bottom:e.to("_stickyBottomOffset",n=>n&&po(n)),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo($.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()})}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new dt(this.limiterElement);let e=t.getVisible();if(e){const n=new dt($.window);n.top+=this.viewportTopOffset,n.height-=this.viewportTopOffset,e=e.getIntersection(n)}if(e&&t.tope.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset{this.reset(),this.focus(),this.fire("reset")}),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",r=>!r),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class _v extends et{constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",t.if("isVisible","ck-hidden",e=>!e)],tabindex:-1},children:[{tag:"span",children:[{text:[t.to("primaryText")]}]},{tag:"span",children:[{text:[t.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class vv extends et{constructor(t){super(t),this.children=this.createCollection(),this.focusTracker=new Qt,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new ye({focusables:this.children,focusTracker:this.focusTracker})}render(){super.render();for(const t of this.children)this.focusTracker.add(t.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}var Vu=/[\\^$.*+?()[\]{}|]/g,yv=RegExp(Vu.source);const Hu=function(o){return(o=ws(o))&&yv.test(o)?o.replace(Vu,"\\$&"):o};var Uu=P(8107),xv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Uu.A,xv),Uu.A.locals;var Ev=Object.defineProperty,qu=Object.getOwnPropertySymbols,Dv=Object.prototype.hasOwnProperty,Iv=Object.prototype.propertyIsEnumerable,Gu=(o,t,e)=>t in o?Ev(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Sv extends et{constructor(t,e){super(t),this._config=e,this.filteredView=e.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new Qt,this.keystrokes=new oe,this.resultsView=new vv(t),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),e.infoView&&e.infoView.instance?this.infoView=e.infoView.instance:(this.infoView=new _v,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new ye({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(n,{resultsCount:i,totalItemsCount:r})=>{this.resultsCount=i,this.totalItemsCount=r}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",e.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);const t=e=>e.stopPropagation();for(const e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search("")}search(t){const e=t?new RegExp(Hu(t),"ig"):null,n=this.filteredView.filter(e);this.fire("search",((i,r)=>{for(var s in r||(r={}))Dv.call(r,s)&&Gu(i,s,r[s]);if(qu)for(var s of qu(r))Iv.call(r,s)&&Gu(i,s,r[s]);return i})({query:t},n))}_createSearchTextQueryView(){const t=new Cv(this.locale,this._config.queryView);return this.listenTo(t.fieldView,"input",()=>{this.search(t.fieldView.element.value)}),t.on("reset",()=>this.reset()),t.bind("isEnabled").to(this),t}_enableDefaultInfoViewBehavior(){const t=this.locale.t,e=this.infoView;function n(i,{query:r,resultsCount:s,totalItemsCount:a}){return typeof i=="function"?i(r,s,a):i}this.on("search",(i,r)=>{if(r.resultsCount)e.set({isVisible:!1});else{const s=this._config.infoView&&this._config.infoView.text;let a,c;r.totalItemsCount?s&&s.notFound?(a=s.notFound.primary,c=s.notFound.secondary):(a=t("No results found"),c=""):s&&s.noSearchableItems?(a=s.noSearchableItems.primary,c=s.noSearchableItems.secondary):(a=t("No searchable items"),c=""),e.set({primaryText:n(a,r),secondaryText:n(c,r),isVisible:!0})}})}}var Wu=P(5727),Tv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Wu.A,Tv),Wu.A.locals;const la=class extends Sv{constructor(o,t){super(o,t),this._config=t;const e=oo("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});const n=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[n.if("isVisible","ck-hidden",i=>!i),n.to("_position",i=>`ck-search__results_${i}`)],style:{width:n.to("_width",e)}}}),this.focusTracker.on("change:isFocused",(i,r,s)=>{this._updateResultsVisibility(),s?this.resultsView.element.scrollTop=0:t.resetOnBlur&&this.queryView.reset()}),this.on("search",()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()}),this.keystrokes.set("esc",(i,r)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,r())}),this.listenTo($.document,"scroll",()=>{this._updateResultsViewWidthAndPosition()}),this.on("change:isEnabled",()=>{this._updateResultsVisibility()}),this.filteredView.on("execute",(i,{value:r})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=r,this.resultsView.isVisible=!1}),this.resultsView.on("change:isVisible",()=>{this._updateResultsViewWidthAndPosition()})}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new dt(this.queryView.fieldView.element).width;const o=la._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:la.defaultResultsPositions});this.resultsView._position=o?o.name:"s"}_updateResultsVisibility(){const o=this._config.queryMinChars===void 0?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=o}};let Ku=la;Ku.defaultResultsPositions=[o=>({top:o.bottom,left:o.left,name:"s"}),(o,t)=>({top:o.top-t.height,left:o.left,name:"n"})],Ku._getOptimalPosition=ss;var $u=P(9529),Mv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()($u.A,Mv),$u.A.locals;var Yu=P(109),Bv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Yu.A,Bv),Yu.A.locals;var Qu=P(2710),Nv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Qu.A,Nv),Qu.A.locals;class Pv extends lv{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Qh(t.config.get("toolbar")),this._elementReplacer=new Io,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,n=this.view,i=e.editing.view,r=n.editable,s=i.document.getRoot();r.name=s.rootName,n.render();const a=r.element;this.setEditableElement(r.name,a),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(a),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({top:e})=>e||0),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,e=t.editing.view,n=e.document.getRoot(),i=t.sourceElement;let r;const s=t.config.get("placeholder");s&&(r=typeof s=="string"?s:s[this.view.editable.name]),!r&&i&&i.tagName.toLowerCase()==="textarea"&&(r=i.getAttribute("placeholder")),r&&(n.placeholder=r),_l({view:e,element:n,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,n){const i=this.view.stickyPanel;if(i.isSticky){const r=new dt(i.element).height;e.viewportOffset.top+=r}else{const r=()=>{this.editor.editing.view.scrollToTheSelection(n)};this.listenTo(i,"change:isSticky",r),setTimeout(()=>{this.stopListening(i,"change:isSticky",r)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,e=this.editor.plugins.get("Dialog");e.on("show",()=>{const n=e.view;n.on("moveTo",(i,r)=>{if(!t.isSticky||n.wasMoved)return;const s=new dt(t.contentPanelElement);r[1]{const n="error"in e?e.error:e.reason;n instanceof Error&&this._handleError(n,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(n=>n!==e)}_fire(t,...e){const n=this._listeners[t]||[];for(const i of n)i.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e instanceof ErrorEvent?e.filename:void 0,lineno:e instanceof ErrorEvent?e.lineno:void 0,colno:e instanceof ErrorEvent?e.colno:void 0,date:this._now()});const n=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:n}),n?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&t.context!==void 0&&t.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(t)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function da(o,t=new Set){const e=[o],n=new Set;let i=0;for(;e.length>i;){const r=e[i++];if(!n.has(r)&&zv(r)&&!t.has(r))if(n.add(r),Symbol.iterator in r)try{for(const s of r)e.push(s)}catch{}else for(const s in r)s!=="defaultValue"&&e.push(r[s])}return n}function zv(o){const t=Object.prototype.toString.call(o),e=typeof o;return!(e==="number"||e==="boolean"||e==="string"||e==="symbol"||e==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||o==null||o._watchdogExcluded||o instanceof EventTarget||o instanceof Event)}function Xu(o,t,e=new Set){if(o===t&&typeof(n=o)=="object"&&n!==null)return!0;var n;const i=da(o,e),r=da(t,e);for(const s of i)if(r.has(s))return!0;return!1}var Rv=Object.defineProperty,jv=Object.defineProperties,Fv=Object.getOwnPropertyDescriptors,pr=Object.getOwnPropertySymbols,tg=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,ng=(o,t,e)=>t in o?Rv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,ha=(o,t)=>{for(var e in t||(t={}))tg.call(t,e)&&ng(o,e,t[e]);if(pr)for(var e of pr(t))eg.call(t,e)&&ng(o,e,t[e]);return o};class og extends Ju{constructor(t,e={}){super(e),this._editor=null,this._initUsingData=!0,this._editables={},this._throttledSave=hr(this._save.bind(this),typeof e.saveInterval=="number"?e.saveInterval:5e3),t&&(this._creator=(n,i)=>t.create(n,i)),this._destructor=n=>n.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(t=>{console.error("An error happened during the editor destroying.",t)}).then(()=>{const t={},e=[],n=this._config.rootsAttributes||{},i={};for(const[c,l]of Object.entries(this._data.roots))l.isLoaded?(t[c]="",i[c]=n[c]||{}):e.push(c);const r=(s=ha({},this._config),a={extraPlugins:this._config.extraPlugins||[],lazyRoots:e,rootsAttributes:i,_watchdogInitialData:this._data},jv(s,Fv(a)));var s,a;return delete r.initialData,r.extraPlugins.push(Vv),this._initUsingData?this.create(t,r,r.context):Tn(this._elementOrData)?this.create(this._elementOrData,r,r.context):this.create(this._editables,r,r.context)}).then(()=>{this._fire("restart")})}create(t=this._elementOrData,e=this._config,n){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=t,this._initUsingData=typeof t=="string"||Object.keys(t).length>0&&typeof Object.values(t)[0]=="string",this._config=this._cloneEditorConfiguration(e)||{},this._config.context=n,this._creator(t,this._config))).then(i=>{this._editor=i,i.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=i.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const t=this._editor;return this._editor=null,t.model.document.off("change:data",this._throttledSave),this._destructor(t)})}_save(){const t=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=t}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(t){this._excludedProps=t}_getData(){const t=this._editor,e=t.model.document.roots.filter(a=>a.isAttached()&&a.rootName!="$graveyard"),{plugins:n}=t,i=n.has("CommentsRepository")&&n.get("CommentsRepository"),r=n.has("TrackChanges")&&n.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};e.forEach(a=>{s.roots[a.rootName]={content:JSON.stringify(Array.from(a.getChildren())),attributes:JSON.stringify(Array.from(a.getAttributes())),isLoaded:a._isLoaded}});for(const a of t.model.markers)a._affectsData&&(s.markers[a.name]={rangeJSON:a.getRange().toJSON(),usingOperation:a._managedUsingOperations,affectsData:a._affectsData});return i&&(s.commentThreads=JSON.stringify(i.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),r&&(s.suggestions=JSON.stringify(r.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const t={};for(const e of this.editor.model.document.getRootNames()){const n=this.editor.ui.getEditableElement(e);n&&(t[e]=n)}return t}_isErrorComingFromThisItem(t){return Xu(this._editor,t.context,this._excludedProps)}_cloneEditorConfiguration(t){return os(t,(e,n)=>Tn(e)||n==="context"?e:void 0)}}class Vv{constructor(t){this.editor=t,this._data=t.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",t=>{t.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:999})}_createNode(t,e){if("name"in e){const n=t.createElement(e.name,e.attributes);if(e.children)for(const i of e.children)n._appendChild(this._createNode(t,i));return n}return t.createText(e.data,e.attributes)}_restoreEditorData(t){const e=this.editor;Object.entries(this._data.roots).forEach(([n,{content:i,attributes:r}])=>{const s=JSON.parse(i),a=JSON.parse(r),c=e.model.document.getRoot(n);for(const[l,d]of a)t.setAttribute(l,d,c);for(const l of s){const d=this._createNode(t,l);t.insert(d,c,"end")}}),Object.entries(this._data.markers).forEach(([n,i])=>{const{document:r}=e.model,s=i,{rangeJSON:{start:a,end:c}}=s,l=((p,k)=>{var b={};for(var A in p)tg.call(p,A)&&k.indexOf(A)<0&&(b[A]=p[A]);if(p!=null&&pr)for(var A of pr(p))k.indexOf(A)<0&&eg.call(p,A)&&(b[A]=p[A]);return b})(s,["rangeJSON"]),d=r.getRoot(a.root),h=t.createPositionFromPath(d,a.path,a.stickiness),u=t.createPositionFromPath(d,c.path,c.stickiness),g=t.createRange(h,u);t.addMarker(n,ha({range:g},l))})}_restoreCollaborationData(){const t=JSON.parse(this._data.commentThreads),e=JSON.parse(this._data.suggestions);t.forEach(n=>{const i=this.editor.config.get("collaboration.channelId"),r=this.editor.plugins.get("CommentsRepository");r.hasCommentThread(n.threadId)&&r.getCommentThread(n.threadId).remove(),r.addCommentThread(ha({channelId:i},n))}),e.forEach(n=>{const i=this.editor.plugins.get("TrackChangesEditing");i.hasSuggestion(n.id)?i.getSuggestion(n.id).attributes=n.attributes:i.addSuggestionData(n)})}}const ii=Symbol("MainQueueId");class Hv{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._activeActions=0}onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t,e){const n=t===ii;this._activeActions++,this._queues.get(t)||this._queues.set(t,Promise.resolve());const i=(n?Promise.all(this._queues.values()):Promise.all([this._queues.get(ii),this._queues.get(t)])).then(e),r=i.catch(()=>{});return this._queues.set(t,r),i.finally(()=>{this._activeActions--,this._queues.get(t)===r&&this._activeActions===0&&this._onEmptyCallbacks.forEach(s=>s())})}}function ig(o){return Array.isArray(o)?o:[o]}class mr extends Ys(jC){constructor(t,e={}){if(!fr(t)&&e.initialData!==void 0)throw new _("editor-create-initial-data",null);super(e),this.config.get("initialData")===void 0&&this.config.set("initialData",function(r){return fr(r)?(s=r,s instanceof HTMLTextAreaElement?s.value:s.innerHTML):r;var s}(t)),fr(t)&&(this.sourceElement=t),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new Lv(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new Pv(this,i),function(r){if(!En(r.updateSourceElement))throw new _("attachtoform-missing-elementapi-interface",r);const s=r.sourceElement;if(function(a){return!!a&&a.tagName.toLowerCase()==="textarea"}(s)&&s.form){let a;const c=s.form,l=()=>r.updateSourceElement();En(c.submit)&&(a=c.submit,c.submit=()=>{l(),a.apply(c)}),c.addEventListener("submit",l),r.on("destroy",()=>{c.removeEventListener("submit",l),a&&(c.submit=a)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(n=>{const i=new this(t,e);n(i.initPlugins().then(()=>i.ui.init(fr(t)?t:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}function fr(o){return Tn(o)}mr.Context=wl,mr.EditorWatchdog=og,mr.ContextWatchdog=class extends Ju{constructor(o,t={}){super(t),this._watchdogs=new Map,this._context=null,this._contextProps=new Set,this._actionQueues=new Hv,this._watchdogConfig=t,this._creator=e=>o.create(e),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(o){this._creator=o}setDestructor(o){this._destructor=o}get context(){return this._context}create(o={}){return this._actionQueues.enqueue(ii,()=>(this._contextConfig=o,this._create()))}getItem(o){return this._getWatchdog(o)._item}getItemState(o){return this._getWatchdog(o).state}add(o){const t=ig(o);return Promise.all(t.map(e=>this._actionQueues.enqueue(e.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let n;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if(e.type==="editor")return n=new og(null,this._watchdogConfig),n.setCreator(e.creator),n._setExcludedProperties(this._contextProps),e.destructor&&n.setDestructor(e.destructor),this._watchdogs.set(e.id,n),n.on("error",(i,{error:r,causesRestart:s})=>{this._fire("itemError",{itemId:e.id,error:r}),s&&this._actionQueues.enqueue(e.id,()=>new Promise(a=>{const c=()=>{n.off("restart",c),this._fire("itemRestart",{itemId:e.id}),a()};n.on("restart",c)}))}),n.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))}remove(o){const t=ig(o);return Promise.all(t.map(e=>this._actionQueues.enqueue(e,()=>{const n=this._getWatchdog(e);return this._watchdogs.delete(e),n.destroy()})))}destroy(){return this._actionQueues.enqueue(ii,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(ii,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(o=>{console.error("An error happened during destroying the context or items.",o)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(o=>(this._context=o,this._contextProps=da(this._context),Promise.all(Array.from(this._watchdogs.values()).map(t=>(t._setExcludedProperties(this._contextProps),t.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const o=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(t=>t.destroy())).then(()=>this._destructor(o))})}_getWatchdog(o){const t=this._watchdogs.get(o);if(!t)throw new Error(`Item with the given id was not registered: ${o}.`);return t}_isErrorComingFromThisItem(o){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(o))return!1;return Xu(this._context,o.context)}};class ri extends pn{constructor(t){super(t),this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];const e=this.document;function n(i){return(r,s)=>{s.preventDefault();const a=s.dropRange?[s.dropRange]:null,c=new H(e,i);e.fire(c,{dataTransfer:s.dataTransfer,method:r.name,targetRanges:a,target:s.target,domEvent:s.domEvent}),c.stop.called&&s.stopPropagation()}}this.listenTo(e,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(e,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(e,"dragover",n("dragging"),{priority:"low"})}onDomEvent(t){const e="clipboardData"in t?t.clipboardData:t.dataTransfer,n=t.type=="drop"||t.type=="paste",i={dataTransfer:new od(e,{cacheFiles:n})};t.type!="drop"&&t.type!="dragover"||(i.dropRange=function(r,s){const a=s.target.ownerDocument,c=s.clientX,l=s.clientY;let d;return a.caretRangeFromPoint&&a.caretRangeFromPoint(c,l)?d=a.caretRangeFromPoint(c,l):s.rangeParent&&(d=a.createRange(),d.setStart(s.rangeParent,s.rangeOffset),d.collapse(!0)),d?r.domConverter.domRangeToView(d):null}(this.view,t)),this.fire(t.type,t,i)}}const rg=["figcaption","li"],sg=["ol","ul"];function ag(o){if(o.is("$text")||o.is("$textProxy"))return o.data;if(o.is("element","img")&&o.hasAttribute("alt"))return o.getAttribute("alt");if(o.is("element","br"))return` +`;let t="",e=null;for(const n of o.getChildren())t+=Uv(n,e)+ag(n),e=n;return t}function Uv(o,t){return t?o.is("element","li")&&!o.isEmpty&&o.getChild(0).is("containerElement")||sg.includes(o.name)&&sg.includes(t.name)?` -`:o.is("containerElement")||t.is("containerElement")?ig.includes(o.name)||ig.includes(t.name)?` +`:o.is("containerElement")||t.is("containerElement")?rg.includes(o.name)||rg.includes(t.name)?` `:` -`:"":""}const Gv=function(o,t){return o&&cl(o,t,Oo)},Wv=function(o,t,e,n){var i=e.length,r=i,s=!n;if(o==null)return!r;for(o=Object(o);i--;){var a=e[i];if(s&&a[2]?a[1]!==o[a[0]]:!(a[0]in o))return!1}for(;++it in o?i1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class si extends R{constructor(){super(...arguments),this._markersToCopy=new Map}static get pluginName(){return"ClipboardMarkersUtils"}_registerMarkerToCopy(t,e){const n=Array.isArray(e)?e:this._mapRestrictionPresetToActions(e);n.length&&this._markersToCopy.set(t,n)}_mapRestrictionPresetToActions(t){switch(t){case"always":return["copy","cut","dragstart"];case"default":return["cut","dragstart"];case"never":return[];default:return[]}}_copySelectedFragmentWithMarkers(t,e,n=i=>i.model.getSelectedContent(i.model.document.selection)){return this.editor.model.change(i=>{const r=i.model.document.selection;i.setSelection(e);const s=this._insertFakeMarkersIntoSelection(i,i.model.document.selection,t),a=n(i),c=this._removeFakeMarkersInsideElement(i,a);for(const[l,d]of Object.entries(s)){c[l]||(c[l]=i.createRangeIn(a));for(const h of d)i.remove(h)}a.markers.clear();for(const[l,d]of Object.entries(c))a.markers.set(l,d);return i.setSelection(r),a})}_pasteMarkersIntoTransformedElement(t,e){const n=this._getCopyableMarkersFromRangeMap(t);return this.editor.model.change(i=>{const r=this._insertFakeMarkersElements(i,n),s=e(i),a=this._removeFakeMarkersInsideElement(i,s);for(const c of Object.values(r).flat())i.remove(c);for(const[c,l]of Object.entries(a)){const d=i.model.markers.has(c)?this._getUniqueMarkerName(c):c;i.addMarker(d,{usingOperation:!0,affectsData:!0,range:l})}return s})}_forceMarkersCopy(t,e){const n=this._markersToCopy.get(t);this._markersToCopy.set(t,this._mapRestrictionPresetToActions("always")),e(),n?this._markersToCopy.set(t,n):this._markersToCopy.delete(t)}_canPerformMarkerClipboardAction(t,e){const[n]=t.split(":");return e?(this._markersToCopy.get(n)||[]).includes(e):this._markersToCopy.has(n)}_setUniqueMarkerNamesInFragment(t){const e=Array.from(t.markers);t.markers.clear();for(const[n,i]of e)t.markers.set(this._getUniqueMarkerName(n),i)}_insertFakeMarkersIntoSelection(t,e,n){const i=this._getCopyableMarkersFromSelection(t,e,n);return this._insertFakeMarkersElements(t,i)}_getCopyableMarkersFromSelection(t,e,n){return Array.from(e.getRanges()).flatMap(i=>Array.from(t.model.markers.getMarkersIntersectingRange(i))).filter(i=>this._canPerformMarkerClipboardAction(i.name,n)).map(i=>({name:i.name,range:i.getRange()}))}_getCopyableMarkersFromRangeMap(t,e=null){return(t instanceof Map?Array.from(t.entries()):Object.entries(t)).map(([n,i])=>({name:n,range:i})).filter(n=>this._canPerformMarkerClipboardAction(n.name,e))}_insertFakeMarkersElements(t,e){const n={},i=e.flatMap(r=>{const{start:s,end:a}=r.range;return[{position:s,marker:r,type:"start"},{position:a,marker:r,type:"end"}]}).sort(({position:r},{position:s})=>r.isBefore(s)?1:-1);for(const{position:r,marker:s,type:a}of i){const c=t.createElement("$marker",{"data-name":s.name,"data-type":a});n[s.name]||(n[s.name]=[]),n[s.name].push(c),t.insert(c,r)}return n}_removeFakeMarkersInsideElement(t,e){const n=this._getAllFakeMarkersFromElement(t,e).reduce((i,r)=>{const s=r.markerElement&&t.createPositionBefore(r.markerElement);let a=i[r.name];var c,l;return a&&a.start&&a.end&&(i[this._getUniqueMarkerName(r.name)]=i[r.name],a=null),i[r.name]=(c=((d,h)=>{for(var u in h||(h={}))a1.call(h,u)&&dg(d,u,h[u]);if(lg)for(var u of lg(h))c1.call(h,u)&&dg(d,u,h[u]);return d})({},a),l={[r.type]:s},r1(c,s1(l))),r.markerElement&&t.remove(r.markerElement),i},{});return o1(n,i=>new B(i.start||t.createPositionFromPath(e,[0]),i.end||t.createPositionAt(e,"end")))}_getAllFakeMarkersFromElement(t,e){const n=Array.from(t.createRangeIn(e)).flatMap(({item:s})=>{if(!s.is("element","$marker"))return[];const a=s.getAttribute("data-name"),c=s.getAttribute("data-type");return[{markerElement:s,name:a,type:c}]}),i=[],r=[];for(const s of n)s.type==="end"&&(n.some(a=>a.name===s.name&&a.type==="start")||i.push({markerElement:null,name:s.name,type:"start"})),s.type==="start"&&(n.some(a=>a.name===s.name&&a.type==="end")||r.unshift({markerElement:null,name:s.name,type:"end"}));return[...i,...n,...r]}_getUniqueMarkerName(t){const e=t.split(":"),n=X().substring(1,6);return e.length===3?`${e.slice(0,2).join(":")}:${n}`:`${e.join(":")}:${n}`}}class xe extends R{static get pluginName(){return"ClipboardPipeline"}static get requires(){return[si]}init(){this.editor.editing.view.addObserver(ri),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.plugins.get("ClipboardMarkersUtils")._copySelectedFragmentWithMarkers(n,e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(i,"clipboardInput",(s,a)=>{a.method!="paste"||t.model.canEditAt(t.model.document.selection)||s.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(s,a)=>{const c=a.dataTransfer;let l;if(a.content)l=a.content;else{let u="";c.getData("text/html")?u=function(g){return g.replace(/(\s+)<\/span>/g,(p,k)=>k.length==1?" ":k).replace(//g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((d=(d=c.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||d.includes("
"))&&(d=`

${d}

`),u=d),l=this.editor.data.htmlProcessor.toView(u)}var d;const h=new H(this,"inputTransformation");this.fire(h,{content:l,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),h.stop.called&&s.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(s.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,a)=>{r._setUniqueMarkerNamesInFragment(a.content)},{priority:"highest"}),this.listenTo(this,"contentInsertion",(s,a)=>{a.resultRange=e.insertContent(a.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,e.selection,r.name)};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{t.model.canEditAt(t.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=t.data.toView(s.content);n.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:a,method:s.method})},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",sg(s.content))),s.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class hg{constructor(t,e=20){this._batch=null,this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){this.isLocked&&!t||(this._batch=null,this._size=0)}}class l1 extends st{constructor(t,e){super(t),this._buffer=new hg(t.model,e),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",r=i.length;let s=n.selection;if(t.selection?s=t.selection:t.range&&(s=e.createSelection(t.range)),!e.canEditAt(s))return;const a=t.resultRange;e.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());e.deleteContent(s),i&&e.insertContent(c.createText(i,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const ug=["insertText","insertReplacementText"];class d1 extends $e{constructor(t){super(t),this.focusObserver=t.getObserver($i),f.isAndroid&&ug.push("insertCompositionText");const e=t.document;e.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=i;if(!ug.includes(a))return;this.focusObserver.flush();const l=new H(e,"insertText");e.fire(l,new co(t,c,{text:r,selection:t.createSelection(s)})),l.stop.called&&n.stop()}),e.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!f.isAndroid&&i&&e.fire("insertText",new co(t,r,{text:i,selection:e.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class gg extends R{static get pluginName(){return"Input"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=e.document.selection;n.addObserver(d1);const r=new l1(t,t.config.get("typing.undoStep")||20);t.commands.add("insertText",r),t.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,h=Array.from(l.getRanges()).map(p=>t.editing.mapper.toModelRange(p));let u=c;if(f.isAndroid){const p=Array.from(h[0].getItems()).reduce((k,b)=>k+(b.is("$textProxy")?b.data:""),"");p&&(p.length<=u.length?u.startsWith(p)&&(u=u.substring(p.length),h[0].start=h[0].start.getShiftedBy(p.length)):p.startsWith(u)&&(h[0].start=h[0].start.getShiftedBy(u.length),u=""))}const g={text:u,selection:e.createSelection(h)};d&&(g.resultRange=t.editing.mapper.toModelRange(d)),t.execute("insertText",g),n.scrollToTheSelection()}),f.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&pg(e,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||pg(e,r)})}}function pg(o,t){if(!t.isEnabled)return;const e=t.buffer;e.lock(),o.enqueueChange(e.batch,()=>{o.deleteContent(o.document.selection)}),e.unlock()}class mg extends st{constructor(t,e){super(t),this.direction=e,this._buffer=new hg(t.model,t.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(t.selection||n.selection);if(!e.canEditAt(r))return;const s=t.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let c=0;r.getFirstRange().getMinimalFlatRanges().forEach(l=>{c+=jt(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!e.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),r=t.createElement("paragraph");t.remove(t.createRangeIn(i)),t.insert(r,i),t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!="backward"||!t.isCollapsed)return!1;const i=t.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!t.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const fg="word",bn="selection",mo="backward",ai="forward",kg={deleteContent:{unit:bn,direction:mo},deleteContentBackward:{unit:"codePoint",direction:mo},deleteWordBackward:{unit:fg,direction:mo},deleteHardLineBackward:{unit:bn,direction:mo},deleteSoftLineBackward:{unit:bn,direction:mo},deleteContentForward:{unit:"character",direction:ai},deleteWordForward:{unit:fg,direction:ai},deleteHardLineForward:{unit:bn,direction:ai},deleteSoftLineForward:{unit:bn,direction:ai}};class h1 extends $e{constructor(t){super(t);const e=t.document;let n=0;e.on("keydown",()=>{n++}),e.on("keyup",()=>{n=0}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=kg[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==bn&&(d.selectionToRemove=t.createSelection(s[0])),c==="deleteContentBackward"&&(f.isAndroid&&(d.sequence=1),function(u){if(u.length!=1||u[0].isCollapsed)return!1;const g=u[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let p=0;for(const{nextPosition:k}of g){if(k.parent.is("$text")){const b=k.parent.data,A=k.offset;if(gs(b,A)||ps(b,A)||ul(b,A))continue;p++}else p++;if(p>1)return!0}return!1}(s)&&(d.unit=bn,d.selectionToRemove=t.createSelection(s)));const h=new so(e,"delete",s[0]);e.fire(h,new co(t,a,d)),h.stop.called&&i.stop()}),f.isBlink&&function(i){const r=i.view,s=r.document;let a=null,c=!1;function l(h){return h==ut.backspace||h==ut.delete}function d(h){return h==ut.backspace?mo:ai}s.on("keydown",(h,{keyCode:u})=>{a=u,c=!1}),s.on("keyup",(h,{keyCode:u,domEvent:g})=>{const p=s.selection,k=i.isEnabled&&u==a&&l(u)&&!p.isCollapsed&&!c;if(a=null,k){const b=p.getFirstRange(),A=new so(s,"delete",b),E={unit:bn,direction:d(u),selectionToRemove:p};s.fire(A,new co(r,g,E))}}),s.on("beforeinput",(h,{inputType:u})=>{const g=kg[u];l(a)&&g&&g.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(h,{inputType:u,data:g})=>{a==ut.delete&&u=="insertText"&&g==""&&h.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class sn extends R{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.model.document;e.addObserver(h1),this._undoOnBackspace=!1;const r=new mg(t,"forward");t.commands.add("deleteForward",r),t.commands.add("forwardDelete",r),t.commands.add("delete",new mg(t,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:h}=a,u=c==="forward"?"deleteForward":"delete",g={sequence:l};if(h=="selection"){const p=Array.from(d.getRanges()).map(k=>t.editing.mapper.toModelRange(k));g.selection=t.model.createSelection(p)}else g.unit=h;t.execute(u,g),e.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,t.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class u1 extends R{static get requires(){return[gg,sn]}static get pluginName(){return"Typing"}}function bg(o,t){let e=o.start;return{text:Array.from(o.getWalker({ignoreElementEnd:!1})).reduce((n,{item:i})=>i.is("$text")||i.is("$textProxy")?n+i.data:(e=t.createPositionAfter(i),""),""),range:t.createRange(e,o.end)}}class wg extends ft(){constructor(t,e){super(),this.model=t,this.testCallback=e,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(t,"change:data",(e,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(t,e={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=bg(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(e,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${t}`,l)}}}class Ag extends R{constructor(t){super(t),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=t.locale,r=e.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==ut.arrowright,l=a.keyCode==ut.arrowleft;if(!c&&!l)return;const d=i.contentLanguageDirection;let h=!1;h=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),h===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&Ee(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!an(i,e))&&!!Ee(r,e)&&(li(t),an(i,e)&&Ee(r,e,!0)?ci(n,e):this._overrideGravity(),!0)}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(li(t),this._restoreGravity(),Ee(r,e,!0)?ci(n,e):kr(n,e,r),!0):r.isAtStart?!!an(i,e)&&(li(t),kr(n,e,r),!0):!an(i,e)&&Ee(r,e,!0)?(li(t),kr(n,e,r),!0):!!Cg(r,e)&&(r.isAtEnd&&!an(i,e)&&Ee(r,e)?(li(t),kr(n,e,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view.document;t.editing.view.addObserver(Ks);let r=!1;this.listenTo(i,"mousedown",()=>{r=!0}),this.listenTo(i,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!an(n,s))return;const a=n.getFirstPosition();Ee(a,s)&&(a.isAtStart||Ee(a,s,!0)?ci(e,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection,n=this.attributes;this.listenTo(t,"insertContent",()=>{const i=e.getFirstPosition();an(e,n)&&Ee(i,n)&&ci(t,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=an(n,this.attributes)&&!Cg(a,this.attributes)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,s||t.model.enqueueChange(()=>{const a=n.getFirstPosition();an(n,this.attributes)&&Ee(a,this.attributes)&&(a.isAtStart||Ee(a,this.attributes,!0)?ci(e,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function an(o,t){for(const e of t)if(o.hasAttribute(e))return!0;return!1}function kr(o,t,e){const n=e.nodeBefore;o.change(i=>{if(n){const r=[],s=o.schema.isObject(n)&&o.schema.isInline(n);for(const[a,c]of n.getAttributes())!o.schema.checkAttribute("$text",a)||s&&o.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);i.setSelectionAttribute(r)}else i.removeSelectionAttribute(t)})}function ci(o,t){o.change(e=>{e.removeSelectionAttribute(t)})}function li(o){o.preventDefault()}function Cg(o,t){return Ee(o.getShiftedBy(-1),t)}function Ee(o,t,e=!1){const{nodeBefore:n,nodeAfter:i}=o;for(const r of t){const s=n?n.getAttribute(r):void 0,a=i?i.getAttribute(r):void 0;if((!e||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const _g={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:fo('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:fo("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:fo("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:fo('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:fo('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:fo("'"),to:[null,"‚",null,"’"]}},vg={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},g1=["symbols","mathematical","typography","quotes"];function p1(o){return typeof o=="string"?new RegExp(`(${Vu(o)})$`):o}function m1(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function f1(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function fo(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function br(o,t,e,n){return n.createRange(yg(o,t,e,!0,n),yg(o,t,e,!1,n))}function yg(o,t,e,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(t)==e;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*xg(o,t){for(const e of t)e&&o.getAttributeProperties(e[0]).copyOnEnter&&(yield e)}class k1 extends st{execute(){this.editor.model.change(t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})})}enterBlock(t){const e=this.editor.model,n=e.document.selection,i=e.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(i.isLimit(a)||i.isLimit(c))return r||a!=c||e.deleteContent(n),!1;if(r){const l=xg(t.model.schema,n.getAttributes());return Eg(t,s.start),t.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(e.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Eg(t,n.focus),!0;t.setSelection(c,0)}}return!1}}function Eg(o,t){o.split(t),o.setSelection(t.parent.nextSibling,0)}const b1={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Dg extends $e{constructor(t){super(t);const e=this.document;let n=!1;e.on("keydown",(i,r)=>{n=r.shiftKey}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;f.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=b1[s];if(!c)return;const l=new so(e,"enter",r.targetRanges[0]);e.fire(l,new co(t,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class wr extends R{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=this.editor.t;e.addObserver(Dg),t.commands.add("enter",new k1(t)),this.listenTo(n,"enter",(r,s)=>{n.isComposing||s.preventDefault(),s.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class w1 extends st{execute(){const t=this.editor.model,e=t.document;t.change(n=>{(function(i,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,h=l==d;if(a){const u=xg(i.schema,s.getAttributes());Ig(i,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(u)}else{const u=!(c.start.isAtStart&&c.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:u}),h?Ig(i,r,s.focus):u&&r.setSelection(d,0)}})(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,c=s.end.parent;return!((ua(a,n)||ua(c,n))&&a!==c)}(t.schema,e.selection)}}function Ig(o,t,e){const n=t.createElement("softBreak");o.insertContent(n,e),t.setSelection(n,"after")}function ua(o,t){return!o.is("rootElement")&&(t.isLimit(o)||ua(o.parent,t))}class A1 extends R{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=i.document,s=this.editor.t;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),i.addObserver(Dg),t.commands.add("shiftEnter",new w1(t)),this.listenTo(r,"enter",(a,c)=>{r.isComposing||c.preventDefault(),c.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class C1 extends kt(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i===r||ga(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i===r||ga(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(ga(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&_1(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function ga(o,t){return o&&t&&o.priority==t.priority&&Ar(o.classes)==Ar(t.classes)}function _1(o,t){return o.priority>t.priority||!(o.priorityAr(t.classes)}function Ar(o){return Array.isArray(o)?o.sort().join(","):o}const v1='',y1="ck-widget",Sg="ck-widget_selected";function Ut(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function pa(o,t,e={}){if(!o.is("containerElement"))throw new _("widget-to-widget-wrong-element-type",null,{element:o});return t.setAttribute("contenteditable","false",o),t.addClass(y1,o),t.setCustomProperty("widget",!0,o),o.getFillerOffset=D1,t.setCustomProperty("widgetLabel",[],o),e.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,e.label),e.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new kn;return c.set("content",v1),c.render(),a.appendChild(c.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,t),Tg(o,t),o}function x1(o,t,e){if(t.classes&&e.addClass(Et(t.classes),o),t.attributes)for(const n in t.attributes)e.setAttribute(n,t.attributes[n],o)}function E1(o,t,e){if(t.classes&&e.removeClass(Et(t.classes),o),t.attributes)for(const n in t.attributes)e.removeAttribute(n,o)}function Tg(o,t,e=x1,n=E1){const i=new C1;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&e(o,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),t.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function Mg(o,t,e={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),t.setAttribute("role","textbox",o),e.label&&t.setAttribute("aria-label",e.label,o),t.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{t.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?t.addClass("ck-editor__nested-editable_focused",o):t.removeClass("ck-editor__nested-editable_focused",o)}),Tg(o,t),o}function Bg(o,t){const e=o.getSelectedElement();if(e){const n=wn(o);if(n)return t.createRange(t.createPositionAt(e,n))}return t.schema.findOptimalInsertionRange(o)}function D1(){return null}const cn="widget-type-around";function Vn(o,t,e){return!!o&&Ut(o)&&!e.isInline(t)}function wn(o){return o.getAttribute(cn)}var Ng=N(8508),I1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ng.A,I1),Ng.A.locals;const Pg=["before","after"],S1=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Og="ck-widget__type-around_disabled";class T1 extends R{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[wr,sn]}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(n,i,r)=>{e.change(s=>{for(const a of e.document.roots)r?s.removeClass(Og,a):s.addClass(Og,a)}),r||t.model.change(s=>{s.removeSelectionAttribute(cn)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=wn(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&Vn(c,s.item,e)&&(function(l,d,h){const u=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(g){const p=this.toDomElement(g);return function(k,b){for(const A of Pg){const E=new Re({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${A}`],title:b[A],"aria-hidden":"true"},children:[k.ownerDocument.importNode(S1,!0)]});k.appendChild(E.render())}}(p,d),function(k){const b=new Re({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});k.appendChild(b.render())}(p),p});l.insert(l.createPositionAt(h,"end"),u)}(a.writer,i,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,n=e.document.selection,i=e.schema,r=t.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,c)=>{this._handleArrowKeyPress(a,c)},{context:[Ut,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&t.model.change(l=>{l.removeSelectionAttribute(cn)})}),this._listenToIfEnabled(e.document,"change:data",()=>{const a=n.getSelectedElement();a&&Vn(t.editing.mapper.toViewElement(a),a,i)||t.model.change(c=>{c.removeSelectionAttribute(cn)})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const p=l.mapper.toViewElement(this._currentFakeCaretModelElement);p&&(d.removeClass(Pg.map(s),p),this._currentFakeCaretModelElement=null)}const h=c.selection.getSelectedElement();if(!h)return;const u=l.mapper.toViewElement(h);if(!Vn(u,h,i))return;const g=wn(c.selection);g&&(d.addClass(s(g),u),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||t.model.change(d=>{d.removeSelectionAttribute(cn)})})}_handleArrowKeyPress(t,e){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,c=function(h,u){const g=cs(h,u);return g==="down"||g==="right"}(e.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;Vn(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):e.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=wn(e.document.selection);return e.change(i=>n?n!==(t?"after":"before")?(i.removeSelectionAttribute(cn),!0):!1:(i.setSelectionAttribute(cn,t?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,r=e.plugins.get("Widget"),s=r._getObjectElementNextToSelection(t);return!!Vn(e.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(cn,t?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,r=e.editing.mapper,s=n.document.selection,a=t?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!Vn(r.toViewElement(a),a,i)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(cn,t?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(l){return l.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(l,d){const h=l.closest(".ck-widget");return d.mapDomToView(h)}(r,e.domConverter),c=t.editing.mapper.toModelElement(a);this._insertParagraph(c,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=e.getSelectedElement(),a=t.editing.mapper.toViewElement(s),c=t.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Vn(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),i.stop())},{context:Ut})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(e,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=t.selection)},{priority:"high"}),f.isAndroid?this._listenToIfEnabled(t,"keydown",(e,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=wn(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)t.execute("delete",{selection:n.createSelection(l,"on")});else{const h=i.getNearestSelectionRange(n.createPositionAt(l,a),c);if(h)if(h.isCollapsed){const u=n.createSelection(h.start);if(n.modifySelection(u,{direction:c}),u.focus.isEqual(h.start)){const g=function(p,k){let b=k;for(const A of k.getAncestors({parentFirst:!0})){if(A.childCount>1||p.isLimit(A))break;b=A}return b}(i,h.start.parent);n.deleteContent(n.createSelection(g,"on"),{doNotAutoparagraph:!0})}else n.change(g=>{g.setSelection(h),t.execute(d?"deleteForward":"delete")})}else n.change(u=>{u.setSelection(h),t.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Ut})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=wn(n);return a?(i.stop(),e.change(c=>{const l=n.getSelectedElement(),d=e.createPositionAt(l,a),h=c.createSelection(d),u=e.insertContent(r,h);return c.setSelection(h),u})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=wn(e);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||wn(e)&&n.stop()},{priority:"high"})}}function M1(o){const t=o.model;return(e,n)=>{const i=n.keyCode==ut.arrowup,r=n.keyCode==ut.arrowdown,s=n.shiftKey,a=t.document.selection;if(!i&&!r)return;const c=r;if(s&&function(d,h){return!d.isCollapsed&&d.isBackward==h}(a,c))return;const l=function(d,h,u){const g=d.model;if(u){const p=h.isCollapsed?h.focus:h.getLastPosition(),k=Lg(g,p,"forward");if(!k)return null;const b=g.createRange(p,k),A=zg(g.schema,b,"backward");return A?g.createRange(p,A):null}{const p=h.isCollapsed?h.focus:h.getFirstPosition(),k=Lg(g,p,"backward");if(!k)return null;const b=g.createRange(k,p),A=zg(g.schema,b,"forward");return A?g.createRange(A,p):null}}(o,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,h,u){const g=d.model,p=d.view.domConverter;if(u){const M=g.createSelection(h.start);g.modifySelection(M),M.focus.isAtEnd||h.start.isEqual(M.focus)||(h=g.createRange(M.focus,h.end))}const k=d.mapper.toViewRange(h),b=p.viewRangeToDom(k),A=dt.getDomRangeRects(b);let E;for(const M of A)if(E!==void 0){if(Math.round(M.top)>=E)return!1;E=Math.max(E,Math.round(M.bottom))}else E=Math.round(M.bottom);return!0}(o,l,c))&&(t.change(d=>{const h=c?l.end:l.start;if(s){const u=t.createSelection(a.anchor);u.setFocus(h),d.setSelection(u)}else d.setSelection(h)}),e.stop(),n.preventDefault(),n.stopPropagation())}}}function Lg(o,t,e){const n=o.schema,i=o.createRangeIn(t.root),r=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of i.getWalker({startPosition:t,direction:e})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function zg(o,t,e){const n=e=="backward"?t.end:t.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of t.getWalker({direction:e}))if(o.checkChild(i,"$text"))return i;return null}var Rg=N(695),B1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Rg.A,B1),Rg.A.locals;class di extends R{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[T1,sn]}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.t;this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{const c=a.writer,l=s.selection;if(l.isCollapsed)return;const d=l.getSelectedElement();if(!d)return;const h=t.editing.mapper.toViewElement(d);var u;Ut(h)&&a.consumable.consume(l,"selection")&&c.setSelection(c.createRangeOn(h),{fake:!0,label:(u=h,u.getCustomProperty("widgetLabel").reduce((g,p)=>typeof p=="function"?g?g+". "+p():p():g?g+". "+p:p,""))})}),this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,l=c.document.selection;let d=null;for(const h of l.getRanges())for(const u of h){const g=u.item;Ut(g)&&!N1(g,d)&&(c.addClass(Sg,g),this._previouslySelected.add(g),d=g)}},{priority:"low"}),e.addObserver(Ks),this.listenTo(n,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(n,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[Ut,"$text"]}),this.listenTo(n,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(n,"arrowKey",M1(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(r,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),r.stop())},{context:"$root"}),t.accessibility.addKeystrokeInfoGroup({id:"widget",label:i("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:i("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:i("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:i("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:i("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(t,e){const n=this.editor,i=n.editing.view,r=i.document;let s=e.target;if(e.domEvent.detail>=3)return void(this._selectBlockContent(s)&&e.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(Ut(l))return!1;l=l.parent}return!1}(s)||!Ut(s)&&(s=s.findAncestor(Ut),!s))return;f.isAndroid&&e.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(t){const e=this.editor,n=e.model,i=e.editing.mapper,r=n.schema,s=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(t,0)),a=function(c,l){for(const d of c.getAncestors({includeSelf:!0,parentFirst:!0})){if(l.checkChild(d,"$text"))return d;if(l.isLimit(d)&&!l.isObject(d))break}return null}(i.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(u,g){const p=new Xe({startPosition:u});for(const{item:k}of p){if(g.isLimit(k)||!k.is("element"))return null;if(g.checkChild(k,"$text"))return k}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),h=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,h))}),!0)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),c=cs(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const u=l?s.getLastPosition():s.getFirstPosition(),g=r.getNearestSelectionRange(u,l?"forward":"backward");return void(g&&(i.change(p=>{p.setSelection(g)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed&&!e.shiftKey){const u=s.getFirstPosition(),g=s.getLastPosition(),p=u.nodeAfter,k=g.nodeBefore;return void((p&&r.isObject(p)||k&&r.isObject(k))&&(i.change(b=>{b.setSelection(l?g:u)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&r.isObject(h)){if(r.isInline(h)&&d)return;this._setSelectionOverElement(h),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(e.preventDefault(),t.stop())}_handleDelete(t){const e=this.editor.model.document.selection;if(!this.editor.model.canEditAt(e)||!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(i=>{let r=e.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,r=e.createSelection(i);if(e.modifySelection(r,{direction:t?"forward":"backward"}),r.isEqual(i))return null;const s=t?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(Sg,e);this._previouslySelected.clear()}}function N1(o,t){return!!t&&Array.from(o.getAncestors()).includes(t)}class Cr extends R{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[gr]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Ut(r))})(t.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Q("widget-toolbar-no-items",{toolbarId:t});const s=this.editor,a=s.t,c=new na(s.locale);if(c.ariaLabel=e||a("Widget toolbar"),this._toolbarDefinitions.has(t))throw new _("widget-toolbar-duplicated",this,{toolbarId:t});const l={view:c,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(t,l)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>t&&(t=s,e=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?jg(this.editor,e):this._isToolbarInBalloon(t)||(t.initialized||(t.initialized=!0,t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:t.view,position:Fg(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);jg(this.editor,i)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function jg(o,t){const e=o.plugins.get("ContextualBalloon"),n=Fg(o,t);e.updatePosition(n)}function Fg(o,t){const e=o.editing.view,n=se.defaultPositions;return{target:e.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Vg=N(4095),P1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Vg.A,P1),Vg.A.locals;const ma=oo("px");class O1 extends et{constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",e=>!e)],style:{left:t.to("left",e=>ma(e)),top:t.to("top",e=>ma(e)),width:t.to("width",e=>ma(e))}}})}}class _r extends R{constructor(){super(...arguments),this.removeDropMarkerDelayed=us(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=hr(t=>this._updateDropMarker(t),40),this._reconvertMarkerThrottled=hr(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new O1,this._domEmitter=new(Ce()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:t}of this._scrollables.values())t.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(t,e,n,i,r,s){this.removeDropMarkerDelayed.cancel();const a=Hg(this.editor,t,e,n,i,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(t,e,n,i,r,s){const a=Hg(this.editor,t,e,n,i,r,s);return this.removeDropMarker(),a}removeDropMarker(){const t=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,t.markers.has("drop-target")&&t.change(e=>{e.removeMarker("drop-target")})}_setupDropMarker(){const t=this.editor;t.ui.view.body.add(this._dropTargetLineView),t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);e.markerRange.isCollapsed?this._updateDropTargetLine(e.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||i.updateMarker("drop-target",{range:t}):i.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(t){return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const n=this.toDomElement(e);return n.append("⁠",e.createElement("span"),"⁠"),n})}_updateDropTargetLine(t){const e=this.editor.editing,n=t.start.nodeBefore,i=t.start.nodeAfter,r=t.start.parent,s=n?e.mapper.toViewElement(n):null,a=s?e.view.domConverter.mapViewToDom(s):null,c=i?e.mapper.toViewElement(i):null,l=c?e.view.domConverter.mapViewToDom(c):null,d=e.mapper.toViewElement(r);if(!d)return;const h=e.view.domConverter.mapViewToDom(d),u=this._getScrollableRect(d),{scrollX:g,scrollY:p}=$.window,k=a?new dt(a):null,b=l?new dt(l):null,A=new dt(h).excludeScrollbarsAndBorders(),E=k?k.bottom:A.top,M=b?b.top:A.bottom,z=$.window.getComputedStyle(h),G=E<=M?(E+M)/2:M;if(u.topa.schema.checkChild(h,u))){if(a.schema.checkChild(h,"$text"))return a.createRange(h);if(d)return vr(o,qg(o,d.parent),n,i)}}}else if(a.schema.isInline(l))return vr(o,l,n,i)}if(a.schema.isBlock(l))return vr(o,l,n,i);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(g=>g.is("element")&&!L1(o,g));let h=0,u=d.length;if(u==0)return a.createRange(a.createPositionAt(l,"end"));for(;ht in o?z1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class H1 extends R{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(Ce())}static get pluginName(){return"DragDropBlockToolbar"}init(){const t=this.editor;if(this.listenTo(t,"change:isReadOnly",(e,n,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),f.isAndroid&&this.forceDisabled("noAndroidSupport"),t.plugins.has("BlockToolbar")){const e=t.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(e,"dragstart",(n,i)=>this._handleBlockDragStart(i)),this._domEmitter.listenTo($.document,"dragover",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo($.document,"drop",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo($.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&e.setAttribute("draggable","true"),this.on("change:isEnabled",(n,i,r)=>{e.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(t){if(!this.isEnabled)return;const e=this.editor.model,n=e.document.selection,i=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));e.change(a=>a.setSelection(s)),this._isBlockDragging=!0,i.focus(),i.getObserver(ri).onDomEvent(t)}_handleBlockDragging(t){if(!this.isEnabled||!this._isBlockDragging)return;const e=t.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=t.clientY,i=document.elementFromPoint(e,n),r=this.editor.editing.view;var s,a;i&&i.closest(".ck-editor__editable")&&r.getObserver(ri).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))F1.call(l,d)&&Wg(c,d,l[d]);if(Gg)for(var d of Gg(l))V1.call(l,d)&&Wg(c,d,l[d]);return c})({},t),a={type:t.type,dataTransfer:t.dataTransfer,target:i,clientX:e,clientY:n,preventDefault:()=>t.preventDefault(),stopPropagation:()=>t.stopPropagation()},R1(s,j1(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var Kg=N(7793),U1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Kg.A,U1),Kg.A.locals;class q1 extends R{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=us(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(Ce())}static get pluginName(){return"DragDrop"}static get requires(){return[xe,di,_r,H1]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,e.addObserver(ri),e.addObserver(Ks),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),f.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=t.plugins.get(_r);this.listenTo(i,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=X(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:h}=a,{clientX:u}=h;this._updatePreview({dataTransfer:l,domTarget:d,clientX:u}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(i,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo($.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(i,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(i,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(i,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");const{clientX:c,clientY:l}=a.domEvent;r.updateDropMarker(a.target,a.targetRanges,c,l,this._blockMode,this._draggedRange),this._draggedRange||(a.dataTransfer.dropEffect="copy"),f.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get(_r);this.listenTo(e,"clipboardInput",(i,r)=>{if(r.method!="drop")return;const{clientX:s,clientY:a}=r.domEvent,c=n.getFinalDropRange(r.target,r.targetRanges,s,a,this._blockMode,this._draggedRange);if(!c)return this._finalizeDragging(!1),void i.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),$g(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void i.stop();r.targetRanges=[t.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(xe);t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=$g(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,n=e.document;this.listenTo(n,"mousedown",(i,r)=>{if(f.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Yg(r.target);if(f.isBlink&&!t.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&Ut(a)||(s=n.selection.editableElement)}s&&(e.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=t.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{f.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(t){const e=this.editor,n=e.model;e.plugins.get(_r).removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(t&&this.isEnabled&&n.change(i=>{const r=n.createSelection(this._draggedRange);n.deleteContent(r,{doNotAutoparagraph:!0});const s=r.getFirstPosition().parent;s.isEmpty&&!n.schema.checkChild(s,"$text")&&n.schema.checkChild(s,"paragraph")&&i.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(t){const e=this.editor,n=e.model,i=n.document.selection,r=t?Yg(t):null;if(r){const l=e.editing.mapper.toModelElement(r);this._draggedRange=pe.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(i.isCollapsed&&!i.getFirstPosition().parent.isEmpty)return;const s=Array.from(i.getSelectedBlocks()),a=i.getFirstRange();if(s.length==0)return void(this._draggedRange=pe.fromRange(a));const c=Qg(n,s);if(s.length>1)this._draggedRange=pe.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=pe.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:t,domTarget:e,clientX:n}){const i=this.editor.editing.view,r=i.document.selection.editableElement,s=i.domConverter.mapViewToDom(r),a=$.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Ae($.document,"div",{style:"position: fixed; left: -999999px;"}),$.document.body.appendChild(this._previewContainer));const c=new dt(s);if(s.contains(e))return;const l=parseFloat(a.paddingLeft),d=Ae($.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,f.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=t.getData("text/html"),t.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function $g(o){return f.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Yg(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Ut);if(Ut(o))return o;const t=o.findAncestor(e=>Ut(e)||e.is("editableElement"));return Ut(t)?t:null}function Qg(o,t){const e=t[0],n=t[t.length-1],i=e.getCommonAncestor(n),r=o.createPositionBefore(e),s=o.createPositionAfter(n);if(i&&i.is("element")&&!o.schema.isLimit(i)){const a=o.createRangeOn(i),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return Qg(o,[i])}return o.createRange(r,s)}class G1 extends R{static get pluginName(){return"PastePlainText"}static get requires(){return[xe]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=e.document.selection;let s=!1;n.addObserver(ri),this.listenTo(i,"keydown",(a,c)=>{s=c.shiftKey}),t.plugins.get(xe).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const h=l.getChild(0);return d.isObject(h)?!1:Array.from(h.getAttributeKeys()).length==0}(c.content,e.schema))&&e.change(l=>{const d=Array.from(r.getAttributes()).filter(([u])=>e.schema.getAttributeProperties(u).isFormatting);r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const h=l.createRangeIn(c.content);for(const u of h.getItems())u.is("$textProxy")&&l.setAttributes(d,u)})})}}class Zg extends R{static get pluginName(){return"Clipboard"}static get requires(){return[si,xe,q1,G1]}init(){const t=this.editor,e=this.editor.t;t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Copy selected content"),keystroke:"CTRL+C"},{label:e("Paste content"),keystroke:"CTRL+V"},{label:e("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class W1 extends st{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!Jg(t.schema,n))do if(n=n.parent,!n)return;while(!Jg(t.schema,n));t.change(i=>{i.setSelection(n,"in")})}}function Jg(o,t){return o.isLimit(t)&&(o.checkChild(t,"$text")||o.checkChild(t,"paragraph"))}const K1=jo("Ctrl+A");class $1 extends R{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.t,n=t.editing.view.document;t.commands.add("selectAll",new W1(t)),this.listenTo(n,"keydown",(i,r)=>{io(r)===K1&&(t.execute("selectAll"),r.preventDefault())}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Select all"),keystroke:"CTRL+A"}]})}}class Y1 extends R{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const n=t.commands.get("selectAll"),i=new wt(e),r=e.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),i})}}class Q1 extends R{static get requires(){return[$1,Y1]}static get pluginName(){return"SelectAll"}}var Z1=Object.defineProperty,Xg=Object.getOwnPropertySymbols,J1=Object.prototype.hasOwnProperty,X1=Object.prototype.propertyIsEnumerable,tp=(o,t,e)=>t in o?Z1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class ep extends st{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))J1.call(s,a)&&tp(r,a,s[a]);if(Xg)for(var a of Xg(s))X1.call(s,a)&&tp(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,r=i.document,s=[],a=t.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(h=>h.root!=r.graveyard).filter(h=>!ey(h,c));d.length&&(ty(d),s.push(d[0]))}s.length&&i.change(l=>{l.setSelection(s,{backward:e})})}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(i.history.getOperations(a)),l=YA([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const h=d.affectedSelectable;h&&!n.canEditAt(h)&&(d=new Vt(d.baseVersion)),e.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function ty(o){o.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;te!==o&&e.containsRange(o,!0))}class ny extends ep{execute(t=null){const e=t?this._stack.findIndex(r=>r.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r)}),this.fire("revert",n.batch,i),this.refresh()}}class oy extends ep{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class iy extends R{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const t=this.editor,e=t.t;this._undoCommand=new ny(t),this._redoCommand=new oy(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(n,i)=>{const r=i[0];if(!r.isDocumentOperation)return;const s=r.batch,a=this._redoCommand.createdBatches.has(s),c=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(a?this._undoCommand.addBatch(s):c||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(n,i,r)=>{this._redoCommand.addBatch(r)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Undo"),keystroke:"CTRL+Z"},{label:e("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class ry extends R{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?ot.undo:ot.redo,r=e.uiLanguageDirection=="ltr"?ot.redo:ot.undo;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(t,e,n,i){const r=this.editor;r.ui.componentFactory.add(t,s=>{const a=r.commands.get(t),c=new wt(s);return c.set({label:e,icon:i,keystroke:n,tooltip:!0}),c.bind("isEnabled").to(a,"isEnabled"),this.listenTo(c,"execute",()=>{r.execute(t),r.editing.view.focus()}),c})}}class np extends R{static get requires(){return[iy,ry]}static get pluginName(){return"Undo"}}class sy extends ft(){constructor(){super();const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,i)=>{e.onload=()=>{const r=e.result;this._data=r,n(r)},e.onerror=()=>{i("error")},e.onabort=()=>{i("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}class je extends R{constructor(){super(...arguments),this.loaders=new Be,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Ah]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Q("filerepository-no-upload-adapter"),null;const e=new op(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(n=>{this._loadersMap.set(n,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),e.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),e}destroyLoader(t){const e=t instanceof op?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((n,i)=>{n===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Ah);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=i=>`${e("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}class op extends ft(){constructor(t,e){super(),this.id=X(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new sy,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new _("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if(this.status!=="reading")throw this.status;return this.status="idle",t}).catch(t=>{throw t==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:t)})}upload(){if(this.status!="idle")throw new _("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{throw this.status==="aborted"?"aborted":(this.status="error",t)})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?t=="reading"?this._reader.abort():t=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((n,i)=>{e.rejecter=i,e.isFulfilled=!1,t.then(r=>{e.isFulfilled=!0,n(r)}).catch(r=>{e.isFulfilled=!0,i(r)})}),e}}class ay extends wt{constructor(t){super(t),this.buttonView=this,this._fileInputView=new cy(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}class cy extends et{constructor(t){super(t),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const ip="ckCsrfToken",rp="abcdefghijklmnopqrstuvwxyz0123456789";function ly(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(ip);var t,e;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),t=ip,e=o,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"),o}class dy{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>e(s)),i.addEventListener("abort",()=>e()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return e(a&&a.error&&a.error.message?a.error.message:s);t({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",ly()),this.xhr.send(e)}}function An(o,t,e,n){let i,r=null;typeof n=="function"?i=n:(r=o.commands.get(n),i=()=>{o.execute(n)}),o.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const c=Wt(o.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(o.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const h=d.position.parent;if(h.is("element","codeBlock")||h.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const u=h.getChild(0),g=o.model.createRangeOn(u);if(!g.containsRange(c)&&!c.end.isEqual(g.end))return;const p=e.exec(u.data.substr(0,c.end.offset));p&&o.model.enqueueChange(k=>{const b=k.createPositionAt(h,0),A=k.createPositionAt(h,p[0].length),E=new pe(b,A);if(i({match:p})!==!1){k.remove(E);const M=o.model.document.selection.getFirstRange(),z=k.createRangeIn(h);!h.isEmpty||z.isEqual(M)||z.containsRange(M,!0)||k.remove(h)}E.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function ko(o,t,e,n){let i,r;e instanceof RegExp?i=e:r=e,r=r||(s=>{let a;const c=[],l=[];for(;(a=i.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:h,2:u,3:g}=a;const p=h+u+g;d+=a[0].length-p.length;const k=[d,d+h.length],b=[d+h.length+u.length,d+h.length+u.length+g.length];c.push(k),c.push(b),l.push([d+h.length,d+h.length+u.length])}return{remove:c,format:l}}),o.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;const c=o.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),h=d[0];if(d.length!=1||h.type!=="insert"||h.name!="$text"||h.length!=1)return;const u=l.focus,g=u.parent,{text:p,range:k}=function(M,z){let G=M.start;return{text:Array.from(M.getItems()).reduce((at,St)=>!St.is("$text")&&!St.is("$textProxy")||St.getAttribute("code")?(G=z.createPositionAfter(St),""):at+St.data,""),range:z.createRange(G,M.end)}}(c.createRange(c.createPositionAt(g,0),u),c),b=r(p),A=sp(k.start,b.format,c),E=sp(k.start,b.remove,c);A.length&&E.length&&c.enqueueChange(M=>{if(n(M,A)!==!1){for(const z of E.reverse())M.remove(z);c.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function sp(o,t,e){return t.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>e.createRange(o.getShiftedBy(n[0]),o.getShiftedBy(n[1])))}function yr(o,t){return(e,n)=>{if(!o.commands.get(t).isEnabled)return!1;const i=o.model.schema.getValidRanges(n,t);for(const r of i)e.setAttribute(t,!0,r);e.removeSelectionAttribute(t)}}class ap extends st{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.forceValue===void 0?!this.value:t.forceValue;e.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(e.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const bo="bold";class hy extends R{static get pluginName(){return"BoldEditing"}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:bo}),t.model.schema.setAttributeProperties(bo,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:bo,view:"strong",upcastAlso:["b",n=>{const i=n.getStyle("font-weight");return i&&(i=="bold"||Number(i)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(bo,new ap(t,bo)),t.keystrokes.set("CTRL+B",bo),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Bold text"),keystroke:"CTRL+B"}]})}}const fa="bold";class uy extends R{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(fa,n=>{const i=t.commands.get(fa),r=new wt(n);return r.set({label:e("Bold"),icon:ot.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(fa),t.editing.view.focus()}),r})}}var cp=N(4199),gy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(cp.A,gy),cp.A.locals;const wo="italic";class py extends R{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:wo}),t.model.schema.setAttributeProperties(wo,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:wo,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(wo,new ap(t,wo)),t.keystrokes.set("CTRL+I",wo),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Italic text"),keystroke:"CTRL+I"}]})}}const ka="italic";class my extends R{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(ka,n=>{const i=t.commands.get(ka),r=new wt(n);return r.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(ka),t.editing.view.focus()}),r})}}class fy extends st{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks()),s=t.forceValue===void 0?!this.value:t.forceValue;e.change(a=>{if(s){const c=r.filter(l=>xr(l)||dp(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(xr))})}_getValue(){const t=Wt(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!xr(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Wt(t.getSelectedBlocks());return!!n&&dp(e,n)}_removeQuote(t,e){lp(t,e).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void t.unwrap(n.start.parent);if(n.start.isAtStart){const r=t.createPositionBefore(n.start.parent);return void t.move(n,r)}n.end.isAtEnd||t.split(n.end);const i=t.createPositionAfter(n.end.parent);t.move(n,i)})}_applyQuote(t,e){const n=[];lp(t,e).reverse().forEach(i=>{let r=xr(i.start);r||(r=t.createElement("blockQuote"),t.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(t.merge(t.createPositionAfter(i)),i):r)}}function xr(o){return o.parent.name=="blockQuote"?o.parent:null}function lp(o,t){let e,n=0;const i=[];for(;n{const a=t.model.document.differ.getChanges();for(const c of a)if(c.type=="insert"){const l=c.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!e.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const h of d.getItems())if(h.is("element","blockQuote")&&!e.checkChild(s.createPositionBefore(h),h))return s.unwrap(h),!0}}else if(c.type=="remove"){const l=c.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});const n=this.editor.editing.view.document,i=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const c=i.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var hp=N(8708),by={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(hp.A,by),hp.A.locals;class wy extends R{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const i=t.commands.get("blockQuote"),r=new wt(n);return r.set({label:e("Block quote"),icon:ot.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r})}}class Ay extends R{static get pluginName(){return"CKBoxUI"}afterInit(){const t=this.editor;if(!t.commands.get("ckbox"))return;const e=t.t;if(t.ui.componentFactory.add("ckbox",n=>{const i=t.commands.get("ckbox"),r=new wt(n);return r.set({label:e("Open file manager"),icon:ot.browseFiles,tooltip:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),r.on("execute",()=>{t.execute("ckbox")}),r}),t.plugins.has("ImageInsertUI")){const n=t.plugins.get("ImageInsertUI");n.registerIntegration({name:"assetManager",observable:()=>t.commands.get("ckbox"),buttonViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckbox");return i.icon=ot.imageAssetManager,i.bind("label").to(n,"isImageSelected",r=>e(r?"Replace image with file manager":"Insert image with file manager")),i},formViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckbox");return i.icon=ot.imageAssetManager,i.withText=!0,i.bind("label").to(n,"isImageSelected",r=>e(r?"Replace with file manager":"Insert with file manager")),i.on("execute",()=>{n.dropdownView.isOpen=!1}),i}})}}}var Cy=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],hi=o=>{let t=0;for(let e=0;e{let t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},wa=o=>{let t=Math.max(0,Math.min(1,o));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},Aa=(o,t)=>(e=>e<0?-1:1)(o)*Math.pow(Math.abs(o),t),up=class extends Error{constructor(o){super(o),this.name="ValidationError",this.message=o}},_y=o=>{if(!o||o.length<6)throw new up("The blurhash string must be at least 6 characters");let t=hi(o[0]),e=Math.floor(t/9)+1,n=t%9+1;if(o.length!==4+2*n*e)throw new up(`blurhash length mismatch: length is ${o.length} but it should be ${4+2*n*e}`)},vy=o=>{let t=o>>8&255,e=255&o;return[ba(o>>16),ba(t),ba(e)]},yy=(o,t)=>{let e=Math.floor(o/361),n=Math.floor(o/19)%19,i=o%19;return[Aa((e-9)/9,2)*t,Aa((n-9)/9,2)*t,Aa((i-9)/9,2)*t]},xy=(o,t,e,n)=>{_y(o),n|=1;let i=hi(o[0]),r=Math.floor(i/9)+1,s=i%9+1,a=(hi(o[1])+1)/166,c=new Array(s*r);for(let h=0;ht in o?Ey(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;function mp(o){const t=[];let e=0;for(const i in o){const r=parseInt(i,10);isNaN(r)||(r>e&&(e=r),t.push(`${o[i]} ${i}w`))}const n=[{srcset:t.join(","),sizes:`(max-width: ${e}px) 100vw, ${e}px`,type:"image/webp"}];return{imageFallbackUrl:o.default,imageSources:n}}const ui=32;function fp({url:o,method:t="GET",data:e,onUploadProgress:n,signal:i,authorization:r}){const s=new XMLHttpRequest;s.open(t,o.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{i.throwIfAborted(),i.addEventListener("abort",a),s.addEventListener("loadstart",()=>{i.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{i.removeEventListener("abort",a)}),s.addEventListener("error",()=>{l()}),s.addEventListener("abort",()=>{l()}),s.addEventListener("load",()=>{const d=s.response;if(!d||d.statusCode>=400)return l(d&&d.message);c(d)}),n&&s.upload.addEventListener("progress",d=>{n(d)}),s.send(e)})}const Sy={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function Ty(o,t){return e=this,n=null,i=function*(){try{const r=yield fetch(o,((s,a)=>{for(var c in a||(a={}))Dy.call(a,c)&&pp(s,c,a[c]);if(gp)for(var c of gp(a))Iy.call(a,c)&&pp(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},t));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(i.next(d))}catch(h){s(h)}},c=d=>{try{l(i.throw(d))}catch(h){s(h)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((i=i.apply(e,n)).next())});var e,n,i}var My=Object.defineProperty,kp=Object.getOwnPropertySymbols,By=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,bp=(o,t,e)=>t in o?My(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,wp=(o,t)=>{for(var e in t||(t={}))By.call(t,e)&&bp(o,e,t[e]);if(kp)for(var e of kp(t))Ny.call(t,e)&&bp(o,e,t[e]);return o};class Py extends st{constructor(t){super(t),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return this._wrapper!==null}_checkEnabled(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");return!(!t.isEnabled&&!e.isEnabled)}_prepareOptions(){const t=this.editor.config.get("ckbox");return{theme:t.theme,language:t.language,tokenUrl:t.tokenUrl,serviceOrigin:t.serviceOrigin,forceDemoLabel:t.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const t=this.editor,e=t.model,n=!t.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=Ae(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))}),this.on("ckbox:close",()=>{this.value&&(this._wrapper.remove(),this._wrapper=null,t.editing.view.focus())}),this.on("ckbox:choose",(i,r)=>{if(!this.isEnabled)return;const s=t.commands.get("insertImage"),a=t.commands.get("link"),c=function({assets:d,isImageAllowed:h,isLinkAllowed:u}){return d.map(g=>function(p){const k=p.data.metadata;return k?k.width&&k.height:!1}(g)?{id:g.data.id,type:"image",attributes:Oy(g)}:{id:g.data.id,type:"link",attributes:Ly(g)}).filter(g=>g.type==="image"?h:u)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(e.change(d=>{for(const h of c){const u=h===c[l-1],g=l===1;this._insertAsset(h,u,d,g),n&&(setTimeout(()=>this._chosenAssets.delete(h),1e3),this._chosenAssets.add(h))}}),t.editing.view.focus())}),this.listenTo(t,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(t,e,n,i){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),t.type==="image"?this._insertImage(t):this._insertLink(t,n,i),e||n.setSelection(r.getLastPosition())}_insertImage(t){const e=this.editor,{imageFallbackUrl:n,imageSources:i,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=t.attributes;e.execute("insertImage",{source:wp({src:n,sources:i,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(t,e,n){const i=this.editor,r=i.model,s=r.document.selection,{linkName:a,linkHref:c}=t.attributes;if(s.isCollapsed){const l=We(s.getAttributes()),d=e.createText(a,l);if(!n){const u=s.getLastPosition(),g=u.parent;g.name==="paragraph"&&g.isEmpty||i.execute("insertParagraph",{position:u});const p=r.insertContent(d);return e.setSelection(p),void i.execute("link",c)}const h=r.insertContent(d);e.setSelection(h)}i.execute("link",c)}}function Oy(o){const{imageFallbackUrl:t,imageSources:e}=mp(o.data.imageUrls),{description:n,width:i,height:r,blurHash:s}=o.data.metadata,a=function(c){if(c)try{const l=`${ui}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const h=d.getContext("2d");if(!h)return;const u=h.createImageData(ui,ui),g=xy(c,ui,ui);return u.data.set(g),h.putImageData(u,0,0),d.toDataURL()}catch{return}}(s);return wp({imageFallbackUrl:t,imageSources:e,imageTextAlternative:n||"",imageWidth:i,imageHeight:r},a?{imagePlaceholder:a}:null)}function Ly(o){return{linkName:o.data.name,linkHref:zy(o)}}function zy(o){const t=new URL(o.data.url);return t.searchParams.set("download","true"),t.toString()}var Ca=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class Ap extends R{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return Ca(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;t.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:t.locale.uiLanguage,theme:"lark",tokenUrl:t.config.get("cloudServices.tokenUrl")});const i=t.plugins.get("CloudServices"),r=t.config.get("cloudServices.tokenUrl"),s=t.config.get("ckbox.tokenUrl");if(!s)throw new _("ckbox-plugin-missing-token-url",this);this._token=s==r?i.token:yield i.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const t=(0,this.editor.t)("Cannot access default workspace."),e=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(i,r){const[,s]=i.value.split("."),a=JSON.parse(atob(s)),c=a.auth&&a.auth.ckbox&&a.auth.ckbox.workspaces||[a.aud];return r?(a.auth&&a.auth.ckbox&&a.auth.ckbox.role)=="superadmin"||c.includes(r)?r:null:c[0]}(this._token,e);if(n==null)throw Dt("ckbox-access-default-workspace-error"),t;return n}getCategoryIdForFile(t,e){return Ca(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),i=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(e),s=typeof t=="string"?(a=yield Ty(t,e),Sy[a]):function(d){const h=d.name,u=new RegExp("\\.(?[^.]+)$");return h.match(u).groups.ext.toLowerCase()}(t);var a;const c=yield r;if(!c)throw n;if(i){const d=Object.keys(i).find(h=>i[h].find(u=>u.toLowerCase()==s));if(d){const h=c.find(u=>u.id===d||u.name===d);if(!h)throw n;return h.id}}const l=c.find(d=>d.extensions.find(h=>h.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(t){return Ca(this,null,function*(){const e=this.editor,n=this._token,{signal:i}=t,r=e.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const h=yield a(d);c.push(...h.items),l=h.totalCount-(d+50),d+=50}while(l>0);return c}catch{return i.throwIfAborted(),void Dt("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit","50"),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),fp({url:l,signal:i,authorization:n.value})}})}}var _a=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class Ry extends R{static get requires(){return["ImageUploadEditing","ImageUploadProgress",je,Cp]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return _a(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;const i=t.plugins.get(je),r=t.plugins.get(Ap);i.createUploadAdapter=c=>new jy(c,t,r);const s=!t.config.get("ckbox.ignoreDataId"),a=t.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{t.model.change(h=>{h.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class jy{constructor(t,e,n){this.loader=t,this.token=n.getToken(),this.ckboxUtils=n,this.editor=e,this.controller=new AbortController,this.serviceOrigin=e.config.get("ckbox.serviceOrigin")}upload(){return _a(this,null,function*(){const t=this.ckboxUtils,e=this.editor.t,n=yield this.loader.file,i=yield t.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",t.getWorkspaceId()),s.append("categoryId",i),s.append("file",n),fp({method:"POST",url:r,data:s,onUploadProgress:a=>{a.lengthComputable&&(this.loader.uploadTotal=a.total,this.loader.uploaded=a.loaded)},signal:this.controller.signal,authorization:this.token.value}).then(a=>_a(this,null,function*(){const c=mp(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=e("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class Cp extends R{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",Ry,Ap]}init(){const t=this.editor;this._shouldBeInitialised()&&(this._checkImagePlugins(),vp()&&t.commands.add("ckbox",new Py(t)))}afterInit(){const t=this.editor;this._shouldBeInitialised()&&(t.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()))}_shouldBeInitialised(){return!!this.editor.config.get("ckbox")||vp()}_checkImagePlugins(){const t=this.editor;t.plugins.has("ImageBlockEditing")||t.plugins.has("ImageInlineEditing")||Dt("ckbox-plugin-image-feature-missing",t)}_initSchema(){const t=this.editor.model.schema;t.extend("$text",{allowAttributes:"ckboxLinkId"}),t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.addAttributeCheck((e,n)=>{if(!e.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const t=this.editor;t.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,i.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(h=>h.name==="a");d&&(r.item.hasAttribute("ckboxLinkId")?a.setAttribute("data-ckbox-resource-id",r.item.getAttribute("ckboxLinkId"),d):a.removeAttribute("data-ckbox-resource-id",d))},{priority:"low"}),n.on("attribute:ckboxLinkId",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,i.name)){if(r.attributeOldValue){const d=_p(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=_p(a,r.attributeNewValue);if(r.item.is("selection")){const h=a.document.selection;a.wrap(h.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),t.conversion.for("upcast").add(n=>{n.on("element:a",(i,r,s)=>{const{writer:a,consumable:c}=s;if(!r.viewItem.getAttribute("href")||!c.consume(r.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const l=r.viewItem.getAttribute("data-ckbox-resource-id");if(l)if(r.modelRange)for(let d of r.modelRange.getItems())d.is("$textProxy")&&(d=d.textNode),Vy(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),t.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),t.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const e=t.commands.get("replaceImageSource");e&&this.listenTo(e,"cleanupImage",(n,[i,r])=>{i.removeAttribute("ckboxImageId",r)})}_initFixers(){const t=this.editor,e=t.model,n=e.document.selection;e.document.registerPostFixer(function(i){return r=>{let s=!1;const a=i.model,c=i.commands.get("ckbox");if(!c)return s;for(const l of a.document.differ.getChanges()){if(l.type!=="insert"&&l.type!=="attribute")continue;const d=l.type==="insert"?new B(l.position,l.position.getShiftedBy(l.length)):l.range,h=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const u of d.getItems()){if(h&&u.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",u),s=!0;continue}const g=Fy(u,c._chosenAssets);for(const p of g){const k=p.type==="image"?"ckboxImageId":"ckboxLinkId";p.id!==u.getAttribute(k)&&(r.setAttribute(k,p.id,u),s=!0)}}}return s}}(t)),e.document.registerPostFixer(function(i){return r=>!(i.hasAttribute("linkHref")||!i.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function Fy(o,t){const e=o.is("element","imageInline")||o.is("element","imageBlock"),n=o.hasAttribute("linkHref");return[...t].filter(i=>i.type==="image"&&e?i.attributes.imageFallbackUrl===o.getAttribute("src"):i.type==="link"&&n?i.attributes.linkHref===o.getAttribute("linkHref"):void 0)}function _p(o,t){const e=o.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return o.setCustomProperty("link",!0,e),e}function Vy(o){return!!o.is("$text")||!(!o.is("element","imageInline")&&!o.is("element","imageBlock"))}function vp(){return!!window.CKBox}var yp=N(1866),Hy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(yp.A,Hy),yp.A.locals;class Uy extends R{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t;if(e.add("ckfinder",i=>{const r=t.commands.get("ckfinder"),s=new wt(i);return s.set({label:n("Insert image or file"),icon:ot.browseFiles,tooltip:!0}),s.bind("isEnabled").to(r),s.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),s}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"assetManager",observable:()=>t.commands.get("ckfinder"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=ot.imageAssetManager,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=ot.imageAssetManager,r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}class qy extends st{constructor(t){super(t),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if(e!="popup"&&e!="modal")throw new _("ckfinder-unknown-openermethod",t);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=t.locale.uiLanguage),n.onInit=r=>{i&&i(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(h=>!h.isImage()),l=a.filter(h=>h.isImage());for(const h of c)t.execute("link",h.getUrl());const d=[];for(const h of l){const u=h.getUrl();d.push(u||r.request("file:getProxyUrl",{file:h}))}d.length&&xp(t,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)xp(t,[a]);else{const c=t.plugins.get("Notification"),l=t.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](n)}}function xp(o,t){if(o.commands.get("insertImage").isEnabled)o.execute("insertImage",{source:t});else{const e=o.plugins.get("Notification"),n=o.locale.t;e.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class Gy extends R{static get pluginName(){return"CKFinderEditing"}static get requires(){return[ca,"LinkEditing"]}init(){const t=this.editor;if(!t.plugins.has("ImageBlockEditing")&&!t.plugins.has("ImageInlineEditing"))throw new _("ckfinder-missing-image-plugin",t);t.commands.add("ckfinder",new qy(t))}}class Wy extends R{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",je]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),n=e.token,i=e.uploadUrl;if(!n)return;const r=t.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),t.plugins.get(je).createUploadAdapter=s=>new Ky(this._uploadGateway,s)}}class Ky{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then(t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",(e,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class $y extends st{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}refresh(){const t=this.editor.model,e=Wt(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Ep(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document,i=t.selection||n.selection;e.canEditAt(i)&&e.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Ep(a,e.schema)&&r.rename(a,"paragraph")})}}function Ep(o,t){return t.checkChild(o.parent,"paragraph")&&!t.isObject(o)}class Yy extends st{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.canEditAt(i)&&e.change(r=>{if(i=this._findPositionToInsertParagraph(i,r),!i)return;const s=r.createElement("paragraph");n&&e.schema.setAllowedAttributes(s,n,r),e.insertContent(s,i),r.setSelection(s,"in")})}_findPositionToInsertParagraph(t,e){const n=this.editor.model;if(n.schema.checkChild(t,"paragraph"))return t;const i=n.schema.findAllowedParent(t,"paragraph");if(!i)return null;const r=t.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&t.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&t.isAtStart?n.createPositionBefore(r):e.split(t,i).position}}const Dp=class extends R{static get pluginName(){return"Paragraph"}init(){const o=this.editor,t=o.model;o.commands.add("paragraph",new $y(o)),o.commands.add("insertParagraph",new Yy(o)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(e,{writer:n})=>Dp.paragraphLikeElements.has(e.name)?e.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let va=Dp;va.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Qy extends st{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Wt(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Ip(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Ip(a,i,e.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Ip(o,t,e){return e.checkChild(o.parent,t)&&!e.isObject(o)}const Sp="paragraph";class Zy extends R{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[va]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)i.model!=="paragraph"&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Qy(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(i,r)=>{const s=t.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Sp)&&s.childCount===0&&r.writer.rename(s,Sp)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:At.low+1})}}var Tp=N(6269),Jy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Tp.A,Jy),Tp.A.locals;class Xy extends R{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(s){const a=s.t,c={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(l=>{const d=c[l.title];return d&&d!=l.title&&(l.title=d),l})}(t),i=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",s=>{const a={},c=new Be,l=t.commands.get("heading"),d=t.commands.get("paragraph"),h=[l];for(const g of n){const p={type:"button",model:new Lu({label:g.title,class:g.class,role:"menuitemradio",withText:!0})};g.model==="paragraph"?(p.model.bind("isOn").to(d,"value"),p.model.set("commandName","paragraph"),h.push(d)):(p.model.bind("isOn").to(l,"value",k=>k===g.model),p.model.set({commandName:"heading",commandValue:g.model})),c.add(p),a[g.model]=g.title}const u=on(s);return ru(u,c,{ariaLabel:r,role:"menu"}),u.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(h,"isEnabled",(...g)=>g.some(p=>p)),u.buttonView.bind("label").to(l,"value",d,"value",(g,p)=>{const k=g||p&&"paragraph";return typeof k=="boolean"?i:a[k]?a[k]:i}),this.listenTo(u,"execute",g=>{const{commandName:p,commandValue:k}=g.source;t.execute(p,k?{value:k}:void 0),t.editing.view.focus()}),u})}}function Mp(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function Bp(o,t){const e=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>e.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==t?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function ya(o,t){const e=Wt(t.getSelectedBlocks());return!e||o.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function Er(o){return o&&o.endsWith("px")?parseInt(o):null}function Np(o){const t=Er(o.getStyle("width")),e=Er(o.getStyle("height"));return!(!t||!e)}var t2=Object.defineProperty,Pp=Object.getOwnPropertySymbols,e2=Object.prototype.hasOwnProperty,n2=Object.prototype.propertyIsEnumerable,Op=(o,t,e)=>t in o?t2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Lp=(o,t)=>{for(var e in t||(t={}))e2.call(t,e)&&Op(o,e,t[e]);if(Pp)for(var e of Pp(t))n2.call(t,e)&&Op(o,e,t[e]);return o};const o2=/^(image|image-inline)$/;class ce extends R{constructor(){super(...arguments),this._domEmitter=new(Ce())}static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null,i={}){const r=this.editor,s=r.model,a=s.document.selection,c=zp(r,e||a,n);t=Lp(Lp({},Object.fromEntries(a.getAttributes())),t);for(const l in t)s.schema.checkAttribute(c,l)||delete t[l];return s.change(l=>{const{setImageSizes:d=!0}=i,h=l.createElement(c,t);return s.insertObject(h,e,null,{setSelection:"on",findOptimalPosition:e||c=="imageInline"?void 0:"auto"}),h.parent?(d&&this.setImageNaturalSizeAttributes(h),h):null})}setImageNaturalSizeAttributes(t){const e=t.getAttribute("src");e&&(t.getAttribute("width")||t.getAttribute("height")||this.editor.model.change(n=>{const i=new $.window.Image;this._domEmitter.listenTo(i,"load",()=>{t.getAttribute("width")||t.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",i.naturalWidth,t),r.setAttribute("height",i.naturalHeight,t)}),this._domEmitter.stopListening(i,"load")}),i.src=e}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e)return null;const n=t.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=e.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(t){return t.findAncestor({classes:o2})}isImageAllowed(){const t=this.editor.model.document.selection;return function(e,n){if(zp(e,n,null)=="imageBlock"){const r=function(s,a){const c=Bg(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,e.model);if(e.model.schema.checkChild(r,"imageBlock"))return!0}else if(e.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(e){return[...e.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(t)}toImageWidget(t,e,n){return e.setCustomProperty("image",!0,t),pa(t,e,{label:()=>{const i=this.findViewImgElement(t).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Ut(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function zp(o,t,e){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?e||(i==="inline"?"imageInline":i!=="auto"?"imageBlock":t.is("selection")?ya(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class i2 extends st{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",t.newValue,r)})}}class r2 extends R{static get requires(){return[ce]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new i2(this.editor))}}var Rp=N(4062),s2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Rp.A,s2),Rp.A.locals;var jp=N(2722),a2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(jp.A,a2),jp.A.locals;class c2 extends et{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Qt,this.keystrokes=new oe,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),m({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new or(this.locale,ar);return e.label=t("Text alternative"),e}}function Fp(o){const t=o.editing.view,e=se.defaultPositions,n=o.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class l2 extends R{static get requires(){return[gr]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const i=t.commands.get("imageTextAlternative"),r=new wt(n);return r.set({label:e("Change image text alternative"),icon:ot.textAlternative,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(x(c2))(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(t.ui,"update",()=>{n.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=Fp(i);r.updatePosition(s)}}(t):this._hideForm(!0)}),v({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Fp(t)}),n.fieldView.value=n.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Vp extends R{static get requires(){return[r2,l2]}static get pluginName(){return"ImageTextAlternative"}}function Hp(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),c=o.findViewImgElement(a);i.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):i.attributeNewValue&&(s.setAttribute("srcset",i.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${t}`,e)}}function Dr(o,t,e){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=o.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return i=>{i.on(`attribute:${e}:${t}`,n)}}class Up extends $e{observe(t){this.listenTo(t,"load",(e,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(t){this.stopListening(t)}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}var d2=Object.defineProperty,qp=Object.getOwnPropertySymbols,h2=Object.prototype.hasOwnProperty,u2=Object.prototype.propertyIsEnumerable,Gp=(o,t,e)=>t in o?d2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Ir=(o,t)=>{for(var e in t||(t={}))h2.call(t,e)&&Gp(o,e,t[e]);if(qp)for(var e of qp(t))u2.call(t,e)&&Gp(o,e,t[e]);return o};class g2 extends st{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||e==="block"&&Q("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||e==="inline"&&Q("image-inline-plugin-required")}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=Et(t.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);i.insertImage(Ir(Ir({},s),r),l)}else i.insertImage(Ir(Ir({},s),r))})}}class p2 extends st{constructor(t){super(t),this.decorate("cleanupImage")}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=t.isImage(e),this.value=this.isEnabled?e.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(i=>{i.setAttribute("src",t.source,e),this.cleanupImage(i,e),n.setImageNaturalSizeAttributes(e)})}cleanupImage(t,e){t.removeAttribute("srcset",e),t.removeAttribute("sizes",e),t.removeAttribute("sources",e),t.removeAttribute("width",e),t.removeAttribute("height",e),t.removeAttribute("alt",e)}}class xa extends R{static get requires(){return[ce]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(Up),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new g2(t),i=new p2(t);t.commands.add("insertImage",n),t.commands.add("replaceImageSource",i),t.commands.add("imageInsert",n)}}class Wp extends R{static get requires(){return[ce]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=t==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${t}`,(d,h,u)=>{if(!u.consumable.consume(h.item,d.name))return;const g=u.writer,p=u.mapper.toViewElement(h.item),k=n.findViewImgElement(p);if(h.attributeNewValue!==null?g.setAttribute(c,h.attributeNewValue,k):g.removeAttribute(c,k),h.item.hasAttribute("sources"))return;const b=h.item.hasAttribute("resizedWidth");if(t==="imageInline"&&!b&&!l)return;const A=h.item.getAttribute("width"),E=h.item.getAttribute("height");A&&E&&g.setStyle("aspect-ratio",`${A}/${E}`,k)})}e.conversion.for("upcast").attributeToAttribute({view:{name:i,styles:{width:/.+/}},model:{key:"width",value:s=>Np(s)?Er(s.getStyle("width")):null}}).attributeToAttribute({view:{name:i,key:"width"},model:"width"}).attributeToAttribute({view:{name:i,styles:{height:/.+/}},model:{key:"height",value:s=>Np(s)?Er(s.getStyle("height")):null}}).attributeToAttribute({view:{name:i,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),e.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class Kp extends st{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(t={}){const e=this.editor,n=this.editor.model,i=e.plugins.get("ImageUtils"),r=i.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=t,l=Array.from(n.markers).filter(u=>u.getRange().containsItem(r)),d=i.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const h=a.createRangeOn(d);for(const u of l){const g=u.getRange(),p=g.root.rootName!="$graveyard"?g.getJoined(h,!0):h;a.updateMarker(u,{range:p})}return{oldElement:r,newElement:d}}):null}}var $p=N(7378),m2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()($p.A,m2),$p.A.locals;class Yp extends R{static get requires(){return[ce]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["placeholder"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const t=this.editor,e=t.conversion,n=t.plugins.get("ImageUtils");e.for("editingDowncast").add(i=>{i.on("attribute:placeholder",(r,s,a)=>{if(!a.consumable.test(s.item,r.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;a.consumable.consume(s.item,r.name);const c=a.writer,l=a.mapper.toViewElement(s.item),d=n.findViewImgElement(l);s.attributeNewValue?(c.addClass("image_placeholder",d),c.setStyle("background-image",`url(${s.attributeNewValue})`,d),c.setCustomProperty("editingPipeline:doNotReuseOnce",!0,d)):(c.removeClass("image_placeholder",d),c.removeStyle("background-image",d))})})}_setupLoadListener(){const t=this.editor,e=t.model,n=t.editing,i=n.view,r=t.plugins.get("ImageUtils");i.addObserver(Up),this.listenTo(i.document,"imageLoaded",(s,a)=>{const c=i.domConverter.mapDomToView(a.target);if(!c)return;const l=r.getImageWidgetFromImageView(c);if(!l)return;const d=n.mapper.toModelElement(l);d&&d.hasAttribute("placeholder")&&e.enqueueChange({isUndoable:!1},h=>{h.removeAttribute("placeholder",d)})})}}class Qp extends R{static get requires(){return[xa,Wp,ce,Yp,xe]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new Kp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>Mp(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(Mp(s),s,e("image widget"))}),n.for("downcast").add(Dr(i,"imageBlock","src")).add(Dr(i,"imageBlock","alt")).add(Hp(i,"imageBlock")),n.for("upcast").elementToElement({view:Bp(t,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,c,l)=>{if(!l.consumable.test(c.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(c.viewItem);if(!d||!l.consumable.test(d,{name:!0}))return;l.consumable.consume(c.viewItem,{name:!0,classes:"image"});const h=Wt(l.convertItem(d,c.modelCursor).modelRange.getItems());h?(l.convertChildren(c.viewItem,h),l.updateConversionResult(h,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isInlineImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(ya(e.schema,d)==="imageBlock"){const h=new nn(n.document),u=c.map(g=>h.createElement("figure",{class:"image"},g));a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&i.setImageNaturalSizeAttributes(d)})})}}var Zp=N(3350),f2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Zp.A,f2),Zp.A.locals;class k2 extends et{constructor(t,e=[]){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve,this.children=this.createCollection(),this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of e)this.children.add(n),this._focusables.add(n),n instanceof o_&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)b2(n)&&(n.focusCycler.on("forwardCycle",i=>{this._focusCycler.focusNext(),i.stop()}),n.focusCycler.on("backwardCycle",i=>{this._focusCycler.focusPrevious(),i.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),m({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function b2(o){return"focusCycler"in o}class Jp extends R{constructor(t){super(t),this._integrations=new Map,t.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[ce]}init(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(t.model.document,"change",()=>{this.isImageSelected=n.isImage(e.getSelectedElement())});const i=r=>this._createToolbarComponent(r);t.ui.componentFactory.add("insertImage",i),t.ui.componentFactory.add("imageInsert",i)}registerIntegration({name:t,observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:r}){this._integrations.has(t)&&Q("image-insert-integration-exists",{name:t}),this._integrations.set(t,{observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:!!r})}_createToolbarComponent(t){const e=this.editor,n=t.t,i=this._prepareIntegrations();if(!i.length)return null;let r;const s=i[0];if(i.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new sr(t,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=on(t,r),c=i.map(({observable:l})=>typeof l=="function"?l():l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=i.map(({formViewCreator:h})=>h(i.length==1)),d=new k2(e.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),e=[];if(!t.length)return Q("image-insert-integrations-not-specified"),e;for(const n of t)this._integrations.has(n)?e.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||Q("image-insert-unknown-integration",{item:n});return e.length||Q("image-insert-integrations-not-registered"),e}}var Xp=N(265),w2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Xp.A,w2),Xp.A.locals;class A2 extends R{static get requires(){return[Qp,di,Vp,Jp]}static get pluginName(){return"ImageBlock"}}class C2 extends R{static get requires(){return[xa,Wp,ce,Yp,xe]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),e.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new Kp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,e("image widget"))}),n.for("downcast").add(Dr(i,"imageInline","src")).add(Dr(i,"imageInline","alt")).add(Hp(i,"imageInline")),n.for("upcast").elementToElement({view:Bp(t,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isBlockImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(ya(e.schema,d)==="imageInline"){const h=new nn(n.document),u=c.map(g=>g.childCount===1?(Array.from(g.getAttributes()).forEach(p=>h.setAttribute(...p,i.findViewImgElement(g))),g.getChild(0)):g);a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&i.setImageNaturalSizeAttributes(d)})})}}class _2 extends R{static get requires(){return[C2,di,Vp,Jp]}static get pluginName(){return"ImageInline"}}class tm extends R{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[ce]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),n=t.getFirstPosition().findAncestor("caption");return n&&e.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return t.name=="figcaption"&&e.isBlockImageView(t.parent)?{name:!0}:null}}class v2 extends st{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils"),n=t.plugins.get("ImageUtils");if(!t.plugins.has(Qp))return this.isEnabled=!1,void(this.value=!1);const i=t.model.document.selection,r=i.getSelectedElement();if(!r){const s=e.getCaptionFromModelSelection(i);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(r):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,e)})}_showImageCaption(t,e){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=i._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||t.createElement("caption");t.append(c,s),e&&t.setSelection(c,"in")}_hideImageCaption(t){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageCaptionEditing"),r=e.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),i._saveCaption(a,s),t.setSelection(a,"on"),t.remove(s)}}class y2 extends R{constructor(t){super(t),this._savedCaptionsMap=new WeakMap}static get requires(){return[ce,tm]}static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.model.schema;e.isRegistered("caption")?e.extend("caption",{allowIn:"imageBlock"}):e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),t.commands.add("toggleImageCaption",new v2(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils"),r=t.t;t.conversion.for("upcast").elementToElement({view:s=>i.matchImageCaptionViewElement(s),model:"caption"}),t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>{if(!n.isBlockImage(s.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),c.placeholder=r("Enter image caption"),Cl({view:e,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return Mg(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.plugins.get("ImageCaptionUtils"),i=t.commands.get("imageTypeInline"),r=t.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(e.isBlockImage(c)){const h=n.getCaptionFromImageModelElement(c);if(h)return void this._saveCaption(l,h)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};i&&this.listenTo(i,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?Ct.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor,e=t.model,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",()=>{const r=e.document.differ.getChanges();for(const s of r){if(s.attributeKey!=="alt")continue;const a=s.range.start.nodeAfter;if(n.isBlockImage(a)){const c=i.getCaptionFromImageModelElement(a);if(!c)return;t.editing.reconvertItem(c)}}})}}class x2 extends R{static get requires(){return[tm]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),i=t.t;t.ui.componentFactory.add("toggleImageCaption",r=>{const s=t.commands.get("toggleImageCaption"),a=new wt(r);return a.set({icon:ot.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>i(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(t.model.document.selection);if(c){const l=t.editing.mapper.toViewElement(c);e.scrollToTheSelection(),e.change(d=>{d.addClass("image__caption_highlighted",l)})}t.editing.view.focus()}),a})}}var em=N(5247),E2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(em.A,E2),em.A.locals;function nm(o){const t=o.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function D2(o){return new Promise((t,e)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=om(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});t(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=$.document.createElement("img");l.addEventListener("load",()=>{const d=$.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(h=>h?a(h):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=om(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(t).catch(e):e(i))})}function om(o,t){return o.type?o.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class I2 extends R{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,n=i=>{const r=new ay(i),s=t.commands.get("uploadImage"),a=t.config.get("image.upload.types"),c=nm(a);return r.set({acceptedType:a.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:e("Upload image from computer"),icon:ot.imageUpload,tooltip:!0}),r.bind("isEnabled").to(s),r.on("done",(l,d)=>{const h=Array.from(d).filter(u=>c.test(u.type));h.length&&(t.execute("uploadImage",{file:h}),t.editing.view.focus())}),r};if(t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"upload",observable:()=>t.commands.get("uploadImage"),buttonViewCreator:()=>{const r=t.ui.componentFactory.create("uploadImage");return r.bind("label").to(i,"isImageSelected",s=>e(s?"Replace image from computer":"Upload image from computer")),r},formViewCreator:()=>{const r=t.ui.componentFactory.create("uploadImage");return r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>e(s?"Replace from computer":"Upload from computer")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}var im=N(2267),S2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(im.A,S2),im.A.locals;var rm=N(7693),T2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(rm.A,T2),rm.A.locals;var sm=N(1559),M2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(sm.A,M2),sm.A.locals;class B2 extends R{constructor(t){super(t),this.uploadStatusChange=(e,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,e.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(je),d=a?n.attributeNewValue:null,h=this.placeholder,u=r.editing.mapper.toViewElement(s),g=i.writer;if(d=="reading")return am(u,g),void cm(c,h,u,g);if(d=="uploading"){const p=l.loaders.get(a);return am(u,g),void(p?(lm(u,g),function(k,b,A,E){const M=function(z){const G=z.createUIElement("div",{class:"ck-progress-bar"});return z.setCustomProperty("progressBar",!0,G),G}(b);b.insert(b.createPositionAt(k,"end"),M),A.on("change:uploadedPercent",(z,G,tt)=>{E.change(at=>{at.setStyle("width",tt+"%",M)})})}(u,g,p,r.editing.view),function(k,b,A,E){if(E.data){const M=k.findViewImgElement(b);A.setAttribute("src",E.data,M)}}(c,u,g,p)):cm(c,h,u,g))}d=="complete"&&l.loaders.get(a)&&function(p,k,b){const A=k.createUIElement("div",{class:"ck-image-upload-complete-icon"});k.insert(k.createPositionAt(p,"end"),A),setTimeout(()=>{b.change(E=>E.remove(E.createRangeOn(A)))},3e3)}(u,g,r.editing.view),function(p,k){hm(p,k,"progressBar")}(u,g),lm(u,g),function(p,k){k.removeClass("ck-appear",p)}(u,g)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),t.plugins.has("ImageInlineEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function am(o,t){o.hasClass("ck-appear")||t.addClass("ck-appear",o)}function cm(o,t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const i=o.findViewImgElement(e);i.getAttribute("src")!==t&&n.setAttribute("src",t,i),dm(e,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function lm(o,t){o.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",o),hm(o,t,"placeholder")}function dm(o,t){for(const e of o.getChildren())if(e.getCustomProperty(t))return e}function hm(o,t,e){const n=dm(o,e);n&&t.remove(t.createRangeOn(n))}var N2=Object.defineProperty,P2=Object.defineProperties,O2=Object.getOwnPropertyDescriptors,um=Object.getOwnPropertySymbols,L2=Object.prototype.hasOwnProperty,z2=Object.prototype.propertyIsEnumerable,gm=(o,t,e)=>t in o?N2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class R2 extends st{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=Et(t.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(t,e,n){const i=this.editor,r=i.plugins.get(je).createLoader(t),s=i.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var h in d||(d={}))L2.call(d,h)&&gm(l,h,d[h]);if(um)for(var h of um(d))z2.call(d,h)&&gm(l,h,d[h]);return l})({},e),c={uploadId:r.id},P2(a,O2(c))),n)}}class j2 extends R{constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[je,ca,xe,ce]}static get pluginName(){return"ImageUploadEditing"}init(){const t=this.editor,e=t.model.document,n=t.conversion,i=t.plugins.get(je),r=t.plugins.get("ImageUtils"),s=t.plugins.get("ClipboardPipeline"),a=nm(t.config.get("image.upload.types")),c=new R2(t);t.commands.add("uploadImage",c),t.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(l,d)=>{if(h=d.dataTransfer,Array.from(h.types).includes("text/html")&&h.getData("text/html")!=="")return;var h;const u=Array.from(d.dataTransfer.files).filter(g=>!!g&&a.test(g.type));u.length&&(l.stop(),t.model.change(g=>{d.targetRanges&&g.setSelection(d.targetRanges.map(p=>t.editing.mapper.toModelRange(p))),t.execute("uploadImage",{file:u})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const h=Array.from(t.editing.view.createRangeIn(d.content)).map(g=>g.item).filter(g=>function(p,k){return!(!p.isInlineImageView(k)||!k.getAttribute("src")||!k.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!k.getAttribute("src").match(/^blob:/g))}(r,g)&&!g.getAttribute("uploadProcessed")).map(g=>({promise:D2(g),imageElement:g}));if(!h.length)return;const u=new nn(t.editing.view.document);for(const g of h){u.setAttribute("uploadProcessed",!0,g.imageElement);const p=i.createLoader(g.promise);p&&(u.setAttribute("src","",g.imageElement),u.setAttribute("uploadId",p.id,g.imageElement))}}),t.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),e.on("change",()=>{const l=e.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const h of l)if(h.type=="insert"&&h.name!="$text"){const u=h.position.nodeAfter,g=h.position.root.rootName=="$graveyard";for(const p of F2(t,u)){const k=p.getAttribute("uploadId");if(!k)continue;const b=i.loaders.get(k);b&&(g?d.has(k)||b.abort():(d.add(k),this._uploadImageElements.set(k,p),b.status=="idle"&&this._readAndUpload(b)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:h})=>{const u=h.urls?h.urls:h;this.editor.model.change(g=>{g.setAttribute("src",u.default,d),this._parseAndSetSrcsetAttributeOnImage(u,d,g),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(t){const e=this.editor,n=e.model,i=e.locale.t,r=e.plugins.get(je),s=e.plugins.get(ca),a=e.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(t.id))}),t.read().then(()=>{const d=t.upload(),h=c.get(t.id);if(f.isSafari){const u=e.editing.mapper.toViewElement(h),g=a.findViewImgElement(u);e.editing.view.once("render",()=>{if(!g.parent)return;const p=e.editing.view.domConverter.mapViewToDom(g.parent);if(!p)return;const k=p.style.display;p.style.display="none",p._ckHack=p.offsetHeight,p.style.display=k})}return n.enqueueChange({isUndoable:!1},u=>{u.setAttribute("uploadStatus","uploading",h)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},h=>{const u=c.get(t.id);h.setAttribute("uploadStatus","complete",u),this.fire("uploadComplete",{data:d,imageElement:u})}),l()}).catch(d=>{if(t.status!=="error"&&t.status!=="aborted")throw d;t.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},h=>{h.remove(c.get(t.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const h=c.get(t.id);d.removeAttribute("uploadId",h),d.removeAttribute("uploadStatus",h),c.delete(t.id)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const r=Object.keys(t).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${t[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};e.hasAttribute("width")||e.hasAttribute("height")||(s.width=i),n.setAttributes(s,e)}}}function F2(o,t){const e=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(t)).filter(n=>e.isImage(n.item)).map(n=>n.item)}var pm=N(3469),V2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(pm.A,V2),pm.A.locals;class H2 extends st{constructor(t,e){super(t),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(e.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled?t.hasAttribute("imageStyle")?this.value=t.getAttribute("imageStyle"):this.value=this._defaultStyles[t.name]:this.value=!1}execute(t={}){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils");n.change(r=>{const s=t.value,{setImageSizes:a=!0}=t;let c=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(i.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&i.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(t,e){return!this._styles.get(t).modelElements.includes(e.name)}}var U2=Object.defineProperty,mm=Object.getOwnPropertySymbols,q2=Object.prototype.hasOwnProperty,G2=Object.prototype.propertyIsEnumerable,fm=(o,t,e)=>t in o?U2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,km=(o,t)=>{for(var e in t||(t={}))q2.call(t,e)&&fm(o,e,t[e]);if(mm)for(var e of mm(t))G2.call(t,e)&&fm(o,e,t[e]);return o};const{objectFullWidth:W2,objectInline:bm,objectLeft:wm,objectRight:Ea,objectCenter:Da,objectBlockLeft:Am,objectBlockRight:Cm}=ot,Sr={get inline(){return{name:"inline",title:"In line",icon:bm,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:wm,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Am,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Da,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Ea,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Cm,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Da,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Ea,modelElements:["imageBlock"],className:"image-style-side"}}},_m={full:W2,left:Am,right:Cm,center:Da,inlineLeft:wm,inlineRight:Ea,inline:bm},vm=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function ym(o){Q("image-style-configuration-definition-invalid",o)}const Ia={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(t=>function(e){return e=typeof e=="string"?Sr[e]?km({},Sr[e]):{name:e}:function(n,i){const r=km({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(Sr[e.name],e),typeof e.icon=="string"&&(e.icon=_m[e.icon]||e.icon),e}(t)).filter(t=>function(e,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=e;if(!(r&&r.length&&s))return ym({style:e}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(c=>a.includes(c)))return Q("image-style-missing-dependency",{style:e,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(t,o))},getDefaultStylesConfiguration:function(o,t){return o&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...vm]:[]},warnInvalidStyle:ym,DEFAULT_OPTIONS:Sr,DEFAULT_ICONS:_m,DEFAULT_DROPDOWN_DEFINITIONS:vm};function xm(o,t){for(const e of t)if(e.name===o)return e}class Em extends R{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[ce]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=Ia,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,r)),this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new H2(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const h=xm(l.attributeNewValue,s),u=xm(l.attributeOldValue,s),g=d.mapper.toViewElement(l.item),p=d.writer;u&&p.removeClass(u.className,g),h&&p.addClass(h.className,g)});var s;const a=function(c){const l={imageInline:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,h,u)=>{if(!h.modelRange)return;const g=h.viewItem,p=Wt(h.modelRange.getItems());if(p&&u.schema.checkAttribute(p,"imageStyle"))for(const k of l[p.name])u.consumable.consume(g,{classes:k.className})&&u.writer.setAttribute("imageStyle",k.name,p)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),t&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),e&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const t=this.editor,e=t.model.document,n=t.plugins.get(ce),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));e.registerPostFixer(r=>{let s=!1;for(const a of e.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let c=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!n.isImage(c))continue;const l=c.getAttribute("imageStyle");if(!l)continue;const d=i.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Dm=N(6386),K2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Dm.A,K2),Dm.A.locals;class $2 extends R{static get requires(){return[Em]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],n=Im(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Im([...e.filter(bt),...Ia.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,i=>{let r;const{defaultItem:s,items:a,title:c}=t,l=a.filter(g=>e.find(({name:p})=>Sm(p)===g)).map(g=>{const p=n.create(g);return g===s&&(r=p),p});a.length!==l.length&&Ia.warnInvalidStyle({dropdown:t});const d=on(i,sr),h=d.buttonView,u=h.arrowView;return oa(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:Tm(c,r.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:c}),h.bind("icon").toMany(l,"isOn",(...g)=>{const p=g.findIndex(gn);return p<0?r.icon:l[p].icon}),h.bind("label").toMany(l,"isOn",(...g)=>{const p=g.findIndex(gn);return Tm(c,p<0?r.label:l[p].label)}),h.bind("isOn").toMany(l,"isOn",(...g)=>g.some(gn)),h.bind("class").toMany(l,"isOn",(...g)=>g.some(gn)?"ck-splitbutton_flatten":void 0),h.on("execute",()=>{l.some(({isOn:g})=>g)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...g)=>g.some(gn)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(Sm(e),n=>{const i=this.editor.commands.get("imageStyle"),r=new wt(n);return r.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===e),r.on("execute",this._executeCommand.bind(this,e)),r})}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function Im(o,t){for(const e of o)t[e.title]&&(e.title=t[e.title]);return o}function Sm(o){return`imageStyle:${o}`}function Tm(o,t){return(o?o+": ":"")+t}class Y2 extends R{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new ml(t)),t.commands.add("outdent",new ml(t))}}class Q2 extends R{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?ot.indent:ot.outdent,r=e.uiLanguageDirection=="ltr"?ot.outdent:ot.indent;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,r=>{const s=i.commands.get(t),a=new wt(r);return a.set({label:e,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(t),i.editing.view.focus()}),a})}}class Z2{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(e=>this._definitions.add(e)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(e,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const c=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,c);for(const l in a.styles)r.setStyle(l,a.styles[l],c);r.setCustomProperty("link",!0,c),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),c):r.wrap(i.mapper.toViewRange(n.range),c):r.unwrap(i.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",(e,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(c=>c.is("element","a"));for(const c of this._definitions){const l=We(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,h]of l)d==="class"?i.addClass(h,a):i.setAttribute(d,h,a);c.classes&&i.addClass(c.classes,a);for(const d in c.styles)i.setStyle(d,c.styles[d],a)}else{for(const[d,h]of l)d==="class"?i.removeClass(h,a):i.removeAttribute(d,a);c.classes&&i.removeClass(c.classes,a);for(const d in c.styles)i.removeStyle(d,a)}}})}}}const J2=function(o,t,e){var n=o.length;return e=e===void 0?n:e,!t&&e>=n?o:Dl(o,t,e)};var X2=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Mm=function(o){return X2.test(o)},tx=function(o){return o.split("")};var Bm="\\ud800-\\udfff",ex="["+Bm+"]",Sa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ta="\\ud83c[\\udffb-\\udfff]",Nm="[^"+Bm+"]",Pm="(?:\\ud83c[\\udde6-\\uddff]){2}",Om="[\\ud800-\\udbff][\\udc00-\\udfff]",Lm="(?:"+Sa+"|"+Ta+")?",zm="[\\ufe0e\\ufe0f]?",nx=zm+Lm+("(?:\\u200d(?:"+[Nm,Pm,Om].join("|")+")"+zm+Lm+")*"),ox="(?:"+[Nm+Sa+"?",Sa,Pm,Om,ex].join("|")+")",ix=RegExp(Ta+"(?="+Ta+")|"+ox+nx,"g");const rx=function(o){return o.match(ix)||[]},sx=function(o){return Mm(o)?rx(o):tx(o)},ax=function(o){return function(t){t=ws(t);var e=Mm(t)?sx(t):void 0,n=e?e[0]:t.charAt(0),i=e?J2(e,1).join(""):t.slice(1);return n[o]()+i}}("toUpperCase"),cx=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,lx=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,dx=/^((\w+:(\/{2,})?)|(\W))/i,hx=["https?","ftps?","mailto"],Tr="Ctrl+K";function Rm(o,{writer:t}){const e=t.createAttributeElement("a",{href:o},{priority:5});return t.setCustomProperty("link",!0,e),e}function jm(o,t=hx){const e=String(o),n=t.join("|");return function(i,r){return!!i.replace(cx,"").match(r)}(e,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?e:"#"}function Ma(o,t){return!!o&&t.checkAttribute(o.name,"linkHref")}function Ba(o,t){const e=(n=o,lx.test(n)?"mailto:":t);var n;const i=!!e&&!Fm(o);return o&&i?e+o:o}function Fm(o){return dx.test(o)}function Vm(o){window.open(o,"_blank","noopener")}class ux extends st{constructor(){super(...arguments),this.manualDecorators=new Be,this.automaticDecorators=new Z2}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||Wt(e.getSelectedBlocks());Ma(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in e)e[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const c=i.getFirstPosition();if(i.hasAttribute("linkHref")){const l=Hm(i);let d=br(c,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,t)),a.setAttribute("linkHref",t,d),r.forEach(h=>{a.setAttribute(h,!0,d)}),s.forEach(h=>{a.removeAttribute(h,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(t!==""){const l=We(i.getAttributes());l.set("linkHref",t),r.forEach(h=>{l.set(h,!0)});const{end:d}=n.insertContent(a.createText(t,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(i.getRanges(),"linkHref"),l=[];for(const h of i.getSelectedBlocks())n.schema.checkAttribute(h,"linkHref")&&l.push(a.createRangeOn(h));const d=l.slice();for(const h of c)this._isRangeToUpdate(h,l)&&d.push(h);for(const h of d){let u=h;if(d.length===1){const g=Hm(i);i.getAttribute("linkHref")===g&&(u=this._updateLinkContent(n,a,h,t),a.setSelection(a.createSelection(u)))}a.setAttribute("linkHref",t,u),r.forEach(g=>{a.setAttribute(g,!0,u)}),s.forEach(g=>{a.removeAttribute(g,u)})}}})}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return Ma(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}_updateLinkContent(t,e,n,i){const r=e.createText(i,{linkHref:i});return t.insertContent(r,n)}}function Hm(o){if(o.isCollapsed){const t=o.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(o.getFirstRange().getItems());if(t.length>1)return null;const e=t[0];return e.is("$text")||e.is("$textProxy")?e.data:null}}class gx extends st{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();Ma(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change(r=>{const s=n.isCollapsed?[br(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const c of i.manualDecorators)r.removeAttribute(c.id,a)})}}class px extends ft(){constructor({id:t,label:e,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=t,this.set("value",void 0),this.defaultValue=s,this.label=e,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var Um=N(7719),mx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Um.A,mx),Um.A.locals;var fx=Object.defineProperty,qm=Object.getOwnPropertySymbols,kx=Object.prototype.hasOwnProperty,bx=Object.prototype.propertyIsEnumerable,Gm=(o,t,e)=>t in o?fx(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,wx=(o,t)=>{for(var e in t||(t={}))kx.call(t,e)&&Gm(o,e,t[e]);if(qm)for(var e of qm(t))bx.call(t,e)&&Gm(o,e,t[e]);return o};const Wm="automatic",Ax=/^(https?:)?\/\//;class Km extends R{static get pluginName(){return"LinkEditing"}static get requires(){return[Ag,gg,xe]}constructor(t){super(t),t.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const t=this.editor,e=this.editor.config.get("link.allowedProtocols");t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Rm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(i,r)=>Rm(jm(i,e),r)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:i=>i.getAttribute("href")}}),t.commands.add("link",new ux(t)),t.commands.add("unlink",new gx(t));const n=function(i,r){const s={"Open in a new tab":i("Open in a new tab"),Downloadable:i("Downloadable")};return r.forEach(a=>("label"in a&&s[a.label]&&(a.label=s[a.label]),a)),r}(t.t,function(i){const r=[];if(i)for(const[s,a]of Object.entries(i)){const c=Object.assign({},a,{id:`link${ax(s)}`});r.push(c)}return r}(t.config.get("link.decorators")));this._enableAutomaticDecorators(n.filter(i=>i.mode===Wm)),this._enableManualDecorators(n.filter(i=>i.mode==="manual")),t.plugins.get(Ag).registerAttribute("linkHref"),function(i,r,s,a){const c=i.editing.view,l=new Set;c.document.registerPostFixer(d=>{const h=i.model.document.selection;let u=!1;if(h.hasAttribute(r)){const g=br(h.getFirstPosition(),r,h.getAttribute(r),i.model),p=i.editing.mapper.toViewRange(g);for(const k of p.getItems())k.is("element",s)&&!k.hasClass(a)&&(d.addClass(a,k),l.add(k),u=!0)}return u}),i.conversion.for("editingDowncast").add(d=>{function h(){c.change(u=>{for(const g of l.values())u.removeClass(a,g),l.delete(g)})}d.on("insert",h,{priority:"highest"}),d.on("remove",h,{priority:"highest"}),d.on("attribute",h,{priority:"highest"}),d.on("selection",h,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:Wm,callback:i=>!!i&&Ax.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(i=>{e.model.schema.extend("$text",{allowAttributes:i.id});const r=new px(i);n.add(r),e.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:c},{item:l})=>{if((l.is("selection")||c.isInline(l))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const h in r.styles)a.setStyle(h,r.styles[h],d);return a.setCustomProperty("link",!0,d),d}}}),e.conversion.for("upcast").elementToAttribute({view:wx({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(n,i)=>{if(!(f.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),Vm(s))},{context:"$capture"}),this.listenTo(e,"keydown",(n,i)=>{const r=t.commands.get("link").value;r&&i.keyCode===ut.enter&&i.altKey&&(n.stop(),Vm(r))})}_enableSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(e,"change:attribute",(n,{attributeKeys:i})=>{i.includes("linkHref")&&!e.hasAttribute("linkHref")&&t.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=t.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const t=this.editor,e=t.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{e.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=Ba(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var $m=N(3817),Cx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()($m.A,Cx),$m.A.locals;class _x extends et{constructor(t,e){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve;const n=t.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),m({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new or(this.locale,ar);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new nr(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const n=new et;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(n)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var Ym=N(8762),vx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ym.A,vx),Ym.A.locals;class yx extends et{constructor(t,e={}){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve;const n=t.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),ot.pencil,"edit"),this.set("href",void 0),this._linkConfig=e,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new wt(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new wt(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",i=>i&&jm(i,this._linkConfig.allowedProtocols)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",i=>i||n("This link has no URL")),t.bind("isEnabled").to(this,"href",i=>!!i),t.template.tag="a",t.template.eventListeners={},t}}const Qe="link-ui";class xx extends R{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[gr]}static get pluginName(){return"LinkUI"}init(){const t=this.editor,e=this.editor.t;t.editing.view.addObserver(BC),this._balloon=t.plugins.get(gr),this._createToolbarLinkButton(),this._enableBalloonActivators(),t.conversion.for("editingDowncast").markerToHighlight({model:Qe,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Qe,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Create link"),keystroke:Tr},{label:e("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new yx(t.locale,t.config.get("link")),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),e.keystrokes.set(Tr,(r,s)=>{this._addFormView(),s()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=t.config.get("link.allowCreatingEmptyLinks"),r=new(x(_x))(t.locale,e);return r.urlInputView.fieldView.bind("value").to(e,"value"),r.urlInputView.bind("isEnabled").to(e,"isEnabled"),r.saveButtonView.bind("isEnabled").to(e,"isEnabled",r.urlInputView,"isEmpty",(s,a)=>s&&(i||!a)),this.listenTo(r,"submit",()=>{const{value:s}=r.urlInputView.fieldView.element,a=Ba(s,n);t.execute("link",a,r.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(r,"cancel",()=>{this._closeFormView()}),r.keystrokes.set("Esc",(s,a)=>{this._closeFormView(),a()}),r}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.ui.componentFactory.add("link",i=>{const r=new wt(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=Tr,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(e,"isEnabled"),r.bind("isOn").to(e,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),t.keystrokes.set(Tr,(n,i)=>{i(),t.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),v({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=t.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),t.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=c};function s(){return e.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(t.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return!!this.formView&&t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i;if(e.markers.has(Qe)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Qe)),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));i=t.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?t.domConverter.mapViewToDom(r):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&Ut(n))return Na(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),r=Na(i.start),s=Na(i.end);return r&&r==s&&t.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(Qe))e.updateMarker(Qe,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!t.schema.isContent(r),{boundaries:n});e.addMarker(Qe,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(Qe,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Qe)&&t.change(e=>{e.removeMarker(Qe)})}}function Na(o){return o.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})||null}const Qm=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Ex extends R{static get requires(){return[sn,Km]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(t,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?br(e,"linkHref",e.textNode.getAttribute("linkHref"),t):null}_selectEntireLinks(t,e){const n=this.editor.model,i=n.document.selection,r=i.getFirstPosition(),s=i.getLastPosition();let a=e.getJoined(this._expandLinkRange(n,r)||e);a&&(a=a.getJoined(this._expandLinkRange(n,s)||e)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&t.setSelection(a)}_enablePasteLinking(){const t=this.editor,e=t.model,n=e.document.selection,i=t.plugins.get("ClipboardPipeline"),r=t.commands.get("link");i.on("inputTransformation",(s,a)=>{if(!this.isEnabled||!r.isEnabled||n.isCollapsed||a.method!=="paste"||n.rangeCount>1)return;const c=n.getFirstRange(),l=a.dataTransfer.getData("text/plain");if(!l)return;const d=l.match(Qm);d&&d[2]===l&&(e.change(h=>{this._selectEntireLinks(h,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const t=this.editor,e=new wg(t.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Zm(n.substr(0,n.length-1));return i?{url:i}:void 0});e.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=t.model.createRange(l,c);this._applyAutoLink(a,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=e.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition(),r=e.createRange(e.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=bg(t,e),r=Zm(n);if(r){const s=e.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(t,e){const n=this.editor.model,i=Ba(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(e,n)&&Fm(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",t,e),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Zm(o){const t=Qm.exec(o);return t?t[2]:null}var Jm=N(4808),Dx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Jm.A,Dx),Jm.A.locals;class De{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=Et(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){return Wt(new this(t,e)[Symbol.iterator]())}*[Symbol.iterator](){const t=[];for(const{node:e}of gi(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(i=>e.getAttribute(i)!==this._startElement.getAttribute(i)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*gi(o,t="forward"){const e=t=="forward",n=[];let i=null;for(;$t(o);){let r=null;if(i){const s=o.getAttribute("listIndent"),a=i.getAttribute("listIndent");s>a?n[a]=i:st in o?Sx(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Pa=(o,t)=>{for(var e in t||(t={}))Bx.call(t,e)&&tf(o,e,t[e]);if(Xm)for(var e of Xm(t))Nx.call(t,e)&&tf(o,e,t[e]);return o},Oa=(o,t)=>Tx(o,Mx(t));class Ao{static next(){return X()}}function $t(o){return!!o&&o.is("element")&&o.hasAttribute("listItemId")}function La(o,t={}){return[...Cn(o,Oa(Pa({},t),{direction:"backward"})),...Cn(o,Oa(Pa({},t),{direction:"forward"}))]}function Cn(o,t={}){const e=t.direction=="forward",n=Array.from(new De(o,Oa(Pa({},t),{includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"})));return e?n:n.reverse()}function ef(o){const t=new De(o,{sameIndent:!0,sameAttributes:"listType"}),e=new De(o,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(t).reverse(),...e]}function Hn(o){return!De.first(o,{sameIndent:!0,sameAttributes:"listItemId"})}function nf(o){return!De.first(o,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function pi(o,t={}){o=Et(o);const e=t.withNested!==!1,n=new Set;for(const i of o)for(const r of La(i,{higherIndent:e}))n.add(r);return Un(n)}function Px(o){o=Et(o);const t=new Set;for(const e of o)for(const n of ef(e))t.add(n);return Un(t)}function za(o,t){const e=Cn(o,{direction:"forward"}),n=Ao.next();for(const i of e)t.setAttribute("listItemId",n,i);return e}function Ra(o,t,e){const n={};for(const[r,s]of t.getAttributes())r.startsWith("list")&&(n[r]=s);const i=Cn(o,{direction:"forward"});for(const r of i)e.setAttributes(n,r);return i}function ja(o,t,{expand:e,indentBy:n=1}={}){o=Et(o);const i=e?pi(o):o;for(const r of i){const s=r.getAttribute("listIndent")+n;s<0?Mr(r,t):t.setAttribute("listIndent",s,r)}return i}function Mr(o,t){o=Et(o);for(const e of o)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of o)for(const n of e.getAttributeKeys())n.startsWith("list")&&t.removeAttribute(n,e);return o}function mi(o){if(!o.length)return!1;const t=o[0].getAttribute("listItemId");return!!t&&!o.some(e=>e.getAttribute("listItemId")!=t)}function Un(o){return Array.from(o).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function fi(o){const t=o.document.selection.getSelectedElement();return t&&o.schema.isObject(t)&&o.schema.isBlock(t)?t:null}function Fa(o,t){return t.checkChild(o.parent,"listItem")&&t.checkChild(o,"$text")&&!t.isObject(o)}function Ox(o,t,e){return Cn(t,{direction:"forward"}).pop().index>o.index?Ra(o,t,e):[]}class of extends st{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=rf(t.document.selection);t.change(n=>{const i=[];mi(e)&&!Hn(e[0])?(this._direction=="forward"&&i.push(...ja(e,n)),i.push(...za(e[0],n))):this._direction=="forward"?i.push(...ja(e,n,{expand:!0})):i.push(...function(r,s){const a=pi(r=Et(r)),c=new Set,l=Math.min(...a.map(h=>h.getAttribute("listIndent"))),d=new Map;for(const h of a)d.set(h,De.first(h,{lowerIndent:!0}));for(const h of a){if(c.has(h))continue;c.add(h);const u=h.getAttribute("listIndent")-1;if(u<0)Mr(h,s);else{if(h.getAttribute("listIndent")==l){const g=Ox(h,d.get(h),s);for(const p of g)c.add(p);if(g.length)continue}s.setAttribute("listIndent",u,h)}}return Un(c)}(e,n));for(const r of i){if(!r.hasAttribute("listType"))continue;const s=De.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",Un(new Set(t)))}_checkEnabled(){let t=rf(this.editor.model.document.selection),e=t[0];if(!e)return!1;if(this._direction=="backward"||mi(t)&&!Hn(t[0]))return!0;t=pi(t),e=t[0];const n=De.first(e,{sameIndent:!0});return!!n&&n.getAttribute("listType")==e.getAttribute("listType")}}function rf(o){const t=Array.from(o.getSelectedBlocks()),e=t.findIndex(n=>!$t(n));return e!=-1&&(t.length=e),t}class sf extends st{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=fi(e),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>e.schema.checkAttribute(a,"listType")||Fa(a,e.schema)),s=t.forceValue!==void 0?!t.forceValue:this.value;e.change(a=>{if(s){const c=r[r.length-1],l=Cn(c,{direction:"forward"}),d=[];l.length>1&&d.push(...za(l[1],a)),d.push(...Mr(r,a)),d.push(...function(h,u){const g=[];let p=Number.POSITIVE_INFINITY;for(const{node:k}of gi(h.nextSibling,"forward")){const b=k.getAttribute("listIndent");if(b==0)break;b{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,t),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const u=(h=a,Array.from(new De(h,{direction:"forward",higherIndent:!0})));i.push(...ja([a,...u],r,{indentBy:c-l,expand:c{const e=za(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",Un(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&$t(e)&&!Hn(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?t:t.nextSibling}}class Lx extends R{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(t){return Px(t)}isFirstBlockOfListItem(t){return Hn(t)}isListItemBlock(t){return $t(t)}expandListBlocksToCompleteItems(t,e={}){return pi(t,e)}}function lf(o){return o.is("element","ol")||o.is("element","ul")}function Br(o){return o.is("element","li")}function zx(o,t,e,n=hf(e,t)){return o.createAttributeElement(df(e),null,{priority:2*t/100-100,id:n})}function Rx(o,t,e){return o.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function df(o){return o=="numbered"?"ol":"ul"}function hf(o,t){return`list-${o}-${t}`}function Fe(o,t){const e=o.nodeBefore;if($t(e)){let n=e;for(const{node:i}of gi(n,"backward"))if(n=i,t.has(n))return;t.set(e,n)}else{const n=o.nodeAfter;$t(n)&&t.set(n,n)}}function jx(){return(o,t,e)=>{const{writer:n,schema:i}=e;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(h=>i.checkAttribute(h,"listItemId"));if(!r.length)return;const s=Ao.next(),a=function(h){let u=0,g=h.parent;for(;g;){if(Br(g))u++;else{const p=g.previousSibling;p&&Br(p)&&u++}g=g.parent}return u}(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");l&&(c=l);const d={listItemId:s,listIndent:a,listType:c};for(const h of r)h.hasAttribute("listItemId")||n.setAttributes(d,h);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&e.keepEmptyElement(r[0])}}function uf(){return(o,t,e)=>{if(!e.consumable.test(t.viewItem,{name:!0}))return;const n=new nn(t.viewItem.document);for(const i of Array.from(t.viewItem.getChildren()))Br(i)||lf(i)||n.remove(i)}}function gf(o,t,e,{dataPipeline:n}={}){const i=function(r){return(s,a)=>{const c=[];for(const l of r)s.hasAttribute(l)&&c.push(`attribute:${l}`);return!!c.every(l=>a.test(s,l)!==!1)&&(c.forEach(l=>a.consume(s,l)),!0)}}(o);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,h=s.item;if(!o.includes(s.attributeKey)||!i(h,d))return;const u=function(p,k,b){const A=b.createRangeOn(p);return k.toViewRange(A).getTrimmed().end.nodeBefore}(h,l,e);(function(p,k,b){for(;p.parent.is("attributeElement")&&p.parent.getCustomProperty("listItemWrapper");)k.unwrap(k.createRangeIn(p.parent),p.parent);const A=k.createPositionBefore(p).getWalker({direction:"backward"}),E=[];for(const{item:M}of A){if(M.is("element")&&b.toModelElement(M))break;M.is("element")&&M.getCustomProperty("listItemMarker")&&E.push(M)}for(const M of E)k.remove(M)})(u,c,l),function(p,k){let b=p.parent;for(;b.is("attributeElement")&&["ul","ol","li"].includes(b.name);){const A=b.parent;k.unwrap(k.createRangeOn(p),b),b=A}}(u,c);const g=function(p,k,b,A,{dataPipeline:E}){let M=A.createRangeOn(k);if(!Hn(p))return M;for(const z of b){if(z.scope!="itemMarker")continue;const G=z.createElement(A,p,{dataPipeline:E});if(!G||(A.setCustomProperty("listItemMarker",!0,G),A.insert(M.start,G),M=A.createRange(A.createPositionBefore(G),A.createPositionAfter(k)),!z.createWrapperElement||!z.canWrapElement))continue;const tt=z.createWrapperElement(A,p,{dataPipeline:E});A.setCustomProperty("listItemWrapper",!0,tt),z.canWrapElement(p)?M=A.wrap(M,tt):(M=A.wrap(A.createRangeOn(G),tt),M=A.createRange(M.start,A.createPositionAfter(k)))}return M}(h,u,t,c,{dataPipeline:n});(function(p,k,b,A){if(!p.hasAttribute("listIndent"))return;const E=p.getAttribute("listIndent");let M=p;for(let z=E;z>=0;z--){const G=Rx(A,z,M.getAttribute("listItemId")),tt=zx(A,z,M.getAttribute("listType"));for(const at of b)at.scope!="list"&&at.scope!="item"||!M.hasAttribute(at.attributeName)||at.setAttributeOnDowncast(A,M.getAttribute(at.attributeName),at.scope=="list"?tt:G);if(k=A.wrap(k,G),k=A.wrap(k,tt),z==0||(M=De.first(M,{lowerIndent:!0}),!M))break}})(h,g,t,c)}}function pf(o,{dataPipeline:t}={}){return(e,{writer:n})=>{if(!mf(e,o))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const i=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,i),i}}function mf(o,t,e=La(o)){if(!$t(o))return!1;for(const n of o.getAttributeKeys())if(!n.startsWith("selection:")&&!t.includes(n))return!1;return e.length<2}var ff=N(1232),Fx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(ff.A,Fx),ff.A.locals;var kf=N(6903),Vx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(kf.A,Vx),kf.A.locals;const Nr=["listType","listIndent","listItemId"];class Hx extends R{constructor(t){super(t),this._downcastStrategies=[],t.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[wr,sn,Lx,xe]}init(){const t=this.editor,e=t.model,n=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new _("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:Nr}),n?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const i of Nr)e.schema.setAttributeProperties(i,{copyOnReplace:!0});t.commands.add("numberedList",new sf(t,"numbered")),t.commands.add("bulletedList",new sf(t,"bulleted")),t.commands.add("indentList",new of(t,"forward")),t.commands.add("outdentList",new of(t,"backward")),t.commands.add("splitListItemBefore",new cf(t,"before")),t.commands.add("splitListItemAfter",new cf(t,"after")),n&&(t.commands.add("mergeListItemBackward",new af(t,"backward")),t.commands.add("mergeListItemForward",new af(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...Nr,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),n=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(i,r)=>{const s=t.model.document.selection;fi(t.model)||t.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!$t(c))return;if(De.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:bf(t.model,"backward")})}else nf(c)||t.execute("splitListItemAfter"),t.execute("outdentList");r.preventDefault(),i.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:bf(t.model,"forward")}),r.preventDefault(),i.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,n=t.commands,i=n.get("enter");this.listenTo(t.editing.view.document,"enter",(r,s)=>{const a=e.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&$t(c)&&c.isEmpty&&!s.isSoft){const l=Hn(c),d=nf(c);l&&d?(t.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(t.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(t.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(i,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&La(t.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,n=this.getListAttributeNames(),i=t.config.get("list.multiBlock"),r=i?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(s,{writer:a})=>a.createElement(r,{listType:""})}).elementToElement({view:"p",model:(s,{writer:a})=>s.parent&&s.parent.is("element","li")?a.createElement(r,{listType:""}):null,converterPriority:"high"}).add(s=>{s.on("element:li",jx()),s.on("element:ul",uf(),{priority:"high"}),s.on("element:ol",uf(),{priority:"high"})}),i||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:r,view:pf(n),converterPriority:"high"}).add(s=>{s.on("attribute",gf(n,this._downcastStrategies,e))}),t.conversion.for("dataDowncast").elementToElement({model:r,view:pf(n,{dataPipeline:!0}),converterPriority:"high"}).add(s=>{s.on("attribute",gf(n,this._downcastStrategies,e,{dataPipeline:!0}))}),this.listenTo(e.document,"change:data",function(s,a,c,l){return()=>{const g=s.document.differ.getChanges(),p=[],k=new Map,b=new Set;for(const A of g)if(A.type=="insert"&&A.name!="$text")Fe(A.position,k),A.attributes.has("listItemId")?b.add(A.position.nodeAfter):Fe(A.position.getShiftedBy(A.length),k);else if(A.type=="remove"&&A.attributes.has("listItemId"))Fe(A.position,k);else if(A.type=="attribute"){const E=A.range.start.nodeAfter;c.includes(A.attributeKey)?(Fe(A.range.start,k),A.attributeNewValue===null?(Fe(A.range.start.getShiftedBy(1),k),h(E)&&p.push(E)):b.add(E)):$t(E)&&h(E)&&p.push(E)}for(const A of k.values())p.push(...d(A,b));for(const A of new Set(p))a.reconvertItem(A)};function d(g,p){const k=[],b=new Set,A=[];for(const{node:E,previous:M}of gi(g,"forward")){if(b.has(E))continue;const z=E.getAttribute("listIndent");M&&zc.includes(tt)));const G=Cn(E,{direction:"forward"});for(const tt of G)b.add(tt),(h(tt,G)||u(tt,A,p))&&k.push(tt)}return k}function h(g,p){const k=a.mapper.toViewElement(g);if(!k)return!1;if(l.fire("checkElement",{modelElement:g,viewElement:k}))return!0;if(!g.is("element","paragraph")&&!g.is("element","listItem"))return!1;const b=mf(g,c,p);return!(!b||!k.is("element","p"))||!(b||!k.is("element","span"))}function u(g,p,k){if(k.has(g))return!1;const b=a.mapper.toViewElement(g);let A=p.length-1;for(let E=b.parent;!E.is("editableElement");E=E.parent){const M=Br(E),z=lf(E);if(!z&&!M)continue;const G="checkAttributes:"+(M?"item":"list");if(l.fire(G,{viewElement:E,modelAttributes:p[A]}))break;if(z&&(A--,A<0))return!1}return!0}}(e,t.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(s,{viewElement:a,modelAttributes:c})=>{a.id!=c.listItemId&&(s.return=!0,s.stop())}),this.on("checkAttributes:list",(s,{viewElement:a,modelAttributes:c})=>{a.name==df(c.listType)&&a.id==hf(c.listType,c.listIndent)||(s.return=!0,s.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(n=>function(i,r,s,a){const c=i.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let h=!1;for(const g of c){if(g.type=="insert"&&g.name!="$text"){const p=g.position.nodeAfter;if(!i.schema.checkAttribute(p,"listItemId"))for(const k of Array.from(p.getAttributeKeys()))s.includes(k)&&(r.removeAttribute(k,p),h=!0);Fe(g.position,l),g.attributes.has("listItemId")||Fe(g.position.getShiftedBy(g.length),l);for(const{item:k,previousPosition:b}of i.createRangeIn(p))$t(k)&&Fe(b,l)}else g.type=="remove"?Fe(g.position,l):g.type=="attribute"&&s.includes(g.attributeKey)&&(Fe(g.range.start,l),g.attributeNewValue===null&&Fe(g.range.start.getShiftedBy(1),l));if(!d&&g.type=="attribute"&&Nr.includes(g.attributeKey)){const p=g.range.start.nodeAfter;g.attributeNewValue===null&&p&&p.is("element","listItem")?(r.rename(p,"paragraph"),h=!0):g.attributeOldValue===null&&p&&p.is("element")&&p.name!="listItem"&&(r.rename(p,"listItem"),h=!0)}}const u=new Set;for(const g of l.values())h=a.fire("postFixer",{listNodes:new Ix(g),listHead:g,writer:r,seenIds:u})||h;return h}(t,n,e,this)),this.on("postFixer",(n,{listNodes:i,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,h=!1;for(const{node:u}of s){const g=u.getAttribute("listIndent");if(g>c){let p;d===null?(d=g-c,p=c):(d>g&&(d=g),p=g-d),p>l+1&&(p=l+1),a.setAttribute("listIndent",p,u),h=!0,l=p}else d=null,c=g+1,l=g}return h}(i,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:i,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let h=!1;for(const{node:u}of a){if(d.has(u))continue;let g=u.getAttribute("listType"),p=u.getAttribute("listItemId");if(c.has(p)&&(p=Ao.next()),c.add(p),u.is("element","listItem"))u.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,u),h=!0);else for(const k of Cn(u,{direction:"forward"}))d.add(k),k.getAttribute("listType")!=g&&(p=Ao.next(),g=k.getAttribute("listType")),k.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,k),h=!0)}return h}(i,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(n){return(i,[r,s])=>{const a=r.is("documentFragment")?Array.from(r.getChildren()):[r];if(!a.length)return;const c=(s?n.createSelection(s):n.document.selection).getFirstPosition();let l;if($t(c.parent))l=c.parent;else{if(!$t(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const h=l.getAttribute("listType"),u=l.getAttribute("listIndent"),g=a[0].getAttribute("listIndent")||0,p=Math.max(u-g,0);for(const k of a){const b=$t(k);l.is("element","listItem")&&k.is("element","paragraph")&&d.rename(k,"listItem"),d.setAttributes({listIndent:(b?k.getAttribute("listIndent"):0)+p,listItemId:b?k.getAttribute("listItemId"):Ao.next(),listType:h},k)}})}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(n,i)=>{t.change(r=>{const s=Array.from(i.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every($t)&&r.remove(a),i.method=="copy"||i.method=="cut"){const c=Array.from(i.content.getChildren());mi(c)&&Mr(c,r)}})})}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function bf(o,t){const e=o.document.selection;if(!e.isCollapsed)return!fi(o);if(t==="forward")return!0;const n=e.getFirstPosition().parent,i=n.previousSibling;return!o.schema.isObject(i)&&(!!i.isEmpty||mi([n,i]))}function wf(o,t,e,n){o.ui.componentFactory.add(t,i=>{const r=o.commands.get(t),s=new wt(i);return s.set({label:e,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(t),o.editing.view.focus()}),s})}class Ux extends R{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;wf(this.editor,"numberedList",t("Numbered List"),ot.numberedList),wf(this.editor,"bulletedList",t("Bulleted List"),ot.bulletedList)}}class qx extends R{static get requires(){return[Hx,Ux]}static get pluginName(){return"List"}}const Gx=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:t,listType:e}of Gx);var Af=N(9968),Wx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Af.A,Wx),Af.A.locals;var Cf=N(7141),Kx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Cf.A,Kx),Cf.A.locals,jo("Ctrl+Enter");var _f=N(8991),$x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(_f.A,$x),_f.A.locals,jo("Ctrl+Enter");function vf(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=i.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(i.item),l=[...c.getChildren()].find(h=>h.getCustomProperty("media-content"));a.remove(l);const d=o.getMediaViewElement(a,s,t);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",e)}}function yf(o,t,e,n){return o.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(o,e,n),o.createSlot()])}function xf(o){const t=o.getSelectedElement();return t&&t.is("element","media")?t:null}function Ef(o,t,e,n){o.change(i=>{const r=i.createElement("media",{url:t});o.insertObject(r,e,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class Yx extends st{refresh(){const t=this.editor.model,e=t.document.selection,n=xf(e);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(i){const r=i.getSelectedElement();return!!r&&r.name==="media"}(e)||function(i,r){let a=Bg(i,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=xf(n);i?e.change(r=>{r.setAttribute("url",t,i)}):Ef(e,t,n,!0)}}class Qx{constructor(t,e){const n=e.providers,i=e.extraProviders||[],r=new Set(e.removeProviders),s=n.concat(i).filter(a=>{const c=a.name;return c?!r.has(c):(Q("media-embed-no-provider-name",{provider:a}),!1)});this.locale=t,this.providerDefinitions=s}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new Df(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=Et(e.url);for(const r of i){const s=this._getUrlMatches(t,r);if(s)return new Df(this.locale,t,s,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class Df{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(e);i=t.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new kn,e=this._locale.t;return t.content='',t.viewBox="0 0 64 42",new Re({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var If=N(7048),Zx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(If.A,Zx),If.A.locals;class Pr extends R{constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const n=e[1],i=e[2];return`
`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new Qx(t.locale,t.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,r=t.config.get("mediaEmbed.previewsInData"),s=t.config.get("mediaEmbed.elementName"),a=this.registry;t.commands.add("mediaEmbed",new Yx(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return yf(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),i.for("dataDowncast").add(vf(a,{elementName:s,renderMediaPreview:r})),i.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(h,u,g){return u.setCustomProperty("media",!0,h),pa(h,u,{label:g})}(yf(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),i.for("editingDowncast").add(vf(a,{elementName:s,renderForEditingView:!0})),i.for("upcast").elementToElement({view:c=>["oembed",s].includes(c.name)&&c.getAttribute("url")?{name:!0}:null,model:(c,{writer:l})=>{const d=c.getAttribute("url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(c,{writer:l})=>{const d=c.getAttribute("data-oembed-url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).add(c=>{c.on("element:figure",(l,d,h)=>{if(!h.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:u,modelCursor:g}=h.convertChildren(d.viewItem,d.modelCursor);d.modelRange=u,d.modelCursor=g,Wt(u.getItems())||h.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const Jx=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Xx extends R{constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[Zg,sn,np]}static get pluginName(){return"AutoMediaEmbed"}init(){const t=this.editor,e=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const i=e.selection.getFirstRange(),r=Zt.fromPosition(i.start);r.stickiness="toPrevious";const s=Zt.fromPosition(i.end);s.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&($.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(Pr).registry,r=new pe(t,e),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const c of s)c.item.is("$textProxy")&&(a+=c.item.data);if(a=a.trim(),!a.match(Jx)||!i.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Zt.fromPosition(t),this._timeoutId=$.window.setTimeout(()=>{n.model.change(c=>{this._timeoutId=null,c.remove(r),r.detach();let l=null;this._positionToInsert.root.rootName!=="$graveyard"&&(l=this._positionToInsert),Ef(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(sn).requestUndoOnBackspace()},100)):r.detach()}}var Sf=N(5651),tE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Sf.A,tE),Sf.A.locals;class eE extends et{constructor(t,e){super(e);const n=e.t;this.focusTracker=new Qt,this.keystrokes=new oe,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),m({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new or(this.locale,ar),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),e}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class nE extends R{static get requires(){return[Pr]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",n=>{const i=on(n);return this._setUpDropdown(i,e),i})}_setUpDropdown(t,e){const n=this.editor,i=n.t,r=t.buttonView,s=n.plugins.get(Pr).registry;t.once("change:isOpen",()=>{const a=new(x(eE))(function(c,l){return[d=>{if(!d.url.length)return c("The URL must not be empty.")},d=>{if(!l.hasMedia(d.url))return c("This media URL is not supported.")}]}(n.t,s),n.locale);t.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=e.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),t.on("change:isOpen",()=>a.resetFormStatus()),t.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(t),a.urlInputView.fieldView.bind("value").to(e,"value"),a.urlInputView.bind("isEnabled").to(e,"isEnabled")}),t.bind("isEnabled").to(e),r.set({label:i("Insert media"),icon:'',tooltip:!0})}}var Tf=N(70),oE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Tf.A,oE),Tf.A.locals;function iE(o,t){if(!o.childCount)return;const e=new nn(o.document),n=function(s,a){const c=a.createRangeIn(s),l=new Ne({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),d=[];for(const h of c)if(h.type==="elementStart"&&l.match(h.item)){const u=sE(h.item);d.push({element:h.item,id:u.id,order:u.order,indent:u.indent})}return d}(o,e);if(!n.length)return;let i=null,r=1;n.forEach((s,a)=>{const c=function(p,k){if(!p)return!0;if(p.id!==k.id)return k.indent-p.indent!=1;const b=k.element.previousSibling;if(!b)return!0;return A=b,!(A.is("element","ol")||A.is("element","ul"));var A}(n[a-1],s),l=c?null:n[a-1],d=(u=s,(h=l)?u.indent-h.indent:u.indent-1);var h,u;if(c&&(i=null,r=1),!i||d!==0){const p=function(k,b){const A=new RegExp(`@list l${k.id}:level${k.indent}\\s*({[^}]*)`,"gi"),E=/mso-level-number-format:([^;]{0,100});/gi,M=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,z=A.exec(b);let G="decimal",tt="ol",at=null;if(z&&z[1]){const St=E.exec(z[1]);if(St&&St[1]&&(G=St[1].trim(),tt=G!=="bullet"&&G!=="image"?"ol":"ul"),G==="bullet"){const qt=function(Lr){const ki=function(vk){if(vk.getChild(0).is("$text"))return null;for(const yk of vk.getChildren()){if(!yk.is("element","span"))continue;const zr=yk.getChild(0);if(zr)return zr.is("$text")?zr:zr.getChild(0)}return null}(Lr);if(!ki)return null;const _o=ki._data;return _o==="o"?"circle":_o==="·"?"disc":_o==="§"?"square":null}(k.element);qt&&(G=qt)}else{const qt=M.exec(z[1]);qt&&qt[1]&&(at=parseInt(qt[1]))}}return{type:tt,startIndex:at,style:rE(G)}}(s,t);if(i){if(s.indent>r){const k=i.getChild(i.childCount-1),b=k.getChild(k.childCount-1);i=Mf(p,b,e),r+=1}else if(s.indent1&&e.setAttribute("start",o.startIndex,i),i}function sE(o){const t={},e=o.getStyle("mso-list");if(e){const n=e.match(/(^|\s{1,100})l(\d+)/i),i=e.match(/\s{0,100}lfo(\d+)/i),r=e.match(/\s{0,100}level(\d+)/i);n&&i&&r&&(t.id=n[2],t.order=i[1],t.indent=parseInt(r[1]))}return t}function aE(o,t){if(!o.childCount)return;const e=new nn(o.document),n=function(r,s){const a=s.createRangeIn(r),c=new Ne({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const h=d.item,u=h.previousSibling,g=u&&u.is("element")?u.name:null,p=["Chart"],k=c.match(h),b=h.getAttribute("o:gfxdata"),A=g==="v:shapetype",E=b&&p.some(M=>h.getAttribute("id").includes(M));k&&b&&!A&&!E&&l.push(d.item.getAttribute("id"))}return l}(o,e);(function(r,s,a){const c=a.createRangeIn(s),l=new Ne({name:"img"}),d=[];for(const h of c)if(h.item.is("element")&&l.match(h.item)){const u=h.item,g=u.getAttribute("v:shapes")?u.getAttribute("v:shapes").split(" "):[];g.length&&g.every(p=>r.indexOf(p)>-1)?d.push(u):u.getAttribute("src")||d.push(u)}for(const h of d)a.remove(h)})(n,o,e),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const u of c)if(u.type=="elementStart"&&u.item.is("element","v:shape")){const g=u.item.getAttribute("id");if(r.includes(g))continue;d(u.item.parent.getChildren(),g)||l.push(u.item)}for(const u of l){const g={src:h(u)};u.hasAttribute("alt")&&(g.alt=u.getAttribute("alt"));const p=a.createElement("img",g);a.insertChild(u.index+1,p,u.parent)}function d(u,g){for(const p of u)if(p.is("element")&&(p.name=="img"&&p.getAttribute("v:shapes")==g||d(p.getChildren(),g)))return!0;return!1}function h(u){for(const g of u.getChildren())if(g.is("element")&&g.getAttribute("src"))return g.getAttribute("src")}}(n,o,e),function(r,s){const a=s.createRangeIn(r),c=new Ne({name:/v:(.+)/}),l=[];for(const d of a)d.type=="elementStart"&&c.match(d.item)&&l.push(d.item);for(const d of l)s.remove(d)}(o,e);const i=function(r,s){const a=s.createRangeIn(r),c=new Ne({name:"img"}),l=[];for(const d of a)d.item.is("element")&&c.match(d.item)&&d.item.getAttribute("src").startsWith("file://")&&l.push(d.item);return l}(o,e);i.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(t,16))).join(""))}const lE=//i,dE=/xmlns:o="urn:schemas-microsoft-com/i;class hE{constructor(t){this.document=t}isActive(t){return lE.test(t)||dE.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;iE(e,n),aE(e,t.dataTransfer.getData("text/rtf")),function(i){const r=[],s=new nn(i.document);for(const{item:a}of s.createRangeIn(i))if(a.is("element")){for(const c of a.getClassNames())/\bmso/gi.exec(c)&&s.removeClass(c,a);for(const c of a.getStyleNames())/\bmso/gi.exec(c)&&s.removeStyle(c,a);a.is("element","w:sdt")&&r.push(a)}for(const a of r){const c=a.parent,l=c.getChildIndex(a);s.insertChild(l,a.getChildren(),c),s.remove(a)}}(e),t.content=e}}function Bf(o,t,e,{blockElements:n,inlineObjectElements:i}){let r=e.createPositionAt(o,t=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!i.includes(s.name),{direction:t}),t=="forward"?r.nodeAfter:r.nodeBefore}function Nf(o,t){return!!o&&o.is("element")&&t.includes(o.name)}const uE=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class gE{constructor(t){this.document=t}isActive(t){return uE.test(t)}execute(t){const e=new nn(this.document),{body:n}=t._parsedData;(function(i,r){for(const s of i.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=i.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),i)}})(n,e),function(i,r){for(const s of r.createRangeIn(i)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,e),function(i,r){const s=new Vi(r.document.stylesProcessor),a=new qi(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const h of r.createRangeIn(i)){const u=h.item;if(u.is("element","br")){const g=Bf(u,"forward",r,{blockElements:c,inlineObjectElements:l}),p=Bf(u,"backward",r,{blockElements:c,inlineObjectElements:l}),k=Nf(g,c);(Nf(p,c)||k)&&d.push(u)}}for(const h of d)h.hasClass("Apple-interchange-newline")?r.remove(h):r.replace(h,r.createElement("p"))}(n,e),t.content=n}}const pE=/(\s+)<\/span>/g,(t,e)=>e.length===1?" ":Array(e.length+1).join("  ").substr(0,e.length))}function fE(o,t){const e=new DOMParser,n=function(c){return Pf(Pf(c)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(c){const l="",d="",h=c.indexOf(l);if(h<0)return c;const u=c.indexOf(d,h+l.length);return c.substring(0,h+l.length)+(u>=0?c.substring(u):"")}(o=(o=o.replace(//g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((d=(d=c.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||d.includes("
"))&&(d=`

${d}

`),u=d),l=this.editor.data.htmlProcessor.toView(u)}var d;const h=new H(this,"inputTransformation");this.fire(h,{content:l,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),h.stop.called&&s.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(s.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,a)=>{r._setUniqueMarkerNamesInFragment(a.content)},{priority:"highest"}),this.listenTo(this,"contentInsertion",(s,a)=>{a.resultRange=e.insertContent(a.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,e.selection,r.name)};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{t.model.canEditAt(t.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=t.data.toView(s.content);n.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:a,method:s.method})},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",ag(s.content))),s.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class ug{constructor(t,e=20){this._batch=null,this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){this.isLocked&&!t||(this._batch=null,this._size=0)}}class c1 extends st{constructor(t,e){super(t),this._buffer=new ug(t.model,e),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",r=i.length;let s=n.selection;if(t.selection?s=t.selection:t.range&&(s=e.createSelection(t.range)),!e.canEditAt(s))return;const a=t.resultRange;e.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());e.deleteContent(s),i&&e.insertContent(c.createText(i,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const gg=["insertText","insertReplacementText"];class l1 extends $e{constructor(t){super(t),this.focusObserver=t.getObserver($i),f.isAndroid&&gg.push("insertCompositionText");const e=t.document;e.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=i;if(!gg.includes(a))return;this.focusObserver.flush();const l=new H(e,"insertText");e.fire(l,new co(t,c,{text:r,selection:t.createSelection(s)})),l.stop.called&&n.stop()}),e.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!f.isAndroid&&i&&e.fire("insertText",new co(t,r,{text:i,selection:e.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class pg extends R{static get pluginName(){return"Input"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=e.document.selection;n.addObserver(l1);const r=new c1(t,t.config.get("typing.undoStep")||20);t.commands.add("insertText",r),t.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,h=Array.from(l.getRanges()).map(p=>t.editing.mapper.toModelRange(p));let u=c;if(f.isAndroid){const p=Array.from(h[0].getItems()).reduce((k,b)=>k+(b.is("$textProxy")?b.data:""),"");p&&(p.length<=u.length?u.startsWith(p)&&(u=u.substring(p.length),h[0].start=h[0].start.getShiftedBy(p.length)):p.startsWith(u)&&(h[0].start=h[0].start.getShiftedBy(u.length),u=""))}const g={text:u,selection:e.createSelection(h)};d&&(g.resultRange=t.editing.mapper.toModelRange(d)),t.execute("insertText",g),n.scrollToTheSelection()}),f.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&mg(e,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||mg(e,r)})}}function mg(o,t){if(!t.isEnabled)return;const e=t.buffer;e.lock(),o.enqueueChange(e.batch,()=>{o.deleteContent(o.document.selection)}),e.unlock()}class fg extends st{constructor(t,e){super(t),this.direction=e,this._buffer=new ug(t.model,t.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(t.selection||n.selection);if(!e.canEditAt(r))return;const s=t.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let c=0;r.getFirstRange().getMinimalFlatRanges().forEach(l=>{c+=jt(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!e.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),r=t.createElement("paragraph");t.remove(t.createRangeIn(i)),t.insert(r,i),t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!="backward"||!t.isCollapsed)return!1;const i=t.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!t.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const kg="word",bn="selection",mo="backward",ai="forward",bg={deleteContent:{unit:bn,direction:mo},deleteContentBackward:{unit:"codePoint",direction:mo},deleteWordBackward:{unit:kg,direction:mo},deleteHardLineBackward:{unit:bn,direction:mo},deleteSoftLineBackward:{unit:bn,direction:mo},deleteContentForward:{unit:"character",direction:ai},deleteWordForward:{unit:kg,direction:ai},deleteHardLineForward:{unit:bn,direction:ai},deleteSoftLineForward:{unit:bn,direction:ai}};class d1 extends $e{constructor(t){super(t);const e=t.document;let n=0;e.on("keydown",()=>{n++}),e.on("keyup",()=>{n=0}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=bg[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==bn&&(d.selectionToRemove=t.createSelection(s[0])),c==="deleteContentBackward"&&(f.isAndroid&&(d.sequence=1),function(u){if(u.length!=1||u[0].isCollapsed)return!1;const g=u[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let p=0;for(const{nextPosition:k}of g){if(k.parent.is("$text")){const b=k.parent.data,A=k.offset;if(gs(b,A)||ps(b,A)||gl(b,A))continue;p++}else p++;if(p>1)return!0}return!1}(s)&&(d.unit=bn,d.selectionToRemove=t.createSelection(s)));const h=new so(e,"delete",s[0]);e.fire(h,new co(t,a,d)),h.stop.called&&i.stop()}),f.isBlink&&function(i){const r=i.view,s=r.document;let a=null,c=!1;function l(h){return h==ut.backspace||h==ut.delete}function d(h){return h==ut.backspace?mo:ai}s.on("keydown",(h,{keyCode:u})=>{a=u,c=!1}),s.on("keyup",(h,{keyCode:u,domEvent:g})=>{const p=s.selection,k=i.isEnabled&&u==a&&l(u)&&!p.isCollapsed&&!c;if(a=null,k){const b=p.getFirstRange(),A=new so(s,"delete",b),E={unit:bn,direction:d(u),selectionToRemove:p};s.fire(A,new co(r,g,E))}}),s.on("beforeinput",(h,{inputType:u})=>{const g=bg[u];l(a)&&g&&g.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(h,{inputType:u,data:g})=>{a==ut.delete&&u=="insertText"&&g==""&&h.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class sn extends R{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.model.document;e.addObserver(d1),this._undoOnBackspace=!1;const r=new fg(t,"forward");t.commands.add("deleteForward",r),t.commands.add("forwardDelete",r),t.commands.add("delete",new fg(t,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:h}=a,u=c==="forward"?"deleteForward":"delete",g={sequence:l};if(h=="selection"){const p=Array.from(d.getRanges()).map(k=>t.editing.mapper.toModelRange(k));g.selection=t.model.createSelection(p)}else g.unit=h;t.execute(u,g),e.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,t.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class h1 extends R{static get requires(){return[pg,sn]}static get pluginName(){return"Typing"}}function wg(o,t){let e=o.start;return{text:Array.from(o.getWalker({ignoreElementEnd:!1})).reduce((n,{item:i})=>i.is("$text")||i.is("$textProxy")?n+i.data:(e=t.createPositionAfter(i),""),""),range:t.createRange(e,o.end)}}class Ag extends ft(){constructor(t,e){super(),this.model=t,this.testCallback=e,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(t,"change:data",(e,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(t,e={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=wg(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(e,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${t}`,l)}}}class Cg extends R{constructor(t){super(t),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=t.locale,r=e.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==ut.arrowright,l=a.keyCode==ut.arrowleft;if(!c&&!l)return;const d=i.contentLanguageDirection;let h=!1;h=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),h===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&Ee(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!an(i,e))&&!!Ee(r,e)&&(li(t),an(i,e)&&Ee(r,e,!0)?ci(n,e):this._overrideGravity(),!0)}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(li(t),this._restoreGravity(),Ee(r,e,!0)?ci(n,e):kr(n,e,r),!0):r.isAtStart?!!an(i,e)&&(li(t),kr(n,e,r),!0):!an(i,e)&&Ee(r,e,!0)?(li(t),kr(n,e,r),!0):!!_g(r,e)&&(r.isAtEnd&&!an(i,e)&&Ee(r,e)?(li(t),kr(n,e,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view.document;t.editing.view.addObserver(Ks);let r=!1;this.listenTo(i,"mousedown",()=>{r=!0}),this.listenTo(i,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!an(n,s))return;const a=n.getFirstPosition();Ee(a,s)&&(a.isAtStart||Ee(a,s,!0)?ci(e,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection,n=this.attributes;this.listenTo(t,"insertContent",()=>{const i=e.getFirstPosition();an(e,n)&&Ee(i,n)&&ci(t,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=an(n,this.attributes)&&!_g(a,this.attributes)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,s||t.model.enqueueChange(()=>{const a=n.getFirstPosition();an(n,this.attributes)&&Ee(a,this.attributes)&&(a.isAtStart||Ee(a,this.attributes,!0)?ci(e,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function an(o,t){for(const e of t)if(o.hasAttribute(e))return!0;return!1}function kr(o,t,e){const n=e.nodeBefore;o.change(i=>{if(n){const r=[],s=o.schema.isObject(n)&&o.schema.isInline(n);for(const[a,c]of n.getAttributes())!o.schema.checkAttribute("$text",a)||s&&o.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);i.setSelectionAttribute(r)}else i.removeSelectionAttribute(t)})}function ci(o,t){o.change(e=>{e.removeSelectionAttribute(t)})}function li(o){o.preventDefault()}function _g(o,t){return Ee(o.getShiftedBy(-1),t)}function Ee(o,t,e=!1){const{nodeBefore:n,nodeAfter:i}=o;for(const r of t){const s=n?n.getAttribute(r):void 0,a=i?i.getAttribute(r):void 0;if((!e||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const vg={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:fo('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:fo("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:fo("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:fo('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:fo('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:fo("'"),to:[null,"‚",null,"’"]}},yg={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},u1=["symbols","mathematical","typography","quotes"];function g1(o){return typeof o=="string"?new RegExp(`(${Hu(o)})$`):o}function p1(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function m1(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function fo(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function br(o,t,e,n){return n.createRange(xg(o,t,e,!0,n),xg(o,t,e,!1,n))}function xg(o,t,e,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(t)==e;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*Eg(o,t){for(const e of t)e&&o.getAttributeProperties(e[0]).copyOnEnter&&(yield e)}class f1 extends st{execute(){this.editor.model.change(t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})})}enterBlock(t){const e=this.editor.model,n=e.document.selection,i=e.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(i.isLimit(a)||i.isLimit(c))return r||a!=c||e.deleteContent(n),!1;if(r){const l=Eg(t.model.schema,n.getAttributes());return Dg(t,s.start),t.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(e.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Dg(t,n.focus),!0;t.setSelection(c,0)}}return!1}}function Dg(o,t){o.split(t),o.setSelection(t.parent.nextSibling,0)}const k1={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ig extends $e{constructor(t){super(t);const e=this.document;let n=!1;e.on("keydown",(i,r)=>{n=r.shiftKey}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;f.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=k1[s];if(!c)return;const l=new so(e,"enter",r.targetRanges[0]);e.fire(l,new co(t,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class wr extends R{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=this.editor.t;e.addObserver(Ig),t.commands.add("enter",new f1(t)),this.listenTo(n,"enter",(r,s)=>{n.isComposing||s.preventDefault(),s.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class b1 extends st{execute(){const t=this.editor.model,e=t.document;t.change(n=>{(function(i,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,h=l==d;if(a){const u=Eg(i.schema,s.getAttributes());Sg(i,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(u)}else{const u=!(c.start.isAtStart&&c.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:u}),h?Sg(i,r,s.focus):u&&r.setSelection(d,0)}})(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,c=s.end.parent;return!((ua(a,n)||ua(c,n))&&a!==c)}(t.schema,e.selection)}}function Sg(o,t,e){const n=t.createElement("softBreak");o.insertContent(n,e),t.setSelection(n,"after")}function ua(o,t){return!o.is("rootElement")&&(t.isLimit(o)||ua(o.parent,t))}class w1 extends R{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=i.document,s=this.editor.t;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),i.addObserver(Ig),t.commands.add("shiftEnter",new b1(t)),this.listenTo(r,"enter",(a,c)=>{r.isComposing||c.preventDefault(),c.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class A1 extends kt(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i===r||ga(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i===r||ga(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(ga(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&C1(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function ga(o,t){return o&&t&&o.priority==t.priority&&Ar(o.classes)==Ar(t.classes)}function C1(o,t){return o.priority>t.priority||!(o.priorityAr(t.classes)}function Ar(o){return Array.isArray(o)?o.sort().join(","):o}const _1='',v1="ck-widget",Tg="ck-widget_selected";function Ut(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function pa(o,t,e={}){if(!o.is("containerElement"))throw new _("widget-to-widget-wrong-element-type",null,{element:o});return t.setAttribute("contenteditable","false",o),t.addClass(v1,o),t.setCustomProperty("widget",!0,o),o.getFillerOffset=E1,t.setCustomProperty("widgetLabel",[],o),e.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,e.label),e.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new kn;return c.set("content",_1),c.render(),a.appendChild(c.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,t),Mg(o,t),o}function y1(o,t,e){if(t.classes&&e.addClass(Et(t.classes),o),t.attributes)for(const n in t.attributes)e.setAttribute(n,t.attributes[n],o)}function x1(o,t,e){if(t.classes&&e.removeClass(Et(t.classes),o),t.attributes)for(const n in t.attributes)e.removeAttribute(n,o)}function Mg(o,t,e=y1,n=x1){const i=new A1;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&e(o,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),t.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function Bg(o,t,e={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),t.setAttribute("role","textbox",o),e.label&&t.setAttribute("aria-label",e.label,o),t.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{t.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?t.addClass("ck-editor__nested-editable_focused",o):t.removeClass("ck-editor__nested-editable_focused",o)}),Mg(o,t),o}function Ng(o,t){const e=o.getSelectedElement();if(e){const n=wn(o);if(n)return t.createRange(t.createPositionAt(e,n))}return t.schema.findOptimalInsertionRange(o)}function E1(){return null}const cn="widget-type-around";function Vn(o,t,e){return!!o&&Ut(o)&&!e.isInline(t)}function wn(o){return o.getAttribute(cn)}var Pg=P(8508),D1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Pg.A,D1),Pg.A.locals;const Og=["before","after"],I1=new DOMParser().parseFromString('',"image/svg+xml").firstChild,Lg="ck-widget__type-around_disabled";class S1 extends R{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[wr,sn]}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(n,i,r)=>{e.change(s=>{for(const a of e.document.roots)r?s.removeClass(Lg,a):s.addClass(Lg,a)}),r||t.model.change(s=>{s.removeSelectionAttribute(cn)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=wn(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&Vn(c,s.item,e)&&(function(l,d,h){const u=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(g){const p=this.toDomElement(g);return function(k,b){for(const A of Og){const E=new Re({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${A}`],title:b[A],"aria-hidden":"true"},children:[k.ownerDocument.importNode(I1,!0)]});k.appendChild(E.render())}}(p,d),function(k){const b=new Re({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});k.appendChild(b.render())}(p),p});l.insert(l.createPositionAt(h,"end"),u)}(a.writer,i,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,n=e.document.selection,i=e.schema,r=t.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,c)=>{this._handleArrowKeyPress(a,c)},{context:[Ut,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&t.model.change(l=>{l.removeSelectionAttribute(cn)})}),this._listenToIfEnabled(e.document,"change:data",()=>{const a=n.getSelectedElement();a&&Vn(t.editing.mapper.toViewElement(a),a,i)||t.model.change(c=>{c.removeSelectionAttribute(cn)})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const p=l.mapper.toViewElement(this._currentFakeCaretModelElement);p&&(d.removeClass(Og.map(s),p),this._currentFakeCaretModelElement=null)}const h=c.selection.getSelectedElement();if(!h)return;const u=l.mapper.toViewElement(h);if(!Vn(u,h,i))return;const g=wn(c.selection);g&&(d.addClass(s(g),u),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||t.model.change(d=>{d.removeSelectionAttribute(cn)})})}_handleArrowKeyPress(t,e){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,c=function(h,u){const g=cs(h,u);return g==="down"||g==="right"}(e.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;Vn(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):e.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=wn(e.document.selection);return e.change(i=>n?n!==(t?"after":"before")?(i.removeSelectionAttribute(cn),!0):!1:(i.setSelectionAttribute(cn,t?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,r=e.plugins.get("Widget"),s=r._getObjectElementNextToSelection(t);return!!Vn(e.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(cn,t?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,r=e.editing.mapper,s=n.document.selection,a=t?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!Vn(r.toViewElement(a),a,i)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(cn,t?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(l){return l.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(l,d){const h=l.closest(".ck-widget");return d.mapDomToView(h)}(r,e.domConverter),c=t.editing.mapper.toModelElement(a);this._insertParagraph(c,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=e.getSelectedElement(),a=t.editing.mapper.toViewElement(s),c=t.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Vn(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),i.stop())},{context:Ut})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(e,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=t.selection)},{priority:"high"}),f.isAndroid?this._listenToIfEnabled(t,"keydown",(e,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=wn(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)t.execute("delete",{selection:n.createSelection(l,"on")});else{const h=i.getNearestSelectionRange(n.createPositionAt(l,a),c);if(h)if(h.isCollapsed){const u=n.createSelection(h.start);if(n.modifySelection(u,{direction:c}),u.focus.isEqual(h.start)){const g=function(p,k){let b=k;for(const A of k.getAncestors({parentFirst:!0})){if(A.childCount>1||p.isLimit(A))break;b=A}return b}(i,h.start.parent);n.deleteContent(n.createSelection(g,"on"),{doNotAutoparagraph:!0})}else n.change(g=>{g.setSelection(h),t.execute(d?"deleteForward":"delete")})}else n.change(u=>{u.setSelection(h),t.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Ut})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=wn(n);return a?(i.stop(),e.change(c=>{const l=n.getSelectedElement(),d=e.createPositionAt(l,a),h=c.createSelection(d),u=e.insertContent(r,h);return c.setSelection(h),u})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=wn(e);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||wn(e)&&n.stop()},{priority:"high"})}}function T1(o){const t=o.model;return(e,n)=>{const i=n.keyCode==ut.arrowup,r=n.keyCode==ut.arrowdown,s=n.shiftKey,a=t.document.selection;if(!i&&!r)return;const c=r;if(s&&function(d,h){return!d.isCollapsed&&d.isBackward==h}(a,c))return;const l=function(d,h,u){const g=d.model;if(u){const p=h.isCollapsed?h.focus:h.getLastPosition(),k=zg(g,p,"forward");if(!k)return null;const b=g.createRange(p,k),A=Rg(g.schema,b,"backward");return A?g.createRange(p,A):null}{const p=h.isCollapsed?h.focus:h.getFirstPosition(),k=zg(g,p,"backward");if(!k)return null;const b=g.createRange(k,p),A=Rg(g.schema,b,"forward");return A?g.createRange(A,p):null}}(o,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,h,u){const g=d.model,p=d.view.domConverter;if(u){const M=g.createSelection(h.start);g.modifySelection(M),M.focus.isAtEnd||h.start.isEqual(M.focus)||(h=g.createRange(M.focus,h.end))}const k=d.mapper.toViewRange(h),b=p.viewRangeToDom(k),A=dt.getDomRangeRects(b);let E;for(const M of A)if(E!==void 0){if(Math.round(M.top)>=E)return!1;E=Math.max(E,Math.round(M.bottom))}else E=Math.round(M.bottom);return!0}(o,l,c))&&(t.change(d=>{const h=c?l.end:l.start;if(s){const u=t.createSelection(a.anchor);u.setFocus(h),d.setSelection(u)}else d.setSelection(h)}),e.stop(),n.preventDefault(),n.stopPropagation())}}}function zg(o,t,e){const n=o.schema,i=o.createRangeIn(t.root),r=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of i.getWalker({startPosition:t,direction:e})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function Rg(o,t,e){const n=e=="backward"?t.end:t.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of t.getWalker({direction:e}))if(o.checkChild(i,"$text"))return i;return null}var jg=P(695),M1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(jg.A,M1),jg.A.locals;class di extends R{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[S1,sn]}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.t;this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{const c=a.writer,l=s.selection;if(l.isCollapsed)return;const d=l.getSelectedElement();if(!d)return;const h=t.editing.mapper.toViewElement(d);var u;Ut(h)&&a.consumable.consume(l,"selection")&&c.setSelection(c.createRangeOn(h),{fake:!0,label:(u=h,u.getCustomProperty("widgetLabel").reduce((g,p)=>typeof p=="function"?g?g+". "+p():p():g?g+". "+p:p,""))})}),this.editor.editing.downcastDispatcher.on("selection",(r,s,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,l=c.document.selection;let d=null;for(const h of l.getRanges())for(const u of h){const g=u.item;Ut(g)&&!B1(g,d)&&(c.addClass(Tg,g),this._previouslySelected.add(g),d=g)}},{priority:"low"}),e.addObserver(Ks),this.listenTo(n,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(n,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[Ut,"$text"]}),this.listenTo(n,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(n,"arrowKey",T1(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(r,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),r.stop())},{context:"$root"}),t.accessibility.addKeystrokeInfoGroup({id:"widget",label:i("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:i("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:i("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:i("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:i("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(t,e){const n=this.editor,i=n.editing.view,r=i.document;let s=e.target;if(e.domEvent.detail>=3)return void(this._selectBlockContent(s)&&e.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(Ut(l))return!1;l=l.parent}return!1}(s)||!Ut(s)&&(s=s.findAncestor(Ut),!s))return;f.isAndroid&&e.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(t){const e=this.editor,n=e.model,i=e.editing.mapper,r=n.schema,s=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(t,0)),a=function(c,l){for(const d of c.getAncestors({includeSelf:!0,parentFirst:!0})){if(l.checkChild(d,"$text"))return d;if(l.isLimit(d)&&!l.isObject(d))break}return null}(i.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(u,g){const p=new Xe({startPosition:u});for(const{item:k}of p){if(g.isLimit(k)||!k.is("element"))return null;if(g.checkChild(k,"$text"))return k}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),h=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,h))}),!0)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),c=cs(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const u=l?s.getLastPosition():s.getFirstPosition(),g=r.getNearestSelectionRange(u,l?"forward":"backward");return void(g&&(i.change(p=>{p.setSelection(g)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed&&!e.shiftKey){const u=s.getFirstPosition(),g=s.getLastPosition(),p=u.nodeAfter,k=g.nodeBefore;return void((p&&r.isObject(p)||k&&r.isObject(k))&&(i.change(b=>{b.setSelection(l?g:u)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&r.isObject(h)){if(r.isInline(h)&&d)return;this._setSelectionOverElement(h),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(e.preventDefault(),t.stop())}_handleDelete(t){const e=this.editor.model.document.selection;if(!this.editor.model.canEditAt(e)||!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(i=>{let r=e.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,r=e.createSelection(i);if(e.modifySelection(r,{direction:t?"forward":"backward"}),r.isEqual(i))return null;const s=t?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(Tg,e);this._previouslySelected.clear()}}function B1(o,t){return!!t&&Array.from(o.getAncestors()).includes(t)}class Cr extends R{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[gr]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Ut(r))})(t.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Q("widget-toolbar-no-items",{toolbarId:t});const s=this.editor,a=s.t,c=new na(s.locale);if(c.ariaLabel=e||a("Widget toolbar"),this._toolbarDefinitions.has(t))throw new _("widget-toolbar-duplicated",this,{toolbarId:t});const l={view:c,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(t,l)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>t&&(t=s,e=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Fg(this.editor,e):this._isToolbarInBalloon(t)||(t.initialized||(t.initialized=!0,t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:t.view,position:Vg(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);Fg(this.editor,i)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function Fg(o,t){const e=o.plugins.get("ContextualBalloon"),n=Vg(o,t);e.updatePosition(n)}function Vg(o,t){const e=o.editing.view,n=se.defaultPositions;return{target:e.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var Hg=P(4095),N1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Hg.A,N1),Hg.A.locals;const ma=oo("px");class P1 extends et{constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",e=>!e)],style:{left:t.to("left",e=>ma(e)),top:t.to("top",e=>ma(e)),width:t.to("width",e=>ma(e))}}})}}class _r extends R{constructor(){super(...arguments),this.removeDropMarkerDelayed=us(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=hr(t=>this._updateDropMarker(t),40),this._reconvertMarkerThrottled=hr(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new P1,this._domEmitter=new(Ce()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:t}of this._scrollables.values())t.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(t,e,n,i,r,s){this.removeDropMarkerDelayed.cancel();const a=Ug(this.editor,t,e,n,i,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(t,e,n,i,r,s){const a=Ug(this.editor,t,e,n,i,r,s);return this.removeDropMarker(),a}removeDropMarker(){const t=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,t.markers.has("drop-target")&&t.change(e=>{e.removeMarker("drop-target")})}_setupDropMarker(){const t=this.editor;t.ui.view.body.add(this._dropTargetLineView),t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);e.markerRange.isCollapsed?this._updateDropTargetLine(e.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||i.updateMarker("drop-target",{range:t}):i.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(t){return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const n=this.toDomElement(e);return n.append("⁠",e.createElement("span"),"⁠"),n})}_updateDropTargetLine(t){const e=this.editor.editing,n=t.start.nodeBefore,i=t.start.nodeAfter,r=t.start.parent,s=n?e.mapper.toViewElement(n):null,a=s?e.view.domConverter.mapViewToDom(s):null,c=i?e.mapper.toViewElement(i):null,l=c?e.view.domConverter.mapViewToDom(c):null,d=e.mapper.toViewElement(r);if(!d)return;const h=e.view.domConverter.mapViewToDom(d),u=this._getScrollableRect(d),{scrollX:g,scrollY:p}=$.window,k=a?new dt(a):null,b=l?new dt(l):null,A=new dt(h).excludeScrollbarsAndBorders(),E=k?k.bottom:A.top,M=b?b.top:A.bottom,z=$.window.getComputedStyle(h),G=E<=M?(E+M)/2:M;if(u.topa.schema.checkChild(h,u))){if(a.schema.checkChild(h,"$text"))return a.createRange(h);if(d)return vr(o,Gg(o,d.parent),n,i)}}}else if(a.schema.isInline(l))return vr(o,l,n,i)}if(a.schema.isBlock(l))return vr(o,l,n,i);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(g=>g.is("element")&&!O1(o,g));let h=0,u=d.length;if(u==0)return a.createRange(a.createPositionAt(l,"end"));for(;ht in o?L1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class V1 extends R{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(Ce())}static get pluginName(){return"DragDropBlockToolbar"}init(){const t=this.editor;if(this.listenTo(t,"change:isReadOnly",(e,n,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),f.isAndroid&&this.forceDisabled("noAndroidSupport"),t.plugins.has("BlockToolbar")){const e=t.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(e,"dragstart",(n,i)=>this._handleBlockDragStart(i)),this._domEmitter.listenTo($.document,"dragover",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo($.document,"drop",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo($.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&e.setAttribute("draggable","true"),this.on("change:isEnabled",(n,i,r)=>{e.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(t){if(!this.isEnabled)return;const e=this.editor.model,n=e.document.selection,i=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));e.change(a=>a.setSelection(s)),this._isBlockDragging=!0,i.focus(),i.getObserver(ri).onDomEvent(t)}_handleBlockDragging(t){if(!this.isEnabled||!this._isBlockDragging)return;const e=t.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=t.clientY,i=document.elementFromPoint(e,n),r=this.editor.editing.view;var s,a;i&&i.closest(".ck-editor__editable")&&r.getObserver(ri).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))j1.call(l,d)&&Kg(c,d,l[d]);if(Wg)for(var d of Wg(l))F1.call(l,d)&&Kg(c,d,l[d]);return c})({},t),a={type:t.type,dataTransfer:t.dataTransfer,target:i,clientX:e,clientY:n,preventDefault:()=>t.preventDefault(),stopPropagation:()=>t.stopPropagation()},z1(s,R1(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var $g=P(7793),H1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()($g.A,H1),$g.A.locals;class U1 extends R{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=us(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(Ce())}static get pluginName(){return"DragDrop"}static get requires(){return[xe,di,_r,V1]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,e.addObserver(ri),e.addObserver(Ks),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),f.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=t.plugins.get(_r);this.listenTo(i,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=X(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:h}=a,{clientX:u}=h;this._updatePreview({dataTransfer:l,domTarget:d,clientX:u}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(i,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo($.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(i,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(i,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(i,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");const{clientX:c,clientY:l}=a.domEvent;r.updateDropMarker(a.target,a.targetRanges,c,l,this._blockMode,this._draggedRange),this._draggedRange||(a.dataTransfer.dropEffect="copy"),f.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get(_r);this.listenTo(e,"clipboardInput",(i,r)=>{if(r.method!="drop")return;const{clientX:s,clientY:a}=r.domEvent,c=n.getFinalDropRange(r.target,r.targetRanges,s,a,this._blockMode,this._draggedRange);if(!c)return this._finalizeDragging(!1),void i.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),Yg(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void i.stop();r.targetRanges=[t.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(xe);t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=Yg(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,n=e.document;this.listenTo(n,"mousedown",(i,r)=>{if(f.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Qg(r.target);if(f.isBlink&&!t.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&Ut(a)||(s=n.selection.editableElement)}s&&(e.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=t.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{f.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(t){const e=this.editor,n=e.model;e.plugins.get(_r).removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(t&&this.isEnabled&&n.change(i=>{const r=n.createSelection(this._draggedRange);n.deleteContent(r,{doNotAutoparagraph:!0});const s=r.getFirstPosition().parent;s.isEmpty&&!n.schema.checkChild(s,"$text")&&n.schema.checkChild(s,"paragraph")&&i.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(t){const e=this.editor,n=e.model,i=n.document.selection,r=t?Qg(t):null;if(r){const l=e.editing.mapper.toModelElement(r);this._draggedRange=pe.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(i.isCollapsed&&!i.getFirstPosition().parent.isEmpty)return;const s=Array.from(i.getSelectedBlocks()),a=i.getFirstRange();if(s.length==0)return void(this._draggedRange=pe.fromRange(a));const c=Zg(n,s);if(s.length>1)this._draggedRange=pe.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=pe.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:t,domTarget:e,clientX:n}){const i=this.editor.editing.view,r=i.document.selection.editableElement,s=i.domConverter.mapViewToDom(r),a=$.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Ae($.document,"div",{style:"position: fixed; left: -999999px;"}),$.document.body.appendChild(this._previewContainer));const c=new dt(s);if(s.contains(e))return;const l=parseFloat(a.paddingLeft),d=Ae($.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,f.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=t.getData("text/html"),t.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function Yg(o){return f.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Qg(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Ut);if(Ut(o))return o;const t=o.findAncestor(e=>Ut(e)||e.is("editableElement"));return Ut(t)?t:null}function Zg(o,t){const e=t[0],n=t[t.length-1],i=e.getCommonAncestor(n),r=o.createPositionBefore(e),s=o.createPositionAfter(n);if(i&&i.is("element")&&!o.schema.isLimit(i)){const a=o.createRangeOn(i),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return Zg(o,[i])}return o.createRange(r,s)}class q1 extends R{static get pluginName(){return"PastePlainText"}static get requires(){return[xe]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=e.document.selection;let s=!1;n.addObserver(ri),this.listenTo(i,"keydown",(a,c)=>{s=c.shiftKey}),t.plugins.get(xe).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const h=l.getChild(0);return d.isObject(h)?!1:Array.from(h.getAttributeKeys()).length==0}(c.content,e.schema))&&e.change(l=>{const d=Array.from(r.getAttributes()).filter(([u])=>e.schema.getAttributeProperties(u).isFormatting);r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const h=l.createRangeIn(c.content);for(const u of h.getItems())u.is("$textProxy")&&l.setAttributes(d,u)})})}}class Jg extends R{static get pluginName(){return"Clipboard"}static get requires(){return[si,xe,U1,q1]}init(){const t=this.editor,e=this.editor.t;t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Copy selected content"),keystroke:"CTRL+C"},{label:e("Paste content"),keystroke:"CTRL+V"},{label:e("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}class G1 extends st{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!Xg(t.schema,n))do if(n=n.parent,!n)return;while(!Xg(t.schema,n));t.change(i=>{i.setSelection(n,"in")})}}function Xg(o,t){return o.isLimit(t)&&(o.checkChild(t,"$text")||o.checkChild(t,"paragraph"))}const W1=jo("Ctrl+A");class K1 extends R{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.t,n=t.editing.view.document;t.commands.add("selectAll",new G1(t)),this.listenTo(n,"keydown",(i,r)=>{io(r)===W1&&(t.execute("selectAll"),r.preventDefault())}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Select all"),keystroke:"CTRL+A"}]})}}class $1 extends R{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const n=t.commands.get("selectAll"),i=new wt(e),r=e.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),i})}}class Y1 extends R{static get requires(){return[K1,$1]}static get pluginName(){return"SelectAll"}}var Q1=Object.defineProperty,tp=Object.getOwnPropertySymbols,Z1=Object.prototype.hasOwnProperty,J1=Object.prototype.propertyIsEnumerable,ep=(o,t,e)=>t in o?Q1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class np extends st{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))Z1.call(s,a)&&ep(r,a,s[a]);if(tp)for(var a of tp(s))J1.call(s,a)&&ep(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,r=i.document,s=[],a=t.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(h=>h.root!=r.graveyard).filter(h=>!ty(h,c));d.length&&(X1(d),s.push(d[0]))}s.length&&i.change(l=>{l.setSelection(s,{backward:e})})}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(i.history.getOperations(a)),l=$A([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const h=d.affectedSelectable;h&&!n.canEditAt(h)&&(d=new Vt(d.baseVersion)),e.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function X1(o){o.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;te!==o&&e.containsRange(o,!0))}class ey extends np{execute(t=null){const e=t?this._stack.findIndex(r=>r.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r)}),this.fire("revert",n.batch,i),this.refresh()}}class ny extends np{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class oy extends R{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const t=this.editor,e=t.t;this._undoCommand=new ey(t),this._redoCommand=new ny(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(n,i)=>{const r=i[0];if(!r.isDocumentOperation)return;const s=r.batch,a=this._redoCommand.createdBatches.has(s),c=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(a?this._undoCommand.addBatch(s):c||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(n,i,r)=>{this._redoCommand.addBatch(r)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Undo"),keystroke:"CTRL+Z"},{label:e("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class iy extends R{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?ot.undo:ot.redo,r=e.uiLanguageDirection=="ltr"?ot.redo:ot.undo;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(t,e,n,i){const r=this.editor;r.ui.componentFactory.add(t,s=>{const a=r.commands.get(t),c=new wt(s);return c.set({label:e,icon:i,keystroke:n,tooltip:!0}),c.bind("isEnabled").to(a,"isEnabled"),this.listenTo(c,"execute",()=>{r.execute(t),r.editing.view.focus()}),c})}}class op extends R{static get requires(){return[oy,iy]}static get pluginName(){return"Undo"}}class ry extends ft(){constructor(){super();const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,i)=>{e.onload=()=>{const r=e.result;this._data=r,n(r)},e.onerror=()=>{i("error")},e.onabort=()=>{i("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}class je extends R{constructor(){super(...arguments),this.loaders=new Be,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Ch]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return Q("filerepository-no-upload-adapter"),null;const e=new ip(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(n=>{this._loadersMap.set(n,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),e.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),e}destroyLoader(t){const e=t instanceof ip?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((n,i)=>{n===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Ch);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=i=>`${e("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}class ip extends ft(){constructor(t,e){super(),this.id=X(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new ry,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new _("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if(this.status!=="reading")throw this.status;return this.status="idle",t}).catch(t=>{throw t==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:t)})}upload(){if(this.status!="idle")throw new _("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{throw this.status==="aborted"?"aborted":(this.status="error",t)})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?t=="reading"?this._reader.abort():t=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((n,i)=>{e.rejecter=i,e.isFulfilled=!1,t.then(r=>{e.isFulfilled=!0,n(r)}).catch(r=>{e.isFulfilled=!0,i(r)})}),e}}class sy extends wt{constructor(t){super(t),this.buttonView=this,this._fileInputView=new ay(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}class ay extends et{constructor(t){super(t),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const rp="ckCsrfToken",sp="abcdefghijklmnopqrstuvwxyz0123456789";function cy(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(rp);var t,e;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),t=rp,e=o,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"),o}class ly{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>e(s)),i.addEventListener("abort",()=>e()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return e(a&&a.error&&a.error.message?a.error.message:s);t({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",cy()),this.xhr.send(e)}}function An(o,t,e,n){let i,r=null;typeof n=="function"?i=n:(r=o.commands.get(n),i=()=>{o.execute(n)}),o.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const c=Wt(o.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(o.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const h=d.position.parent;if(h.is("element","codeBlock")||h.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const u=h.getChild(0),g=o.model.createRangeOn(u);if(!g.containsRange(c)&&!c.end.isEqual(g.end))return;const p=e.exec(u.data.substr(0,c.end.offset));p&&o.model.enqueueChange(k=>{const b=k.createPositionAt(h,0),A=k.createPositionAt(h,p[0].length),E=new pe(b,A);if(i({match:p})!==!1){k.remove(E);const M=o.model.document.selection.getFirstRange(),z=k.createRangeIn(h);!h.isEmpty||z.isEqual(M)||z.containsRange(M,!0)||k.remove(h)}E.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function ko(o,t,e,n){let i,r;e instanceof RegExp?i=e:r=e,r=r||(s=>{let a;const c=[],l=[];for(;(a=i.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:h,2:u,3:g}=a;const p=h+u+g;d+=a[0].length-p.length;const k=[d,d+h.length],b=[d+h.length+u.length,d+h.length+u.length+g.length];c.push(k),c.push(b),l.push([d+h.length,d+h.length+u.length])}return{remove:c,format:l}}),o.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;const c=o.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),h=d[0];if(d.length!=1||h.type!=="insert"||h.name!="$text"||h.length!=1)return;const u=l.focus,g=u.parent,{text:p,range:k}=function(M,z){let G=M.start;return{text:Array.from(M.getItems()).reduce((at,St)=>!St.is("$text")&&!St.is("$textProxy")||St.getAttribute("code")?(G=z.createPositionAfter(St),""):at+St.data,""),range:z.createRange(G,M.end)}}(c.createRange(c.createPositionAt(g,0),u),c),b=r(p),A=ap(k.start,b.format,c),E=ap(k.start,b.remove,c);A.length&&E.length&&c.enqueueChange(M=>{if(n(M,A)!==!1){for(const z of E.reverse())M.remove(z);c.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function ap(o,t,e){return t.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>e.createRange(o.getShiftedBy(n[0]),o.getShiftedBy(n[1])))}function yr(o,t){return(e,n)=>{if(!o.commands.get(t).isEnabled)return!1;const i=o.model.schema.getValidRanges(n,t);for(const r of i)e.setAttribute(t,!0,r);e.removeSelectionAttribute(t)}}class cp extends st{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.forceValue===void 0?!this.value:t.forceValue;e.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(e.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const bo="bold";class dy extends R{static get pluginName(){return"BoldEditing"}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:bo}),t.model.schema.setAttributeProperties(bo,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:bo,view:"strong",upcastAlso:["b",n=>{const i=n.getStyle("font-weight");return i&&(i=="bold"||Number(i)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(bo,new cp(t,bo)),t.keystrokes.set("CTRL+B",bo),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Bold text"),keystroke:"CTRL+B"}]})}}const fa="bold";class hy extends R{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(fa,n=>{const i=t.commands.get(fa),r=new wt(n);return r.set({label:e("Bold"),icon:ot.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(fa),t.editing.view.focus()}),r})}}var lp=P(4199),uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(lp.A,uy),lp.A.locals;const wo="italic";class gy extends R{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:wo}),t.model.schema.setAttributeProperties(wo,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:wo,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(wo,new cp(t,wo)),t.keystrokes.set("CTRL+I",wo),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Italic text"),keystroke:"CTRL+I"}]})}}const ka="italic";class py extends R{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(ka,n=>{const i=t.commands.get(ka),r=new wt(n);return r.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(ka),t.editing.view.focus()}),r})}}class my extends st{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks()),s=t.forceValue===void 0?!this.value:t.forceValue;e.change(a=>{if(s){const c=r.filter(l=>xr(l)||hp(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(xr))})}_getValue(){const t=Wt(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!xr(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Wt(t.getSelectedBlocks());return!!n&&hp(e,n)}_removeQuote(t,e){dp(t,e).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void t.unwrap(n.start.parent);if(n.start.isAtStart){const r=t.createPositionBefore(n.start.parent);return void t.move(n,r)}n.end.isAtEnd||t.split(n.end);const i=t.createPositionAfter(n.end.parent);t.move(n,i)})}_applyQuote(t,e){const n=[];dp(t,e).reverse().forEach(i=>{let r=xr(i.start);r||(r=t.createElement("blockQuote"),t.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(t.merge(t.createPositionAfter(i)),i):r)}}function xr(o){return o.parent.name=="blockQuote"?o.parent:null}function dp(o,t){let e,n=0;const i=[];for(;n{const a=t.model.document.differ.getChanges();for(const c of a)if(c.type=="insert"){const l=c.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!e.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const h of d.getItems())if(h.is("element","blockQuote")&&!e.checkChild(s.createPositionBefore(h),h))return s.unwrap(h),!0}}else if(c.type=="remove"){const l=c.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});const n=this.editor.editing.view.document,i=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const c=i.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var up=P(8708),ky={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(up.A,ky),up.A.locals;class by extends R{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const i=t.commands.get("blockQuote"),r=new wt(n);return r.set({label:e("Block quote"),icon:ot.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r})}}class wy extends R{static get pluginName(){return"CKBoxUI"}afterInit(){const t=this.editor;if(!t.commands.get("ckbox"))return;const e=t.t;if(t.ui.componentFactory.add("ckbox",n=>{const i=t.commands.get("ckbox"),r=new wt(n);return r.set({label:e("Open file manager"),icon:ot.browseFiles,tooltip:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),r.on("execute",()=>{t.execute("ckbox")}),r}),t.plugins.has("ImageInsertUI")){const n=t.plugins.get("ImageInsertUI");n.registerIntegration({name:"assetManager",observable:()=>t.commands.get("ckbox"),buttonViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckbox");return i.icon=ot.imageAssetManager,i.bind("label").to(n,"isImageSelected",r=>e(r?"Replace image with file manager":"Insert image with file manager")),i},formViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckbox");return i.icon=ot.imageAssetManager,i.withText=!0,i.bind("label").to(n,"isImageSelected",r=>e(r?"Replace with file manager":"Insert with file manager")),i.on("execute",()=>{n.dropdownView.isOpen=!1}),i}})}}}var Ay=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],hi=o=>{let t=0;for(let e=0;e{let t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},wa=o=>{let t=Math.max(0,Math.min(1,o));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},Aa=(o,t)=>(e=>e<0?-1:1)(o)*Math.pow(Math.abs(o),t),gp=class extends Error{constructor(o){super(o),this.name="ValidationError",this.message=o}},Cy=o=>{if(!o||o.length<6)throw new gp("The blurhash string must be at least 6 characters");let t=hi(o[0]),e=Math.floor(t/9)+1,n=t%9+1;if(o.length!==4+2*n*e)throw new gp(`blurhash length mismatch: length is ${o.length} but it should be ${4+2*n*e}`)},_y=o=>{let t=o>>8&255,e=255&o;return[ba(o>>16),ba(t),ba(e)]},vy=(o,t)=>{let e=Math.floor(o/361),n=Math.floor(o/19)%19,i=o%19;return[Aa((e-9)/9,2)*t,Aa((n-9)/9,2)*t,Aa((i-9)/9,2)*t]},yy=(o,t,e,n)=>{Cy(o),n|=1;let i=hi(o[0]),r=Math.floor(i/9)+1,s=i%9+1,a=(hi(o[1])+1)/166,c=new Array(s*r);for(let h=0;ht in o?xy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;function fp(o){const t=[];let e=0;for(const i in o){const r=parseInt(i,10);isNaN(r)||(r>e&&(e=r),t.push(`${o[i]} ${i}w`))}const n=[{srcset:t.join(","),sizes:`(max-width: ${e}px) 100vw, ${e}px`,type:"image/webp"}];return{imageFallbackUrl:o.default,imageSources:n}}const ui=32;function kp({url:o,method:t="GET",data:e,onUploadProgress:n,signal:i,authorization:r}){const s=new XMLHttpRequest;s.open(t,o.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{i.throwIfAborted(),i.addEventListener("abort",a),s.addEventListener("loadstart",()=>{i.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{i.removeEventListener("abort",a)}),s.addEventListener("error",()=>{l()}),s.addEventListener("abort",()=>{l()}),s.addEventListener("load",()=>{const d=s.response;if(!d||d.statusCode>=400)return l(d&&d.message);c(d)}),n&&s.upload.addEventListener("progress",d=>{n(d)}),s.send(e)})}const Iy={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function Sy(o,t){return e=this,n=null,i=function*(){try{const r=yield fetch(o,((s,a)=>{for(var c in a||(a={}))Ey.call(a,c)&&mp(s,c,a[c]);if(pp)for(var c of pp(a))Dy.call(a,c)&&mp(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},t));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(i.next(d))}catch(h){s(h)}},c=d=>{try{l(i.throw(d))}catch(h){s(h)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((i=i.apply(e,n)).next())});var e,n,i}var Ty=Object.defineProperty,bp=Object.getOwnPropertySymbols,My=Object.prototype.hasOwnProperty,By=Object.prototype.propertyIsEnumerable,wp=(o,t,e)=>t in o?Ty(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Ap=(o,t)=>{for(var e in t||(t={}))My.call(t,e)&&wp(o,e,t[e]);if(bp)for(var e of bp(t))By.call(t,e)&&wp(o,e,t[e]);return o};class Ny extends st{constructor(t){super(t),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return this._wrapper!==null}_checkEnabled(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");return!(!t.isEnabled&&!e.isEnabled)}_prepareOptions(){const t=this.editor.config.get("ckbox");return{theme:t.theme,language:t.language,tokenUrl:t.tokenUrl,serviceOrigin:t.serviceOrigin,forceDemoLabel:t.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const t=this.editor,e=t.model,n=!t.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=Ae(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))}),this.on("ckbox:close",()=>{this.value&&(this._wrapper.remove(),this._wrapper=null,t.editing.view.focus())}),this.on("ckbox:choose",(i,r)=>{if(!this.isEnabled)return;const s=t.commands.get("insertImage"),a=t.commands.get("link"),c=function({assets:d,isImageAllowed:h,isLinkAllowed:u}){return d.map(g=>function(p){const k=p.data.metadata;return k?k.width&&k.height:!1}(g)?{id:g.data.id,type:"image",attributes:Py(g)}:{id:g.data.id,type:"link",attributes:Oy(g)}).filter(g=>g.type==="image"?h:u)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(e.change(d=>{for(const h of c){const u=h===c[l-1],g=l===1;this._insertAsset(h,u,d,g),n&&(setTimeout(()=>this._chosenAssets.delete(h),1e3),this._chosenAssets.add(h))}}),t.editing.view.focus())}),this.listenTo(t,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(t,e,n,i){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),t.type==="image"?this._insertImage(t):this._insertLink(t,n,i),e||n.setSelection(r.getLastPosition())}_insertImage(t){const e=this.editor,{imageFallbackUrl:n,imageSources:i,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=t.attributes;e.execute("insertImage",{source:Ap({src:n,sources:i,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(t,e,n){const i=this.editor,r=i.model,s=r.document.selection,{linkName:a,linkHref:c}=t.attributes;if(s.isCollapsed){const l=We(s.getAttributes()),d=e.createText(a,l);if(!n){const u=s.getLastPosition(),g=u.parent;g.name==="paragraph"&&g.isEmpty||i.execute("insertParagraph",{position:u});const p=r.insertContent(d);return e.setSelection(p),void i.execute("link",c)}const h=r.insertContent(d);e.setSelection(h)}i.execute("link",c)}}function Py(o){const{imageFallbackUrl:t,imageSources:e}=fp(o.data.imageUrls),{description:n,width:i,height:r,blurHash:s}=o.data.metadata,a=function(c){if(c)try{const l=`${ui}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const h=d.getContext("2d");if(!h)return;const u=h.createImageData(ui,ui),g=yy(c,ui,ui);return u.data.set(g),h.putImageData(u,0,0),d.toDataURL()}catch{return}}(s);return Ap({imageFallbackUrl:t,imageSources:e,imageTextAlternative:n||"",imageWidth:i,imageHeight:r},a?{imagePlaceholder:a}:null)}function Oy(o){return{linkName:o.data.name,linkHref:Ly(o)}}function Ly(o){const t=new URL(o.data.url);return t.searchParams.set("download","true"),t.toString()}var Ca=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class Cp extends R{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return Ca(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;t.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:t.locale.uiLanguage,theme:"lark",tokenUrl:t.config.get("cloudServices.tokenUrl")});const i=t.plugins.get("CloudServices"),r=t.config.get("cloudServices.tokenUrl"),s=t.config.get("ckbox.tokenUrl");if(!s)throw new _("ckbox-plugin-missing-token-url",this);this._token=s==r?i.token:yield i.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const t=(0,this.editor.t)("Cannot access default workspace."),e=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(i,r){const[,s]=i.value.split("."),a=JSON.parse(atob(s)),c=a.auth&&a.auth.ckbox&&a.auth.ckbox.workspaces||[a.aud];return r?(a.auth&&a.auth.ckbox&&a.auth.ckbox.role)=="superadmin"||c.includes(r)?r:null:c[0]}(this._token,e);if(n==null)throw Dt("ckbox-access-default-workspace-error"),t;return n}getCategoryIdForFile(t,e){return Ca(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),i=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(e),s=typeof t=="string"?(a=yield Sy(t,e),Iy[a]):function(d){const h=d.name,u=new RegExp("\\.(?[^.]+)$");return h.match(u).groups.ext.toLowerCase()}(t);var a;const c=yield r;if(!c)throw n;if(i){const d=Object.keys(i).find(h=>i[h].find(u=>u.toLowerCase()==s));if(d){const h=c.find(u=>u.id===d||u.name===d);if(!h)throw n;return h.id}}const l=c.find(d=>d.extensions.find(h=>h.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(t){return Ca(this,null,function*(){const e=this.editor,n=this._token,{signal:i}=t,r=e.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const h=yield a(d);c.push(...h.items),l=h.totalCount-(d+50),d+=50}while(l>0);return c}catch{return i.throwIfAborted(),void Dt("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit",50 .toString()),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),kp({url:l,signal:i,authorization:n.value})}})}}var _a=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class zy extends R{static get requires(){return["ImageUploadEditing","ImageUploadProgress",je,_p]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return _a(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;const i=t.plugins.get(je),r=t.plugins.get(Cp);i.createUploadAdapter=c=>new Ry(c,t,r);const s=!t.config.get("ckbox.ignoreDataId"),a=t.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{t.model.change(h=>{h.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class Ry{constructor(t,e,n){this.loader=t,this.token=n.getToken(),this.ckboxUtils=n,this.editor=e,this.controller=new AbortController,this.serviceOrigin=e.config.get("ckbox.serviceOrigin")}upload(){return _a(this,null,function*(){const t=this.ckboxUtils,e=this.editor.t,n=yield this.loader.file,i=yield t.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",t.getWorkspaceId()),s.append("categoryId",i),s.append("file",n),kp({method:"POST",url:r,data:s,onUploadProgress:a=>{a.lengthComputable&&(this.loader.uploadTotal=a.total,this.loader.uploaded=a.loaded)},signal:this.controller.signal,authorization:this.token.value}).then(a=>_a(this,null,function*(){const c=fp(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=e("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class _p extends R{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",zy,Cp]}init(){const t=this.editor;this._shouldBeInitialised()&&(this._checkImagePlugins(),yp()&&t.commands.add("ckbox",new Ny(t)))}afterInit(){const t=this.editor;this._shouldBeInitialised()&&(t.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()))}_shouldBeInitialised(){return!!this.editor.config.get("ckbox")||yp()}_checkImagePlugins(){const t=this.editor;t.plugins.has("ImageBlockEditing")||t.plugins.has("ImageInlineEditing")||Dt("ckbox-plugin-image-feature-missing",t)}_initSchema(){const t=this.editor.model.schema;t.extend("$text",{allowAttributes:"ckboxLinkId"}),t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.addAttributeCheck((e,n)=>{if(!e.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const t=this.editor;t.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,i.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(h=>h.name==="a");d&&(r.item.hasAttribute("ckboxLinkId")?a.setAttribute("data-ckbox-resource-id",r.item.getAttribute("ckboxLinkId"),d):a.removeAttribute("data-ckbox-resource-id",d))},{priority:"low"}),n.on("attribute:ckboxLinkId",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,i.name)){if(r.attributeOldValue){const d=vp(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=vp(a,r.attributeNewValue);if(r.item.is("selection")){const h=a.document.selection;a.wrap(h.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),t.conversion.for("upcast").add(n=>{n.on("element:a",(i,r,s)=>{const{writer:a,consumable:c}=s;if(!r.viewItem.getAttribute("href")||!c.consume(r.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const l=r.viewItem.getAttribute("data-ckbox-resource-id");if(l)if(r.modelRange)for(let d of r.modelRange.getItems())d.is("$textProxy")&&(d=d.textNode),Fy(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),t.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),t.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const e=t.commands.get("replaceImageSource");e&&this.listenTo(e,"cleanupImage",(n,[i,r])=>{i.removeAttribute("ckboxImageId",r)})}_initFixers(){const t=this.editor,e=t.model,n=e.document.selection;e.document.registerPostFixer(function(i){return r=>{let s=!1;const a=i.model,c=i.commands.get("ckbox");if(!c)return s;for(const l of a.document.differ.getChanges()){if(l.type!=="insert"&&l.type!=="attribute")continue;const d=l.type==="insert"?new B(l.position,l.position.getShiftedBy(l.length)):l.range,h=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const u of d.getItems()){if(h&&u.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",u),s=!0;continue}const g=jy(u,c._chosenAssets);for(const p of g){const k=p.type==="image"?"ckboxImageId":"ckboxLinkId";p.id!==u.getAttribute(k)&&(r.setAttribute(k,p.id,u),s=!0)}}}return s}}(t)),e.document.registerPostFixer(function(i){return r=>!(i.hasAttribute("linkHref")||!i.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function jy(o,t){const e=o.is("element","imageInline")||o.is("element","imageBlock"),n=o.hasAttribute("linkHref");return[...t].filter(i=>i.type==="image"&&e?i.attributes.imageFallbackUrl===o.getAttribute("src"):i.type==="link"&&n?i.attributes.linkHref===o.getAttribute("linkHref"):void 0)}function vp(o,t){const e=o.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return o.setCustomProperty("link",!0,e),e}function Fy(o){return!!o.is("$text")||!(!o.is("element","imageInline")&&!o.is("element","imageBlock"))}function yp(){return!!window.CKBox}var xp=P(1866),Vy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(xp.A,Vy),xp.A.locals;class Hy extends R{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t;if(e.add("ckfinder",i=>{const r=t.commands.get("ckfinder"),s=new wt(i);return s.set({label:n("Insert image or file"),icon:ot.browseFiles,tooltip:!0}),s.bind("isEnabled").to(r),s.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),s}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"assetManager",observable:()=>t.commands.get("ckfinder"),buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=ot.imageAssetManager,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckfinder");return r.icon=ot.imageAssetManager,r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}class Uy extends st{constructor(t){super(t),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if(e!="popup"&&e!="modal")throw new _("ckfinder-unknown-openermethod",t);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=t.locale.uiLanguage),n.onInit=r=>{i&&i(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(h=>!h.isImage()),l=a.filter(h=>h.isImage());for(const h of c)t.execute("link",h.getUrl());const d=[];for(const h of l){const u=h.getUrl();d.push(u||r.request("file:getProxyUrl",{file:h}))}d.length&&Ep(t,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)Ep(t,[a]);else{const c=t.plugins.get("Notification"),l=t.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](n)}}function Ep(o,t){if(o.commands.get("insertImage").isEnabled)o.execute("insertImage",{source:t});else{const e=o.plugins.get("Notification"),n=o.locale.t;e.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class qy extends R{static get pluginName(){return"CKFinderEditing"}static get requires(){return[ca,"LinkEditing"]}init(){const t=this.editor;if(!t.plugins.has("ImageBlockEditing")&&!t.plugins.has("ImageInlineEditing"))throw new _("ckfinder-missing-image-plugin",t);t.commands.add("ckfinder",new Uy(t))}}class Gy extends R{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",je]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),n=e.token,i=e.uploadUrl;if(!n)return;const r=t.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),t.plugins.get(je).createUploadAdapter=s=>new Wy(this._uploadGateway,s)}}class Wy{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then(t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",(e,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class Ky extends st{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}refresh(){const t=this.editor.model,e=Wt(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Dp(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document,i=t.selection||n.selection;e.canEditAt(i)&&e.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Dp(a,e.schema)&&r.rename(a,"paragraph")})}}function Dp(o,t){return t.checkChild(o.parent,"paragraph")&&!t.isObject(o)}class $y extends st{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.canEditAt(i)&&e.change(r=>{if(i=this._findPositionToInsertParagraph(i,r),!i)return;const s=r.createElement("paragraph");n&&e.schema.setAllowedAttributes(s,n,r),e.insertContent(s,i),r.setSelection(s,"in")})}_findPositionToInsertParagraph(t,e){const n=this.editor.model;if(n.schema.checkChild(t,"paragraph"))return t;const i=n.schema.findAllowedParent(t,"paragraph");if(!i)return null;const r=t.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&t.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&t.isAtStart?n.createPositionBefore(r):e.split(t,i).position}}const Ip=class extends R{static get pluginName(){return"Paragraph"}init(){const o=this.editor,t=o.model;o.commands.add("paragraph",new Ky(o)),o.commands.add("insertParagraph",new $y(o)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(e,{writer:n})=>Ip.paragraphLikeElements.has(e.name)?e.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let va=Ip;va.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Yy extends st{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Wt(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Sp(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Sp(a,i,e.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Sp(o,t,e){return e.checkChild(o.parent,t)&&!e.isObject(o)}const Tp="paragraph";class Qy extends R{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[va]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)i.model!=="paragraph"&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Yy(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(i,r)=>{const s=t.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Tp)&&s.childCount===0&&r.writer.rename(s,Tp)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:At.low+1})}}var Mp=P(6269),Zy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Mp.A,Zy),Mp.A.locals;class Jy extends R{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(s){const a=s.t,c={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(l=>{const d=c[l.title];return d&&d!=l.title&&(l.title=d),l})}(t),i=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",s=>{const a={},c=new Be,l=t.commands.get("heading"),d=t.commands.get("paragraph"),h=[l];for(const g of n){const p={type:"button",model:new zu({label:g.title,class:g.class,role:"menuitemradio",withText:!0})};g.model==="paragraph"?(p.model.bind("isOn").to(d,"value"),p.model.set("commandName","paragraph"),h.push(d)):(p.model.bind("isOn").to(l,"value",k=>k===g.model),p.model.set({commandName:"heading",commandValue:g.model})),c.add(p),a[g.model]=g.title}const u=on(s);return su(u,c,{ariaLabel:r,role:"menu"}),u.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(h,"isEnabled",(...g)=>g.some(p=>p)),u.buttonView.bind("label").to(l,"value",d,"value",(g,p)=>{const k=g||p&&"paragraph";return typeof k=="boolean"?i:a[k]?a[k]:i}),this.listenTo(u,"execute",g=>{const{commandName:p,commandValue:k}=g.source;t.execute(p,k?{value:k}:void 0),t.editing.view.focus()}),u})}}function Bp(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function Np(o,t){const e=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>e.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==t?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function ya(o,t){const e=Wt(t.getSelectedBlocks());return!e||o.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function Er(o){return o&&o.endsWith("px")?parseInt(o):null}function Pp(o){const t=Er(o.getStyle("width")),e=Er(o.getStyle("height"));return!(!t||!e)}var Xy=Object.defineProperty,Op=Object.getOwnPropertySymbols,t2=Object.prototype.hasOwnProperty,e2=Object.prototype.propertyIsEnumerable,Lp=(o,t,e)=>t in o?Xy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,zp=(o,t)=>{for(var e in t||(t={}))t2.call(t,e)&&Lp(o,e,t[e]);if(Op)for(var e of Op(t))e2.call(t,e)&&Lp(o,e,t[e]);return o};const n2=/^(image|image-inline)$/;class ce extends R{constructor(){super(...arguments),this._domEmitter=new(Ce())}static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null,i={}){const r=this.editor,s=r.model,a=s.document.selection,c=Rp(r,e||a,n);t=zp(zp({},Object.fromEntries(a.getAttributes())),t);for(const l in t)s.schema.checkAttribute(c,l)||delete t[l];return s.change(l=>{const{setImageSizes:d=!0}=i,h=l.createElement(c,t);return s.insertObject(h,e,null,{setSelection:"on",findOptimalPosition:e||c=="imageInline"?void 0:"auto"}),h.parent?(d&&this.setImageNaturalSizeAttributes(h),h):null})}setImageNaturalSizeAttributes(t){const e=t.getAttribute("src");e&&(t.getAttribute("width")||t.getAttribute("height")||this.editor.model.change(n=>{const i=new $.window.Image;this._domEmitter.listenTo(i,"load",()=>{t.getAttribute("width")||t.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",i.naturalWidth,t),r.setAttribute("height",i.naturalHeight,t)}),this._domEmitter.stopListening(i,"load")}),i.src=e}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e)return null;const n=t.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=e.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(t){return t.findAncestor({classes:n2})}isImageAllowed(){const t=this.editor.model.document.selection;return function(e,n){if(Rp(e,n,null)=="imageBlock"){const r=function(s,a){const c=Ng(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,e.model);if(e.model.schema.checkChild(r,"imageBlock"))return!0}else if(e.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(e){return[...e.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(t)}toImageWidget(t,e,n){return e.setCustomProperty("image",!0,t),pa(t,e,{label:()=>{const i=this.findViewImgElement(t).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Ut(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Rp(o,t,e){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?e||(i==="inline"?"imageInline":i!=="auto"?"imageBlock":t.is("selection")?ya(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class o2 extends st{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",t.newValue,r)})}}class i2 extends R{static get requires(){return[ce]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new o2(this.editor))}}var jp=P(4062),r2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(jp.A,r2),jp.A.locals;var Fp=P(2722),s2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Fp.A,s2),Fp.A.locals;class a2 extends et{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Qt,this.keystrokes=new oe,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),m({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new or(this.locale,ar);return e.label=t("Text alternative"),e}}function Vp(o){const t=o.editing.view,e=se.defaultPositions,n=o.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class c2 extends R{static get requires(){return[gr]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const i=t.commands.get("imageTextAlternative"),r=new wt(n);return r.set({label:e("Change image text alternative"),icon:ot.textAlternative,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(x(a2))(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(t.ui,"update",()=>{n.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=Vp(i);r.updatePosition(s)}}(t):this._hideForm(!0)}),v({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Vp(t)}),n.fieldView.value=n.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Hp extends R{static get requires(){return[i2,c2]}static get pluginName(){return"ImageTextAlternative"}}function Up(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),c=o.findViewImgElement(a);i.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):i.attributeNewValue&&(s.setAttribute("srcset",i.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${t}`,e)}}function Dr(o,t,e){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=o.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return i=>{i.on(`attribute:${e}:${t}`,n)}}class qp extends $e{observe(t){this.listenTo(t,"load",(e,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(t){this.stopListening(t)}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}var l2=Object.defineProperty,Gp=Object.getOwnPropertySymbols,d2=Object.prototype.hasOwnProperty,h2=Object.prototype.propertyIsEnumerable,Wp=(o,t,e)=>t in o?l2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Ir=(o,t)=>{for(var e in t||(t={}))d2.call(t,e)&&Wp(o,e,t[e]);if(Gp)for(var e of Gp(t))h2.call(t,e)&&Wp(o,e,t[e]);return o};class u2 extends st{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||e==="block"&&Q("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||e==="inline"&&Q("image-inline-plugin-required")}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=Et(t.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);i.insertImage(Ir(Ir({},s),r),l)}else i.insertImage(Ir(Ir({},s),r))})}}class g2 extends st{constructor(t){super(t),this.decorate("cleanupImage")}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=t.isImage(e),this.value=this.isEnabled?e.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(i=>{i.setAttribute("src",t.source,e),this.cleanupImage(i,e),n.setImageNaturalSizeAttributes(e)})}cleanupImage(t,e){t.removeAttribute("srcset",e),t.removeAttribute("sizes",e),t.removeAttribute("sources",e),t.removeAttribute("width",e),t.removeAttribute("height",e),t.removeAttribute("alt",e)}}class xa extends R{static get requires(){return[ce]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(qp),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new u2(t),i=new g2(t);t.commands.add("insertImage",n),t.commands.add("replaceImageSource",i),t.commands.add("imageInsert",n)}}class Kp extends R{static get requires(){return[ce]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=t==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${t}`,(d,h,u)=>{if(!u.consumable.consume(h.item,d.name))return;const g=u.writer,p=u.mapper.toViewElement(h.item),k=n.findViewImgElement(p);if(h.attributeNewValue!==null?g.setAttribute(c,h.attributeNewValue,k):g.removeAttribute(c,k),h.item.hasAttribute("sources"))return;const b=h.item.hasAttribute("resizedWidth");if(t==="imageInline"&&!b&&!l)return;const A=h.item.getAttribute("width"),E=h.item.getAttribute("height");A&&E&&g.setStyle("aspect-ratio",`${A}/${E}`,k)})}e.conversion.for("upcast").attributeToAttribute({view:{name:i,styles:{width:/.+/}},model:{key:"width",value:s=>Pp(s)?Er(s.getStyle("width")):null}}).attributeToAttribute({view:{name:i,key:"width"},model:"width"}).attributeToAttribute({view:{name:i,styles:{height:/.+/}},model:{key:"height",value:s=>Pp(s)?Er(s.getStyle("height")):null}}).attributeToAttribute({view:{name:i,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),e.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class $p extends st{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(t={}){const e=this.editor,n=this.editor.model,i=e.plugins.get("ImageUtils"),r=i.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=t,l=Array.from(n.markers).filter(u=>u.getRange().containsItem(r)),d=i.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const h=a.createRangeOn(d);for(const u of l){const g=u.getRange(),p=g.root.rootName!="$graveyard"?g.getJoined(h,!0):h;a.updateMarker(u,{range:p})}return{oldElement:r,newElement:d}}):null}}var Yp=P(7378),p2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Yp.A,p2),Yp.A.locals;class Qp extends R{static get requires(){return[ce]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["placeholder"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const t=this.editor,e=t.conversion,n=t.plugins.get("ImageUtils");e.for("editingDowncast").add(i=>{i.on("attribute:placeholder",(r,s,a)=>{if(!a.consumable.test(s.item,r.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;a.consumable.consume(s.item,r.name);const c=a.writer,l=a.mapper.toViewElement(s.item),d=n.findViewImgElement(l);s.attributeNewValue?(c.addClass("image_placeholder",d),c.setStyle("background-image",`url(${s.attributeNewValue})`,d),c.setCustomProperty("editingPipeline:doNotReuseOnce",!0,d)):(c.removeClass("image_placeholder",d),c.removeStyle("background-image",d))})})}_setupLoadListener(){const t=this.editor,e=t.model,n=t.editing,i=n.view,r=t.plugins.get("ImageUtils");i.addObserver(qp),this.listenTo(i.document,"imageLoaded",(s,a)=>{const c=i.domConverter.mapDomToView(a.target);if(!c)return;const l=r.getImageWidgetFromImageView(c);if(!l)return;const d=n.mapper.toModelElement(l);d&&d.hasAttribute("placeholder")&&e.enqueueChange({isUndoable:!1},h=>{h.removeAttribute("placeholder",d)})})}}class Zp extends R{static get requires(){return[xa,Kp,ce,Qp,xe]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new $p(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>Bp(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(Bp(s),s,e("image widget"))}),n.for("downcast").add(Dr(i,"imageBlock","src")).add(Dr(i,"imageBlock","alt")).add(Up(i,"imageBlock")),n.for("upcast").elementToElement({view:Np(t,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,c,l)=>{if(!l.consumable.test(c.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(c.viewItem);if(!d||!l.consumable.test(d,{name:!0}))return;l.consumable.consume(c.viewItem,{name:!0,classes:"image"});const h=Wt(l.convertItem(d,c.modelCursor).modelRange.getItems());h?(l.convertChildren(c.viewItem,h),l.updateConversionResult(h,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isInlineImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(ya(e.schema,d)==="imageBlock"){const h=new nn(n.document),u=c.map(g=>h.createElement("figure",{class:"image"},g));a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&i.setImageNaturalSizeAttributes(d)})})}}var Jp=P(3350),m2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Jp.A,m2),Jp.A.locals;class f2 extends et{constructor(t,e=[]){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve,this.children=this.createCollection(),this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of e)this.children.add(n),this._focusables.add(n),n instanceof n_&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)k2(n)&&(n.focusCycler.on("forwardCycle",i=>{this._focusCycler.focusNext(),i.stop()}),n.focusCycler.on("backwardCycle",i=>{this._focusCycler.focusPrevious(),i.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),m({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function k2(o){return"focusCycler"in o}class Xp extends R{constructor(t){super(t),this._integrations=new Map,t.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[ce]}init(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(t.model.document,"change",()=>{this.isImageSelected=n.isImage(e.getSelectedElement())});const i=r=>this._createToolbarComponent(r);t.ui.componentFactory.add("insertImage",i),t.ui.componentFactory.add("imageInsert",i)}registerIntegration({name:t,observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:r}){this._integrations.has(t)&&Q("image-insert-integration-exists",{name:t}),this._integrations.set(t,{observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:!!r})}_createToolbarComponent(t){const e=this.editor,n=t.t,i=this._prepareIntegrations();if(!i.length)return null;let r;const s=i[0];if(i.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new sr(t,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=on(t,r),c=i.map(({observable:l})=>typeof l=="function"?l():l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=i.map(({formViewCreator:h})=>h(i.length==1)),d=new f2(e.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),e=[];if(!t.length)return Q("image-insert-integrations-not-specified"),e;for(const n of t)this._integrations.has(n)?e.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||Q("image-insert-unknown-integration",{item:n});return e.length||Q("image-insert-integrations-not-registered"),e}}var tm=P(265),b2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(tm.A,b2),tm.A.locals;class w2 extends R{static get requires(){return[Zp,di,Hp,Xp]}static get pluginName(){return"ImageBlock"}}class A2 extends R{static get requires(){return[xa,Kp,ce,Qp,xe]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),e.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new $p(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,e("image widget"))}),n.for("downcast").add(Dr(i,"imageInline","src")).add(Dr(i,"imageInline","alt")).add(Up(i,"imageInline")),n.for("upcast").elementToElement({view:Np(t,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isBlockImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(ya(e.schema,d)==="imageInline"){const h=new nn(n.document),u=c.map(g=>g.childCount===1?(Array.from(g.getAttributes()).forEach(p=>h.setAttribute(...p,i.findViewImgElement(g))),g.getChild(0)):g);a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&i.setImageNaturalSizeAttributes(d)})})}}class C2 extends R{static get requires(){return[A2,di,Hp,Xp]}static get pluginName(){return"ImageInline"}}class em extends R{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[ce]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),n=t.getFirstPosition().findAncestor("caption");return n&&e.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return t.name=="figcaption"&&e.isBlockImageView(t.parent)?{name:!0}:null}}class _2 extends st{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils"),n=t.plugins.get("ImageUtils");if(!t.plugins.has(Zp))return this.isEnabled=!1,void(this.value=!1);const i=t.model.document.selection,r=i.getSelectedElement();if(!r){const s=e.getCaptionFromModelSelection(i);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(r):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,e)})}_showImageCaption(t,e){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=i._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||t.createElement("caption");t.append(c,s),e&&t.setSelection(c,"in")}_hideImageCaption(t){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageCaptionEditing"),r=e.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),i._saveCaption(a,s),t.setSelection(a,"on"),t.remove(s)}}class v2 extends R{constructor(t){super(t),this._savedCaptionsMap=new WeakMap}static get requires(){return[ce,em]}static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.model.schema;e.isRegistered("caption")?e.extend("caption",{allowIn:"imageBlock"}):e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),t.commands.add("toggleImageCaption",new _2(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils"),r=t.t;t.conversion.for("upcast").elementToElement({view:s=>i.matchImageCaptionViewElement(s),model:"caption"}),t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>{if(!n.isBlockImage(s.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),c.placeholder=r("Enter image caption"),_l({view:e,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return Bg(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.plugins.get("ImageCaptionUtils"),i=t.commands.get("imageTypeInline"),r=t.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(e.isBlockImage(c)){const h=n.getCaptionFromImageModelElement(c);if(h)return void this._saveCaption(l,h)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};i&&this.listenTo(i,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?Ct.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor,e=t.model,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",()=>{const r=e.document.differ.getChanges();for(const s of r){if(s.attributeKey!=="alt")continue;const a=s.range.start.nodeAfter;if(n.isBlockImage(a)){const c=i.getCaptionFromImageModelElement(a);if(!c)return;t.editing.reconvertItem(c)}}})}}class y2 extends R{static get requires(){return[em]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),i=t.t;t.ui.componentFactory.add("toggleImageCaption",r=>{const s=t.commands.get("toggleImageCaption"),a=new wt(r);return a.set({icon:ot.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>i(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(t.model.document.selection);if(c){const l=t.editing.mapper.toViewElement(c);e.scrollToTheSelection(),e.change(d=>{d.addClass("image__caption_highlighted",l)})}t.editing.view.focus()}),a})}}var nm=P(5247),x2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(nm.A,x2),nm.A.locals;function om(o){const t=o.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function E2(o){return new Promise((t,e)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=im(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});t(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=$.document.createElement("img");l.addEventListener("load",()=>{const d=$.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(h=>h?a(h):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=im(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(t).catch(e):e(i))})}function im(o,t){return o.type?o.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class D2 extends R{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,n=i=>{const r=new sy(i),s=t.commands.get("uploadImage"),a=t.config.get("image.upload.types"),c=om(a);return r.set({acceptedType:a.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:e("Upload image from computer"),icon:ot.imageUpload,tooltip:!0}),r.bind("isEnabled").to(s),r.on("done",(l,d)=>{const h=Array.from(d).filter(u=>c.test(u.type));h.length&&(t.execute("uploadImage",{file:h}),t.editing.view.focus())}),r};if(t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"upload",observable:()=>t.commands.get("uploadImage"),buttonViewCreator:()=>{const r=t.ui.componentFactory.create("uploadImage");return r.bind("label").to(i,"isImageSelected",s=>e(s?"Replace image from computer":"Upload image from computer")),r},formViewCreator:()=>{const r=t.ui.componentFactory.create("uploadImage");return r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>e(s?"Replace from computer":"Upload from computer")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}var rm=P(2267),I2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(rm.A,I2),rm.A.locals;var sm=P(7693),S2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(sm.A,S2),sm.A.locals;var am=P(1559),T2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(am.A,T2),am.A.locals;class M2 extends R{constructor(t){super(t),this.uploadStatusChange=(e,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,e.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(je),d=a?n.attributeNewValue:null,h=this.placeholder,u=r.editing.mapper.toViewElement(s),g=i.writer;if(d=="reading")return cm(u,g),void lm(c,h,u,g);if(d=="uploading"){const p=l.loaders.get(a);return cm(u,g),void(p?(dm(u,g),function(k,b,A,E){const M=function(z){const G=z.createUIElement("div",{class:"ck-progress-bar"});return z.setCustomProperty("progressBar",!0,G),G}(b);b.insert(b.createPositionAt(k,"end"),M),A.on("change:uploadedPercent",(z,G,tt)=>{E.change(at=>{at.setStyle("width",tt+"%",M)})})}(u,g,p,r.editing.view),function(k,b,A,E){if(E.data){const M=k.findViewImgElement(b);A.setAttribute("src",E.data,M)}}(c,u,g,p)):lm(c,h,u,g))}d=="complete"&&l.loaders.get(a)&&function(p,k,b){const A=k.createUIElement("div",{class:"ck-image-upload-complete-icon"});k.insert(k.createPositionAt(p,"end"),A),setTimeout(()=>{b.change(E=>E.remove(E.createRangeOn(A)))},3e3)}(u,g,r.editing.view),function(p,k){um(p,k,"progressBar")}(u,g),dm(u,g),function(p,k){k.removeClass("ck-appear",p)}(u,g)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),t.plugins.has("ImageInlineEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function cm(o,t){o.hasClass("ck-appear")||t.addClass("ck-appear",o)}function lm(o,t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const i=o.findViewImgElement(e);i.getAttribute("src")!==t&&n.setAttribute("src",t,i),hm(e,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function dm(o,t){o.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",o),um(o,t,"placeholder")}function hm(o,t){for(const e of o.getChildren())if(e.getCustomProperty(t))return e}function um(o,t,e){const n=hm(o,e);n&&t.remove(t.createRangeOn(n))}var B2=Object.defineProperty,N2=Object.defineProperties,P2=Object.getOwnPropertyDescriptors,gm=Object.getOwnPropertySymbols,O2=Object.prototype.hasOwnProperty,L2=Object.prototype.propertyIsEnumerable,pm=(o,t,e)=>t in o?B2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class z2 extends st{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=Et(t.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(t,e,n){const i=this.editor,r=i.plugins.get(je).createLoader(t),s=i.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var h in d||(d={}))O2.call(d,h)&&pm(l,h,d[h]);if(gm)for(var h of gm(d))L2.call(d,h)&&pm(l,h,d[h]);return l})({},e),c={uploadId:r.id},N2(a,P2(c))),n)}}class R2 extends R{constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[je,ca,xe,ce]}static get pluginName(){return"ImageUploadEditing"}init(){const t=this.editor,e=t.model.document,n=t.conversion,i=t.plugins.get(je),r=t.plugins.get("ImageUtils"),s=t.plugins.get("ClipboardPipeline"),a=om(t.config.get("image.upload.types")),c=new z2(t);t.commands.add("uploadImage",c),t.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(l,d)=>{if(h=d.dataTransfer,Array.from(h.types).includes("text/html")&&h.getData("text/html")!=="")return;var h;const u=Array.from(d.dataTransfer.files).filter(g=>!!g&&a.test(g.type));u.length&&(l.stop(),t.model.change(g=>{d.targetRanges&&g.setSelection(d.targetRanges.map(p=>t.editing.mapper.toModelRange(p))),t.execute("uploadImage",{file:u})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const h=Array.from(t.editing.view.createRangeIn(d.content)).map(g=>g.item).filter(g=>function(p,k){return!(!p.isInlineImageView(k)||!k.getAttribute("src")||!k.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!k.getAttribute("src").match(/^blob:/g))}(r,g)&&!g.getAttribute("uploadProcessed")).map(g=>({promise:E2(g),imageElement:g}));if(!h.length)return;const u=new nn(t.editing.view.document);for(const g of h){u.setAttribute("uploadProcessed",!0,g.imageElement);const p=i.createLoader(g.promise);p&&(u.setAttribute("src","",g.imageElement),u.setAttribute("uploadId",p.id,g.imageElement))}}),t.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),e.on("change",()=>{const l=e.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const h of l)if(h.type=="insert"&&h.name!="$text"){const u=h.position.nodeAfter,g=h.position.root.rootName=="$graveyard";for(const p of j2(t,u)){const k=p.getAttribute("uploadId");if(!k)continue;const b=i.loaders.get(k);b&&(g?d.has(k)||b.abort():(d.add(k),this._uploadImageElements.set(k,p),b.status=="idle"&&this._readAndUpload(b)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:h})=>{const u=h.urls?h.urls:h;this.editor.model.change(g=>{g.setAttribute("src",u.default,d),this._parseAndSetSrcsetAttributeOnImage(u,d,g),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(t){const e=this.editor,n=e.model,i=e.locale.t,r=e.plugins.get(je),s=e.plugins.get(ca),a=e.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(t.id))}),t.read().then(()=>{const d=t.upload(),h=c.get(t.id);if(f.isSafari){const u=e.editing.mapper.toViewElement(h),g=a.findViewImgElement(u);e.editing.view.once("render",()=>{if(!g.parent)return;const p=e.editing.view.domConverter.mapViewToDom(g.parent);if(!p)return;const k=p.style.display;p.style.display="none",p._ckHack=p.offsetHeight,p.style.display=k})}return n.enqueueChange({isUndoable:!1},u=>{u.setAttribute("uploadStatus","uploading",h)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},h=>{const u=c.get(t.id);h.setAttribute("uploadStatus","complete",u),this.fire("uploadComplete",{data:d,imageElement:u})}),l()}).catch(d=>{if(t.status!=="error"&&t.status!=="aborted")throw d;t.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},h=>{h.remove(c.get(t.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const h=c.get(t.id);d.removeAttribute("uploadId",h),d.removeAttribute("uploadStatus",h),c.delete(t.id)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const r=Object.keys(t).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${t[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};e.hasAttribute("width")||e.hasAttribute("height")||(s.width=i),n.setAttributes(s,e)}}}function j2(o,t){const e=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(t)).filter(n=>e.isImage(n.item)).map(n=>n.item)}var mm=P(3469),F2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(mm.A,F2),mm.A.locals;class V2 extends st{constructor(t,e){super(t),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(e.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled?t.hasAttribute("imageStyle")?this.value=t.getAttribute("imageStyle"):this.value=this._defaultStyles[t.name]:this.value=!1}execute(t={}){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils");n.change(r=>{const s=t.value,{setImageSizes:a=!0}=t;let c=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(i.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&i.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(t,e){return!this._styles.get(t).modelElements.includes(e.name)}}var H2=Object.defineProperty,fm=Object.getOwnPropertySymbols,U2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,km=(o,t,e)=>t in o?H2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,bm=(o,t)=>{for(var e in t||(t={}))U2.call(t,e)&&km(o,e,t[e]);if(fm)for(var e of fm(t))q2.call(t,e)&&km(o,e,t[e]);return o};const{objectFullWidth:G2,objectInline:wm,objectLeft:Am,objectRight:Ea,objectCenter:Da,objectBlockLeft:Cm,objectBlockRight:_m}=ot,Sr={get inline(){return{name:"inline",title:"In line",icon:wm,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Am,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Cm,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Da,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Ea,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:_m,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Da,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Ea,modelElements:["imageBlock"],className:"image-style-side"}}},vm={full:G2,left:Cm,right:_m,center:Da,inlineLeft:Am,inlineRight:Ea,inline:wm},ym=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function xm(o){Q("image-style-configuration-definition-invalid",o)}const Ia={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(t=>function(e){return e=typeof e=="string"?Sr[e]?bm({},Sr[e]):{name:e}:function(n,i){const r=bm({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(Sr[e.name],e),typeof e.icon=="string"&&(e.icon=vm[e.icon]||e.icon),e}(t)).filter(t=>function(e,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=e;if(!(r&&r.length&&s))return xm({style:e}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(c=>a.includes(c)))return Q("image-style-missing-dependency",{style:e,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(t,o))},getDefaultStylesConfiguration:function(o,t){return o&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...ym]:[]},warnInvalidStyle:xm,DEFAULT_OPTIONS:Sr,DEFAULT_ICONS:vm,DEFAULT_DROPDOWN_DEFINITIONS:ym};function Em(o,t){for(const e of t)if(e.name===o)return e}class Dm extends R{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[ce]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=Ia,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,r)),this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new V2(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const h=Em(l.attributeNewValue,s),u=Em(l.attributeOldValue,s),g=d.mapper.toViewElement(l.item),p=d.writer;u&&p.removeClass(u.className,g),h&&p.addClass(h.className,g)});var s;const a=function(c){const l={imageInline:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,h,u)=>{if(!h.modelRange)return;const g=h.viewItem,p=Wt(h.modelRange.getItems());if(p&&u.schema.checkAttribute(p,"imageStyle"))for(const k of l[p.name])u.consumable.consume(g,{classes:k.className})&&u.writer.setAttribute("imageStyle",k.name,p)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),t&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),e&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const t=this.editor,e=t.model.document,n=t.plugins.get(ce),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));e.registerPostFixer(r=>{let s=!1;for(const a of e.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let c=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!n.isImage(c))continue;const l=c.getAttribute("imageStyle");if(!l)continue;const d=i.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Im=P(6386),W2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Im.A,W2),Im.A.locals;class K2 extends R{static get requires(){return[Dm]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],n=Sm(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Sm([...e.filter(bt),...Ia.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,i=>{let r;const{defaultItem:s,items:a,title:c}=t,l=a.filter(g=>e.find(({name:p})=>Tm(p)===g)).map(g=>{const p=n.create(g);return g===s&&(r=p),p});a.length!==l.length&&Ia.warnInvalidStyle({dropdown:t});const d=on(i,sr),h=d.buttonView,u=h.arrowView;return oa(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:Mm(c,r.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:c}),h.bind("icon").toMany(l,"isOn",(...g)=>{const p=g.findIndex(gn);return p<0?r.icon:l[p].icon}),h.bind("label").toMany(l,"isOn",(...g)=>{const p=g.findIndex(gn);return Mm(c,p<0?r.label:l[p].label)}),h.bind("isOn").toMany(l,"isOn",(...g)=>g.some(gn)),h.bind("class").toMany(l,"isOn",(...g)=>g.some(gn)?"ck-splitbutton_flatten":void 0),h.on("execute",()=>{l.some(({isOn:g})=>g)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...g)=>g.some(gn)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(Tm(e),n=>{const i=this.editor.commands.get("imageStyle"),r=new wt(n);return r.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===e),r.on("execute",this._executeCommand.bind(this,e)),r})}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function Sm(o,t){for(const e of o)t[e.title]&&(e.title=t[e.title]);return o}function Tm(o){return`imageStyle:${o}`}function Mm(o,t){return(o?o+": ":"")+t}class $2 extends R{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new fl(t)),t.commands.add("outdent",new fl(t))}}class Y2 extends R{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?ot.indent:ot.outdent,r=e.uiLanguageDirection=="ltr"?ot.outdent:ot.indent;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,r=>{const s=i.commands.get(t),a=new wt(r);return a.set({label:e,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(t),i.editing.view.focus()}),a})}}class Q2{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(e=>this._definitions.add(e)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(e,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const c=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,c);for(const l in a.styles)r.setStyle(l,a.styles[l],c);r.setCustomProperty("link",!0,c),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),c):r.wrap(i.mapper.toViewRange(n.range),c):r.unwrap(i.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",(e,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(c=>c.is("element","a"));for(const c of this._definitions){const l=We(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,h]of l)d==="class"?i.addClass(h,a):i.setAttribute(d,h,a);c.classes&&i.addClass(c.classes,a);for(const d in c.styles)i.setStyle(d,c.styles[d],a)}else{for(const[d,h]of l)d==="class"?i.removeClass(h,a):i.removeAttribute(d,a);c.classes&&i.removeClass(c.classes,a);for(const d in c.styles)i.removeStyle(d,a)}}})}}}const Z2=function(o,t,e){var n=o.length;return e=e===void 0?n:e,!t&&e>=n?o:Il(o,t,e)};var J2=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Bm=function(o){return J2.test(o)},X2=function(o){return o.split("")};var Nm="\\ud800-\\udfff",tx="["+Nm+"]",Sa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ta="\\ud83c[\\udffb-\\udfff]",Pm="[^"+Nm+"]",Om="(?:\\ud83c[\\udde6-\\uddff]){2}",Lm="[\\ud800-\\udbff][\\udc00-\\udfff]",zm="(?:"+Sa+"|"+Ta+")?",Rm="[\\ufe0e\\ufe0f]?",ex=Rm+zm+("(?:\\u200d(?:"+[Pm,Om,Lm].join("|")+")"+Rm+zm+")*"),nx="(?:"+[Pm+Sa+"?",Sa,Om,Lm,tx].join("|")+")",ox=RegExp(Ta+"(?="+Ta+")|"+nx+ex,"g");const ix=function(o){return o.match(ox)||[]},rx=function(o){return Bm(o)?ix(o):X2(o)},sx=function(o){return function(t){t=ws(t);var e=Bm(t)?rx(t):void 0,n=e?e[0]:t.charAt(0),i=e?Z2(e,1).join(""):t.slice(1);return n[o]()+i}}("toUpperCase"),ax=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,cx=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,lx=/^((\w+:(\/{2,})?)|(\W))/i,dx=["https?","ftps?","mailto"],Tr="Ctrl+K";function jm(o,{writer:t}){const e=t.createAttributeElement("a",{href:o},{priority:5});return t.setCustomProperty("link",!0,e),e}function Fm(o,t=dx){const e=String(o),n=t.join("|");return function(i,r){return!!i.replace(ax,"").match(r)}(e,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?e:"#"}function Ma(o,t){return!!o&&t.checkAttribute(o.name,"linkHref")}function Ba(o,t){const e=(n=o,cx.test(n)?"mailto:":t);var n;const i=!!e&&!Vm(o);return o&&i?e+o:o}function Vm(o){return lx.test(o)}function Hm(o){window.open(o,"_blank","noopener")}class hx extends st{constructor(){super(...arguments),this.manualDecorators=new Be,this.automaticDecorators=new Q2}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||Wt(e.getSelectedBlocks());Ma(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in e)e[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const c=i.getFirstPosition();if(i.hasAttribute("linkHref")){const l=Um(i);let d=br(c,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,t)),a.setAttribute("linkHref",t,d),r.forEach(h=>{a.setAttribute(h,!0,d)}),s.forEach(h=>{a.removeAttribute(h,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(t!==""){const l=We(i.getAttributes());l.set("linkHref",t),r.forEach(h=>{l.set(h,!0)});const{end:d}=n.insertContent(a.createText(t,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(i.getRanges(),"linkHref"),l=[];for(const h of i.getSelectedBlocks())n.schema.checkAttribute(h,"linkHref")&&l.push(a.createRangeOn(h));const d=l.slice();for(const h of c)this._isRangeToUpdate(h,l)&&d.push(h);for(const h of d){let u=h;if(d.length===1){const g=Um(i);i.getAttribute("linkHref")===g&&(u=this._updateLinkContent(n,a,h,t),a.setSelection(a.createSelection(u)))}a.setAttribute("linkHref",t,u),r.forEach(g=>{a.setAttribute(g,!0,u)}),s.forEach(g=>{a.removeAttribute(g,u)})}}})}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return Ma(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}_updateLinkContent(t,e,n,i){const r=e.createText(i,{linkHref:i});return t.insertContent(r,n)}}function Um(o){if(o.isCollapsed){const t=o.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(o.getFirstRange().getItems());if(t.length>1)return null;const e=t[0];return e.is("$text")||e.is("$textProxy")?e.data:null}}class ux extends st{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();Ma(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change(r=>{const s=n.isCollapsed?[br(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const c of i.manualDecorators)r.removeAttribute(c.id,a)})}}class gx extends ft(){constructor({id:t,label:e,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=t,this.set("value",void 0),this.defaultValue=s,this.label=e,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var qm=P(7719),px={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(qm.A,px),qm.A.locals;var mx=Object.defineProperty,Gm=Object.getOwnPropertySymbols,fx=Object.prototype.hasOwnProperty,kx=Object.prototype.propertyIsEnumerable,Wm=(o,t,e)=>t in o?mx(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,bx=(o,t)=>{for(var e in t||(t={}))fx.call(t,e)&&Wm(o,e,t[e]);if(Gm)for(var e of Gm(t))kx.call(t,e)&&Wm(o,e,t[e]);return o};const Km="automatic",wx=/^(https?:)?\/\//;class $m extends R{static get pluginName(){return"LinkEditing"}static get requires(){return[Cg,pg,xe]}constructor(t){super(t),t.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const t=this.editor,e=this.editor.config.get("link.allowedProtocols");t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:jm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(i,r)=>jm(Fm(i,e),r)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:i=>i.getAttribute("href")}}),t.commands.add("link",new hx(t)),t.commands.add("unlink",new ux(t));const n=function(i,r){const s={"Open in a new tab":i("Open in a new tab"),Downloadable:i("Downloadable")};return r.forEach(a=>("label"in a&&s[a.label]&&(a.label=s[a.label]),a)),r}(t.t,function(i){const r=[];if(i)for(const[s,a]of Object.entries(i)){const c=Object.assign({},a,{id:`link${sx(s)}`});r.push(c)}return r}(t.config.get("link.decorators")));this._enableAutomaticDecorators(n.filter(i=>i.mode===Km)),this._enableManualDecorators(n.filter(i=>i.mode==="manual")),t.plugins.get(Cg).registerAttribute("linkHref"),function(i,r,s,a){const c=i.editing.view,l=new Set;c.document.registerPostFixer(d=>{const h=i.model.document.selection;let u=!1;if(h.hasAttribute(r)){const g=br(h.getFirstPosition(),r,h.getAttribute(r),i.model),p=i.editing.mapper.toViewRange(g);for(const k of p.getItems())k.is("element",s)&&!k.hasClass(a)&&(d.addClass(a,k),l.add(k),u=!0)}return u}),i.conversion.for("editingDowncast").add(d=>{function h(){c.change(u=>{for(const g of l.values())u.removeClass(a,g),l.delete(g)})}d.on("insert",h,{priority:"highest"}),d.on("remove",h,{priority:"highest"}),d.on("attribute",h,{priority:"highest"}),d.on("selection",h,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:Km,callback:i=>!!i&&wx.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(i=>{e.model.schema.extend("$text",{allowAttributes:i.id});const r=new gx(i);n.add(r),e.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:c},{item:l})=>{if((l.is("selection")||c.isInline(l))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const h in r.styles)a.setStyle(h,r.styles[h],d);return a.setCustomProperty("link",!0,d),d}}}),e.conversion.for("upcast").elementToAttribute({view:bx({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(n,i)=>{if(!(f.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),Hm(s))},{context:"$capture"}),this.listenTo(e,"keydown",(n,i)=>{const r=t.commands.get("link").value;r&&i.keyCode===ut.enter&&i.altKey&&(n.stop(),Hm(r))})}_enableSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(e,"change:attribute",(n,{attributeKeys:i})=>{i.includes("linkHref")&&!e.hasAttribute("linkHref")&&t.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=t.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const t=this.editor,e=t.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{e.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=Ba(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var Ym=P(3817),Ax={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Ym.A,Ax),Ym.A.locals;class Cx extends et{constructor(t,e){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve;const n=t.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),m({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new or(this.locale,ar);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new nr(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const n=new et;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(n)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var Qm=P(8762),_x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Qm.A,_x),Qm.A.locals;class vx extends et{constructor(t,e={}){super(t),this.focusTracker=new Qt,this.keystrokes=new oe,this._focusables=new ve;const n=t.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),ot.pencil,"edit"),this.set("href",void 0),this._linkConfig=e,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new wt(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new wt(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",i=>i&&Fm(i,this._linkConfig.allowedProtocols)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",i=>i||n("This link has no URL")),t.bind("isEnabled").to(this,"href",i=>!!i),t.template.tag="a",t.template.eventListeners={},t}}const Qe="link-ui";class yx extends R{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[gr]}static get pluginName(){return"LinkUI"}init(){const t=this.editor,e=this.editor.t;t.editing.view.addObserver(MC),this._balloon=t.plugins.get(gr),this._createToolbarLinkButton(),this._enableBalloonActivators(),t.conversion.for("editingDowncast").markerToHighlight({model:Qe,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Qe,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Create link"),keystroke:Tr},{label:e("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new vx(t.locale,t.config.get("link")),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),e.keystrokes.set(Tr,(r,s)=>{this._addFormView(),s()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=t.config.get("link.allowCreatingEmptyLinks"),r=new(x(Cx))(t.locale,e);return r.urlInputView.fieldView.bind("value").to(e,"value"),r.urlInputView.bind("isEnabled").to(e,"isEnabled"),r.saveButtonView.bind("isEnabled").to(e,"isEnabled",r.urlInputView,"isEmpty",(s,a)=>s&&(i||!a)),this.listenTo(r,"submit",()=>{const{value:s}=r.urlInputView.fieldView.element,a=Ba(s,n);t.execute("link",a,r.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(r,"cancel",()=>{this._closeFormView()}),r.keystrokes.set("Esc",(s,a)=>{this._closeFormView(),a()}),r}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.ui.componentFactory.add("link",i=>{const r=new wt(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=Tr,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(e,"isEnabled"),r.bind("isOn").to(e,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),t.keystrokes.set(Tr,(n,i)=>{i(),t.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),v({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=t.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),t.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=c};function s(){return e.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(t.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return!!this.formView&&t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i;if(e.markers.has(Qe)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Qe)),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));i=t.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?t.domConverter.mapViewToDom(r):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&Ut(n))return Na(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),r=Na(i.start),s=Na(i.end);return r&&r==s&&t.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(Qe))e.updateMarker(Qe,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!t.schema.isContent(r),{boundaries:n});e.addMarker(Qe,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(Qe,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Qe)&&t.change(e=>{e.removeMarker(Qe)})}}function Na(o){return o.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})||null}const Zm=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class xx extends R{static get requires(){return[sn,$m]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(t,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?br(e,"linkHref",e.textNode.getAttribute("linkHref"),t):null}_selectEntireLinks(t,e){const n=this.editor.model,i=n.document.selection,r=i.getFirstPosition(),s=i.getLastPosition();let a=e.getJoined(this._expandLinkRange(n,r)||e);a&&(a=a.getJoined(this._expandLinkRange(n,s)||e)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&t.setSelection(a)}_enablePasteLinking(){const t=this.editor,e=t.model,n=e.document.selection,i=t.plugins.get("ClipboardPipeline"),r=t.commands.get("link");i.on("inputTransformation",(s,a)=>{if(!this.isEnabled||!r.isEnabled||n.isCollapsed||a.method!=="paste"||n.rangeCount>1)return;const c=n.getFirstRange(),l=a.dataTransfer.getData("text/plain");if(!l)return;const d=l.match(Zm);d&&d[2]===l&&(e.change(h=>{this._selectEntireLinks(h,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const t=this.editor,e=new Ag(t.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Jm(n.substr(0,n.length-1));return i?{url:i}:void 0});e.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=t.model.createRange(l,c);this._applyAutoLink(a,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=e.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition(),r=e.createRange(e.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=wg(t,e),r=Jm(n);if(r){const s=e.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(t,e){const n=this.editor.model,i=Ba(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(e,n)&&Vm(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",t,e),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Jm(o){const t=Zm.exec(o);return t?t[2]:null}var Xm=P(4808),Ex={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Xm.A,Ex),Xm.A.locals;class De{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=Et(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){return Wt(new this(t,e)[Symbol.iterator]())}*[Symbol.iterator](){const t=[];for(const{node:e}of gi(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(i=>e.getAttribute(i)!==this._startElement.getAttribute(i)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*gi(o,t="forward"){const e=t=="forward",n=[];let i=null;for(;$t(o);){let r=null;if(i){const s=o.getAttribute("listIndent"),a=i.getAttribute("listIndent");s>a?n[a]=i:st in o?Ix(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Pa=(o,t)=>{for(var e in t||(t={}))Mx.call(t,e)&&ef(o,e,t[e]);if(tf)for(var e of tf(t))Bx.call(t,e)&&ef(o,e,t[e]);return o},Oa=(o,t)=>Sx(o,Tx(t));class Ao{static next(){return X()}}function $t(o){return!!o&&o.is("element")&&o.hasAttribute("listItemId")}function La(o,t={}){return[...Cn(o,Oa(Pa({},t),{direction:"backward"})),...Cn(o,Oa(Pa({},t),{direction:"forward"}))]}function Cn(o,t={}){const e=t.direction=="forward",n=Array.from(new De(o,Oa(Pa({},t),{includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"})));return e?n:n.reverse()}function nf(o){const t=new De(o,{sameIndent:!0,sameAttributes:"listType"}),e=new De(o,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(t).reverse(),...e]}function Hn(o){return!De.first(o,{sameIndent:!0,sameAttributes:"listItemId"})}function of(o){return!De.first(o,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function pi(o,t={}){o=Et(o);const e=t.withNested!==!1,n=new Set;for(const i of o)for(const r of La(i,{higherIndent:e}))n.add(r);return Un(n)}function Nx(o){o=Et(o);const t=new Set;for(const e of o)for(const n of nf(e))t.add(n);return Un(t)}function za(o,t){const e=Cn(o,{direction:"forward"}),n=Ao.next();for(const i of e)t.setAttribute("listItemId",n,i);return e}function Ra(o,t,e){const n={};for(const[r,s]of t.getAttributes())r.startsWith("list")&&(n[r]=s);const i=Cn(o,{direction:"forward"});for(const r of i)e.setAttributes(n,r);return i}function ja(o,t,{expand:e,indentBy:n=1}={}){o=Et(o);const i=e?pi(o):o;for(const r of i){const s=r.getAttribute("listIndent")+n;s<0?Mr(r,t):t.setAttribute("listIndent",s,r)}return i}function Mr(o,t){o=Et(o);for(const e of o)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of o)for(const n of e.getAttributeKeys())n.startsWith("list")&&t.removeAttribute(n,e);return o}function mi(o){if(!o.length)return!1;const t=o[0].getAttribute("listItemId");return!!t&&!o.some(e=>e.getAttribute("listItemId")!=t)}function Un(o){return Array.from(o).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function fi(o){const t=o.document.selection.getSelectedElement();return t&&o.schema.isObject(t)&&o.schema.isBlock(t)?t:null}function Fa(o,t){return t.checkChild(o.parent,"listItem")&&t.checkChild(o,"$text")&&!t.isObject(o)}function Px(o,t,e){return Cn(t,{direction:"forward"}).pop().index>o.index?Ra(o,t,e):[]}class rf extends st{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=sf(t.document.selection);t.change(n=>{const i=[];mi(e)&&!Hn(e[0])?(this._direction=="forward"&&i.push(...ja(e,n)),i.push(...za(e[0],n))):this._direction=="forward"?i.push(...ja(e,n,{expand:!0})):i.push(...function(r,s){const a=pi(r=Et(r)),c=new Set,l=Math.min(...a.map(h=>h.getAttribute("listIndent"))),d=new Map;for(const h of a)d.set(h,De.first(h,{lowerIndent:!0}));for(const h of a){if(c.has(h))continue;c.add(h);const u=h.getAttribute("listIndent")-1;if(u<0)Mr(h,s);else{if(h.getAttribute("listIndent")==l){const g=Px(h,d.get(h),s);for(const p of g)c.add(p);if(g.length)continue}s.setAttribute("listIndent",u,h)}}return Un(c)}(e,n));for(const r of i){if(!r.hasAttribute("listType"))continue;const s=De.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",Un(new Set(t)))}_checkEnabled(){let t=sf(this.editor.model.document.selection),e=t[0];if(!e)return!1;if(this._direction=="backward"||mi(t)&&!Hn(t[0]))return!0;t=pi(t),e=t[0];const n=De.first(e,{sameIndent:!0});return!!n&&n.getAttribute("listType")==e.getAttribute("listType")}}function sf(o){const t=Array.from(o.getSelectedBlocks()),e=t.findIndex(n=>!$t(n));return e!=-1&&(t.length=e),t}class af extends st{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=fi(e),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>e.schema.checkAttribute(a,"listType")||Fa(a,e.schema)),s=t.forceValue!==void 0?!t.forceValue:this.value;e.change(a=>{if(s){const c=r[r.length-1],l=Cn(c,{direction:"forward"}),d=[];l.length>1&&d.push(...za(l[1],a)),d.push(...Mr(r,a)),d.push(...function(h,u){const g=[];let p=Number.POSITIVE_INFINITY;for(const{node:k}of gi(h.nextSibling,"forward")){const b=k.getAttribute("listIndent");if(b==0)break;b{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,t),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const u=(h=a,Array.from(new De(h,{direction:"forward",higherIndent:!0})));i.push(...ja([a,...u],r,{indentBy:c-l,expand:c{const e=za(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",Un(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&$t(e)&&!Hn(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?t:t.nextSibling}}class Ox extends R{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(t){return Nx(t)}isFirstBlockOfListItem(t){return Hn(t)}isListItemBlock(t){return $t(t)}expandListBlocksToCompleteItems(t,e={}){return pi(t,e)}}function df(o){return o.is("element","ol")||o.is("element","ul")}function Br(o){return o.is("element","li")}function Lx(o,t,e,n=uf(e,t)){return o.createAttributeElement(hf(e),null,{priority:2*t/100-100,id:n})}function zx(o,t,e){return o.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function hf(o){return o=="numbered"?"ol":"ul"}function uf(o,t){return`list-${o}-${t}`}function Fe(o,t){const e=o.nodeBefore;if($t(e)){let n=e;for(const{node:i}of gi(n,"backward"))if(n=i,t.has(n))return;t.set(e,n)}else{const n=o.nodeAfter;$t(n)&&t.set(n,n)}}function Rx(){return(o,t,e)=>{const{writer:n,schema:i}=e;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(h=>i.checkAttribute(h,"listItemId"));if(!r.length)return;const s=Ao.next(),a=function(h){let u=0,g=h.parent;for(;g;){if(Br(g))u++;else{const p=g.previousSibling;p&&Br(p)&&u++}g=g.parent}return u}(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");l&&(c=l);const d={listItemId:s,listIndent:a,listType:c};for(const h of r)h.hasAttribute("listItemId")||n.setAttributes(d,h);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&e.keepEmptyElement(r[0])}}function gf(){return(o,t,e)=>{if(!e.consumable.test(t.viewItem,{name:!0}))return;const n=new nn(t.viewItem.document);for(const i of Array.from(t.viewItem.getChildren()))Br(i)||df(i)||n.remove(i)}}function pf(o,t,e,{dataPipeline:n}={}){const i=function(r){return(s,a)=>{const c=[];for(const l of r)s.hasAttribute(l)&&c.push(`attribute:${l}`);return!!c.every(l=>a.test(s,l)!==!1)&&(c.forEach(l=>a.consume(s,l)),!0)}}(o);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,h=s.item;if(!o.includes(s.attributeKey)||!i(h,d))return;const u=function(p,k,b){const A=b.createRangeOn(p);return k.toViewRange(A).getTrimmed().end.nodeBefore}(h,l,e);(function(p,k,b){for(;p.parent.is("attributeElement")&&p.parent.getCustomProperty("listItemWrapper");)k.unwrap(k.createRangeIn(p.parent),p.parent);const A=k.createPositionBefore(p).getWalker({direction:"backward"}),E=[];for(const{item:M}of A){if(M.is("element")&&b.toModelElement(M))break;M.is("element")&&M.getCustomProperty("listItemMarker")&&E.push(M)}for(const M of E)k.remove(M)})(u,c,l),function(p,k){let b=p.parent;for(;b.is("attributeElement")&&["ul","ol","li"].includes(b.name);){const A=b.parent;k.unwrap(k.createRangeOn(p),b),b=A}}(u,c);const g=function(p,k,b,A,{dataPipeline:E}){let M=A.createRangeOn(k);if(!Hn(p))return M;for(const z of b){if(z.scope!="itemMarker")continue;const G=z.createElement(A,p,{dataPipeline:E});if(!G||(A.setCustomProperty("listItemMarker",!0,G),A.insert(M.start,G),M=A.createRange(A.createPositionBefore(G),A.createPositionAfter(k)),!z.createWrapperElement||!z.canWrapElement))continue;const tt=z.createWrapperElement(A,p,{dataPipeline:E});A.setCustomProperty("listItemWrapper",!0,tt),z.canWrapElement(p)?M=A.wrap(M,tt):(M=A.wrap(A.createRangeOn(G),tt),M=A.createRange(M.start,A.createPositionAfter(k)))}return M}(h,u,t,c,{dataPipeline:n});(function(p,k,b,A){if(!p.hasAttribute("listIndent"))return;const E=p.getAttribute("listIndent");let M=p;for(let z=E;z>=0;z--){const G=zx(A,z,M.getAttribute("listItemId")),tt=Lx(A,z,M.getAttribute("listType"));for(const at of b)at.scope!="list"&&at.scope!="item"||!M.hasAttribute(at.attributeName)||at.setAttributeOnDowncast(A,M.getAttribute(at.attributeName),at.scope=="list"?tt:G);if(k=A.wrap(k,G),k=A.wrap(k,tt),z==0||(M=De.first(M,{lowerIndent:!0}),!M))break}})(h,g,t,c)}}function mf(o,{dataPipeline:t}={}){return(e,{writer:n})=>{if(!ff(e,o))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const i=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,i),i}}function ff(o,t,e=La(o)){if(!$t(o))return!1;for(const n of o.getAttributeKeys())if(!n.startsWith("selection:")&&!t.includes(n))return!1;return e.length<2}var kf=P(1232),jx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(kf.A,jx),kf.A.locals;var bf=P(6903),Fx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(bf.A,Fx),bf.A.locals;const Nr=["listType","listIndent","listItemId"];class Vx extends R{constructor(t){super(t),this._downcastStrategies=[],t.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[wr,sn,Ox,xe]}init(){const t=this.editor,e=t.model,n=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new _("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:Nr}),n?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const i of Nr)e.schema.setAttributeProperties(i,{copyOnReplace:!0});t.commands.add("numberedList",new af(t,"numbered")),t.commands.add("bulletedList",new af(t,"bulleted")),t.commands.add("indentList",new rf(t,"forward")),t.commands.add("outdentList",new rf(t,"backward")),t.commands.add("splitListItemBefore",new lf(t,"before")),t.commands.add("splitListItemAfter",new lf(t,"after")),n&&(t.commands.add("mergeListItemBackward",new cf(t,"backward")),t.commands.add("mergeListItemForward",new cf(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...Nr,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),n=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(i,r)=>{const s=t.model.document.selection;fi(t.model)||t.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!$t(c))return;if(De.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:wf(t.model,"backward")})}else of(c)||t.execute("splitListItemAfter"),t.execute("outdentList");r.preventDefault(),i.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:wf(t.model,"forward")}),r.preventDefault(),i.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,n=t.commands,i=n.get("enter");this.listenTo(t.editing.view.document,"enter",(r,s)=>{const a=e.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&$t(c)&&c.isEmpty&&!s.isSoft){const l=Hn(c),d=of(c);l&&d?(t.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(t.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(t.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(i,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&La(t.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,n=this.getListAttributeNames(),i=t.config.get("list.multiBlock"),r=i?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(s,{writer:a})=>a.createElement(r,{listType:""})}).elementToElement({view:"p",model:(s,{writer:a})=>s.parent&&s.parent.is("element","li")?a.createElement(r,{listType:""}):null,converterPriority:"high"}).add(s=>{s.on("element:li",Rx()),s.on("element:ul",gf(),{priority:"high"}),s.on("element:ol",gf(),{priority:"high"})}),i||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:r,view:mf(n),converterPriority:"high"}).add(s=>{s.on("attribute",pf(n,this._downcastStrategies,e))}),t.conversion.for("dataDowncast").elementToElement({model:r,view:mf(n,{dataPipeline:!0}),converterPriority:"high"}).add(s=>{s.on("attribute",pf(n,this._downcastStrategies,e,{dataPipeline:!0}))}),this.listenTo(e.document,"change:data",function(s,a,c,l){return()=>{const g=s.document.differ.getChanges(),p=[],k=new Map,b=new Set;for(const A of g)if(A.type=="insert"&&A.name!="$text")Fe(A.position,k),A.attributes.has("listItemId")?b.add(A.position.nodeAfter):Fe(A.position.getShiftedBy(A.length),k);else if(A.type=="remove"&&A.attributes.has("listItemId"))Fe(A.position,k);else if(A.type=="attribute"){const E=A.range.start.nodeAfter;c.includes(A.attributeKey)?(Fe(A.range.start,k),A.attributeNewValue===null?(Fe(A.range.start.getShiftedBy(1),k),h(E)&&p.push(E)):b.add(E)):$t(E)&&h(E)&&p.push(E)}for(const A of k.values())p.push(...d(A,b));for(const A of new Set(p))a.reconvertItem(A)};function d(g,p){const k=[],b=new Set,A=[];for(const{node:E,previous:M}of gi(g,"forward")){if(b.has(E))continue;const z=E.getAttribute("listIndent");M&&zc.includes(tt)));const G=Cn(E,{direction:"forward"});for(const tt of G)b.add(tt),(h(tt,G)||u(tt,A,p))&&k.push(tt)}return k}function h(g,p){const k=a.mapper.toViewElement(g);if(!k)return!1;if(l.fire("checkElement",{modelElement:g,viewElement:k}))return!0;if(!g.is("element","paragraph")&&!g.is("element","listItem"))return!1;const b=ff(g,c,p);return!(!b||!k.is("element","p"))||!(b||!k.is("element","span"))}function u(g,p,k){if(k.has(g))return!1;const b=a.mapper.toViewElement(g);let A=p.length-1;for(let E=b.parent;!E.is("editableElement");E=E.parent){const M=Br(E),z=df(E);if(!z&&!M)continue;const G="checkAttributes:"+(M?"item":"list");if(l.fire(G,{viewElement:E,modelAttributes:p[A]}))break;if(z&&(A--,A<0))return!1}return!0}}(e,t.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(s,{viewElement:a,modelAttributes:c})=>{a.id!=c.listItemId&&(s.return=!0,s.stop())}),this.on("checkAttributes:list",(s,{viewElement:a,modelAttributes:c})=>{a.name==hf(c.listType)&&a.id==uf(c.listType,c.listIndent)||(s.return=!0,s.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(n=>function(i,r,s,a){const c=i.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let h=!1;for(const g of c){if(g.type=="insert"&&g.name!="$text"){const p=g.position.nodeAfter;if(!i.schema.checkAttribute(p,"listItemId"))for(const k of Array.from(p.getAttributeKeys()))s.includes(k)&&(r.removeAttribute(k,p),h=!0);Fe(g.position,l),g.attributes.has("listItemId")||Fe(g.position.getShiftedBy(g.length),l);for(const{item:k,previousPosition:b}of i.createRangeIn(p))$t(k)&&Fe(b,l)}else g.type=="remove"?Fe(g.position,l):g.type=="attribute"&&s.includes(g.attributeKey)&&(Fe(g.range.start,l),g.attributeNewValue===null&&Fe(g.range.start.getShiftedBy(1),l));if(!d&&g.type=="attribute"&&Nr.includes(g.attributeKey)){const p=g.range.start.nodeAfter;g.attributeNewValue===null&&p&&p.is("element","listItem")?(r.rename(p,"paragraph"),h=!0):g.attributeOldValue===null&&p&&p.is("element")&&p.name!="listItem"&&(r.rename(p,"listItem"),h=!0)}}const u=new Set;for(const g of l.values())h=a.fire("postFixer",{listNodes:new Dx(g),listHead:g,writer:r,seenIds:u})||h;return h}(t,n,e,this)),this.on("postFixer",(n,{listNodes:i,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,h=!1;for(const{node:u}of s){const g=u.getAttribute("listIndent");if(g>c){let p;d===null?(d=g-c,p=c):(d>g&&(d=g),p=g-d),p>l+1&&(p=l+1),a.setAttribute("listIndent",p,u),h=!0,l=p}else d=null,c=g+1,l=g}return h}(i,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:i,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let h=!1;for(const{node:u}of a){if(d.has(u))continue;let g=u.getAttribute("listType"),p=u.getAttribute("listItemId");if(c.has(p)&&(p=Ao.next()),c.add(p),u.is("element","listItem"))u.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,u),h=!0);else for(const k of Cn(u,{direction:"forward"}))d.add(k),k.getAttribute("listType")!=g&&(p=Ao.next(),g=k.getAttribute("listType")),k.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,k),h=!0)}return h}(i,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(n){return(i,[r,s])=>{const a=r.is("documentFragment")?Array.from(r.getChildren()):[r];if(!a.length)return;const c=(s?n.createSelection(s):n.document.selection).getFirstPosition();let l;if($t(c.parent))l=c.parent;else{if(!$t(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const h=l.getAttribute("listType"),u=l.getAttribute("listIndent"),g=a[0].getAttribute("listIndent")||0,p=Math.max(u-g,0);for(const k of a){const b=$t(k);l.is("element","listItem")&&k.is("element","paragraph")&&d.rename(k,"listItem"),d.setAttributes({listIndent:(b?k.getAttribute("listIndent"):0)+p,listItemId:b?k.getAttribute("listItemId"):Ao.next(),listType:h},k)}})}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(n,i)=>{t.change(r=>{const s=Array.from(i.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every($t)&&r.remove(a),i.method=="copy"||i.method=="cut"){const c=Array.from(i.content.getChildren());mi(c)&&Mr(c,r)}})})}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function wf(o,t){const e=o.document.selection;if(!e.isCollapsed)return!fi(o);if(t==="forward")return!0;const n=e.getFirstPosition().parent,i=n.previousSibling;return!o.schema.isObject(i)&&(!!i.isEmpty||mi([n,i]))}function Af(o,t,e,n){o.ui.componentFactory.add(t,i=>{const r=o.commands.get(t),s=new wt(i);return s.set({label:e,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(t),o.editing.view.focus()}),s})}class Hx extends R{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;Af(this.editor,"numberedList",t("Numbered List"),ot.numberedList),Af(this.editor,"bulletedList",t("Bulleted List"),ot.bulletedList)}}class Ux extends R{static get requires(){return[Vx,Hx]}static get pluginName(){return"List"}}const qx=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:t,listType:e}of qx);var Cf=P(9968),Gx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Cf.A,Gx),Cf.A.locals;var _f=P(7141),Wx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(_f.A,Wx),_f.A.locals,jo("Ctrl+Enter");var vf=P(8991),Kx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(vf.A,Kx),vf.A.locals,jo("Ctrl+Enter");function yf(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=i.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(i.item),l=[...c.getChildren()].find(h=>h.getCustomProperty("media-content"));a.remove(l);const d=o.getMediaViewElement(a,s,t);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",e)}}function xf(o,t,e,n){return o.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(o,e,n),o.createSlot()])}function Ef(o){const t=o.getSelectedElement();return t&&t.is("element","media")?t:null}function Df(o,t,e,n){o.change(i=>{const r=i.createElement("media",{url:t});o.insertObject(r,e,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class $x extends st{refresh(){const t=this.editor.model,e=t.document.selection,n=Ef(e);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(i){const r=i.getSelectedElement();return!!r&&r.name==="media"}(e)||function(i,r){let a=Ng(i,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=Ef(n);i?e.change(r=>{r.setAttribute("url",t,i)}):Df(e,t,n,!0)}}class Yx{constructor(t,e){const n=e.providers,i=e.extraProviders||[],r=new Set(e.removeProviders),s=n.concat(i).filter(a=>{const c=a.name;return c?!r.has(c):(Q("media-embed-no-provider-name",{provider:a}),!1)});this.locale=t,this.providerDefinitions=s}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new If(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=Et(e.url);for(const r of i){const s=this._getUrlMatches(t,r);if(s)return new If(this.locale,t,s,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class If{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(e);i=t.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new kn,e=this._locale.t;return t.content='',t.viewBox="0 0 64 42",new Re({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var Sf=P(7048),Qx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Sf.A,Qx),Sf.A.locals;class Pr extends R{constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const n=e[1],i=e[2];return`
`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new Yx(t.locale,t.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,r=t.config.get("mediaEmbed.previewsInData"),s=t.config.get("mediaEmbed.elementName"),a=this.registry;t.commands.add("mediaEmbed",new $x(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return xf(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),i.for("dataDowncast").add(yf(a,{elementName:s,renderMediaPreview:r})),i.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(h,u,g){return u.setCustomProperty("media",!0,h),pa(h,u,{label:g})}(xf(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),i.for("editingDowncast").add(yf(a,{elementName:s,renderForEditingView:!0})),i.for("upcast").elementToElement({view:c=>["oembed",s].includes(c.name)&&c.getAttribute("url")?{name:!0}:null,model:(c,{writer:l})=>{const d=c.getAttribute("url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(c,{writer:l})=>{const d=c.getAttribute("data-oembed-url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).add(c=>{c.on("element:figure",(l,d,h)=>{if(!h.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:u,modelCursor:g}=h.convertChildren(d.viewItem,d.modelCursor);d.modelRange=u,d.modelCursor=g,Wt(u.getItems())||h.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const Zx=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Jx extends R{constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[Jg,sn,op]}static get pluginName(){return"AutoMediaEmbed"}init(){const t=this.editor,e=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const i=e.selection.getFirstRange(),r=Zt.fromPosition(i.start);r.stickiness="toPrevious";const s=Zt.fromPosition(i.end);s.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&($.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(Pr).registry,r=new pe(t,e),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const c of s)c.item.is("$textProxy")&&(a+=c.item.data);if(a=a.trim(),!a.match(Zx)||!i.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Zt.fromPosition(t),this._timeoutId=$.window.setTimeout(()=>{n.model.change(c=>{this._timeoutId=null,c.remove(r),r.detach();let l=null;this._positionToInsert.root.rootName!=="$graveyard"&&(l=this._positionToInsert),Df(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(sn).requestUndoOnBackspace()},100)):r.detach()}}var Tf=P(5651),Xx={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Tf.A,Xx),Tf.A.locals;class tE extends et{constructor(t,e){super(e);const n=e.t;this.focusTracker=new Qt,this.keystrokes=new oe,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ot.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),ot.cancel,"ck-button-cancel","cancel"),this._focusables=new ve,this._focusCycler=new ye({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),m({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new or(this.locale,ar),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),e}_createButton(t,e,n,i){const r=new wt(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class eE extends R{static get requires(){return[Pr]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",n=>{const i=on(n);return this._setUpDropdown(i,e),i})}_setUpDropdown(t,e){const n=this.editor,i=n.t,r=t.buttonView,s=n.plugins.get(Pr).registry;t.once("change:isOpen",()=>{const a=new(x(tE))(function(c,l){return[d=>{if(!d.url.length)return c("The URL must not be empty.")},d=>{if(!l.hasMedia(d.url))return c("This media URL is not supported.")}]}(n.t,s),n.locale);t.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=e.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),t.on("change:isOpen",()=>a.resetFormStatus()),t.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(t),a.urlInputView.fieldView.bind("value").to(e,"value"),a.urlInputView.bind("isEnabled").to(e,"isEnabled")}),t.bind("isEnabled").to(e),r.set({label:i("Insert media"),icon:'',tooltip:!0})}}var Mf=P(70),nE={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};q()(Mf.A,nE),Mf.A.locals;function oE(o,t){if(!o.childCount)return;const e=new nn(o.document),n=function(s,a){const c=a.createRangeIn(s),l=new Ne({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),d=[];for(const h of c)if(h.type==="elementStart"&&l.match(h.item)){const u=rE(h.item);d.push({element:h.item,id:u.id,order:u.order,indent:u.indent})}return d}(o,e);if(!n.length)return;let i=null,r=1;n.forEach((s,a)=>{const c=function(p,k){if(!p)return!0;if(p.id!==k.id)return k.indent-p.indent!=1;const b=k.element.previousSibling;if(!b)return!0;return A=b,!(A.is("element","ol")||A.is("element","ul"));var A}(n[a-1],s),l=c?null:n[a-1],d=(u=s,(h=l)?u.indent-h.indent:u.indent-1);var h,u;if(c&&(i=null,r=1),!i||d!==0){const p=function(k,b){const A=new RegExp(`@list l${k.id}:level${k.indent}\\s*({[^}]*)`,"gi"),E=/mso-level-number-format:([^;]{0,100});/gi,M=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,z=A.exec(b);let G="decimal",tt="ol",at=null;if(z&&z[1]){const St=E.exec(z[1]);if(St&&St[1]&&(G=St[1].trim(),tt=G!=="bullet"&&G!=="image"?"ol":"ul"),G==="bullet"){const qt=function(Lr){const ki=function(yk){if(yk.getChild(0).is("$text"))return null;for(const xk of yk.getChildren()){if(!xk.is("element","span"))continue;const zr=xk.getChild(0);if(zr)return zr.is("$text")?zr:zr.getChild(0)}return null}(Lr);if(!ki)return null;const _o=ki._data;return _o==="o"?"circle":_o==="·"?"disc":_o==="§"?"square":null}(k.element);qt&&(G=qt)}else{const qt=M.exec(z[1]);qt&&qt[1]&&(at=parseInt(qt[1]))}}return{type:tt,startIndex:at,style:iE(G)}}(s,t);if(i){if(s.indent>r){const k=i.getChild(i.childCount-1),b=k.getChild(k.childCount-1);i=Bf(p,b,e),r+=1}else if(s.indent1&&e.setAttribute("start",o.startIndex,i),i}function rE(o){const t={},e=o.getStyle("mso-list");if(e){const n=e.match(/(^|\s{1,100})l(\d+)/i),i=e.match(/\s{0,100}lfo(\d+)/i),r=e.match(/\s{0,100}level(\d+)/i);n&&i&&r&&(t.id=n[2],t.order=i[1],t.indent=parseInt(r[1]))}return t}function sE(o,t){if(!o.childCount)return;const e=new nn(o.document),n=function(r,s){const a=s.createRangeIn(r),c=new Ne({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const h=d.item,u=h.previousSibling,g=u&&u.is("element")?u.name:null,p=["Chart"],k=c.match(h),b=h.getAttribute("o:gfxdata"),A=g==="v:shapetype",E=b&&p.some(M=>h.getAttribute("id").includes(M));k&&b&&!A&&!E&&l.push(d.item.getAttribute("id"))}return l}(o,e);(function(r,s,a){const c=a.createRangeIn(s),l=new Ne({name:"img"}),d=[];for(const h of c)if(h.item.is("element")&&l.match(h.item)){const u=h.item,g=u.getAttribute("v:shapes")?u.getAttribute("v:shapes").split(" "):[];g.length&&g.every(p=>r.indexOf(p)>-1)?d.push(u):u.getAttribute("src")||d.push(u)}for(const h of d)a.remove(h)})(n,o,e),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const u of c)if(u.type=="elementStart"&&u.item.is("element","v:shape")){const g=u.item.getAttribute("id");if(r.includes(g))continue;d(u.item.parent.getChildren(),g)||l.push(u.item)}for(const u of l){const g={src:h(u)};u.hasAttribute("alt")&&(g.alt=u.getAttribute("alt"));const p=a.createElement("img",g);a.insertChild(u.index+1,p,u.parent)}function d(u,g){for(const p of u)if(p.is("element")&&(p.name=="img"&&p.getAttribute("v:shapes")==g||d(p.getChildren(),g)))return!0;return!1}function h(u){for(const g of u.getChildren())if(g.is("element")&&g.getAttribute("src"))return g.getAttribute("src")}}(n,o,e),function(r,s){const a=s.createRangeIn(r),c=new Ne({name:/v:(.+)/}),l=[];for(const d of a)d.type=="elementStart"&&c.match(d.item)&&l.push(d.item);for(const d of l)s.remove(d)}(o,e);const i=function(r,s){const a=s.createRangeIn(r),c=new Ne({name:"img"}),l=[];for(const d of a)d.item.is("element")&&c.match(d.item)&&d.item.getAttribute("src").startsWith("file://")&&l.push(d.item);return l}(o,e);i.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(t,16))).join(""))}const cE=//i,lE=/xmlns:o="urn:schemas-microsoft-com/i;class dE{constructor(t){this.document=t}isActive(t){return cE.test(t)||lE.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;oE(e,n),sE(e,t.dataTransfer.getData("text/rtf")),function(i){const r=[],s=new nn(i.document);for(const{item:a}of s.createRangeIn(i))if(a.is("element")){for(const c of a.getClassNames())/\bmso/gi.exec(c)&&s.removeClass(c,a);for(const c of a.getStyleNames())/\bmso/gi.exec(c)&&s.removeStyle(c,a);a.is("element","w:sdt")&&r.push(a)}for(const a of r){const c=a.parent,l=c.getChildIndex(a);s.insertChild(l,a.getChildren(),c),s.remove(a)}}(e),t.content=e}}function Nf(o,t,e,{blockElements:n,inlineObjectElements:i}){let r=e.createPositionAt(o,t=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!i.includes(s.name),{direction:t}),t=="forward"?r.nodeAfter:r.nodeBefore}function Pf(o,t){return!!o&&o.is("element")&&t.includes(o.name)}const hE=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class uE{constructor(t){this.document=t}isActive(t){return hE.test(t)}execute(t){const e=new nn(this.document),{body:n}=t._parsedData;(function(i,r){for(const s of i.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=i.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),i)}})(n,e),function(i,r){for(const s of r.createRangeIn(i)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,e),function(i,r){const s=new Vi(r.document.stylesProcessor),a=new qi(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const h of r.createRangeIn(i)){const u=h.item;if(u.is("element","br")){const g=Nf(u,"forward",r,{blockElements:c,inlineObjectElements:l}),p=Nf(u,"backward",r,{blockElements:c,inlineObjectElements:l}),k=Pf(g,c);(Pf(p,c)||k)&&d.push(u)}}for(const h of d)h.hasClass("Apple-interchange-newline")?r.remove(h):r.replace(h,r.createElement("p"))}(n,e),t.content=n}}const gE=/(\s+)<\/span>/g,(t,e)=>e.length===1?" ":Array(e.length+1).join("  ").substr(0,e.length))}function mE(o,t){const e=new DOMParser,n=function(c){return Of(Of(c)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(c){const l="",d="",h=c.indexOf(l);if(h<0)return c;const u=c.indexOf(d,h+l.length);return c.substring(0,h+l.length)+(u>=0?c.substring(u):"")}(o=(o=o.replace(/