openweights 0.7.0__tar.gz → 0.7.2__tar.gz
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.
- {openweights-0.7.0 → openweights-0.7.2}/.gitignore +0 -1
- {openweights-0.7.0 → openweights-0.7.2}/PKG-INFO +1 -1
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/backend/database.py +1 -8
- openweights-0.7.2/openweights/dashboard/backend/static/assets/LogProbVisualization-B6jQtzzK.js +20 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/LogProbVisualization-CnEzdbXa.js +20 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/LogProbVisualization-DChAruH-.js +20 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/MetricsPlots-BzYzp0RD.js +3855 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/MetricsPlots-Do-0PbcE.js +3855 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/MetricsPlots-Dy5N4URR.js +3855 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/browser-CHCO931n.js +1 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/browser-DG1xBqer.js +1 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/browser-tfbTCamV.js +1 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/index-CL2BTY-B.js +179 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/index-CmfXCDny.js +179 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/index-DpYPsR6j.css +1 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/index-KCoSzXrZ.js +179 -0
- openweights-0.7.2/openweights/dashboard/backend/static/assets/index-nmHS5w_u.css +1 -0
- openweights-0.7.2/openweights/dashboard/backend/static/index.html +14 -0
- openweights-0.7.2/openweights/dashboard/frontend/public/ow.svg +22 -0
- openweights-0.7.2/openweights/dashboard/frontend/public/vite.svg +1 -0
- {openweights-0.7.0 → openweights-0.7.2}/pyproject.toml +1 -1
- {openweights-0.7.0 → openweights-0.7.2}/.dockerignore +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.github/workflows/ci.yaml +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.github/workflows/manual_publish.yaml +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.pdm-python +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/.pre-commit-config.yaml +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/CLAUDE.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/DOCKER_README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/Dockerfile +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/Dockerfile.cluster +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/LICENSE.txt +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/api-deployment/api.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/api-deployment/context_manager_api.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/api-deployment/gradio_ui.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/custom_job/README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/custom_job/client_side.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/custom_job/worker_side.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/inference/prompts.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/inference/run_inference.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/inspect_eval.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/preference_learning/llama3_dpo.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/preference_learning/llama3_orpo.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/preference_learning/preferences.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/logp_tracking.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/prompts.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/test.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/train.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/weighted_data.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/data/weighted_data_test.jsonl +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/logprob_tracking.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/lora_qwen3_4b.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/multi_gpu_llama3_70b.py.skip +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/qlora_llama3_70b.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/sampling_callback.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/cookbook/sft/token_level_weighted_sft.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/entrypoint.cluster.sh +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/entrypoint.sh +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/llm.txt +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/llm_dot_txt.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/llm_full.txt +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/__main__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/cancel.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/cluster.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/common.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/deploy.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/env.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/exec.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/fetch.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/logs.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/ls.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/manage.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/serve.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/signup.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/ssh.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/token.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cli/worker.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/chat.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/decorators.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/events.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/files.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/jobs.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/run.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/temporary_api.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/client/utils.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cluster/.gitignore +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cluster/org_manager.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cluster/start_runpod.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/cluster/supervisor.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/backend/main.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/backend/models.py +0 -0
- {openweights-0.7.0/openweights/dashboard/frontend/public → openweights-0.7.2/openweights/dashboard/backend/static}/ow.svg +0 -0
- {openweights-0.7.0/openweights/dashboard/frontend/public → openweights-0.7.2/openweights/dashboard/backend/static}/vite.svg +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/backend/utils.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/.gitignore +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/eslint.config.js +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/index.html +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/package-lock.json +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/package.json +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/App.css +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/App.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/api.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/assets/react.svg +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Auth/Auth.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/FileContent.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/JobDetailView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/MetricsDisplay.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/MetricsPlots.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/OutputsDisplay.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/RunDetailView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/WorkerDetailView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews/index.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/DetailViews.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/JobsListView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/JobsView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/LogProbVisualization.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Organizations/OrganizationDetail.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Organizations/OrganizationList.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Organizations/OrganizationSwitcher.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Organizations/OrganizationsList.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/Organizations/TokensTab.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/RefreshButton.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/StatusCheckboxes.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/TokenView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/ViewToggle.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/WorkersListView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/components/WorkersView.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/contexts/AuthContext.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/contexts/OrganizationContext.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/index.css +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/main.tsx +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/supabaseClient.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/types/supabase.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/types.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/src/vite-env.d.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/tsconfig.app.json +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/tsconfig.json +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/tsconfig.node.json +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/dashboard/frontend/vite.config.ts +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/inference/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/inference/cli.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/inference/openai_support.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/inference/validate.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/inspect_ai.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/mmlu_pro/README.md +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/mmlu_pro/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/mmlu_pro/compute_accuracy.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/mmlu_pro/evaluate_from_local.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/mmlu_pro/requirements.txt +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/dpo_ft.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/logp_callback.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/logprobs.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/orpo_ft.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/sampling_callback.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/sft.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/training.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/utils.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/unsloth/validate.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/vllm/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/vllm/validate.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/logp_callback.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/logprobs.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/sampling_callback.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/sft.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/token_weighting.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/training.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/utils.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/jobs/weighted_sft/validate.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/gpu_health_check.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/main.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/__init__.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/checkout.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/hf_login.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/log_server.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/ttl_manager.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/openweights/worker/services/ttl_monitor.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/.gitignore +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/config.toml +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/config.toml.dev +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/config.toml.legacy +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/migrations/20250116_v1_schema.sql +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/migrations/20250118_storage_and_files_policies.sql +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/supabase/migrations/20250119_fix_files_insert.sql +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/tests/test_db.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/tests/test_files_insert.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/tests/test_integration.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/tests/test_jwt.py +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/use.sh +0 -0
- {openweights-0.7.0 → openweights-0.7.2}/uv.lock +0 -0
|
@@ -31,14 +31,9 @@ from supabase import Client, create_client
|
|
|
31
31
|
|
|
32
32
|
class Database:
|
|
33
33
|
def __init__(self, auth_token: Optional[str] = None):
|
|
34
|
-
self.supabase_url = os.getenv("SUPABASE_URL")
|
|
35
|
-
self.supabase_anon_key = os.getenv("SUPABASE_ANON_KEY")
|
|
36
34
|
self.auth_token = auth_token
|
|
37
35
|
self._current_org_id = None
|
|
38
36
|
|
|
39
|
-
if not self.supabase_url or not self.supabase_anon_key:
|
|
40
|
-
raise ValueError("SUPABASE_URL and SUPABASE_ANON_KEY must be set")
|
|
41
|
-
|
|
42
37
|
# Initialize regular client for normal operations
|
|
43
38
|
self.client = create_client(self.supabase_url, self.supabase_anon_key)
|
|
44
39
|
if auth_token:
|
|
@@ -50,9 +45,7 @@ class Database:
|
|
|
50
45
|
if not self._current_org_id:
|
|
51
46
|
raise ValueError("No organization set. Call set_organization_id first.")
|
|
52
47
|
return OpenWeights(
|
|
53
|
-
self.
|
|
54
|
-
self.supabase_anon_key,
|
|
55
|
-
self.auth_token,
|
|
48
|
+
auth_token=self.auth_token,
|
|
56
49
|
organization_id=self._current_org_id,
|
|
57
50
|
)
|
|
58
51
|
|
openweights-0.7.2/openweights/dashboard/backend/static/assets/LogProbVisualization-B6jQtzzK.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var ir=Object.defineProperty;var sr=(i,t,e)=>t in i?ir(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var F=(i,t,e)=>sr(i,typeof t!="symbol"?t+"":t,e);import{a as I,u as nr,c as _e,d as or,e as Fs,f as rr,h as Xi,o as ui,i as Ki,_ as Y,k as fi,l as ar,m as lr,n as ue,j as L,s as ne,p as Yt,q as de,t as no,v as cr,w as hr,x as dr,y as Wt,z as ur,R as ms,B as Pt,F as Hs,I as Bs,S as js,M as Ns,A as fr,D as gr,T as Xe,P as pr,E as mr,G as br,H as xr,C as _r}from"./index-KCoSzXrZ.js";const yr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function vr(i,t,e=(s,n)=>s===n){return i.length===t.length&&i.every((s,n)=>e(s,t[n]))}const kr=2;function oo(i,t){return i-t}function Ws(i,t){var e;const{index:s}=(e=i.reduce((n,o,r)=>{const a=Math.abs(t-o);return n===null||a<n.distance||a===n.distance?{distance:a,index:r}:n},null))!=null?e:{};return s}function Ke(i,t){if(t.current!==void 0&&i.changedTouches){const e=i;for(let s=0;s<e.changedTouches.length;s+=1){const n=e.changedTouches[s];if(n.identifier===t.current)return{x:n.clientX,y:n.clientY}}return!1}return{x:i.clientX,y:i.clientY}}function xi(i,t,e){return(i-t)*100/(e-t)}function Sr(i,t,e){return(e-t)*i+t}function wr(i){if(Math.abs(i)<1){const e=i.toExponential().split("e-"),s=e[0].split(".")[1];return(s?s.length:0)+parseInt(e[1],10)}const t=i.toString().split(".")[1];return t?t.length:0}function Mr(i,t,e){const s=Math.round((i-e)/t)*t+e;return Number(s.toFixed(wr(t)))}function $s({values:i,newValue:t,index:e}){const s=i.slice();return s[e]=t,s.sort(oo)}function qe({sliderRef:i,activeIndex:t,setActive:e}){var s,n;const o=ui(i.current);if(!((s=i.current)!=null&&s.contains(o.activeElement))||Number(o==null||(n=o.activeElement)==null?void 0:n.getAttribute("data-index"))!==t){var r;(r=i.current)==null||r.querySelector(`[type="range"][data-index="${t}"]`).focus()}e&&e(t)}function Ge(i,t){return typeof i=="number"&&typeof t=="number"?i===t:typeof i=="object"&&typeof t=="object"?vr(i,t):!1}const Cr={horizontal:{offset:i=>({left:`${i}%`}),leap:i=>({width:`${i}%`})},"horizontal-reverse":{offset:i=>({right:`${i}%`}),leap:i=>({width:`${i}%`})},vertical:{offset:i=>({bottom:`${i}%`}),leap:i=>({height:`${i}%`})}},Pr=i=>i;let Ze;function Vs(){return Ze===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ze=CSS.supports("touch-action","none"):Ze=!0),Ze}function Tr(i){const{"aria-labelledby":t,defaultValue:e,disabled:s=!1,disableSwap:n=!1,isRtl:o=!1,marks:r=!1,max:a=100,min:l=0,name:c,onChange:h,onChangeCommitted:d,orientation:u="horizontal",rootRef:f,scale:p=Pr,step:g=1,shiftStep:m=10,tabIndex:b,value:y}=i,k=I.useRef(void 0),[S,x]=I.useState(-1),[C,w]=I.useState(-1),[v,P]=I.useState(!1),E=I.useRef(0),[D,z]=nr({controlled:y,default:e??l,name:"Slider"}),G=h&&((_,M,O)=>{const $=_.nativeEvent||_,V=new $.constructor($.type,$);Object.defineProperty(V,"target",{writable:!0,value:{value:M,name:c}}),h(V,M,O)}),nt=Array.isArray(D);let R=nt?D.slice().sort(oo):[D];R=R.map(_=>_==null?l:_e(_,l,a));const Q=r===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((_,M)=>({value:l+g*M})):r||[],j=Q.map(_=>_.value),{isFocusVisibleRef:rt,onBlur:A,onFocus:T,ref:Z}=or(),[X,H]=I.useState(-1),B=I.useRef(null),ht=Fs(Z,B),gt=Fs(f,ht),re=_=>M=>{var O;const $=Number(M.currentTarget.getAttribute("data-index"));T(M),rt.current===!0&&H($),w($),_==null||(O=_.onFocus)==null||O.call(_,M)},ae=_=>M=>{var O;A(M),rt.current===!1&&H(-1),w(-1),_==null||(O=_.onBlur)==null||O.call(_,M)},Ve=(_,M)=>{const O=Number(_.currentTarget.getAttribute("data-index")),$=R[O],V=j.indexOf($);let N=M;if(Q&&g==null){const Ct=j[j.length-1];N>Ct?N=Ct:N<j[0]?N=j[0]:N=N<$?j[V-1]:j[V+1]}if(N=_e(N,l,a),nt){n&&(N=_e(N,R[O-1]||-1/0,R[O+1]||1/0));const Ct=N;N=$s({values:R,newValue:N,index:O});let Ot=O;n||(Ot=N.indexOf(Ct)),qe({sliderRef:B,activeIndex:Ot})}z(N),H(O),G&&!Ge(N,D)&&G(_,N,O),d&&d(_,N)},Di=_=>M=>{var O;if(g!==null){const $=Number(M.currentTarget.getAttribute("data-index")),V=R[$];let N=null;(M.key==="ArrowLeft"||M.key==="ArrowDown")&&M.shiftKey||M.key==="PageDown"?N=Math.max(V-m,l):((M.key==="ArrowRight"||M.key==="ArrowUp")&&M.shiftKey||M.key==="PageUp")&&(N=Math.min(V+m,a)),N!==null&&(Ve(M,N),M.preventDefault())}_==null||(O=_.onKeyDown)==null||O.call(_,M)};rr(()=>{if(s&&B.current.contains(document.activeElement)){var _;(_=document.activeElement)==null||_.blur()}},[s]),s&&S!==-1&&x(-1),s&&X!==-1&&H(-1);const Li=_=>M=>{var O;(O=_.onChange)==null||O.call(_,M),Ve(M,M.target.valueAsNumber)},Ye=I.useRef(void 0);let Rt=u;o&&u==="horizontal"&&(Rt+="-reverse");const it=({finger:_,move:M=!1})=>{const{current:O}=B,{width:$,height:V,bottom:N,left:Ct}=O.getBoundingClientRect();let Ot;Rt.indexOf("vertical")===0?Ot=(N-_.y)/V:Ot=(_.x-Ct)/$,Rt.indexOf("-reverse")!==-1&&(Ot=1-Ot);let K;if(K=Sr(Ot,l,a),g)K=Mr(K,g,l);else{const ce=Ws(j,K);K=j[ce]}K=_e(K,l,a);let bt=0;if(nt){M?bt=Ye.current:bt=Ws(R,K),n&&(K=_e(K,R[bt-1]||-1/0,R[bt+1]||1/0));const ce=K;K=$s({values:R,newValue:K,index:bt}),n&&M||(bt=K.indexOf(ce),Ye.current=bt)}return{newValue:K,activeIndex:bt}},et=Xi(_=>{const M=Ke(_,k);if(!M)return;if(E.current+=1,_.type==="mousemove"&&_.buttons===0){wt(_);return}const{newValue:O,activeIndex:$}=it({finger:M,move:!0});qe({sliderRef:B,activeIndex:$,setActive:x}),z(O),!v&&E.current>kr&&P(!0),G&&!Ge(O,D)&&G(_,O,$)}),wt=Xi(_=>{const M=Ke(_,k);if(P(!1),!M)return;const{newValue:O}=it({finger:M,move:!0});x(-1),_.type==="touchend"&&w(-1),d&&d(_,O),k.current=void 0,Mt()}),Nt=Xi(_=>{if(s)return;Vs()||_.preventDefault();const M=_.changedTouches[0];M!=null&&(k.current=M.identifier);const O=Ke(_,k);if(O!==!1){const{newValue:V,activeIndex:N}=it({finger:O});qe({sliderRef:B,activeIndex:N,setActive:x}),z(V),G&&!Ge(V,D)&&G(_,V,N)}E.current=0;const $=ui(B.current);$.addEventListener("touchmove",et,{passive:!0}),$.addEventListener("touchend",wt,{passive:!0})}),Mt=I.useCallback(()=>{const _=ui(B.current);_.removeEventListener("mousemove",et),_.removeEventListener("mouseup",wt),_.removeEventListener("touchmove",et),_.removeEventListener("touchend",wt)},[wt,et]);I.useEffect(()=>{const{current:_}=B;return _.addEventListener("touchstart",Nt,{passive:Vs()}),()=>{_.removeEventListener("touchstart",Nt),Mt()}},[Mt,Nt]),I.useEffect(()=>{s&&Mt()},[s,Mt]);const Ai=_=>M=>{var O;if((O=_.onMouseDown)==null||O.call(_,M),s||M.defaultPrevented||M.button!==0)return;M.preventDefault();const $=Ke(M,k);if($!==!1){const{newValue:N,activeIndex:Ct}=it({finger:$});qe({sliderRef:B,activeIndex:Ct,setActive:x}),z(N),G&&!Ge(N,D)&&G(M,N,Ct)}E.current=0;const V=ui(B.current);V.addEventListener("mousemove",et,{passive:!0}),V.addEventListener("mouseup",wt)},dt=xi(nt?R[0]:l,l,a),le=xi(R[R.length-1],l,a)-dt,Ii=(_={})=>{const M=Ki(_),O={onMouseDown:Ai(M||{})},$=Y({},M,O);return Y({},_,{ref:gt},$)},Ri=_=>M=>{var O;(O=_.onMouseOver)==null||O.call(_,M);const $=Number(M.currentTarget.getAttribute("data-index"));w($)},Ei=_=>M=>{var O;(O=_.onMouseLeave)==null||O.call(_,M),w(-1)};return{active:S,axis:Rt,axisProps:Cr,dragging:v,focusedThumbIndex:X,getHiddenInputProps:(_={})=>{var M;const O=Ki(_),$={onChange:Li(O||{}),onFocus:re(O||{}),onBlur:ae(O||{}),onKeyDown:Di(O||{})},V=Y({},O,$);return Y({tabIndex:b,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:i.min,max:i.max,step:i.step===null&&i.marks?"any":(M=i.step)!=null?M:void 0,disabled:s},_,V,{style:Y({},yr,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ii,getThumbProps:(_={})=>{const M=Ki(_),O={onMouseOver:Ri(M||{}),onMouseLeave:Ei(M||{})};return Y({},_,M,O)},marks:Q,open:C,range:nt,rootRef:gt,trackLeap:le,trackOffset:dt,values:R,getThumbStyle:_=>({pointerEvents:S!==-1&&S!==_?"none":void 0})}}const Or=i=>!i||!fi(i);function Dr(i){return lr("MuiSlider",i)}const _t=ar("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Lr=i=>{const{open:t}=i;return{offset:ue(t&&_t.valueLabelOpen),circle:_t.valueLabelCircle,label:_t.valueLabelLabel}};function Ar(i){const{children:t,className:e,value:s}=i,n=Lr(i);return t?I.cloneElement(t,{className:ue(t.props.className)},L.jsxs(I.Fragment,{children:[t.props.children,L.jsx("span",{className:ue(n.offset,e),"aria-hidden":!0,children:L.jsx("span",{className:n.circle,children:L.jsx("span",{className:n.label,children:s})})})]})):null}const Ir=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Ys(i){return i}const Rr=ne("span",{name:"MuiSlider",slot:"Root",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.root,t[`color${Yt(e.color)}`],e.size!=="medium"&&t[`size${Yt(e.size)}`],e.marked&&t.marked,e.orientation==="vertical"&&t.vertical,e.track==="inverted"&&t.trackInverted,e.track===!1&&t.trackFalse]}})(({theme:i})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${_t.disabled}`]:{pointerEvents:"none",cursor:"default",color:(i.vars||i).palette.grey[400]},[`&.${_t.dragging}`]:{[`& .${_t.thumb}, & .${_t.track}`]:{transition:"none"}},variants:[...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),Er=ne("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(i,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),zr=ne("span",{name:"MuiSlider",slot:"Track",overridesResolver:(i,t)=>t.track})(({theme:i})=>{var t;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:i.transitions.create(["left","width","bottom","height"],{duration:i.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e,track:"inverted"},style:Y({},i.vars?{backgroundColor:i.vars.palette.Slider[`${e}Track`],borderColor:i.vars.palette.Slider[`${e}Track`]}:Y({backgroundColor:de.lighten(i.palette[e].main,.62),borderColor:de.lighten(i.palette[e].main,.62)},i.applyStyles("dark",{backgroundColor:de.darken(i.palette[e].main,.5)}),i.applyStyles("dark",{borderColor:de.darken(i.palette[e].main,.5)})))}))]}}),Fr=ne("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.thumb,t[`thumbColor${Yt(e.color)}`],e.size!=="medium"&&t[`thumbSize${Yt(e.size)}`]]}})(({theme:i})=>{var t;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:i.transitions.create(["box-shadow","left","bottom"],{duration:i.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(i.vars||i).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${_t.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{[`&:hover, &.${_t.focusVisible}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 8px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${de.alpha(i.palette[e].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${_t.active}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 14px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${de.alpha(i.palette[e].main,.16)}`})}}))]}}),Hr=ne(Ar,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(i,t)=>t.valueLabel})(({theme:i})=>Y({zIndex:1,whiteSpace:"nowrap"},i.typography.body2,{fontWeight:500,transition:i.transitions.create(["transform"],{duration:i.transitions.duration.shortest}),position:"absolute",backgroundColor:(i.vars||i).palette.grey[600],borderRadius:2,color:(i.vars||i).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:i.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),Br=ne("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:i=>no(i)&&i!=="markActive",overridesResolver:(i,t)=>{const{markActive:e}=i;return[t.mark,e&&t.markActive]}})(({theme:i})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(i.vars||i).palette.background.paper,opacity:.8}}]})),jr=ne("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:i=>no(i)&&i!=="markLabelActive",overridesResolver:(i,t)=>t.markLabel})(({theme:i})=>Y({},i.typography.body2,{color:(i.vars||i).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(i.vars||i).palette.text.primary}}]})),Nr=i=>{const{disabled:t,dragging:e,marked:s,orientation:n,track:o,classes:r,color:a,size:l}=i,c={root:["root",t&&"disabled",e&&"dragging",s&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Yt(a)}`,l&&`size${Yt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Yt(l)}`,a&&`thumbColor${Yt(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return ur(c,Dr,r)},Wr=({children:i})=>i,$r=I.forwardRef(function(t,e){var s,n,o,r,a,l,c,h,d,u,f,p,g,m,b,y,k,S,x,C,w,v,P,E;const D=cr({props:t,name:"MuiSlider"}),z=hr(),{"aria-label":G,"aria-valuetext":nt,"aria-labelledby":R,component:Q="span",components:j={},componentsProps:rt={},color:A="primary",classes:T,className:Z,disableSwap:X=!1,disabled:H=!1,getAriaLabel:B,getAriaValueText:ht,marks:gt=!1,max:re=100,min:ae=0,orientation:Ve="horizontal",shiftStep:Di=10,size:Li="medium",step:Ye=1,scale:Rt=Ys,slotProps:it,slots:et,track:wt="normal",valueLabelDisplay:Nt="off",valueLabelFormat:Mt=Ys}=D,Ai=dr(D,Ir),dt=Y({},D,{isRtl:z,max:re,min:ae,classes:T,disabled:H,disableSwap:X,orientation:Ve,marks:gt,color:A,size:Li,step:Ye,shiftStep:Di,scale:Rt,track:wt,valueLabelDisplay:Nt,valueLabelFormat:Mt}),{axisProps:le,getRootProps:Ii,getHiddenInputProps:Ri,getThumbProps:Ei,open:As,active:zi,axis:xe,focusedThumbIndex:_,range:M,dragging:O,marks:$,values:V,trackOffset:N,trackLeap:Ct,getThumbStyle:Ot}=Tr(Y({},dt,{rootRef:e}));dt.marked=$.length>0&&$.some(ot=>ot.label),dt.dragging=O,dt.focusedThumbIndex=_;const K=Nr(dt),bt=(s=(n=et==null?void 0:et.root)!=null?n:j.Root)!=null?s:Rr,ce=(o=(r=et==null?void 0:et.rail)!=null?r:j.Rail)!=null?o:Er,Is=(a=(l=et==null?void 0:et.track)!=null?l:j.Track)!=null?a:zr,Rs=(c=(h=et==null?void 0:et.thumb)!=null?h:j.Thumb)!=null?c:Fr,Es=(d=(u=et==null?void 0:et.valueLabel)!=null?u:j.ValueLabel)!=null?d:Hr,Fi=(f=(p=et==null?void 0:et.mark)!=null?p:j.Mark)!=null?f:Br,Hi=(g=(m=et==null?void 0:et.markLabel)!=null?m:j.MarkLabel)!=null?g:jr,zs=(b=(y=et==null?void 0:et.input)!=null?y:j.Input)!=null?b:"input",Bi=(k=it==null?void 0:it.root)!=null?k:rt.root,Xo=(S=it==null?void 0:it.rail)!=null?S:rt.rail,ji=(x=it==null?void 0:it.track)!=null?x:rt.track,Ni=(C=it==null?void 0:it.thumb)!=null?C:rt.thumb,Wi=(w=it==null?void 0:it.valueLabel)!=null?w:rt.valueLabel,Ko=(v=it==null?void 0:it.mark)!=null?v:rt.mark,qo=(P=it==null?void 0:it.markLabel)!=null?P:rt.markLabel,Go=(E=it==null?void 0:it.input)!=null?E:rt.input,Zo=Wt({elementType:bt,getSlotProps:Ii,externalSlotProps:Bi,externalForwardedProps:Ai,additionalProps:Y({},Or(bt)&&{as:Q}),ownerState:Y({},dt,Bi==null?void 0:Bi.ownerState),className:[K.root,Z]}),Qo=Wt({elementType:ce,externalSlotProps:Xo,ownerState:dt,className:K.rail}),Jo=Wt({elementType:Is,externalSlotProps:ji,additionalProps:{style:Y({},le[xe].offset(N),le[xe].leap(Ct))},ownerState:Y({},dt,ji==null?void 0:ji.ownerState),className:K.track}),$i=Wt({elementType:Rs,getSlotProps:Ei,externalSlotProps:Ni,ownerState:Y({},dt,Ni==null?void 0:Ni.ownerState),className:K.thumb}),tr=Wt({elementType:Es,externalSlotProps:Wi,ownerState:Y({},dt,Wi==null?void 0:Wi.ownerState),className:K.valueLabel}),Vi=Wt({elementType:Fi,externalSlotProps:Ko,ownerState:dt,className:K.mark}),Yi=Wt({elementType:Hi,externalSlotProps:qo,ownerState:dt,className:K.markLabel}),er=Wt({elementType:zs,getSlotProps:Ri,externalSlotProps:Go,ownerState:dt});return L.jsxs(bt,Y({},Zo,{children:[L.jsx(ce,Y({},Qo)),L.jsx(Is,Y({},Jo)),$.filter(ot=>ot.value>=ae&&ot.value<=re).map((ot,ct)=>{const Ui=xi(ot.value,ae,re),Ue=le[xe].offset(Ui);let Et;return wt===!1?Et=V.indexOf(ot.value)!==-1:Et=wt==="normal"&&(M?ot.value>=V[0]&&ot.value<=V[V.length-1]:ot.value<=V[0])||wt==="inverted"&&(M?ot.value<=V[0]||ot.value>=V[V.length-1]:ot.value>=V[0]),L.jsxs(I.Fragment,{children:[L.jsx(Fi,Y({"data-index":ct},Vi,!fi(Fi)&&{markActive:Et},{style:Y({},Ue,Vi.style),className:ue(Vi.className,Et&&K.markActive)})),ot.label!=null?L.jsx(Hi,Y({"aria-hidden":!0,"data-index":ct},Yi,!fi(Hi)&&{markLabelActive:Et},{style:Y({},Ue,Yi.style),className:ue(K.markLabel,Yi.className,Et&&K.markLabelActive),children:ot.label})):null]},ct)}),V.map((ot,ct)=>{const Ui=xi(ot,ae,re),Ue=le[xe].offset(Ui),Et=Nt==="off"?Wr:Es;return L.jsx(Et,Y({},!fi(Et)&&{valueLabelFormat:Mt,valueLabelDisplay:Nt,value:typeof Mt=="function"?Mt(Rt(ot),ct):Mt,index:ct,open:As===ct||zi===ct||Nt==="on",disabled:H},tr,{children:L.jsx(Rs,Y({"data-index":ct},$i,{className:ue(K.thumb,$i.className,zi===ct&&K.active,_===ct&&K.focusVisible),style:Y({},Ue,Ot(ct),$i.style),children:L.jsx(zs,Y({"data-index":ct,"aria-label":B?B(ct):G,"aria-valuenow":Rt(ot),"aria-labelledby":R,"aria-valuetext":ht?ht(Rt(ot),ct):nt,value:V[ct]},er))}))}),ct)})]}))});/*!
|
|
2
|
+
* @kurkle/color v0.3.4
|
|
3
|
+
* https://github.com/kurkle/color#readme
|
|
4
|
+
* (c) 2024 Jukka Kurkela
|
|
5
|
+
* Released under the MIT License
|
|
6
|
+
*/function We(i){return i+.5|0}const Ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Me(i){return Ut(We(i*2.55),0,255)}function Xt(i){return Ut(We(i*255),0,255)}function Bt(i){return Ut(We(i/2.55)/100,0,1)}function Us(i){return Ut(We(i*100),0,100)}const xt={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},ns=[..."0123456789ABCDEF"],Vr=i=>ns[i&15],Yr=i=>ns[(i&240)>>4]+ns[i&15],Qe=i=>(i&240)>>4===(i&15),Ur=i=>Qe(i.r)&&Qe(i.g)&&Qe(i.b)&&Qe(i.a);function Xr(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}const Kr=(i,t)=>i<255?t(i):"";function qr(i){var t=Ur(i)?Vr:Yr;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Kr(i.a,t):void 0}const Gr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ro(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Zr(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Qr(i,t,e){const s=ro(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Jr(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function bs(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Jr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Xt)}function _s(i,t,e){return xs(ro,i,t,e)}function ta(i,t,e){return xs(Qr,i,t,e)}function ea(i,t,e){return xs(Zr,i,t,e)}function ao(i){return(i%360+360)%360}function ia(i){const t=Gr.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Me(+t[5]):Xt(+t[5]));const n=ao(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=ta(n,o,r):t[1]==="hsv"?s=ea(n,o,r):s=_s(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function sa(i,t){var e=bs(i);e[0]=ao(e[0]+t),e=_s(e),i.r=e[0],i.g=e[1],i.b=e[2]}function na(i){if(!i)return;const t=bs(i),e=t[0],s=Us(t[1]),n=Us(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Bt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Xs={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"},Ks={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function oa(){const i={},t=Object.keys(Ks),e=Object.keys(Xs);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,Xs[o]);o=parseInt(Ks[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let Je;function ra(i){Je||(Je=oa(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const aa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function la(i){const t=aa.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Me(r):Ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Me(s):Ut(s,0,255)),n=255&(t[4]?Me(n):Ut(n,0,255)),o=255&(t[6]?Me(o):Ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function ca(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Bt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ha(i,t,e){const s=he(Bt(i.r)),n=he(Bt(i.g)),o=he(Bt(i.b));return{r:Xt(qi(s+e*(he(Bt(t.r))-s))),g:Xt(qi(n+e*(he(Bt(t.g))-n))),b:Xt(qi(o+e*(he(Bt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ti(i,t,e){if(i){let s=bs(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_s(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function lo(i,t){return i&&Object.assign(t||{},i)}function qs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Xt(i[3]))):(t=lo(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function da(i){return i.charAt(0)==="r"?la(i):ia(i)}class ze{constructor(t){if(t instanceof ze)return t;const e=typeof t;let s;e==="object"?s=qs(t):e==="string"&&(s=Xr(t)||ra(t)||da(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=lo(this._rgb);return t&&(t.a=Bt(t.a)),t}set rgb(t){this._rgb=qs(t)}rgbString(){return this._valid?ca(this._rgb):void 0}hexString(){return this._valid?qr(this._rgb):void 0}hslString(){return this._valid?na(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ha(this._rgb,t._rgb,e)),this}clone(){return new ze(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=We(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 ti(this._rgb,2,t),this}darken(t){return ti(this._rgb,2,-t),this}saturate(t){return ti(this._rgb,1,t),this}desaturate(t){return ti(this._rgb,1,-t),this}rotate(t){return sa(this._rgb,t),this}}/*!
|
|
7
|
+
* Chart.js v4.4.8
|
|
8
|
+
* https://www.chartjs.org
|
|
9
|
+
* (c) 2025 Chart.js Contributors
|
|
10
|
+
* Released under the MIT License
|
|
11
|
+
*/function zt(){}const ua=(()=>{let i=0;return()=>i++})();function J(i){return i==null}function at(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function U(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function kt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,t){return kt(i)?i:t}function W(i,t){return typeof i>"u"?t:i}const fa=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function tt(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function q(i,t,e,s){let n,o,r;if(at(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(U(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function _i(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function yi(i){if(at(i))return i.map(yi);if(U(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=yi(i[e[n]]);return t}return i}function co(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ga(i,t,e,s){if(!co(i))return;const n=t[i],o=e[i];U(n)&&U(o)?Fe(n,o,s):t[i]=yi(o)}function Fe(i,t,e){const s=at(t)?t:[t],n=s.length;if(!U(i))return i;e=e||{};const o=e.merger||ga;let r;for(let a=0;a<n;++a){if(r=s[a],!U(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function De(i,t){return Fe(i,t,{merger:pa})}function pa(i,t,e){if(!co(i))return;const s=t[i],n=e[i];U(s)&&U(n)?De(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=yi(n))}const Gs={"":i=>i,x:i=>i.x,y:i=>i.y};function ma(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function ba(i){const t=ma(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function vi(i,t){return(Gs[t]||(Gs[t]=ba(t)))(i)}function ys(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ki=i=>typeof i<"u",Kt=i=>typeof i=="function",Zs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const lt=Math.PI,It=2*lt,_a=It+lt,Si=Number.POSITIVE_INFINITY,ya=lt/180,Tt=lt/2,qt=lt/4,Qs=lt*2/3,os=Math.log10,ge=Math.sign;function Le(i,t,e){return Math.abs(i-t)<e}function Js(i){const t=Math.round(i);i=Le(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(os(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function va(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function ka(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function He(i){return!ka(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Sa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wa(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function te(i){return i*(lt/180)}function Ma(i){return i*(180/lt)}function tn(i){if(!kt(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Ca(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*lt&&(o+=It),{angle:o,distance:n}}function rs(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Pa(i,t){return(i-t+_a)%It-lt}function Vt(i){return(i%It+It)%It}function ho(i,t,e,s){const n=Vt(i),o=Vt(t),r=Vt(e),a=Vt(o-n),l=Vt(r-n),c=Vt(n-o),h=Vt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function yt(i,t,e){return Math.max(t,Math.min(e,i))}function Ta(i){return yt(i,-32768,32767)}function Ce(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function vs(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const ee=(i,t,e,s)=>vs(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Oa=(i,t,e)=>vs(i,e,s=>i[s][t]>=e);function Da(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const uo=["push","pop","shift","splice","unshift"];function La(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),uo.forEach(e=>{const s="_onData"+ys(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function en(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(uo.forEach(o=>{delete i[o]}),delete i._chartjs)}function Aa(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const fo=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function go(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,fo.call(window,()=>{s=!1,i.apply(t,e)}))}}function Ia(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ks=i=>i==="start"?"left":i==="end"?"right":"center",ut=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ra=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Ea(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(ee(l,h,d).lo,e?s:ee(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!J(m[a.axis]));n-=Math.max(0,g)}n=yt(n,0,s-1)}if(p){let g=Math.max(ee(l,r.axis,u,!0).hi+1,e?0:ee(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!J(b[a.axis]));g+=Math.max(0,m)}o=yt(g,n,s)-n}else o=s-n}return{start:n,count:o}}function za(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ei=i=>i===0||i===1,sn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*It/e)),nn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*It/e)+1,Ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Tt)+1,easeOutSine:i=>Math.sin(i*Tt),easeInOutSine:i=>-.5*(Math.cos(lt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ei(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ei(i)?i:sn(i,.075,.3),easeOutElastic:i=>ei(i)?i:nn(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*sn(i*2,.1125,.45):.5+.5*nn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function Ss(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function on(i){return Ss(i)?i:new ze(i)}function Gi(i){return Ss(i)?i:new ze(i).saturate(.5).darken(.1).hexString()}const Fa=["x","y","borderWidth","radius","tension"],Ha=["color","borderColor","backgroundColor"];function Ba(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Ha},numbers:{type:"number",properties:Fa}}),i.describe("animations",{_fallback:"animation"}),i.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=>t|0}}}})}function ja(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rn=new Map;function Na(i,t){t=t||{};const e=i+JSON.stringify(t);let s=rn.get(e);return s||(s=new Intl.NumberFormat(i,t),rn.set(e,s)),s}function po(i,t,e){return Na(t,e).format(i)}const mo={values(i){return at(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Wa(i,e)}const r=os(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),po(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(os(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?mo.numeric.call(this,i,t,e):""}};function Wa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var bo={formatters:mo};function $a(i){i.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,e)=>e.lineWidth,tickColor:(t,e)=>e.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:bo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const se=Object.create(null),as=Object.create(null);function Ie(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Zi(i,t,e){return typeof t=="string"?Fe(Ie(i,t),e):Fe(Ie(i,""),t)}class Va{constructor(t,e){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=s=>s.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=(s,n)=>Gi(n.backgroundColor),this.hoverBorderColor=(s,n)=>Gi(n.borderColor),this.hoverColor=(s,n)=>Gi(n.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(e)}set(t,e){return Zi(this,t,e)}get(t){return Ie(this,t)}describe(t,e){return Zi(as,t,e)}override(t,e){return Zi(se,t,e)}route(t,e,s,n){const o=Ie(this,t),r=Ie(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return U(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var st=new Va({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ba,ja,$a]);function Ya(i){return!i||J(i.size)||J(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function an(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Gt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function ln(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ls(i,t,e,s){xo(i,t,e,s,null)}function xo(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*ya;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,It):i.arc(e,s,g,0,It),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+qt)*l,d=Math.cos(m+qt)*(n?n/2-c:l),a=Math.sin(m+qt)*l,u=Math.sin(m+qt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-lt,m-Tt),i.arc(e+u,s-r,c,m-Tt,m),i.arc(e+d,s+a,c,m,m+Tt),i.arc(e-u,s+r,c,m+Tt,m+lt),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=qt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":m+=qt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),m+=qt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Be(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ws(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Ms(i){i.restore()}function Ua(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Xa(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Ka(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),J(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function qa(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function Ga(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function je(i,t,e,s,n,o={}){const r=at(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ka(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Ga(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),J(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),qa(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function cs(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*lt,lt,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,lt,Tt,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,Tt,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-Tt,!0),i.lineTo(e+r.topLeft,s)}const Za=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qa=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ja(i,t){const e=(""+i).match(Za);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const tl=i=>+i||0;function _o(i,t){const e={},s=U(t),n=s?Object.keys(t):t,o=U(i)?s?r=>W(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=tl(o(r));return e}function el(i){return _o(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(i){return _o(i,["topLeft","topRight","bottomLeft","bottomRight"])}function St(i){const t=el(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(i,t){i=i||{},t=t||st.font;let e=W(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=W(i.style,t.style);s&&!(""+s).match(Qa)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:W(i.family,t.family),lineHeight:Ja(W(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:W(i.weight,t.weight),string:""};return n.string=Ya(n),n}function ii(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&r!==void 0)return r}function il(i,t,e){const{min:s,max:n}=i,o=fa(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function oe(i,t){return Object.assign(Object.create(i),t)}function Cs(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=So("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Cs([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return vo(a,l,()=>hl(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return hn(a).includes(l)},ownKeys(a){return hn(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function pe(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:yo(i,s),setContext:o=>pe(i,o,e,s),override:o=>pe(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return vo(o,r,()=>nl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function yo(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Kt(e)?e:()=>e,isIndexable:Kt(s)?s:()=>s}}const sl=(i,t)=>i?i+ys(t):t,Ps=(i,t)=>U(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function nl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return Kt(a)&&r.isScriptable(t)&&(a=ol(t,a,i,e)),at(a)&&a.length&&(a=rl(t,a,i,r.isIndexable)),Ps(t,a)&&(a=pe(a,n,o&&o[t],r)),a}function ol(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ps(i,l)&&(l=Ts(n._scopes,n,i,l)),l}function rl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(U(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ts(c,n,i,h);t.push(pe(d,o,r&&r[i],a))}}return t}function ko(i,t,e){return Kt(i)?i(t,e):i}const al=(i,t)=>i===!0?t:typeof i=="string"?vi(t,i):void 0;function ll(i,t,e,s,n){for(const o of t){const r=al(e,o);if(r){i.add(r);const a=ko(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ts(i,t,e,s){const n=t._rootScopes,o=ko(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=cn(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=cn(a,r,o,l,s),l===null)?!1:Cs(Array.from(a),[""],n,o,()=>cl(t,e,s))}function cn(i,t,e,s,n){for(;e;)e=ll(i,t,e,s,n);return e}function cl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return at(n)&&U(e)?e:n||{}}function hl(i,t,e,s){let n;for(const o of t)if(n=So(sl(o,i),e),typeof n<"u")return Ps(i,n)?Ts(e,s,i,n):n}function So(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function hn(i){let t=i._keys;return t||(t=i._keys=dl(i._scopes)),t}function dl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const ul=Number.EPSILON||1e-14,me=(i,t)=>t<i.length&&!i[t].skip&&i[t],wo=i=>i==="x"?"y":"x";function fl(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=rs(o,n),l=rs(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function gl(i,t,e){const s=i.length;let n,o,r,a,l,c=me(i,0);for(let h=0;h<s-1;++h)if(l=c,c=me(i,h+1),!(!l||!c)){if(Le(t[h],0,ul)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function pl(i,t,e="x"){const s=wo(e),n=i.length;let o,r,a,l=me(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=me(i,c+1),!a)continue;const h=a[e],d=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function ml(i,t="x"){const e=wo(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=me(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=me(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?ge(n[r-1])!==ge(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}gl(i,n,o),pl(i,o,t)}function si(i,t,e){return Math.max(Math.min(i,e),t)}function bl(i,t){let e,s,n,o,r,a=Be(i[0],t);for(e=0,s=i.length;e<s;++e)r=o,o=a,a=e<s-1&&Be(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=si(n.cp1x,t.left,t.right),n.cp1y=si(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=si(n.cp2x,t.left,t.right),n.cp2y=si(n.cp2y,t.top,t.bottom)))}function xl(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ml(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=fl(c,a,i[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&bl(i,e)}function Os(){return typeof window<"u"&&typeof document<"u"}function Ds(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wi(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Pi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function _l(i,t){return Pi(i).getPropertyValue(t)}const yl=["top","right","bottom","left"];function ie(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=yl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const vl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(vl(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Pi(e),o=n.boxSizing==="border-box",r=ie(n,"padding"),a=ie(n,"border","width"),{x:l,y:c,box:h}=kl(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Sl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ds(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Pi(o),l=ie(a,"border","width"),c=ie(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=wi(a.maxWidth,o,"clientWidth"),n=wi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Si,maxHeight:n||Si}}const ni=i=>Math.round(i*10)/10;function wl(i,t,e,s){const n=Pi(i),o=ie(n,"margin"),r=wi(n.maxWidth,i,"clientWidth")||Si,a=wi(n.maxHeight,i,"clientHeight")||Si,l=Sl(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=ie(n,"border","width"),f=ie(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ni(Math.min(c,r,l.maxWidth)),h=ni(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ni(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ni(Math.floor(h*s))),{width:c,height:h}}function dn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ml=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Os()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function un(i,t){const e=_l(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Jt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Cl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Jt(i,n,e),a=Jt(n,o,e),l=Jt(o,t,e),c=Jt(r,a,e),h=Jt(a,l,e);return Jt(c,h,e)}const Tl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ol=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function fe(i,t,e){return i?Tl(t,e):Ol()}function Mo(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Co(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Po(i){return i==="angle"?{between:ho,compare:Pa,normalize:Vt}:{between:Ce,compare:(t,e)=>t-e,normalize:t=>t}}function fn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Dl(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Po(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function Ll(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Po(s),{start:h,end:d,loop:u,style:f}=Dl(i,t,e),p=[];let g=!1,m=null,b,y,k;const S=()=>l(n,k,b)&&a(n,k)!==0,x=()=>a(o,b)===0||l(o,k,b),C=()=>g||S(),w=()=>!g||x();for(let v=h,P=h;v<=d;++v)y=t[v%r],!y.skip&&(b=c(y[s]),b!==k&&(g=l(b,n,o),m===null&&C()&&(m=a(b,n)===0?v:P),m!==null&&w()&&(p.push(fn({start:m,end:v,loop:u,count:r,style:f})),m=null),P=v,k=b));return m!==null&&p.push(fn({start:m,end:d,loop:u,count:r,style:f})),p}function Al(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=Ll(s[n],i.points,t);o.length&&e.push(...o)}return e}function Il(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Rl(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function El(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Il(e,n,o,s);if(s===!0)return gn(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return gn(i,Rl(e,r,l,c),e,t)}function gn(i,t,e,s){return!s||!s.setContext||!e?t:zl(i,t,e,s)}function zl(i,t,e,s){const n=i._chart.getContext(),o=pn(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(p,g,m,b){const y=a?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=y;for(;e[g%l].skip;)g+=y;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(const p of t){d=a?d:p.start;let g=e[d%l],m;for(u=d+1;u<=p.end;u++){const b=e[u%l];m=pn(s.setContext(oe(n,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Fl(m,h)&&f(d,u-1,p.loop,h),g=b,h=m}d<u-1&&f(d,u-1,p.loop,h)}return c}function pn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Fl(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ss(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
|
|
12
|
+
* Chart.js v4.4.8
|
|
13
|
+
* https://www.chartjs.org
|
|
14
|
+
* (c) 2025 Chart.js Contributors
|
|
15
|
+
* Released under the MIT License
|
|
16
|
+
*/class Hl{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ft=new Hl;const mn="transparent",Bl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=on(i||mn),n=s.valid&&on(t||mn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class jl{constructor(t,e,s,n){const o=e[s];n=ii([t.to,n,o,t.from]);const r=ii([t.from,o,n]);this._active=!0,this._fn=t.fn||Bl[t.type||typeof r],this._easing=Ae[t.easing]||Ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ii([t.to,e,n,t.from]),this._from=ii([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class To{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!U(t))return;const e=Object.keys(st.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!U(o))return;const r={};for(const a of e)r[a]=o[a];(at(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Wl(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Nl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new jl(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ft.add(this._chart,s),!0}}function Nl(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Wl(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function bn(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function $l(i,t,e){if(e===!1)return!1;const s=bn(i,e),n=bn(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Vl(i){let t,e,s,n;return U(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Oo(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function xn(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],kt(c)&&(o||t===0||ge(t)===ge(c))&&(t+=c)}return!h&&!s.all?0:t}function Yl(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Qi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ul(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Xl(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Kl(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function _n(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function yn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Ul(o,r,s),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=Kl(n,h,g),u[a]=m,u._top=_n(u,r,!0,s.type),u._bottom=_n(u,r,!1,s.type);const y=u._visualValues||(u._visualValues={});y[a]=m}}function Ji(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function ql(i,t){return oe(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gl(i,t,e){return oe(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",vn=(i,t)=>t?i:Object.assign({},i),Zl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Oo(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=Qi(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&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=W(s.xAxisID,Ji(t,"x")),r=e.yAxisID=W(s.yAxisID,Ji(t,"y")),a=e.rAxisID=W(s.rAxisID,Ji(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&en(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(U(e)){const n=this._cachedMeta;this._data=Yl(e,n)}else if(s!==e){if(s){en(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&La(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Qi(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(yn(this,e._parsed),e._stacked=Qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{at(n[t])?u=this.parseArrayData(s,n,t,e):U(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}r&&yn(this,u)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+s,d[u]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+s,f=e[u],c[h]={x:o.parse(vi(f,a),u),y:r.parse(vi(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Oo(n,!0),values:e._stacks[t.axis]._visualValues};return xn(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=xn(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=Zl(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Xl(a);let u,f;function p(){f=n[u];const g=f[a.axis];return!kt(f[t.axis])||h>g||d<g}for(u=0;u<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],kt(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Vl(W(this.options.clip,$l(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Gl(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ql(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ki(s);if(a)return vn(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(st.elements[t]),p=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new To(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"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 e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&ye(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}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,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}F(Ee,"defaults",{}),F(Ee,"datasetElementType",null),F(Ee,"dataElementType",null);class gi extends Ee{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Ea(e,n,r);this._drawStart=a,this._drawCount=l,za(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=He(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",y=e+s,k=t.length;let S=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const C=t[x],w=b?C:{};if(x<e||x>=y){w.skip=!0;continue}const v=this.getParsed(x),P=J(v[f]),E=w[u]=r.getPixelForValue(v[u],x),D=w[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[f],x);w.skip=isNaN(E)||isNaN(D)||P,w.stop=x>0&&Math.abs(v[u]-S[u])>m,g&&(w.parsed=v,w.raw=c.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,C.active?"active":n)),b||this.updateElement(C,x,w,n),S=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}F(gi,"id","line"),F(gi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(gi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Zt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ls{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(Ls.prototype,t)}init(){}formats(){return Zt()}parse(){return Zt()}format(){return Zt()}add(){return Zt()}diff(){return Zt()}startOf(){return Zt()}endOf(){return Zt()}}var Ql={_date:Ls};function Jl(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Oa:ee;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!J(g[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(g=>!J(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function $e(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=Jl(o[a],t,r,n);for(let f=d;f<=u;++f){const p=h[f];p.skip||s(p,c,f)}}}function tc(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function es(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||$e(i,e,t,function(a,l,c){!n&&!Be(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ec(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Ca(r,{x:t.x,y:t.y});ho(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return $e(i,e,t,o),n}function ic(i,t,e,s,n,o){let r=[];const a=tc(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!f)return;const m=a(t,p);m<l?(r=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:u})}return $e(i,e,t,c),r}function is(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?ec(i,t,e,n):ic(i,t,e,s,n,o)}function kn(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return $e(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var sc={evaluateInteractionItems:$e,modes:{index(i,t,e,s){const n=Qt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return es(i,n,o,s,r)},nearest(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return is(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=Qt(t,i);return kn(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Qt(t,i);return kn(i,n,"y",e.intersect,s)}}};const Do=["left","top","right","bottom"];function ve(i,t){return i.filter(e=>e.pos===t)}function Sn(i,t){return i.filter(e=>Do.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nc(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function oc(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!Do.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function rc(i,t){const e=oc(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function ac(i){const t=nc(i),e=ke(t.filter(c=>c.box.fullSize),!0),s=ke(ve(t,"left"),!0),n=ke(ve(t,"right")),o=ke(ve(t,"top"),!0),r=ke(ve(t,"bottom")),a=Sn(t,"x"),l=Sn(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ve(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function wn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Lo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function lc(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!U(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Lo(r,o.getPadding());const a=Math.max(0,t.outerWidth-wn(r,i,"left","right")),l=Math.max(0,t.outerHeight-wn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function cc(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function hc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Pe(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,hc(a.horizontal,t));const{same:d,other:u}=lc(t,e,a,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&Pe(n,t,e,s)||h}function oi(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Mn(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;ki(c.start)&&(r=c.start),l.fullSize?oi(l,n.left,r,e.outerWidth-n.right-n.left,u):oi(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;ki(c.start)&&(o=c.start),l.fullSize?oi(l,o,n.top,u,e.outerHeight-n.bottom-n.top):oi(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var vt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=St(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=ac(i.boxes),l=a.vertical,c=a.horizontal;q(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Lo(u,St(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=rc(l.concat(c),d);Pe(a.fullSize,f,d,p),Pe(l,f,d,p),Pe(c,f,d,p)&&Pe(l,f,d,p),cc(f),Mn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Mn(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},q(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ao{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class dc extends Ao{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pi="$chartjs",uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cn=i=>i===null||i==="";function fc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[pi]={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",Cn(n)){const o=un(i,"width");o!==void 0&&(i.width=o)}if(Cn(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=un(i,"height");o!==void 0&&(i.height=o)}return i}const Io=Ml?{passive:!0}:!1;function gc(i,t,e){i&&i.addEventListener(t,e,Io)}function pc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Io)}function mc(i,t){const e=uc[i.type]||i.type,{x:s,y:n}=Qt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Mi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function bc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.addedNodes,s),r=r&&!Mi(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function xc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.removedNodes,s),r=r&&!Mi(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ne=new Map;let Pn=0;function Ro(){const i=window.devicePixelRatio;i!==Pn&&(Pn=i,Ne.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function _c(i,t){Ne.size||window.addEventListener("resize",Ro),Ne.set(i,t)}function yc(i){Ne.delete(i),Ne.size||window.removeEventListener("resize",Ro)}function vc(i,t,e){const s=i.canvas,n=s&&Ds(s);if(!n)return;const o=go((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),_c(i,o),r}function ss(i,t,e){e&&e.disconnect(),t==="resize"&&yc(i)}function kc(i,t,e){const s=i.canvas,n=go(o=>{i.ctx!==null&&e(mc(o,i))},i);return gc(s,t,n),n}class Sc extends Ao{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(fc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[pi])return!1;const s=e[pi].initial;["height","width"].forEach(o=>{const r=s[o];J(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[pi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:bc,detach:xc,resize:vc}[e]||kc;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ss,detach:ss,resize:ss}[e]||pc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return wl(t,e,s,n)}isAttached(t){const e=t&&Ds(t);return!!(e&&e.isConnected)}}function wc(i){return!Os()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?dc:Sc}class jt{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return He(this.x)&&He(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}F(jt,"defaults",{}),F(jt,"defaultRoutes");function Mc(i,t){const e=i.options.ticks,s=Cc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Tc(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Oc(t,c,o,r/n),c;const h=Pc(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ri(t,c,h,J(f)?0:a-f,a),d=0,u=r-1;d<u;d++)ri(t,c,h,o[d],o[d+1]);return ri(t,c,h,l,J(f)?t.length:l+f),c}return ri(t,c,h),c}function Cc(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Pc(i,t,e){const s=Dc(i),n=t.length/e;if(!s)return Math.max(n,1);const o=va(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Tc(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Oc(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function ri(i,t,e,s,n){const o=W(s,0),r=Math.min(W(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Dc(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Lc=i=>i==="left"?"right":i==="right"?"left":i,Tn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,On=(i,t)=>Math.min(t||i,i);function Dn(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Ac(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function Ic(i,t){q(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Se(i){return i.drawTicks?i.tickLength:0}function Ln(i,t){if(!i.display)return 0;const e=ft(i.font,t),s=St(i.padding);return(at(i.text)?i.text.length:1)*e.lineHeight+s.height}function Rc(i,t){return oe(i,{scale:t,type:"scale"})}function Ec(i,t,e){return oe(i,{tick:e,index:t,type:"tick"})}function zc(i,t,e){let s=ks(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Lc(s)),s}function Fc(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,p;const g=r-n,m=a-o;if(i.isHorizontal()){if(f=ut(s,o,a),U(e)){const b=Object.keys(e)[0],y=e[b];p=h[b].getPixelForValue(y)+g-t}else e==="center"?p=(c.bottom+c.top)/2+g-t:p=Tn(i,e,t);u=a-o}else{if(U(e)){const b=Object.keys(e)[0],y=e[b];f=h[b].getPixelForValue(y)-m+t}else e==="center"?f=(c.left+c.right)/2-m+t:f=Tn(i,e,t);p=ut(s,r,n),d=e==="left"?-Tt:Tt}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class be extends jt{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,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=Dt(t,Number.POSITIVE_INFINITY),e=Dt(e,Number.NEGATIVE_INFINITY),s=Dt(s,Number.POSITIVE_INFINITY),n=Dt(n,Number.NEGATIVE_INFINITY),{min:Dt(t,s),max:Dt(e,n),minDefined:kt(t),maxDefined:kt(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:Dt(e,Dt(s,e)),max:Dt(s,Dt(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(){tt(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=il(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Dn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Mc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){tt(this.options.afterUpdate,[this])}beforeSetDimensions(){tt(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(){tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=tt(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=On(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=yt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Se(t.grid)-e.padding-Ln(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ma(Math.min(Math.asin(yt((h.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ln(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Se(o)+l):(t.height=this.maxHeight,t.width=Se(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=te(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+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(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)J(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Dn(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/On(e,s));let c=0,h=0,d,u,f,p,g,m,b,y,k,S,x;for(d=0;d<e;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},y=g.lineHeight,k=S=0,!J(p)&&!at(p))k=an(n,b.data,b.gc,k,p),S=y;else if(at(p))for(u=0,f=p.length;u<f;++u)x=p[u],!J(x)&&!at(x)&&(k=an(n,b.data,b.gc,k,x),S+=y);r.push(k),a.push(S),c=Math.max(k,c),h=Math.max(S,h)}Ic(o,e);const C=r.indexOf(c),w=a.indexOf(h),v=P=>({width:r[P]||0,height:a[P]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ta(this._alignToPixels?Gt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Ec(this.getContext(),t,s))}return this.$context||(this.$context=Rc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=te(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Se(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(Q){return Gt(s,Q,g)};let y,k,S,x,C,w,v,P,E,D,z,G;if(r==="top")y=b(this.bottom),w=this.bottom-u,P=y-m,D=b(t.top)+m,G=t.bottom;else if(r==="bottom")y=b(this.top),D=t.top,G=b(t.bottom)-m,w=y+m,P=this.top+u;else if(r==="left")y=b(this.right),C=this.right-u,v=y-m,E=b(t.left)+m,z=t.right;else if(r==="right")y=b(this.left),E=t.left,z=b(t.right)-m,C=y+m,v=this.left+u;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}D=t.top,G=t.bottom,w=y+m,P=w+u}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}C=y-m,v=C-u,E=t.left,z=t.right}const nt=W(n.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/nt));for(k=0;k<d;k+=R){const Q=this.getContext(k),j=o.setContext(Q),rt=a.setContext(Q),A=j.lineWidth,T=j.color,Z=rt.dash||[],X=rt.dashOffset,H=j.tickWidth,B=j.tickColor,ht=j.tickBorderDash||[],gt=j.tickBorderDashOffset;S=Ac(this,k,l),S!==void 0&&(x=Gt(s,S,A),c?C=v=E=z=x:w=P=D=G=x,f.push({tx1:C,ty1:w,tx2:v,ty2:P,x1:E,y1:D,x2:z,y2:G,width:A,color:T,borderDash:Z,borderDashOffset:X,tickWidth:H,tickColor:B,tickBorderDash:ht,tickBorderDashOffset:gt}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Se(s.grid),f=u+h,p=d?-h:f,g=-te(this.labelRotation),m=[];let b,y,k,S,x,C,w,v,P,E,D,z,G="middle";if(n==="top")C=this.bottom-p,w=this._getXAxisLabelAlignment();else if(n==="bottom")C=this.top+p,w=this._getXAxisLabelAlignment();else if(n==="left"){const R=this._getYAxisLabelAlignment(u);w=R.textAlign,x=R.x}else if(n==="right"){const R=this._getYAxisLabelAlignment(u);w=R.textAlign,x=R.x}else if(e==="x"){if(n==="center")C=(t.top+t.bottom)/2+f;else if(U(n)){const R=Object.keys(n)[0],Q=n[R];C=this.chart.scales[R].getPixelForValue(Q)+f}w=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")x=(t.left+t.right)/2-f;else if(U(n)){const R=Object.keys(n)[0],Q=n[R];x=this.chart.scales[R].getPixelForValue(Q)}w=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?G="top":l==="end"&&(G="bottom"));const nt=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){k=a[b],S=k.label;const R=o.setContext(this.getContext(b));v=this.getPixelForTick(b)+o.labelOffset,P=this._resolveTickFontOptions(b),E=P.lineHeight,D=at(S)?S.length:1;const Q=D/2,j=R.color,rt=R.textStrokeColor,A=R.textStrokeWidth;let T=w;r?(x=v,w==="inner"&&(b===y-1?T=this.options.reverse?"left":"right":b===0?T=this.options.reverse?"right":"left":T="center"),n==="top"?c==="near"||g!==0?z=-D*E+E/2:c==="center"?z=-nt.highest.height/2-Q*E+E:z=-nt.highest.height+E/2:c==="near"||g!==0?z=E/2:c==="center"?z=nt.highest.height/2-Q*E:z=nt.highest.height-D*E,d&&(z*=-1),g!==0&&!R.showLabelBackdrop&&(x+=E/2*Math.sin(g))):(C=v,z=(1-D)*E/2);let Z;if(R.showLabelBackdrop){const X=St(R.backdropPadding),H=nt.heights[b],B=nt.widths[b];let ht=z-X.top,gt=0-X.left;switch(G){case"middle":ht-=H/2;break;case"bottom":ht-=H;break}switch(w){case"center":gt-=B/2;break;case"right":gt-=B;break;case"inner":b===y-1?gt-=B:b>0&&(gt-=B/2);break}Z={left:gt,top:ht,width:B+X.width,height:H+X.height,color:R.backdropColor}}m.push({label:S,font:P,textOffset:z,options:{rotation:g,color:j,strokeColor:rt,strokeWidth:A,textAlign:T,textBaseline:G,translation:[x,C],backdrop:Z}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-te(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Gt(t,this.left,r)-r/2,h=Gt(t,this.right,a)+a/2,d=u=l):(d=Gt(t,this.top,r)-r/2,u=Gt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ws(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;je(s,c,0,h,l,a)}n&&Ms(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=ft(s.font),r=St(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||U(e)?(l+=r.bottom,at(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=Fc(this,l,e,a);je(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:zc(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=W(t.grid&&t.grid.z,-1),n=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==be.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return ft(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ai{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;jc(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Hc(t,r,s),this.override&&st.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in st[n]&&(delete st[n][s],this.override&&delete se[s])}}function Hc(i,t,e){const s=Fe(Object.create(null),[e?st.get(e):{},st.get(t),i.defaults]);st.set(t,s),i.defaultRoutes&&Bc(t,i.defaultRoutes),i.descriptors&&st.describe(t,i.descriptors)}function Bc(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");st.route(o,n,l,a)})}function jc(i){return"id"in i&&"defaults"in i}class Nc{constructor(){this.controllers=new ai(Ee,"datasets",!0),this.elements=new ai(jt,"elements"),this.plugins=new ai(Object,"plugins"),this.scales=new ai(be,"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,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):q(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ys(t);tt(s["before"+n],[],s),e[t](s),tt(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var At=new Nc;class Wc{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(tt(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){J(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=W(s.options&&s.options.plugins,{}),o=$c(s);return n===!1&&!e?[]:Yc(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function $c(i){const t={},e=[],s=Object.keys(At.plugins.items);for(let o=0;o<s.length;o++)e.push(At.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Vc(i,t){return!t&&i===!1?null:i===!0?{}:i}function Yc(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Vc(s[l],n);c!==null&&o.push({plugin:a,options:Uc(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Uc(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function hs(i,t){const e=st.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Xc(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Kc(i,t){return i===t?"_index_":"_value_"}function An(i){if(i==="x"||i==="y"||i==="r")return i}function qc(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ds(i,...t){if(An(i))return i;for(const e of t){const s=e.axis||qc(e.position)||i.length>1&&An(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function In(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return In(i,"x",e[0])||In(i,"y",e[0])}return{}}function Zc(i,t){const e=se[i.type]||{scales:{}},s=t.scales||{},n=hs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!U(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ds(r,a,Gc(r,i),st.scales[a.type]),c=Kc(l,n),h=e.scales||{};o[r]=De(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||hs(a,t),h=(se[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Xc(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),De(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];De(a,[st.scales[a.type],st.scale])}),o}function Eo(i){const t=i.options||(i.options={});t.plugins=W(t.plugins,{}),t.scales=Zc(i,t)}function zo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Qc(i){return i=i||{},i.data=zo(i.data),Eo(i),i}const Rn=new Map,Fo=new Set;function li(i,t){let e=Rn.get(i);return e||(e=t(),Rn.set(i,e),Fo.add(e)),e}const we=(i,t,e)=>{const s=vi(t,e);s!==void 0&&i.add(s)};class Jc{constructor(t){this._config=Qc(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=zo(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(),Eo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return li(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return li(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return li(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return li(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>we(l,t,d))),h.forEach(d=>we(l,n,d)),h.forEach(d=>we(l,se[o]||{},d)),h.forEach(d=>we(l,st,d)),h.forEach(d=>we(l,as,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,se[e]||{},st.datasets[e]||{},{type:e},st,as]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=En(this._resolverCache,t,n);let l=r;if(eh(r,e)){o.$shared=!1,s=Kt(s)?s():s;const c=this.createResolver(t,s,a);l=pe(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=En(this._resolverCache,t,s);return U(e)?pe(o,e,void 0,n):o}}function En(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Cs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const th=i=>U(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function eh(i,t){const{isScriptable:e,isIndexable:s}=yo(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(Kt(a)||th(a))||r&&at(a))return!0}return!1}var ih="4.4.8";const sh=["top","bottom","left","right","chartArea"];function zn(i,t){return i==="top"||i==="bottom"||sh.indexOf(i)===-1&&t==="x"}function Fn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Hn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),tt(e&&e.onComplete,[i],t)}function nh(i){const t=i.chart,e=t.options.animation;tt(e&&e.onProgress,[i],t)}function Ho(i){return Os()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const mi={},Bn=i=>{const t=Ho(i);return Object.values(mi).filter(e=>e.canvas===t).pop()};function oh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function rh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(s,t,"top"),bottom:ci(s,t,"bottom")}:t}var $t;let Ti=($t=class{static register(...t){At.add(...t),jn()}static unregister(...t){At.remove(...t),jn()}constructor(t,e){const s=this.config=new Jc(e),n=Ho(t),o=Bn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||wc(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ua(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,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 Wc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ia(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Hn),Ft.listen(this,"progress",nh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return J(t)?e&&o?o:n?s/n: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 At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ln(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,dn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),tt(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};q(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ds(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),q(o,r=>{const a=r.options,l=a.id,c=ds(l,a),h=W(a.type,r.dtype);(a.position===void 0||zn(a.position,c)!==zn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=At.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),q(n,(r,a)=>{r||delete s[a]}),q(s,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Fn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||hs(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=At.getController(a),{datasetElementType:c,dataElementType:h}=st.datasets[a];Object.assign(l,{dataElementType:At.getElement(h),datasetElementType:c&&At.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){q(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||q(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Zs(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;oh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Zs(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],q(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Kt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ft.has(this)?this.attached&&!Ft.running(this)&&Ft.start(this):(this.draw(),Hn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&ws(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ms(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Be(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=sc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=oe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ki(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ft.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ln(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete mi[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,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};q(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},q(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_i(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=xa(t),c=rh(t,this._lastEvent,s,l);s&&(this._lastEvent=null,tt(o.onHover,[t,a,this],this),l&&tt(o.onClick,[t,a,this],this));const h=!_i(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},F($t,"defaults",st),F($t,"instances",mi),F($t,"overrides",se),F($t,"registry",At),F($t,"version",ih),F($t,"getChart",Bn),$t);function jn(){return q(Ti.instances,i=>i._plugins.invalidate())}function Bo(i,t,e=t){i.lineCap=W(e.borderCapStyle,t.borderCapStyle),i.setLineDash(W(e.borderDash,t.borderDash)),i.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),i.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=W(e.borderWidth,t.borderWidth),i.strokeStyle=W(e.borderColor,t.borderColor)}function lh(i,t,e){i.lineTo(e.x,e.y)}function ch(i){return i.stepped?Ua:i.tension||i.cubicInterpolationMode==="monotone"?Xa:lh}function jo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function hh(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=jo(n,e,s),h=ch(o);let{move:d=!0,reverse:u}=s||{},f,p,g;for(f=0;f<=c;++f)p=n[(a+(u?c-f:f))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,g,p,u,o.stepped),g=p);return l&&(p=n[(a+(u?c:0))%r],h(i,g,p,u,o.stepped)),!!l}function dh(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=jo(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,u,f,p,g,m,b;const y=S=>(r+(c?a-S:S))%o,k=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const S=f.x,x=f.y,C=S|0;C===p?(x<g?g=x:x>m&&(m=x),h=(d*h+S)/++d):(k(),i.lineTo(S,x),p=C,d=0,g=m=x),b=x}k()}function us(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?dh:hh}function uh(i){return i.stepped?Cl:i.tension||i.cubicInterpolationMode==="monotone"?Pl:Jt}function fh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bo(i,t.options),i.stroke(n)}function gh(i,t,e,s){const{segments:n,options:o}=t,r=us(t);for(const a of n)Bo(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const ph=typeof Path2D=="function";function mh(i,t,e,s){ph&&!t.options.segment?fh(i,t,e,s):gh(i,t,e,s)}class Te extends jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;xl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Al(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=uh(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],p=o[u];if(f===p){a.push(f);continue}const g=Math.abs((n-f[e])/(p[e]-f[e])),m=l(f,p,g,s.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,s){return us(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=us(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),mh(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}F(Te,"id","line"),F(Te,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(Te,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(Te,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Nn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class bi extends jt{constructor(e){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(e-r,2)+Math.pow(s-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Nn(this,e,"x",s)}inYRange(e,s){return Nn(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!Be(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,ls(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}F(bi,"id","point"),F(bi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Wn=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},bh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class $n extends jt{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,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,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 e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=ft(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wn(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:k}=xh(s,e,o,m,n);b>0&&f+k+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:k},u=Math.max(u,y),f+=k+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=fe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ut(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ut(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ws(t,this),this._draw(),Ms(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=st.color,l=fe(t.rtl,this.left,this.width),c=ft(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Wn(r,d),b=function(C,w,v){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const P=W(v.lineWidth,1);if(n.fillStyle=W(v.fillStyle,a),n.lineCap=W(v.lineCap,"butt"),n.lineDashOffset=W(v.lineDashOffset,0),n.lineJoin=W(v.lineJoin,"miter"),n.lineWidth=P,n.strokeStyle=W(v.strokeStyle,a),n.setLineDash(W(v.lineDash,[])),r.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:P},D=l.xPlus(C,p/2),z=w+u;xo(n,E,D,z,r.pointStyleWidth&&p)}else{const E=w+Math.max((d-g)/2,0),D=l.leftForLtr(C,p),z=Re(v.borderRadius);n.beginPath(),Object.values(z).some(G=>G!==0)?cs(n,{x:D,y:E,w:p,h:g,radius:z}):n.rect(D,E,p,g),n.fill(),P!==0&&n.stroke()}n.restore()},y=function(C,w,v){je(n,v.text,C,w+m/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},k=this.isHorizontal(),S=this._computeTitleHeight();k?f={x:ut(o,this.left+h,this.right-s[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:ut(o,this.top+S+h,this.bottom-e[0].height),line:0},Mo(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((C,w)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const v=n.measureText(C.text).width,P=l.textAlign(C.textAlign||(C.textAlign=r.textAlign)),E=p+u+v;let D=f.x,z=f.y;l.setWidth(this.width),k?w>0&&D+E+h>this.right&&(z=f.y+=x,f.line++,D=f.x=ut(o,this.left+h,this.right-s[f.line])):w>0&&z+x>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,z=f.y=ut(o,this.top+S+h,this.bottom-e[f.line].height));const G=l.x(D);if(b(G,z,C),D=Ra(P,D+p+u,k?D+E:this.right,t.rtl),y(l.x(D),z,C),k)f.x+=E+h;else if(typeof C.text!="string"){const nt=c.lineHeight;f.y+=No(C,nt)+h}else f.y+=x}),Co(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=ft(e.font),n=St(e.padding);if(!e.display)return;const o=fe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=ut(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+ut(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=ut(a,d,d+u);r.textAlign=o.textAlign(ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,je(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=ft(t.font),s=St(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Ce(t,this.left,this.right)&&Ce(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Ce(t,n.left,n.left+n.width)&&Ce(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!vh(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=bh(n,s);n&&!o&&tt(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&tt(e.onHover,[t,s,this],this)}else s&&tt(e.onClick,[t,s,this],this)}}function xh(i,t,e,s,n){const o=_h(s,i,t,e),r=yh(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function _h(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function yh(i,t,e){let s=i;return typeof t.text!="string"&&(s=No(t,e)),s}function No(i,t){const e=i.text?i.text.length:0;return t*e}function vh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var kh={id:"legend",_element:$n,start(i,t,e){const s=i.legend=new $n({ctx:i.ctx,options:e,chart:i});vt.configure(i,s,e),vt.addBox(i,s)},stop(i){vt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;vt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=St(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Wo extends jt{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,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=at(s.text)?s.text.length:1;this._padding=St(s.padding);const o=n*ft(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=ut(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=ut(a,n,e),l=lt*-.5):(h=o-t,d=ut(a,e,n),l=lt*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=ft(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);je(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ks(e.align),textBaseline:"middle",translation:[r,a]})}}function Sh(i,t){const e=new Wo({ctx:i.ctx,options:t,chart:i});vt.configure(i,e,t),vt.addBox(i,e),i.titleBlock=e}var wh={id:"title",_element:Wo,start(i,t,e){Sh(i,e)},stop(i){const t=i.titleBlock;vt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;vt.configure(i,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 Oe={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=rs(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function Lt(i,t){return t&&(at(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Ht(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
17
|
+
`)>-1?i.split(`
|
|
18
|
+
`):i}function Mh(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Vn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),h=ft(t.footerFont),d=o.length,u=n.length,f=s.length,p=St(t.padding);let g=p.height,m=0,b=s.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*S+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(S){m=Math.max(m,e.measureText(S).width+y)};return e.save(),e.font=c.string,q(i.title,k),e.font=l.string,q(i.beforeBody.concat(i.afterBody),k),y=t.displayColors?r+2+t.boxPadding:0,q(s,S=>{q(S.before,k),q(S.lines,k),q(S.after,k)}),y=0,e.font=h.string,q(i.footer,k),e.restore(),m+=p.width,{width:m,height:g}}function Ch(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Ph(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Th(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ph(c,i,t,e)&&(c="center"),c}function Yn(i,t,e){const s=e.yAlign||t.yAlign||Ch(i,e);return{xAlign:e.xAlign||t.xAlign||Th(i,t,e,s),yAlign:s}}function Oh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Dh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Un(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Re(r);let p=Oh(t,a);const g=Dh(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:yt(p,0,s.width-t.width),y:yt(g,0,s.height-t.height)}}function hi(i,t,e){const s=St(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Xn(i){return Lt([],Ht(i))}function Lh(i,t,e){return oe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Kn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const $o={beforeTitle:zt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:zt,beforeBody:zt,beforeLabel:zt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return J(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:zt,afterBody:zt,beforeFooter:zt,footer:zt,afterFooter:zt};function pt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?$o[t].call(e,s):n}class fs extends jt{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 e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new To(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Lh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=pt(s,"beforeTitle",this,t),o=pt(s,"title",this,t),r=pt(s,"afterTitle",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}getBeforeBody(t,e){return Xn(pt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return q(t,o=>{const r={before:[],lines:[],after:[]},a=Kn(s,o);Lt(r.before,Ht(pt(a,"beforeLabel",this,o))),Lt(r.lines,pt(a,"label",this,o)),Lt(r.after,Ht(pt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Xn(pt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=pt(s,"beforeFooter",this,t),o=pt(s,"footer",this,t),r=pt(s,"afterFooter",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Mh(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),q(a,h=>{const d=Kn(t.callbacks,h);n.push(pt(d,"labelColor",this,h)),o.push(pt(d,"labelPointStyle",this,h)),r.push(pt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Oe[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Vn(this,s),c=Object.assign({},a,l),h=Yn(this.chart,s,c),d=Un(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Re(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,b,y,k,S,x;return o==="center"?(S=f+g/2,n==="left"?(m=u,b=m-r,k=S+r,x=S-r):(m=u+p,b=m+r,k=S-r,x=S+r),y=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(k=f,S=k-r,m=b-r,y=b+r):(k=f+g,S=k+r,m=b+r,y=b-r),x=k),{x1:m,x2:b,x3:y,y1:k,y2:S,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=fe(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=ft(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=ft(o.bodyFont),d=hi(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=n.leftForLtr(u,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ls(t,g,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ls(t,g,m,b)}else{t.lineWidth=U(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 g=n.leftForLtr(u,c),m=n.leftForLtr(n.xPlus(u,1),c-2),b=Re(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,cs(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),cs(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=ft(s.bodyFont);let u=d.lineHeight,f=0;const p=fe(s.rtl,this.x,this.width),g=function(v){e.fillText(v,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let b,y,k,S,x,C,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,q(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,S=0,C=n.length;S<C;++S){for(b=n[S],y=this.labelTextColors[S],e.fillStyle=y,q(b.before,g),k=b.lines,a&&k.length&&(this._drawColorBox(e,t,S,p,s),u=Math.max(d.lineHeight,l)),x=0,w=k.length;x<w;++x)g(k[x]),u=d.lineHeight;q(b.after,g)}f=0,u=d.lineHeight,q(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=fe(s.rtl,this.x,this.width);for(t.x=hi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=ft(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=Re(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Oe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Vn(this,t),l=Object.assign({},r,this._size),c=Yn(e,t,l),h=Un(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=St(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Mo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Co(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!_i(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!_i(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Oe[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}F(fs,"positioners",Oe);var Ah={id:"tooltip",_element:fs,positioners:Oe,afterInit(i,t,e){e&&(i.tooltip=new fs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Ih=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rh(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ih(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Eh=(i,t)=>i===null?null:yt(Math.round(i),0,t);function qn(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class gs extends be{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(J(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Rh(s,t,W(e,t),this._addedLabels),Eh(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return qn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}F(gs,"id","category"),F(gs,"defaults",{ticks:{callback:qn}});function zh(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:g,max:m}=t,b=!J(r),y=!J(a),k=!J(c),S=(m-g)/(d+1);let x=Js((m-g)/p/f)*f,C,w,v,P;if(x<1e-14&&!b&&!y)return[{value:g},{value:m}];P=Math.ceil(m/x)-Math.floor(g/x),P>p&&(x=Js(P*x/p/f)*f),J(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),n==="ticks"?(w=Math.floor(g/x)*x,v=Math.ceil(m/x)*x):(w=g,v=m),b&&y&&o&&Sa((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,w=r,v=a):k?(w=b?r:w,v=y?a:v,P=c-1,x=(v-w)/P):(P=(v-w)/x,Le(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const E=Math.max(tn(x),tn(w));C=Math.pow(10,J(l)?E:l),w=Math.round(w*C)/C,v=Math.round(v*C)/C;let D=0;for(b&&(u&&w!==r?(e.push({value:r}),w<r&&D++,Le(Math.round((w+D*x)*C)/C,r,Gn(r,S,i))&&D++):w<r&&D++);D<P;++D){const z=Math.round((w+D*x)*C)/C;if(y&&z>a)break;e.push({value:z})}return y&&u&&v!==a?e.length&&Le(e[e.length-1].value,a,Gn(a,S,i))?e[e.length-1].value=a:e.push({value:a}):(!y||v===a)&&e.push({value:v}),e}function Gn(i,t,{horizontal:e,minRotation:s}){const n=te(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Fh extends be{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,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ge(n),c=ge(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=zh(n,o);return t.bounds==="ticks"&&wa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return po(t,this.chart.options.locale,this.options.ticks.format)}}class ps extends Fh{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=te(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}F(ps,"id","linear"),F(ps,"defaults",{ticks:{callback:bo.formatters.numeric}});const Oi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mt=Object.keys(Oi);function Zn(i,t){return i-t}function Qn(i,t){if(J(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),kt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(He(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Jn(i,t,e,s){const n=mt.length;for(let o=mt.indexOf(i);o<n-1;++o){const r=Oi[mt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return mt[o]}return mt[n-1]}function Hh(i,t,e,s,n){for(let o=mt.length-1;o>=mt.indexOf(e);o--){const r=mt[o];if(Oi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return mt[e?mt.indexOf(e):0]}function Bh(i){for(let t=mt.indexOf(i)+1,e=mt.length;t<e;++t)if(Oi[mt[t]].common)return mt[t]}function to(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=vs(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function jh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function eo(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:jh(i,s,n,e)}class Ci extends be{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new Ql._date(t.adapters.date);n.init(e),De(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Qn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=kt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=kt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=Da(n,o,r);return this._unit=e.unit||(s.autoSkip?Jn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Hh(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Bh(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),eo(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=yt(e,0,r),s=yt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Jn(o.minUnit,e,s,this._getLabelCapacity(e)),a=W(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=He(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,a,r),f++)to(h,u,p);return(u===s||n.bounds==="ticks"||f===1)&&to(h,u,p),Object.keys(h).sort(Zn).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return tt(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=te(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,eo(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(Qn(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Aa(t.sort(Zn))}}F(Ci,"id","time"),F(Ci,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function di(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=ee(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=ee(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class io extends Ci{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=di(e,this.min),this._tableRange=di(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return di(this._table,s*this._tableRange+this._minPos,!0)}}F(io,"id","timeseries"),F(io,"defaults",Ci.defaults);const Vo="label";function so(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Nh(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Yo(i,t){i.labels=t}function Uo(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wh(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo;const e={labels:[],datasets:[]};return Yo(e,i.labels),Uo(e,i.datasets,t),e}function $h(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...u}=i,f=I.useRef(null),p=I.useRef(null),g=()=>{f.current&&(p.current=new Ti(f.current,{type:r,data:Wh(a,o),options:l&&{...l},plugins:c}),so(t,p.current))},m=()=>{so(t,null),p.current&&(p.current.destroy(),p.current=null)};return I.useEffect(()=>{!n&&p.current&&l&&Nh(p.current,l)},[n,l]),I.useEffect(()=>{!n&&p.current&&Yo(p.current.config.data,a.labels)},[n,a.labels]),I.useEffect(()=>{!n&&p.current&&a.datasets&&Uo(p.current.config.data,a.datasets,o)},[n,a.datasets]),I.useEffect(()=>{p.current&&(n?(m(),setTimeout(g)):p.current.update(d))},[n,l,a.labels,a.datasets,d]),I.useEffect(()=>{p.current&&(m(),setTimeout(g))},[r]),I.useEffect(()=>(g(),()=>m()),[]),ms.createElement("canvas",{ref:f,role:"img",height:e,width:s,...u},h)}const Vh=I.forwardRef($h);function Yh(i,t){return Ti.register(t),I.forwardRef((e,s)=>ms.createElement(Vh,{...e,ref:s,type:i}))}const Uh=Yh("line",gi);Ti.register(gs,ps,bi,Te,wh,Ah,kh);const Gh=({events:i,getFileContent:t})=>{var R,Q,j,rt;const[e,s]=I.useState(""),[n,o]=I.useState(0),[r,a]=I.useState(0),[l,c]=I.useState({}),[h,d]=I.useState(null),[u,f]=I.useState(!1),[p,g]=I.useState({steps:[],logprobs:[]}),[m,b]=I.useState(!1),[y,k]=I.useState(!0),[S,x]=I.useState(!1),C=I.useRef(null),w=I.useRef(null),v=I.useMemo(()=>{const A=new Set;return i.forEach(T=>{const Z=Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file");Z&&A.add(Z)}),Array.from(A)},[i]),P=I.useMemo(()=>i.filter(A=>A.type==="logprobs").map(A=>A.step).sort((A,T)=>A-T),[i]),E=async A=>{try{const T=await t(A.file),Z=JSON.parse(T),X=Object.keys(A).find(H=>H!=="type"&&H!=="loss"&&H!=="step"&&H!=="file")||"";c(H=>({...H,[X]:{...H[X]||{},[A.step]:Z}}))}catch(T){console.error("Error loading log prob data:",T)}};I.useEffect(()=>{if(!e)return;i.filter(T=>Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file")===e).forEach(T=>{var Z;(Z=l[e])!=null&&Z[T.step]||E(T)})},[e]),I.useEffect(()=>{v.length>0&&!e&&s(v[0]),P.length>0&&!r&&a(P[0])},[v,P]),I.useEffect(()=>{if(!C.current)return;const A={root:null,rootMargin:"0px",threshold:.1},T=new IntersectionObserver(Z=>{Z.forEach(X=>{k(X.isIntersecting)})},A);return T.observe(C.current),()=>T.disconnect()},[]),I.useEffect(()=>{u&&h&&(async()=>{if(!h||!e)return;b(!0);const T={steps:[],logprobs:[]};try{Object.keys(l[e]||{}).map(Number).sort((H,B)=>H-B).forEach(H=>{const B=l[e][H];if(!B||!B[n])return;const ht=B[n];if(h.position<ht.tokens.length){const gt=ht.tokens[h.position];T.steps.push(H),T.logprobs.push(gt.logp)}});const X=T.steps.map((H,B)=>({step:H,logp:T.logprobs[B]})).sort((H,B)=>H.step-B.step);g({steps:X.map(H=>H.step),logprobs:X.map(H=>H.logp)})}finally{b(!1)}})()},[u,h,e,l,n]);const D=A=>{if(S){const T=Math.max(0,Math.min(1,(A+20)/20));return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}else{const T=Math.exp(A);return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}},z=e&&r&&((Q=(R=l[e])==null?void 0:R[r])==null?void 0:Q[n]),G=e&&r&&((rt=(j=l[e])==null?void 0:j[r])==null?void 0:rt.length)||0,nt=A=>A.map((T,Z)=>{if(T.token.includes(`
|
|
19
|
+
`)){const H=T.token.split(/(\n)/);return L.jsx(ms.Fragment,{children:H.map((B,ht)=>B===`
|
|
20
|
+
`?L.jsx(Pt,{sx:{width:"100%",height:0}},`${Z}-${ht}`):B&&L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:B})},`${Z}-${ht}`))},Z)}return L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:T.token})},Z)});return L.jsxs(Pt,{sx:{mt:2},children:[L.jsxs(Pt,{ref:w,sx:{position:y?"sticky":"static",top:0,zIndex:1,backgroundColor:"white",pb:2,borderBottom:y?"1px solid rgba(0, 0, 0, 0.12)":"none"},children:[L.jsxs(Pt,{sx:{display:"flex",gap:2,mb:2,alignItems:"center"},children:[L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Dataset"}),L.jsx(js,{value:e,onChange:A=>s(A.target.value),label:"Dataset",children:v.map(A=>L.jsx(Ns,{value:A,children:A},A))})]}),L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Sequence Index"}),L.jsx(js,{value:n,onChange:A=>o(Number(A.target.value)),label:"Sequence Index",children:[...Array(G)].map((A,T)=>L.jsx(Ns,{value:T,children:T},T))})]}),L.jsx(fr,{control:L.jsx(gr,{checked:S,onChange:A=>x(A.target.checked)}),label:"Use LogProb Colors"})]}),L.jsxs(Pt,{sx:{px:2},children:[L.jsxs(Xe,{gutterBottom:!0,children:["Step: ",r]}),L.jsx($r,{value:r,onChange:(A,T)=>a(T),min:Math.min(...P),max:Math.max(...P),step:null,marks:P.map(A=>({value:A,label:A.toString()}))})]})]}),L.jsx(Pt,{ref:C,children:z?L.jsx(pr,{sx:{p:2,mt:2},children:L.jsx(Pt,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:nt(z.tokens)})}):L.jsx(Xe,{children:"No data available for the selected parameters"})}),L.jsxs(mr,{open:u,onClose:()=>f(!1),maxWidth:"md",fullWidth:!0,children:[L.jsxs(br,{children:["Token History: ",h==null?void 0:h.token," (Position: ",h==null?void 0:h.position,")"]}),L.jsx(xr,{children:m?L.jsx(Pt,{sx:{display:"flex",justifyContent:"center",p:4},children:L.jsx(_r,{})}):h&&L.jsx(Pt,{sx:{height:400},children:L.jsx(Uh,{data:{labels:p.steps,datasets:[{label:"Log Probability",data:p.logprobs,borderColor:"rgb(75, 192, 192)",tension:.1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!0,text:`Log Probability Evolution for Token: ${h.token} at Position ${h.position}`}},scales:{y:{title:{display:!0,text:"Log Probability"}},x:{title:{display:!0,text:"Training Step"}}}}})})})]})]})};export{Gh as LogProbVisualization};
|