@editora/ui-core 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
- package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
- package/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +39 -62
- package/dist/alert-dialog.cjs.js +19 -19
- package/dist/alert-dialog.esm.js +69 -87
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +4 -7
- package/dist/anchor.cjs.js +2 -2
- package/dist/anchor.esm.js +3 -3
- package/dist/animated-beam.cjs.js +83 -83
- package/dist/animated-beam.esm.js +250 -277
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +47 -61
- package/dist/animated-text.cjs.js +2 -2
- package/dist/animated-text.esm.js +13 -24
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +11 -13
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +4 -7
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +7 -13
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +4 -7
- package/dist/block-controls.cjs.js +2 -2
- package/dist/block-controls.esm.js +19 -35
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +8 -15
- package/dist/breadcrumb.cjs.js +2 -2
- package/dist/breadcrumb.esm.js +20 -37
- package/dist/button.cjs.js +1 -521
- package/dist/button.esm.js +2 -671
- package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
- package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +8 -9
- package/dist/card.cjs.js +4 -4
- package/dist/card.esm.js +13 -19
- package/dist/chart.cjs.js +64 -64
- package/dist/chart.esm.js +223 -254
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +2 -3
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +5 -9
- package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +30 -29
- package/dist/color-picker.cjs.js +10 -10
- package/dist/color-picker.esm.js +190 -253
- package/dist/combobox.cjs.js +13 -13
- package/dist/combobox.esm.js +93 -126
- package/dist/command-palette.cjs.js +3 -3
- package/dist/command-palette.esm.js +19 -30
- package/dist/command.cjs.js +4 -4
- package/dist/command.esm.js +41 -53
- package/dist/components/ui-collection.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-portal.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +8 -0
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts +1 -0
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/container.cjs.js +2 -2
- package/dist/container.esm.js +2 -3
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +157 -219
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +2 -3
- package/dist/data-table.cjs.js +4 -4
- package/dist/data-table.esm.js +299 -381
- package/dist/date-field.cjs.js +3 -3
- package/dist/date-field.esm.js +68 -80
- package/dist/date-picker.cjs.js +9 -9
- package/dist/date-picker.esm.js +69 -97
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +32 -56
- package/dist/date-range-time-picker.cjs.js +9 -9
- package/dist/date-range-time-picker.esm.js +111 -140
- package/dist/date-time-picker.cjs.js +7 -7
- package/dist/date-time-picker.esm.js +115 -147
- package/dist/date-time-utils-Dmost5Ee.js +1 -0
- package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +3 -5
- package/dist/dialog.cjs.js +12 -12
- package/dist/dialog.esm.js +44 -63
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +2 -3
- package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
- package/dist/dismissable-layer-DNfrKA20.js +1 -0
- package/dist/dismissable-layer.cjs.js +2 -2
- package/dist/dismissable-layer.esm.js +4 -6
- package/dist/dock.cjs.js +5 -5
- package/dist/dock.esm.js +134 -155
- package/dist/drawer.cjs.js +2 -2
- package/dist/drawer.esm.js +18 -35
- package/dist/dropdown.cjs.js +2 -2
- package/dist/dropdown.esm.js +119 -149
- package/dist/dropzone.cjs.js +1 -1
- package/dist/dropzone.esm.js +0 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +3 -5
- package/dist/field.cjs.js +5 -5
- package/dist/field.esm.js +27 -34
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +19 -24
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +69 -93
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +5 -9
- package/dist/floating-toolbar.cjs.js +4 -4
- package/dist/floating-toolbar.esm.js +60 -85
- package/dist/focus-scope-Bwug2gDv.js +1 -0
- package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
- package/dist/focus-scope.cjs.js +2 -2
- package/dist/focus-scope.esm.js +15 -20
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +26 -53
- package/dist/gantt.cjs.js +43 -43
- package/dist/gantt.esm.js +295 -322
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +5 -9
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +22 -28
- package/dist/icon-cloud.cjs.js +7 -7
- package/dist/icon-cloud.esm.js +48 -62
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +2 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +378 -390
- package/dist/inline-edit.cjs.js +11 -11
- package/dist/inline-edit.esm.js +32 -36
- package/dist/input.cjs.js +17 -17
- package/dist/input.esm.js +50 -63
- package/dist/label.cjs.js +2 -2
- package/dist/label.esm.js +8 -17
- package/dist/layout.cjs.js +2 -2
- package/dist/layout.esm.js +20 -26
- package/dist/listbox-B6QgECax.js +46 -0
- package/dist/listbox-DJamVeFj.mjs +200 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +2 -4
- package/dist/marquee.cjs.js +5 -5
- package/dist/marquee.esm.js +33 -50
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +5 -9
- package/dist/menu.cjs.js +3 -3
- package/dist/menu.esm.js +106 -126
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +118 -164
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +4 -4
- package/dist/multi-select.cjs.js +5 -5
- package/dist/multi-select.esm.js +125 -137
- package/dist/navigation-menu.cjs.js +4 -4
- package/dist/navigation-menu.esm.js +44 -55
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +73 -98
- package/dist/number-ticker.cjs.js +3 -3
- package/dist/number-ticker.esm.js +22 -43
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +5 -9
- package/dist/orbiter.cjs.js +13 -13
- package/dist/orbiter.esm.js +79 -90
- package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
- package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +14 -18
- package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
- package/dist/panel-group-CaD0_KQf.js +36 -0
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +2 -5
- package/dist/panel.cjs.js +4 -4
- package/dist/panel.esm.js +8 -10
- package/dist/password-field.cjs.js +9 -9
- package/dist/password-field.esm.js +62 -82
- package/dist/pin-input.cjs.js +3 -3
- package/dist/pin-input.esm.js +33 -39
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +108 -131
- package/dist/plugin-panel.cjs.js +7 -7
- package/dist/plugin-panel.esm.js +13 -15
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +21 -31
- package/dist/portal-DgpQ3Jo1.js +1 -0
- package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
- package/dist/portal.cjs.js +3 -3
- package/dist/portal.esm.js +20 -28
- package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
- package/dist/positioner-D_fqyx_j.js +1 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +22 -28
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/primitives/auto-scroll.d.ts +9 -0
- package/dist/primitives/auto-scroll.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +4 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +5 -9
- package/dist/quick-actions.cjs.js +6 -6
- package/dist/quick-actions.esm.js +52 -62
- package/dist/radio-group.cjs.js +13 -13
- package/dist/radio-group.esm.js +39 -51
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +5 -9
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +12 -23
- package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +3 -5
- package/dist/runtime-CTaOSmBj.js +1 -0
- package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +6 -6
- package/dist/scroll-area.cjs.js +3 -3
- package/dist/scroll-area.esm.js +38 -46
- package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +7 -7
- package/dist/select.esm.js +67 -97
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +8 -15
- package/dist/selector-BvAh35ve.js +1 -0
- package/dist/selector-WI8pD7YO.mjs +18 -0
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +18 -18
- package/dist/sidebar.esm.js +117 -139
- package/dist/skeleton.cjs.js +11 -11
- package/dist/skeleton.esm.js +27 -24
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +6 -11
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +16 -19
- package/dist/sortable.cjs.js +79 -65
- package/dist/sortable.esm.js +714 -734
- package/dist/spinning-text.cjs.js +12 -12
- package/dist/spinning-text.esm.js +80 -92
- package/dist/split-button.cjs.js +4 -4
- package/dist/split-button.esm.js +77 -62
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +8 -8
- package/dist/stepper.esm.js +32 -52
- package/dist/switch.cjs.js +7 -7
- package/dist/switch.esm.js +23 -31
- package/dist/table.cjs.js +2 -2
- package/dist/table.esm.js +46 -56
- package/dist/tabs.cjs.js +8 -8
- package/dist/tabs.esm.js +89 -109
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +49 -52
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +22 -22
- package/dist/time-picker.esm.js +88 -110
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +3 -5
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +33 -47
- package/dist/toggle-group.cjs.js +6 -6
- package/dist/toggle-group.esm.js +85 -105
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +3 -5
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +13 -24
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +31 -42
- package/dist/transfer-list.cjs.js +31 -31
- package/dist/transfer-list.esm.js +114 -127
- package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
- package/dist/tree-Dx_kv_ih.js +39 -0
- package/dist/tree-item.cjs.js +2 -2
- package/dist/tree-item.esm.js +2 -3
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +2 -5
- package/dist/ui-button-Q0GNNWKC.mjs +665 -0
- package/dist/ui-button-rXQOS9QJ.js +521 -0
- package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
- package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +14 -14
- package/dist/wizard.esm.js +85 -105
- package/package.json +2 -2
- package/dist/date-time-utils-66480de4.js +0 -1
- package/dist/date-time-utils-a2c7af25.mjs +0 -307
- package/dist/dismissable-layer-193e3bed.js +0 -1
- package/dist/focus-scope-2b12b4e7.js +0 -1
- package/dist/listbox-308789a0.mjs +0 -210
- package/dist/listbox-ef2f708e.js +0 -46
- package/dist/panel-group-40254cdd.js +0 -36
- package/dist/portal-c69756c0.js +0 -1
- package/dist/positioner-33529bb8.js +0 -1
- package/dist/runtime-3f13807b.js +0 -1
- package/dist/tree-0a7a8d05.js +0 -39
- /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
- /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
- /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
- /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
- /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const $e=require("./ElementBase-EV6mVBUV.js"),Oe={calendarLabel:"Calendar",today:"Today",clear:"Clear",apply:"Apply",cancel:"Cancel",now:"Now",previousMonth:"Previous month",nextMonth:"Next month",chooseMonthYear:"Choose month and year",previousYear:"Previous year",nextYear:"Next year",syncingSchedule:"Syncing schedule...",unableToSyncEvents:"Unable to sync events",scheduleSynced:"Schedule synced",event:"Event",selectDate:"Select date",selectDateRange:"Select date range",startDate:"Start date",endDate:"End date",startEnd:"Start — End",toggleCalendar:"Toggle calendar",clearDate:"Clear date",clearDateRange:"Clear date range",invalidDate:"Invalid date",dateOutOfRange:"Date is outside the allowed range",invalidRange:"Invalid range",invalidTime:"Invalid time",invalidDateTime:"Invalid date-time",invalidRangeOrder:"Invalid range order",rangeIncomplete:"Range is incomplete",last7Days:"Last 7 days",thisMonth:"This month",hour:"Hour",minute:"Minute",second:"Second",meridiem:"Meridiem",am:"AM",pm:"PM",startTime:"Start time",endTime:"End time",datePickerPanel:"Date picker panel",timePlaceholder:"HH:mm",timePlaceholderSeconds:"HH:mm:ss",dateTimePlaceholder:"YYYY-MM-DD HH:mm",dateRangeTimePlaceholder:"Start — End"},Pe={calendarLabel:"日历",today:"今天",clear:"清除",apply:"应用",cancel:"取消",now:"现在",previousMonth:"上个月",nextMonth:"下个月",chooseMonthYear:"选择月份和年份",previousYear:"上一年",nextYear:"下一年",syncingSchedule:"正在同步日程...",unableToSyncEvents:"无法同步事件",scheduleSynced:"日程已同步",event:"事件",selectDate:"选择日期",selectDateRange:"选择日期范围",startDate:"开始日期",endDate:"结束日期",startEnd:"开始 — 结束",toggleCalendar:"切换日历",clearDate:"清除日期",clearDateRange:"清除日期范围",invalidDate:"日期无效",dateOutOfRange:"日期超出允许范围",invalidRange:"范围无效",invalidTime:"时间无效",invalidDateTime:"日期时间无效",invalidRangeOrder:"范围顺序无效",rangeIncomplete:"范围不完整",last7Days:"最近7天",thisMonth:"本月",hour:"小时",minute:"分钟",second:"秒",meridiem:"上午/下午",am:"上午",pm:"下午",startTime:"开始时间",endTime:"结束时间",datePickerPanel:"日期选择面板",timePlaceholder:"HH:mm",timePlaceholderSeconds:"HH:mm:ss",dateTimePlaceholder:"YYYY-MM-DD HH:mm",dateRangeTimePlaceholder:"开始 — 结束"},Le={calendarLabel:"Calendrier",today:"Aujourd'hui",clear:"Effacer",apply:"Appliquer",cancel:"Annuler",now:"Maintenant",previousMonth:"Mois precedent",nextMonth:"Mois suivant",chooseMonthYear:"Choisir le mois et l annee",previousYear:"Annee precedente",nextYear:"Annee suivante",syncingSchedule:"Synchronisation du planning...",unableToSyncEvents:"Impossible de synchroniser les evenements",scheduleSynced:"Planning synchronise",event:"Evenement",selectDate:"Selectionner une date",selectDateRange:"Selectionner une periode",startDate:"Date de debut",endDate:"Date de fin",startEnd:"Debut — Fin",toggleCalendar:"Afficher le calendrier",clearDate:"Effacer la date",clearDateRange:"Effacer la periode",invalidDate:"Date invalide",dateOutOfRange:"La date est hors de la plage autorisee",invalidRange:"Periode invalide",invalidTime:"Heure invalide",invalidDateTime:"Date/heure invalide",invalidRangeOrder:"Ordre de periode invalide",rangeIncomplete:"Periode incomplete",last7Days:"7 derniers jours",thisMonth:"Ce mois-ci",hour:"Heure",minute:"Minute",second:"Seconde",meridiem:"AM/PM",am:"AM",pm:"PM",startTime:"Heure de debut",endTime:"Heure de fin",datePickerPanel:"Panneau de selection de date",timePlaceholder:"HH:mm",timePlaceholderSeconds:"HH:mm:ss",dateTimePlaceholder:"YYYY-MM-DD HH:mm",dateRangeTimePlaceholder:"Debut — Fin"},Be={en:Oe,zh:Pe,fr:Le},oe=new Map;function Fe(r){return r.trim().toLowerCase().replace(/_/g,"-")}function He(r){const e=r||(typeof navigator<"u"&&navigator.language?navigator.language:"en"),t=Fe(e||"");return t==="zh"||t.startsWith("zh-")||t==="cn"||t==="chinese"||t==="zh-cn"||t==="zh-hans"||t==="zh-hant"?"zh":t==="fr"||t.startsWith("fr-")||t==="french"?"fr":"en"}function le(r){if(!r||typeof r!="object"||Array.isArray(r))return{};const e={};return Object.entries(r).forEach(([t,n])=>{typeof n=="string"&&(e[t]=n)}),e}function Ue(r,e){if(!r)return{};try{const t=JSON.parse(r);if(!t||typeof t!="object"||Array.isArray(t))return{};const n=le(t),a=le(t[e]);return{...n,...a}}catch{return{}}}function fe(r,e){const t=He(r),n=`${t}::${e||""}`,a=oe.get(n);if(a)return a;const i=Be[t],s=Ue(e,t),l={...i,...s};return oe.set(n,l),l}const Ne=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-calendar-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 95%, transparent);
|
|
4
4
|
--ui-calendar-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 74%, transparent);
|
|
@@ -640,62 +640,62 @@
|
|
|
640
640
|
from { background-position: 120% 0; }
|
|
641
641
|
to { background-position: -120% 0; }
|
|
642
642
|
}
|
|
643
|
-
`,K={default:"var(--ui-color-primary, #2563eb)",info:"var(--ui-color-info, #0891b2)",success:"var(--ui-color-success, #16a34a)",warning:"var(--ui-color-warning, #d97706)",danger:"var(--ui-color-danger, #dc2626)"};function P(r,e,t){return Math.max(e,Math.min(t,r))}function B(r){return String(r).padStart(2,"0")}function v(r){return`${r.y}-${B(r.m)}-${B(r.d)}`}function c(r){const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec((r||"").trim());if(!e)return null;const t=Number(e[1]),a=Number(e[2]),n=Number(e[3]);if(!Number.isInteger(t)||!Number.isInteger(a)||!Number.isInteger(n)||a<1||a>12)return null;const i=H(t,a);return n<1||n>i?null:{y:t,m:a,d:n}}function H(r,e){return new Date(Date.UTC(r,e,0)).getUTCDate()}function F(r){return new Date(Date.UTC(r.y,r.m-1,r.d))}function be(r){return{y:r.getUTCFullYear(),m:r.getUTCMonth()+1,d:r.getUTCDate()}}function k(r,e){const t=c(r),a=c(e);return!t||!a?r.localeCompare(e):t.y!==a.y?t.y-a.y:t.m!==a.m?t.m-a.m:t.d-a.d}function ve(r,e){const t=c(r);if(!t)return r;const a=F(t);return a.setUTCDate(a.getUTCDate()+e),v(be(a))}function L(r,e){const t=new Date(Date.UTC(r.y,r.m-1,1));t.setUTCMonth(t.getUTCMonth()+e);const a=t.getUTCFullYear(),n=t.getUTCMonth()+1,i=P(r.d,1,H(a,n));return{y:a,m:n,d:i}}function me(r,e){const t=c(r);return t?v(L(t,e)):r}function W(r,e){return{y:r,m:e,d:1}}function ye(r,e){return{y:r,m:e,d:H(r,e)}}function ce(r){const e=c(r);return e?F(e).getUTCDay():0}function Z(r,e){if(r==null||r==="")return e;const t=Number(r);return Number.isFinite(t)?Math.trunc(t):e}function ue(r,e){const t=Z(r,e);return t<1?e:t}function Ye(r,e){if(r==null)return e;const t=String(r).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function m(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function J(r,e,t){return k(r,e)>=0&&k(r,t)<=0}function E(r,e){return k(r,e)<=0?{start:r,end:e}:{start:e,end:r}}function he(r,e){var a;const t=Number(r);if(t===0||t===1||t===6)return t;try{const n=new Intl.Locale(e||void 0),i=(a=n==null?void 0:n.weekInfo)==null?void 0:a.firstDay;if(i===7)return 0;if(i===1||i===6)return i}catch{}return 0}function je(r){return r==="range"||r==="multiple"?r:"single"}function Ve(r){return r==="none"||r==="select"?r:"navigate"}function qe(r){return r==="badges"||r==="count"?r:"dots"}function Ke(r){return r==="sm"||r==="lg"?r:"md"}function Je(r){return r==="neutral"||r==="info"||r==="success"||r==="warning"||r==="danger"?r:null}function pe(r){return r==="loading"||r==="error"||r==="success"?r:"idle"}function fe(r){const e=[],t=new Set;return r.forEach(a=>{const n=c(a);if(!n)return;const i=v(n);t.has(i)||(t.add(i),e.push(i))}),e.sort(k),e}function O(r){return r.mode==="single"?{mode:"single",value:r.value}:r.mode==="range"?{mode:"range",start:r.start,end:r.end}:{mode:"multiple",values:[...r.values]}}class _e extends Ee.ElementBase{constructor(){super(),this._eventsRawCache=null,this._eventsParsedCache=[],this._eventsByDateCache=new Map,this._valueRawCache=null,this._valueModeCache=null,this._valueParsedCache={mode:"single",value:null},this._focusedIso="",this._hoverIso=null,this._pickerOpen=!1,this._syncingValueAttribute=!1,this._rangeKeyboardAnchor=null,this._shouldRefocus=!1,this._docPointerDownBound=e=>this._onDocumentPointerDown(e),this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerOver=this._onPointerOver.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onFocusIn=this._onFocusIn.bind(this)}static get observedAttributes(){return["year","month","events","value","variant","headless","selection","min","max","disabled","readonly","week-start","locale","translations","outside-click","events-max","events-display","max-selections","size","hide-today","show-today","tone","state","bare","aria-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.root.addEventListener("pointerover",this._onPointerOver),this.root.addEventListener("mouseleave",this._onMouseLeave),this.root.addEventListener("focusin",this._onFocusIn),this._syncDocumentListener()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.root.removeEventListener("pointerover",this._onPointerOver),this.root.removeEventListener("mouseleave",this._onMouseLeave),this.root.removeEventListener("focusin",this._onFocusIn),typeof document<"u"&&document.removeEventListener("pointerdown",this._docPointerDownBound,!0),super.disconnectedCallback()}attributeChangedCallback(e,t,a){t!==a&&(e==="events"&&(this._eventsRawCache=null),e==="value"&&!this._syncingValueAttribute&&(this._rangeKeyboardAnchor=null,this._valueRawCache=null),e==="selection"&&(this._rangeKeyboardAnchor=null,this._valueModeCache=null),e==="disabled"&&this.hasAttribute("disabled")&&(this._pickerOpen=!1,this._hoverIso=null),e==="state"&&pe(a)==="loading"&&(this._pickerOpen=!1,this._hoverIso=null),this.isConnected&&(this._syncDocumentListener(),this.requestRender()))}focusDate(e){const t=c(e);t&&(this.goToMonth(t.y,t.m),this._focusedIso=v(t),this._shouldRefocus=!0,this.requestRender())}goToMonth(e,t,a="api"){if(!Number.isFinite(e)||!Number.isFinite(t))return;let n=Math.trunc(e),i=Math.trunc(t);for(;i<1;)i+=12,n-=1;for(;i>12;)i-=12,n+=1;let s=!1;if(String(n)!==(this.getAttribute("year")||"")&&(this.setAttribute("year",String(n)),s=!0),String(i)!==(this.getAttribute("month")||"")&&(this.setAttribute("month",String(i)),s=!0),s){const o={year:n,month:i,source:a};this.dispatchEvent(new CustomEvent("month-change",{detail:o,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-month-change",{detail:o,bubbles:!0,composed:!0}))}}selectDate(e){const t=c(e);if(!t)return;const a=v(t);this._shouldRefocus=!0,this._applySelection(a,!1,"api")}_syncDocumentListener(){typeof document>"u"||(document.removeEventListener("pointerdown",this._docPointerDownBound,!0),this._pickerOpen&&document.addEventListener("pointerdown",this._docPointerDownBound,!0))}_onDocumentPointerDown(e){!this._pickerOpen||e.composedPath().includes(this)||(this._pickerOpen=!1,this.requestRender())}_resolveLocale(){return(this.getAttribute("locale")||"").trim()||(typeof navigator<"u"?navigator.language:"en-US")}_resolvedView(){const e=new Date,t=Z(this.getAttribute("year"),e.getFullYear()),a=Z(this.getAttribute("month"),e.getMonth()+1);return{year:t,month:P(a,1,12)}}_todayIso(){const e=new Date;return`${e.getFullYear()}-${B(e.getMonth()+1)}-${B(e.getDate())}`}_resolveMinIso(){const e=c(this.getAttribute("min")||"");return e?v(e):null}_resolveMaxIso(){const e=c(this.getAttribute("max")||"");return e?v(e):null}_monthHasAllowedDay(e,t,a,n){const i=v(W(e,t)),s=v(ye(e,t));return!(a&&k(s,a)<0||n&&k(i,n)>0)}_resolveSelectionMode(){return je(this.getAttribute("selection"))}_resolveEventsDisplay(){return qe(this.getAttribute("events-display"))}_resolveOutsideClickMode(){return Ve(this.getAttribute("outside-click"))}_resolveCalendarSize(){return Ke(this.getAttribute("size"))}_resolveTone(){return Je(this.getAttribute("tone"))}_resolveState(){return pe(this.getAttribute("state"))}_resolveLabel(){const e=(this.getAttribute("aria-label")||"").trim();return e||this._translations().calendarLabel}_translations(){return ge(this.getAttribute("locale"),this.getAttribute("translations"))}_resolveBounds(){let e=this._resolveMinIso(),t=this._resolveMaxIso();if(e&&t&&k(e,t)>0){const a=e;e=t,t=a}return{minIso:e,maxIso:t}}_direction(){const e=this.getAttribute("dir");if(e==="rtl"||e==="ltr")return e;const t=this.closest("[dir]"),a=t==null?void 0:t.getAttribute("dir");return a==="rtl"||a==="ltr"?a:getComputedStyle(this).direction==="rtl"?"rtl":"ltr"}_maxSelections(){return ue(this.getAttribute("max-selections"),Number.MAX_SAFE_INTEGER)}_eventsMax(){return P(ue(this.getAttribute("events-max"),3),1,9)}_showTodayButton(){return this.hasAttribute("hide-today")?!1:Ye(this.getAttribute("show-today"),!0)}_isDisabled(){return this.hasAttribute("disabled")}_isReadonly(){return this.hasAttribute("readonly")}_isInteractionDisabled(){return this._isDisabled()||this._resolveState()==="loading"}_isDateOutOfBounds(e,t,a){return!!(t&&k(e,t)<0||a&&k(e,a)>0)}_isDateBlocked(e,t,a,n){return!!(this._isInteractionDisabled()||this._isDateOutOfBounds(e,a,n)||t&&this._resolveOutsideClickMode()==="none")}_normalizeValueForMode(e){const t=this.getAttribute("value")||"";if(this._valueRawCache===t&&this._valueModeCache===e)return O(this._valueParsedCache);let a;if(e==="multiple"){try{const i=JSON.parse(t);if(!Array.isArray(i))a={mode:e,values:[]};else{const s=fe(i.map(o=>String(o||"")));a={mode:e,values:s}}}catch{a={mode:e,values:[]}}return this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=O(a),a}if(e==="range"){try{const i=JSON.parse(t),s=i&&typeof i=="object"?String(i.start||""):"",o=i&&typeof i=="object"?String(i.end||""):"",d=c(s),u=c(o),h=d?v(d):null,p=u?v(u):null;if(h&&p){const f=E(h,p);a={mode:e,start:f.start,end:f.end}}else a={mode:e,start:h,end:null}}catch{a={mode:e,start:null,end:null}}return this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=O(a),a}const n=c(t);return a={mode:e,value:n?v(n):null},this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=O(a),a}_serializeSelection(e){if(e.mode==="single")return e.value;if(e.mode==="multiple")return JSON.stringify(e.values);const t={};return e.start&&(t.start=e.start),e.end&&(t.end=e.end),!t.start&&!t.end?null:JSON.stringify(t)}_emitSelectionEvents(e,t,a){e.mode==="single"&&t&&(this.dispatchEvent(new CustomEvent("select",{detail:{value:t,source:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-select",{detail:{value:t,source:a},bubbles:!0,composed:!0})));const n={mode:e.mode,source:a};e.mode==="single"?n.value=e.value:e.mode==="range"?(n.value=e.start&&e.end?{start:e.start,end:e.end}:null,n.start=e.start,n.end=e.end):(n.value=[...e.values],n.values=[...e.values]),this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-change",{detail:n,bubbles:!0,composed:!0}))}_setValueAttribute(e){this._syncingValueAttribute=!0;try{e?this.getAttribute("value")!==e&&this.setAttribute("value",e):this.hasAttribute("value")&&this.removeAttribute("value")}finally{this._syncingValueAttribute=!1}}_applySelection(e,t,a){if(!c(e))return;const n=this._resolveSelectionMode(),{minIso:i,maxIso:s}=this._resolveBounds();if(this._isDateOutOfBounds(e,i,s))return;const o=this._isReadonly();if(this._isInteractionDisabled()||o)return;let d=this._normalizeValueForMode(n);if(n==="single")d={mode:n,value:e};else if(n==="multiple"){const p=this._normalizeValueForMode("multiple"),f=new Set(p.values);f.has(e)?f.delete(e):f.size<this._maxSelections()&&f.add(e),d={mode:n,values:fe(Array.from(f))}}else{const p=this._normalizeValueForMode("range"),f=p.start,_=p.end;if(t){const l=this._rangeKeyboardAnchor||f||this._focusedIso||e;if(!c(l))this._rangeKeyboardAnchor=e,d={mode:n,start:e,end:null};else{const b=E(l,e);d={mode:n,start:b.start,end:b.end}}}else if(!f||f&&_)this._rangeKeyboardAnchor=e,d={mode:n,start:e,end:null};else if(f&&!_){const l=E(f,e);d={mode:n,start:l.start,end:l.end}}}const u=this.getAttribute("value"),h=this._serializeSelection(d);u!==h?(this._setValueAttribute(h),this._emitSelectionEvents(d,n==="single"?e:null,a)):n==="single"&&this._emitSelectionEvents(d,e,a),this._focusedIso=e,this._hoverIso=null,this._shouldRefocus=!0,a!=="api"&&this.requestRender()}_monthLabel(e,t,a){try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(e,t-1,1)))}catch{return`${String(t)} ${e}`}}_monthPickerLabels(e){try{const t=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"});return Array.from({length:12},(a,n)=>t.format(new Date(Date.UTC(2024,n,1))))}catch{return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}_weekdayLabels(e,t){const a=[],n=new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"});for(let i=0;i<7;i+=1){const s=(t+i)%7,o=new Date(Date.UTC(2024,0,7+s));a.push(n.format(o))}return a}_dayAriaLabel(e,t){const a=c(e);if(!a)return e;try{return new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}).format(F(a))}catch{return e}}_ensureEventsCache(){const e=this.getAttribute("events");if(e!==this._eventsRawCache&&(this._eventsRawCache=e,this._eventsParsedCache=[],this._eventsByDateCache=new Map,!!e))try{const t=JSON.parse(e);if(!Array.isArray(t))return;const a=[];t.forEach(n=>{if(!n||typeof n!="object")return;const i=String(n.date||"").trim(),s=c(i),o=s?v(s):"";if(!o)return;const d=String(n.tone||"default"),u=d==="success"||d==="warning"||d==="danger"||d==="info"?d:"default",h=n.title!=null?String(n.title):void 0;a.push({date:o,title:h,tone:u})}),this._eventsParsedCache=a,a.forEach(n=>{this._eventsByDateCache.has(n.date)||this._eventsByDateCache.set(n.date,[]),this._eventsByDateCache.get(n.date).push(n)})}catch{}}_buildCells(e,t,a,n,i,s){const o=v(W(e,t)),u=(ce(o)-a+7)%7,h=c(o);if(!h)return[];const p=F(h);p.setUTCDate(p.getUTCDate()-u);const f=[];for(let _=0;_<42;_+=1){_>0&&p.setUTCDate(p.getUTCDate()+1);const l=be(p),b=v(l),D=l.y!==e||l.m!==t,y=this._isDateBlocked(b,D,n,i);f.push({iso:b,parts:l,outside:D,disabled:y,today:b===s})}return f}_resolveFocusIso(e,t,a){var d;const n=new Map;e.forEach(u=>n.set(u.iso,u));const i=u=>{if(!u)return null;const h=n.get(u);return!h||h.disabled?null:u};let s=i(this._focusedIso);if(s||(t.mode==="single"&&(s=i(t.value)),!s&&t.mode==="range"&&(s=i(t.end||t.start)),!s&&t.mode==="multiple"&&(s=i(t.values[0])),s||(s=i(a)),s))return s;const o=e.find(u=>!u.disabled);return o?o.iso:((d=e[0])==null?void 0:d.iso)||""}_focusDateButton(e){if(!e)return;const t=this.root.activeElement;if((t==null?void 0:t.getAttribute("data-date"))===e)return;const a=`.day[data-date="${e}"]`,n=this.root.querySelector(a);if(n)try{n.focus({preventScroll:!0})}catch{n.focus()}}_moveFocusByDays(e,t,a){const n=ve(e,t),i=c(n);i&&(this.goToMonth(i.y,i.m,"keyboard"),this._focusedIso=n,this._shouldRefocus=!0,a&&this._resolveSelectionMode()==="range"&&!this._isReadonly()&&!this._isInteractionDisabled()?this._applySelection(n,!0,"keyboard"):this.requestRender())}_moveFocusByMonths(e,t){const a=me(e,t),n=c(a);n&&(this.goToMonth(n.y,n.m,"keyboard"),this._focusedIso=a,this._shouldRefocus=!0,this.requestRender())}_focusWeekBoundary(e,t,a){const i=(ce(e)-a+7)%7,s=t==="start"?-i:6-i;this._moveFocusByDays(e,s,!1)}_onPointerOver(e){if(this._resolveSelectionMode()!=="range")return;const t=this._normalizeValueForMode("range");if(!t.start||t.end)return;const a=e.target,n=a==null?void 0:a.closest(".day");if(!n)return;const i=n.getAttribute("data-date")||"";if(!c(i))return;const s=n.getAttribute("data-outside")==="true",{minIso:o,maxIso:d}=this._resolveBounds();this._isDateBlocked(i,s,o,d)||this._hoverIso!==i&&(this._hoverIso=i,this.requestRender())}_onMouseLeave(){this._hoverIso!=null&&(this._hoverIso=null,this.requestRender())}_onFocusIn(e){const t=e.target,a=t==null?void 0:t.closest(".day");if(!a)return;const n=a.getAttribute("data-date")||"";if(c(n)&&(this._focusedIso=n,this._resolveSelectionMode()==="range")){const i=this._normalizeValueForMode("range");i.start&&!i.end&&(this._hoverIso=n,this.requestRender())}}_toggleMonthYearPicker(e){this._isInteractionDisabled()||(this._pickerOpen=typeof e=="boolean"?e:!this._pickerOpen,this._syncDocumentListener(),this.requestRender())}_onClick(e){const t=e.target;if(!t)return;const a=t.closest("[data-action]"),n=(a==null?void 0:a.getAttribute("data-action"))||"",{year:i,month:s}=this._resolvedView(),o=this._todayIso(),d=c(o);if(n==="prev-month"||n==="next-month"){if(this._isInteractionDisabled())return;const l=n==="prev-month"?-1:1,D=(this._focusedIso?c(this._focusedIso):null)||{y:i,m:s,d:1},y=L(D,l);this.goToMonth(y.y,y.m,"pointer"),this._focusedIso=v({y:y.y,m:y.m,d:P(D.d,1,H(y.y,y.m))}),this._shouldRefocus=!0,this.requestRender();return}if(n==="today"){if(this._isInteractionDisabled())return;this.goToMonth(d.y,d.m,"pointer"),this._focusedIso=o,this._shouldRefocus=!0,this._isReadonly()?this.requestRender():this._applySelection(o,!1,"pointer");return}if(n==="toggle-monthyear"){this._toggleMonthYearPicker();return}if(n==="picker-prev-year"||n==="picker-next-year"){if(this._isInteractionDisabled())return;const l=n==="picker-prev-year"?-1:1;this.goToMonth(i+l,s,"pointer"),this._pickerOpen=!0,this._shouldRefocus=!0,this.requestRender();return}if(n==="pick-month"){if(this._isInteractionDisabled())return;const l=Number((a==null?void 0:a.getAttribute("data-month"))||"");if(!Number.isInteger(l)||l<1||l>12)return;this.goToMonth(i,l,"pointer"),this._pickerOpen=!1,this._shouldRefocus=!0,this.requestRender();return}const u=t.closest(".day");if(!u)return;const h=u.getAttribute("data-date")||"";if(!c(h))return;const p=u.getAttribute("data-outside")==="true",{minIso:f,maxIso:_}=this._resolveBounds();if(!this._isDateBlocked(h,p,f,_)){if(p){const l=this._resolveOutsideClickMode();if(l==="none")return;if(l==="navigate"){const b=c(h);this.goToMonth(b.y,b.m,"pointer")}}if(this._isReadonly()){this._focusedIso=h,this._shouldRefocus=!0,this.requestRender();return}this._applySelection(h,!1,"pointer")}}_onKeyDown(e){if(e.key==="Escape"&&this._pickerOpen){e.preventDefault(),this._toggleMonthYearPicker(!1);return}const t=e.target,a=t==null?void 0:t.closest(".day");if(!a)return;const n=a.getAttribute("data-date")||"";if(!c(n))return;const i=he(this.getAttribute("week-start"),this._resolveLocale()),s=this._direction()==="rtl",o=e.shiftKey;if(e.key==="ArrowRight"){e.preventDefault(),this._moveFocusByDays(n,s?-1:1,o);return}if(e.key==="ArrowLeft"){e.preventDefault(),this._moveFocusByDays(n,s?1:-1,o);return}if(e.key==="ArrowDown"){e.preventDefault(),this._moveFocusByDays(n,7,o);return}if(e.key==="ArrowUp"){e.preventDefault(),this._moveFocusByDays(n,-7,o);return}if(e.key==="Home"){e.preventDefault(),this._focusWeekBoundary(n,"start",i);return}if(e.key==="End"){e.preventDefault(),this._focusWeekBoundary(n,"end",i);return}if(e.key==="PageUp"){e.preventDefault(),this._moveFocusByMonths(n,e.shiftKey?-12:-1);return}if(e.key==="PageDown"){e.preventDefault(),this._moveFocusByMonths(n,e.shiftKey?12:1);return}if(e.key==="Enter"||e.key===" "){e.preventDefault();const d=a.getAttribute("data-outside")==="true",{minIso:u,maxIso:h}=this._resolveBounds();if(this._isDateBlocked(n,d,u,h))return;if(d&&this._resolveOutsideClickMode()==="navigate"){const p=c(n);this.goToMonth(p.y,p.m,"keyboard")}this._isReadonly()||this._applySelection(n,!1,"keyboard")}}render(){const e=this._resolveLocale(),t=this._translations(),a=he(this.getAttribute("week-start"),e),{year:n,month:i}=this._resolvedView(),s=this._resolveSelectionMode(),{minIso:o,maxIso:d}=this._resolveBounds(),u=this._todayIso(),h=this._resolveEventsDisplay(),p=this._eventsMax(),f=this._resolveCalendarSize(),_=this._resolveTone(),l=this._resolveState(),b=this._isInteractionDisabled(),D=this._resolveLabel();_?this.setAttribute("tone",_):this.removeAttribute("tone"),l!=="idle"?this.setAttribute("state",l):this.removeAttribute("state"),l==="loading"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this._ensureEventsCache();const y=this._normalizeValueForMode(s),X=this._buildCells(n,i,a,o,d,u);this._focusedIso=this._resolveFocusIso(X,y,u);const G=this._monthLabel(n,i,e),Q=L({y:n,m:i,d:1},-1),ee=L({y:n,m:i,d:1},1),xe=this._monthHasAllowedDay(Q.y,Q.m,o,d),ke=this._monthHasAllowedDay(ee.y,ee.m,o,d),we=this._weekdayLabels(e,a),I=s==="range"?y:null,S=(I==null?void 0:I.start)||null,M=(I==null?void 0:I.end)||null,U=s==="multiple"?new Set(y.values):null;let N=null,Y=null;if(s==="range"&&S&&!M&&this._hoverIso&&c(this._hoverIso)){const x=E(S,this._hoverIso);N=x.start,Y=x.end}const te=[];for(let x=0;x<6;x+=1){const A=X.slice(x*7,x*7+7).map(g=>{const w=this._eventsByDateCache.get(g.iso)||[],Ae=this._dayAriaLabel(g.iso,e);let T=!1;s==="single"?T=y.value===g.iso:s==="multiple"?T=(U==null?void 0:U.has(g.iso))||!1:S&&M&&(T=J(g.iso,S,M));const R=!!(S&&M&&J(g.iso,S,M)),j=!!(S&&g.iso===S),V=!!(M&&g.iso===M),Te=!!(N&&Y&&J(g.iso,N,Y)),Re=!g.disabled&&g.iso===this._focusedIso?0:-1;let C="";w.length>0&&(h==="count"?C=`<span class="event-count" part="event-more" style="--event-tone:${K[w[0].tone||"default"]}">${w.length}</span>`:h==="badges"?C=w.slice(0,p).map($=>{const q=m($.title||t.event);return`<span class="event-badge" part="event-dot" style="--event-tone:${K[$.tone||"default"]}" title="${q}">${q}</span>`}).join(""):C=w.slice(0,p).map($=>`<span class="event-dot" part="event-dot" style="--event-tone:${K[$.tone||"default"]}"></span>`).join(""),w.length>p&&h!=="count"&&(C+=`<span class="event-more" part="event-more">+${w.length-p}</span>`));const re=`ui-calendar-tip-${g.iso}`,ie=w.length?w.map(z=>m(z.title||t.event)).join("<br/>"):"",se=ie.length>0,ze=C?`<span class="events" part="events">${C}</span>`:"",$e=se?`<span class="tooltip" part="tooltip" id="${re}">${ie}</span>`:"",oe=T||R||j||V;return`
|
|
643
|
+
`,V={default:"var(--ui-color-primary, #2563eb)",info:"var(--ui-color-info, #0891b2)",success:"var(--ui-color-success, #16a34a)",warning:"var(--ui-color-warning, #d97706)",danger:"var(--ui-color-danger, #dc2626)"};function O(r,e,t){return Math.max(e,Math.min(t,r))}function L(r){return String(r).padStart(2,"0")}function v(r){return`${r.y}-${L(r.m)}-${L(r.d)}`}function c(r){const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec((r||"").trim());if(!e)return null;const t=Number(e[1]),n=Number(e[2]),a=Number(e[3]);if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(a)||n<1||n>12)return null;const i=F(t,n);return a<1||a>i?null:{y:t,m:n,d:a}}function F(r,e){return new Date(Date.UTC(r,e,0)).getUTCDate()}function B(r){return new Date(Date.UTC(r.y,r.m-1,r.d))}function ge(r){return{y:r.getUTCFullYear(),m:r.getUTCMonth()+1,d:r.getUTCDate()}}function k(r,e){const t=c(r),n=c(e);return!t||!n?r.localeCompare(e):t.y!==n.y?t.y-n.y:t.m!==n.m?t.m-n.m:t.d-n.d}function be(r,e){const t=c(r);if(!t)return r;const n=B(t);return n.setUTCDate(n.getUTCDate()+e),v(ge(n))}function P(r,e){const t=new Date(Date.UTC(r.y,r.m-1,1));t.setUTCMonth(t.getUTCMonth()+e);const n=t.getUTCFullYear(),a=t.getUTCMonth()+1,i=O(r.d,1,F(n,a));return{y:n,m:a,d:i}}function ve(r,e){const t=c(r);return t?v(P(t,e)):r}function K(r,e){return{y:r,m:e,d:1}}function me(r,e){return{y:r,m:e,d:F(r,e)}}function de(r){const e=c(r);return e?B(e).getUTCDay():0}function W(r,e){if(r==null||r==="")return e;const t=Number(r);return Number.isFinite(t)?Math.trunc(t):e}function ce(r,e){const t=W(r,e);return t<1?e:t}function Ye(r,e){if(r==null)return e;const t=String(r).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function m(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function q(r,e,t){return k(r,e)>=0&&k(r,t)<=0}function E(r,e){return k(r,e)<=0?{start:r,end:e}:{start:e,end:r}}function ue(r,e){const t=Number(r);if(t===0||t===1||t===6)return t;try{const a=new Intl.Locale(e||void 0)?.weekInfo?.firstDay;if(a===7)return 0;if(a===1||a===6)return a}catch{}return 0}function je(r){return r==="range"||r==="multiple"?r:"single"}function Ve(r){return r==="none"||r==="select"?r:"navigate"}function qe(r){return r==="badges"||r==="count"?r:"dots"}function Ke(r){return r==="sm"||r==="lg"?r:"md"}function We(r){return r==="neutral"||r==="info"||r==="success"||r==="warning"||r==="danger"?r:null}function he(r){return r==="loading"||r==="error"||r==="success"?r:"idle"}function pe(r){const e=[],t=new Set;return r.forEach(n=>{const a=c(n);if(!a)return;const i=v(a);t.has(i)||(t.add(i),e.push(i))}),e.sort(k),e}function $(r){return r.mode==="single"?{mode:"single",value:r.value}:r.mode==="range"?{mode:"range",start:r.start,end:r.end}:{mode:"multiple",values:[...r.values]}}class ye extends $e.ElementBase{constructor(){super(),this._eventsRawCache=null,this._eventsParsedCache=[],this._eventsByDateCache=new Map,this._valueRawCache=null,this._valueModeCache=null,this._valueParsedCache={mode:"single",value:null},this._focusedIso="",this._hoverIso=null,this._pickerOpen=!1,this._syncingValueAttribute=!1,this._rangeKeyboardAnchor=null,this._shouldRefocus=!1,this._docPointerDownBound=e=>this._onDocumentPointerDown(e),this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerOver=this._onPointerOver.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onFocusIn=this._onFocusIn.bind(this)}static get observedAttributes(){return["year","month","events","value","variant","headless","selection","min","max","disabled","readonly","week-start","locale","translations","outside-click","events-max","events-display","max-selections","size","hide-today","show-today","tone","state","bare","aria-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.root.addEventListener("pointerover",this._onPointerOver),this.root.addEventListener("mouseleave",this._onMouseLeave),this.root.addEventListener("focusin",this._onFocusIn),this._syncDocumentListener()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.root.removeEventListener("pointerover",this._onPointerOver),this.root.removeEventListener("mouseleave",this._onMouseLeave),this.root.removeEventListener("focusin",this._onFocusIn),typeof document<"u"&&document.removeEventListener("pointerdown",this._docPointerDownBound,!0),super.disconnectedCallback()}attributeChangedCallback(e,t,n){t!==n&&(e==="events"&&(this._eventsRawCache=null),e==="value"&&!this._syncingValueAttribute&&(this._rangeKeyboardAnchor=null,this._valueRawCache=null),e==="selection"&&(this._rangeKeyboardAnchor=null,this._valueModeCache=null),e==="disabled"&&this.hasAttribute("disabled")&&(this._pickerOpen=!1,this._hoverIso=null),e==="state"&&he(n)==="loading"&&(this._pickerOpen=!1,this._hoverIso=null),this.isConnected&&(this._syncDocumentListener(),this.requestRender()))}focusDate(e){const t=c(e);t&&(this.goToMonth(t.y,t.m),this._focusedIso=v(t),this._shouldRefocus=!0,this.requestRender())}goToMonth(e,t,n="api"){if(!Number.isFinite(e)||!Number.isFinite(t))return;let a=Math.trunc(e),i=Math.trunc(t);for(;i<1;)i+=12,a-=1;for(;i>12;)i-=12,a+=1;let s=!1;if(String(a)!==(this.getAttribute("year")||"")&&(this.setAttribute("year",String(a)),s=!0),String(i)!==(this.getAttribute("month")||"")&&(this.setAttribute("month",String(i)),s=!0),s){const l={year:a,month:i,source:n};this.dispatchEvent(new CustomEvent("month-change",{detail:l,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-month-change",{detail:l,bubbles:!0,composed:!0}))}}selectDate(e){const t=c(e);if(!t)return;const n=v(t);this._shouldRefocus=!0,this._applySelection(n,!1,"api")}_syncDocumentListener(){typeof document>"u"||(document.removeEventListener("pointerdown",this._docPointerDownBound,!0),this._pickerOpen&&document.addEventListener("pointerdown",this._docPointerDownBound,!0))}_onDocumentPointerDown(e){!this._pickerOpen||e.composedPath().includes(this)||(this._pickerOpen=!1,this.requestRender())}_resolveLocale(){return(this.getAttribute("locale")||"").trim()||(typeof navigator<"u"?navigator.language:"en-US")}_resolvedView(){const e=new Date,t=W(this.getAttribute("year"),e.getFullYear()),n=W(this.getAttribute("month"),e.getMonth()+1);return{year:t,month:O(n,1,12)}}_todayIso(){const e=new Date;return`${e.getFullYear()}-${L(e.getMonth()+1)}-${L(e.getDate())}`}_resolveMinIso(){const e=c(this.getAttribute("min")||"");return e?v(e):null}_resolveMaxIso(){const e=c(this.getAttribute("max")||"");return e?v(e):null}_monthHasAllowedDay(e,t,n,a){const i=v(K(e,t)),s=v(me(e,t));return!(n&&k(s,n)<0||a&&k(i,a)>0)}_resolveSelectionMode(){return je(this.getAttribute("selection"))}_resolveEventsDisplay(){return qe(this.getAttribute("events-display"))}_resolveOutsideClickMode(){return Ve(this.getAttribute("outside-click"))}_resolveCalendarSize(){return Ke(this.getAttribute("size"))}_resolveTone(){return We(this.getAttribute("tone"))}_resolveState(){return he(this.getAttribute("state"))}_resolveLabel(){const e=(this.getAttribute("aria-label")||"").trim();return e||this._translations().calendarLabel}_translations(){return fe(this.getAttribute("locale"),this.getAttribute("translations"))}_resolveBounds(){let e=this._resolveMinIso(),t=this._resolveMaxIso();if(e&&t&&k(e,t)>0){const n=e;e=t,t=n}return{minIso:e,maxIso:t}}_direction(){const e=this.getAttribute("dir");if(e==="rtl"||e==="ltr")return e;const n=this.closest("[dir]")?.getAttribute("dir");return n==="rtl"||n==="ltr"?n:getComputedStyle(this).direction==="rtl"?"rtl":"ltr"}_maxSelections(){return ce(this.getAttribute("max-selections"),Number.MAX_SAFE_INTEGER)}_eventsMax(){return O(ce(this.getAttribute("events-max"),3),1,9)}_showTodayButton(){return this.hasAttribute("hide-today")?!1:Ye(this.getAttribute("show-today"),!0)}_isDisabled(){return this.hasAttribute("disabled")}_isReadonly(){return this.hasAttribute("readonly")}_isInteractionDisabled(){return this._isDisabled()||this._resolveState()==="loading"}_isDateOutOfBounds(e,t,n){return!!(t&&k(e,t)<0||n&&k(e,n)>0)}_isDateBlocked(e,t,n,a){return!!(this._isInteractionDisabled()||this._isDateOutOfBounds(e,n,a)||t&&this._resolveOutsideClickMode()==="none")}_normalizeValueForMode(e){const t=this.getAttribute("value")||"";if(this._valueRawCache===t&&this._valueModeCache===e)return $(this._valueParsedCache);let n;if(e==="multiple"){try{const i=JSON.parse(t);if(!Array.isArray(i))n={mode:e,values:[]};else{const s=pe(i.map(l=>String(l||"")));n={mode:e,values:s}}}catch{n={mode:e,values:[]}}return this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=$(n),n}if(e==="range"){try{const i=JSON.parse(t),s=i&&typeof i=="object"?String(i.start||""):"",l=i&&typeof i=="object"?String(i.end||""):"",o=c(s),p=c(l),h=o?v(o):null,u=p?v(p):null;if(h&&u){const f=E(h,u);n={mode:e,start:f.start,end:f.end}}else n={mode:e,start:h,end:null}}catch{n={mode:e,start:null,end:null}}return this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=$(n),n}const a=c(t);return n={mode:e,value:a?v(a):null},this._valueRawCache=t,this._valueModeCache=e,this._valueParsedCache=$(n),n}_serializeSelection(e){if(e.mode==="single")return e.value;if(e.mode==="multiple")return JSON.stringify(e.values);const t={};return e.start&&(t.start=e.start),e.end&&(t.end=e.end),!t.start&&!t.end?null:JSON.stringify(t)}_emitSelectionEvents(e,t,n){e.mode==="single"&&t&&(this.dispatchEvent(new CustomEvent("select",{detail:{value:t,source:n},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-select",{detail:{value:t,source:n},bubbles:!0,composed:!0})));const a={mode:e.mode,source:n};e.mode==="single"?a.value=e.value:e.mode==="range"?(a.value=e.start&&e.end?{start:e.start,end:e.end}:null,a.start=e.start,a.end=e.end):(a.value=[...e.values],a.values=[...e.values]),this.dispatchEvent(new CustomEvent("change",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("ui-change",{detail:a,bubbles:!0,composed:!0}))}_setValueAttribute(e){this._syncingValueAttribute=!0;try{e?this.getAttribute("value")!==e&&this.setAttribute("value",e):this.hasAttribute("value")&&this.removeAttribute("value")}finally{this._syncingValueAttribute=!1}}_applySelection(e,t,n){if(!c(e))return;const a=this._resolveSelectionMode(),{minIso:i,maxIso:s}=this._resolveBounds();if(this._isDateOutOfBounds(e,i,s))return;const l=this._isReadonly();if(this._isInteractionDisabled()||l)return;let o=this._normalizeValueForMode(a);if(a==="single")o={mode:a,value:e};else if(a==="multiple"){const u=this._normalizeValueForMode("multiple"),f=new Set(u.values);f.has(e)?f.delete(e):f.size<this._maxSelections()&&f.add(e),o={mode:a,values:pe(Array.from(f))}}else{const u=this._normalizeValueForMode("range"),f=u.start,_=u.end;if(t){const d=this._rangeKeyboardAnchor||f||this._focusedIso||e;if(!c(d))this._rangeKeyboardAnchor=e,o={mode:a,start:e,end:null};else{const b=E(d,e);o={mode:a,start:b.start,end:b.end}}}else if(!f||f&&_)this._rangeKeyboardAnchor=e,o={mode:a,start:e,end:null};else if(f&&!_){const d=E(f,e);o={mode:a,start:d.start,end:d.end}}}const p=this.getAttribute("value"),h=this._serializeSelection(o);p!==h?(this._setValueAttribute(h),this._emitSelectionEvents(o,a==="single"?e:null,n)):a==="single"&&this._emitSelectionEvents(o,e,n),this._focusedIso=e,this._hoverIso=null,this._shouldRefocus=!0,n!=="api"&&this.requestRender()}_monthLabel(e,t,n){try{return new Intl.DateTimeFormat(n,{month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(Date.UTC(e,t-1,1)))}catch{return`${String(t)} ${e}`}}_monthPickerLabels(e){try{const t=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"});return Array.from({length:12},(n,a)=>t.format(new Date(Date.UTC(2024,a,1))))}catch{return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}_weekdayLabels(e,t){const n=[],a=new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"});for(let i=0;i<7;i+=1){const s=(t+i)%7,l=new Date(Date.UTC(2024,0,7+s));n.push(a.format(l))}return n}_dayAriaLabel(e,t){const n=c(e);if(!n)return e;try{return new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}).format(B(n))}catch{return e}}_ensureEventsCache(){const e=this.getAttribute("events");if(e!==this._eventsRawCache&&(this._eventsRawCache=e,this._eventsParsedCache=[],this._eventsByDateCache=new Map,!!e))try{const t=JSON.parse(e);if(!Array.isArray(t))return;const n=[];t.forEach(a=>{if(!a||typeof a!="object")return;const i=String(a.date||"").trim(),s=c(i),l=s?v(s):"";if(!l)return;const o=String(a.tone||"default"),p=o==="success"||o==="warning"||o==="danger"||o==="info"?o:"default",h=a.title!=null?String(a.title):void 0;n.push({date:l,title:h,tone:p})}),this._eventsParsedCache=n,n.forEach(a=>{this._eventsByDateCache.has(a.date)||this._eventsByDateCache.set(a.date,[]),this._eventsByDateCache.get(a.date).push(a)})}catch{}}_buildCells(e,t,n,a,i,s){const l=v(K(e,t)),p=(de(l)-n+7)%7,h=c(l);if(!h)return[];const u=B(h);u.setUTCDate(u.getUTCDate()-p);const f=[];for(let _=0;_<42;_+=1){_>0&&u.setUTCDate(u.getUTCDate()+1);const d=ge(u),b=v(d),D=d.y!==e||d.m!==t,y=this._isDateBlocked(b,D,a,i);f.push({iso:b,parts:d,outside:D,disabled:y,today:b===s})}return f}_resolveFocusIso(e,t,n){const a=new Map;e.forEach(o=>a.set(o.iso,o));const i=o=>{if(!o)return null;const p=a.get(o);return!p||p.disabled?null:o};let s=i(this._focusedIso);if(s||(t.mode==="single"&&(s=i(t.value)),!s&&t.mode==="range"&&(s=i(t.end||t.start)),!s&&t.mode==="multiple"&&(s=i(t.values[0])),s||(s=i(n)),s))return s;const l=e.find(o=>!o.disabled);return l?l.iso:e[0]?.iso||""}_focusDateButton(e){if(!e||this.root.activeElement?.getAttribute("data-date")===e)return;const n=`.day[data-date="${e}"]`,a=this.root.querySelector(n);if(a)try{a.focus({preventScroll:!0})}catch{a.focus()}}_moveFocusByDays(e,t,n){const a=be(e,t),i=c(a);i&&(this.goToMonth(i.y,i.m,"keyboard"),this._focusedIso=a,this._shouldRefocus=!0,n&&this._resolveSelectionMode()==="range"&&!this._isReadonly()&&!this._isInteractionDisabled()?this._applySelection(a,!0,"keyboard"):this.requestRender())}_moveFocusByMonths(e,t){const n=ve(e,t),a=c(n);a&&(this.goToMonth(a.y,a.m,"keyboard"),this._focusedIso=n,this._shouldRefocus=!0,this.requestRender())}_focusWeekBoundary(e,t,n){const i=(de(e)-n+7)%7,s=t==="start"?-i:6-i;this._moveFocusByDays(e,s,!1)}_onPointerOver(e){if(this._resolveSelectionMode()!=="range")return;const t=this._normalizeValueForMode("range");if(!t.start||t.end)return;const a=e.target?.closest(".day");if(!a)return;const i=a.getAttribute("data-date")||"";if(!c(i))return;const s=a.getAttribute("data-outside")==="true",{minIso:l,maxIso:o}=this._resolveBounds();this._isDateBlocked(i,s,l,o)||this._hoverIso!==i&&(this._hoverIso=i,this.requestRender())}_onMouseLeave(){this._hoverIso!=null&&(this._hoverIso=null,this.requestRender())}_onFocusIn(e){const n=e.target?.closest(".day");if(!n)return;const a=n.getAttribute("data-date")||"";if(c(a)&&(this._focusedIso=a,this._resolveSelectionMode()==="range")){const i=this._normalizeValueForMode("range");i.start&&!i.end&&(this._hoverIso=a,this.requestRender())}}_toggleMonthYearPicker(e){this._isInteractionDisabled()||(this._pickerOpen=typeof e=="boolean"?e:!this._pickerOpen,this._syncDocumentListener(),this.requestRender())}_onClick(e){const t=e.target;if(!t)return;const n=t.closest("[data-action]"),a=n?.getAttribute("data-action")||"",{year:i,month:s}=this._resolvedView(),l=this._todayIso(),o=c(l);if(a==="prev-month"||a==="next-month"){if(this._isInteractionDisabled())return;const d=a==="prev-month"?-1:1,D=(this._focusedIso?c(this._focusedIso):null)||{y:i,m:s,d:1},y=P(D,d);this.goToMonth(y.y,y.m,"pointer"),this._focusedIso=v({y:y.y,m:y.m,d:O(D.d,1,F(y.y,y.m))}),this._shouldRefocus=!0,this.requestRender();return}if(a==="today"){if(this._isInteractionDisabled())return;this.goToMonth(o.y,o.m,"pointer"),this._focusedIso=l,this._shouldRefocus=!0,this._isReadonly()?this.requestRender():this._applySelection(l,!1,"pointer");return}if(a==="toggle-monthyear"){this._toggleMonthYearPicker();return}if(a==="picker-prev-year"||a==="picker-next-year"){if(this._isInteractionDisabled())return;const d=a==="picker-prev-year"?-1:1;this.goToMonth(i+d,s,"pointer"),this._pickerOpen=!0,this._shouldRefocus=!0,this.requestRender();return}if(a==="pick-month"){if(this._isInteractionDisabled())return;const d=Number(n?.getAttribute("data-month")||"");if(!Number.isInteger(d)||d<1||d>12)return;this.goToMonth(i,d,"pointer"),this._pickerOpen=!1,this._shouldRefocus=!0,this.requestRender();return}const p=t.closest(".day");if(!p)return;const h=p.getAttribute("data-date")||"";if(!c(h))return;const u=p.getAttribute("data-outside")==="true",{minIso:f,maxIso:_}=this._resolveBounds();if(!this._isDateBlocked(h,u,f,_)){if(u){const d=this._resolveOutsideClickMode();if(d==="none")return;if(d==="navigate"){const b=c(h);this.goToMonth(b.y,b.m,"pointer")}}if(this._isReadonly()){this._focusedIso=h,this._shouldRefocus=!0,this.requestRender();return}this._applySelection(h,!1,"pointer")}}_onKeyDown(e){if(e.key==="Escape"&&this._pickerOpen){e.preventDefault(),this._toggleMonthYearPicker(!1);return}const n=e.target?.closest(".day");if(!n)return;const a=n.getAttribute("data-date")||"";if(!c(a))return;const i=ue(this.getAttribute("week-start"),this._resolveLocale()),s=this._direction()==="rtl",l=e.shiftKey;if(e.key==="ArrowRight"){e.preventDefault(),this._moveFocusByDays(a,s?-1:1,l);return}if(e.key==="ArrowLeft"){e.preventDefault(),this._moveFocusByDays(a,s?1:-1,l);return}if(e.key==="ArrowDown"){e.preventDefault(),this._moveFocusByDays(a,7,l);return}if(e.key==="ArrowUp"){e.preventDefault(),this._moveFocusByDays(a,-7,l);return}if(e.key==="Home"){e.preventDefault(),this._focusWeekBoundary(a,"start",i);return}if(e.key==="End"){e.preventDefault(),this._focusWeekBoundary(a,"end",i);return}if(e.key==="PageUp"){e.preventDefault(),this._moveFocusByMonths(a,e.shiftKey?-12:-1);return}if(e.key==="PageDown"){e.preventDefault(),this._moveFocusByMonths(a,e.shiftKey?12:1);return}if(e.key==="Enter"||e.key===" "){e.preventDefault();const o=n.getAttribute("data-outside")==="true",{minIso:p,maxIso:h}=this._resolveBounds();if(this._isDateBlocked(a,o,p,h))return;if(o&&this._resolveOutsideClickMode()==="navigate"){const u=c(a);this.goToMonth(u.y,u.m,"keyboard")}this._isReadonly()||this._applySelection(a,!1,"keyboard")}}render(){const e=this._resolveLocale(),t=this._translations(),n=ue(this.getAttribute("week-start"),e),{year:a,month:i}=this._resolvedView(),s=this._resolveSelectionMode(),{minIso:l,maxIso:o}=this._resolveBounds(),p=this._todayIso(),h=this._resolveEventsDisplay(),u=this._eventsMax(),f=this._resolveCalendarSize(),_=this._resolveTone(),d=this._resolveState(),b=this._isInteractionDisabled(),D=this._resolveLabel();_?this.setAttribute("tone",_):this.removeAttribute("tone"),d!=="idle"?this.setAttribute("state",d):this.removeAttribute("state"),d==="loading"?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this._ensureEventsCache();const y=this._normalizeValueForMode(s),J=this._buildCells(a,i,n,l,o,p);this._focusedIso=this._resolveFocusIso(J,y,p);const Z=this._monthLabel(a,i,e),X=P({y:a,m:i,d:1},-1),G=P({y:a,m:i,d:1},1),_e=this._monthHasAllowedDay(X.y,X.m,l,o),xe=this._monthHasAllowedDay(G.y,G.m,l,o),ke=this._weekdayLabels(e,n),Q=s==="range"?y:null,S=Q?.start||null,M=Q?.end||null,we=s==="multiple"?new Set(y.values):null;let H=null,U=null;if(s==="range"&&S&&!M&&this._hoverIso&&c(this._hoverIso)){const x=E(S,this._hoverIso);H=x.start,U=x.end}const ee=[];for(let x=0;x<6;x+=1){const C=J.slice(x*7,x*7+7).map(g=>{const w=this._eventsByDateCache.get(g.iso)||[],Ae=this._dayAriaLabel(g.iso,e);let A=!1;s==="single"?A=y.value===g.iso:s==="multiple"?A=we?.has(g.iso)||!1:S&&M&&(A=q(g.iso,S,M));const T=!!(S&&M&&q(g.iso,S,M)),N=!!(S&&g.iso===S),Y=!!(M&&g.iso===M),Te=!!(H&&U&&q(g.iso,H,U)),Re=!g.disabled&&g.iso===this._focusedIso?0:-1;let I="";w.length>0&&(h==="count"?I=`<span class="event-count" part="event-more" style="--event-tone:${V[w[0].tone||"default"]}">${w.length}</span>`:h==="badges"?I=w.slice(0,u).map(z=>{const j=m(z.title||t.event);return`<span class="event-badge" part="event-dot" style="--event-tone:${V[z.tone||"default"]}" title="${j}">${j}</span>`}).join(""):I=w.slice(0,u).map(z=>`<span class="event-dot" part="event-dot" style="--event-tone:${V[z.tone||"default"]}"></span>`).join(""),w.length>u&&h!=="count"&&(I+=`<span class="event-more" part="event-more">+${w.length-u}</span>`));const ne=`ui-calendar-tip-${g.iso}`,re=w.length?w.map(R=>m(R.title||t.event)).join("<br/>"):"",ie=re.length>0,ze=I?`<span class="events" part="events">${I}</span>`:"",Ee=ie?`<span class="tooltip" part="tooltip" id="${ne}">${re}</span>`:"",se=A||T||N||Y;return`
|
|
644
644
|
<button
|
|
645
645
|
type="button"
|
|
646
646
|
class="day"
|
|
647
|
-
part="${
|
|
647
|
+
part="${T||N||Y?"day range":"day"}"
|
|
648
648
|
role="gridcell"
|
|
649
649
|
data-date="${g.iso}"
|
|
650
650
|
data-outside="${g.outside?"true":"false"}"
|
|
651
651
|
data-disabled="${g.disabled?"true":"false"}"
|
|
652
652
|
data-today="${g.today?"true":"false"}"
|
|
653
|
-
data-selected="${
|
|
654
|
-
data-range="${
|
|
655
|
-
data-range-start="${
|
|
656
|
-
data-range-end="${
|
|
657
|
-
data-range-preview="${!
|
|
658
|
-
aria-selected="${
|
|
653
|
+
data-selected="${se?"true":"false"}"
|
|
654
|
+
data-range="${T?"true":"false"}"
|
|
655
|
+
data-range-start="${N?"true":"false"}"
|
|
656
|
+
data-range-end="${Y?"true":"false"}"
|
|
657
|
+
data-range-preview="${!T&&Te?"true":"false"}"
|
|
658
|
+
aria-selected="${se?"true":"false"}"
|
|
659
659
|
aria-disabled="${g.disabled?"true":"false"}"
|
|
660
660
|
${g.today?'aria-current="date"':""}
|
|
661
661
|
aria-label="${m(Ae)}"
|
|
662
|
-
${
|
|
662
|
+
${ie?`aria-describedby="${ne}"`:""}
|
|
663
663
|
tabindex="${Re}"
|
|
664
664
|
>
|
|
665
665
|
<span class="day-number" part="day-number">${g.parts.d}</span>
|
|
666
666
|
${ze}
|
|
667
|
-
${
|
|
667
|
+
${Ee}
|
|
668
668
|
</button>
|
|
669
|
-
`}).join("");
|
|
669
|
+
`}).join("");ee.push(`<div class="week" role="row">${C}</div>`)}const De=this._monthPickerLabels(e).map((x,ae)=>{const C=ae+1;return`
|
|
670
670
|
<button
|
|
671
671
|
type="button"
|
|
672
672
|
class="picker-month"
|
|
673
673
|
part="monthyear"
|
|
674
674
|
data-action="pick-month"
|
|
675
|
-
data-month="${
|
|
676
|
-
data-active="${
|
|
675
|
+
data-month="${C}"
|
|
676
|
+
data-active="${C===i?"true":"false"}"
|
|
677
677
|
${b?"disabled":""}
|
|
678
678
|
>
|
|
679
679
|
${x}
|
|
680
680
|
</button>
|
|
681
|
-
`}).join(""),Se=
|
|
681
|
+
`}).join(""),Se=ke.map(x=>`<span class="weekday" part="weekday" role="columnheader">${m(x)}</span>`).join(""),Me=this._showTodayButton()?`<button type="button" class="today-btn" part="today" data-action="today" ${b?"disabled":""}>${m(t.today)}</button>`:"",te=d==="loading"?t.syncingSchedule:d==="error"?t.unableToSyncEvents:d==="success"?t.scheduleSynced:"";this.setContent(`
|
|
682
682
|
<style>${Ne}</style>
|
|
683
683
|
<section
|
|
684
684
|
class="frame"
|
|
685
685
|
part="frame"
|
|
686
686
|
data-size="${f}"
|
|
687
|
-
data-state="${
|
|
687
|
+
data-state="${d}"
|
|
688
688
|
aria-disabled="${b?"true":"false"}"
|
|
689
689
|
aria-label="${m(D)}"
|
|
690
690
|
>
|
|
691
|
-
<div class="live-region" aria-live="polite" aria-atomic="true">${m(
|
|
691
|
+
<div class="live-region" aria-live="polite" aria-atomic="true">${m(Z)}</div>
|
|
692
692
|
|
|
693
693
|
<header class="header" part="header">
|
|
694
694
|
<div class="nav" part="nav">
|
|
695
|
-
<button type="button" class="nav-btn" part="prev" data-action="prev-month" ${!
|
|
695
|
+
<button type="button" class="nav-btn" part="prev" data-action="prev-month" ${!_e||b?"disabled":""} aria-label="${m(t.previousMonth)}">
|
|
696
696
|
<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M14.7 6.3a1 1 0 0 1 0 1.4L10.41 12l4.29 4.3a1 1 0 1 1-1.42 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.42 0Z" fill="currentColor"/></svg>
|
|
697
697
|
</button>
|
|
698
|
-
<button type="button" class="nav-btn" part="next" data-action="next-month" ${!
|
|
698
|
+
<button type="button" class="nav-btn" part="next" data-action="next-month" ${!xe||b?"disabled":""} aria-label="${m(t.nextMonth)}">
|
|
699
699
|
<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M9.3 17.7a1 1 0 0 1 0-1.4L13.59 12 9.3 7.7a1 1 0 0 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4 0Z" fill="currentColor"/></svg>
|
|
700
700
|
</button>
|
|
701
701
|
</div>
|
|
@@ -710,13 +710,13 @@
|
|
|
710
710
|
aria-expanded="${this._pickerOpen?"true":"false"}"
|
|
711
711
|
aria-label="${m(t.chooseMonthYear)}"
|
|
712
712
|
>
|
|
713
|
-
<span>${m(
|
|
713
|
+
<span>${m(Z)}</span>
|
|
714
714
|
<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M6.7 9.7a1 1 0 0 1 1.4 0L12 13.59l3.9-3.9a1 1 0 1 1 1.4 1.42l-4.6 4.6a1 1 0 0 1-1.4 0l-4.6-4.6a1 1 0 0 1 0-1.42Z" fill="currentColor"/></svg>
|
|
715
715
|
</button>
|
|
716
716
|
<section class="monthyear-pop" part="monthyear" ${this._pickerOpen?"":"hidden"}>
|
|
717
717
|
<div class="picker-header">
|
|
718
718
|
<button type="button" class="picker-year-btn" part="prev" data-action="picker-prev-year" ${b?"disabled":""} aria-label="${m(t.previousYear)}">-</button>
|
|
719
|
-
<span class="picker-year">${
|
|
719
|
+
<span class="picker-year">${a}</span>
|
|
720
720
|
<button type="button" class="picker-year-btn" part="next" data-action="picker-next-year" ${b?"disabled":""} aria-label="${m(t.nextYear)}">+</button>
|
|
721
721
|
</div>
|
|
722
722
|
<div class="picker-months">${De}</div>
|
|
@@ -728,14 +728,14 @@
|
|
|
728
728
|
</div>
|
|
729
729
|
</header>
|
|
730
730
|
|
|
731
|
-
<div class="status" part="status" ${
|
|
731
|
+
<div class="status" part="status" ${te?"":"hidden"}>
|
|
732
732
|
<span class="status-dot" aria-hidden="true"></span>
|
|
733
|
-
<span>${m(
|
|
733
|
+
<span>${m(te)}</span>
|
|
734
734
|
</div>
|
|
735
735
|
|
|
736
736
|
<section class="grid-wrap" part="grid" role="grid" aria-label="${m(D)}">
|
|
737
737
|
<div class="weekdays" role="row">${Se}</div>
|
|
738
|
-
${
|
|
738
|
+
${ee.join("")}
|
|
739
739
|
</section>
|
|
740
740
|
</section>
|
|
741
|
-
`);const Ie=this._focusedIso,Ce=this._shouldRefocus;this._shouldRefocus=!1,Ce&&queueMicrotask(()=>{this.isConnected&&this._focusDateButton(Ie)})}shouldRenderOnAttributeChange(e,t,
|
|
741
|
+
`);const Ie=this._focusedIso,Ce=this._shouldRefocus;this._shouldRefocus=!1,Ce&&queueMicrotask(()=>{this.isConnected&&this._focusDateButton(Ie)})}shouldRenderOnAttributeChange(e,t,n){return!1}}typeof customElements<"u"&&!customElements.get("ui-calendar")&&customElements.define("ui-calendar",ye);exports.UICalendar=ye;exports.addDaysISO=be;exports.addMonthsISO=ve;exports.compareISO=k;exports.endOfMonth=me;exports.parseISO=c;exports.resolveDateTimeTranslations=fe;exports.startOfMonth=K;
|
package/dist/calendar.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./calendar-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./calendar-Dkof-FTK.js");exports.UICalendar=e.UICalendar;exports.addDaysISO=e.addDaysISO;exports.addMonthsISO=e.addMonthsISO;exports.compareISO=e.compareISO;exports.endOfMonth=e.endOfMonth;exports.parseISO=e.parseISO;exports.startOfMonth=e.startOfMonth;
|
package/dist/calendar.esm.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { U as
|
|
2
|
-
import "./ElementBase-909688f3.mjs";
|
|
1
|
+
import { U as d, a as e, b as o, c as r, e as t, p as O, s as n } from "./calendar-DLY4acgn.mjs";
|
|
3
2
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
d as UICalendar,
|
|
4
|
+
e as addDaysISO,
|
|
5
|
+
o as addMonthsISO,
|
|
6
|
+
r as compareISO,
|
|
7
|
+
t as endOfMonth,
|
|
8
|
+
O as parseISO,
|
|
9
|
+
n as startOfMonth
|
|
11
10
|
};
|
package/dist/card.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./ElementBase-EV6mVBUV.js"),n=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-card-radius: var(--base-card-radius, var(--ui-radius, 4px));
|
|
4
4
|
--ui-card-bg: var(--base-card-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
|
|
@@ -284,8 +284,8 @@
|
|
|
284
284
|
box-shadow: none;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
`;function
|
|
288
|
-
<style>${
|
|
287
|
+
`;function c(a){if(!a||!a.trim())return"var(--base-card-radius, var(--ui-radius, 4px))";const i=a.trim().toLowerCase();return i==="full"?"999px":/^-?\d+(\.\d+)?$/.test(i)?`${i}px`:a}class o extends d.ElementBase{constructor(){super(...arguments),this._slotCleanup=[],this._onKeyDownBound=this._onKeyDown.bind(this)}static get observedAttributes(){return["variant","size","radius","tone","elevation","interactive","disabled","tabindex","role"]}connectedCallback(){super.connectedCallback(),this._syncHostStyles(),this.addEventListener("keydown",this._onKeyDownBound),this._syncAccessibilityState()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._onKeyDownBound),this._cleanupSlotListeners()}attributeChangedCallback(i,r,e){super.attributeChangedCallback(i,r,e),r!==e&&(i==="radius"&&this._syncHostStyles(),(i==="interactive"||i==="disabled"||i==="tabindex"||i==="role")&&this._syncAccessibilityState())}shouldRenderOnAttributeChange(){return!1}render(){this.setContent(`
|
|
288
|
+
<style>${n}</style>
|
|
289
289
|
<article class="card" part="card" role="group">
|
|
290
290
|
<div class="section media" part="media" hidden>
|
|
291
291
|
<slot name="media"></slot>
|
|
@@ -303,4 +303,4 @@
|
|
|
303
303
|
<slot name="footer"></slot>
|
|
304
304
|
</div>
|
|
305
305
|
</article>
|
|
306
|
-
`),this._syncHostStyles(),this._bindSlotListeners(),this._syncSlotState()}_syncHostStyles(){this.style.setProperty("--ui-card-radius",
|
|
306
|
+
`),this._syncHostStyles(),this._bindSlotListeners(),this._syncSlotState()}_syncHostStyles(){this.style.setProperty("--ui-card-radius",c(this.getAttribute("radius")))}_syncAccessibilityState(){const i=this.hasAttribute("interactive"),r=this.hasAttribute("disabled");if(!i){this.getAttribute("role")==="button"&&this.removeAttribute("role"),this.removeAttribute("aria-disabled"),(this.getAttribute("tabindex")==="0"||this.getAttribute("tabindex")==="-1")&&this.removeAttribute("tabindex");return}this.hasAttribute("role")||this.setAttribute("role","button"),this.setAttribute("aria-disabled",r?"true":"false"),this.hasAttribute("tabindex")?r&&this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"):this.setAttribute("tabindex",r?"-1":"0")}_cleanupSlotListeners(){for(const i of this._slotCleanup)i();this._slotCleanup=[]}_bindSlotListeners(){this._cleanupSlotListeners(),this.root.querySelectorAll("slot").forEach(r=>{const e=()=>this._syncSlotState();r.addEventListener("slotchange",e),this._slotCleanup.push(()=>r.removeEventListener("slotchange",e))})}_syncSlotState(){this._toggleSection("media"),this._toggleSection("inset"),this._toggleSection("header"),this._toggleSection("footer")}_toggleSection(i){const r=this.root.querySelector(`slot[name="${i}"]`),e=this.root.querySelector(`.${i}`);if(!r||!e)return;const s=r.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.TEXT_NODE?!!t.textContent?.trim():!0);e.hidden=!s}_onKeyDown(i){!this.hasAttribute("interactive")||this.hasAttribute("disabled")||i.defaultPrevented||i.target===this&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this.click())}}typeof customElements<"u"&&!customElements.get("ui-card")&&customElements.define("ui-card",o);exports.UICard=o;
|
package/dist/card.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
const
|
|
1
|
+
import { E as s } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
const d = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-card-radius: var(--base-card-radius, var(--ui-radius, 4px));
|
|
5
5
|
--ui-card-bg: var(--base-card-bg, var(--color-panel-solid, var(--ui-color-surface, #ffffff)));
|
|
@@ -286,13 +286,12 @@ const n = `
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
`;
|
|
289
|
-
function
|
|
290
|
-
if (!a || !a.trim())
|
|
291
|
-
return "var(--base-card-radius, var(--ui-radius, 4px))";
|
|
289
|
+
function n(a) {
|
|
290
|
+
if (!a || !a.trim()) return "var(--base-card-radius, var(--ui-radius, 4px))";
|
|
292
291
|
const i = a.trim().toLowerCase();
|
|
293
292
|
return i === "full" ? "999px" : /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : a;
|
|
294
293
|
}
|
|
295
|
-
class
|
|
294
|
+
class c extends s {
|
|
296
295
|
constructor() {
|
|
297
296
|
super(...arguments), this._slotCleanup = [], this._onKeyDownBound = this._onKeyDown.bind(this);
|
|
298
297
|
}
|
|
@@ -313,7 +312,7 @@ class l extends d {
|
|
|
313
312
|
}
|
|
314
313
|
render() {
|
|
315
314
|
this.setContent(`
|
|
316
|
-
<style>${
|
|
315
|
+
<style>${d}</style>
|
|
317
316
|
<article class="card" part="card" role="group">
|
|
318
317
|
<div class="section media" part="media" hidden>
|
|
319
318
|
<slot name="media"></slot>
|
|
@@ -334,7 +333,7 @@ class l extends d {
|
|
|
334
333
|
`), this._syncHostStyles(), this._bindSlotListeners(), this._syncSlotState();
|
|
335
334
|
}
|
|
336
335
|
_syncHostStyles() {
|
|
337
|
-
this.style.setProperty("--ui-card-radius",
|
|
336
|
+
this.style.setProperty("--ui-card-radius", n(this.getAttribute("radius")));
|
|
338
337
|
}
|
|
339
338
|
_syncAccessibilityState() {
|
|
340
339
|
const i = this.hasAttribute("interactive"), r = this.hasAttribute("disabled");
|
|
@@ -345,8 +344,7 @@ class l extends d {
|
|
|
345
344
|
this.hasAttribute("role") || this.setAttribute("role", "button"), this.setAttribute("aria-disabled", r ? "true" : "false"), this.hasAttribute("tabindex") ? r && this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1") : this.setAttribute("tabindex", r ? "-1" : "0");
|
|
346
345
|
}
|
|
347
346
|
_cleanupSlotListeners() {
|
|
348
|
-
for (const i of this._slotCleanup)
|
|
349
|
-
i();
|
|
347
|
+
for (const i of this._slotCleanup) i();
|
|
350
348
|
this._slotCleanup = [];
|
|
351
349
|
}
|
|
352
350
|
_bindSlotListeners() {
|
|
@@ -360,19 +358,15 @@ class l extends d {
|
|
|
360
358
|
}
|
|
361
359
|
_toggleSection(i) {
|
|
362
360
|
const r = this.root.querySelector(`slot[name="${i}"]`), e = this.root.querySelector(`.${i}`);
|
|
363
|
-
if (!r || !e)
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
var o;
|
|
367
|
-
return t.nodeType === Node.TEXT_NODE ? !!((o = t.textContent) != null && o.trim()) : !0;
|
|
368
|
-
});
|
|
369
|
-
e.hidden = !s;
|
|
361
|
+
if (!r || !e) return;
|
|
362
|
+
const o = r.assignedNodes({ flatten: !0 }).some((t) => t.nodeType === Node.TEXT_NODE ? !!t.textContent?.trim() : !0);
|
|
363
|
+
e.hidden = !o;
|
|
370
364
|
}
|
|
371
365
|
_onKeyDown(i) {
|
|
372
366
|
!this.hasAttribute("interactive") || this.hasAttribute("disabled") || i.defaultPrevented || i.target === this && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), this.click());
|
|
373
367
|
}
|
|
374
368
|
}
|
|
375
|
-
typeof customElements < "u" && !customElements.get("ui-card") && customElements.define("ui-card",
|
|
369
|
+
typeof customElements < "u" && !customElements.get("ui-card") && customElements.define("ui-card", c);
|
|
376
370
|
export {
|
|
377
|
-
|
|
371
|
+
c as UICard
|
|
378
372
|
};
|