karafka-web 0.9.1 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +30 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +98 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +37 -25
- data/LICENSE +1 -1
- data/bin/build_assets +51 -0
- data/bin/release +6 -0
- data/certs/cert.pem +26 -0
- data/config/locales/pro_errors.yml +18 -0
- data/docker-compose.yml +1 -1
- data/gulpfile.js +73 -0
- data/karafka-web.gemspec +3 -3
- data/lib/karafka/web/config.rb +18 -10
- data/lib/karafka/web/contracts/base.rb +2 -0
- data/lib/karafka/web/contracts/config.rb +6 -1
- data/lib/karafka/web/errors.rb +12 -0
- data/lib/karafka/web/inflector.rb +1 -1
- data/lib/karafka/web/management/actions/enable.rb +17 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/0_set_initial.rb +39 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1699543515_fill_missing_received_and_sent_bytes.rb +28 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_introduce_waiting.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_remove_processing.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1704722380_split_listeners_into_active_and_paused.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706607960_introduce_lag_total.rb +40 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706611396_rename_lag_total_to_lag_hybrid.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1716218393_populate_jobs_metrics.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_states/0_set_initial.rb +46 -0
- data/lib/karafka/web/management/migrations/consumers_states/1699543515_fill_missing_received_and_sent_bytes.rb +25 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_introduce_waiting.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_remove_processing.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1704722380_split_listeners_into_active_and_paused.rb +34 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706607960_introduce_lag_total.rb +24 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706611396_rename_lag_total_to_lag_hybrid.rb +23 -0
- data/lib/karafka/web/management/migrations/consumers_states/1716218393_add_jobs_counter.rb +24 -0
- data/lib/karafka/web/management/migrator.rb +5 -5
- data/lib/karafka/web/pro/commanding/commands/base.rb +8 -0
- data/lib/karafka/web/pro/commanding/commands/quiet.rb +4 -1
- data/lib/karafka/web/pro/commanding/commands/stop.rb +4 -1
- data/lib/karafka/web/pro/loader.rb +8 -0
- data/lib/karafka/web/pro/ui/app.rb +84 -7
- data/lib/karafka/web/pro/ui/controllers/commanding_controller.rb +4 -4
- data/lib/karafka/web/pro/ui/controllers/dlq_controller.rb +1 -1
- data/lib/karafka/web/pro/ui/controllers/errors_controller.rb +1 -0
- data/lib/karafka/web/pro/ui/controllers/explorer_controller.rb +6 -14
- data/lib/karafka/web/pro/ui/controllers/messages_controller.rb +5 -4
- data/lib/karafka/web/pro/ui/controllers/recurring_tasks_controller.rb +131 -0
- data/lib/karafka/web/pro/ui/controllers/search_controller.rb +73 -0
- data/lib/karafka/web/pro/ui/controllers/support_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/controllers/topics_controller.rb +31 -0
- data/lib/karafka/web/pro/ui/controllers/ux_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/lib/policies/config.rb +39 -0
- data/lib/karafka/web/pro/ui/lib/policies/contracts/config.rb +46 -0
- data/lib/karafka/web/pro/ui/lib/policies/messages.rb +76 -0
- data/lib/karafka/web/pro/ui/lib/policies/requests.rb +36 -0
- data/lib/karafka/web/pro/ui/lib/policies.rb +34 -0
- data/lib/karafka/web/pro/ui/lib/safe_runner.rb +98 -0
- data/lib/karafka/web/pro/ui/lib/search/config.rb +53 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/config.rb +101 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/form.rb +111 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/base.rb +59 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_header_includes.rb +57 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_key_includes.rb +41 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_payload_includes.rb +45 -0
- data/lib/karafka/web/pro/ui/lib/search/normalizer.rb +47 -0
- data/lib/karafka/web/pro/ui/lib/search/runner.rb +230 -0
- data/lib/karafka/web/pro/ui/lib/search.rb +36 -0
- data/lib/karafka/web/pro/ui/views/cluster/_breadcrumbs.erb +4 -4
- data/lib/karafka/web/pro/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/pro/ui/views/cluster/index.erb +20 -22
- data/lib/karafka/web/pro/ui/views/cluster/show.erb +21 -25
- data/lib/karafka/web/pro/ui/views/commands/_backtrace.erb +4 -19
- data/lib/karafka/web/pro/ui/views/commands/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/commands/_command.erb +6 -6
- data/lib/karafka/web/pro/ui/views/commands/_command_details.erb +1 -11
- data/lib/karafka/web/pro/ui/views/commands/_incompatible_schema.erb +3 -14
- data/lib/karafka/web/pro/ui/views/commands/_metadata.erb +33 -42
- data/lib/karafka/web/pro/ui/views/commands/_table.erb +9 -3
- data/lib/karafka/web/pro/ui/views/commands/index.erb +18 -12
- data/lib/karafka/web/pro/ui/views/commands/show.erb +24 -29
- data/lib/karafka/web/pro/ui/views/consumers/_breadcrumbs.erb +8 -8
- data/lib/karafka/web/pro/ui/views/consumers/_consumer.erb +13 -23
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +52 -35
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_performance.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/_tabs.erb +28 -30
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_commands.erb +68 -28
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_metrics.erb +114 -133
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_partition.erb +4 -4
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_stopped.erb +6 -9
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_subscription_group.erb +116 -126
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_tabs.erb +26 -31
- data/lib/karafka/web/pro/ui/views/consumers/controls.erb +53 -57
- data/lib/karafka/web/pro/ui/views/consumers/details.erb +4 -17
- data/lib/karafka/web/pro/ui/views/consumers/index.erb +31 -34
- data/lib/karafka/web/pro/ui/views/consumers/pending_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/performance.erb +43 -47
- data/lib/karafka/web/pro/ui/views/consumers/running_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/subscriptions.erb +14 -17
- data/lib/karafka/web/pro/ui/views/dashboard/index.erb +67 -76
- data/lib/karafka/web/pro/ui/views/dlq/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/pro/ui/views/dlq/_no_topics.erb +1 -7
- data/lib/karafka/web/pro/ui/views/dlq/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/dlq/index.erb +8 -10
- data/lib/karafka/web/pro/ui/views/errors/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/errors/_error.erb +8 -5
- data/lib/karafka/web/pro/ui/views/errors/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/errors/_table.erb +5 -4
- data/lib/karafka/web/pro/ui/views/errors/index.erb +50 -15
- data/lib/karafka/web/pro/ui/views/errors/partition.erb +61 -14
- data/lib/karafka/web/pro/ui/views/errors/show.erb +28 -46
- data/lib/karafka/web/pro/ui/views/explorer/_breadcrumbs.erb +11 -3
- data/lib/karafka/web/pro/ui/views/explorer/_failed_deserialization.erb +8 -3
- data/lib/karafka/web/pro/ui/views/explorer/_message.erb +12 -6
- data/lib/karafka/web/pro/ui/views/explorer/_no_topics.erb +1 -5
- data/lib/karafka/web/pro/ui/views/explorer/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/explorer/_topic.erb +6 -8
- data/lib/karafka/web/pro/ui/views/explorer/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/explorer/message/_metadata.erb +68 -32
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload.erb +17 -16
- data/lib/karafka/web/pro/ui/views/explorer/message/_resources_utilization.erb +127 -0
- data/lib/karafka/web/pro/ui/views/explorer/message/_too_big_to_be_displayed.erb +20 -0
- data/lib/karafka/web/pro/ui/views/explorer/messages/_detail.erb +1 -1
- data/lib/karafka/web/pro/ui/views/explorer/partition/_cleaned.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_messages.erb +6 -3
- data/lib/karafka/web/pro/ui/views/explorer/partition.erb +67 -46
- data/lib/karafka/web/pro/ui/views/explorer/show.erb +85 -21
- data/lib/karafka/web/pro/ui/views/explorer/topic/_actions.erb +27 -0
- data/lib/karafka/web/pro/ui/views/explorer/topic/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/topic/_limited.erb +8 -10
- data/lib/karafka/web/pro/ui/views/explorer/topic.erb +24 -44
- data/lib/karafka/web/pro/ui/views/health/_breadcrumbs.erb +7 -7
- data/lib/karafka/web/pro/ui/views/health/_no_data.erb +1 -7
- data/lib/karafka/web/pro/ui/views/health/_partition.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_lags.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_offset.erb +2 -2
- data/lib/karafka/web/pro/ui/views/health/_partition_times.erb +3 -7
- data/lib/karafka/web/pro/ui/views/health/_table_metadata.erb +8 -0
- data/lib/karafka/web/pro/ui/views/health/_tabs.erb +32 -49
- data/lib/karafka/web/pro/ui/views/health/changes.erb +51 -51
- data/lib/karafka/web/pro/ui/views/health/cluster_lags.erb +28 -41
- data/lib/karafka/web/pro/ui/views/health/lags.erb +52 -52
- data/lib/karafka/web/pro/ui/views/health/offsets.erb +55 -55
- data/lib/karafka/web/pro/ui/views/health/overview.erb +60 -60
- data/lib/karafka/web/pro/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/pro/ui/views/jobs/pending.erb +36 -38
- data/lib/karafka/web/pro/ui/views/jobs/running.erb +36 -38
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_actions.erb +58 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_batch_actions.erb +45 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_breadcrumbs.erb +22 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_log.erb +26 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_not_active.erb +12 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_tabs.erb +17 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_task.erb +46 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/logs.erb +34 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/schedule.erb +43 -0
- data/lib/karafka/web/pro/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/pro/ui/views/routing/_topic.erb +13 -11
- data/lib/karafka/web/pro/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/pro/ui/views/routing/show.erb +41 -33
- data/lib/karafka/web/pro/ui/views/search/_fix_errors.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_metadata.erb +71 -0
- data/lib/karafka/web/pro/ui/views/search/_no_results.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_no_search_criteria.erb +5 -0
- data/lib/karafka/web/pro/ui/views/search/_search_criteria.erb +37 -0
- data/lib/karafka/web/pro/ui/views/search/_search_modal.erb +139 -0
- data/lib/karafka/web/pro/ui/views/search/_timeout.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/index.erb +29 -0
- data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +90 -28
- data/lib/karafka/web/pro/ui/views/topics/_breadcrumbs.erb +14 -6
- data/lib/karafka/web/pro/ui/views/topics/_partition_offsets.erb +10 -0
- data/lib/karafka/web/pro/ui/views/topics/_tabs.erb +26 -32
- data/lib/karafka/web/pro/ui/views/topics/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/topics/config.erb +21 -25
- data/lib/karafka/web/pro/ui/views/topics/distribution/_badges.erb +10 -5
- data/lib/karafka/web/pro/ui/views/topics/distribution/_chart.erb +3 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution/_limited.erb +1 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution.erb +34 -39
- data/lib/karafka/web/pro/ui/views/topics/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/topics/offsets.erb +24 -0
- data/lib/karafka/web/pro/ui/views/topics/replication.erb +20 -24
- data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +1 -1
- data/lib/karafka/web/processing/consumers/aggregators/state.rb +1 -1
- data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +1 -0
- data/lib/karafka/web/tracking/consumers/contracts/job.rb +1 -1
- data/lib/karafka/web/tracking/consumers/contracts/report.rb +6 -0
- data/lib/karafka/web/tracking/consumers/listeners/connections.rb +8 -6
- data/lib/karafka/web/tracking/consumers/listeners/processing.rb +7 -1
- data/lib/karafka/web/tracking/consumers/listeners/tags.rb +1 -1
- data/lib/karafka/web/tracking/consumers/reporter.rb +6 -8
- data/lib/karafka/web/tracking/consumers/sampler.rb +16 -5
- data/lib/karafka/web/ui/app.rb +20 -1
- data/lib/karafka/web/ui/base.rb +26 -20
- data/lib/karafka/web/ui/controllers/base_controller.rb +7 -5
- data/lib/karafka/web/ui/controllers/dashboard_controller.rb +8 -0
- data/lib/karafka/web/ui/controllers/requests/params.rb +16 -2
- data/lib/karafka/web/ui/controllers/support_controller.rb +17 -0
- data/lib/karafka/web/ui/controllers/ux_controller.rb +17 -0
- data/lib/karafka/web/ui/helpers/application_helper.rb +83 -43
- data/lib/karafka/web/ui/helpers/paths_helper.rb +24 -0
- data/lib/karafka/web/ui/helpers/tailwind_helper.rb +90 -0
- data/lib/karafka/web/ui/lib/sorter.rb +1 -1
- data/lib/karafka/web/ui/models/metrics/aggregated.rb +1 -0
- data/lib/karafka/web/ui/models/metrics/charts/topics.rb +36 -20
- data/lib/karafka/web/ui/models/recurring_tasks/log.rb +26 -0
- data/lib/karafka/web/ui/models/recurring_tasks/schedule.rb +86 -0
- data/lib/karafka/web/ui/models/recurring_tasks/task.rb +30 -0
- data/lib/karafka/web/ui/models/status.rb +28 -1
- data/lib/karafka/web/ui/public/images/calendar.svg +3 -0
- data/lib/karafka/web/ui/public/javascripts/application.js +39 -15
- data/lib/karafka/web/ui/public/javascripts/application.min.js +64 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js.br +0 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js.gz +0 -0
- data/lib/karafka/web/ui/public/javascripts/charts/types/line.js +41 -9
- data/lib/karafka/web/ui/public/javascripts/components/btn_toggle_manager.js +37 -0
- data/lib/karafka/web/ui/public/javascripts/{live_poll.js → components/live_poll.js} +80 -8
- data/lib/karafka/web/ui/public/javascripts/{offset_datetime.js → components/offset_datetime.js} +1 -1
- data/lib/karafka/web/ui/public/javascripts/components/search.js +102 -0
- data/lib/karafka/web/ui/public/javascripts/components/tabs_manager.js +84 -0
- data/lib/karafka/web/ui/public/javascripts/components/theme_manager.js +66 -0
- data/lib/karafka/web/ui/public/javascripts/components/turbo_tracker.js +30 -0
- data/lib/karafka/web/ui/public/javascripts/libs/datepicker.js +2 -2
- data/lib/karafka/web/ui/public/javascripts/libs/turbo.js +6618 -0
- data/lib/karafka/web/ui/public/stylesheets/application.css +20 -113
- data/lib/karafka/web/ui/public/stylesheets/application.min.css +13 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css +8 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/tailwind.css +403 -0
- data/lib/karafka/web/ui/views/cluster/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/cluster/brokers.erb +20 -22
- data/lib/karafka/web/ui/views/cluster/replication.erb +28 -32
- data/lib/karafka/web/ui/views/consumers/_assignments_badges.erb +1 -1
- data/lib/karafka/web/ui/views/consumers/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/consumers/_consumer.erb +9 -13
- data/lib/karafka/web/ui/views/consumers/_no_consumers.erb +2 -8
- data/lib/karafka/web/ui/views/consumers/_summary.erb +34 -45
- data/lib/karafka/web/ui/views/consumers/_tabs.erb +35 -0
- data/lib/karafka/web/ui/views/consumers/index.erb +31 -33
- data/lib/karafka/web/ui/views/dashboard/_counters.erb +76 -0
- data/lib/karafka/web/ui/views/dashboard/_feature_pro.erb +6 -2
- data/lib/karafka/web/ui/views/dashboard/_not_enough_data.erb +3 -15
- data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +12 -12
- data/lib/karafka/web/ui/views/dashboard/index.erb +78 -52
- data/lib/karafka/web/ui/views/errors/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/errors/_detail.erb +1 -3
- data/lib/karafka/web/ui/views/errors/_error.erb +3 -5
- data/lib/karafka/web/ui/views/errors/index.erb +34 -44
- data/lib/karafka/web/ui/views/errors/show.erb +29 -47
- data/lib/karafka/web/ui/views/jobs/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/ui/views/jobs/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/jobs/pending.erb +30 -32
- data/lib/karafka/web/ui/views/jobs/running.erb +30 -32
- data/lib/karafka/web/ui/views/layout.erb +37 -21
- data/lib/karafka/web/ui/views/routing/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/ui/views/routing/_topic.erb +3 -5
- data/lib/karafka/web/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/ui/views/routing/show.erb +30 -22
- data/lib/karafka/web/ui/views/shared/_become_pro.erb +8 -8
- data/lib/karafka/web/ui/views/shared/_brand.erb +2 -2
- data/lib/karafka/web/ui/views/shared/_breadcrumbs.erb +23 -0
- data/lib/karafka/web/ui/views/shared/_content.erb +2 -28
- data/lib/karafka/web/ui/views/shared/_controls.erb +15 -0
- data/lib/karafka/web/ui/views/shared/_flashes.erb +5 -7
- data/lib/karafka/web/ui/views/shared/_header.erb +16 -19
- data/lib/karafka/web/ui/views/shared/_navigation.erb +95 -28
- data/lib/karafka/web/ui/views/shared/_no_paginated_data.erb +5 -9
- data/lib/karafka/web/ui/views/shared/_pagination.erb +11 -11
- data/lib/karafka/web/ui/views/shared/_tab_nav.erb +4 -5
- data/lib/karafka/web/ui/views/shared/_title.erb +5 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_error.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_info.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_primary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_secondary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_success.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_warning.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_error.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_info.erb +5 -2
- data/lib/karafka/web/ui/views/shared/alerts/_primary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_secondary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_success.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_warning.erb +4 -0
- data/lib/karafka/web/ui/views/shared/charts/_line.erb +1 -1
- data/lib/karafka/web/ui/views/shared/exceptions/not_allowed.erb +14 -19
- data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +16 -21
- data/lib/karafka/web/ui/views/shared/exceptions/pro_only.erb +16 -28
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_on_square.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_tray.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_on_squares.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_path_rounded.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_uturn_right.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrows_right_left.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_blocks.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_book_open.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_bug.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_burger.erb +14 -0
- data/lib/karafka/web/ui/views/shared/icons/_calendar_days.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_chart_bar.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_badge.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_circle_stack.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_cpu.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_document_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_exclamation_triangle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_eye.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_gear.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_github.erb +13 -0
- data/lib/karafka/web/ui/views/shared/icons/_globe.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_heart.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_home.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_info_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_lifebuoy.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_light_bulb.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_list_bullets.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_magnifying_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_moon.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_offices.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_play.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_play_circle.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_question_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_queue_list.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_refresh.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_slack.erb +16 -0
- data/lib/karafka/web/ui/views/shared/icons/_stop.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_sun.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_mark.erb +3 -0
- data/lib/karafka/web/ui/views/status/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/ui/views/status/_failure.erb +2 -13
- data/lib/karafka/web/ui/views/status/_halted.erb +2 -10
- data/lib/karafka/web/ui/views/status/_info.erb +2 -13
- data/lib/karafka/web/ui/views/status/_success.erb +2 -10
- data/lib/karafka/web/ui/views/status/_warning.erb +2 -13
- data/lib/karafka/web/ui/views/status/failures/_connection.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb +4 -4
- data/lib/karafka/web/ui/views/status/failures/_enabled.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_state.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_live_reporting.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_materializing_lag.erb +11 -0
- data/lib/karafka/web/ui/views/status/failures/_partitions.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_state_calculation.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_topics.erb +3 -3
- data/lib/karafka/web/ui/views/status/info/_components.erb +59 -49
- data/lib/karafka/web/ui/views/status/show.erb +165 -154
- data/lib/karafka/web/ui/views/status/warnings/_connection.erb +3 -3
- data/lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_replication.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_routing_topics_presence.erb +1 -1
- data/lib/karafka/web/ui/views/support/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/support/show.erb +71 -0
- data/lib/karafka/web/ui/views/ux/_alerts.erb +25 -0
- data/lib/karafka/web/ui/views/ux/_badges.erb +21 -0
- data/lib/karafka/web/ui/views/ux/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/ux/_buttons.erb +47 -0
- data/lib/karafka/web/ui/views/ux/_card_detail.erb +15 -0
- data/lib/karafka/web/ui/views/ux/_card_metric.erb +123 -0
- data/lib/karafka/web/ui/views/ux/_card_summary.erb +72 -0
- data/lib/karafka/web/ui/views/ux/_card_support.erb +39 -0
- data/lib/karafka/web/ui/views/ux/_code.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_data_table.erb +82 -0
- data/lib/karafka/web/ui/views/ux/_headers.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_icons.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_pagination.erb +32 -0
- data/lib/karafka/web/ui/views/ux/_row_table.erb +52 -0
- data/lib/karafka/web/ui/views/ux/_status_rows.erb +65 -0
- data/lib/karafka/web/ui/views/ux/_tabs.erb +14 -0
- data/lib/karafka/web/ui/views/ux/_text.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_topic_tiles.erb +42 -0
- data/lib/karafka/web/ui/views/ux/show.erb +19 -0
- data/lib/karafka/web/version.rb +1 -1
- data/lib/karafka/web.rb +2 -0
- data/package-lock.json +4163 -0
- data/package.json +15 -0
- data/postcss.config.js +6 -0
- data/tailwind.config.js +16 -0
- data.tar.gz.sig +0 -0
- metadata +209 -69
- metadata.gz.sig +1 -4
- data/certs/cert_chain.pem +0 -26
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_state.rb +0 -43
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb +0 -26
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_state.rb +0 -23
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb +0 -32
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_metrics.rb +0 -38
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_states.rb +0 -22
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_states.rb +0 -21
- data/lib/karafka/web/pro/ui/views/cluster/brokers.erb +0 -27
- data/lib/karafka/web/pro/ui/views/commands/_details.erb +0 -26
- data/lib/karafka/web/pro/ui/views/consumers/_counters.erb +0 -72
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_title.erb +0 -5
- data/lib/karafka/web/pro/ui/views/errors/_title_with_select.erb +0 -31
- data/lib/karafka/web/pro/ui/views/explorer/message/_message_actions.erb +0 -18
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload_actions.erb +0 -19
- data/lib/karafka/web/pro/ui/views/explorer/partition/_details.erb +0 -35
- data/lib/karafka/web/pro/ui/views/explorer/topic/_details.erb +0 -23
- data/lib/karafka/web/pro/ui/views/health/_consumer_group_header.erb +0 -14
- data/lib/karafka/web/ui/controllers/responses/deny.rb +0 -15
- data/lib/karafka/web/ui/helpers/alerts_helper.rb +0 -23
- data/lib/karafka/web/ui/lib/safe_runner.rb +0 -59
- data/lib/karafka/web/ui/models/visibility_filter.rb +0 -49
- data/lib/karafka/web/ui/public/javascripts/libs/bootstrap.min.js +0 -6
- data/lib/karafka/web/ui/public/javascripts/tabs_manager.js +0 -57
- data/lib/karafka/web/ui/public/stylesheets/libs/bootstrap.min.css +0 -6
- data/lib/karafka/web/ui/views/consumers/_counters.erb +0 -62
- data/lib/karafka/web/ui/views/errors/_watermark_offsets.erb +0 -10
- data/lib/karafka/web/ui/views/shared/_feature_pro.erb +0 -4
- data/lib/karafka/web/ui/views/shared/_footer.erb +0 -22
- data/lib/karafka/web/ui/views/shared/_live_poll.erb +0 -7
- /data/lib/karafka/web/management/migrations/{0_base.rb → base.rb} +0 -0
- /data/lib/karafka/web/ui/public/javascripts/{charts.js → components/charts.js} +0 -0
- /data/lib/karafka/web/ui/public/stylesheets/libs/{highlight.min.css → highlight_light.min.css} +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/libs/chart.min.js */
|
2
|
+
/*!
|
3
|
+
* Chart.js v4.1.1
|
4
|
+
* https://www.chartjs.org
|
5
|
+
* (c) 2022 Chart.js Contributors
|
6
|
+
* Released under the MIT License
|
7
|
+
*/
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Chart=t()}(this,function(){var s=Object.freeze({__proto__:null,get Colors(){return ra},get Decimation(){return oa},get Filler(){return xa},get Legend(){return ka},get SubTitle(){return Ca},get Title(){return Ea},get Tooltip(){return Ha}});function e(){}let B=(()=>{let e=0;return()=>e++})();function E(e){return null==e}function T(e){return!(!Array.isArray||!Array.isArray(e))||"[object"===(e=Object.prototype.toString.call(e)).slice(0,7)&&"Array]"===e.slice(-6)}function A(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function m(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)}function u(e,t){return m(e)?e:t}function L(e,t){return void 0===e?t:e}let N=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100:+e/t,H=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function c(e,t,i){if(e&&"function"==typeof e.call)return e.apply(i,t)}function S(e,t,i,s){let r,a,n;if(T(e))if(a=e.length,s)for(r=a-1;0<=r;r--)t.call(i,e[r],r);else for(r=0;r<a;r++)t.call(i,e[r],r);else if(A(e))for(n=Object.keys(e),a=n.length,r=0;r<a;r++)t.call(i,e[n[r]],n[r])}function V(e,t){let i,s,r,a;if(!e||!t||e.length!==t.length)return!1;for(i=0,s=e.length;i<s;++i)if(r=e[i],a=t[i],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function $(t){if(T(t))return t.map($);if(A(t)){var i=Object.create(null),s=Object.keys(t),r=s.length;let e=0;for(;e<r;++e)i[s[e]]=$(t[s[e]]);return i}return t}function z(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function j(e,t,i,s){var r;z(e)&&(r=t[e],i=i[e],A(r)&&A(i)?W(r,i,s):t[e]=$(i))}function W(s,e,r){var t=T(e)?e:[e],i=t.length;if(A(s)){var a,n=(r=r||{}).merger||j;for(let e=0;e<i;++e)if(A(a=t[e])){let i=Object.keys(a);for(let e=0,t=i.length;e<t;++e)n(i[e],s,a,r)}}return s}function q(e,t){return W(e,t,{merger:U})}function U(e,t,i){var s;z(e)&&(s=t[e],i=i[e],A(s)&&A(i)?q(s,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=$(i)))}let Y={"":e=>e,x:e=>e.x,y:e=>e.y};function K(e){var t=e.split("."),i=[];let s="";for(let e of t)s+=e,s=s.endsWith("\\")?s.slice(0,-1)+".":(i.push(s),"");return i}function g(e,t){return(Y[t]||(Y[t]=function(){let i=K(t);return e=>{for(var t of i){if(""===t)break;e=e&&e[t]}return e}}()))(e)}function X(e){return e.charAt(0).toUpperCase()+e.slice(1)}let p=e=>void 0!==e,f=e=>"function"==typeof e,G=(e,t)=>{if(e.size!==t.size)return!1;for(var i of e)if(!t.has(i))return!1;return!0};function J(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}let M=Math.PI,y=2*M,Z=y+M,Q=Number.POSITIVE_INFINITY,ee=M/180,D=M/2,te=M/4,ie=2*M/3,o=Math.log10,x=Math.sign;function se(e,t,i){return Math.abs(e-t)<i}function re(e){var t=Math.round(e),t=(e=se(e,t,e/1e3)?t:e,Math.pow(10,Math.floor(o(e)))),e=e/t;return(e<=1?1:e<=2?2:e<=5?5:10)*t}function ae(e){var t=[],i=Math.sqrt(e);let s;for(s=1;s<i;s++)e%s==0&&(t.push(s),t.push(e/s));return i===(0|i)&&t.push(i),t.sort((e,t)=>e-t).pop(),t}function ne(e){return!isNaN(parseFloat(e))&&isFinite(e)}function oe(e,t){var i=Math.round(e);return i-t<=e&&e<=i+t}function le(e,t,i){let s,r,a;for(s=0,r=e.length;s<r;s++)a=e[s][i],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function P(e){return e*(M/180)}function he(e){return e*(180/M)}function de(i){if(m(i)){let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}}function ce(e,t){var i=t.x-e.x,t=t.y-e.y,e=Math.sqrt(i*i+t*t);let s=Math.atan2(t,i);return s<-.5*M&&(s+=y),{angle:s,distance:e}}function ue(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pe(e,t){return(e-t+Z)%y-M}function b(e){return(e%y+y)%y}function ge(e,t,i,s){var e=b(e),t=b(t),i=b(i),r=b(t-e),a=b(i-e),n=b(e-t),o=b(e-i);return e===t||e===i||s&&t===i||a<r&&n<o}function C(e,t,i){return Math.max(t,Math.min(i,e))}function me(e){return C(e,-32768,32767)}function d(e,t,i,s=1e-6){return e>=Math.min(t,i)-s&&e<=Math.max(t,i)+s}function fe(t,i,e){e=e||(e=>t[e]<i);let s,r=t.length-1,a=0;for(;1<r-a;)e(s=a+r>>1)?a=s:r=s;return{lo:a,hi:r}}let v=(i,s,r,e)=>fe(i,r,e?e=>{var t=i[e][s];return t<r||t===r&&i[e+1][s]===r}:e=>i[e][s]<r),ve=(t,i,s)=>fe(t,s,e=>t[e][i]>=s);function be(e,t,i){let s=0,r=e.length;for(;s<r&&e[s]<t;)s++;for(;r>s&&e[r-1]>i;)r--;return 0<s||r<e.length?e.slice(s,r):e}let ye=["push","pop","shift","splice","unshift"];function xe(r,e){r._chartjs?r._chartjs.listeners.push(e):(Object.defineProperty(r,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ye.forEach(e=>{let i="_onData"+X(e),s=r[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,value(...t){var e=s.apply(this,t);return r._chartjs.listeners.forEach(e=>{"function"==typeof e[i]&&e[i](...t)}),e}})}))}function we(t,e){var i=t._chartjs;i&&(-1!==(e=(i=i.listeners).indexOf(e))&&i.splice(e,1),0<i.length||(ye.forEach(e=>{delete t[e]}),delete t._chartjs))}function _e(e){var t=new Set;let i,s;for(i=0,s=e.length;i<s;++i)t.add(e[i]);return t.size===s?e:Array.from(t)}let Se="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function ke(t,i){let s,r=!1;return function(...e){s=e,r||(r=!0,Se.call(window,()=>{r=!1,t.apply(i,s)}))}}function Me(t,i){let s;return function(...e){return i?(clearTimeout(s),s=setTimeout(t,i,e)):t.apply(this,e),i}}let Ee=e=>"start"===e?"left":"end"===e?"right":"center",R=(e,t,i)=>"start"===e?t:"end"===e?i:(t+i)/2,De=(e,t,i,s)=>e===(s?"left":"right")?i:"center"===e?(t+i)/2:t;function Ce(e,t,i){var s,r,a,n,o,l,h=t.length;let d=0,c=h;return e._sorted&&({iScale:e,_parsed:s}=e,r=e.axis,{min:a,max:n,minDefined:o,maxDefined:l}=e.getUserBounds(),o&&(d=C(Math.min(v(s,e.axis,a).lo,i?h:v(t,r,e.getPixelForValue(a)).lo),0,h-1)),c=l?C(Math.max(v(s,e.axis,n,!0).hi+1,i?0:v(t,r,e.getPixelForValue(n),!0).hi+1),d,h)-d:h-d),{start:d,count:c}}function Te(e){var{xScale:t,yScale:i,_scaleRanges:s}=e,r={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};return s?(t=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==i.min||s.ymax!==i.max,Object.assign(s,r),t):(e._scaleRanges=r,!0)}var a=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,s,e){let r=i.listeners[e],a=i.duration;r.forEach(e=>e({chart:t,initial:i.initial,numSteps:a,currentStep:Math.min(s-i.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Se.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((s,r)=>{if(s.running&&s.items.length){var a=s.items;let e,t=a.length-1,i=!1;for(;0<=t;--t)(e=a[t])._active?(e._total>s.duration&&(s.duration=e._total),e.tick(n),i=!0):(a[t]=a[a.length-1],a.pop());i&&(r.draw(),this._notify(r,s,n,"progress")),a.length||(s.running=!1,this._notify(r,s,n,"complete"),s.initial=!1),o+=a.length}}),this._lastDate=n,0===o&&(this._running=!1)}_getAnims(e){var t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return 0<this._getAnims(e).items.length}start(e){e=this._charts.get(e);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){return!!this._running&&!!((e=this._charts.get(e))&&e.running&&e.items.length)}stop(t){var i=this._charts.get(t);if(i&&i.items.length){var s=i.items;let e=s.length-1;for(;0<=e;--e)s[e].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}}remove(e){return this._charts.delete(e)}};
|
9
|
+
/*!
|
10
|
+
* @kurkle/color v0.3.0
|
11
|
+
* https://github.com/kurkle/color#readme
|
12
|
+
* (c) 2022 Jukka Kurkela
|
13
|
+
* Released under the MIT License
|
14
|
+
*/function Ae(e){return e+.5|0}let Le=(e,t,i)=>Math.max(Math.min(e,i),t);function Pe(e){return Le(Ae(2.55*e),0,255)}function Re(e){return Le(Ae(255*e),0,255)}function n(e){return Le(Ae(e/2.55)/100,0,1)}function Oe(e){return Le(Ae(100*e),0,100)}let l={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},Ie=[..."0123456789ABCDEF"],Fe=e=>Ie[15&e],Be=e=>Ie[(240&e)>>4]+Ie[15&e],Ne=e=>(240&e)>>4==(15&e);let He=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ve(i,e,s){let r=e*Math.min(s,1-s),t=(e,t=(e+i/30)%12)=>s-r*Math.max(Math.min(t-3,9-t,1),-1);return[t(0),t(8),t(4)]}function $e(i,s,r){var e=(e,t=(e+i/60)%6)=>r-r*s*Math.max(Math.min(t,4-t,1),0);return[e(5),e(3),e(1)]}function ze(e,t,i){var s=Ve(e,1,.5);let r;for(1<t+i&&(t*=r=1/(t+i),i*=r),r=0;r<3;r++)s[r]*=1-t-i,s[r]+=t;return s}function je(e){var t=e.r/255,i=e.g/255,e=e.b/255,s=Math.max(t,i,e),r=Math.min(t,i,e),a=(s+r)/2;let n,o,l;return s!==r&&(l=s-r,o=.5<a?l/(2-s-r):l/(s+r),n=60*(n=(r=i,i=e,(e=t)===s?(r-i)/l+(r<i?6:0):r===s?(i-e)/l+2:(e-r)/l+4))+.5),[0|n,o||0,a]}function We(e,t,i,s){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,s)).map(Re)}function qe(e,t,i){return We(Ve,e,t,i)}function Ue(e){return(e%360+360)%360}let Ye={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"},Ke={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"},Xe;let Ge=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Je=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,Ze=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Qe(t,i,s){if(t){let e=je(t);e[i]=Math.max(0,Math.min(e[i]+e[i]*s,0===i?360:1)),e=qe(e),t.r=e[0],t.g=e[1],t.b=e[2]}}function et(e,t){return e&&Object.assign(t||{},e)}function tt(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?3<=e.length&&(t={r:e[0],g:e[1],b:e[2],a:255},3<e.length)&&(t.a=Re(e[3])):(t=et(e,{r:0,g:0,b:0,a:1})).a=Re(t.a),t}function it(e){return("r"===e.charAt(0)?function(e){var t=Ge.exec(e);let i,s,r,a=255;if(t){if(void 0!==t[7]){let e=+t[7];a=t[8]?Pe(e):Le(255*e,0,255)}return i=+t[1],s=+t[3],r=+t[5],{r:255&(t[2]?Pe(i):Le(i,0,255)),g:255&(t[4]?Pe(s):Le(s,0,255)),b:255&(t[6]?Pe(r):Le(r,0,255)),a:a}}}:function(e){var t,i,s,e=He.exec(e);let r,a=255;if(e)return void 0!==e[5]&&(a=(e[6]?Pe:Re)(+e[5])),t=Ue(+e[2]),i=+e[3]/100,s=+e[4]/100,{r:(r="hwb"===e[1]?We(ze,t,i,s):"hsv"===e[1]?We($e,t,i,s):qe(t,i,s))[0],g:r[1],b:r[2],a:a}})(e)}class st{constructor(e){if(e instanceof st)return e;var t,i,s=typeof e;let r;"object"==s?r=tt(e):"string"==s&&(i=(s=e).length,"#"===s[0]&&(4===i||5===i?t={r:255&17*l[s[1]],g:255&17*l[s[2]],b:255&17*l[s[3]],a:5===i?17*l[s[4]]:255}:7!==i&&9!==i||(t={r:l[s[1]]<<4|l[s[2]],g:l[s[3]]<<4|l[s[4]],b:l[s[5]]<<4|l[s[6]],a:9===i?l[s[7]]<<4|l[s[8]]:255})),r=t||(i=e,Xe||((Xe=function(){var e={},t=Object.keys(Ke),i=Object.keys(Ye);let s,r,a,n,o;for(s=0;s<t.length;s++){for(n=o=t[s],r=0;r<i.length;r++)a=i[r],o=o.replace(a,Ye[a]);a=parseInt(Ke[n],16),e[o]=[a>>16&255,a>>8&255,255&a]}return e}()).transparent=[0,0,0,0]),(i=Xe[i.toLowerCase()])&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255})||it(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=et(this._rgb);return e&&(e.a=n(e.a)),e}set rgb(e){this._rgb=tt(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid&&(e=this._rgb,t=e,t=Ne(t.r)&&Ne(t.g)&&Ne(t.b)&&Ne(t.a)?Fe:Be,e)?"#"+t(e.r)+t(e.g)+t(e.b)+((e=e.a)<255?t(e):""):void 0;var e,t}hslString(){if(this._valid){var e,t,i,s=this._rgb;if(s)return e=(i=je(s))[0],t=Oe(i[1]),i=Oe(i[2]),s.a<255?`hsla(${e}, ${t}%, ${i}%, ${n(s.a)})`:`hsl(${e}, ${t}%, ${i}%)`}}mix(e,t){var i,s,r;return e&&(i=this.rgb,e=e.rgb,r=i.a-e.a,i.r=255&(s=(1+((s=2*(t=void 0===t?.5:t)-1)*r==-1?s:(s+r)/(1+s*r)))/2)*i.r+(r=1-s)*e.r+.5,i.g=255&s*i.g+r*e.g+.5,i.b=255&s*i.b+r*e.b+.5,i.a=t*i.a+(1-t)*e.a,this.rgb=i),this}interpolate(e,t){return e&&(this._rgb=(i=this._rgb,e=e._rgb,t=t,s=Ze(n(i.r)),r=Ze(n(i.g)),a=Ze(n(i.b)),{r:Re(Je(s+t*(Ze(n(e.r))-s))),g:Re(Je(r+t*(Ze(n(e.g))-r))),b:Re(Je(a+t*(Ze(n(e.b))-a))),a:i.a+t*(e.a-i.a)})),this;var i,s,r,a}clone(){return new st(this.rgb)}alpha(e){return this._rgb.a=Re(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){var e=this._rgb,t=Ae(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){var e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Qe(this._rgb,2,e),this}darken(e){return Qe(this._rgb,2,-e),this}saturate(e){return Qe(this._rgb,1,e),this}desaturate(e){return Qe(this._rgb,1,-e),this}rotate(e){return t=this._rgb,e=e,(i=je(t))[0]=Ue(i[0]+e),i=qe(i),t.r=i[0],t.g=i[1],t.b=i[2],this;var t,i}}function rt(e){return!(!e||"object"!=typeof e||"[object CanvasPattern]"!==(e=e.toString())&&"[object CanvasGradient]"!==e)}function at(e){return rt(e)?e:new st(e)}function nt(e){return rt(e)?e:new st(e).saturate(.5).darken(.1).hexString()}let ot=["x","y","borderWidth","radius","tension"],lt=["color","borderColor","backgroundColor"],ht=new Map;function dt(e,t,r){return function(e,t){t=r||{};var i=e+JSON.stringify(t);let s=ht.get(i);return s||(s=new Intl.NumberFormat(e,t),ht.set(i,s)),s}(t).format(e)}let ct={values:e=>T(e)?e:""+e,numeric(t,e,i){if(0===t)return"0";var s=this.chart.options.locale;let r,a=t;if(1<i.length){let e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||1e15<e)&&(r="scientific"),a=function(e){let t=3<i.length?i[2].value-i[1].value:i[1].value-i[0].value;return t=1<=Math.abs(t)&&e!==Math.floor(e)?e-Math.floor(e):t}(t)}var n=o(Math.abs(a)),n=Math.max(Math.min(-1*Math.floor(n),20),0),n={notation:r,minimumFractionDigits:n,maximumFractionDigits:n};return Object.assign(n,this.options.ticks.format),dt(t,s,n)},logarithmic(e,t,i){var s;return 0===e?"0":(s=i[t].significand||e/Math.pow(10,Math.floor(o(e))),[1,2,3,5,10,15].includes(s)||t>.8*i.length?ct.numeric.call(this,e,t,i):"")}};var ut={formatters:ct};let pt=Object.create(null),gt=Object.create(null);function mt(i,e){if(e){var s=e.split(".");for(let e=0,t=s.length;e<t;++e){var r=s[e];i=i[r]||(i[r]=Object.create(null))}}return i}function ft(e,t,i){return"string"==typeof t?W(mt(e,t),i):W(mt(e,""),t)}var O=new class{constructor(e,t){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=e=>e.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=(e,t)=>nt(t.backgroundColor),this.hoverBorderColor=(e,t)=>nt(t.borderColor),this.hoverColor=(e,t)=>nt(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return ft(this,e,t)}get(e){return mt(this,e)}describe(e,t){return ft(gt,e,t)}override(e,t){return ft(pt,e,t)}route(e,t,i,s){let r=mt(this,e),a=mt(this,i),n="_"+t;Object.defineProperties(r,{[n]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){var e=this[n],t=a[s];return A(e)?Object.assign({},t,e):L(e,t)},set(e){this[n]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:lt},numbers:{type:"number",properties:ot}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:ut.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function vt(){return"undefined"!=typeof window&&"undefined"!=typeof document}function bt(e){let t=e.parentNode;return t=t&&"[object ShadowRoot]"===t.toString()?t.host:t}function yt(e,t,i){let s;return"string"==typeof e?(s=parseInt(e,10),-1!==e.indexOf("%")&&(s=s/100*t.parentNode[i])):s=e,s}let xt=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function wt(e,t){return xt(e).getPropertyValue(t)}let _t=["top","right","bottom","left"];function St(t,i,s){var r={};s=s?"-"+s:"";for(let e=0;e<4;e++){var a=_t[e];r[a]=parseFloat(t[i+"-"+a+s])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function kt(e,t){if("native"in e)return e;var{canvas:i,currentDevicePixelRatio:s}=t,r=xt(i),a="border-box"===r.boxSizing,n=St(r,"padding"),r=St(r,"border","width"),{x:e,y:o,box:l}=function(e,t){var i=e.touches,i=i&&i.length?i[0]:e,{offsetX:s,offsetY:r}=i;let a,n,o=!1;if(e=e.target,!(0<s||0<r)||e&&e.shadowRoot){let e=t.getBoundingClientRect();a=i.clientX-e.left,n=i.clientY-e.top,o=!0}else a=s,n=r;return{x:a,y:n,box:o}}(e,i),h=n.left+(l&&r.left),l=n.top+(l&&r.top);let{width:d,height:c}=t;return a&&(d-=n.width+r.width,c-=n.height+r.height),{x:Math.round((e-h)/d*i.width/s),y:Math.round((o-l)/c*i.height/s)}}let Mt=e=>Math.round(10*e)/10;function Et(e,t,i,s){var r=xt(e),a=St(r,"margin"),n=yt(r.maxWidth,e,"clientWidth")||Q,o=yt(r.maxHeight,e,"clientHeight")||Q,e=function(e,r,a){let n,o;if(void 0===r||void 0===a){var l=bt(e);if(l){let e=l.getBoundingClientRect(),t=xt(l),i=St(t,"border","width"),s=St(t,"padding");r=e.width-s.width-i.width,a=e.height-s.height-i.height,n=yt(t.maxWidth,l,"clientWidth"),o=yt(t.maxHeight,l,"clientHeight")}else r=e.clientWidth,a=e.clientHeight}return{width:r,height:a,maxWidth:n||Q,maxHeight:o||Q}}(e,t,i);let{width:l,height:h}=e;if("content-box"===r.boxSizing){let e=St(r,"border","width"),t=St(r,"padding");l-=t.width+e.width,h-=t.height+e.height}return l=Math.max(0,l-a.width),h=Math.max(0,s?l/s:h-a.height),l=Mt(Math.min(l,n,e.maxWidth)),h=Mt(Math.min(h,o,e.maxHeight)),l&&!h&&(h=Mt(l/2)),(void 0!==t||void 0!==i)&&s&&e.height&&h>e.height&&(h=e.height,l=Mt(Math.floor(h*s))),{width:l,height:h}}function Dt(e,t,i){var t=t||1,s=Math.floor(e.height*t),r=Math.floor(e.width*t),a=(e.height=Math.floor(e.height),e.width=Math.floor(e.width),e.canvas);return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=e.height+"px",a.style.width=e.width+"px"),(e.currentDevicePixelRatio!==t||a.height!==s||a.width!==r)&&(e.currentDevicePixelRatio=t,a.height=s,a.width=r,e.ctx.setTransform(t,0,0,t,0,0),!0)}var Ct=function(){let e=!1;try{var t={get passive(){return!(e=!0)}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Tt(e,t){e=wt(e,t),t=e&&e.match(/^(\d+)(\.\d+)?px$/);return t?+t[1]:void 0}function At(e){return!e||E(e.size)||E(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Lt(e,t,i,s,r){let a=t[r];return a||(a=t[r]=e.measureText(r).width,i.push(r)),s=a>s?a:s}function Pt(e,t,i,s){let r=(s=s||{}).data=s.data||{},a=s.garbageCollect=s.garbageCollect||[],n=(s.font!==t&&(r=s.data={},a=s.garbageCollect=[],s.font=t),e.save(),e.font=t,0);var o=i.length;let l,h,d,c,u;for(l=0;l<o;l++)if(null!=(c=i[l])&&!0!==T(c))n=Lt(e,r,a,n,c);else if(T(c))for(h=0,d=c.length;h<d;h++)null==(u=c[h])||T(u)||(n=Lt(e,r,a,n,u));e.restore();var p=a.length/2;if(p>i.length){for(l=0;l<p;l++)delete r[a[l]];a.splice(0,p)}return n}function Rt(e,t,i){e=e.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((t-i)*e)/e+i}function Ot(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function It(e,t,i,s){Ft(e,t,i,s,null)}function Ft(e,t,i,s,r){let a,n,o,l,h,d,c,u;var p=t.pointStyle,g=t.rotation,m=t.radius;let f=(g||0)*ee;if(p&&"object"==typeof p&&("[object HTMLImageElement]"===(a=p.toString())||"[object HTMLCanvasElement]"===a))e.save(),e.translate(i,s),e.rotate(f),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();else if(!(isNaN(m)||m<=0)){switch(e.beginPath(),p){default:r?e.ellipse(i,s,r/2,m,0,0,y):e.arc(i,s,m,0,y),e.closePath();break;case"triangle":d=r?r/2:m,e.moveTo(i+Math.sin(f)*d,s-Math.cos(f)*m),f+=ie,e.lineTo(i+Math.sin(f)*d,s-Math.cos(f)*m),f+=ie,e.lineTo(i+Math.sin(f)*d,s-Math.cos(f)*m),e.closePath();break;case"rectRounded":h=.516*m,l=m-h,n=Math.cos(f+te)*l,c=Math.cos(f+te)*(r?r/2-h:l),o=Math.sin(f+te)*l,u=Math.sin(f+te)*(r?r/2-h:l),e.arc(i-c,s-o,h,f-M,f-D),e.arc(i+u,s-n,h,f-D,f),e.arc(i+c,s+o,h,f,f+D),e.arc(i-u,s+n,h,f+D,f+M),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,d=r?r/2:l,e.rect(i-d,s-l,2*d,2*l);break}f+=te;case"rectRot":c=Math.cos(f)*(r?r/2:m),n=Math.cos(f)*m,o=Math.sin(f)*m,u=Math.sin(f)*(r?r/2:m),e.moveTo(i-c,s-o),e.lineTo(i+u,s-n),e.lineTo(i+c,s+o),e.lineTo(i-u,s+n),e.closePath();break;case"crossRot":f+=te;case"cross":c=Math.cos(f)*(r?r/2:m),n=Math.cos(f)*m,o=Math.sin(f)*m,u=Math.sin(f)*(r?r/2:m),e.moveTo(i-c,s-o),e.lineTo(i+c,s+o),e.moveTo(i+u,s-n),e.lineTo(i-u,s+n);break;case"star":c=Math.cos(f)*(r?r/2:m),n=Math.cos(f)*m,o=Math.sin(f)*m,u=Math.sin(f)*(r?r/2:m),e.moveTo(i-c,s-o),e.lineTo(i+c,s+o),e.moveTo(i+u,s-n),e.lineTo(i-u,s+n),f+=te,c=Math.cos(f)*(r?r/2:m),n=Math.cos(f)*m,o=Math.sin(f)*m,u=Math.sin(f)*(r?r/2:m),e.moveTo(i-c,s-o),e.lineTo(i+c,s+o),e.moveTo(i+u,s-n),e.lineTo(i-u,s+n);break;case"line":n=r?r/2:Math.cos(f)*m,o=Math.sin(f)*m,e.moveTo(i-n,s-o),e.lineTo(i+n,s+o);break;case"dash":e.moveTo(i,s),e.lineTo(i+Math.cos(f)*(r?r/2:m),s+Math.sin(f)*m);break;case!1:e.closePath()}e.fill(),0<t.borderWidth&&e.stroke()}}function Bt(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function Nt(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ht(e){e.restore()}function Vt(t,i,s,e,r){if(!i)return t.lineTo(s.x,s.y);if("middle"===r){let e=(i.x+s.x)/2;t.lineTo(e,i.y),t.lineTo(e,s.y)}else"after"===r!=!!e?t.lineTo(i.x,s.y):t.lineTo(s.x,i.y);t.lineTo(s.x,s.y)}function $t(e,t,i,s){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function zt(e,t,i,s,r,a={}){var n,o,l,h=T(t)?t:[t],d=0<a.strokeWidth&&""!==a.strokeColor;let c,u;for(e.save(),e.font=r.string,t=e,(l=a).translation&&t.translate(l.translation[0],l.translation[1]),E(l.rotation)||t.rotate(l.rotation),l.color&&(t.fillStyle=l.color),l.textAlign&&(t.textAlign=l.textAlign),l.textBaseline&&(t.textBaseline=l.textBaseline),c=0;c<h.length;++c){u=h[c],a.backdrop&&(g=e,p=a.backdrop,m=void 0,m=g.fillStyle,g.fillStyle=p.color,g.fillRect(p.left,p.top,p.width,p.height),g.fillStyle=m),d&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),E(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(u,i,s,a.maxWidth)),e.fillText(u,i,s,a.maxWidth);{p=void 0;g=void 0;m=void 0;f=void 0;v=void 0;n=void 0;o=void 0;var p=e;var g=i;var m=s;var f=u;var v=a;(v.strikethrough||v.underline)&&(f=p.measureText(f),n=g-f.actualBoundingBoxLeft,g=g+f.actualBoundingBoxRight,o=m+f.actualBoundingBoxDescent,m=v.strikethrough?(m-f.actualBoundingBoxAscent+o)/2:o,p.strokeStyle=p.fillStyle,p.beginPath(),p.lineWidth=v.decorationWidth||2,p.moveTo(n,m),p.lineTo(g,m),p.stroke())}s+=r.lineHeight}e.restore()}function jt(e,t){var{x:t,y:i,w:s,h:r,radius:a}=t;e.arc(t+a.topLeft,i+a.topLeft,a.topLeft,-D,M,!0),e.lineTo(t,i+r-a.bottomLeft),e.arc(t+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,M,D,!0),e.lineTo(t+s-a.bottomRight,i+r),e.arc(t+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,D,0,!0),e.lineTo(t+s,i+a.topRight),e.arc(t+s-a.topRight,i+a.topRight,a.topRight,0,-D,!0),e.lineTo(t+a.topLeft,i)}function Wt(o,l=[""],t=o,i,r=()=>o[0]){p(i)||(i=ei("_fallback",o));var e={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:t,_fallback:i,_getTarget:r,override:e=>Wt([e,...o],l,t,i)};return new Proxy(e,{deleteProperty:(e,t)=>(delete e[t],delete e._keys,delete o[0][t],!0),get:(a,n)=>Xt(a,n,()=>{var e,t,i=n,s=o,r=a;for(t of l)if(e=ei(Yt(t,i),s),p(e))return Kt(i,e)?Zt(s,r,i,e):e}),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(o[0]),has:(e,t)=>ti(e).includes(t),ownKeys:e=>ti(e),set(e,t,i){var s=e._storage||(e._storage=r());return e[t]=s[t]=i,delete e._keys,!0}})}function qt(s,t,i,r){var e={_cacheable:!1,_proxy:s,_context:t,_subProxy:i,_stack:new Set,_descriptors:Ut(s,r),setContext:e=>qt(s,e,i,r),override:e=>qt(s.override(e),t,i,r)};return new Proxy(e,{deleteProperty:(e,t)=>(delete e[t],delete s[t],!0),get:(l,h,d)=>Xt(l,h,()=>{{var o=l,t=h,i=d,{_proxy:s,_context:r,_subProxy:a,_descriptors:n}=o;let e=s[t];return T(e=f(e)&&n.isScriptable(t)?function(e,t,i){var{_proxy:s,_context:r,_subProxy:a,_stack:n}=o;if(n.has(e))throw new Error("Recursion detected: "+Array.from(n).join("->")+"->"+e);return n.add(e),t=t(r,a||i),n.delete(e),t=Kt(e,t)?Zt(s._scopes,s,e,t):t}(t,e,i):e)&&e.length&&(e=function(r,a,e,t){var{_proxy:n,_context:o,_subProxy:l,_descriptors:h}=e;if(p(o.index)&&t(r))a=a[o.index%a.length];else if(A(a[0])){let i=a,s=n._scopes.filter(e=>e!==i);a=[];for(let t of i){let e=Zt(s,n,r,t);a.push(qt(e,o,l&&l[r],h))}}return a}(t,e,o,n.isIndexable)),e=Kt(t,e)?qt(e,r,a&&a[t],n):e}}),getOwnPropertyDescriptor:(e,t)=>e._descriptors.allKeys?Reflect.has(s,t)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,t),getPrototypeOf:()=>Reflect.getPrototypeOf(s),has:(e,t)=>Reflect.has(s,t),ownKeys:()=>Reflect.ownKeys(s),set:(e,t,i)=>(s[t]=i,delete e[t],!0)})}function Ut(e,t={scriptable:!0,indexable:!0}){let{_scriptable:i=t.scriptable,_indexable:s=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:i,indexable:s,isScriptable:f(i)?i:()=>i,isIndexable:f(s)?s:()=>s}}let Yt=(e,t)=>e?e+X(t):t,Kt=(e,t)=>A(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function Xt(e,t,i){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:(i=i(),e[t]=i)}function Gt(e,t,i){return f(e)?e(t,i):e}let Jt=(e,t)=>!0===e?t:"string"==typeof e?g(t,e):void 0;function Zt(e,s,r,a){var t=s._rootScopes,i=Gt(s._fallback,r,a),e=[...e,...t],n=new Set,o=(n.add(a),Qt(n,e,r,i||r,a));return null!==o&&(!p(i)||i===r||null!==(o=Qt(n,e,i,o,a)))&&Wt(Array.from(n),[""],t,i,()=>{return e=r,t=a,i=s._getTarget(),e in i||(i[e]={}),T(i=i[e])&&A(t)?t:i||{};var e,t,i})}function Qt(e,t,i,s,r){for(;i;)i=function(t,e,i,s,r){for(var a of e){let e=Jt(i,a);if(e){t.add(e);a=Gt(e._fallback,i,r);if(p(a)&&a!==i&&a!==s)return a}else if(!1===e&&p(s)&&i!==s)return null}return!1}(e,t,i,s,r);return i}function ei(t,e){for(var i of e)if(i){let e=i[t];if(p(e))return e}}function ti(e){let t=e._keys;return t=t||(e._keys=function(e){var t,i=new Set;for(t of e)for(let e of Object.keys(t).filter(e=>!e.startsWith("_")))i.add(e);return Array.from(i)}(e._scopes))}function ii(e,t,i,s){var r=e.iScale,{key:a="r"}=this._parsing,n=new Array(s);let o,l,h,d;for(o=0,l=s;o<l;++o)d=t[h=o+i],n[o]={r:r.parse(g(d,a),h)};return n}let si=Number.EPSILON||1e-14,ri=(e,t)=>t<e.length&&!e[t].skip&&e[t],ai=e=>"x"===e?"y":"x";function ni(e,t,i,s){var e=e.skip?t:e,r=t,t=i.skip?t:i,i=ue(r,e),a=ue(t,r),n=i/(i+a),i=a/(i+a),a=s*(isNaN(n)?0:n),n=s*(isNaN(i)?0:i);return{previous:{x:r.x-a*(t.x-e.x),y:r.y-a*(t.y-e.y)},next:{x:r.x+n*(t.x-e.x),y:r.y+n*(t.y-e.y)}}}function oi(l,t="x"){var i=ai(t),e=l.length,o=Array(e).fill(0),h=Array(e);let s,r,a,n=ri(l,0);for(s=0;s<e;++s)if(r=a,a=n,n=ri(l,s+1),a){if(n){let e=n[t]-a[t];o[s]=0!=e?(n[i]-a[i])/e:0}h[s]=r?n?x(o[s-1])!==x(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}{var d=l,c=o,u=h,p=d.length;let t,i,s,r,a,n=ri(d,0);for(let e=0;e<p-1;++e)a=n,n=ri(d,e+1),a&&n&&(se(c[e],0,si)?u[e]=u[e+1]=0:(t=u[e]/c[e],i=u[e+1]/c[e],(r=Math.pow(t,2)+Math.pow(i,2))<=9||(s=3/Math.sqrt(r),u[e]=t*s*c[e],u[e+1]=i*s*c[e])))}{var[g,m,f="x"]=[l,h,t];let s=ai(f),e=g.length,r,a,n,o=ri(g,0);for(let i=0;i<e;++i)if(a=n,n=o,o=ri(g,i+1),n){let e=n[f],t=n[s];a&&(r=(e-a[f])/3,n["cp1"+f]=e-r,n["cp1"+s]=t-r*m[i]),o&&(r=(o[f]-e)/3,n["cp2"+f]=e+r,n["cp2"+s]=t+r*m[i])}}}function li(e,t,i){return Math.max(Math.min(e,i),t)}function hi(n,t,o,i,e){let s,r,a,l;if(t.spanGaps&&(n=n.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)oi(n,e);else{let e=i?n[n.length-1]:n[0];for(s=0,r=n.length;s<r;++s)a=n[s],l=ni(e,a,n[Math.min(s+1,r-(i?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,e=a}if(t.capBezierPoints){var h=n,d=o;let e,t,i,s,r,a=Bt(h[0],d);for(e=0,t=h.length;e<t;++e)r=s,s=a,a=e<t-1&&Bt(h[e+1],d),s&&(i=h[e],r&&(i.cp1x=li(i.cp1x,d.left,d.right),i.cp1y=li(i.cp1y,d.top,d.bottom)),a)&&(i.cp2x=li(i.cp2x,d.left,d.right),i.cp2y=li(i.cp2y,d.top,d.bottom))}}let di=e=>0===e||1===e,ci=(e,t,i)=>-Math.pow(2,10*--e)*Math.sin((e-t)*y/i),ui=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*y/i)+1,pi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*D),easeOutSine:e=>Math.sin(e*D),easeInOutSine:e=>-.5*(Math.cos(M*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>di(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>1<=e?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>di(e)?e:ci(e,.075,.3),easeOutElastic:e=>di(e)?e:ui(e,.075,.3),easeInOutElastic(e){return di(e)?e:e<.5?.5*ci(2*e,.1125,.45):.5+.5*ui(2*e-1,.1125,.45)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-pi.easeOutBounce(1-e),easeOutBounce(e){var t=7.5625,i=2.75;return e<1/i?t*e*e:e<2/i?t*(e-=1.5/i)*e+.75:e<2.5/i?t*(e-=2.25/i)*e+.9375:t*(e-=2.625/i)*e+.984375},easeInOutBounce:e=>e<.5?.5*pi.easeInBounce(2*e):.5*pi.easeOutBounce(2*e-1)+.5};function gi(e,t,i,s){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function mi(e,t,i,s){return{x:e.x+i*(t.x-e.x),y:("middle"===s?i<.5?e:t:"after"===s?i<1?e:t:0<i?t:e).y}}function fi(e,t,i,s){var r={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},e=gi(e,r,i),r=gi(r,a,i),a=gi(a,t,i),t=gi(e,r,i),e=gi(r,a,i);return gi(t,e,i)}let vi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yi(e,t){var i=(""+e).match(vi);if(!i||"normal"===i[1])return 1.2*t;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100}return t*e}function xi(t,i){var s={},e=A(i),r=e?Object.keys(i):i,a=A(t)?e?e=>L(t[e],t[i[e]]):e=>t[e]:()=>t;for(let e of r)s[e]=+a(e)||0;return s}function wi(e){return xi(e,{top:"y",right:"x",bottom:"y",left:"x"})}function _i(e){return xi(e,["topLeft","topRight","bottomLeft","bottomRight"])}function I(e){e=wi(e);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function F(e,t){t=t||O.font;let i=L((e=e||{}).size,t.size),s=("string"==typeof i&&(i=parseInt(i,10)),L(e.style,t.style));s&&!(""+s).match(bi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);e={family:L(e.family,t.family),lineHeight:yi(L(e.lineHeight,t.lineHeight),i),size:i,style:s,weight:L(e.weight,t.weight),string:""};return e.string=At(e),e}function Si(e,t,i,s){let r,a,n,o=!0;for(r=0,a=e.length;r<a;++r)if(void 0!==(n=e[r])&&(void 0!==t&&"function"==typeof n&&(n=n(t),o=!1),void 0!==i&&T(n)&&(n=n[i%n.length],o=!1),void 0!==n))return s&&!o&&(s.cacheable=!1),n}function ki(e,t,i){var{min:e,max:s}=e,t=H(t,(s-e)/2),r=(e,t)=>i&&0===e?0:e+t;return{min:r(e,-Math.abs(t)),max:r(s,t)}}function Mi(e,t){return Object.assign(Object.create(e),t)}function Ei(e,t,i){return e?(s=t,r=i,{x:e=>s+s+r-e,setWidth(e){r=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e};var s,r}function Di(e,t){var i,s;"ltr"!==t&&"rtl"!==t||(s=[(i=e.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=s)}function Ci(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Ti(e){return"angle"===e?{between:ge,compare:pe,normalize:b}:{between:d,compare:(e,t)=>e-t,normalize:e=>e}}function Ai({start:e,end:t,count:i,loop:s,style:r}){return{start:e%i,end:t%i,loop:s&&(t-e+1)%i==0,style:r}}function Li(e,i,p){if(!p)return[e];let{property:s,start:r,end:a}=p,n=i.length,{compare:o,between:l,normalize:h}=Ti(s),{start:d,end:c,loop:u,style:g}=function(e,t){var{property:i,start:s,end:r}=p,{between:a,normalize:n}=Ti(i),o=t.length;let l,h,{start:d,end:c,loop:u}=e;if(u){for(d+=o,c+=o,l=0,h=o;l<h&&a(n(t[d%o][i]),s,r);++l)d--,c--;d%=o,c%=o}return c<d&&(c+=o),{start:d,end:c,loop:u,style:e.style}}(e,i),m=[],f,v,b,y,x=null;for(let e=d,t=d;e<=c;++e)(v=i[e%n]).skip||(f=h(v[s]))!==b&&(y=l(f,r,a),null===(x=null===x&&(y||l(r,b,f)&&0!==o(r,b))?0===o(f,r)?e:t:x)||y&&0!==o(a,f)&&!l(a,b,f)||(m.push(Ai({start:x,end:e,loop:u,count:n,style:g})),x=null),t=e,b=f);return null!==x&&m.push(Ai({start:x,end:c,loop:u,count:n,style:g})),m}function Pi(t,i){var s=[],r=t.segments;for(let e=0;e<r.length;e++){var a=Li(r[e],t.points,i);a.length&&s.push(...a)}return s}function Ri(e,t){var i,s,r,a=e.points,n=e.options.spanGaps,o=a.length;return o?({start:s,end:r}=function(e,t,i){let s=0,r=t-1;if(i&&!n)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,i&&(r+=s);r>s&&e[r%t].skip;)r--;return r%=t,{start:s,end:r}}(a,o,i=!!e._loop),Oi(e,!0===n?[{start:s,end:r,loop:i}]:function(t,i,e,s){var r=t.length,a=[];let n,o=i,l=t[i];for(n=i+1;n<=e;++n){let e=t[n%r];e.skip||e.stop?l.skip||(s=!1,a.push({start:i%r,end:(n-1)%r,loop:s}),i=o=e.stop?n:null):(o=n,l.skip&&(i=n)),l=e}return null!==o&&a.push({start:i%r,end:o%r,loop:s}),a}(a,s,r<s?r+o:r,!!e._fullLoop&&0===s&&r===o-1),a,t)):[]}function Oi(t,i,s,u){if(u&&u.setContext&&s){var p,g,m=t,t=i,f=s,v=u;let r=m._chart.getContext(),e=Ii(m.options),{_datasetIndex:a,options:{spanGaps:n}}=m,o=f.length,l=[],h=e,d=t[0].start,c=d;function b(e,t,i,s){var r=n?-1:1;if(e!==t){for(e+=o;f[e%o].skip;)e-=r;for(;f[t%o].skip;)t+=r;e%o!=t%o&&(l.push({start:e%o,end:t%o,loop:i,style:s}),h=s,d=t%o)}}for(let s of t){d=n?d:s.start;let t,i=f[d%o];for(c=d+1;c<=s.end;c++){let e=f[c%o];t=Ii(v.setContext(Mi(r,{type:"segment",p0:i,p1:e,p0DataIndex:(c-1)%o,p1DataIndex:c%o,datasetIndex:a}))),p=t,(g=h)&&JSON.stringify(p)!==JSON.stringify(g)&&b(d,c-1,s.loop,h),i=e,h=t}d<c-1&&b(d,c-1,s.loop,h)}return l}return i}function Ii(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}var Fi=Object.freeze({__proto__:null,easingEffects:pi,isPatternOrGradient:rt,color:at,getHoverColor:nt,noop:e,uid:B,isNullOrUndef:E,isArray:T,isObject:A,isFinite:m,finiteOrDefault:u,valueOrDefault:L,toPercentage:N,toDimension:H,callback:c,each:S,_elementsEqual:V,clone:$,_merger:j,merge:W,mergeIf:q,_mergerIf:U,_deprecated:function(e,t,i,s){void 0!==t&&console.warn(e+': "'+i+'" is deprecated. Please use "'+s+'" instead')},_splitKey:K,resolveObjectKey:g,_capitalize:X,defined:p,isFunction:f,setsEqual:G,_isClickEvent:J,toFontString:At,_measureText:Lt,_longestText:Pt,_alignPixel:Rt,clearCanvas:Ot,drawPoint:It,drawPointLegend:Ft,_isPointInArea:Bt,clipArea:Nt,unclipArea:Ht,_steppedLineTo:Vt,_bezierCurveTo:$t,renderText:zt,addRoundedRectPath:jt,_lookup:fe,_lookupByKey:v,_rlookupByKey:ve,_filterBetween:be,listenArrayEvents:xe,unlistenArrayEvents:we,_arrayUnique:_e,_createResolver:Wt,_attachContext:qt,_descriptors:Ut,_parseObjectDataRadialScale:ii,splineCurve:ni,splineCurveMonotone:oi,_updateBezierControlPoints:hi,_isDomSupported:vt,_getParentNode:bt,getStyle:wt,getRelativePosition:kt,getMaximumSize:Et,retinaScale:Dt,supportsEventListenerOptions:Ct,readUsedSize:Tt,fontString:function(e,t,i){return t+" "+e+"px "+i},requestAnimFrame:Se,throttled:ke,debounce:Me,_toLeftRightCenter:Ee,_alignStartEnd:R,_textX:De,_getStartAndCountOfVisiblePoints:Ce,_scaleRangesChanged:Te,_pointInLine:gi,_steppedInterpolation:mi,_bezierInterpolation:fi,formatNumber:dt,toLineHeight:yi,_readValueToProps:xi,toTRBL:wi,toTRBLCorners:_i,toPadding:I,toFont:F,resolve:Si,_addGrace:ki,createContext:Mi,PI:M,TAU:y,PITAU:Z,INFINITY:Q,RAD_PER_DEG:ee,HALF_PI:D,QUARTER_PI:te,TWO_THIRDS_PI:ie,log10:o,sign:x,almostEquals:se,niceNum:re,_factorize:ae,isNumber:ne,almostWhole:oe,_setMinAndMaxByKey:le,toRadians:P,toDegrees:he,_decimalPlaces:de,getAngleFromPoint:ce,distanceBetweenPoints:ue,_angleDiff:pe,_normalizeAngle:b,_angleBetween:ge,_limitValue:C,_int16Range:me,_isBetween:d,getRtlAdapter:Ei,overrideTextDirection:Di,restoreTextDirection:Ci,_boundSegment:Li,_boundSegments:Pi,_computeSegments:Ri});function Bi(e,a,t,n,o){var l=e.getSortedVisibleDatasetMetas(),h=t[a];for(let t=0,e=l.length;t<e;++t){let{index:i,data:s}=l[t],{lo:e,hi:r}=function(e,r,a,t){let{controller:i,data:n,_sorted:s}=e,o=i._cachedMeta.iScale;if(o&&r===o.axis&&"r"!==r&&s&&n.length){let s=o._reversePixels?ve:v;if(!t)return s(n,r,a);if(i._sharedOptions){let e=n[0],i="function"==typeof e.getRange&&e.getRange(r);if(i){let e=s(n,r,a-i),t=s(n,r,a+i);return{lo:e.lo,hi:t.hi}}}}return{lo:0,hi:n.length-1}}(l[t],a,h,o);for(let t=e;t<=r;++t){let e=s[t];e.skip||n(e,i,t)}}}function Ni(s,r,e,a,n){let o=[];return(n||s.isPointInArea(r))&&Bi(s,e,r,function(e,t,i){(n||Bt(e,s.chartArea,0))&&e.inRange(r.x,r.y,a)&&o.push({element:e,datasetIndex:t,index:i})},!0),o}function Hi(e,t,i,s,r,l){{if(l||e.isPointInArea(t)){if("r"!==i||s){var h=e,d=t,c=i,u=s,p=r,g=l;let a=[],n=function(e){let s=-1!==e.indexOf("x"),r=-1!==e.indexOf("y");return function(e,t){var i=s?Math.abs(e.x-t.x):0,e=r?Math.abs(e.y-t.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(e,2))}}(c),o=Number.POSITIVE_INFINITY;return Bi(h,c,d,function(e,t,i){var s,r=e.inRange(d.x,d.y,p);(!u||r)&&(s=e.getCenterPoint(p),g||h.isPointInArea(s)||r)&&((r=n(d,s))<o?(a=[{element:e,datasetIndex:t,index:i}],o=r):r===o&&a.push({element:e,datasetIndex:t,index:i}))}),a}{var o=t,m=r;let n=[];return Bi(e,i,o,function(e,t,i){var{startAngle:s,endAngle:r}=e.getProps(["startAngle","endAngle"],m),a=ce(e,{x:o.x,y:o.y}).angle;ge(a,s,r)&&n.push({element:e,datasetIndex:t,index:i})}),n}}return[]}}function Vi(e,s,r,t,a){let n=[],o="x"===r?"inXRange":"inYRange",l=!1;return Bi(e,r,s,(e,t,i)=>{e[o](s[r],a)&&(n.push({element:e,datasetIndex:t,index:i}),l=l||e.inRange(s.x,s.y,a))}),t&&!l?[]:n}var $i={evaluateInteractionItems:Bi,modes:{index(e,t,i,s){let r=kt(t,e),a=i.axis||"x",n=i.includeInvisible||!1,o=i.intersect?Ni(e,r,a,s,n):Hi(e,r,a,!1,s,n),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{var t=o[0].index,i=e.data[t];i&&!i.skip&&l.push({element:i,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,i,s){var t=kt(t,e),r=i.axis||"xy",a=i.includeInvisible||!1;let n=i.intersect?Ni(e,t,r,s,a):Hi(e,t,r,!1,s,a);if(0<n.length){let t=n[0].datasetIndex,i=e.getDatasetMeta(t).data;n=[];for(let e=0;e<i.length;++e)n.push({element:i[e],datasetIndex:t,index:e})}return n},point:(e,t,i,s)=>Ni(e,kt(t,e),i.axis||"xy",s,i.includeInvisible||!1),nearest(e,t,i,s){return Hi(e,kt(t,e),i.axis||"xy",i.intersect,s,i.includeInvisible||!1)},x:(e,t,i,s)=>Vi(e,kt(t,e),"x",i.intersect,s),y:(e,t,i,s)=>Vi(e,kt(t,e),"y",i.intersect,s)}};let zi=["left","top","right","bottom"];function ji(e,t){return e.filter(e=>e.pos===t)}function Wi(e,t){return e.filter(e=>-1===zi.indexOf(e.pos)&&e.box.axis===t)}function qi(e,s){return e.sort((e,t)=>{var i=s?t:e,e=s?e:t;return i.weight===e.weight?i.index-e.index:i.weight-e.weight})}function Ui(e,t,i,s){return Math.max(e[i],t[i])+Math.max(e[s],t[s])}function Yi(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Ki(i,s,r,a){var n=[];let o,e,l,h,d,c;for(o=0,e=i.length,d=0;o<e;++o){l=i[o],(h=l.box).update(l.width||s.w,l.height||s.h,function(e,i){let s=i.maxPadding;{let t={left:0,top:0,right:0,bottom:0};return(e=e?["left","right"]:["top","bottom"]).forEach(e=>{t[e]=Math.max(i[e],s[e])}),t}}(l.horizontal,s));let{same:e,other:t}=function(t,e,i,s){var{pos:r,box:a}=i,n=t.maxPadding;if(!A(r)){i.size&&(t[r]-=i.size);let e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[r]+=i.size}return a.getPadding&&Yi(n,a.getPadding()),s=Math.max(0,e.outerWidth-Ui(n,t,"left","right")),r=Math.max(0,e.outerHeight-Ui(n,t,"top","bottom")),a=s!==t.w,e=r!==t.h,t.w=s,t.h=r,i.horizontal?{same:a,other:e}:{same:e,other:a}}(s,r,l,a);d|=e&&n.length,c=c||t,h.fullSize||n.push(l)}return d&&Ki(n,s,r,a)||c}function Xi(e,t,i,s,r){e.top=i,e.left=t,e.right=t+s,e.bottom=i+r,e.width=s,e.height=r}function Gi(e,a,n,t){var o,l=n.padding;let{x:h,y:d}=a;for(o of e){let i=o.box,s=t[o.stack]||{count:1,placed:0,weight:1},r=o.stackWeight/s.weight||1;if(o.horizontal){let e=a.w*r,t=s.size||i.height;p(s.start)&&(d=s.start),i.fullSize?Xi(i,l.left,d,n.outerWidth-l.right-l.left,t):Xi(i,a.left+s.placed,d,e,t),s.start=d,s.placed+=e,d=i.bottom}else{let e=a.h*r,t=s.size||i.width;p(s.start)&&(h=s.start),i.fullSize?Xi(i,h,l.top,t,n.outerHeight-l.bottom-l.top):Xi(i,h,a.top+s.placed,t,e),s.start=h,s.placed+=e,h=i.right}}a.x=h,a.y=d}var r={addBox(e,t){e.boxes||(e.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)}}]},e.boxes.push(t)},removeBox(e,t){t=e.boxes?e.boxes.indexOf(t):-1;-1!==t&&e.boxes.splice(t,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(i,s,r,a){if(i){var n,o,l=I(i.options.layout.padding),h=Math.max(s-l.width,0),d=Math.max(r-l.height,0),c=(u=function(e){var t=[];let i,s,r,a,n,o;for(i=0,s=(e||[]).length;i<s;++i)({position:a,options:{stack:n,stackWeight:o=1}}=r=e[i]),t.push({index:i,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:n&&a+n,stackWeight:o});return t}(i.boxes),c=qi(u.filter(e=>e.box.fullSize),!0),p=qi(ji(u,"left"),!0),g=qi(ji(u,"right")),f=qi(ji(u,"top"),!0),n=qi(ji(u,"bottom")),o=Wi(u,"x"),m=Wi(u,"y"),{fullSize:c,leftAndTop:p.concat(f),rightAndBottom:g.concat(m).concat(n).concat(o),chartArea:ji(u,"chartArea"),vertical:p.concat(g).concat(m),horizontal:f.concat(n).concat(o)}),u=c.vertical,p=c.horizontal,g=(S(i.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}),u.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1),m=Object.freeze({outerWidth:s,outerHeight:r,padding:l,availableWidth:h,availableHeight:d,vBoxMaxWidth:h/2/g,hBoxMaxHeight:d/2}),f=Object.assign({},l);Yi(f,I(a));let t=Object.assign({maxPadding:f,w:h,h:d,x:l.left,y:l.top},l),e=function(s,r){var a=function(e){var s,r,a={};for(s of e){let{stack:e,pos:t,stackWeight:i}=s;e&&zi.includes(t)&&((r=a[e]||(a[e]={count:0,placed:0,weight:0,size:0})).count++,r.weight+=i)}return a}(s),{vBoxMaxWidth:n,hBoxMaxHeight:o}=r;let l,e,h;for(l=0,e=s.length;l<e;++l){let e=(h=s[l]).box.fullSize,t=a[h.stack],i=t&&h.stackWeight/t.weight;h.horizontal?(h.width=i?i*n:e&&r.availableWidth,h.height=o):(h.width=n,h.height=i?i*o:e&&r.availableHeight)}return a}(u.concat(p),m);Ki(c.fullSize,t,m,e),Ki(u,t,m,e),Ki(p,t,m,e)&&Ki(u,t,m,e);{var v=t;let i=v.maxPadding;function b(e){var t=Math.max(i[e]-v[e],0);return v[e]+=t,t}v.y+=b("top"),v.x+=b("left"),b("right"),b("bottom")}Gi(c.leftAndTop,t,m,e),t.x+=t.w,t.y+=t.h,Gi(c.rightAndBottom,t,m,e),i.chartArea={left:t.left,top:t.top,right:t.left+t.w,bottom:t.top+t.h,height:t.h,width:t.w},S(c.chartArea,e=>{e=e.box;Object.assign(e,i.chartArea),e.update(t.w,t.h,{left:0,top:0,right:0,bottom:0})})}}};class Ji{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Zi extends Ji{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}let Qi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},es=e=>null===e||""===e,ts=!!Ct&&{passive:!0};function is(e,t){for(var i of e)if(i===t||i.contains(t))return!0}function ss(e,t,s){let r=e.canvas,i=new MutationObserver(t=>{let i=!1;for(let e of t)i=i||is(e.addedNodes,r),i=i&&!is(e.removedNodes,r);i&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}function rs(e,t,s){let r=e.canvas,i=new MutationObserver(t=>{let i=!1;for(let e of t)i=i||is(e.removedNodes,r),i=i&&!is(e.addedNodes,r);i&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}let as=new Map,ns=0;function os(){let i=window.devicePixelRatio;i!==ns&&(ns=i,as.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function ls(t,e,s){let i=t.canvas,r=i&&bt(i);if(r){let i=ke((e,t)=>{var i=r.clientWidth;s(e,t),i<r.clientWidth&&s()},window),e=new ResizeObserver(e=>{var e=e[0],t=e.contentRect.width,e=e.contentRect.height;0===t&&0===e||i(t,e)});return e.observe(r),t=t,a=i,as.size||window.addEventListener("resize",os),as.set(t,a),e;var a}}function hs(e,t,i){i&&i.disconnect(),"resize"===t&&(i=e,as.delete(i),as.size||window.removeEventListener("resize",os))}function ds(t,e,i){var s=t.canvas,r=ke(e=>{null!==t.ctx&&i(function(e,t){var i=Qi[e.type]||e.type,{x:s,y:r}=kt(e,t);return{type:i,chart:t,native:e,x:void 0!==s?s:null,y:void 0!==r?r:null}}(e,t))},t);return s.addEventListener(e,r,ts),r}class cs extends Ji{acquireContext(t,e){var i=t&&t.getContext&&t.getContext("2d");{if(i&&i.canvas===t){var s=e,e=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:r,width:a,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",es(a)){let e=Tt(t,"width");void 0!==e&&(t.width=e)}if(es(r))if(""===t.style.height)t.height=t.width/(s||2);else{let e=Tt(t,"height");void 0!==e&&(t.height=e)}return i}return null}}releaseContext(e){let i=e.canvas;if(!i.$chartjs)return!1;let s=i.$chartjs.initial,t=(["height","width"].forEach(e=>{var t=s[e];E(t)?i.removeAttribute(e):i.setAttribute(e,t)}),s.style||{});return Object.keys(t).forEach(e=>{i.style[e]=t[e]}),i.width=i.width,delete i.$chartjs,!0}addEventListener(e,t,i){this.removeEventListener(e,t);var s=e.$proxies||(e.$proxies={}),r={attach:ss,detach:rs,resize:ls}[t]||ds;s[t]=r(e,t,i)}removeEventListener(e,t){var i=e.$proxies||(e.$proxies={}),s=i[t];s&&(({attach:hs,detach:hs,resize:hs}[t]||function(e,t,i){e.canvas.removeEventListener(t,i,ts)})(e,t,s),i[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Et(e,t,i,s)}isAttached(e){e=bt(e);return!(!e||!e.isConnected)}}function us(e){return!vt()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Zi:cs}let ps=Object.freeze({__proto__:null,_detectPlatform:us,BasePlatform:Ji,BasicPlatform:Zi,DomPlatform:cs}),gs="transparent",ms={boolean:(e,t,i)=>.5<i?t:e,color(e,t,i){var e=at(e||gs),s=e.valid&&at(t||gs);return s&&s.valid?s.mix(e,i).hexString():t},number:(e,t,i)=>e+(t-e)*i};class fs{constructor(e,t,i,s){var r=t[i],r=(s=Si([e.to,s,r,e.from]),Si([e.from,r,s]));this._active=!0,this._fn=e.fn||ms[e.type||typeof r],this._easing=pi[e.easing]||pi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){var s,r,a;this._active&&(this._notify(!1),s=this._target[this._prop],r=i-this._start,a=this._duration-r,this._start=i,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=Si([e.to,t,s,e.from]),this._from=Si([e.from,s,t]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){var e=e-this._start,t=this._duration,i=this._prop,s=this._from,r=this._loop,a=this._to;this._active=s!==a&&(r||e<t),this._active?e<0?this._target[i]=s:(e=e/t%2,e=this._easing(Math.min(1,Math.max(0,r&&1<e?2-e:e))),this._target[i]=this._fn(s,a,e)):(this._target[i]=a,this._notify(!0))}wait(){let i=this._promises||(this._promises=[]);return new Promise((e,t)=>{i.push({res:e,rej:t})})}_notify(e){var t=e?"res":"rej",i=this._promises||[];for(let e=0;e<i.length;e++)i[e][t]()}}class vs{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(A(e)){let r=Object.keys(O.animation),a=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{var s=e[i];if(A(s)){let t={};for(let e of r)t[e]=s[e];(T(s.properties)&&s.properties||[i]).forEach(e=>{e!==i&&a.has(e)||a.set(e,t)})}})}}_animateOptions(e,t){let i=t.options,s=function(t,i){if(i){let e=t.options;if(e)return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e;t.options=i}}(e,i);return s?(t=this._createAnimations(s,i),i.$shared&&function(t,e){var i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){var r=t[s[e]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(e.options.$animations,i).then(()=>{e.options=i},()=>{}),t):[]}_createAnimations(t,i){var s=this._properties,r=[],a=t.$animations||(t.$animations={}),e=Object.keys(i),n=Date.now();let o;for(o=e.length-1;0<=o;--o){var l=e[o];if("$"!==l.charAt(0))if("options"===l)r.push(...this._animateOptions(t,i));else{var h=i[l];let e=a[l];var d=s.get(l);if(e){if(d&&e.active()){e.update(d,h,n);continue}e.cancel()}d&&d.duration?(a[l]=e=new fs(d,t,l,h),r.push(e)):t[l]=h}}return r}update(e,t){var i;if(0!==this._properties.size)return(i=this._createAnimations(e,t)).length?(a.add(this._chart,i),!0):void 0;Object.assign(e,t)}}function bs(e,t){var e=e&&e.options||{},i=e.reverse,s=void 0===e.min?t:0,e=void 0===e.max?t:0;return{start:i?e:s,end:i?s:e}}function ys(e,t){var i=[],s=e._getSortedDatasetMetas(t);let r,a;for(r=0,a=s.length;r<a;++r)i.push(s[r].index);return i}function xs(e,t,i,s={}){var r=e.keys,a="single"===s.mode;let n,o,l,h;if(null!==t){for(n=0,o=r.length;n<o;++n){if((l=+r[n])===i){if(s.all)continue;break}m(h=e.values[l])&&(a||0===t||x(t)===x(h))&&(t+=h)}return t}}function ws(e,t){e=e&&e.options.stacked;return e||void 0===e&&void 0!==t.stack}function _s(t,e,i,s){for(var r of e.getMatchingVisibleMetas(s).reverse()){let e=t[r.index];if(i&&0<e||!i&&e<0)return r.index}return null}function Ss(e,r){let{chart:t,_cachedMeta:a}=e,n=t._stacks||(t._stacks={}),{iScale:i,vScale:o,index:l}=a,h=i.axis,d=o.axis,c=i.id+`.${o.id}.`+(a.stack||a.type),u=r.length;var p,g,m;for(let s=0;s<u;++s){let e=r[s],{[h]:t,[d]:i}=e;(g=(e._stacks||(e._stacks={}))[d]=(m=t,(p=(p=n)[g=c]||(p[g]={}))[m]||(p[m]={})))[l]=i,g._top=_s(g,o,!0,a.type),g._bottom=_s(g,o,!1,a.type),(g._visualValues||(g._visualValues={}))[l]=i}}function ks(e,t){let i=e.scales;return Object.keys(i).filter(e=>i[e].axis===t).shift()}function Ms(e,i){var s=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){i=i||e._parsed;for(let t of i){let e=t._stacks;if(!e||void 0===e[r]||void 0===e[r][s])return;delete e[r][s],void 0!==e[r]._visualValues&&void 0!==e[r]._visualValues[s]&&delete e[r]._visualValues[s]}}}let Es=e=>"reset"===e||"none"===e,Ds=(e,t)=>t?e:Object.assign({},e);class Cs{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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(){var e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=ws(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Ms(this._cachedMeta),this.index=e}linkScales(){var e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(e,t,i,s)=>"x"===e?t:"r"===e?s:i,r=t.xAxisID=L(i.xAxisID,ks(e,"x")),a=t.yAxisID=L(i.yAxisID,ks(e,"y")),i=t.rAxisID=L(i.rAxisID,ks(e,"r")),e=t.indexAxis,n=t.iAxisID=s(e,r,a,i),s=t.vAxisID=s(e,a,r,i);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(i),t.iScale=this.getScaleForId(n),t.vScale=this.getScaleForId(s)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){var t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){var e=this._cachedMeta;this._data&&we(this._data,this),e._stacked&&Ms(e)}_dataCheck(){let e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(A(t))this._data=function(e){var t=Object.keys(e),i=new Array(t.length);let s,r,a;for(s=0,r=t.length;s<r;++s)a=t[s],i[s]={x:a,y:e[a]};return i}(t);else if(i!==t){if(i){we(i,this);let e=this._cachedMeta;Ms(e),e._parsed=[]}t&&Object.isExtensible(t)&&xe(t,this),this._syncList=[],this._data=t}}addElements(){var e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){var t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();var r=t._stacked;t._stacked=ws(t.vScale,t),t.stack!==i.stack&&(s=!0,Ms(t),t.stack=i.stack),this._resyncElements(e),!s&&r===t._stacked||Ss(this,t._parsed)}configure(){var e=this.chart.config,t=e.datasetScopeKeys(this._type),t=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(t,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:s,_data:r}=this,{iScale:e,_stacked:a}=s,n=e.axis,o,l,h,d=0===t&&i===r.length||s._sorted,c=0<t&&s._parsed[t-1];if(!1===this._parsing)s._parsed=r,s._sorted=!0,h=r;else{h=T(r[t])?this.parseArrayData(s,r,t,i):A(r[t])?this.parseObjectData(s,r,t,i):this.parsePrimitiveData(s,r,t,i);let e=()=>null===l[n]||c&&l[n]<c[n];for(o=0;o<i;++o)s._parsed[o+t]=l=h[o],d&&(e()&&(d=!1),c=l);s._sorted=d}a&&Ss(this,h)}parsePrimitiveData(e,t,i,s){var{iScale:r,vScale:a}=e,n=r.axis,o=a.axis,l=r.getLabels(),h=r===a,d=new Array(s);let c,u,p;for(c=0,u=s;c<u;++c)p=c+i,d[c]={[n]:h||r.parse(l[p],p),[o]:a.parse(t[p],p)};return d}parseArrayData(e,t,i,s){var{xScale:r,yScale:a}=e,n=new Array(s);let o,l,h,d;for(o=0,l=s;o<l;++o)d=t[h=o+i],n[o]={x:r.parse(d[0],h),y:a.parse(d[1],h)};return n}parseObjectData(e,t,i,s){var{xScale:r,yScale:a}=e,{xAxisKey:n="x",yAxisKey:o="y"}=this._parsing,l=new Array(s);let h,d,c,u;for(h=0,d=s;h<d;++h)u=t[c=h+i],l[h]={x:r.parse(g(u,n),c),y:a.parse(g(u,o),c)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){var s=this.chart,r=this._cachedMeta,a=t[e.axis];return xs({keys:ys(s,!0),values:t._stacks[e.axis]._visualValues},a,r.index,{mode:i})}updateRangeFromParsed(e,t,i,s){var r=i[t.axis];let a=null===r?NaN:r;i=s&&i._stacks[t.axis];s&&i&&(s.values=i,a=xs(s,r,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(t,e){let i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,n=this._getOtherScale(t),o=(c=this.chart,e&&!i.hidden&&i._stacked&&{keys:ys(c,!0),values:null}),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=function(){var{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}();var c;let u,p;function g(){var e=(p=s[u])[n.axis];return!m(p[t.axis])||h>e||d<e}for(u=0;u<a&&(g()||(this.updateRangeFromParsed(l,t,p,o),!r));++u);if(r)for(u=a-1;0<=u;--u)if(!g()){this.updateRangeFromParsed(l,t,p,o);break}return l}getAllParsedValues(e){var t=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=t.length;s<r;++s)m(a=t[s][e.axis])&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(e){var t=this._cachedMeta,i=t.iScale,t=t.vScale,e=this.getParsed(e);return{label:i?""+i.getLabelForValue(e[i.axis]):"",value:t?""+t.getLabelForValue(e[t.axis]):""}}_update(e){var t,i=this._cachedMeta;this.update(e||"default"),i._clip=function(e){let t,i,s,r;return A(e)?(t=e.top,i=e.right,s=e.bottom,r=e.left):t=i=s=r=e,{top:t,right:i,bottom:s,left:r,disabled:!1===e}}(L(this.options.clip,(e=i.xScale,i=i.yScale,!1!==(t=this.getMaxOverflow())&&(e=bs(e,t),{top:(i=bs(i,t)).end,right:e.end,bottom:i.start,left:e.start}))))}update(e){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],n=this._drawStart||0,o=this._drawCount||s.length-n,l=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(t,r,n,o),h=n;h<n+o;++h){let e=s[h];e.hidden||(e.active&&l?a.push(e):e.draw(t,r))}for(h=0;h<a.length;++h)a[h].draw(t,r)}getStyle(e,t){t=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(t):this.resolveDataElementOptions(e||0,t)}getContext(t,e,i){var s,r=this.getDataset();let a;if(0<=t&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];(a=e.$context||(e.$context=Mi(this.getContext(),{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"}))).parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else(a=this.$context||(this.$context=(t=this.chart.getContext(),s=this.index,Mi(t,{active:!1,dataset:void 0,datasetIndex:s,index:s,mode:"default",type:"dataset"})))).dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){let s="active"===t,r=this._cachedDataOpts,a=e+"-"+t,n=r[a],o=this.enableOptionSharing&&p(i);var l,h,d;return n?Ds(n,o):(h=(d=this.chart.config).datasetElementScopeKeys(this._type,e),l=s?[e+"Hover","hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),h),e=Object.keys(O.elements[e]),(d=d.resolveNamedOptions(h,e,()=>this.getContext(i,s,t),l)).$shared&&(d.$shared=o,r[a]=Object.freeze(Ds(d,o))),d)}_resolveAnimations(s,r,a){let e=this.chart,t=this._cachedDataOpts,i="animation-"+r,n=t[i];if(n)return n;let o;if(!1!==e.options.animation){let e=this.chart.config,t=e.datasetAnimationScopeKeys(this._type,r),i=e.getOptionScopes(this.getDataset(),t);o=e.createResolver(i,this.getContext(s,a,r))}s=new vs(e,o&&o.animations);return o&&o._cacheable&&(t[i]=Object.freeze(s)),s}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Es(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){var e=this.resolveDataElementOptions(e,t),i=this._sharedOptions,s=this.getSharedOptions(e),i=this.includeOptions(t,s)||s!==i;return this.updateSharedOptions(s,t,e),{sharedOptions:s,includeOptions:i}}updateElement(e,t,i,s){Es(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!Es(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;var r=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){let t=this._data,i=this._cachedMeta.data;for(let[e,t,i]of this._syncList)this[e](t,i);this._syncList=[];var s=i.length,r=t.length,a=Math.min(r,s);a&&this.parse(0,a),s<r?this._insertElements(s,r-s,e):r<s&&this._removeElements(r,s-r)}_insertElements(e,t,i=!0){let s=this._cachedMeta,r=s.data,a=e+t,n;var o=e=>{for(e.length+=t,n=e.length-1;n>=a;n--)e[n]=e[n-t]};for(o(r),n=e;n<a;++n)r[n]=new this.dataElementType;this._parsing&&o(s._parsed),this.parse(e,t),i&&this.updateElements(r,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){var i,s=this._cachedMeta;this._parsing&&(i=s._parsed.splice(e,t),s._stacked)&&Ms(s,i),s.data.splice(e,t)}_sync(e){var t,i,s;this._parsing?this._syncList.push(e):([t,i,s]=e,this[t](i,s)),this.chart._dataChanges.push([this.index,...e])}_onDataPush(){var e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);t=arguments.length-2;t&&this._sync(["_insertElements",e,t])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class t{static defaults={};static defaultRoutes=void 0;active=!1;tooltipPosition(e){var{x:e,y:t}=this.getProps(["x","y"],e);return{x:e,y:t}}hasValue(){return ne(this.x)&&ne(this.y)}getProps(e,t){let i=this.$animations;if(!t||!i)return this;let s={};return e.forEach(e=>{s[e]=i[e]&&i[e].active()?i[e]._to:this[e]}),s}}function Ts(e,t,i,s,r){var a=L(s,0),n=Math.min(L(r,e.length),e.length);let o,l,h,d=0;for(i=Math.ceil(i),r&&(i=(o=r-s)/Math.floor(o/i)),h=a;h<0;)d++,h=Math.round(a+d*i);for(l=Math.max(a,0);l<n;l++)l===h&&(t.push(e[l]),d++,h=Math.round(a+d*i))}let As=(e,t,i)=>"top"===t||"left"===t?e[t]+i:e[t]-i;function Ls(e,t){var i=[],s=e.length/t,r=e.length;let a=0;for(;a<r;a+=s)i.push(e[Math.floor(a)]);return i}function Ps(e){return e.drawTicks?e.tickLength:0}function Rs(e,t){var i;return e.display?(t=F(e.font,t),i=I(e.padding),(T(e.text)?e.text.length:1)*t.lineHeight+i.height):0}class Os extends t{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){var{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this,e=u(e,Number.POSITIVE_INFINITY),t=u(t,Number.NEGATIVE_INFINITY),i=u(i,Number.POSITIVE_INFINITY),s=u(s,Number.NEGATIVE_INFINITY);return{min:u(e,i),max:u(t,s),minDefined:m(e),maxDefined:m(t)}}getMinMax(i){let s,{min:r,max:a,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:r,max:a};var l=this.getMatchingVisibleMetas();for(let e=0,t=l.length;e<t;++e)s=l[e].controller.getMinMax(this,i),n||(r=Math.min(r,s.min)),o||(a=Math.max(a,s.max));return r=o&&r>a?a:r,a=n&&r>a?r:a,{min:u(r,u(a,r)),max:u(a,u(r,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(e,t,i){var{beginAtZero:s,grace:r,ticks:a}=this.options,n=a.sampleSize,e=(this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ki(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks(),n<this.ticks.length);this._convertTicksToLabels(e?Ls(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=function(e,s){let t=e.options.ticks,i=(d=(e=e).options.offset,c=e._tickSize(),d=e._length/c+(d?0:1),Math.floor(Math.min(d,e._maxLength/c))),r=Math.min(t.maxTicksLimit||i,i),a=t.major.enabled?function(e){var t=[];let i,s;for(i=0,s=e.length;i<s;i++)e[i].major&&t.push(i);return t}(s):[],n=a.length,o=a[0],l=a[n-1],h=[];var d,c;if(r<n){var u=s;var p=h;var g=a;var m=n/r;let e,t=0,i=g[0];for(m=Math.ceil(m),e=0;e<u.length;e++)e===i&&(p.push(u[e]),t++,i=g[t*m])}else{var f=function(e,t,i){var e=function(e){var t=e.length;let i,s;if(t<2)return!1;for(s=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==s)return!1;return s}(e),s=t.length/i;if(e){var r=ae(e);for(let t=0,e=r.length-1;t<e;t++){let e=r[t];if(e>s)return e}}return Math.max(s,1)}(a,s,r);if(0<n){let e,t,i=1<n?Math.round((l-o)/(n-1)):null;for(Ts(s,h,f,E(i)?0:o-i,o),e=0,t=n-1;e<t;e++)Ts(s,h,f,a[e],a[e+1]);Ts(s,h,f,l,E(i)?s.length:l+i)}else Ts(s,h,f)}return h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),e&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,i=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,i=!i),this._startPixel=e,this._endPixel=t,this._reversePixels=i,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(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(){c(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),c(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){var t=this.options.ticks;let i,s,r;for(i=0,s=e.length;i<s;i++)(r=e[i]).label=c(t.callback,[r.value,i,e],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var e,t,i,s,r=this.options,a=r.ticks,n=this.ticks.length,o=a.minRotation||0,l=a.maxRotation;let h,d,c,u=o;!this._isVisible()||!a.display||l<=o||n<=1||!this.isHorizontal()?this.labelRotation=o:(t=(e=this._getLabelSizes()).widest.width,i=e.highest.height,s=C(this.chart.width-t,0,this.maxWidth),(r.offset?this.maxWidth/n:s/(n-1))<t+6&&(h=s/(n-(r.offset?.5:1)),d=this.maxHeight-Ps(r.grid)-a.padding-Rs(r.title,this.chart.options.font),c=Math.sqrt(t*t+i*i),u=he(Math.min(Math.asin(C((e.highest.height+6)/h,-1,1)),Math.asin(C(d/c,-1,1))-Math.asin(C(i/c,-1,1)))),u=Math.max(o,Math.min(l,u))),this.labelRotation=u)}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){c(this.options.beforeFit,[this])}fit(){let l={width:0,height:0},{chart:t,options:{ticks:h,title:i,grid:s}}=this,e=this._isVisible(),d=this.isHorizontal();if(e){let e=Rs(i,t.options.font);if(d?(l.width=this.maxWidth,l.height=Ps(s)+e):(l.height=this.maxHeight,l.width=Ps(s)+e),h.display&&this.ticks.length){let{first:e,last:t,widest:i,highest:s}=this._getLabelSizes(),r=2*h.padding,a=P(this.labelRotation),n=Math.cos(a),o=Math.sin(a);if(d){let e=h.mirror?0:o*i.width+n*s.height;l.height=Math.min(this.maxHeight,l.height+e+r)}else{let e=h.mirror?0:n*i.width+o*s.height;l.width=Math.min(this.maxWidth,l.width+e+r)}this._calculatePadding(e,t,o,n)}}this._handleMargins(),d?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(r,a,n,o){let{ticks:{align:l,padding:h},position:e}=this.options,d=0!==this.labelRotation,c="top"!==e&&"x"===this.axis;if(this.isHorizontal()){let e=this.getPixelForTick(0)-this.left,t=this.right-this.getPixelForTick(this.ticks.length-1),i=0,s=0;d?s=c?(i=o*r.width,n*a.height):(i=n*r.height,o*a.width):"start"===l?s=a.width:"end"===l?i=r.width:"inner"!==l&&(i=r.width/2,s=a.width/2),this.paddingLeft=Math.max((i-e+h)*this.width/(this.width-e),0),this.paddingRight=Math.max((s-t+h)*this.width/(this.width-t),0)}else{let e=a.height/2,t=r.height/2;"start"===l?(e=0,t=r.height):"end"===l&&(e=a.height,t=0),this.paddingTop=e+h,this.paddingBottom=t+h}}_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(){c(this.options.afterFit,[this])}isHorizontal(){var{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,i=e.length;t<i;t++)E(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){var i=this.options.ticks.sampleSize;let e=this.ticks;i<e.length&&(e=Ls(e,i)),this._labelSizes=t=this._computeLabelSizes(e,e.length)}return t}_computeLabelSizes(e,t){let{ctx:i,_longestTextCache:s}=this,r=[],a=[],n,o,l,h,d,c,u,p,g,m,f,v=0,b=0;for(n=0;n<t;++n){if(h=e[n].label,d=this._resolveTickFontOptions(n),i.font=c=d.string,u=s[c]=s[c]||{data:{},gc:[]},p=d.lineHeight,g=m=0,E(h)||T(h)){if(T(h))for(o=0,l=h.length;o<l;++o)E(f=h[o])||T(f)||(g=Lt(i,u.data,u.gc,g,f),m+=p)}else g=Lt(i,u.data,u.gc,g,h),m=p;r.push(g),a.push(m),v=Math.max(g,v),b=Math.max(m,b)}y=t,S(s,e=>{var t=e.gc,i=t.length/2;let s;if(y<i){for(s=0;s<i;++s)delete e.data[t[s]];t.splice(0,i)}});var y,x=r.indexOf(v),w=a.indexOf(b),_=e=>({width:r[e]||0,height:a[e]||0});return{first:_(0),last:_(t-1),widest:_(x),highest:_(w),widths:r,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);e=this._startPixel+e*this._length;return me(this._alignToPixels?Rt(this.chart,e,0):e)}getDecimalForPixel(e){e=(e-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:e,max:t}=this;return e<0&&t<0?t:0<e&&0<t?e:0}getContext(e){var t=this.ticks||[];return 0<=e&&e<t.length?(t=t[e]).$context||(t.$context=Mi(this.getContext(),{tick:t,index:e,type:"tick"})):this.$context||(this.$context=Mi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){var e=this.options.ticks,t=P(this.labelRotation),i=Math.abs(Math.cos(t)),t=Math.abs(Math.sin(t)),s=this._getLabelSizes(),e=e.autoSkipPadding||0,r=s?s.widest.width+e:0,s=s?s.highest.height+e:0;return this.isHorizontal()?r*t<s*i?r/i:s/t:s*t<r*i?s/i:r/t}_isVisible(){var e=this.options.display;return"auto"!==e?!!e:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(e){function i(e){return Rt(c,e,l)}let t=this.axis,c=this.chart,s=this.options,{grid:u,position:r,border:p}=s,g=u.offset,m=this.isHorizontal(),a=this.ticks.length+(g?1:0),n=Ps(u),f=[],o=p.setContext(this.getContext()),l=o.display?o.width:0,h=l/2,d,v,b,y,x,w,_,S,k,M,E,D;if("top"===r)d=i(this.bottom),w=this.bottom-n,S=d-h,M=i(e.top)+h,D=e.bottom;else if("bottom"===r)d=i(this.top),M=e.top,D=i(e.bottom)-h,w=d+h,S=this.top+n;else if("left"===r)d=i(this.right),x=this.right-n,_=d-h,k=i(e.left)+h,E=e.right;else if("right"===r)d=i(this.left),k=e.left,E=i(e.right)-h,x=d+h,_=this.left+n;else if("x"===t){if("center"===r)d=i((e.top+e.bottom)/2+.5);else if(A(r)){let e=Object.keys(r)[0],t=r[e];d=i(this.chart.scales[e].getPixelForValue(t))}M=e.top,D=e.bottom,w=d+h,S=w+n}else if("y"===t){if("center"===r)d=i((e.left+e.right)/2);else if(A(r)){let e=Object.keys(r)[0],t=r[e];d=i(this.chart.scales[e].getPixelForValue(t))}x=d-h,_=x-n,k=e.left,E=e.right}var e=L(s.ticks.maxTicksLimit,a),C=Math.max(1,Math.ceil(a/e));for(v=0;v<a;v+=C){let e=this.getContext(v),t=u.setContext(e),i=p.setContext(e),s=t.lineWidth,r=t.color,a=i.dash||[],n=i.dashOffset,o=t.tickWidth,l=t.tickColor,h=t.tickBorderDash||[],d=t.tickBorderDashOffset;void 0!==(b=function(e,t,i){var s=e.ticks.length,r=Math.min(t,s-1),a=e._startPixel,n=e._endPixel;let o,l=e.getPixelForTick(r);if(!(i&&(o=1===s?Math.max(l-a,n-l):0===t?(e.getPixelForTick(1)-l)/2:(l-e.getPixelForTick(r-1))/2,(l+=r<t?o:-o)<a-1e-6||l>n+1e-6)))return l}(this,v,g))&&(y=Rt(c,b,s),m?x=_=k=E=y:w=S=M=D=y,f.push({tx1:x,ty1:w,tx2:_,ty2:S,x1:k,y1:M,x2:E,y2:D,width:s,color:r,borderDash:a,borderDashOffset:n,tickWidth:o,tickColor:l,tickBorderDash:h,tickBorderDashOffset:d}))}return this._ticksLength=a,this._borderValue=d,f}_computeLabelItems(e){let t=this.axis,i=this.options,{position:o,ticks:l}=i,h=this.isHorizontal(),d=this.ticks,{align:s,crossAlign:c,padding:r,mirror:u}=l,a=Ps(i.grid),n=a+r,p=u?-r:n,g=-P(this.labelRotation),m=[],f,v,b,y,x,w,_,S,k,M,E,D="middle";if("top"===o)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===o)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===o){let e=this._getYAxisLabelAlignment(a);w=e.textAlign,y=e.x}else if("right"===o){let e=this._getYAxisLabelAlignment(a);w=e.textAlign,y=e.x}else if("x"===t){if("center"===o)x=(e.top+e.bottom)/2+n;else if(A(o)){let e=Object.keys(o)[0],t=o[e];x=this.chart.scales[e].getPixelForValue(t)+n}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===o)y=(e.left+e.right)/2-n;else if(A(o)){let e=Object.keys(o)[0],t=o[e];y=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(a).textAlign}"y"===t&&("start"===s?D="top":"end"===s&&(D="bottom"));var C=this._getLabelSizes();for(f=0,v=d.length;f<v;++f){b=d[f].label;let a=l.setContext(this.getContext(f)),e=(_=this.getPixelForTick(f)+l.labelOffset,k=(S=this._resolveTickFontOptions(f)).lineHeight,(M=T(b)?b.length:1)/2),t=a.color,i=a.textStrokeColor,s=a.textStrokeWidth,n,r=w;if(h?(y=_,"inner"===w&&(r=f===v-1?this.options.reverse?"left":"right":0===f?this.options.reverse?"right":"left":"center"),E="top"===o?"near"===c||0!=g?-M*k+k/2:"center"===c?-C.highest.height/2-e*k+k:-C.highest.height+k/2:"near"===c||0!=g?k/2:"center"===c?C.highest.height/2-e*k:C.highest.height-M*k,u&&(E*=-1),0==g||a.showLabelBackdrop||(y+=k/2*Math.sin(g))):(x=_,E=(1-M)*k/2),a.showLabelBackdrop){let e=I(a.backdropPadding),t=C.heights[f],i=C.widths[f],s=E-e.top,r=0-e.left;switch(D){case"middle":s-=t/2;break;case"bottom":s-=t}switch(w){case"center":r-=i/2;break;case"right":r-=i}n={left:r,top:s,width:i+e.width,height:t+e.height,color:a.backdropColor}}m.push({label:b,font:S,textOffset:E,options:{rotation:g,color:t,strokeColor:i,strokeWidth:s,textAlign:r,textBaseline:D,translation:[y,x],backdrop:n}})}return m}_getXAxisLabelAlignment(){var{position:e,ticks:t}=this.options;if(-P(this.labelRotation))return"top"===e?"left":"right";let i="center";return"start"===t.align?i="left":"end"===t.align?i="right":"inner"===t.align&&(i="inner"),i}_getYAxisLabelAlignment(e){var{position:t,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,e=e+r,a=this._getLabelSizes().widest.width;let n,o;return"left"===t?s?(o=this.right+r,"near"===i?n="left":"center"===i?(n="center",o+=a/2):(n="right",o+=a)):(o=this.right-e,"near"===i?n="right":"center"===i?(n="center",o-=a/2):(n="left",o=this.left)):"right"===t?s?(o=this.left+r,"near"===i?n="right":"center"===i?(n="center",o-=a/2):(n="left",o-=a)):(o=this.left+e,"near"===i?n="left":"center"===i?(n="center",o+=a/2):(n="right",o=this.right)):n="right",{textAlign:n,x:o}}_computeLabelArea(){var e,t;if(!this.options.ticks.mirror)return e=this.chart,"left"===(t=this.options.position)||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){var{ctx:e,options:{backgroundColor:t},left:i,top:s,width:r,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,r,a),e.restore())}getLineWidthForValue(t){var e,i=this.options.grid;return this._isVisible()&&i.display&&0<=(e=this.ticks.findIndex(e=>e.value===t))?i.setContext(this.getContext(e)).lineWidth:0}drawGrid(e){let t=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),r,a;var n=(e,t,i)=>{i.width&&i.color&&(s.save(),s.lineWidth=i.width,s.strokeStyle=i.color,s.setLineDash(i.borderDash||[]),s.lineDashOffset=i.borderDashOffset,s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke(),s.restore())};if(t.display)for(r=0,a=i.length;r<a;++r){let e=i[r];t.drawOnChartArea&&n({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&n({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){var{chart:r,ctx:a,options:{border:n,grid:o}}=this,l=n.setContext(this.getContext()),n=n.display?l.width:0;if(n){var o=o.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let e,t,i,s;this.isHorizontal()?(e=Rt(r,this.left,n)-n/2,t=Rt(r,this.right,o)+o/2,i=s=h):(i=Rt(r,this.top,n)-n/2,s=Rt(r,this.bottom,o)+o/2,e=t=h),a.save(),a.lineWidth=l.width,a.strokeStyle=l.color,a.beginPath(),a.moveTo(e,i),a.lineTo(t,s),a.stroke(),a.restore()}}drawLabels(i){if(this.options.ticks.display){let s=this.ctx,e=this._computeLabelArea(),t=(e&&Nt(s,e),this.getLabelItems(i));for(let i of t){let e=i.options,t=i.font;zt(s,i.label,0,i.textOffset,t,e)}e&&Ht(s)}}drawTitle(){var{ctx:t,options:{position:i,title:s,reverse:r}}=this;if(s.display){var a=F(s.font),n=I(s.padding),o=s.align;let e=a.lineHeight/2;"bottom"===i||"center"===i||A(i)?(e+=n.bottom,T(s.text)&&(e+=a.lineHeight*(s.text.length-1))):e+=n.top;var{titleX:n,titleY:l,maxWidth:h,rotation:d}=function(e,i,s,t){var{top:r,left:a,bottom:n,right:o,chart:l}=e,{chartArea:l,scales:h}=l;let d,c,u,p=0;var g=n-r,m=o-a;if(e.isHorizontal()){if(c=R(t,a,o),A(s)){let e=Object.keys(s)[0],t=s[e];u=h[e].getPixelForValue(t)+g-i}else u="center"===s?(l.bottom+l.top)/2+g-i:As(e,s,i);d=o-a}else{if(A(s)){let e=Object.keys(s)[0],t=s[e];c=h[e].getPixelForValue(t)-m+i}else c="center"===s?(l.left+l.right)/2-m+i:As(e,s,i);u=R(t,n,r),p="left"===s?-D:D}return{titleX:c,titleY:u,maxWidth:d,rotation:p}}(this,e,i,o);zt(t,s.text,0,0,a,{color:s.color,maxWidth:h,rotation:d,textAlign:function(e,t,i){let s=Ee(e);return s=i&&"right"!==t||!i&&"right"===t?"left"===(e=s)?"right":"right"===e?"left":e:s}(o,i,r),textBaseline:"middle",translation:[n,l]})}}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){var e=this.options,t=e.ticks&&e.ticks.z||0,i=L(e.grid&&e.grid.z,-1),e=L(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Os.prototype.draw?[{z:i,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:e,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(t){var i=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",r=[];let a,e;for(a=0,e=i.length;a<e;++a){let e=i[a];e[s]!==this.id||t&&e.type!==t||r.push(e)}return r}_resolveTickFontOptions(e){return F(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){var e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Is{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){var t=Object.getPrototypeOf(e);let i;"id"in(n=t)&&"defaults"in n&&(i=this.register(t));var s,r,a,n=this.items,t=e.id,o=this.scope+"."+t;if(t)return t in n||(n[t]=e,n=e,t=o,s=i,s=W(Object.create(null),[s?O.get(s):{},O.get(t),n.defaults]),O.set(t,s),n.defaultRoutes&&(r=t,a=n.defaultRoutes,Object.keys(a).forEach(e=>{var t=e.split("."),i=t.pop(),t=[r].concat(t).join("."),e=a[e].split("."),s=e.pop(),e=e.join(".");O.route(t,i,e,s)})),n.descriptors&&O.describe(t,n.descriptors),this.override&&O.override(e.id,e.overrides)),o;throw new Error("class does not have id: "+e)}get(e){return this.items[e]}unregister(e){var t=this.items,e=e.id,i=this.scope;e in t&&delete t[e],i&&e in O[i]&&(delete O[i][e],this.override)&&delete pt[e]}}var w=new class{constructor(){this.controllers=new Is(Cs,"datasets",!0),this.elements=new Is(t,"elements"),this.plugins=new Is(Object,"plugins"),this.scales=new Is(Os,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(i,e,s){[...e].forEach(e=>{var t=s||this._getRegistryForType(e);s||t.isForType(e)||t===this.plugins&&e.id?this._exec(i,t,e):S(e,e=>{var t=s||this._getRegistryForType(e);this._exec(i,t,e)})})}_exec(e,t,i){var s=X(e);c(i["before"+s],[],i),t[e](i),c(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){var i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(e,t,i){t=t.get(e);if(void 0===t)throw new Error('"'+e+'" is not a registered '+i+".");return t}};class Fs{constructor(){this._init=[]}notify(e,t,i,s){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));s=s?this._descriptors(e).filter(s):this._descriptors(e),i=this._notify(s,e,t,i);return"afterDestroy"===t&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),i}_notify(e,t,i,s){s=s||{};for(var r of e){let e=r.plugin;if(!1===c(e[i],[t,s,r.options],e)&&s.cancelable)return!1}return!0}invalidate(){E(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){var t;return this._cache||(t=this._cache=this._createDescriptors(e),this._notifyStateChanges(e),t)}_createDescriptors(e,t){var i=e&&e.config,s=L(i.options&&i.options.plugins,{}),i=function(e){let i={},s=[],t=Object.keys(w.plugins.items);for(let e=0;e<t.length;e++)s.push(w.getPlugin(t[e]));var r=e.plugins||[];for(let t=0;t<r.length;t++){let e=r[t];-1===s.indexOf(e)&&(s.push(e),i[e.id]=!0)}return{plugins:s,localIds:i}}(i);if(!1!==s||t){var r,a,n,o,l,h,d,[c,{plugins:u,localIds:p},g,m]=[e,i,s,t],f=[],v=c.getContext();for(r of u){let e=r.id,t=(d=g[e],m||!1!==d?!0===d?{}:d:null);null!==t&&f.push({plugin:r,options:([d,{plugin:a,local:n},o,l]=[c.config,{plugin:r,local:p[e]},t,v],h=void 0,h=d.pluginScopeKeys(a),o=d.getOptionScopes(o,h),n&&a.defaults&&o.push(a.defaults),d.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0}))})}return f}return[]}_notifyStateChanges(e){var t=this._oldCache||[],i=this._cache,s=(e,i)=>e.filter(t=>!i.some(e=>t.plugin.id===e.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function Bs(e,t){var i=O.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Ns(e,t){if("x"===e||"y"===e||"r"===e)return e;var i;if(e=t.axis||("top"===(i=t.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||1<e.length&&Ns(e[0].toLowerCase(),t))return e;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Hs(e){var t=e.options||(e.options={});t.plugins=L(t.plugins,{}),t.scales=function(t,i){let a=pt[t.type]||{scales:{}},n=i.scales||{},o=Bs(t.type,i),l=Object.create(null);return Object.keys(n).forEach(e=>{var t=n[e];if(!A(t))return console.error("Invalid scale configuration for scale: "+e);if(t._proxy)return console.warn("Ignoring resolver passed as options for scale: "+e);let i=Ns(e,t),s=i===o?"_index_":"_value_",r=a.scales||{};l[e]=q(Object.create(null),[{axis:i},t,r[i],r[s]])}),t.data.datasets.forEach(s=>{let e=s.type||t.type,r=s.indexAxis||Bs(e,i),a=(pt[e]||{}).scales||{};Object.keys(a).forEach(e=>{var t=function(e,t){let i=e;return"_index_"===e?i=t:"_value_"===e&&(i="x"===t?"y":"x"),i}(e,r),i=s[t+"AxisID"]||t;l[i]=l[i]||Object.create(null),q(l[i],[{axis:t},n[i],a[e]])})}),Object.keys(l).forEach(e=>{e=l[e];q(e,[O.scales[e.type],O.scale])}),l}(e,t)}function Vs(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}let $s=new Map,zs=new Set;function js(e,t){let i=$s.get(e);return i||(i=t(),$s.set(e,i),zs.add(i)),i}let Ws=(e,t,i)=>{t=g(t,i);void 0!==t&&e.add(t)};class qs{constructor(e){this._config=((e=(e=e)||{}).data=Vs(e.data),Hs(e),e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Vs(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){var e=this._config;this.clearCache(),Hs(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return js(e,()=>[["datasets."+e,""]])}datasetAnimationScopeKeys(e,t){return js(e+".transition."+t,()=>[[`datasets.${e}.transitions.`+t,"transitions."+t],["datasets."+e,""]])}datasetElementScopeKeys(e,t){return js(e+"-"+t,()=>[[`datasets.${e}.elements.`+t,"datasets."+e,"elements."+t,""]])}pluginScopeKeys(e){let t=e.id;return js(this.type+"-plugin-"+t,()=>[["plugins."+t,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){var i=this._scopeCache;let s=i.get(e);return s&&!t||(s=new Map,i.set(e,s)),s}getOptionScopes(t,e,i){let{options:s,type:r}=this,a=this._cachedScopes(t,i),n=a.get(e);if(n)return n;let o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Ws(o,t,e))),e.forEach(e=>Ws(o,s,e)),e.forEach(e=>Ws(o,pt[r]||{},e)),e.forEach(e=>Ws(o,O,e)),e.forEach(e=>Ws(o,gt,e))});i=Array.from(o);return 0===i.length&&i.push(Object.create(null)),zs.has(e)&&a.set(e,i),i}chartOptionScopes(){var{options:e,type:t}=this;return[e,pt[t]||{},O.datasets[t]||{},{type:t},O,gt]}resolveNamedOptions(e,t,i,s=[""]){var r={$shared:!0},{resolver:s,subPrefixes:a}=Us(this._resolverCache,e,s);let n=s;!function(s,e){var r,{isScriptable:a,isIndexable:n}=Ut(s);for(r of e){let e=a(r),t=n(r),i=(t||e)&&s[r];if(e&&(f(i)||Ys(i))||t&&T(i))return 1}}(s,t)||(r.$shared=!1,n=qt(s,i=f(i)?i():i,this.createResolver(e,i,a)));for(let e of t)r[e]=n[e];return r}createResolver(e,t,i=[""],s){e=Us(this._resolverCache,e,i).resolver;return A(t)?qt(e,t,void 0,s):e}}function Us(e,t,i){let s=e.get(t);s||(s=new Map,e.set(t,s));e=i.join();let r=s.get(e);return r||(r={resolver:Wt(t,i),subPrefixes:i.filter(e=>!e.toLowerCase().includes("hover"))},s.set(e,r)),r}let Ys=i=>A(i)&&Object.getOwnPropertyNames(i).reduce((e,t)=>e||f(i[t]),!1),Ks=["top","bottom","left","right","chartArea"];function Xs(e,t){return"top"===e||"bottom"===e||-1===Ks.indexOf(e)&&"x"===t}function Gs(i,s){return function(e,t){return e[i]===t[i]?e[s]-t[s]:e[i]-t[i]}}function Js(e){var t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),c(i&&i.onComplete,[e],t)}function Zs(e){var t=e.chart,i=t.options.animation;c(i&&i.onProgress,[e],t)}function Qs(e){return vt()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e=e&&e.canvas?e.canvas:e}let er={},tr=e=>{let t=Qs(e);return Object.values(er).filter(e=>e.canvas===t).pop()};class i{static defaults=O;static instances=er;static overrides=pt;static registry=w;static version="4.1.1";static getChart=tr;static register(...e){w.add(...e),ir()}static unregister(...e){w.remove(...e),ir()}constructor(e,t){var t=this.config=new qs(t),e=Qs(e),i=tr(e);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");var i=t.createResolver(t.chartOptionScopes(),this.getContext()),t=(this.platform=new(t.platform||us(e)),this.platform.updateConfig(t),this.platform.acquireContext(e,i.aspectRatio)),e=t&&t.canvas,s=e&&e.height,r=e&&e.width;this.id=B(),this.ctx=t,this.canvas=e,this.width=r,this.height=s,this._options=i,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 Fs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Me(e=>this.update(e),i.resizeDelay||0),this._dataChanges=[],er[this.id]=this,t&&e?(a.listen(this,"complete",Js),a.listen(this,"progress",Zs),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:r}=this;return E(e)?t&&r?r:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return w}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Dt(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ot(this.canvas,this.ctx),this}stop(){return a.stop(this),this}resize(e,t){a.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){var i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(s,e,t,r),e=i.devicePixelRatio||this.platform.getDevicePixelRatio(),t=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Dt(this,e,!0)&&(this.notifyPlugins("resize",{size:s}),c(i.onResize,[this,s],this),this.attached)&&this._doResize(t)&&this.render()}ensureScalesHaveIDs(){S(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let n=this.options,s=n.scales,o=this.scales,l=Object.keys(o).reduce((e,t)=>(e[t]=!1,e),{}),e=[];S(e=s?e.concat(Object.keys(s).map(e=>{var t=s[e],e=Ns(e,t),i="r"===e,e="x"===e;return{options:t,dposition:i?"chartArea":e?"bottom":"left",dtype:i?"radialLinear":e?"category":"linear"}})):e,e=>{var t=e.options,i=t.id,s=Ns(i,t),r=L(t.type,e.dtype);void 0!==t.position&&Xs(t.position,s)===Xs(e.dposition)||(t.position=e.dposition),l[i]=!0;let a=null;i in o&&o[i].type===r?a=o[i]:(a=new(w.getScale(r))({id:i,type:r,ctx:this.ctx,chart:this}),o[a.id]=a),a.init(t,n)}),S(l,(e,t)=>{e||delete o[t]}),S(o,e=>{r.configure(this,e,e.options),r.addBox(this,e)})}_updateMetasets(){var e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((e,t)=>e.index-t.index),t<i){for(let e=t;e<i;++e)this._destroyDatasetMeta(e);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Gs("order","index"))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:i}}=this;e.length>i.length&&delete this._stacks,e.forEach((t,e)=>{0===i.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(e)})}buildOrUpdateControllers(){let r=[],t=this.data.datasets,a,e;for(this._removeUnreferencedMetasets(),a=0,e=t.length;a<e;a++){let e=t[a],s=this.getDatasetMeta(a);var n=e.type||this.config.type;if(s.type&&s.type!==n&&(this._destroyDatasetMeta(a),s=this.getDatasetMeta(a)),s.type=n,s.indexAxis=e.indexAxis||Bs(n,this.options),s.order=e.order||0,s.index=a,s.label=""+e.label,s.visible=this.isDatasetVisible(a),s.controller)s.controller.updateIndex(a),s.controller.linkScales();else{let e=w.getController(n),{datasetElementType:t,dataElementType:i}=O.datasets[n];Object.assign(e,{dataElementType:w.getElement(i),datasetElementType:t&&w.getElement(t)}),s.controller=new e(this,a),r.push(s.controller)}}return this._updateMetasets(),r}_resetElements(){S(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){let t=this.config,i=(t.update(),this._options=t.createResolver(t.chartOptionScopes(),this.getContext())),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})){var a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let i=0,e=this.data.datasets.length;i<e;i++){let e=this.getDatasetMeta(i).controller,t=!r&&-1===a.indexOf(e);e.buildOrUpdateElements(t),s=Math.max(+e.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||S(a,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Gs("z","_idx"));var{_active:e,_lastEvent:n}=this;n?this._eventHandler(n,!0):e.length&&this._updateHoverStyles(e,e,!0),this.render()}}_updateScales(){S(this.scales,e=>{r.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);G(t,i)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var t,i,s,r,a=this._hiddenIndices;for({method:t,start:i,count:s}of this._getUniformDataChanges()||[]){n=void 0;o=void 0;l=void 0;r=void 0;h=void 0;var n=a;var o=i;var l="_removeElements"===t?-s:s;let e=Object.keys(n);for(var h of e){let e=+h;e>=o&&(r=n[h],delete n[h],0<l||e>o)&&(n[e+l]=r)}}}_getUniformDataChanges(){let e=this._dataChanges;if(e&&e.length){this._dataChanges=[];var t=this.data.datasets.length,i=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),s=i(0);for(let e=1;e<t;e++)if(!G(s,i(e)))return;return Array.from(s).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}}_updateLayout(i){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){r.update(this,this.width,this.height,i);let e=this.chartArea,t=e.width<=0||e.height<=0;this._layers=[],S(this.boxes,e=>{t&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}}_updateDatasets(i){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,t=this.data.datasets.length;e<t;++e)this._updateDataset(e,f(i)?i({datasetIndex:e}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(e,t){var i=this.getDatasetMeta(e),e={meta:i,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",e)&&(i.controller._update(t),e.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",e))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(a.has(this)?this.attached&&!a.running(this)&&a.start(this):(this.draw(),Js({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resize(e,t),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){let 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){var i=this._sortedMetasets,s=[];let r,e;for(r=0,e=i.length;r<e;++r){let e=i[r];t&&!e.visible||s.push(e)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;0<=e;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(i){var e=this.ctx,t=i._clip,s=!t.disabled,r=function(){var{xScale:e,yScale:t}=i;if(e&&t)return{left:e.left,right:e.right,top:t.top,bottom:t.bottom}}()||this.chartArea,a={meta:i,index:i.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&Nt(e,{left:!1===t.left?0:r.left-t.left,right:!1===t.right?this.width:r.right+t.right,top:!1===t.top?0:r.top-t.top,bottom:!1===t.bottom?this.height:r.bottom+t.bottom}),i.controller.draw(),s&&Ht(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return Bt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){t=$i.modes[t];return"function"==typeof t?t(this,e,i,s):[]}getDatasetMeta(e){let t=this.data.datasets[e],i=this._metasets,s=i.filter(e=>e&&e._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){var t=this.data.datasets[e];return!!t&&("boolean"==typeof(e=this.getDatasetMeta(e)).hidden?!e.hidden:!t.hidden)}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(t,e,i){let s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);p(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){var t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),a.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");var{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ot(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete er[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let i=this._listeners,s=this.platform,t=(e,t)=>{s.addEventListener(this,e,t),i[e]=t},r=(e,t,i)=>{e.offsetX=t,e.offsetY=i,this._eventHandler(e)};S(this.options.events,e=>t(e,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let i=this._responsiveListeners,s=this.platform,e=(e,t)=>{s.addEventListener(this,e,t),i[e]=t},t=(e,t)=>{i[e]&&(s.removeEventListener(this,e,t),delete i[e])},r=(e,t)=>{this.canvas&&this.resize(e,t)},a,n=()=>{t("attach",n),this.attached=!0,this.resize(),e("resize",r),e("detach",a)};a=()=>{this.attached=!1,t("resize",r),this._stop(),this._resize(0,0),e("attach",n)},(s.isAttached(this.canvas)?n:a)()}unbindEvents(){S(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},S(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){var s=i?"set":"remove";let r,a,n;for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+s+"DatasetHoverStyle"](),a=0,n=t.length;a<n;++a){let e=(r=t[a])&&this.getDatasetMeta(r.datasetIndex).controller;e&&e[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){var t=this._active||[],e=e.map(({datasetIndex:e,index:t})=>{var i=this.getDatasetMeta(e);if(i)return{datasetIndex:e,element:i.data[t],index:t};throw new Error("No dataset found at index "+e)});V(e,t)||(this._active=e,this._lastEvent=null,this._updateHoverStyles(e,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(e,t,i){var s=this.options.hover,r=(e,i)=>e.filter(t=>!i.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),a=r(t,e),i=i?e:r(e,t);a.length&&this.updateHoverStyle(a,s.mode,!1),i.length&&s.mode&&this.updateHoverStyle(i,s.mode,!0)}_eventHandler(t,e){var i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,s))return e=this._handleEvent(t,e,i.inChartArea),i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(e||i.changed)&&this.render(),this}_handleEvent(e,t,i){let{_active:s=[],options:r}=this,a=t,n=this._getActiveElements(e,s,i,a),o=J(e),l=(h=e,d=this._lastEvent,i&&"mouseout"!==h.type?o?d:h:null);i&&(this._lastEvent=null,c(r.onHover,[e,n,this],this),o)&&c(r.onClick,[e,n,this],this);var h,d=!V(n,s);return(d||t)&&(this._active=n,this._updateHoverStyles(n,s,t)),this._lastEvent=l,d}_getActiveElements(e,t,i,s){return"mouseout"===e.type?[]:i?(i=this.options.hover,this.getElementsAtEventForMode(e,i.mode,i,s)):t}}function ir(){S(i.instances,e=>e._plugins.invalidate())}function sr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var rr={_date:class Va{static override(e){Object.assign(Va.prototype,e)}constructor(e){this.options=e||{}}init(){}formats(){return sr()}parse(){return sr()}format(){return sr()}add(){return sr()}diff(){return sr()}startOf(){return sr()}endOf(){return sr()}}};function ar(i,s,r,a){if(T(i)){var n=i,o=s,l=r,h=a,d=l.parse(n[0],h),n=l.parse(n[1],h),h=Math.min(d,n),c=Math.max(d,n);let e=h,t=c;Math.abs(h)>Math.abs(c)&&(e=c,t=h),o[l.axis]=t,o._custom={barStart:e,barEnd:t,start:d,end:n,min:h,max:c}}else s[r.axis]=r.parse(i,a);return s}function nr(e,t,i,s){var r=e.iScale,a=e.vScale,n=r.getLabels(),o=r===a,l=[];let h,d,c,u;for(d=(h=i)+s;h<d;++h)u=t[h],(c={})[r.axis]=o||r.parse(n[h],h),l.push(ar(u,c,a,h));return l}function or(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function lr(e,t,i,s){return e=s?hr(e=e===t?i:e===i?t:e,i,t):hr(e,t,i)}function hr(e,t,i){return"start"===e?t:"end"===e?i:e}class dr extends Cs{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){var e=a.data;if(e.labels.length&&e.datasets.length){let{pointStyle:s,color:r}=a.legend.options.labels;return e.labels.map((e,t)=>{var i=a.getDatasetMeta(0).controller.getStyle(t);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:s,hidden:!a.getDataVisibility(t),index:t}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(s,r){let a=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=a;else{let e,t,i=e=>+a[e];if(A(a[s])){let{key:t="value"}=this._parsing;i=e=>+g(a[e],t)}for(t=(e=s)+r;e<t;++e)n._parsed[e]=i(e)}}_getRotation(){return P(this.options.rotation-90)}_getCircumference(){return P(this.options.circumference)}_getRotationExtents(){let t=y,i=-y;for(let e=0;e<this.chart.data.datasets.length;++e){var s,r;this.chart.isDatasetVisible(e)&&this.chart.getDatasetMeta(e).type===this._type&&(s=(r=this.chart.getDatasetMeta(e).controller)._getRotation(),r=r._getCircumference(),t=Math.min(t,s),i=Math.max(i,s+r))}return{rotation:t,circumference:i-t}}update(e){var t=this.chart.chartArea,i=this._cachedMeta,s=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-r)/2,0),a=Math.min(N(this.options.cutout,a),1),n=this._getRingWeight(this.index),{circumference:o,rotation:l}=this._getRotationExtents(),{ratioX:l,ratioY:o,offsetX:h,offsetY:d}=function(u,p,g){let m=1,f=1,v=0,b=0;if(p<y){let s=u,r=s+p,e=Math.cos(s),t=Math.sin(s),i=Math.cos(r),a=Math.sin(r),n=(e,t,i)=>ge(e,s,r,!0)?1:Math.max(t,t*g,i,i*g),o=(e,t,i)=>ge(e,s,r,!0)?-1:Math.min(t,t*g,i,i*g),l=n(0,e,i),h=n(D,t,a),d=o(M,e,i),c=o(M+D,t,a);m=(l-d)/2,f=(h-c)/2,v=-(l+d)/2,b=-(h+c)/2}return{ratioX:m,ratioY:f,offsetX:v,offsetY:b}}(l,o,a),l=(t.width-r)/l,t=(t.height-r)/o,r=Math.max(Math.min(l,t)/2,0),o=H(this.options.radius,r),l=(o-Math.max(o*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=h*o,this.offsetY=d*o,i.total=this.calculateTotal(),this.outerRadius=o-l*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-l*n,0),this.updateElements(s,0,s.length,e)}_circumference(e,t){var i=this.options,s=this._cachedMeta,r=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||null===s._parsed[e]||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*r/y)}updateElements(s,e,t,r){let a="reset"===r,i=this.chart,n=i.chartArea,o=i.options.animation,l=(n.left+n.right)/2,h=(n.top+n.bottom)/2,d=a&&o.animateScale,c=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,r),m,f=this._getRotation();for(m=0;m<e;++m)f+=this._circumference(m,a);for(m=e;m<e+t;++m){let e=this._circumference(m,a),t=s[m],i={x:l+this.offsetX,y:h+this.offsetY,startAngle:f,endAngle:f+e,circumference:e,outerRadius:u,innerRadius:c};g&&(i.options=p||this.resolveDataElementOptions(m,t.active?"active":r)),f+=e,this.updateElement(t,m,i,r)}}calculateTotal(){var e=this._cachedMeta,t=e.data;let i,s=0;for(i=0;i<t.length;i++){var r=e._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||t[i].hidden||(s+=Math.abs(r))}return s}calculateCircumference(e){var t=this._cachedMeta.total;return 0<t&&!isNaN(e)?y*(Math.abs(e)/t):0}getLabelAndValue(e){var t=this._cachedMeta,i=this.chart,s=i.data.labels||[],t=dt(t._parsed[e],i.options.locale);return{label:s[e]||"",value:t}}getMaxBorderWidth(e){let t=0;var i=this.chart;let s,r,a,n,o;if(!e)for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){e=(a=i.getDatasetMeta(s)).data,n=a.controller;break}if(!e)return 0;for(s=0,r=e.length;s<r;++s)"inner"!==(o=n.resolveDataElementOptions(s)).borderAlign&&(t=Math.max(t,o.borderWidth||0,o.hoverBorderWidth||0));return t}getMaxOffset(i){let s=0;for(let t=0,e=i.length;t<e;++t){let e=this.resolveDataElementOptions(t);s=Math.max(s,e.offset||0,e.hoverOffset||0)}return s}_getRingWeightOffset(t){let i=0;for(let e=0;e<t;++e)this.chart.isDatasetVisible(e)&&(i+=this._getRingWeight(e));return i}_getRingWeight(e){return Math.max(L(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class cr extends Cs{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){var e=a.data;if(e.labels.length&&e.datasets.length){let{pointStyle:s,color:r}=a.legend.options.labels;return e.labels.map((e,t)=>{var i=a.getDatasetMeta(0).controller.getStyle(t);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:s,hidden:!a.getDataVisibility(t),index:t}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){var t=this._cachedMeta,i=this.chart,s=i.data.labels||[],t=dt(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:t}}parseObjectData(e,t,i,s){return ii.bind(this)(e,t,i,s)}update(e){var t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((e,t)=>{var i=this.getParsed(t).r;!isNaN(i)&&this.chart.getDataVisibility(t)&&(i<s.min&&(s.min=i),i>s.max)&&(s.max=i)}),s}_updateRadius(){var e=this.chart,t=e.chartArea,i=e.options,t=Math.min(t.right-t.left,t.bottom-t.top),t=Math.max(t/2,0),i=(t-Math.max(i.cutoutPercentage?t/100*i.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=t-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(r,e,t,a){var n="reset"===a,o=this.chart,l=o.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,c=h.yCenter,u=h.getIndexAngle(0)-.5*M;let p,g=u;var m=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,a,m);for(p=e;p<e+t;p++){let e=r[p],t=g,i=g+this._computeAngle(p,a,m),s=o.getDataVisibility(p)?h.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=i,n&&(l.animateScale&&(s=0),l.animateRotate)&&(t=i=u);var f={x:d,y:c,innerRadius:0,outerRadius:s,startAngle:t,endAngle:i,options:this.resolveDataElementOptions(p,e.active?"active":a)};this.updateElement(e,p,f,a)}}countVisibleElements(){var e=this._cachedMeta;let i=0;return e.data.forEach((e,t)=>{!isNaN(this.getParsed(t).r)&&this.chart.getDataVisibility(t)&&i++}),i}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?P(this.resolveDataElementOptions(e,t).angle||i):0}}Ct=Object.freeze({__proto__:null,BarController:class extends Cs{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,i,s){return nr(e,t,i,s)}parseArrayData(e,t,i,s){return nr(e,t,i,s)}parseObjectData(e,t,i,s){var{iScale:r,vScale:a}=e,{xAxisKey:e="x",yAxisKey:n="y"}=this._parsing,o="x"===r.axis?e:n,l="x"===a.axis?e:n,h=[];let d,c,u,p;for(c=(d=i)+s;d<c;++d)p=t[d],(u={})[r.axis]=r.parse(g(p,o),d),h.push(ar(g(p,l),u,a,d));return h}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);s=i._custom;s&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){var{iScale:t,vScale:i}=this._cachedMeta,e=this.getParsed(e),s=e._custom,s=or(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(e[i.axis]);return{label:""+t.getLabelForValue(e[t.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(e){var t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(n,e,t,o){var l="reset"===o,{index:h,_cachedMeta:{vScale:d}}=this,c=d.getBasePixel(),u=d.isHorizontal(),p=this._getRuler(),{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,o);for(let a=e;a<e+t;a++){let e=this.getParsed(a),t=l||E(e[d.axis])?{base:c,head:c}:this._calculateBarValuePixels(a),i=this._calculateBarIndexPixels(a,p),s=(e._stacks||{})[d.axis],r={horizontal:u,base:t.base,enableBorderRadius:!s||or(e._custom)||h===s._top||h===s._bottom,x:u?t.head:i.center,y:u?i.center:t.head,height:u?i.size:Math.abs(t.size),width:u?Math.abs(t.size):i.size};m&&(r.options=g||this.resolveDataElementOptions(a,n[a].active?"active":o));var f=r.options||n[a].options;{v=void 0;b=void 0;y=void 0;x=void 0;w=void 0;_=void 0;S=void 0;k=void 0;M=void 0;var v=r;var b=f;var y=s;var x=h;let e=b.borderSkipped;var w,_,S,k,M,b={};e?!0===e?v.borderSkipped={top:!0,right:!0,bottom:!0,left:!0}:({start:w,end:_,reverse:S,top:k,bottom:M}=function(){let e,t,i,s,r;return i=v.horizontal?(e=v.x<v.base,t="left","right"):(e=v.base<v.y,t="bottom","top"),r=e?(s="end","start"):(s="start","end"),{start:t,end:i,reverse:e,top:s,bottom:r}}(),"middle"===e&&y&&(v.enableBorderRadius=!0,e=(y._top||0)===x?k:(y._bottom||0)===x?M:(b[lr(M,w,_,S)]=!0,k)),b[lr(e,w,_,S)]=!0,v.borderSkipped=b):v.borderSkipped=b}[y,{inflateAmount:x},M]=[r,f,p.ratio],y.inflateAmount="auto"===x?1===M?.33:0:x,this.updateElement(n[a],a,r,o)}}_getStacks(t,i){let e=this._cachedMeta.iScale,s=e.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),r=e.options.stacked,a=[];for(let e of s)if((void 0===i||!(e=>{var t=e.controller.getParsed(i),t=t&&t[e.vScale.axis];if(E(t)||isNaN(t))return!0})(e))&&((!1===r||-1===a.indexOf(e.stack)||void 0===r&&void 0===e.stack)&&a.push(e.stack),e.index===t))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){e=this._getStacks(e,i),i=void 0!==t?e.indexOf(t):-1;return-1===i?e.length-1:i}_getRuler(){var e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let r,a;for(r=0,a=t.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));var n=e.barThickness;return{min:n||function(e){var t=e.iScale,i=function(s){if(!s._cache.$bar){var r=s.getMatchingVisibleMetas(e.type);let i=[];for(let e=0,t=r.length;e<t;e++)i=i.concat(r[e].controller.getAllParsedValues(s));s._cache.$bar=_e(i.sort((e,t)=>e-t))}return s._cache.$bar}(t);let s,r,a,n,o=t._length;var l=()=>{32767!==a&&-32768!==a&&(p(n)&&(o=Math.min(o,Math.abs(a-n)||o)),n=a)};for(s=0,r=i.length;s<r;++s)a=t.getPixelForValue(i[s]),l();for(n=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return o}(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:n?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:r,_stacked:a,index:n},options:{base:t,minBarLength:o}}=this,l=t||0,h=this.getParsed(e),i=h._custom,d=or(i),c,u,p=h[r.axis],s=0,g=a?this.applyStack(r,h,a):p;g!==p&&(s=g-p,g=p),d&&(p=i.barStart,g=i.barEnd-i.barStart,0!==p&&x(p)!==x(i.barEnd)&&(s=0),s+=p);var m,f,v=E(t)||d?s:t;let b=r.getPixelForValue(v);if(c=this.chart.getDataVisibility(e)?r.getPixelForValue(s+g):b,u=c-b,Math.abs(u)<o){u=(v=u,m=r,f=l,(0!==v?x(v):(m.isHorizontal()?1:-1)*(m.min>=f?1:-1))*o),p===l&&(b-=u/2);let e=r.getPixelForDecimal(0),t=r.getPixelForDecimal(1),i=Math.min(e,t),s=Math.max(e,t);b=Math.max(Math.min(b,s),i),c=b+u,a&&!d&&(h._stacks[r.axis]._visualValues[n]=r.getValueForPixel(c)-r.getValueForPixel(b))}if(b===r.getPixelForValue(l)){let e=x(u)*r.getLineWidthForValue(l)/2;b+=e,u-=e}return{size:u,base:b,head:c,center:c+u/2}}_calculateBarIndexPixels(s,r){let e=r.scale,a=this.options,n=a.skipNull,o=L(a.maxBarThickness,1/0),l,h;if(r.grouped){let e=n?this._getStackCount(s):r.stackCount,t=("flex"===a.barThickness?function(e,t,i,s){var r=t.pixels,a=r[e];let n=0<e?r[e-1]:null,o=e<r.length-1?r[e+1]:null;r=i.categoryPercentage,null===n&&(n=a-(null===o?t.end-t.start:o-a)),null===o&&(o=a+a-n),e=a-(a-Math.min(n,o))/2*r;return{chunk:Math.abs(o-n)/2*r/s,ratio:i.barPercentage,start:e}}:function(e,t,i,s){var r=i.barThickness;let a,n;return n=E(r)?(a=t.min*i.categoryPercentage,i.barPercentage):(a=r*s,1),{chunk:a/s,ratio:n,start:t.pixels[e]-a/2}})(s,r,a,e),i=this._getStackIndex(this.index,this._cachedMeta.stack,n?s:void 0);l=t.start+t.chunk*i+t.chunk/2,h=Math.min(o,t.chunk*t.ratio)}else l=e.getPixelForValue(this.getParsed(s)[e.axis],s),h=Math.min(o,r.min*r.ratio);return{base:l-h/2,head:l+h/2,center:l,size:h}}draw(){var e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let r=0;for(;r<s;++r)null!==this.getParsed(r)[t.axis]&&i[r].draw(this._ctx)}},BubbleController:class extends Cs{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){var r=super.parsePrimitiveData(e,t,i,s);for(let e=0;e<r.length;e++)r[e]._custom=this.resolveDataElementOptions(e+i).radius;return r}parseArrayData(e,i,s,t){var r=super.parseArrayData(e,i,s,t);for(let t=0;t<r.length;t++){let e=i[s+t];r[t]._custom=L(e[2],this.resolveDataElementOptions(t+s).radius)}return r}parseObjectData(e,i,s,t){var r=super.parseObjectData(e,i,s,t);for(let t=0;t<r.length;t++){let e=i[s+t];r[t]._custom=L(e&&e.r&&+e.r,this.resolveDataElementOptions(t+s).radius)}return r}getMaxOverflow(){var t=this._cachedMeta.data;let i=0;for(let e=t.length-1;0<=e;--e)i=Math.max(i,t[e].size(this.resolveDataElementOptions(e))/2);return 0<i&&i}getLabelAndValue(e){var t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:t,yScale:s}=t,r=this.getParsed(e),t=t.getLabelForValue(r.x),s=s.getLabelForValue(r.y),r=r._custom;return{label:i[e]||"",value:"("+t+", "+s+(r?", "+r:"")+")"}}update(e){var t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(n,e,t,o){var l="reset"===o,{iScale:h,vScale:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,o),p=h.axis,g=d.axis;for(let a=e;a<e+t;a++){let e=n[a],t=!l&&this.getParsed(a),i={},s=i[p]=l?h.getPixelForDecimal(.5):h.getPixelForValue(t[p]),r=i[g]=l?d.getBasePixel():d.getPixelForValue(t[g]);i.skip=isNaN(s)||isNaN(r),u&&(i.options=c||this.resolveDataElementOptions(a,e.active?"active":o),l)&&(i.options.radius=0),this.updateElement(e,a,i,o)}}resolveDataElementOptions(e,t){var i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);e=(s=s.$shared?Object.assign({},s,{$shared:!1}):s).radius;return"active"!==t&&(s.radius=0),s.radius+=L(i&&i._custom,e),s}},DoughnutController:dr,LineController:class extends Cs{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){var t=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=t,a=this.chart._animationsDisabled;let{start:n,count:o}=Ce(t,s,a);this._drawStart=n,this._drawCount=o,Te(t)&&(n=0,o=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0),t.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:t},e),this.updateElements(s,n,o,e)}updateElements(s,r,e,a){let n="reset"===a,{iScale:o,vScale:l,_stacked:h,_dataset:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(r,a),p=o.axis,g=l.axis,{spanGaps:t,segment:m}=this.options,f=ne(t)?t:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||n||"none"===a,b=r+e,y=s.length,x=0<r&&this.getParsed(r-1);for(let i=0;i<y;++i){let e=s[i],t=v?e:{};var w,_,S,k;i<r||i>=b?t.skip=!0:(_=E((w=this.getParsed(i))[g]),S=t[p]=o.getPixelForValue(w[p],i),k=t[g]=n||_?l.getBasePixel():l.getPixelForValue(h?this.applyStack(l,w,h):w[g],i),t.skip=isNaN(S)||isNaN(k)||_,t.stop=0<i&&Math.abs(w[p]-x[p])>f,m&&(t.parsed=w,t.raw=d.data[i]),u&&(t.options=c||this.resolveDataElementOptions(i,e.active?"active":a)),v||this.updateElement(e,i,t,a),x=w)}}getMaxOverflow(){var e,t=this._cachedMeta,i=t.dataset,i=i.options&&i.options.borderWidth||0,t=t.data||[];return t.length?(e=t[0].size(this.resolveDataElementOptions(0)),t=t[t.length-1].size(this.resolveDataElementOptions(t.length-1)),Math.max(i,e,t)/2):i}draw(){var e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PolarAreaController:cr,PieController:class extends dr{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},RadarController:class extends Cs{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){var t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return ii.bind(this)(e,t,i,s)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);var a={_loop:!0,_fullLoop:r.length===s.length,options:e};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(o,e,t,l){var h=this._cachedMeta.rScale,d="reset"===l;for(let n=e;n<e+t;n++){let e=o[n],t=this.resolveDataElementOptions(n,e.active?"active":l),i=h.getPointPositionForValue(n,this.getParsed(n).r),s=d?h.xCenter:i.x,r=d?h.yCenter:i.y,a={x:s,y:r,angle:i.angle,skip:isNaN(s)||isNaN(r),options:t};this.updateElement(e,n,a,l)}}},ScatterController:class extends Cs{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){var t=this._cachedMeta,i=this.chart.data.labels||[],{xScale:t,yScale:s}=t,r=this.getParsed(e),t=t.getLabelForValue(r.x),s=s.getLabelForValue(r.y);return{label:i[e]||"",value:"("+t+", "+s+")"}}update(i){var s=this._cachedMeta,{data:r=[]}=s,a=this.chart._animationsDisabled;let{start:e,count:t}=Ce(s,r,a);if(this._drawStart=e,this._drawCount=t,Te(s)&&(e=0,t=r.length),this.options.showLine){let{dataset:e,_dataset:t}=s;e._chart=this.chart,e._datasetIndex=this.index,e._decimated=!!t._decimated,e.points=r;s=this.resolveDatasetElementOptions(i);s.segment=this.options.segment,this.updateElement(e,void 0,{animated:!a,options:s},i)}this.updateElements(r,e,t,i)}addElements(){var e=this.options.showLine;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(o,e,t,l){let h="reset"===l,{iScale:d,vScale:c,_stacked:u,_dataset:p}=this._cachedMeta,i=this.resolveDataElementOptions(e,l),g=this.getSharedOptions(i),m=this.includeOptions(l,g),f=d.axis,v=c.axis,{spanGaps:s,segment:b}=this.options,y=ne(s)?s:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||h||"none"===l,w=0<e&&this.getParsed(e-1);for(let n=e;n<e+t;++n){let e=o[n],t=this.getParsed(n),i=x?e:{},s=E(t[v]),r=i[f]=d.getPixelForValue(t[f],n),a=i[v]=h||s?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,t,u):t[v],n);i.skip=isNaN(r)||isNaN(a)||s,i.stop=0<n&&Math.abs(t[f]-w[f])>y,b&&(i.parsed=t,i.raw=p.data[n]),m&&(i.options=g||this.resolveDataElementOptions(n,e.active?"active":l)),x||this.updateElement(e,n,i,l),w=t}this.updateSharedOptions(g,l,i)}getMaxOverflow(){var e,t,i=this._cachedMeta,s=i.data||[];if(this.options.showLine)return i=(i=i.dataset).options&&i.options.borderWidth||0,s.length?(e=s[0].size(this.resolveDataElementOptions(0)),t=s[s.length-1].size(this.resolveDataElementOptions(s.length-1)),Math.max(i,e,t)/2):i;{let t=0;for(let e=s.length-1;0<=e;--e)t=Math.max(t,s[e].size(this.resolveDataElementOptions(e))/2);return 0<t&&t}}}});function ur(e,t,i,s){return{x:i+e*Math.cos(t),y:s+e*Math.sin(t)}}function pr(r,e,t,i,s,a){var{x:n,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=e,c=Math.max(e.outerRadius+i+t-h,0),h=0<d?d+i+t+h:0;let u=0;var p=s-l;if(i){let e=((0<d?d-i:0)+(0<c?c-i:0))/2;u=(p-(0!=e?p*e/(e+i):p))/2}var d=(p-Math.max(.001,p*c-t/M)/c)/2,p=l+d+u,l=s-d-u,{outerStart:d,outerEnd:g,innerStart:m,innerEnd:f}=function(e,t,i,s){e=xi(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);let r=(i-t)/2,a=Math.min(r,s*t/2),n=e=>{var t=(i-Math.min(r,e))*s/2;return C(e,0,Math.min(r,t))};return{outerStart:n(e.outerStart),outerEnd:n(e.outerEnd),innerStart:C(e.innerStart,0,a),innerEnd:C(e.innerEnd,0,a)}}(e,h,c,l-p),v=c-d,b=c-g,y=p+d/v,x=l-g/b,w=h+m,_=h+f,S=p+m/w,k=l-f/_;if(r.beginPath(),a){let e=(y+x)/2;if(r.arc(n,o,c,y,e),r.arc(n,o,c,e,x),0<g){let e=ur(b,x,n,o);r.arc(e.x,e.y,g,x,l+D)}let t=ur(_,l,n,o);if(r.lineTo(t.x,t.y),0<f){let e=ur(_,k,n,o);r.arc(e.x,e.y,f,l+D,k+Math.PI)}let i=(l-f/h+(p+m/h))/2;if(r.arc(n,o,h,l-f/h,i,!0),r.arc(n,o,h,i,p+m/h,!0),0<m){let e=ur(w,S,n,o);r.arc(e.x,e.y,m,S+Math.PI,p-D)}let s=ur(v,p,n,o);if(r.lineTo(s.x,s.y),0<d){let e=ur(v,y,n,o);r.arc(e.x,e.y,d,p-D,y)}}else{r.moveTo(n,o);let e=Math.cos(y)*c+n,t=Math.sin(y)*c+o,i=(r.lineTo(e,t),Math.cos(x)*c+n),s=Math.sin(x)*c+o;r.lineTo(i,s)}r.closePath()}function gr(e,t,i=t){e.lineCap=L(i.borderCapStyle,t.borderCapStyle),e.setLineDash(L(i.borderDash,t.borderDash)),e.lineDashOffset=L(i.borderDashOffset,t.borderDashOffset),e.lineJoin=L(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=L(i.borderWidth,t.borderWidth),e.strokeStyle=L(i.borderColor,t.borderColor)}function mr(e,t,i){e.lineTo(i.x,i.y)}function fr(e,t,i={}){var e=e.length,{start:i=0,end:s=e-1}=i,{start:r,end:a}=t,n=Math.max(i,r),o=Math.min(s,a);return{count:e,start:n,loop:t.loop,ilen:o<n&&!(i<r&&s<r||a<i&&a<s)?e+o-n:o-n}}function vr(e,t,i,s){let{points:r,options:a}=t,{count:n,start:o,loop:l,ilen:h}=fr(r,i,s),d=a.stepped?Vt:a.tension||"monotone"===a.cubicInterpolationMode?$t:mr,c,u,p,{move:g=!0,reverse:m}=s||{};for(c=0;c<=h;++c)(u=r[(o+(m?h-c:c))%n]).skip||(g?(e.moveTo(u.x,u.y),g=!1):d(e,p,u,m,a.stepped),p=u);return l&&(u=r[(o+(m?h:0))%n],d(e,p,u,m,a.stepped)),!!l}function br(s,e,t,i){let r=e.points,{count:a,start:n,ilen:o}=fr(r,t,i),{move:l=!0,reverse:h}=i||{},d,c,u,p,g,m,f=0,v=0;var b=e=>(n+(h?o-e:e))%a,y=()=>{p!==g&&(s.lineTo(f,g),s.lineTo(f,p),s.lineTo(f,m))};for(l&&(c=r[b(0)],s.moveTo(c.x,c.y)),d=0;d<=o;++d)if(!(c=r[b(d)]).skip){let e=c.x,t=c.y,i=0|e;i===u?(t<p?p=t:t>g&&(g=t),f=(v*f+e)/++v):(y(),s.lineTo(e,t),u=i,v=0,p=g=t),m=t}y()}function yr(e){var t=e.options,i=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||i?vr:br}let xr="function"==typeof Path2D;class wr extends t{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){var i,s=this.options;!s.tension&&"monotone"!==s.cubicInterpolationMode||s.stepped||this._pointsUpdated||(i=s.spanGaps?this._loop:this._fullLoop,hi(this._points,s,e,i,t),this._pointsUpdated=!0)}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ri(this,this.options.segment))}first(){var e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){var e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(a,n){var o=this.options,l=a[n],h=this.points,d=Pi(this,{property:n,start:l,end:l});if(d.length){var c,u=[],p=o.stepped?mi:o.tension||"monotone"===o.cubicInterpolationMode?fi:gi;let r,e;for(r=0,e=d.length;r<e;++r){let{start:e,end:t}=d[r],i=h[e],s=h[t];i===s?u.push(i):((c=p(i,s,Math.abs((l-i[n])/(s[n]-i[n])),o.stepped))[n]=a[n],u.push(c))}return 1===u.length?u[0]:u}}pathSegment(e,t,i){return yr(this)(e,this,t,i)}path(e,t,i){var s,r=this.segments,a=yr(this);let n=this._loop;t=t||0,i=i||this.points.length-t;for(s of r)n&=a(e,this,s,{start:t,end:t+i-1});return!!n}draw(e,t,i,s){var r,a=this.options||{};(this.points||[]).length&&a.borderWidth&&(e.save(),a=e,r=this,i=i,s=s,(xr&&!r.options.segment?function(e,t,i,s){let r=t._path;r||(r=t._path=new Path2D,t.path(r,i,s)&&r.closePath()),gr(e,t.options),e.stroke(r)}:function(e,t,i,s){var r,{segments:a,options:n}=t,o=yr(t);for(r of a)gr(e,n,r.style),e.beginPath(),o(e,t,r,{start:i,end:i+s-1})&&e.closePath(),e.stroke()})(a,r,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function _r(e,t,i,s){var r=e.options,{[i]:e}=e.getProps([i],s);return Math.abs(t-e)<r.radius+r.hitRadius}function Sr(e,t){var{x:t,y:i,base:s,width:r,height:a}=e.getProps(["x","y","base","width","height"],t);let n,o,l,h,d;return h=e.horizontal?(d=a/2,n=Math.min(t,s),o=Math.max(t,s),l=i-d,i+d):(d=r/2,n=t-d,o=t+d,l=Math.min(i,s),Math.max(i,s)),{left:n,top:l,right:o,bottom:h}}function kr(e,t,i,s){return e?0:C(t,i,s)}function Mr(e,t,i,s){var r=null===t,a=null===i,e=e&&!(r&&a)&&Sr(e,s);return e&&(r||d(t,e.left,e.right))&&(a||d(i,e.top,e.bottom))}function Er(e,t){e.rect(t.x,t.y,t.w,t.h)}function Dr(e,t,i={}){var s=e.x!==i.x?-t:0,r=e.y!==i.y?-t:0;return{x:e.x+s,y:e.y+r,w:e.w+((e.x+e.w!==i.x+i.w?t:0)-s),h:e.h+((e.y+e.h!==i.y+i.h?t:0)-r),radius:e.radius}}var Cr=Object.freeze({__proto__:null,ArcElement:class extends t{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){var{angle:e,distance:t}=ce(this.getProps(["x","y"],i),{x:e,y:t}),{startAngle:i,endAngle:s,innerRadius:r,outerRadius:a,circumference:n}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=this.options.spacing/2,n=L(n,s-i)>=y||ge(e,i,s),e=d(t,r+o,a+o);return n&&e}getCenterPoint(e){var{x:e,y:t,startAngle:i,endAngle:s,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:n,spacing:o}=this.options,i=(i+s)/2,s=(r+a+o+n)/2;return{x:e+Math.cos(i)*s,y:t+Math.sin(i)*s}}tooltipPosition(e){return this.getCenterPoint(e)}draw(t){var{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,n=i.circular;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=s>y?Math.floor(s/y):0,!(0===s||this.innerRadius<0||this.outerRadius<0)){t.save();var o=(this.startAngle+this.endAngle)/2,o=(t.translate(Math.cos(o)*r,Math.sin(o)*r),r*(1-Math.sin(Math.min(M,s||0))));t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor;{var l=t;r=this;s=o;i=a;var h=n;var{fullCircles:d,startAngle:c,circumference:u}=r;let e=r.endAngle;if(d){pr(l,r,s,i,e,h);for(let e=0;e<d;++e)l.fill();isNaN(u)||(e=c+(u%y||y))}pr(l,r,s,i,e,h),l.fill()}var p=t,c=this,u=o,r=a,s=n,{fullCircles:g,startAngle:i,circumference:h,options:o}=c,{borderWidth:a,borderJoinStyle:n}=o,o="inner"===o.borderAlign;if(a){o?(p.lineWidth=2*a,p.lineJoin=n||"round"):(p.lineWidth=a,p.lineJoin=n||"bevel");let e=c.endAngle;if(g){pr(p,c,u,r,e,s);for(let e=0;e<g;++e)p.stroke();isNaN(h)||(e=i+(h%y||y))}if(o){a=p;n=c;i=e;var{startAngle:n,pixelMargin:h,x:o,y:m,outerRadius:f,innerRadius:v}=n,b=h/f;a.beginPath(),a.arc(o,m,f,n-b,i+b),h<v?a.arc(o,m,v,i+(b=h/v),n-b,!0):a.arc(o,m,h,i+D,n-D),a.closePath(),a.clip()}g||(pr(p,c,u,r,e,s),p.stroke())}t.restore()}}},LineElement:wr,PointElement:class extends t{static id="point";static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){var s=this.options,{x:i,y:r}=this.getProps(["x","y"],i);return Math.pow(e-i,2)+Math.pow(t-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return _r(this,e,"x",t)}inYRange(e,t){return _r(this,e,"y",t)}getCenterPoint(e){var{x:e,y:t}=this.getProps(["x","y"],e);return{x:e,y:t}}size(e){var t=(e=e||this.options||{}).radius||0;return 2*((t=Math.max(t,t&&e.hoverRadius||0))+(t&&e.borderWidth||0))}draw(e,t){var i=this.options;this.skip||i.radius<.1||!Bt(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,It(e,i,this.x,this.y))}getRange(){var e=this.options||{};return e.radius+e.hitRadius}},BarElement:class extends t{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){var t,i,s,r,a,n,o,{inflateAmount:l,options:{borderColor:h,backgroundColor:d}}=this,{inner:c,outer:u}=(s=Sr(t=this),r=s.right-s.left,u=r/2,n=(a=s.bottom-s.top)/2,o=(i=t).options.borderWidth,i=i.borderSkipped,o=wi(o),n={t:kr(i.top,o.top,0,n),r:kr(i.right,o.right,0,u),b:kr(i.bottom,o.bottom,0,n),l:kr(i.left,o.left,0,u)},i=r/2,o=a/2,t=(u=t).getProps(["enableBorderRadius"]).enableBorderRadius,c=u.options.borderRadius,p=_i(c),i=Math.min(i,o),o=u.borderSkipped,t={topLeft:kr(!(u=t||A(c))||o.top||o.left,p.topLeft,0,i),topRight:kr(!u||o.top||o.right,p.topRight,0,i),bottomLeft:kr(!u||o.bottom||o.left,p.bottomLeft,0,i),bottomRight:kr(!u||o.bottom||o.right,p.bottomRight,0,i)},{outer:{x:s.left,y:s.top,w:r,h:a,radius:t},inner:{x:s.left+n.l,y:s.top+n.t,w:r-n.l-n.r,h:a-n.t-n.b,radius:{topLeft:Math.max(0,t.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,t.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,t.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,t.bottomRight-Math.max(n.b,n.r))}}}),p=(o=u.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?jt:Er;e.save(),u.w===c.w&&u.h===c.h||(e.beginPath(),p(e,Dr(u,l,c)),e.clip(),p(e,Dr(c,-l,u)),e.fillStyle=h,e.fill("evenodd")),e.beginPath(),p(e,Dr(c,l)),e.fillStyle=d,e.fill(),e.restore()}inRange(e,t,i){return Mr(this,e,t,i)}inXRange(e,t){return Mr(this,e,null,t)}inYRange(e,t){return Mr(this,null,e,t)}getCenterPoint(e){var{x:e,y:t,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(e+i)/2:e,y:s?t:(t+i)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}});function Tr(e){var t=this.getLabels();return 0<=e&&e<t.length?t[e]:e}function Ar(e,t,{horizontal:i,minRotation:s}){s=P(s),i=(i?Math.sin(s):Math.cos(s))||.001;return Math.min(t/i,.75*t*(""+e).length)}class Lr extends Os{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return E(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let e=this.options.beginAtZero,{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:s,max:r}=this;var a,n=e=>s=t?s:e,o=e=>r=i?r:e;if(e){let e=x(s),t=x(r);e<0&&t<0?o(0):0<e&&0<t&&n(0)}s===r&&(a=0===r?1:Math.abs(.05*r),o(r+a),e||n(s-a)),this.min=s,this.max=r}getTickLimit(){let e,{maxTicksLimit:t,stepSize:i}=this.options.ticks;return i?1e3<(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3):(e=this.computeTickLimit(),t=t||11),e=t?Math.min(t,e):e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var e=this.options,t=e.ticks,i=this.getTickLimit(),i=function(e,t){var i=[],{bounds:s,step:r,min:a,max:n,precision:o,count:l,maxTicks:h,maxDigits:d,includeBounds:c}=e,u=r||1,p=h-1,{min:t,max:g}=t,m=!E(a),f=!E(n),v=!E(l),d=(g-t)/(d+1);let b,y,x,w,_=re((g-t)/p/u)*u;if(_<1e-14&&!m&&!f)return[{value:t},{value:g}];(w=Math.ceil(g/_)-Math.floor(t/_))>p&&(_=re(w*_/p/u)*u),E(o)||(b=Math.pow(10,o),_=Math.ceil(_*b)/b),x="ticks"===s?(y=Math.floor(t/_)*_,Math.ceil(g/_)*_):(y=t,g),m&&f&&r&&oe((n-a)/r,_/1e3)?(w=Math.round(Math.min((n-a)/_,h)),_=(n-a)/w,y=a,x=n):v?(y=m?a:y,x=f?n:x,w=l-1,_=(x-y)/w):w=se(w=(x-y)/_,Math.round(w),_/1e3)?Math.round(w):Math.ceil(w);p=Math.max(de(_),de(y));b=Math.pow(10,E(o)?p:o),y=Math.round(y*b)/b,x=Math.round(x*b)/b;let S=0;for(m&&(c&&y!==a?(i.push({value:a}),y<a&&S++,se(Math.round((y+S*_)*b)/b,a,Ar(a,d,e))&&S++):y<a&&S++);S<w;++S)i.push({value:Math.round((y+S*_)*b)/b});return f&&c&&x!==n?i.length&&se(i[i.length-1].value,n,Ar(n,d,e))?i[i.length-1].value=n:i.push({value:n}):f&&x!==n||i.push({value:x}),i}({maxTicks:Math.max(2,i),bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&le(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){var e=this.ticks;let t=this.min,i=this.max;super.configure(),this.options.offset&&e.length&&(e=(i-t)/Math.max(e.length-1,1)/2,t-=e,i+=e),this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return dt(e,this.chart.options.locale,this.options.ticks.format)}}class Pr extends Lr{static id="linear";static defaults={ticks:{callback:ut.formatters.numeric}};determineDataLimits(){var{min:e,max:t}=this.getMinMax(!0);this.min=m(e)?e:0,this.max=m(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){var e=this.isHorizontal(),t=e?this.width:this.height,i=P(this.options.ticks.minRotation),e=(e?Math.sin(i):Math.cos(i))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/e))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}let Rr=e=>Math.floor(o(e)),Or=(e,t)=>Math.pow(10,Rr(e)+t);function Ir(e){return 1==e/Math.pow(10,Rr(e))}function Fr(e,t,i){i=Math.pow(10,i),e=Math.floor(e/i);return Math.ceil(t/i)-e}class Br extends Os{static id="logarithmic";static defaults={ticks:{callback:ut.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){e=Lr.prototype.parse.apply(this,[e,t]);if(0!==e)return m(e)&&0<e?e:null;this._zero=!0}determineDataLimits(){var{min:e,max:t}=this.getMinMax(!0);this.min=m(e)?Math.max(0,e):null,this.max=m(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!m(this._userMin)&&(this.min=e===Or(this.min,0)?Or(this.min,-1):Or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),s=this.min,r=this.max;var e=e=>s=t?s:e,a=e=>r=i?r:e;s===r&&(s<=0?(e(1),a(10)):(e(Or(s,-1)),a(Or(r,1)))),s<=0&&e(Or(r,-1)),r<=0&&a(Or(s,1)),this.min=s,this.max=r}buildTicks(){var e=this.options,t=function(e,{min:t,max:i}){t=u(e.min,t);var s=[],r=Rr(t);let a=function(e,t){let i=Rr(t-e);for(;10<Fr(e,t,i);)i++;for(;Fr(e,t,i)<10;)i--;return Math.min(i,Rr(e))}(t,i),n=a<0?Math.pow(10,Math.abs(a)):1;var o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,r=Math.round((t-l)*n)/n,h=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((r-h)/Math.pow(10,a)),c=u(e.min,Math.round((l+h+d*Math.pow(10,a))*n)/n);for(;c<i;)s.push({value:c,major:Ir(c),significand:d}),10<=d?d=d<15?15:20:d++,20<=d&&(a++,d=2,n=0<=a?1:n),c=Math.round((l+h+d*Math.pow(10,a))*n)/n;return t=u(e.max,c),s.push({value:t,major:Ir(t),significand:d}),s}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&le(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":dt(e,this.chart.options.locale,this.options.ticks.format)}configure(){var e=this.min;super.configure(),this._startValue=o(e),this._valueRange=o(this.max)-o(e)}getPixelForValue(e){return null===(e=void 0!==e&&0!==e?e:this.min)||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(o(e)-this._startValue)/this._valueRange)}getValueForPixel(e){e=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+e*this._valueRange)}}function Nr(e){var t=e.ticks;if(t.display&&e.display){let e=I(t.backdropPadding);return L(t.font&&t.font.size,O.font.size)+e.height}return 0}function Hr(e,t,i,s,r){return e===s||e===r?{start:t-i/2,end:t+i/2}:e<s||r<e?{start:t-i,end:t}:{start:t,end:t+i}}function Vr(i){let r={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},a=Object.assign({},r),s=[],n=[],e=i._pointLabels.length,o=i.options.pointLabels,l=o.centerPointLabels?M/e:0;for(let t=0;t<e;t++){let e=o.setContext(i.getPointLabelContext(t));n[t]=e.padding;var h=i.getPointPosition(t,i.drawingArea+n[t],l),d=F(e.font),c=(c=i.ctx,d=d,u=T(u=i._pointLabels[t])?u:[u],{w:Pt(c,d.string,u),h:u.length*d.lineHeight}),u=(s[t]=c,b(i.getIndexAngle(t)+l)),d=Math.round(he(u));{p=void 0;g=void 0;m=void 0;f=void 0;v=void 0;var p=a;var g=r;var m=u;var f=Hr(d,h.x,c.w,0,180);var v=Hr(d,h.y,c.h,90,270);let e=Math.abs(Math.sin(m)),t=Math.abs(Math.cos(m)),i=0,s=0;f.start<g.l?(i=(g.l-f.start)/e,p.l=Math.min(p.l,g.l-i)):g.r<f.end&&(i=(f.end-g.r)/e,p.r=Math.max(p.r,g.r+i)),v.start<g.t?(s=(g.t-v.start)/t,p.t=Math.min(p.t,g.t-s)):g.b<v.end&&(s=(v.end-g.b)/t,p.b=Math.max(p.b,g.b+s))}}var c,u;i.setCenterPoint(r.l-a.l,a.r-r.r,r.t-a.t,a.b-r.b),i._pointLabelItems=function(o,l,h){let d=[],e=o._pointLabels.length,t=o.options,c=Nr(t)/2,u=o.drawingArea,p=t.pointLabels.centerPointLabels?M/e:0;for(let n=0;n<e;n++){let e=o.getPointPosition(n,u+c+h[n],p),t=Math.round(he(b(e.angle+D))),i=l[n],s=(g=e.y,m=i.h,90===(f=t)||270===f?g-=m/2:(270<f||f<90)&&(g-=m),g),r=0===(f=t)||180===f?"center":f<180?"left":"right",a=(m=e.x,g=i.w,"right"===(f=r)?m-=g:"center"===f&&(m-=g/2),m);d.push({x:e.x,y:s,textAlign:r,left:a,top:s,right:a+i.w,bottom:s+i.h})}var g,m,f;return d}(i,s,n)}function $r(t,i,e,s){var r=t.ctx;if(e)r.arc(t.xCenter,t.yCenter,i,0,y);else{var a=t.getPointPosition(0,i);r.moveTo(a.x,a.y);for(let e=1;e<s;e++)a=t.getPointPosition(e,i),r.lineTo(a.x,a.y)}}class zr extends Lr{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ut.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){var e=this._padding=I(Nr(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){var{min:e,max:t}=this.getMinMax(!1);this.min=m(e)&&!isNaN(e)?e:0,this.max=m(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Nr(this.options))}generateTickLabels(e){Lr.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{e=c(this.options.pointLabels.callback,[e,t],this);return e||0===e?e:""}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){var e=this.options;e.display&&e.pointLabels.display?Vr(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){return b(e*(y/(this._pointLabels.length||1))+P(this.options.startAngle||0))}getDistanceFromCenterForValue(e){var t;return E(e)?NaN:(t=this.drawingArea/(this.max-this.min),this.options.reverse?(this.max-e)*t:(e-this.min)*t)}getValueForDistanceFromCenter(e){return E(e)?NaN:(e=e/(this.drawingArea/(this.max-this.min)),this.options.reverse?this.max-e:this.min+e)}getPointLabelContext(e){var t=this._pointLabels||[];if(0<=e&&e<t.length)return t=t[e],Mi(this.getContext(),{label:t,index:e,type:"pointLabel"})}getPointPosition(e,t,i=0){e=this.getIndexAngle(e)-D+i;return{x:Math.cos(e)*t+this.xCenter,y:Math.sin(e)*t+this.yCenter,angle:e}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){var{left:e,top:t,right:i,bottom:s}=this._pointLabelItems[e];return{left:e,top:t,right:i,bottom:s}}drawBackground(){var e,{backgroundColor:t,grid:{circular:i}}=this.options;t&&((e=this.ctx).save(),e.beginPath(),$r(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),e.closePath(),e.fillStyle=t,e.fill(),e.restore())}drawGrid(){let s=this.ctx,r=this.options,{angleLines:a,grid:l,border:h}=r,d=this._pointLabels.length,n,c,o;if(r.pointLabels.display){var p=this,e=d;let{ctx:u,options:{pointLabels:a}}=p;for(let r=e-1;0<=r;r--){let n=a.setContext(p.getPointLabelContext(r)),e=F(n.font),{x:t,y:i,textAlign:s,left:o,top:l,right:h,bottom:d}=p._pointLabelItems[r],c=n.backdropColor;if(!E(c)){let e=_i(n.borderRadius),t=I(n.backdropPadding),i=(u.fillStyle=c,o-t.left),s=l-t.top,r=h-o+t.width,a=d-l+t.height;Object.values(e).some(e=>0!==e)?(u.beginPath(),jt(u,{x:i,y:s,w:r,h:a,radius:e}),u.fill()):u.fillRect(i,s,r,a)}zt(u,p._pointLabels[r],t,i+e.lineHeight/2,e,{color:n.color,textAlign:s,textBaseline:"middle"})}}if(l.display&&this.ticks.forEach((e,t)=>{var i,s,r,a,n,o;0!==t&&(c=this.getDistanceFromCenterForValue(e.value),e=this.getContext(t),t=l.setContext(e),e=h.setContext(e),i=this,t=t,s=c,r=d,e=e,a=i.ctx,n=t.circular,{color:t,lineWidth:o}=t,!n&&!r||!t||!o||s<0||(a.save(),a.strokeStyle=t,a.lineWidth=o,a.setLineDash(e.dash),a.lineDashOffset=e.dashOffset,a.beginPath(),$r(i,s,n,r),a.closePath(),a.stroke(),a.restore()))}),a.display){for(s.save(),n=d-1;0<=n;n--){let e=a.setContext(this.getPointLabelContext(n)),{color:t,lineWidth:i}=e;i&&t&&(s.lineWidth=i,s.strokeStyle=t,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,c=this.getDistanceFromCenterForValue(r.ticks.reverse?this.min:this.max),o=this.getPointPosition(n,c),s.beginPath(),s.moveTo(this.xCenter,this.yCenter),s.lineTo(o.x,o.y),s.stroke())}s.restore()}}drawBorder(){}drawLabels(){let n=this.ctx,o=this.options,l=o.ticks;if(l.display){var e=this.getIndexAngle(0);let r,a;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(e),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((t,e)=>{if(0!==e||o.reverse){var i=l.setContext(this.getContext(e)),s=F(i.font);if(r=this.getDistanceFromCenterForValue(this.ticks[e].value),i.showLabelBackdrop){n.font=s.string,a=n.measureText(t.label).width,n.fillStyle=i.backdropColor;let e=I(i.backdropPadding);n.fillRect(-a/2-e.left,-r-s.size/2-e.top,a+e.width,s.size+e.height)}zt(n,t.label,0,-r,s,{color:i.color})}}),n.restore()}}drawTitle(){}}let jr={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}},h=Object.keys(jr);function Wr(e,t){return e-t}function qr(e,t){if(E(t))return null;var i=e._adapter,{parser:e,round:s,isoWeekday:r}=e._parseOpts;let a=t;return null===(a=m(a="function"==typeof e?e(a):a)?a:"string"==typeof e?i.parse(a,e):i.parse(a))?null:+(a=s?"week"!==s||!ne(r)&&!0!==r?i.startOf(a,s):i.startOf(a,"isoWeek",r):a)}function Ur(e,s,r,a){let t=h.length;for(let i=h.indexOf(e);i<t-1;++i){let e=jr[h[i]],t=e.steps||Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((r-s)/(t*e.size))<=a)return h[i]}return h[t-1]}function Yr(e,t,i){var s,r;i?i.length&&({lo:s,hi:r}=fe(i,t),e[t<=i[s]?i[s]:i[r]]=!0):e[t]=!0}function Kr(i,e,s){var r=[],a={},t=e.length;let n,o;for(n=0;n<t;++n)a[o=e[n]]=n,r.push({value:o,major:!1});if(0!==t&&s){var l=r,h=a,d=s,c=i._adapter,s=+c.startOf(l[0].value,d),u=l[l.length-1].value;let e,t;for(e=s;e<=u;e=+c.add(e,1,d))0<=(t=h[e])&&(l[t].major=!0);return l}return r}class Xr extends Os{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){var i=e.time||(e.time={}),s=this._adapter=new rr._date(e.adapters.date);s.init(t),q(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:qr(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:n}=this.getUserBounds();function o(e){a||isNaN(e.min)||(s=Math.min(s,e.min)),n||isNaN(e.max)||(r=Math.max(r,e.max))}a&&n||(o(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source)||o(this.getMinMax(!1)),s=m(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),r=m(r)&&!isNaN(r)?r:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){var e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){var e=this.options,t=e.time,i=e.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate(),r=("ticks"===e.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]),this.min),a=be(s,r,this.max);return this._unit=t.unit||(i.autoSkip?Ur(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(i,s,e,r,a){for(let t=h.length-1;t>=h.indexOf(e);t--){let e=h[t];if(jr[e].common&&i._adapter.diff(a,r,e)>=s-1)return e}return h[e?h.indexOf(e):0]}(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(i){for(let e=h.indexOf(i)+1,t=h.length;e<t;++e)if(jr[h[e]].common)return h[e]}(this._unit):void 0,this.initOffsets(s),e.reverse&&a.reverse(),Kr(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,i,s=0,r=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),s=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,i=this.getDecimalForValue(e[e.length-1]),r=1===e.length?i:(i-this.getDecimalForValue(e[e.length-2]))/2);e=e.length<3?.5:.25;s=C(s,0,e),r=C(r,0,e),this._offsets={start:s,end:r,factor:1/(s+1+r)}}_generate(){var e=this._adapter,t=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Ur(r.minUnit,t,i,this._getLabelCapacity(t)),n=L(s.ticks.stepSize,1),r="week"===a&&r.isoWeekday,o=ne(r)||!0===r,l={};let h,d,c=t;if(o&&(c=+e.startOf(c,"isoWeek",r)),c=+e.startOf(c,o?"day":a),e.diff(i,t,a)>1e5*n)throw new Error(t+" and "+i+" are too far apart with stepSize of "+n+" "+a);var u="data"===s.ticks.source&&this.getDataTimestamps();for(h=c,d=0;h<i;h=+e.add(h,n,a),d++)Yr(l,h,u);return h!==i&&"ticks"!==s.bounds&&1!==d||Yr(l,h,u),Object.keys(l).sort((e,t)=>e-t).map(e=>+e)}getLabelForValue(e){var t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){var r,a=this.options,n=a.ticks.callback;return n?c(n,[e,t,i],this):(n=a.time.displayFormats,a=this._unit,r=this._majorUnit,a=a&&n[a],n=r&&n[r],i=i[t],t=r&&n&&i&&i.major,this._adapter.format(e,s||(t?n:a)))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)(s=e[t]).label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){var t=this._offsets,e=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+e)*t.factor)}getValueForPixel(e){var t=this._offsets,e=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+e*(this.max-this.min)}_getLabelSize(e){var t=this.options.ticks,e=this.ctx.measureText(e).width,t=P(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(t),t=Math.sin(t),s=this._resolveTickFontOptions(0).size;return{w:e*i+s*t,h:e*t+s*i}}_getLabelCapacity(e){var t=this.options.time,i=t.displayFormats,t=i[t.unit]||i.millisecond,i=this._tickFormatFunction(e,0,Kr(this,[e],this._majorUnit),t),e=this._getLabelSize(i),t=Math.floor(this.isHorizontal()?this.width/e.w:this.height/e.h)-1;return 0<t?t:1}getDataTimestamps(){let e,t,i=this._cache.data||[];if(i.length)return i;var s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,t=s.length;e<t;++e)i=i.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){var e=this._cache.labels||[];let t,i;if(e.length)return e;var s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(qr(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _e(e.sort(Wr))}}function Gr(e,t,i){let s,r,a,n,o=0,l=e.length-1;i?(t>=e[o].pos&&t<=e[l].pos&&({lo:o,hi:l}=v(e,"pos",t)),{pos:s,time:a}=e[o],{pos:r,time:n}=e[l]):(t>=e[o].time&&t<=e[l].time&&({lo:o,hi:l}=v(e,"time",t)),{time:s,pos:a}=e[o],{time:r,pos:n}=e[l]);i=r-s;return i?a+(n-a)*(t-s)/i:a}let Jr=Object.freeze({__proto__:null,CategoryScale:class extends Os{static id="category";static defaults={ticks:{callback:Tr}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){var t=this._addedLabels;if(t.length){let e=this.getLabels();for(var{index:i,label:s}of t)e[i]===s&&e.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,t){var i,s,r,a,n,o,l;return E(e)||(i=this.getLabels(),a=t=isFinite(t)&&i[t]===e?t:(s=i,r=L(t,e=e),a=this._addedLabels,-1===(l=s.indexOf(e))?(o=r,a=a,"string"==typeof(n=e)?(o=s.push(n)-1,a.unshift({index:o,label:n})):isNaN(n)&&(o=null),o):l!==s.lastIndexOf(e)?r:l),n=i.length-1,null===a)?null:C(Math.round(a),0,n)}determineDataLimits(){var{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){var t=this.min,i=this.max,e=this.options.offset,s=[];let r=this.getLabels();r=0===t&&i===r.length-1?r:r.slice(t,i+1),this._valueRange=Math.max(r.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let e=t;e<=i;e++)s.push({value:e});return s}getLabelForValue(e){return Tr.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return null===(e="number"!=typeof e?this.parse(e):e)?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Pr,LogarithmicScale:Br,RadialLinearScale:zr,TimeScale:Xr,TimeSeriesScale:class extends Xr{static id="timeseries";static defaults=Xr.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Gr(t,this.min),this._tableRange=Gr(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){var{min:t,max:i}=this,s=[],r=[];let a,n,o,l,h;for(a=0,n=e.length;a<n;++a)(l=e[a])>=t&&l<=i&&s.push(l);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(a=0,n=s.length;a<n;++a)h=s[a+1],o=s[a-1],l=s[a],Math.round((h+o)/2)!==l&&r.push({time:l,pos:a/(n-1)});return r}_getTimestampsForTable(){var e,t,i=this._cache.all||[];return i.length||(e=this.getDataTimestamps(),t=this.getLabelTimestamps(),i=e.length&&t.length?this.normalize(e.concat(t)):e.length?e:t,i=this._cache.all=i),i}getDecimalForValue(e){return(Gr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){var t=this._offsets,e=this.getDecimalForPixel(e)/t.factor-t.end;return Gr(this._table,e*this._tableRange+this._minPos,!0)}}}),Zr=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Qr=Zr.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function ea(e){return Zr[e%Zr.length]}function ta(e){return Qr[e%Qr.length]}function ia(a){let n=0;return(e,t)=>{var i,s,r,t=a.getDatasetMeta(t).controller;t instanceof dr?n=(s=e,r=n,s.backgroundColor=s.data.map(()=>ea(r++)),r):t instanceof cr?n=(s=e,i=n,s.backgroundColor=s.data.map(()=>ta(i++)),i):t&&(n=(t=e,e=n,t.borderColor=ea(e),t.backgroundColor=ta(e),++e))}}function sa(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return 1}var ra={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){var s,r;i.enabled&&({options:{elements:s},data:{datasets:r}}=e.config,!i.forceOverride&&(sa(r)||s&&sa(s))||(i=ia(e),r.forEach(i)))}};function aa(e){var t;e._decimated&&(t=e._data,delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t}))}function na(e){e.data.datasets.forEach(e=>{aa(e)})}var oa={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(l,e,_)=>{if(_.enabled){let o=l.width;l.data.datasets.forEach((t,e)=>{var{_data:i,indexAxis:s}=t,h=l.getDatasetMeta(e),r=i||t.data;if("y"!==Si([s,l.options.indexAxis])&&h.controller.supportsDecimation){e=l.scales[h.xAxisID];if(("linear"===e.type||"time"===e.type)&&!l.options.parsing){var{start:a,count:n}=function(e){var t=e.length;let i,s=0;var r=h.iScale,{min:a,max:n,minDefined:o,maxDefined:l}=r.getUserBounds();return o&&(s=C(v(e,r.axis,a).lo,0,t-1)),i=l?C(v(e,r.axis,n).hi+1,s,t)-s:t-s,{start:s,count:i}}(r);if(n<=(_.threshold||4*o))aa(t);else{let e;switch(E(i)&&(t._data=r,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),_.algorithm){case"lttb":e=function(n,o,l,e){var t=_.samples||e;if(l<=t)return n.slice(o,o+l);var h=[],d=(l-2)/(t-2);let c=0,i=o+l-1,u,p,g,m,f,v=o;for(h[c++]=n[v],u=0;u<t-2;u++){let e,t=0,i=0,s=Math.floor((u+1)*d)+1+o,r=Math.min(Math.floor((u+2)*d)+1,l)+o,a=r-s;for(e=s;e<r;e++)t+=n[e].x,i+=n[e].y;t/=a,i/=a;var b=Math.floor(u*d)+1+o,y=Math.min(Math.floor((u+1)*d)+1,l)+o,{x,y:w}=n[v];for(g=-1,e=b;e<y;e++)(m=.5*Math.abs((x-t)*(n[e].y-w)-(x-n[e].x)*(i-w)))>g&&(g=m,p=n[e],f=e);h[c++]=p,v=f}return h[c++]=n[i],h}(r,a,n,o);break;case"min-max":e=function(s,e,t,i){let r,a,n,o,l,h,d,c,u,p,g=0,m=0;var f=[],v=s[e].x,b=s[e+t-1].x-v;for(r=e;r<e+t;++r){n=((a=s[r]).x-v)/b*i,o=a.y;let e=0|n;if(e===l)o<u?(u=o,h=r):o>p&&(p=o,d=r),g=(m*g+a.x)/++m;else{let i=r-1;if(!E(h)&&!E(d)){let e=Math.min(h,d),t=Math.max(h,d);e!==c&&e!==i&&f.push({...s[e],x:g}),t!==c&&t!==i&&f.push({...s[t],x:g})}0<r&&i!==c&&f.push(s[i]),f.push(a),l=e,m=0,u=p=o,h=d=c=r}}return f}(r,a,n,o);break;default:throw new Error(`Unsupported decimation algorithm '${_.algorithm}'`)}t._decimated=e}}}})}else na(l)},destroy(e){na(e)}};function la(i,s,r,e){if(!e){let e=s[i],t=r[i];return"angle"===i&&(e=b(e),t=b(t)),{property:i,start:e,end:t}}}function ha(e,t,i){for(;e<t;t--){let e=i[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function da(e,t,i,s){return e&&t?s(e[i],t[i]):e?e[i]:t?t[i]:0}function ca(t,e){let i=[],s=!1;return(i=T(t)?(s=!0,t):function(e){let{x:i=null,y:s=null}=t||{},r=e.points,a=[];return e.segments.forEach(({start:e,end:t})=>{t=ha(e,t,r);e=r[e],t=r[t];null!==s?(a.push({x:e.x,y:s}),a.push({x:t.x,y:s})):null!==i&&(a.push({x:i,y:e.y}),a.push({x:i,y:t.y}))}),a}(e)).length?new wr({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function ua(e){return e&&!1!==e.fill}function pa(t,i,s){var r=[];for(let e=0;e<s.length;e++){var{first:a,last:n,point:o}=function(e,t,r){let i=e.interpolate(t,r);if(!i)return{};let a=i[r],n=e.segments,o=e.points,l=!1,h=!1;for(let s=0;s<n.length;s++){let e=n[s],t=o[e.start][r],i=o[e.end][r];if(d(a,t,i)){l=a===t,h=a===i;break}}return{first:l,last:h,point:i}}(s[e],i,"x");if(!(!o||a&&n))if(a)r.unshift(o);else if(t.push(o),!n)break}t.push(...r)}class ga{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){var{x:s,y:r,radius:a}=this;return t=t||{start:0,end:y},e.arc(s,r,a,t.end,t.start,!0),!i.bounds}interpolate(e){var{x:t,y:i,radius:s}=this,e=e.angle;return{x:t+Math.cos(e)*s,y:i+Math.sin(e)*s,angle:e}}}function ma(o){var e,t,{chart:i,fill:s,line:r}=o;if(m(s))return e=s,(t=(i=i).getDatasetMeta(e))&&i.isDatasetVisible(e)?t.dataset:null;if("stack"!==s)return"shape"===s||((i=function(o){if((o.scale||{}).getPointPositionForValue){var l=o;let{scale:t,fill:e}=l,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=(l=e,h=t,"start"===l?r:"end"===l?h.options.reverse?h.min:h.max:A(l)?l.value:h.getBaseValue()),n=[];if(i.grid.circular){let e=t.getPointPositionForValue(0,r);return new ga({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<s;++e)n.push(t.getPointPositionForValue(e,a));return n}var e=o,{scale:l={},fill:e}=e,h=function(e,t){let i=null;return"start"===e?i=t.bottom:"end"===e?i=t.top:A(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}(e,l);if(m(h)){let e=l.isHorizontal();return{x:e?h:null,y:e?null:h}}return null}(o))instanceof ga?i:ca(i,r));{let{scale:e,index:t,line:i}=o,s=[],r=i.segments,a=i.points,n=function(e,t){var i=[],s=e.getMatchingVisibleMetas("line");for(let e=0;e<s.length;e++){var r=s[e];if(r.index===t)break;r.hidden||i.unshift(r.dataset)}return i}(e,t);n.push(ca({x:null,y:e.bottom},i));for(let e=0;e<r.length;e++){let t=r[e];for(let e=t.start;e<=t.end;e++)pa(s,a[e],n)}return new wr({points:s,options:{}})}}function fa(e,t,i){var s,r=ma(t),{line:t,scale:a,axis:n}=t,o=t.options,l=o.fill,o=o.backgroundColor,{above:l=o,below:o=o}=l||{};r&&t.points.length&&(Nt(e,i),s=e,{line:r,target:l,above:o,below:i,area:a,scale:n}=t={line:t,target:r,above:l,below:o,area:i,scale:a,axis:n},t=r._loop?"angle":t.axis,s.save(),"x"===t&&i!==o&&(va(s,l,a.top),ba(s,{line:r,target:l,color:o,scale:n,property:t}),s.restore(),s.save(),va(s,l,a.bottom)),ba(s,{line:r,target:l,color:i,scale:n,property:t}),s.restore(),Ht(e))}function va(r,a,n){let{segments:e,points:o}=a,l=!0,h=!1;r.beginPath();for(var d of e){let{start:e,end:t}=d,i=o[e],s=o[ha(e,t,o)];l?(r.moveTo(i.x,i.y),l=!1):(r.lineTo(i.x,n),r.lineTo(i.x,i.y)),(h=!!a.pathSegment(r,d,{move:h}))?r.closePath():r.lineTo(s.x,n)}r.lineTo(a.first().x,n),r.closePath(),r.clip()}function ba(o,e){let{line:l,target:h,property:d,color:c,scale:u}=e,t=function(e,t,r){let i=e.segments,a=e.points,n=t.points,o=[];for(let e of i){var{start:s,end:l}=e,l=ha(s,l,a),h=la(r,a[s],a[l],e.loop);if(t.segments){var d=Pi(t,h);for(let s of d){let t=la(r,n[s.start],n[s.end],s.loop),i=Li(e,a,t);for(let e of i)o.push({source:e,target:s,start:{[r]:da(h,t,"start",Math.max)},end:{[r]:da(h,t,"end",Math.min)}})}}else o.push({source:e,target:h,start:a[s],end:a[l]})}return o}(l,h,d);for(let{source:s,target:r,start:a,end:n}of t){let{style:{backgroundColor:e=c}={}}=s,t=!0!==h;o.save(),o.fillStyle=e,b=v=f=m=g=p=void 0;var p=o,g=u,m=t&&la(d,a,n),{top:g,bottom:f}=g.chart.chartArea,{property:m,start:v,end:b}=m||{},m=("x"===m&&(p.beginPath(),p.rect(v,g,b-v,f-g),p.clip()),o.beginPath(),!!l.pathSegment(o,s));let i;if(t){m?o.closePath():ya(o,h,n,d);let e=!!h.pathSegment(o,r,{move:m,reverse:!0});(i=m&&e)||ya(o,h,a,d)}o.closePath(),o.fill(i?"evenodd":"nonzero"),o.restore()}}function ya(e,t,i,s){t=t.interpolate(i,s);t&&e.lineTo(t.x,t.y)}var xa={id:"filler",afterDatasetsUpdate(e,t,i){var s,r,a,n,o,l,h=(e.data.datasets||[]).length,d=[];let c,u,p,g;for(u=0;u<h;++u)p=(c=e.getDatasetMeta(u)).dataset,g=null,p&&p.options&&p instanceof wr&&(g={visible:e.isDatasetVisible(u),index:u,fill:(s=p,r=u,a=h,l=o=n=void 0,A(l=function(){var e=s.options,t=e.fill;let i=L(t&&t.target,t);return!1!==(i=void 0===i?!!e.backgroundColor:i)&&null!==i&&(!0===i?"origin":i)}())?!isNaN(l.value)&&l:m(o=parseFloat(l))&&Math.floor(o)===o?(n=l[0],o=o,!((o="-"!==n&&"+"!==n?o:r+o)===r||o<0||a<=o)&&o):0<=["origin","start","end","stack","shape"].indexOf(l)&&l),chart:e,axis:c.controller.options.indexAxis,scale:c.vScale,line:p}),c.$filler=g,d.push(g);for(u=0;u<h;++u)(g=d[u])&&!1!==g.fill&&(g.fill=function(e,t,i){let s=e[t].fill;var r,a=[t];if(!i)return s;for(;!1!==s&&-1===a.indexOf(s);){if(!m(s))return s;if(!(r=e[s]))return!1;if(r.visible)return s;a.push(s),s=r.fill}return!1}(d,u,i.propagate))},beforeDraw(i,e,t){var s="beforeDraw"===t.drawTime,r=i.getSortedVisibleDatasetMetas(),a=i.chartArea;for(let t=r.length-1;0<=t;--t){let e=r[t].$filler;e&&(e.line.updateControlPoints(a,e.axis),s)&&e.fill&&fa(i.ctx,e,a)}},beforeDatasetsDraw(i,e,t){if("beforeDatasetsDraw"===t.drawTime){var s=i.getSortedVisibleDatasetMetas();for(let t=s.length-1;0<=t;--t){let e=s[t].$filler;ua(e)&&fa(i.ctx,e,i.chartArea)}}},beforeDatasetDraw(e,t,i){t=t.meta.$filler;ua(t)&&"beforeDatasetDraw"===i.drawTime&&fa(e.ctx,t,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let wa=(e,t)=>{let{boxHeight:i=t,boxWidth:s=t}=e;return e.usePointStyle&&(i=Math.min(i,t),s=e.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(t,i)}};class _a extends t{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,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(){let i=this.options.labels||{},e=c(i.generateLabels,[this.chart],this)||[];i.filter&&(e=e.filter(e=>i.filter(e,this.chart.data))),i.sort&&(e=e.sort((e,t)=>i.sort(e,t,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){var{options:i,ctx:s}=this;if(i.display){var r=i.labels,a=F(r.font),n=a.size,o=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=wa(r,n);let e,t;s.font=a.string,this.isHorizontal()?(e=this.maxWidth,t=this._fitRows(o,n,r,l)+10):(t=this.maxHeight,e=this._fitCols(o,a,r,l)+10),this.width=Math.min(e,i.maxWidth||this.maxWidth),this.height=Math.min(t,i.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(e,i,s,r){let{ctx:a,maxWidth:n,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],d=r+o,c=e,u=(a.textAlign="left",a.textBaseline="middle",-1),p=-d;return this.legendItems.forEach((e,t)=>{e=s+i/2+a.measureText(e.text).width;(0===t||h[h.length-1]+e+2*o>n)&&(c+=d,h[h.length-(0<t?0:1)]=0,p+=d,u++),l[t]={left:0,top:p,row:u,width:e,height:r},h[h.length-1]+=e+o}),c}_fitCols(e,o,l,h){let{ctx:d,maxHeight:t,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],p=this.columnSizes=[],g=t-e,m=c,f=0,v=0,b=0,y=0;return this.legendItems.forEach((e,t)=>{n=l,i=o,s=d,r=e,a=h;var i,s,r,a,{itemWidth:e,itemHeight:n}={itemWidth:function(e,t,i){let s=r.text;return s&&"string"!=typeof s&&(s=s.reduce((e,t)=>e.length>t.length?e:t)),e+t.size/2+i.measureText(s).width}(n,i,s),itemHeight:function(e){let t=a;return t="string"!=typeof r.text?Sa(r,e):t}(i.lineHeight)};0<t&&v+n+2*c>g&&(m+=f+c,p.push({width:f,height:v}),b+=f+c,y++,f=v=0),u[t]={left:b,top:v,col:y,width:e,height:n},f=Math.max(f,e),v+=n+c}),m+=f,p.push({width:f,height:v}),m}adjustHitBoxes(){if(this.options.display){var i=this._computeTitleHeight(),{legendHitBoxes:s,options:{align:r,labels:{padding:a},rtl:e}}=this,n=Ei(e,this.left,this.width);if(this.isHorizontal()){let e=0,t=R(r,this.left+a,this.right-this.lineWidths[e]);for(var o of s)e!==o.row&&(e=o.row,t=R(r,this.left+a,this.right-this.lineWidths[e])),o.top+=this.top+i+a,o.left=n.leftForLtr(n.x(t),o.width),t+=o.width+a}else{let e=0,t=R(r,this.top+i+a,this.bottom-this.columnSizes[e].height);for(var l of s)l.col!==e&&(e=l.col,t=R(r,this.top+i+a,this.bottom-this.columnSizes[e].height)),l.top=t,l.left+=this.left+a,l.left=n.leftForLtr(n.x(l.left),l.width),t+=l.height+a}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var e;this.options.display&&(Nt(e=this.ctx,this),this._draw(),Ht(e))}_draw(){let{options:h,columnSizes:d,lineWidths:c,ctx:u}=this,{align:p,labels:g}=h,m=O.color,f=Ei(h.rtl,this.left,this.width),v=F(g.font),b=g.padding,y=v.size,x=y/2,w,{boxWidth:_,boxHeight:S,itemHeight:k}=(this.drawTitle(),u.textAlign=f.textAlign("left"),u.textBaseline="middle",u.lineWidth=.5,u.font=v.string,wa(g,y)),M=this.isHorizontal(),E=this._computeTitleHeight(),D=(w=M?{x:R(p,this.left+b,this.right-c[0]),y:this.top+b+E,line:0}:{x:this.left+b,y:R(p,this.top+E+b,this.bottom-d[0].height),line:0},Di(this.ctx,h.textDirection),k+b);this.legendItems.forEach((t,s)=>{u.strokeStyle=t.fontColor,u.fillStyle=t.fontColor;var e=u.measureText(t.text).width,i=f.textAlign(t.textAlign||(t.textAlign=g.textAlign)),e=_+x+e;let r=w.x,a=w.y;f.setWidth(this.width),M?0<s&&r+e+b>this.right&&(a=w.y+=D,w.line++,r=w.x=R(p,this.left+b,this.right-c[w.line])):0<s&&a+D>this.bottom&&(r=w.x=r+d[w.line].width+b,w.line++,a=w.y=R(p,this.top+E+b,this.bottom-d[w.line].height));var s=f.x(r),n=a,o=t;if(!(isNaN(_)||_<=0||isNaN(S)||S<0)){u.save();var l=L(o.lineWidth,1);if(u.fillStyle=L(o.fillStyle,m),u.lineCap=L(o.lineCap,"butt"),u.lineDashOffset=L(o.lineDashOffset,0),u.lineJoin=L(o.lineJoin,"miter"),u.lineWidth=l,u.strokeStyle=L(o.strokeStyle,m),u.setLineDash(L(o.lineDash,[])),g.usePointStyle){let e={radius:S*Math.SQRT2/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:l},t=f.xPlus(s,_/2);Ft(u,e,t,n+x,g.pointStyleWidth&&_)}else{let e=n+Math.max((y-S)/2,0),t=f.leftForLtr(s,_),i=_i(o.borderRadius);u.beginPath(),Object.values(i).some(e=>0!==e)?jt(u,{x:t,y:e,w:_,h:S,radius:i}):u.rect(t,e,_,S),u.fill(),0!==l&&u.stroke()}u.restore()}if(r=De(i,r+_+x,M?r+e:this.right,h.rtl),n=f.x(r),s=a,o=t,zt(u,o.text,n,s+k/2,v,{strikethrough:o.hidden,textAlign:f.textAlign(o.textAlign)}),M)w.x+=e+b;else if("string"!=typeof t.text){let e=v.lineHeight;w.y+=Sa(t,e)}else w.y+=D}),Ci(this.ctx,h.textDirection)}drawTitle(){let s=this.options,r=s.title,a=F(r.font),n=I(r.padding);if(r.display){var o=Ei(s.rtl,this.left,this.width),l=this.ctx,h=r.position,d=a.size/2,d=n.top+d;let t,e=this.left,i=this.width;if(this.isHorizontal())i=Math.max(...this.lineWidths),t=this.top+d,e=R(s.align,e,this.right-i);else{let e=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);t=d+R(s.align,this.top,this.bottom-e-s.labels.padding-this._computeTitleHeight())}d=R(h,e,e+i);l.textAlign=o.textAlign(Ee(h)),l.textBaseline="middle",l.strokeStyle=r.color,l.fillStyle=r.color,l.font=a.string,zt(l,r.text,d,t,a)}}_computeTitleHeight(){var e=this.options.title,t=F(e.font),i=I(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,r;if(d(e,this.left,this.right)&&d(t,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(d(e,(s=r[i]).left,s.left+s.width)&&d(t,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(e){var t,i,s,r=this.options;("mousemove"!==(t=e.type)&&"mouseout"!==t||!r.onHover&&!r.onLeave)&&(!r.onClick||"click"!==t&&"mouseup"!==t)||(t=this._getLegendItemAt(e.x,e.y),"mousemove"===e.type||"mouseout"===e.type?(s=null!==(i=this._hoveredItem)&&null!==t&&i.datasetIndex===t.datasetIndex&&i.index===t.index,i&&!s&&c(r.onLeave,[e,i,this],this),(this._hoveredItem=t)&&!s&&c(r.onHover,[e,t,this],this)):t&&c(r.onClick,[e,t,this],this))}}function Sa(e,t){return t*(e.text?e.text.length+.5:0)}var ka={id:"legend",_element:_a,start(e,t,i){var s=e.legend=new _a({ctx:e.ctx,options:i,chart:e});r.configure(e,s,i),r.addBox(e,s)},stop(e){r.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){var s=e.legend;r.configure(e,s,i),s.options=i},afterUpdate(e){e=e.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){var s=t.datasetIndex,i=i.chart;i.isDatasetVisible(s)?(i.hide(s),t.hidden=!0):(i.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let s=e.data.datasets,{usePointStyle:r,pointStyle:a,textAlign:n,color:o,useBorderRadius:l,borderRadius:h}=e.legend.options.labels;return e._getSortedDatasetMetas().map(e=>{var t=e.controller.getStyle(r?0:void 0),i=I(t.borderWidth);return{text:s[e.index].label,fillStyle:t.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:t.borderCapStyle,lineDash:t.borderDash,lineDashOffset:t.borderDashOffset,lineJoin:t.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:t.borderColor,pointStyle:a||t.pointStyle,rotation:t.rotation,textAlign:n||t.textAlign,borderRadius:l&&(h||t.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Ma extends t{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){var i=this.options;this.left=0,this.top=0,i.display?(this.width=this.right=e,this.height=this.bottom=t,e=T(i.text)?i.text.length:1,this._padding=I(i.padding),t=e*F(i.font).lineHeight+this._padding.height,this.isHorizontal()?this.height=t:this.width=t):this.width=this.height=this.right=this.bottom=0}isHorizontal(){var e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){var{top:t,left:i,bottom:s,right:r,options:a}=this,n=a.align;let o,l,h,d=0;return o=this.isHorizontal()?(l=R(n,i,r),h=t+e,r-i):(d="left"===a.position?(l=i+e,h=R(n,s,t),-.5*M):(l=r-e,h=R(n,t,s),.5*M),s-t),{titleX:l,titleY:h,maxWidth:o,rotation:d}}draw(){var e,t,i,s,r,a=this.ctx,n=this.options;n.display&&(t=(e=F(n.font)).lineHeight/2+this._padding.top,{titleX:t,titleY:i,maxWidth:s,rotation:r}=this._drawArgs(t),zt(a,n.text,0,0,e,{color:n.color,maxWidth:s,rotation:r,textAlign:Ee(n.align),textBaseline:"middle",translation:[t,i]}))}}var Ea={id:"title",_element:Ma,start(e,t,i){var s;e=e,i=i,s=new Ma({ctx:e.ctx,options:i,chart:e}),r.configure(e,s,i),r.addBox(e,s),e.titleBlock=s},stop(e){var t=e.titleBlock;r.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){var s=e.titleBlock;r.configure(e,s,i),s.options=i},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}};let Da=new WeakMap;var Ca={id:"subtitle",start(e,t,i){var s=new Ma({ctx:e.ctx,options:i,chart:e});r.configure(e,s,i),r.addBox(e,s),Da.set(e,s)},stop(e){r.removeBox(e,Da.get(e)),Da.delete(e)},beforeUpdate(e,t,i){var s=Da.get(e);r.configure(e,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let Ta={average(e){if(!e.length)return!1;let i,t,s=0,r=0,a=0;for(i=0,t=e.length;i<t;++i){let t=e[i].element;if(t&&t.hasValue()){let e=t.tooltipPosition();s+=e.x,r+=e.y,++a}}return{x:s/a,y:r/a}},nearest(e,i){if(!e.length)return!1;let s,t,r,a=i.x,n=i.y,o=Number.POSITIVE_INFINITY;for(s=0,t=e.length;s<t;++s){let t=e[s].element;if(t&&t.hasValue()){let e=ue(i,t.getCenterPoint());e<o&&(o=e,r=t)}}if(r){let e=r.tooltipPosition();a=e.x,n=e.y}return{x:a,y:n}}};function _(e,t){return t&&(T(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Aa(e){return("string"==typeof e||e instanceof String)&&-1<e.indexOf("\n")?e.split("\n"):e}function La(e,t){function i(e){v=Math.max(v,s.measureText(e).width+y)}let s=e.chart.ctx,{body:r,footer:a,title:n}=e,{boxWidth:o,boxHeight:l}=t,h=F(t.bodyFont),d=F(t.titleFont),c=F(t.footerFont),u=n.length,p=a.length,g=r.length,m=I(t.padding),f=m.height,v=0,b=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0),y=(b+=e.beforeBody.length+e.afterBody.length,u&&(f+=u*d.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b&&(f+=g*(t.displayColors?Math.max(l,h.lineHeight):h.lineHeight)+(b-g)*h.lineHeight+(b-1)*t.bodySpacing),p&&(f+=t.footerMarginTop+p*c.lineHeight+(p-1)*t.footerSpacing),0);return s.save(),s.font=d.string,S(e.title,i),s.font=h.string,S(e.beforeBody.concat(e.afterBody),i),y=t.displayColors?o+2+t.boxPadding:0,S(r,e=>{S(e.before,i),S(e.lines,i),S(e.after,i)}),y=0,s.font=c.string,S(e.footer,i),s.restore(),{width:v+=m.width,height:f}}function Pa(i,e,s){var t=s.yAlign||e.yAlign||function(){var{y:e,height:t}=s;return e<t/2?"top":e>i.height-t/2?"bottom":"center"}();return{xAlign:s.xAlign||e.xAlign||function(r,a,n,e){var{x:t,width:i}=n,{width:s,chartArea:{left:o,right:l}}=r;let h="center";return"center"===e?h=t<=(o+l)/2?"left":"right":t<=i/2?h="left":s-i/2<=t&&(h="right"),h=function(e){var{x:t,width:i}=n,s=a.caretSize+a.caretPadding;return"left"===e&&t+i+s>r.width||"right"===e&&t-i-s<0}(h)?"center":h}(i,e,s,t),yAlign:t}}function Ra(e,i,t,s){var{caretSize:e,caretPadding:r,cornerRadius:a}=e,{xAlign:n,yAlign:o}=t,l=e+r,{topLeft:t,topRight:r,bottomLeft:a,bottomRight:h}=_i(a);let d=function(){let{x:e,width:t}=i;return"right"===n?e-=t:"center"===n&&(e-=t/2),e}();var c=function(){let{y:e,height:t}=i;return"top"===o?e+=l:e-="bottom"===o?t+l:t/2,e}();return"center"===o?"left"===n?d+=l:"right"===n&&(d-=l):"left"===n?d-=Math.max(t,a)+e:"right"===n&&(d+=Math.max(r,h)+e),{x:C(d,0,s.width-i.width),y:C(c,0,s.height-i.height)}}function Oa(e,t,i){i=I(i.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-i.right:e.x+i.left}function Ia(e){return _([],Aa(e))}function Fa(e,t){t=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return t?e.override(t):e}let Ba={beforeTitle:e,title(e){if(0<e.length){var e=e[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(0<i&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:e,beforeBody:e,beforeLabel:e,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");e=e.formattedValue;return E(e)||(t+=e),t},labelColor(e){e=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){e=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:e,afterBody:e,beforeFooter:e,footer:e,afterFooter:e};function k(e,t,i,s){e=e[t].call(i,s);return void 0===e?Ba[t].call(i,s):e}class Na extends t{static positioners=Ta;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){var e,t=this._cachedAnimations;return t||(t=this.chart,t=(e=this.options.setContext(this.getContext())).enabled&&t.options.animation&&e.animations,e=new vs(this.chart,t),t._cacheable&&(this._cachedAnimations=Object.freeze(e)),e)}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),Mi(e,{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})));var e}getTitle(e,t){var t=t.callbacks,i=k(t,"beforeTitle",this,e),s=k(t,"title",this,e),t=k(t,"afterTitle",this,e),e=_([],Aa(i));return e=_(e,Aa(s)),_(e,Aa(t))}getBeforeBody(e,t){return Ia(k(t.callbacks,"beforeBody",this,e))}getBody(e,t){let s=t.callbacks,r=[];return S(e,e=>{var t={before:[],lines:[],after:[]},i=Fa(s,e);_(t.before,Aa(k(i,"beforeLabel",this,e))),_(t.lines,k(i,"label",this,e)),_(t.after,Aa(k(i,"afterLabel",this,e))),r.push(t)}),r}getAfterBody(e,t){return Ia(k(t.callbacks,"afterBody",this,e))}getFooter(e,t){var t=t.callbacks,i=k(t,"beforeFooter",this,e),s=k(t,"footer",this,e),t=k(t,"afterFooter",this,e),e=_([],Aa(i));return e=_(e,Aa(s)),_(e,Aa(t))}_createItems(s){let e=this._active,r=this.chart.data,i=[],a=[],n=[],t,o,l=[];for(t=0,o=e.length;t<o;++t)l.push(function(e,t){var{element:t,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:a,value:n}=r.getLabelAndValue(s);return{chart:e,label:a,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:n,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:t}}(this.chart,e[t]));return s.filter&&(l=l.filter((e,t,i)=>s.filter(e,t,i,r))),S(l=s.itemSort?l.sort((e,t)=>s.itemSort(e,t,r)):l,e=>{var t=Fa(s.callbacks,e);i.push(k(t,"labelColor",this,e)),a.push(k(t,"labelPointStyle",this,e)),n.push(k(t,"labelTextColor",this,e))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=n,this.dataPoints=l}update(e,t){var a=this.options.setContext(this.getContext()),n=this._active;let o,l=[];if(n.length){let e=Ta[a.position].call(this,n,this._eventPosition),t=(l=this._createItems(a),this.title=this.getTitle(l,a),this.beforeBody=this.getBeforeBody(l,a),this.body=this.getBody(l,a),this.afterBody=this.getAfterBody(l,a),this.footer=this.getFooter(l,a),this._size=La(this,a)),i=Object.assign({},e,t),s=Pa(this.chart,a,i),r=Ra(a,i,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:r.x,y:r.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=l,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){e=this.getCaretPosition(e,i,s);t.lineTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineTo(e.x3,e.y3)}getCaretPosition(e,t,i){var{xAlign:s,yAlign:r}=this,{caretSize:i,cornerRadius:a}=i,{topLeft:a,topRight:n,bottomLeft:o,bottomRight:l}=_i(a),{x:e,y:h}=e,{width:t,height:d}=t;let c,u,p,g,m,f;return"center"===r?(m=h+d/2,f="left"===s?(c=e,u=c-i,g=m+i,m-i):(c=e+t,u=c+i,g=m-i,m+i),p=c):(u="left"===s?e+Math.max(a,o)+i:"right"===s?e+t-Math.max(n,l)-i:this.caretX,p="top"===r?(g=h,m=g-i,c=u-i,u+i):(g=h+d,m=g+i,c=u+i,u-i),f=g),{x1:c,x2:u,x3:p,y1:g,y2:m,y3:f}}drawTitle(e,t,i){var s=this.title,r=s.length;let a,n,o;if(r){var l=Ei(i.rtl,this.x,this.width);for(e.x=Oa(this,i.titleAlign,i),t.textAlign=l.textAlign(i.titleAlign),t.textBaseline="middle",a=F(i.titleFont),n=i.titleSpacing,t.fillStyle=i.titleColor,t.font=a.string,o=0;o<r;++o)t.fillText(s[o],l.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n,o+1===r&&(e.y+=i.titleMarginBottom-n)}}_drawColorBox(s,e,t,r,a){let n=this.labelColors[t],o=this.labelPointStyles[t],{boxHeight:l,boxWidth:h,boxPadding:d}=a,i=F(a.bodyFont),c=Oa(this,"left",a),u=r.x(c),p=l<i.lineHeight?(i.lineHeight-l)/2:0,g=e.y+p;if(a.usePointStyle){let e={radius:Math.min(h,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},t=r.leftForLtr(u,h)+h/2,i=g+l/2;s.strokeStyle=a.multiKeyBackground,s.fillStyle=a.multiKeyBackground,It(s,e,t,i),s.strokeStyle=n.borderColor,s.fillStyle=n.backgroundColor,It(s,e,t,i)}else{s.lineWidth=A(n.borderWidth)?Math.max(...Object.values(n.borderWidth)):n.borderWidth||1,s.strokeStyle=n.borderColor,s.setLineDash(n.borderDash||[]),s.lineDashOffset=n.borderDashOffset||0;let e=r.leftForLtr(u,h-d),t=r.leftForLtr(r.xPlus(u,1),h-d-2),i=_i(n.borderRadius);Object.values(i).some(e=>0!==e)?(s.beginPath(),s.fillStyle=a.multiKeyBackground,jt(s,{x:e,y:g,w:h,h:l,radius:i}),s.fill(),s.stroke(),s.fillStyle=n.backgroundColor,s.beginPath(),jt(s,{x:t,y:g+1,w:h-2,h:l-2,radius:i}),s.fill()):(s.fillStyle=a.multiKeyBackground,s.fillRect(e,g,h,l),s.strokeRect(e,g,h,l),s.fillStyle=n.backgroundColor,s.fillRect(t,g+1,h-2,l-2))}s.fillStyle=this.labelTextColors[t]}drawBody(t,i,e){function s(e){i.fillText(e,g.x(t.x+p),t.y+u/2),t.y+=u+a}let r=this.body,{bodySpacing:a,bodyAlign:n,displayColors:o,boxHeight:l,boxWidth:h,boxPadding:d}=e,c=F(e.bodyFont),u=c.lineHeight,p=0,g=Ei(e.rtl,this.x,this.width),m=g.textAlign(n),f,v,b,y,x,w,_;for(i.textAlign=n,i.textBaseline="middle",i.font=c.string,t.x=Oa(this,m,e),i.fillStyle=e.bodyColor,S(this.beforeBody,s),p=o&&"right"!==m?"center"===n?h/2+d:h+2+d:0,y=0,w=r.length;y<w;++y){for(f=r[y],v=this.labelTextColors[y],i.fillStyle=v,S(f.before,s),b=f.lines,o&&b.length&&(this._drawColorBox(i,t,y,g,e),u=Math.max(c.lineHeight,l)),x=0,_=b.length;x<_;++x)s(b[x]),u=c.lineHeight;S(f.after,s)}p=0,u=c.lineHeight,S(this.afterBody,s),t.y-=a}drawFooter(e,t,i){var s=this.footer,r=s.length;let a,n;if(r){var o=Ei(i.rtl,this.x,this.width);for(e.x=Oa(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=o.textAlign(i.footerAlign),t.textBaseline="middle",a=F(i.footerFont),t.fillStyle=i.footerColor,t.font=a.string,n=0;n<r;++n)t.fillText(s[n],o.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){var{xAlign:r,yAlign:a}=this,{x:n,y:o}=e,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:p}=_i(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(n+d,o),"top"===a&&this.drawCaret(e,t,i,s),t.lineTo(n+l-c,o),t.quadraticCurveTo(n+l,o,n+l,o+c),"center"===a&&"right"===r&&this.drawCaret(e,t,i,s),t.lineTo(n+l,o+h-p),t.quadraticCurveTo(n+l,o+h,n+l-p,o+h),"bottom"===a&&this.drawCaret(e,t,i,s),t.lineTo(n+u,o+h),t.quadraticCurveTo(n,o+h,n,o+h-u),"center"===a&&"left"===r&&this.drawCaret(e,t,i,s),t.lineTo(n,o+d),t.quadraticCurveTo(n,o,n+d,o),t.closePath(),t.fill(),0<s.borderWidth&&t.stroke()}_updateAnimationTarget(t){let i=this.chart,e=this.$animations,s=e&&e.x,r=e&&e.y;if(s||r){let e=Ta[t.position].call(this,this._active,this._eventPosition);var a,n;e&&(a=this._size=La(this,t),n=Ra(t,n=Object.assign({},e,this._size),t=Pa(i,t,n),i),s._to===n.x&&r._to===n.y||(this.xAlign=t.xAlign,this.yAlign=t.yAlign,this.width=a.width,this.height=a.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,n)))}}_willRender(){return!!this.opacity}draw(e){var t,i,s,r,a=this.options.setContext(this.getContext()),n=this.opacity;n&&(this._updateAnimationTarget(a),t={width:this.width,height:this.height},i={x:this.x,y:this.y},n=Math.abs(n)<.001?0:n,s=I(a.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length,a.enabled)&&r&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,t,a),Di(e,a.textDirection),i.y+=s.top,this.drawTitle(i,e,a),this.drawBody(i,e,a),this.drawFooter(i,e,a),Ci(e,a.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){var i=this._active,e=e.map(({datasetIndex:e,index:t})=>{var i=this.chart.getDatasetMeta(e);if(i)return{datasetIndex:e,element:i.data[t],index:t};throw new Error("Cannot find a dataset at index "+e)}),i=!V(i,e),s=this._positionChanged(e,t);(i||s)&&(this._active=e,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var s=this.options,r=this._active||[],i=this._getActiveElements(e,r,t,i),a=this._positionChanged(i,e),r=t||!V(i,r)||a;return r&&(this._active=i,s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t)),r}_getActiveElements(e,t,i,s){var r=this.options;return"mouseout"===e.type?[]:s?(s=this.chart.getElementsAtEventForMode(e,r.mode,r,i),r.reverse&&s.reverse(),s):t}_positionChanged(e,t){var{caretX:i,caretY:s,options:r}=this,r=Ta[r.position].call(this,e,t);return!1!==r&&(i!==r.x||s!==r.y)}}var Ha={id:"tooltip",_element:Na,positioners:Ta,afterInit(e,t,i){i&&(e.tooltip=new Na({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){var t,i=e.tooltip;i&&i._willRender()&&!(t={tooltip:i})!==e.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})&&(i.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",t))},afterEvent(e,t){var i;e.tooltip&&(i=t.replay,e.tooltip.handleEvent(t.event,i,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:Ba},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return i.register(Ct,Jr,Cr,s),i.helpers={...Fi},i._adapters=rr,i.Animation=fs,i.Animations=vs,i.animator=a,i.controllers=w.controllers.items,i.DatasetController=Cs,i.Element=t,i.elements=Cr,i.Interaction=$i,i.layouts=r,i.platforms=ps,i.Scale=Os,i.Ticks=ut,Object.assign(i,Ct,Jr,Cr,s,ps),i.Chart=i,"undefined"!=typeof window&&(window.Chart=i),i}),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AirDatepicker=t():e.AirDatepicker=t()}(this,function(){{var s={d:function(e,t){for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={},g=(s.d(t,{default:function(){return V}}),{days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"}),i={classes:"",inline:!1,locale:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вос","Пон","Вто","Сре","Чет","Пят","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:g.days,minView:g.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function c(e,t){t=1<arguments.length&&void 0!==t?t:document;return"string"==typeof e?t.querySelector(e):e}function r(e){var{tagName:e="div",className:t="",innerHtml:i="",id:s="",attrs:r={}}=0<arguments.length&&void 0!==e?e:{},e=document.createElement(e);return t&&e.classList.add(...t.split(" ")),s&&(e.id=s),i&&(e.innerHTML=i),r&&n(e,r),e}function n(e,t){for(var[i,s]of Object.entries(t))void 0!==s&&e.setAttribute(i,s);return e}function m(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function f(e){var t=e.getHours(),{hours:i,dayPeriod:s}=o(t);return{year:e.getFullYear(),month:e.getMonth(),fullMonth:e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,date:e.getDate(),fullDate:e.getDate()<10?"0"+e.getDate():e.getDate(),day:e.getDay(),hours:t,fullHours:u(t),hours12:i,dayPeriod:s,fullHours12:u(i),minutes:e.getMinutes(),fullMinutes:e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}}function o(e){return{dayPeriod:11<e?"pm":"am",hours:e%12==0?12:e%12}}function u(e){return e<10?"0"+e:e}function p(e){e=10*Math.floor(e.getFullYear()/10);return[e,9+e]}function v(){let i=[];for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.forEach(e=>{if("object"==typeof e)for(var t in e)e[t]&&i.push(t);else e&&i.push(e)}),i.join(" ")}function b(e,t,i){i=2<arguments.length&&void 0!==i?i:g.days;return!(!e||!t)&&(e=f(e),t=f(t),{[g.days]:e.date===t.date&&e.month===t.month&&e.year===t.year,[g.months]:e.month===t.month&&e.year===t.year,[g.years]:e.year===t.year}[i])}function y(e,t,i){e=w(e,!1).getTime(),t=w(t,!1).getTime();return i?t<=e:t<e}function x(e,t){return!y(e,t,!0)}function w(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],e=new Date(e.getTime());return"boolean"!=typeof t||t||e.setHours(0,0,0,0),e}function _(e,t,i){e.length?e.forEach(e=>{e.addEventListener(t,i)}):e.addEventListener(t,i)}function S(e,t){return!(!e||e===document||e instanceof DocumentFragment)&&(e.matches(t)?e:S(e.parentNode,t))}function k(e,t,i){return i<e?i:e<t?t:e}function M(n){for(var e=arguments.length,t=new Array(1<e?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return t.filter(e=>e).forEach(e=>{for(var[t,i]of Object.entries(e)){var s,r,a;void 0!==i&&"[object Object]"===i.toString()?(s=void 0!==n[t]?n[t].toString():void 0,r=i.toString(),a=Array.isArray(i)?[]:{},n[t]=!n[t]||s!==r?a:n[t],M(n[t],i)):n[t]=i}}),n}function E(e){let t=e;return e instanceof Date||("string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&(e+="T00:00:00"),t=new Date(e)),isNaN(t.getTime())&&(console.log(`Unable to convert value "${e}" to Date object`),t=!1),t}function D(e){var t="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+t+")("+e+")($|<|"+t+")","g")}function C(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}class F{constructor(){var{type:e,date:t,dp:i,opts:s,body:r}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};C(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),C(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),C(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),C(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),C(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),C(this,"onChangeFocusDate",e=>{e?((e=b(e,this.date,this.type))?this.focus():!e&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()):this.focused&&this.removeFocus()}),C(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=e,this.singleType=this.type.slice(0,-1),this.date=t,this.dp=i,this.opts=s,this.body=r,this.customData=!1,this.init()}init(){var e=this.opts.onRenderCell;e&&(this.customData=e({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),null!=(e=this.customData)&&e.disabled&&this.dp.disableDate(this.date)}_bindDatepickerEvents(){this.dp.on(g.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(g.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(g.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(g.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var{year:e,month:t,date:i}=f(this.date),s=(null==(s=this.customData)?void 0:s.attrs)||{};this.$cell=r({attrs:{"data-year":e,"data-month":t,"data-date":i,...s}}),this.$cell.adpCell=this}_getClassName(){let e,t=new Date,{selectOtherMonths:i,selectOtherYears:s}=this.opts,{minDate:r,maxDate:a,isDateDisabled:n}=this.dp,o=f(this.date).day,l=this._isOutOfMinMaxRange(),h=n(this.date),d=v("air-datepicker-cell",`-${this.singleType}-`,{"-current-":b(t,this.date,this.type),"-min-date-":r&&b(r,this.date,this.type),"-max-date-":a&&b(a,this.date,this.type)}),c="";switch(this.type){case g.days:c=v({"-weekend-":this.dp.isWeekend(o),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!i||l||h});break;case g.months:c=v({"-disabled-":l});break;case g.years:c=v({"-other-decade-":this.isOtherDecade,"-disabled-":l||this.isOtherDecade&&!s})}return v(d,c,null==(e=this.customData)?void 0:e.classes).split(" ")}_getHtml(){var e,{year:t,month:i,date:s}=f(this.date),{showOtherMonths:r,showOtherYears:a}=this.opts;if(null!=(e=this.customData)&&e.html)return this.customData.html;switch(this.type){case g.days:return!r&&this.isOtherMonth?"":s;case g.months:return this.dp.locale[this.opts.monthsField][i];case g.years:return!a&&this.isOtherDecade?"":t}}_isOutOfMinMaxRange(){var{minDate:e,maxDate:t}=this.dp,{type:i,date:s}=this,{month:s,year:r,date:a}=f(s),n=i===g.days,i=i===g.years,o=!!e&&new Date(r,i?e.getMonth():s,n?a:e.getDate()),r=!!t&&new Date(r,i?t.getMonth():s,n?a:t.getDate());return e&&t?x(o,e)||y(r,t):e?x(o,e):t?y(r,t):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){let{selectedDates:s,focusDate:r,rangeDateTo:e,rangeDateFrom:a}=this.dp,n=s.length;if(n){let t=a,i=e;if(1===n&&r){let e=y(r,s[0]);t=e?s[0]:r,i=e?r:s[0]}var o,l,h=v({"-in-range-":t&&i&&(o=this.date,h=t,l=i,y(o,h))&&x(o,l),"-range-from-":t&&b(this.date,t,this.type),"-range-to-":i&&b(this.date,i,this.type)});this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),h&&this.$cell.classList.add(...h.split(" "))}}_handleSelectedStatus(){var e=this.dp._checkIfDateIsSelected(this.date,this.type);e?this.select():!e&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){b(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range)&&this._handleRangeStatus(),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function T(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}let e={[g.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${g.days}-"></div>`,[g.months]:`<div class="air-datepicker-body--cells -${g.months}-"></div>`,[g.years]:`<div class="air-datepicker-body--cells -${g.years}-"></div>`},a=".air-datepicker-cell";class B{constructor(e){var{dp:e,type:t,opts:i}=e;T(this,"handleClick",e=>{var t,e=e.target.closest(a).adpCell;e.isDisabled||(this.dp.isMinViewReached?(t=this.dp._checkIfDateIsSelected(e.date,e.type))?this.dp._handleAlreadySelectedDates(t,e.date):this.dp.selectDate(e.date):this.dp.down())}),T(this,"handleDayNameClick",e=>{e=e.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(e),datepicker:this.dp})}),T(this,"onChangeCurrentView",e=>{e!==this.type?this.hide():(this.show(),this.render())}),T(this,"onMouseOverCell",e=>{e=S(e.target,a);this.dp.setFocusDate(!!e&&e.adpCell.date)}),T(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),T(this,"onClickBody",e=>{var t=this.opts.onClickDayName,i=e.target;i.closest(a)&&this.handleClick(e),t&&i.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(e)}),T(this,"onMouseDown",e=>{this.pressed=!0;e=S(e.target,a),e=e&&e.adpCell;b(e.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),b(e.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),T(this,"onMouseMove",e=>{var t,i,s,r;this.pressed&&this.dp.isMinViewReached&&(e.preventDefault(),e=(e=S(e.target,a))&&e.adpCell,{selectedDates:s,rangeDateTo:t,rangeDateFrom:i}=this.dp,e)&&!e.isDisabled&&(e=e.date,2===s.length)&&(this.rangeFromFocused&&!y(e,t)&&({hours:s,minutes:r}=f(i),e.setHours(s),e.setMinutes(r),this.dp.rangeDateFrom=e,this.dp.replaceDate(i,e)),this.rangeToFocused)&&!x(e,i)&&({hours:s,minutes:r}=f(t),e.setHours(s),e.setMinutes(r),this.dp.rangeDateTo=e,this.dp.replaceDate(t,e))}),T(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),T(this,"onChangeViewDate",(e,t)=>{if(this.isVisible){var i=p(e),s=p(t);switch(this.dp.currentView){case g.days:if(b(e,t,g.months))return;break;case g.months:if(b(e,t,g.years))return;break;case g.years:if(i[0]===s[0]&&i[1]===s[1])return}this.render()}}),T(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(e=>{this.$cells.appendChild(e.render())})}),this.dp=e,this.type=t,this.opts=i,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===g.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){var{range:e,dynamicRange:t}=this.opts;_(this.$el,"mouseover",this.onMouseOverCell),_(this.$el,"mouseout",this.onMouseOutCell),_(this.$el,"click",this.onClickBody),e&&t&&(_(this.$el,"mousedown",this.onMouseDown),_(this.$el,"mousemove",this.onMouseMove),_(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(g.eventChangeViewDate,this.onChangeViewDate),this.dp.on(g.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=r({className:`air-datepicker-body -${this.type}-`,innerHtml:e[this.type]}),this.$names=c(".air-datepicker-body--day-names",this.$el),this.$cells=c(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.dp.locale.firstDay,t="",i=this.dp.isWeekend,s=this.opts.onClickDayName,r=e,a=0;for(;a<7;){var n=r%7;t+=`<div class="${v("air-datepicker-body--day-name",{[g.cssClassWeekend]:i(n),"-clickable-":!!s})}" data-day-index='${n}'>${this.dp.locale.daysMin[n]}</div>`,a++,r++}return t}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(e){var{type:t,dp:i,opts:s}=this;return new F({type:t,dp:i,opts:s,date:e,body:this})}_generateCells(){B.getDatesFunction(this.type)(this.dp,e=>{this.cells.push(this._generateCell(e))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(e=>e.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(g.eventChangeViewDate,this.onChangeViewDate),this.dp.off(g.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(e,t){var{viewDate:e,opts:{fixedHeight:i},locale:{firstDay:s}}=e,r=m(e),{year:e,month:a}=f(e),n=new Date(e,a,1),e=new Date(e,a,r),a=n.getDay()-s,e=6<(e=6-e.getDay()+s)?e-7:e;let o=function(e){var{year:t,month:i,date:s}=f(n);return new Date(t,i,s-e)}(a=a<0?7+a:a),l=r+a+e,h=o.getDate(),{year:d,month:c}=f(o),u=0;i&&(l=42);for(var p=[];u<l;){var g=new Date(d,c,h+u);t&&t(g),p.push(g),u++}return p}static getMonthsDates(e,t){let i=e.parsedViewDate.year,s=0,r=[];for(;s<12;){let e=new Date(i,s);r.push(e),t&&t(e),s++}return r}static getYearsDates(e,t){let i=p(e.viewDate),s=i[0]-1,r=i[1]+1,a=s,n=[];for(;a<=r;){let e=new Date(a,0);n.push(e),t&&t(e),a++}return n}static getDatesFunction(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:g.days;return{[g.days]:B.getDaysDates,[g.months]:B.getMonthsDates,[g.years]:B.getYearsDates}[e]}}function A(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}class N{constructor(e){var{dp:e,opts:t}=e;A(this,"onClickNav",e=>{var e=S(e.target,".air-datepicker-nav--action");e&&(e=e.dataset.action,this.dp[e]())}),A(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),A(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),A(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),A(this,"update",()=>{var{prevHtml:e,nextHtml:t}=this.opts;this.$prev.innerHTML=e,this.$next.innerHTML=t,this._resetNavStatus(),this.render(),this.handleNavStatus()}),A(this,"renderDelay",()=>{setTimeout(this.render)}),A(this,"render",()=>{this.$title.innerHTML=this._getTitle();var e,t=this.$title,i={"-disabled-":this.dp.isFinalView};for(e in i)i[e]?t.classList.add(e):t.classList.remove(e)}),this.dp=e,this.opts=t,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=c(".air-datepicker-nav--title",this.$el),this.$prev=c('[data-action="prev"]',this.$el),this.$next=c('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(g.eventChangeViewDate,this.onChangeViewDate),this.dp.on(g.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(g.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker)&&this.dp.on(g.eventChangeTime,this.render)}destroy(){this.dp.off(g.eventChangeViewDate,this.onChangeViewDate),this.dp.off(g.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(g.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker)&&this.dp.off(g.eventChangeTime,this.render)}_createElement(){this.$el=r({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){var{dp:e,opts:t}=this,t=t.navTitles[e.currentView];return"function"==typeof t?t(e):e.formatDate(e.viewDate,t)}handleNavStatus(){var e=this.opts.disableNavWhenOutOfRange,{minDate:t,maxDate:i}=this.dp;if((t||i)&&e){var{year:s,month:r}=this.dp.parsedViewDate,a=!!t&&f(t),n=!!i&&f(i);switch(this.dp.currentView){case g.days:t&&a.month>=r&&a.year>=s&&this._disableNav("prev"),i&&n.month<=r&&n.year<=s&&this._disableNav("next");break;case g.months:t&&a.year>=s&&this._disableNav("prev"),i&&n.year<=s&&this._disableNav("next");break;case g.years:var o=p(this.dp.viewDate);t&&a.year>=o[0]&&this._disableNav("prev"),i&&n.year<=o[1]&&this._disableNav("next")}}}_disableNav(e){c('[data-action="'+e+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){!function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];e.length?e.forEach(e=>{e.classList.remove(...i)}):e.classList.remove(...i)}(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){var{prevHtml:e,nextHtml:t}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${e}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${t}</div>`}get isNavIsFunction(){let t=this.opts.navTitles;return Object.keys(t).find(e=>"function"==typeof t[e])}}var L={today:{content:e=>e.locale.today,onClick:e=>e.setViewDate(new Date)},clear:{content:e=>e.locale.clear,onClick:e=>e.clear()}};class H{constructor(e){var{dp:e,opts:t}=e;this.dp=e,this.opts=t,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=r({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let e=this.opts.buttons;(e=Array.isArray(e)?e:[e]).forEach(e=>{let t=e;"string"==typeof e&&L[e]&&(t=L[e]);e=this.createButton(t);t.onClick&&this.attachEventToButton(e,t.onClick),this.$el.appendChild(e)})}attachEventToButton(e,t){e.addEventListener("click",()=>{t(this.dp)})}createButton(e){var{content:e,className:t,tagName:i="button",attrs:s={}}=e;return r({tagName:i,innerHtml:`<span tabindex='-1'>${"function"==typeof e?e(this.dp):e}</span>`,className:v("air-datepicker-button",t),attrs:s})}render(){this.generateButtons()}}function P(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}class z{constructor(){var{opts:e,dp:t}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=(P(this,"toggleTimepickerIsActive",e=>{this.dp.timepickerIsActive=e}),P(this,"onChangeSelectedDate",e=>{var{date:e,updateTime:t=!1}=e;e&&(this.setMinMaxTime(e),this.setCurrentTime(!!t&&e),this.addTimeToDate(e))}),P(this,"onChangeLastSelectedDate",e=>{e&&(this.setTime(e),this.render())}),P(this,"onChangeInputRange",e=>{e=e.target;this[e.getAttribute("name")]=e.value,this.updateText(),this.dp.trigger(g.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),P(this,"onMouseEnterLeave",e=>{let t=e.target.getAttribute("name"),i=this.$minutesText;(i="hours"===t?this.$hoursText:i).classList.toggle("-focus-")}),P(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),P(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=e,this.dp=t,this.dp.locale).timeFormat;e&&(e.match(D("h"))||e.match(D("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(g.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(g.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let e="input";navigator.userAgent.match(/trident/gi)&&(e="change"),_(this.$ranges,e,this.onChangeInputRange),_(this.$ranges,"mouseenter",this.onMouseEnterLeave),_(this.$ranges,"mouseleave",this.onMouseEnterLeave),_(this.$ranges,"focus",this.onFocus),_(this.$ranges,"mousedown",this.onFocus),_(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=r({className:v("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(g.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(g.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){var{ampm:e,hours:t,displayHours:i,minutes:s,minHours:r,minMinutes:a,maxHours:n,maxMinutes:o,dayPeriod:l,opts:{hoursStep:h,minutesStep:d}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${u(i)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${u(s)}</span> `+(e?`<span class='air-datepicker-time--current-ampm'>${l}</span>`:"")+'</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row">'+` <input type="range" name="hours" value="${t}" min="${r}" max="${n}" step="${h}"/> </div> <div class="air-datepicker-time--row">`+` <input type="range" name="minutes" value="${s}" min="${a}" max="${o}" step="${d}"/> </div></div>`}defineDOM(){var e=e=>c(e,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=e('[name="hours"]'),this.$minutes=e('[name="minutes"]'),this.$hoursText=e(".air-datepicker-time--current-hours"),this.$minutesText=e(".air-datepicker-time--current-minutes"),this.$ampm=e(".air-datepicker-time--current-ampm")}setTime(e){this.setMinMaxTime(e),this.setCurrentTime(e)}addTimeToDate(e){e&&(e.setHours(this.hours),e.setMinutes(this.minutes))}setMinMaxTime(e){var t,i;this.setMinMaxTimeFromOptions(),e&&({minDate:t,maxDate:i}=this.dp,t&&b(e,t)&&this.setMinTimeFromMinDate(t),i)&&b(e,i)&&this.setMaxTimeFromMaxDate(i)}setCurrentTime(e){var{hours:e,minutes:t}=e?f(e):this;this.hours=k(e,this.minHours,this.maxHours),this.minutes=k(t,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){var{minHours:e,minMinutes:t,maxHours:i,maxMinutes:s}=this.opts;this.minHours=k(e,0,23),this.minMinutes=k(t,0,59),this.maxHours=k(i,0,23),this.maxMinutes=k(s,0,59)}setMinTimeFromMinDate(e){var t=this.dp.lastSelectedDate;this.minHours=e.getHours(),t&&t.getHours()>e.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=e.getMinutes()}setMaxTimeFromMaxDate(e){var t=this.dp.lastSelectedDate;this.maxHours=e.getHours(),t&&t.getHours()<e.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=e.getMinutes()}updateSliders(){n(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,n(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=u(this.displayHours),this.$minutesText.innerHTML=u(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(e){var{hours:t,dayPeriod:i}=o(this._hours=e);this.displayHours=this.ampm?t:e,this.dayPeriod=i}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function R(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}class j{constructor(e){var{dp:e,opts:t}=e;R(this,"pressedKeys",new Set),R(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],e=>e.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],e=>e.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],e=>e.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],e=>e.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],e=>e.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],e=>e.year-=10],[["Control","Shift","ArrowUp"],(e,t)=>t.up()]])),R(this,"handleHotKey",e=>{var e=this.hotKeys.get(e),t=f(this.getInitialFocusDate());e(t,this.dp);let{year:i,month:s,date:r}=t,a=m(new Date(i,s));a<r&&(r=a);e=this.dp.getClampedDate(new Date(i,s,r));this.dp.setFocusDate(e,{viewDateTransition:!0})}),R(this,"isHotKeyPressed",()=>{let i=!1,s=this.pressedKeys.size,r=e=>this.pressedKeys.has(e);for(let[t]of this.hotKeys){if(i)break;Array.isArray(t[0])?t.forEach(e=>{i||s!==e.length||(i=e.every(r)&&t)}):s===t.length&&(i=t.every(r)&&t)}return i}),R(this,"isArrow",e=>37<=e&&e<=40),R(this,"onKeyDown",e=>{var{key:t,which:i}=e,{dp:s,dp:{focusDate:r},opts:a}=this,n=(this.registerKey(t),this.isHotKeyPressed());if(n)e.preventDefault(),this.handleHotKey(n);else if(this.isArrow(i))e.preventDefault(),this.focusNextCell(t);else{if("Enter"===t){if(s.currentView!==a.minView)return void s.down();if(r)return void((n=s._checkIfDateIsSelected(r))?s._handleAlreadySelectedDates(n,r):s.selectDate(r))}"Escape"===t&&this.dp.hide()}}),R(this,"onKeyUp",e=>{this.removeKey(e.key)}),this.dp=e,this.opts=t,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){var e=this.dp.$el;e.addEventListener("keydown",this.onKeyDown),e.addEventListener("keyup",this.onKeyUp)}destroy(){var e=this.dp.$el;e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:e,currentView:t,selectedDates:i,parsedViewDate:{year:s,month:r}}=this.dp,a=e||i[i.length-1];if(!a)switch(t){case g.days:a=new Date(s,r,(new Date).getDate());break;case g.months:a=new Date(s,r,1);break;case g.years:a=new Date(s,0,1)}return a}focusNextCell(e){let t=this.getInitialFocusDate(),i=this.dp.currentView,{days:s,months:r,years:a}=g,n=f(t),o=n.year,l=n.month,h=n.date;switch(e){case"ArrowLeft":i===s&&--h,i===r&&--l,i===a&&--o;break;case"ArrowUp":i===s&&(h-=7),i===r&&(l-=3),i===a&&(o-=4);break;case"ArrowRight":i===s&&(h+=1),i===r&&(l+=1),i===a&&(o+=1);break;case"ArrowDown":i===s&&(h+=7),i===r&&(l+=3),i===a&&(o+=4)}e=this.dp.getClampedDate(new Date(o,l,h));this.dp.setFocusDate(e,{viewDateTransition:!0})}registerKey(e){this.pressedKeys.add(e)}removeKey(e){this.pressedKeys.delete(e)}}var O,$={on(e,t){this.__events||(this.__events={}),this.__events[e]?this.__events[e].push(t):this.__events[e]=[t]},off(e,t){this.__events&&this.__events[e]&&(this.__events[e]=this.__events[e].filter(e=>e!==t))},removeAllEvents(){this.__events={}},trigger(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];this.__events&&this.__events[e]&&this.__events[e].forEach(e=>{e(...i)})}};function I(e,t,i){var s;s=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),(t="symbol"==typeof s?s:String(s))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}let l="",h="",d=!1;class V{static buildGlobalContainer(e){d=!0,l=r({className:e,id:e}),c("body").appendChild(l)}constructor(e,t){var m=this;I(this,"viewIndexes",[g.days,g.months,g.years]),I(this,"next",()=>{var{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case g.days:this.setViewDate(new Date(e,t+1,1));break;case g.months:this.setViewDate(new Date(e+1,t,1));break;case g.years:this.setViewDate(new Date(e+10,0,1))}}),I(this,"prev",()=>{var{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case g.days:this.setViewDate(new Date(e,t-1,1));break;case g.months:this.setViewDate(new Date(e-1,t,1));break;case g.years:this.setViewDate(new Date(e-10,0,1))}}),I(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),I(this,"setPosition",function(g){if("function"==typeof(g=g||m.opts.position))m.customHide=g({$datepicker:m.$datepicker,$target:m.$el,$pointer:m.$pointer,isViewChange:1<arguments.length&&void 0!==arguments[1]&&arguments[1],done:m._finishHide});else{let e,t,i=m.opts.isMobile,s=m.$el.getBoundingClientRect(),r=m.$el.getBoundingClientRect(),a=m.$datepicker.offsetParent,n=m.$el.offsetParent,o=m.$datepicker.getBoundingClientRect(),l=g.split(" "),h=window.scrollY,d=window.scrollX,c=m.opts.offset,u=l[0],p=l[1];if(i)m.$datepicker.style.cssText="left: 50%; top: 50%";else{switch(a===n&&a!==document.body&&(r={top:m.$el.offsetTop,left:m.$el.offsetLeft,width:s.width,height:m.$el.offsetHeight},h=0,d=0),a!==n&&a!==document.body&&(g=a.getBoundingClientRect(),r={top:s.top-g.top,left:s.left-g.left,width:s.width,height:s.height},h=0,d=0),u){case"top":e=r.top-o.height-c;break;case"right":t=r.left+r.width+c;break;case"bottom":e=r.top+r.height+c;break;case"left":t=r.left-o.width-c}switch(p){case"top":e=r.top;break;case"right":t=r.left+r.width-o.width;break;case"bottom":e=r.top+r.height-o.height;break;case"left":t=r.left;break;case"center":/left|right/.test(u)?e=r.top+r.height/2-o.height/2:t=r.left+r.width/2-o.width/2}m.$datepicker.style.cssText=`left: ${t+d}px; top: ${e+h}px`}}}),I(this,"_setInputValue",()=>{var{opts:e,$altField:t,locale:{dateFormat:i}}=this,{altFieldDateFormat:e,altField:s}=e;s&&t&&(t.value=this._getInputValue(e)),this.$el.value=this._getInputValue(i)}),I(this,"_getInputValue",t=>{var{selectedDates:e,opts:i}=this,{multipleDates:i,multipleDatesSeparator:s}=i;if(!e.length)return"";let r="function"==typeof t,a=r?t(i?e:e[0]):e.map(e=>this.formatDate(e,t));return a=r?a:a.join(s)}),I(this,"_checkIfDateIsSelected",function(i){let s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:g.days,r=!1;return m.selectedDates.some(e=>{var t=b(i,e,s);return r=t&&e,t}),r}),I(this,"_scheduleCallAfterTransition",e=>{this._cancelScheduledCall(),e&&e(!1),this._onTransitionEnd=()=>{e&&e(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),I(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),I(this,"setViewDate",e=>{var t,i,s,r;(e=E(e))instanceof Date&&(b(e,this.viewDate)||(t=this.viewDate,i=(this.viewDate=e,this.opts).onChangeViewDate,i&&({month:s,year:r}=this.parsedViewDate,i({month:s,year:r,decade:this.curDecade})),this.trigger(g.eventChangeViewDate,e,t)))}),I(this,"setFocusDate",function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};(!e||(e=E(e))instanceof Date)&&(m.focusDate=e,m.trigger(g.eventChangeFocusDate,e,t))}),I(this,"setCurrentView",function(e){var t,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};m.viewIndexes.includes(e)&&(m.currentView=e,m.elIsInput&&m.visible&&m.setPosition(void 0,!0),m.trigger(g.eventChangeCurrentView,e),m.views[e]||(t=m.views[e]=new B({dp:m,opts:m.opts,type:e}),m.shouldUpdateDOM&&m.$content.appendChild(t.$el)),m.opts.onChangeView)&&!i.silent&&m.opts.onChangeView(e)}),I(this,"_updateLastSelectedDate",e=>{this.lastSelectedDate=e,this.trigger(g.eventChangeLastSelectedDate,e)}),I(this,"destroy",()=>{var e,t,i;this.isDestroyed||({showEvent:e,isMobile:t}=this.opts,(i=this.$datepicker.parentNode)&&i.removeChild(this.$datepicker),this.$el.removeEventListener(e,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),t&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0)}),I(this,"update",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=M({},m.opts),t=t.silent,{timepicker:s,buttons:r,range:a,selectedDates:n,isMobile:o}=(M(m.opts,e),m.opts),l=m.visible||m.treatAsInline;m._createMinMaxDates(),m._limitViewDateByMaxMinDates(),m._handleLocale(),n&&(m.selectedDates=[],m.selectDate(n,{silent:t})),e.view&&m.setCurrentView(e.view,{silent:t}),m._setInputValue(),i.range&&!a?(m.rangeDateTo=!1,m.rangeDateFrom=!1):!i.range&&a&&m.selectedDates.length&&(m.rangeDateFrom=m.selectedDates[0],m.rangeDateTo=m.selectedDates[1]),i.timepicker&&!s?(l&&m.timepicker.destroy(),m.timepicker=!1,m.$timepicker.parentNode.removeChild(m.$timepicker)):!i.timepicker&&s&&m._addTimepicker(),!i.buttons&&r?m._addButtons():i.buttons&&!r?(m.buttons.destroy(),m.$buttons.parentNode.removeChild(m.$buttons)):l&&i.buttons&&r&&m.buttons.clearHtml().render(),!i.isMobile&&o?(m.treatAsInline||h||m._createMobileOverlay(),m._addMobileAttributes(),m.visible&&m._showMobileOverlay()):i.isMobile&&!o&&(m._removeMobileAttributes(),m.visible)&&(h.classList.remove("-active-"),"function"!=typeof m.opts.position)&&m.setPosition(),l&&(m.nav.update(),m.views[m.currentView].render(),m.currentView===g.days)&&m.views[m.currentView].renderDayNames()}),I(this,"disableDate",(e,t)=>{(Array.isArray(e)?e:[e]).forEach(e=>{var e=E(e);e&&(this.disabledDates[t?"delete":"add"](this.formatDate(e,"yyyy-MM-dd")),e=this.getCell(e,this.currentViewSingular))&&e.adpCell.render()},[])}),I(this,"enableDate",e=>{this.disableDate(e,!0)}),I(this,"isDateDisabled",e=>{e=E(e);return this.disabledDates.has(this.formatDate(e,"yyyy-MM-dd"))}),I(this,"isOtherMonth",e=>{e=f(e).month;return e!==this.parsedViewDate.month}),I(this,"isOtherYear",e=>{e=f(e).year;return e!==this.parsedViewDate.year}),I(this,"isOtherDecade",e=>{var e=f(e).year,[t,i]=p(this.viewDate);return e<t||i<e}),I(this,"_onChangeSelectedDate",e=>{let t=e.silent;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!t&&this._triggerOnSelect()})}),I(this,"_onChangeFocusedDate",function(t){var i=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).viewDateTransition;if(t){let e=!1;(e=i?m.isOtherMonth(t)||m.isOtherYear(t)||m.isOtherDecade(t):e)&&m.setViewDate(t),m.opts.onFocus&&m.opts.onFocus({datepicker:m,date:t})}}),I(this,"_onChangeTime",e=>{let{hours:t,minutes:i}=e,s=new Date,{lastSelectedDate:r,opts:{onSelect:a}}=this,n=r;r||(n=s);e=this.getCell(n,this.currentViewSingular),e=e&&e.adpCell;e&&e.isDisabled||(n.setHours(t),n.setMinutes(i),r?(this._setInputValue(),a&&this._triggerOnSelect()):this.selectDate(n))}),I(this,"_onFocus",e=>{this.visible||this.show()}),I(this,"_onBlur",e=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),I(this,"_onMouseDown",e=>{this.inFocus=!0}),I(this,"_onMouseUp",e=>{this.inFocus=!1,this.$el.focus()}),I(this,"_onResize",()=>{this.visible&&"function"!=typeof this.opts.position&&this.setPosition()}),I(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),I(this,"getViewDates",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:g.days;return B.getDatesFunction(e)(m)}),I(this,"isWeekend",e=>this.opts.weekends.includes(e)),I(this,"getClampedDate",e=>{let{minDate:t,maxDate:i}=this,s=e;return i&&y(e,i)?s=i:t&&x(e,t)&&(s=t),s}),this.$el=c(e),this.$el&&(this.$datepicker=r({className:"air-datepicker"}),this.opts=M({},i,t),this.$customContainer=!!this.opts.container&&c(this.opts.container),this.$altField=c(this.opts.altField||!1),{view:e,startDate:t}=this.opts,t||(this.opts.startDate=new Date),"INPUT"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=E(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=e,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init())}init(){var{opts:e,treatAsInline:t,opts:{inline:i,isMobile:s,selectedDates:r,keyboardNav:a,onlyTimepicker:n}}=this,o=c("body");d&&(!d||!l||o.contains(l))||i||!this.elIsInput||this.$customContainer||V.buildGlobalContainer(V.defaultGlobalContainerId),!s||h||t||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(i||this._bindEvents(),a)&&!n&&(this.keyboardNav=new j({dp:this,opts:e})),r&&this.selectDate(r,{silent:!0}),this.opts.visible&&!t&&this.show(),s&&!t&&this.$el.setAttribute("readonly",!0),t&&this._createComponents()}_createMobileOverlay(){h=r({className:"air-datepicker-overlay"}),l.appendChild(h)}_createComponents(){var{opts:e,treatAsInline:t,opts:{inline:i,buttons:s,timepicker:r,position:a,classes:n,onlyTimepicker:o,isMobile:l}}=this;this._buildBaseHtml(),this.elIsInput&&!i&&this._setPositionClasses(a),!i&&this.elIsInput||this.$datepicker.classList.add("-inline-"),n&&this.$datepicker.classList.add(...n.split(" ")),o&&this.$datepicker.classList.add("-only-timepicker-"),l&&!t&&this._addMobileAttributes(),this.views[this.currentView]=new B({dp:this,type:this.currentView,opts:e}),this.nav=new N({dp:this,opts:e}),r&&this._addTimepicker(),s&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(var e in this.views)this.views[e].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){h.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){h.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||""===this.initialReadonly||this.$el.removeAttribute("readonly")}_createMinMaxDates(){var{minDate:e,maxDate:t}=this.opts;this.minDate=!!e&&E(e),this.maxDate=!!t&&E(t)}_addTimepicker(){this.$timepicker=r({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new z({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=r({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new H({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(g.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(g.eventChangeFocusDate,this._onChangeFocusedDate),this.on(g.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){var e,t=this.opts.inline;this.elIsInput?t?(t=this.$datepicker,(e=this.$el).parentNode.insertBefore(t,e.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=c(".air-datepicker--content",this.$datepicker),this.$pointer=c(".air-datepicker--pointer",this.$datepicker),this.$nav=c(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){var{locale:e,dateFormat:t,firstDay:i,timepicker:s,onlyTimepicker:r,timeFormat:a,dateTimeSeparator:n}=this.opts,e=(this.locale=JSON.parse(JSON.stringify(e)),t&&(this.locale.dateFormat=t),void 0!==a&&""!==a&&(this.locale.timeFormat=a),this.locale).timeFormat;""!==i&&(this.locale.firstDay=i),s&&"function"!=typeof t&&(this.locale.dateFormat=[this.locale.dateFormat,e||""].join(e?n:"")),r&&"function"!=typeof t&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(e){var t;"function"==typeof e?this.$datepicker.classList.add("-custom-position-"):(e=`air-datepicker -${t=(e=e.split(" "))[0]}-${e[1]}- -from-${t}-`,this.$datepicker.classList.add(...e.split(" ")))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){var{viewDate:e,minDate:t,maxDate:i}=this;i&&y(e,i)&&this.setViewDate(i),t&&x(e,t)&&this.setViewDate(t)}formatDate(){var o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.viewDate,l=1<arguments.length?arguments[1]:void 0;if((o=E(o))instanceof Date){let e=l,t=this.locale,i=f(o),s=i.dayPeriod,r=p(o),a=V.replacer,n={T:o.getTime(),m:i.minutes,mm:i.fullMinutes,h:i.hours12,hh:i.fullHours12,H:i.hours,HH:i.fullHours,aa:s,AA:s.toUpperCase(),E:t.daysShort[i.day],EEEE:t.days[i.day],d:i.date,dd:i.fullDate,M:i.month+1,MM:i.fullMonth,MMM:t.monthsShort[i.month],MMMM:t.months[i.month],yy:i.year.toString().slice(-2),yyyy:i.year,yyyy1:r[0],yyyy2:r[1]};for(var[h,d]of Object.entries(n))e=a(e,D(h),d);return e}}down(e){this._handleUpDownActions(e,"down")}up(e){this._handleUpDownActions(e,"up")}selectDate(e){let t,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},{currentView:s,parsedViewDate:r,selectedDates:a}=this,n=i.updateTime,{moveToOtherMonthsOnSelect:o,moveToOtherYearsOnSelect:l,multipleDates:h,range:d,autoClose:c,onBeforeSelect:u}=this.opts,p=a.length;if(Array.isArray(e))return e.forEach(e=>{this.selectDate(e,i)}),new Promise(e=>{setTimeout(e)});if((e=E(e))instanceof Date){if(u&&!u({date:e,datepicker:this}))return Promise.resolve();if(s===g.days&&e.getMonth()!==r.month&&o&&(t=new Date(e.getFullYear(),e.getMonth(),1)),(t=s===g.years&&e.getFullYear()!==r.year&&l?new Date(e.getFullYear(),0,1):t)&&this.setViewDate(t),h&&!d){if(p===h)return;this._checkIfDateIsSelected(e)||a.push(e)}else if(d)switch(p){case 1:a.push(e),this.rangeDateTo||(this.rangeDateTo=e),y(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=e),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[e],this.rangeDateFrom=e,this.rangeDateTo="";break;default:this.selectedDates=[e],this.rangeDateFrom=e}else this.selectedDates=[e];return this.trigger(g.eventChangeSelectedDate,{action:g.actionSelectDate,silent:null==i?void 0:i.silent,date:e,updateTime:n}),this._updateLastSelectedDate(e),c&&!this.timepickerIsActive&&this.visible&&(!h&&!d||d&&1===p)&&this.hide(),new Promise(e=>{setTimeout(e)})}}unselectDate(i){let s=this.selectedDates,r=this;if((i=E(i))instanceof Date)return s.some((e,t)=>{if(b(e,i))return s.splice(t,1),r.selectedDates.length?(r.rangeDateTo="",r.rangeDateFrom=s[0],r._updateLastSelectedDate(r.selectedDates[r.selectedDates.length-1])):(r.rangeDateFrom="",r.rangeDateTo="",r._updateLastSelectedDate(!1)),this.trigger(g.eventChangeSelectedDate,{action:g.actionUnselectDate,date:i}),!0})}replaceDate(t,e){var i=this.selectedDates.find(e=>b(e,t,this.currentView)),i=this.selectedDates.indexOf(i);i<0||b(this.selectedDates[i],e,this.currentView)||(this.selectedDates[i]=e,this.trigger(g.eventChangeSelectedDate,{action:g.actionSelectDate,date:e,updateTime:!0}),this._updateLastSelectedDate(e))}clear(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(g.eventChangeSelectedDate,{action:g.actionUnselectDate,silent:e.silent}),new Promise(e=>{setTimeout(e)})}show(){var{onShow:e,isMobile:t}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,e&&this._scheduleCallAfterTransition(e),t&&this._showMobileOverlay()}hide(){let{onHide:t,isMobile:e}=this.opts,i=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(e=>{!this.customHide&&(e&&i||!e&&!i)&&this._finishHide(),t&&t(e)}),e&&h.classList.remove("-active-")}_triggerOnSelect(){let e=[],t=[],{selectedDates:i,locale:s,opts:{onSelect:r,multipleDates:a,range:n}}=this,o=a||n,l="function"==typeof s.dateFormat;i.length&&(e=i.map(w),t=l?a?s.dateFormat(e):e.map(e=>s.dateFormat(e)):e.map(e=>this.formatDate(e,s.dateFormat))),r({date:o?e:e[0],formattedDate:o?t:t[0],datepicker:this})}_handleAlreadySelectedDates(e,t){var{selectedDates:i,rangeDateFrom:s,rangeDateTo:r}=this,{range:a,toggleSelected:n}=this.opts,i=i.length,n="function"==typeof n?n({datepicker:this,date:t}):n,o=Boolean(a&&1===i&&e),t=o?w(t):t;a&&!n&&(2!==i&&this.selectDate(t),2===i)&&b(s,r)||(n?this.unselectDate(t):this._updateLastSelectedDate(o?t:e))}_handleUpDownActions(t,i){if((t=E(t||this.focusDate||this.viewDate))instanceof Date){let e="up"===i?this.viewIndex+1:this.viewIndex-1;(e=2<e?2:e)<0&&(e=0),this.setViewDate(new Date(t.getFullYear(),t.getMonth(),1)),this.setCurrentView(this.viewIndexes[e])}}getCell(e){var t,i,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:g.day;if((e=E(e))instanceof Date)return{year:e,month:i,date:t}=f(e),e=`[data-year="${e}"]`,i=`[data-month="${i}"]`,this.views[this.currentView]?this.views[this.currentView].$el.querySelector({[g.day]:e+i+`[data-date="${t}"]`,[g.month]:e+i,[g.year]:e}[s]):void 0}_showMobileOverlay(){h.classList.add("-active-")}_hasTransition(){return 0<window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((e,t)=>parseFloat(t)+e,0)}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return f(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return p(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===g.years}get hasSelectedDates(){return 0<this.selectedDates.length}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===g.days}get $container(){return this.$customContainer||l}static replacer(e,t,r){return e.replace(t,function(e,t,i,s){return t+r+s})}}return I(V,"defaults",i),I(V,"version","3.5.3"),I(V,"defaultGlobalContainerId","air-datepicker-global-container"),O=V.prototype,Object.assign(O,$),t.default}});
|
15
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/libs/highlight.min.js */
|
16
|
+
/*!
|
17
|
+
Highlight.js v11.7.0 (git: 82688fad18)
|
18
|
+
(c) 2006-2022 undefined and other contributors
|
19
|
+
License: BSD-3-Clause
|
20
|
+
*/
|
21
|
+
var hljs=function(){var u={exports:{}};function i(t){return t instanceof Map?t.clear=t.delete=t.set=()=>{throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{e=t[e];"object"!=typeof e||Object.isFrozen(e)||i(e)}),t}u.exports=i,u.exports.default=i;class L{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(t,...e){let i=Object.create(null);for(let e in t)i[e]=t[e];return e.forEach(e=>{for(var t in e)i[t]=e[t]}),i}let r=e=>!!e.scope||e.sublanguage&&e.language;class e{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){var t,i,s;r(e)&&(s="",s=e.sublanguage?"language-"+e.language:([e,t]=[e.scope,{prefix:this.classPrefix}.prefix],e.includes(".")?[""+t+(i=e.split(".")).shift(),...i.map((e,t)=>""+e+"_".repeat(t+1))].join(" "):""+t+e),this.span(s))}closeNode(e){r(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let s=(e={})=>{var t={children:[]};return Object.assign(t,e),t};class a{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){e=s({scope:e});this.add(e),this.stack.push(e)}closeNode(){if(1<this.stack.length)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(t,e){return"string"==typeof e?t.addText(e):e.children&&(t.openNode(e),e.children.forEach(e=>this._walk(t,e)),t.closeNode(e)),t}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{a._collapse(e)}))}}class p extends a{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){e=e.root;e.sublanguage=!0,e.language=t,this.add(e)}toHTML(){return new e(this,this.options).value()}finalize(){return!0}}function h(e){return e?"string"==typeof e?e:e.source:null}function g(e){return v("(?=",e,")")}function m(e){return v("(?:",e,")*")}function f(e){return v("(?:",e,")?")}function v(...e){return e.map(e=>h(e)).join("")}function b(...e){var t,i="object"==typeof(t=(i=e)[i.length-1])&&t.constructor===Object?(i.splice(i.length-1,1),t):{};return"("+(i.capture?"":"?:")+e.map(e=>h(e)).join("|")+")"}function d(e){return RegExp(e.toString()+"|").exec("").length-1}let C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function c(e,{joinWith:t}){let r=0;return e.map(e=>{var t=r+=1;let i=h(e),s="";for(;0<i.length;){let e=C.exec(i);if(!e){s+=i;break}s+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0],"("===e[0]&&r++)}return s}).map(e=>`(${e})`).join(t)}var n="[a-zA-Z]\\w*",o="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",x="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",_={begin:"\\\\[\\s\\S]",relevance:0},T={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[_]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[_]},S=(e,t,i={})=>{e=l({scope:"comment",begin:e,end:t,contains:[]},i),e.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}),t=b("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return e.contains.push({begin:v(/[ ]+/,"(",t,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),e},H=S("//","$"),V=S("/\\*","\\*/"),$=S("#","$"),P=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:n,UNDERSCORE_IDENT_RE:o,NUMBER_RE:y,C_NUMBER_RE:x,BINARY_NUMBER_RE:w,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{var t=/^#![ ]*\//;return e.binary&&(e.begin=v(t,/.*\b/,e.binary,/\b.*/)),l({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:_,APOS_STRING_MODE:T,QUOTE_STRING_MODE:A,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:S,C_LINE_COMMENT_MODE:H,C_BLOCK_COMMENT_MODE:V,HASH_COMMENT_MODE:$,NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number",begin:x,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:w,relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[_,{begin:/\[/,end:/\]/,relevance:0,contains:[_]}]}]},TITLE_MODE:{scope:"title",begin:n,relevance:0},UNDERSCORE_TITLE_MODE:{scope:"title",begin:o,relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function z(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}let j=(t,e)=>{if(t.beforeMatch){if(t.starts)throw Error("beforeMatch cannot be used with starts");var i=Object.assign({},t);Object.keys(t).forEach(e=>{delete t[e]}),t.keywords=i.keywords,t.begin=v(i.beforeMatch,g(i.begin)),t.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},t.relevance=0,delete i.beforeMatch}},W=["of","and","for","in","not","or","if","then","parent","list","value"];function k(t,s,e="keyword"){let r=Object.create(null);return"string"==typeof t?i(e,t.split(" ")):Array.isArray(t)?i(e,t):Object.keys(t).forEach(e=>{Object.assign(r,k(t[e],s,e))}),r;function i(i,e){(e=s?e.map(e=>e.toLowerCase()):e).forEach(e=>{var t,e=e.split("|");r[e[0]]=[i,(t=e[0],(e=e[1])?Number(e):(e=>W.includes(e.toLowerCase()))(t)?0:1)]})}}let M={},R=e=>{console.error(e)},O=(e,...t)=>{console.log("WARN: "+e,...t)},I=(e,t)=>{M[e+"/"+t]||(console.log(`Deprecated as of ${e}. `+t),M[e+"/"+t]=!0)},E=Error();function D(e,t,{key:i}){let s=0;var r=e[i],a={},n={};for(let e=1;e<=t.length;e++)n[e+s]=r[e],a[e+s]=!0,s+=d(t[e-1]);e[i]=n,e[i]._emit=a,e[i]._multi=!0}function q(a){function n(e,t){return RegExp(h(e),"m"+(a.case_insensitive?"i":"")+(a.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=d(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);var e=this.regexes.map(e=>e[1]);this.matcherRe=n(c(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;var t,i,e=this.matcherRe.exec(e);return e?(t=e.findIndex((e,t)=>0<t&&void 0!==e),i=this.matchIndexes[t],e.splice(0,t),Object.assign(e,i)):null}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let i=new t;return this.rules.slice(e).forEach(([e,t])=>i.addRule(e,t)),i.compile(),this.multiRegexes[e]=i}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(t){let e=this.getMatcher(this.regexIndex),i=(e.lastIndex=this.lastIndex,e.exec(t));if(this.resumingScanAtSamePosition()&&(!i||i.index!==this.lastIndex)){let e=this.getMatcher(0);e.lastIndex=this.lastIndex+1,i=e.exec(t)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count)&&this.considerAll(),i}}if(a.compilerExtensions||(a.compilerExtensions=[]),a.contains&&a.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return a.classNameAliases=l(a.classNameAliases||{}),function t(i,s){let r=i;if(!i.isCompiled){[function(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)},function(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}},function(e){if((t=e).scope&&"object"==typeof t.scope&&null!==t.scope&&(t.beginScope=t.scope,delete t.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),t=e,Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw R("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),E;if("object"!=typeof t.beginScope||null===t.beginScope)throw R("beginScope must be object"),E;D(t,t.begin,{key:"beginScope"}),t.begin=c(t.begin,{joinWith:""})}var t=e;if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw R("skip, excludeEnd, returnEnd not compatible with endScope: {}"),E;if("object"!=typeof t.endScope||null===t.endScope)throw R("endScope must be object"),E;D(t,t.end,{key:"endScope"}),t.end=c(t.end,{joinWith:""})}},j].forEach(e=>e(i,s)),a.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[function(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=z,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance)&&(e.relevance=0)},function(e,t){Array.isArray(e.illegal)&&(e.illegal=b(...e.illegal))},function(e,t){void 0===e.relevance&&(e.relevance=1)}].forEach(e=>e(i,s)),i.isCompiled=!0;let e=null;"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),e=i.keywords.$pattern,delete i.keywords.$pattern),e=e||/\w+/,i.keywords&&(i.keywords=k(i.keywords,a.case_insensitive)),r.keywordPatternRe=n(e,!0),s&&(i.begin||(i.begin=/\B|\b/),r.beginRe=n(r.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(r.endRe=n(r.end)),r.terminatorEnd=h(r.end)||"",i.endsWithParent)&&s.terminatorEnd&&(r.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd),i.illegal&&(r.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(e=>{return(t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(e=>l(t,{variants:null},e))),t.cachedVariants||(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?l(t,{starts:t.starts?l(t.starts):null}):Object.isFrozen(t)?l(t):t);var t})),i.contains.forEach(e=>{t(e,r)}),i.starts&&t(i.starts,s),r.matcher=(e=>{let t=new o;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(r)}return r}(a)}class U extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let F=t,B=l,N=Symbol("nomatch"),Y=(s=>{let k=Object.create(null),n=Object.create(null),r=[],M=!0,E="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},D={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function o(e){return D.noHighlightRe.test(e)}function l(e,t,i){let s="",r="";"object"==typeof t?(s=e,i=t.ignoreIllegals,r=t.language):(I("10.7.0","highlight(lang, code, ...args) has been deprecated."),I("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,s=t),void 0===i&&(i=!0);e={code:s,language:r},c("before:highlight",e),t=e.result||C(e.language,e.code,i);return t.code=e.code,c("after:highlight",t),t}function C(l,h,e,t){let n=Object.create(null);function a(){if(!m.keywords)return v.addText(y);let e=0,i=(m.keywordPatternRe.lastIndex=0,m.keywordPatternRe.exec(y)),s="";for(;i;){s+=y.substring(e,i.index);var r=o.case_insensitive?i[0].toLowerCase():i[0],a=(t=r,m.keywords[t]);if(a){let[t,e]=a;if(v.addText(s),s="",n[r]=(n[r]||0)+1,n[r]<=7&&(x+=e),t.startsWith("_"))s+=i[0];else{let e=o.classNameAliases[t]||t;v.addKeyword(i[0],e)}}else s+=i[0];e=m.keywordPatternRe.lastIndex,i=m.keywordPatternRe.exec(y)}var t;s+=y.substring(e),v.addText(s)}function d(){(null!=m.subLanguage?()=>{if(""!==y){let e=null;if("string"==typeof m.subLanguage){if(!k[m.subLanguage])return void v.addText(y);e=C(m.subLanguage,y,!0,f[m.subLanguage]),f[m.subLanguage]=e._top}else e=T(y,m.subLanguage.length?m.subLanguage:null);0<m.relevance&&(x+=e.relevance),v.addSublanguage(e._emitter,e.language)}}:a)(),y=""}function r(i,s){let r=1,e=s.length-1;for(;r<=e;){if(i._emit[r]){let e=o.classNameAliases[i[r]]||i[r],t=s[r];e?v.addKeyword(t,e):(y=t,a(),y="")}r++}}function c(e,t){e.scope&&"string"==typeof e.scope&&v.openNode(o.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(v.addKeyword(y,o.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),y=""):e.beginScope._multi&&(r(e.beginScope,t),y="")),m=Object.create(e,{parent:{value:m}})}function u(e){var t=e[0],i=h.substring(e.index),s=function e(t,i,s){let r=(e=>(e=e&&e.exec(s))&&0===e.index)(t.endRe);if(r){if(t["on:end"]){let e=new L(t);t["on:end"](i,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,s)}(m,e,i);if(!s)return N;i=m;for(m.endScope&&m.endScope._wrap?(d(),v.addKeyword(t,m.endScope._wrap)):m.endScope&&m.endScope._multi?(d(),r(m.endScope,e)):i.skip?y+=t:(i.returnEnd||i.excludeEnd||(y+=t),d(),i.excludeEnd&&(y=t));m.scope&&v.closeNode(),m.skip||m.subLanguage||(x+=m.relevance),(m=m.parent)!==s.parent;);return s.starts&&c(s.starts,e),i.returnEnd?0:t.length}let p={};function i(t,i){var s=i&&i[0];if(y+=t,null==s)return d(),0;if("begin"===p.type&&"end"===i.type&&p.index===i.index&&""===s){if(y+=h.slice(i.index,i.index+1),M)return 1;{let e=Error(`0 width match regex (${l})`);throw e.languageName=l,e.badRule=p.rule,e}}if("begin"===(p=i).type){var r,a=i,n=a[0],t=a.rule,o=new L(t);for(let e of[t.__beforeBegin,t["on:begin"]])if(e&&(e(a,o),o.isMatchIgnored))return r=n,0===m.matcher.regexIndex?(y+=r[0],1):(S=!0,0);return t.skip?y+=n:(t.excludeBegin&&(y+=n),d(),t.returnBegin||t.excludeBegin||(y=n)),c(t,a),t.returnBegin?0:n.length}if("illegal"===i.type&&!e){let e=Error('Illegal lexeme "'+s+'" for mode "'+(m.scope||"<unnamed>")+'"');throw e.mode=m,e}if("end"===i.type){let e=u(i);if(e!==N)return e}if("illegal"===i.type&&""===s)return 1;if(1e5<_&&_>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return y+=s,s.length}let o=A(l);if(!o)throw R(E.replace("{}",l)),Error('Unknown language: "'+l+'"');var s=q(o);let g="",m=t||s,f={},v=new D.__emitter(D);var b=[];for(let e=m;e!==o;e=e.parent)e.scope&&b.unshift(e.scope);b.forEach(e=>v.openNode(e));let y="",x=0,w=0,_=0,S=!1;try{for(m.matcher.considerAll();;){_++,S?S=!1:m.matcher.considerAll(),m.matcher.lastIndex=w;let e=m.matcher.exec(h);if(!e)break;let t=i(h.substring(w,e.index),e);w=e.index+t}return i(h.substring(w)),v.closeAllNodes(),v.finalize(),g=v.toHTML(),{language:l,value:g,relevance:x,illegal:!1,_emitter:v,_top:m}}catch(e){if(e.message&&e.message.includes("Illegal"))return{language:l,value:F(h),illegal:!0,relevance:0,_illegalBy:{message:e.message,index:w,context:h.slice(w-100,w+100),mode:e.mode,resultSoFar:g},_emitter:v};if(M)return{language:l,value:F(h),illegal:!1,relevance:0,errorRaised:e,_emitter:v,_top:m};throw e}}function T(t,e){e=e||D.languages||Object.keys(k);i=t,(s={value:F(i),illegal:!1,relevance:0,_top:a,_emitter:new D.__emitter(D)})._emitter.addText(i);var i=s,s=e.filter(A).filter(d).map(e=>C(e,t,!1)),e=(s.unshift(i),s.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(A(e.language).supersetOf===t.language)return 1;if(A(t.language).supersetOf===e.language)return-1}return 0})),[i,s]=e,e=i;return e.secondBest=s,e}function t(e){var t=(t=>{let e=t.className+" ";e+=t.parentNode?t.parentNode.className:"";var i=D.languageDetectRe.exec(e);if(i){let e=A(i[1]);return e||(O(E.replace("{}",i[1])),O("Falling back to no-highlight mode for this block.",t)),e?i[1]:"no-highlight"}return e.split(/\s+/).find(e=>o(e)||A(e))})(e);if(!o(t)){if(c("before:highlightElement",{el:e,language:t}),0<e.children.length&&(D.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),D.throwUnescapedHTML))throw new U("One of your code blocks includes unescaped HTML.",e.innerHTML);var i=e.textContent,s=t?l(i,{language:t,ignoreIllegals:!0}):T(i),r=(e.innerHTML=s.value,e),a=s.language;t=t&&n[t]||a,r.classList.add("hljs"),r.classList.add("language-"+t),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),c("after:highlightElement",{el:e,result:s,text:i})}}let e=!1;function i(){"loading"!==document.readyState?document.querySelectorAll(D.cssSelector).forEach(t):e=!0}function A(e){return e=(e||"").toLowerCase(),k[e]||k[n[e]]}function h(e,{languageName:t}){(e="string"==typeof e?[e]:e).forEach(e=>{n[e.toLowerCase()]=t})}function d(e){e=A(e);return e&&!e.disableAutodetect}function c(e,t){let i=e;r.forEach(e=>{e[i]&&e[i](t)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",()=>{e&&i()},!1),Object.assign(s,{highlight:l,highlightAuto:T,highlightAll:i,highlightElement:t,highlightBlock:e=>(I("10.7.0","highlightBlock will be removed entirely in v12.0"),I("10.7.0","Please use highlightElement now."),t(e)),configure:e=>{D=B(D,e)},initHighlighting:()=>{i(),I("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{i(),I("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(t,e)=>{let i=null;try{i=e(s)}catch(e){if(R("Language definition for '{}' could not be registered.".replace("{}",t)),!M)throw e;R(e),i=a}i.name||(i.name=t),(k[t]=i).rawDefinition=e.bind(null,s),i.aliases&&h(i.aliases,{languageName:t})},unregisterLanguage:e=>{delete k[e];for(var t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:()=>Object.keys(k),getLanguage:A,registerAliases:h,autoDetection:d,inherit:B,addPlugin:e=>{var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),r.push(e)}}),s.debugMode=()=>{M=!1},s.safeMode=()=>{M=!0},s.versionString="11.7.0",s.regex={concat:v,lookahead:g,either:b,optional:f,anyNumberOfTimes:m};for(let e in P)"object"==typeof P[e]&&u.exports(P[e]);return Object.assign(s,P),s})({});return Y}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs),hljs.registerLanguage("bash",e=>{var t=e.regex,i={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]},t=(Object.assign(i,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]}),{className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,t]},t=(t.contains.push(r),{begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]}),a=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),n={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[a,e.SHEBANG(),n,t,e.HASH_COMMENT_MODE,s,{match:/(\/[a-z._-]+)+/},r,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},i]}}),hljs.registerLanguage("shell",e=>({name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]})),hljs.registerLanguage("plaintext",e=>({name:"Plain text",aliases:["text","txt"],disableAutodetect:!0})),hljs.registerLanguage("json",e=>{var t=["true","false","null"],i={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).timeago={})}(this,function(e){var i=["second","minute","hour","day","week","month","year"],s=["秒","分钟","小时","天","周","个月","年"];function t(e,t){a[e]=t}function r(e){return a[e]||a.en_US}var a={},o=[60,60,24,7,365/7/12,12];function n(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}function l(e,t){for(var i=e<0?1:0,s=e=Math.abs(e),r=0;o[r]<=e&&r<o.length;r++)e/=o[r];return(0==(r*=2)?9:1)<(e=Math.floor(e))&&(r+=1),t(e,r,s)[i].replace("%s",e.toString())}function h(e,t){return((t?n(t):new Date)-n(e))/1e3}var d="timeago-id";function c(e){return parseInt(e.getAttribute(d))}function u(e){clearTimeout(e),delete p[e]}var p={};t("en_US",function(e,t){return 0===t?["just now","right now"]:(t=i[Math.floor(t/2)],1<e&&(t+="s"),[e+" "+t+" ago","in "+e+" "+t])}),t("zh_CN",function(e,t){return 0===t?["刚刚","片刻后"]:[e+" "+(t=s[~~(t/2)])+"前",e+" "+t+"后"]}),e.cancel=function(e){e?u(c(e)):Object.keys(p).forEach(u)},e.format=function(e,t,i){return l(h(e,i&&i.relativeDate),r(t))},e.register=t,e.render=function(e,t,i){e=e.length?e:[e];return e.forEach(function(e){!function e(t,i,s,r){u(c(t));var a=r.relativeDate,n=r.minInterval,a=h(i,a);t.innerText=l(a,s);a=setTimeout(function(){e(t,i,s,r)},Math.min(1e3*Math.max(function(e){for(var t=1,i=0,s=Math.abs(e);o[i]<=e&&i<o.length;i++)e/=o[i],t*=o[i];return s=(s%=t)?t-s:t,Math.ceil(s)}(a),n||1),2147483647));p[a]=0,t.setAttribute(d,a)}(e,e.getAttribute("datetime"),r(t),i||{})}),e},Object.defineProperty(e,"__esModule",{value:!0})}),
|
22
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/libs/turbo.js */
|
23
|
+
/*!
|
24
|
+
Turbo 8.0.5
|
25
|
+
Copyright © 2024 37signals LLC
|
26
|
+
*/
|
27
|
+
function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Turbo={})}(this,function(e){function F(e,t,i){throw new e("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+t+".",i)}"function"!=typeof(it=HTMLFormElement.prototype).requestSubmit&&(it.requestSubmit=function(e){var t,i;e?(i=this,(t=e)instanceof HTMLElement||F(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"!=t.type&&F(TypeError,"The specified element is not a submit button"),t.form!=i&&F(DOMException,"The specified element is not owned by this form element","NotFoundError"),e.click()):((e=document.createElement("input")).type="submit",e.hidden=!0,this.appendChild(e),e.click(),this.removeChild(e))});let B=new WeakMap;function N(e){e="submit"==(e=(e=(e=e.target)instanceof Element?e:e instanceof Node?e.parentElement:null)?e.closest("input, button"):null)?.type?e:null;e&&e.form&&B.set(e.form,e)}!function(){if(!("submitter"in Event.prototype)){let e=window.Event.prototype;if("SubmitEvent"in window){var t=window.SubmitEvent.prototype;if(!/Apple Computer/.test(navigator.vendor)||"submitter"in t)return;e=t}addEventListener("click",N,!0),Object.defineProperty(e,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return B.get(this.target)}})}}();let t={eager:"eager",lazy:"lazy"};class r extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new r.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e?this.delegate.sourceURLChanged():"disabled"==e&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return"lazy"!==(this.getAttribute("loading")||"").toLowerCase()?t.eager:t.lazy}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}}function l(e){return new URL(e.toString(),document.baseURI)}function a(e){return e.hash?e.hash.slice(1):(e=e.href.match(/#(.*)$/))?e[1]:void 0}function H(e,t){return l(t?.getAttribute("formaction")||e.getAttribute("action")||e.action)}function V(e){return(e.pathname.split("/").slice(1).slice(-1)[0].match(/\.[^.]*$/)||[])[0]||""}function $(e,t){t=function(e){return e.endsWith("/")?e:e+"/"}(t.origin+t.pathname);return e.href===l(t).href||e.href.startsWith(t)}function n(e,t){return $(e,t)&&!!V(e).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function z(e){var t=a(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}function i(e){return z(e)}class o{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return 400<=this.statusCode&&this.statusCode<=499}get serverError(){return 500<=this.statusCode&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return l(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function h(e){if("false"==e.getAttribute("data-turbo-eval"))return e;var t,i,s=document.createElement("script"),r=f("csp-nonce"),a=(r&&(s.nonce=r),s.textContent=e.textContent,s.async=!1,s);for({name:t,value:i}of e.attributes)a.setAttribute(t,i);return s}function s(e,{target:t,cancelable:i,detail:s}={}){e=new CustomEvent(e,{cancelable:i,bubbles:!0,composed:!0,detail:s});return(t&&t.isConnected?t:document.documentElement).dispatchEvent(e),e}function d(){return("hidden"===document.visibilityState?W:j)()}function j(){return new Promise(e=>requestAnimationFrame(()=>e()))}function W(){return new Promise(e=>setTimeout(()=>e(),0))}function q(e=""){return(new DOMParser).parseFromString(e,"text/html")}function U(e,...t){s=t;var s,t=e.reduce((e,t,i)=>{return e+t+(null==s[i]?"":s[i])},"").replace(/^\n/,"").split("\n"),e=t[0].match(/^\s+/);let i=e?e[0].length:0;return t.map(e=>e.slice(i)).join("\n")}function u(){return Array.from({length:36}).map((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":(19==t?Math.floor(4*Math.random())+8:Math.floor(15*Math.random())).toString(16)).join("")}function c(t,...e){for(var i of e.map(e=>e?.getAttribute(t)))if("string"==typeof i)return i;return null}function p(...e){for(var t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function g(...e){for(var t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function Y(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function m(...e){var t,e=c("data-turbo-action",...e);return"advance"==(t=e)||"replace"==t||"restore"==t?e:null}function K(e){return document.querySelector(`meta[name="${e}"]`)}function f(e){e=K(e);return e&&e.content}function v(e,t){if(e instanceof Element)return e.closest(t)||v(e.assignedSlot||e.getRootNode()?.host,t)}function X(e){return!!e&&null==e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")&&"function"==typeof e.focus}function G(e){return Array.from(e.querySelectorAll("[autofocus]")).find(X)}function J(e){if("_blank"===e)return!1;if(e)for(var t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}function Z(e){return v(e,"a[href]:not([target^=_]):not([download])")}function Q(e){return l(e.getAttribute("href")||"")}class ee extends Set{constructor(e){super(),this.maxSize=e}add(e){var t;this.size>=this.maxSize&&(t=this.values().next().value,this.delete(t)),super.add(e)}}let te=new ee(20),ie=window.fetch;function se(e,t={}){var i=new Headers(t.headers||{}),s=u();return te.add(s),i.append("X-Turbo-Request-Id",s),ie(e,{...t,headers:i})}function b(e){switch(e.toLowerCase()){case"get":return y.get;case"post":return y.post;case"put":return y.put;case"patch":return y.patch;case"delete":return y.delete}}let y={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function re(e){switch(e.toLowerCase()){case x.multipart:return x.multipart;case x.plain:return x.plain;default:return x.urlEncoded}}let x={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class w{abortController=new AbortController;#resolveRequestPromise=e=>{};constructor(e,t,i,s=new URLSearchParams,r=null,a=x.urlEncoded){var[i,s]=ae(l(i),t,s,a);this.delegate=e,this.url=i,this.target=r,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:s,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=a}get method(){return this.fetchOptions.method}set method(e){var t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,e=b(e)||y.get,[t,i]=(this.url.search="",ae(this.url,e,t,this.enctype));this.url=t,this.fetchOptions.body=i,this.fetchOptions.method=e.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){var e=this.fetchOptions,t=(this.delegate.prepareRequest(this),await this.#allowRequestToBeIntercepted(e));try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=se(this.url.href,e);var i=await this.response;return await this.receive(i)}catch(e){if("AbortError"!==e.name)throw this.#willDelegateErrorHandling(e)&&this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){e=new o(e);return s("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:e},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,e):e.succeeded?this.delegate.requestSucceededWithResponse(this,e):this.delegate.requestFailedWithResponse(this,e),e}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return _(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#allowRequestToBeIntercepted(e){var t=new Promise(e=>this.#resolveRequestPromise=e),e=s("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#resolveRequestPromise},target:this.target});return this.url=e.detail.url,e.defaultPrevented&&await t,e}#willDelegateErrorHandling(e){return!s("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}function _(e){return b(e)==y.get}function ae(e,t,i,s){var r=0<Array.from(i).length?new URLSearchParams(ne(i)):e.searchParams;return _(t)?[function(e,t){t=new URLSearchParams(ne(t));return e.search=t.toString(),e}(e,r),null]:s==x.urlEncoded?[e,r]:[e,i]}function ne(e){var t,i,s=[];for([t,i]of e)i instanceof File||s.push([t,i]);return s}class oe{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}}class S{static contentType="text/vnd.turbo-stream.html";static wrap(e){return"string"==typeof e?new this((t=e,(i=document.createElement("template")).innerHTML=t,i.content)):e;var t,i}constructor(e){this.fragment=function(e){for(var t of e.querySelectorAll("turbo-stream")){var i,s=document.importNode(t,!0);for(i of s.templateElement.content.querySelectorAll("script"))i.replaceWith(h(i));t.replaceWith(s)}return e}(e)}}let k=new class{#prefetchTimeout=null;#prefetched=null;get(e){if(this.#prefetched&&this.#prefetched.url===e&&this.#prefetched.expire>Date.now())return this.#prefetched.request}setLater(e,t,i){this.clear(),this.#prefetchTimeout=setTimeout(()=>{t.perform(),this.set(e,t,i),this.#prefetchTimeout=null},100)}set(e,t,i){this.#prefetched={url:e,request:t,expire:new Date((new Date).getTime()+i)}}clear(){this.#prefetchTimeout&&clearTimeout(this.#prefetchTimeout),this.#prefetched=null}},M={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class E{state=M.initialized;static confirmMethod(e,t,i){return Promise.resolve(confirm(e))}constructor(e,t,i,s=!1){var r=function(e,t){t=t?.getAttribute("formmethod")||e.getAttribute("method")||"";return b(t.toLowerCase())||y.get}(t,i),a=function(e,t){e=l(e);_(t)&&(e.search="");return e}((a=i,o="string"==typeof(n=t).action?n.action:null,a?.hasAttribute("formaction")?a.getAttribute("formaction")||"":n.getAttribute("action")||o||""),r),n=function(e,t){var e=new FormData(e),i=t?.getAttribute("name"),t=t?.getAttribute("value");i&&e.append(i,t||"");return e}(t,i),o=(o=t,re(i?.getAttribute("formenctype")||o.enctype));this.delegate=e,this.formElement=t,this.submitter=i,this.fetchRequest=new w(this,r,a,n,t,o),this.mustRedirect=s}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=l(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){var{initialized:e,requesting:t}=M,i=c("data-turbo-confirm",this.submitter,this.formElement);if("string"==typeof i&&!await E.confirmMethod(i,this.formElement,this.submitter))return;if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){var{stopping:e,stopped:t}=M;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){var t;e.isSafe||(t=function(t){{var e;return null!=t&&(e=(document.cookie?document.cookie.split("; "):[]).find(e=>e.startsWith(t)))&&(e=e.split("=").slice(1).join("="))?decodeURIComponent(e):void 0}}(f("csrf-param"))||f("csrf-token"))&&(e.headers["X-CSRF-Token"]=t),this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(S.contentType)}requestStarted(e){this.state=M.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),p(this.formElement),s("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){k.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){t.clientError||t.serverError?this.delegate.formSubmissionFailedWithResponse(this,t):(k.clear(),this.requestMustRedirect(e)&&200==(e=t).statusCode&&!e.redirected?(e=new Error("Form responses must redirect to another location"),this.delegate.formSubmissionErrored(this,e)):(this.state=M.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)))}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=M.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),g(this.formElement),s("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){var e;this.submitter&&this.submitsWith&&(this.submitter.matches("button")?(this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith):this.submitter.matches("input")&&(e=this.submitter,this.originalSubmitText=e.value,e.value=this.submitsWith))}resetSubmitterText(){this.submitter&&this.originalSubmitText&&(this.submitter.matches("button")?this.submitter.innerHTML=this.originalSubmitText:this.submitter.matches("input")&&(this.submitter.value=this.originalSubmitText))}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||(t="data-turbo-stream",[this.submitter,this.formElement].some(e=>e&&e.hasAttribute(t)));var t}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}class D{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return G(this.element)}get permanentElements(){return he(this.element)}getPermanentElementById(e){return le(this.element,e)}getPermanentElementMapForSnapshot(e){var t,i={};for(t of this.permanentElements){var s=t.id,r=e.getPermanentElementById(s);r&&(i[s]=[t,r])}return i}}function le(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function he(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class de{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{var t,i;e.defaultPrevented||(t=e.target instanceof HTMLFormElement?e.target:void 0,i=e.submitter||void 0,t&&function(e,t){t=t?.getAttribute("formmethod")||e.getAttribute("method");return"dialog"!=t}(t,i)&&function(e,t){t=t?.getAttribute("formtarget")||e.getAttribute("target");return J(t)}(t,i)&&this.delegate.willSubmitForm(t,i)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,i)))}}class ce{#resolveRenderPromise=e=>{};#resolveInterceptionPromise=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){e=this.snapshot.getElementForAnchor(e);e?(this.scrollToElement(e),this.focusElement(e)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(a(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){var{isPreview:t,shouldRender:i,willRender:s,newSnapshot:r}=e;if(i)try{this.renderPromise=new Promise(e=>this.#resolveRenderPromise=e),this.renderer=e,await this.prepareToRenderSnapshot(e);var a=new Promise(e=>this.#resolveInterceptionPromise=e),n={resume:this.#resolveInterceptionPromise,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(r,n)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(r,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#resolveRenderPromise(void 0),delete this.renderPromise}else s&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class ue extends ce{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new D(this.element)}}class pe{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){e=e.composed?e.target?.parentElement:e.target,e=Z(e)||e;return e instanceof Element&&e.closest("turbo-frame, html")==this.element}}class ge{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{var t,i;e instanceof MouseEvent&&this.clickEventIsSignificant(e)&&(t=Z(e.composedPath&&e.composedPath()[0]||e.target))&&J(t.target)&&(i=Q(t),this.delegate.willFollowLinkToLocation(t,i,e))&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,i))};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||1<e.which||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class me{constructor(e,t){this.delegate=e,this.linkInterceptor=new ge(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,i){return this.delegate.willSubmitFormLinkToLocation(e,t,i)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let i=document.createElement("form");var s,r;for([s,r]of t.searchParams)i.append(Object.assign(document.createElement("input"),{type:"hidden",name:s,value:r}));var a=Object.assign(t,{search:""}),a=(i.setAttribute("data-turbo","true"),i.setAttribute("action",a.href),i.setAttribute("hidden",""),e.getAttribute("data-turbo-method")),a=(a&&i.setAttribute("method",a),e.getAttribute("data-turbo-frame")),a=(a&&i.setAttribute("data-turbo-frame",a),m(e)),a=(a&&i.setAttribute("data-turbo-action",a),e.getAttribute("data-turbo-confirm")),a=(a&&i.setAttribute("data-turbo-confirm",a),e.hasAttribute("data-turbo-stream"));a&&i.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,i),document.body.appendChild(i),i.addEventListener("turbo:submit-end",()=>i.remove(),{once:!0}),requestAnimationFrame(()=>i.requestSubmit())}}class fe{static async preservingPermanentElements(e,t,i){e=new this(e,t);e.enter(),await i(),e.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(var e in this.permanentElementMap){var[e,t]=this.permanentElementMap[e];this.delegate.enteringBardo(e,t),this.replaceNewPermanentElementWithPlaceholder(t)}}leave(){for(var e in this.permanentElementMap){var[e]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(e),this.replacePlaceholderWithPermanentElement(e),this.delegate.leavingBardo(e)}}replaceNewPermanentElementWithPlaceholder(e){i=e,(t=document.createElement("meta")).setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",i.id);var t,i=t;e.replaceWith(i)}replaceCurrentPermanentElementWithClone(e){var t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(t){return this.placeholders.find(e=>e.content==t)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class ve{#activeElement=null;constructor(e,t,i,s,r=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=r,this.renderElement=i,this.promise=new Promise((e,t)=>this.resolvingFunctions={resolve:e,reject:t})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await fe.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){var e;this.shouldAutofocus&&(e=this.connectedSnapshot.firstAutofocusableElement)&&e.focus()}enteringBardo(e){this.#activeElement||e.contains(this.currentSnapshot.activeElement)&&(this.#activeElement=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#activeElement)&&this.#activeElement instanceof HTMLElement&&(this.#activeElement.focus(),this.#activeElement=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}class C extends ve{static renderElement(e,t){var i=document.createRange(),i=(i.selectNodeContents(e),i.deleteContents(),t),t=i.ownerDocument?.createRange();t&&(t.selectNodeContents(i),e.appendChild(t.extractContents()))}constructor(e,t,i,s,r,a=!0){super(t,i,s,r,a),this.delegate=e}get shouldRender(){return!0}async render(){await d(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await d(),this.focusFirstAutofocusableElement(),await d(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){var e=this.currentElement.firstElementChild,t=(t=this.currentElement.getAttribute("data-autoscroll-block"),(i="end")==t||"start"==t||"center"==t||"nearest"==t?t:i),i=(i=this.currentElement.getAttribute("data-autoscroll-behavior"),(s="auto")==i||"smooth"==i?i:s);if(e)return e.scrollIntoView({block:t,behavior:i}),!0}var s,t,i;return!1}activateScriptElements(){for(var e of this.newScriptElements){var t=h(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}class T{static animationDuration=300;static get defaultCSS(){return U`
|
28
|
+
.turbo-progress-bar {
|
29
|
+
position: fixed;
|
30
|
+
display: block;
|
31
|
+
top: 0;
|
32
|
+
left: 0;
|
33
|
+
height: 3px;
|
34
|
+
background: #0076ff;
|
35
|
+
z-index: 2147483647;
|
36
|
+
transition:
|
37
|
+
width ${T.animationDuration}ms ease-out,
|
38
|
+
opacity ${T.animationDuration/2}ms ${T.animationDuration/2}ms ease-in;
|
39
|
+
transform: translate3d(0, 0, 0);
|
40
|
+
}
|
41
|
+
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*T.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,T.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=10+90*this.value+"%"})}createStylesheetElement(){var e=document.createElement("style");return e.type="text/css",e.textContent=T.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){var e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return f("csp-nonce")}}class be extends D{detailsByOuterHTML=this.children.filter(e=>{return!("noscript"==e.localName)}).map(e=>{return e.hasAttribute("nonce")&&e.setAttribute("nonce",""),e}).reduce((e,t)=>{var i=t.outerHTML,s=i in e?e[i]:{type:function(e){e=e.localName;return"script"==e}(s=t)?"script":function(e){var t=e.localName;return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(s)?"stylesheet":void 0,tracked:"reload"==t.getAttribute("data-turbo-track"),elements:[]};return{...e,[i]:{...s,elements:[...s.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(t,i){return Object.keys(this.detailsByOuterHTML).filter(e=>!(e in i.detailsByOuterHTML)).map(e=>this.detailsByOuterHTML[e]).filter(({type:e})=>e==t).map(({elements:[e]})=>e)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{var{type:t,tracked:i,elements:s}=this.detailsByOuterHTML[t];return null!=t||i?1<s.length?[...e,...s.slice(1)]:e:[...e,...s]},[])}getMetaValue(e){e=this.findMetaElementByName(e);return e?e.getAttribute("content"):null}findMetaElementByName(r){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{var i,s,[t]=this.detailsByOuterHTML[t].elements;return s=r,"meta"==(i=t).localName&&i.getAttribute("name")==s?t:e},0)}}class A extends D{static fromHTMLString(e=""){return this.fromDocument(q(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:i}){return new this(e,t,new be(i))}constructor(e,t,i){super(t),this.documentElement=e,this.headSnapshot=i}clone(){var e,t,i,s=this.element.cloneNode(!0),r=this.element.querySelectorAll("select"),a=s.querySelectorAll("select");for([e,t]of r.entries()){var n,o,l=a[e];for(n of l.selectedOptions)n.selected=!1;for(o of t.selectedOptions)l.options[o.index].selected=!0}for(i of s.querySelectorAll('input[type="password"]'))i.value="";return new A(this.documentElement,s,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){return l(this.getSetting("root")??"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}get prefersViewTransitions(){return"same-origin"===this.headSnapshot.getMetaValue("view-transition")}get shouldMorphPage(){return"morph"===this.getSetting("refresh-method")}get shouldPreserveScrollPosition(){return"preserve"===this.getSetting("refresh-scroll")}getSetting(e){return this.headSnapshot.getMetaValue("turbo-"+e)}}class ye{#viewTransitionStarted=!1;#lastOperation=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#viewTransitionStarted?(this.#viewTransitionStarted=!0,this.#lastOperation=this.#lastOperation.then(async()=>{await document.startViewTransition(t).finished})):this.#lastOperation=this.#lastOperation.then(t),this.#lastOperation}get viewTransitionsAvailable(){return document.startViewTransition}}let xe={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},L={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},P={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},R={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},we={advance:"forward",restore:"back",replace:"none"};class _e{identifier=u();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=P.initialized;viewTransitioner=new ye;constructor(e,t,i,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=i||u();var{action:e,historyChanged:t,referrer:i,snapshot:s,snapshotHTML:r,response:a,visitCachedSnapshot:n,willRender:o,updateHistory:l,shouldCacheSnapshot:h,acceptsStreamResponse:d,direction:c}={...xe,...s};this.action=e,this.historyChanged=t,this.referrer=i,this.snapshot=s,this.snapshotHTML=r,this.response=a,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=n,this.willRender=o,this.updateHistory=l,this.scrolled=!o,this.shouldCacheSnapshot=h,this.acceptsStreamResponse=d,this.direction=c||we[e]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==P.initialized&&(this.recordTimingMetric(L.visitStart),this.state=P.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==P.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=P.canceled)}complete(){this.state==P.started&&(this.recordTimingMetric(L.visitEnd),this.adapter.visitCompleted(this),this.state=P.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==P.started&&(this.state=P.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){var e;!this.historyChanged&&this.updateHistory&&(e=Y(this.location.href===this.referrer?.href?"replace":this.action),this.history.update(e,this.location,this.restorationIdentifier),this.historyChanged=!0)}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new w(this,y.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(L.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){(this.response=e)&&(e=e.statusCode,Se(e)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,e))}finishRequest(){this.recordTimingMetric(L.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:t,responseHTML:i}=this.response;this.render(async()=>{var e;this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Se(t)&&null!=i?(e=A.fromHTMLString(i),await this.renderPageSnapshot(e,!1),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(A.fromHTMLString(i),this),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){var e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!a(this.location)||e.hasAnchor(a(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return A.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){let t=this.getCachedSnapshot();if(t){let e=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(t,e),this.adapter.visitRendered(this),e||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(S.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){var i=await t.responseHTML,{redirected:s,statusCode:r}=t;null==i?this.recordResponse({statusCode:R.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:r,responseHTML:i,redirected:s}))}async requestFailedWithResponse(e,t){var i=await t.responseHTML,{redirected:t,statusCode:s}=t;null==i?this.recordResponse({statusCode:R.contentTypeMismatch,redirected:t}):this.recordResponse({statusCode:s,responseHTML:i,redirected:t})}requestErrored(e,t){this.recordResponse({statusCode:R.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||this.view.forceReloaded||this.view.shouldPreserveScrollPosition(this)||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){var e=this.restorationData.scrollPosition;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){var e=a(this.location);if(null!=e)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=(new Date).getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return!this.isSamePage&&("restore"==this.action?!this.hasCachedSnapshot():this.willRender)}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await d(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function Se(e){return 200<=e&&e<300}class ke{progressBar=new T;constructor(e){this.session=e}visitProposedToLocation(e,t){n(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||u(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case R.networkFailure:case R.timeoutFailure:case R.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){s("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}}class Me{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(var t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){var e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}}class Ee{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new pe(this,t),this.formSubmitObserver=new de(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,i){return this.#shouldRedirect(e)}linkClickIntercepted(e,t,i){var s=this.#findFrameElement(e);s&&s.delegate.linkClickIntercepted(e,t,i)}willSubmitForm(e,t){return null==e.closest("turbo-frame")&&this.#shouldSubmit(e,t)&&this.#shouldRedirect(e,t)}formSubmitted(e,t){var i=this.#findFrameElement(e,t);i&&i.delegate.formSubmitted(e,t)}#shouldSubmit(e,t){var i=H(e,t),s=l(this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/");return this.#shouldRedirect(e,t)&&n(i,s)}#shouldRedirect(e,t){return!!(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e))&&!!(t=this.#findFrameElement(e,t))&&t!=e.closest("turbo-frame")}#findFrameElement(e,t){t=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(t&&"_top"!=t){e=this.element.querySelector(`#${t}:not([disabled])`);if(e instanceof r)return e}}}class De{location;restorationIdentifier=u();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,i=u()){e===history.pushState&&++this.currentIndex;var s={turbo:{restorationIdentifier:i,restorationIndex:this.currentIndex}};e.call(history,s,"",t.href),this.location=t,this.restorationIdentifier=i}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){var t=this.restorationIdentifier,i=this.restorationData[t];this.restorationData[t]={...i,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{var t,i;this.shouldHandlePopState()&&(e=(e.state||{}).turbo,e)&&(this.location=new URL(window.location.href),{restorationIdentifier:e,restorationIndex:t}=e,this.restorationIdentifier=e,i=t>this.currentIndex?"forward":"back",this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,e,i),this.currentIndex=t)};onPageLoad=async e=>{await Promise.resolve(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class Ce{started=!1;#prefetchedLink=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||("loading"===this.eventTarget.readyState?this.eventTarget.addEventListener("DOMContentLoaded",this.#enable,{once:!0}):this.#enable())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#tryToPrefetchRequest,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#cancelRequestIfObsolete,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#tryToUsePrefetchedRequest,!0),this.started=!1)}#enable=()=>{this.eventTarget.addEventListener("mouseenter",this.#tryToPrefetchRequest,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#cancelRequestIfObsolete,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#tryToUsePrefetchedRequest,!0),this.started=!0};#tryToPrefetchRequest=e=>{var t,i;"false"!==f("turbo-prefetch")&&(e=e.target).matches&&e.matches("a[href]:not([target^=_]):not([download])")&&this.#isPrefetchable(e)&&(t=Q(i=e),this.delegate.canPrefetchRequestToLocation(i,t))&&(this.#prefetchedLink=i,i=new w(this,y.get,t,new URLSearchParams,e),k.setLater(t.toString(),i,this.#cacheTtl))};#cancelRequestIfObsolete=e=>{e.target===this.#prefetchedLink&&this.#cancelPrefetchRequest()};#cancelPrefetchRequest=()=>{k.clear(),this.#prefetchedLink=null};#tryToUsePrefetchedRequest=e=>{var t;"FORM"!==e.target.tagName&&"GET"===e.detail.fetchOptions.method&&((t=k.get(e.detail.url.toString()))&&(e.detail.fetchRequest=t),k.clear())};prepareRequest(e){var t=e.target,i=(e.headers["X-Sec-Purpose"]="prefetch",t.closest("turbo-frame")),t=t.getAttribute("data-turbo-frame")||i?.getAttribute("target")||i?.id;t&&"_top"!==t&&(e.headers["Turbo-Frame"]=t)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#cacheTtl(){return Number(f("turbo-prefetch-cache-time"))||1e4}#isPrefetchable(e){return!!e.getAttribute("href")&&!Te(e)&&!(Ae(e)||Le(e)||Pe(e)||Oe(e))}}let Te=e=>e.origin!==document.location.origin||!["http:","https:"].includes(e.protocol)||e.hasAttribute("target"),Ae=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith("#"),Le=e=>{return"false"===e.getAttribute("data-turbo-prefetch")||"false"===e.getAttribute("data-turbo")||!(!(e=v(e,"[data-turbo-prefetch]"))||"false"!==e.getAttribute("data-turbo-prefetch"))},Pe=e=>{var t=e.getAttribute("data-turbo-method");return!!(t&&"get"!==t.toLowerCase()||Re(e)||e.hasAttribute("data-turbo-confirm")||e.hasAttribute("data-turbo-stream"))},Re=e=>e.hasAttribute("data-remote")||e.hasAttribute("data-behavior")||e.hasAttribute("data-confirm")||e.hasAttribute("data-method"),Oe=e=>{return s("turbo:before-prefetch",{target:e,cancelable:!0}).defaultPrevented};class Ie{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,i={}){this.stop(),this.currentVisit=new _e(this,l(e),t,{referrer:this.location,...i}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new E(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){var i,s,r,a;e==this.formSubmission&&(i=await t.responseHTML)&&({statusCode:r,redirected:a}=((s=e.isSafe)||this.view.clearSnapshotCache(),t),e=this.#getActionForFormSubmission(e,t),this.proposeVisit(t.location,{action:e,shouldCacheSnapshot:s,response:{statusCode:r,responseHTML:i,redirected:a}}))}async formSubmissionFailedWithResponse(e,t){var i=await t.responseHTML;i&&(i=A.fromHTMLString(i),t.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache())}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){var i=a(e),s=a(this.view.lastRenderedLocation),r="restore"===t&&void 0===i;return"replace"!==t&&z(e)===z(this.view.lastRenderedLocation)&&(r||null!=i&&i!==s)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#getActionForFormSubmission(e,t){var{submitter:e,formElement:i}=e;return m(e,i)||this.#getDefaultAction(t)}#getDefaultAction(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}}let O={initial:0,loading:1,interactive:2,complete:3};class Fe{stage=O.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==O.initial&&(this.stage=O.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{var e=this.readyState;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()};pageIsInteractive(){this.stage==O.loading&&(this.stage=O.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==O.interactive&&(this.stage=O.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}}class Be{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}}class Ne{render({fragment:e}){fe.preservingPermanentElements(this,function(e){var t=he(document.documentElement),i={};for(var s of t){var r,a=s.id;for(r of e.querySelectorAll("turbo-stream")){var n=le(r.templateElement.content,a);n&&(i[a]=[s,n])}}return i}(e),()=>{!async function(e,t){let i="turbo-stream-autofocus-"+u(),s=e.querySelectorAll("turbo-stream"),r=function(e){for(var t of e){t=G(t.templateElement.content);if(t)return t}return null}(s),a=null;r&&(a=r.id||i,r.id=a);t(),await d();e=null==document.activeElement||document.activeElement==document.body;e&&a&&(X(t=document.getElementById(a))&&t.focus(),t)&&t.id==i&&t.removeAttribute("id")}(e,()=>{!async function(e){var[e,t]=await async function(e,t){var i=t(),e=(e(),await j(),t());return[i,e]}(e,()=>document.activeElement),e=e&&e.id;e&&X(e=document.getElementById(e))&&e!=t&&e.focus()}(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}class He{sources=new Set;#started=!1;constructor(e){this.delegate=e}start(){this.#started||(this.#started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#started&&(this.#started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{var t=function(e){e=e.detail?.fetchResponse;if(e instanceof o)return e}(e);t&&function(e){e=e.contentType??"";return e.startsWith(S.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#started&&"string"==typeof e.data&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){e=await e.responseHTML;e&&this.receiveMessageHTML(e)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(S.wrap(e))}}class Ve extends ve{static renderElement(e,t){var{documentElement:i,body:s}=document;i.replaceChild(t,s)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){var{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(var e of this.scriptElements){var t,i=e.parentNode;i&&(t=h(e),i.replaceChild(t,e))}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}var $e=function(){let n=new Set,a={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:"merge",shouldPreserve:function(e){return"true"===e.getAttribute("im-preserve")},shouldReAppend:function(e){return"true"===e.getAttribute("im-re-append")},shouldRemove:e,afterHeadMorphed:e}};function g(e,t){return t.ignoreActiveValue&&e===document.activeElement&&e!==document.body}function l(e,t,i){if(!i.ignoreActive||e!==document.activeElement){if(null==t)return!1===i.callbacks.beforeNodeRemoved(e)?e:(e.remove(),i.callbacks.afterNodeRemoved(e),null);if(y(e,t)){if(!1!==i.callbacks.beforeNodeMorphed(e,t)){if(!(e instanceof HTMLHeadElement&&i.head.ignore))if(e instanceof HTMLHeadElement&&"morph"!==i.head.style)b(t,e,i);else{var s,r,a=t,n=e,o=i,l=a.nodeType;if(1===l){var h,d=n.attributes;for(h of a.attributes)f(h.name,n,"update",o)||n.getAttribute(h.name)!==h.value&&n.setAttribute(h.name,h.value);for(let e=d.length-1;0<=e;e--){var c=d[e];f(c.name,n,"remove",o)||a.hasAttribute(c.name)||n.removeAttribute(c.name)}}if(8!==l&&3!==l||n.nodeValue!==a.nodeValue&&(n.nodeValue=a.nodeValue),!g(n,o)){l=a;var u=n;var p=o;l instanceof HTMLInputElement&&u instanceof HTMLInputElement&&"file"!==l.type?(r=l.value,s=u.value,v(l,u,"checked",p),v(l,u,"disabled",p),l.hasAttribute("value")?r===s||f("value",u,"update",p)||(u.setAttribute("value",r),u.value=r):f("value",u,"remove",p)||(u.value="",u.removeAttribute("value"))):l instanceof HTMLOptionElement?v(l,u,"selected",p):l instanceof HTMLTextAreaElement&&u instanceof HTMLTextAreaElement&&(s=l.value,r=u.value,f("value",u,"update",p)||(s!==r&&(u.value=s),u.firstChild&&u.firstChild.nodeValue!==s&&(u.firstChild.nodeValue=s)))}g(e,i)||m(t,e,i)}i.callbacks.afterNodeMorphed(e,t)}return e}return!1===i.callbacks.beforeNodeRemoved(e)||!1===i.callbacks.beforeNodeAdded(t)?e:(e.parentElement.replaceChild(t,e),i.callbacks.afterNodeAdded(t),i.callbacks.afterNodeRemoved(e),t)}}function m(e,t,i){let s=e.firstChild,r=t.firstChild;for(var a;s;){if(s=(a=s).nextSibling,null==r){if(!1===i.callbacks.beforeNodeAdded(a))return;t.appendChild(a),i.callbacks.afterNodeAdded(a)}else if(h(a,r,i))l(r,a,i),r=r.nextSibling;else{var n=function(i,e,s,r,a){var n=x(a,s,e);if(0<n){let e=r,t=0;for(;null!=e;){if(h(s,e,a))return e;if((t+=x(a,e,i))>n)return null;e=e.nextSibling}}return null}(e,t,a,r,i);if(n)r=d(r,n,i),l(n,a,i);else{n=function(e,t,i,s){let r=i,a=t.nextSibling,n=0;for(;null!=r;){if(0<x(s,r,e))return null;if(y(t,r))return r;if(y(a,r)&&(n++,a=a.nextSibling,2<=n))return null;r=r.nextSibling}return r}(e,a,r,i);if(n)r=d(r,n,i),l(n,a,i);else{if(!1===i.callbacks.beforeNodeAdded(a))return;t.insertBefore(a,r),i.callbacks.afterNodeAdded(a)}}}p(i,a)}for(;null!==r;){var o=r;r=r.nextSibling,u(o,i)}}function f(e,t,i,s){return!("value"!==e||!s.ignoreActiveValue||t!==document.activeElement)||!1===s.callbacks.beforeAttributeUpdated(e,t,i)}function v(e,t,i,s){var r;e[i]!==t[i]&&((r=f(i,t,"update",s))||(t[i]=e[i]),e[i]?r||t.setAttribute(i,e[i]):f(i,t,"remove",s)||t.removeAttribute(i))}function b(e,t,i){var s,r,a=[],n=[],o=[],l=[],h=i.head.style,d=new Map;for(s of e.children)d.set(s.outerHTML,s);for(r of t.children){var c=d.has(r.outerHTML),u=i.head.shouldReAppend(r),p=i.head.shouldPreserve(r);c||p?(u?n:(d.delete(r.outerHTML),o)).push(r):"append"===h?u&&(n.push(r),l.push(r)):!1!==i.head.shouldRemove(r)&&n.push(r)}l.push(...d.values());var g,m,f=[];for(g of l){var v=document.createRange().createContextualFragment(g.outerHTML).firstChild;if(!1!==i.callbacks.beforeNodeAdded(v)){if(v.href||v.src){let t=null;var b=new Promise(function(e){t=e});v.addEventListener("load",function(){t()}),f.push(b)}t.appendChild(v),i.callbacks.afterNodeAdded(v),a.push(v)}}for(m of n)!1!==i.callbacks.beforeNodeRemoved(m)&&(t.removeChild(m),i.callbacks.afterNodeRemoved(m));return i.head.afterHeadMorphed(t,{added:a,kept:o,removed:n}),f}function e(){}function h(e,t,i){return null!=e&&null!=t&&e.nodeType===t.nodeType&&e.tagName===t.tagName&&(""!==e.id&&e.id===t.id||0<x(i,e,t))}function y(e,t){return null!=e&&null!=t&&e.nodeType===t.nodeType&&e.tagName===t.tagName}function d(e,t,i){for(;e!==t;){var s=e;e=e.nextSibling,u(s,i)}return p(i,t),t.nextSibling}function o(e,t,i){for(var s=[],r=[];null!=e;)s.push(e),e=e.previousSibling;for(;0<s.length;){var a=s.pop();r.push(a),t.parentElement.insertBefore(a,t)}for(r.push(t);null!=i;)s.push(i),r.push(i),i=i.nextSibling;for(;0<s.length;)t.parentElement.insertBefore(s.pop(),t.nextSibling);return r}function c(e,t,i){let s,r=s=e.firstChild,a=0;for(;s;){var n=function(e,t,i){if(y(e,t))return.5+x(i,e,t);return 0}(s,t,i);n>a&&(r=s,a=n),s=s.nextSibling}return r}function u(e,t){p(t,e),!1!==t.callbacks.beforeNodeRemoved(e)&&(e.remove(),t.callbacks.afterNodeRemoved(e))}function p(e,t){var i;for(i of e.idMap.get(t)||n)e.deadIds.add(i)}function x(e,t,i){var s,r;let a=0;for(s of e.idMap.get(t)||n)r=s,!e.deadIds.has(r)&&(r=s,(e.idMap.get(i)||n).has(r))&&++a;return a}function w(e,i){var s,r=e.parentElement;for(s of e.querySelectorAll("[id]")){let t=s;for(;t!==r&&null!=t;){let e=i.get(t);null==e&&(e=new Set,i.set(t,e)),e.add(s.id),t=t.parentElement}}}return{morph:function(e,t,i={}){e instanceof Document&&(e=e.documentElement);var s,r,t=function(e){{var t;if(null==e)return document.createElement("div");if(e.generatedByIdiomorph)return e;if(e instanceof Node)return(t=document.createElement("div")).append(e),t;var i,s=document.createElement("div");for(i of[...e])s.append(i);return s}}(t="string"==typeof t?function(e){var t=new DOMParser,i=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");{var s;return i.match(/<\/html>/)||i.match(/<\/head>/)||i.match(/<\/body>/)?(s=t.parseFromString(e,"text/html"),i.match(/<\/html>/)?(s.generatedByIdiomorph=!0,s):(i=s.firstChild)?(i.generatedByIdiomorph=!0,i):null):((s=t.parseFromString("<body><template>"+e+"</template></body>","text/html").body.querySelector("template").content).generatedByIdiomorph=!0,s)}}(t):t);return s=e,r=t,i=function(e){var t={};return Object.assign(t,a),Object.assign(t,e),t.callbacks={},Object.assign(t.callbacks,a.callbacks),Object.assign(t.callbacks,e.callbacks),t.head={},Object.assign(t.head,a.head),Object.assign(t.head,e.head),t}(i=i),function s(r,a,n){if(n.head.block){let t=r.querySelector("head"),i=a.querySelector("head");if(t&&i){let e=b(i,t,n);return void Promise.all(e).then(function(){s(r,a,Object.assign(n,{head:{block:!1,ignore:!0}}))})}}{if("innerHTML"===n.morphStyle)return m(a,r,n),r.children;if("outerHTML"!==n.morphStyle&&null!=n.morphStyle)throw"Do not understand how to morph style "+n.morphStyle;{let e=c(a,r,n),t=e?.previousSibling,i=e?.nextSibling,s=l(r,e,n);return e?o(t,s,i):[]}}}(e,t,{target:s,newContent:r,config:i,morphStyle:i.morphStyle,ignoreActive:i.ignoreActive,ignoreActiveValue:i.ignoreActiveValue,idMap:function(e,t){var i=new Map;return w(e,i),w(t,i),i}(s,r),deadIds:new Set,callbacks:i.callbacks,head:i.head})},defaults:a}}();function ze(e,t,{callbacks:i,...s}={}){$e.morph(e,t,{...s,callbacks:new We(i)})}function je(e,t){ze(e,t.children,{morphStyle:"innerHTML"})}class We{#beforeNodeMorphed;constructor({beforeNodeMorphed:e}={}){this.#beforeNodeMorphed=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element)return!(e.hasAttribute("data-turbo-permanent")||!this.#beforeNodeMorphed(e,t)||s("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented)};beforeAttributeUpdated=(e,t,i)=>{return!s("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:i}}).defaultPrevented};beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&s("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}}class qe extends C{static renderElement(e,t){s("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),je(e,t)}}class Ue extends ve{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){return this.newSnapshot.isVisitable?this.trackedElementsAreIdentical?void 0:{reason:"tracked_element_mismatch"}:{reason:"turbo_visit_control_is_reload"}}async prepareToRender(){this.#setLanguage(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#setLanguage(){var e=this.currentSnapshot.documentElement,t=this.newSnapshot.lang;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){var e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){var e,t=[];for(e of this.newHeadStylesheetElements)t.push(function(i,s=2e3){return new Promise(e=>{let t=()=>{i.removeEventListener("error",t),i.removeEventListener("load",t),e()};i.addEventListener("load",t,{once:!0}),i.addEventListener("error",t,{once:!0}),setTimeout(e,s)})}(e)),document.head.appendChild(e);await Promise.all(t)}copyNewHeadScriptElements(){for(var e of this.newHeadScriptElements)document.head.appendChild(h(e))}removeUnusedDynamicStylesheetElements(){for(var e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){var e,t,i=[...this.newHeadProvisionalElements];for(e of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(e,i)||document.head.removeChild(e);for(t of i)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(var[i,s]of t.entries()){if("TITLE"==e.tagName){if("TITLE"!=s.tagName)continue;if(e.innerHTML==s.innerHTML)return t.splice(i,1),!0}if(s.isEqualNode(e))return t.splice(i,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(var e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(var e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(var e of this.newBodyScriptElements){var t=h(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>"dynamic"===e.getAttribute("data-turbo-track"))}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}class Ye extends Ue{static renderElement(t,e){ze(t,e,{callbacks:{beforeNodeMorphed:e=>!Ke(e)}});for(let e of t.querySelectorAll("turbo-frame"))Ke(e)&&((i=e).addEventListener("turbo:before-frame-render",({detail:e})=>{e.render=qe.renderElement},{once:!0}),i.reload());var i;s("turbo:morph",{detail:{currentElement:t,newElement:e}})}async preservingPermanentElements(e){return e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function Ke(e){return e instanceof r&&e.src&&"morph"===e.refresh&&!e.closest("[data-turbo-permanent]")}class Xe{keys=[];snapshots={};constructor(e){this.size=e}has(e){return i(e)in this.snapshots}get(e){var t;if(this.has(e))return t=this.read(e),this.touch(e),t}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[i(e)]}write(e,t){this.snapshots[i(e)]=t}touch(e){var e=i(e),t=this.keys.indexOf(e);-1<t&&this.keys.splice(t,1),this.keys.unshift(e),this.trim()}trim(){for(var e of this.keys.splice(this.size))delete this.snapshots[e]}}class Ge extends ce{snapshotCache=new Xe(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,i=!0,s){var r=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?Ye:Ue,e=new r(this.snapshot,e,r.renderElement,t,i);return e.shouldRender?s?.changeHistory():this.forceReloaded=!0,this.render(e)}renderError(e,t){t?.changeHistory();t=new Ve(this.snapshot,e,Ve.renderElement,!1);return this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){var t;if(e.isCacheable)return this.delegate.viewWillCacheSnapshot(),t=this.lastRenderedLocation,await W(),e=e.clone(),this.snapshotCache.put(t,e),e}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&"replace"===e.action}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return A.fromElement(this.element)}}class Je{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.#preloadAll):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#preloadAll)}preloadOnLoadLinksForView(e){for(var t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){var t=new URL(e.href);this.snapshotCache.has(t)||await new w(this,y.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{var i=await t.responseHTML,s=A.fromHTMLString(i);this.snapshotCache.put(e.url,s)}catch(e){}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#preloadAll=()=>{this.preloadOnLoadLinksForView(document.body)}}class Ze{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#setCacheControl("")}exemptPageFromCache(){this.#setCacheControl("no-cache")}exemptPageFromPreview(){this.#setCacheControl("no-preview")}#setCacheControl(t){{var i="turbo-cache-control";let e=K(i);e||((e=document.createElement("meta")).setAttribute("name",i),document.head.appendChild(e)),e.setAttribute("content",t),e}}}class Qe{navigator=new Ie(this);history=new De(this);view=new Ge(this,document.documentElement);adapter=new ke(this);pageObserver=new Fe(this);cacheObserver=new Me;linkPrefetchObserver=new Ce(this,document);linkClickObserver=new ge(this,window);formSubmitObserver=new de(this,document);scrollObserver=new Be(this);streamObserver=new He(this);formLinkClickObserver=new me(this,document.documentElement);frameRedirector=new Ee(this,document.documentElement);streamMessageRenderer=new Ne;cache=new Ze(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#pageRefreshDebouncePeriod=150;constructor(e){this.recentRequests=e,this.preloader=new Je(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){var i,s=t.frame?document.getElementById(t.frame):null;s instanceof r?(i=t.action||m(s),s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()):this.navigator.proposeVisit(l(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.navigator.currentVisit||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(S.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#pageRefreshDebouncePeriod}set pageRefreshDebouncePeriod(e){this.refresh=function(t,i){let s=null;return(...e)=>{clearTimeout(s),s=setTimeout(()=>t.apply(this,e),i)}}(this.debouncedRefresh.bind(this),e),this.#pageRefreshDebouncePeriod=e}shouldPreloadLink(e){var t=e.hasAttribute("data-turbo-method"),i=e.hasAttribute("data-turbo-stream"),s=e.getAttribute("data-turbo-frame"),s="_top"==s?null:document.getElementById(s)||v(e,"turbo-frame:not([disabled])");return!(t||i||s instanceof r)&&(t=new URL(e.href),this.elementIsNavigatable(e))&&n(t,this.snapshot.rootLocation)}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,i){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:i}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&n(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&n(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,i){return this.elementIsNavigatable(e)&&n(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,i)}followedLinkToLocation(e,t){var i=this.getActionForLink(e),e=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:i,acceptsStreamResponse:e})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){et(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(p(document.documentElement),this.view.markVisitDirection(e.direction)),et(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),g(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){var i=H(e,t);return this.submissionIsNavigatable(e,t)&&n(l(i),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){var{defaultPrevented:e,detail:{render:t}}=this.notifyApplicationBeforeRender(e,t);return this.view.renderer&&t&&(this.view.renderer.renderElement=t),!e}viewRenderedSnapshot(e,t,i){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(i)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,i){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,i).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,i){return s("turbo:click",{target:e,detail:{url:t.href,originalEvent:i},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return s("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return s("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return s("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return s("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return s("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return s("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return s("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return s("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){return"off"!=this.formMode&&(t=!t||this.elementIsNavigatable(t),"optin"==this.formMode?t&&null!=e.closest('[data-turbo="true"]'):t&&this.elementIsNavigatable(e))}elementIsNavigatable(e){var t=v(e,"[data-turbo]"),e=v(e,"turbo-frame");return this.drive||e?!t||"false"!=t.getAttribute("data-turbo"):!!t&&"true"==t.getAttribute("data-turbo")}getActionForLink(e){return m(e)||"advance"}get snapshot(){return this.view.snapshot}}function et(e){Object.defineProperties(e,tt)}let tt={absoluteURL:{get(){return this.toString()}}},I=new Qe(te);var{cache:it,navigator:st}=I;function rt(){I.start()}function at(e){I.registerAdapter(e)}function nt(e,t){I.visit(e,t)}function ot(e){I.connectStreamSource(e)}function lt(e){I.disconnectStreamSource(e)}function ht(e){I.renderStreamMessage(e)}function dt(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.clearCache()}function ct(e){I.setProgressBarDelay(e)}function ut(e){E.confirmMethod=e}function pt(e){I.setFormMode(e)}var gt=Object.freeze({__proto__:null,navigator:st,session:I,cache:it,PageRenderer:Ue,PageSnapshot:A,FrameRenderer:C,fetch:se,start:rt,registerAdapter:at,visit:nt,connectStreamSource:ot,disconnectStreamSource:lt,renderStreamMessage:ht,clearCache:dt,setProgressBarDelay:ct,setConfirmMethod:ut,setFormMode:pt});class mt extends Error{}class ft{fetchResponseLoaded=e=>Promise.resolve();#currentFetchRequest=null;#resolveVisitPromise=()=>{};#connected=!1;#hasBeenLoaded=!1;#ignoredAttributes=new Set;action=null;constructor(e){this.element=e,this.view=new ue(this,this.element),this.appearanceObserver=new oe(this,this.element),this.formLinkClickObserver=new me(this,this.element),this.linkInterceptor=new pe(this,this.element),this.restorationIdentifier=u(),this.formSubmitObserver=new de(this,this.element)}connect(){this.#connected||(this.#connected=!0,this.loadingStyle==t.lazy?this.appearanceObserver.start():this.#loadSourceURL(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#connected&&(this.#connected=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==t.eager&&this.#loadSourceURL()}sourceURLChanged(){!this.#isIgnoringChangesTo("src")&&(this.element.isConnected&&(this.complete=!1),this.loadingStyle==t.eager||this.#hasBeenLoaded)&&this.#loadSourceURL()}sourceURLReloaded(){var e=this.element.src;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==t.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#loadSourceURL())}async#loadSourceURL(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#visit(l(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#hasBeenLoaded=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{var t,i=await e.responseHTML;i&&(t=q(i),A.fromDocument(t).isVisitable?await this.#loadFrameResponse(e,t):await this.#handleUnvisitableFrameResponse(e))}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,m(e)),this.#loadSourceURL()}willSubmitFormLinkToLocation(e){return this.#shouldInterceptNavigation(e)}submittedFormLinkToLocation(e,t,i){e=this.#findFrameElement(e);e&&i.setAttribute("data-turbo-frame",e.id)}shouldInterceptLinkClick(e,t,i){return this.#shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.#navigateFrame(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#shouldInterceptNavigation(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new E(this,e,t);e=this.formSubmission.fetchRequest;this.prepareRequest(e),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(S.contentType)}requestStarted(e){p(this.element)}requestPreventedHandlingResponse(e,t){this.#resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#resolveVisitPromise()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#resolveVisitPromise()}requestErrored(e,t){console.error(t),this.#resolveVisitPromise()}requestFinished(e){g(this.element)}formSubmissionStarted({formElement:e}){p(e,this.#findFrameElement(e))}formSubmissionSucceededWithResponse(e,t){var i=this.#findFrameElement(e.formElement,e.submitter);i.delegate.proposeVisitIfNavigatedWithAction(i,m(e.submitter,e.formElement,i)),i.delegate.loadResponse(t),e.isSafe||I.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),I.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){g(e,this.#findFrameElement(e))}allowsImmediateRender({element:e},t){var{defaultPrevented:e,detail:{render:t}}=s("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0});return this.view.renderer&&t&&(this.view.renderer.renderElement=t),!e}viewRenderedSnapshot(e,t,i){}preloadOnLoadLinksForView(e){I.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{e=e.querySelector("#"+this.element.id);e&&this.previousFrameElement&&e.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#loadFrameResponse(e,t){var t=await this.extractForeignFrameElement(t.body);t?(t=new D(t),t=new C(this,this.view.snapshot,t,C.renderElement,!1,!1),this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(t),this.complete=!0,I.frameRendered(e,this.element),I.frameLoaded(this.element),await this.fetchResponseLoaded(e)):this.#willHandleFrameMissingFromResponse(e)&&this.#handleFrameMissingFromResponse(e)}async#visit(e){let t=new w(this,y.get,e,new URLSearchParams,this.element);return this.#currentFetchRequest?.cancel(),this.#currentFetchRequest=t,new Promise(e=>{this.#resolveVisitPromise=()=>{this.#resolveVisitPromise=()=>{},this.#currentFetchRequest=null,e()},t.perform()})}#navigateFrame(e,t,i){let s=this.#findFrameElement(e,i);s.delegate.proposeVisitIfNavigatedWithAction(s,m(i,e,s)),this.#withCurrentNavigationElement(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(a,e=null){if(this.action=e,this.action){let s=A.fromElement(a).clone(),r=a.delegate.visitCachedSnapshot;a.delegate.fetchResponseLoaded=async e=>{var t,i;a.src&&({statusCode:i,redirected:t}=e,i={response:{statusCode:i,redirected:t,responseHTML:await e.responseHTML},visitCachedSnapshot:r,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s},this.action&&(i.action=this.action),I.visit(a.src,i))}}}changeHistory(){var e;this.action&&(e=Y(this.action),I.history.update(e,l(this.element.src||""),this.restorationIdentifier))}async#handleUnvisitableFrameResponse(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#visitResponse(e.response)}#willHandleFrameMissingFromResponse(e){this.element.setAttribute("complete","");e=e.response;return!s("turbo:frame-missing",{target:this.element,detail:{response:e,visit:async(e,t)=>{e instanceof Response?this.#visitResponse(e):I.visit(e,t)}},cancelable:!0}).defaultPrevented}#handleFrameMissingFromResponse(e){this.view.missing(),this.#throwFrameMissingError(e)}#throwFrameMissingError(e){e=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new mt(e)}async#visitResponse(e){var e=new o(e),t=await e.responseHTML,{location:e,redirected:i,statusCode:s}=e;return I.visit(e,{response:{redirected:i,statusCode:s,responseHTML:t}})}#findFrameElement(e,t){return vt(c("data-turbo-frame",t,e)||this.element.getAttribute("target"))??this.element}async extractForeignFrameElement(e){var t,i=CSS.escape(this.id);try{if(t=bt(e.querySelector("turbo-frame#"+i),this.sourceURL))return t;if(t=bt(e.querySelector(`turbo-frame[src][recurse~=${i}]`),this.sourceURL))return await t.loaded,await this.extractForeignFrameElement(t)}catch(e){return console.error(e),new r}return null}#formActionIsVisitable(e,t){return n(l(H(e,t)),this.rootLocation)}#shouldInterceptNavigation(e,t){var i=c("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#formActionIsVisitable(e,t))return!1;if(!this.enabled||"_top"==i)return!1;if(i){i=vt(i);if(i)return!i.disabled}return!(!I.elementIsNavigatable(e)||t&&!I.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#ignoringChangesToAttribute("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.#resolveVisitPromise()}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#connected}get rootLocation(){return l(this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/")}#isIgnoringChangesTo(e){return this.#ignoredAttributes.has(e)}#ignoringChangesToAttribute(e,t){this.#ignoredAttributes.add(e),t(),this.#ignoredAttributes.delete(e)}#withCurrentNavigationElement(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}}function vt(e){if(null!=e){e=document.getElementById(e);if(e instanceof r)return e}}function bt(e,t){if(e){var i=e.getAttribute("src");if(null!=i&&null!=t&&(t=t,l(i).href==l(t).href))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if((e=e.ownerDocument!==document?document.importNode(e,!0):e)instanceof r)return e.connectedCallback(),e.disconnectedCallback(),e}}let yt={after(){this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){let t=this.getAttribute("method");this.targetElements.forEach(e=>{"morph"===t?ze(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let t=this.getAttribute("method");this.targetElements.forEach(e=>{"morph"===t?je(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){I.refresh(this.baseURI,this.requestId)}};class xt extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{var e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await d(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){var e=this.targetElements.flatMap(e=>[...e.children]).filter(e=>!!e.id);let t=[...this.templateContent?.children||[]].filter(e=>!!e.id).map(e=>e.id);return e.filter(e=>t.includes(e.id))}get performAction(){if(this.action){var e=yt[this.action];if(e)return e;this.#raise("unknown action")}this.#raise("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.#raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){var e;return null===this.firstElementChild?(e=this.ownerDocument.createElement("template"),this.appendChild(e),e):this.firstElementChild instanceof HTMLTemplateElement?this.firstElementChild:void this.#raise("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#raise(e){throw new Error(this.description+": "+e)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:xt.renderElement}})}get targetElementsById(){var e=this.ownerDocument?.getElementById(this.target);return null!==e?[e]:[]}get targetElementsByQuery(){var e=this.ownerDocument?.querySelectorAll(this.targets);return 0!==e.length?Array.prototype.slice.call(e):[]}}class wt extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=new(this.src.match(/^ws{1,2}:/)?WebSocket:EventSource)(this.src),ot(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),lt(this.streamSource))}get src(){return this.getAttribute("src")||""}}r.delegateConstructor=ft,void 0===customElements.get("turbo-frame")&&customElements.define("turbo-frame",r),void 0===customElements.get("turbo-stream")&&customElements.define("turbo-stream",xt),void 0===customElements.get("turbo-stream-source")&&customElements.define("turbo-stream-source",wt),(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(e=e.parentElement;e;){if(e==document.body)return console.warn(U`
|
42
|
+
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
43
|
+
|
44
|
+
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
45
|
+
|
46
|
+
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
|
47
|
+
|
48
|
+
——
|
49
|
+
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
50
|
+
`,e.outerHTML);e=e.parentElement}})(),window.Turbo={...gt,StreamActions:yt},rt(),e.FetchEnctype=x,e.FetchMethod=y,e.FetchRequest=w,e.FetchResponse=o,e.FrameElement=r,e.FrameLoadingStyle=t,e.FrameRenderer=C,e.PageRenderer=Ue,e.PageSnapshot=A,e.StreamActions=yt,e.StreamElement=xt,e.StreamSourceElement=wt,e.cache=it,e.clearCache=dt,e.connectStreamSource=ot,e.disconnectStreamSource=lt,e.fetch=se,e.fetchEnctypeFromString=re,e.fetchMethodFromString=b,e.isSafe=_,e.navigator=st,e.registerAdapter=at,e.renderStreamMessage=ht,e.session=I,e.setConfirmMethod=ut,e.setFormMode=pt,e.setProgressBarDelay=ct,e.start=rt,e.visit=nt,Object.defineProperty(e,"__esModule",{value:!0})});
|
51
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/charts/data_formatting_utility.js */
|
52
|
+
let DataFormattingUtils={niceBytes(e,t=2){let i=0,s=parseInt(e,10)||0;for(;1024<=s&&++i;)s/=1024;return s.toFixed(s<10&&0<i?1:t)+" "+["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]},formatLabelX(e,t){return"date"!==t?e:("00"+((t=new Date(1e3*e)).getMonth()+1)).slice(-2)+"/"+("00"+t.getDate()).slice(-2)+"/"+t.getFullYear()+" "+("00"+t.getHours()).slice(-2)+":"+("00"+t.getMinutes()).slice(-2)+":"+("00"+t.getSeconds()).slice(-2)},formatTooltip(e,t){var i=t.parsed.y,s=t.dataset.label;switch(e){case"percentage":return Math.floor(i)===i?s+": "+i+" %":s+": "+Math.round(100*i)/100+" %";case"memory":return s+": "+DataFormattingUtils.niceBytes(1024*i,2);default:return t.yLabel}},formatLabelY(e,t){switch(e){case"percentage":return Math.floor(t)===t?t+"%":Math.round(100*t)/100+"%";case"memory":return DataFormattingUtils.niceBytes(1024*t,1);default:return Math.floor(t)===t?t:Math.round(100*t)/100}},isFractionalPrecision(e){return e!==Math.floor(e)}};
|
53
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/charts/dataset_state_manager.js */class DatasetStateManager{constructor(){this.storageKey="karafkaDisabledDatasets"}readAll(){var e=localStorage.getItem(this.storageKey);return e?JSON.parse(e):{}}saveAll(e){localStorage.setItem(this.storageKey,JSON.stringify(e))}saveCurrent(){var e=document.querySelectorAll(".chartjs"),t=window.location.href.split("?")[0];let i={};var s=this.readAll();e.forEach(e=>{var e=e.id,t=Chart.getChart(e);t&&t.legend&&t.legend.legendItems&&0<(t=t.legend.legendItems.map((e,t)=>e.hidden?t:null).filter(e=>null!==e)).length&&(i[e]=t)}),s[t]=i,this.saveAll(s)}getCurrentChart(e){var t=window.location.href.split("?")[0];return(this.readAll()[t]||{})[e]||[]}}
|
54
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/btn_toggle_manager.js */class BtnToggleManager{constructor(){this.init()}init(){document.querySelectorAll(".btn-toggle").forEach(t=>{let i=t.getAttribute("data-toggle-target"),s=document.getElementById(i);s&&(this.restoreVisibility(t,s),t.addEventListener("click",()=>{var e=!s.classList.contains("hidden");s.classList.toggle("hidden"),t.classList.toggle("active",!e),this.saveVisibility(i,!e)}))})}saveVisibility(e,t){localStorage.setItem(e+"_visibility",t)}restoreVisibility(e,t){var i=localStorage.getItem(t.id+"_visibility"),i=i?"true"===i:!t.classList.contains("hidden");t.classList.toggle("hidden",!i),e.classList.toggle("active",i)}}
|
55
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/charts.js */function refreshCharts(e){(new LineChartsManager).refreshAndRender(e,!0),(new BarChartManager).refreshAndRenderBarCharts(e,!0)}function manageCharts(){(new LineChartsManager).refreshAndRender(document,!1),(new BarChartManager).refreshAndRenderBarCharts(document,!1)}
|
56
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/live_poll.js */var livePollTimer=null,oldDOM=null,datePicker=null,startURL=window.location.href;let isHoveringOverClickable=!1;function initLivePolling(){document.addEventListener("mouseover",function(e){isElementClickable(e.target)&&(isHoveringOverClickable=!0)}),document.addEventListener("mouseout",function(e){isElementClickable(e.target)&&(isHoveringOverClickable=!1)}),null==localStorage.karafkaLivePoll&&(localStorage.karafkaLivePoll="enabled")}function isElementClickable(e){return!!("A"===e.tagName||"BUTTON"===e.tagName||"INPUT"===e.tagName&&("button"===e.type||"submit"===e.type)||e.hasAttribute("onclick")||"function"==typeof e.onclick||"SPAN"===e.tagName&&e.closest(".tab-container"))}function isUserHoveringOverClickable(){return isHoveringOverClickable}function isAnyTextSelected(){var e="";return void 0!==window.getSelection?e=window.getSelection().toString():void 0!==document.selection&&"Text"==document.selection.type&&(e=document.selection.createRange().text),""!=e}function isCollapsingHappening(){return 0<document.querySelectorAll(".collapsing").length}function isPollingPossible(e=!1){return!isUserHoveringOverClickable()&&!isAnyTextSelected()&&!(isOffsetLookupCalendarVisible()||isAnyModalOpen()||isCollapsingHappening()||isTurboOperating()||e&&startURL!=window.location.href)}function isAnyModalOpen(){var e;for(e of document.querySelectorAll("dialog"))if(e.open)return!0;return!1}function bindPollingButtonClick(){var e=document.getElementById("live-poll");null!=e&&e.addEventListener("click",handleLivePollingButtonClick)}function handleLivePollingButtonClick(){toggleLivePollState(),setLivePollButton(),setPollingListener()}function toggleLivePollState(){"enabled"==localStorage.karafkaLivePoll?localStorage.karafkaLivePoll="disabled":localStorage.karafkaLivePoll="enabled"}function setLivePollButton(){null!=(selector=document.getElementById("live-poll"))&&("enabled"==localStorage.karafkaLivePoll?(selector.classList.add("text-base-content"),selector.classList.remove("text-gray-500")):(selector.classList.add("text-gray-500"),selector.classList.remove("text-base-content")))}function checkResponse(e){if(e.ok)return e;throw e}function refreshPage(e){if(!isPollingPossible())return!1;var t,e=(new DOMParser).parseFromString(e,"text/html"),i=e.getElementById("content");oldDOM!=i.innerHTML&&(t=document.querySelectorAll(".chartjs").length,0==i.querySelectorAll(".chartjs").length||0==t?(document.getElementById("content").replaceWith(i),addListeners()):(t=e.getElementById("refreshable"),document.getElementById("refreshable").replaceWith(t),refreshCharts(e)),oldDOM=i.innerHTML)}function showError(e){console.error(e)}function scheduleLivePoll(){null==oldDOM&&(oldDOM=document.getElementById("content").innerHTML);let e=parseInt(localStorage.karafkaTimeInterval)||5e3;e<1e3&&(localStorage.karafkaTimeInterval=5e3,e=5e3),livePollTimer=setTimeout(livePollCallback,e)}function livePollCallback(){clearTimeout(livePollTimer),livePollTimer=null,isPollingPossible(!1)?(startURL=window.location.href,fetch(window.location.href).then(checkResponse).then(e=>e.text()).then(refreshPage).catch(showError).finally(setPollingListener)):setPollingListener()}function setPollingListener(){var e=document.getElementById("live-poll"),t=localStorage.karafkaLivePoll;"disabled"==t||null==t||null==e?(clearTimeout(livePollTimer),livePollTimer=null):(clearTimeout(livePollTimer),scheduleLivePoll())}
|
57
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/offset_datetime.js */function loadOffsetLookupDatePicker(){var e={locale:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm",firstDay:1},timepicker:!0,onSelect:({})=>{document.getElementById("offset-lookup-datepicker").value=""},onShow:function(){offsetLookupDatePicker.selectDate((new Date).getTime()),offsetLookupDatePicker.maxDate=new Date},onHide:function(){offsetLookupDatePicker.selectDate((new Date).getTime())},buttons:[{content(e){return"Go to offset"},onClick(e){var t=e.selectedDates[0]||new Date,i=e.$el.dataset.target;e.hide(),location.href=i+"/"+formatRedirectDateTime(t)}}]};null!=offsetLookupDatePicker&&offsetLookupDatePicker.destroy(),null!=document.getElementById("offset-lookup-datepicker")&&((offsetLookupDatePicker=new AirDatepicker("#offset-lookup-datepicker",e)).maxDate=new Date,offsetLookupDatePicker.selectDate((new Date).getTime()))}function formatRedirectDateTime(e){return e.getFullYear()+`-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}/${String(e.getHours()).padStart(2,"0")}:`+String(e.getMinutes()).padStart(2,"0")}function isOffsetLookupCalendarVisible(){return null!=offsetLookupDatePicker&&offsetLookupDatePicker.visible}
|
58
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/search.js */offsetLookupDatePicker=null;class SearchModalManager{constructor(){this.init()}init(){var t=document.getElementById("offset-input");if(!t)return!1;var i=document.getElementById("offset-timestamp-input"),e=document.querySelectorAll('input[name="search[offset_type]"]'),s=document.getElementById("no-search-criteria"),r=document.getElementById("search-form-errors");e.forEach(function(e){e.addEventListener("change",function(){t.disabled=!document.getElementById("offset-value").checked,t.required=document.getElementById("offset-value").checked,i.disabled=!document.getElementById("offset-timestamp").checked,i.required=document.getElementById("offset-timestamp").checked})}),t.disabled=!document.getElementById("offset-value").checked,t.required=document.getElementById("offset-value").checked,i.disabled=!document.getElementById("offset-timestamp").checked,i.required=document.getElementById("offset-timestamp").checked,document.getElementById("show-search-modal").addEventListener("click",function(){document.getElementById("messages_search_modal").showModal();var e=document.querySelector('#messages_search_modal input[type="text"]');e&&e.focus()}),(s||r)&&(document.getElementById("messages_search_modal").showModal(),e=document.querySelector('#messages_search_modal input[type="text"]'))&&e.focus()}}class SearchMetadataVisibilityManager{constructor(){this.storageKey="karafkaSearchMetadataVisibility",this.metadataElement=document.getElementById("search-metadata-details"),this.toggleButton=document.getElementById("toggle-search-metadata"),this.metadataElement&&this.init()}init(){this.restoreVisibility(),self=this;var t=document.getElementById("toggle-search-metadata");t.addEventListener("click",function(){var e=document.getElementById("search-metadata-details");e.classList.toggle("hidden"),t.classList.toggle("active"),self.saveVisibility(!e.classList.contains("hidden"))})}readVisibility(){return"true"===localStorage.getItem(this.storageKey)}saveVisibility(e){localStorage.setItem(this.storageKey,e)}restoreVisibility(){this.readVisibility()&&(document.getElementById("toggle-search-metadata").classList.add("active"),document.getElementById("search-metadata-details").classList.remove("hidden"))}}
|
59
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/tabs_manager.js */class TabsManager{constructor(){this.storageKey="karafkaActiveTabsv2"}readAllActiveTabs(){var e=localStorage.getItem(this.storageKey);return e?JSON.parse(e):{}}saveAllActiveTabs(e){localStorage.setItem(this.storageKey,JSON.stringify(e))}saveCurrentActiveTabs(){var e=document.querySelectorAll(".inline-tabs > .active"),t=window.location.href.split("?")[0];let i=[];var s=this.readAllActiveTabs();e.forEach(e=>{i.push(e.id)}),s[t]=i,this.saveAllActiveTabs(s)}setActiveTabs(){var e=window.location.href.split("?")[0],e=this.readAllActiveTabs()[e];(e=e||Array.from(document.querySelectorAll(".inline-tabs > .active")).map(e=>e.id))&&e.forEach(e=>{e=document.getElementById(e);e&&(e.parentElement.querySelectorAll(".custom-tab").forEach(function(e){e.classList.remove("active")}),e.classList.add("active"),document.getElementById(e.getAttribute("data-target")).classList.remove("hidden"))})}manageTabs(){this.setActiveTabs();var t=this;document.querySelectorAll(".inline-tabs > .custom-tab").forEach(function(e){e.addEventListener("click",function(e){this.parentElement.querySelectorAll(".custom-tab").forEach(function(e){e.classList.remove("active");e=e.getAttribute("data-target");document.getElementById(e).classList.add("hidden")}),this.classList.add("active"),t.saveCurrentActiveTabs(),t.setActiveTabs()})})}}
|
60
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/theme_manager.js */class ThemeManager{constructor(){this.themeSelectorButton=document.getElementById("theme-selector"),this.themeSelectorLight=document.getElementById("theme-selector-light"),this.themeSelectorDark=document.getElementById("theme-selector-dark"),this.init()}init(){this.lightThemeLink=document.querySelector(".highlight-light"),this.darkThemeLink=document.querySelector(".highlight-dark"),this.lightThemeLink&&this.darkThemeLink&&this.themeSelectorButton?(this.restoreTheme(),this.bindThemeSelectorButton()):console.error("Theme CSS links or theme selector button not found")}bindThemeSelectorButton(){this.themeSelectorButton&&!this.themeSelectorButton.dataset.bound&&(this.themeSelectorButton.addEventListener("click",()=>{this.toggleTheme()}),this.themeSelectorButton.dataset.bound="true")}setTheme(e){document.documentElement.setAttribute("data-theme",e),"dark"===e?(this.lightThemeLink.disabled=!0,this.darkThemeLink.disabled=!1,this.themeSelectorLight.classList.add("hidden"),this.themeSelectorDark.classList.remove("hidden")):(this.lightThemeLink.disabled=!1,this.darkThemeLink.disabled=!0,this.themeSelectorLight.classList.remove("hidden"),this.themeSelectorDark.classList.add("hidden")),localStorage.setItem("theme",e)}toggleTheme(){var e=document.documentElement.getAttribute("data-theme");this.setTheme("dark"===e?"corporate":"dark")}restoreTheme(){var e=localStorage.getItem("theme"),e=e||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"corporate");this.setTheme(e),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{localStorage.getItem("theme")||this.setTheme(e.matches?"dark":"corporate")})}}
|
61
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/components/turbo_tracker.js */let turboIsOperating=!1;function isTurboOperating(){return turboIsOperating}
|
62
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/application.js */function updateTimeAgo(){0!=(e=document.querySelectorAll("time")).length&&(timeago.render(e),timeago.cancel());for(var e=document.getElementsByClassName("time-title"),t=0;t<e.length;t++){var i=e[t],s=i.getAttribute("title");i.setAttribute("title",timeago.format(s))}}function refreshTitle(){var e=document.querySelectorAll(".breadcrumbs a"),e=Array.from(e).slice(1).map(e=>e.textContent.trim());0<e.length?document.title=e.join(" > ")+" - Karafka Web UI":document.title="Karafka Web UI"}function redirectToPartition(){var e=document.getElementById("current-partition");null!=e&&e.addEventListener("change",function(){Turbo.visit(this.value)})}function bindActionsConfirmations(){for(var t=document.getElementsByClassName("confirm-action"),i=0;i<t.length;i++){var s=t[i];let e="click";"FORM"===s.nodeName&&(e="submit"),s.addEventListener(e,function(e){window.confirm("Are you sure?")||e.preventDefault()})}}function bindLockableButtons(){document.querySelectorAll(".btn-lockable").forEach(function(i){i.addEventListener("click",function(e){var t=i.closest("form");t?t.addEventListener("submit",function(){i.disabled=!0,i.textContent+="...",document.querySelectorAll(".modal").forEach(function(e){e.classList.add("modal-locked")})},{once:!0}):(i.disabled=!0,i.textContent+="...")})})}function addListeners(){initLivePolling(),bindPollingButtonClick(),bindLockableButtons(),setLivePollButton(),setPollingListener(),hljs.highlightAll(),updateTimeAgo(),redirectToPartition(),(new TabsManager).manageTabs(),manageCharts(),bindActionsConfirmations(),loadOffsetLookupDatePicker(),new BtnToggleManager,new ThemeManager,refreshTitle(),new SearchMetadataVisibilityManager,new SearchModalManager}document.addEventListener("turbo:visit",function(){turboIsOperating=!0}),document.addEventListener("turbo:before-fetch-request",function(){turboIsOperating=!0}),document.addEventListener("turbo:before-fetch-response",function(){turboIsOperating=!0}),document.addEventListener("turbo:load",function(){turboIsOperating=!1}),document.addEventListener("turbo:frame-load",function(){turboIsOperating=!1}),document.addEventListener("turbo:frame-render",function(){turboIsOperating=!1}),document.addEventListener("turbo:load",addListeners),Turbo.setProgressBarDelay(100)
|
63
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/charts/types/bar.js */;class BarChartManager{constructor(){this.datasetStateManager=new DatasetStateManager}refreshAndRenderBarCharts(c,u=!1){(u?c:document).querySelectorAll(".chartjs-bar").forEach(e=>{var t=e.id,i=(u?c:document).getElementById(t),s=JSON.parse(i.dataset.datasets);let r=[],a=[],n=[];var o=i.dataset.label_type_y;let l=i.dataset.label_type_x,h=this.datasetStateManager.getCurrentChart(t);Object.entries(s).forEach(([e,t],i)=>{t.forEach(([e,t])=>{n.push(t),0===i&&r.push(DataFormattingUtils.formatLabelX(e,l))}),a.push({data:t.map(([,e])=>e),label:e,hidden:h.includes(i),borderWidth:2.5})});var i=Math.min(...n),s=Math.max(...n),i=Math.round(i-.1*i),s=Math.round(s+.005*s),d=Math.round(n.reduce((e,t)=>e+t,0)/n.length);a.push({type:"line",label:"Average",data:new Array(r.length).fill(d),borderWidth:2,fill:!1,pointRadius:0,hoverBorderWidth:3,pointHitRadius:20}),u?((d=Chart.getChart(t)).data.datasets=a,d.data.labels=r,d.options.scales.y.min=i,d.options.scales.y.max=s,d.update("none")):this.renderBarChart(e,r,a,i,s,o)})}renderBarChart(e,t,i,s,r,a){new Chart(e,{type:"bar",data:{labels:t,datasets:i},options:{responsive:!0,maintainAspectRatio:!1,aspectRatio:5,scales:{x:{display:!0},y:{beginAtZero:!1,min:s,max:r,ticks:{maxTicksLimit:8,callback:function(e,t,i){return DataFormattingUtils.formatLabelY(a,e,t,i)}}}},animation:!1,animations:{colors:!1,x:!1},transitions:{active:{animation:{duration:!1}}},plugins:{legend:{position:"hidden"},tooltip:{callbacks:{label:function(e){let t=e.dataset.label||"";return"Average"!==t?DataFormattingUtils.formatTooltip(a,e):t+=": "+e.formattedValue}}}}}})}}
|
64
|
+
/*! Source: lib/karafka/web/ui/public/javascripts/charts/types/line.js */class LineChartsManager{constructor(){this.datasetStateManager=new DatasetStateManager}getLegendHeightPercentage(e){var t=e.chartArea,e=e.height,t=e-(t.bottom-t.top);return Math.round(t/e*100)}afterRenderPlugin(){let i=this;return{id:"afterRender",afterRender:function(e){var t=i.getLegendHeightPercentage(e),e=document.getElementById(e.canvas.id);50<t&&""==e.parentElement.style.height&&(e.parentElement.style.height="400px")}}}refreshAndRender(d,c=!1){(c?d:document).querySelectorAll(".chartjs-line").forEach(e=>{var t=e.id,i=(c?d:document).getElementById(t),s=JSON.parse(i.dataset.datasets);let r=[],a=[],n=0;var o=i.dataset.label_type_y;let l=i.dataset.label_type_x,h=this.datasetStateManager.getCurrentChart(t);Object.entries(s).forEach(([e,t],i)=>{t.forEach(([e,t])=>{0===i&&r.push(DataFormattingUtils.formatLabelX(e,l)),DataFormattingUtils.isFractionalPrecision(t)&&(n=2)}),a.push({data:t,label:e,hidden:h.includes(i),borderWidth:2.5,pointHitRadius:10})}),c?((i=Chart.getChart(t)).data.datasets=a,i.data.labels=r,i.update("none")):this.render(e,r,a,n,o)})}render(e,t,i,s,r){var a=null,a=10<i.length?"point":"x";new Chart(e,{type:"line",data:{labels:t,datasets:i},options:{responsive:!0,maintainAspectRatio:!1,aspectRatio:5,title:{display:!1},interaction:{mode:"nearest",axis:"x",intersect:!1},animation:!1,transitions:{active:{animation:{duration:!1}}},plugins:{legend:{position:"bottom",labels:{padding:20},onClick:(e,t,i)=>{var s=t.datasetIndex,i=i.chart;i.isDatasetVisible(s)?(i.hide(s),t.hidden=!0):(i.show(s),t.hidden=!1),this.datasetStateManager.saveCurrent()}},tooltip:{mode:a,filter:function(e,t,i){return t<10},callbacks:{label:function(e){return DataFormattingUtils.formatTooltip(r,e)}}}},scales:{x:{display:!1},y:{ticks:{precision:s,count:5,callback:function(e,t,i){return DataFormattingUtils.formatLabelY(r,e,t,i)}}}},elements:{point:{radius:0,style:!1},line:{style:"star",radius:0,spanGaps:!1}},hover:{mode:"index",intersect:!1}},plugins:[this.afterRenderPlugin()]})}}
|