panda-core 0.12.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +53 -0
- data/app/assets/builds/panda_core_admin.css +2 -0
- data/app/assets/tailwind/application.css +236 -36
- data/app/builders/panda/core/form_builder.rb +120 -18
- data/app/components/panda/core/UI/badge.html.erb +10 -0
- data/app/components/panda/core/UI/badge.rb +14 -30
- data/app/components/panda/core/UI/button.html.erb +5 -0
- data/app/components/panda/core/UI/button.rb +11 -15
- data/app/components/panda/core/UI/card.html.erb +3 -0
- data/app/components/panda/core/UI/card.rb +7 -6
- data/app/components/panda/core/admin/attribute_diff_component.html.erb +21 -0
- data/app/components/panda/core/admin/attribute_diff_component.rb +29 -0
- data/app/components/panda/core/admin/breadcrumb_component.html.erb +36 -0
- data/app/components/panda/core/admin/breadcrumb_component.rb +12 -64
- data/app/components/panda/core/admin/breadcrumbs_component.html.erb +16 -0
- data/app/components/panda/core/admin/breadcrumbs_component.rb +26 -0
- data/app/components/panda/core/admin/button_component.html.erb +9 -0
- data/app/components/panda/core/admin/button_component.rb +36 -31
- data/app/components/panda/core/admin/callout_component.html.erb +17 -0
- data/app/components/panda/core/admin/callout_component.rb +57 -0
- data/app/components/panda/core/admin/code_block_component.html.erb +9 -0
- data/app/components/panda/core/admin/code_block_component.rb +23 -0
- data/app/components/panda/core/admin/container_component.html.erb +27 -0
- data/app/components/panda/core/admin/container_component.rb +11 -77
- data/app/components/panda/core/admin/contributors_summary_component.html.erb +15 -0
- data/app/components/panda/core/admin/contributors_summary_component.rb +23 -0
- data/app/components/panda/core/admin/dashboard_default_content_component.html.erb +70 -0
- data/app/components/panda/core/admin/dashboard_default_content_component.rb +32 -0
- data/app/components/panda/core/admin/delete_button_component.html.erb +4 -0
- data/app/components/panda/core/admin/delete_button_component.rb +41 -0
- data/app/components/panda/core/admin/dropdown_button_component.html.erb +28 -0
- data/app/components/panda/core/admin/dropdown_button_component.rb +100 -0
- data/app/components/panda/core/admin/dropdown_component.html.erb +32 -0
- data/app/components/panda/core/admin/dropdown_component.rb +65 -0
- data/app/components/panda/core/admin/empty_state_component.html.erb +16 -0
- data/app/components/panda/core/admin/empty_state_component.rb +25 -0
- data/app/components/panda/core/admin/file_gallery_component.html.erb +58 -0
- data/app/components/panda/core/admin/file_gallery_component.rb +26 -98
- data/app/components/panda/core/admin/filter_pills_component.html.erb +6 -0
- data/app/components/panda/core/admin/filter_pills_component.rb +29 -0
- data/app/components/panda/core/admin/flash_message_component.html.erb +11 -0
- data/app/components/panda/core/admin/flash_message_component.rb +33 -60
- data/app/components/panda/core/admin/form_error_component.html.erb +7 -0
- data/app/components/panda/core/admin/form_error_component.rb +8 -16
- data/app/components/panda/core/admin/form_footer_component.html.erb +16 -0
- data/app/components/panda/core/admin/form_footer_component.rb +65 -0
- data/app/components/panda/core/admin/form_input_component.html.erb +1 -0
- data/app/components/panda/core/admin/form_input_component.rb +21 -13
- data/app/components/panda/core/admin/form_section_component.html.erb +16 -0
- data/app/components/panda/core/admin/form_section_component.rb +64 -0
- data/app/components/panda/core/admin/form_select_component.html.erb +5 -0
- data/app/components/panda/core/admin/form_select_component.rb +25 -26
- data/app/components/panda/core/admin/heading_component.html.erb +26 -0
- data/app/components/panda/core/admin/heading_component.rb +23 -60
- data/app/components/panda/core/admin/login_form_component.html.erb +38 -0
- data/app/components/panda/core/admin/login_form_component.rb +28 -0
- data/app/components/panda/core/admin/main_layout_component.html.erb +88 -0
- data/app/components/panda/core/admin/main_layout_component.rb +19 -0
- data/app/components/panda/core/admin/my_profile/connected_account_component.html.erb +41 -0
- data/app/components/panda/core/admin/my_profile/connected_account_component.rb +27 -0
- data/app/components/panda/core/admin/navigation/item_component.html.erb +34 -0
- data/app/components/panda/core/admin/navigation/item_component.rb +69 -0
- data/app/components/panda/core/admin/navigation/sub_item_component.html.erb +9 -0
- data/app/components/panda/core/admin/navigation/sub_item_component.rb +44 -0
- data/app/components/panda/core/admin/navigation/user_menu_component.html.erb +30 -0
- data/app/components/panda/core/admin/navigation/user_menu_component.rb +36 -0
- data/app/components/panda/core/admin/page_header_component.html.erb +28 -0
- data/app/components/panda/core/admin/page_header_component.rb +19 -35
- data/app/components/panda/core/admin/pagination_component.html.erb +33 -0
- data/app/components/panda/core/admin/pagination_component.rb +56 -0
- data/app/components/panda/core/admin/panel_component.html.erb +19 -0
- data/app/components/panda/core/admin/panel_component.rb +4 -29
- data/app/components/panda/core/admin/prose_panel_component.html.erb +6 -0
- data/app/components/panda/core/admin/prose_panel_component.rb +43 -0
- data/app/components/panda/core/admin/search_bar_component.html.erb +19 -0
- data/app/components/panda/core/admin/search_bar_component.rb +31 -0
- data/app/components/panda/core/admin/search_filter_bar_component.html.erb +22 -0
- data/app/components/panda/core/admin/search_filter_bar_component.rb +27 -0
- data/app/components/panda/core/admin/secret_field_component.html.erb +24 -0
- data/app/components/panda/core/admin/secret_field_component.rb +31 -0
- data/app/components/panda/core/admin/sidebar_component.html.erb +160 -0
- data/app/components/panda/core/admin/sidebar_component.rb +55 -0
- data/app/components/panda/core/admin/slideover_component.html.erb +67 -0
- data/app/components/panda/core/admin/slideover_component.rb +31 -70
- data/app/components/panda/core/admin/statistics_component.html.erb +4 -0
- data/app/components/panda/core/admin/statistics_component.rb +6 -8
- data/app/components/panda/core/admin/tab_bar_component.html.erb +48 -0
- data/app/components/panda/core/admin/tab_bar_component.rb +32 -67
- data/app/components/panda/core/admin/table_component.html.erb +82 -0
- data/app/components/panda/core/admin/table_component.rb +54 -87
- data/app/components/panda/core/admin/tag_badge_component.html.erb +7 -0
- data/app/components/panda/core/admin/tag_badge_component.rb +21 -0
- data/app/components/panda/core/admin/tag_component.html.erb +1 -0
- data/app/components/panda/core/admin/tag_component.rb +51 -20
- data/app/components/panda/core/admin/tag_input_component.html.erb +37 -0
- data/app/components/panda/core/admin/tag_input_component.rb +22 -0
- data/app/components/panda/core/admin/tags_panel_component.html.erb +8 -0
- data/app/components/panda/core/admin/tags_panel_component.rb +33 -0
- data/app/components/panda/core/admin/user_activity_component.html.erb +15 -0
- data/app/components/panda/core/admin/user_activity_component.rb +9 -22
- data/app/components/panda/core/admin/user_display_component.html.erb +8 -0
- data/app/components/panda/core/admin/user_display_component.rb +19 -22
- data/app/components/panda/core/base.rb +35 -42
- data/app/components/panda/core/shared/footer_component.html.erb +2 -0
- data/app/components/panda/core/shared/footer_component.rb +11 -0
- data/app/components/panda/core/shared/header_component.html.erb +32 -0
- data/app/components/panda/core/shared/header_component.rb +19 -0
- data/app/constraints/panda/core/admin_constraint.rb +2 -2
- data/app/controllers/concerns/panda/core/admin_authorization.rb +58 -0
- data/app/controllers/concerns/panda/core/authorizable.rb +107 -0
- data/app/controllers/panda/core/admin/base_controller.rb +62 -3
- data/app/controllers/panda/core/admin/editor/search_controller.rb +17 -0
- data/app/controllers/panda/core/admin/feature_flags_controller.rb +35 -0
- data/app/controllers/panda/core/admin/file_categories_controller.rb +84 -0
- data/app/controllers/panda/core/admin/files_controller.rb +230 -0
- data/app/controllers/panda/core/admin/import_sessions_controller.rb +120 -0
- data/app/controllers/panda/core/admin/my_profile/logins_controller.rb +24 -0
- data/app/controllers/panda/core/admin/my_profile_controller.rb +31 -0
- data/app/controllers/panda/core/admin/search_controller.rb +15 -0
- data/app/controllers/panda/core/admin/sessions_controller.rb +84 -10
- data/app/controllers/panda/core/admin/tags_controller.rb +77 -0
- data/app/controllers/panda/core/admin/test_sessions_controller.rb +5 -6
- data/app/controllers/panda/core/admin/users_controller.rb +184 -0
- data/app/controllers/panda/core/application_controller.rb +13 -1
- data/app/helpers/panda/core/active_storage_helper.rb +24 -0
- data/app/helpers/panda/core/feature_flag_helper.rb +11 -0
- data/app/helpers/panda/core/form_helper.rb +15 -0
- data/app/javascript/panda/core/controllers/avatar_upload_controller.js +73 -0
- data/app/javascript/panda/core/controllers/clipboard_controller.js +119 -0
- data/app/javascript/panda/core/controllers/collapsible_item_controller.js +45 -0
- data/app/javascript/panda/core/controllers/custom_select_controller.js +256 -0
- data/app/javascript/panda/core/controllers/datepicker_controller.js +121 -0
- data/app/javascript/panda/core/controllers/daterange_controller.js +193 -0
- data/app/javascript/panda/core/controllers/file_gallery_controller.js +134 -0
- data/app/javascript/panda/core/controllers/file_upload_controller.js +165 -0
- data/app/javascript/panda/core/controllers/global_search_controller.js +184 -0
- data/app/javascript/panda/core/controllers/index.js +36 -0
- data/app/javascript/panda/core/controllers/mobile_sidebar_controller.js +58 -0
- data/app/javascript/panda/core/controllers/navigation_toggle_controller.js +49 -24
- data/app/javascript/panda/core/controllers/row_link_controller.js +27 -0
- data/app/javascript/panda/core/controllers/tag_input_controller.js +183 -0
- data/app/javascript/panda/core/tailwindcss-stimulus-components.js +2 -3
- data/app/javascript/panda/core/vendor/@fortawesome--fontawesome-free@7.2.0.js +8129 -0
- data/app/javascript/panda/core/vendor/@hotwired--turbo.js +7197 -100
- data/app/javascript/panda/core/vendor/@rails--actioncable--src.js +511 -2
- data/app/javascript/panda/core/vendor/@tailwindplus--elements@1.0.22.js +65 -0
- data/app/javascript/panda/core/vendor/cropperjs@2.1.0.js +3 -0
- data/app/javascript/panda/core/vendor/vanilla-calendar-pro.js +2 -0
- data/app/models/concerns/panda/core/has_metadata.rb +164 -0
- data/app/models/concerns/panda/core/importable.rb +79 -0
- data/app/models/concerns/panda/core/searchable.rb +66 -0
- data/app/models/concerns/panda/core/taggable.rb +37 -0
- data/app/models/panda/core/feature_flag.rb +56 -0
- data/app/models/panda/core/file_categorization.rb +14 -0
- data/app/models/panda/core/file_category.rb +45 -0
- data/app/models/panda/core/import_session.rb +79 -0
- data/app/models/panda/core/presence.rb +24 -0
- data/app/models/panda/core/tag.rb +33 -0
- data/app/models/panda/core/tagging.rb +14 -0
- data/app/models/panda/core/user.rb +94 -16
- data/app/models/panda/core/user_activity.rb +42 -0
- data/app/models/panda/core/user_session.rb +35 -0
- data/app/services/panda/core/attach_avatar_service.rb +15 -3
- data/app/services/panda/core/csv_import_service.rb +65 -0
- data/app/services/panda/core/file_categorizer.rb +52 -0
- data/app/services/panda/core/file_parser.rb +76 -0
- data/app/services/panda/core/invite_user_service.rb +44 -0
- data/app/services/panda/core/presence_service.rb +49 -0
- data/app/views/layouts/panda/core/admin.html.erb +6 -76
- data/app/views/layouts/panda/core/admin_simple.html.erb +2 -2
- data/app/views/panda/core/admin/dashboard/_default_content.html.erb +1 -73
- data/app/views/panda/core/admin/dashboard/show.html.erb +12 -15
- data/app/views/panda/core/admin/feature_flags/index.html.erb +56 -0
- data/app/views/panda/core/admin/file_categories/_form.html.erb +20 -0
- data/app/views/panda/core/admin/file_categories/edit.html.erb +5 -0
- data/app/views/panda/core/admin/file_categories/index.html.erb +55 -0
- data/app/views/panda/core/admin/file_categories/new.html.erb +5 -0
- data/app/views/panda/core/admin/files/_file_details.html.erb +156 -0
- data/app/views/panda/core/admin/files/index.html.erb +61 -0
- data/app/views/panda/core/admin/import_sessions/column_map.html.erb +43 -0
- data/app/views/panda/core/admin/import_sessions/index.html.erb +48 -0
- data/app/views/panda/core/admin/import_sessions/new.html.erb +37 -0
- data/app/views/panda/core/admin/import_sessions/preview.html.erb +51 -0
- data/app/views/panda/core/admin/import_sessions/show.html.erb +87 -0
- data/app/views/panda/core/admin/my_profile/edit.html.erb +51 -39
- data/app/views/panda/core/admin/my_profile/logins/show.html.erb +72 -0
- data/app/views/panda/core/admin/sessions/new.html.erb +1 -37
- data/app/views/panda/core/admin/shared/_breadcrumbs.html.erb +1 -18
- data/app/views/panda/core/admin/shared/_sidebar.html.erb +1 -99
- data/app/views/panda/core/admin/shared/_slideover.html.erb +3 -3
- data/app/views/panda/core/admin/tags/_form.html.erb +21 -0
- data/app/views/panda/core/admin/tags/edit.html.erb +4 -0
- data/app/views/panda/core/admin/tags/index.html.erb +41 -0
- data/app/views/panda/core/admin/tags/new.html.erb +4 -0
- data/app/views/panda/core/admin/users/activity.html.erb +90 -0
- data/app/views/panda/core/admin/users/edit.html.erb +48 -0
- data/app/views/panda/core/admin/users/index.html.erb +161 -0
- data/app/views/panda/core/admin/users/sessions.html.erb +103 -0
- data/app/views/panda/core/admin/users/show.html.erb +224 -0
- data/app/views/panda/core/shared/_footer.html.erb +1 -2
- data/app/views/panda/core/shared/_header.html.erb +4 -22
- data/config/brakeman.ignore +68 -31
- data/config/importmap.rb +13 -11
- data/config/routes.rb +49 -2
- data/db/migrate/20260202171614_create_panda_core_file_categories.rb +30 -0
- data/db/migrate/20260203000001_add_user_management_fields_to_panda_core_users.rb +21 -0
- data/db/migrate/20260203000002_create_panda_core_user_activities.rb +24 -0
- data/db/migrate/20260203000003_create_panda_core_user_sessions.rb +25 -0
- data/db/migrate/20260207100000_create_panda_core_presences.rb +21 -0
- data/db/migrate/20260213000001_fix_active_storage_attachments_record_id_type.rb +44 -0
- data/db/migrate/20260217000001_create_panda_core_feature_flags.rb +14 -0
- data/db/migrate/20260303000001_add_metadata_to_panda_core_users.rb +11 -0
- data/db/migrate/20260310000001_create_panda_core_tags.rb +27 -0
- data/db/migrate/20260310000002_create_panda_core_import_sessions.rb +29 -0
- data/lib/generators/panda/core/install_generator.rb +32 -0
- data/lib/generators/panda/core/templates/panda.rb +63 -0
- data/lib/panda/core/asset_loader.rb +5 -2
- data/lib/panda/core/authentication.rb +3 -3
- data/lib/panda/core/configuration.rb +195 -1
- data/lib/panda/core/engine/admin_controller_config.rb +3 -6
- data/lib/panda/core/engine/autoload_config.rb +21 -9
- data/lib/panda/core/engine/omniauth_config.rb +108 -38
- data/lib/panda/core/engine/pending_migrations_check.rb +46 -0
- data/lib/panda/core/engine/sqlite_schema_compatibility.rb +36 -0
- data/lib/panda/core/engine/{phlex_config.rb → view_component_config.rb} +5 -7
- data/lib/panda/core/engine.rb +90 -25
- data/lib/panda/core/middleware.rb +35 -0
- data/lib/panda/core/navigation_registry.rb +455 -0
- data/lib/panda/core/oauth_providers.rb +27 -0
- data/lib/panda/core/permission_registry.rb +89 -0
- data/lib/panda/core/search_registry.rb +69 -0
- data/lib/panda/core/seeds/file_categories.rb +30 -0
- data/lib/panda/core/shared/inflections_config.rb +1 -5
- data/lib/panda/core/testing/rails_helper.rb +87 -0
- data/lib/panda/core/testing/support/authentication_test_helpers.rb +22 -18
- data/lib/panda/core/testing/support/system/cuprite_helpers.rb +4 -4
- data/lib/panda/core/testing/view_component_test_controller.rb +19 -0
- data/lib/panda/core/version.rb +1 -1
- data/lib/panda/core/widget_registry.rb +50 -0
- data/lib/panda/core.rb +17 -8
- data/lib/tasks/panda/core/file_categories.rake +41 -0
- data/public/panda-core-assets/panda-core-0.12.5.css +2 -0
- data/public/panda-core-assets/panda-core-0.13.0.css +2 -0
- data/public/panda-core-assets/panda-core-0.14.0.css +2 -0
- data/public/panda-core-assets/panda-core-0.14.4.css +2 -0
- data/public/panda-core-assets/panda-core.css +2 -2
- data/public/panda-core-assets/vanilla-calendar.css +47 -0
- metadata +203 -26
- data/lib/panda/core/engine/inflections_config.rb +0 -23
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @tailwindplus/elements@1.0.22 vendored from npm
|
|
2
|
+
/*! @tailwindplus/elements v1.0.22 | Proprietary License | https://tailwindcss.com/plus/license */
|
|
3
|
+
var Pn=Object.defineProperty;var So=e=>{throw TypeError(e)};var Cn=(e,o,t)=>o in e?Pn(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var M=(e,o,t)=>Cn(e,typeof o!="symbol"?o+"":o,t),Ot=(e,o,t)=>o.has(e)||So("Cannot "+t);var d=(e,o,t)=>(Ot(e,o,"read from private field"),t?t.call(e):o.get(e)),L=(e,o,t)=>o.has(e)?So("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(e):o.set(e,t),I=(e,o,t,n)=>(Ot(e,o,"write to private field"),n?n.call(e,t):o.set(e,t),t),H=(e,o,t)=>(Ot(e,o,"access private method"),t);if(typeof globalThis.window<"u"){let e=!1;document.addEventListener("submit",o=>{if(e){e=!1;return}let t=o.target;if(t&&t.method==="dialog"){let n=t.closest("el-dialog");if(!n||!("beforeClose"in n))return;let r=o.submitter?.value??"",i=n.beforeClose(r);if(i===!0||(o.preventDefault(),o.stopImmediatePropagation(),i===!1))return;i.then(s=>{s&&(e=!0,t.dispatchEvent(o))}).catch(console.error)}},!0)}var at=class extends Event{constructor(o,{oldState:t="",newState:n="",...r}={}){super(o,r);M(this,"oldState");M(this,"newState");this.oldState=String(t||""),this.newState=String(n||"")}},Lo=new WeakMap;function Mo(e,o,t){Lo.set(e,setTimeout(()=>{Lo.has(e)&&e.dispatchEvent(new at("toggle",{cancelable:!1,oldState:o,newState:t}))},0))}var Nt=globalThis.ShadowRoot||function(){},On=globalThis.HTMLDialogElement||function(){},rt=new WeakMap,X=new WeakMap,q=new WeakMap,xe=new WeakMap;function it(e){return xe.get(e)||"hidden"}var st=new WeakMap;function qe(e){return[...e].pop()}function Dn(e){let o=e.popoverTargetElement;if(!(o instanceof HTMLElement))return;let t=it(o);e.popoverTargetAction==="show"&&t==="showing"||e.popoverTargetAction==="hide"&&t==="hidden"||(t==="showing"?Se(o,!0,!0):pe(o,!1)&&(st.set(o,e),Rt(o)))}function pe(e,o){return!(e.popover!=="auto"&&e.popover!=="manual"&&e.popover!=="hint"||!e.isConnected||o&&it(e)!=="showing"||!o&&it(e)!=="hidden"||e instanceof On&&e.hasAttribute("open")||document.fullscreenElement===e)}function Io(e){if(!e)return 0;let o=X.get(document)||new Set,t=q.get(document)||new Set;return t.has(e)?[...t].indexOf(e)+o.size+1:o.has(e)?[...o].indexOf(e)+1:0}function Mn(e){let o=Ho(e),t=Hn(e);return Io(o)>Io(t)?o:t}function Ve(e){let o,t=q.get(e)||new Set,n=X.get(e)||new Set,r=t.size>0?t:n.size>0?n:null;return r?(o=qe(r),o.isConnected?o:(r.delete(o),Ve(e))):null}function ko(e){for(let o of e||[])if(!o.isConnected)e.delete(o);else return o;return null}function Te(e){return typeof e.getRootNode=="function"?e.getRootNode():e.parentNode?Te(e.parentNode):e}function Ho(e){for(;e;){if(e instanceof HTMLElement&&e.popover==="auto"&&xe.get(e)==="showing")return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||Te(e),e instanceof Nt&&(e=e.host),e instanceof Document)return}}function Hn(e){for(;e;){let o=e.popoverTargetElement;if(o instanceof HTMLElement)return o;if(e=e.parentElement||Te(e),e instanceof Nt&&(e=e.host),e instanceof Document)return}}function Po(e,o){let t=new Map,n=0;for(let s of o||[])t.set(s,n),n+=1;t.set(e,n),n+=1;let r=null;function i(s){if(!s)return;let a=!1,l=null,u=null;for(;!a;){if(l=Ho(s)||null,l===null||!t.has(l))return;(e.popover==="hint"||l.popover==="auto")&&(a=!0),a||(s=l.parentElement)}u=t.get(l),(r===null||t.get(r)<u)&&(r=l)}return i(e.parentElement||Te(e)),r}function Rn(e){return e.hidden||e instanceof Nt||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e instanceof HTMLAnchorElement&&e.href===""?!1:typeof e.tabIndex=="number"&&e.tabIndex!==-1}function Bn(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let o=e;o.shadowRoot&&(o=o.shadowRoot);let t=o.querySelector("[autofocus]");if(t)return t;{let i=o.querySelectorAll("slot");for(let s of i){let a=s.assignedElements({flatten:!0});for(let l of a){if(l.hasAttribute("autofocus"))return l;if(t=l.querySelector("[autofocus]"),t)return t}}}let n=e.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),r=n.currentNode;for(;r;){if(Rn(r))return r;r=n.nextNode()}}function Nn(e){var o;(o=Bn(e))==null||o.focus()}var lt=new WeakMap;function Rt(e){if(!pe(e,!1))return;let o=e.ownerDocument;if(!e.dispatchEvent(new at("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!pe(e,!1))return;let t=!1,n=e.popover,r=null,i=Po(e,X.get(o)||new Set),s=Po(e,q.get(o)||new Set);if(n==="auto"&&(Bt(q.get(o)||new Set,t,!0),me(i||o,t,!0),r="auto"),n==="hint"&&(s?(me(s,t,!0),r="hint"):(Bt(q.get(o)||new Set,t,!0),i?(me(i,t,!0),r="auto"):r="hint")),n==="auto"||n==="hint"){if(n!==e.popover||!pe(e,!1))return;Ve(o)||(t=!0),r==="auto"?(X.has(o)||X.set(o,new Set),X.get(o).add(e)):r==="hint"&&(q.has(o)||q.set(o,new Set),q.get(o).add(e))}lt.delete(e);let a=o.activeElement;e.classList.add(":popover-open"),xe.set(e,"showing"),rt.has(o)||rt.set(o,new Set),rt.get(o).add(e),Ro(st.get(e),!0),Nn(e),t&&a&&e.popover==="auto"&<.set(e,a),Mo(e,"closed","open")}function Se(e,o=!1,t=!1){var n,r;if(!pe(e,!0))return;let i=e.ownerDocument;if(["auto","hint"].includes(e.popover)&&(me(e,o,t),!pe(e,!0)))return;let s=X.get(i)||new Set,a=s.has(e)&&qe(s)===e;if(Ro(st.get(e),!1),st.delete(e),t&&(e.dispatchEvent(new at("beforetoggle",{oldState:"open",newState:"closed"})),a&&qe(s)!==e&&me(e,o,t),!pe(e,!0)))return;(n=rt.get(i))==null||n.delete(e),s.delete(e),(r=q.get(i))==null||r.delete(e),e.classList.remove(":popover-open"),xe.set(e,"hidden"),t&&Mo(e,"open","closed");let l=lt.get(e);l&&(lt.delete(e),o&&l.focus())}function Fn(e,o=!1,t=!1){let n=Ve(e);for(;n;)Se(n,o,t),n=Ve(e)}function Bt(e,o=!1,t=!1){let n=ko(e);for(;n;)Se(n,o,t),n=ko(e)}function Co(e,o,t,n){let r=!1,i=!1;for(;r||!i;){i=!0;let s=null,a=!1;for(let l of o)if(l===e)a=!0;else if(a){s=l;break}if(!s)return;for(;it(s)==="showing"&&o.size;)Se(qe(o),t,n);o.has(e)&&qe(o)!==e&&(r=!0),r&&(n=!1)}}function me(e,o,t){var n,r;let i=e.ownerDocument||e;if(e instanceof Document)return Fn(i,o,t);if((n=q.get(i))!=null&&n.has(e)){Co(e,q.get(i),o,t);return}Bt(q.get(i)||new Set,o,t),(r=X.get(i))!=null&&r.has(e)&&Co(e,X.get(i),o,t)}var Dt=new WeakMap;function Oo(e){if(!e.isTrusted)return;let o=e.composedPath()[0];if(!o)return;let t=o.ownerDocument;if(!Ve(t))return;let r=Mn(o);if(r&&e.type==="pointerdown")Dt.set(t,r);else if(e.type==="pointerup"){let i=Dt.get(t)===r;Dt.delete(t),i&&me(r||t,!1,!0)}}var Mt=new WeakMap;function Ro(e,o=!1){if(!e)return;Mt.has(e)||Mt.set(e,e.getAttribute("aria-expanded"));let t=e.popoverTargetElement;if(t instanceof HTMLElement&&t.popover==="auto")e.setAttribute("aria-expanded",String(o));else{let n=Mt.get(e);n?e.setAttribute("aria-expanded",n):e.removeAttribute("aria-expanded")}}var Do=globalThis.ShadowRoot||function(){};function Bo(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function de(e,o,t){let n=e[o];Object.defineProperty(e,o,{value(r){return n.call(this,t(r))}})}var qn=/(^|[^\\]):popover-open\b/g;function Vn(){return typeof globalThis.CSSLayerBlockRule=="function"}function Wn(){let e=Vn();return`
|
|
4
|
+
${e?"@layer popover-polyfill {":""}
|
|
5
|
+
:where([popover]) {
|
|
6
|
+
position: fixed;
|
|
7
|
+
z-index: 2147483647;
|
|
8
|
+
inset: 0;
|
|
9
|
+
padding: 0.25em;
|
|
10
|
+
width: fit-content;
|
|
11
|
+
height: fit-content;
|
|
12
|
+
border-width: initial;
|
|
13
|
+
border-color: initial;
|
|
14
|
+
border-image: initial;
|
|
15
|
+
border-style: solid;
|
|
16
|
+
background-color: canvas;
|
|
17
|
+
color: canvastext;
|
|
18
|
+
overflow: auto;
|
|
19
|
+
margin: auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:where([popover]:not(.\\:popover-open)) {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(dialog[popover].\\:popover-open) {
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:where(dialog[popover][open]) {
|
|
31
|
+
display: revert;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where([anchor].\\:popover-open) {
|
|
35
|
+
inset: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:where([anchor]:popover-open) {
|
|
39
|
+
inset: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@supports not (background-color: canvas) {
|
|
43
|
+
:where([popover]) {
|
|
44
|
+
background-color: white;
|
|
45
|
+
color: black;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@supports (width: -moz-fit-content) {
|
|
50
|
+
:where([popover]) {
|
|
51
|
+
width: -moz-fit-content;
|
|
52
|
+
height: -moz-fit-content;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@supports not (inset: 0) {
|
|
57
|
+
:where([popover]) {
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
${e?"}":""}
|
|
65
|
+
`}var Ae=null;function Ht(e){let o=Wn();if(Ae===null)try{Ae=new CSSStyleSheet,Ae.replaceSync(o)}catch{Ae=!1}if(Ae===!1){let t=document.createElement("style");t.textContent=o,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[Ae,...e.adoptedStyleSheets]}function No(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||at;function e(l){return l?.includes(":popover-open")&&(l=l.replace(qn,"$1.\\:popover-open")),l}de(Document.prototype,"querySelector",e),de(Document.prototype,"querySelectorAll",e),de(Element.prototype,"querySelector",e),de(Element.prototype,"querySelectorAll",e),de(Element.prototype,"matches",e),de(Element.prototype,"closest",e),de(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let l=(this.getAttribute("popover")||"").toLowerCase();return l===""||l=="auto"?"auto":l=="hint"?"hint":"manual"},set(l){l===null?this.removeAttribute("popover"):this.setAttribute("popover",l)}},showPopover:{enumerable:!0,configurable:!0,value(l={}){Rt(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){Se(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(l={}){return typeof l=="boolean"&&(l={force:l}),xe.get(this)==="showing"&&l.force===void 0||l.force===!1?Se(this,!0,!0):(l.force===void 0||l.force===!0)&&Rt(this),xe.get(this)==="showing"}}});let o=Element.prototype.attachShadow;o&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(l){let u=o.call(this,l);return Ht(u),u}}});let t=HTMLElement.prototype.attachInternals;t&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let l=t.call(this);return l.shadowRoot&&Ht(l.shadowRoot),l}}});let n=new WeakMap;function r(l){Object.defineProperties(l.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(u){if(u===null)this.removeAttribute("popovertarget"),n.delete(this);else if(u instanceof Element)this.setAttribute("popovertarget",""),n.set(this,u);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let u=n.get(this);if(u&&u.isConnected)return u;if(u&&!u.isConnected)return n.delete(this),null;let g=Te(this),m=this.getAttribute("popovertarget");return(g instanceof Document||g instanceof Do)&&m&&g.getElementById(m)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let u=(this.getAttribute("popovertargetaction")||"").toLowerCase();return u==="show"||u==="hide"?u:"toggle"},set(u){this.setAttribute("popovertargetaction",u)}}})}r(HTMLButtonElement),r(HTMLInputElement);let i=l=>{if(l.defaultPrevented)return;let u=l.composedPath(),g=u[0];if(!(g instanceof Element)||g?.shadowRoot)return;let m=Te(g);if(!(m instanceof Do||m instanceof Document))return;let c=u.find(b=>{var f;return(f=b.matches)==null?void 0:f.call(b,"[popovertargetaction],[popovertarget]")});if(c){Dn(c),l.preventDefault();return}},s=l=>{let u=l.key,g=l.target;!l.defaultPrevented&&g&&(u==="Escape"||u==="Esc")&&me(g.ownerDocument,!0,!0)};(l=>{l.addEventListener("click",i),l.addEventListener("keydown",s),l.addEventListener("pointerdown",Oo),l.addEventListener("pointerup",Oo)})(document),Ht(document)}function Fo(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function qo(){document.addEventListener("invoke",f=>{f.type=="invoke"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0),document.addEventListener("command",f=>{f.type=="command"&&f.isTrusted&&(f.stopImmediatePropagation(),f.preventDefault())},!0);function e(f,h,p=!0){Object.defineProperty(f,h,{...Object.getOwnPropertyDescriptor(f,h),enumerable:p})}function o(f){return f&&typeof f.getRootNode=="function"?f.getRootNode():f&&f.parentNode?o(f.parentNode):f}let t=new WeakMap,n=new WeakMap;class r extends Event{constructor(h,p={}){super(h,p);let{source:v,command:y}=p;if(v!=null&&!(v instanceof Element))throw new TypeError("source must be an element");t.set(this,v||null),n.set(this,y!==void 0?String(y):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!t.has(this))throw new TypeError("illegal invocation");let h=t.get(this);if(!(h instanceof Element))return null;let p=o(h);return p!==o(this.target||document)?p.host:h}get command(){if(!n.has(this))throw new TypeError("illegal invocation");return n.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}e(r.prototype,"source"),e(r.prototype,"command");class i extends Event{constructor(h,p={}){throw super(h,p),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let s=new WeakMap;function a(f){Object.defineProperties(f.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(h){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(h===null)this.removeAttribute("commandfor"),s.delete(this);else if(h instanceof Element){this.setAttribute("commandfor","");let p=o(h);o(this)===p||p===this.ownerDocument?s.set(this,h):s.delete(this)}else throw new TypeError("commandForElement must be an element or null")},get(){if(this.localName!=="button")return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute("type")!=="button")return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let h=s.get(this);if(h)return h.isConnected?h:(s.delete(this),null);let p=o(this),v=this.getAttribute("commandfor");return(p instanceof Document||p instanceof ShadowRoot)&&v&&p.getElementById(v)||null}},command:{enumerable:!0,configurable:!0,get(){let h=this.getAttribute("command")||"";if(h.startsWith("--"))return h;let p=h.toLowerCase();switch(p){case"show-modal":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return p}return""},set(h){this.setAttribute("command",h)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(h){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(h){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}})}let l=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return g.takeRecords(),l.get(this)||null},set(f){let h=l.get(this)||null;h&&this.removeEventListener("command",h),l.set(this,typeof f=="object"||typeof f=="function"?f:null),typeof f=="function"&&this.addEventListener("command",f)}}});function u(f){for(let h of f)h.oncommand=new Function("event",h.getAttribute("oncommand"))}let g=new MutationObserver(f=>{for(let h of f){let{target:p}=h;h.type==="childList"?u(p.querySelectorAll("[oncommand]")):u([p])}});g.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),u(document.querySelectorAll("[oncommand]"));function m(f){if(f.defaultPrevented||f.type!=="click")return;let h=f.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(h&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),h.matches("input")))throw new Error("Input elements no longer support `commandfor`");let p=f.target.closest("button[commandfor], button[command]");if(!p)return;if(p.form&&p.getAttribute("type")!=="button")throw f.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(p.hasAttribute("command")!==p.hasAttribute("commandfor")){let w=p.hasAttribute("command")?"command":"commandfor",E=p.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${w} attribute must also have a ${E} attribute to function.`)}if(p.command!=="show-popover"&&p.command!=="hide-popover"&&p.command!=="toggle-popover"&&p.command!=="show-modal"&&p.command!=="close"&&!p.command.startsWith("--")){console.warn(`"${p.command}" is not a valid command value. Custom commands must begin with --`);return}let v=p.commandForElement;if(!v)return;let y=new r("command",{command:p.command,source:p,cancelable:!0});if(v.dispatchEvent(y),y.defaultPrevented)return;let T=y.command.toLowerCase();if(v.popover){let w=!v.matches(":popover-open");w&&(T==="toggle-popover"||T==="show-popover")?v.showPopover({source:p}):!w&&T==="hide-popover"&&v.hidePopover()}else if(v.localName==="dialog"){let w=!v.hasAttribute("open");w&&T==="show-modal"?v.showModal():!w&&T==="close"&&v.close()}}function c(f){f.addEventListener("click",m,!0)}function b(f,h){let p=f.prototype.attachShadow;f.prototype.attachShadow=function(y){let T=p.call(this,y);return h(T),T};let v=f.prototype.attachInternals;f.prototype.attachInternals=function(){let y=v.call(this);return y.shadowRoot&&h(y.shadowRoot),y}}a(HTMLButtonElement),b(HTMLElement,f=>{c(f),g.observe(f,{attributeFilter:["oncommand"]}),u(f.querySelectorAll("[oncommand]"))}),c(document),Object.assign(globalThis,{CommandEvent:r,InvokeEvent:i})}function Vo(){if(typeof HTMLDialogElement!="function")return!1;let e=!1,o=document.createElement("dialog");return o.addEventListener("beforetoggle",t=>{e=!0,t.preventDefault()}),o.show(),e}function Wo(){let e=new WeakMap;function o(s){let a=s.open?"closed":"open",l=s.open?"open":"closed";if(e.has(s)){let u=e.get(s);l=u.oldState,clearTimeout(u.id)}e.set(s,{oldState:l,id:setTimeout(()=>{s.dispatchEvent(new ToggleEvent("toggle",{newState:a,oldState:l}))})})}let t=HTMLDialogElement.prototype.show,n=HTMLDialogElement.prototype.showModal,r=HTMLDialogElement.prototype.close;function i(s){let a=new ToggleEvent("beforetoggle",{newState:"closed",oldState:"open",cancelable:!1});s.dispatchEvent(a),s.open&&o(s)}document.addEventListener("submit",s=>{let a=s.target;if(a.method==="dialog"){let l=a.closest("dialog");l instanceof HTMLDialogElement&&i(l)}},!0),Object.defineProperties(HTMLDialogElement.prototype,{show:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.ownerDocument)return t.apply(this,arguments);let s=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});this.dispatchEvent(s)&&(o(this),t.apply(this,arguments))}},showModal:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.isConnected||!this.ownerDocument)return n.apply(this,arguments);let s=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});if(this.dispatchEvent(s))return o(this),n.apply(this,arguments)}},close:{value(){return!this.open&&!this.matches(":popover-open, :modal")?r.apply(this,arguments):(i(this),r.apply(this,arguments))}}})}function ut(e){function o(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",o))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",o),o())}typeof globalThis.window<"u"&&(Bo()||(No(),ut(async()=>{if(await $n("popover-polyfill"))return;let e=document.createElement("style");e.textContent="@layer popover-polyfill;",e.setAttribute("suppressHydrationWarning",""),e.addEventListener("securitypolicyviolation",()=>{console.log("CSP rules on this website prevented @tailwindplus/elements from defining `popover-polyfill` as the first CSS layer. This is necessary to ensure the popover polyfill behaves correctly with CSS layers. To fix this, please manually add the following CSS to the top of your first stylesheet:\n\n```\n@layer popover-polyfill;\n```")}),document.documentElement.prepend(e)})),Fo()||qo(),Vo()||Wo());async function $n(e){await _n();for(let o of document.styleSheets)try{for(let t of o.rules)if(t.constructor.name==="CSSLayerStatementRule"&&"nameList"in t&&t.nameList.includes(e))return!0}catch{}return!1}async function _n(){await Promise.all(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(e=>e.sheet?Promise.resolve():new Promise(o=>{e.addEventListener("load",()=>o(),{once:!0}),e.addEventListener("error",()=>o(),{once:!0})})))}function Le(e){"focus"in e&&e.focus({focusVisible:ct})}var ct=!1;if(typeof globalThis.window<"u"){let e;(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse"))(e||(e={})),document.addEventListener("keydown",o=>{o.metaKey||o.altKey||o.ctrlKey||(ct=!0,document.documentElement.dataset.focusVisible="")},!0),document.addEventListener("click",o=>{o.detail===1?(ct=!1,delete document.documentElement.dataset.focusVisible):o.detail===0&&(ct=!0,document.documentElement.dataset.focusVisible="")},!0)}typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{});var Ie,We,se,A=class extends HTMLElement{constructor(){super(...arguments);L(this,Ie,new AbortController);L(this,We,!1);L(this,se,!1)}connectedCallback(){if("observedAttributes"in this.constructor&&typeof this.constructor.observedAttributes=="object"&&Array.isArray(this.constructor.observedAttributes))for(let n of this.constructor.observedAttributes)typeof n=="string"&&(n in this||Object.defineProperty(this,n,{get(){return this.getAttribute(n)},set(r){if(r==null||r===!1){this.removeAttribute(n);return}this.setAttribute(n,r.toString())}}));I(this,We,!0);let t=d(this,Ie).signal;queueMicrotask(()=>{if(!t.aborted)try{this.mount?.(t)}catch(n){console.error(n)}})}disconnectedCallback(){d(this,Ie).abort(),I(this,Ie,new AbortController)}setAttributeNoCallbacks(t,n){try{I(this,se,!0),this.setAttribute(t,n)}finally{I(this,se,!1)}}removeAttributeNoCallbacks(t){try{I(this,se,!0),this.removeAttribute(t)}finally{I(this,se,!1)}}attributeChangedCallback(t,n,r){d(this,We)&&(d(this,se)||n!==r&&this.onAttributeChange?.(t,n,r))}};Ie=new WeakMap,We=new WeakMap,se=new WeakMap;function x(e,o){typeof globalThis.customElements>"u"||customElements.get(e)===o||customElements.define(e,o)}function J(){let e=[],o={addEventListener(t,n,r,i){return t.addEventListener(n,r,i),o.add(()=>t.removeEventListener(n,r,i))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return o.add(()=>cancelAnimationFrame(n))},nextFrame(...t){return o.requestAnimationFrame(()=>o.requestAnimationFrame(...t))},setTimeout(...t){let n=setTimeout(...t);return o.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return queueMicrotask(()=>{n.current&&t[0]()}),o.add(()=>{n.current=!1})},style(t,n,r){let i=t.style.getPropertyValue(n);return n.startsWith("--")?t.style.setProperty(n,r):Object.assign(t.style,{[n]:r}),this.add(()=>{n.startsWith("--")?t.style.setProperty(n,i):Object.assign(t.style,{[n]:i})})},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let r of e.splice(n,1))r()}},dispose(){for(let t of e.splice(0))t()}};return o}function ke(e,o=()=>[]){let t=!1,n=null,r=J();return{start(i,s){let a=[e,...o()];t?t=!1:t=n!==null&&n!==i,n=i;for(let l of a)Kn(l,()=>{t||(i==="in"?(l.dataset.transition="",l.dataset.enter="",l.dataset.closed="",delete l.dataset.leave):i==="out"&&(l.dataset.transition="",l.dataset.leave="",delete l.dataset.enter))},n!==null);r.nextFrame(()=>{for(let l of a)t?i==="in"?(delete l.dataset.enter,delete l.dataset.closed,l.dataset.leave=""):i==="out"&&(delete l.dataset.leave,l.dataset.enter="",l.dataset.closed=""):i==="in"?delete l.dataset.closed:i==="out"&&(l.dataset.closed="");r.requestAnimationFrame(()=>{r.add(Ft(e,()=>{if(!(t&&a.some(l=>qt(l)))){for(let l of a)delete l.dataset.transition,delete l.dataset.enter,delete l.dataset.closed,delete l.dataset.leave;n=null,s?.()}}))})})},abort(){r.dispose(),t=!1,n=null}}}function Kn(e,o,t=!1){if(t){o();return}let n=e.style.transition;e.style.transition="none",o(),e.offsetHeight,e.style.transition=n}function Ft(e,o){let t=J();if(!e)return t.dispose;let n=!1;t.add(()=>{n=!0});let r=e.getAnimations?.({subtree:!0}).filter(i=>i instanceof CSSTransition)??[];return r.length===0?(o(),t.dispose):(Promise.allSettled(r.map(i=>i.finished)).then(()=>{n||o()}),t.dispose)}function qt(e){return(e.getAnimations?.()??[]).some(t=>t instanceof CSSTransition&&t.playState!=="finished")}var Pe=Math.min,Z=Math.max,_e=Math.round,Ke=Math.floor,K=e=>({x:e,y:e}),Un={left:"right",right:"left",bottom:"top",top:"bottom"},jn={start:"end",end:"start"};function Vt(e,o,t){return Z(e,Pe(o,t))}function dt(e,o){return typeof e=="function"?e(o):e}function he(e){return e.split("-")[0]}function pt(e){return e.split("-")[1]}function Wt(e){return e==="x"?"y":"x"}function $t(e){return e==="y"?"height":"width"}var zn=new Set(["top","bottom"]);function le(e){return zn.has(he(e))?"y":"x"}function _t(e){return Wt(le(e))}function Ko(e,o,t){t===void 0&&(t=!1);let n=pt(e),r=_t(e),i=$t(r),s=r==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return o.reference[i]>o.floating[i]&&(s=$e(s)),[s,$e(s)]}function Uo(e){let o=$e(e);return[ft(e),o,ft(o)]}function ft(e){return e.replace(/start|end/g,o=>jn[o])}var $o=["left","right"],_o=["right","left"],Gn=["top","bottom"],Yn=["bottom","top"];function Qn(e,o,t){switch(e){case"top":case"bottom":return t?o?_o:$o:o?$o:_o;case"left":case"right":return o?Gn:Yn;default:return[]}}function jo(e,o,t,n){let r=pt(e),i=Qn(he(e),t==="start",n);return r&&(i=i.map(s=>s+"-"+r),o&&(i=i.concat(i.map(ft)))),i}function $e(e){return e.replace(/left|right|bottom|top/g,o=>Un[o])}function Xn(e){return{top:0,right:0,bottom:0,left:0,...e}}function zo(e){return typeof e!="number"?Xn(e):{top:e,right:e,bottom:e,left:e}}function ge(e){let{x:o,y:t,width:n,height:r}=e;return{width:n,height:r,top:t,left:o,right:o+n,bottom:t+r,x:o,y:t}}function Go(e,o,t){let{reference:n,floating:r}=e,i=le(o),s=_t(o),a=$t(s),l=he(o),u=i==="y",g=n.x+n.width/2-r.width/2,m=n.y+n.height/2-r.height/2,c=n[a]/2-r[a]/2,b;switch(l){case"top":b={x:g,y:n.y-r.height};break;case"bottom":b={x:g,y:n.y+n.height};break;case"right":b={x:n.x+n.width,y:m};break;case"left":b={x:n.x-r.width,y:m};break;default:b={x:n.x,y:n.y}}switch(pt(o)){case"start":b[s]-=c*(t&&u?-1:1);break;case"end":b[s]+=c*(t&&u?-1:1);break}return b}var Yo=async(e,o,t)=>{let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(o)),u=await s.getElementRects({reference:e,floating:o,strategy:r}),{x:g,y:m}=Go(u,n,l),c=n,b={},f=0;for(let h=0;h<a.length;h++){let{name:p,fn:v}=a[h],{x:y,y:T,data:w,reset:E}=await v({x:g,y:m,initialPlacement:n,placement:c,strategy:r,middlewareData:b,rects:u,platform:s,elements:{reference:e,floating:o}});g=y??g,m=T??m,b={...b,[p]:{...b[p],...w}},E&&f<=50&&(f++,typeof E=="object"&&(E.placement&&(c=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:o,strategy:r}):E.rects),{x:g,y:m}=Go(u,c,l)),h=-1)}return{x:g,y:m,placement:c,strategy:r,middlewareData:b}};async function Kt(e,o){var t;o===void 0&&(o={});let{x:n,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:c=!1,padding:b=0}=dt(o,e),f=zo(b),p=a[c?m==="floating"?"reference":"floating":m],v=ge(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(p)))==null||t?p:p.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:g,strategy:l})),y=m==="floating"?{x:n,y:r,width:s.floating.width,height:s.floating.height}:s.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},E=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:T,strategy:l}):y);return{top:(v.top-E.top+f.top)/w.y,bottom:(E.bottom-v.bottom+f.bottom)/w.y,left:(v.left-E.left+f.left)/w.x,right:(E.right-v.right+f.right)/w.x}}var Qo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(o){var t,n;let{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=o,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:c,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...p}=dt(e,o);if((t=i.arrow)!=null&&t.alignmentOffset)return{};let v=he(r),y=le(a),T=he(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=c||(T||!h?[$e(a)]:Uo(a)),k=f!=="none";!c&&k&&E.push(...jo(a,h,f,w));let S=[a,...E],$=await Kt(o,p),re=[],D=((n=i.flip)==null?void 0:n.overflows)||[];if(g&&re.push($[v]),m){let ce=Ko(r,s,w);re.push($[ce[0]],$[ce[1]])}if(D=[...D,{placement:r,overflows:re}],!re.every(ce=>ce<=0)){var nt,xo;let ce=(((nt=i.flip)==null?void 0:nt.index)||0)+1,Ct=S[ce];if(Ct&&(!(m==="alignment"?y!==le(Ct):!1)||D.every(_=>le(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:ce,overflows:D},reset:{placement:Ct}};let Fe=(xo=D.filter(fe=>fe.overflows[0]<=0).sort((fe,_)=>fe.overflows[1]-_.overflows[1])[0])==null?void 0:xo.placement;if(!Fe)switch(b){case"bestFit":{var To;let fe=(To=D.filter(_=>{if(k){let ie=le(_.placement);return ie===y||ie==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(ie=>ie>0).reduce((ie,kn)=>ie+kn,0)]).sort((_,ie)=>_[1]-ie[1])[0])==null?void 0:To[0];fe&&(Fe=fe);break}case"initialPlacement":Fe=a;break}if(r!==Fe)return{reset:{placement:Fe}}}return{}}}};var Xo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(o){let{x:t,y:n,placement:r}=o,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:p=>{let{x:v,y}=p;return{x:v,y}}},...l}=dt(e,o),u={x:t,y:n},g=await Kt(o,l),m=le(he(r)),c=Wt(m),b=u[c],f=u[m];if(i){let p=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=b+g[p],T=b-g[v];b=Vt(y,b,T)}if(s){let p=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=f+g[p],T=f-g[v];f=Vt(y,f,T)}let h=a.fn({...o,[c]:b,[m]:f});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[c]:i,[m]:s}}}}}};function mt(){return typeof window<"u"}function be(e){return Zo(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var o;return(e==null||(o=e.ownerDocument)==null?void 0:o.defaultView)||window}function U(e){var o;return(o=(Zo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:o.documentElement}function Zo(e){return mt()?e instanceof Node||e instanceof R(e).Node:!1}function V(e){return mt()?e instanceof Element||e instanceof R(e).Element:!1}function j(e){return mt()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Jo(e){return!mt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}var Jn=new Set(["inline","contents"]);function Oe(e){let{overflow:o,overflowX:t,overflowY:n,display:r}=W(e);return/auto|scroll|overlay|hidden|clip/.test(o+n+t)&&!Jn.has(r)}var Zn=new Set(["table","td","th"]);function en(e){return Zn.has(be(e))}var er=[":popover-open",":modal"];function Ue(e){return er.some(o=>{try{return e.matches(o)}catch{return!1}})}var tr=["transform","translate","scale","rotate","perspective"],or=["transform","translate","scale","rotate","perspective","filter"],nr=["paint","layout","strict","content"];function ht(e){let o=gt(),t=V(e)?W(e):e;return tr.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!o&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!o&&(t.filter?t.filter!=="none":!1)||or.some(n=>(t.willChange||"").includes(n))||nr.some(n=>(t.contain||"").includes(n))}function tn(e){let o=ee(e);for(;j(o)&&!ve(o);){if(ht(o))return o;if(Ue(o))return null;o=ee(o)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var rr=new Set(["html","body","#document"]);function ve(e){return rr.has(be(e))}function W(e){return R(e).getComputedStyle(e)}function je(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ee(e){if(be(e)==="html")return e;let o=e.assignedSlot||e.parentNode||Jo(e)&&e.host||U(e);return Jo(o)?o.host:o}function on(e){let o=ee(e);return ve(o)?e.ownerDocument?e.ownerDocument.body:e.body:j(o)&&Oe(o)?o:on(o)}function Ce(e,o,t){var n;o===void 0&&(o=[]),t===void 0&&(t=!0);let r=on(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=R(r);if(i){let a=bt(s);return o.concat(s,s.visualViewport||[],Oe(r)?r:[],a&&t?Ce(a):[])}return o.concat(r,Ce(r,[],t))}function bt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sn(e){let o=W(e),t=parseFloat(o.width)||0,n=parseFloat(o.height)||0,r=j(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:n,a=_e(t)!==i||_e(n)!==s;return a&&(t=i,n=s),{width:t,height:n,$:a}}function jt(e){return V(e)?e:e.contextElement}function De(e){let o=jt(e);if(!j(o))return K(1);let t=o.getBoundingClientRect(),{width:n,height:r,$:i}=sn(o),s=(i?_e(t.width):t.width)/n,a=(i?_e(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var ir=K(0);function ln(e){let o=R(e);return!gt()||!o.visualViewport?ir:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function sr(e,o,t){return o===void 0&&(o=!1),!t||o&&t!==R(e)?!1:o}function we(e,o,t,n){o===void 0&&(o=!1),t===void 0&&(t=!1);let r=e.getBoundingClientRect(),i=jt(e),s=K(1);o&&(n?V(n)&&(s=De(n)):s=De(e));let a=sr(i,t,n)?ln(i):K(0),l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,g=r.width/s.x,m=r.height/s.y;if(i){let c=R(i),b=n&&V(n)?R(n):n,f=c,h=bt(f);for(;h&&n&&b!==f;){let p=De(h),v=h.getBoundingClientRect(),y=W(h),T=v.left+(h.clientLeft+parseFloat(y.paddingLeft))*p.x,w=v.top+(h.clientTop+parseFloat(y.paddingTop))*p.y;l*=p.x,u*=p.y,g*=p.x,m*=p.y,l+=T,u+=w,f=R(h),h=bt(f)}}return ge({width:g,height:m,x:l,y:u})}function zt(e,o){let t=je(e).scrollLeft;return o?o.left+t:we(U(e)).left+t}function an(e,o,t){t===void 0&&(t=!1);let n=e.getBoundingClientRect(),r=n.left+o.scrollLeft-(t?0:zt(e,n)),i=n.top+o.scrollTop;return{x:r,y:i}}function lr(e){let{elements:o,rect:t,offsetParent:n,strategy:r}=e,i=r==="fixed",s=U(n),a=o?Ue(o.floating):!1;if(n===s||a&&i)return t;let l={scrollLeft:0,scrollTop:0},u=K(1),g=K(0),m=j(n);if((m||!m&&!i)&&((be(n)!=="body"||Oe(s))&&(l=je(n)),j(n))){let b=we(n);u=De(n),g.x=b.x+n.clientLeft,g.y=b.y+n.clientTop}let c=s&&!m&&!i?an(s,l,!0):K(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+g.x+c.x,y:t.y*u.y-l.scrollTop*u.y+g.y+c.y}}function ar(e){return Array.from(e.getClientRects())}function ur(e){let o=U(e),t=je(e),n=e.ownerDocument.body,r=Z(o.scrollWidth,o.clientWidth,n.scrollWidth,n.clientWidth),i=Z(o.scrollHeight,o.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+zt(e),a=-t.scrollTop;return W(n).direction==="rtl"&&(s+=Z(o.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:a}}function cr(e,o){let t=R(e),n=U(e),r=t.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;let u=gt();(!u||u&&o==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}var fr=new Set(["absolute","fixed"]);function dr(e,o){let t=we(e,!0,o==="fixed"),n=t.top+e.clientTop,r=t.left+e.clientLeft,i=j(e)?De(e):K(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,u=n*i.y;return{width:s,height:a,x:l,y:u}}function nn(e,o,t){let n;if(o==="viewport")n=cr(e,t);else if(o==="document")n=ur(U(e));else if(V(o))n=dr(o,t);else{let r=ln(e);n={x:o.x-r.x,y:o.y-r.y,width:o.width,height:o.height}}return ge(n)}function un(e,o){let t=ee(e);return t===o||!V(t)||ve(t)?!1:W(t).position==="fixed"||un(t,o)}function pr(e,o){let t=o.get(e);if(t)return t;let n=Ce(e,[],!1).filter(a=>V(a)&&be(a)!=="body"),r=null,i=W(e).position==="fixed",s=i?ee(e):e;for(;V(s)&&!ve(s);){let a=W(s),l=ht(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&fr.has(r.position)||Oe(s)&&!l&&un(e,s))?n=n.filter(g=>g!==s):r=a,s=ee(s)}return o.set(e,n),n}function mr(e){let{element:o,boundary:t,rootBoundary:n,strategy:r}=e,s=[...t==="clippingAncestors"?Ue(o)?[]:pr(o,this._c):[].concat(t),n],a=s[0],l=s.reduce((u,g)=>{let m=nn(o,g,r);return u.top=Z(m.top,u.top),u.right=Pe(m.right,u.right),u.bottom=Pe(m.bottom,u.bottom),u.left=Z(m.left,u.left),u},nn(o,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hr(e){let{width:o,height:t}=sn(e);return{width:o,height:t}}function gr(e,o,t){let n=j(o),r=U(o),i=t==="fixed",s=we(e,!0,i,o),a={scrollLeft:0,scrollTop:0},l=K(0);function u(){l.x=zt(r)}if(n||!n&&!i)if((be(o)!=="body"||Oe(r))&&(a=je(o)),n){let b=we(o,!0,i,o);l.x=b.x+o.clientLeft,l.y=b.y+o.clientTop}else r&&u();i&&!n&&r&&u();let g=r&&!n&&!i?an(r,a):K(0),m=s.left+a.scrollLeft-l.x-g.x,c=s.top+a.scrollTop-l.y-g.y;return{x:m,y:c,width:s.width,height:s.height}}function Ut(e){return W(e).position==="static"}function rn(e,o){if(!j(e)||W(e).position==="fixed")return null;if(o)return o(e);let t=e.offsetParent;return U(e)===t&&(t=t.ownerDocument.body),t}function cn(e,o){let t=R(e);if(Ue(e))return t;if(!j(e)){let r=ee(e);for(;r&&!ve(r);){if(V(r)&&!Ut(r))return r;r=ee(r)}return t}let n=rn(e,o);for(;n&&en(n)&&Ut(n);)n=rn(n,o);return n&&ve(n)&&Ut(n)&&!ht(n)?t:n||tn(e)||t}var br=async function(e){let o=this.getOffsetParent||cn,t=this.getDimensions,n=await t(e.floating);return{reference:gr(e.reference,await o(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function vr(e){return W(e).direction==="rtl"}var Gt={convertOffsetParentRelativeRectToViewportRelativeRect:lr,getDocumentElement:U,getClippingRect:mr,getOffsetParent:cn,getElementRects:br,getClientRects:ar,getDimensions:hr,getScale:De,isElement:V,isRTL:vr};function fn(e,o){return e.x===o.x&&e.y===o.y&&e.width===o.width&&e.height===o.height}function wr(e,o){let t=null,n,r=U(e);function i(){var a;clearTimeout(n),(a=t)==null||a.disconnect(),t=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();let u=e.getBoundingClientRect(),{left:g,top:m,width:c,height:b}=u;if(a||o(),!c||!b)return;let f=Ke(m),h=Ke(r.clientWidth-(g+c)),p=Ke(r.clientHeight-(m+b)),v=Ke(g),T={rootMargin:-f+"px "+-h+"px "+-p+"px "+-v+"px",threshold:Z(0,Pe(1,l))||1},w=!0;function E(k){let S=k[0].intersectionRatio;if(S!==l){if(!w)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!fn(u,e.getBoundingClientRect())&&s(),w=!1}try{t=new IntersectionObserver(E,{...T,root:r.ownerDocument})}catch{t=new IntersectionObserver(E,T)}t.observe(e)}return s(!0),i}function dn(e,o,t,n){n===void 0&&(n={});let{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=jt(e),g=r||i?[...u?Ce(u):[],...Ce(o)]:[];g.forEach(v=>{r&&v.addEventListener("scroll",t,{passive:!0}),i&&v.addEventListener("resize",t)});let m=u&&a?wr(u,t):null,c=-1,b=null;s&&(b=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&b&&(b.unobserve(o),cancelAnimationFrame(c),c=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(o)})),t()}),u&&!l&&b.observe(u),b.observe(o));let f,h=l?we(e):null;l&&p();function p(){let v=we(e);h&&!fn(h,v)&&t(),h=v,f=requestAnimationFrame(p)}return t(),()=>{var v;g.forEach(y=>{r&&y.removeEventListener("scroll",t),i&&y.removeEventListener("resize",t)}),m?.(),(v=b)==null||v.disconnect(),b=null,l&&cancelAnimationFrame(f)}}var pn=Xo,mn=Qo;var hn=(e,o,t)=>{let n=new Map,r={platform:Gt,...t},i={...r.platform,_c:n};return Yo(e,o,{...r,platform:i})};function bn(e){let o=()=>{};return function(n,r){if(o(),!n){requestAnimationFrame(()=>{qt(e)?Ft(e,()=>{e.style.removeProperty("position")}):e.style.removeProperty("position")});return}if(!r||!e.hasAttribute("anchor"))return;let i=e.getAttribute("anchor"),s=e.getAttribute("anchor-strategy")||"absolute";s!=="absolute"&&s!=="fixed"&&(console.warn(`[createAnchorUpdater] Invalid anchor strategy "${s}" for element:`,e),s="absolute"),o=dn(r,e,()=>{let a=gn(window.getComputedStyle(e).getPropertyValue("--anchor-gap"),e),l=gn(window.getComputedStyle(e).getPropertyValue("--anchor-offset"),e),u=i.split(" ")[0],g={};switch(u){case"top":case"bottom":g={top:a,left:-1*l,right:l,bottom:a};break;case"left":case"right":g={top:-1*l,bottom:l,left:a,right:a};break}hn(r,e,{strategy:s,placement:i.replace(" ","-"),middleware:[mn({padding:g}),pn({padding:g})]}).then(async({x:m,y:c,placement:b})=>{if(!yr()&&s==="absolute"){let p=null;for(let v=e.parentElement;v;v=v.parentElement){let y=getComputedStyle(v).position;if(y==="relative"||y==="absolute"||y==="fixed"||y==="sticky"){p=v;break}}if(p){let v=p.getBoundingClientRect();m-=v.left+window.scrollX,c-=v.top+window.scrollY}}let f=`${m}px`,h=`${c}px`;switch(b.split("-")[0]){case"top":h=`calc(${c}px - var(--anchor-gap, 0px))`,f=`calc(${m}px + var(--anchor-offset, 0px))`;break;case"right":f=`calc(${m}px + var(--anchor-gap, 0px))`,h=`calc(${c}px + var(--anchor-offset, 0px))`;break;case"bottom":h=`calc(${c}px + var(--anchor-gap, 0px))`,f=`calc(${m}px + var(--anchor-offset, 0px))`;break;case"left":f=`calc(${m}px - var(--anchor-gap, 0px))`,h=`calc(${c}px + var(--anchor-offset, 0px))`;break}{let p=e.getBoundingClientRect();if(p.x===0&&p.y===0&&p.width===0&&p.height===0)return}Object.assign(e.style,{left:f,top:h,position:s}),await Gt.isRTL?.(e)&&Object.assign(e.style,{right:"unset",bottom:"unset"})})})}}function yr(){return"showPopover"in HTMLElement.prototype&&HTMLElement.prototype.showPopover.toString().includes("[native code]")}function gn(e,o){let t=document.createElement("div");o.appendChild(t),t.style.setProperty("margin-top","0px","important"),t.style.setProperty("margin-top",e,"important");let n=parseFloat(window.getComputedStyle(t).marginTop)||0;return o.removeChild(t),n}function ze(e){return Yt(e)&&"tabIndex"in e}function Yt(e){return Er(e)&&"tagName"in e}function Qt(e){return Yt(e)&&"accessKey"in e}function Er(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function vn(e){return Yt(e)&&"style"in e}function wn(e){return Qt(e)&&e.nodeName==="INPUT"}function B(e){let o=e.getBoundingClientRect();return!(!(o.x!==0||o.y!==0||o.width!==0||o.height!==0)||(e.ownerDocument.defaultView||window).getComputedStyle(e).visibility==="hidden")}var yn={get selectRequired(){let e=document.createElement("select");e.setAttribute("required","true");let o=e.validationMessage;return Object.defineProperty(this,"selectRequired",{value:o}),o}};function Ge(e,o,t){function n(){if(!B(e)){for(let r of e.children)if(B(r))return;t()}}if(typeof ResizeObserver<"u"){let r=new ResizeObserver(n);r.observe(e),o.addEventListener("abort",()=>r.disconnect())}if(typeof IntersectionObserver<"u"){let r=new IntersectionObserver(n);r.observe(e),o.addEventListener("abort",()=>r.disconnect())}}var ae=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");function Y(e,o,t){let n=o?e.indexOf(o):null;switch(n===-1&&(n=null),t){case 0:{for(let r=0;r<e.length;r++)if(B(e[r]))return e[r];return null}case 1:{for(let r=e.length-1;r>=0;r--)if(B(e[r]))return e[r];return null}case 2:{if(n===null)return Y(e,o,1);for(let r=n-1;r>=0;r--)if(B(e[r]))return e[r];return null}case 3:{if(n===null)return Y(e,o,0);for(let r=n+1;r<e.length;r++)if(B(e[r]))return e[r];return null}case 4:return null}}var N=[];ut(()=>{function e(o){if(o.target===document.body||N[0]===o.target)return;let t=o.target;t&&"closest"in t&&(t=t.closest(ae),N.unshift(t??o.target),N=N.filter(n=>n!=null&&n.isConnected),N.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("pointerdown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var Ye=!1,Xt=!1;typeof navigator<"u"&&(Ye=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Xt=navigator.userAgent.toLowerCase().includes("firefox"));var Jt=!1;function Me(e,o,t,n,r,i){xr(e.ownerDocument);let s=ke(e),a=bn(e),l=J();e.hasAttribute("popover")||e.setAttribute("popover","");let u=t();for(let c of u)c.setAttribute("type","button"),c.setAttribute("aria-haspopup","true"),c.setAttribute("aria-controls",e.id),c.setAttribute("aria-expanded","false");e.hasAttribute("open")&&queueMicrotask(()=>e.showPopover());function g(){e.hasAttribute("open")&&e.hidePopover()}let m=new AbortController;o.addEventListener("abort",()=>m.abort()),e.addEventListener("beforetoggle",c=>{let b=vt(c,u);a(c.newState==="open",n?.()??b),c.newState==="open"?b&&(Ge(b,m.signal,g),Ge(e,m.signal,g)):(m.abort(),m=new AbortController);let f=e.hasAttribute("open");c.newState==="open"&&!f?e.setAttributeNoCallbacks("open",""):c.newState==="closed"&&f&&e.removeAttributeNoCallbacks("open"),c.newState==="open"?(b?.setAttribute("aria-expanded","true"),b?.id&&e.setAttribute("aria-labelledby",b.id),r?.(),Jt=e.getAttribute("popover")===""):(b?.setAttribute("aria-expanded","false"),e.removeAttribute("aria-labelledby"),i?.(),Jt=!1),c.oldState==="closed"&&c.newState==="open"?(Ye&&(l.dispose(),l=J()),s.start("in")):c.oldState==="open"&&c.newState==="closed"&&(Ye&&l.style(e,"transition-property","none"),s.start("out"))},{signal:o}),o.addEventListener("abort",()=>s.abort())}function vt(e,o){return e.source??N.find(t=>o.includes(t))??o[0]??null}var En=new WeakSet;function xr(e){if(Xt||Ye||En.has(e))return;En.add(e);let o=null;e.addEventListener("mousedown",()=>{Jt&&(e.body.setAttribute("tabindex","-1"),o&&clearTimeout(o),o=setTimeout(()=>e.body.removeAttribute("tabindex")))},{capture:!0})}function z(e,o,t,n){function r(){let a=e.getBoundingClientRect();n.style.setProperty(o,a.width+"px")}let i=e.ownerDocument,s=new ResizeObserver(r);s.observe(e),i.addEventListener("transitionend",r,{signal:t}),t.addEventListener("abort",()=>s.disconnect())}var Tr=0;function P(e){return`${e}-${Tr++}`}var Sr=200;function ue(e,o,t,n){Lr(),e.addEventListener(o,r=>{Zt!==null&&Date.now()-Zt<Sr||n(r)},{passive:!0,signal:t})}var Zt=null,xn=!1;function Lr(){xn||(xn=!0,document.addEventListener("keydown",()=>{Zt=Date.now()},{capture:!0}))}var wt=class extends Map{constructor(t){super();this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t,this),this.set(t,n)),n}};var Tn=new wt(()=>({referenceCounter:0,d:J()}));function yt(e){let o=Tn.get(e);if(o.referenceCounter++,o.referenceCounter===1){let n=[Cr(),kr(),Ir()];n.forEach(({before:r})=>r({doc:e,d:o.d})),n.forEach(({after:r})=>r({doc:e,d:o.d}))}let t=!1;return()=>{t||(t=!0,o.referenceCounter--,!(o.referenceCounter>0)&&(o.d.dispose(),Tn.delete(e)))}}function Ir(){return{before({doc:e,d:o}){o.style(e.documentElement,"overflow","hidden")},after(){}}}function kr(){let e;return{before({doc:o}){let t=o.documentElement,n=o.defaultView??window;e=Math.max(0,n.innerWidth-t.clientWidth),t.style.setProperty("--el-top-layer-scrollbar-offset","0px")},after({doc:o,d:t}){let n=o.documentElement,r=Math.max(0,n.clientWidth-n.offsetWidth),i=Math.max(0,e-r);t.style(n,"paddingRight",`${i}px`),t.add(()=>{n.style.setProperty("--el-top-layer-scrollbar-offset",`-${i}px`)})}}}function Pr(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Cr(){return Pr()?{before({doc:e,d:o}){function t(n){return!!n.closest("[popover], dialog > *")}o.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let i=J();i.style(e.documentElement,"scrollBehavior","auto"),o.add(()=>o.microTask(()=>i.dispose()))}let n=window.scrollY??window.pageYOffset,r=null;o.addEventListener(e,"click",i=>{if(ze(i.target))try{let s=i.target.closest("a");if(!s)return;let{hash:a}=new URL(s.href),l=e.querySelector(a);ze(l)&&!t(l)&&(r=l)}catch{}},!0),o.addEventListener(e,"touchstart",i=>{if(ze(i.target)&&vn(i.target))if(t(i.target)){let s=i.target;for(;s.parentElement&&t(s.parentElement);)s=s.parentElement;o.style(s,"overscrollBehavior","contain")}else o.style(i.target,"touchAction","none")}),o.addEventListener(e,"touchmove",i=>{if(ze(i.target)){if(wn(i.target))return;if(t(i.target)){let s=i.target;for(;s.parentElement&&s.dataset.tailwindplusPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.tailwindplusPortal===""&&i.preventDefault()}else i.preventDefault()}},{passive:!1}),o.add(()=>{let i=window.scrollY??window.pageYOffset;n!==i&&window.scrollTo(0,n),r&&r.isConnected&&(r.scrollIntoView({block:"nearest"}),r=null)})})},after(){}}:{before(){},after(){}}}function Et(e,o){let t=null;e.addEventListener("toggle",n=>{n.newState==="open"?t||(t=yt(e.ownerDocument)):t&&(t(),t=null)},{signal:o}),o.addEventListener("abort",()=>{t&&(t(),t=null)})}var Sn=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function At(e){let o=e.innerText??"",t=e.cloneNode(!0);if(!Qt(t))return o;let n=!1;for(let i of t.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))i.remove(),n=!0;let r=n?t.innerText??"":o;return Sn.test(r)&&(r=r.replace(Sn,"")),r}function Ln(e){let o=e.getAttribute("aria-label");if(typeof o=="string")return o.trim();let t=e.getAttribute("aria-labelledby");if(t){let n=t.split(" ").map(r=>{let i=document.getElementById(r);if(i){let s=i.getAttribute("aria-label");return typeof s=="string"?s.trim():At(i).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return At(e).trim()}var F,Qe,eo=class extends A{constructor(){super(...arguments);L(this,F,[]);L(this,Qe,null)}mount(t){let n=this.getInput(),r=this.getButton(),i=this.getOptions();n.id||(n.id=P("autocomplete-input")),r&&(r.id||(r.id=P("autocomplete-button"))),i.id||(i.id=P("autocomplete-listbox")),Me(i,t,()=>{let c=this.getButton();return c?[c]:[]},()=>this.getInput(),()=>this.onBeforeOpen(),()=>this.onBeforeClose()),Et(i,t),n.setAttribute("role","combobox"),n.setAttribute("aria-autocomplete","list"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls",i.id),n.setAttribute("aria-activedescendant",""),n.setAttribute("autocomplete","off"),r&&(r.setAttribute("type","button"),r.setAttribute("tabindex","-1"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-haspopup","listbox"),r.setAttribute("popovertarget",i.id)),i.setAttribute("role","listbox"),i.setAttribute("popover","manual");let s=this,a=new WeakSet;function l(){for(let c of i.getItems())a.has(c)||(a.add(c),c.id||(c.id=P("option")),c.setAttribute("role","option"),c.setAttribute("aria-selected","false"),c.setAttribute("tabIndex","-1"),c.addEventListener("mousedown",b=>{b.button===0&&(b.preventDefault(),s.selectOption(c))},{signal:t}),ue(c,"mouseover",t,()=>s.setActiveItem(c,!1)),ue(c,"mouseout",t,()=>s.clearActiveItem()));s.filterOptions()}l();let u=new MutationObserver(l);u.observe(this,{attributes:!1,childList:!0,subtree:!0}),r&&z(r,"--button-width",t,this),z(n,"--input-width",t,this),n.addEventListener("input",()=>{n.matches(":disabled")||(this.filterOptions(),d(this,F).length>0?i.hasAttribute("open")||i.showPopover():i.hidePopover())},{signal:t});let g=()=>{n.matches(":disabled")||(n.focus(),i.hasAttribute("open")?i.hidePopover():(this.filterOptions(),d(this,F).length>0&&i.showPopover()))};n.addEventListener("pointerdown",g,{signal:t}),r&&(r.addEventListener("pointerdown",c=>{c.preventDefault(),g()},{signal:t}),r.addEventListener("click",c=>{c.preventDefault(),c.stopImmediatePropagation()},{signal:t})),n.addEventListener("blur",({relatedTarget:c})=>{c&&this.contains(c)||i.hidePopover()},{signal:t}),n.addEventListener("keydown",c=>{if(!n.matches(":disabled"))switch(c.key){case"ArrowDown":{c.preventDefault(),i.hasAttribute("open")||(d(this,F).length===0&&this.filterOptions(),d(this,F).length>0&&i.showPopover()),this.goToItem(3);break}case"ArrowUp":{c.preventDefault(),i.hasAttribute("open")||(d(this,F).length===0&&this.filterOptions(),d(this,F).length>0&&i.showPopover()),this.goToItem(2);break}case"Home":case"PageUp":return i.hasAttribute("open")?(c.preventDefault(),c.stopPropagation(),this.goToItem(0)):void 0;case"End":case"PageDown":return i.hasAttribute("open")?(c.preventDefault(),c.stopPropagation(),this.goToItem(1)):void 0;case"Enter":{let b=this.getActiveItem();b&&(c.preventDefault(),this.selectOption(b)),i.hasAttribute("open")&&(c.preventDefault(),i.hidePopover());break}case"Escape":{if(!i.hasAttribute("open"))return;c.preventDefault(),i.hidePopover();break}case"Tab":{i.hidePopover();break}}},{signal:t});let m=Array.from(i.querySelectorAll("el-option[disabled]"));for(let c of m)c.setAttribute("aria-disabled","true"),c.setAttribute("aria-selected","false");t.addEventListener("abort",()=>{u.disconnect()})}getInput(){let t=this.querySelector("input");if(!t)throw new Error("`<el-autocomplete>` must contain an input element.");return t}getButton(){return this.querySelector("button")}getOptions(){let t=this.querySelector("el-options");if(!t)throw new Error("`<el-autocomplete>` must contain a `<el-options>` element.");return t}filterOptions(){let t=this.getInput().value.toLowerCase();d(this,Qe)!==t&&(this.clearActiveItem(),I(this,Qe,t)),I(this,F,[]);for(let n of this.getOptions().getItems()){let r=n.getAttribute("value")?.toLowerCase()||"",i=At(n)?.trim().toLowerCase()??"";t===""||r.includes(t)||i.includes(t)?(d(this,F).push(n),n.removeAttribute("hidden"),n.removeAttribute("aria-hidden")):(n.setAttribute("hidden",""),n.setAttribute("aria-hidden","true"))}}getActiveItem(){let n=this.getInput().getAttribute("aria-activedescendant");return n?document.getElementById(n):null}goToItem(t){if(d(this,F).length===0)return;let n=this.getActiveItem(),r=Y(d(this,F),n,t);r&&this.setActiveItem(r)}setActiveItem(t,n=!0){let r=this.getInput(),i=this.getActiveItem();i!==null&&i.setAttribute("aria-selected","false"),t.setAttribute("aria-selected","true"),r.setAttribute("aria-activedescendant",t.id),n&&t.scrollIntoView({block:"nearest"})}clearActiveItem(){let t=this.getInput(),n=this.getActiveItem();n!==null&&n.setAttribute("aria-selected","false"),t.setAttribute("aria-activedescendant","")}selectOption(t){let n=this.getInput(),r=t.getAttribute("value");r&&(n.value=r,n.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),n.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover())}onBeforeOpen(){let t=this.getInput(),n=this.getButton();t.setAttribute("aria-expanded","true"),n?.setAttribute("aria-expanded","true")}onBeforeClose(){let t=this.getInput(),n=this.getButton();t.setAttribute("aria-expanded","false"),n?.setAttribute("aria-expanded","false"),this.clearActiveItem()}};F=new WeakMap,Qe=new WeakMap;x("el-autocomplete",eo);var G,Xe,Je,te,xt,no,oo=class extends A{constructor(){super(...arguments);L(this,te);L(this,G,[]);L(this,Xe,null);L(this,Je,({query:t,content:n})=>n.toLocaleLowerCase().includes(t.toLocaleLowerCase().trim()))}mount(t){let n=this.getInput(),r=this.getItems();n.id||(n.id=P("command-input")),r.id||(r.id=P("command-items")),n.setAttribute("role","combobox"),n.setAttribute("aria-autocomplete","list"),n.setAttribute("autocomplete","off"),n.setAttribute("aria-controls",r.id),r.setAttribute("role","listbox");let i=this,s=new WeakSet;function a(u=!1){var g;for(let m of r.getItems())s.has(m)||(s.add(m),m.id||(m.id=P("item")),m.setAttribute("role","option"),m.setAttribute("tabIndex","-1"),m.setAttribute("aria-selected","false"),m.hasAttribute("disabled")&&m.setAttribute("aria-disabled","true"),ue(m,"mouseover",t,()=>{var c;return H(c=i,te,no).call(c,m,!1)}));H(g=i,te,xt).call(g,u),u||i.goToItem(0)}a(!0);let l=new MutationObserver(()=>a(!1));l.observe(this,{attributes:!1,childList:!0,subtree:!0}),z(n,"--input-width",t,this),n.addEventListener("input",()=>H(this,te,xt).call(this),{signal:t}),n.addEventListener("keydown",u=>{switch(u.key){case"ArrowDown":{u.preventDefault(),this.goToItem(3);break}case"ArrowUp":{u.preventDefault(),this.goToItem(2);break}case"Home":case"PageUp":return u.preventDefault(),u.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return u.preventDefault(),u.stopPropagation(),this.goToItem(1);case"Enter":{let g=this.getActiveItem();g&&(u.preventDefault(),g.click());break}case"Tab":break}},{signal:t}),t.addEventListener("abort",()=>{l.disconnect()})}getInput(){let t=this.querySelector("input");if(!t)throw new Error("`<el-command-palette>` must contain an input element.");return t}getItems(){let t=this.querySelector("el-command-list");if(!t)throw new Error("`<el-command-palette>` must contain a `<el-command-list>` element.");return t}getGroups(){return this.getItems().querySelectorAll("el-command-group")}getSuggestions(){return this.querySelector("el-defaults")}getActiveItem(){let n=this.getInput().getAttribute("aria-activedescendant");return n?document.getElementById(n):null}goToItem(t){if(d(this,G).length===0)return;let n=this.getActiveItem(),r=Y(d(this,G),n,t);r&&H(this,te,no).call(this,r)}clearActiveItem(){let t=this.getInput(),n=this.getActiveItem();if(n!==null){n.setAttribute("aria-selected","false");let r=this.querySelector(`el-command-preview[for="${n.id}"]`);r&&r.setAttribute("hidden","")}t.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:null},bubbles:!1,cancelable:!1}))}reset(){let t=this.getInput();t.value="",t.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),H(this,te,xt).call(this,!0),this.clearActiveItem()}setFilterCallback(t){I(this,Je,t)}};G=new WeakMap,Xe=new WeakMap,Je=new WeakMap,te=new WeakSet,xt=function(t=!1){let n=this.getItems(),r=this.getInput().value??"";I(this,G,[]);for(let a of n.getItems()){if(a.closest("el-defaults"))continue;let l=Ln(a)??"";r===""||!d(this,Je).call(this,{query:r,node:a,content:l})?(a.setAttribute("hidden",""),a.setAttribute("aria-hidden","true")):(d(this,G).push(a),a.removeAttribute("hidden"),a.removeAttribute("aria-hidden"))}for(let a of this.getGroups())a.getItems().some(u=>!u.hasAttribute("hidden"))?a.removeAttribute("hidden"):a.setAttribute("hidden","");let i=this.getSuggestions();i&&(r===""?(i.removeAttribute("hidden"),I(this,G,i.getItems())):i.setAttribute("hidden",""));let s=this.querySelector("el-no-results");s&&(r===""||d(this,G).length>0?s.setAttribute("hidden",""):s.removeAttribute("hidden")),d(this,G).length===0?n.setAttribute("hidden",""):n.removeAttribute("hidden"),!(t&&r==="")&&(d(this,G).length===0?this.clearActiveItem():d(this,Xe)!==r&&this.goToItem(0),I(this,Xe,r))},no=function(t,n=!0){let r=this.getInput(),i=this.getActiveItem();if(t===i)return;if(i!==null){i.setAttribute("aria-selected","false");let a=this.querySelector(`el-command-preview[for="${i.id}"]`);a&&a.setAttribute("hidden","")}t.setAttribute("aria-selected","true"),r.setAttribute("aria-activedescendant",t.id);let s=this.querySelector(`el-command-preview[for="${t.id}"]`);s&&s.removeAttribute("hidden"),n&&t.scrollIntoView({block:"nearest"}),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:t},bubbles:!1,cancelable:!1}))};var ro=class extends A{getItems(){return Array.from(this.querySelectorAll(`${ae},[role="option"]`))}},io=class extends A{getItems(){return Array.from(this.querySelectorAll(`${ae},[role="option"]`))}},so=class extends A{},lo=class extends A{},ao=class extends A{getItems(){return Array.from(this.querySelectorAll(`${ae},[role="option"]`))}};x("el-command-palette",oo);x("el-command-list",ro);x("el-defaults",io);x("el-no-results",so);x("el-command-group",ao);x("el-command-preview",lo);var He=null;typeof globalThis.window<"u"&&(He=HTMLDialogElement.prototype.close,Object.defineProperties(HTMLDialogElement.prototype,{close:{value(e){let o=this.closest("el-dialog");if(!(o instanceof Re))return He?.call(this,e);let t=o.beforeClose(e);if(t===!0)return He?.call(this,e);t!==!1&&t.then(n=>n?He?.call(this,e):null).catch(console.error)}}}),document.addEventListener("command",e=>{let o=e.target;if(!(o instanceof HTMLDialogElement)||!("command"in e)||e.command!=="close")return;let t=o.closest("el-dialog");if(!(t instanceof Re))return;let n=e.source?.tagName==="BUTTON"?e.source.value:void 0,r=t.beforeClose(n);r!==!0&&(e.stopImmediatePropagation(),e.preventDefault(),r!==!1&&r.then(i=>i?He?.call(o,n):null).catch(console.error))},!0));var Q,oe,Be,ye,Ze,uo,Re=class extends A{constructor(){super(...arguments);L(this,Ze);L(this,Q,null);L(this,oe,null);L(this,Be,!0);L(this,ye,ke(this,()=>Array.from(this.querySelectorAll("el-dialog-panel,el-dialog-backdrop"))))}mount(t){let n=this.getNativeDialog();n.removeAttribute("open"),n.style.setProperty("right","var(--el-top-layer-scrollbar-offset, 0px)");let r=this.hasAttribute("open");for(let a of H(this,Ze,uo).call(this))a.setAttribute("aria-expanded",r.toString());Dr(n,t,a=>{a.preventDefault();let l=new Event("cancel",{bubbles:!1,cancelable:!0});!this.dispatchEvent(l)||n.close("")});let i=this.querySelector("el-dialog-panel");Ge(i??n,t,()=>{this.hasAttribute("open")&&n.close("")});let s=null;n.addEventListener("beforetoggle",a=>{let l=a;l.newState==="open"&&l.oldState==="closed"&&this.beforeOpen();let u=this.hasAttribute("open");if(l.newState==="open"&&!u?(this.dispatchEvent(new CustomEvent("open",{bubbles:!1,cancelable:!1})),this.setAttribute("open","")):l.newState==="closed"&&u&&(this.dispatchEvent(new CustomEvent("close",{bubbles:!1,cancelable:!1})),this.removeAttribute("open")),l.newState==="open"&&l.oldState==="closed")N.length>0&&!s&&(s=N[0]);else if(l.newState==="closed"&&l.oldState==="open"){let g=d(this,Be);setTimeout(()=>{if(!g){s&&s===document.activeElement&&s.isConnected&&"blur"in s&&typeof s.blur=="function"&&s.blur();return}s&&s!==document.activeElement&&s.isConnected&&Le(s),s=null})}},{signal:t}),n.addEventListener("focusout",a=>{a.relatedTarget===null&&queueMicrotask(()=>{n.contains(n.ownerDocument.activeElement)||n.focus()})},{signal:t}),t.addEventListener("abort",()=>{var a;d(this,ye).abort(),(a=d(this,oe))==null||a.call(this)}),this.hasAttribute("open")&&n.showModal()}onAttributeChange(t,n,r){switch(t){case"open":{let i=this.getNativeDialog();for(let s of H(this,Ze,uo).call(this))s.setAttribute("aria-expanded",r!==null?"true":"false");r===null?i.close():i.showModal();break}}}getNativeDialog(){let t=this.querySelector("dialog");if(!t)throw new Error("[ElDialog] No `<dialog>` element found");return t}beforeOpen(){I(this,Be,!0),d(this,Q)&&(d(this,Q).abort(),I(this,Q,null)),d(this,oe)||I(this,oe,yt(this.ownerDocument)),d(this,ye)&&d(this,ye).start("in")}beforeClose(t){if(d(this,oe)&&(d(this,oe).call(this),I(this,oe,null)),d(this,Q))return!1;I(this,Q,new AbortController);let n=d(this,Q).signal;return new Promise(r=>{d(this,ye)?.start("out",()=>{n.aborted||(I(this,Q,null),requestAnimationFrame(()=>{let i=this.getNativeDialog(),s=i.style.cssText;i.style.cssText=s+"transition-duration: 0 !important;",He?.call(i,t),requestAnimationFrame(()=>{i.style.cssText=s})}),r(!0))})})}show(){this.getNativeDialog().showModal()}hide({restoreFocus:t=!0}={}){I(this,Be,t),this.getNativeDialog().close()}};Q=new WeakMap,oe=new WeakMap,Be=new WeakMap,ye=new WeakMap,Ze=new WeakSet,uo=function(){return document.querySelectorAll(`[commandfor="${this.getNativeDialog().id}"]`)},M(Re,"observedAttributes",["open"]);var co=class extends A{mount(o){Or(this,o,()=>{let t=this.getDialog(),n=t.getNativeDialog();if(!n.hasAttribute("open"))return;let r=new Event("cancel",{bubbles:!1,cancelable:!0});!t.dispatchEvent(r)||n.close()})}getDialog(){let o=this.closest("el-dialog");if(!o)throw new Error("[ElDialogPanel] No `<el-dialog>` parent found");return o}},fo=class extends A{mount(){this.setAttribute("inert","")}};x("el-dialog",Re);x("el-dialog-panel",co);x("el-dialog-backdrop",fo);function Or(e,o,t){let n=null;document.addEventListener("pointerdown",r=>{n=r.composedPath()[0]||r.target},!0),document.addEventListener("click",r=>{if(n!==r.target)return;if(r.target===e){let{clientX:s,clientY:a}=r,l=e.getBoundingClientRect();if(s>=l.left&&s<=l.right&&a>=l.top&&a<=l.bottom)return;t(r);return}let i=e.closest("dialog");if(i&&i.contains(r.target)&&!e.contains(r.target)){t(r);return}if(r.target===r.target.ownerDocument.documentElement){t(r);return}},{signal:o,capture:!0})}function Dr(e,o,t){e.addEventListener("keydown",n=>{n.key==="Escape"&&(n.defaultPrevented||t(n))},{signal:o})}var Ne,et,po,Tt=class extends A{constructor(){super(...arguments);L(this,et);L(this,Ne,ke(this))}mount(t){this.id||(this.id=P("disclosure")),this.hasAttribute("hidden")?this.removeAttributeNoCallbacks("open"):this.setAttributeNoCallbacks("open","");let n=!this.hasAttribute("hidden");for(let r of H(this,et,po).call(this))r.setAttribute("aria-expanded",n.toString()),r.setAttribute("aria-controls",this.id);this.addEventListener("command",r=>{if(r.target instanceof HTMLElement&&"command"in r)switch(r.command){case"--show":{this.show(),r.preventDefault();break}case"--hide":{this.hide(),r.preventDefault();break}case"--toggle":{this.toggle(),r.preventDefault();break}}},{signal:t}),t.addEventListener("abort",()=>d(this,Ne).abort())}onAttributeChange(t,n,r){switch(t){case"hidden":{r===null?this.setAttributeNoCallbacks("open",""):this.removeAttributeNoCallbacks("open");for(let i of H(this,et,po).call(this))i.setAttribute("aria-expanded",r===null?"true":"false");r===null?d(this,Ne).start("in"):d(this,Ne).start("out");break}case"open":{r===null?this.hide():this.show();break}}}show(){this.removeAttribute("hidden")}hide(){this.setAttribute("hidden","")}toggle(){this.hasAttribute("hidden")?this.show():this.hide()}};Ne=new WeakMap,et=new WeakSet,po=function(){return document.querySelectorAll(`[commandfor="${this.id}"]`)},M(Tt,"observedAttributes",["hidden","open"]);x("el-disclosure",Tt);function St(e,o,t,n,r){let i=null;for(let a of o)a.addEventListener("pointerdown",l=>{l.button===0&&e.classList.contains(":popover-open")&&(i=Date.now()+100)},{signal:n,capture:!0});e.ownerDocument.addEventListener("focusin",a=>{if(!t.hasAttribute("open"))return;let l=a.target,u=a.relatedTarget;l!==null&&(i&&Date.now()<i||e.contains(l)||o.some(g=>g.contains(l))||r(u))},{signal:n})}var Mr=200;function Lt(e,o,t){let n=null,r="",i=null,s=null;e.id||(e.id=P(o.role));let a=o.getButton();a.id||(a.id=P(`${o.role}-button`)),Me(e,t,()=>[o.getButton()],()=>o.getButton(),()=>o.onBeforeOpen(),()=>{o.onBeforeClose(),h(),r="",i&&(clearTimeout(i),i=null)}),Et(e,t),e.setAttribute("popover","manual"),e.setAttribute("role",o.role),a.setAttribute("popovertarget",e.id),a.setAttribute("aria-haspopup",o.role);let l=new WeakSet;function u(){let w=o.getItems(),E={passive:!0,signal:t},k=o.role==="menu"?"menuitem":"option";for(let S of w)l.has(S)||(l.add(S),S.id||(S.id=P("item")),S.setAttribute("role",k),S.setAttribute("tabIndex","-1"),S.addEventListener("click",()=>o.onItemClick(S),E),ue(S,"mouseover",t,()=>f(S,!1)),ue(S,"mouseout",t,()=>h()))}u();let g=new MutationObserver(u);g.observe(e,{attributes:!1,childList:!0,subtree:!0}),St(e,[a],e,t,w=>{w===null&&(s=Date.now()+100),e.hidePopover()});let m=null,c=!1;a.addEventListener("pointerdown",w=>{if(w.button===0&&!a.matches(":disabled")){if(w.pointerType==="touch"){c=!0;return}e.togglePopover(),m=Date.now()}},{signal:t}),document.addEventListener("pointerup",w=>{if(w.button!==0||a.matches(":disabled")||!e.hasAttribute("open"))return;if(Date.now()-(m??0)>Mr){let k=w.composedPath();if(k.includes(e)){if(m!==null){let S=p();S&&S.click()}return}for(let S of k){if(!(S instanceof Element))continue;if((S.getAttribute("commandfor")||S.getAttribute("popovertarget"))===e.id)return}e.hidePopover()}m=null},{signal:t,capture:!0}),a.addEventListener("click",w=>{if(c){c=!1;return}w.preventDefault(),w.stopPropagation()},{signal:t});let b=null;e.addEventListener("beforetoggle",w=>{let E=w;E.newState==="open"&&E.oldState==="closed"&&N.length>0&&!b&&(b=N[0])},{signal:t}),e.addEventListener("toggle",w=>{let E=w;E.newState==="closed"&&E.oldState==="open"&&setTimeout(()=>{!e.contains(document.activeElement)&&document.activeElement!==document.body||s&&Date.now()<s||(b&&b!==document.activeElement&&b.isConnected&&Le(b),b=null)})},{signal:t}),t.addEventListener("abort",()=>{i&&(clearTimeout(i),i=null),g.disconnect()});function f(w,E=!0){let k=p();k!==null&&k.setAttribute("tabIndex","-1"),e.removeAttribute("tabIndex"),w.setAttribute("tabIndex","0"),w.focus({preventScroll:!0}),n=w,E&&w.scrollIntoView({block:"nearest"})}function h(){let w=p();w!==null&&w.setAttribute("tabIndex","-1"),n=null,e.hasAttribute("open")&&(e.setAttribute("tabIndex","0"),e.focus())}function p(){return n}function v(w,E=!1){if(w==="")return null;let k=o.getItems(),S=w.toLowerCase(),$=p(),re=$?k.indexOf($):-1;if(!E&&$&&re!==-1&&B($)&&($.textContent?.trim().toLowerCase()||"").startsWith(S))return $;for(let D=re+1;D<k.length;D++)if((k[D].textContent?.trim().toLowerCase()||"").startsWith(S)&&B(k[D]))return k[D];for(let D=0;D<=re;D++)if((k[D].textContent?.trim().toLowerCase()||"").startsWith(S)&&B(k[D]))return k[D];return null}function y(w){let E=r==="";i&&(clearTimeout(i),i=null),r+=w.toLowerCase();let k=v(r,E);k&&f(k,!0),i=setTimeout(()=>{r="",i=null},350)}function T(){return r!==""}return{ignoreNextFocusRestoration:()=>s=Date.now()+100,setActiveItem:f,clearActiveItem:h,getActiveItem:p,findItemBySearchQuery:v,handleSearchKey:y,hasActiveSearchQuery:T}}var ne,Ee,C,ot,mo,tt=class extends A{constructor(){super(...arguments);L(this,ot);L(this,ne,this.attachInternals());L(this,Ee,"");L(this,C,null)}mount(t){let n=this.getOptions();this.value=this.getAttribute("value")??this.value??"";let r=this.getButton();r.id||(r.id=P("select-button")),z(r,"--button-width",t,this),r.addEventListener("keydown",s=>{if(!r.matches(":disabled"))switch(s.key){case"ArrowUp":{n.showPopover(),this.goToItem("selected"),s.preventDefault();break}case"ArrowDown":{n.showPopover(),this.goToItem("selected"),s.preventDefault();break}case"Enter":{s.preventDefault(),d(this,ne).form&&d(this,ne).form.requestSubmit();break}case" ":{if(n.hasAttribute("open")&&d(this,C)&&d(this,C).hasActiveSearchQuery()){s.preventDefault(),s.stopPropagation(),d(this,C).handleSearchKey(s.key);break}s.preventDefault(),n.hasAttribute("open")?n.hidePopover():(n.showPopover(),this.goToItem("selected"));break}default:{n.hasAttribute("open")&&s.key.length===1&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&(s.preventDefault(),s.stopPropagation(),this.handleSearchKey(s.key));break}}},{signal:t});for(let s of d(this,ne).labels)s.setAttribute("for",r.id);I(this,C,Lt(n,{role:"listbox",getItems:()=>this.getItems(),onItemClick:s=>this.setSelectedOption(s),getButton:()=>this.getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},t)),n.addEventListener("keydown",s=>{switch(s.key){case"ArrowDown":return s.preventDefault(),s.stopPropagation(),this.goToItem(3);case"ArrowUp":return s.preventDefault(),s.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return s.preventDefault(),s.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return s.preventDefault(),s.stopPropagation(),this.goToItem(1);case" ":if(d(this,C)&&d(this,C).hasActiveSearchQuery()){s.preventDefault(),s.stopPropagation(),d(this,C).handleSearchKey(s.key);return}case"Enter":{s.preventDefault(),s.stopPropagation();let a=this.getActiveItem();a?a.click():n.hidePopover();return}case"Tab":{d(this,C)&&d(this,C).ignoreNextFocusRestoration();break}case"Escape":{s.preventDefault(),s.stopPropagation(),n.hidePopover(),r.focus();break}default:{s.key.length===1&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&(s.preventDefault(),s.stopPropagation(),d(this,C)&&d(this,C).handleSearchKey(s.key));break}}},{signal:t}),n.addEventListener("toggle",s=>{s.newState==="open"&&this.onOpen()},{signal:t});let i=Array.from(n.querySelectorAll("el-option[disabled]"));for(let s of i)s.setAttribute("aria-disabled","true"),s.setAttribute("aria-selected","false")}onAttributeChange(t,n,r){switch(t){case"value":{r!==null&&(this.value=r);break}case"required":{H(this,ot,mo).call(this);break}}}getButton(){let t=this.querySelector("button");if(!t)throw new Error("`<el-select>` must contain a button element.");return t}getOptions(){let t=this.querySelector("el-options");if(!t)throw new Error("`<el-select>` must contain a `<el-options>` element.");return t}setSelectedOption(t){this.value=t.getAttribute("value"),this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover()}getOptionByName(t){return this.getOptions().getOptionByName(t)}getItems(){return this.getOptions().getItems()}getActiveItem(){return d(this,C)?.getActiveItem()}getSelectedOption(){return this.getOptionByName(d(this,Ee))}goToItem(t=4){let n=this.getItems();if(n.length===0)return;let r=this.getActiveItem();if(r===null&&(t===2||t===3)){this.goToItem("selected");return}if(t==="selected"){let s=this.getSelectedOption();s&&B(s)?this.setActiveItem(s):this.goToItem(0);return}let i=Y(n,r,t);i&&this.setActiveItem(i)}setActiveItem(t){d(this,C)&&d(this,C).setActiveItem(t)}clearActiveItem(){d(this,C)&&d(this,C).clearActiveItem()}onBeforeOpen(){let t=this.getButton(),n=t.dataset.originalTabIndex;n&&(t.dataset.originalTabIndex=n),t.setAttribute("tabIndex","-1")}onOpen(){this.getActiveItem()===null&&this.goToItem("selected")}onBeforeClose(){let t=this.getButton(),n=t.dataset.originalTabIndex;delete t.dataset.originalTabIndex,n!==void 0?t.setAttribute("tabIndex",n):t.removeAttribute("tabIndex");let r=this.getActiveItem();r!==null&&r.setAttribute("tabIndex","-1")}handleSearchKey(t){d(this,C)&&d(this,C).handleSearchKey(t)}set value(t){I(this,Ee,t),d(this,ne).setFormValue(t),H(this,ot,mo).call(this);let n=this.getSelectedOption();if(n){for(let r of this.getItems())r.setAttribute("aria-selected","false");n.setAttribute("aria-selected","true");try{this.querySelectorAll("el-selectedcontent").forEach(r=>r.update())}catch{}}}get value(){return d(this,Ee)}};ne=new WeakMap,Ee=new WeakMap,C=new WeakMap,ot=new WeakSet,mo=function(){if(!this.hasAttribute("required")||d(this,Ee)){d(this,ne).setValidity({});return}d(this,ne).setValidity({valueMissing:!0},yn.selectRequired,this.getButton())},M(tt,"formAssociated",!0),M(tt,"observedAttributes",["required"]);var ho=class extends A{mount(){this.update()}update(){let t=this.getSelect().getSelectedOption();if(!t)return;let n=document.createDocumentFragment();for(let r of t.childNodes)n.append(r.cloneNode(!0));this.replaceChildren(n)}getSelect(){let o=this.closest("el-select");if(!o)throw new Error("`<el-selectedcontent>` must be inside of a `<el-select>` element.");return o}};x("el-select",tt);x("el-selectedcontent",ho);var go=class extends A{getButton(){let o=this.querySelector("button");if(!o)throw new Error("[ElDropdown] No `<button>` element found");return o}mount(o){let t=this.getButton();t.id||(t.id=P("dropdown-button")),z(t,"--button-width",o,this);let n=this.querySelectorAll("label");for(let r of n)r.setAttribute("for",t.id)}},O,It=class extends A{constructor(){super(...arguments);L(this,O,null)}mount(t){I(this,O,Lt(this,{role:"menu",getItems:()=>this.getItems(),onItemClick:()=>this.hidePopover(),getButton:()=>this.getDropdown().getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},t));let r=this.getDropdown().getButton();r.addEventListener("keydown",i=>{if(!r.disabled)switch(i.key){case"ArrowDown":{this.showPopover(),this.goToItem(0),i.preventDefault();break}case"ArrowUp":{this.showPopover(),this.goToItem(1),i.preventDefault();break}case" ":if(this.hasAttribute("open")&&d(this,O)&&d(this,O).hasActiveSearchQuery()){i.preventDefault(),i.stopPropagation(),d(this,O).handleSearchKey(i.key);break}case"Enter":{i.preventDefault(),this.hasAttribute("open")?this.hidePopover():(this.showPopover(),this.goToItem(0));break}default:{this.hasAttribute("open")&&i.key.length===1&&!i.ctrlKey&&!i.altKey&&!i.metaKey&&(i.preventDefault(),i.stopPropagation(),d(this,O)&&d(this,O).handleSearchKey(i.key));break}}},{signal:t}),this.addEventListener("keydown",i=>{switch(i.key){case"ArrowDown":return i.preventDefault(),i.stopPropagation(),this.goToItem(3);case"ArrowUp":return i.preventDefault(),i.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return i.preventDefault(),i.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return i.preventDefault(),i.stopPropagation(),this.goToItem(1);case" ":if(d(this,O)&&d(this,O).hasActiveSearchQuery()){i.preventDefault(),i.stopPropagation(),d(this,O).handleSearchKey(i.key);return}case"Enter":{i.preventDefault(),i.stopPropagation();let s=this.getActiveItem();s?s.click():this.hidePopover();return}case"Tab":{d(this,O)&&d(this,O).ignoreNextFocusRestoration();break}case"Escape":{i.preventDefault(),i.stopPropagation(),this.hidePopover(),r.focus();break}default:{i.key.length===1&&!i.ctrlKey&&!i.altKey&&!i.metaKey&&(i.preventDefault(),i.stopPropagation(),d(this,O)&&d(this,O).handleSearchKey(i.key));break}}},{signal:t})}onBeforeOpen(){let n=this.getDropdown().getButton(),r=n.dataset.originalTabIndex;r&&(n.dataset.originalTabIndex=r),n.setAttribute("tabIndex","-1"),this.getActiveItem()===null&&(this.setAttribute("tabIndex","0"),setTimeout(()=>this.focus({preventScroll:!0})))}onBeforeClose(){let n=this.getDropdown().getButton(),r=n.dataset.originalTabIndex;delete n.dataset.originalTabIndex,r!==void 0?n.setAttribute("tabIndex",r):n.removeAttribute("tabIndex");let i=this.getActiveItem();i!==null&&i.setAttribute("tabIndex","-1")}goToItem(t=4){let n=this.getItems();if(n.length===0)return;let r=this.getActiveItem(),i=Y(n,r,t);i&&this.setActiveItem(i)}setActiveItem(t){d(this,O)&&d(this,O).setActiveItem(t)}clearActiveItem(){d(this,O)&&d(this,O).clearActiveItem()}getDropdown(){let t=this.closest("el-dropdown");if(!t)throw new Error("[ElMenu] No `<el-dropdown>` element found");return t}getItems(){return Array.from(this.querySelectorAll(`${ae},[role="menuitem"]`))}getActiveItem(){return d(this,O)?.getActiveItem()||null}onAttributeChange(t,n,r){switch(t){case"open":{r===null?this.hidePopover():this.showPopover();break}}}};O=new WeakMap,M(It,"observedAttributes",["anchor","open"]);x("el-menu",It);x("el-dropdown",go);var kt=class extends A{onAttributeChange(o,t,n){switch(o){case"open":{n===null?this.hidePopover():this.showPopover();break}}}getOptionByName(o){let t=this.querySelector(`el-option[value="${o}"]`);return t||null}getItems(){return Array.from(this.querySelectorAll("el-option:not([disabled])"))}};M(kt,"observedAttributes",["anchor","open"]);var bo=class extends A{};x("el-options",kt);x("el-option",bo);var vo=class extends A{getPopovers(){return Array.from(this.querySelectorAll("* > el-popover"))}},Pt=class extends A{mount(o){if(!this.id)throw new Error("[ElPopover] No id found for popover (ensure `id` is set)");let n=this.getButtons();for(let a of n)a.id||(a.id=P("popover-button")),a.addEventListener("keydown",l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),this.togglePopover())},{signal:o});Me(this,o,()=>this.getButtons()),this.setAttribute("tabindex","-1");let r=this,i=this.closest("el-popover-group");i&&i.getPopovers().includes(this)&&(r=i),St(r,n,this,o,()=>this.hidePopover());let s=new AbortController;o.addEventListener("abort",()=>s.abort()),this.addEventListener("beforetoggle",a=>{if(a.newState==="open"){let l=vt(a,n);l&&z(l,"--button-width",s.signal,this)}else s.abort(),s=new AbortController}),this.addEventListener("toggle",a=>{a.newState==="closed"&&a.oldState==="open"&&setTimeout(()=>{if(!this.contains(document.activeElement)&&document.activeElement!==document.body)return;let l=vt(a,n);l&&l!==document.activeElement&&l.isConnected&&Le(l)})},{signal:o})}getButtons(){let o=this.id,t=Array.from(document.querySelectorAll(`[popovertarget="${o}"]`));if(!t)throw new Error('[ElPopover] No button found for popover (ensure you add a `<button popovertarget="${id}">` on the page)');return t}onAttributeChange(o,t,n){switch(o){case"open":{n===null?this.hidePopover():this.showPopover();break}}}};M(Pt,"observedAttributes",["anchor","open"]);x("el-popover",Pt);x("el-popover-group",vo);var wo=class extends A{mount(o){let t=this.getList(),n=this.getPanels(),r=t.getTabButtons(),i=n.getPanels();if(r.length!==i.length){console.warn("[ElTabGroup] Mismatch between number of tabs and panels");return}for(let a=0;a<i.length;a++){let l=i[a],u=r[a];u.id||(u.id=P("tailwindplus-tab")),l.id||(l.id=P("tailwindplus-tab-panel")),l.setAttribute("aria-labelledby",u.id),u.setAttribute("aria-controls",l.id),u.setAttribute("role","tab")}let s=this.getActiveTab();s===-1&&(s=0),t.setActiveTab(s),n.setActivePanel(s),t.addEventListener("keydown",a=>{switch(a.key){case"ArrowLeft":{a.preventDefault();let u=this.getActiveTab()-1;u<0&&(u=r.length-1),this.setActiveTab(u),r[u].focus();break}case"ArrowRight":{a.preventDefault();let u=this.getActiveTab()+1;u>=r.length&&(u=0),this.setActiveTab(u),r[u].focus();break}case"Home":case"PageUp":{a.preventDefault(),this.setActiveTab(0),r[0].focus();break}case"End":case"PageDown":{a.preventDefault(),this.setActiveTab(r.length-1),r[r.length-1].focus();break}}},{signal:o});for(let a=0;a<r.length;a++)r[a].addEventListener("click",u=>{u.preventDefault(),this.setActiveTab(a)},{signal:o})}getActiveTab(){let o=this.querySelector("el-tab-panels"),t=o.getPanels().find(n=>!n.hasAttribute("hidden"));return t?o.getPanels().indexOf(t):-1}getList(){let o=this.querySelector("el-tab-list");if(!o)throw new Error("[ElTabGroup] No `<el-tab-list>` element found");return o}getPanels(){let o=this.querySelector("el-tab-panels");if(!o)throw new Error("[ElTabGroup] No `<el-tab-panels>` element found");return o}setActiveTab(o){if(this.getActiveTab()===o)return;let n=this.getList(),r=this.getPanels(),i=n.getTabButtons();o<0||o>=i.length||(n.setActiveTab(o),r.setActivePanel(o))}},yo=class extends A{mount(){this.setAttribute("role","tablist"),this.setAttribute("aria-orientation","horizontal")}getTabButtons(){let o=this.querySelectorAll("button");return Array.from(o)}setActiveTab(o){this.getTabButtons().forEach((n,r)=>{let i=r===o;n.setAttribute("tabindex",i?"0":"-1"),n.setAttribute("aria-selected",i?"true":"false")})}},Eo=class extends A{mount(){let t=this.getTabGroup().getList(),n=this.getPanels(),r=new MutationObserver(i=>{for(let s of i){let a=s.target;switch(s.attributeName){case"hidden":if(!a.hasAttribute(s.attributeName)){let l=n.indexOf(a);t.setActiveTab(l),this.setActivePanel(l)}}}});for(let i of n)i.setAttribute("role","tabpanel"),i.setAttribute("tabindex","0"),r.observe(i,{attributeFilter:["hidden"],attributes:!0})}getTabGroup(){let o=this.closest("el-tab-group");if(!o)throw new Error("`<el-tab-panels>` must be inside of a `<el-tab-group>` element.");return o}getPanels(){return Array.from(this.children)}setActivePanel(o){this.getPanels().forEach((n,r)=>{n.toggleAttribute("hidden",r!==o)})}};x("el-tab-list",yo);x("el-tab-panels",Eo);x("el-tab-group",wo);var Ao=class extends A{mount(o){let t=new WeakMap;this.addEventListener("command",n=>{let r=n;if(r.command!=="--copy")return;let i=r.source;t.get(i)?.abort();let s=new AbortController;t.set(i,s);let a=this.textContent??"";return navigator.clipboard.writeText(a).then(()=>{i.dataset.copied=""}).catch(l=>{i.dataset.error="",console.error("Failed to copy text: ",l)}).finally(()=>{let l=setTimeout(()=>{delete i.dataset.copied,delete i.dataset.error},2e3);s.signal.addEventListener("abort",()=>clearTimeout(l),{once:!0})})},{signal:o})}};x("el-copyable",Ao);typeof globalThis.window<"u"&&setTimeout(()=>window.dispatchEvent(new Event("elements:ready")));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// cropperjs@2.1.0 vendored from npm
|
|
2
|
+
/*! Cropper.js v2.1.0 | (c) 2015-present Chen Fengyuan | MIT */
|
|
3
|
+
const t="undefined"!=typeof window&&void 0!==window.document,e=t?window:{},i=!!t&&"ontouchstart"in e.document.documentElement,s=!!t&&"PointerEvent"in e,n="cropper",a=`${n}-canvas`,o=`${n}-crosshair`,r=`${n}-grid`,h=`${n}-handle`,c=`${n}-image`,l=`${n}-selection`,d=`${n}-shade`,u=`${n}-viewer`,$="select",p="move",g="scale",m="rotate",b="transform",f="none",v="n-resize",w="e-resize",y="s-resize",C="w-resize",S="ne-resize",k="nw-resize",x="se-resize",A="sw-resize",E="action",T=i?"touchend touchcancel":"mouseup",z=i?"touchmove":"mousemove",M=i?"touchstart":"mousedown",D=s?"pointerdown":M,P=s?"pointermove":z,O=s?"pointerup pointercancel":T,I="error",N="keydown",R="load",X="resize",Y="wheel",W="action",L="actionend",j="actionmove",q="actionstart",H="change",B="transform";function U(t){return"string"==typeof t}const K=Number.isNaN||e.isNaN;function F(t){return"number"==typeof t&&!K(t)}function Z(t){return F(t)&&t>0&&t<1/0}function G(t){return void 0===t}function J(t){return"object"==typeof t&&null!==t}const{hasOwnProperty:Q}=Object.prototype;function V(t){if(!J(t))return!1;try{const{constructor:e}=t,{prototype:i}=e;return e&&i&&Q.call(i,"isPrototypeOf")}catch(t){return!1}}function _(t){return"function"==typeof t}function tt(t){return"object"==typeof t&&null!==t&&1===t.nodeType}const et=/([a-z\d])([A-Z])/g;function it(t){return String(t).replace(et,"$1-$2").toLowerCase()}const st=/-[A-z\d]/g;function nt(t){return t.replace(st,(t=>t.slice(1).toUpperCase()))}const at=/\s\s*/;function ot(t,e,i,s){e.trim().split(at).forEach((e=>{t.removeEventListener(e,i,s)}))}function rt(t,e,i,s){e.trim().split(at).forEach((e=>{t.addEventListener(e,i,s)}))}function ht(t,e,i,s){rt(t,e,i,Object.assign(Object.assign({},s),{once:!0}))}const ct={bubbles:!0,cancelable:!0,composed:!0};function lt(t,e,i,s){return t.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign(Object.assign({},ct),{detail:i}),s)))}function dt(t){if("function"==typeof t.composedPath){return t.composedPath().find(tt)||t.target}return t.target}const ut=Promise.resolve();function $t(t,e){return e?ut.then(t?e.bind(t):e):ut}function pt(t){const e=t.getRootNode();switch(e.nodeType){case 1:return e.ownerDocument;case 9:case 11:return e}return null}function gt(t){const{documentElement:i}=t.ownerDocument,s=t.getBoundingClientRect();return{left:s.left+(e.pageXOffset-i.clientLeft),top:s.top+(e.pageYOffset-i.clientTop)}}const mt=/deg|g?rad|turn$/i;function bt(t){const e=parseFloat(t)||0;if(0!==e){const[i="rad"]=String(t).match(mt)||[];switch(i.toLowerCase()){case"deg":return e/360*(2*Math.PI);case"grad":return e/400*(2*Math.PI);case"turn":return e*(2*Math.PI)}}return e}const ft="contain";function vt(t,e=ft){const{aspectRatio:i}=t;let{width:s,height:n}=t;const a=Z(s),o=Z(n);if(a&&o){const t=n*i;e===ft&&t>s||"cover"===e&&t<s?n=s/i:s=n*i}else a?n=s/i:o&&(s=n*i);return{width:s,height:n}}function wt(t,...e){if(0===e.length)return t;const[i,s,n,a,o,r]=t,[h,c,l,d,u,$]=e[0];return wt(t=[i*h+n*c,s*h+a*c,i*l+n*d,s*l+a*d,i*u+n*$+o,s*u+a*$+r],...e.slice(1))}const yt=/left|top|width|height/i,Ct="open",St=new WeakMap,kt=new WeakMap,xt=new Map,At=e.document&&Array.isArray(e.document.adoptedStyleSheets)&&"replaceSync"in e.CSSStyleSheet.prototype;class Et extends HTMLElement{get $sharedStyle(){return(this.themeColor?`:host{--theme-color: ${this.themeColor};}`:"")+":host([hidden]){display:none!important}"}constructor(){var t,e;super(),this.shadowRootMode=Ct,this.slottable=!0;const i=null===(e=null===(t=Object.getPrototypeOf(this))||void 0===t?void 0:t.constructor)||void 0===e?void 0:e.$name;i&&xt.set(i,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(t,e,i){if(Object.is(i,e))return;const s=nt(t);let n=i;switch(typeof this[s]){case"boolean":n=null!==i&&"false"!==i;break;case"number":n=Number(i)}switch(this[s]=n,t){case"theme-color":{const t=kt.get(this),e=this.$sharedStyle;t&&e&&(At?t.replaceSync(e):t.textContent=e);break}}}$propertyChangedCallback(t,e,i){if(!Object.is(i,e))switch(t=it(t),typeof i){case"boolean":!0===i?this.hasAttribute(t)||this.setAttribute(t,""):this.removeAttribute(t);break;case"number":i=K(i)?"":String(i);default:i?this.getAttribute(t)!==i&&this.setAttribute(t,i):this.removeAttribute(t)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach((t=>{const e=nt(t);let i=this[e];G(i)||this.$propertyChangedCallback(e,void 0,i),Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>i,set(t){const s=i;i=t,this.$propertyChangedCallback(e,s,t)}})}));const t=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||Ct});if(St.set(this,t),kt.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){const e=document.createElement("template");e.innerHTML=this.$template,t.appendChild(e.content)}if(this.slottable){const e=document.createElement("slot");t.appendChild(e)}}disconnectedCallback(){kt.has(this)&&kt.delete(this),St.has(this)&&St.delete(this)}$getTagNameOf(t){var e;return null!==(e=xt.get(t))&&void 0!==e?e:t}$setStyles(t){return Object.keys(t).forEach((e=>{let i=t[e];F(i)&&(i=0!==i&&yt.test(e)?`${i}px`:String(i)),this.style[e]=i})),this}$getShadowRoot(){return this.shadowRoot||St.get(this)}$addStyles(t){let e;const i=this.$getShadowRoot();return At?(e=new CSSStyleSheet,e.replaceSync(t),i.adoptedStyleSheets=i.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=t,i.appendChild(e)),e}$emit(t,e,i){return lt(this,t,e,i)}$nextTick(t){return $t(this,t)}static $define(i,s){J(i)&&(s=i,i=""),i||(i=this.$name||this.name),i=it(i),t&&e.customElements&&!e.customElements.get(i)&&customElements.define(i,this,s)}}Et.$version="2.1.0";class Tt extends Et{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',this.$action=f,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(t,e,i){if(!Object.is(i,e)&&(super.$propertyChangedCallback(t,e,i),"disabled"===t))i?this.$unbind():this.$bind()}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),rt(this,D,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),rt(this.ownerDocument,P,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),rt(this.ownerDocument,O,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),rt(this,Y,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(ot(this,D,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(ot(this.ownerDocument,P,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(ot(this.ownerDocument,O,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(ot(this,Y,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(t){const{buttons:e,button:i,type:s}=t;if(this.disabled||("pointerdown"===s&&"mouse"===t.pointerType||"mousedown"===s)&&(F(e)&&1!==e||F(i)&&0!==i||t.ctrlKey))return;const{$pointers:n}=this;let a="";if(t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t,pageX:e,pageY:i})=>{n.set(t,{startX:e,startY:i,endX:e,endY:i})}));else{const{pointerId:e=0,pageX:i,pageY:s}=t;n.set(e,{startX:i,startY:s,endX:i,endY:s})}n.size>1?a=b:tt(t.target)&&(a=t.target.action||t.target.getAttribute(E)||""),!1!==this.$emit(q,{action:a,relatedEvent:t})&&(t.preventDefault(),this.$action=a,this.style.willChange="transform")}$handlePointerMove(t){const{$action:e,$pointers:i}=this;if(this.disabled||e===f||0===i.size)return;if(!1===this.$emit(j,{action:e,relatedEvent:t}))return;if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t,pageX:e,pageY:s})=>{const n=i.get(t);n&&Object.assign(n,{endX:e,endY:s})}));else{const{pointerId:e=0,pageX:s,pageY:n}=t,a=i.get(e);a&&Object.assign(a,{endX:s,endY:n})}const s={action:e,relatedEvent:t};if(e===b){const e=new Map(i);let n=0,a=0,o=0,r=0,h=t.pageX,c=t.pageY;i.forEach(((t,i)=>{e.delete(i),e.forEach((e=>{let i=e.startX-t.startX,s=e.startY-t.startY,l=e.endX-t.endX,d=e.endY-t.endY,u=0,$=0,p=0,g=0;if(0===i?s<0?p=2*Math.PI:s>0&&(p=Math.PI):i>0?p=Math.PI/2+Math.atan(s/i):i<0&&(p=1.5*Math.PI+Math.atan(s/i)),0===l?d<0?g=2*Math.PI:d>0&&(g=Math.PI):l>0?g=Math.PI/2+Math.atan(d/l):l<0&&(g=1.5*Math.PI+Math.atan(d/l)),g>0||p>0){const i=g-p,s=Math.abs(i);s>n&&(n=s,o=i,h=(t.startX+e.startX)/2,c=(t.startY+e.startY)/2)}if(i=Math.abs(i),s=Math.abs(s),l=Math.abs(l),d=Math.abs(d),i>0&&s>0?u=Math.sqrt(i*i+s*s):i>0?u=i:s>0&&(u=s),l>0&&d>0?$=Math.sqrt(l*l+d*d):l>0?$=l:d>0&&($=d),u>0&&$>0){const i=($-u)/u,s=Math.abs(i);s>a&&(a=s,r=i,h=(t.startX+e.startX)/2,c=(t.startY+e.startY)/2)}}))}));const l=n>0,d=a>0;l&&d?(s.rotate=o,s.scale=r,s.centerX=h,s.centerY=c):l?(s.action=m,s.rotate=o,s.centerX=h,s.centerY=c):d?(s.action=g,s.scale=r,s.centerX=h,s.centerY=c):s.action=f}else{const[t]=Array.from(i.values());Object.assign(s,t)}i.forEach((t=>{t.startX=t.endX,t.startY=t.endY})),s.action!==f&&this.$emit(W,s,{cancelable:!1})}$handlePointerUp(t){const{$action:e,$pointers:i}=this;if(!this.disabled&&e!==f&&!1!==this.$emit(L,{action:e,relatedEvent:t})){if(t.preventDefault(),t.changedTouches)Array.from(t.changedTouches).forEach((({identifier:t})=>{i.delete(t)}));else{const{pointerId:e=0}=t;i.delete(e)}0===i.size&&(this.style.willChange="",this.$action=f)}}$handleWheel(t){if(this.disabled)return;if(t.preventDefault(),this.$wheeling)return;this.$wheeling=!0,setTimeout((()=>{this.$wheeling=!1}),50);const e=(t.deltaY>0?-1:1)*this.scaleStep;this.$emit(W,{action:g,scale:e,relatedEvent:t},{cancelable:!1})}$setAction(t){return U(t)&&(this.$action=t),this}$toCanvas(t){return new Promise(((e,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const s=document.createElement("canvas");let n=this.offsetWidth,a=this.offsetHeight,o=1;V(t)&&(Z(t.width)||Z(t.height))&&(({width:n,height:a}=vt({aspectRatio:n/a,width:t.width,height:t.height})),o=n/this.offsetWidth),s.width=n,s.height=a;const r=this.querySelector(this.$getTagNameOf(c));r?r.$ready().then((i=>{const h=s.getContext("2d");if(h){const[e,c,l,d,u,$]=r.$getTransform();let p=u,g=$,m=i.naturalWidth,b=i.naturalHeight;1!==o&&(p*=o,g*=o,m*=o,b*=o);const f=m/2,v=b/2;h.fillStyle="transparent",h.fillRect(0,0,n,a),V(t)&&_(t.beforeDraw)&&t.beforeDraw.call(this,h,s),h.save(),h.translate(f,v),h.transform(e,c,l,d,p,g),h.translate(-f,-v),h.drawImage(i,0,0,m,b),h.restore()}e(s)})).catch(i):e(s)}))}}Tt.$name=a,Tt.$version="2.1.0";const zt=new WeakMap,Mt=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"];class Dt extends Et{constructor(){super(...arguments),this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(t){zt.set(this,t)}get $canvas(){return zt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(Mt,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(t,e,i){Object.is(i,e)||(super.attributeChangedCallback(t,e,i),Mt.includes(t)&&this.$image.setAttribute(t,i))}$propertyChangedCallback(t,e,i){if(!Object.is(i,e)&&(super.$propertyChangedCallback(t,e,i),"initialCenterSize"===t))this.$nextTick((()=>{this.$center(i)}))}connectedCallback(){super.connectedCallback();const{$image:t}=this,e=this.closest(this.$getTagNameOf(a));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var e,i;this.$actionStartTarget=null===(i=null===(e=t.detail)||void 0===e?void 0:e.relatedEvent)||void 0===i?void 0:i.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),rt(e,q,this.$onCanvasActionStart),rt(e,L,this.$onCanvasActionEnd),rt(e,W,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),rt(t,R,this.$onLoad),this.$getShadowRoot().appendChild(t)}disconnectedCallback(){const{$image:t,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(ot(e,q,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ot(e,L,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ot(e,W,this.$onCanvasAction),this.$onCanvasAction=null)),t&&this.$onLoad&&(ot(t,R,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(t),super.disconnectedCallback()}$handleLoad(){const{$image:t}=this;this.$setStyles({width:t.naturalWidth,height:t.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize)}$handleAction(t){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;const{$canvas:e}=this,{detail:i}=t;if(i){const{relatedEvent:t}=i;let{action:s}=i;switch(s!==b||this.rotatable&&this.scalable||(s=this.rotatable?m:this.scalable?g:f),s){case p:if(this.translatable){let s=null;t&&(s=t.target.closest(this.$getTagNameOf(l))),s||(s=e.querySelector(this.$getTagNameOf(l))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(l)}[active]`)),s&&!s.hidden&&s.movable&&!s.dynamic&&this.$actionStartTarget&&s.contains(this.$actionStartTarget)||this.$move(i.endX-i.startX,i.endY-i.startY)}break;case m:if(this.rotatable)if(t){const{x:e,y:s}=this.getBoundingClientRect();this.$rotate(i.rotate,t.clientX-e,t.clientY-s)}else this.$rotate(i.rotate);break;case g:if(this.scalable)if(t){const e=t.target.closest(this.$getTagNameOf(l));if(!e||!e.zoomable||e.zoomable&&e.dynamic){const{x:e,y:s}=this.getBoundingClientRect();this.$zoom(i.scale,t.clientX-e,t.clientY-s)}}else this.$zoom(i.scale);break;case b:if(this.rotatable&&this.scalable){const{rotate:e}=i;let{scale:s}=i;s<0?s=1/(1-s):s+=1;const n=Math.cos(e),a=Math.sin(e),[o,r,h,c]=[n*s,a*s,-a*s,n*s];if(t){const e=this.getBoundingClientRect(),i=t.clientX-e.x,s=t.clientY-e.y,[n,a,l,d]=this.$matrix,u=i-e.width/2,$=s-e.height/2,p=(u*d-l*$)/(n*d-l*a),g=($*n-a*u)/(n*d-l*a);this.$transform(o,r,h,c,p*(1-o)+g*h,g*(1-c)+p*r)}else this.$transform(o,r,h,c,0,0)}}}}$ready(t){const{$image:e}=this,i=new Promise(((t,i)=>{const s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?t(e):i(s);else{const n=()=>{ot(e,I,a),setTimeout((()=>{t(e)}))},a=()=>{ot(e,R,n),i(s)};ht(e,R,n),ht(e,I,a)}}));return _(t)&&i.then((e=>(t(e),e))),i}$center(t){const{parentElement:e}=this;if(!e)return this;const i=e.getBoundingClientRect(),s=i.width,n=i.height,{x:a,y:o,width:r,height:h}=this.getBoundingClientRect(),c=a+r/2,l=o+h/2,d=i.x+s/2,u=i.y+n/2;if(this.$move(d-c,u-l),t&&(r!==s||h!==n)){const e=s/r,i=n/h;switch(t){case"cover":this.$scale(Math.max(e,i));break;case"contain":this.$scale(Math.min(e,i))}}return this}$move(t,e=t){if(this.translatable&&F(t)&&F(e)){const[i,s,n,a]=this.$matrix,o=(t*a-n*e)/(i*a-n*s),r=(e*i-s*t)/(i*a-n*s);this.$translate(o,r)}return this}$moveTo(t,e=t){if(this.translatable&&F(t)&&F(e)){const[i,s,n,a]=this.$matrix,o=(t*a-n*e)/(i*a-n*s),r=(e*i-s*t)/(i*a-n*s);this.$setTransform(i,s,n,a,o,r)}return this}$rotate(t,e,i){if(this.rotatable){const s=bt(t),n=Math.cos(s),a=Math.sin(s),[o,r,h,c]=[n,a,-a,n];if(F(e)&&F(i)){const[t,s,n,a]=this.$matrix,{width:l,height:d}=this.getBoundingClientRect(),u=e-l/2,$=i-d/2,p=(u*a-n*$)/(t*a-n*s),g=($*t-s*u)/(t*a-n*s);this.$transform(o,r,h,c,p*(1-o)-g*h,g*(1-c)-p*r)}else this.$transform(o,r,h,c,0,0)}return this}$zoom(t,e,i){if(!this.scalable||0===t)return this;if(t<0?t=1/(1-t):t+=1,F(e)&&F(i)){const[s,n,a,o]=this.$matrix,{width:r,height:h}=this.getBoundingClientRect(),c=e-r/2,l=i-h/2,d=(c*o-a*l)/(s*o-a*n),u=(l*s-n*c)/(s*o-a*n);this.$transform(t,0,0,t,d*(1-t),u*(1-t))}else this.$scale(t);return this}$scale(t,e=t){return this.scalable&&this.$transform(t,0,0,e,0,0),this}$skew(t,e=0){if(this.skewable){const i=bt(t),s=bt(e);this.$transform(1,Math.tan(s),Math.tan(i),1,0,0)}return this}$translate(t,e=t){return this.translatable&&F(t)&&F(e)&&this.$transform(1,0,0,1,t,e),this}$transform(t,e,i,s,n,a){return F(t)&&F(e)&&F(i)&&F(s)&&F(n)&&F(a)?this.$setTransform(wt(this.$matrix,[t,e,i,s,n,a])):this}$setTransform(t,e,i,s,n,a){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(t)&&([t,e,i,s,n,a]=t),F(t)&&F(e)&&F(i)&&F(s)&&F(n)&&F(a))){const o=[...this.$matrix],r=[t,e,i,s,n,a];if(!1===this.$emit(B,{matrix:r,oldMatrix:o}))return this;this.$matrix=r,this.style.transform=`matrix(${r.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}}Dt.$name=c,Dt.$version="2.1.0";const Pt=new WeakMap;class Ot extends Et{constructor(){super(...arguments),this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(t){Pt.set(this,t)}get $canvas(){return Pt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();const t=this.closest(this.$getTagNameOf(a));if(t){this.$canvas=t,this.style.position="absolute";const e=t.querySelector(this.$getTagNameOf(l));e&&(this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===$&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===$&&(this.hidden=!0)},this.$onSelectionChange=t=>{const{x:i,y:s,width:n,height:a}=t.defaultPrevented?e:t.detail;this.$change(i,s,n,a),(e.hidden||0===i&&0===s&&0===n&&0===a)&&(this.hidden=!0)},rt(t,q,this.$onCanvasActionStart),rt(t,L,this.$onCanvasActionEnd),rt(t,H,this.$onSelectionChange))}this.$render()}disconnectedCallback(){const{$canvas:t}=this;t&&(this.$onCanvasActionStart&&(ot(t,q,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ot(t,L,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(ot(t,H,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(t,e,i=this.width,s=this.height){return F(t)&&F(e)&&F(i)&&F(s)&&(t!==this.x||e!==this.y||i!==this.width||s!==this.height)?(this.hidden&&(this.hidden=!1),this.x=t,this.y=e,this.width=i,this.height=s,this.$render()):this}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:e.innerWidth})}}Ot.$name=d,Ot.$version="2.1.0";class It extends Et{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',this.action=f,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}}It.$name=h,It.$version="2.1.0";const Nt=new WeakMap;class Rt extends Et{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(t){Nt.set(this,t)}get $canvas(){return Nt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(t,e,i){if(!Object.is(i,e))switch(super.$propertyChangedCallback(t,e,i),t){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick((()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)}));break;case"aspectRatio":case"initialAspectRatio":this.$nextTick((()=>{this.$initSelection()}));break;case"initialCoverage":this.$nextTick((()=>{Z(i)&&i<=1&&this.$initSelection(!0,!0)}));break;case"keyboard":this.$nextTick((()=>{this.$canvas&&(i?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),rt(this.ownerDocument,N,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(ot(this.ownerDocument,N,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))}));break;case"multiple":this.$nextTick((()=>{if(this.$canvas){const t=this.$getSelections();i?(t.forEach((t=>{t.active=!1})),this.active=!0,this.$emit(H,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,t.slice(1).forEach((t=>{this.$removeSelection(t)})))}}));break;case"precise":this.$nextTick((()=>{this.$change(this.x,this.y)}));break;case"linked":i&&(this.dynamic=!0)}}connectedCallback(){super.connectedCallback();const t=this.closest(this.$getTagNameOf(a));t?(this.$canvas=t,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),rt(t,q,this.$onCanvasActionStart),rt(t,L,this.$onCanvasActionEnd),rt(t,W,this.$onCanvasAction)):this.$render()}disconnectedCallback(){const{$canvas:t}=this;t&&(this.$onCanvasActionStart&&(ot(t,q,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(ot(t,L,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(ot(t,W,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let t=[];return this.parentElement&&(t=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(l)))),t}$initSelection(t=!1,e=!1){const{initialCoverage:i,parentElement:s}=this;if(Z(i)&&s){const n=this.aspectRatio||this.initialAspectRatio;let a=(e?0:this.width)||s.offsetWidth*i,o=(e?0:this.height)||s.offsetHeight*i;Z(n)&&({width:a,height:o}=vt({aspectRatio:n,width:a,height:o})),this.$change(this.x,this.y,a,o),t&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){const t=this.cloneNode(!0);return this.hasAttribute("id")&&t.removeAttribute("id"),t.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(t,this.nextSibling),t}$removeSelection(t=this){if(this.parentElement){const e=this.$getSelections();if(e.length>1){const i=e.indexOf(t),s=e[i+1]||e[i-1];s&&(t.active=!1,this.parentElement.removeChild(t),s.active=!0,s.$emit(H,{x:s.x,y:s.y,width:s.width,height:s.height}))}else this.$clear()}}$handleActionStart(t){var e,i;const s=null===(i=null===(e=t.detail)||void 0===e?void 0:e.relatedEvent)||void 0===i?void 0:i.target;this.$action="",this.$actionStartTarget=s,!this.hidden&&this.multiple&&!this.active&&s===this&&this.parentElement&&(this.$getSelections().forEach((t=>{t.active=!1})),this.active=!0,this.$emit(H,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(t){const{currentTarget:e,detail:i}=t;if(!e||!i)return;const{relatedEvent:s}=i;let{action:n}=i;const a=s?dt(s):null;if(!n&&this.multiple&&(n=this.$action||(null==a?void 0:a.action),this.$action=n),!n||this.hidden&&n!==$||this.multiple&&!this.active&&n!==g)return;const{width:o,height:r}=this;let h=i.endX-i.startX,c=i.endY-i.startY,{aspectRatio:l}=this;switch(!Z(l)&&s.shiftKey&&(l=Z(o)&&Z(r)?o/r:1),n){case $:if(0!==h||0!==c){0===h?h=c:0===c&&(c=h);const{$canvas:t}=this,s=gt(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(i.startX-s.left,i.startY-s.top,Math.abs(h),Math.abs(c),l),h<0?c<0?n=k:c>0&&(n=A):h>0&&(c<0?n=S:c>0&&(n=x)),t&&(t.$action=n)}break;case p:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(h,c);break;case g:if(s&&this.zoomable&&(this.dynamic||this.contains(s.target))){const t=gt(e);this.$zoom(i.scale,s.pageX-t.left,s.pageY-t.top)}break;default:this.$resize(n,h,c,l)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(t){if(this.hidden||!this.keyboard||this.multiple&&!this.active||t.defaultPrevented)return;const{activeElement:e}=document;if(!e||!["INPUT","TEXTAREA"].includes(e.tagName)&&!["true","plaintext-only"].includes(e.contentEditable))switch(t.key){case"Backspace":t.metaKey&&(t.preventDefault(),this.$removeSelection());break;case"Delete":t.preventDefault(),this.$removeSelection();break;case"ArrowLeft":t.preventDefault(),this.$move(-1,0);break;case"ArrowRight":t.preventDefault(),this.$move(1,0);break;case"ArrowUp":t.preventDefault(),this.$move(0,-1);break;case"ArrowDown":t.preventDefault(),this.$move(0,1);break;case"+":t.preventDefault(),this.$zoom(.1);break;case"-":t.preventDefault(),this.$zoom(-.1)}}$center(){const{parentElement:t}=this;if(!t)return this;const e=(t.offsetWidth-this.width)/2,i=(t.offsetHeight-this.height)/2;return this.$change(e,i)}$move(t,e=t){return this.$moveTo(this.x+t,this.y+e)}$moveTo(t,e=t){return this.movable?this.$change(t,e):this}$resize(t,e=0,i=0,s=this.aspectRatio){if(!this.resizable)return this;const n=Z(s),{$canvas:a}=this;let{x:o,y:r,width:h,height:c}=this;switch(t){case v:r+=i,c-=i,c<0&&(t=y,c=-c,r-=c),n&&(o+=(e=i*s)/2,h-=e,h<0&&(h=-h,o-=h));break;case w:h+=e,h<0&&(t=C,h=-h,o-=h),n&&(r-=(i=e/s)/2,c+=i,c<0&&(c=-c,r-=c));break;case y:c+=i,c<0&&(t=v,c=-c,r-=c),n&&(o-=(e=i*s)/2,h+=e,h<0&&(h=-h,o-=h));break;case C:o+=e,h-=e,h<0&&(t=w,h=-h,o-=h),n&&(r+=(i=e/s)/2,c-=i,c<0&&(c=-c,r-=c));break;case S:n&&(i=-e/s),r+=i,c-=i,h+=e,h<0&&c<0?(t=A,h=-h,c=-c,o-=h,r-=c):h<0?(t=k,h=-h,o-=h):c<0&&(t=x,c=-c,r-=c);break;case k:n&&(i=e/s),o+=e,r+=i,h-=e,c-=i,h<0&&c<0?(t=x,h=-h,c=-c,o-=h,r-=c):h<0?(t=S,h=-h,o-=h):c<0&&(t=A,c=-c,r-=c);break;case x:n&&(i=e/s),h+=e,c+=i,h<0&&c<0?(t=k,h=-h,c=-c,o-=h,r-=c):h<0?(t=A,h=-h,o-=h):c<0&&(t=S,c=-c,r-=c);break;case A:n&&(i=-e/s),o+=e,h-=e,c+=i,h<0&&c<0?(t=S,h=-h,c=-c,o-=h,r-=c):h<0?(t=x,h=-h,o-=h):c<0&&(t=k,c=-c,r-=c)}return a&&a.$setAction(t),this.$change(o,r,h,c)}$zoom(t,e,i){if(!this.zoomable||0===t)return this;t<0?t=1/(1-t):t+=1;const{width:s,height:n}=this,a=s*t,o=n*t;let r=this.x,h=this.y;return F(e)&&F(i)?(r-=(a-s)*((e-this.x)/s),h-=(o-n)*((i-this.y)/n)):(r-=(a-s)/2,h-=(o-n)/2),this.$change(r,h,a,o)}$change(t,e,i=this.width,s=this.height,n=this.aspectRatio,a=!1){return this.$changing||!F(t)||!F(e)||!F(i)||!F(s)||i<0||s<0?this:(Z(n)&&({width:i,height:s}=vt({aspectRatio:n,width:i,height:s},"cover")),this.precise||(t=Math.round(t),e=Math.round(e),i=Math.round(i),s=Math.round(s)),t===this.x&&e===this.y&&i===this.width&&s===this.height&&Object.is(n,this.aspectRatio)&&!a?this:(this.hidden&&(this.hidden=!1),!1===this.$emit(H,{x:t,y:e,width:i,height:s})?this:(this.$changing=!0,this.x=t,this.y=e,this.width=i,this.height=s,this.$changing=!1,this.$render())))}$reset(){const{x:t,y:e,width:i,height:s}=this.$initialSelection;return this.$change(t,e,i,s)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(t){return new Promise(((e,i)=>{if(!this.isConnected)return void i(new Error("The current element is not connected to the DOM."));const s=document.createElement("canvas");let{width:n,height:a}=this,o=1;if(V(t)&&(Z(t.width)||Z(t.height))&&(({width:n,height:a}=vt({aspectRatio:n/a,width:t.width,height:t.height})),o=n/this.width),s.width=n,s.height=a,!this.$canvas)return void e(s);const r=this.$canvas.querySelector(this.$getTagNameOf(c));r?r.$ready().then((i=>{const h=s.getContext("2d");if(h){const[e,c,l,d,u,$]=r.$getTransform(),p=-this.x,g=-this.y,m=(p*d-l*g)/(e*d-l*c),b=(g*e-c*p)/(e*d-l*c);let f=e*m+l*b+u,v=c*m+d*b+$,w=i.naturalWidth,y=i.naturalHeight;1!==o&&(f*=o,v*=o,w*=o,y*=o);const C=w/2,S=y/2;h.fillStyle="transparent",h.fillRect(0,0,n,a),V(t)&&_(t.beforeDraw)&&t.beforeDraw.call(this,h,s),h.save(),h.translate(C,S),h.transform(e,c,l,d,f,v),h.translate(-C,-S),h.drawImage(i,0,0,w,y),h.restore()}e(s)})).catch(i):e(s)}))}}Rt.$name=l,Rt.$version="2.1.0";class Xt extends Et{constructor(){super(...arguments),this.$style=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(t,e,i){Object.is(i,e)||(super.$propertyChangedCallback(t,e,i),"rows"!==t&&"columns"!==t||this.$nextTick((()=>{this.$render()})))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){const t=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){const t=document.createElement("span");t.setAttribute("role","row");for(let e=0;e<this.columns;e+=1){const e=document.createElement("span");e.setAttribute("role","gridcell"),t.appendChild(e)}e.appendChild(t)}t&&(t.innerHTML="",t.appendChild(e))}}Xt.$name=r,Xt.$version="2.1.0";class Yt extends Et{constructor(){super(...arguments),this.$style=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}}Yt.$name=o,Yt.$version="2.1.0";const Wt=new WeakMap,Lt=new WeakMap,jt=new WeakMap,qt=new WeakMap,Ht="vertical";class Bt extends Et{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",this.resize=Ht,this.selection="",this.slottable=!1}set $image(t){Lt.set(this,t)}get $image(){return Lt.get(this)}set $sourceImage(t){qt.set(this,t)}get $sourceImage(){return qt.get(this)}set $canvas(t){Wt.set(this,t)}get $canvas(){return Wt.get(this)}set $selection(t){jt.set(this,t)}get $selection(){return jt.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var t,e;super.connectedCallback();let i=null;if(i=this.selection?null!==(e=null===(t=pt(this))||void 0===t?void 0:t.querySelector(this.selection))&&void 0!==e?e:null:this.closest(this.$getTagNameOf(l)),tt(i)){this.$selection=i,this.$onSelectionChange=this.$handleSelectionChange.bind(this),rt(i,H,this.$onSelectionChange);const t=i.closest(this.$getTagNameOf(a));if(t){this.$canvas=t;const e=t.querySelector(this.$getTagNameOf(c));e&&(this.$sourceImage=e,this.$image=e.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),rt(e.$image,R,this.$onSourceImageLoad),rt(e,B,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){const{$selection:t,$sourceImage:e}=this;t&&this.$onSelectionChange&&(ot(t,H,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(ot(e.$image,R,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(ot(e,B,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(t){this.$render(t.defaultPrevented?this.$selection:t.detail)}$handleSourceImageLoad(){const{$image:t,$sourceImage:e}=this,i=t.getAttribute("src"),s=e.getAttribute("src");s&&s!==i&&(t.setAttribute("src",s),t.$ready((()=>{this.$render()})))}$handleSourceImageTransform(t){this.$render(void 0,t.detail.matrix)}$render(t,e){const{$canvas:i,$selection:s}=this;t||s.hidden||(t=s),(!t||0===t.x&&0===t.y&&0===t.width&&0===t.height)&&(t={x:0,y:0,width:i.offsetWidth,height:i.offsetHeight});const{x:n,y:a,width:o,height:r}=t,h={},{clientWidth:c,clientHeight:l}=this;let d=c,u=l,$=NaN;switch(this.resize){case"both":$=1,d=o,u=r,h.width=o,h.height=r;break;case"horizontal":$=r>0?l/r:0,d=o*$,h.width=d;break;case Ht:$=o>0?c/o:0,u=r*$,h.height=u;break;default:c>0?$=o>0?c/o:0:l>0&&($=r>0?l/r:0)}this.$scale=$,this.$setStyles(h),this.$sourceImage&&setTimeout((()=>{this.$transformImageByOffset(null!=e?e:this.$sourceImage.$getTransform(),-n,-a)}))}$transformImageByOffset(t,e,i){const{$image:s,$scale:n,$sourceImage:a}=this;if(a&&s&&n>=0){const[a,o,r,h,c,l]=t,d=(e*h-r*i)/(a*h-r*o),u=(i*a-o*e)/(a*h-r*o),$=a*d+r*u+c,p=o*d+h*u+l;s.$ready((t=>{this.$setStyles.call(s,{width:t.naturalWidth*n,height:t.naturalHeight*n})})),s.$setTransform(a,o,r,h,$*n,p*n)}}}Bt.$name=u,Bt.$version="2.1.0";var Ut='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>';const Kt=/^img|canvas$/,Ft=/<(\/?(?:script|style)[^>]*)>/gi,Zt={template:Ut};Tt.$define(),Yt.$define(),Xt.$define(),It.$define(),Dt.$define(),Rt.$define(),Ot.$define(),Bt.$define();class Gt{constructor(t,e){var i;if(this.options=Zt,U(t)&&(t=document.querySelector(t)),!tt(t)||!Kt.test(t.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,e=Object.assign(Object.assign({},Zt),e),this.options=e;let{container:s}=e;if(s&&(U(s)&&(s=null===(i=pt(t))||void 0===i?void 0:i.querySelector(s)),!tt(s)))throw new Error("The `container` option must be an element or a valid selector.");tt(s)||(s=t.parentElement?t.parentElement:t.ownerDocument.body),this.container=s;const n=t.localName;let a="";"img"===n?({src:a}=t):"canvas"===n&&window.HTMLCanvasElement&&(a=t.toDataURL());const{template:o}=e;if(o&&U(o)){const e=document.createElement("template"),i=document.createDocumentFragment();e.innerHTML=o.replace(Ft,"<$1>"),i.appendChild(e.content),Array.from(i.querySelectorAll(c)).forEach((e=>{e.setAttribute("src",a),e.setAttribute("alt",t.alt||"The image to crop"),"img"===n&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach((i=>{t.hasAttribute(i)&&e.setAttribute(i,t.getAttribute(i)||"")}))})),t.parentElement?(t.style.display="none",s.insertBefore(i,t.nextSibling)):s.appendChild(i)}}getCropperCanvas(){return this.container.querySelector(a)}getCropperImage(){return this.container.querySelector(c)}getCropperSelection(){return this.container.querySelector(l)}getCropperSelections(){return this.container.querySelectorAll(l)}destroy(){var t;const e=this.getCropperCanvas();e&&(null===(t=e.parentElement)||void 0===t||t.removeChild(e)),this.element&&(this.element.style.display="")}}Gt.version="2.1.0";export{p as ACTION_MOVE,f as ACTION_NONE,w as ACTION_RESIZE_EAST,v as ACTION_RESIZE_NORTH,S as ACTION_RESIZE_NORTHEAST,k as ACTION_RESIZE_NORTHWEST,y as ACTION_RESIZE_SOUTH,x as ACTION_RESIZE_SOUTHEAST,A as ACTION_RESIZE_SOUTHWEST,C as ACTION_RESIZE_WEST,m as ACTION_ROTATE,g as ACTION_SCALE,$ as ACTION_SELECT,b as ACTION_TRANSFORM,E as ATTRIBUTE_ACTION,a as CROPPER_CANVAS,o as CROPPER_CROSSHAIR,r as CROPPER_GIRD,h as CROPPER_HANDLE,c as CROPPER_IMAGE,l as CROPPER_SELECTION,d as CROPPER_SHADE,u as CROPPER_VIEWER,Tt as CropperCanvas,Yt as CropperCrosshair,Et as CropperElement,Xt as CropperGrid,It as CropperHandle,Dt as CropperImage,Rt as CropperSelection,Ot as CropperShade,Bt as CropperViewer,Ut as DEFAULT_TEMPLATE,W as EVENT_ACTION,L as EVENT_ACTION_END,j as EVENT_ACTION_MOVE,q as EVENT_ACTION_START,H as EVENT_CHANGE,I as EVENT_ERROR,N as EVENT_KEYDOWN,R as EVENT_LOAD,D as EVENT_POINTER_DOWN,P as EVENT_POINTER_MOVE,O as EVENT_POINTER_UP,X as EVENT_RESIZE,T as EVENT_TOUCH_END,z as EVENT_TOUCH_MOVE,M as EVENT_TOUCH_START,B as EVENT_TRANSFORM,Y as EVENT_WHEEL,s as HAS_POINTER_EVENT,t as IS_BROWSER,i as IS_TOUCH_DEVICE,n as NAMESPACE,e as WINDOW,Gt as default,lt as emit,vt as getAdjustedSizes,dt as getComposedPathTarget,gt as getOffset,pt as getRootDocument,tt as isElement,_ as isFunction,K as isNaN,F as isNumber,J as isObject,V as isPlainObject,Z as isPositiveNumber,U as isString,G as isUndefined,wt as multiplyMatrices,$t as nextTick,ot as off,rt as on,ht as once,bt as toAngleInRadian,nt as toCamelCase,it as toKebabCase};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! name: vanilla-calendar-pro v3.1.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
|
|
2
|
+
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n);const errorMessages={notFoundSelector:e=>`${e} is not found, check the first argument passed to new Calendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:"You specified an incorrect language label or did not specify the required number of values for «locale.weekdays» or «locale.months».",incorrectTime:"The value of the time property can be: false, 12 or 24.",incorrectMonthsCount:"For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1."},setContext=(e,t,n)=>{e.context[t]=n},destroy=e=>{var t,n,a,o,l;if(!e.context.isInit)throw new Error(errorMessages.notInit);e.inputMode?(null==(t=e.context.mainElement.parentElement)||t.removeChild(e.context.mainElement),null==(a=null==(n=e.context.inputElement)?void 0:n.replaceWith)||a.call(n,e.context.originalElement),setContext(e,"inputElement",void 0)):null==(l=(o=e.context.mainElement).replaceWith)||l.call(o,e.context.originalElement),setContext(e,"mainElement",e.context.originalElement),e.onDestroy&&e.onDestroy(e)},skipOpenOnFocus=new WeakSet,shouldSkipOpenOnFocus=e=>skipOpenOnFocus.has(e),setSkipOpenOnFocus=e=>{skipOpenOnFocus.add(e)},clearSkipOpenOnFocus=e=>{skipOpenOnFocus.delete(e)},PREV_TABINDEX_ATTR="data-vc-prev-tabindex",isFocusable=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),storePrevTabIndex=e=>{if(e.hasAttribute(PREV_TABINDEX_ATTR))return;const t=e.getAttribute("tabindex");e.setAttribute(PREV_TABINDEX_ATTR,null!=t?t:"")},restorePrevTabIndex=e=>{if(!e.hasAttribute(PREV_TABINDEX_ATTR))return;const t=e.getAttribute(PREV_TABINDEX_ATTR);""===t||null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),e.removeAttribute(PREV_TABINDEX_ATTR)},disableTabbing=e=>{isFocusable(e)&&(storePrevTabIndex(e),e.tabIndex=-1);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>isFocusable(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){const e=t.currentNode;storePrevTabIndex(e),e.tabIndex=-1}},restoreTabbing=e=>{restorePrevTabIndex(e),e.querySelectorAll(`[${PREV_TABINDEX_ATTR}]`).forEach(restorePrevTabIndex)},hide=e=>{if(e.context.isShowInInputMode&&e.context.currentType){if(e.context.mainElement.dataset.vcCalendarHidden="",setContext(e,"isShowInInputMode",!1),e.inputMode&&disableTabbing(e.context.mainElement),e.context.cleanupHandlers[0]&&(e.context.cleanupHandlers.forEach((e=>e())),setContext(e,"cleanupHandlers",[])),e.inputMode&&e.context.inputElement&&e.context.mainElement.contains(document.activeElement)){("function"==typeof e.openOnFocus||!0===e.openOnFocus)&&setSkipOpenOnFocus(e),e.context.inputElement.focus()}e.onHide&&e.onHide(e)}};function getOffset(e){if(!e||!e.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};const t=e.getBoundingClientRect(),n=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-n.clientTop,left:t.left+window.scrollX-n.clientLeft}}function getViewportDimensions(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function getWindowScrollPosition(){return{left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0}}function calculateAvailableSpace(e){const{top:t,left:n}=getWindowScrollPosition(),{top:a,left:o}=getOffset(e),{vh:l,vw:s}=getViewportDimensions(),i=a-t,r=o-n;return{top:i,bottom:l-(i+e.clientHeight),left:r,right:s-(r+e.clientWidth)}}function getAvailablePosition(e,t,n=5){const a={top:!0,bottom:!0,left:!0,right:!0},o=[];if(!t||!e)return{canShow:a,parentPositions:o};const{bottom:l,top:s}=calculateAvailableSpace(e),{top:i,left:r}=getOffset(e),{height:c,width:d}=t.getBoundingClientRect(),{vh:u,vw:m}=getViewportDimensions(),p=m/2,h=u/2;return[{condition:i<h,position:"top"},{condition:i>h,position:"bottom"},{condition:r<p,position:"left"},{condition:r>p,position:"right"}].forEach((({condition:e,position:t})=>{e&&o.push(t)})),Object.assign(a,{top:c<=s-n,bottom:c<=l-n,left:d<=r,right:d<=m-r}),{canShow:a,parentPositions:o}}const handleDay=(e,t,n,a)=>{var o;const l=a.querySelector(`[data-vc-date="${t}"]`),s=null==l?void 0:l.querySelector("[data-vc-date-btn]");if(!l||!s)return;if((null==n?void 0:n.modifier)&&s.classList.add(...n.modifier.trim().split(" ")),!(null==n?void 0:n.html))return;const i=document.createElement("div");i.className=e.styles.datePopup,i.dataset.vcDatePopup="",i.innerHTML=e.sanitizerHTML(n.html),s.ariaExpanded="true",s.ariaLabel=`${s.ariaLabel}, ${null==(o=null==i?void 0:i.textContent)?void 0:o.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/ /g," ")}`,l.appendChild(i),requestAnimationFrame((()=>{if(!i)return;const{canShow:e}=getAvailablePosition(l,i),t=e.bottom?l.offsetHeight:-i.offsetHeight,n=e.left&&!e.right?l.offsetWidth-i.offsetWidth/2:!e.left&&e.right?i.offsetWidth/2:0;Object.assign(i.style,{left:`${n}px`,top:`${t}px`})}))},createDatePopup=(e,t)=>{var n;e.popups&&(null==(n=Object.entries(e.popups))||n.forEach((([n,a])=>handleDay(e,n,a,t))))},getDate=e=>new Date(`${e}T00:00:00`),getDateString=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,parseDates=e=>e.reduce(((e,t)=>{if(t instanceof Date||"number"==typeof t){const n=t instanceof Date?t:new Date(t);e.push(n.toISOString().substring(0,10))}else t.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(t):t.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,((t,n,a)=>{const o=getDate(n),l=getDate(a),s=new Date(o.getTime());for(;s<=l;s.setDate(s.getDate()+1))e.push(getDateString(s));return t}));return e}),[]),updateAttribute=(e,t,n,a="")=>{t?e.setAttribute(n,a):e.getAttribute(n)===a&&e.removeAttribute(n)},setDateModifier=(e,t,n,a,o,l,s)=>{var i,r,c,d;const u=getDate(e.context.displayDateMin)>getDate(l)||getDate(e.context.displayDateMax)<getDate(l)||(null==(i=e.context.disableDates)?void 0:i.includes(l))||!e.selectionMonthsMode&&"current"!==s||!e.selectionYearsMode&&getDate(l).getFullYear()!==t;updateAttribute(n,u,"data-vc-date-disabled"),a&&updateAttribute(a,u,"aria-disabled","true"),a&&updateAttribute(a,u,"tabindex","-1"),updateAttribute(n,!e.disableToday&&e.context.dateToday===l,"data-vc-date-today"),updateAttribute(n,!e.disableToday&&e.context.dateToday===l,"aria-current","date"),updateAttribute(n,null==(r=e.selectedWeekends)?void 0:r.includes(o),"data-vc-date-weekend");const m=(null==(c=e.selectedHolidays)?void 0:c[0])?parseDates(e.selectedHolidays):[];if(updateAttribute(n,m.includes(l),"data-vc-date-holiday"),(null==(d=e.context.selectedDates)?void 0:d.includes(l))?(n.setAttribute("data-vc-date-selected",""),a&&a.setAttribute("aria-selected","true"),e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode&&(e.context.selectedDates[0]===l&&e.context.selectedDates[e.context.selectedDates.length-1]===l?n.setAttribute("data-vc-date-selected","first-and-last"):e.context.selectedDates[0]===l?n.setAttribute("data-vc-date-selected","first"):e.context.selectedDates[e.context.selectedDates.length-1]===l&&n.setAttribute("data-vc-date-selected","last"),e.context.selectedDates[0]!==l&&e.context.selectedDates[e.context.selectedDates.length-1]!==l&&n.setAttribute("data-vc-date-selected","middle"))):n.hasAttribute("data-vc-date-selected")&&(n.removeAttribute("data-vc-date-selected"),a&&a.removeAttribute("aria-selected")),!e.context.disableDates.includes(l)&&e.enableEdgeDatesOnly&&e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode){const t=getDate(e.context.selectedDates[0]),a=getDate(e.context.selectedDates[e.context.selectedDates.length-1]),o=getDate(l);updateAttribute(n,o>t&&o<a,"data-vc-date-selected","middle")}},getLocaleString=(e,t,n)=>new Date(`${e}T00:00:00.000Z`).toLocaleString(t,n),getWeekNumber=(e,t)=>{const n=getDate(e),a=(n.getDay()-t+7)%7;n.setDate(n.getDate()+4-a);const o=new Date(n.getFullYear(),0,1),l=Math.ceil(((+n-+o)/864e5+1)/7);return{year:n.getFullYear(),week:l}},addWeekNumberForDate=(e,t,n)=>{const a=getWeekNumber(n,e.firstWeekday);a&&(t.dataset.vcDateWeekNumber=String(a.week))},setDaysAsDisabled=(e,t,n)=>{var a,o,l,s,i;const r=null==(a=e.disableWeekdays)?void 0:a.includes(n),c=e.disableAllDates&&!!(null==(o=e.context.enableDates)?void 0:o[0]);!r&&!c||(null==(l=e.context.enableDates)?void 0:l.includes(t))||(null==(s=e.context.disableDates)?void 0:s.includes(t))||(e.context.disableDates.push(t),null==(i=e.context.disableDates)||i.sort(((e,t)=>+new Date(e)-+new Date(t))))},createDate=(e,t,n,a,o,l)=>{const s=getDate(o).getDay(),i="string"==typeof e.locale&&e.locale.length?e.locale:"en",r=document.createElement("div");let c;r.className=e.styles.date,r.dataset.vcDate=o,r.dataset.vcDateMonth=l,r.dataset.vcDateWeekDay=String(s),r.role="gridcell",("current"===l||e.displayDatesOutside)&&(c=document.createElement("button"),c.className=e.styles.dateBtn,c.type="button",c.ariaLabel=getLocaleString(o,i,{dateStyle:"long",timeZone:"UTC"}),c.dataset.vcDateBtn="",c.innerText=String(a),r.appendChild(c)),e.enableWeekNumbers&&addWeekNumberForDate(e,r,o),setDaysAsDisabled(e,o,s),setDateModifier(e,t,r,c,s,o,l),n.addDate(r),e.onCreateDateEls&&e.onCreateDateEls(e,r)},createDatesFromCurrentMonth=(e,t,n,a,o)=>{for(let l=1;l<=n;l++){const n=new Date(a,o,l);createDate(e,a,t,l,getDateString(n),"current")}},createDatesFromNextMonth=(e,t,n,a,o)=>{const l=o+1===12?a+1:a,s=o+1===12?"01":o+2<10?`0${o+2}`:o+2;for(let o=1;o<=n;o++){const n=o<10?`0${o}`:String(o);createDate(e,a,t,o,`${l}-${s}-${n}`,"next")}},createDatesFromPrevMonth=(e,t,n,a,o)=>{let l=new Date(n,a,0).getDate()-(o-1);const s=0===a?n-1:n,i=0===a?12:a<10?`0${a}`:a;for(let a=o;a>0;a--,l++){createDate(e,n,t,l,`${s}-${i}-${l}`,"prev")}},createWeekNumbers=(e,t,n,a,o)=>{if(!e.enableWeekNumbers)return;a.textContent="";const l=document.createElement("b");l.className=e.styles.weekNumbersTitle,l.innerText="#",l.dataset.vcWeekNumbers="title",a.appendChild(l);const s=document.createElement("div");s.className=e.styles.weekNumbersContent,s.dataset.vcWeekNumbers="content",a.appendChild(s);const i=document.createElement("button");i.type="button",i.className=e.styles.weekNumber;const r=o.querySelectorAll("[data-vc-date]"),c=Math.ceil((t+n)/7);for(let t=0;t<c;t++){const n=r[0===t?6:7*t].dataset.vcDate,a=getWeekNumber(n,e.firstWeekday);if(!a)return;const o=i.cloneNode(!0);o.innerText=String(a.week),o.dataset.vcWeekNumber=String(a.week),o.dataset.vcWeekYear=String(a.year),o.role="rowheader",o.ariaLabel=`${a.week}`,s.appendChild(o)}},createDates=e=>{const t=new Date(e.context.selectedYear,e.context.selectedMonth,1),n=e.context.mainElement.querySelectorAll('[data-vc="dates"]'),a=e.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');n.forEach(((n,o)=>{e.selectionDatesMode||(n.dataset.vcDatesDisabled=""),n.textContent="";const l=new Date(t);l.setMonth(l.getMonth()+o);const s=l.getMonth(),i=l.getFullYear(),r=(new Date(i,s,1).getDay()-e.firstWeekday+7)%7,c=new Date(i,s+1,0).getDate(),d=r+c,u=Math.ceil(d/7),m=7*u-d,p=[];for(let t=0;t<u;t++){const t=document.createElement("div");t.className=e.styles.datesRow,t.setAttribute("data-vc-dates","row"),t.setAttribute("role","row"),p.push(t)}let h=0,v=0;const g={addDate:e=>{p[h].appendChild(e),v++,v>=7&&(h++,v=0)}};createDatesFromPrevMonth(e,g,i,s,r),createDatesFromCurrentMonth(e,g,c,i,s),createDatesFromNextMonth(e,g,m,i,s);for(const e of p)n.appendChild(e);createDatePopup(e,n),createWeekNumbers(e,r,c,a[o],n)}))},layoutDefault=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n <#DateRangeTooltip />\n </div>\n </div>\n <#ControlTime />\n`,layoutMonths=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Months />\n </div>\n </div>\n`,layoutMultiple=e=>`\n <div class="${e.styles.controls}" data-vc="controls" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.grid}" data-vc="grid">\n <#Multiple>\n <div class="${e.styles.column}" data-vc="column" role="region">\n <div class="${e.styles.header}" data-vc="header">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n <#DateRangeTooltip />\n </div>\n <#ControlTime />\n`,layoutYears=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [year] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [year] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Years />\n </div>\n </div>\n`,ArrowNext=(e,t)=>`<button type="button" class="${e.styles.arrowNext}" data-vc-arrow="next" aria-label="${e.labels.arrowNext[t]}"></button>`,ArrowPrev=(e,t)=>`<button type="button" class="${e.styles.arrowPrev}" data-vc-arrow="prev" aria-label="${e.labels.arrowPrev[t]}"></button>`,ControlTime=e=>e.selectionTimeMode?`<div class="${e.styles.time}" data-vc="time" role="group" aria-label="${e.labels.selectingTime}"></div>`:"",DateRangeTooltip=e=>e.onCreateDateRangeTooltip?`<div class="${e.styles.dateRangeTooltip}" data-vc-date-range-tooltip="hidden"></div>`:"",Dates=e=>`<div class="${e.styles.dates}" data-vc="dates" aria-live="assertive" aria-label="${e.labels.dates}" ${"multiple"===e.type?"aria-multiselectable":""}></div>`,Month=e=>`<button type="button" class="${e.styles.month}" data-vc="month"></button>`,Months=e=>`<div class="${e.styles.months}" data-vc="months" role="grid" aria-live="assertive" aria-label="${e.labels.months}"></div>`,Week=e=>`<div class="${e.styles.week}" data-vc="week" role="row" aria-label="${e.labels.week}"></div>`,WeekNumbers=e=>e.enableWeekNumbers?`<div class="${e.styles.weekNumbers}" data-vc-week="numbers" role="row" aria-label="${e.labels.weekNumber}"></div>`:"",Year=e=>`<button type="button" class="${e.styles.year}" data-vc="year"></button>`,Years=e=>`<div class="${e.styles.years}" data-vc="years" role="grid" aria-live="assertive" aria-label="${e.labels.years}"></div>`,components={ArrowNext:ArrowNext,ArrowPrev:ArrowPrev,ControlTime:ControlTime,Dates:Dates,DateRangeTooltip:DateRangeTooltip,Month:Month,Months:Months,Week:Week,WeekNumbers:WeekNumbers,Year:Year,Years:Years},getComponent=e=>components[e],parseLayout=(e,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,((t,n)=>{const a=(n.match(/\[(.*?)\]/)||[])[1],o=n.replace(/[/\s\n\t]|\[(.*?)\]/g,""),l=getComponent(o),s=l?l(e,null!=a?a:null):"";return e.sanitizerHTML(s)})).replace(/[\n\t]/g,""),parseMultipleLayout=(e,t)=>t.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),((t,n)=>{const a=Array(e.context.displayMonthsCount).fill(n).join("");return e.sanitizerHTML(a)})).replace(/[\n\t]/g,""),createLayouts=(e,t)=>{const n={default:layoutDefault,month:layoutMonths,year:layoutYears,multiple:layoutMultiple};if(Object.keys(n).forEach((t=>{const a=t;e.layouts[a].length||(e.layouts[a]=n[a](e))})),e.context.mainElement.className=e.styles.calendar,e.context.mainElement.dataset.vc="calendar",e.context.mainElement.dataset.vcType=e.context.currentType,e.context.mainElement.role="application",e.context.mainElement.tabIndex=0,e.context.mainElement.ariaLabel=e.labels.application,"multiple"!==e.context.currentType){if("multiple"===e.type&&t){const n=e.context.mainElement.querySelector('[data-vc="controls"]'),a=e.context.mainElement.querySelector('[data-vc="grid"]'),o=t.closest('[data-vc="column"]');return n&&n.remove(),a&&(a.dataset.vcGrid="hidden"),o&&(o.dataset.vcColumn=e.context.currentType),void(o&&(o.innerHTML=e.sanitizerHTML(parseLayout(e,e.layouts[e.context.currentType]))))}e.context.mainElement.innerHTML=e.sanitizerHTML(parseLayout(e,e.layouts[e.context.currentType]))}else e.context.mainElement.innerHTML=e.sanitizerHTML(parseMultipleLayout(e,parseLayout(e,e.layouts[e.context.currentType])))},setVisibilityArrows=(e,t,n,a)=>{e.style.visibility=n?"hidden":"",t.style.visibility=a?"hidden":""},handleDefaultType=(e,t,n)=>{const a=getDate(getDateString(new Date(e.context.selectedYear,e.context.selectedMonth,1))),o=new Date(a.getTime()),l=new Date(a.getTime());o.setMonth(o.getMonth()-e.monthsToSwitch),l.setMonth(l.getMonth()+e.monthsToSwitch);const s=getDate(e.context.dateMin),i=getDate(e.context.dateMax);e.selectionYearsMode||(s.setFullYear(a.getFullYear()),i.setFullYear(a.getFullYear()));const r=!e.selectionMonthsMode||o.getFullYear()<s.getFullYear()||o.getFullYear()===s.getFullYear()&&o.getMonth()<s.getMonth(),c=!e.selectionMonthsMode||l.getFullYear()>i.getFullYear()||l.getFullYear()===i.getFullYear()&&l.getMonth()>i.getMonth()-(e.context.displayMonthsCount-1);setVisibilityArrows(t,n,r,c)},handleYearType=(e,t,n)=>{const a=getDate(e.context.dateMin),o=getDate(e.context.dateMax),l=!!(a.getFullYear()&&e.context.displayYear-7<=a.getFullYear()),s=!!(o.getFullYear()&&e.context.displayYear+7>=o.getFullYear());setVisibilityArrows(t,n,l,s)},visibilityArrows=e=>{if("month"===e.context.currentType)return;const t=e.context.mainElement.querySelector('[data-vc-arrow="prev"]'),n=e.context.mainElement.querySelector('[data-vc-arrow="next"]');if(!t||!n)return;({default:()=>handleDefaultType(e,t,n),year:()=>handleYearType(e,t,n)})["multiple"===e.context.currentType?"default":e.context.currentType]()},visibilityHandler=(e,t,n,a,o)=>{const l=new Date(a.setFullYear(e.context.selectedYear,e.context.selectedMonth+n)).getFullYear(),s=new Date(a.setMonth(e.context.selectedMonth+n)).getMonth(),i=e.context.locale.months.long[s],r=t.closest('[data-vc="column"]');r&&(r.ariaLabel=`${i} ${l}`);const c={month:{id:s,label:i},year:{id:l,label:l}};t.innerText=String(c[o].label),t.dataset[`vc${o.charAt(0).toUpperCase()+o.slice(1)}`]=String(c[o].id),t.ariaLabel=`${e.labels[o]} ${c[o].label}`;const d={month:e.selectionMonthsMode,year:e.selectionYearsMode},u=!1===d[o]||"only-arrows"===d[o];u&&(t.tabIndex=-1),t.disabled=u},visibilityTitle=e=>{const t=e.context.mainElement.querySelectorAll('[data-vc="month"]'),n=e.context.mainElement.querySelectorAll('[data-vc="year"]'),a=new Date(e.context.selectedYear,e.context.selectedMonth,1);[t,n].forEach((t=>null==t?void 0:t.forEach(((t,n)=>visibilityHandler(e,t,n,a,t.dataset.vc)))))},setYearModifier=(e,t,n,a,o)=>{var l;const s={month:"[data-vc-months-month]",year:"[data-vc-years-year]"},i={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};o&&(null==(l=e.context.mainElement.querySelectorAll(s[n]))||l.forEach((e=>{e.removeAttribute(i[n].selected),e.removeAttribute(i[n].aria)})),setContext(e,i[n].selectedProperty,Number(t.dataset[i[n].value])),visibilityTitle(e),"year"===n&&visibilityArrows(e)),a&&(t.setAttribute(i[n].selected,""),t.setAttribute(i[n].aria,"true"))},getColumnID=(e,t)=>{var n;if("multiple"!==e.type)return{currentValue:null,columnID:0};const a=e.context.mainElement.querySelectorAll('[data-vc="column"]'),o=Array.from(a).findIndex((e=>e.closest(`[data-vc-column="${t}"]`)));return{currentValue:o>=0?Number(null==(n=a[o].querySelector(`[data-vc="${t}"]`))?void 0:n.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(o,0)}},createMonthEl=(e,t,n,a,o,l,s)=>{const i=t.cloneNode(!1);return i.className=e.styles.monthsMonth,i.innerText=a,i.ariaLabel=o,i.role="gridcell",i.dataset.vcMonthsMonth=`${s}`,l&&(i.ariaDisabled="true"),l&&(i.tabIndex=-1),i.disabled=l,setYearModifier(e,i,"month",n===s,!1),i},createMonths=(e,t)=>{var n,a;const o=null==(n=null==t?void 0:t.closest('[data-vc="header"]'))?void 0:n.querySelector('[data-vc="year"]'),l=o?Number(o.dataset.vcYear):e.context.selectedYear,s=(null==t?void 0:t.dataset.vcMonth)?Number(t.dataset.vcMonth):e.context.selectedMonth;setContext(e,"currentType","month"),createLayouts(e,t),visibilityTitle(e);const i=e.context.mainElement.querySelector('[data-vc="months"]');if(!e.selectionMonthsMode||!i)return;const r=e.monthsToSwitch>1?e.context.locale.months.long.map(((t,n)=>s-e.monthsToSwitch*n)).concat(e.context.locale.months.long.map(((t,n)=>s+e.monthsToSwitch*n))).filter((e=>e>=0&&e<=12)):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";for(let t=0;t<12;t++){const n=getDate(e.context.dateMin),a=getDate(e.context.dateMax),o=e.context.displayMonthsCount-1,{columnID:d}=getColumnID(e,"month"),u=l<=n.getFullYear()&&t<n.getMonth()+d||l>=a.getFullYear()&&t>a.getMonth()-o+d||l>a.getFullYear()||t!==s&&!r.includes(t),m=createMonthEl(e,c,s,e.context.locale.months.short[t],e.context.locale.months.long[t],u,t);i.appendChild(m),e.onCreateMonthEls&&e.onCreateMonthEls(e,m)}null==(a=e.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))||a.focus()},TimeInput=(e,t,n,a,o)=>`\n <label class="${t}" data-vc-time-input="${e}">\n <input type="text" name="${e}" maxlength="2" aria-label="${n[`input${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${a}" ${o?"disabled":""}>\n </label>\n`,TimeRange=(e,t,n,a,o,l,s)=>`\n <label class="${t}" data-vc-time-range="${e}">\n <input type="range" name="${e}" min="${a}" max="${o}" step="${l}" aria-label="${n[`range${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${s}">\n </label>\n`,handleActions=(e,t,n,a)=>{({hour:()=>setContext(e,"selectedHours",n),minute:()=>setContext(e,"selectedMinutes",n)})[a](),setContext(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${e.context.selectedKeeping?` ${e.context.selectedKeeping}`:""}`),e.onChangeTime&&e.onChangeTime(e,t,!1),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t)},transformTime24=(e,t)=>{var n;return(null==(n={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(e)])?void 0:n[t])||String(e)},handleClickKeepingTime=(e,t,n,a,o)=>{const l=l=>{const s="AM"===e.context.selectedKeeping?"PM":"AM",i=transformTime24(e.context.selectedHours,s);Number(i)<=a&&Number(i)>=o?(setContext(e,"selectedKeeping",s),n.value=i,handleActions(e,l,e.context.selectedHours,"hour"),t.ariaLabel=`${e.labels.btnKeeping} ${e.context.selectedKeeping}`,t.innerText=e.context.selectedKeeping):e.onChangeTime&&e.onChangeTime(e,l,!0)};return t.addEventListener("click",l),()=>{t.removeEventListener("click",l)}},transformTime12=e=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(e)]||String(e)),updateInputAndRange=(e,t,n,a)=>{e.value=n,t.value=a},updateKeepingTime$1=(e,t,n)=>{t&&n&&(setContext(e,"selectedKeeping",n),t.innerText=n)},handleInput$1=(e,t,n,a,o,l,s)=>{const i={hour:(i,r,c)=>{if(!e.selectionTimeMode)return;({12:()=>{if(!e.context.selectedKeeping)return;const d=Number(transformTime24(r,e.context.selectedKeeping));if(!(d<=l&&d>=s))return updateInputAndRange(n,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));updateInputAndRange(n,t,transformTime12(r),transformTime24(r,e.context.selectedKeeping)),i>12&&updateKeepingTime$1(e,a,"PM"),handleActions(e,c,transformTime12(r),o)},24:()=>{if(!(i<=l&&i>=s))return updateInputAndRange(n,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));updateInputAndRange(n,t,r,r),handleActions(e,c,r,o)}})[e.selectionTimeMode]()},minute:(a,i,r)=>{if(!(a<=l&&a>=s))return n.value=e.context.selectedMinutes,void(e.onChangeTime&&e.onChangeTime(e,r,!0));n.value=i,t.value=i,handleActions(e,r,i,o)}},r=e=>{const t=Number(n.value),a=n.value.padStart(2,"0");i[o]&&i[o](t,a,e)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}},updateInputAndTime=(e,t,n,a,o)=>{t.value=o,handleActions(e,n,o,a)},updateKeepingTime=(e,t,n)=>{t&&(setContext(e,"selectedKeeping",n),t.innerText=n)},handleRange=(e,t,n,a,o)=>{const l=l=>{const s=Number(t.value),i=t.value.padStart(2,"0"),r="hour"===o,c=24===e.selectionTimeMode,d=s>0&&s<12;r&&!c&&updateKeepingTime(e,a,0===s||d?"AM":"PM"),updateInputAndTime(e,n,l,o,!r||c||d?i:transformTime12(t.value))};return t.addEventListener("input",l),()=>{t.removeEventListener("input",l)}},handleMouseOver=e=>e.setAttribute("data-vc-input-focus",""),handleMouseOut=e=>e.removeAttribute("data-vc-input-focus"),handleTime=(e,t)=>{const n=t.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),a=t.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),o=t.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),l=t.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),s=t.querySelector('[data-vc-time="keeping"]');if(!(n&&a&&o&&l))return;const i=e=>{e.target===n&&handleMouseOver(o),e.target===a&&handleMouseOver(l)},r=e=>{e.target===n&&handleMouseOut(o),e.target===a&&handleMouseOut(l)};return t.addEventListener("mouseover",i),t.addEventListener("mouseout",r),handleInput$1(e,n,o,s,"hour",e.timeMaxHour,e.timeMinHour),handleInput$1(e,a,l,s,"minute",e.timeMaxMinute,e.timeMinMinute),handleRange(e,n,o,s,"hour"),handleRange(e,a,l,s,"minute"),s&&handleClickKeepingTime(e,s,n,e.timeMaxHour,e.timeMinHour),()=>{t.removeEventListener("mouseover",i),t.removeEventListener("mouseout",r)}},createTime=e=>{const t=e.context.mainElement.querySelector('[data-vc="time"]');if(!e.selectionTimeMode||!t)return;const[n,a]=[e.timeMinHour,e.timeMaxHour],[o,l]=[e.timeMinMinute,e.timeMaxMinute],s=e.context.selectedKeeping?transformTime24(e.context.selectedHours,e.context.selectedKeeping):e.context.selectedHours,i="range"===e.timeControls;var r;t.innerHTML=e.sanitizerHTML(`\n <div class="${e.styles.timeContent}" data-vc-time="content">\n ${TimeInput("hour",e.styles.timeHour,e.labels,e.context.selectedHours,i)}\n ${TimeInput("minute",e.styles.timeMinute,e.labels,e.context.selectedMinutes,i)}\n ${12===e.selectionTimeMode?(r=e.context.selectedKeeping,`<button type="button" class="${e.styles.timeKeeping}" aria-label="${e.labels.btnKeeping} ${r}" data-vc-time="keeping" ${i?"disabled":""}>${r}</button>`):""}\n </div>\n <div class="${e.styles.timeRanges}" data-vc-time="ranges">\n ${TimeRange("hour",e.styles.timeRange,e.labels,n,a,e.timeStepHour,s)}\n ${TimeRange("minute",e.styles.timeRange,e.labels,o,l,e.timeStepMinute,e.context.selectedMinutes)}\n </div>\n `),handleTime(e,t)},createWeek=e=>{const t=e.selectedWeekends?[...e.selectedWeekends]:[],n=[...e.context.locale.weekdays.long].reduce(((n,a,o)=>[...n,{id:o,titleShort:e.context.locale.weekdays.short[o],titleLong:a,isWeekend:t.includes(o)}]),[]),a=[...n.slice(e.firstWeekday),...n.slice(0,e.firstWeekday)];e.context.mainElement.querySelectorAll('[data-vc="week"]').forEach((t=>{const n=e.onClickWeekDay?document.createElement("button"):document.createElement("b");e.onClickWeekDay&&(n.type="button"),a.forEach((a=>{const o=n.cloneNode(!0);o.innerText=a.titleShort,o.className=e.styles.weekDay,o.role="columnheader",o.ariaLabel=a.titleLong,o.dataset.vcWeekDay=String(a.id),a.isWeekend&&(o.dataset.vcWeekDayOff=""),t.appendChild(o)}))}))},createYearEl=(e,t,n,a,o)=>{const l=t.cloneNode(!1);return l.className=e.styles.yearsYear,l.innerText=String(o),l.ariaLabel=String(o),l.role="gridcell",l.dataset.vcYearsYear=`${o}`,a&&(l.ariaDisabled="true"),a&&(l.tabIndex=-1),l.disabled=a,setYearModifier(e,l,"year",n===o,!1),l},createYears=(e,t)=>{var n;const a=(null==t?void 0:t.dataset.vcYear)?Number(t.dataset.vcYear):e.context.selectedYear;setContext(e,"currentType","year"),createLayouts(e,t),visibilityTitle(e),visibilityArrows(e);const o=e.context.mainElement.querySelector('[data-vc="years"]');if(!e.selectionYearsMode||!o)return;const l="multiple"!==e.type||e.context.selectedYear===a?0:1,s=document.createElement("button");s.type="button";for(let t=e.context.displayYear-7;t<e.context.displayYear+8;t++){const n=t<getDate(e.context.dateMin).getFullYear()+l||t>getDate(e.context.dateMax).getFullYear(),i=createYearEl(e,s,a,n,t);o.appendChild(i),e.onCreateYearEls&&e.onCreateYearEls(e,i)}null==(n=e.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))||n.focus()},trackChangesHTMLElement=(e,t,n)=>{new MutationObserver((e=>{for(let a=0;a<e.length;a++){if(e[a].attributeName===t){n();break}}})).observe(e,{attributes:!0})},haveListener={value:!1,set:()=>haveListener.value=!0,check:()=>haveListener.value},setTheme=(e,t)=>e.dataset.vcTheme=t,trackChangesThemeInSystemSettings=(e,t)=>{if(setTheme(e.context.mainElement,t.matches?"dark":"light"),"system"!==e.selectedTheme||haveListener.check())return;const n=e=>{const t=document.querySelectorAll('[data-vc="calendar"]');null==t||t.forEach((t=>setTheme(t,e.matches?"dark":"light")))};t.addEventListener?t.addEventListener("change",n):t.addListener(n),haveListener.set()},detectTheme=(e,t)=>{const n=e.themeAttrDetect.length?document.querySelector(e.themeAttrDetect):null,a=e.themeAttrDetect.replace(/^.*\[(.+)\]/g,((e,t)=>t));if(!n||"system"===n.getAttribute(a))return void trackChangesThemeInSystemSettings(e,t);const o=n.getAttribute(a);o?(setTheme(e.context.mainElement,o),trackChangesHTMLElement(n,a,(()=>{const t=n.getAttribute(a);t&&setTheme(e.context.mainElement,t)}))):trackChangesThemeInSystemSettings(e,t)},handleTheme=e=>{"not all"!==window.matchMedia("(prefers-color-scheme)").media?"system"===e.selectedTheme?detectTheme(e,window.matchMedia("(prefers-color-scheme: dark)")):setTheme(e.context.mainElement,e.selectedTheme):setTheme(e.context.mainElement,"light")},capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/\./,""),getLocaleWeekday=(e,t,n)=>{const a=new Date(`1978-01-0${t+1}T00:00:00.000Z`),o=a.toLocaleString(n,{weekday:"short",timeZone:"UTC"}),l=a.toLocaleString(n,{weekday:"long",timeZone:"UTC"});e.context.locale.weekdays.short.push(capitalizeFirstLetter(o)),e.context.locale.weekdays.long.push(capitalizeFirstLetter(l))},getLocaleMonth=(e,t,n)=>{const a=new Date(`1978-${String(t+1).padStart(2,"0")}-01T00:00:00.000Z`),o=a.toLocaleString(n,{month:"short",timeZone:"UTC"}),l=a.toLocaleString(n,{month:"long",timeZone:"UTC"});e.context.locale.months.short.push(capitalizeFirstLetter(o)),e.context.locale.months.long.push(capitalizeFirstLetter(l))},getLocale=e=>{var t,n,a,o,l,s,i,r;if(!(e.context.locale.weekdays.short[6]&&e.context.locale.weekdays.long[6]&&e.context.locale.months.short[11]&&e.context.locale.months.long[11]))if("string"==typeof e.locale){if("string"==typeof e.locale&&!e.locale.length)throw new Error(errorMessages.notLocale);Array.from({length:7},((t,n)=>getLocaleWeekday(e,n,e.locale))),Array.from({length:12},((t,n)=>getLocaleMonth(e,n,e.locale)))}else{if(!((null==(n=null==(t=e.locale)?void 0:t.weekdays)?void 0:n.short[6])&&(null==(o=null==(a=e.locale)?void 0:a.weekdays)?void 0:o.long[6])&&(null==(s=null==(l=e.locale)?void 0:l.months)?void 0:s.short[11])&&(null==(r=null==(i=e.locale)?void 0:i.months)?void 0:r.long[11])))throw new Error(errorMessages.notLocale);setContext(e,"locale",__spreadValues({},e.locale))}},create=e=>{const t={default:()=>{createWeek(e),createDates(e)},multiple:()=>{createWeek(e),createDates(e)},month:()=>createMonths(e),year:()=>createYears(e)};handleTheme(e),getLocale(e),createLayouts(e),visibilityTitle(e),visibilityArrows(e),createTime(e),t[e.context.currentType]()},handleArrowKeys=e=>{const t=t=>{var n;const a=t.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)||"button"!==a.localName)return;const o=Array.from(e.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),l=o.indexOf(a);if(-1===l)return;const s=(i=o[l]).hasAttribute("data-vc-date-btn")?7:i.hasAttribute("data-vc-months-month")?4:i.hasAttribute("data-vc-years-year")?5:1;var i;const r=(0,{ArrowUp:()=>Math.max(0,l-s),ArrowDown:()=>Math.min(o.length-1,l+s),ArrowLeft:()=>Math.max(0,l-1),ArrowRight:()=>Math.min(o.length-1,l+1)}[t.key])();null==(n=o[r])||n.focus()};return e.context.mainElement.addEventListener("keydown",t),()=>e.context.mainElement.removeEventListener("keydown",t)},handleMonth=(e,t)=>{const n=getDate(getDateString(new Date(e.context.selectedYear,e.context.selectedMonth,1)));({prev:()=>n.setMonth(n.getMonth()-e.monthsToSwitch),next:()=>n.setMonth(n.getMonth()+e.monthsToSwitch)})[t](),setContext(e,"selectedMonth",n.getMonth()),setContext(e,"selectedYear",n.getFullYear()),visibilityTitle(e),visibilityArrows(e),createDates(e)},handleClickArrow=(e,t)=>{const n=t.target.closest("[data-vc-arrow]");if(n){if(["default","multiple"].includes(e.context.currentType))handleMonth(e,n.dataset.vcArrow);else if("year"===e.context.currentType&&void 0!==e.context.displayYear){const a={prev:-15,next:15}[n.dataset.vcArrow];setContext(e,"displayYear",e.context.displayYear+a),createYears(e,t.target)}e.onClickArrow&&e.onClickArrow(e,t)}},resolveToggle=(e,t)=>void 0===t||("function"==typeof t?t(e):t),canToggleSelection=e=>resolveToggle(e,e.enableDateToggle),handleSelectDate=(e,t,n)=>{const a=t.dataset.vcDate,o=t.closest("[data-vc-date][data-vc-date-selected]"),l=canToggleSelection(e);if(o&&!l)return;const s=o?e.context.selectedDates.filter((e=>e!==a)):n?[...e.context.selectedDates,a]:[a];setContext(e,"selectedDates",s)},createDateRangeTooltip=(e,t,n)=>{if(!t)return;if(!n)return t.dataset.vcDateRangeTooltip="hidden",void(t.textContent="");const a=e.context.mainElement.getBoundingClientRect(),o=n.getBoundingClientRect();t.style.left=o.left-a.left+o.width/2+"px",t.style.top=o.bottom-a.top-o.height+"px",t.dataset.vcDateRangeTooltip="visible",t.innerHTML=e.sanitizerHTML(e.onCreateDateRangeTooltip(e,n,t,o,a))},state={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},addHoverEffect=(e,t,n)=>{var a,o,l;if(!(null==(o=null==(a=state.self)?void 0:a.context)?void 0:o.selectedDates[0]))return;const s=getDateString(e);(null==(l=state.self.context.disableDates)?void 0:l.includes(s))||(state.self.context.mainElement.querySelectorAll(`[data-vc-date="${s}"]`).forEach((e=>e.dataset.vcDateHover="")),t.forEach((e=>e.dataset.vcDateHover="first")),n.forEach((e=>{"first"===e.dataset.vcDateHover?e.dataset.vcDateHover="first-and-last":e.dataset.vcDateHover="last"})))},removeHoverEffect=()=>{var e,t;if(!(null==(t=null==(e=state.self)?void 0:e.context)?void 0:t.mainElement))return;state.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach((e=>e.removeAttribute("data-vc-date-hover")))},handleHoverDatesEvent=e=>{var t,n;if(!e||!(null==(n=null==(t=state.self)?void 0:t.context)?void 0:n.selectedDates[0]))return;if(!e.closest('[data-vc="dates"]'))return state.lastDateEl=null,createDateRangeTooltip(state.self,state.tooltipEl,null),void removeHoverEffect();const a=e.closest("[data-vc-date]");if(!a||state.lastDateEl===a)return;state.lastDateEl=a,createDateRangeTooltip(state.self,state.tooltipEl,a),removeHoverEffect();const o=a.dataset.vcDate,l=getDate(state.self.context.selectedDates[0]),s=getDate(o),i=state.self.context.mainElement.querySelectorAll(`[data-vc-date="${state.self.context.selectedDates[0]}"]`),r=state.self.context.mainElement.querySelectorAll(`[data-vc-date="${o}"]`),[c,d]=l<s?[i,r]:[r,i],[u,m]=l<s?[l,s]:[s,l];for(let e=new Date(u);e<=m;e.setDate(e.getDate()+1))addHoverEffect(e,c,d)},handleHoverSelectedDatesRangeEvent=e=>{const t=null==e?void 0:e.closest("[data-vc-date-selected]");if(!t&&state.lastDateEl)return state.lastDateEl=null,void createDateRangeTooltip(state.self,state.tooltipEl,null);t&&state.lastDateEl!==t&&(state.lastDateEl=t,createDateRangeTooltip(state.self,state.tooltipEl,t))},optimizedHoverHandler=e=>t=>{const n=t.target;state.isHovering||(state.isHovering=!0,requestAnimationFrame((()=>{e(n),state.isHovering=!1})))},optimizedHandleHoverDatesEvent=optimizedHoverHandler(handleHoverDatesEvent),optimizedHandleHoverSelectedDatesRangeEvent=optimizedHoverHandler(handleHoverSelectedDatesRangeEvent),handleCancelSelectionDates=e=>{state.self&&"Escape"===e.key&&(state.lastDateEl=null,setContext(state.self,"selectedDates",[]),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),createDateRangeTooltip(state.self,state.tooltipEl,null),removeHoverEffect())},handleMouseLeave=()=>{null!==state.timeoutId&&clearTimeout(state.timeoutId),state.timeoutId=setTimeout((()=>{state.lastDateEl=null,createDateRangeTooltip(state.self,state.tooltipEl,null),removeHoverEffect()}),50)},updateDisabledDates=()=>{var e,t,n,a;if(!(null==(n=null==(t=null==(e=state.self)?void 0:e.context)?void 0:t.selectedDates)?void 0:n[0])||!(null==(a=state.self.context.disableDates)?void 0:a[0]))return;const o=getDate(state.self.context.selectedDates[0]),[l,s]=state.self.context.disableDates.map((e=>getDate(e))).reduce((([e,t],n)=>[o>=n?n:e,o<n&&null===t?n:t]),[null,null]);l&&setContext(state.self,"displayDateMin",getDateString(new Date(l.setDate(l.getDate()+1)))),s&&setContext(state.self,"displayDateMax",getDateString(new Date(s.setDate(s.getDate()-1))));state.self.disableDatesPast&&!state.self.disableAllDates&&getDate(state.self.context.displayDateMin)<getDate(state.self.context.dateToday)&&setContext(state.self,"displayDateMin",state.self.context.dateToday)},handleSelectDateRange=(e,t)=>{state.self=e,state.lastDateEl=t,removeHoverEffect(),e.disableDatesGaps&&(state.rangeMin=state.rangeMin?state.rangeMin:e.context.displayDateMin,state.rangeMax=state.rangeMax?state.rangeMax:e.context.displayDateMax),e.onCreateDateRangeTooltip&&(state.tooltipEl=e.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));const n=null==t?void 0:t.dataset.vcDate;if(n){const t=1===e.context.selectedDates.length&&e.context.selectedDates[0].includes(n),a=t&&!canToggleSelection(e)?[n,n]:t&&canToggleSelection(e)?[]:e.context.selectedDates.length>1?[n]:[...e.context.selectedDates,n];setContext(e,"selectedDates",a),e.context.selectedDates.length>1&&e.context.selectedDates.sort(((e,t)=>+new Date(e)-+new Date(t)))}({set:()=>(e.disableDatesGaps&&updateDisabledDates(),createDateRangeTooltip(state.self,state.tooltipEl,t),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),state.self.context.mainElement.addEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.addEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.addEventListener("keydown",handleCancelSelectionDates),()=>{state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates)}),reset:()=>{const[n,a]=[e.context.selectedDates[0],e.context.selectedDates[e.context.selectedDates.length-1]],o=e.context.selectedDates[0]!==e.context.selectedDates[e.context.selectedDates.length-1],l=parseDates([`${n}:${a}`]).filter((t=>!e.context.disableDates.includes(t))),s=o?e.enableEdgeDatesOnly?[n,a]:l:[e.context.selectedDates[0],e.context.selectedDates[0]];if(setContext(e,"selectedDates",s),e.disableDatesGaps&&(setContext(e,"displayDateMin",state.rangeMin),setContext(e,"displayDateMax",state.rangeMax)),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),e.onCreateDateRangeTooltip)return e.context.selectedDates[0]||(state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),createDateRangeTooltip(state.self,state.tooltipEl,null)),e.context.selectedDates[0]&&(state.self.context.mainElement.addEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.addEventListener("mouseleave",handleMouseLeave),createDateRangeTooltip(state.self,state.tooltipEl,t)),()=>{state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave)}}})[1===e.context.selectedDates.length?"set":"reset"]()},updateDateModifier=e=>{e.context.mainElement.querySelectorAll("[data-vc-date]").forEach((t=>{const n=t.querySelector("[data-vc-date-btn]"),a=t.dataset.vcDate,o=getDate(a).getDay();setDateModifier(e,e.context.selectedYear,t,n,o,a,"current")}))},handleClickDate=(e,t)=>{var n;const a=t.target,o=a.closest("[data-vc-date-btn]");if(!e.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(e.selectionDatesMode)||!o)return;const l=o.closest("[data-vc-date]");({single:()=>handleSelectDate(e,l,!1),multiple:()=>handleSelectDate(e,l,!0),"multiple-ranged":()=>handleSelectDateRange(e,l)})[e.selectionDatesMode](),null==(n=e.context.selectedDates)||n.sort(((e,t)=>+new Date(e)-+new Date(t))),e.onClickDate&&e.onClickDate(e,t),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t);const s=a.closest('[data-vc-date-month="prev"]'),i=a.closest('[data-vc-date-month="next"]');({prev:()=>e.enableMonthChangeOnDayClick?handleMonth(e,"prev"):updateDateModifier(e),next:()=>e.enableMonthChangeOnDayClick?handleMonth(e,"next"):updateDateModifier(e),current:()=>updateDateModifier(e)})[s?"prev":i?"next":"current"]()},typeClick=["month","year"],getValue=(e,t,n)=>{const{currentValue:a,columnID:o}=getColumnID(e,t);return"month"===e.context.currentType&&o>=0?n-o:"year"===e.context.currentType&&e.context.selectedYear!==a?n-1:n},handleMultipleYearSelection=(e,t)=>{const n=getValue(e,"year",Number(t.dataset.vcYearsYear)),a=getDate(e.context.dateMin),o=getDate(e.context.dateMax),l=e.context.displayMonthsCount-1,{columnID:s}=getColumnID(e,"year"),i=e.context.selectedMonth<a.getMonth()&&n<=a.getFullYear(),r=e.context.selectedMonth>o.getMonth()-l+s&&n>=o.getFullYear(),c=n<a.getFullYear(),d=n>o.getFullYear(),u=i||c?a.getFullYear():r||d?o.getFullYear():n,m=i||c?a.getMonth():r||d?o.getMonth()-l+s:e.context.selectedMonth;setContext(e,"selectedYear",u),setContext(e,"selectedMonth",m)},handleMultipleMonthSelection=(e,t)=>{const n=t.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),a=getValue(e,"month",Number(t.dataset.vcMonthsMonth)),o=Number(n.dataset.vcYear),l=getDate(e.context.dateMin),s=getDate(e.context.dateMax),i=a<l.getMonth()&&o<=l.getFullYear(),r=a>s.getMonth()&&o>=s.getFullYear();setContext(e,"selectedYear",o),setContext(e,"selectedMonth",i?l.getMonth():r?s.getMonth():a)},handleItemClick=(e,t,n,a)=>{var o;({year:()=>{if("multiple"===e.type)return handleMultipleYearSelection(e,a);setContext(e,"selectedYear",Number(a.dataset.vcYearsYear))},month:()=>{if("multiple"===e.type)return handleMultipleMonthSelection(e,a);setContext(e,"selectedMonth",Number(a.dataset.vcMonthsMonth))}})[n]();({year:()=>{var n;return null==(n=e.onClickYear)?void 0:n.call(e,e,t)},month:()=>{var n;return null==(n=e.onClickMonth)?void 0:n.call(e,e,t)}})[n](),e.context.currentType!==e.type?(setContext(e,"currentType",e.type),create(e),null==(o=e.context.mainElement.querySelector(`[data-vc="${n}"]`))||o.focus()):setYearModifier(e,a,n,!0,!0)},handleClickType=(e,t,n)=>{var a;const o=t.target,l=o.closest(`[data-vc="${n}"]`),s={year:()=>createYears(e,o),month:()=>createMonths(e,o)};if(l&&e.onClickTitle&&e.onClickTitle(e,t),l&&e.context.currentType!==n)return s[n]();const i=o.closest(`[data-vc-${n}s-${n}]`);if(i)return handleItemClick(e,t,n,i);const r=o.closest('[data-vc="grid"]'),c=o.closest('[data-vc="column"]');(e.context.currentType===n&&l||"multiple"===e.type&&e.context.currentType===n&&r&&!c)&&(setContext(e,"currentType",e.type),create(e),null==(a=e.context.mainElement.querySelector(`[data-vc="${n}"]`))||a.focus())},handleClickMonthOrYear=(e,t)=>{const n={month:e.selectionMonthsMode,year:e.selectionYearsMode};typeClick.forEach((a=>{n[a]&&t.target&&handleClickType(e,t,a)}))},handleClickWeekNumber=(e,t)=>{if(!e.enableWeekNumbers||!e.onClickWeekNumber)return;const n=t.target.closest("[data-vc-week-number]"),a=e.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!n||!a[0])return;const o=Number(n.innerText),l=Number(n.dataset.vcWeekYear),s=Array.from(a).filter((e=>Number(e.dataset.vcDateWeekNumber)===o));e.onClickWeekNumber(e,o,l,s,t)},handleClickWeekDay=(e,t)=>{if(!e.onClickWeekDay)return;const n=t.target.closest("[data-vc-week-day]"),a=t.target.closest('[data-vc="column"]'),o=a?a.querySelectorAll("[data-vc-date-week-day]"):e.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!n||!o[0])return;const l=Number(n.dataset.vcWeekDay),s=Array.from(o).filter((e=>Number(e.dataset.vcDateWeekDay)===l));e.onClickWeekDay(e,l,s,t)},handleClick=e=>{const t=t=>{handleClickArrow(e,t),handleClickWeekDay(e,t),handleClickWeekNumber(e,t),handleClickDate(e,t),handleClickMonthOrYear(e,t)};return e.context.mainElement.addEventListener("click",t),()=>e.context.mainElement.removeEventListener("click",t)},initMonthsCount=e=>{if("multiple"===e.type&&(e.displayMonthsCount<=1||e.displayMonthsCount>12))throw new Error(errorMessages.incorrectMonthsCount);if("multiple"!==e.type&&e.displayMonthsCount>1)throw new Error(errorMessages.incorrectMonthsCount);setContext(e,"displayMonthsCount",e.displayMonthsCount?e.displayMonthsCount:"multiple"===e.type?2:1)},getLocalDate=()=>{const e=new Date;return new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substring(0,10)},resolveDate=(e,t)=>"today"===e?getLocalDate():e instanceof Date||"number"==typeof e||"string"==typeof e?parseDates([e])[0]:t,initRange=e=>{var t,n,a;const o=resolveDate(e.dateMin,e.dateMin),l=resolveDate(e.dateMax,e.dateMax),s=resolveDate(e.displayDateMin,o),i=resolveDate(e.displayDateMax,l);setContext(e,"dateToday",resolveDate(e.dateToday,e.dateToday)),setContext(e,"displayDateMin",s?getDate(o)>=getDate(s)?o:s:o),setContext(e,"displayDateMax",i?getDate(l)<=getDate(i)?l:i:l);const r=e.disableDatesPast&&!e.disableAllDates&&getDate(s)<getDate(e.context.dateToday);setContext(e,"displayDateMin",r||e.disableAllDates?e.context.dateToday:s),setContext(e,"displayDateMax",e.disableAllDates?e.context.dateToday:i),setContext(e,"disableDates",e.disableDates[0]&&!e.disableAllDates?parseDates(e.disableDates):e.disableAllDates?[e.context.displayDateMin]:[]),e.context.disableDates.length>1&&e.context.disableDates.sort(((e,t)=>+new Date(e)-+new Date(t))),setContext(e,"enableDates",e.enableDates[0]?parseDates(e.enableDates):[]),(null==(t=e.context.enableDates)?void 0:t[0])&&(null==(n=e.context.disableDates)?void 0:n[0])&&setContext(e,"disableDates",e.context.disableDates.filter((t=>!e.context.enableDates.includes(t)))),e.context.enableDates.length>1&&e.context.enableDates.sort(((e,t)=>+new Date(e)-+new Date(t))),(null==(a=e.context.enableDates)?void 0:a[0])&&e.disableAllDates&&(setContext(e,"displayDateMin",e.context.enableDates[0]),setContext(e,"displayDateMax",e.context.enableDates[e.context.enableDates.length-1])),setContext(e,"dateMin",e.displayDisabledDates?o:e.context.displayDateMin),setContext(e,"dateMax",e.displayDisabledDates?l:e.context.displayDateMax)},initSelectedDates=e=>{var t;setContext(e,"selectedDates",(null==(t=e.selectedDates)?void 0:t[0])?parseDates(e.selectedDates):[])},displayClosestValidDate=e=>{const t=t=>{const n=new Date(t);setInitialContext(e,n.getMonth(),n.getFullYear())};if(e.displayDateMin&&"today"!==e.displayDateMin&&(n=e.displayDateMin,a=new Date,new Date(n).getTime()>a.getTime())){const n=e.selectedDates.length&&e.selectedDates[0]?parseDates(e.selectedDates)[0]:e.displayDateMin;return t(getDate(resolveDate(n,e.displayDateMin))),!0}var n,a;if(e.displayDateMax&&"today"!==e.displayDateMax&&((e,t)=>new Date(e).getTime()<t.getTime())(e.displayDateMax,new Date)){const n=e.selectedDates.length&&e.selectedDates[0]?parseDates(e.selectedDates)[0]:e.displayDateMax;return t(getDate(resolveDate(n,e.displayDateMax))),!0}return!1},setInitialContext=(e,t,n)=>{setContext(e,"selectedMonth",t),setContext(e,"selectedYear",n),setContext(e,"displayYear",n)},initSelectedMonthYear=e=>{var t;if(e.enableJumpToSelectedDate&&(null==(t=e.selectedDates)?void 0:t[0])&&void 0===e.selectedMonth&&void 0===e.selectedYear){const t=getDate(parseDates(e.selectedDates)[0]);return void setInitialContext(e,t.getMonth(),t.getFullYear())}if(displayClosestValidDate(e))return;const n=void 0!==e.selectedMonth&&Number(e.selectedMonth)>=0&&Number(e.selectedMonth)<12,a=void 0!==e.selectedYear&&Number(e.selectedYear)>=0&&Number(e.selectedYear)<=9999;setInitialContext(e,n?Number(e.selectedMonth):getDate(e.context.dateToday).getMonth(),a?Number(e.selectedYear):getDate(e.context.dateToday).getFullYear())},initTime=e=>{var t,n,a;if(!e.selectionTimeMode)return;if(![12,24].includes(e.selectionTimeMode))throw new Error(errorMessages.incorrectTime);const o=12===e.selectionTimeMode,l=o?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;let[s,i,r]=null!=(a=null==(n=null==(t=e.selectedTime)?void 0:t.match(l))?void 0:n.slice(1))?a:[];s?o&&!r&&(r="AM"):(s=o?transformTime12(String(e.timeMinHour)):String(e.timeMinHour),i=String(e.timeMinMinute),r=o?Number(transformTime12(String(e.timeMinHour)))>=12?"PM":"AM":null),setContext(e,"selectedHours",s.padStart(2,"0")),setContext(e,"selectedMinutes",i.padStart(2,"0")),setContext(e,"selectedKeeping",r),setContext(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${r?` ${r}`:""}`)},initAllVariables=e=>{setContext(e,"currentType",e.type),initMonthsCount(e),initRange(e),initSelectedMonthYear(e),initSelectedDates(e),initTime(e)},reset=(e,{year:t,month:n,dates:a,time:o,locale:l},s=!0)=>{var i;const r={year:e.selectedYear,month:e.selectedMonth,dates:e.selectedDates,time:e.selectedTime};if(e.selectedYear=t?r.year:e.context.selectedYear,e.selectedMonth=n?r.month:e.context.selectedMonth,e.selectedTime=o?r.time:e.context.selectedTime,e.selectedDates="only-first"===a&&(null==(i=e.context.selectedDates)?void 0:i[0])?[e.context.selectedDates[0]]:!0===a?r.dates:e.context.selectedDates,l){setContext(e,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}})}initAllVariables(e),s&&create(e),e.selectedYear=r.year,e.selectedMonth=r.month,e.selectedDates=r.dates,e.selectedTime=r.time,"multiple-ranged"===e.selectionDatesMode&&a&&handleSelectDateRange(e,null)},createToInput=e=>{const t=document.createElement("div");return t.className=e.styles.calendar,t.dataset.vc="calendar",t.dataset.vcInput="",t.dataset.vcCalendarHidden="",setContext(e,"inputModeInit",!0),setContext(e,"isShowInInputMode",!1),setContext(e,"mainElement",t),document.body.appendChild(e.context.mainElement),reset(e,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),setTimeout((()=>show(e))),e.onInit&&e.onInit(e),handleArrowKeys(e),handleClick(e)},canOpenOnFocus=e=>resolveToggle(e,e.openOnFocus),handleInput=e=>{setContext(e,"inputElement",e.context.mainElement);const t=()=>{e.context.inputModeInit?setTimeout((()=>show(e))):createToInput(e)};e.context.inputElement.addEventListener("click",t);const n="function"==typeof e.openOnFocus||!0===e.openOnFocus,a=()=>{shouldSkipOpenOnFocus(e)?clearSkipOpenOnFocus(e):canOpenOnFocus(e)&&t()};n&&e.context.inputElement.addEventListener("focus",a);const o=t=>{const n="Tab"===t.key&&!t.shiftKey,a=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key);(n||a)&&(t=>{var n;if(!e.context.isShowInInputMode)return!1;if(document.activeElement!==e.context.inputElement)return!1;const a=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),o=null!=(n=document.createTreeWalker(e.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>a(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())?n:a(e.context.mainElement)?e.context.mainElement:null;!o||o.tabIndex<0||(t.preventDefault(),o.focus())})(t)};return e.context.inputElement.addEventListener("keydown",o),()=>{e.context.inputElement.removeEventListener("click",t),n&&e.context.inputElement.removeEventListener("focus",a),e.context.inputElement.removeEventListener("keydown",o)}},init=e=>(setContext(e,"originalElement",e.context.mainElement.cloneNode(!0)),setContext(e,"isInit",!0),e.inputMode?handleInput(e):(initAllVariables(e),create(e),e.onInit&&e.onInit(e),handleArrowKeys(e),handleClick(e))),update=(e,t)=>{if(!e.context.isInit)throw new Error(errorMessages.notInit);reset(e,__spreadValues(__spreadValues({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(e.inputMode&&!e.context.inputModeInit)),e.onUpdate&&e.onUpdate(e)},replaceProperties=(e,t)=>{const n=Object.keys(t);for(let a=0;a<n.length;a++){const o=n[a];"object"!=typeof e[o]||"object"!=typeof t[o]||t[o]instanceof Date||Array.isArray(t[o])?void 0!==t[o]&&(e[o]=t[o]):replaceProperties(e[o],t[o])}},set=(e,t,n)=>{replaceProperties(e,t),e.context.isInit&&update(e,n)};function findBestPickerPosition(e,t){const n="left";if(!t||!e)return n;const{canShow:a,parentPositions:o}=getAvailablePosition(e,t),l=a.left&&a.right;return(l&&a.bottom?"center":l&&a.top?["top","center"]:Array.isArray(o)?["bottom"===o[0]?"top":"bottom",...o.slice(1)]:o)||n}const setPosition=(e,t,n)=>{if(!e)return;const a="auto"===n?findBestPickerPosition(e,t):n,o={top:-t.offsetHeight,bottom:e.offsetHeight,left:0,center:e.offsetWidth/2-t.offsetWidth/2,right:e.offsetWidth-t.offsetWidth},l=Array.isArray(a)?a[0]:"bottom",s=Array.isArray(a)?a[1]:a;t.dataset.vcPosition=l;const{top:i,left:r}=getOffset(e),c=i+o[l];let d=r+o[s];const{vw:u}=getViewportDimensions();if(d+t.clientWidth>u){const e=window.innerWidth-document.body.clientWidth;d=u-t.clientWidth-e}else d<0&&(d=0);Object.assign(t.style,{left:`${d}px`,top:`${c}px`})},show=e=>{if(e.context.isShowInInputMode)return;if(!e.context.currentType)return void e.context.mainElement.click();setContext(e,"cleanupHandlers",[]),setContext(e,"isShowInInputMode",!0),e.inputMode&&restoreTabbing(e.context.mainElement),setPosition(e.context.inputElement,e.context.mainElement,e.positionToInput),e.context.mainElement.removeAttribute("data-vc-calendar-hidden");const t=()=>{setPosition(e.context.inputElement,e.context.mainElement,e.positionToInput)};window.addEventListener("resize",t),e.context.cleanupHandlers.push((()=>window.removeEventListener("resize",t)));const n=t=>{"Escape"===t.key&&hide(e)};document.addEventListener("keydown",n),e.context.cleanupHandlers.push((()=>document.removeEventListener("keydown",n)));const a=t=>{t.target===e.context.inputElement||e.context.mainElement.contains(t.target)||hide(e)};document.addEventListener("click",a,{capture:!0}),e.context.cleanupHandlers.push((()=>document.removeEventListener("click",a,{capture:!0}))),e.onShow&&e.onShow(e)},labels={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},styles={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"};class OptionsCalendar{constructor(){__publicField(this,"type","default"),__publicField(this,"inputMode",!1),__publicField(this,"openOnFocus",!0),__publicField(this,"positionToInput","left"),__publicField(this,"firstWeekday",1),__publicField(this,"monthsToSwitch",1),__publicField(this,"themeAttrDetect","html[data-theme]"),__publicField(this,"locale","en"),__publicField(this,"dateToday","today"),__publicField(this,"dateMin","1970-01-01"),__publicField(this,"dateMax","2470-12-31"),__publicField(this,"displayDateMin"),__publicField(this,"displayDateMax"),__publicField(this,"displayDatesOutside",!0),__publicField(this,"displayDisabledDates",!1),__publicField(this,"displayMonthsCount"),__publicField(this,"disableDates",[]),__publicField(this,"disableAllDates",!1),__publicField(this,"disableDatesPast",!1),__publicField(this,"disableDatesGaps",!1),__publicField(this,"disableWeekdays",[]),__publicField(this,"disableToday",!1),__publicField(this,"enableDates",[]),__publicField(this,"enableEdgeDatesOnly",!0),__publicField(this,"enableDateToggle",!0),__publicField(this,"enableWeekNumbers",!1),__publicField(this,"enableMonthChangeOnDayClick",!0),__publicField(this,"enableJumpToSelectedDate",!1),__publicField(this,"selectionDatesMode","single"),__publicField(this,"selectionMonthsMode",!0),__publicField(this,"selectionYearsMode",!0),__publicField(this,"selectionTimeMode",!1),__publicField(this,"selectedDates",[]),__publicField(this,"selectedMonth"),__publicField(this,"selectedYear"),__publicField(this,"selectedHolidays",[]),__publicField(this,"selectedWeekends",[0,6]),__publicField(this,"selectedTime"),__publicField(this,"selectedTheme","system"),__publicField(this,"timeMinHour",0),__publicField(this,"timeMaxHour",23),__publicField(this,"timeMinMinute",0),__publicField(this,"timeMaxMinute",59),__publicField(this,"timeControls","all"),__publicField(this,"timeStepHour",1),__publicField(this,"timeStepMinute",1),__publicField(this,"sanitizerHTML",(e=>e)),__publicField(this,"onClickDate"),__publicField(this,"onClickWeekDay"),__publicField(this,"onClickWeekNumber"),__publicField(this,"onClickTitle"),__publicField(this,"onClickMonth"),__publicField(this,"onClickYear"),__publicField(this,"onClickArrow"),__publicField(this,"onChangeTime"),__publicField(this,"onChangeToInput"),__publicField(this,"onCreateDateRangeTooltip"),__publicField(this,"onCreateDateEls"),__publicField(this,"onCreateMonthEls"),__publicField(this,"onCreateYearEls"),__publicField(this,"onInit"),__publicField(this,"onUpdate"),__publicField(this,"onDestroy"),__publicField(this,"onShow"),__publicField(this,"onHide"),__publicField(this,"popups",{}),__publicField(this,"labels",__spreadValues({},labels)),__publicField(this,"layouts",{default:"",multiple:"",month:"",year:""}),__publicField(this,"styles",__spreadValues({},styles))}}const _Calendar=class e extends OptionsCalendar{constructor(t,n){var a;super(),__publicField(this,"init",(()=>init(this))),__publicField(this,"update",(e=>update(this,e))),__publicField(this,"destroy",(()=>destroy(this))),__publicField(this,"show",(()=>show(this))),__publicField(this,"hide",(()=>hide(this))),__publicField(this,"set",((e,t)=>set(this,e,t))),__publicField(this,"context"),this.context=__spreadProps(__spreadValues({},this.context),{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),setContext(this,"mainElement","string"==typeof t?null!=(a=e.memoizedElements.get(t))?a:this.queryAndMemoize(t):t),n&&replaceProperties(this,n)}queryAndMemoize(t){const n=document.querySelector(t);if(!n)throw new Error(errorMessages.notFoundSelector(t));return e.memoizedElements.set(t,n),n}};__publicField(_Calendar,"memoizedElements",new Map);let Calendar=_Calendar;export{Calendar};
|