@justifi/webcomponents 6.2.0 → 6.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bank-account-document-form-inputs_6.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-BzHg6qqg.js → business-additional-questions-schema-CE-z5qrr.js} +1 -1
- package/dist/cjs/{business-identity-schema-Di-jf6nr.js → business-identity-schema-rMMiHyPz.js} +2 -2
- package/dist/cjs/{check-pkg-version-Cz6cM3zf.js → check-pkg-version-BVyea38i.js} +1 -1
- package/dist/cjs/{checkout.store-BiT7zKgX.js → checkout.store-BA6h-dp2.js} +2 -0
- package/dist/cjs/custom-popper.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number-masked_3.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number.cjs.entry.js +2 -2
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_3.cjs.entry.js +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
- package/dist/cjs/{justifi-bank-account-billing-form-simple_9.cjs.entry.js → internal-tokenize-payment-method_7.cjs.entry.js} +254 -139
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
- package/dist/cjs/{justifi-apple-pay_8.cjs.entry.js → justifi-apple-pay_7.cjs.entry.js} +4 -259
- package/dist/cjs/justifi-bank-account-billing-form-simple_3.cjs.entry.js +147 -0
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +6 -5
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +15 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-CHe5hX1H.js → package-keJMf4WX.js} +1 -1
- package/dist/cjs/{schema-validations-AxtufX7q.js → schema-validations-BOiGVUHM.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +2 -2
- package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
- package/dist/collection/components/checkout/checkout.js +31 -2
- package/dist/collection/components/modular-checkout/sub-components/billing-form-full.js +1 -2
- package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -2
- package/dist/collection/components/tokenize-payment-method/internal-tokenize-payment-method.js +626 -0
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +2 -422
- package/dist/collection/store/checkout.store.js +2 -0
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
- package/dist/collection/ui-components/form/form-control-file.js +2 -2
- package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
- package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
- package/dist/collection/ui-components/form/form-control-number.js +2 -2
- package/dist/collection/ui-components/form/form-control-radio.js +2 -2
- package/dist/collection/ui-components/form/form-control-text.js +2 -2
- package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +3 -3
- package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
- package/dist/docs.json +590 -242
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{badge-BkjjtNUQ.js → badge-Bgosx-DC.js} +1 -1
- package/dist/esm/bank-account-document-form-inputs_6.entry.js +5 -5
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-BCXg6YTP.js → business-additional-questions-schema-QFJEOHF5.js} +1 -1
- package/dist/esm/business-details-core.entry.js +3 -3
- package/dist/esm/{business-identity-schema-CvzdGI9h.js → business-identity-schema-DB_Hhjld.js} +2 -2
- package/dist/esm/{button-DHljyr0K.js → button-DBmjN7Ra.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-DrqnlTa_.js → check-pkg-version-BZb5Z6DW.js} +1 -1
- package/dist/esm/{checkout.store-CMsV0tl9.js → checkout.store-CaS_htQd.js} +2 -0
- package/dist/esm/checkouts-list-core.entry.js +5 -5
- package/dist/esm/{checkouts-table-Dn1sFyZs.js → checkouts-table-lgbZpF1o.js} +2 -2
- package/dist/esm/custom-popper.entry.js +2 -2
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox.entry.js +3 -3
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/{form-control-error-text-Cje0veu2.js → form-control-error-text-B5LSdUXI.js} +1 -1
- package/dist/esm/form-control-file-v2_2.entry.js +5 -5
- package/dist/esm/{form-control-help-text-ClJnecm3.js → form-control-help-text-BK9RNOf-.js} +1 -1
- package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
- package/dist/esm/form-control-monetary.entry.js +5 -5
- package/dist/esm/form-control-number-masked_3.entry.js +4 -4
- package/dist/esm/form-control-number.entry.js +5 -5
- package/dist/esm/form-control-radio.entry.js +3 -3
- package/dist/esm/form-control-select_3.entry.js +4 -4
- package/dist/esm/gross-payment-chart-core.entry.js +3 -3
- package/dist/esm/{header-1-uiFiNrVs.js → header-1-CPF3S2CC.js} +1 -1
- package/dist/esm/{header-3-BVYYTpLc.js → header-3-Cah707hu.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +7 -7
- package/dist/esm/{insurance-state-iJs0LRg_.js → insurance-state-DRe0g_wf.js} +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +460 -0
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +6 -6
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-additional-statement_8.entry.js +1 -1
- package/dist/esm/{justifi-apple-pay_8.entry.js → justifi-apple-pay_7.entry.js} +10 -264
- package/dist/esm/justifi-bank-account-billing-form-simple_3.entry.js +143 -0
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +9 -9
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
- package/dist/esm/justifi-checkout.entry.js +7 -6
- package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +5 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
- package/dist/esm/justifi-order-terminals.entry.js +4 -4
- package/dist/esm/justifi-owner-form_3.entry.js +4 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payments-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payments-list.entry.js +6 -6
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
- package/dist/esm/justifi-payouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-payouts-list.entry.js +6 -6
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
- package/dist/esm/justifi-skeleton.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list.entry.js +5 -5
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +5 -5
- package/dist/esm/justifi-tokenize-payment-method.entry.js +13 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-BjCdImSF.js → package-C19Xk7z3.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +1 -1
- package/dist/esm/{parts-Dj_zevuD.js → parts-wtuY7MT2.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +5 -5
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/payments-list-core.entry.js +6 -6
- package/dist/esm/{payments-status-DK2me5T2.js → payments-status-Dypl6WFL.js} +1 -1
- package/dist/esm/{payments-table-DxRdl7-E.js → payments-table-CK9BRZEz.js} +2 -2
- package/dist/esm/payout-details-core.entry.js +6 -6
- package/dist/esm/payouts-list-core.entry.js +6 -6
- package/dist/esm/{payouts-status-BfEM6F8q.js → payouts-status-hTCBgpLW.js} +1 -1
- package/dist/esm/{payouts-table-C2binjIW.js → payouts-table-Dd8IDBBX.js} +2 -2
- package/dist/esm/{schema-validations-CoIE0a4H.js → schema-validations-B5sfox_4.js} +2 -2
- package/dist/esm/{skeleton-DdynMBnt.js → skeleton-BmRZRW5K.js} +1 -1
- package/dist/esm/{spinner-BRMSkfVc.js → spinner-tU4D9iak.js} +1 -1
- package/dist/esm/{table-DYlsfkCm.js → table-Cjq1A6mO.js} +2 -2
- package/dist/esm/table-filters-menu.entry.js +2 -2
- package/dist/esm/terminal-orders-list-core.entry.js +5 -5
- package/dist/esm/{terminal-orders-table-zf0ASRCr.js → terminal-orders-table-CMWBIr9y.js} +2 -2
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/terminals-list-core.entry.js +5 -5
- package/dist/esm/{terminals-table-DNUTk3gi.js → terminals-table-D9okETJr.js} +2 -2
- package/dist/esm/{utils-DUz-H1tG.js → utils-BX7Rjm1M.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Refund.js +1 -1
- package/dist/module/additional-statement.js +1 -1
- package/dist/module/billing-form-full.js +1 -2
- package/dist/module/billing-form-schema.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +1 -1
- package/dist/module/business-additional-questions-schema.js +1 -1
- package/dist/module/business-address-schema.js +2 -2
- package/dist/module/business-bank-account-form-step-core.js +1 -1
- package/dist/module/business-bank-account-form-step.js +1 -1
- package/dist/module/business-core-info-form-step.js +1 -1
- package/dist/module/business-owners-form-step.js +1 -1
- package/dist/module/business-representative-form-step.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +1 -1
- package/dist/module/button.js +1 -1
- package/dist/module/cancellation-policy.js +1 -1
- package/dist/module/card-billing-form-simple.js +1 -2
- package/dist/module/checkout.store.js +2 -0
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details.js +1 -1
- package/dist/module/dispute-response-actions.js +1 -1
- package/dist/module/dispute-response.js +1 -1
- package/dist/module/duplicate-charge.js +1 -1
- package/dist/module/electronic-evidence.js +1 -1
- package/dist/module/form-control-file-v22.js +1 -1
- package/dist/module/form-control-file2.js +2 -2
- package/dist/module/form-control-monetary2.js +2 -2
- package/dist/module/form-control-number-masked2.js +2 -2
- package/dist/module/form-control-number.js +2 -2
- package/dist/module/form-control-radio2.js +2 -2
- package/dist/module/form-control-text2.js +2 -2
- package/dist/module/form-control-textarea2.js +2 -2
- package/dist/module/get-business.js +1 -1
- package/dist/module/get-payment-details.js +1 -1
- package/dist/module/get-payout-csv.js +1 -1
- package/dist/module/get-subaccounts.js +1 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/internal-tokenize-payment-method.d.ts +11 -0
- package/dist/module/internal-tokenize-payment-method.js +6 -0
- package/dist/module/{tokenize-payment-method.js → internal-tokenize-payment-method2.js} +8 -8
- package/dist/module/justifi-business-details.js +1 -1
- package/dist/module/justifi-business-form.js +1 -1
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-checkout.js +39 -37
- package/dist/module/justifi-checkouts-list.js +1 -1
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-gross-payment-chart.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +2 -2
- package/dist/module/justifi-payment-details.js +1 -1
- package/dist/module/justifi-payment-provisioning.js +1 -1
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-details.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-refund-payment.js +1 -1
- package/dist/module/justifi-season-interruption-insurance.js +1 -1
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/justifi-tokenize-payment-method.js +154 -1
- package/dist/module/legal-address-form-step.js +1 -1
- package/dist/module/modular-checkout.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +1 -1
- package/dist/module/payment-provisioning-actions.js +1 -1
- package/dist/module/payment-provisioning-core.js +1 -1
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/plaid-payment-method.js +1 -1
- package/dist/module/product-or-service.js +1 -1
- package/dist/module/refund-policy.js +1 -1
- package/dist/module/schema-validations.js +2 -2
- package/dist/module/shipping-details.js +1 -1
- package/dist/module/utils4.js +1 -1
- package/dist/types/components/checkout/checkout.d.ts +4 -2
- package/dist/types/components/tokenize-payment-method/internal-tokenize-payment-method.d.ts +60 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +0 -47
- package/dist/types/components.d.ts +97 -56
- package/dist/types/store/checkout.store.d.ts +1 -0
- package/dist/webcomponents/{p-73e766d2.entry.js → p-00e0a745.entry.js} +1 -1
- package/dist/webcomponents/{p-6c2b5d37.entry.js → p-087a81ff.entry.js} +1 -1
- package/dist/webcomponents/{p-56d9a8f1.entry.js → p-0ce046fd.entry.js} +1 -1
- package/dist/webcomponents/{p-62cdb2b1.entry.js → p-1193a1ac.entry.js} +1 -1
- package/dist/webcomponents/{p-e3a41b95.entry.js → p-14d2f6c6.entry.js} +1 -1
- package/dist/webcomponents/{p-264d9183.entry.js → p-1eae32ac.entry.js} +1 -1
- package/dist/webcomponents/{p-198a6ae3.entry.js → p-1edec396.entry.js} +1 -1
- package/dist/webcomponents/{p-065eafc5.entry.js → p-20a8b0c0.entry.js} +1 -1
- package/dist/webcomponents/{p-3cb3a241.entry.js → p-22f74666.entry.js} +1 -1
- package/dist/webcomponents/p-2769f945.entry.js +1 -0
- package/dist/webcomponents/{p-f87b9b86.entry.js → p-2cd5733e.entry.js} +1 -1
- package/dist/webcomponents/p-30f61f44.entry.js +1 -0
- package/dist/webcomponents/{p-5aa27e1b.entry.js → p-37a55eaf.entry.js} +1 -1
- package/dist/webcomponents/p-3c38cec5.entry.js +1 -0
- package/dist/webcomponents/p-40d3a480.entry.js +1 -0
- package/dist/webcomponents/{p-82b13550.entry.js → p-45936490.entry.js} +1 -1
- package/dist/webcomponents/{p-abf2073d.entry.js → p-4761e0aa.entry.js} +1 -1
- package/dist/webcomponents/{p-91f22211.entry.js → p-4c3eea2b.entry.js} +1 -1
- package/dist/webcomponents/{p-27acf7cc.entry.js → p-4dcbc0af.entry.js} +1 -1
- package/dist/webcomponents/{p-46d7ca2f.entry.js → p-4e23116c.entry.js} +4 -4
- package/dist/webcomponents/{p-910af6e1.entry.js → p-5464b902.entry.js} +1 -1
- package/dist/webcomponents/{p-ab1ef223.entry.js → p-54facfdc.entry.js} +1 -1
- package/dist/webcomponents/{p-85336b64.entry.js → p-56a8e07d.entry.js} +1 -1
- package/dist/webcomponents/{p-52cb10a7.entry.js → p-58ae4f9e.entry.js} +1 -1
- package/dist/webcomponents/p-5d1fb433.entry.js +1 -0
- package/dist/webcomponents/p-5f81a3d6.entry.js +1 -0
- package/dist/webcomponents/{p-ccc771d0.entry.js → p-696a5c8e.entry.js} +1 -1
- package/dist/webcomponents/p-6b6003d2.entry.js +1 -0
- package/dist/webcomponents/{p-590290a2.entry.js → p-716ddc27.entry.js} +1 -1
- package/dist/webcomponents/{p-9633fbb8.entry.js → p-7218c312.entry.js} +1 -1
- package/dist/webcomponents/{p-83cd698c.entry.js → p-75c65531.entry.js} +1 -1
- package/dist/webcomponents/{p-d217f6ea.entry.js → p-800660f2.entry.js} +1 -1
- package/dist/webcomponents/p-84e2bd93.entry.js +1 -0
- package/dist/webcomponents/{p-6677f09f.entry.js → p-8681f258.entry.js} +1 -1
- package/dist/webcomponents/{p-98a50760.entry.js → p-87a2a830.entry.js} +1 -1
- package/dist/webcomponents/{p-e788ecc9.entry.js → p-89518b26.entry.js} +1 -1
- package/dist/webcomponents/{p-e549cd33.entry.js → p-95593721.entry.js} +1 -1
- package/dist/webcomponents/{p-e29bdbc2.entry.js → p-9d914297.entry.js} +1 -1
- package/dist/webcomponents/{p-5eb2698f.entry.js → p-9f70ce93.entry.js} +1 -1
- package/dist/webcomponents/p-B-0a8Xqm.js +1 -0
- package/dist/webcomponents/{p-D2DVDmwd.js → p-BNqo3kt0.js} +1 -1
- package/dist/webcomponents/{p-B-7rLJIB.js → p-BTzt8N0l.js} +1 -1
- package/dist/webcomponents/{p-C9Ho60F2.js → p-BitGlMSc.js} +1 -1
- package/dist/webcomponents/p-Bli6WznP.js +1 -0
- package/dist/webcomponents/{p-DkOvNRJs.js → p-Bqlcv3ZV.js} +1 -1
- package/dist/webcomponents/p-BuCKkdLM.js +1 -0
- package/dist/webcomponents/{p-BB3MQDQq.js → p-BydKIJVC.js} +1 -1
- package/dist/webcomponents/p-C-2kW6Al.js +1 -0
- package/dist/webcomponents/p-C19Xk7z3.js +1 -0
- package/dist/webcomponents/{p-D8HCCl2t.js → p-CkN7DFFn.js} +1 -1
- package/dist/webcomponents/p-D1WQG4I7.js +1 -0
- package/dist/webcomponents/{p-Cu1FEdFr.js → p-DOLBAxYf.js} +1 -1
- package/dist/webcomponents/p-DU8dqq9U.js +1 -0
- package/dist/webcomponents/{p-pV1ZX4A8.js → p-DV4RaYYL.js} +1 -1
- package/dist/webcomponents/{p-fDGfMEwy.js → p-DkOiS6Zr.js} +1 -1
- package/dist/webcomponents/{p-BVWZSqCK.js → p-KPmnq8xf.js} +1 -1
- package/dist/webcomponents/{p-28c28c0b.entry.js → p-a655b996.entry.js} +1 -1
- package/dist/webcomponents/{p-ad4900de.entry.js → p-a6e37d4a.entry.js} +1 -1
- package/dist/webcomponents/{p-256a95eb.entry.js → p-a8f7cf9b.entry.js} +1 -1
- package/dist/webcomponents/{p-8993c961.entry.js → p-ae7a027b.entry.js} +1 -1
- package/dist/webcomponents/{p-1414e80b.entry.js → p-aec9185f.entry.js} +1 -1
- package/dist/webcomponents/p-avgjSJ1d.js +1 -0
- package/dist/webcomponents/{p-97bfb8d5.entry.js → p-b07470fa.entry.js} +1 -1
- package/dist/webcomponents/{p-93806238.entry.js → p-b2f969a6.entry.js} +1 -1
- package/dist/webcomponents/p-b4d8a3f6.entry.js +1 -0
- package/dist/webcomponents/{p-q6C7btl0.js → p-bolTb61p.js} +1 -1
- package/dist/webcomponents/p-c0198eef.entry.js +1 -0
- package/dist/webcomponents/{p-2a53a095.entry.js → p-c1831747.entry.js} +1 -1
- package/dist/webcomponents/{p-99af02c9.entry.js → p-c31fe838.entry.js} +1 -1
- package/dist/webcomponents/p-c3b71a1f.entry.js +1 -0
- package/dist/webcomponents/{p-4e90834e.entry.js → p-c7279bc6.entry.js} +1 -1
- package/dist/webcomponents/p-c7MCfTgE.js +1 -0
- package/dist/webcomponents/{p-e06327aa.entry.js → p-c8f40375.entry.js} +1 -1
- package/dist/webcomponents/{p-7f8cd8dd.entry.js → p-d182f489.entry.js} +1 -1
- package/dist/webcomponents/{p-728158a8.entry.js → p-d4b8274f.entry.js} +1 -1
- package/dist/webcomponents/{p-071c1047.entry.js → p-d86b8ce7.entry.js} +1 -1
- package/dist/webcomponents/p-dc0d3484.entry.js +1 -0
- package/dist/webcomponents/{p-24be9ef6.entry.js → p-dfe68bf0.entry.js} +1 -1
- package/dist/webcomponents/{p-BfYkosa4.js → p-dgG_o6wN.js} +1 -1
- package/dist/webcomponents/{p-f02ab3fd.entry.js → p-e2e6c201.entry.js} +1 -1
- package/dist/webcomponents/{p-238859ef.entry.js → p-eb56ba9b.entry.js} +1 -1
- package/dist/webcomponents/{p-0d928de1.entry.js → p-ed55d333.entry.js} +1 -1
- package/dist/webcomponents/p-edcb84bf.entry.js +1 -0
- package/dist/webcomponents/{p-9db64da8.entry.js → p-f1af630f.entry.js} +1 -1
- package/dist/webcomponents/{p-6023553c.entry.js → p-f5fb1af2.entry.js} +1 -1
- package/dist/webcomponents/{p-79cb28bd.entry.js → p-fab28b02.entry.js} +1 -1
- package/dist/webcomponents/p-fda2d53b.entry.js +1 -0
- package/dist/webcomponents/{p-DsR5Dt9w.js → p-jTVpG8Gt.js} +1 -1
- package/dist/webcomponents/{p-DwLZbA7D.js → p-nrZ9yHcl.js} +1 -1
- package/dist/webcomponents/{p-Dj_zevuD.js → p-wtuY7MT2.js} +1 -1
- package/dist/webcomponents/p-zNSPsvs3.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -1
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +0 -343
- package/dist/webcomponents/p-20a85390.entry.js +0 -1
- package/dist/webcomponents/p-2859a8e3.entry.js +0 -1
- package/dist/webcomponents/p-336b08de.entry.js +0 -1
- package/dist/webcomponents/p-36259848.entry.js +0 -1
- package/dist/webcomponents/p-568577d4.entry.js +0 -1
- package/dist/webcomponents/p-6b563428.entry.js +0 -1
- package/dist/webcomponents/p-92f0e010.entry.js +0 -1
- package/dist/webcomponents/p-BHe87s0Y.js +0 -1
- package/dist/webcomponents/p-BjCdImSF.js +0 -1
- package/dist/webcomponents/p-C2gAiiwJ.js +0 -1
- package/dist/webcomponents/p-C7m-gAAM.js +0 -1
- package/dist/webcomponents/p-CO8ZJ0jB.js +0 -1
- package/dist/webcomponents/p-CbBTgsKC.js +0 -1
- package/dist/webcomponents/p-CgbXzEbz.js +0 -1
- package/dist/webcomponents/p-Cpp4qrH2.js +0 -1
- package/dist/webcomponents/p-JvWiY69B.js +0 -1
- package/dist/webcomponents/p-VhOlg78I.js +0 -1
- package/dist/webcomponents/p-a49ca7d8.entry.js +0 -1
- package/dist/webcomponents/p-cdf94860.entry.js +0 -1
- package/dist/webcomponents/p-d8fc3996.entry.js +0 -1
- package/dist/webcomponents/p-e77490af.entry.js +0 -1
- package/dist/webcomponents/p-f17188cf.entry.js +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s}from"./p-DwYM91AU.js";import{f as n,l as r}from"./p-BS7OgSQe.js";import{E as o}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e,H as s}from"./p-DwYM91AU.js";import{f as n,l as r}from"./p-BS7OgSQe.js";import{E as o}from"./p-BNqo3kt0.js";import{S as h}from"./p-B-0a8Xqm.js";import"./p-HXpYMWUU.js";import"./p-wtuY7MT2.js";
|
|
2
2
|
/*!
|
|
3
3
|
* @kurkle/color v0.3.4
|
|
4
4
|
* https://github.com/kurkle/color#readme
|
|
5
5
|
* (c) 2024 Jukka Kurkela
|
|
6
6
|
* Released under the MIT License
|
|
7
|
-
*/function a(t){return t+.5|0}const c=(t,i,e)=>Math.max(Math.min(t,e),i);function l(t){return c(a(2.55*t),0,255)}function u(t){return c(a(255*t),0,255)}function f(t){return c(a(t/2.55)/100,0,1)}function d(t){return c(a(100*t),0,100)}const b={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},g=[..."0123456789ABCDEF"],p=t=>g[15&t],m=t=>g[(240&t)>>4]+g[15&t],
|
|
7
|
+
*/function a(t){return t+.5|0}const c=(t,i,e)=>Math.max(Math.min(t,e),i);function l(t){return c(a(2.55*t),0,255)}function u(t){return c(a(255*t),0,255)}function f(t){return c(a(t/2.55)/100,0,1)}function d(t){return c(a(100*t),0,100)}const b={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},g=[..."0123456789ABCDEF"],p=t=>g[15&t],m=t=>g[(240&t)>>4]+g[15&t],x=t=>(240&t)>>4==(15&t);const v=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y(t,i,e){const s=i*Math.min(e,1-e),n=(i,n=(i+t/30)%12)=>e-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function M(t,i,e){const s=(s,n=(s+t/60)%6)=>e-e*i*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function w(t,i,e){const s=y(t,1,.5);let n;for(i+e>1&&(n=1/(i+e),i*=n,e*=n),n=0;n<3;n++)s[n]*=1-i-e,s[n]+=i;return s}function _(t){const i=t.r/255,e=t.g/255,s=t.b/255,n=Math.max(i,e,s),r=Math.min(i,e,s),o=(n+r)/2;let h,a,c;return n!==r&&(c=n-r,a=o>.5?c/(2-n-r):c/(n+r),h=function(t,i,e,s,n){return t===n?(i-e)/s+(i<e?6:0):i===n?(e-t)/s+2:(t-i)/s+4}(i,e,s,c,n),h=60*h+.5),[0|h,a||0,o]}function k(t,i,e,s){return(Array.isArray(i)?t(i[0],i[1],i[2]):t(i,e,s)).map(u)}function O(t,i,e){return k(y,t,i,e)}function S(t){return(t%360+360)%360}const A={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"},D={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"};let j;const R=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,C=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,E=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function L(t,i,e){if(t){let s=_(t);s[i]=Math.max(0,Math.min(s[i]+s[i]*e,0===i?360:1)),s=O(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function P(t,i){return t?Object.assign(i||{},t):t}function T(t){var i={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(i={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(i.a=u(t[3]))):(i=P(t,{r:0,g:0,b:0,a:1})).a=u(i.a),i}function I(t){return"r"===t.charAt(0)?function(t){const i=R.exec(t);let e,s,n,r=255;if(i){if(i[7]!==e){const t=+i[7];r=i[8]?l(t):c(255*t,0,255)}return e=+i[1],s=+i[3],n=+i[5],e=255&(i[2]?l(e):c(e,0,255)),s=255&(i[4]?l(s):c(s,0,255)),n=255&(i[6]?l(n):c(n,0,255)),{r:e,g:s,b:n,a:r}}}(t):function(t){const i=v.exec(t);let e,s=255;if(!i)return;i[5]!==e&&(s=i[6]?l(+i[5]):u(+i[5]));const n=S(+i[2]),r=+i[3]/100,o=+i[4]/100;return e="hwb"===i[1]?function(t,i,e){return k(w,t,i,e)}(n,r,o):"hsv"===i[1]?function(t,i,e){return k(M,t,i,e)}(n,r,o):O(n,r,o),{r:e[0],g:e[1],b:e[2],a:s}}(t)}class F{constructor(t){if(t instanceof F)return t;const i=typeof t;let e;var s,n,r;"object"===i?e=T(t):"string"===i&&(r=(s=t).length,"#"===s[0]&&(4===r||5===r?n={r:255&17*b[s[1]],g:255&17*b[s[2]],b:255&17*b[s[3]],a:5===r?17*b[s[4]]:255}:7!==r&&9!==r||(n={r:b[s[1]]<<4|b[s[2]],g:b[s[3]]<<4|b[s[4]],b:b[s[5]]<<4|b[s[6]],a:9===r?b[s[7]]<<4|b[s[8]]:255})),e=n||function(t){j||(j=function(){const t={},i=Object.keys(D),e=Object.keys(A);let s,n,r,o,h;for(s=0;s<i.length;s++){for(o=h=i[s],n=0;n<e.length;n++)r=e[n],h=h.replace(r,A[r]);r=parseInt(D[o],16),t[h]=[r>>16&255,r>>8&255,255&r]}return t}(),j.transparent=[0,0,0,0]);const i=j[t.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(t)||I(t)),this._rgb=e,this._valid=!!e}get valid(){return this._valid}get rgb(){var t=P(this._rgb);return t&&(t.a=f(t.a)),t}set rgb(t){this._rgb=T(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${f(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(i=(t=>x(t.r)&&x(t.g)&&x(t.b)&&x(t.a))(t=this._rgb)?p:m,t?"#"+i(t.r)+i(t.g)+i(t.b)+((t,i)=>t<255?i(t):"")(t.a,i):void 0):void 0;var t,i}hslString(){return this._valid?function(t){if(!t)return;const i=_(t),e=i[0],s=d(i[1]),n=d(i[2]);return t.a<255?`hsla(${e}, ${s}%, ${n}%, ${f(t.a)})`:`hsl(${e}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,i){if(t){const e=this.rgb,s=t.rgb;let n;const r=i===n?.5:i,o=2*r-1,h=e.a-s.a,a=((o*h==-1?o:(o+h)/(1+o*h))+1)/2;n=1-a,e.r=255&a*e.r+n*s.r+.5,e.g=255&a*e.g+n*s.g+.5,e.b=255&a*e.b+n*s.b+.5,e.a=r*e.a+(1-r)*s.a,this.rgb=e}return this}interpolate(t,i){return t&&(this._rgb=function(t,i,e){const s=E(f(t.r)),n=E(f(t.g)),r=E(f(t.b));return{r:u(C(s+e*(E(f(i.r))-s))),g:u(C(n+e*(E(f(i.g))-n))),b:u(C(r+e*(E(f(i.b))-r))),a:t.a+e*(i.a-t.a)}}(this._rgb,t._rgb,i)),this}clone(){return new F(this.rgb)}alpha(t){return this._rgb.a=u(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,i=a(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=i,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return L(this._rgb,2,t),this}darken(t){return L(this._rgb,2,-t),this}saturate(t){return L(this._rgb,1,t),this}desaturate(t){return L(this._rgb,1,-t),this}rotate(t){return function(t,i){var e=_(t);e[0]=S(e[0]+i),e=O(e),t.r=e[0],t.g=e[1],t.b=e[2]}(this._rgb,t),this}}
|
|
8
8
|
/*!
|
|
9
9
|
* Chart.js v4.5.1
|
|
10
10
|
* https://www.chartjs.org
|
|
11
11
|
* (c) 2025 Chart.js Contributors
|
|
12
12
|
* Released under the MIT License
|
|
13
|
-
*/function B(){}const W=(()=>{let t=0;return()=>t++})();function z(t){return null==t}function N(t){if(Array.isArray&&Array.isArray(t))return!0;const i=Object.prototype.toString.call(t);return"[object"===i.slice(0,7)&&"Array]"===i.slice(-6)}function H(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function $(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Y(t,i){return $(t)?t:i}function V(t,i){return void 0===t?i:t}const X=(t,i)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*i:+t;function U(t,i,e){if(t&&"function"==typeof t.call)return t.apply(e,i)}function Z(t,i,e){let s,n,r;if(N(t))for(n=t.length,s=0;s<n;s++)i.call(e,t[s],s);else if(H(t))for(r=Object.keys(t),n=r.length,s=0;s<n;s++)i.call(e,t[r[s]],r[s])}function K(t,i){let e,s,n,r;if(!t||!i||t.length!==i.length)return!1;for(e=0,s=t.length;e<s;++e)if(n=t[e],r=i[e],n.datasetIndex!==r.datasetIndex||n.index!==r.index)return!1;return!0}function Q(t){if(N(t))return t.map(Q);if(H(t)){const i=Object.create(null),e=Object.keys(t),s=e.length;let n=0;for(;n<s;++n)i[e[n]]=Q(t[e[n]]);return i}return t}function q(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function G(t,i,e,s){if(!q(t))return;const n=i[t],r=e[t];H(n)&&H(r)?J(n,r,s):i[t]=Q(r)}function J(t,i,e){const s=N(i)?i:[i],n=s.length;if(!H(t))return t;const r=(e=e||{}).merger||G;let o;for(let i=0;i<n;++i){if(o=s[i],!H(o))continue;const n=Object.keys(o);for(let i=0,s=n.length;i<s;++i)r(n[i],t,o,e)}return t}function tt(t,i){return J(t,i,{merger:it})}function it(t,i,e){if(!q(t))return;const s=i[t],n=e[t];H(s)&&H(n)?tt(s,n):Object.prototype.hasOwnProperty.call(i,t)||(i[t]=Q(n))}const et={"":t=>t,x:t=>t.x,y:t=>t.y};function st(t,i){const e=et[i]||(et[i]=function(t){const i=function(t){const i=t.split("."),e=[];let s="";for(const t of i)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}(t);return t=>{for(const e of i){if(""===e)break;t=t&&t[e]}return t}}(i));return e(t)}function nt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const rt=t=>void 0!==t,ot=t=>"function"==typeof t,ht=(t,i)=>{if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0},at=Math.PI,ct=2*at,lt=Number.POSITIVE_INFINITY,ut=at/180,ft=at/2,dt=at/4,bt=2*at/3,gt=Math.log10,pt=Math.sign;function mt(t,i,e){return Math.abs(t-i)<e}function vt(t){const i=Math.round(t);t=mt(t,i,t/1e3)?i:t;const e=Math.pow(10,Math.floor(gt(t))),s=t/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function xt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function yt(t){return t*(at/180)}function Mt(t){if(!$(t))return;let i=1,e=0;for(;Math.round(t*i)/i!==t;)i*=10,e++;return e}function wt(t){return(t%ct+ct)%ct}function _t(t,i,e,s){const n=wt(t),r=wt(i),o=wt(e),h=wt(r-n),a=wt(o-n),c=wt(n-r),l=wt(n-o);return n===r||n===o||s&&r===o||h>a&&c<l}function kt(t,i,e){return Math.max(i,Math.min(e,t))}function Ot(t,i,e,s=1e-6){return t>=Math.min(i,e)-s&&t<=Math.max(i,e)+s}function St(t,i,e){e=e||(e=>t[e]<i);let s,n=t.length-1,r=0;for(;n-r>1;)s=r+n>>1,e(s)?r=s:n=s;return{lo:r,hi:n}}const At=(t,i,e,s)=>St(t,e,s?s=>{const n=t[s][i];return n<e||n===e&&t[s+1][i]===e}:s=>t[s][i]<e),Dt=(t,i,e)=>St(t,e,(s=>t[s][i]>=e)),jt=["push","pop","shift","splice","unshift"];function Rt(t,i){const e=t._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(i);-1!==n&&s.splice(n,1),s.length>0||(jt.forEach((i=>{delete t[i]})),delete t._chartjs)}const Ct="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Et(t,i){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Ct.call(window,(()=>{s=!1,t.apply(i,e)})))}}const Lt=t=>"start"===t?"left":"end"===t?"right":"center",Pt=(t,i,e)=>"start"===t?i:"end"===t?e:(i+e)/2,Tt=t=>0===t||1===t,It=(t,i,e)=>-Math.pow(2,10*(t-=1))*Math.sin((t-i)*ct/e),Ft=(t,i,e)=>Math.pow(2,-10*t)*Math.sin((t-i)*ct/e)+1,Bt={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=>1-Math.cos(t*ft),easeOutSine:t=>Math.sin(t*ft),easeInOutSine:t=>-.5*(Math.cos(at*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Tt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),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=>Tt(t)?t:It(t,.075,.3),easeOutElastic:t=>Tt(t)?t:Ft(t,.075,.3),easeInOutElastic(t){const i=.1125;return Tt(t)?t:t<.5?.5*It(2*t,i,.45):.5+.5*Ft(2*t-1,i,.45)},easeInBack(t){const i=1.70158;return t*t*((i+1)*t-i)},easeOutBack(t){const i=1.70158;return(t-=1)*t*((i+1)*t+i)+1},easeInOutBack(t){let i=1.70158;return(t/=.5)<1?t*t*((1+(i*=1.525))*t-i)*.5:.5*((t-=2)*t*((1+(i*=1.525))*t+i)+2)},easeInBounce:t=>1-Bt.easeOutBounce(1-t),easeOutBounce(t){const i=7.5625,e=2.75;return t<1/e?i*t*t:t<2/e?i*(t-=1.5/e)*t+.75:t<2.5/e?i*(t-=2.25/e)*t+.9375:i*(t-=2.625/e)*t+.984375},easeInOutBounce:t=>t<.5?.5*Bt.easeInBounce(2*t):.5*Bt.easeOutBounce(2*t-1)+.5};function Wt(t){if(t&&"object"==typeof t){const i=t.toString();return"[object CanvasPattern]"===i||"[object CanvasGradient]"===i}return!1}function zt(t){return Wt(t)?t:new F(t)}function Nt(t){return Wt(t)?t:new F(t).saturate(.5).darken(.1).hexString()}const Ht=["x","y","borderWidth","radius","tension"],$t=["color","borderColor","backgroundColor"],Yt=new Map;function Vt(t,i,e){return function(t,i){i=i||{};const e=t+JSON.stringify(i);let s=Yt.get(e);return s||(s=new Intl.NumberFormat(t,i),Yt.set(e,s)),s}(i,e).format(t)}var Xt={formatters:{values:t=>N(t)?t:""+t,numeric(t,i,e){if(0===t)return"0";const s=this.chart.options.locale;let n,r=t;if(e.length>1){const i=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(i<1e-4||i>1e15)&&(n="scientific"),r=function(t,i){let e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(e)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),e}(t,e)}const o=gt(Math.abs(r)),h=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:n,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(a,this.options.ticks.format),Vt(t,s,a)}}};const Ut=Object.create(null),Zt=Object.create(null);function Kt(t,i){if(!i)return t;const e=i.split(".");for(let i=0,s=e.length;i<s;++i){const s=e[i];t=t[s]||(t[s]=Object.create(null))}return t}function Qt(t,i,e){return"string"==typeof i?J(Kt(t,i),e):J(Kt(t,""),i)}class qt{constructor(t,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,i)=>Nt(i.backgroundColor),this.hoverBorderColor=(t,i)=>Nt(i.borderColor),this.hoverColor=(t,i)=>Nt(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(t),this.apply(i)}set(t,i){return Qt(this,t,i)}get(t){return Kt(this,t)}describe(t,i){return Qt(Zt,t,i)}override(t,i){return Qt(Ut,t,i)}route(t,i,e,s){const n=Kt(this,t),r=Kt(this,e),o="_"+i;Object.defineProperties(n,{[o]:{value:n[i],writable:!0},[i]:{enumerable:!0,get(){const t=this[o],i=r[s];return H(t)?Object.assign({},i,t):V(t,i)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Gt=new qt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(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:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:$t},numbers:{type:"number",properties:Ht}}),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:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(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:(t,i)=>i.lineWidth,tickColor:(t,i)=>i.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:Xt.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Jt(t,i,e,s,n){let r=i[n];return r||(r=i[n]=t.measureText(n).width,e.push(n)),r>s&&(s=r),s}function ti(t,i,e){const s=t.currentDevicePixelRatio,n=0!==e?Math.max(e/2,.5):0;return Math.round((i-n)*s)/s+n}function ii(t,i){(i||t)&&((i=i||t.getContext("2d")).save(),i.resetTransform(),i.clearRect(0,0,t.width,t.height),i.restore())}function ei(t,i,e,s){si(t,i,e,s,null)}function si(t,i,e,s,n){let r,o,h,a,c,l,u,f;const d=i.pointStyle,b=i.rotation,g=i.radius;let p=(b||0)*ut;if(d&&"object"==typeof d&&(r=d.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(e,s),t.rotate(p),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),d){default:n?t.ellipse(e,s,n/2,g,0,0,ct):t.arc(e,s,g,0,ct),t.closePath();break;case"triangle":l=n?n/2:g,t.moveTo(e+Math.sin(p)*l,s-Math.cos(p)*g),p+=bt,t.lineTo(e+Math.sin(p)*l,s-Math.cos(p)*g),p+=bt,t.lineTo(e+Math.sin(p)*l,s-Math.cos(p)*g),t.closePath();break;case"rectRounded":c=.516*g,a=g-c,o=Math.cos(p+dt)*a,u=Math.cos(p+dt)*(n?n/2-c:a),h=Math.sin(p+dt)*a,f=Math.sin(p+dt)*(n?n/2-c:a),t.arc(e-u,s-h,c,p-at,p-ft),t.arc(e+f,s-o,c,p-ft,p),t.arc(e+u,s+h,c,p,p+ft),t.arc(e-f,s+o,c,p+ft,p+at),t.closePath();break;case"rect":if(!b){a=Math.SQRT1_2*g,l=n?n/2:a,t.rect(e-l,s-a,2*l,2*a);break}p+=dt;case"rectRot":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+f,s-o),t.lineTo(e+u,s+h),t.lineTo(e-f,s+o),t.closePath();break;case"crossRot":p+=dt;case"cross":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o);break;case"star":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o),p+=dt,u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o);break;case"line":o=n?n/2:Math.cos(p)*g,h=Math.sin(p)*g,t.moveTo(e-o,s-h),t.lineTo(e+o,s+h);break;case"dash":t.moveTo(e,s),t.lineTo(e+Math.cos(p)*(n?n/2:g),s+Math.sin(p)*g);break;case!1:t.closePath()}t.fill(),i.borderWidth>0&&t.stroke()}}function ni(t,i,e){return e=e||.5,!i||t&&t.x>i.left-e&&t.x<i.right+e&&t.y>i.top-e&&t.y<i.bottom+e}function ri(t,i){t.save(),t.beginPath(),t.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),t.clip()}function oi(t){t.restore()}function hi(t,i,e,s,n){if(n.strikethrough||n.underline){const r=t.measureText(s),o=i-r.actualBoundingBoxLeft,h=i+r.actualBoundingBoxRight,a=e+r.actualBoundingBoxDescent,c=n.strikethrough?(e-r.actualBoundingBoxAscent+a)/2:a;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(o,c),t.lineTo(h,c),t.stroke()}}function ai(t,i){const e=t.fillStyle;t.fillStyle=i.color,t.fillRect(i.left,i.top,i.width,i.height),t.fillStyle=e}function ci(t,i,e,s,n,r={}){const o=N(i)?i:[i],h=r.strokeWidth>0&&""!==r.strokeColor;let a,c;for(t.save(),t.font=n.string,function(t,i){i.translation&&t.translate(i.translation[0],i.translation[1]),z(i.rotation)||t.rotate(i.rotation),i.color&&(t.fillStyle=i.color),i.textAlign&&(t.textAlign=i.textAlign),i.textBaseline&&(t.textBaseline=i.textBaseline)}(t,r),a=0;a<o.length;++a)c=o[a],r.backdrop&&ai(t,r.backdrop),h&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),z(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(c,e,s,r.maxWidth)),t.fillText(c,e,s,r.maxWidth),hi(t,e,s,c,r),s+=Number(n.lineHeight);t.restore()}function li(t,i){const{x:e,y:s,w:n,h:r,radius:o}=i;t.arc(e+o.topLeft,s+o.topLeft,o.topLeft,1.5*at,at,!0),t.lineTo(e,s+r-o.bottomLeft),t.arc(e+o.bottomLeft,s+r-o.bottomLeft,o.bottomLeft,at,ft,!0),t.lineTo(e+n-o.bottomRight,s+r),t.arc(e+n-o.bottomRight,s+r-o.bottomRight,o.bottomRight,ft,0,!0),t.lineTo(e+n,s+o.topRight),t.arc(e+n-o.topRight,s+o.topRight,o.topRight,0,-ft,!0),t.lineTo(e+o.topLeft,s)}const ui=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function di(t,i){const e=(""+t).match(ui);if(!e||"normal"===e[1])return 1.2*i;switch(t=+e[2],e[3]){case"px":return t;case"%":t/=100}return i*t}function bi(t,i){const e={},s=H(i),n=s?Object.keys(i):i,r=H(t)?s?e=>V(t[e],t[i[e]]):i=>t[i]:()=>t;for(const t of n)e[t]=+r(t)||0;return e}function gi(t){return bi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function pi(t){return bi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function mi(t){const i=gi(t);return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function vi(t,i){let e=V((t=t||{}).size,(i=i||Gt.font).size);"string"==typeof e&&(e=parseInt(e,10));let s=V(t.style,i.style);s&&!(""+s).match(fi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:V(t.family,i.family),lineHeight:di(V(t.lineHeight,i.lineHeight),e),size:e,style:s,weight:V(t.weight,i.weight),string:""};return n.string=function(t){return!t||z(t.size)||z(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function xi(t){let i,e,s;for(i=0,e=t.length;i<e;++i)if(s=t[i],void 0!==s&&void 0!==s)return s}function yi(t,i){return Object.assign(Object.create(t),i)}function Mi(t,i=[""],e,s,n=()=>t[0]){const r=e||t;void 0===s&&(s=Ei("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:s,_getTarget:n,override:e=>Mi([e,...t],i,r,s)};return new Proxy(o,{deleteProperty:(i,e)=>(delete i[e],delete i._keys,delete t[0][e],!0),get:(e,s)=>Si(e,s,(()=>function(t,i,e,s){let n;for(const r of i)if(n=Ei(ki(r,t),e),void 0!==n)return Oi(t,n)?Ri(e,s,t,n):n}(s,i,t,e))),getOwnPropertyDescriptor:(t,i)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],i),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,i)=>Li(t).includes(i),ownKeys:t=>Li(t),set(t,i,e){const s=t._storage||(t._storage=n());return t[i]=s[i]=e,delete t._keys,!0}})}function wi(t,i,e,s){const n={_cacheable:!1,_proxy:t,_context:i,_subProxy:e,_stack:new Set,_descriptors:_i(t,s),setContext:i=>wi(t,i,e,s),override:n=>wi(t.override(n),i,e,s)};return new Proxy(n,{deleteProperty:(i,e)=>(delete i[e],delete t[e],!0),get:(t,i,e)=>Si(t,i,(()=>function(t,i,e){const{_proxy:s,_context:n,_subProxy:r,_descriptors:o}=t;let h=s[i];return ot(h)&&o.isScriptable(i)&&(h=function(t,i,e,s){const{_proxy:n,_context:r,_subProxy:o,_stack:h}=e;if(h.has(t))throw new Error("Recursion detected: "+Array.from(h).join("->")+"->"+t);h.add(t);let a=i(r,o||s);return h.delete(t),Oi(t,a)&&(a=Ri(n._scopes,n,t,a)),a}(i,h,t,e)),N(h)&&h.length&&(h=function(t,i,e,s){const{_proxy:n,_context:r,_subProxy:o,_descriptors:h}=e;if(void 0!==r.index&&s(t))return i[r.index%i.length];if(H(i[0])){const e=i,s=n._scopes.filter((t=>t!==e));i=[];for(const a of e){const e=Ri(s,n,t,a);i.push(wi(e,r,o&&o[t],h))}}return i}(i,h,t,o.isIndexable)),Oi(i,h)&&(h=wi(h,n,r&&r[i],o)),h}(t,i,e))),getOwnPropertyDescriptor:(i,e)=>i._descriptors.allKeys?Reflect.has(t,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,e),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(i,e)=>Reflect.has(t,e),ownKeys:()=>Reflect.ownKeys(t),set:(i,e,s)=>(t[e]=s,delete i[e],!0)})}function _i(t,i={scriptable:!0,indexable:!0}){const{_scriptable:e=i.scriptable,_indexable:s=i.indexable,_allKeys:n=i.allKeys}=t;return{allKeys:n,scriptable:e,indexable:s,isScriptable:ot(e)?e:()=>e,isIndexable:ot(s)?s:()=>s}}const ki=(t,i)=>t?t+nt(i):i,Oi=(t,i)=>H(i)&&"adapters"!==t&&(null===Object.getPrototypeOf(i)||i.constructor===Object);function Si(t,i,e){if(Object.prototype.hasOwnProperty.call(t,i)||"constructor"===i)return t[i];const s=e();return t[i]=s,s}function Ai(t,i,e){return ot(t)?t(i,e):t}const Di=(t,i)=>!0===t?i:"string"==typeof t?st(i,t):void 0;function ji(t,i,e,s,n){for(const r of i){const i=Di(e,r);if(i){t.add(i);const r=Ai(i._fallback,e,n);if(void 0!==r&&r!==e&&r!==s)return r}else if(!1===i&&void 0!==s&&e!==s)return null}return!1}function Ri(t,i,e,s){const n=i._rootScopes,r=Ai(i._fallback,e,s),o=[...t,...n],h=new Set;h.add(s);let a=Ci(h,o,e,r||e,s);return null!==a&&(void 0===r||r===e||(a=Ci(h,o,r,a,s),null!==a))&&Mi(Array.from(h),[""],n,r,(()=>function(t,i,e){const s=t._getTarget();i in s||(s[i]={});const n=s[i];return N(n)&&H(e)?e:n||{}}(i,e,s)))}function Ci(t,i,e,s,n){for(;e;)e=ji(t,i,e,s,n);return e}function Ei(t,i){for(const e of i){if(!e)continue;const i=e[t];if(void 0!==i)return i}}function Li(t){let i=t._keys;return i||(i=t._keys=function(t){const i=new Set;for(const e of t)for(const t of Object.keys(e).filter((t=>!t.startsWith("_"))))i.add(t);return Array.from(i)}(t._scopes)),i}function Pi(t,i,e,s){const{iScale:n}=t,{key:r="r"}=this._parsing,o=new Array(s);let h,a,c,l;for(h=0,a=s;h<a;++h)c=h+e,l=i[c],o[h]={r:n.parse(st(l,r),c)};return o}function Ti(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ii(t){let i=t.parentNode;return i&&"[object ShadowRoot]"===i.toString()&&(i=i.host),i}function Fi(t,i,e){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*i.parentNode[e])):s=t,s}const Bi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Wi=["top","right","bottom","left"];function zi(t,i,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const r=Wi[n];s[r]=parseFloat(t[i+"-"+r+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Ni(t,i){if("native"in t)return t;const{canvas:e,currentDevicePixelRatio:s}=i,n=Bi(e),r="border-box"===n.boxSizing,o=zi(n,"padding"),h=zi(n,"border","width"),{x:a,y:c,box:l}=function(t,i){const e=t.touches,s=e&&e.length?e[0]:t,{offsetX:n,offsetY:r}=s;let o,h,a=!1;if(((t,i,e)=>(t>0||i>0)&&(!e||!e.shadowRoot))(n,r,t.target))o=n,h=r;else{const t=i.getBoundingClientRect();o=s.clientX-t.left,h=s.clientY-t.top,a=!0}return{x:o,y:h,box:a}}(t,e),u=o.left+(l&&h.left),f=o.top+(l&&h.top);let{width:d,height:b}=i;return r&&(d-=o.width+h.width,b-=o.height+h.height),{x:Math.round((a-u)/d*e.width/s),y:Math.round((c-f)/b*e.height/s)}}const Hi=t=>Math.round(10*t)/10;function $i(t,i,e){const s=i||1,n=Hi(t.height*s),r=Hi(t.width*s);t.height=Hi(t.height),t.width=Hi(t.width);const o=t.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||o.height!==n||o.width!==r)&&(t.currentDevicePixelRatio=s,o.height=n,o.width=r,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Yi=function(){let t=!1;try{const i={get passive(){return t=!0,!1}};Ti()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i))}catch(t){}return t}();function Vi(t,i){const e=function(t,i){return Bi(t).getPropertyValue(i)}(t,i),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Xi(t,i,e){return t?function(t,i){return{x:e=>t+t+i-e,setWidth(t){i=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,i)=>t-i,leftForLtr:(t,i)=>t-i}}(i,e):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,i)=>t+i,leftForLtr:t=>t}}function Ui(t,i){let e,s;"ltr"!==i&&"rtl"!==i||(e=t.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",i,"important"),t.prevTextDirection=s)}function Zi(t,i){void 0!==i&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",i[0],i[1]))}function Ki(t,i,e){return t.options.clip?t[e]:i[e]}
|
|
13
|
+
*/function B(){}const N=(()=>{let t=0;return()=>t++})();function W(t){return null==t}function z(t){if(Array.isArray&&Array.isArray(t))return!0;const i=Object.prototype.toString.call(t);return"[object"===i.slice(0,7)&&"Array]"===i.slice(-6)}function H(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function $(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Y(t,i){return $(t)?t:i}function V(t,i){return void 0===t?i:t}const X=(t,i)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*i:+t;function U(t,i,e){if(t&&"function"==typeof t.call)return t.apply(e,i)}function Z(t,i,e){let s,n,r;if(z(t))for(n=t.length,s=0;s<n;s++)i.call(e,t[s],s);else if(H(t))for(r=Object.keys(t),n=r.length,s=0;s<n;s++)i.call(e,t[r[s]],r[s])}function K(t,i){let e,s,n,r;if(!t||!i||t.length!==i.length)return!1;for(e=0,s=t.length;e<s;++e)if(n=t[e],r=i[e],n.datasetIndex!==r.datasetIndex||n.index!==r.index)return!1;return!0}function Q(t){if(z(t))return t.map(Q);if(H(t)){const i=Object.create(null),e=Object.keys(t),s=e.length;let n=0;for(;n<s;++n)i[e[n]]=Q(t[e[n]]);return i}return t}function q(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function G(t,i,e,s){if(!q(t))return;const n=i[t],r=e[t];H(n)&&H(r)?J(n,r,s):i[t]=Q(r)}function J(t,i,e){const s=z(i)?i:[i],n=s.length;if(!H(t))return t;const r=(e=e||{}).merger||G;let o;for(let i=0;i<n;++i){if(o=s[i],!H(o))continue;const n=Object.keys(o);for(let i=0,s=n.length;i<s;++i)r(n[i],t,o,e)}return t}function tt(t,i){return J(t,i,{merger:it})}function it(t,i,e){if(!q(t))return;const s=i[t],n=e[t];H(s)&&H(n)?tt(s,n):Object.prototype.hasOwnProperty.call(i,t)||(i[t]=Q(n))}const et={"":t=>t,x:t=>t.x,y:t=>t.y};function st(t,i){const e=et[i]||(et[i]=function(t){const i=function(t){const i=t.split("."),e=[];let s="";for(const t of i)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}(t);return t=>{for(const e of i){if(""===e)break;t=t&&t[e]}return t}}(i));return e(t)}function nt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const rt=t=>void 0!==t,ot=t=>"function"==typeof t,ht=(t,i)=>{if(t.size!==i.size)return!1;for(const e of t)if(!i.has(e))return!1;return!0},at=Math.PI,ct=2*at,lt=Number.POSITIVE_INFINITY,ut=at/180,ft=at/2,dt=at/4,bt=2*at/3,gt=Math.log10,pt=Math.sign;function mt(t,i,e){return Math.abs(t-i)<e}function xt(t){const i=Math.round(t);t=mt(t,i,t/1e3)?i:t;const e=Math.pow(10,Math.floor(gt(t))),s=t/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function vt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function yt(t){return t*(at/180)}function Mt(t){if(!$(t))return;let i=1,e=0;for(;Math.round(t*i)/i!==t;)i*=10,e++;return e}function wt(t){return(t%ct+ct)%ct}function _t(t,i,e,s){const n=wt(t),r=wt(i),o=wt(e),h=wt(r-n),a=wt(o-n),c=wt(n-r),l=wt(n-o);return n===r||n===o||s&&r===o||h>a&&c<l}function kt(t,i,e){return Math.max(i,Math.min(e,t))}function Ot(t,i,e,s=1e-6){return t>=Math.min(i,e)-s&&t<=Math.max(i,e)+s}function St(t,i,e){e=e||(e=>t[e]<i);let s,n=t.length-1,r=0;for(;n-r>1;)s=r+n>>1,e(s)?r=s:n=s;return{lo:r,hi:n}}const At=(t,i,e,s)=>St(t,e,s?s=>{const n=t[s][i];return n<e||n===e&&t[s+1][i]===e}:s=>t[s][i]<e),Dt=(t,i,e)=>St(t,e,(s=>t[s][i]>=e)),jt=["push","pop","shift","splice","unshift"];function Rt(t,i){const e=t._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(i);-1!==n&&s.splice(n,1),s.length>0||(jt.forEach((i=>{delete t[i]})),delete t._chartjs)}const Ct="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Et(t,i){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Ct.call(window,(()=>{s=!1,t.apply(i,e)})))}}const Lt=t=>"start"===t?"left":"end"===t?"right":"center",Pt=(t,i,e)=>"start"===t?i:"end"===t?e:(i+e)/2,Tt=t=>0===t||1===t,It=(t,i,e)=>-Math.pow(2,10*(t-=1))*Math.sin((t-i)*ct/e),Ft=(t,i,e)=>Math.pow(2,-10*t)*Math.sin((t-i)*ct/e)+1,Bt={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=>1-Math.cos(t*ft),easeOutSine:t=>Math.sin(t*ft),easeInOutSine:t=>-.5*(Math.cos(at*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Tt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),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=>Tt(t)?t:It(t,.075,.3),easeOutElastic:t=>Tt(t)?t:Ft(t,.075,.3),easeInOutElastic(t){const i=.1125;return Tt(t)?t:t<.5?.5*It(2*t,i,.45):.5+.5*Ft(2*t-1,i,.45)},easeInBack(t){const i=1.70158;return t*t*((i+1)*t-i)},easeOutBack(t){const i=1.70158;return(t-=1)*t*((i+1)*t+i)+1},easeInOutBack(t){let i=1.70158;return(t/=.5)<1?t*t*((1+(i*=1.525))*t-i)*.5:.5*((t-=2)*t*((1+(i*=1.525))*t+i)+2)},easeInBounce:t=>1-Bt.easeOutBounce(1-t),easeOutBounce(t){const i=7.5625,e=2.75;return t<1/e?i*t*t:t<2/e?i*(t-=1.5/e)*t+.75:t<2.5/e?i*(t-=2.25/e)*t+.9375:i*(t-=2.625/e)*t+.984375},easeInOutBounce:t=>t<.5?.5*Bt.easeInBounce(2*t):.5*Bt.easeOutBounce(2*t-1)+.5};function Nt(t){if(t&&"object"==typeof t){const i=t.toString();return"[object CanvasPattern]"===i||"[object CanvasGradient]"===i}return!1}function Wt(t){return Nt(t)?t:new F(t)}function zt(t){return Nt(t)?t:new F(t).saturate(.5).darken(.1).hexString()}const Ht=["x","y","borderWidth","radius","tension"],$t=["color","borderColor","backgroundColor"],Yt=new Map;function Vt(t,i,e){return function(t,i){i=i||{};const e=t+JSON.stringify(i);let s=Yt.get(e);return s||(s=new Intl.NumberFormat(t,i),Yt.set(e,s)),s}(i,e).format(t)}var Xt={formatters:{values:t=>z(t)?t:""+t,numeric(t,i,e){if(0===t)return"0";const s=this.chart.options.locale;let n,r=t;if(e.length>1){const i=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(i<1e-4||i>1e15)&&(n="scientific"),r=function(t,i){let e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(e)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),e}(t,e)}const o=gt(Math.abs(r)),h=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:n,minimumFractionDigits:h,maximumFractionDigits:h};return Object.assign(a,this.options.ticks.format),Vt(t,s,a)}}};const Ut=Object.create(null),Zt=Object.create(null);function Kt(t,i){if(!i)return t;const e=i.split(".");for(let i=0,s=e.length;i<s;++i){const s=e[i];t=t[s]||(t[s]=Object.create(null))}return t}function Qt(t,i,e){return"string"==typeof i?J(Kt(t,i),e):J(Kt(t,""),i)}class qt{constructor(t,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,i)=>zt(i.backgroundColor),this.hoverBorderColor=(t,i)=>zt(i.borderColor),this.hoverColor=(t,i)=>zt(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(t),this.apply(i)}set(t,i){return Qt(this,t,i)}get(t){return Kt(this,t)}describe(t,i){return Qt(Zt,t,i)}override(t,i){return Qt(Ut,t,i)}route(t,i,e,s){const n=Kt(this,t),r=Kt(this,e),o="_"+i;Object.defineProperties(n,{[o]:{value:n[i],writable:!0},[i]:{enumerable:!0,get(){const t=this[o],i=r[s];return H(t)?Object.assign({},i,t):V(t,i)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Gt=new qt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(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:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:$t},numbers:{type:"number",properties:Ht}}),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:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(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:(t,i)=>i.lineWidth,tickColor:(t,i)=>i.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:Xt.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Jt(t,i,e,s,n){let r=i[n];return r||(r=i[n]=t.measureText(n).width,e.push(n)),r>s&&(s=r),s}function ti(t,i,e){const s=t.currentDevicePixelRatio,n=0!==e?Math.max(e/2,.5):0;return Math.round((i-n)*s)/s+n}function ii(t,i){(i||t)&&((i=i||t.getContext("2d")).save(),i.resetTransform(),i.clearRect(0,0,t.width,t.height),i.restore())}function ei(t,i,e,s){si(t,i,e,s,null)}function si(t,i,e,s,n){let r,o,h,a,c,l,u,f;const d=i.pointStyle,b=i.rotation,g=i.radius;let p=(b||0)*ut;if(d&&"object"==typeof d&&(r=d.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(e,s),t.rotate(p),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),d){default:n?t.ellipse(e,s,n/2,g,0,0,ct):t.arc(e,s,g,0,ct),t.closePath();break;case"triangle":l=n?n/2:g,t.moveTo(e+Math.sin(p)*l,s-Math.cos(p)*g),p+=bt,t.lineTo(e+Math.sin(p)*l,s-Math.cos(p)*g),p+=bt,t.lineTo(e+Math.sin(p)*l,s-Math.cos(p)*g),t.closePath();break;case"rectRounded":c=.516*g,a=g-c,o=Math.cos(p+dt)*a,u=Math.cos(p+dt)*(n?n/2-c:a),h=Math.sin(p+dt)*a,f=Math.sin(p+dt)*(n?n/2-c:a),t.arc(e-u,s-h,c,p-at,p-ft),t.arc(e+f,s-o,c,p-ft,p),t.arc(e+u,s+h,c,p,p+ft),t.arc(e-f,s+o,c,p+ft,p+at),t.closePath();break;case"rect":if(!b){a=Math.SQRT1_2*g,l=n?n/2:a,t.rect(e-l,s-a,2*l,2*a);break}p+=dt;case"rectRot":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+f,s-o),t.lineTo(e+u,s+h),t.lineTo(e-f,s+o),t.closePath();break;case"crossRot":p+=dt;case"cross":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o);break;case"star":u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o),p+=dt,u=Math.cos(p)*(n?n/2:g),o=Math.cos(p)*g,h=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),t.moveTo(e-u,s-h),t.lineTo(e+u,s+h),t.moveTo(e+f,s-o),t.lineTo(e-f,s+o);break;case"line":o=n?n/2:Math.cos(p)*g,h=Math.sin(p)*g,t.moveTo(e-o,s-h),t.lineTo(e+o,s+h);break;case"dash":t.moveTo(e,s),t.lineTo(e+Math.cos(p)*(n?n/2:g),s+Math.sin(p)*g);break;case!1:t.closePath()}t.fill(),i.borderWidth>0&&t.stroke()}}function ni(t,i,e){return e=e||.5,!i||t&&t.x>i.left-e&&t.x<i.right+e&&t.y>i.top-e&&t.y<i.bottom+e}function ri(t,i){t.save(),t.beginPath(),t.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),t.clip()}function oi(t){t.restore()}function hi(t,i,e,s,n){if(n.strikethrough||n.underline){const r=t.measureText(s),o=i-r.actualBoundingBoxLeft,h=i+r.actualBoundingBoxRight,a=e+r.actualBoundingBoxDescent,c=n.strikethrough?(e-r.actualBoundingBoxAscent+a)/2:a;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(o,c),t.lineTo(h,c),t.stroke()}}function ai(t,i){const e=t.fillStyle;t.fillStyle=i.color,t.fillRect(i.left,i.top,i.width,i.height),t.fillStyle=e}function ci(t,i,e,s,n,r={}){const o=z(i)?i:[i],h=r.strokeWidth>0&&""!==r.strokeColor;let a,c;for(t.save(),t.font=n.string,function(t,i){i.translation&&t.translate(i.translation[0],i.translation[1]),W(i.rotation)||t.rotate(i.rotation),i.color&&(t.fillStyle=i.color),i.textAlign&&(t.textAlign=i.textAlign),i.textBaseline&&(t.textBaseline=i.textBaseline)}(t,r),a=0;a<o.length;++a)c=o[a],r.backdrop&&ai(t,r.backdrop),h&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),W(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(c,e,s,r.maxWidth)),t.fillText(c,e,s,r.maxWidth),hi(t,e,s,c,r),s+=Number(n.lineHeight);t.restore()}function li(t,i){const{x:e,y:s,w:n,h:r,radius:o}=i;t.arc(e+o.topLeft,s+o.topLeft,o.topLeft,1.5*at,at,!0),t.lineTo(e,s+r-o.bottomLeft),t.arc(e+o.bottomLeft,s+r-o.bottomLeft,o.bottomLeft,at,ft,!0),t.lineTo(e+n-o.bottomRight,s+r),t.arc(e+n-o.bottomRight,s+r-o.bottomRight,o.bottomRight,ft,0,!0),t.lineTo(e+n,s+o.topRight),t.arc(e+n-o.topRight,s+o.topRight,o.topRight,0,-ft,!0),t.lineTo(e+o.topLeft,s)}const ui=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function di(t,i){const e=(""+t).match(ui);if(!e||"normal"===e[1])return 1.2*i;switch(t=+e[2],e[3]){case"px":return t;case"%":t/=100}return i*t}function bi(t,i){const e={},s=H(i),n=s?Object.keys(i):i,r=H(t)?s?e=>V(t[e],t[i[e]]):i=>t[i]:()=>t;for(const t of n)e[t]=+r(t)||0;return e}function gi(t){return bi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function pi(t){return bi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function mi(t){const i=gi(t);return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function xi(t,i){let e=V((t=t||{}).size,(i=i||Gt.font).size);"string"==typeof e&&(e=parseInt(e,10));let s=V(t.style,i.style);s&&!(""+s).match(fi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:V(t.family,i.family),lineHeight:di(V(t.lineHeight,i.lineHeight),e),size:e,style:s,weight:V(t.weight,i.weight),string:""};return n.string=function(t){return!t||W(t.size)||W(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function vi(t){let i,e,s;for(i=0,e=t.length;i<e;++i)if(s=t[i],void 0!==s&&void 0!==s)return s}function yi(t,i){return Object.assign(Object.create(t),i)}function Mi(t,i=[""],e,s,n=()=>t[0]){const r=e||t;void 0===s&&(s=Ei("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:s,_getTarget:n,override:e=>Mi([e,...t],i,r,s)};return new Proxy(o,{deleteProperty:(i,e)=>(delete i[e],delete i._keys,delete t[0][e],!0),get:(e,s)=>Si(e,s,(()=>function(t,i,e,s){let n;for(const r of i)if(n=Ei(ki(r,t),e),void 0!==n)return Oi(t,n)?Ri(e,s,t,n):n}(s,i,t,e))),getOwnPropertyDescriptor:(t,i)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],i),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,i)=>Li(t).includes(i),ownKeys:t=>Li(t),set(t,i,e){const s=t._storage||(t._storage=n());return t[i]=s[i]=e,delete t._keys,!0}})}function wi(t,i,e,s){const n={_cacheable:!1,_proxy:t,_context:i,_subProxy:e,_stack:new Set,_descriptors:_i(t,s),setContext:i=>wi(t,i,e,s),override:n=>wi(t.override(n),i,e,s)};return new Proxy(n,{deleteProperty:(i,e)=>(delete i[e],delete t[e],!0),get:(t,i,e)=>Si(t,i,(()=>function(t,i,e){const{_proxy:s,_context:n,_subProxy:r,_descriptors:o}=t;let h=s[i];return ot(h)&&o.isScriptable(i)&&(h=function(t,i,e,s){const{_proxy:n,_context:r,_subProxy:o,_stack:h}=e;if(h.has(t))throw new Error("Recursion detected: "+Array.from(h).join("->")+"->"+t);h.add(t);let a=i(r,o||s);return h.delete(t),Oi(t,a)&&(a=Ri(n._scopes,n,t,a)),a}(i,h,t,e)),z(h)&&h.length&&(h=function(t,i,e,s){const{_proxy:n,_context:r,_subProxy:o,_descriptors:h}=e;if(void 0!==r.index&&s(t))return i[r.index%i.length];if(H(i[0])){const e=i,s=n._scopes.filter((t=>t!==e));i=[];for(const a of e){const e=Ri(s,n,t,a);i.push(wi(e,r,o&&o[t],h))}}return i}(i,h,t,o.isIndexable)),Oi(i,h)&&(h=wi(h,n,r&&r[i],o)),h}(t,i,e))),getOwnPropertyDescriptor:(i,e)=>i._descriptors.allKeys?Reflect.has(t,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,e),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(i,e)=>Reflect.has(t,e),ownKeys:()=>Reflect.ownKeys(t),set:(i,e,s)=>(t[e]=s,delete i[e],!0)})}function _i(t,i={scriptable:!0,indexable:!0}){const{_scriptable:e=i.scriptable,_indexable:s=i.indexable,_allKeys:n=i.allKeys}=t;return{allKeys:n,scriptable:e,indexable:s,isScriptable:ot(e)?e:()=>e,isIndexable:ot(s)?s:()=>s}}const ki=(t,i)=>t?t+nt(i):i,Oi=(t,i)=>H(i)&&"adapters"!==t&&(null===Object.getPrototypeOf(i)||i.constructor===Object);function Si(t,i,e){if(Object.prototype.hasOwnProperty.call(t,i)||"constructor"===i)return t[i];const s=e();return t[i]=s,s}function Ai(t,i,e){return ot(t)?t(i,e):t}const Di=(t,i)=>!0===t?i:"string"==typeof t?st(i,t):void 0;function ji(t,i,e,s,n){for(const r of i){const i=Di(e,r);if(i){t.add(i);const r=Ai(i._fallback,e,n);if(void 0!==r&&r!==e&&r!==s)return r}else if(!1===i&&void 0!==s&&e!==s)return null}return!1}function Ri(t,i,e,s){const n=i._rootScopes,r=Ai(i._fallback,e,s),o=[...t,...n],h=new Set;h.add(s);let a=Ci(h,o,e,r||e,s);return null!==a&&(void 0===r||r===e||(a=Ci(h,o,r,a,s),null!==a))&&Mi(Array.from(h),[""],n,r,(()=>function(t,i,e){const s=t._getTarget();i in s||(s[i]={});const n=s[i];return z(n)&&H(e)?e:n||{}}(i,e,s)))}function Ci(t,i,e,s,n){for(;e;)e=ji(t,i,e,s,n);return e}function Ei(t,i){for(const e of i){if(!e)continue;const i=e[t];if(void 0!==i)return i}}function Li(t){let i=t._keys;return i||(i=t._keys=function(t){const i=new Set;for(const e of t)for(const t of Object.keys(e).filter((t=>!t.startsWith("_"))))i.add(t);return Array.from(i)}(t._scopes)),i}function Pi(t,i,e,s){const{iScale:n}=t,{key:r="r"}=this._parsing,o=new Array(s);let h,a,c,l;for(h=0,a=s;h<a;++h)c=h+e,l=i[c],o[h]={r:n.parse(st(l,r),c)};return o}function Ti(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ii(t){let i=t.parentNode;return i&&"[object ShadowRoot]"===i.toString()&&(i=i.host),i}function Fi(t,i,e){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*i.parentNode[e])):s=t,s}const Bi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),Ni=["top","right","bottom","left"];function Wi(t,i,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const r=Ni[n];s[r]=parseFloat(t[i+"-"+r+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function zi(t,i){if("native"in t)return t;const{canvas:e,currentDevicePixelRatio:s}=i,n=Bi(e),r="border-box"===n.boxSizing,o=Wi(n,"padding"),h=Wi(n,"border","width"),{x:a,y:c,box:l}=function(t,i){const e=t.touches,s=e&&e.length?e[0]:t,{offsetX:n,offsetY:r}=s;let o,h,a=!1;if(((t,i,e)=>(t>0||i>0)&&(!e||!e.shadowRoot))(n,r,t.target))o=n,h=r;else{const t=i.getBoundingClientRect();o=s.clientX-t.left,h=s.clientY-t.top,a=!0}return{x:o,y:h,box:a}}(t,e),u=o.left+(l&&h.left),f=o.top+(l&&h.top);let{width:d,height:b}=i;return r&&(d-=o.width+h.width,b-=o.height+h.height),{x:Math.round((a-u)/d*e.width/s),y:Math.round((c-f)/b*e.height/s)}}const Hi=t=>Math.round(10*t)/10;function $i(t,i,e){const s=i||1,n=Hi(t.height*s),r=Hi(t.width*s);t.height=Hi(t.height),t.width=Hi(t.width);const o=t.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||o.height!==n||o.width!==r)&&(t.currentDevicePixelRatio=s,o.height=n,o.width=r,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Yi=function(){let t=!1;try{const i={get passive(){return t=!0,!1}};Ti()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i))}catch(t){}return t}();function Vi(t,i){const e=function(t,i){return Bi(t).getPropertyValue(i)}(t,i),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Xi(t,i,e){return t?function(t,i){return{x:e=>t+t+i-e,setWidth(t){i=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,i)=>t-i,leftForLtr:(t,i)=>t-i}}(i,e):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,i)=>t+i,leftForLtr:t=>t}}function Ui(t,i){let e,s;"ltr"!==i&&"rtl"!==i||(e=t.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",i,"important"),t.prevTextDirection=s)}function Zi(t,i){void 0!==i&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",i[0],i[1]))}function Ki(t,i,e){return t.options.clip?t[e]:i[e]}
|
|
14
14
|
/*!
|
|
15
15
|
* Chart.js v4.5.1
|
|
16
16
|
* https://www.chartjs.org
|
|
17
17
|
* (c) 2025 Chart.js Contributors
|
|
18
18
|
* Released under the MIT License
|
|
19
19
|
*/
|
|
20
|
-
class Qi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,e,s){const n=i.duration;i.listeners[s].forEach((s=>s({chart:t,initial:i.initial,numSteps:n,currentStep:Math.min(e-i.start,n)})))}_refresh(){this._request||(this._running=!0,this._request=Ct.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let i=0;this._charts.forEach(((e,s)=>{if(!e.running||!e.items.length)return;const n=e.items;let r,o=n.length-1,h=!1;for(;o>=0;--o)r=n[o],r._active?(r._total>e.duration&&(e.duration=r._total),r.tick(t),h=!0):(n[o]=n[n.length-1],n.pop());h&&(s.draw(),this._notify(s,e,t,"progress")),n.length||(e.running=!1,this._notify(s,e,t,"complete"),e.initial=!1),i+=n.length})),this._lastDate=t,0===i&&(this._running=!1)}_getAnims(t){const i=this._charts;let e=i.get(t);return e||(e={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,e)),e}listen(t,i,e){this._getAnims(t).listeners[i].push(e)}add(t,i){i&&i.length&&this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce(((t,i)=>Math.max(t,i._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!!(i&&i.running&&i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const e=i.items;let s=e.length-1;for(;s>=0;--s)e[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qi=new Qi;const Gi="transparent",Ji={boolean:(t,i,e)=>e>.5?i:t,color(t,i,e){const s=zt(t||Gi),n=s.valid&&zt(i||Gi);return n&&n.valid?n.mix(s,e).hexString():i},number:(t,i,e)=>t+(i-t)*e};class te{constructor(t,i,e,s){const n=i[e];s=xi([t.to,s,n,t.from]);const r=xi([t.from,n,s]);this._active=!0,this._fn=t.fn||Ji[t.type||typeof r],this._easing=Bt[t.easing]||Bt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=e,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,e){if(this._active){this._notify(!1);const s=this._target[this._prop],n=e-this._start,r=this._duration-n;this._start=e,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=xi([t.to,i,s,t.from]),this._from=xi([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,e=this._duration,s=this._prop,n=this._from,r=this._loop,o=this._to;let h;if(this._active=n!==o&&(r||i<e),!this._active)return this._target[s]=o,void this._notify(!0);i<0?this._target[s]=n:(h=i/e%2,h=r&&h>1?2-h:h,h=this._easing(Math.min(1,Math.max(0,h))),this._target[s]=this._fn(n,o,h))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((i,e)=>{t.push({res:i,rej:e})}))}_notify(t){const i=t?"res":"rej",e=this._promises||[];for(let t=0;t<e.length;t++)e[t][i]()}}class ie{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!H(t))return;const i=Object.keys(Gt.animation),e=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const n=t[s];if(!H(n))return;const r={};for(const t of i)r[t]=n[t];(N(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,i){const e=i.options,s=function(t,i){if(!i)return;let e=t.options;if(e)return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;t.options=i}(t,e);if(!s)return[];const n=this._createAnimations(s,e);return e.$shared&&function(t,i){const e=[],s=Object.keys(i);for(let i=0;i<s.length;i++){const n=t[s[i]];n&&n.active()&&e.push(n.wait())}return Promise.all(e)}(t.options.$animations,e).then((()=>{t.options=e}),(()=>{})),n}_createAnimations(t,i){const e=this._properties,s=[],n=t.$animations||(t.$animations={}),r=Object.keys(i),o=Date.now();let h;for(h=r.length-1;h>=0;--h){const a=r[h];if("$"===a.charAt(0))continue;if("options"===a){s.push(...this._animateOptions(t,i));continue}const c=i[a];let l=n[a];const u=e.get(a);if(l){if(u&&l.active()){l.update(u,c,o);continue}l.cancel()}u&&u.duration?(n[a]=l=new te(u,t,a,c),s.push(l)):t[a]=c}return s}update(t,i){if(0===this._properties.size)return void Object.assign(t,i);const e=this._createAnimations(t,i);return e.length?(qi.add(this._chart,e),!0):void 0}}function ee(t,i){const e=t&&t.options||{},s=e.reverse,n=void 0===e.min?i:0,r=void 0===e.max?i:0;return{start:s?r:n,end:s?n:r}}function se(t,i){const e=[],s=t._getSortedDatasetMetas(i);let n,r;for(n=0,r=s.length;n<r;++n)e.push(s[n].index);return e}function ne(t,i,e,s={}){const n=t.keys,r="single"===s.mode;let o,h,a,c;if(null===i)return;let l=!1;for(o=0,h=n.length;o<h;++o){if(a=+n[o],a===e){if(l=!0,s.all)continue;break}c=t.values[a],$(c)&&(r||0===i||pt(i)===pt(c))&&(i+=c)}return l||s.all?i:0}function re(t,i){const e=t&&t.options.stacked;return e||void 0===e&&void 0!==i.stack}function oe(t,i,e){const s=t[i]||(t[i]={});return s[e]||(s[e]={})}function he(t,i,e,s){for(const n of i.getMatchingVisibleMetas(s).reverse()){const i=t[n.index];if(e&&i>0||!e&&i<0)return n.index}return null}function ae(t,i){const{chart:e,_cachedMeta:s}=t,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:h}=s,a=r.axis,c=o.axis,l=function(t,i,e){return`${t.id}.${i.id}.${e.stack||e.type}`}(r,o,s),u=i.length;let f;for(let t=0;t<u;++t){const e=i[t],{[a]:r,[c]:u}=e;f=(e._stacks||(e._stacks={}))[c]=oe(n,l,r),f[h]=u,f._top=he(f,o,!0,s.type),f._bottom=he(f,o,!1,s.type),(f._visualValues||(f._visualValues={}))[h]=u}}function ce(t,i){const e=t.scales;return Object.keys(e).filter((t=>e[t].axis===i)).shift()}function le(t,i){const e=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(const t of i){const i=t._stacks;if(!i||void 0===i[s]||void 0===i[s][e])return;delete i[s][e],void 0!==i[s]._visualValues&&void 0!==i[s]._visualValues[e]&&delete i[s]._visualValues[e]}}}const ue=t=>"reset"===t||"none"===t,fe=(t,i)=>i?t:Object.assign({},t);class de{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=re(t.vScale,t),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(t){this.index!==t&&le(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,e=this.getDataset(),s=(t,i,e,s)=>"x"===t?i:"r"===t?s:e,n=i.xAxisID=V(e.xAxisID,ce(t,"x")),r=i.yAxisID=V(e.yAxisID,ce(t,"y")),o=i.rAxisID=V(e.rAxisID,ce(t,"r")),h=i.indexAxis,a=i.iAxisID=s(h,n,r,o),c=i.vAxisID=s(h,r,n,o);i.xScale=this.getScaleForId(n),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(o),i.iScale=this.getScaleForId(a),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Rt(this._data,this),t._stacked&&le(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),e=this._data;if(H(i))this._data=function(t,i){const{iScale:e,vScale:s}=i,n="x"===e.axis?"x":"y",r="x"===s.axis?"x":"y",o=Object.keys(t),h=new Array(o.length);let a,c,l;for(a=0,c=o.length;a<c;++a)l=o[a],h[a]={[n]:l,[r]:t[l]};return h}(i,this._cachedMeta);else if(e!==i){if(e){Rt(e,this);const t=this._cachedMeta;le(t),t._parsed=[]}i&&Object.isExtensible(i)&&((s=i)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),jt.forEach((t=>{const i="_onData"+nt(t),e=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=e.apply(this,t);return s._chartjs.listeners.forEach((e=>{"function"==typeof e[i]&&e[i](...t)})),n}})})))),this._syncList=[],this._data=i}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,e=this.getDataset();let s=!1;this._dataCheck();const n=i._stacked;i._stacked=re(i.vScale,i),i.stack!==e.stack&&(s=!0,le(i),i.stack=e.stack),this._resyncElements(t),(s||n!==i._stacked)&&(ae(this,i._parsed),i._stacked=re(i.vScale,i))}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:e,_data:s}=this,{iScale:n,_stacked:r}=e,o=n.axis;let h,a,c,l=0===t&&i===s.length||e._sorted,u=t>0&&e._parsed[t-1];if(!1===this._parsing)e._parsed=s,e._sorted=!0,c=s;else{c=N(s[t])?this.parseArrayData(e,s,t,i):H(s[t])?this.parseObjectData(e,s,t,i):this.parsePrimitiveData(e,s,t,i);const n=()=>null===a[o]||u&&a[o]<u[o];for(h=0;h<i;++h)e._parsed[h+t]=a=c[h],l&&(n()&&(l=!1),u=a);e._sorted=l}r&&ae(this,c)}parsePrimitiveData(t,i,e,s){const{iScale:n,vScale:r}=t,o=n.axis,h=r.axis,a=n.getLabels(),c=n===r,l=new Array(s);let u,f,d;for(u=0,f=s;u<f;++u)d=u+e,l[u]={[o]:c||n.parse(a[d],d),[h]:r.parse(i[d],d)};return l}parseArrayData(t,i,e,s){const{xScale:n,yScale:r}=t,o=new Array(s);let h,a,c,l;for(h=0,a=s;h<a;++h)c=h+e,l=i[c],o[h]={x:n.parse(l[0],c),y:r.parse(l[1],c)};return o}parseObjectData(t,i,e,s){const{xScale:n,yScale:r}=t,{xAxisKey:o="x",yAxisKey:h="y"}=this._parsing,a=new Array(s);let c,l,u,f;for(c=0,l=s;c<l;++c)u=c+e,f=i[u],a[c]={x:n.parse(st(f,o),u),y:r.parse(st(f,h),u)};return a}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,e){const s=this._cachedMeta,n=i[t.axis];return ne({keys:se(this.chart,!0),values:i._stacks[t.axis]._visualValues},n,s.index,{mode:e})}updateRangeFromParsed(t,i,e,s){const n=e[i.axis];let r=null===n?NaN:n;const o=s&&e._stacks[i.axis];s&&o&&(s.values=o,r=ne(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){const e=this._cachedMeta,s=e._parsed,n=e._sorted&&t===e.iScale,r=s.length,o=this._getOtherScale(t),h=((t,i)=>t&&!i.hidden&&i._stacked&&{keys:se(this.chart,!0),values:null})(i,e),a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:l}=function(t){const{min:i,max:e,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=s[u];const i=f[o.axis];return!$(f[t.axis])||c>i||l<i}for(u=0;u<r&&(d()||(this.updateRangeFromParsed(a,t,f,h),!n));++u);if(n)for(u=r-1;u>=0;--u)if(!d()){this.updateRangeFromParsed(a,t,f,h);break}return a}getAllParsedValues(t){const i=this._cachedMeta._parsed,e=[];let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s][t.axis],$(r)&&e.push(r);return e}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,e=i.iScale,s=i.vScale,n=this.getParsed(t);return{label:e?""+e.getLabelForValue(n[e.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let i,e,s,n;return H(t)?(i=t.top,e=t.right,s=t.bottom,n=t.left):i=e=s=n=t,{top:i,right:e,bottom:s,left:n,disabled:!1===t}}(V(this.options.clip,function(t,i,e){if(!1===e)return!1;const s=ee(t,e),n=ee(i,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this._cachedMeta,e=i.data||[],s=this.chart.chartArea,n=[],r=this._drawStart||0,o=this._drawCount||e.length-r,h=this.options.drawActiveElementsOnTop;let a;for(i.dataset&&i.dataset.draw(t,s,r,o),a=r;a<r+o;++a){const i=e[a];i.hidden||(i.active&&h?n.push(i):i.draw(t,s))}for(a=0;a<n.length;++a)n[a].draw(t,s)}getStyle(t,i){const e=i?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,i,e){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];n=i.$context||(i.$context=function(t,i,e){return yi(t,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:e,index:i,mode:"default",type:"data"})}(this.getContext(),t,i)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,i){return yi(t,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!i,n.mode=e,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",e){const s="active"===i,n=this._cachedDataOpts,r=t+"-"+i,o=n[r],h=this.enableOptionSharing&&rt(e);if(o)return fe(o,h);const a=this.chart.config,c=a.datasetElementScopeKeys(this._type,t),l=s?[`${t}Hover`,"hover",t,""]:[t,""],u=a.getOptionScopes(this.getDataset(),c),f=Object.keys(Gt.elements[t]),d=a.resolveNamedOptions(u,f,(()=>this.getContext(e,s,i)),l);return d.$shared&&(d.$shared=h,n[r]=Object.freeze(fe(d,h))),d}_resolveAnimations(t,i,e){const s=this.chart,n=this._cachedDataOpts,r=`animation-${i}`,o=n[r];if(o)return o;let h;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,i),r=s.getOptionScopes(this.getDataset(),n);h=s.createResolver(r,this.getContext(t,e,i))}const a=new ie(s,h&&h.animations);return h&&h._cacheable&&(n[r]=Object.freeze(a)),a}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||ue(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const e=this.resolveDataElementOptions(t,i),s=this._sharedOptions,n=this.getSharedOptions(e),r=this.includeOptions(i,n)||n!==s;return this.updateSharedOptions(n,i,e),{sharedOptions:n,includeOptions:r}}updateElement(t,i,e,s){ue(s)?Object.assign(t,e):this._resolveAnimations(i,s).update(t,e)}updateSharedOptions(t,i,e){t&&!ue(i)&&this._resolveAnimations(void 0,i).update(t,e)}_setStyle(t,i,e,s){t.active=s;const n=this.getStyle(i,s);this._resolveAnimations(i,e,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,i,e){this._setStyle(t,e,"active",!1)}setHoverStyle(t,i,e){this._setStyle(t,e,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,e=this._cachedMeta.data;for(const[t,i,e]of this._syncList)this[t](i,e);this._syncList=[];const s=e.length,n=i.length,r=Math.min(n,s);r&&this.parse(0,r),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,i,e=!0){const s=this._cachedMeta,n=s.data,r=t+i;let o;const h=t=>{for(t.length+=i,o=t.length-1;o>=r;o--)t[o]=t[o-i]};for(h(n),o=t;o<r;++o)n[o]=new this.dataElementType;this._parsing&&h(s._parsed),this.parse(t,i),e&&this.updateElements(n,t,i,"reset")}updateElements(t,i,e,s){}_removeElements(t,i){const e=this._cachedMeta;if(this._parsing){const s=e._parsed.splice(t,i);e._stacked&&le(e,s)}e.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,e,s]=t;this[i](e,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function be(t,i,e,s){return N(t)?function(t,i,e,s){const n=e.parse(t[0],s),r=e.parse(t[1],s),o=Math.min(n,r),h=Math.max(n,r);let a=o,c=h;Math.abs(o)>Math.abs(h)&&(a=h,c=o),i[e.axis]=c,i._custom={barStart:a,barEnd:c,start:n,end:r,min:o,max:h}}(t,i,e,s):i[e.axis]=e.parse(t,s),i}function ge(t,i,e,s){const n=t.iScale,r=t.vScale,o=n.getLabels(),h=n===r,a=[];let c,l,u,f;for(c=e,l=e+s;c<l;++c)f=i[c],u={},u[n.axis]=h||n.parse(o[c],c),a.push(be(f,u,r,c));return a}function pe(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function me(t,i,e,s){let n=i.borderSkipped;const r={};if(!n)return void(t.borderSkipped=r);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:h,reverse:a,top:c,bottom:l}=function(t){let i,e,s,n,r;return t.horizontal?(i=t.base>t.x,e="left",s="right"):(i=t.base<t.y,e="bottom",s="top"),i?(n="end",r="start"):(n="start",r="end"),{start:e,end:s,reverse:i,top:n,bottom:r}}(t);"middle"===n&&e&&(t.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=l:(r[ve(l,o,h,a)]=!0,n=c)),r[ve(n,o,h,a)]=!0,t.borderSkipped=r}function ve(t,i,e,s){var n,r,o;return s?(o=e,t=xe(t=(n=t)===(r=i)?o:n===o?r:n,e,i)):t=xe(t,i,e),t}function xe(t,i,e){return"start"===t?i:"end"===t?e:t}function ye(t,{inflateAmount:i},e){t.inflateAmount="auto"===i?1===e?.33:0:i}class Me extends de{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data,{labels:{pointStyle:e,textAlign:s,color:n,useBorderRadius:r,borderRadius:o}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map(((i,h)=>{const a=t.getDatasetMeta(0).controller.getStyle(h);return{text:i,fillStyle:a.backgroundColor,fontColor:n,hidden:!t.getDataVisibility(h),lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,textAlign:s,pointStyle:e,borderRadius:r&&(o||a.borderRadius),index:h}})):[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}}};constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){const e=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=e;else{let n,r,o=t=>+e[t];if(H(e[t])){const{key:t="value"}=this._parsing;o=i=>+st(e[i],t)}for(n=t,r=t+i;n<r;++n)s._parsed[n]=o(n)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=ct,i=-ct;for(let e=0;e<this.chart.data.datasets.length;++e)if(this.chart.isDatasetVisible(e)&&this.chart.getDatasetMeta(e).type===this._type){const s=this.chart.getDatasetMeta(e).controller,n=s._getRotation(),r=s._getCircumference();t=Math.min(t,n),i=Math.max(i,n+r)}return{rotation:t,circumference:i-t}}update(t){const i=this.chart,{chartArea:e}=i,s=this._cachedMeta,n=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(e.width,e.height)-r)/2,0),h=Math.min((c=o,"string"==typeof(a=this.options.cutout)&&a.endsWith("%")?parseFloat(a)/100:+a/c),1);var a,c;const l=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:b,offsetX:g,offsetY:p}=function(t,i,e){let s=1,n=1,r=0,o=0;if(i<ct){const h=t,a=h+i,c=Math.cos(h),l=Math.sin(h),u=Math.cos(a),f=Math.sin(a),d=(t,i,s)=>_t(t,h,a,!0)?1:Math.max(i,i*e,s,s*e),b=(t,i,s)=>_t(t,h,a,!0)?-1:Math.min(i,i*e,s,s*e),g=d(0,c,u),p=d(ft,l,f),m=b(at,c,u),v=b(at+ft,l,f);s=(g-m)/2,n=(p-v)/2,r=-(g+m)/2,o=-(p+v)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}(f,u,h),m=Math.max(Math.min((e.width-r)/d,(e.height-r)/b)/2,0),v=X(this.options.radius,m),x=(v-Math.max(v*h,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=p*v,s.total=this.calculateTotal(),this.outerRadius=v-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,i){const e=this.options,s=this._cachedMeta,n=this._getCircumference();return i&&e.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/ct)}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.chartArea,h=(o.left+o.right)/2,a=(o.top+o.bottom)/2,c=n&&r.options.animation.animateScale,l=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(i,s);let b,g=this._getRotation();for(b=0;b<i;++b)g+=this._circumference(b,n);for(b=i;b<i+e;++b){const i=this._circumference(b,n),e=t[b],r={x:h+this.offsetX,y:a+this.offsetY,startAngle:g,endAngle:g+i,circumference:i,outerRadius:u,innerRadius:l};d&&(r.options=f||this.resolveDataElementOptions(b,e.active?"active":s)),g+=i,this.updateElement(e,b,r,s)}}calculateTotal(){const t=this._cachedMeta,i=t.data;let e,s=0;for(e=0;e<i.length;e++){const n=t._parsed[e];null===n||isNaN(n)||!this.chart.getDataVisibility(e)||i[e].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const i=this._cachedMeta.total;return i>0&&!isNaN(t)?ct*(Math.abs(t)/i):0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Vt(this._cachedMeta._parsed[t],i.options.locale);return{label:e[t]||"",value:s}}getMaxBorderWidth(t){let i=0;const e=this.chart;let s,n,r,o,h;if(!t)for(s=0,n=e.data.datasets.length;s<n;++s)if(e.isDatasetVisible(s)){r=e.getDatasetMeta(s),t=r.data,o=r.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)h=o.resolveDataElementOptions(s),"inner"!==h.borderAlign&&(i=Math.max(i,h.borderWidth||0,h.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let e=0,s=t.length;e<s;++e){const t=this.resolveDataElementOptions(e);i=Math.max(i,t.offset||0,t.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let e=0;e<t;++e)this.chart.isDatasetVisible(e)&&(i+=this._getRingWeight(e));return i}_getRingWeight(t){return Math.max(V(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class we extends de{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Vt(this._cachedMeta._parsed[t].r,i.options.locale);return{label:e[t]||"",value:s}}parseObjectData(t,i,e,s){return Pi.bind(this)(t,i,e,s)}update(t){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){const t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach(((i,e)=>{const s=this.getParsed(e).r;!isNaN(s)&&this.chart.getDataVisibility(e)&&(s<t.min&&(t.min=s),s>t.max&&(t.max=s))})),t}_updateRadius(){const t=this.chart,i=t.chartArea,e=t.options,s=Math.min(i.right-i.left,i.bottom-i.top),n=Math.max(s/2,0),r=(n-Math.max(e.cutoutPercentage?n/100*e.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.options.animation,h=this._cachedMeta.rScale,a=h.xCenter,c=h.yCenter,l=h.getIndexAngle(0)-.5*at;let u,f=l;const d=360/this.countVisibleElements();for(u=0;u<i;++u)f+=this._computeAngle(u,s,d);for(u=i;u<i+e;u++){const i=t[u];let e=f,b=f+this._computeAngle(u,s,d),g=r.getDataVisibility(u)?h.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=b,n&&(o.animateScale&&(g=0),o.animateRotate&&(e=b=l));const p={x:a,y:c,innerRadius:0,outerRadius:g,startAngle:e,endAngle:b,options:this.resolveDataElementOptions(u,i.active?"active":s)};this.updateElement(i,u,p,s)}}countVisibleElements(){let t=0;return this._cachedMeta.data.forEach(((i,e)=>{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&t++})),t}_computeAngle(t,i,e){return this.chart.getDataVisibility(t)?yt(this.resolveDataElementOptions(t,i).angle||e):0}}function _e(t,i,e,s){const{controller:n,data:r,_sorted:o}=t,h=n._cachedMeta.iScale,a=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(h&&i===h.axis&&"r"!==i&&o&&r.length){const o=h._reversePixels?Dt:At;if(!s){const s=o(r,i,e);if(a){const{vScale:i}=n._cachedMeta,{_parsed:e}=t,r=e.slice(0,s.lo+1).reverse().findIndex((t=>!z(t[i.axis])));s.lo-=Math.max(0,r);const o=e.slice(s.hi).findIndex((t=>!z(t[i.axis])));s.hi+=Math.max(0,o)}return s}if(n._sharedOptions){const t=r[0],s="function"==typeof t.getRange&&t.getRange(i);if(s){const t=o(r,i,e-s),n=o(r,i,e+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:r.length-1}}function ke(t,i,e,s,n){const r=t.getSortedVisibleDatasetMetas(),o=e[i];for(let t=0,e=r.length;t<e;++t){const{index:e,data:h}=r[t],{lo:a,hi:c}=_e(r[t],i,o,n);for(let t=a;t<=c;++t){const i=h[t];i.skip||s(i,e,t)}}}function Oe(t,i,e,s,n){const r=[];return n||t.isPointInArea(i)?(ke(t,e,i,(function(e,o,h){(n||ni(e,t.chartArea,0))&&e.inRange(i.x,i.y,s)&&r.push({element:e,datasetIndex:o,index:h})}),!0),r):r}function Se(t,i,e,s,n,r){return r||t.isPointInArea(i)?"r"!==e||s?function(t,i,e,s,n,r){let o=[];const h=function(t){const i=-1!==t.indexOf("x"),e=-1!==t.indexOf("y");return function(t,s){const n=i?Math.abs(t.x-s.x):0,r=e?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}}(e);let a=Number.POSITIVE_INFINITY;return ke(t,e,i,(function(e,c,l){const u=e.inRange(i.x,i.y,n);if(s&&!u)return;const f=e.getCenterPoint(n);if(!r&&!t.isPointInArea(f)&&!u)return;const d=h(i,f);d<a?(o=[{element:e,datasetIndex:c,index:l}],a=d):d===a&&o.push({element:e,datasetIndex:c,index:l})})),o}(t,i,e,s,n,r):function(t,i,e,s){let n=[];return ke(t,e,i,(function(t,e,r){const{startAngle:o,endAngle:h}=t.getProps(["startAngle","endAngle"],s),{angle:a}=function(t,i){const e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*at&&(r+=ct),{angle:r,distance:n}}(t,{x:i.x,y:i.y});_t(a,o,h)&&n.push({element:t,datasetIndex:e,index:r})})),n}(t,i,e,n):[]}function Ae(t,i,e,s,n){const r=[],o="x"===e?"inXRange":"inYRange";let h=!1;return ke(t,e,i,((t,s,a)=>{t[o]&&t[o](i[e],n)&&(r.push({element:t,datasetIndex:s,index:a}),h=h||t.inRange(i.x,i.y,n))})),s&&!h?[]:r}var De={modes:{index(t,i,e,s){const n=Ni(i,t),r=e.axis||"x",o=e.includeInvisible||!1,h=e.intersect?Oe(t,n,r,s,o):Se(t,n,r,!1,s,o),a=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const i=h[0].index,e=t.data[i];e&&!e.skip&&a.push({element:e,datasetIndex:t.index,index:i})})),a):[]},dataset(t,i,e,s){const n=Ni(i,t),r=e.axis||"xy",o=e.includeInvisible||!1;let h=e.intersect?Oe(t,n,r,s,o):Se(t,n,r,!1,s,o);if(h.length>0){const i=h[0].datasetIndex,e=t.getDatasetMeta(i).data;h=[];for(let t=0;t<e.length;++t)h.push({element:e[t],datasetIndex:i,index:t})}return h},point:(t,i,e,s)=>Oe(t,Ni(i,t),e.axis||"xy",s,e.includeInvisible||!1),nearest:(t,i,e,s)=>Se(t,Ni(i,t),e.axis||"xy",e.intersect,s,e.includeInvisible||!1),x:(t,i,e,s)=>Ae(t,Ni(i,t),"x",e.intersect,s),y:(t,i,e,s)=>Ae(t,Ni(i,t),"y",e.intersect,s)}};const je=["left","top","right","bottom"];function Re(t,i){return t.filter((t=>t.pos===i))}function Ce(t,i){return t.filter((t=>-1===je.indexOf(t.pos)&&t.box.axis===i))}function Ee(t,i){return t.sort(((t,e)=>{const s=i?e:t,n=i?t:e;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Le(t,i,e,s){return Math.max(t[e],i[e])+Math.max(t[s],i[s])}function Pe(t,i){t.top=Math.max(t.top,i.top),t.left=Math.max(t.left,i.left),t.bottom=Math.max(t.bottom,i.bottom),t.right=Math.max(t.right,i.right)}function Te(t,i,e,s){const{pos:n,box:r}=e,o=t.maxPadding;if(!H(n)){e.size&&(t[n]-=e.size);const i=s[e.stack]||{size:0,count:1};i.size=Math.max(i.size,e.horizontal?r.height:r.width),e.size=i.size/i.count,t[n]+=e.size}r.getPadding&&Pe(o,r.getPadding());const h=Math.max(0,i.outerWidth-Le(o,t,"left","right")),a=Math.max(0,i.outerHeight-Le(o,t,"top","bottom")),c=h!==t.w,l=a!==t.h;return t.w=h,t.h=a,e.horizontal?{same:c,other:l}:{same:l,other:c}}function Ie(t,i){const e=i.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(i[t],e[t])})),s}(t?["left","right"]:["top","bottom"])}function Fe(t,i,e,s){const n=[];let r,o,h,a,c,l;for(r=0,o=t.length,c=0;r<o;++r){h=t[r],a=h.box,a.update(h.width||i.w,h.height||i.h,Ie(h.horizontal,i));const{same:o,other:u}=Te(i,e,h,s);c|=o&&n.length,l=l||u,a.fullSize||n.push(h)}return c&&Fe(n,i,e,s)||l}function Be(t,i,e,s,n){t.top=e,t.left=i,t.right=i+s,t.bottom=e+n,t.width=s,t.height=n}function We(t,i,e,s){const n=e.padding;let{x:r,y:o}=i;for(const h of t){const t=h.box,a=s[h.stack]||{placed:0,weight:1},c=h.stackWeight/a.weight||1;if(h.horizontal){const s=i.w*c,r=a.size||t.height;rt(a.start)&&(o=a.start),t.fullSize?Be(t,n.left,o,e.outerWidth-n.right-n.left,r):Be(t,i.left+a.placed,o,s,r),a.start=o,a.placed+=s,o=t.bottom}else{const s=i.h*c,o=a.size||t.width;rt(a.start)&&(r=a.start),t.fullSize?Be(t,r,n.top,o,e.outerHeight-n.bottom-n.top):Be(t,r,i.top+a.placed,o,s),a.start=r,a.placed+=s,r=t.right}}i.x=r,i.y=o}var ze={addBox(t,i){t.boxes||(t.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t)}}]},t.boxes.push(i)},removeBox(t,i){const e=t.boxes?t.boxes.indexOf(i):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,i,e){i.fullSize=e.fullSize,i.position=e.position,i.weight=e.weight},update(t,i,e,s){if(!t)return;const n=mi(t.options.layout.padding),r=Math.max(i-n.width,0),o=Math.max(e-n.height,0),h=function(t){const i=function(t){const i=[];let e,s,n,r,o,h;for(e=0,s=(t||[]).length;e<s;++e)n=t[e],({position:r,options:{stack:o,stackWeight:h=1}}=n),i.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:h});return i}(t),e=Ee(i.filter((t=>t.box.fullSize)),!0),s=Ee(Re(i,"left"),!0),n=Ee(Re(i,"right")),r=Ee(Re(i,"top"),!0),o=Ee(Re(i,"bottom")),h=Ce(i,"x"),a=Ce(i,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(a).concat(o).concat(h),chartArea:Re(i,"chartArea"),vertical:s.concat(n).concat(a),horizontal:r.concat(o).concat(h)}}(t.boxes),a=h.vertical,c=h.horizontal;Z(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const l=a.reduce(((t,i)=>i.box.options&&!1===i.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:i,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/l,hBoxMaxHeight:o/2}),f=Object.assign({},n);Pe(f,mi(s));const d=Object.assign({maxPadding:f,w:r,h:o,x:n.left,y:n.top},n),b=function(t,i){const e=function(t){const i={};for(const e of t){const{stack:t,pos:s,stackWeight:n}=e;if(!t||!je.includes(s))continue;const r=i[t]||(i[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=n}return i}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i;let r,o,h;for(r=0,o=t.length;r<o;++r){h=t[r];const{fullSize:o}=h.box,a=e[h.stack],c=a&&h.stackWeight/a.weight;h.horizontal?(h.width=c?c*s:o&&i.availableWidth,h.height=n):(h.width=s,h.height=c?c*n:o&&i.availableHeight)}return e}(a.concat(c),u);Fe(h.fullSize,d,u,b),Fe(a,d,u,b),Fe(c,d,u,b)&&Fe(a,d,u,b),function(t){const i=t.maxPadding;function e(e){const s=Math.max(i[e]-t[e],0);return t[e]+=s,s}t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}(d),We(h.leftAndTop,d,u,b),d.x+=d.w,d.y+=d.h,We(h.rightAndBottom,d,u,b),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},Z(h.chartArea,(i=>{const e=i.box;Object.assign(e,t.chartArea),e.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class Ne{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,e){}removeEventListener(t,i,e){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,e,s){return i=Math.max(0,i||t.width),e=e||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):e)}}isAttached(t){return!0}updateConfig(t){}}class He extends Ne{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $e="$chartjs",Ye={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ve=t=>null===t||""===t,Xe=!!Yi&&{passive:!0};function Ue(t,i,e){t&&t.canvas&&t.canvas.removeEventListener(i,e,Xe)}function Ze(t,i){for(const e of t)if(e===i||e.contains(i))return!0}function Ke(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Ze(e.addedNodes,s),i=i&&!Ze(e.removedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Qe(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Ze(e.removedNodes,s),i=i&&!Ze(e.addedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}const qe=new Map;let Ge=0;function Je(){const t=window.devicePixelRatio;t!==Ge&&(Ge=t,qe.forEach(((i,e)=>{e.currentDevicePixelRatio!==t&&i()})))}function ts(t,i,e){const s=t.canvas,n=s&&Ii(s);if(!n)return;const r=Et(((t,i)=>{const s=n.clientWidth;e(t,i),s<n.clientWidth&&e()}),window),o=new ResizeObserver((t=>{const i=t[0],e=i.contentRect.width,s=i.contentRect.height;0===e&&0===s||r(e,s)}));return o.observe(n),function(t,i){qe.size||window.addEventListener("resize",Je),qe.set(t,i)}(t,r),o}function is(t,i,e){e&&e.disconnect(),"resize"===i&&function(t){qe.delete(t),qe.size||window.removeEventListener("resize",Je)}(t)}function es(t,i,e){const s=t.canvas,n=Et((i=>{null!==t.ctx&&e(function(t,i){const e=Ye[t.type]||t.type,{x:s,y:n}=Ni(t,i);return{type:e,chart:i,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(i,t))}),t);return function(t,i,e){t&&t.addEventListener(i,e,Xe)}(s,i,n),n}class ss extends Ne{acquireContext(t,i){const e=t&&t.getContext&&t.getContext("2d");return e&&e.canvas===t?(function(t,i){const e=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[$e]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ve(n)){const i=Vi(t,"width");void 0!==i&&(t.width=i)}if(Ve(s))if(""===t.style.height)t.height=t.width/(i||2);else{const i=Vi(t,"height");void 0!==i&&(t.height=i)}}(t,i),e):null}releaseContext(t){const i=t.canvas;if(!i[$e])return!1;const e=i[$e].initial;["height","width"].forEach((t=>{const s=e[t];z(s)?i.removeAttribute(t):i.setAttribute(t,s)}));const s=e.style||{};return Object.keys(s).forEach((t=>{i.style[t]=s[t]})),i.width=i.width,delete i[$e],!0}addEventListener(t,i,e){this.removeEventListener(t,i),(t.$proxies||(t.$proxies={}))[i]=({attach:Ke,detach:Qe,resize:ts}[i]||es)(t,i,e)}removeEventListener(t,i){const e=t.$proxies||(t.$proxies={}),s=e[i];s&&(({attach:is,detach:is,resize:is}[i]||Ue)(t,i,s),e[i]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,e,s){return function(t,i,e,s){const n=Bi(t),r=zi(n,"margin"),o=Fi(n.maxWidth,t,"clientWidth")||lt,h=Fi(n.maxHeight,t,"clientHeight")||lt,a=function(t,i,e){let s,n;if(void 0===i||void 0===e){const r=t&&Ii(t);if(r){const t=r.getBoundingClientRect(),o=Bi(r),h=zi(o,"border","width"),a=zi(o,"padding");i=t.width-a.width-h.width,e=t.height-a.height-h.height,s=Fi(o.maxWidth,r,"clientWidth"),n=Fi(o.maxHeight,r,"clientHeight")}else i=t.clientWidth,e=t.clientHeight}return{width:i,height:e,maxWidth:s||lt,maxHeight:n||lt}}(t,i,e);let{width:c,height:l}=a;if("content-box"===n.boxSizing){const t=zi(n,"border","width"),i=zi(n,"padding");c-=i.width+t.width,l-=i.height+t.height}return c=Math.max(0,c-r.width),l=Math.max(0,s?c/s:l-r.height),c=Hi(Math.min(c,o,a.maxWidth)),l=Hi(Math.min(l,h,a.maxHeight)),c&&!l&&(l=Hi(c/2)),(void 0!==i||void 0!==e)&&s&&a.height&&l>a.height&&(l=a.height,c=Hi(Math.floor(l*s))),{width:c,height:l}}(t,i,e,s)}isAttached(t){const i=t&&Ii(t);return!(!i||!i.isConnected)}}class ns{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:i,y:e}=this.getProps(["x","y"],t);return{x:i,y:e}}hasValue(){return xt(this.x)&&xt(this.y)}getProps(t,i){const e=this.$animations;if(!i||!e)return this;const s={};return t.forEach((t=>{s[t]=e[t]&&e[t].active()?e[t]._to:this[t]})),s}}function rs(t,i,e,s,n){const r=V(s,0),o=Math.min(V(n,t.length),t.length);let h,a,c,l=0;for(e=Math.ceil(e),n&&(h=n-s,e=h/Math.floor(h/e)),c=r;c<0;)l++,c=Math.round(r+l*e);for(a=Math.max(r,0);a<o;a++)a===c&&(i.push(t[a]),l++,c=Math.round(r+l*e))}const os=(t,i,e)=>"top"===i||"left"===i?t[i]+e:t[i]-e,hs=(t,i)=>Math.min(i||t,t);function as(t,i){const e=[],s=t.length/i,n=t.length;let r=0;for(;r<n;r+=s)e.push(t[Math.floor(r)]);return e}function cs(t,i,e){const s=t.ticks.length,n=Math.min(i,s-1),r=t._startPixel,o=t._endPixel,h=1e-6;let a,c=t.getPixelForTick(n);if(!(e&&(a=1===s?Math.max(c-r,o-c):0===i?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(n-1))/2,c+=n<i?a:-a,c<r-h||c>o+h)))return c}function ls(t){return t.drawTicks?t.tickLength:0}function us(t,i){if(!t.display)return 0;const e=vi(t.font,i),s=mi(t.padding);return(N(t.text)?t.text.length:1)*e.lineHeight+s.height}function fs(t,i,e){let s=Lt(t);return(e&&"right"!==i||!e&&"right"===i)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class ds extends ns{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:e,_suggestedMax:s}=this;return t=Y(t,Number.POSITIVE_INFINITY),i=Y(i,Number.NEGATIVE_INFINITY),e=Y(e,Number.POSITIVE_INFINITY),s=Y(s,Number.NEGATIVE_INFINITY),{min:Y(t,e),max:Y(i,s),minDefined:$(t),maxDefined:$(i)}}getMinMax(t){let i,{min:e,max:s,minDefined:n,maxDefined:r}=this.getUserBounds();if(n&&r)return{min:e,max:s};const o=this.getMatchingVisibleMetas();for(let h=0,a=o.length;h<a;++h)i=o[h].controller.getMinMax(this,t),n||(e=Math.min(e,i.min)),r||(s=Math.max(s,i.max));return e=r&&e>s?s:e,s=n&&e>s?e:s,{min:Y(e,Y(s,e)),max:Y(s,Y(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){U(this.options.beforeUpdate,[this])}update(t,i,e){const{beginAtZero:s,grace:n,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=e=Object.assign({left:0,right:0,top:0,bottom:0},e),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+e.left+e.right:this.height+e.top+e.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,i,e){const{min:s,max:n}=t,r=X(i,(n-s)/2),o=(t,i)=>e&&0===t?0:t+i;return{min:o(s,-Math.abs(r)),max:o(n,r)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=o<this.ticks.length;this._convertTicksToLabels(h?as(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,i){const e=t.options.ticks,s=function(t){const i=t.options.offset,e=t._tickSize();return Math.floor(Math.min(t._length/e+(i?0:1),t._maxLength/e))}(t),n=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?function(t){const i=[];let e,s;for(e=0,s=t.length;e<s;e++)t[e].major&&i.push(e);return i}(i):[],o=r.length,h=r[0],a=r[o-1],c=[];if(o>n)return function(t,i,e,s){let n,r=0,o=e[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(i.push(t[n]),r++,o=e[r*s])}(i,c,r,o/n),c;const l=function(t,i,e){const s=function(t){const i=t.length;let e,s;if(i<2)return!1;for(s=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==s)return!1;return s}(t),n=i.length/e;if(!s)return Math.max(n,1);const r=function(t){const i=[],e=Math.sqrt(t);let s;for(s=1;s<e;s++)t%s==0&&(i.push(s),i.push(t/s));return e===(0|e)&&i.push(e),i.sort(((t,i)=>t-i)).pop(),i}(s);for(let t=0,i=r.length-1;t<i;t++){const i=r[t];if(i>n)return i}return Math.max(n,1)}(r,i,n);if(o>0){let t,e;const s=o>1?Math.round((a-h)/(o-1)):null;for(rs(i,c,l,z(s)?0:h-s,h),t=0,e=o-1;t<e;t++)rs(i,c,l,r[t],r[t+1]);return rs(i,c,l,a,z(s)?i.length:a+s),c}return rs(i,c,l),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,i,e=this.options.reverse;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){U(this.options.afterUpdate,[this])}beforeSetDimensions(){U(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){U(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),U(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){U(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e],n.label=U(i.callback,[n.value,e,t],this)}afterTickToLabelConversion(){U(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){U(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,e=hs(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,n=i.maxRotation;let r,o,h,a=s;if(!this._isVisible()||!i.display||s>=n||e<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),l=c.widest.width,u=c.highest.height,f=kt(this.chart.width-l,0,this.maxWidth);r=t.offset?this.maxWidth/e:f/(e-1),l+6>r&&(r=f/(e-(t.offset?.5:1)),o=this.maxHeight-ls(t.grid)-i.padding-us(t.title,this.chart.options.font),h=Math.sqrt(l*l+u*u),a=Math.min(Math.asin(kt((c.highest.height+6)/r,-1,1)),Math.asin(kt(o/h,-1,1))-Math.asin(kt(u/h,-1,1)))*(180/at),a=Math.max(s,Math.min(n,a))),this.labelRotation=a}afterCalculateLabelRotation(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:e,title:s,grid:n}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=us(s,i.options.font);if(o?(t.width=this.maxWidth,t.height=ls(n)+r):(t.height=this.maxHeight,t.width=ls(n)+r),e.display&&this.ticks.length){const{first:i,last:s,widest:n,highest:r}=this._getLabelSizes(),h=2*e.padding,a=yt(this.labelRotation),c=Math.cos(a),l=Math.sin(a);o?t.height=Math.min(this.maxHeight,t.height+(e.mirror?0:l*n.width+c*r.height)+h):t.width=Math.min(this.maxWidth,t.width+(e.mirror?0:c*n.width+l*r.height)+h),this._calculatePadding(i,s,l,c)}}this._handleMargins(),o?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,e,s){const{ticks:{align:n,padding:r},position:o}=this.options,h=0!==this.labelRotation,a="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let l=0,u=0;h?a?(l=s*t.width,u=e*i.height):(l=e*t.height,u=s*i.width):"start"===n?u=i.width:"end"===n?l=t.width:"inner"!==n&&(l=t.width/2,u=i.width/2),this.paddingLeft=Math.max((l-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-c+r)*this.width/(this.width-c),0)}else{let e=i.height/2,s=t.height/2;"start"===n?(e=0,s=t.height):"end"===n&&(e=i.height,s=0),this.paddingTop=e+r,this.paddingBottom=s+r}}_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(){U(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return"top"===i||"bottom"===i||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let i,e;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),i=0,e=t.length;i<e;i++)z(t[i].label)&&(t.splice(i,1),e--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let e=this.ticks;i<e.length&&(e=as(e,i)),this._labelSizes=t=this._computeLabelSizes(e,e.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,e){const{ctx:s,_longestTextCache:n}=this,r=[],o=[],h=Math.floor(i/hs(i,e));let a,c,l,u,f,d,b,g,p,m,v,x=0,y=0;for(a=0;a<i;a+=h){if(u=t[a].label,f=this._resolveTickFontOptions(a),s.font=d=f.string,b=n[d]=n[d]||{data:{},gc:[]},g=f.lineHeight,p=m=0,z(u)||N(u)){if(N(u))for(c=0,l=u.length;c<l;++c)v=u[c],z(v)||N(v)||(p=Jt(s,b.data,b.gc,p,v),m+=g)}else p=Jt(s,b.data,b.gc,p,u),m=g;r.push(p),o.push(m),x=Math.max(p,x),y=Math.max(m,y)}!function(t,i){Z(t,(t=>{const e=t.gc,s=e.length/2;let n;if(s>i){for(n=0;n<s;++n)delete t.data[e[n]];e.splice(0,s)}}))}(n,i);const M=r.indexOf(x),w=o.indexOf(y),_=t=>({width:r[t]||0,height:o[t]||0});return{first:_(0),last:_(i-1),widest:_(M),highest:_(w),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return kt(this._alignToPixels?ti(this.chart,i,0):i,-32768,32767)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const e=i[t];return e.$context||(e.$context=function(t,i,e){return yi(t,{tick:e,index:i,type:"tick"})}(this.getContext(),t,e))}return this.$context||(this.$context=yi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,i=yt(this.labelRotation),e=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),n=this._getLabelSizes(),r=t.autoSkipPadding||0,o=n?n.widest.width+r:0,h=n?n.highest.height+r:0;return this.isHorizontal()?h*e>o*s?o/e:h/s:h*s<o*e?h/e:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,e=this.chart,s=this.options,{grid:n,position:r,border:o}=s,h=n.offset,a=this.isHorizontal(),c=this.ticks.length+(h?1:0),l=ls(n),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,b=d/2,g=function(t){return ti(e,t,d)};let p,m,v,x,y,M,w,_,k,O,S,A;if("top"===r)p=g(this.bottom),M=this.bottom-l,_=p-b,O=g(t.top)+b,A=t.bottom;else if("bottom"===r)p=g(this.top),O=t.top,A=g(t.bottom)-b,M=p+b,_=this.top+l;else if("left"===r)p=g(this.right),y=this.right-l,w=p-b,k=g(t.left)+b,S=t.right;else if("right"===r)p=g(this.left),k=t.left,S=g(t.right)-b,y=p+b,w=this.left+l;else if("x"===i){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(H(r)){const t=Object.keys(r)[0];p=g(this.chart.scales[t].getPixelForValue(r[t]))}O=t.top,A=t.bottom,M=p+b,_=M+l}else if("y"===i){if("center"===r)p=g((t.left+t.right)/2);else if(H(r)){const t=Object.keys(r)[0];p=g(this.chart.scales[t].getPixelForValue(r[t]))}y=p-b,w=y-l,k=t.left,S=t.right}const D=V(s.ticks.maxTicksLimit,c),j=Math.max(1,Math.ceil(c/D));for(m=0;m<c;m+=j){const t=this.getContext(m),i=n.setContext(t),s=o.setContext(t),r=i.lineWidth,c=i.color,l=s.dash||[],f=s.dashOffset,d=i.tickWidth,b=i.tickColor,g=i.tickBorderDash||[],p=i.tickBorderDashOffset;v=cs(this,m,h),void 0!==v&&(x=ti(e,v,r),a?y=w=k=S=x:M=_=O=A=x,u.push({tx1:y,ty1:M,tx2:w,ty2:_,x1:k,y1:O,x2:S,y2:A,width:r,color:c,borderDash:l,borderDashOffset:f,tickWidth:d,tickColor:b,tickBorderDash:g,tickBorderDashOffset:p}))}return this._ticksLength=c,this._borderValue=p,u}_computeLabelItems(t){const i=this.axis,e=this.options,{position:s,ticks:n}=e,r=this.isHorizontal(),o=this.ticks,{align:h,crossAlign:a,padding:c,mirror:l}=n,u=ls(e.grid),f=u+c,d=l?-c:f,b=-yt(this.labelRotation),g=[];let p,m,v,x,y,M,w,_,k,O,S,A,D="middle";if("top"===s)M=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===s)M=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,y=t.x}else if("x"===i){if("center"===s)M=(t.top+t.bottom)/2+f;else if(H(s)){const t=Object.keys(s)[0];M=this.chart.scales[t].getPixelForValue(s[t])+f}w=this._getXAxisLabelAlignment()}else if("y"===i){if("center"===s)y=(t.left+t.right)/2-f;else if(H(s)){const t=Object.keys(s)[0];y=this.chart.scales[t].getPixelForValue(s[t])}w=this._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===h?D="top":"end"===h&&(D="bottom"));const j=this._getLabelSizes();for(p=0,m=o.length;p<m;++p){v=o[p],x=v.label;const t=n.setContext(this.getContext(p));_=this.getPixelForTick(p)+n.labelOffset,k=this._resolveTickFontOptions(p),O=k.lineHeight,S=N(x)?x.length:1;const i=S/2,e=t.color,h=t.textStrokeColor,c=t.textStrokeWidth;let u,f=w;if(r?(y=_,"inner"===w&&(f=p===m-1?this.options.reverse?"left":"right":0===p?this.options.reverse?"right":"left":"center"),A="top"===s?"near"===a||0!==b?-S*O+O/2:"center"===a?-j.highest.height/2-i*O+O:O/2-j.highest.height:"near"===a||0!==b?O/2:"center"===a?j.highest.height/2-i*O:j.highest.height-S*O,l&&(A*=-1),0===b||t.showLabelBackdrop||(y+=O/2*Math.sin(b))):(M=_,A=(1-S)*O/2),t.showLabelBackdrop){const i=mi(t.backdropPadding),e=j.heights[p],s=j.widths[p];let n=A-i.top,r=0-i.left;switch(D){case"middle":n-=e/2;break;case"bottom":n-=e}switch(w){case"center":r-=s/2;break;case"right":r-=s;break;case"inner":p===m-1?r-=s:p>0&&(r-=s/2)}u={left:r,top:n,width:s+i.width,height:e+i.height,color:t.backdropColor}}g.push({label:x,font:k,textOffset:A,options:{rotation:b,color:e,strokeColor:h,strokeWidth:c,textAlign:f,textBaseline:D,translation:[y,M],backdrop:u}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-yt(this.labelRotation))return"top"===t?"left":"right";let e="center";return"start"===i.align?e="left":"end"===i.align?e="right":"inner"===i.align&&(e="inner"),e}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:e,mirror:s,padding:n}}=this.options,r=t+n,o=this._getLabelSizes().widest.width;let h,a;return"left"===i?s?(a=this.right+n,"near"===e?h="left":"center"===e?(h="center",a+=o/2):(h="right",a+=o)):(a=this.right-r,"near"===e?h="right":"center"===e?(h="center",a-=o/2):(h="left",a=this.left)):"right"===i?s?(a=this.left+n,"near"===e?h="right":"center"===e?(h="center",a-=o/2):(h="left",a-=o)):(a=this.left+r,"near"===e?h="left":"center"===e?(h="center",a+=o/2):(h="right",a=this.right)):h="right",{textAlign:h,x:a}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;return"left"===i||"right"===i?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===i||"bottom"===i?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:e,top:s,width:n,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(e,s,n,r),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const e=this.ticks.findIndex((i=>i.value===t));return e>=0?i.setContext(this.getContext(e)).lineWidth:0}drawGrid(t){const i=this.options.grid,e=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,r;const o=(t,i,s)=>{s.width&&s.color&&(e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),e.stroke(),e.restore())};if(i.display)for(n=0,r=s.length;n<r;++n){const t=s[n];i.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:e,grid:s}}=this,n=e.setContext(this.getContext()),r=e.display?n.width:0;if(!r)return;const o=s.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let a,c,l,u;this.isHorizontal()?(a=ti(t,this.left,r)-r/2,c=ti(t,this.right,o)+o/2,l=u=h):(l=ti(t,this.top,r)-r/2,u=ti(t,this.bottom,o)+o/2,a=c=h),i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.beginPath(),i.moveTo(a,l),i.lineTo(c,u),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,e=this._computeLabelArea();e&&ri(i,e);const s=this.getLabelItems(t);for(const t of s)ci(i,t.label,0,t.textOffset,t.font,t.options);e&&oi(i)}drawTitle(){const{ctx:t,options:{position:i,title:e,reverse:s}}=this;if(!e.display)return;const n=vi(e.font),r=mi(e.padding),o=e.align;let h=n.lineHeight/2;"bottom"===i||"center"===i||H(i)?(h+=r.bottom,N(e.text)&&(h+=n.lineHeight*(e.text.length-1))):h+=r.top;const{titleX:a,titleY:c,maxWidth:l,rotation:u}=function(t,i,e,s){const{top:n,left:r,bottom:o,right:h,chart:a}=t,{chartArea:c,scales:l}=a;let u,f,d,b=0;const g=o-n,p=h-r;if(t.isHorizontal()){if(f=Pt(s,r,h),H(e)){const t=Object.keys(e)[0];d=l[t].getPixelForValue(e[t])+g-i}else d="center"===e?(c.bottom+c.top)/2+g-i:os(t,e,i);u=h-r}else{if(H(e)){const t=Object.keys(e)[0];f=l[t].getPixelForValue(e[t])-p+i}else f="center"===e?(c.left+c.right)/2-p+i:os(t,e,i);d=Pt(s,o,n),b="left"===e?-ft:ft}return{titleX:f,titleY:d,maxWidth:u,rotation:b}}(this,h,i,o);ci(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:u,textAlign:fs(o,i,s),textBaseline:"middle",translation:[a,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,e=V(t.grid&&t.grid.z,-1),s=V(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ds.prototype.draw?[{z:e,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),e=this.axis+"AxisID",s=[];let n,r;for(n=0,r=i.length;n<r;++n){const r=i[n];r[e]!==this.id||t&&r.type!==t||s.push(r)}return s}_resolveTickFontOptions(t){return vi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bs{constructor(t,i,e){this.type=t,this.scope=i,this.override=e,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let e;(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));const s=this.items,n=t.id,r=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,i,e){const s=J(Object.create(null),[e?Gt.get(e):{},Gt.get(i),t.defaults]);Gt.set(i,s),t.defaultRoutes&&function(t,i){Object.keys(i).forEach((e=>{const s=e.split("."),n=s.pop(),r=[t].concat(s).join("."),o=i[e].split("."),h=o.pop(),a=o.join(".");Gt.route(r,n,a,h)}))}(i,t.defaultRoutes),t.descriptors&&Gt.describe(i,t.descriptors)}(t,r,e),this.override&&Gt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const i=this.items,e=t.id,s=this.scope;e in i&&delete i[e],s&&e in Gt[s]&&(delete Gt[s][e],this.override&&delete Ut[e])}}class gs{constructor(){this.controllers=new bs(de,"datasets",!0),this.elements=new bs(ns,"elements"),this.plugins=new bs(Object,"plugins"),this.scales=new bs(ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,e){[...i].forEach((i=>{const s=e||this._getRegistryForType(i);e||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Z(i,(i=>{const s=e||this._getRegistryForType(i);this._exec(t,s,i)}))}))}_exec(t,i,e){const s=nt(t);U(e["before"+s],[],e),i[t](e),U(e["after"+s],[],e)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const e=this._typedRegistries[i];if(e.isForType(t))return e}return this.plugins}_get(t,i,e){const s=i.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+e+".");return s}}var ps=new gs;class ms{constructor(){this._init=void 0}notify(t,i,e,s){if("beforeInit"===i&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const n=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(n,t,i,e);return"afterDestroy"===i&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,i,e,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===U(t[e],[i,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const e=t&&t.config,s=V(e.options&&e.options.plugins,{}),n=function(t){const i={},e=[],s=Object.keys(ps.plugins.items);for(let t=0;t<s.length;t++)e.push(ps.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===e.indexOf(s)&&(e.push(s),i[s.id]=!0)}return{plugins:e,localIds:i}}(e);return!1!==s||i?function(t,{plugins:i,localIds:e},s,n){const r=[],o=t.getContext();for(const h of i){const i=h.id,a=vs(s[i],n);null!==a&&r.push({plugin:h,options:xs(t.config,{plugin:h,local:e[i]},a,o)})}return r}(t,n,s,i):[]}_notifyStateChanges(t){const i=this._oldCache||[],e=this._cache,s=(t,i)=>t.filter((t=>!i.some((i=>t.plugin.id===i.plugin.id))));this._notify(s(i,e),t,"stop"),this._notify(s(e,i),t,"start")}}function vs(t,i){return i||!1!==t?!0===t?{}:t:null}function xs(t,{plugin:i,local:e},s,n){const r=t.pluginScopeKeys(i),o=t.getOptionScopes(s,r);return e&&i.defaults&&o.push(i.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ys(t,i){return((i.datasets||{})[t]||{}).indexAxis||i.indexAxis||(Gt.datasets[t]||{}).indexAxis||"x"}function Ms(t){if("x"===t||"y"===t||"r"===t)return t}function ws(t,...i){if(Ms(t))return t;for(const s of i){const i=s.axis||("top"===(e=s.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.length>1&&Ms(t[0].toLowerCase());if(i)return i}var e;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function _s(t,i,e){if(e[i+"AxisID"]===t)return{axis:i}}function ks(t){const i=t.options||(t.options={});i.plugins=V(i.plugins,{}),i.scales=function(t,i){const e=Ut[t.type]||{scales:{}},s=i.scales||{},n=ys(t.type,i),r=Object.create(null);return Object.keys(s).forEach((i=>{const o=s[i];if(!H(o))return console.error(`Invalid scale configuration for scale: ${i}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const h=ws(i,o,function(t,i){if(i.data&&i.data.datasets){const e=i.data.datasets.filter((i=>i.xAxisID===t||i.yAxisID===t));if(e.length)return _s(t,"x",e[0])||_s(t,"y",e[0])}return{}}(i,t),Gt.scales[o.type]),a=function(t,i){return t===i?"_index_":"_value_"}(h,n),c=e.scales||{};r[i]=tt(Object.create(null),[{axis:h},o,c[h],c[a]])})),t.data.datasets.forEach((e=>{const n=e.type||t.type,o=e.indexAxis||ys(n,i),h=(Ut[n]||{}).scales||{};Object.keys(h).forEach((t=>{const i=function(t,i){let e=t;return"_index_"===t?e=i:"_value_"===t&&(e="x"===i?"y":"x"),e}(t,o),n=e[i+"AxisID"]||i;r[n]=r[n]||Object.create(null),tt(r[n],[{axis:i},s[n],h[t]])}))})),Object.keys(r).forEach((t=>{const i=r[t];tt(i,[Gt.scales[i.type],Gt.scale])})),r}(t,i)}function Os(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ss=new Map,As=new Set;function Ds(t,i){let e=Ss.get(t);return e||(e=i(),Ss.set(t,e),As.add(e)),e}const js=(t,i,e)=>{const s=st(i,e);void 0!==s&&t.add(s)};class Rs{constructor(t){this._config=function(t){return(t=t||{}).data=Os(t.data),ks(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Os(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ks(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ds(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,i){return Ds(`${t}.transition.${i}`,(()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,i){return Ds(`${t}-${i}`,(()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]]))}pluginScopeKeys(t){const i=t.id;return Ds(`${this.type}-plugin-${i}`,(()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,i){const e=this._scopeCache;let s=e.get(t);return s&&!i||(s=new Map,e.set(t,s)),s}getOptionScopes(t,i,e){const{options:s,type:n}=this,r=this._cachedScopes(t,e),o=r.get(i);if(o)return o;const h=new Set;i.forEach((i=>{t&&(h.add(t),i.forEach((i=>js(h,t,i)))),i.forEach((t=>js(h,s,t))),i.forEach((t=>js(h,Ut[n]||{},t))),i.forEach((t=>js(h,Gt,t))),i.forEach((t=>js(h,Zt,t)))}));const a=Array.from(h);return 0===a.length&&a.push(Object.create(null)),As.has(i)&&r.set(i,a),a}chartOptionScopes(){const{options:t,type:i}=this;return[t,Ut[i]||{},Gt.datasets[i]||{},{type:i},Gt,Zt]}resolveNamedOptions(t,i,e,s=[""]){const n={$shared:!0},{resolver:r,subPrefixes:o}=Cs(this._resolverCache,t,s);let h=r;(function(t,i){const{isScriptable:e,isIndexable:s}=_i(t);for(const n of i){const i=e(n),r=s(n),o=(r||i)&&t[n];if(i&&(ot(o)||Es(o))||r&&N(o))return!0}return!1})(r,i)&&(n.$shared=!1,h=wi(r,e=ot(e)?e():e,this.createResolver(t,e,o)));for(const t of i)n[t]=h[t];return n}createResolver(t,i,e=[""],s){const{resolver:n}=Cs(this._resolverCache,t,e);return H(i)?wi(n,i,void 0,s):n}}function Cs(t,i,e){let s=t.get(i);s||(s=new Map,t.set(i,s));const n=e.join();let r=s.get(n);return r||(r={resolver:Mi(i,e),subPrefixes:e.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,r)),r}const Es=t=>H(t)&&Object.getOwnPropertyNames(t).some((i=>ot(t[i]))),Ls=["top","bottom","left","right","chartArea"];function Ps(t,i){return"top"===t||"bottom"===t||-1===Ls.indexOf(t)&&"x"===i}function Ts(t,i){return function(e,s){return e[t]===s[t]?e[i]-s[i]:e[t]-s[t]}}function Is(t){const i=t.chart,e=i.options.animation;i.notifyPlugins("afterRender"),U(e&&e.onComplete,[t],i)}function Fs(t){const i=t.chart,e=i.options.animation;U(e&&e.onProgress,[t],i)}function Bs(t){return Ti()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ws={},zs=t=>{const i=Bs(t);return Object.values(Ws).filter((t=>t.canvas===i)).pop()};function Ns(t,i,e){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=i){const r=t[n];delete t[n],(e>0||s>i)&&(t[s+e]=r)}}}class Hs{static defaults=Gt;static instances=Ws;static overrides=Ut;static registry=ps;static version="4.5.1";static getChart=zs;static register(...t){ps.add(...t),$s()}static unregister(...t){ps.remove(...t),$s()}constructor(t,i){const e=this.config=new Rs(i),s=Bs(t),n=zs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const r=e.createResolver(e.chartOptionScopes(),this.getContext());this.platform=new(e.platform||function(t){return!Ti()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?He:ss}(s)),this.platform.updateConfig(e);const o=this.platform.acquireContext(s,r.aspectRatio),h=o&&o.canvas,a=h&&h.height,c=h&&h.width;this.id=W(),this.ctx=o,this.canvas=h,this.width=c,this.height=a,this._options=r,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 ms,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,i){let e;return function(...s){return i?(clearTimeout(e),e=setTimeout(t,i,s)):t.apply(this,s),i}}((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],Ws[this.id]=this,o&&h?(qi.listen(this,"complete",Is),qi.listen(this,"progress",Fs),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:e,height:s,_aspectRatio:n}=this;return z(t)?i&&n?n:s?e/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ps}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():$i(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ii(this.canvas,this.ctx),this}stop(){return qi.stop(this),this}resize(t,i){qi.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const e=this.options,s=this.platform.getMaximumSize(this.canvas,t,i,e.maintainAspectRatio&&this.aspectRatio),n=e.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,$i(this,n,!0)&&(this.notifyPlugins("resize",{size:s}),U(e.onResize,[this,s],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){Z(this.options.scales||{},((t,i)=>{t.id=i}))}buildOrUpdateScales(){const t=this.options,i=t.scales,e=this.scales,s=Object.keys(e).reduce(((t,i)=>(t[i]=!1,t)),{});let n=[];i&&(n=n.concat(Object.keys(i).map((t=>{const e=i[t],s=ws(t,e),n="r"===s,r="x"===s;return{options:e,dposition:n?"chartArea":r?"bottom":"left",dtype:n?"radialLinear":r?"category":"linear"}})))),Z(n,(i=>{const n=i.options,r=n.id,o=ws(r,n),h=V(n.type,i.dtype);void 0!==n.position&&Ps(n.position,o)===Ps(i.dposition)||(n.position=i.dposition),s[r]=!0;let a=null;r in e&&e[r].type===h?a=e[r]:(a=new(ps.getScale(h))({id:r,type:h,ctx:this.ctx,chart:this}),e[a.id]=a),a.init(n,t)})),Z(s,((t,i)=>{t||delete e[i]})),Z(e,(t=>{ze.configure(this,t,t.options),ze.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,e=t.length;if(t.sort(((t,i)=>t.index-i.index)),e>i){for(let t=i;t<e;++t)this._destroyDatasetMeta(t);t.splice(i,e-i)}this._sortedMetasets=t.slice(0).sort(Ts("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach(((t,e)=>{0===i.filter((i=>i===t._dataset)).length&&this._destroyDatasetMeta(e)}))}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let e,s;for(this._removeUnreferencedMetasets(),e=0,s=i.length;e<s;e++){const s=i[e];let n=this.getDatasetMeta(e);const r=s.type||this.config.type;if(n.type&&n.type!==r&&(this._destroyDatasetMeta(e),n=this.getDatasetMeta(e)),n.type=r,n.indexAxis=s.indexAxis||ys(r,this.options),n.order=s.order||0,n.index=e,n.label=""+s.label,n.visible=this.isDatasetVisible(e),n.controller)n.controller.updateIndex(e),n.controller.linkScales();else{const i=ps.getController(r),{datasetElementType:s,dataElementType:o}=Gt.datasets[r];Object.assign(i,{dataElementType:ps.getElement(o),datasetElementType:s&&ps.getElement(s)}),n.controller=new i(this,e),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){Z(this.data.datasets,((t,i)=>{this.getDatasetMeta(i).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const e=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!e.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,i=this.data.datasets.length;t<i;t++){const{controller:i}=this.getDatasetMeta(t),e=!s&&-1===n.indexOf(i);i.buildOrUpdateElements(e),r=Math.max(+i.getMaxOverflow(),r)}r=this._minPadding=e.layout.autoPadding?r:0,this._updateLayout(r),s||Z(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ts("z","_idx"));const{_active:o,_lastEvent:h}=this;h?this._eventHandler(h,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Z(this.scales,(t=>{ze.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),e=new Set(t.events);ht(i,e)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:e,start:s,count:n}of i)Ns(t,s,"_removeElements"===e?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,e=i=>new Set(t.filter((t=>t[0]===i)).map(((t,i)=>i+","+t.splice(1).join(",")))),s=e(0);for(let t=1;t<i;t++)if(!ht(s,e(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ze.update(this,this.width,this.height,t);const i=this.chartArea,e=i.width<=0||i.height<=0;this._layers=[],Z(this.boxes,(t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,i)=>{t._idx=i})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let i=0,e=this.data.datasets.length;i<e;++i)this._updateDataset(i,ot(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const e=this.getDatasetMeta(t),s={meta:e,index:t,mode:i,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(e.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(qi.has(this)?this.attached&&!qi.running(this)&&qi.start(this):(this.draw(),Is({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,i)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,e=[];let s,n;for(s=0,n=i.length;s<n;++s){const n=i[s];t&&!n.visible||e.push(n)}return e}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,e={meta:t,index:t.index,cancelable:!0},s=function(t,i){const e=i._clip;if(e.disabled)return!1;const s=function(t,i){const{xScale:e,yScale:s}=t;return e&&s?{left:Ki(e,i,"left"),right:Ki(e,i,"right"),top:Ki(s,i,"top"),bottom:Ki(s,i,"bottom")}:i}(i,t.chartArea);return{left:!1===e.left?0:s.left-(!0===e.left?0:e.left),right:!1===e.right?t.width:s.right+(!0===e.right?0:e.right),top:!1===e.top?0:s.top-(!0===e.top?0:e.top),bottom:!1===e.bottom?t.height:s.bottom+(!0===e.bottom?0:e.bottom)}}(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",e)&&(s&&ri(i,s),t.controller.draw(),s&&oi(i),e.cancelable=!1,this.notifyPlugins("afterDatasetDraw",e))}isPointInArea(t){return ni(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,e,s){const n=De.modes[i];return"function"==typeof n?n(this,t,e,s):[]}getDatasetMeta(t){const i=this.data.datasets[t],e=this._metasets;let s=e.filter((t=>t&&t._dataset===i)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},e.push(s)),s}getContext(){return this.$context||(this.$context=yi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!i.hidden}setDatasetVisibility(t,i){this.getDatasetMeta(t).hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,e){const s=e?"show":"hide",n=this.getDatasetMeta(t),r=n.controller._resolveAnimations(void 0,s);rt(i)?(n.data[i].hidden=!e,this.update()):(this.setDatasetVisibility(t,e),r.update(n,{visible:e}),this.update((i=>i.datasetIndex===t?s:void 0)))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),qi.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ii(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete Ws[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(t,i,e)=>{t.offsetX=i,t.offsetY=e,this._eventHandler(t)};Z(this.options.events,(t=>e(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(e,s)=>{t[e]&&(i.removeEventListener(this,e,s),delete t[e])},n=(t,i)=>{this.canvas&&this.resize(t,i)};let r;const o=()=>{s("attach",o),this.attached=!0,this.resize(),e("resize",n),e("detach",r)};r=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),e("attach",o)},i.isAttached(this.canvas)?o():r()}unbindEvents(){Z(this._listeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._listeners={},Z(this._responsiveListeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,i,e){const s=e?"set":"remove";let n,r,o,h;for("dataset"===i&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,h=t.length;o<h;++o){r=t[o];const i=r&&this.getDatasetMeta(r.datasetIndex).controller;i&&i[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],e=t.map((({datasetIndex:t,index:i})=>{const e=this.getDatasetMeta(t);if(!e)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:e.data[i],index:i}}));!K(e,i)&&(this._active=e,this._lastEvent=null,this._updateHoverStyles(e,i))}notifyPlugins(t,i,e){return this._plugins.notify(this,t,i,e)}isPluginEnabled(t){return 1===this._plugins._cache.filter((i=>i.plugin.id===t)).length}_updateHoverStyles(t,i,e){const s=this.options.hover,n=(t,i)=>t.filter((t=>!i.some((i=>t.datasetIndex===i.datasetIndex&&t.index===i.index)))),r=n(i,t),o=e?t:n(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,i){const e={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",e,s))return;const n=this._handleEvent(t,i,e.inChartArea);return e.cancelable=!1,this.notifyPlugins("afterEvent",e,s),(n||e.changed)&&this.render(),this}_handleEvent(t,i,e){const{_active:s=[],options:n}=this,r=this._getActiveElements(t,s,e,i),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,i,e,s){return e&&"mouseout"!==t.type?s?i:t:null}(t,this._lastEvent,e,o);e&&(this._lastEvent=null,U(n.onHover,[t,r,this],this),o&&U(n.onClick,[t,r,this],this));const a=!K(r,s);return(a||i)&&(this._active=r,this._updateHoverStyles(r,s,i)),this._lastEvent=h,a}_getActiveElements(t,i,e,s){if("mouseout"===t.type)return[];if(!e)return i;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function $s(){return Z(Hs.instances,(t=>t._plugins.invalidate()))}function Ys(t,i){const{x:e,y:s,base:n,width:r,height:o}=t.getProps(["x","y","base","width","height"],i);let h,a,c,l,u;return t.horizontal?(u=o/2,h=Math.min(e,n),a=Math.max(e,n),c=s-u,l=s+u):(u=r/2,h=e-u,a=e+u,c=Math.min(s,n),l=Math.max(s,n)),{left:h,top:c,right:a,bottom:l}}function Vs(t,i,e,s){return t?0:kt(i,e,s)}function Xs(t,i,e,s){const n=null===i,r=null===e,o=t&&!(n&&r)&&Ys(t,s);return o&&(n||Ot(i,o.left,o.right))&&(r||Ot(e,o.top,o.bottom))}function Us(t,i){t.rect(i.x,i.y,i.w,i.h)}function Zs(t,i,e={}){const s=t.x!==e.x?-i:0,n=t.y!==e.y?-i:0;return{x:t.x+s,y:t.y+n,w:t.w+((t.x+t.w!==e.x+e.w?i:0)-s),h:t.h+((t.y+t.h!==e.y+e.h?i:0)-n),radius:t.radius}}const Ks=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Qs=Ks.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function qs(t){return Ks[t%Ks.length]}function Gs(t){return Qs[t%Qs.length]}function Js(t){let i;for(i in t)if(t[i].borderColor||t[i].backgroundColor)return!0;return!1}var tn={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,i,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:r}=n,o=Js(s)||(h=n)&&(h.borderColor||h.backgroundColor)||r&&Js(r)||"rgba(0,0,0,0.1)"!==Gt.borderColor||"rgba(0,0,0,0.1)"!==Gt.backgroundColor;var h;if(!e.forceOverride&&o)return;const a=function(t){let i=0;return(e,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Me?i=function(t,i){return t.backgroundColor=t.data.map((()=>qs(i++))),i}(e,i):n instanceof we?i=function(t,i){return t.backgroundColor=t.data.map((()=>Gs(i++))),i}(e,i):n&&(i=function(t,i){return t.borderColor=qs(i),t.backgroundColor=Gs(i),++i}(e,i))}}(t);s.forEach(a)}};const en=(t,i)=>{let{boxHeight:e=i,boxWidth:s=i}=t;return t.usePointStyle&&(e=Math.min(e,i),s=t.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(i,e)}};class sn extends ns{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,i,e){this.maxWidth=t,this.maxHeight=i,this._margins=e,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 t=this.options.labels||{};let i=U(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter((i=>t.filter(i,this.chart.data)))),t.sort&&(i=i.sort(((i,e)=>t.sort(i,e,this.chart.data)))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display)return void(this.width=this.height=0);const e=t.labels,s=vi(e.font),n=s.size,r=this._computeTitleHeight(),{boxWidth:o,itemHeight:h}=en(e,n);let a,c;i.font=s.string,this.isHorizontal()?(a=this.maxWidth,c=this._fitRows(r,n,o,h)+10):(c=this.maxHeight,a=this._fitCols(r,s,o,h)+10),this.width=Math.min(a,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,i,e,s){const{ctx:n,maxWidth:r,options:{labels:{padding:o}}}=this,h=this.legendHitBoxes=[],a=this.lineWidths=[0],c=s+o;let l=t;n.textAlign="left",n.textBaseline="middle";let u=-1,f=-c;return this.legendItems.forEach(((t,d)=>{const b=e+i/2+n.measureText(t.text).width;(0===d||a[a.length-1]+b+2*o>r)&&(l+=c,a[a.length-(d>0?0:1)]=0,f+=c,u++),h[d]={left:0,top:f,row:u,width:b,height:s},a[a.length-1]+=b+o})),l}_fitCols(t,i,e,s){const{ctx:n,maxHeight:r,options:{labels:{padding:o}}}=this,h=this.legendHitBoxes=[],a=this.columnSizes=[],c=r-t;let l=o,u=0,f=0,d=0,b=0;return this.legendItems.forEach(((t,r)=>{const{itemWidth:g,itemHeight:p}=function(t,i,e,s,n){const r=function(t,i,e,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,i)=>t.length>i.length?t:i))),i+e.size/2+s.measureText(n).width}(s,t,i,e),o=function(t,i,e){let s=t;return"string"!=typeof i.text&&(s=nn(i,e)),s}(n,s,i.lineHeight);return{itemWidth:r,itemHeight:o}}(e,i,n,t,s);r>0&&f+p+2*o>c&&(l+=u+o,a.push({width:u,height:f}),d+=u+o,b++,u=f=0),h[r]={left:d,top:f,col:b,width:g,height:p},u=Math.max(u,g),f+=p+o})),l+=u,a.push({width:u,height:f}),l}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:e,labels:{padding:s},rtl:n}}=this,r=Xi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=Pt(e,this.left+s,this.right-this.lineWidths[n]);for(const h of i)n!==h.row&&(n=h.row,o=Pt(e,this.left+s,this.right-this.lineWidths[n])),h.top+=this.top+t+s,h.left=r.leftForLtr(r.x(o),h.width),o+=h.width+s}else{let n=0,o=Pt(e,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const h of i)h.col!==n&&(n=h.col,o=Pt(e,this.top+t+s,this.bottom-this.columnSizes[n].height)),h.top=o,h.left+=this.left+s,h.left=r.leftForLtr(r.x(h.left),h.width),o+=h.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;ri(t,this),this._draw(),oi(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:e,ctx:s}=this,{align:n,labels:r}=t,o=Gt.color,h=Xi(t.rtl,this.left,this.width),a=vi(r.font),{padding:c}=r,l=a.size,u=l/2;let f;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=a.string;const{boxWidth:d,boxHeight:b,itemHeight:g}=en(r,l),p=this.isHorizontal(),m=this._computeTitleHeight();f=p?{x:Pt(n,this.left+c,this.right-e[0]),y:this.top+c+m,line:0}:{x:this.left+c,y:Pt(n,this.top+m+c,this.bottom-i[0].height),line:0},Ui(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach(((x,y)=>{s.strokeStyle=x.fontColor,s.fillStyle=x.fontColor;const M=s.measureText(x.text).width,w=h.textAlign(x.textAlign||(x.textAlign=r.textAlign)),_=d+u+M;let k=f.x,O=f.y;h.setWidth(this.width),p?y>0&&k+_+c>this.right&&(O=f.y+=v,f.line++,k=f.x=Pt(n,this.left+c,this.right-e[f.line])):y>0&&O+v>this.bottom&&(k=f.x=k+i[f.line].width+c,f.line++,O=f.y=Pt(n,this.top+m+c,this.bottom-i[f.line].height)),function(t,i,e){if(isNaN(d)||d<=0||isNaN(b)||b<0)return;s.save();const n=V(e.lineWidth,1);if(s.fillStyle=V(e.fillStyle,o),s.lineCap=V(e.lineCap,"butt"),s.lineDashOffset=V(e.lineDashOffset,0),s.lineJoin=V(e.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=V(e.strokeStyle,o),s.setLineDash(V(e.lineDash,[])),r.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:e.pointStyle,rotation:e.rotation,borderWidth:n},a=h.xPlus(t,d/2);si(s,o,a,i+u,r.pointStyleWidth&&d)}else{const r=i+Math.max((l-b)/2,0),o=h.leftForLtr(t,d),a=pi(e.borderRadius);s.beginPath(),Object.values(a).some((t=>0!==t))?li(s,{x:o,y:r,w:d,h:b,radius:a}):s.rect(o,r,d,b),s.fill(),0!==n&&s.stroke()}s.restore()}(h.x(k),O,x),k=((t,i,e,s)=>t===(s?"left":"right")?e:"center"===t?(i+e)/2:i)(w,k+d+u,p?k+_:this.right,t.rtl),function(t,i,e){ci(s,e.text,t,i+g/2,a,{strikethrough:e.hidden,textAlign:h.textAlign(e.textAlign)})}(h.x(k),O,x),p?f.x+=_+c:f.y+="string"!=typeof x.text?nn(x,a.lineHeight)+c:v})),Zi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,e=vi(i.font),s=mi(i.padding);if(!i.display)return;const n=Xi(t.rtl,this.left,this.width),r=this.ctx,o=i.position,h=s.top+e.size/2;let a,c=this.left,l=this.width;if(this.isHorizontal())l=Math.max(...this.lineWidths),a=this.top+h,c=Pt(t.align,c,this.right-l);else{const i=this.columnSizes.reduce(((t,i)=>Math.max(t,i.height)),0);a=h+Pt(t.align,this.top,this.bottom-i-t.labels.padding-this._computeTitleHeight())}const u=Pt(o,c,c+l);r.textAlign=n.textAlign(Lt(o)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=e.string,ci(r,i.text,u,a,e)}_computeTitleHeight(){const t=this.options.title,i=vi(t.font),e=mi(t.padding);return t.display?i.lineHeight+e.height:0}_getLegendItemAt(t,i){let e,s,n;if(Ot(t,this.left,this.right)&&Ot(i,this.top,this.bottom))for(n=this.legendHitBoxes,e=0;e<n.length;++e)if(s=n[e],Ot(t,s.left,s.left+s.width)&&Ot(i,s.top,s.top+s.height))return this.legendItems[e];return null}handleEvent(t){const i=this.options;if(!function(t,i){return!("mousemove"!==t&&"mouseout"!==t||!i.onHover&&!i.onLeave)||!(!i.onClick||"click"!==t&&"mouseup"!==t)}(t.type,i))return;const e=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,o=(n=e,null!==(s=r)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);r&&!o&&U(i.onLeave,[t,r,this],this),this._hoveredItem=e,e&&!o&&U(i.onHover,[t,e,this],this)}else e&&U(i.onClick,[t,e,this],this);var s,n}}function nn(t,i){return i*(t.text?t.text.length:0)}var rn={id:"legend",_element:sn,start(t,i,e){const s=t.legend=new sn({ctx:t.ctx,options:e,chart:t});ze.configure(t,s,e),ze.addBox(t,s)},stop(t){ze.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,i,e){const s=t.legend;ze.configure(t,s,e),s.options=e},afterUpdate(t){const i=t.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(t,i){i.replay||t.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,i,e){const s=i.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const i=t.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r,useBorderRadius:o,borderRadius:h}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(e?0:void 0),c=mi(a.borderWidth);return{text:i[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:o&&(h||a.borderRadius),datasetIndex:t.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 on extends ns{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,i){const e=this.options;if(this.left=0,this.top=0,!e.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=i;const s=N(e.text)?e.text.length:1;this._padding=mi(e.padding);const n=s*vi(e.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:i,left:e,bottom:s,right:n,options:r}=this,o=r.align;let h,a,c,l=0;return this.isHorizontal()?(a=Pt(o,e,n),c=i+t,h=n-e):("left"===r.position?(a=e+t,c=Pt(o,s,i),l=-.5*at):(a=n-t,c=Pt(o,i,s),l=.5*at),h=s-i),{titleX:a,titleY:c,maxWidth:h,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const e=vi(i.font),s=e.lineHeight/2+this._padding.top,{titleX:n,titleY:r,maxWidth:o,rotation:h}=this._drawArgs(s);ci(t,i.text,0,0,e,{color:i.color,maxWidth:o,rotation:h,textAlign:Lt(i.align),textBaseline:"middle",translation:[n,r]})}}var hn={id:"title",_element:on,start(t,i,e){!function(t,i){const e=new on({ctx:t.ctx,options:i,chart:t});ze.configure(t,e,i),ze.addBox(t,e),t.titleBlock=e}(t,e)},stop(t){ze.removeBox(t,t.titleBlock),delete t.titleBlock},beforeUpdate(t,i,e){const s=t.titleBlock;ze.configure(t,s,e),s.options=e},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 an={average(t){if(!t.length)return!1;let i,e,s=new Set,n=0,r=0;for(i=0,e=t.length;i<e;++i){const e=t[i].element;if(e&&e.hasValue()){const t=e.tooltipPosition();s.add(t.x),n+=t.y,++r}}return 0!==r&&0!==s.size&&{x:[...s].reduce(((t,i)=>t+i))/s.size,y:n/r}},nearest(t,i){if(!t.length)return!1;let e,s,n,r=i.x,o=i.y,h=Number.POSITIVE_INFINITY;for(e=0,s=t.length;e<s;++e){const s=t[e].element;if(s&&s.hasValue()){const t=(a=i,c=s.getCenterPoint(),Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2)));t<h&&(h=t,n=s)}}var a,c;if(n){const t=n.tooltipPosition();r=t.x,o=t.y}return{x:r,y:o}}};function cn(t,i){return i&&(N(i)?Array.prototype.push.apply(t,i):t.push(i)),t}function ln(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function un(t,i){const{element:e,datasetIndex:s,index:n}=i,r=t.getDatasetMeta(s).controller,{label:o,value:h}=r.getLabelAndValue(n);return{chart:t,label:o,parsed:r.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:h,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function fn(t,i){const e=t.chart.ctx,{body:s,footer:n,title:r}=t,{boxWidth:o,boxHeight:h}=i,a=vi(i.bodyFont),c=vi(i.titleFont),l=vi(i.footerFont),u=r.length,f=n.length,d=s.length,b=mi(i.padding);let g=b.height,p=0,m=s.reduce(((t,i)=>t+i.before.length+i.lines.length+i.after.length),0);m+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),m&&(g+=d*(i.displayColors?Math.max(h,a.lineHeight):a.lineHeight)+(m-d)*a.lineHeight+(m-1)*i.bodySpacing),f&&(g+=i.footerMarginTop+f*l.lineHeight+(f-1)*i.footerSpacing);let v=0;const x=function(t){p=Math.max(p,e.measureText(t).width+v)};return e.save(),e.font=c.string,Z(t.title,x),e.font=a.string,Z(t.beforeBody.concat(t.afterBody),x),v=i.displayColors?o+2+i.boxPadding:0,Z(s,(t=>{Z(t.before,x),Z(t.lines,x),Z(t.after,x)})),v=0,e.font=l.string,Z(t.footer,x),e.restore(),p+=b.width,{width:p,height:g}}function dn(t,i,e,s){const{x:n,width:r}=e,{width:o,chartArea:{left:h,right:a}}=t;let c="center";return"center"===s?c=n<=(h+a)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),function(t,i,e,s){const{x:n,width:r}=s,o=e.caretSize+e.caretPadding;return"left"===t&&n+r+o>i.width||"right"===t&&n-r-o<0||void 0}(c,t,i,e)&&(c="center"),c}function bn(t,i,e){const s=e.yAlign||i.yAlign||function(t,i){const{y:e,height:s}=i;return e<s/2?"top":e>t.height-s/2?"bottom":"center"}(t,e);return{xAlign:e.xAlign||i.xAlign||dn(t,i,e,s),yAlign:s}}function gn(t,i,e,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=t,{xAlign:h,yAlign:a}=e,c=n+r,{topLeft:l,topRight:u,bottomLeft:f,bottomRight:d}=pi(o);let b=function(t,i){let{x:e,width:s}=t;return"right"===i?e-=s:"center"===i&&(e-=s/2),e}(i,h);const g=function(t,i,e){let{y:s,height:n}=t;return"top"===i?s+=e:s-="bottom"===i?n+e:n/2,s}(i,a,c);return"center"===a?"left"===h?b+=c:"right"===h&&(b-=c):"left"===h?b-=Math.max(l,f)+n:"right"===h&&(b+=Math.max(u,d)+n),{x:kt(b,0,s.width-i.width),y:kt(g,0,s.height-i.height)}}function pn(t,i,e){const s=mi(e.padding);return"center"===i?t.x+t.width/2:"right"===i?t.x+t.width-s.right:t.x+s.left}function mn(t){return cn([],ln(t))}function vn(t,i){const e=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return e?t.override(e):t}const xn={beforeTitle:B,title(t){if(t.length>0){const i=t[0],e=i.chart.data.labels,s=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return e[i.dataIndex]}return""},afterTitle:B,beforeBody:B,beforeLabel:B,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let i=t.dataset.label||"";i&&(i+=": ");const e=t.formattedValue;return z(e)||(i+=e),i},labelColor(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:B,afterBody:B,beforeFooter:B,footer:B,afterFooter:B};function yn(t,i,e,s){const n=t[i].call(e,s);return void 0===n?xn[i].call(e,s):n}class Mn extends ns{static positioners=an;constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,e=this.options.setContext(this.getContext()),s=e.enabled&&i.options.animation&&e.animations,n=new ie(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=yi(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,i){const{callbacks:e}=i,s=yn(e,"beforeTitle",this,t),n=yn(e,"title",this,t),r=yn(e,"afterTitle",this,t);let o=[];return o=cn(o,ln(s)),o=cn(o,ln(n)),o=cn(o,ln(r)),o}getBeforeBody(t,i){return mn(yn(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:e}=i,s=[];return Z(t,(t=>{const i={before:[],lines:[],after:[]},n=vn(e,t);cn(i.before,ln(yn(n,"beforeLabel",this,t))),cn(i.lines,yn(n,"label",this,t)),cn(i.after,ln(yn(n,"afterLabel",this,t))),s.push(i)})),s}getAfterBody(t,i){return mn(yn(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:e}=i,s=yn(e,"beforeFooter",this,t),n=yn(e,"footer",this,t),r=yn(e,"afterFooter",this,t);let o=[];return o=cn(o,ln(s)),o=cn(o,ln(n)),o=cn(o,ln(r)),o}_createItems(t){const i=this._active,e=this.chart.data,s=[],n=[],r=[];let o,h,a=[];for(o=0,h=i.length;o<h;++o)a.push(un(this.chart,i[o]));return t.filter&&(a=a.filter(((i,s,n)=>t.filter(i,s,n,e)))),t.itemSort&&(a=a.sort(((i,s)=>t.itemSort(i,s,e)))),Z(a,(i=>{const e=vn(t.callbacks,i);s.push(yn(e,"labelColor",this,i)),n.push(yn(e,"labelPointStyle",this,i)),r.push(yn(e,"labelTextColor",this,i))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){const e=this.options.setContext(this.getContext()),s=this._active;let n,r=[];if(s.length){const t=an[e.position].call(this,s,this._eventPosition);r=this._createItems(e),this.title=this.getTitle(r,e),this.beforeBody=this.getBeforeBody(r,e),this.body=this.getBody(r,e),this.afterBody=this.getAfterBody(r,e),this.footer=this.getFooter(r,e);const i=this._size=fn(this,e),o=Object.assign({},t,i),h=bn(this.chart,e,o),a=gn(e,o,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,n={opacity:1,x:a.x,y:a.y,width:i.width,height:i.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=r,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&e.external&&e.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,e,s){const n=this.getCaretPosition(t,e,s);i.lineTo(n.x1,n.y1),i.lineTo(n.x2,n.y2),i.lineTo(n.x3,n.y3)}getCaretPosition(t,i,e){const{xAlign:s,yAlign:n}=this,{caretSize:r,cornerRadius:o}=e,{topLeft:h,topRight:a,bottomLeft:c,bottomRight:l}=pi(o),{x:u,y:f}=t,{width:d,height:b}=i;let g,p,m,v,x,y;return"center"===n?(x=f+b/2,"left"===s?(g=u,p=g-r,v=x+r,y=x-r):(g=u+d,p=g+r,v=x-r,y=x+r),m=g):(p="left"===s?u+Math.max(h,c)+r:"right"===s?u+d-Math.max(a,l)-r:this.caretX,"top"===n?(v=f,x=v-r,g=p-r,m=p+r):(v=f+b,x=v+r,g=p+r,m=p-r),y=v),{x1:g,x2:p,x3:m,y1:v,y2:x,y3:y}}drawTitle(t,i,e){const s=this.title,n=s.length;let r,o,h;if(n){const a=Xi(e.rtl,this.x,this.width);for(t.x=pn(this,e.titleAlign,e),i.textAlign=a.textAlign(e.titleAlign),i.textBaseline="middle",r=vi(e.titleFont),o=e.titleSpacing,i.fillStyle=e.titleColor,i.font=r.string,h=0;h<n;++h)i.fillText(s[h],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+o,h+1===n&&(t.y+=e.titleMarginBottom-o)}}_drawColorBox(t,i,e,s,n){const r=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:h,boxWidth:a}=n,c=vi(n.bodyFont),l=pn(this,"left",n),u=s.x(l),f=i.y+(h<c.lineHeight?(c.lineHeight-h)/2:0);if(n.usePointStyle){const i={radius:Math.min(a,h)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(u,a)+a/2,c=f+h/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ei(t,i,e,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ei(t,i,e,c)}else{t.lineWidth=H(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const i=s.leftForLtr(u,a),e=s.leftForLtr(s.xPlus(u,1),a-2),o=pi(r.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,li(t,{x:i,y:f,w:a,h,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),li(t,{x:e,y:f+1,w:a-2,h:h-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(i,f,a,h),t.strokeRect(i,f,a,h),t.fillStyle=r.backgroundColor,t.fillRect(e,f+1,a-2,h-2))}t.fillStyle=this.labelTextColors[e]}drawBody(t,i,e){const{body:s}=this,{bodySpacing:n,bodyAlign:r,displayColors:o,boxHeight:h,boxWidth:a,boxPadding:c}=e,l=vi(e.bodyFont);let u=l.lineHeight,f=0;const d=Xi(e.rtl,this.x,this.width),b=function(e){i.fillText(e,d.x(t.x+f),t.y+u/2),t.y+=u+n},g=d.textAlign(r);let p,m,v,x,y,M,w;for(i.textAlign=r,i.textBaseline="middle",i.font=l.string,t.x=pn(this,g,e),i.fillStyle=e.bodyColor,Z(this.beforeBody,b),f=o&&"right"!==g?"center"===r?a/2+c:a+2+c:0,x=0,M=s.length;x<M;++x){for(p=s[x],m=this.labelTextColors[x],i.fillStyle=m,Z(p.before,b),v=p.lines,o&&v.length&&(this._drawColorBox(i,t,x,d,e),u=Math.max(l.lineHeight,h)),y=0,w=v.length;y<w;++y)b(v[y]),u=l.lineHeight;Z(p.after,b)}f=0,u=l.lineHeight,Z(this.afterBody,b),t.y-=n}drawFooter(t,i,e){const s=this.footer,n=s.length;let r,o;if(n){const h=Xi(e.rtl,this.x,this.width);for(t.x=pn(this,e.footerAlign,e),t.y+=e.footerMarginTop,i.textAlign=h.textAlign(e.footerAlign),i.textBaseline="middle",r=vi(e.footerFont),i.fillStyle=e.footerColor,i.font=r.string,o=0;o<n;++o)i.fillText(s[o],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+e.footerSpacing}}drawBackground(t,i,e,s){const{xAlign:n,yAlign:r}=this,{x:o,y:h}=t,{width:a,height:c}=e,{topLeft:l,topRight:u,bottomLeft:f,bottomRight:d}=pi(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(o+l,h),"top"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+a-u,h),i.quadraticCurveTo(o+a,h,o+a,h+u),"center"===r&&"right"===n&&this.drawCaret(t,i,e,s),i.lineTo(o+a,h+c-d),i.quadraticCurveTo(o+a,h+c,o+a-d,h+c),"bottom"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+f,h+c),i.quadraticCurveTo(o,h+c,o,h+c-f),"center"===r&&"left"===n&&this.drawCaret(t,i,e,s),i.lineTo(o,h+l),i.quadraticCurveTo(o,h,o+l,h),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,e=this.$animations,s=e&&e.x,n=e&&e.y;if(s||n){const e=an[t.position].call(this,this._active,this._eventPosition);if(!e)return;const r=this._size=fn(this,t),o=Object.assign({},e,this._size),h=bn(i,t,o),a=gn(t,o,h,i);s._to===a.x&&n._to===a.y||(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=r.width,this.height=r.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,a))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let e=this.opacity;if(!e)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};e=Math.abs(e)<.001?0:e;const r=mi(i.padding);i.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=e,this.drawBackground(n,t,s,i),Ui(t,i.textDirection),n.y+=r.top,this.drawTitle(n,t,i),this.drawBody(n,t,i),this.drawFooter(n,t,i),Zi(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const e=this._active,s=t.map((({datasetIndex:t,index:i})=>{const e=this.chart.getDatasetMeta(t);if(!e)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:e.data[i],index:i}})),n=!K(e,s),r=this._positionChanged(s,i);(n||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,e=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],r=this._getActiveElements(t,n,i,e),o=this._positionChanged(r,t),h=i||!K(r,n)||o;return h&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),h}_getActiveElements(t,i,e,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return i.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const r=this.chart.getElementsAtEventForMode(t,n.mode,n,e);return n.reverse&&r.reverse(),r}_positionChanged(t,i){const{caretX:e,caretY:s,options:n}=this,r=an[n.position].call(this,t,i);return!1!==r&&(e!==r.x||s!==r.y)}}var wn={id:"tooltip",_element:Mn,positioners:an,afterInit(t,i,e){e&&(t.tooltip=new Mn({chart:t,options:e}))},beforeUpdate(t,i,e){t.tooltip&&t.tooltip.initialize(e)},reset(t,i,e){t.tooltip&&t.tooltip.initialize(e)},afterDraw(t){const i=t.tooltip;if(i&&i._willRender()){const e={tooltip:i};if(!1===t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0}))return;i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e)}},afterEvent(t,i){t.tooltip&&t.tooltip.handleEvent(i.event,i.replay,i.inChartArea)&&(i.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,i)=>i.bodyFont.size,boxWidth:(t,i)=>i.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:xn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function _n(t){const i=this.getLabels();return t>=0&&t<i.length?i[t]:t}function kn(t,i,{horizontal:e,minRotation:s}){const n=yt(s),r=(e?Math.sin(n):Math.cos(n))||.001;return Math.min(i/r,.75*i*(""+t).length)}class On extends ds{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return z(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this;const r=t=>s=i?s:t,o=t=>n=e?n:t;if(t){const t=pt(s),i=pt(n);t<0&&i<0?o(0):t>0&&i>0&&r(0)}if(s===n){let i=0===n?1:Math.abs(.05*n);o(n+i),t||r(s-i)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let i,{maxTicksLimit:e,stepSize:s}=t;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let e=this.getTickLimit();e=Math.max(2,e);const s=function(t,i){const e=[],{bounds:s,step:n,min:r,max:o,precision:h,count:a,maxTicks:c,maxDigits:l,includeBounds:u}=t,f=n||1,d=c-1,{min:b,max:g}=i,p=!z(r),m=!z(o),v=!z(a),x=(g-b)/(l+1);let y,M,w,_,k=vt((g-b)/d/f)*f;if(k<1e-14&&!p&&!m)return[{value:b},{value:g}];_=Math.ceil(g/k)-Math.floor(b/k),_>d&&(k=vt(_*k/d/f)*f),z(h)||(y=Math.pow(10,h),k=Math.ceil(k*y)/y),"ticks"===s?(M=Math.floor(b/k)*k,w=Math.ceil(g/k)*k):(M=b,w=g),p&&m&&n&&function(t,i){const e=Math.round(t);return e-i<=t&&e+i>=t}((o-r)/n,k/1e3)?(_=Math.round(Math.min((o-r)/k,c)),k=(o-r)/_,M=r,w=o):v?(M=p?r:M,w=m?o:w,_=a-1,k=(w-M)/_):(_=(w-M)/k,_=mt(_,Math.round(_),k/1e3)?Math.round(_):Math.ceil(_));const O=Math.max(Mt(k),Mt(M));y=Math.pow(10,z(h)?O:h),M=Math.round(M*y)/y,w=Math.round(w*y)/y;let S=0;for(p&&(u&&M!==r?(e.push({value:r}),M<r&&S++,mt(Math.round((M+S*k)*y)/y,r,kn(r,x,t))&&S++):M<r&&S++);S<_;++S){const t=Math.round((M+S*k)*y)/y;if(m&&t>o)break;e.push({value:t})}return m&&u&&w!==o?e.length&&mt(e[e.length-1].value,o,kn(o,x,t))?e[e.length-1].value=o:e.push({value:o}):m&&w!==o||e.push({value:w}),e}({maxTicks:e,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,i){let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e].value,isNaN(n)||(i.min=Math.min(i.min,n),i.max=Math.max(i.max,n))}(s,this),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let i=this.min,e=this.max;if(super.configure(),this.options.offset&&t.length){const s=(e-i)/Math.max(t.length-1,1)/2;i-=s,e+=s}this._startValue=i,this._endValue=e,this._valueRange=e-i}getLabelForValue(t){return Vt(t,this.chart.options.locale,this.options.ticks.format)}}Hs.register(tn,class extends de{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,i,e,s){return ge(t,i,e,s)}parseArrayData(t,i,e,s){return ge(t,i,e,s)}parseObjectData(t,i,e,s){const{iScale:n,vScale:r}=t,{xAxisKey:o="x",yAxisKey:h="y"}=this._parsing,a="x"===n.axis?o:h,c="x"===r.axis?o:h,l=[];let u,f,d,b;for(u=e,f=e+s;u<f;++u)b=i[u],d={},d[n.axis]=n.parse(st(b,a),u),l.push(be(st(b,c),d,r,u));return l}updateRangeFromParsed(t,i,e,s){super.updateRangeFromParsed(t,i,e,s);const n=e._custom;n&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:e,vScale:s}=i,n=this.getParsed(t),r=n._custom,o=pe(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+e.getLabelForValue(n[e.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,e,s){const n="reset"===s,{index:r,_cachedMeta:{vScale:o}}=this,h=o.getBasePixel(),a=o.isHorizontal(),c=this._getRuler(),{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,s);for(let f=i;f<i+e;f++){const i=this.getParsed(f),e=n||z(i[o.axis])?{base:h,head:h}:this._calculateBarValuePixels(f),d=this._calculateBarIndexPixels(f,c),b=(i._stacks||{})[o.axis],g={horizontal:a,base:e.base,enableBorderRadius:!b||pe(i._custom)||r===b._top||r===b._bottom,x:a?e.head:d.center,y:a?d.center:e.head,height:a?d.size:Math.abs(e.size),width:a?Math.abs(e.size):d.size};u&&(g.options=l||this.resolveDataElementOptions(f,t[f].active?"active":s));const p=g.options||t[f].options;me(g,p,b,r),ye(g,p,c.ratio),this.updateElement(t[f],f,g,s)}}_getStacks(t,i){const{iScale:e}=this._cachedMeta,s=e.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),n=e.options.stacked,r=[],o=this._cachedMeta.controller.getParsed(i),h=o&&o[e.axis],a=t=>{const i=t._parsed.find((t=>t[e.axis]===h)),s=i&&i[t.vScale.axis];if(z(s)||isNaN(s))return!0};for(const e of s)if((void 0===i||!a(e))&&((!1===n||-1===r.indexOf(e.stack)||void 0===n&&void 0===e.stack)&&r.push(e.stack),e.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter((e=>t[e].axis===i)).shift()}_getAxis(){const t={},i=this.getFirstScaleIdForIndexAxis();for(const e of this.chart.data.datasets)t[V("x"===this.chart.options.indexAxis?e.xAxisID:e.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,e){const s=this._getStacks(t,e),n=void 0!==i?s.indexOf(i):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,i=this._cachedMeta,e=i.iScale,s=[];let n,r;for(n=0,r=i.data.length;n<r;++n)s.push(e.getPixelForValue(this.getParsed(n)[e.axis],n));const o=t.barThickness,h=o||function(t){const i=t.iScale,e=function(t,i){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas(i);let s=[];for(let i=0,n=e.length;i<n;i++)s=s.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=function(t){const i=new Set(t);return i.size===t.length?t:Array.from(i)}(s.sort(((t,i)=>t-i)))}return t._cache.$bar}(i,t.type);let s,n,r,o,h=i._length;const a=()=>{32767!==r&&-32768!==r&&(rt(o)&&(h=Math.min(h,Math.abs(r-o)||h)),o=r)};for(s=0,n=e.length;s<n;++s)r=i.getPixelForValue(e[s]),a();for(o=void 0,s=0,n=i.ticks.length;s<n;++s)r=i.getPixelForTick(s),a();return h}(i);return{min:h,pixels:s,start:e._startPixel,end:e._endPixel,stackCount:this._getStackCount(),scale:e,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:e,index:s},options:{base:n,minBarLength:r}}=this,o=n||0,h=this.getParsed(t),a=h._custom,c=pe(a);let l,u,f=h[i.axis],d=0,b=e?this.applyStack(i,h,e):f;b!==f&&(d=b-f,b=f),c&&(f=a.barStart,b=a.barEnd-a.barStart,0!==f&&pt(f)!==pt(a.barEnd)&&(d=0),d+=f);const g=z(n)||c?d:n;let p=i.getPixelForValue(g);if(l=this.chart.getDataVisibility(t)?i.getPixelForValue(d+b):p,u=l-p,Math.abs(u)<r){u=function(t,i,e){return 0!==t?pt(t):(i.isHorizontal()?1:-1)*(i.min>=e?1:-1)}(u,i,o)*r,f===o&&(p-=u/2);const t=i.getPixelForDecimal(0),n=i.getPixelForDecimal(1),a=Math.min(t,n),d=Math.max(t,n);p=Math.max(Math.min(p,d),a),l=p+u,e&&!c&&(h._stacks[i.axis]._visualValues[s]=i.getValueForPixel(l)-i.getValueForPixel(p))}if(p===i.getPixelForValue(o)){const t=pt(u)*i.getLineWidthForValue(o)/2;p+=t,u-=t}return{size:u,base:p,head:l,center:l+u/2}}_calculateBarIndexPixels(t,i){const e=i.scale,s=this.options,n=s.skipNull,r=V(s.maxBarThickness,1/0);let o,h;const a=this._getAxisCount();if(i.grouped){const e=n?this._getStackCount(t):i.stackCount,c="flex"===s.barThickness?function(t,i,e,s){const n=i.pixels,r=n[t];let o=t>0?n[t-1]:null,h=t<n.length-1?n[t+1]:null;const a=e.categoryPercentage;null===o&&(o=r-(null===h?i.end-i.start:h-r)),null===h&&(h=r+r-o);const c=r-(r-Math.min(o,h))/2*a;return{chunk:Math.abs(h-o)/2*a/s,ratio:e.barPercentage,start:c}}(t,i,s,e*a):function(t,i,e,s){const n=e.barThickness;let r,o;return z(n)?(r=i.min*e.categoryPercentage,o=e.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:i.pixels[t]-r/2}}(t,i,s,e*a),l="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(V(l,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0)+u;o=c.start+c.chunk*f+c.chunk/2,h=Math.min(r,c.chunk*c.ratio)}else o=e.getPixelForValue(this.getParsed(t)[e.axis],t),h=Math.min(r,i.min*i.ratio);return{base:o-h/2,head:o+h/2,center:o,size:h}}draw(){const t=this._cachedMeta,i=t.vScale,e=t.data,s=e.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[i.axis]||e[n].hidden||e[n].draw(this._ctx)}},class extends ns{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:e,backgroundColor:s}}=this,{inner:n,outer:r}=function(t){const i=Ys(t),e=i.right-i.left,s=i.bottom-i.top,n=function(t,i,e){const s=t.borderSkipped,n=gi(t.options.borderWidth);return{t:Vs(s.top,n.top,0,e),r:Vs(s.right,n.right,0,i),b:Vs(s.bottom,n.bottom,0,e),l:Vs(s.left,n.left,0,i)}}(t,e/2,s/2),r=function(t,i,e){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,r=pi(n),o=Math.min(i,e),h=t.borderSkipped,a=s||H(n);return{topLeft:Vs(!a||h.top||h.left,r.topLeft,0,o),topRight:Vs(!a||h.top||h.right,r.topRight,0,o),bottomLeft:Vs(!a||h.bottom||h.left,r.bottomLeft,0,o),bottomRight:Vs(!a||h.bottom||h.right,r.bottomRight,0,o)}}(t,e/2,s/2);return{outer:{x:i.left,y:i.top,w:e,h:s,radius:r},inner:{x:i.left+n.l,y:i.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}(this),o=(h=r.radius).topLeft||h.topRight||h.bottomLeft||h.bottomRight?li:Us;var h;t.save(),r.w===n.w&&r.h===n.h||(t.beginPath(),o(t,Zs(r,i,n)),t.clip(),o(t,Zs(n,-i,r)),t.fillStyle=e,t.fill("evenodd")),t.beginPath(),o(t,Zs(n,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,e){return Xs(this,t,i,e)}inXRange(t,i){return Xs(this,t,null,i)}inYRange(t,i){return Xs(this,null,t,i)}getCenterPoint(t){const{x:i,y:e,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(i+s)/2:i,y:n?e:(e+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends ds{static id="category";static defaults={ticks:{callback:_n}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const t=this.getLabels();for(const{index:e,label:s}of i)t[e]===s&&t.splice(e,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(z(t))return null;const e=this.getLabels();return((t,i)=>null===t?null:kt(Math.round(t),0,i))(i=isFinite(i)&&e[i]===t?i:function(t,i,e,s){const n=t.indexOf(i);return-1===n?((t,i,e,s)=>("string"==typeof i?(e=t.push(i)-1,s.unshift({index:e,label:i})):isNaN(i)&&(e=null),e))(t,i,e,s):n!==t.lastIndexOf(i)?e:n}(e,t,V(i,t),this._addedLabels),e.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:e,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(e=0),i||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){const t=this.min,i=this.max,e=this.options.offset,s=[];let n=this.getLabels();n=0===t&&i===n.length-1?n:n.slice(t,i+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let e=t;e<=i;e++)s.push({value:e});return s}getLabelForValue(t){return _n.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},class extends On{static id="linear";static defaults={ticks:{callback:Xt.formatters.numeric}};determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,e=yt(this.options.ticks.minRotation),s=(t?Math.sin(e):Math.cos(e))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},rn,wn,hn);const Sn=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.loading=!0,this.errorMessage=""}componentDidLoad(){this.getGrossPayment&&this.fetchData()}propChanged(){this.getGrossPayment&&this.fetchData()}grossVolumeReportChanged(t){t&&(this.chart?this.updateChartData(t):this.initChart(t))}async fetchData(){this.loading=!0,this.getGrossPayment({onSuccess:t=>{this.loading=!1,this.grossVolumeReport=t},onError:({error:t,code:i,severity:e})=>{this.loading=!1,this.errorMessage=t,this.errorEvent.emit({errorCode:i,message:t,severity:e})}})}initChart(t){const{dates:i,total:e}=t,s=i.reverse(),o=((t,i,e)=>({type:"bar",options:{plugins:{legend:{display:!1},title:{display:!0,text:["Trailing 30 Days","Gross Payments",n(t)],position:"top",align:"start"},tooltip:{displayColors:!1,intersect:!1,callbacks:{label:t=>{let s=t.dataIndex;return[r(i[s].date,e),n(i[s].value)]}}}},scales:{x:{grid:{drawOnChartArea:!1,drawTicks:!1},ticks:{callback:t=>{if(0===t||t===i.length-1)return r(i[t].date,e)}}},y:{display:!1}}},data:{labels:i.map((()=>"")),datasets:[{label:"Gross Volume by Date",data:i.map((t=>t.value))}]}}))(e,s,s[i.length-1].date);this.chart=new Hs(this.chartRef.getContext("2d"),o)}updateChartData(t){const i=t.dates.map((t=>t.value));this.chart.data.datasets.forEach((t=>{t.data=i})),this.chart.update()}disconnectedCallback(){this.chart&&this.chart.destroy()}render(){return e(s,{key:"0432a1c141cd1ea91ebcb3f975a220e5127164c8"},this.loading&&e(h,{key:"0261cca24232d936418d305f60f3857a502dcb11"}),this.errorMessage?o(this.errorMessage):e("canvas",{id:"chart",ref:t=>this.chartRef=t}))}static get watchers(){return{getGrossPayment:["propChanged"],grossVolumeReport:["grossVolumeReportChanged"]}}};export{Sn as gross_payment_chart_core}
|
|
20
|
+
class Qi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,e,s){const n=i.duration;i.listeners[s].forEach((s=>s({chart:t,initial:i.initial,numSteps:n,currentStep:Math.min(e-i.start,n)})))}_refresh(){this._request||(this._running=!0,this._request=Ct.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let i=0;this._charts.forEach(((e,s)=>{if(!e.running||!e.items.length)return;const n=e.items;let r,o=n.length-1,h=!1;for(;o>=0;--o)r=n[o],r._active?(r._total>e.duration&&(e.duration=r._total),r.tick(t),h=!0):(n[o]=n[n.length-1],n.pop());h&&(s.draw(),this._notify(s,e,t,"progress")),n.length||(e.running=!1,this._notify(s,e,t,"complete"),e.initial=!1),i+=n.length})),this._lastDate=t,0===i&&(this._running=!1)}_getAnims(t){const i=this._charts;let e=i.get(t);return e||(e={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,e)),e}listen(t,i,e){this._getAnims(t).listeners[i].push(e)}add(t,i){i&&i.length&&this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce(((t,i)=>Math.max(t,i._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!!(i&&i.running&&i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const e=i.items;let s=e.length-1;for(;s>=0;--s)e[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qi=new Qi;const Gi="transparent",Ji={boolean:(t,i,e)=>e>.5?i:t,color(t,i,e){const s=Wt(t||Gi),n=s.valid&&Wt(i||Gi);return n&&n.valid?n.mix(s,e).hexString():i},number:(t,i,e)=>t+(i-t)*e};class te{constructor(t,i,e,s){const n=i[e];s=vi([t.to,s,n,t.from]);const r=vi([t.from,n,s]);this._active=!0,this._fn=t.fn||Ji[t.type||typeof r],this._easing=Bt[t.easing]||Bt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=e,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,e){if(this._active){this._notify(!1);const s=this._target[this._prop],n=e-this._start,r=this._duration-n;this._start=e,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=vi([t.to,i,s,t.from]),this._from=vi([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,e=this._duration,s=this._prop,n=this._from,r=this._loop,o=this._to;let h;if(this._active=n!==o&&(r||i<e),!this._active)return this._target[s]=o,void this._notify(!0);i<0?this._target[s]=n:(h=i/e%2,h=r&&h>1?2-h:h,h=this._easing(Math.min(1,Math.max(0,h))),this._target[s]=this._fn(n,o,h))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((i,e)=>{t.push({res:i,rej:e})}))}_notify(t){const i=t?"res":"rej",e=this._promises||[];for(let t=0;t<e.length;t++)e[t][i]()}}class ie{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!H(t))return;const i=Object.keys(Gt.animation),e=this._properties;Object.getOwnPropertyNames(t).forEach((s=>{const n=t[s];if(!H(n))return;const r={};for(const t of i)r[t]=n[t];(z(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,i){const e=i.options,s=function(t,i){if(!i)return;let e=t.options;if(e)return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;t.options=i}(t,e);if(!s)return[];const n=this._createAnimations(s,e);return e.$shared&&function(t,i){const e=[],s=Object.keys(i);for(let i=0;i<s.length;i++){const n=t[s[i]];n&&n.active()&&e.push(n.wait())}return Promise.all(e)}(t.options.$animations,e).then((()=>{t.options=e}),(()=>{})),n}_createAnimations(t,i){const e=this._properties,s=[],n=t.$animations||(t.$animations={}),r=Object.keys(i),o=Date.now();let h;for(h=r.length-1;h>=0;--h){const a=r[h];if("$"===a.charAt(0))continue;if("options"===a){s.push(...this._animateOptions(t,i));continue}const c=i[a];let l=n[a];const u=e.get(a);if(l){if(u&&l.active()){l.update(u,c,o);continue}l.cancel()}u&&u.duration?(n[a]=l=new te(u,t,a,c),s.push(l)):t[a]=c}return s}update(t,i){if(0===this._properties.size)return void Object.assign(t,i);const e=this._createAnimations(t,i);return e.length?(qi.add(this._chart,e),!0):void 0}}function ee(t,i){const e=t&&t.options||{},s=e.reverse,n=void 0===e.min?i:0,r=void 0===e.max?i:0;return{start:s?r:n,end:s?n:r}}function se(t,i){const e=[],s=t._getSortedDatasetMetas(i);let n,r;for(n=0,r=s.length;n<r;++n)e.push(s[n].index);return e}function ne(t,i,e,s={}){const n=t.keys,r="single"===s.mode;let o,h,a,c;if(null===i)return;let l=!1;for(o=0,h=n.length;o<h;++o){if(a=+n[o],a===e){if(l=!0,s.all)continue;break}c=t.values[a],$(c)&&(r||0===i||pt(i)===pt(c))&&(i+=c)}return l||s.all?i:0}function re(t,i){const e=t&&t.options.stacked;return e||void 0===e&&void 0!==i.stack}function oe(t,i,e){const s=t[i]||(t[i]={});return s[e]||(s[e]={})}function he(t,i,e,s){for(const n of i.getMatchingVisibleMetas(s).reverse()){const i=t[n.index];if(e&&i>0||!e&&i<0)return n.index}return null}function ae(t,i){const{chart:e,_cachedMeta:s}=t,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:h}=s,a=r.axis,c=o.axis,l=function(t,i,e){return`${t.id}.${i.id}.${e.stack||e.type}`}(r,o,s),u=i.length;let f;for(let t=0;t<u;++t){const e=i[t],{[a]:r,[c]:u}=e;f=(e._stacks||(e._stacks={}))[c]=oe(n,l,r),f[h]=u,f._top=he(f,o,!0,s.type),f._bottom=he(f,o,!1,s.type),(f._visualValues||(f._visualValues={}))[h]=u}}function ce(t,i){const e=t.scales;return Object.keys(e).filter((t=>e[t].axis===i)).shift()}function le(t,i){const e=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(const t of i){const i=t._stacks;if(!i||void 0===i[s]||void 0===i[s][e])return;delete i[s][e],void 0!==i[s]._visualValues&&void 0!==i[s]._visualValues[e]&&delete i[s]._visualValues[e]}}}const ue=t=>"reset"===t||"none"===t,fe=(t,i)=>i?t:Object.assign({},t);class de{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=re(t.vScale,t),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(t){this.index!==t&&le(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,e=this.getDataset(),s=(t,i,e,s)=>"x"===t?i:"r"===t?s:e,n=i.xAxisID=V(e.xAxisID,ce(t,"x")),r=i.yAxisID=V(e.yAxisID,ce(t,"y")),o=i.rAxisID=V(e.rAxisID,ce(t,"r")),h=i.indexAxis,a=i.iAxisID=s(h,n,r,o),c=i.vAxisID=s(h,r,n,o);i.xScale=this.getScaleForId(n),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(o),i.iScale=this.getScaleForId(a),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Rt(this._data,this),t._stacked&&le(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),e=this._data;if(H(i))this._data=function(t,i){const{iScale:e,vScale:s}=i,n="x"===e.axis?"x":"y",r="x"===s.axis?"x":"y",o=Object.keys(t),h=new Array(o.length);let a,c,l;for(a=0,c=o.length;a<c;++a)l=o[a],h[a]={[n]:l,[r]:t[l]};return h}(i,this._cachedMeta);else if(e!==i){if(e){Rt(e,this);const t=this._cachedMeta;le(t),t._parsed=[]}i&&Object.isExtensible(i)&&((s=i)._chartjs?s._chartjs.listeners.push(this):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),jt.forEach((t=>{const i="_onData"+nt(t),e=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=e.apply(this,t);return s._chartjs.listeners.forEach((e=>{"function"==typeof e[i]&&e[i](...t)})),n}})})))),this._syncList=[],this._data=i}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,e=this.getDataset();let s=!1;this._dataCheck();const n=i._stacked;i._stacked=re(i.vScale,i),i.stack!==e.stack&&(s=!0,le(i),i.stack=e.stack),this._resyncElements(t),(s||n!==i._stacked)&&(ae(this,i._parsed),i._stacked=re(i.vScale,i))}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:e,_data:s}=this,{iScale:n,_stacked:r}=e,o=n.axis;let h,a,c,l=0===t&&i===s.length||e._sorted,u=t>0&&e._parsed[t-1];if(!1===this._parsing)e._parsed=s,e._sorted=!0,c=s;else{c=z(s[t])?this.parseArrayData(e,s,t,i):H(s[t])?this.parseObjectData(e,s,t,i):this.parsePrimitiveData(e,s,t,i);const n=()=>null===a[o]||u&&a[o]<u[o];for(h=0;h<i;++h)e._parsed[h+t]=a=c[h],l&&(n()&&(l=!1),u=a);e._sorted=l}r&&ae(this,c)}parsePrimitiveData(t,i,e,s){const{iScale:n,vScale:r}=t,o=n.axis,h=r.axis,a=n.getLabels(),c=n===r,l=new Array(s);let u,f,d;for(u=0,f=s;u<f;++u)d=u+e,l[u]={[o]:c||n.parse(a[d],d),[h]:r.parse(i[d],d)};return l}parseArrayData(t,i,e,s){const{xScale:n,yScale:r}=t,o=new Array(s);let h,a,c,l;for(h=0,a=s;h<a;++h)c=h+e,l=i[c],o[h]={x:n.parse(l[0],c),y:r.parse(l[1],c)};return o}parseObjectData(t,i,e,s){const{xScale:n,yScale:r}=t,{xAxisKey:o="x",yAxisKey:h="y"}=this._parsing,a=new Array(s);let c,l,u,f;for(c=0,l=s;c<l;++c)u=c+e,f=i[u],a[c]={x:n.parse(st(f,o),u),y:r.parse(st(f,h),u)};return a}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,e){const s=this._cachedMeta,n=i[t.axis];return ne({keys:se(this.chart,!0),values:i._stacks[t.axis]._visualValues},n,s.index,{mode:e})}updateRangeFromParsed(t,i,e,s){const n=e[i.axis];let r=null===n?NaN:n;const o=s&&e._stacks[i.axis];s&&o&&(s.values=o,r=ne(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){const e=this._cachedMeta,s=e._parsed,n=e._sorted&&t===e.iScale,r=s.length,o=this._getOtherScale(t),h=((t,i)=>t&&!i.hidden&&i._stacked&&{keys:se(this.chart,!0),values:null})(i,e),a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:l}=function(t){const{min:i,max:e,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?i:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=s[u];const i=f[o.axis];return!$(f[t.axis])||c>i||l<i}for(u=0;u<r&&(d()||(this.updateRangeFromParsed(a,t,f,h),!n));++u);if(n)for(u=r-1;u>=0;--u)if(!d()){this.updateRangeFromParsed(a,t,f,h);break}return a}getAllParsedValues(t){const i=this._cachedMeta._parsed,e=[];let s,n,r;for(s=0,n=i.length;s<n;++s)r=i[s][t.axis],$(r)&&e.push(r);return e}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,e=i.iScale,s=i.vScale,n=this.getParsed(t);return{label:e?""+e.getLabelForValue(n[e.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let i,e,s,n;return H(t)?(i=t.top,e=t.right,s=t.bottom,n=t.left):i=e=s=n=t,{top:i,right:e,bottom:s,left:n,disabled:!1===t}}(V(this.options.clip,function(t,i,e){if(!1===e)return!1;const s=ee(t,e),n=ee(i,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this._cachedMeta,e=i.data||[],s=this.chart.chartArea,n=[],r=this._drawStart||0,o=this._drawCount||e.length-r,h=this.options.drawActiveElementsOnTop;let a;for(i.dataset&&i.dataset.draw(t,s,r,o),a=r;a<r+o;++a){const i=e[a];i.hidden||(i.active&&h?n.push(i):i.draw(t,s))}for(a=0;a<n.length;++a)n[a].draw(t,s)}getStyle(t,i){const e=i?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,i,e){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];n=i.$context||(i.$context=function(t,i,e){return yi(t,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:e,index:i,mode:"default",type:"data"})}(this.getContext(),t,i)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,i){return yi(t,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!i,n.mode=e,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",e){const s="active"===i,n=this._cachedDataOpts,r=t+"-"+i,o=n[r],h=this.enableOptionSharing&&rt(e);if(o)return fe(o,h);const a=this.chart.config,c=a.datasetElementScopeKeys(this._type,t),l=s?[`${t}Hover`,"hover",t,""]:[t,""],u=a.getOptionScopes(this.getDataset(),c),f=Object.keys(Gt.elements[t]),d=a.resolveNamedOptions(u,f,(()=>this.getContext(e,s,i)),l);return d.$shared&&(d.$shared=h,n[r]=Object.freeze(fe(d,h))),d}_resolveAnimations(t,i,e){const s=this.chart,n=this._cachedDataOpts,r=`animation-${i}`,o=n[r];if(o)return o;let h;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,i),r=s.getOptionScopes(this.getDataset(),n);h=s.createResolver(r,this.getContext(t,e,i))}const a=new ie(s,h&&h.animations);return h&&h._cacheable&&(n[r]=Object.freeze(a)),a}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||ue(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const e=this.resolveDataElementOptions(t,i),s=this._sharedOptions,n=this.getSharedOptions(e),r=this.includeOptions(i,n)||n!==s;return this.updateSharedOptions(n,i,e),{sharedOptions:n,includeOptions:r}}updateElement(t,i,e,s){ue(s)?Object.assign(t,e):this._resolveAnimations(i,s).update(t,e)}updateSharedOptions(t,i,e){t&&!ue(i)&&this._resolveAnimations(void 0,i).update(t,e)}_setStyle(t,i,e,s){t.active=s;const n=this.getStyle(i,s);this._resolveAnimations(i,e,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,i,e){this._setStyle(t,e,"active",!1)}setHoverStyle(t,i,e){this._setStyle(t,e,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,e=this._cachedMeta.data;for(const[t,i,e]of this._syncList)this[t](i,e);this._syncList=[];const s=e.length,n=i.length,r=Math.min(n,s);r&&this.parse(0,r),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,i,e=!0){const s=this._cachedMeta,n=s.data,r=t+i;let o;const h=t=>{for(t.length+=i,o=t.length-1;o>=r;o--)t[o]=t[o-i]};for(h(n),o=t;o<r;++o)n[o]=new this.dataElementType;this._parsing&&h(s._parsed),this.parse(t,i),e&&this.updateElements(n,t,i,"reset")}updateElements(t,i,e,s){}_removeElements(t,i){const e=this._cachedMeta;if(this._parsing){const s=e._parsed.splice(t,i);e._stacked&&le(e,s)}e.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,e,s]=t;this[i](e,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function be(t,i,e,s){return z(t)?function(t,i,e,s){const n=e.parse(t[0],s),r=e.parse(t[1],s),o=Math.min(n,r),h=Math.max(n,r);let a=o,c=h;Math.abs(o)>Math.abs(h)&&(a=h,c=o),i[e.axis]=c,i._custom={barStart:a,barEnd:c,start:n,end:r,min:o,max:h}}(t,i,e,s):i[e.axis]=e.parse(t,s),i}function ge(t,i,e,s){const n=t.iScale,r=t.vScale,o=n.getLabels(),h=n===r,a=[];let c,l,u,f;for(c=e,l=e+s;c<l;++c)f=i[c],u={},u[n.axis]=h||n.parse(o[c],c),a.push(be(f,u,r,c));return a}function pe(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function me(t,i,e,s){let n=i.borderSkipped;const r={};if(!n)return void(t.borderSkipped=r);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:h,reverse:a,top:c,bottom:l}=function(t){let i,e,s,n,r;return t.horizontal?(i=t.base>t.x,e="left",s="right"):(i=t.base<t.y,e="bottom",s="top"),i?(n="end",r="start"):(n="start",r="end"),{start:e,end:s,reverse:i,top:n,bottom:r}}(t);"middle"===n&&e&&(t.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=l:(r[xe(l,o,h,a)]=!0,n=c)),r[xe(n,o,h,a)]=!0,t.borderSkipped=r}function xe(t,i,e,s){var n,r,o;return s?(o=e,t=ve(t=(n=t)===(r=i)?o:n===o?r:n,e,i)):t=ve(t,i,e),t}function ve(t,i,e){return"start"===t?i:"end"===t?e:t}function ye(t,{inflateAmount:i},e){t.inflateAmount="auto"===i?1===e?.33:0:i}class Me extends de{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data,{labels:{pointStyle:e,textAlign:s,color:n,useBorderRadius:r,borderRadius:o}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map(((i,h)=>{const a=t.getDatasetMeta(0).controller.getStyle(h);return{text:i,fillStyle:a.backgroundColor,fontColor:n,hidden:!t.getDataVisibility(h),lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,textAlign:s,pointStyle:e,borderRadius:r&&(o||a.borderRadius),index:h}})):[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}}};constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){const e=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=e;else{let n,r,o=t=>+e[t];if(H(e[t])){const{key:t="value"}=this._parsing;o=i=>+st(e[i],t)}for(n=t,r=t+i;n<r;++n)s._parsed[n]=o(n)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=ct,i=-ct;for(let e=0;e<this.chart.data.datasets.length;++e)if(this.chart.isDatasetVisible(e)&&this.chart.getDatasetMeta(e).type===this._type){const s=this.chart.getDatasetMeta(e).controller,n=s._getRotation(),r=s._getCircumference();t=Math.min(t,n),i=Math.max(i,n+r)}return{rotation:t,circumference:i-t}}update(t){const i=this.chart,{chartArea:e}=i,s=this._cachedMeta,n=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(e.width,e.height)-r)/2,0),h=Math.min((c=o,"string"==typeof(a=this.options.cutout)&&a.endsWith("%")?parseFloat(a)/100:+a/c),1);var a,c;const l=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:b,offsetX:g,offsetY:p}=function(t,i,e){let s=1,n=1,r=0,o=0;if(i<ct){const h=t,a=h+i,c=Math.cos(h),l=Math.sin(h),u=Math.cos(a),f=Math.sin(a),d=(t,i,s)=>_t(t,h,a,!0)?1:Math.max(i,i*e,s,s*e),b=(t,i,s)=>_t(t,h,a,!0)?-1:Math.min(i,i*e,s,s*e),g=d(0,c,u),p=d(ft,l,f),m=b(at,c,u),x=b(at+ft,l,f);s=(g-m)/2,n=(p-x)/2,r=-(g+m)/2,o=-(p+x)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}(f,u,h),m=Math.max(Math.min((e.width-r)/d,(e.height-r)/b)/2,0),x=X(this.options.radius,m),v=(x-Math.max(x*h,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,i){const e=this.options,s=this._cachedMeta,n=this._getCircumference();return i&&e.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/ct)}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.chartArea,h=(o.left+o.right)/2,a=(o.top+o.bottom)/2,c=n&&r.options.animation.animateScale,l=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(i,s);let b,g=this._getRotation();for(b=0;b<i;++b)g+=this._circumference(b,n);for(b=i;b<i+e;++b){const i=this._circumference(b,n),e=t[b],r={x:h+this.offsetX,y:a+this.offsetY,startAngle:g,endAngle:g+i,circumference:i,outerRadius:u,innerRadius:l};d&&(r.options=f||this.resolveDataElementOptions(b,e.active?"active":s)),g+=i,this.updateElement(e,b,r,s)}}calculateTotal(){const t=this._cachedMeta,i=t.data;let e,s=0;for(e=0;e<i.length;e++){const n=t._parsed[e];null===n||isNaN(n)||!this.chart.getDataVisibility(e)||i[e].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const i=this._cachedMeta.total;return i>0&&!isNaN(t)?ct*(Math.abs(t)/i):0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Vt(this._cachedMeta._parsed[t],i.options.locale);return{label:e[t]||"",value:s}}getMaxBorderWidth(t){let i=0;const e=this.chart;let s,n,r,o,h;if(!t)for(s=0,n=e.data.datasets.length;s<n;++s)if(e.isDatasetVisible(s)){r=e.getDatasetMeta(s),t=r.data,o=r.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)h=o.resolveDataElementOptions(s),"inner"!==h.borderAlign&&(i=Math.max(i,h.borderWidth||0,h.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let e=0,s=t.length;e<s;++e){const t=this.resolveDataElementOptions(e);i=Math.max(i,t.offset||0,t.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let e=0;e<t;++e)this.chart.isDatasetVisible(e)&&(i+=this._getRingWeight(e));return i}_getRingWeight(t){return Math.max(V(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class we extends de{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:e,color:s}}=t.legend.options;return i.labels.map(((i,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:e,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,i,e){e.chart.toggleDataVisibility(i.index),e.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this.chart,e=i.data.labels||[],s=Vt(this._cachedMeta._parsed[t].r,i.options.locale);return{label:e[t]||"",value:s}}parseObjectData(t,i,e,s){return Pi.bind(this)(t,i,e,s)}update(t){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){const t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return this._cachedMeta.data.forEach(((i,e)=>{const s=this.getParsed(e).r;!isNaN(s)&&this.chart.getDataVisibility(e)&&(s<t.min&&(t.min=s),s>t.max&&(t.max=s))})),t}_updateRadius(){const t=this.chart,i=t.chartArea,e=t.options,s=Math.min(i.right-i.left,i.bottom-i.top),n=Math.max(s/2,0),r=(n-Math.max(e.cutoutPercentage?n/100*e.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,i,e,s){const n="reset"===s,r=this.chart,o=r.options.animation,h=this._cachedMeta.rScale,a=h.xCenter,c=h.yCenter,l=h.getIndexAngle(0)-.5*at;let u,f=l;const d=360/this.countVisibleElements();for(u=0;u<i;++u)f+=this._computeAngle(u,s,d);for(u=i;u<i+e;u++){const i=t[u];let e=f,b=f+this._computeAngle(u,s,d),g=r.getDataVisibility(u)?h.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=b,n&&(o.animateScale&&(g=0),o.animateRotate&&(e=b=l));const p={x:a,y:c,innerRadius:0,outerRadius:g,startAngle:e,endAngle:b,options:this.resolveDataElementOptions(u,i.active?"active":s)};this.updateElement(i,u,p,s)}}countVisibleElements(){let t=0;return this._cachedMeta.data.forEach(((i,e)=>{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&t++})),t}_computeAngle(t,i,e){return this.chart.getDataVisibility(t)?yt(this.resolveDataElementOptions(t,i).angle||e):0}}function _e(t,i,e,s){const{controller:n,data:r,_sorted:o}=t,h=n._cachedMeta.iScale,a=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(h&&i===h.axis&&"r"!==i&&o&&r.length){const o=h._reversePixels?Dt:At;if(!s){const s=o(r,i,e);if(a){const{vScale:i}=n._cachedMeta,{_parsed:e}=t,r=e.slice(0,s.lo+1).reverse().findIndex((t=>!W(t[i.axis])));s.lo-=Math.max(0,r);const o=e.slice(s.hi).findIndex((t=>!W(t[i.axis])));s.hi+=Math.max(0,o)}return s}if(n._sharedOptions){const t=r[0],s="function"==typeof t.getRange&&t.getRange(i);if(s){const t=o(r,i,e-s),n=o(r,i,e+s);return{lo:t.lo,hi:n.hi}}}}return{lo:0,hi:r.length-1}}function ke(t,i,e,s,n){const r=t.getSortedVisibleDatasetMetas(),o=e[i];for(let t=0,e=r.length;t<e;++t){const{index:e,data:h}=r[t],{lo:a,hi:c}=_e(r[t],i,o,n);for(let t=a;t<=c;++t){const i=h[t];i.skip||s(i,e,t)}}}function Oe(t,i,e,s,n){const r=[];return n||t.isPointInArea(i)?(ke(t,e,i,(function(e,o,h){(n||ni(e,t.chartArea,0))&&e.inRange(i.x,i.y,s)&&r.push({element:e,datasetIndex:o,index:h})}),!0),r):r}function Se(t,i,e,s,n,r){return r||t.isPointInArea(i)?"r"!==e||s?function(t,i,e,s,n,r){let o=[];const h=function(t){const i=-1!==t.indexOf("x"),e=-1!==t.indexOf("y");return function(t,s){const n=i?Math.abs(t.x-s.x):0,r=e?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}}(e);let a=Number.POSITIVE_INFINITY;return ke(t,e,i,(function(e,c,l){const u=e.inRange(i.x,i.y,n);if(s&&!u)return;const f=e.getCenterPoint(n);if(!r&&!t.isPointInArea(f)&&!u)return;const d=h(i,f);d<a?(o=[{element:e,datasetIndex:c,index:l}],a=d):d===a&&o.push({element:e,datasetIndex:c,index:l})})),o}(t,i,e,s,n,r):function(t,i,e,s){let n=[];return ke(t,e,i,(function(t,e,r){const{startAngle:o,endAngle:h}=t.getProps(["startAngle","endAngle"],s),{angle:a}=function(t,i){const e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s);let r=Math.atan2(s,e);return r<-.5*at&&(r+=ct),{angle:r,distance:n}}(t,{x:i.x,y:i.y});_t(a,o,h)&&n.push({element:t,datasetIndex:e,index:r})})),n}(t,i,e,n):[]}function Ae(t,i,e,s,n){const r=[],o="x"===e?"inXRange":"inYRange";let h=!1;return ke(t,e,i,((t,s,a)=>{t[o]&&t[o](i[e],n)&&(r.push({element:t,datasetIndex:s,index:a}),h=h||t.inRange(i.x,i.y,n))})),s&&!h?[]:r}var De={modes:{index(t,i,e,s){const n=zi(i,t),r=e.axis||"x",o=e.includeInvisible||!1,h=e.intersect?Oe(t,n,r,s,o):Se(t,n,r,!1,s,o),a=[];return h.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const i=h[0].index,e=t.data[i];e&&!e.skip&&a.push({element:e,datasetIndex:t.index,index:i})})),a):[]},dataset(t,i,e,s){const n=zi(i,t),r=e.axis||"xy",o=e.includeInvisible||!1;let h=e.intersect?Oe(t,n,r,s,o):Se(t,n,r,!1,s,o);if(h.length>0){const i=h[0].datasetIndex,e=t.getDatasetMeta(i).data;h=[];for(let t=0;t<e.length;++t)h.push({element:e[t],datasetIndex:i,index:t})}return h},point:(t,i,e,s)=>Oe(t,zi(i,t),e.axis||"xy",s,e.includeInvisible||!1),nearest:(t,i,e,s)=>Se(t,zi(i,t),e.axis||"xy",e.intersect,s,e.includeInvisible||!1),x:(t,i,e,s)=>Ae(t,zi(i,t),"x",e.intersect,s),y:(t,i,e,s)=>Ae(t,zi(i,t),"y",e.intersect,s)}};const je=["left","top","right","bottom"];function Re(t,i){return t.filter((t=>t.pos===i))}function Ce(t,i){return t.filter((t=>-1===je.indexOf(t.pos)&&t.box.axis===i))}function Ee(t,i){return t.sort(((t,e)=>{const s=i?e:t,n=i?t:e;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Le(t,i,e,s){return Math.max(t[e],i[e])+Math.max(t[s],i[s])}function Pe(t,i){t.top=Math.max(t.top,i.top),t.left=Math.max(t.left,i.left),t.bottom=Math.max(t.bottom,i.bottom),t.right=Math.max(t.right,i.right)}function Te(t,i,e,s){const{pos:n,box:r}=e,o=t.maxPadding;if(!H(n)){e.size&&(t[n]-=e.size);const i=s[e.stack]||{size:0,count:1};i.size=Math.max(i.size,e.horizontal?r.height:r.width),e.size=i.size/i.count,t[n]+=e.size}r.getPadding&&Pe(o,r.getPadding());const h=Math.max(0,i.outerWidth-Le(o,t,"left","right")),a=Math.max(0,i.outerHeight-Le(o,t,"top","bottom")),c=h!==t.w,l=a!==t.h;return t.w=h,t.h=a,e.horizontal?{same:c,other:l}:{same:l,other:c}}function Ie(t,i){const e=i.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(i[t],e[t])})),s}(t?["left","right"]:["top","bottom"])}function Fe(t,i,e,s){const n=[];let r,o,h,a,c,l;for(r=0,o=t.length,c=0;r<o;++r){h=t[r],a=h.box,a.update(h.width||i.w,h.height||i.h,Ie(h.horizontal,i));const{same:o,other:u}=Te(i,e,h,s);c|=o&&n.length,l=l||u,a.fullSize||n.push(h)}return c&&Fe(n,i,e,s)||l}function Be(t,i,e,s,n){t.top=e,t.left=i,t.right=i+s,t.bottom=e+n,t.width=s,t.height=n}function Ne(t,i,e,s){const n=e.padding;let{x:r,y:o}=i;for(const h of t){const t=h.box,a=s[h.stack]||{placed:0,weight:1},c=h.stackWeight/a.weight||1;if(h.horizontal){const s=i.w*c,r=a.size||t.height;rt(a.start)&&(o=a.start),t.fullSize?Be(t,n.left,o,e.outerWidth-n.right-n.left,r):Be(t,i.left+a.placed,o,s,r),a.start=o,a.placed+=s,o=t.bottom}else{const s=i.h*c,o=a.size||t.width;rt(a.start)&&(r=a.start),t.fullSize?Be(t,r,n.top,o,e.outerHeight-n.bottom-n.top):Be(t,r,i.top+a.placed,o,s),a.start=r,a.placed+=s,r=t.right}}i.x=r,i.y=o}var We={addBox(t,i){t.boxes||(t.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t)}}]},t.boxes.push(i)},removeBox(t,i){const e=t.boxes?t.boxes.indexOf(i):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,i,e){i.fullSize=e.fullSize,i.position=e.position,i.weight=e.weight},update(t,i,e,s){if(!t)return;const n=mi(t.options.layout.padding),r=Math.max(i-n.width,0),o=Math.max(e-n.height,0),h=function(t){const i=function(t){const i=[];let e,s,n,r,o,h;for(e=0,s=(t||[]).length;e<s;++e)n=t[e],({position:r,options:{stack:o,stackWeight:h=1}}=n),i.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:h});return i}(t),e=Ee(i.filter((t=>t.box.fullSize)),!0),s=Ee(Re(i,"left"),!0),n=Ee(Re(i,"right")),r=Ee(Re(i,"top"),!0),o=Ee(Re(i,"bottom")),h=Ce(i,"x"),a=Ce(i,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(a).concat(o).concat(h),chartArea:Re(i,"chartArea"),vertical:s.concat(n).concat(a),horizontal:r.concat(o).concat(h)}}(t.boxes),a=h.vertical,c=h.horizontal;Z(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const l=a.reduce(((t,i)=>i.box.options&&!1===i.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:i,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/l,hBoxMaxHeight:o/2}),f=Object.assign({},n);Pe(f,mi(s));const d=Object.assign({maxPadding:f,w:r,h:o,x:n.left,y:n.top},n),b=function(t,i){const e=function(t){const i={};for(const e of t){const{stack:t,pos:s,stackWeight:n}=e;if(!t||!je.includes(s))continue;const r=i[t]||(i[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=n}return i}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=i;let r,o,h;for(r=0,o=t.length;r<o;++r){h=t[r];const{fullSize:o}=h.box,a=e[h.stack],c=a&&h.stackWeight/a.weight;h.horizontal?(h.width=c?c*s:o&&i.availableWidth,h.height=n):(h.width=s,h.height=c?c*n:o&&i.availableHeight)}return e}(a.concat(c),u);Fe(h.fullSize,d,u,b),Fe(a,d,u,b),Fe(c,d,u,b)&&Fe(a,d,u,b),function(t){const i=t.maxPadding;function e(e){const s=Math.max(i[e]-t[e],0);return t[e]+=s,s}t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}(d),Ne(h.leftAndTop,d,u,b),d.x+=d.w,d.y+=d.h,Ne(h.rightAndBottom,d,u,b),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},Z(h.chartArea,(i=>{const e=i.box;Object.assign(e,t.chartArea),e.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class ze{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,e){}removeEventListener(t,i,e){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,e,s){return i=Math.max(0,i||t.width),e=e||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):e)}}isAttached(t){return!0}updateConfig(t){}}class He extends ze{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $e="$chartjs",Ye={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ve=t=>null===t||""===t,Xe=!!Yi&&{passive:!0};function Ue(t,i,e){t&&t.canvas&&t.canvas.removeEventListener(i,e,Xe)}function Ze(t,i){for(const e of t)if(e===i||e.contains(i))return!0}function Ke(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Ze(e.addedNodes,s),i=i&&!Ze(e.removedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Qe(t,i,e){const s=t.canvas,n=new MutationObserver((t=>{let i=!1;for(const e of t)i=i||Ze(e.removedNodes,s),i=i&&!Ze(e.addedNodes,s);i&&e()}));return n.observe(document,{childList:!0,subtree:!0}),n}const qe=new Map;let Ge=0;function Je(){const t=window.devicePixelRatio;t!==Ge&&(Ge=t,qe.forEach(((i,e)=>{e.currentDevicePixelRatio!==t&&i()})))}function ts(t,i,e){const s=t.canvas,n=s&&Ii(s);if(!n)return;const r=Et(((t,i)=>{const s=n.clientWidth;e(t,i),s<n.clientWidth&&e()}),window),o=new ResizeObserver((t=>{const i=t[0],e=i.contentRect.width,s=i.contentRect.height;0===e&&0===s||r(e,s)}));return o.observe(n),function(t,i){qe.size||window.addEventListener("resize",Je),qe.set(t,i)}(t,r),o}function is(t,i,e){e&&e.disconnect(),"resize"===i&&function(t){qe.delete(t),qe.size||window.removeEventListener("resize",Je)}(t)}function es(t,i,e){const s=t.canvas,n=Et((i=>{null!==t.ctx&&e(function(t,i){const e=Ye[t.type]||t.type,{x:s,y:n}=zi(t,i);return{type:e,chart:i,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(i,t))}),t);return function(t,i,e){t&&t.addEventListener(i,e,Xe)}(s,i,n),n}class ss extends ze{acquireContext(t,i){const e=t&&t.getContext&&t.getContext("2d");return e&&e.canvas===t?(function(t,i){const e=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[$e]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ve(n)){const i=Vi(t,"width");void 0!==i&&(t.width=i)}if(Ve(s))if(""===t.style.height)t.height=t.width/(i||2);else{const i=Vi(t,"height");void 0!==i&&(t.height=i)}}(t,i),e):null}releaseContext(t){const i=t.canvas;if(!i[$e])return!1;const e=i[$e].initial;["height","width"].forEach((t=>{const s=e[t];W(s)?i.removeAttribute(t):i.setAttribute(t,s)}));const s=e.style||{};return Object.keys(s).forEach((t=>{i.style[t]=s[t]})),i.width=i.width,delete i[$e],!0}addEventListener(t,i,e){this.removeEventListener(t,i),(t.$proxies||(t.$proxies={}))[i]=({attach:Ke,detach:Qe,resize:ts}[i]||es)(t,i,e)}removeEventListener(t,i){const e=t.$proxies||(t.$proxies={}),s=e[i];s&&(({attach:is,detach:is,resize:is}[i]||Ue)(t,i,s),e[i]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,e,s){return function(t,i,e,s){const n=Bi(t),r=Wi(n,"margin"),o=Fi(n.maxWidth,t,"clientWidth")||lt,h=Fi(n.maxHeight,t,"clientHeight")||lt,a=function(t,i,e){let s,n;if(void 0===i||void 0===e){const r=t&&Ii(t);if(r){const t=r.getBoundingClientRect(),o=Bi(r),h=Wi(o,"border","width"),a=Wi(o,"padding");i=t.width-a.width-h.width,e=t.height-a.height-h.height,s=Fi(o.maxWidth,r,"clientWidth"),n=Fi(o.maxHeight,r,"clientHeight")}else i=t.clientWidth,e=t.clientHeight}return{width:i,height:e,maxWidth:s||lt,maxHeight:n||lt}}(t,i,e);let{width:c,height:l}=a;if("content-box"===n.boxSizing){const t=Wi(n,"border","width"),i=Wi(n,"padding");c-=i.width+t.width,l-=i.height+t.height}return c=Math.max(0,c-r.width),l=Math.max(0,s?c/s:l-r.height),c=Hi(Math.min(c,o,a.maxWidth)),l=Hi(Math.min(l,h,a.maxHeight)),c&&!l&&(l=Hi(c/2)),(void 0!==i||void 0!==e)&&s&&a.height&&l>a.height&&(l=a.height,c=Hi(Math.floor(l*s))),{width:c,height:l}}(t,i,e,s)}isAttached(t){const i=t&&Ii(t);return!(!i||!i.isConnected)}}class ns{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:i,y:e}=this.getProps(["x","y"],t);return{x:i,y:e}}hasValue(){return vt(this.x)&&vt(this.y)}getProps(t,i){const e=this.$animations;if(!i||!e)return this;const s={};return t.forEach((t=>{s[t]=e[t]&&e[t].active()?e[t]._to:this[t]})),s}}function rs(t,i,e,s,n){const r=V(s,0),o=Math.min(V(n,t.length),t.length);let h,a,c,l=0;for(e=Math.ceil(e),n&&(h=n-s,e=h/Math.floor(h/e)),c=r;c<0;)l++,c=Math.round(r+l*e);for(a=Math.max(r,0);a<o;a++)a===c&&(i.push(t[a]),l++,c=Math.round(r+l*e))}const os=(t,i,e)=>"top"===i||"left"===i?t[i]+e:t[i]-e,hs=(t,i)=>Math.min(i||t,t);function as(t,i){const e=[],s=t.length/i,n=t.length;let r=0;for(;r<n;r+=s)e.push(t[Math.floor(r)]);return e}function cs(t,i,e){const s=t.ticks.length,n=Math.min(i,s-1),r=t._startPixel,o=t._endPixel,h=1e-6;let a,c=t.getPixelForTick(n);if(!(e&&(a=1===s?Math.max(c-r,o-c):0===i?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(n-1))/2,c+=n<i?a:-a,c<r-h||c>o+h)))return c}function ls(t){return t.drawTicks?t.tickLength:0}function us(t,i){if(!t.display)return 0;const e=xi(t.font,i),s=mi(t.padding);return(z(t.text)?t.text.length:1)*e.lineHeight+s.height}function fs(t,i,e){let s=Lt(t);return(e&&"right"!==i||!e&&"right"===i)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class ds extends ns{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:e,_suggestedMax:s}=this;return t=Y(t,Number.POSITIVE_INFINITY),i=Y(i,Number.NEGATIVE_INFINITY),e=Y(e,Number.POSITIVE_INFINITY),s=Y(s,Number.NEGATIVE_INFINITY),{min:Y(t,e),max:Y(i,s),minDefined:$(t),maxDefined:$(i)}}getMinMax(t){let i,{min:e,max:s,minDefined:n,maxDefined:r}=this.getUserBounds();if(n&&r)return{min:e,max:s};const o=this.getMatchingVisibleMetas();for(let h=0,a=o.length;h<a;++h)i=o[h].controller.getMinMax(this,t),n||(e=Math.min(e,i.min)),r||(s=Math.max(s,i.max));return e=r&&e>s?s:e,s=n&&e>s?e:s,{min:Y(e,Y(s,e)),max:Y(s,Y(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){U(this.options.beforeUpdate,[this])}update(t,i,e){const{beginAtZero:s,grace:n,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=e=Object.assign({left:0,right:0,top:0,bottom:0},e),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+e.left+e.right:this.height+e.top+e.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,i,e){const{min:s,max:n}=t,r=X(i,(n-s)/2),o=(t,i)=>e&&0===t?0:t+i;return{min:o(s,-Math.abs(r)),max:o(n,r)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const h=o<this.ticks.length;this._convertTicksToLabels(h?as(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,i){const e=t.options.ticks,s=function(t){const i=t.options.offset,e=t._tickSize();return Math.floor(Math.min(t._length/e+(i?0:1),t._maxLength/e))}(t),n=Math.min(e.maxTicksLimit||s,s),r=e.major.enabled?function(t){const i=[];let e,s;for(e=0,s=t.length;e<s;e++)t[e].major&&i.push(e);return i}(i):[],o=r.length,h=r[0],a=r[o-1],c=[];if(o>n)return function(t,i,e,s){let n,r=0,o=e[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(i.push(t[n]),r++,o=e[r*s])}(i,c,r,o/n),c;const l=function(t,i,e){const s=function(t){const i=t.length;let e,s;if(i<2)return!1;for(s=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==s)return!1;return s}(t),n=i.length/e;if(!s)return Math.max(n,1);const r=function(t){const i=[],e=Math.sqrt(t);let s;for(s=1;s<e;s++)t%s==0&&(i.push(s),i.push(t/s));return e===(0|e)&&i.push(e),i.sort(((t,i)=>t-i)).pop(),i}(s);for(let t=0,i=r.length-1;t<i;t++){const i=r[t];if(i>n)return i}return Math.max(n,1)}(r,i,n);if(o>0){let t,e;const s=o>1?Math.round((a-h)/(o-1)):null;for(rs(i,c,l,W(s)?0:h-s,h),t=0,e=o-1;t<e;t++)rs(i,c,l,r[t],r[t+1]);return rs(i,c,l,a,W(s)?i.length:a+s),c}return rs(i,c,l),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),h&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,i,e=this.options.reverse;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){U(this.options.afterUpdate,[this])}beforeSetDimensions(){U(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){U(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),U(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){U(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e],n.label=U(i.callback,[n.value,e,t],this)}afterTickToLabelConversion(){U(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){U(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,e=hs(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,n=i.maxRotation;let r,o,h,a=s;if(!this._isVisible()||!i.display||s>=n||e<=1||!this.isHorizontal())return void(this.labelRotation=s);const c=this._getLabelSizes(),l=c.widest.width,u=c.highest.height,f=kt(this.chart.width-l,0,this.maxWidth);r=t.offset?this.maxWidth/e:f/(e-1),l+6>r&&(r=f/(e-(t.offset?.5:1)),o=this.maxHeight-ls(t.grid)-i.padding-us(t.title,this.chart.options.font),h=Math.sqrt(l*l+u*u),a=Math.min(Math.asin(kt((c.highest.height+6)/r,-1,1)),Math.asin(kt(o/h,-1,1))-Math.asin(kt(u/h,-1,1)))*(180/at),a=Math.max(s,Math.min(n,a))),this.labelRotation=a}afterCalculateLabelRotation(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:e,title:s,grid:n}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=us(s,i.options.font);if(o?(t.width=this.maxWidth,t.height=ls(n)+r):(t.height=this.maxHeight,t.width=ls(n)+r),e.display&&this.ticks.length){const{first:i,last:s,widest:n,highest:r}=this._getLabelSizes(),h=2*e.padding,a=yt(this.labelRotation),c=Math.cos(a),l=Math.sin(a);o?t.height=Math.min(this.maxHeight,t.height+(e.mirror?0:l*n.width+c*r.height)+h):t.width=Math.min(this.maxWidth,t.width+(e.mirror?0:c*n.width+l*r.height)+h),this._calculatePadding(i,s,l,c)}}this._handleMargins(),o?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,e,s){const{ticks:{align:n,padding:r},position:o}=this.options,h=0!==this.labelRotation,a="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let l=0,u=0;h?a?(l=s*t.width,u=e*i.height):(l=e*t.height,u=s*i.width):"start"===n?u=i.width:"end"===n?l=t.width:"inner"!==n&&(l=t.width/2,u=i.width/2),this.paddingLeft=Math.max((l-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-c+r)*this.width/(this.width-c),0)}else{let e=i.height/2,s=t.height/2;"start"===n?(e=0,s=t.height):"end"===n&&(e=i.height,s=0),this.paddingTop=e+r,this.paddingBottom=s+r}}_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(){U(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return"top"===i||"bottom"===i||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let i,e;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),i=0,e=t.length;i<e;i++)W(t[i].label)&&(t.splice(i,1),e--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let e=this.ticks;i<e.length&&(e=as(e,i)),this._labelSizes=t=this._computeLabelSizes(e,e.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,e){const{ctx:s,_longestTextCache:n}=this,r=[],o=[],h=Math.floor(i/hs(i,e));let a,c,l,u,f,d,b,g,p,m,x,v=0,y=0;for(a=0;a<i;a+=h){if(u=t[a].label,f=this._resolveTickFontOptions(a),s.font=d=f.string,b=n[d]=n[d]||{data:{},gc:[]},g=f.lineHeight,p=m=0,W(u)||z(u)){if(z(u))for(c=0,l=u.length;c<l;++c)x=u[c],W(x)||z(x)||(p=Jt(s,b.data,b.gc,p,x),m+=g)}else p=Jt(s,b.data,b.gc,p,u),m=g;r.push(p),o.push(m),v=Math.max(p,v),y=Math.max(m,y)}!function(t,i){Z(t,(t=>{const e=t.gc,s=e.length/2;let n;if(s>i){for(n=0;n<s;++n)delete t.data[e[n]];e.splice(0,s)}}))}(n,i);const M=r.indexOf(v),w=o.indexOf(y),_=t=>({width:r[t]||0,height:o[t]||0});return{first:_(0),last:_(i-1),widest:_(M),highest:_(w),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return kt(this._alignToPixels?ti(this.chart,i,0):i,-32768,32767)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const e=i[t];return e.$context||(e.$context=function(t,i,e){return yi(t,{tick:e,index:i,type:"tick"})}(this.getContext(),t,e))}return this.$context||(this.$context=yi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,i=yt(this.labelRotation),e=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),n=this._getLabelSizes(),r=t.autoSkipPadding||0,o=n?n.widest.width+r:0,h=n?n.highest.height+r:0;return this.isHorizontal()?h*e>o*s?o/e:h/s:h*s<o*e?h/e:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,e=this.chart,s=this.options,{grid:n,position:r,border:o}=s,h=n.offset,a=this.isHorizontal(),c=this.ticks.length+(h?1:0),l=ls(n),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,b=d/2,g=function(t){return ti(e,t,d)};let p,m,x,v,y,M,w,_,k,O,S,A;if("top"===r)p=g(this.bottom),M=this.bottom-l,_=p-b,O=g(t.top)+b,A=t.bottom;else if("bottom"===r)p=g(this.top),O=t.top,A=g(t.bottom)-b,M=p+b,_=this.top+l;else if("left"===r)p=g(this.right),y=this.right-l,w=p-b,k=g(t.left)+b,S=t.right;else if("right"===r)p=g(this.left),k=t.left,S=g(t.right)-b,y=p+b,w=this.left+l;else if("x"===i){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(H(r)){const t=Object.keys(r)[0];p=g(this.chart.scales[t].getPixelForValue(r[t]))}O=t.top,A=t.bottom,M=p+b,_=M+l}else if("y"===i){if("center"===r)p=g((t.left+t.right)/2);else if(H(r)){const t=Object.keys(r)[0];p=g(this.chart.scales[t].getPixelForValue(r[t]))}y=p-b,w=y-l,k=t.left,S=t.right}const D=V(s.ticks.maxTicksLimit,c),j=Math.max(1,Math.ceil(c/D));for(m=0;m<c;m+=j){const t=this.getContext(m),i=n.setContext(t),s=o.setContext(t),r=i.lineWidth,c=i.color,l=s.dash||[],f=s.dashOffset,d=i.tickWidth,b=i.tickColor,g=i.tickBorderDash||[],p=i.tickBorderDashOffset;x=cs(this,m,h),void 0!==x&&(v=ti(e,x,r),a?y=w=k=S=v:M=_=O=A=v,u.push({tx1:y,ty1:M,tx2:w,ty2:_,x1:k,y1:O,x2:S,y2:A,width:r,color:c,borderDash:l,borderDashOffset:f,tickWidth:d,tickColor:b,tickBorderDash:g,tickBorderDashOffset:p}))}return this._ticksLength=c,this._borderValue=p,u}_computeLabelItems(t){const i=this.axis,e=this.options,{position:s,ticks:n}=e,r=this.isHorizontal(),o=this.ticks,{align:h,crossAlign:a,padding:c,mirror:l}=n,u=ls(e.grid),f=u+c,d=l?-c:f,b=-yt(this.labelRotation),g=[];let p,m,x,v,y,M,w,_,k,O,S,A,D="middle";if("top"===s)M=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===s)M=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,y=t.x}else if("x"===i){if("center"===s)M=(t.top+t.bottom)/2+f;else if(H(s)){const t=Object.keys(s)[0];M=this.chart.scales[t].getPixelForValue(s[t])+f}w=this._getXAxisLabelAlignment()}else if("y"===i){if("center"===s)y=(t.left+t.right)/2-f;else if(H(s)){const t=Object.keys(s)[0];y=this.chart.scales[t].getPixelForValue(s[t])}w=this._getYAxisLabelAlignment(u).textAlign}"y"===i&&("start"===h?D="top":"end"===h&&(D="bottom"));const j=this._getLabelSizes();for(p=0,m=o.length;p<m;++p){x=o[p],v=x.label;const t=n.setContext(this.getContext(p));_=this.getPixelForTick(p)+n.labelOffset,k=this._resolveTickFontOptions(p),O=k.lineHeight,S=z(v)?v.length:1;const i=S/2,e=t.color,h=t.textStrokeColor,c=t.textStrokeWidth;let u,f=w;if(r?(y=_,"inner"===w&&(f=p===m-1?this.options.reverse?"left":"right":0===p?this.options.reverse?"right":"left":"center"),A="top"===s?"near"===a||0!==b?-S*O+O/2:"center"===a?-j.highest.height/2-i*O+O:O/2-j.highest.height:"near"===a||0!==b?O/2:"center"===a?j.highest.height/2-i*O:j.highest.height-S*O,l&&(A*=-1),0===b||t.showLabelBackdrop||(y+=O/2*Math.sin(b))):(M=_,A=(1-S)*O/2),t.showLabelBackdrop){const i=mi(t.backdropPadding),e=j.heights[p],s=j.widths[p];let n=A-i.top,r=0-i.left;switch(D){case"middle":n-=e/2;break;case"bottom":n-=e}switch(w){case"center":r-=s/2;break;case"right":r-=s;break;case"inner":p===m-1?r-=s:p>0&&(r-=s/2)}u={left:r,top:n,width:s+i.width,height:e+i.height,color:t.backdropColor}}g.push({label:v,font:k,textOffset:A,options:{rotation:b,color:e,strokeColor:h,strokeWidth:c,textAlign:f,textBaseline:D,translation:[y,M],backdrop:u}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-yt(this.labelRotation))return"top"===t?"left":"right";let e="center";return"start"===i.align?e="left":"end"===i.align?e="right":"inner"===i.align&&(e="inner"),e}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:e,mirror:s,padding:n}}=this.options,r=t+n,o=this._getLabelSizes().widest.width;let h,a;return"left"===i?s?(a=this.right+n,"near"===e?h="left":"center"===e?(h="center",a+=o/2):(h="right",a+=o)):(a=this.right-r,"near"===e?h="right":"center"===e?(h="center",a-=o/2):(h="left",a=this.left)):"right"===i?s?(a=this.left+n,"near"===e?h="right":"center"===e?(h="center",a-=o/2):(h="left",a-=o)):(a=this.left+r,"near"===e?h="left":"center"===e?(h="center",a+=o/2):(h="right",a=this.right)):h="right",{textAlign:h,x:a}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;return"left"===i||"right"===i?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===i||"bottom"===i?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:e,top:s,width:n,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(e,s,n,r),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const e=this.ticks.findIndex((i=>i.value===t));return e>=0?i.setContext(this.getContext(e)).lineWidth:0}drawGrid(t){const i=this.options.grid,e=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,r;const o=(t,i,s)=>{s.width&&s.color&&(e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),e.stroke(),e.restore())};if(i.display)for(n=0,r=s.length;n<r;++n){const t=s[n];i.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),i.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:e,grid:s}}=this,n=e.setContext(this.getContext()),r=e.display?n.width:0;if(!r)return;const o=s.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let a,c,l,u;this.isHorizontal()?(a=ti(t,this.left,r)-r/2,c=ti(t,this.right,o)+o/2,l=u=h):(l=ti(t,this.top,r)-r/2,u=ti(t,this.bottom,o)+o/2,a=c=h),i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.beginPath(),i.moveTo(a,l),i.lineTo(c,u),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,e=this._computeLabelArea();e&&ri(i,e);const s=this.getLabelItems(t);for(const t of s)ci(i,t.label,0,t.textOffset,t.font,t.options);e&&oi(i)}drawTitle(){const{ctx:t,options:{position:i,title:e,reverse:s}}=this;if(!e.display)return;const n=xi(e.font),r=mi(e.padding),o=e.align;let h=n.lineHeight/2;"bottom"===i||"center"===i||H(i)?(h+=r.bottom,z(e.text)&&(h+=n.lineHeight*(e.text.length-1))):h+=r.top;const{titleX:a,titleY:c,maxWidth:l,rotation:u}=function(t,i,e,s){const{top:n,left:r,bottom:o,right:h,chart:a}=t,{chartArea:c,scales:l}=a;let u,f,d,b=0;const g=o-n,p=h-r;if(t.isHorizontal()){if(f=Pt(s,r,h),H(e)){const t=Object.keys(e)[0];d=l[t].getPixelForValue(e[t])+g-i}else d="center"===e?(c.bottom+c.top)/2+g-i:os(t,e,i);u=h-r}else{if(H(e)){const t=Object.keys(e)[0];f=l[t].getPixelForValue(e[t])-p+i}else f="center"===e?(c.left+c.right)/2-p+i:os(t,e,i);d=Pt(s,o,n),b="left"===e?-ft:ft}return{titleX:f,titleY:d,maxWidth:u,rotation:b}}(this,h,i,o);ci(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:u,textAlign:fs(o,i,s),textBaseline:"middle",translation:[a,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,e=V(t.grid&&t.grid.z,-1),s=V(t.border&&t.border.z,0);return this._isVisible()&&this.draw===ds.prototype.draw?[{z:e,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:t=>{this.drawLabels(t)}}]:[{z:i,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),e=this.axis+"AxisID",s=[];let n,r;for(n=0,r=i.length;n<r;++n){const r=i[n];r[e]!==this.id||t&&r.type!==t||s.push(r)}return s}_resolveTickFontOptions(t){return xi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bs{constructor(t,i,e){this.type=t,this.scope=i,this.override=e,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let e;(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));const s=this.items,n=t.id,r=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,i,e){const s=J(Object.create(null),[e?Gt.get(e):{},Gt.get(i),t.defaults]);Gt.set(i,s),t.defaultRoutes&&function(t,i){Object.keys(i).forEach((e=>{const s=e.split("."),n=s.pop(),r=[t].concat(s).join("."),o=i[e].split("."),h=o.pop(),a=o.join(".");Gt.route(r,n,a,h)}))}(i,t.defaultRoutes),t.descriptors&&Gt.describe(i,t.descriptors)}(t,r,e),this.override&&Gt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const i=this.items,e=t.id,s=this.scope;e in i&&delete i[e],s&&e in Gt[s]&&(delete Gt[s][e],this.override&&delete Ut[e])}}class gs{constructor(){this.controllers=new bs(de,"datasets",!0),this.elements=new bs(ns,"elements"),this.plugins=new bs(Object,"plugins"),this.scales=new bs(ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,e){[...i].forEach((i=>{const s=e||this._getRegistryForType(i);e||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Z(i,(i=>{const s=e||this._getRegistryForType(i);this._exec(t,s,i)}))}))}_exec(t,i,e){const s=nt(t);U(e["before"+s],[],e),i[t](e),U(e["after"+s],[],e)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const e=this._typedRegistries[i];if(e.isForType(t))return e}return this.plugins}_get(t,i,e){const s=i.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+e+".");return s}}var ps=new gs;class ms{constructor(){this._init=void 0}notify(t,i,e,s){if("beforeInit"===i&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const n=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(n,t,i,e);return"afterDestroy"===i&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,i,e,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===U(t[e],[i,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const e=t&&t.config,s=V(e.options&&e.options.plugins,{}),n=function(t){const i={},e=[],s=Object.keys(ps.plugins.items);for(let t=0;t<s.length;t++)e.push(ps.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===e.indexOf(s)&&(e.push(s),i[s.id]=!0)}return{plugins:e,localIds:i}}(e);return!1!==s||i?function(t,{plugins:i,localIds:e},s,n){const r=[],o=t.getContext();for(const h of i){const i=h.id,a=xs(s[i],n);null!==a&&r.push({plugin:h,options:vs(t.config,{plugin:h,local:e[i]},a,o)})}return r}(t,n,s,i):[]}_notifyStateChanges(t){const i=this._oldCache||[],e=this._cache,s=(t,i)=>t.filter((t=>!i.some((i=>t.plugin.id===i.plugin.id))));this._notify(s(i,e),t,"stop"),this._notify(s(e,i),t,"start")}}function xs(t,i){return i||!1!==t?!0===t?{}:t:null}function vs(t,{plugin:i,local:e},s,n){const r=t.pluginScopeKeys(i),o=t.getOptionScopes(s,r);return e&&i.defaults&&o.push(i.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ys(t,i){return((i.datasets||{})[t]||{}).indexAxis||i.indexAxis||(Gt.datasets[t]||{}).indexAxis||"x"}function Ms(t){if("x"===t||"y"===t||"r"===t)return t}function ws(t,...i){if(Ms(t))return t;for(const s of i){const i=s.axis||("top"===(e=s.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.length>1&&Ms(t[0].toLowerCase());if(i)return i}var e;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function _s(t,i,e){if(e[i+"AxisID"]===t)return{axis:i}}function ks(t){const i=t.options||(t.options={});i.plugins=V(i.plugins,{}),i.scales=function(t,i){const e=Ut[t.type]||{scales:{}},s=i.scales||{},n=ys(t.type,i),r=Object.create(null);return Object.keys(s).forEach((i=>{const o=s[i];if(!H(o))return console.error(`Invalid scale configuration for scale: ${i}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const h=ws(i,o,function(t,i){if(i.data&&i.data.datasets){const e=i.data.datasets.filter((i=>i.xAxisID===t||i.yAxisID===t));if(e.length)return _s(t,"x",e[0])||_s(t,"y",e[0])}return{}}(i,t),Gt.scales[o.type]),a=function(t,i){return t===i?"_index_":"_value_"}(h,n),c=e.scales||{};r[i]=tt(Object.create(null),[{axis:h},o,c[h],c[a]])})),t.data.datasets.forEach((e=>{const n=e.type||t.type,o=e.indexAxis||ys(n,i),h=(Ut[n]||{}).scales||{};Object.keys(h).forEach((t=>{const i=function(t,i){let e=t;return"_index_"===t?e=i:"_value_"===t&&(e="x"===i?"y":"x"),e}(t,o),n=e[i+"AxisID"]||i;r[n]=r[n]||Object.create(null),tt(r[n],[{axis:i},s[n],h[t]])}))})),Object.keys(r).forEach((t=>{const i=r[t];tt(i,[Gt.scales[i.type],Gt.scale])})),r}(t,i)}function Os(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Ss=new Map,As=new Set;function Ds(t,i){let e=Ss.get(t);return e||(e=i(),Ss.set(t,e),As.add(e)),e}const js=(t,i,e)=>{const s=st(i,e);void 0!==s&&t.add(s)};class Rs{constructor(t){this._config=function(t){return(t=t||{}).data=Os(t.data),ks(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Os(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ks(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ds(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,i){return Ds(`${t}.transition.${i}`,(()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,i){return Ds(`${t}-${i}`,(()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]]))}pluginScopeKeys(t){const i=t.id;return Ds(`${this.type}-plugin-${i}`,(()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,i){const e=this._scopeCache;let s=e.get(t);return s&&!i||(s=new Map,e.set(t,s)),s}getOptionScopes(t,i,e){const{options:s,type:n}=this,r=this._cachedScopes(t,e),o=r.get(i);if(o)return o;const h=new Set;i.forEach((i=>{t&&(h.add(t),i.forEach((i=>js(h,t,i)))),i.forEach((t=>js(h,s,t))),i.forEach((t=>js(h,Ut[n]||{},t))),i.forEach((t=>js(h,Gt,t))),i.forEach((t=>js(h,Zt,t)))}));const a=Array.from(h);return 0===a.length&&a.push(Object.create(null)),As.has(i)&&r.set(i,a),a}chartOptionScopes(){const{options:t,type:i}=this;return[t,Ut[i]||{},Gt.datasets[i]||{},{type:i},Gt,Zt]}resolveNamedOptions(t,i,e,s=[""]){const n={$shared:!0},{resolver:r,subPrefixes:o}=Cs(this._resolverCache,t,s);let h=r;(function(t,i){const{isScriptable:e,isIndexable:s}=_i(t);for(const n of i){const i=e(n),r=s(n),o=(r||i)&&t[n];if(i&&(ot(o)||Es(o))||r&&z(o))return!0}return!1})(r,i)&&(n.$shared=!1,h=wi(r,e=ot(e)?e():e,this.createResolver(t,e,o)));for(const t of i)n[t]=h[t];return n}createResolver(t,i,e=[""],s){const{resolver:n}=Cs(this._resolverCache,t,e);return H(i)?wi(n,i,void 0,s):n}}function Cs(t,i,e){let s=t.get(i);s||(s=new Map,t.set(i,s));const n=e.join();let r=s.get(n);return r||(r={resolver:Mi(i,e),subPrefixes:e.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,r)),r}const Es=t=>H(t)&&Object.getOwnPropertyNames(t).some((i=>ot(t[i]))),Ls=["top","bottom","left","right","chartArea"];function Ps(t,i){return"top"===t||"bottom"===t||-1===Ls.indexOf(t)&&"x"===i}function Ts(t,i){return function(e,s){return e[t]===s[t]?e[i]-s[i]:e[t]-s[t]}}function Is(t){const i=t.chart,e=i.options.animation;i.notifyPlugins("afterRender"),U(e&&e.onComplete,[t],i)}function Fs(t){const i=t.chart,e=i.options.animation;U(e&&e.onProgress,[t],i)}function Bs(t){return Ti()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ns={},Ws=t=>{const i=Bs(t);return Object.values(Ns).filter((t=>t.canvas===i)).pop()};function zs(t,i,e){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=i){const r=t[n];delete t[n],(e>0||s>i)&&(t[s+e]=r)}}}class Hs{static defaults=Gt;static instances=Ns;static overrides=Ut;static registry=ps;static version="4.5.1";static getChart=Ws;static register(...t){ps.add(...t),$s()}static unregister(...t){ps.remove(...t),$s()}constructor(t,i){const e=this.config=new Rs(i),s=Bs(t),n=Ws(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const r=e.createResolver(e.chartOptionScopes(),this.getContext());this.platform=new(e.platform||function(t){return!Ti()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?He:ss}(s)),this.platform.updateConfig(e);const o=this.platform.acquireContext(s,r.aspectRatio),h=o&&o.canvas,a=h&&h.height,c=h&&h.width;this.id=N(),this.ctx=o,this.canvas=h,this.width=c,this.height=a,this._options=r,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 ms,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,i){let e;return function(...s){return i?(clearTimeout(e),e=setTimeout(t,i,s)):t.apply(this,s),i}}((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],Ns[this.id]=this,o&&h?(qi.listen(this,"complete",Is),qi.listen(this,"progress",Fs),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:e,height:s,_aspectRatio:n}=this;return W(t)?i&&n?n:s?e/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ps}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():$i(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ii(this.canvas,this.ctx),this}stop(){return qi.stop(this),this}resize(t,i){qi.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const e=this.options,s=this.platform.getMaximumSize(this.canvas,t,i,e.maintainAspectRatio&&this.aspectRatio),n=e.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,$i(this,n,!0)&&(this.notifyPlugins("resize",{size:s}),U(e.onResize,[this,s],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){Z(this.options.scales||{},((t,i)=>{t.id=i}))}buildOrUpdateScales(){const t=this.options,i=t.scales,e=this.scales,s=Object.keys(e).reduce(((t,i)=>(t[i]=!1,t)),{});let n=[];i&&(n=n.concat(Object.keys(i).map((t=>{const e=i[t],s=ws(t,e),n="r"===s,r="x"===s;return{options:e,dposition:n?"chartArea":r?"bottom":"left",dtype:n?"radialLinear":r?"category":"linear"}})))),Z(n,(i=>{const n=i.options,r=n.id,o=ws(r,n),h=V(n.type,i.dtype);void 0!==n.position&&Ps(n.position,o)===Ps(i.dposition)||(n.position=i.dposition),s[r]=!0;let a=null;r in e&&e[r].type===h?a=e[r]:(a=new(ps.getScale(h))({id:r,type:h,ctx:this.ctx,chart:this}),e[a.id]=a),a.init(n,t)})),Z(s,((t,i)=>{t||delete e[i]})),Z(e,(t=>{We.configure(this,t,t.options),We.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,e=t.length;if(t.sort(((t,i)=>t.index-i.index)),e>i){for(let t=i;t<e;++t)this._destroyDatasetMeta(t);t.splice(i,e-i)}this._sortedMetasets=t.slice(0).sort(Ts("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach(((t,e)=>{0===i.filter((i=>i===t._dataset)).length&&this._destroyDatasetMeta(e)}))}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let e,s;for(this._removeUnreferencedMetasets(),e=0,s=i.length;e<s;e++){const s=i[e];let n=this.getDatasetMeta(e);const r=s.type||this.config.type;if(n.type&&n.type!==r&&(this._destroyDatasetMeta(e),n=this.getDatasetMeta(e)),n.type=r,n.indexAxis=s.indexAxis||ys(r,this.options),n.order=s.order||0,n.index=e,n.label=""+s.label,n.visible=this.isDatasetVisible(e),n.controller)n.controller.updateIndex(e),n.controller.linkScales();else{const i=ps.getController(r),{datasetElementType:s,dataElementType:o}=Gt.datasets[r];Object.assign(i,{dataElementType:ps.getElement(o),datasetElementType:s&&ps.getElement(s)}),n.controller=new i(this,e),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){Z(this.data.datasets,((t,i)=>{this.getDatasetMeta(i).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const e=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!e.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,i=this.data.datasets.length;t<i;t++){const{controller:i}=this.getDatasetMeta(t),e=!s&&-1===n.indexOf(i);i.buildOrUpdateElements(e),r=Math.max(+i.getMaxOverflow(),r)}r=this._minPadding=e.layout.autoPadding?r:0,this._updateLayout(r),s||Z(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ts("z","_idx"));const{_active:o,_lastEvent:h}=this;h?this._eventHandler(h,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Z(this.scales,(t=>{We.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),e=new Set(t.events);ht(i,e)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:e,start:s,count:n}of i)zs(t,s,"_removeElements"===e?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,e=i=>new Set(t.filter((t=>t[0]===i)).map(((t,i)=>i+","+t.splice(1).join(",")))),s=e(0);for(let t=1;t<i;t++)if(!ht(s,e(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;We.update(this,this.width,this.height,t);const i=this.chartArea,e=i.width<=0||i.height<=0;this._layers=[],Z(this.boxes,(t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,i)=>{t._idx=i})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let i=0,e=this.data.datasets.length;i<e;++i)this._updateDataset(i,ot(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const e=this.getDatasetMeta(t),s={meta:e,index:t,mode:i,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(e.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(qi.has(this)?this.attached&&!qi.running(this)&&qi.start(this):(this.draw(),Is({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,i)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,e=[];let s,n;for(s=0,n=i.length;s<n;++s){const n=i[s];t&&!n.visible||e.push(n)}return e}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,e={meta:t,index:t.index,cancelable:!0},s=function(t,i){const e=i._clip;if(e.disabled)return!1;const s=function(t,i){const{xScale:e,yScale:s}=t;return e&&s?{left:Ki(e,i,"left"),right:Ki(e,i,"right"),top:Ki(s,i,"top"),bottom:Ki(s,i,"bottom")}:i}(i,t.chartArea);return{left:!1===e.left?0:s.left-(!0===e.left?0:e.left),right:!1===e.right?t.width:s.right+(!0===e.right?0:e.right),top:!1===e.top?0:s.top-(!0===e.top?0:e.top),bottom:!1===e.bottom?t.height:s.bottom+(!0===e.bottom?0:e.bottom)}}(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",e)&&(s&&ri(i,s),t.controller.draw(),s&&oi(i),e.cancelable=!1,this.notifyPlugins("afterDatasetDraw",e))}isPointInArea(t){return ni(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,e,s){const n=De.modes[i];return"function"==typeof n?n(this,t,e,s):[]}getDatasetMeta(t){const i=this.data.datasets[t],e=this._metasets;let s=e.filter((t=>t&&t._dataset===i)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},e.push(s)),s}getContext(){return this.$context||(this.$context=yi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!i.hidden}setDatasetVisibility(t,i){this.getDatasetMeta(t).hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,e){const s=e?"show":"hide",n=this.getDatasetMeta(t),r=n.controller._resolveAnimations(void 0,s);rt(i)?(n.data[i].hidden=!e,this.update()):(this.setDatasetVisibility(t,e),r.update(n,{visible:e}),this.update((i=>i.datasetIndex===t?s:void 0)))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),qi.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ii(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete Ns[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(t,i,e)=>{t.offsetX=i,t.offsetY=e,this._eventHandler(t)};Z(this.options.events,(t=>e(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,e=(e,s)=>{i.addEventListener(this,e,s),t[e]=s},s=(e,s)=>{t[e]&&(i.removeEventListener(this,e,s),delete t[e])},n=(t,i)=>{this.canvas&&this.resize(t,i)};let r;const o=()=>{s("attach",o),this.attached=!0,this.resize(),e("resize",n),e("detach",r)};r=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),e("attach",o)},i.isAttached(this.canvas)?o():r()}unbindEvents(){Z(this._listeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._listeners={},Z(this._responsiveListeners,((t,i)=>{this.platform.removeEventListener(this,i,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,i,e){const s=e?"set":"remove";let n,r,o,h;for("dataset"===i&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,h=t.length;o<h;++o){r=t[o];const i=r&&this.getDatasetMeta(r.datasetIndex).controller;i&&i[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],e=t.map((({datasetIndex:t,index:i})=>{const e=this.getDatasetMeta(t);if(!e)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:e.data[i],index:i}}));!K(e,i)&&(this._active=e,this._lastEvent=null,this._updateHoverStyles(e,i))}notifyPlugins(t,i,e){return this._plugins.notify(this,t,i,e)}isPluginEnabled(t){return 1===this._plugins._cache.filter((i=>i.plugin.id===t)).length}_updateHoverStyles(t,i,e){const s=this.options.hover,n=(t,i)=>t.filter((t=>!i.some((i=>t.datasetIndex===i.datasetIndex&&t.index===i.index)))),r=n(i,t),o=e?t:n(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,i){const e={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",e,s))return;const n=this._handleEvent(t,i,e.inChartArea);return e.cancelable=!1,this.notifyPlugins("afterEvent",e,s),(n||e.changed)&&this.render(),this}_handleEvent(t,i,e){const{_active:s=[],options:n}=this,r=this._getActiveElements(t,s,e,i),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,i,e,s){return e&&"mouseout"!==t.type?s?i:t:null}(t,this._lastEvent,e,o);e&&(this._lastEvent=null,U(n.onHover,[t,r,this],this),o&&U(n.onClick,[t,r,this],this));const a=!K(r,s);return(a||i)&&(this._active=r,this._updateHoverStyles(r,s,i)),this._lastEvent=h,a}_getActiveElements(t,i,e,s){if("mouseout"===t.type)return[];if(!e)return i;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function $s(){return Z(Hs.instances,(t=>t._plugins.invalidate()))}function Ys(t,i){const{x:e,y:s,base:n,width:r,height:o}=t.getProps(["x","y","base","width","height"],i);let h,a,c,l,u;return t.horizontal?(u=o/2,h=Math.min(e,n),a=Math.max(e,n),c=s-u,l=s+u):(u=r/2,h=e-u,a=e+u,c=Math.min(s,n),l=Math.max(s,n)),{left:h,top:c,right:a,bottom:l}}function Vs(t,i,e,s){return t?0:kt(i,e,s)}function Xs(t,i,e,s){const n=null===i,r=null===e,o=t&&!(n&&r)&&Ys(t,s);return o&&(n||Ot(i,o.left,o.right))&&(r||Ot(e,o.top,o.bottom))}function Us(t,i){t.rect(i.x,i.y,i.w,i.h)}function Zs(t,i,e={}){const s=t.x!==e.x?-i:0,n=t.y!==e.y?-i:0;return{x:t.x+s,y:t.y+n,w:t.w+((t.x+t.w!==e.x+e.w?i:0)-s),h:t.h+((t.y+t.h!==e.y+e.h?i:0)-n),radius:t.radius}}const Ks=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Qs=Ks.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function qs(t){return Ks[t%Ks.length]}function Gs(t){return Qs[t%Qs.length]}function Js(t){let i;for(i in t)if(t[i].borderColor||t[i].backgroundColor)return!0;return!1}var tn={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,i,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:r}=n,o=Js(s)||(h=n)&&(h.borderColor||h.backgroundColor)||r&&Js(r)||"rgba(0,0,0,0.1)"!==Gt.borderColor||"rgba(0,0,0,0.1)"!==Gt.backgroundColor;var h;if(!e.forceOverride&&o)return;const a=function(t){let i=0;return(e,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Me?i=function(t,i){return t.backgroundColor=t.data.map((()=>qs(i++))),i}(e,i):n instanceof we?i=function(t,i){return t.backgroundColor=t.data.map((()=>Gs(i++))),i}(e,i):n&&(i=function(t,i){return t.borderColor=qs(i),t.backgroundColor=Gs(i),++i}(e,i))}}(t);s.forEach(a)}};const en=(t,i)=>{let{boxHeight:e=i,boxWidth:s=i}=t;return t.usePointStyle&&(e=Math.min(e,i),s=t.pointStyleWidth||Math.min(s,i)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(i,e)}};class sn extends ns{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,i,e){this.maxWidth=t,this.maxHeight=i,this._margins=e,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 t=this.options.labels||{};let i=U(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter((i=>t.filter(i,this.chart.data)))),t.sort&&(i=i.sort(((i,e)=>t.sort(i,e,this.chart.data)))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display)return void(this.width=this.height=0);const e=t.labels,s=xi(e.font),n=s.size,r=this._computeTitleHeight(),{boxWidth:o,itemHeight:h}=en(e,n);let a,c;i.font=s.string,this.isHorizontal()?(a=this.maxWidth,c=this._fitRows(r,n,o,h)+10):(c=this.maxHeight,a=this._fitCols(r,s,o,h)+10),this.width=Math.min(a,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,i,e,s){const{ctx:n,maxWidth:r,options:{labels:{padding:o}}}=this,h=this.legendHitBoxes=[],a=this.lineWidths=[0],c=s+o;let l=t;n.textAlign="left",n.textBaseline="middle";let u=-1,f=-c;return this.legendItems.forEach(((t,d)=>{const b=e+i/2+n.measureText(t.text).width;(0===d||a[a.length-1]+b+2*o>r)&&(l+=c,a[a.length-(d>0?0:1)]=0,f+=c,u++),h[d]={left:0,top:f,row:u,width:b,height:s},a[a.length-1]+=b+o})),l}_fitCols(t,i,e,s){const{ctx:n,maxHeight:r,options:{labels:{padding:o}}}=this,h=this.legendHitBoxes=[],a=this.columnSizes=[],c=r-t;let l=o,u=0,f=0,d=0,b=0;return this.legendItems.forEach(((t,r)=>{const{itemWidth:g,itemHeight:p}=function(t,i,e,s,n){const r=function(t,i,e,s){let n=t.text;return n&&"string"!=typeof n&&(n=n.reduce(((t,i)=>t.length>i.length?t:i))),i+e.size/2+s.measureText(n).width}(s,t,i,e),o=function(t,i,e){let s=t;return"string"!=typeof i.text&&(s=nn(i,e)),s}(n,s,i.lineHeight);return{itemWidth:r,itemHeight:o}}(e,i,n,t,s);r>0&&f+p+2*o>c&&(l+=u+o,a.push({width:u,height:f}),d+=u+o,b++,u=f=0),h[r]={left:d,top:f,col:b,width:g,height:p},u=Math.max(u,g),f+=p+o})),l+=u,a.push({width:u,height:f}),l}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:e,labels:{padding:s},rtl:n}}=this,r=Xi(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=Pt(e,this.left+s,this.right-this.lineWidths[n]);for(const h of i)n!==h.row&&(n=h.row,o=Pt(e,this.left+s,this.right-this.lineWidths[n])),h.top+=this.top+t+s,h.left=r.leftForLtr(r.x(o),h.width),o+=h.width+s}else{let n=0,o=Pt(e,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const h of i)h.col!==n&&(n=h.col,o=Pt(e,this.top+t+s,this.bottom-this.columnSizes[n].height)),h.top=o,h.left+=this.left+s,h.left=r.leftForLtr(r.x(h.left),h.width),o+=h.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;ri(t,this),this._draw(),oi(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:e,ctx:s}=this,{align:n,labels:r}=t,o=Gt.color,h=Xi(t.rtl,this.left,this.width),a=xi(r.font),{padding:c}=r,l=a.size,u=l/2;let f;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=a.string;const{boxWidth:d,boxHeight:b,itemHeight:g}=en(r,l),p=this.isHorizontal(),m=this._computeTitleHeight();f=p?{x:Pt(n,this.left+c,this.right-e[0]),y:this.top+c+m,line:0}:{x:this.left+c,y:Pt(n,this.top+m+c,this.bottom-i[0].height),line:0},Ui(this.ctx,t.textDirection);const x=g+c;this.legendItems.forEach(((v,y)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;const M=s.measureText(v.text).width,w=h.textAlign(v.textAlign||(v.textAlign=r.textAlign)),_=d+u+M;let k=f.x,O=f.y;h.setWidth(this.width),p?y>0&&k+_+c>this.right&&(O=f.y+=x,f.line++,k=f.x=Pt(n,this.left+c,this.right-e[f.line])):y>0&&O+x>this.bottom&&(k=f.x=k+i[f.line].width+c,f.line++,O=f.y=Pt(n,this.top+m+c,this.bottom-i[f.line].height)),function(t,i,e){if(isNaN(d)||d<=0||isNaN(b)||b<0)return;s.save();const n=V(e.lineWidth,1);if(s.fillStyle=V(e.fillStyle,o),s.lineCap=V(e.lineCap,"butt"),s.lineDashOffset=V(e.lineDashOffset,0),s.lineJoin=V(e.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=V(e.strokeStyle,o),s.setLineDash(V(e.lineDash,[])),r.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:e.pointStyle,rotation:e.rotation,borderWidth:n},a=h.xPlus(t,d/2);si(s,o,a,i+u,r.pointStyleWidth&&d)}else{const r=i+Math.max((l-b)/2,0),o=h.leftForLtr(t,d),a=pi(e.borderRadius);s.beginPath(),Object.values(a).some((t=>0!==t))?li(s,{x:o,y:r,w:d,h:b,radius:a}):s.rect(o,r,d,b),s.fill(),0!==n&&s.stroke()}s.restore()}(h.x(k),O,v),k=((t,i,e,s)=>t===(s?"left":"right")?e:"center"===t?(i+e)/2:i)(w,k+d+u,p?k+_:this.right,t.rtl),function(t,i,e){ci(s,e.text,t,i+g/2,a,{strikethrough:e.hidden,textAlign:h.textAlign(e.textAlign)})}(h.x(k),O,v),p?f.x+=_+c:f.y+="string"!=typeof v.text?nn(v,a.lineHeight)+c:x})),Zi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,e=xi(i.font),s=mi(i.padding);if(!i.display)return;const n=Xi(t.rtl,this.left,this.width),r=this.ctx,o=i.position,h=s.top+e.size/2;let a,c=this.left,l=this.width;if(this.isHorizontal())l=Math.max(...this.lineWidths),a=this.top+h,c=Pt(t.align,c,this.right-l);else{const i=this.columnSizes.reduce(((t,i)=>Math.max(t,i.height)),0);a=h+Pt(t.align,this.top,this.bottom-i-t.labels.padding-this._computeTitleHeight())}const u=Pt(o,c,c+l);r.textAlign=n.textAlign(Lt(o)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=e.string,ci(r,i.text,u,a,e)}_computeTitleHeight(){const t=this.options.title,i=xi(t.font),e=mi(t.padding);return t.display?i.lineHeight+e.height:0}_getLegendItemAt(t,i){let e,s,n;if(Ot(t,this.left,this.right)&&Ot(i,this.top,this.bottom))for(n=this.legendHitBoxes,e=0;e<n.length;++e)if(s=n[e],Ot(t,s.left,s.left+s.width)&&Ot(i,s.top,s.top+s.height))return this.legendItems[e];return null}handleEvent(t){const i=this.options;if(!function(t,i){return!("mousemove"!==t&&"mouseout"!==t||!i.onHover&&!i.onLeave)||!(!i.onClick||"click"!==t&&"mouseup"!==t)}(t.type,i))return;const e=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const r=this._hoveredItem,o=(n=e,null!==(s=r)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);r&&!o&&U(i.onLeave,[t,r,this],this),this._hoveredItem=e,e&&!o&&U(i.onHover,[t,e,this],this)}else e&&U(i.onClick,[t,e,this],this);var s,n}}function nn(t,i){return i*(t.text?t.text.length:0)}var rn={id:"legend",_element:sn,start(t,i,e){const s=t.legend=new sn({ctx:t.ctx,options:e,chart:t});We.configure(t,s,e),We.addBox(t,s)},stop(t){We.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,i,e){const s=t.legend;We.configure(t,s,e),s.options=e},afterUpdate(t){const i=t.legend;i.buildLabels(),i.adjustHitBoxes()},afterEvent(t,i){i.replay||t.legend.handleEvent(i.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,i,e){const s=i.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),i.hidden=!0):(n.show(s),i.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const i=t.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r,useBorderRadius:o,borderRadius:h}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(e?0:void 0),c=mi(a.borderWidth);return{text:i[t.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:o&&(h||a.borderRadius),datasetIndex:t.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 on extends ns{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,i){const e=this.options;if(this.left=0,this.top=0,!e.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=i;const s=z(e.text)?e.text.length:1;this._padding=mi(e.padding);const n=s*xi(e.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:i,left:e,bottom:s,right:n,options:r}=this,o=r.align;let h,a,c,l=0;return this.isHorizontal()?(a=Pt(o,e,n),c=i+t,h=n-e):("left"===r.position?(a=e+t,c=Pt(o,s,i),l=-.5*at):(a=n-t,c=Pt(o,i,s),l=.5*at),h=s-i),{titleX:a,titleY:c,maxWidth:h,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const e=xi(i.font),s=e.lineHeight/2+this._padding.top,{titleX:n,titleY:r,maxWidth:o,rotation:h}=this._drawArgs(s);ci(t,i.text,0,0,e,{color:i.color,maxWidth:o,rotation:h,textAlign:Lt(i.align),textBaseline:"middle",translation:[n,r]})}}var hn={id:"title",_element:on,start(t,i,e){!function(t,i){const e=new on({ctx:t.ctx,options:i,chart:t});We.configure(t,e,i),We.addBox(t,e),t.titleBlock=e}(t,e)},stop(t){We.removeBox(t,t.titleBlock),delete t.titleBlock},beforeUpdate(t,i,e){const s=t.titleBlock;We.configure(t,s,e),s.options=e},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 an={average(t){if(!t.length)return!1;let i,e,s=new Set,n=0,r=0;for(i=0,e=t.length;i<e;++i){const e=t[i].element;if(e&&e.hasValue()){const t=e.tooltipPosition();s.add(t.x),n+=t.y,++r}}return 0!==r&&0!==s.size&&{x:[...s].reduce(((t,i)=>t+i))/s.size,y:n/r}},nearest(t,i){if(!t.length)return!1;let e,s,n,r=i.x,o=i.y,h=Number.POSITIVE_INFINITY;for(e=0,s=t.length;e<s;++e){const s=t[e].element;if(s&&s.hasValue()){const t=(a=i,c=s.getCenterPoint(),Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2)));t<h&&(h=t,n=s)}}var a,c;if(n){const t=n.tooltipPosition();r=t.x,o=t.y}return{x:r,y:o}}};function cn(t,i){return i&&(z(i)?Array.prototype.push.apply(t,i):t.push(i)),t}function ln(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function un(t,i){const{element:e,datasetIndex:s,index:n}=i,r=t.getDatasetMeta(s).controller,{label:o,value:h}=r.getLabelAndValue(n);return{chart:t,label:o,parsed:r.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:h,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function fn(t,i){const e=t.chart.ctx,{body:s,footer:n,title:r}=t,{boxWidth:o,boxHeight:h}=i,a=xi(i.bodyFont),c=xi(i.titleFont),l=xi(i.footerFont),u=r.length,f=n.length,d=s.length,b=mi(i.padding);let g=b.height,p=0,m=s.reduce(((t,i)=>t+i.before.length+i.lines.length+i.after.length),0);m+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*i.titleSpacing+i.titleMarginBottom),m&&(g+=d*(i.displayColors?Math.max(h,a.lineHeight):a.lineHeight)+(m-d)*a.lineHeight+(m-1)*i.bodySpacing),f&&(g+=i.footerMarginTop+f*l.lineHeight+(f-1)*i.footerSpacing);let x=0;const v=function(t){p=Math.max(p,e.measureText(t).width+x)};return e.save(),e.font=c.string,Z(t.title,v),e.font=a.string,Z(t.beforeBody.concat(t.afterBody),v),x=i.displayColors?o+2+i.boxPadding:0,Z(s,(t=>{Z(t.before,v),Z(t.lines,v),Z(t.after,v)})),x=0,e.font=l.string,Z(t.footer,v),e.restore(),p+=b.width,{width:p,height:g}}function dn(t,i,e,s){const{x:n,width:r}=e,{width:o,chartArea:{left:h,right:a}}=t;let c="center";return"center"===s?c=n<=(h+a)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),function(t,i,e,s){const{x:n,width:r}=s,o=e.caretSize+e.caretPadding;return"left"===t&&n+r+o>i.width||"right"===t&&n-r-o<0||void 0}(c,t,i,e)&&(c="center"),c}function bn(t,i,e){const s=e.yAlign||i.yAlign||function(t,i){const{y:e,height:s}=i;return e<s/2?"top":e>t.height-s/2?"bottom":"center"}(t,e);return{xAlign:e.xAlign||i.xAlign||dn(t,i,e,s),yAlign:s}}function gn(t,i,e,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=t,{xAlign:h,yAlign:a}=e,c=n+r,{topLeft:l,topRight:u,bottomLeft:f,bottomRight:d}=pi(o);let b=function(t,i){let{x:e,width:s}=t;return"right"===i?e-=s:"center"===i&&(e-=s/2),e}(i,h);const g=function(t,i,e){let{y:s,height:n}=t;return"top"===i?s+=e:s-="bottom"===i?n+e:n/2,s}(i,a,c);return"center"===a?"left"===h?b+=c:"right"===h&&(b-=c):"left"===h?b-=Math.max(l,f)+n:"right"===h&&(b+=Math.max(u,d)+n),{x:kt(b,0,s.width-i.width),y:kt(g,0,s.height-i.height)}}function pn(t,i,e){const s=mi(e.padding);return"center"===i?t.x+t.width/2:"right"===i?t.x+t.width-s.right:t.x+s.left}function mn(t){return cn([],ln(t))}function xn(t,i){const e=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return e?t.override(e):t}const vn={beforeTitle:B,title(t){if(t.length>0){const i=t[0],e=i.chart.data.labels,s=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return i.dataset.label||"";if(i.label)return i.label;if(s>0&&i.dataIndex<s)return e[i.dataIndex]}return""},afterTitle:B,beforeBody:B,beforeLabel:B,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let i=t.dataset.label||"";i&&(i+=": ");const e=t.formattedValue;return W(e)||(i+=e),i},labelColor(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:B,afterBody:B,beforeFooter:B,footer:B,afterFooter:B};function yn(t,i,e,s){const n=t[i].call(e,s);return void 0===n?vn[i].call(e,s):n}class Mn extends ns{static positioners=an;constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,e=this.options.setContext(this.getContext()),s=e.enabled&&i.options.animation&&e.animations,n=new ie(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=yi(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,i){const{callbacks:e}=i,s=yn(e,"beforeTitle",this,t),n=yn(e,"title",this,t),r=yn(e,"afterTitle",this,t);let o=[];return o=cn(o,ln(s)),o=cn(o,ln(n)),o=cn(o,ln(r)),o}getBeforeBody(t,i){return mn(yn(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:e}=i,s=[];return Z(t,(t=>{const i={before:[],lines:[],after:[]},n=xn(e,t);cn(i.before,ln(yn(n,"beforeLabel",this,t))),cn(i.lines,yn(n,"label",this,t)),cn(i.after,ln(yn(n,"afterLabel",this,t))),s.push(i)})),s}getAfterBody(t,i){return mn(yn(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:e}=i,s=yn(e,"beforeFooter",this,t),n=yn(e,"footer",this,t),r=yn(e,"afterFooter",this,t);let o=[];return o=cn(o,ln(s)),o=cn(o,ln(n)),o=cn(o,ln(r)),o}_createItems(t){const i=this._active,e=this.chart.data,s=[],n=[],r=[];let o,h,a=[];for(o=0,h=i.length;o<h;++o)a.push(un(this.chart,i[o]));return t.filter&&(a=a.filter(((i,s,n)=>t.filter(i,s,n,e)))),t.itemSort&&(a=a.sort(((i,s)=>t.itemSort(i,s,e)))),Z(a,(i=>{const e=xn(t.callbacks,i);s.push(yn(e,"labelColor",this,i)),n.push(yn(e,"labelPointStyle",this,i)),r.push(yn(e,"labelTextColor",this,i))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){const e=this.options.setContext(this.getContext()),s=this._active;let n,r=[];if(s.length){const t=an[e.position].call(this,s,this._eventPosition);r=this._createItems(e),this.title=this.getTitle(r,e),this.beforeBody=this.getBeforeBody(r,e),this.body=this.getBody(r,e),this.afterBody=this.getAfterBody(r,e),this.footer=this.getFooter(r,e);const i=this._size=fn(this,e),o=Object.assign({},t,i),h=bn(this.chart,e,o),a=gn(e,o,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,n={opacity:1,x:a.x,y:a.y,width:i.width,height:i.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=r,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&e.external&&e.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,e,s){const n=this.getCaretPosition(t,e,s);i.lineTo(n.x1,n.y1),i.lineTo(n.x2,n.y2),i.lineTo(n.x3,n.y3)}getCaretPosition(t,i,e){const{xAlign:s,yAlign:n}=this,{caretSize:r,cornerRadius:o}=e,{topLeft:h,topRight:a,bottomLeft:c,bottomRight:l}=pi(o),{x:u,y:f}=t,{width:d,height:b}=i;let g,p,m,x,v,y;return"center"===n?(v=f+b/2,"left"===s?(g=u,p=g-r,x=v+r,y=v-r):(g=u+d,p=g+r,x=v-r,y=v+r),m=g):(p="left"===s?u+Math.max(h,c)+r:"right"===s?u+d-Math.max(a,l)-r:this.caretX,"top"===n?(x=f,v=x-r,g=p-r,m=p+r):(x=f+b,v=x+r,g=p+r,m=p-r),y=x),{x1:g,x2:p,x3:m,y1:x,y2:v,y3:y}}drawTitle(t,i,e){const s=this.title,n=s.length;let r,o,h;if(n){const a=Xi(e.rtl,this.x,this.width);for(t.x=pn(this,e.titleAlign,e),i.textAlign=a.textAlign(e.titleAlign),i.textBaseline="middle",r=xi(e.titleFont),o=e.titleSpacing,i.fillStyle=e.titleColor,i.font=r.string,h=0;h<n;++h)i.fillText(s[h],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+o,h+1===n&&(t.y+=e.titleMarginBottom-o)}}_drawColorBox(t,i,e,s,n){const r=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:h,boxWidth:a}=n,c=xi(n.bodyFont),l=pn(this,"left",n),u=s.x(l),f=i.y+(h<c.lineHeight?(c.lineHeight-h)/2:0);if(n.usePointStyle){const i={radius:Math.min(a,h)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(u,a)+a/2,c=f+h/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ei(t,i,e,c),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ei(t,i,e,c)}else{t.lineWidth=H(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const i=s.leftForLtr(u,a),e=s.leftForLtr(s.xPlus(u,1),a-2),o=pi(r.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,li(t,{x:i,y:f,w:a,h,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),li(t,{x:e,y:f+1,w:a-2,h:h-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(i,f,a,h),t.strokeRect(i,f,a,h),t.fillStyle=r.backgroundColor,t.fillRect(e,f+1,a-2,h-2))}t.fillStyle=this.labelTextColors[e]}drawBody(t,i,e){const{body:s}=this,{bodySpacing:n,bodyAlign:r,displayColors:o,boxHeight:h,boxWidth:a,boxPadding:c}=e,l=xi(e.bodyFont);let u=l.lineHeight,f=0;const d=Xi(e.rtl,this.x,this.width),b=function(e){i.fillText(e,d.x(t.x+f),t.y+u/2),t.y+=u+n},g=d.textAlign(r);let p,m,x,v,y,M,w;for(i.textAlign=r,i.textBaseline="middle",i.font=l.string,t.x=pn(this,g,e),i.fillStyle=e.bodyColor,Z(this.beforeBody,b),f=o&&"right"!==g?"center"===r?a/2+c:a+2+c:0,v=0,M=s.length;v<M;++v){for(p=s[v],m=this.labelTextColors[v],i.fillStyle=m,Z(p.before,b),x=p.lines,o&&x.length&&(this._drawColorBox(i,t,v,d,e),u=Math.max(l.lineHeight,h)),y=0,w=x.length;y<w;++y)b(x[y]),u=l.lineHeight;Z(p.after,b)}f=0,u=l.lineHeight,Z(this.afterBody,b),t.y-=n}drawFooter(t,i,e){const s=this.footer,n=s.length;let r,o;if(n){const h=Xi(e.rtl,this.x,this.width);for(t.x=pn(this,e.footerAlign,e),t.y+=e.footerMarginTop,i.textAlign=h.textAlign(e.footerAlign),i.textBaseline="middle",r=xi(e.footerFont),i.fillStyle=e.footerColor,i.font=r.string,o=0;o<n;++o)i.fillText(s[o],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+e.footerSpacing}}drawBackground(t,i,e,s){const{xAlign:n,yAlign:r}=this,{x:o,y:h}=t,{width:a,height:c}=e,{topLeft:l,topRight:u,bottomLeft:f,bottomRight:d}=pi(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(o+l,h),"top"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+a-u,h),i.quadraticCurveTo(o+a,h,o+a,h+u),"center"===r&&"right"===n&&this.drawCaret(t,i,e,s),i.lineTo(o+a,h+c-d),i.quadraticCurveTo(o+a,h+c,o+a-d,h+c),"bottom"===r&&this.drawCaret(t,i,e,s),i.lineTo(o+f,h+c),i.quadraticCurveTo(o,h+c,o,h+c-f),"center"===r&&"left"===n&&this.drawCaret(t,i,e,s),i.lineTo(o,h+l),i.quadraticCurveTo(o,h,o+l,h),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,e=this.$animations,s=e&&e.x,n=e&&e.y;if(s||n){const e=an[t.position].call(this,this._active,this._eventPosition);if(!e)return;const r=this._size=fn(this,t),o=Object.assign({},e,this._size),h=bn(i,t,o),a=gn(t,o,h,i);s._to===a.x&&n._to===a.y||(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=r.width,this.height=r.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,a))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let e=this.opacity;if(!e)return;this._updateAnimationTarget(i);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};e=Math.abs(e)<.001?0:e;const r=mi(i.padding);i.enabled&&(this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length)&&(t.save(),t.globalAlpha=e,this.drawBackground(n,t,s,i),Ui(t,i.textDirection),n.y+=r.top,this.drawTitle(n,t,i),this.drawBody(n,t,i),this.drawFooter(n,t,i),Zi(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const e=this._active,s=t.map((({datasetIndex:t,index:i})=>{const e=this.chart.getDatasetMeta(t);if(!e)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:e.data[i],index:i}})),n=!K(e,s),r=this._positionChanged(s,i);(n||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,e=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],r=this._getActiveElements(t,n,i,e),o=this._positionChanged(r,t),h=i||!K(r,n)||o;return h&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),h}_getActiveElements(t,i,e,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return i.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const r=this.chart.getElementsAtEventForMode(t,n.mode,n,e);return n.reverse&&r.reverse(),r}_positionChanged(t,i){const{caretX:e,caretY:s,options:n}=this,r=an[n.position].call(this,t,i);return!1!==r&&(e!==r.x||s!==r.y)}}var wn={id:"tooltip",_element:Mn,positioners:an,afterInit(t,i,e){e&&(t.tooltip=new Mn({chart:t,options:e}))},beforeUpdate(t,i,e){t.tooltip&&t.tooltip.initialize(e)},reset(t,i,e){t.tooltip&&t.tooltip.initialize(e)},afterDraw(t){const i=t.tooltip;if(i&&i._willRender()){const e={tooltip:i};if(!1===t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0}))return;i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e)}},afterEvent(t,i){t.tooltip&&t.tooltip.handleEvent(i.event,i.replay,i.inChartArea)&&(i.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,i)=>i.bodyFont.size,boxWidth:(t,i)=>i.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:vn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function _n(t){const i=this.getLabels();return t>=0&&t<i.length?i[t]:t}function kn(t,i,{horizontal:e,minRotation:s}){const n=yt(s),r=(e?Math.sin(n):Math.cos(n))||.001;return Math.min(i/r,.75*i*(""+t).length)}class On extends ds{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return W(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this;const r=t=>s=i?s:t,o=t=>n=e?n:t;if(t){const t=pt(s),i=pt(n);t<0&&i<0?o(0):t>0&&i>0&&r(0)}if(s===n){let i=0===n?1:Math.abs(.05*n);o(n+i),t||r(s-i)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let i,{maxTicksLimit:e,stepSize:s}=t;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let e=this.getTickLimit();e=Math.max(2,e);const s=function(t,i){const e=[],{bounds:s,step:n,min:r,max:o,precision:h,count:a,maxTicks:c,maxDigits:l,includeBounds:u}=t,f=n||1,d=c-1,{min:b,max:g}=i,p=!W(r),m=!W(o),x=!W(a),v=(g-b)/(l+1);let y,M,w,_,k=xt((g-b)/d/f)*f;if(k<1e-14&&!p&&!m)return[{value:b},{value:g}];_=Math.ceil(g/k)-Math.floor(b/k),_>d&&(k=xt(_*k/d/f)*f),W(h)||(y=Math.pow(10,h),k=Math.ceil(k*y)/y),"ticks"===s?(M=Math.floor(b/k)*k,w=Math.ceil(g/k)*k):(M=b,w=g),p&&m&&n&&function(t,i){const e=Math.round(t);return e-i<=t&&e+i>=t}((o-r)/n,k/1e3)?(_=Math.round(Math.min((o-r)/k,c)),k=(o-r)/_,M=r,w=o):x?(M=p?r:M,w=m?o:w,_=a-1,k=(w-M)/_):(_=(w-M)/k,_=mt(_,Math.round(_),k/1e3)?Math.round(_):Math.ceil(_));const O=Math.max(Mt(k),Mt(M));y=Math.pow(10,W(h)?O:h),M=Math.round(M*y)/y,w=Math.round(w*y)/y;let S=0;for(p&&(u&&M!==r?(e.push({value:r}),M<r&&S++,mt(Math.round((M+S*k)*y)/y,r,kn(r,v,t))&&S++):M<r&&S++);S<_;++S){const t=Math.round((M+S*k)*y)/y;if(m&&t>o)break;e.push({value:t})}return m&&u&&w!==o?e.length&&mt(e[e.length-1].value,o,kn(o,v,t))?e[e.length-1].value=o:e.push({value:o}):m&&w!==o||e.push({value:w}),e}({maxTicks:e,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:!1!==i.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,i){let e,s,n;for(e=0,s=t.length;e<s;e++)n=t[e].value,isNaN(n)||(i.min=Math.min(i.min,n),i.max=Math.max(i.max,n))}(s,this),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let i=this.min,e=this.max;if(super.configure(),this.options.offset&&t.length){const s=(e-i)/Math.max(t.length-1,1)/2;i-=s,e+=s}this._startValue=i,this._endValue=e,this._valueRange=e-i}getLabelForValue(t){return Vt(t,this.chart.options.locale,this.options.ticks.format)}}Hs.register(tn,class extends de{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,i,e,s){return ge(t,i,e,s)}parseArrayData(t,i,e,s){return ge(t,i,e,s)}parseObjectData(t,i,e,s){const{iScale:n,vScale:r}=t,{xAxisKey:o="x",yAxisKey:h="y"}=this._parsing,a="x"===n.axis?o:h,c="x"===r.axis?o:h,l=[];let u,f,d,b;for(u=e,f=e+s;u<f;++u)b=i[u],d={},d[n.axis]=n.parse(st(b,a),u),l.push(be(st(b,c),d,r,u));return l}updateRangeFromParsed(t,i,e,s){super.updateRangeFromParsed(t,i,e,s);const n=e._custom;n&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:e,vScale:s}=i,n=this.getParsed(t),r=n._custom,o=pe(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+e.getLabelForValue(n[e.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,e,s){const n="reset"===s,{index:r,_cachedMeta:{vScale:o}}=this,h=o.getBasePixel(),a=o.isHorizontal(),c=this._getRuler(),{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,s);for(let f=i;f<i+e;f++){const i=this.getParsed(f),e=n||W(i[o.axis])?{base:h,head:h}:this._calculateBarValuePixels(f),d=this._calculateBarIndexPixels(f,c),b=(i._stacks||{})[o.axis],g={horizontal:a,base:e.base,enableBorderRadius:!b||pe(i._custom)||r===b._top||r===b._bottom,x:a?e.head:d.center,y:a?d.center:e.head,height:a?d.size:Math.abs(e.size),width:a?Math.abs(e.size):d.size};u&&(g.options=l||this.resolveDataElementOptions(f,t[f].active?"active":s));const p=g.options||t[f].options;me(g,p,b,r),ye(g,p,c.ratio),this.updateElement(t[f],f,g,s)}}_getStacks(t,i){const{iScale:e}=this._cachedMeta,s=e.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),n=e.options.stacked,r=[],o=this._cachedMeta.controller.getParsed(i),h=o&&o[e.axis],a=t=>{const i=t._parsed.find((t=>t[e.axis]===h)),s=i&&i[t.vScale.axis];if(W(s)||isNaN(s))return!0};for(const e of s)if((void 0===i||!a(e))&&((!1===n||-1===r.indexOf(e.stack)||void 0===n&&void 0===e.stack)&&r.push(e.stack),e.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter((e=>t[e].axis===i)).shift()}_getAxis(){const t={},i=this.getFirstScaleIdForIndexAxis();for(const e of this.chart.data.datasets)t[V("x"===this.chart.options.indexAxis?e.xAxisID:e.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,e){const s=this._getStacks(t,e),n=void 0!==i?s.indexOf(i):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,i=this._cachedMeta,e=i.iScale,s=[];let n,r;for(n=0,r=i.data.length;n<r;++n)s.push(e.getPixelForValue(this.getParsed(n)[e.axis],n));const o=t.barThickness,h=o||function(t){const i=t.iScale,e=function(t,i){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas(i);let s=[];for(let i=0,n=e.length;i<n;i++)s=s.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=function(t){const i=new Set(t);return i.size===t.length?t:Array.from(i)}(s.sort(((t,i)=>t-i)))}return t._cache.$bar}(i,t.type);let s,n,r,o,h=i._length;const a=()=>{32767!==r&&-32768!==r&&(rt(o)&&(h=Math.min(h,Math.abs(r-o)||h)),o=r)};for(s=0,n=e.length;s<n;++s)r=i.getPixelForValue(e[s]),a();for(o=void 0,s=0,n=i.ticks.length;s<n;++s)r=i.getPixelForTick(s),a();return h}(i);return{min:h,pixels:s,start:e._startPixel,end:e._endPixel,stackCount:this._getStackCount(),scale:e,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:e,index:s},options:{base:n,minBarLength:r}}=this,o=n||0,h=this.getParsed(t),a=h._custom,c=pe(a);let l,u,f=h[i.axis],d=0,b=e?this.applyStack(i,h,e):f;b!==f&&(d=b-f,b=f),c&&(f=a.barStart,b=a.barEnd-a.barStart,0!==f&&pt(f)!==pt(a.barEnd)&&(d=0),d+=f);const g=W(n)||c?d:n;let p=i.getPixelForValue(g);if(l=this.chart.getDataVisibility(t)?i.getPixelForValue(d+b):p,u=l-p,Math.abs(u)<r){u=function(t,i,e){return 0!==t?pt(t):(i.isHorizontal()?1:-1)*(i.min>=e?1:-1)}(u,i,o)*r,f===o&&(p-=u/2);const t=i.getPixelForDecimal(0),n=i.getPixelForDecimal(1),a=Math.min(t,n),d=Math.max(t,n);p=Math.max(Math.min(p,d),a),l=p+u,e&&!c&&(h._stacks[i.axis]._visualValues[s]=i.getValueForPixel(l)-i.getValueForPixel(p))}if(p===i.getPixelForValue(o)){const t=pt(u)*i.getLineWidthForValue(o)/2;p+=t,u-=t}return{size:u,base:p,head:l,center:l+u/2}}_calculateBarIndexPixels(t,i){const e=i.scale,s=this.options,n=s.skipNull,r=V(s.maxBarThickness,1/0);let o,h;const a=this._getAxisCount();if(i.grouped){const e=n?this._getStackCount(t):i.stackCount,c="flex"===s.barThickness?function(t,i,e,s){const n=i.pixels,r=n[t];let o=t>0?n[t-1]:null,h=t<n.length-1?n[t+1]:null;const a=e.categoryPercentage;null===o&&(o=r-(null===h?i.end-i.start:h-r)),null===h&&(h=r+r-o);const c=r-(r-Math.min(o,h))/2*a;return{chunk:Math.abs(h-o)/2*a/s,ratio:e.barPercentage,start:c}}(t,i,s,e*a):function(t,i,e,s){const n=e.barThickness;let r,o;return W(n)?(r=i.min*e.categoryPercentage,o=e.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:i.pixels[t]-r/2}}(t,i,s,e*a),l="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(V(l,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0)+u;o=c.start+c.chunk*f+c.chunk/2,h=Math.min(r,c.chunk*c.ratio)}else o=e.getPixelForValue(this.getParsed(t)[e.axis],t),h=Math.min(r,i.min*i.ratio);return{base:o-h/2,head:o+h/2,center:o,size:h}}draw(){const t=this._cachedMeta,i=t.vScale,e=t.data,s=e.length;let n=0;for(;n<s;++n)null===this.getParsed(n)[i.axis]||e[n].hidden||e[n].draw(this._ctx)}},class extends ns{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:e,backgroundColor:s}}=this,{inner:n,outer:r}=function(t){const i=Ys(t),e=i.right-i.left,s=i.bottom-i.top,n=function(t,i,e){const s=t.borderSkipped,n=gi(t.options.borderWidth);return{t:Vs(s.top,n.top,0,e),r:Vs(s.right,n.right,0,i),b:Vs(s.bottom,n.bottom,0,e),l:Vs(s.left,n.left,0,i)}}(t,e/2,s/2),r=function(t,i,e){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,r=pi(n),o=Math.min(i,e),h=t.borderSkipped,a=s||H(n);return{topLeft:Vs(!a||h.top||h.left,r.topLeft,0,o),topRight:Vs(!a||h.top||h.right,r.topRight,0,o),bottomLeft:Vs(!a||h.bottom||h.left,r.bottomLeft,0,o),bottomRight:Vs(!a||h.bottom||h.right,r.bottomRight,0,o)}}(t,e/2,s/2);return{outer:{x:i.left,y:i.top,w:e,h:s,radius:r},inner:{x:i.left+n.l,y:i.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}(this),o=(h=r.radius).topLeft||h.topRight||h.bottomLeft||h.bottomRight?li:Us;var h;t.save(),r.w===n.w&&r.h===n.h||(t.beginPath(),o(t,Zs(r,i,n)),t.clip(),o(t,Zs(n,-i,r)),t.fillStyle=e,t.fill("evenodd")),t.beginPath(),o(t,Zs(n,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,e){return Xs(this,t,i,e)}inXRange(t,i){return Xs(this,t,null,i)}inYRange(t,i){return Xs(this,null,t,i)}getCenterPoint(t){const{x:i,y:e,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(i+s)/2:i,y:n?e:(e+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends ds{static id="category";static defaults={ticks:{callback:_n}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const t=this.getLabels();for(const{index:e,label:s}of i)t[e]===s&&t.splice(e,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(W(t))return null;const e=this.getLabels();return((t,i)=>null===t?null:kt(Math.round(t),0,i))(i=isFinite(i)&&e[i]===t?i:function(t,i,e,s){const n=t.indexOf(i);return-1===n?((t,i,e,s)=>("string"==typeof i?(e=t.push(i)-1,s.unshift({index:e,label:i})):isNaN(i)&&(e=null),e))(t,i,e,s):n!==t.lastIndexOf(i)?e:n}(e,t,V(i,t),this._addedLabels),e.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:e,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(e=0),i||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){const t=this.min,i=this.max,e=this.options.offset,s=[];let n=this.getLabels();n=0===t&&i===n.length-1?n:n.slice(t,i+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let e=t;e<=i;e++)s.push({value:e});return s}getLabelForValue(t){return _n.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},class extends On{static id="linear";static defaults={ticks:{callback:Xt.formatters.numeric}};determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,e=yt(this.options.ticks.minRotation),s=(t?Math.sin(e):Math.cos(e))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},rn,wn,hn);const Sn=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.loading=!0,this.errorMessage=""}componentDidLoad(){this.getGrossPayment&&this.fetchData()}propChanged(){this.getGrossPayment&&this.fetchData()}grossVolumeReportChanged(t){t&&(this.chart?this.updateChartData(t):this.initChart(t))}async fetchData(){this.loading=!0,this.getGrossPayment({onSuccess:t=>{this.loading=!1,this.grossVolumeReport=t},onError:({error:t,code:i,severity:e})=>{this.loading=!1,this.errorMessage=t,this.errorEvent.emit({errorCode:i,message:t,severity:e})}})}initChart(t){const{dates:i,total:e}=t,s=i.reverse(),o=((t,i,e)=>({type:"bar",options:{plugins:{legend:{display:!1},title:{display:!0,text:["Trailing 30 Days","Gross Payments",n(t)],position:"top",align:"start"},tooltip:{displayColors:!1,intersect:!1,callbacks:{label:t=>{let s=t.dataIndex;return[r(i[s].date,e),n(i[s].value)]}}}},scales:{x:{grid:{drawOnChartArea:!1,drawTicks:!1},ticks:{callback:t=>{if(0===t||t===i.length-1)return r(i[t].date,e)}}},y:{display:!1}}},data:{labels:i.map((()=>"")),datasets:[{label:"Gross Volume by Date",data:i.map((t=>t.value))}]}}))(e,s,s[i.length-1].date);this.chart=new Hs(this.chartRef.getContext("2d"),o)}updateChartData(t){const i=t.dates.map((t=>t.value));this.chart.data.datasets.forEach((t=>{t.data=i})),this.chart.update()}disconnectedCallback(){this.chart&&this.chart.destroy()}render(){return e(s,{key:"0432a1c141cd1ea91ebcb3f975a220e5127164c8"},this.loading&&e(h,{key:"0261cca24232d936418d305f60f3857a502dcb11"}),this.errorMessage?o(this.errorMessage):e("canvas",{id:"chart",ref:t=>this.chartRef=t}))}static get watchers(){return{getGrossPayment:["propChanged"],grossVolumeReport:["grossVolumeReportChanged"]}}};export{Sn as gross_payment_chart_core}
|