@nysds/nys-datepicker 1.13.1 → 1.15.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.
@@ -1,7 +1,17 @@
1
- import { LitElement as ze, unsafeCSS as je, html as O } from "lit";
2
- import { property as g } from "lit/decorators.js";
3
- import { ifDefined as A } from "lit/directives/if-defined.js";
4
- const He = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-input-width: var(--nys-form-width-md, 200px);--_nys-datepicker-gap: var(--nys-space-100, 8px);--_nys-datepicker-height: var(--nys-size-600, 48px);--_nys-datepicker-radius: var(--nys-radius-xl, 12px);--_nys-datepicker-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-datepicker-color-disabled: var(--nys-color-neutral-200, #bec0c1);--_nys-datepicker--row-gap: var(--nys-space-2-px, 2px);--_nys-datepicker-space-sm: var(--nys-space-50, 4px);--_nys-datepicker-space-md: var(--nys-space-100, 8px);--_nys-datepicker-space-lg: var(--nys-space-150, 12px);--_nys-datepicker-border-width: var(--nys-border-width-sm, 1px);--_nys-datepicker-border-color: var(--nys-color-neutral-400, #909395);--_nys-datepicker-border-radius: var(--nys-radius-md, 4px);--_nys-datepicker-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-datepicker-font-size: var(--nys-font-size-ui-md, 16px);--_nys-datepicker-font-weight: var(--nys-font-weight-regular, 400);--_nys-datepicker-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-datepicker-letterspacing: var(--nys-font-letterspacing-ui-md, .044px);--_nys-datepicker-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-datepicker-text-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker-text-disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-bg: var(--nys-color-ink-reverse, #fff);--_nys-datepicker--button-active-bg: var(--nys-color-gray-100, #d0d0ce);--_nys-datepicker--wc-padding: var(--nys-space-200, 16px);--_nys-datepicker--wc-weaker-color: var(--nys-color-text-weaker, #797c7f);--_nys-datepicker--date-font-size: var(--nys-type-size-ui-sm, 14px);--_nys-datepicker--date-hover-bg: var(--nys-color-neutral-50, #ededed);--_nys-datepicker--date-active-bg: var(--nys-color-neutral-100, #d0d0ce);--_nys-datepicker--date-selected-bg: var(--nys-color-info-weak, #e5effa);--_nys-datepicker--date-focus-ring: var(--nys-color-link, #004dd1);--_nys-datepicker--date-hover-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker--date-default-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker--date-selected-color: var(--nys-color-info, #004dd1);--_nys-datepicker--date-disabled-color: var( --nys-color-text-disabled, #bec0c1 );--_nys-datepicker--date-border-disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker--navigation-hover-background: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker--navigation-pressed-background: var( --nys-color-neutral-50, #ededed );--_nys-datepicker--navigation-disabled-background: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker--navigation-border: var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-border-color);--_nys-datepicker--navigation-hover-border: var( --_nys-datepicker-border-width ) solid var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker--navigation-pressed-border: var( --_nys-datepicker-border-width ) solid var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker--navigation-disabled-border: var( --_nys-datepicker-border-width ) solid var(--nys-color-neutral-200, #bec0c1);--_nys-datepicker--navigation-box-shadow-border: inset 0 0 0 1px var(--nys-color-neutral-900, #1b1b1b)}:host([width=lg]){--_nys-datepicker-input-width: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-datepicker-input-width: 100%}:host([showError]){--_nys-datepicker-border-color: var(--nys-color-danger, #b52c2c)}.nys-datepicker--container{display:flex;flex-direction:column;gap:var(--_nys-datepicker-space-sm);font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);font-weight:var(--_nys-datepicker-font-weight);line-height:var(--_nys-datepicker-line-height);width:100%}.nys-datepicker--container .nys-datepicker--input-container{position:relative;width:var(--_nys-datepicker-input-width);display:flex;cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container.disabled #calendar-button{cursor:not-allowed;color:var(--_nys-datepicker--date-disabled-color)}.nys-datepicker--container .nys-datepicker--input-container #nys-datepicker--input{cursor:text;text-align:start;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);flex:1;height:24px;outline-color:transparent;outline-width:1px;outline-style:solid;border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-border-color);background:var(--_nys-datepicker-bg);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);color:var(--_nys-datepicker-color)}.nys-datepicker--container .nys-datepicker--input-container #nys-datepicker--input:hover{outline-color:var(--_nys-datepicker-outline-color--hover);border-color:var(--_nys-datepicker-outline-color--hover)}.nys-datepicker--container .nys-datepicker--input-container #nys-datepicker--input:focus{outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .nys-datepicker--input-container #nys-datepicker--input:disabled{border:var(--_nys-datepicker--navigation-disabled-border);cursor:not-allowed;color:var(--_nys-datepicker--wc-weaker-color)}.nys-datepicker--container .nys-datepicker--input-container #nys-datepicker--input::-webkit-date-and-time-value{text-align:start}.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-inner-spin-button,.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}.nys-datepicker--container .nys-datepicker--input-container #calendar-button{display:flex;align-items:center;justify-content:center;padding:var(--_nys-datepicker-space-sm);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-bg);outline-color:transparent;outline-width:1px;outline-style:solid;background-color:var(--_nys-datepicker-bg);position:absolute;top:50%;right:var(--_nys-datepicker-space-sm);transform:translateY(-50%);cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:hover{outline-color:var(--_nys-datepicker--date-hover-bg);border-color:var(--_nys-datepicker--date-hover-bg);background:var(--_nys-datepicker--date-hover-bg)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:active{outline-color:var(--_nys-datepicker--button-active-bg);border-color:var(--_nys-datepicker--button-active-bg);background:var(--_nys-datepicker--button-active-bg)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:focus:not(:active):not(:disabled){outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .wc-datepicker--container{display:flex;width:fit-content}.nys-datepicker--container .wc-datepicker--container *{flex:1}wc-datepicker{display:none;padding:var(--_nys-datepicker--wc-padding);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--nys-color-neutral-100, #d0d0ce);background:var(--_nys-datepicker-bg);box-shadow:0 4px 6px -1px var(--nys-color-black-transparent-100, rgba(27, 27, 27, .1)),0 4px 6px -1px var(--nys-color-black-transparent-50, rgba(27, 27, 27, .01));color:var(--_nys-datepicker-text-color);margin-bottom:3px}wc-datepicker.active{display:flex;flex-direction:column-reverse;position:absolute;z-index:1}wc-datepicker *,wc-datepicker *:before,wc-datepicker *:after{margin:0;box-sizing:border-box}.wc-datepicker{display:block;width:min-content;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker--date-font-size);font-weight:400;line-height:var(--_nys-datepicker-line-height);letter-spacing:var(--_nys-datepicker-letterspacing)}.wc-datepicker--disabled *:disabled{opacity:.5;cursor:not-allowed}.wc-datepicker--disabled .wc-datepicker__date{cursor:not-allowed;opacity:.5}.wc-datepicker--disabled .wc-datepicker__date:focus{outline:none;border-color:var(--_nys-datepicker--date-border-disabled);box-shadow:none}.wc-datepicker--disabled .wc-datepicker__date:hover:not(.wc-datepicker__date--selected){background-color:transparent}.wc-datepicker--disabled .wc-datepicker__date--selected:hover{color:var(--_nys-datepicker-bg);background-color:var(--_nys-datepicker--date-selected-bg)}.wc-datepicker--disabled #wc-month-dropdown-icon{color:var(--_nys-datepicker--date-disabled-color)}.wc-datepicker__header{display:flex;align-items:center;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__current-month{display:flex;flex-grow:1;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__month-select,.wc-datepicker__year-select{display:flex;align-items:center;font-size:var(--_nys-datepicker-font-size);font-family:var(--_nys-datepicker-font-family);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);border:var(--_nys-datepicker--navigation-border);border-radius:.25rem;color:var(--_nys-datepicker-color);background-color:var(--_nys-datepicker-bg);line-height:var(--_nys-datepicker-line-height)}.wc-datepicker__month-select:hover:not(:disabled),.wc-datepicker__year-select:hover:not(:disabled){border:var(--_nys-datepicker--navigation-hover-border);background-color:var(--_nys-datepicker--navigation-hover-background);box-shadow:var(--_nys-datepicker--navigation-box-shadow-border)}.wc-datepicker__month-select:active:not(:disabled),.wc-datepicker__month-select[aria-pressed=true],.wc-datepicker__year-select:active:not(:disabled),.wc-datepicker__year-select[aria-pressed=true]{border:var(--_nys-datepicker--navigation-pressed-border);background-color:var(--_nys-datepicker--navigation-pressed-background);box-shadow:var(--_nys-datepicker--navigation-box-shadow-border)}.wc-datepicker__month-select:disabled,.wc-datepicker__month-select[aria-disabled=true],.wc-datepicker__year-select:disabled,.wc-datepicker__year-select[aria-disabled=true]{border:var(--_nys-datepicker--navigation-disabled-border);background-color:var(--_nys-datepicker--navigation-disabled-background);color:var(--_nys-datepicker-color-disabled)}.wc-datepicker .month-wrapper{position:relative;width:135px;display:flex;align-items:center;align-self:stretch}.wc-datepicker .month-wrapper #wc-month-dropdown-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.wc-datepicker__month-select{width:100%;max-width:100%;flex-grow:1;cursor:pointer;appearance:none;text-overflow:ellipsis;padding-right:var(--nys-space-400, 32px)}.wc-datepicker__month-select>*{width:91px;height:24px}.wc-datepicker__year-select{border:var(--_nys-datepicker--navigation-border);border-radius:.25rem;padding-right:var(--_nys-datepicker-space-sm);max-width:5rem}.wc-datepicker__previous-month-button,.wc-datepicker__next-month-button,.wc-datepicker__previous-year-button,.wc-datepicker__next-year-button{display:inline-flex;width:40px;max-width:40px;max-height:42px;padding:var(--_nys-datepicker-space-lg);justify-content:center;align-items:center;border:var(--_nys-datepicker--navigation-border);border-radius:.25rem;color:var(--_nys-datepicker--date-default-color);background-color:var(--_nys-datepicker-bg);cursor:pointer}.wc-datepicker__previous-month-button:hover:not(:disabled),.wc-datepicker__next-month-button:hover:not(:disabled),.wc-datepicker__previous-year-button:hover:not(:disabled),.wc-datepicker__next-year-button:hover:not(:disabled){background-color:var(--_nys-datepicker--navigation-hover-background);box-shadow:var(--_nys-datepicker--navigation-box-shadow-border);border:var(--_nys-datepicker--navigation-hover-border)}.wc-datepicker__previous-month-button:active:not(:disabled),.wc-datepicker__previous-month-button[aria-pressed=true],.wc-datepicker__next-month-button:active:not(:disabled),.wc-datepicker__next-month-button[aria-pressed=true],.wc-datepicker__previous-year-button:active:not(:disabled),.wc-datepicker__previous-year-button[aria-pressed=true],.wc-datepicker__next-year-button:active:not(:disabled),.wc-datepicker__next-year-button[aria-pressed=true]{background-color:var(--_nys-datepicker--navigation-pressed-background);box-shadow:var(--_nys-datepicker--navigation-box-shadow-border);border:var(--_nys-datepicker--navigation-pressed-border)}.wc-datepicker__previous-month-button:disabled,.wc-datepicker__previous-month-button[aria-disabled=true],.wc-datepicker__next-month-button:disabled,.wc-datepicker__next-month-button[aria-disabled=true],.wc-datepicker__previous-year-button:disabled,.wc-datepicker__previous-year-button[aria-disabled=true],.wc-datepicker__next-year-button:disabled,.wc-datepicker__next-year-button[aria-disabled=true]{background-color:var(--_nys-datepicker--navigation-disabled-background);border:var(--_nys-datepicker--navigation-disabled-border);color:var(--_nys-datepicker-color-disabled)}.wc-datepicker__calendar{width:100%;table-layout:fixed;border-collapse:collapse}.wc-datepicker__weekday{padding:var(--_nys-datepicker--wc-padding) 0 var(--_nys-datepicker-space-sm) 0;min-width:var(--nys-size-500, 40px);font-weight:600;aspect-ratio:1}.wc-datepicker__weekday>span{width:42.3px;height:24px;display:flex;justify-content:center;align-items:center}.wc-datepicker__weekday[aria-label=Saturday],.wc-datepicker__weekday[aria-label=Sunday]{color:var(--_nys-datepicker--wc-weaker-color)}.wc-datepicker__date{padding:var(--_nys-datepicker-space-md);text-align:center;cursor:pointer;border-radius:var(--nys-radius-lg)}.wc-datepicker__date:focus,.wc-datepicker__date:focus-visible{outline:none}.wc-datepicker__date:focus{box-shadow:inset 0 0 0 2px var(--_nys-datepicker--date-focus-ring)}.wc-datepicker__date:hover:not(.wc-datepicker__date--selected):not(:active){color:var(--_nys-datepicker--date-hover-color);background-color:var(--_nys-datepicker--date-hover-bg)}.wc-datepicker__date:active{color:var(--_nys-datepicker--date-hover-color);background-color:var(--_nys-datepicker--date-active-bg)}.wc-datepicker__date>*{display:flex;justify-content:center;align-items:center;aspect-ratio:1;width:24.3px;height:24px}.wc-datepicker__date--today{font-weight:600;color:var(--_nys-datepicker--date-selected-color)}.wc-datepicker__date--today>*{font-style:normal;text-decoration-line:underline}.wc-datepicker__date--selected{text-decoration-line:none;background-color:var(--_nys-datepicker--date-selected-bg);color:var(--_nys-datepicker--date-selected-color)}.wc-datepicker__date--selected>*{font-weight:600}.wc-datepicker__date--disabled{color:var(--_nys-datepicker--date-disabled-color);cursor:default}.wc-datepicker__date--disabled:not(.wc-datepicker__date--disabled--selected):not(.wc-datepicker__date--disabled--in-range):hover{background-color:transparent}.wc-datepicker__date.wc-datepicker__date--overflowing{color:var(--_nys-datepicker-text-disabled)}.wc-datepicker__date.wc-datepicker__date--overflowing:hover,.wc-datepicker__date.wc-datepicker__date--overflowing:active{color:var(--_nys-datepicker-color)}.wc-datepicker--button-container{display:flex;padding-top:var(--_nys-datepicker-space-lg);align-items:flex-end;gap:var(--_nys-datepicker--wc-padding);align-self:stretch}.wc-datepicker tr.wc-datepicker__calendar-row.sc-wc-datepicker{display:flex;align-items:center;gap:var(--_nys-datepicker--row-gap);align-self:stretch}', B = {
1
+ import { LitElement as se, unsafeCSS as je, html as N } from "lit";
2
+ import { property as k, state as He } from "lit/decorators.js";
3
+ import { ifDefined as q } from "lit/directives/if-defined.js";
4
+ /*!
5
+ * █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
6
+ * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
+ * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
+ *
9
+ * Datepicker Component
10
+ * Part of the New York State Design System
11
+ * Repository: https://github.com/its-hcd/nysds
12
+ * License: MIT
13
+ */
14
+ const Ke = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-width--input: var(--nys-form-width-md, 200px);--_nys-datepicker-gap: var(--nys-space-100, 8px);--_nys-datepicker-height: var(--nys-size-600, 48px);--_nys-datepicker-radius: var(--nys-radius-xl, 12px);--_nys-datepicker-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-datepicker-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-space-sm: var(--nys-space-50, 4px);--_nys-datepicker-space-md: var(--nys-space-100, 8px);--_nys-datepicker-space-lg: var(--nys-space-150, 12px);--_nys-datepicker-border-width: var(--nys-border-width-sm, 1px);--_nys-datepicker-border-color: var(--nys-color-neutral-400, #909395);--_nys-datepicker-border-radius: var(--nys-radius-md, 4px);--_nys-datepicker-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-datepicker-font-size: var(--nys-font-size-ui-md, 16px);--_nys-datepicker-font-weight: var(--nys-font-weight-regular, 400);--_nys-datepicker-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-datepicker-letterspacing: var(--nys-font-letterspacing-ui-md, .044px);--_nys-datepicker-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-datepicker-text-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker-text-disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-datepicker-background-color--button--active: var( --nys-color-gray-100, #d0d0ce );--_nys-datepicker-padding--calendar: var(--nys-space-200, 16px);--_nys-datepicker-color--calendar--weekends: var( --nys-color-text-weaker, #797c7f );--_nys-datepicker-gap--calendar-row: var(--nys-space-2-px, 2px);--_nys-datepicker-font-size--date: var(--nys-type-size-ui-sm, 14px);--_nys-datepicker-background-color--date--hover: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--date--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-datepicker-background-color--date--selected: var( --nys-color-info-weak, #e5effa );--_nys-datepicker-focus-ring--date: var(--nys-color-link, #004dd1);--_nys-datepicker-color--date: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--hover: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--selected: var(--nys-color-info, #004dd1);--_nys-datepicker-color--date--disabled: var( --nys-color-text-disabled, #bec0c1 );--_nys-datepicker-border-color--date--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-background-color--navigation--hover: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-background-color--navigation--pressed: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--navigation--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-color--navigation--hover: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--pressed: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-box-shadow-border--navigation: inset 0 0 0 1px var(--nys-color-neutral-900, #1b1b1b)}:host([width=lg]){--_nys-datepicker-width--input: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-datepicker-width--input: 100%}:host([showError]){--_nys-datepicker-border-color: var(--nys-color-danger, #b52c2c)}.nys-datepicker--container{display:flex;flex-direction:column;gap:var(--_nys-datepicker-space-sm);font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);font-weight:var(--_nys-datepicker-font-weight);line-height:var(--_nys-datepicker-line-height);width:100%}.nys-datepicker--container .nys-datepicker--input-container{position:relative;width:var(--_nys-datepicker-width--input);display:flex;cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container.disabled #calendar-button{cursor:not-allowed;color:var(--_nys-datepicker-color--date--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input{cursor:text;text-align:start;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);flex:1;height:24px;outline:transparent solid 1px;border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-border-color);background-color:var(--_nys-datepicker-background-color);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);color:var(--_nys-datepicker-color)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:hover{outline-color:var(--_nys-datepicker-outline-color--hover);border-color:var(--_nys-datepicker-outline-color--hover)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:focus{outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:disabled{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);cursor:not-allowed;color:var(--_nys-datepicker-color--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input::-webkit-date-and-time-value{text-align:start}.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-inner-spin-button,.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-calendar-picker-indicator{display:none;appearance:none}.nys-datepicker--container .nys-datepicker--input-container #calendar-button{display:flex;align-items:center;justify-content:center;padding:var(--_nys-datepicker-space-sm);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-background-color);outline:transparent solid 1px;background-color:var(--_nys-datepicker-background-color);position:absolute;top:50%;right:var(--_nys-datepicker-space-sm);transform:translateY(-50%);cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:hover{outline-color:var(--_nys-datepicker-background-color--date--hover);border-color:var(--_nys-datepicker-background-color--date--hover);background:var(--_nys-datepicker-background-color--date--hover)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:active{outline-color:var(--_nys-datepicker-background-color--button--active);border-color:var(--_nys-datepicker-background-color--button--active);background:var(--_nys-datepicker-background-color--button--active)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:focus:not(:active):not(:disabled){outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .wc-datepicker--container{display:flex;width:fit-content}.nys-datepicker--container .wc-datepicker--container *{flex:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}wc-datepicker{display:none;padding:var(--_nys-datepicker-padding--calendar);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--nys-color-neutral-100, #d0d0ce);background-color:var(--_nys-datepicker-background-color);box-shadow:0 4px 6px -1px var(--nys-color-black-transparent-100, rgba(27, 27, 27, .1)),0 4px 6px -1px var(--nys-color-black-transparent-50, rgba(27, 27, 27, .01));color:var(--_nys-datepicker-text-color);margin-bottom:3px}wc-datepicker.active{display:flex;flex-direction:column-reverse;position:absolute;z-index:1}wc-datepicker *,wc-datepicker *:before,wc-datepicker *:after{margin:0;box-sizing:border-box}.wc-datepicker{display:block;width:min-content;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size--date);font-weight:400;line-height:var(--_nys-datepicker-line-height);letter-spacing:var(--_nys-datepicker-letterspacing)}.wc-datepicker--disabled *:disabled{opacity:.5;cursor:not-allowed}.wc-datepicker--disabled .wc-datepicker__date{cursor:not-allowed;opacity:.5}.wc-datepicker--disabled .wc-datepicker__date:focus{outline:none;border-color:var(--_nys-datepicker-border-color--date--disabled);box-shadow:none}.wc-datepicker--disabled .wc-datepicker__date:hover:not(.wc-datepicker__date--selected){background-color:transparent}.wc-datepicker--disabled .wc-datepicker__date--selected:hover{color:var(--_nys-datepicker-background-color);background-color:var(--_nys-datepicker-background-color--date--selected)}.wc-datepicker--disabled #wc-month-dropdown-icon{color:var(--_nys-datepicker-color--date--disabled)}.wc-datepicker__header{display:flex;align-items:center;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__current-month{display:flex;flex-grow:1;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__month-select,.wc-datepicker__year-select{display:flex;align-items:center;font-size:var(--_nys-datepicker-font-size);font-family:var(--_nys-datepicker-font-family);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color);background-color:var(--_nys-datepicker-background-color);line-height:var(--_nys-datepicker-line-height)}.wc-datepicker__month-select:hover:not(:disabled),.wc-datepicker__year-select:hover:not(:disabled){border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover);background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:active:not(:disabled),.wc-datepicker__month-select[aria-pressed=true],.wc-datepicker__year-select:active:not(:disabled),.wc-datepicker__year-select[aria-pressed=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed);background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:disabled,.wc-datepicker__month-select[aria-disabled=true],.wc-datepicker__year-select:disabled,.wc-datepicker__year-select[aria-disabled=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);background-color:var(--_nys-datepicker-background-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker .month-wrapper{position:relative;width:135px;display:flex;align-items:center;align-self:stretch}.wc-datepicker .month-wrapper #wc-month-dropdown-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.wc-datepicker__month-select{width:100%;max-width:100%;flex-grow:1;cursor:pointer;appearance:none;text-overflow:ellipsis;padding-right:var(--nys-space-400, 32px)}.wc-datepicker__month-select>*{width:91px;height:24px}.wc-datepicker__year-select{border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;padding-right:var(--_nys-datepicker-space-sm);max-width:5rem}.wc-datepicker__previous-month-button,.wc-datepicker__next-month-button,.wc-datepicker__previous-year-button,.wc-datepicker__next-year-button{display:inline-flex;width:40px;max-width:40px;max-height:42px;padding:var(--_nys-datepicker-space-lg);justify-content:center;align-items:center;border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color--date);background-color:var(--_nys-datepicker-background-color);cursor:pointer}.wc-datepicker__previous-month-button:hover:not(:disabled),.wc-datepicker__next-month-button:hover:not(:disabled),.wc-datepicker__previous-year-button:hover:not(:disabled),.wc-datepicker__next-year-button:hover:not(:disabled){background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover)}.wc-datepicker__previous-month-button:active:not(:disabled),.wc-datepicker__previous-month-button[aria-pressed=true],.wc-datepicker__next-month-button:active:not(:disabled),.wc-datepicker__next-month-button[aria-pressed=true],.wc-datepicker__previous-year-button:active:not(:disabled),.wc-datepicker__previous-year-button[aria-pressed=true],.wc-datepicker__next-year-button:active:not(:disabled),.wc-datepicker__next-year-button[aria-pressed=true]{background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed)}.wc-datepicker__previous-month-button:disabled,.wc-datepicker__previous-month-button[aria-disabled=true],.wc-datepicker__next-month-button:disabled,.wc-datepicker__next-month-button[aria-disabled=true],.wc-datepicker__previous-year-button:disabled,.wc-datepicker__previous-year-button[aria-disabled=true],.wc-datepicker__next-year-button:disabled,.wc-datepicker__next-year-button[aria-disabled=true]{background-color:var(--_nys-datepicker-background-color--navigation--disabled);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker__calendar{width:100%;table-layout:fixed;border-collapse:collapse}.wc-datepicker__weekday{padding:var(--_nys-datepicker-padding--calendar) 0 var(--_nys-datepicker-space-sm) 0;min-width:var(--nys-size-500, 40px);font-weight:600;aspect-ratio:1}.wc-datepicker__weekday>span{width:42.3px;height:24px;display:flex;justify-content:center;align-items:center}.wc-datepicker__weekday[aria-label=Saturday],.wc-datepicker__weekday[aria-label=Sunday]{color:var(--_nys-datepicker-color--calendar--weekends)}.wc-datepicker__date{padding:var(--_nys-datepicker-space-md);text-align:center;cursor:pointer;border-radius:var(--nys-radius-lg)}.wc-datepicker__date:focus,.wc-datepicker__date:focus-visible{outline:none}.wc-datepicker__date:focus{box-shadow:inset 0 0 0 2px var(--_nys-datepicker-focus-ring--date)}.wc-datepicker__date:hover:not(.wc-datepicker__date--selected):not(:active){color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--hover)}.wc-datepicker__date:active{color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--active)}.wc-datepicker__date>*{display:flex;justify-content:center;align-items:center;aspect-ratio:1;width:24.3px;height:24px}.wc-datepicker__date--today{font-weight:600;color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--today>*{font-style:normal;text-decoration-line:underline}.wc-datepicker__date--selected{text-decoration-line:none;background-color:var(--_nys-datepicker-background-color--date--selected);color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--selected>*{font-weight:600}.wc-datepicker__date--disabled{color:var(--_nys-datepicker-color--date--disabled);cursor:default}.wc-datepicker__date--disabled:not(.wc-datepicker__date--disabled--selected,.wc-datepicker__date--disabled--in-range):hover{background-color:transparent}.wc-datepicker__date.wc-datepicker__date--overflowing{color:var(--_nys-datepicker-text-disabled)}.wc-datepicker__date.wc-datepicker__date--overflowing:hover,.wc-datepicker__date.wc-datepicker__date--overflowing:active{color:var(--_nys-datepicker-color)}.wc-datepicker--button-container{display:flex;padding-top:var(--_nys-datepicker-space-lg);align-items:flex-end;gap:var(--_nys-datepicker-padding--calendar);align-self:stretch}.wc-datepicker tr.wc-datepicker__calendar-row.sc-wc-datepicker{display:flex;align-items:center;gap:var(--_nys-datepicker-gap--calendar-row);align-self:stretch}', E = {
5
15
  allRenderFn: !1,
6
16
  cmpDidLoad: !0,
7
17
  cmpDidUnload: !1,
@@ -85,30 +95,30 @@ const He = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-input-w
85
95
  transformTagName: !1,
86
96
  attachStyles: !0
87
97
  };
88
- let R, me, G, we = !1, z = !1, ee = !1, b = !1, re = null, Z = !1;
98
+ let B, we, G, De = !1, z = !1, ee = !1, b = !1, ne = null, Z = !1;
89
99
  const M = (t, e = "") => () => {
90
- }, ne = "http://www.w3.org/1999/xlink", ie = {}, Ke = "http://www.w3.org/2000/svg", Qe = "http://www.w3.org/1999/xhtml", Ge = (t) => t != null, te = (t) => (t = typeof t, t === "object" || t === "function");
91
- function Xe(t) {
92
- var e, a, s;
93
- return (s = (a = (e = t.head) === null || e === void 0 ? void 0 : e.querySelector('meta[name="csp-nonce"]')) === null || a === void 0 ? void 0 : a.getAttribute("content")) !== null && s !== void 0 ? s : void 0;
100
+ }, ie = "http://www.w3.org/1999/xlink", oe = {}, Qe = "http://www.w3.org/2000/svg", Ge = "http://www.w3.org/1999/xhtml", Xe = (t) => t != null, te = (t) => (t = typeof t, t === "object" || t === "function");
101
+ function Je(t) {
102
+ var e, a, r;
103
+ return (r = (a = (e = t.head) === null || e === void 0 ? void 0 : e.querySelector('meta[name="csp-nonce"]')) === null || a === void 0 ? void 0 : a.getAttribute("content")) !== null && r !== void 0 ? r : void 0;
94
104
  }
95
105
  const h = (t, e, ...a) => {
96
- let s = null, r = null, i = null, n = !1, o = !1;
106
+ let r = null, s = null, n = null, i = !1, o = !1;
97
107
  const c = [], l = (d) => {
98
108
  for (let p = 0; p < d.length; p++)
99
- s = d[p], Array.isArray(s) ? l(s) : s != null && typeof s != "boolean" && ((n = typeof t != "function" && !te(s)) && (s = String(s)), n && o ? c[c.length - 1].$text$ += s : c.push(n ? j(null, s) : s), o = n);
109
+ r = d[p], Array.isArray(r) ? l(r) : r != null && typeof r != "boolean" && ((i = typeof t != "function" && !te(r)) && (r = String(r)), i && o ? c[c.length - 1].$text$ += r : c.push(i ? j(null, r) : r), o = i);
100
110
  };
101
111
  if (l(a), e) {
102
- e.key && (r = e.key), e.name && (i = e.name);
112
+ e.key && (s = e.key), e.name && (n = e.name);
103
113
  {
104
114
  const d = e.className || e.class;
105
115
  d && (e.class = typeof d != "object" ? d : Object.keys(d).filter((p) => d[p]).join(" "));
106
116
  }
107
117
  }
108
118
  if (typeof t == "function")
109
- return t(e === null ? {} : e, c, Ze);
119
+ return t(e === null ? {} : e, c, Ve);
110
120
  const u = j(t, null);
111
- return u.$attrs$ = e, c.length > 0 && (u.$children$ = c), u.$key$ = r, u.$name$ = i, u;
121
+ return u.$attrs$ = e, c.length > 0 && (u.$children$ = c), u.$key$ = s, u.$name$ = n, u;
112
122
  }, j = (t, e) => {
113
123
  const a = {
114
124
  $flags$: 0,
@@ -118,214 +128,214 @@ const h = (t, e, ...a) => {
118
128
  $children$: null
119
129
  };
120
130
  return a.$attrs$ = null, a.$key$ = null, a.$name$ = null, a;
121
- }, De = {}, Je = (t) => t && t.$tag$ === De, Ze = {
122
- forEach: (t, e) => t.map(oe).forEach(e),
123
- map: (t, e) => t.map(oe).map(e).map(Ve)
124
- }, oe = (t) => ({
131
+ }, xe = {}, Ze = (t) => t && t.$tag$ === xe, Ve = {
132
+ forEach: (t, e) => t.map(ce).forEach(e),
133
+ map: (t, e) => t.map(ce).map(e).map(et)
134
+ }, ce = (t) => ({
125
135
  vattrs: t.$attrs$,
126
136
  vchildren: t.$children$,
127
137
  vkey: t.$key$,
128
138
  vname: t.$name$,
129
139
  vtag: t.$tag$,
130
140
  vtext: t.$text$
131
- }), Ve = (t) => {
141
+ }), et = (t) => {
132
142
  if (typeof t.vtag == "function") {
133
143
  const a = Object.assign({}, t.vattrs);
134
144
  return t.vkey && (a.key = t.vkey), t.vname && (a.name = t.vname), h(t.vtag, a, ...t.vchildren || []);
135
145
  }
136
146
  const e = j(t.vtag, t.vtext);
137
147
  return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;
138
- }, et = (t) => Mt.map((e) => e(t)).find((e) => !!e), tt = (t, e) => t != null && !te(t) ? e & 4 ? t === "false" ? !1 : t === "" || !!t : e & 2 ? parseFloat(t) : e & 1 ? String(t) : t : t, at = (t) => t, ce = (t, e, a) => {
139
- const s = at(t);
148
+ }, tt = (t) => Tt.map((e) => e(t)).find((e) => !!e), at = (t, e) => t != null && !te(t) ? e & 4 ? t === "false" ? !1 : t === "" || !!t : e & 2 ? parseFloat(t) : e & 1 ? String(t) : t : t, rt = (t) => t, le = (t, e, a) => {
149
+ const r = rt(t);
140
150
  return {
141
- emit: (r) => st(s, e, {
151
+ emit: (s) => st(r, e, {
142
152
  bubbles: !0,
143
153
  composed: !0,
144
154
  cancelable: !0,
145
- detail: r
155
+ detail: s
146
156
  })
147
157
  };
148
158
  }, st = (t, e, a) => {
149
- const s = k.ce(e, a);
150
- return t.dispatchEvent(s), s;
151
- }, le = /* @__PURE__ */ new WeakMap(), rt = (t, e, a) => {
152
- let s = K.get(t);
153
- Rt && a ? (s = s || new CSSStyleSheet(), typeof s == "string" ? s = e : s.replaceSync(e)) : s = e, K.set(t, s);
154
- }, nt = (t, e, a, s) => {
155
- var r;
156
- let i = xe(e, a);
157
- const n = K.get(i);
158
- if (t = t.nodeType === 11 ? t : m, n)
159
- if (typeof n == "string") {
159
+ const r = v.ce(e, a);
160
+ return t.dispatchEvent(r), r;
161
+ }, de = /* @__PURE__ */ new WeakMap(), nt = (t, e, a) => {
162
+ let r = K.get(t);
163
+ Rt && a ? (r = r || new CSSStyleSheet(), typeof r == "string" ? r = e : r.replaceSync(e)) : r = e, K.set(t, r);
164
+ }, it = (t, e, a, r) => {
165
+ var s;
166
+ let n = Se(e, a);
167
+ const i = K.get(n);
168
+ if (t = t.nodeType === 11 ? t : m, i)
169
+ if (typeof i == "string") {
160
170
  t = t.head || t;
161
- let o = le.get(t), c;
162
- if (o || le.set(t, o = /* @__PURE__ */ new Set()), !o.has(i)) {
171
+ let o = de.get(t), c;
172
+ if (o || de.set(t, o = /* @__PURE__ */ new Set()), !o.has(n)) {
163
173
  {
164
- c = m.createElement("style"), c.innerHTML = n;
165
- const l = (r = k.$nonce$) !== null && r !== void 0 ? r : Xe(m);
174
+ c = m.createElement("style"), c.innerHTML = i;
175
+ const l = (s = v.$nonce$) !== null && s !== void 0 ? s : Je(m);
166
176
  l != null && c.setAttribute("nonce", l), t.insertBefore(c, t.querySelector("link"));
167
177
  }
168
- o && o.add(i);
178
+ o && o.add(n);
169
179
  }
170
- } else t.adoptedStyleSheets.includes(n) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, n]);
171
- return i;
172
- }, it = (t) => {
173
- const e = t.$cmpMeta$, a = t.$hostElement$, s = e.$flags$, r = M("attachStyles", e.$tagName$), i = nt(a.shadowRoot ? a.shadowRoot : a.getRootNode(), e, t.$modeName$);
174
- s & 10 && (a["s-sc"] = i, a.classList.add(i + "-h"), s & 2 && a.classList.add(i + "-s")), r();
175
- }, xe = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), de = (t, e, a, s, r, i) => {
176
- if (a !== s) {
177
- let n = fe(t, e), o = e.toLowerCase();
180
+ } else t.adoptedStyleSheets.includes(i) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, i]);
181
+ return n;
182
+ }, ot = (t) => {
183
+ const e = t.$cmpMeta$, a = t.$hostElement$, r = e.$flags$, s = M("attachStyles", e.$tagName$), n = it(a.shadowRoot ? a.shadowRoot : a.getRootNode(), e, t.$modeName$);
184
+ r & 10 && (a["s-sc"] = n, a.classList.add(n + "-h"), r & 2 && a.classList.add(n + "-s")), s();
185
+ }, Se = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), ue = (t, e, a, r, s, n) => {
186
+ if (a !== r) {
187
+ let i = ye(t, e), o = e.toLowerCase();
178
188
  if (e === "class") {
179
- const c = t.classList, l = ue(a), u = ue(s);
189
+ const c = t.classList, l = he(a), u = he(r);
180
190
  c.remove(...l.filter((d) => d && !u.includes(d))), c.add(...u.filter((d) => d && !l.includes(d)));
181
191
  } else if (e === "style") {
182
192
  for (const c in a)
183
- (!s || s[c] == null) && (c.includes("-") ? t.style.removeProperty(c) : t.style[c] = "");
184
- for (const c in s)
185
- (!a || s[c] !== a[c]) && (c.includes("-") ? t.style.setProperty(c, s[c]) : t.style[c] = s[c]);
193
+ (!r || r[c] == null) && (c.includes("-") ? t.style.removeProperty(c) : t.style[c] = "");
194
+ for (const c in r)
195
+ (!a || r[c] !== a[c]) && (c.includes("-") ? t.style.setProperty(c, r[c]) : t.style[c] = r[c]);
186
196
  } else if (e !== "key")
187
197
  if (e === "ref")
188
- s && s(t);
198
+ r && r(t);
189
199
  else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n")
190
- e[2] === "-" ? e = e.slice(3) : fe(J, o) ? e = o.slice(2) : e = o[2] + e.slice(3), a && k.rel(t, e, a, !1), s && k.ael(t, e, s, !1);
200
+ e[2] === "-" ? e = e.slice(3) : ye(J, o) ? e = o.slice(2) : e = o[2] + e.slice(3), a && v.rel(t, e, a, !1), r && v.ael(t, e, r, !1);
191
201
  else {
192
- const c = te(s);
193
- if ((n || c && s !== null) && !r)
202
+ const c = te(r);
203
+ if ((i || c && r !== null) && !s)
194
204
  try {
195
205
  if (t.tagName.includes("-"))
196
- t[e] = s;
206
+ t[e] = r;
197
207
  else {
198
- const u = s ?? "";
199
- e === "list" ? n = !1 : (a == null || t[e] != u) && (t[e] = u);
208
+ const u = r ?? "";
209
+ e === "list" ? i = !1 : (a == null || t[e] != u) && (t[e] = u);
200
210
  }
201
211
  } catch {
202
212
  }
203
213
  let l = !1;
204
- o !== (o = o.replace(/^xlink\:?/, "")) && (e = o, l = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (l ? t.removeAttributeNS(ne, e) : t.removeAttribute(e)) : (!n || i & 4 || r) && !c && (s = s === !0 ? "" : s, l ? t.setAttributeNS(ne, e, s) : t.setAttribute(e, s));
214
+ o !== (o = o.replace(/^xlink\:?/, "")) && (e = o, l = !0), r == null || r === !1 ? (r !== !1 || t.getAttribute(e) === "") && (l ? t.removeAttributeNS(ie, e) : t.removeAttribute(e)) : (!i || n & 4 || s) && !c && (r = r === !0 ? "" : r, l ? t.setAttributeNS(ie, e, r) : t.setAttribute(e, r));
205
215
  }
206
216
  }
207
- }, ot = /\s/, ue = (t) => t ? t.split(ot) : [], Se = (t, e, a, s) => {
208
- const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, i = t && t.$attrs$ || ie, n = e.$attrs$ || ie;
209
- for (s in i)
210
- s in n || de(r, s, i[s], void 0, a, e.$flags$);
211
- for (s in n)
212
- de(r, s, i[s], n[s], a, e.$flags$);
213
- }, H = (t, e, a, s) => {
214
- const r = e.$children$[a];
215
- let i = 0, n, o, c;
216
- if (we || (ee = !0, r.$tag$ === "slot" && (R && s.classList.add(R + "-s"), r.$flags$ |= r.$children$ ? (
217
+ }, ct = /\s/, he = (t) => t ? t.split(ct) : [], Ce = (t, e, a, r) => {
218
+ const s = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, n = t && t.$attrs$ || oe, i = e.$attrs$ || oe;
219
+ for (r in n)
220
+ r in i || ue(s, r, n[r], void 0, a, e.$flags$);
221
+ for (r in i)
222
+ ue(s, r, n[r], i[r], a, e.$flags$);
223
+ }, H = (t, e, a, r) => {
224
+ const s = e.$children$[a];
225
+ let n = 0, i, o, c;
226
+ if (De || (ee = !0, s.$tag$ === "slot" && (B && r.classList.add(B + "-s"), s.$flags$ |= s.$children$ ? (
217
227
  // slot element has fallback content
218
228
  2
219
229
  ) : (
220
230
  // slot element does not have fallback content
221
231
  1
222
- ))), r.$text$ !== null)
223
- n = r.$elm$ = m.createTextNode(r.$text$);
224
- else if (r.$flags$ & 1)
225
- n = r.$elm$ = m.createTextNode("");
232
+ ))), s.$text$ !== null)
233
+ i = s.$elm$ = m.createTextNode(s.$text$);
234
+ else if (s.$flags$ & 1)
235
+ i = s.$elm$ = m.createTextNode("");
226
236
  else {
227
- if (b || (b = r.$tag$ === "svg"), n = r.$elm$ = m.createElementNS(b ? Ke : Qe, r.$flags$ & 2 ? "slot-fb" : r.$tag$), b && r.$tag$ === "foreignObject" && (b = !1), Se(null, r, b), Ge(R) && n["s-si"] !== R && n.classList.add(n["s-si"] = R), r.$children$)
228
- for (i = 0; i < r.$children$.length; ++i)
229
- o = H(t, r, i, n), o && n.appendChild(o);
230
- r.$tag$ === "svg" ? b = !1 : n.tagName === "foreignObject" && (b = !0);
237
+ if (b || (b = s.$tag$ === "svg"), i = s.$elm$ = m.createElementNS(b ? Qe : Ge, s.$flags$ & 2 ? "slot-fb" : s.$tag$), b && s.$tag$ === "foreignObject" && (b = !1), Ce(null, s, b), Xe(B) && i["s-si"] !== B && i.classList.add(i["s-si"] = B), s.$children$)
238
+ for (n = 0; n < s.$children$.length; ++n)
239
+ o = H(t, s, n, i), o && i.appendChild(o);
240
+ s.$tag$ === "svg" ? b = !1 : i.tagName === "foreignObject" && (b = !0);
231
241
  }
232
- return n["s-hn"] = G, r.$flags$ & 3 && (n["s-sr"] = !0, n["s-cr"] = me, n["s-sn"] = r.$name$ || "", c = t && t.$children$ && t.$children$[a], c && c.$tag$ === r.$tag$ && t.$elm$ && F(t.$elm$, !1)), n;
242
+ return i["s-hn"] = G, s.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = we, i["s-sn"] = s.$name$ || "", c = t && t.$children$ && t.$children$[a], c && c.$tag$ === s.$tag$ && t.$elm$ && F(t.$elm$, !1)), i;
233
243
  }, F = (t, e) => {
234
- k.$flags$ |= 1;
244
+ v.$flags$ |= 1;
235
245
  const a = t.childNodes;
236
- for (let s = a.length - 1; s >= 0; s--) {
237
- const r = a[s];
238
- r["s-hn"] !== G && r["s-ol"] && (Te(r).insertBefore(r, ae(r)), r["s-ol"].remove(), r["s-ol"] = void 0, ee = !0), e && F(r, e);
239
- }
240
- k.$flags$ &= -2;
241
- }, Ce = (t, e, a, s, r, i) => {
242
- let n = t["s-cr"] && t["s-cr"].parentNode || t, o;
243
- for (n.shadowRoot && n.tagName === G && (n = n.shadowRoot); r <= i; ++r)
244
- s[r] && (o = H(null, a, r, t), o && (s[r].$elm$ = o, n.insertBefore(o, ae(e))));
245
- }, Me = (t, e, a, s, r) => {
246
+ for (let r = a.length - 1; r >= 0; r--) {
247
+ const s = a[r];
248
+ s["s-hn"] !== G && s["s-ol"] && (Le(s).insertBefore(s, ae(s)), s["s-ol"].remove(), s["s-ol"] = void 0, ee = !0), e && F(s, e);
249
+ }
250
+ v.$flags$ &= -2;
251
+ }, Me = (t, e, a, r, s, n) => {
252
+ let i = t["s-cr"] && t["s-cr"].parentNode || t, o;
253
+ for (i.shadowRoot && i.tagName === G && (i = i.shadowRoot); s <= n; ++s)
254
+ r[s] && (o = H(null, a, s, t), o && (r[s].$elm$ = o, i.insertBefore(o, ae(e))));
255
+ }, Te = (t, e, a, r, s) => {
246
256
  for (; e <= a; ++e)
247
- (s = t[e]) && (r = s.$elm$, Re(s), z = !0, r["s-ol"] ? r["s-ol"].remove() : F(r, !0), r.remove());
248
- }, ct = (t, e, a, s) => {
249
- let r = 0, i = 0, n = 0, o = 0, c = e.length - 1, l = e[0], u = e[c], d = s.length - 1, p = s[0], y = s[d], $, D;
250
- for (; r <= c && i <= d; )
257
+ (r = t[e]) && (s = r.$elm$, Re(r), z = !0, s["s-ol"] ? s["s-ol"].remove() : F(s, !0), s.remove());
258
+ }, lt = (t, e, a, r) => {
259
+ let s = 0, n = 0, i = 0, o = 0, c = e.length - 1, l = e[0], u = e[c], d = r.length - 1, p = r[0], g = r[d], $, x;
260
+ for (; s <= c && n <= d; )
251
261
  if (l == null)
252
- l = e[++r];
262
+ l = e[++s];
253
263
  else if (u == null)
254
264
  u = e[--c];
255
265
  else if (p == null)
256
- p = s[++i];
257
- else if (y == null)
258
- y = s[--d];
259
- else if (q(l, p))
260
- N(l, p), l = e[++r], p = s[++i];
261
- else if (q(u, y))
262
- N(u, y), u = e[--c], y = s[--d];
263
- else if (q(l, y))
264
- (l.$tag$ === "slot" || y.$tag$ === "slot") && F(l.$elm$.parentNode, !1), N(l, y), t.insertBefore(l.$elm$, u.$elm$.nextSibling), l = e[++r], y = s[--d];
265
- else if (q(u, p))
266
- (l.$tag$ === "slot" || y.$tag$ === "slot") && F(u.$elm$.parentNode, !1), N(u, p), t.insertBefore(u.$elm$, l.$elm$), u = e[--c], p = s[++i];
266
+ p = r[++n];
267
+ else if (g == null)
268
+ g = r[--d];
269
+ else if (Y(l, p))
270
+ R(l, p), l = e[++s], p = r[++n];
271
+ else if (Y(u, g))
272
+ R(u, g), u = e[--c], g = r[--d];
273
+ else if (Y(l, g))
274
+ (l.$tag$ === "slot" || g.$tag$ === "slot") && F(l.$elm$.parentNode, !1), R(l, g), t.insertBefore(l.$elm$, u.$elm$.nextSibling), l = e[++s], g = r[--d];
275
+ else if (Y(u, p))
276
+ (l.$tag$ === "slot" || g.$tag$ === "slot") && F(u.$elm$.parentNode, !1), R(u, p), t.insertBefore(u.$elm$, l.$elm$), u = e[--c], p = r[++n];
267
277
  else {
268
- for (n = -1, o = r; o <= c; ++o)
278
+ for (i = -1, o = s; o <= c; ++o)
269
279
  if (e[o] && e[o].$key$ !== null && e[o].$key$ === p.$key$) {
270
- n = o;
280
+ i = o;
271
281
  break;
272
282
  }
273
- n >= 0 ? (D = e[n], D.$tag$ !== p.$tag$ ? $ = H(e && e[i], a, n, t) : (N(D, p), e[n] = void 0, $ = D.$elm$), p = s[++i]) : ($ = H(e && e[i], a, i, t), p = s[++i]), $ && Te(l.$elm$).insertBefore($, ae(l.$elm$));
283
+ i >= 0 ? (x = e[i], x.$tag$ !== p.$tag$ ? $ = H(e && e[n], a, i, t) : (R(x, p), e[i] = void 0, $ = x.$elm$), p = r[++n]) : ($ = H(e && e[n], a, n, t), p = r[++n]), $ && Le(l.$elm$).insertBefore($, ae(l.$elm$));
274
284
  }
275
- r > c ? Ce(t, s[d + 1] == null ? null : s[d + 1].$elm$, a, s, i, d) : i > d && Me(e, r, c);
276
- }, q = (t, e) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : t.$key$ === e.$key$ : !1, ae = (t) => t && t["s-ol"] || t, Te = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, N = (t, e) => {
277
- const a = e.$elm$ = t.$elm$, s = t.$children$, r = e.$children$, i = e.$tag$, n = e.$text$;
285
+ s > c ? Me(t, r[d + 1] == null ? null : r[d + 1].$elm$, a, r, n, d) : n > d && Te(e, s, c);
286
+ }, Y = (t, e) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : t.$key$ === e.$key$ : !1, ae = (t) => t && t["s-ol"] || t, Le = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, R = (t, e) => {
287
+ const a = e.$elm$ = t.$elm$, r = t.$children$, s = e.$children$, n = e.$tag$, i = e.$text$;
278
288
  let o;
279
- n === null ? (b = i === "svg" ? !0 : i === "foreignObject" ? !1 : b, i === "slot" || Se(t, e, b), s !== null && r !== null ? ct(a, s, e, r) : r !== null ? (t.$text$ !== null && (a.textContent = ""), Ce(a, null, e, r, 0, r.length - 1)) : s !== null && Me(s, 0, s.length - 1), b && i === "svg" && (b = !1)) : (o = a["s-cr"]) ? o.parentNode.textContent = n : t.$text$ !== n && (a.data = n);
280
- }, Le = (t) => {
289
+ i === null ? (b = n === "svg" ? !0 : n === "foreignObject" ? !1 : b, n === "slot" || Ce(t, e, b), r !== null && s !== null ? lt(a, r, e, s) : s !== null ? (t.$text$ !== null && (a.textContent = ""), Me(a, null, e, s, 0, s.length - 1)) : r !== null && Te(r, 0, r.length - 1), b && n === "svg" && (b = !1)) : (o = a["s-cr"]) ? o.parentNode.textContent = i : t.$text$ !== i && (a.data = i);
290
+ }, Ee = (t) => {
281
291
  const e = t.childNodes;
282
- let a, s, r, i, n, o;
283
- for (s = 0, r = e.length; s < r; s++)
284
- if (a = e[s], a.nodeType === 1) {
292
+ let a, r, s, n, i, o;
293
+ for (r = 0, s = e.length; r < s; r++)
294
+ if (a = e[r], a.nodeType === 1) {
285
295
  if (a["s-sr"]) {
286
- for (n = a["s-sn"], a.hidden = !1, i = 0; i < r; i++)
287
- if (o = e[i].nodeType, e[i]["s-hn"] !== a["s-hn"] || n !== "") {
288
- if (o === 1 && n === e[i].getAttribute("slot")) {
296
+ for (i = a["s-sn"], a.hidden = !1, n = 0; n < s; n++)
297
+ if (o = e[n].nodeType, e[n]["s-hn"] !== a["s-hn"] || i !== "") {
298
+ if (o === 1 && i === e[n].getAttribute("slot")) {
289
299
  a.hidden = !0;
290
300
  break;
291
301
  }
292
- } else if (o === 1 || o === 3 && e[i].textContent.trim() !== "") {
302
+ } else if (o === 1 || o === 3 && e[n].textContent.trim() !== "") {
293
303
  a.hidden = !0;
294
304
  break;
295
305
  }
296
306
  }
297
- Le(a);
307
+ Ee(a);
298
308
  }
299
309
  }, _ = [], Be = (t) => {
300
- let e, a, s, r, i, n, o = 0;
310
+ let e, a, r, s, n, i, o = 0;
301
311
  const c = t.childNodes, l = c.length;
302
312
  for (; o < l; o++) {
303
313
  if (e = c[o], e["s-sr"] && (a = e["s-cr"]) && a.parentNode)
304
- for (s = a.parentNode.childNodes, r = e["s-sn"], n = s.length - 1; n >= 0; n--)
305
- a = s[n], !a["s-cn"] && !a["s-nr"] && a["s-hn"] !== e["s-hn"] && (he(a, r) ? (i = _.find((u) => u.$nodeToRelocate$ === a), z = !0, a["s-sn"] = a["s-sn"] || r, i ? i.$slotRefNode$ = e : _.push({
314
+ for (r = a.parentNode.childNodes, s = e["s-sn"], i = r.length - 1; i >= 0; i--)
315
+ a = r[i], !a["s-cn"] && !a["s-nr"] && a["s-hn"] !== e["s-hn"] && (pe(a, s) ? (n = _.find((u) => u.$nodeToRelocate$ === a), z = !0, a["s-sn"] = a["s-sn"] || s, n ? n.$slotRefNode$ = e : _.push({
306
316
  $slotRefNode$: e,
307
317
  $nodeToRelocate$: a
308
318
  }), a["s-sr"] && _.map((u) => {
309
- he(u.$nodeToRelocate$, a["s-sn"]) && (i = _.find((d) => d.$nodeToRelocate$ === a), i && !u.$slotRefNode$ && (u.$slotRefNode$ = i.$slotRefNode$));
319
+ pe(u.$nodeToRelocate$, a["s-sn"]) && (n = _.find((d) => d.$nodeToRelocate$ === a), n && !u.$slotRefNode$ && (u.$slotRefNode$ = n.$slotRefNode$));
310
320
  })) : _.some((u) => u.$nodeToRelocate$ === a) || _.push({
311
321
  $nodeToRelocate$: a
312
322
  }));
313
323
  e.nodeType === 1 && Be(e);
314
324
  }
315
- }, he = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", Re = (t) => {
325
+ }, pe = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", Re = (t) => {
316
326
  t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(Re);
317
- }, lt = (t, e) => {
318
- const a = t.$hostElement$, s = t.$cmpMeta$, r = t.$vnode$ || j(null, null), i = Je(e) ? e : h(null, null, e);
319
- G = a.tagName, s.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, s.$attrsToReflect$.map(([n, o]) => i.$attrs$[o] = a[n])), i.$tag$ = null, i.$flags$ |= 4, t.$vnode$ = i, i.$elm$ = r.$elm$ = a.shadowRoot || a, R = a["s-sc"], me = a["s-cr"], we = (s.$flags$ & 1) !== 0, z = !1, N(r, i);
327
+ }, dt = (t, e) => {
328
+ const a = t.$hostElement$, r = t.$cmpMeta$, s = t.$vnode$ || j(null, null), n = Ze(e) ? e : h(null, null, e);
329
+ G = a.tagName, r.$attrsToReflect$ && (n.$attrs$ = n.$attrs$ || {}, r.$attrsToReflect$.map(([i, o]) => n.$attrs$[o] = a[i])), n.$tag$ = null, n.$flags$ |= 4, t.$vnode$ = n, n.$elm$ = s.$elm$ = a.shadowRoot || a, B = a["s-sc"], we = a["s-cr"], De = (r.$flags$ & 1) !== 0, z = !1, R(s, n);
320
330
  {
321
- if (k.$flags$ |= 1, ee) {
322
- Be(i.$elm$);
323
- let n, o, c, l, u, d, p = 0;
331
+ if (v.$flags$ |= 1, ee) {
332
+ Be(n.$elm$);
333
+ let i, o, c, l, u, d, p = 0;
324
334
  for (; p < _.length; p++)
325
- n = _[p], o = n.$nodeToRelocate$, o["s-ol"] || (c = m.createTextNode(""), c["s-nr"] = o, o.parentNode.insertBefore(o["s-ol"] = c, o));
335
+ i = _[p], o = i.$nodeToRelocate$, o["s-ol"] || (c = m.createTextNode(""), c["s-nr"] = o, o.parentNode.insertBefore(o["s-ol"] = c, o));
326
336
  for (p = 0; p < _.length; p++)
327
- if (n = _[p], o = n.$nodeToRelocate$, n.$slotRefNode$) {
328
- for (l = n.$slotRefNode$.parentNode, u = n.$slotRefNode$.nextSibling, c = o["s-ol"]; c = c.previousSibling; )
337
+ if (i = _[p], o = i.$nodeToRelocate$, i.$slotRefNode$) {
338
+ for (l = i.$slotRefNode$.parentNode, u = i.$slotRefNode$.nextSibling, c = o["s-ol"]; c = c.previousSibling; )
329
339
  if (d = c["s-nr"], d && d["s-sn"] === o["s-sn"] && l === d.parentNode && (d = d.nextSibling, !d || !d["s-nr"])) {
330
340
  u = d;
331
341
  break;
@@ -334,142 +344,142 @@ const h = (t, e, ...a) => {
334
344
  } else
335
345
  o.nodeType === 1 && (o.hidden = !0);
336
346
  }
337
- z && Le(i.$elm$), k.$flags$ &= -2, _.length = 0;
338
- }
339
- }, dt = (t, e) => {
340
- }, Ne = (t, e) => (t.$flags$ |= 16, dt(t, t.$ancestorComponent$), Ot(() => ut(t, e))), ut = (t, e) => {
341
- const a = t.$hostElement$, s = M("scheduleUpdate", t.$cmpMeta$.$tagName$), r = a;
342
- let i;
343
- return e ? i = E(r, "componentWillLoad") : i = E(r, "componentWillUpdate"), i = pe(i, () => E(r, "componentWillRender")), s(), pe(i, () => ht(t, r, e));
344
- }, ht = async (t, e, a) => {
345
- const s = t.$hostElement$, r = M("update", t.$cmpMeta$.$tagName$);
346
- s["s-rc"], a && it(t);
347
- const i = M("render", t.$cmpMeta$.$tagName$);
348
- pt(t, e, s), i(), r(), ft(t);
349
- }, pt = (t, e, a) => {
347
+ z && Ee(n.$elm$), v.$flags$ &= -2, _.length = 0;
348
+ }
349
+ }, ut = (t, e) => {
350
+ }, Oe = (t, e) => (t.$flags$ |= 16, ut(t, t.$ancestorComponent$), It(() => ht(t, e))), ht = (t, e) => {
351
+ const a = t.$hostElement$, r = M("scheduleUpdate", t.$cmpMeta$.$tagName$), s = a;
352
+ let n;
353
+ return e ? n = O(s, "componentWillLoad") : n = O(s, "componentWillUpdate"), n = fe(n, () => O(s, "componentWillRender")), r(), fe(n, () => pt(t, s, e));
354
+ }, pt = async (t, e, a) => {
355
+ const r = t.$hostElement$, s = M("update", t.$cmpMeta$.$tagName$);
356
+ r["s-rc"], a && ot(t);
357
+ const n = M("render", t.$cmpMeta$.$tagName$);
358
+ ft(t, e, r), n(), s(), yt(t);
359
+ }, ft = (t, e, a) => {
350
360
  try {
351
- re = e, e = e.render && e.render(), t.$flags$ &= -17, t.$flags$ |= 2, (B.hasRenderFn || B.reflect) && (B.vdomRender || B.reflect) && (B.hydrateServerSide || lt(t, e));
361
+ ne = e, e = e.render && e.render(), t.$flags$ &= -17, t.$flags$ |= 2, (E.hasRenderFn || E.reflect) && (E.vdomRender || E.reflect) && (E.hydrateServerSide || dt(t, e));
352
362
  } catch (o) {
353
- Y(o, t.$hostElement$);
363
+ A(o, t.$hostElement$);
354
364
  }
355
- return re = null, null;
356
- }, ft = (t) => {
357
- const e = t.$cmpMeta$.$tagName$, a = t.$hostElement$, s = M("postUpdate", e), r = a;
358
- t.$ancestorComponent$, E(r, "componentDidRender"), t.$flags$ & 64 ? (E(r, "componentDidUpdate"), s()) : (t.$flags$ |= 64, E(r, "componentDidLoad"), s());
359
- }, E = (t, e, a) => {
365
+ return ne = null, null;
366
+ }, yt = (t) => {
367
+ const e = t.$cmpMeta$.$tagName$, a = t.$hostElement$, r = M("postUpdate", e), s = a;
368
+ t.$ancestorComponent$, O(s, "componentDidRender"), t.$flags$ & 64 ? (O(s, "componentDidUpdate"), r()) : (t.$flags$ |= 64, O(s, "componentDidLoad"), r());
369
+ }, O = (t, e, a) => {
360
370
  if (t && t[e])
361
371
  try {
362
372
  return t[e](a);
363
- } catch (s) {
364
- Y(s);
373
+ } catch (r) {
374
+ A(r);
365
375
  }
366
- }, pe = (t, e) => t && t.then ? t.then(e) : e(), yt = (t, e) => X(t).$instanceValues$.get(e), gt = (t, e, a, s) => {
367
- const r = X(t), i = t, n = r.$instanceValues$.get(e), o = r.$flags$, c = i;
368
- a = tt(a, s.$members$[e][0]);
369
- const l = Number.isNaN(n) && Number.isNaN(a);
370
- if (a !== n && !l) {
371
- r.$instanceValues$.set(e, a);
376
+ }, fe = (t, e) => t && t.then ? t.then(e) : e(), gt = (t, e) => X(t).$instanceValues$.get(e), kt = (t, e, a, r) => {
377
+ const s = X(t), n = t, i = s.$instanceValues$.get(e), o = s.$flags$, c = n;
378
+ a = at(a, r.$members$[e][0]);
379
+ const l = Number.isNaN(i) && Number.isNaN(a);
380
+ if (a !== i && !l) {
381
+ s.$instanceValues$.set(e, a);
372
382
  {
373
- if (s.$watchers$ && o & 128) {
374
- const d = s.$watchers$[e];
383
+ if (r.$watchers$ && o & 128) {
384
+ const d = r.$watchers$[e];
375
385
  d && d.map((p) => {
376
386
  try {
377
- c[p](a, n, e);
378
- } catch (y) {
379
- Y(y, i);
387
+ c[p](a, i, e);
388
+ } catch (g) {
389
+ A(g, n);
380
390
  }
381
391
  });
382
392
  }
383
393
  if ((o & 18) === 2) {
384
- if (c.componentShouldUpdate && c.componentShouldUpdate(a, n, e) === !1)
394
+ if (c.componentShouldUpdate && c.componentShouldUpdate(a, i, e) === !1)
385
395
  return;
386
- Ne(r, !1);
396
+ Oe(s, !1);
387
397
  }
388
398
  }
389
399
  }
390
400
  }, vt = (t, e, a) => {
391
401
  if (e.$members$) {
392
402
  t.watchers && (e.$watchers$ = t.watchers);
393
- const s = Object.entries(e.$members$), r = t.prototype;
394
- s.map(([i, [n]]) => {
395
- (n & 31 || n & 32) && Object.defineProperty(r, i, {
403
+ const r = Object.entries(e.$members$), s = t.prototype;
404
+ r.map(([n, [i]]) => {
405
+ (i & 31 || i & 32) && Object.defineProperty(s, n, {
396
406
  get() {
397
- return yt(this, i);
407
+ return gt(this, n);
398
408
  },
399
409
  set(o) {
400
- gt(this, i, o, e);
410
+ kt(this, n, o, e);
401
411
  },
402
412
  configurable: !0,
403
413
  enumerable: !0
404
414
  });
405
415
  });
406
416
  {
407
- const i = /* @__PURE__ */ new Map();
408
- r.attributeChangedCallback = function(n, o, c) {
409
- k.jmp(() => {
410
- const l = i.get(n);
417
+ const n = /* @__PURE__ */ new Map();
418
+ s.attributeChangedCallback = function(i, o, c) {
419
+ v.jmp(() => {
420
+ const l = n.get(i);
411
421
  if (this.hasOwnProperty(l))
412
422
  c = this[l], delete this[l];
413
- else if (r.hasOwnProperty(l) && typeof this[l] == "number" && this[l] == c)
423
+ else if (s.hasOwnProperty(l) && typeof this[l] == "number" && this[l] == c)
414
424
  return;
415
425
  this[l] = c === null && typeof this[l] == "boolean" ? !1 : c;
416
426
  });
417
- }, t.observedAttributes = s.filter(
418
- ([n, o]) => o[0] & 15
427
+ }, t.observedAttributes = r.filter(
428
+ ([i, o]) => o[0] & 15
419
429
  /* MEMBER_FLAGS.HasAttribute */
420
- ).map(([n, o]) => {
421
- const c = o[1] || n;
422
- return i.set(c, n), o[0] & 512 && e.$attrsToReflect$.push([n, c]), c;
430
+ ).map(([i, o]) => {
431
+ const c = o[1] || i;
432
+ return n.set(c, i), o[0] & 512 && e.$attrsToReflect$.push([i, c]), c;
423
433
  });
424
434
  }
425
435
  }
426
436
  return t;
427
- }, kt = async (t, e, a, s, r) => {
428
- if ((e.$flags$ & 32) === 0 && (r = t.constructor, e.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then(() => e.$flags$ |= 128), r.style)) {
429
- let n = r.style;
430
- typeof n != "string" && (n = n[e.$modeName$ = et(t)]);
431
- const o = xe(a, e.$modeName$);
437
+ }, bt = async (t, e, a, r, s) => {
438
+ if ((e.$flags$ & 32) === 0 && (s = t.constructor, e.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then(() => e.$flags$ |= 128), s.style)) {
439
+ let i = s.style;
440
+ typeof i != "string" && (i = i[e.$modeName$ = tt(t)]);
441
+ const o = Se(a, e.$modeName$);
432
442
  if (!K.has(o)) {
433
443
  const c = M("registerStyles", a.$tagName$);
434
- rt(o, n, !!(a.$flags$ & 1)), c();
444
+ nt(o, i, !!(a.$flags$ & 1)), c();
435
445
  }
436
446
  }
437
- e.$ancestorComponent$, Ne(e, !0);
438
- }, bt = (t) => {
447
+ e.$ancestorComponent$, Oe(e, !0);
439
448
  }, $t = (t) => {
440
- if ((k.$flags$ & 1) === 0) {
441
- const e = X(t), a = e.$cmpMeta$, s = M("connectedCallback", a.$tagName$);
442
- e.$flags$ & 1 ? (Ee(t, e, a.$listeners$), bt(e.$lazyInstance$)) : (e.$flags$ |= 1, a.$flags$ & 12 && _t(t), a.$members$ && Object.entries(a.$members$).map(([r, [i]]) => {
443
- if (i & 31 && t.hasOwnProperty(r)) {
444
- const n = t[r];
445
- delete t[r], t[r] = n;
449
+ }, _t = (t) => {
450
+ if ((v.$flags$ & 1) === 0) {
451
+ const e = X(t), a = e.$cmpMeta$, r = M("connectedCallback", a.$tagName$);
452
+ e.$flags$ & 1 ? (Ne(t, e, a.$listeners$), $t(e.$lazyInstance$)) : (e.$flags$ |= 1, a.$flags$ & 12 && mt(t), a.$members$ && Object.entries(a.$members$).map(([s, [n]]) => {
453
+ if (n & 31 && t.hasOwnProperty(s)) {
454
+ const i = t[s];
455
+ delete t[s], t[s] = i;
446
456
  }
447
- }), kt(t, e, a)), s();
457
+ }), bt(t, e, a)), r();
448
458
  }
449
- }, _t = (t) => {
459
+ }, mt = (t) => {
450
460
  const e = t["s-cr"] = m.createComment("");
451
461
  e["s-cn"] = !0, t.insertBefore(e, t.firstChild);
452
- }, mt = (t) => {
453
- if ((k.$flags$ & 1) === 0) {
462
+ }, wt = (t) => {
463
+ if ((v.$flags$ & 1) === 0) {
454
464
  const e = X(t);
455
465
  e.$rmListeners$ && (e.$rmListeners$.map((a) => a()), e.$rmListeners$ = void 0);
456
466
  }
457
- }, wt = (t, e) => {
467
+ }, Dt = (t, e) => {
458
468
  const a = {
459
469
  $flags$: e[0],
460
470
  $tagName$: e[1]
461
471
  };
462
472
  a.$members$ = e[2], a.$listeners$ = e[3], a.$watchers$ = t.$watchers$, a.$attrsToReflect$ = [];
463
- const s = t.prototype.connectedCallback, r = t.prototype.disconnectedCallback;
473
+ const r = t.prototype.connectedCallback, s = t.prototype.disconnectedCallback;
464
474
  return Object.assign(t.prototype, {
465
475
  __registerHost() {
466
- Ct(this, a);
476
+ Mt(this, a);
467
477
  },
468
478
  connectedCallback() {
469
- $t(this), s && s.call(this);
479
+ _t(this), r && r.call(this);
470
480
  },
471
481
  disconnectedCallback() {
472
- mt(this), r && r.call(this);
482
+ wt(this), s && s.call(this);
473
483
  },
474
484
  __attachShadow() {
475
485
  this.attachShadow({
@@ -478,38 +488,38 @@ const h = (t, e, ...a) => {
478
488
  });
479
489
  }
480
490
  }), t.is = a.$tagName$, vt(t, a);
481
- }, Ee = (t, e, a, s) => {
482
- a && a.map(([r, i, n]) => {
483
- const o = xt(t, r), c = Dt(e, n), l = St(r);
484
- k.ael(o, i, c, l), (e.$rmListeners$ = e.$rmListeners$ || []).push(() => k.rel(o, i, c, l));
491
+ }, Ne = (t, e, a, r) => {
492
+ a && a.map(([s, n, i]) => {
493
+ const o = St(t, s), c = xt(e, i), l = Ct(s);
494
+ v.ael(o, n, c, l), (e.$rmListeners$ = e.$rmListeners$ || []).push(() => v.rel(o, n, c, l));
485
495
  });
486
- }, Dt = (t, e) => (a) => {
496
+ }, xt = (t, e) => (a) => {
487
497
  try {
488
- B.lazyLoad || t.$hostElement$[e](a);
489
- } catch (s) {
490
- Y(s);
498
+ E.lazyLoad || t.$hostElement$[e](a);
499
+ } catch (r) {
500
+ A(r);
491
501
  }
492
- }, xt = (t, e) => e & 4 ? m : e & 8 ? J : e & 16 ? m.body : t, St = (t) => Lt ? {
502
+ }, St = (t, e) => e & 4 ? m : e & 8 ? J : e & 16 ? m.body : t, Ct = (t) => Et ? {
493
503
  passive: (t & 1) !== 0,
494
504
  capture: (t & 2) !== 0
495
- } : (t & 2) !== 0, Oe = /* @__PURE__ */ new WeakMap(), X = (t) => Oe.get(t), Ct = (t, e) => {
505
+ } : (t & 2) !== 0, Ie = /* @__PURE__ */ new WeakMap(), X = (t) => Ie.get(t), Mt = (t, e) => {
496
506
  const a = {
497
507
  $flags$: 0,
498
508
  $hostElement$: t,
499
509
  $cmpMeta$: e,
500
510
  $instanceValues$: /* @__PURE__ */ new Map()
501
511
  };
502
- return Ee(t, a, e.$listeners$), Oe.set(t, a);
503
- }, fe = (t, e) => e in t, Y = (t, e) => (0, console.error)(t, e), K = /* @__PURE__ */ new Map(), Mt = [], J = typeof window < "u" ? window : {}, m = J.document || { head: {} }, Tt = J.HTMLElement || class {
504
- }, k = {
512
+ return Ne(t, a, e.$listeners$), Ie.set(t, a);
513
+ }, ye = (t, e) => e in t, A = (t, e) => (0, console.error)(t, e), K = /* @__PURE__ */ new Map(), Tt = [], J = typeof window < "u" ? window : {}, m = J.document || { head: {} }, Lt = J.HTMLElement || class {
514
+ }, v = {
505
515
  $flags$: 0,
506
516
  $resourcesUrl$: "",
507
517
  jmp: (t) => t(),
508
518
  raf: (t) => requestAnimationFrame(t),
509
- ael: (t, e, a, s) => t.addEventListener(e, a, s),
510
- rel: (t, e, a, s) => t.removeEventListener(e, a, s),
519
+ ael: (t, e, a, r) => t.addEventListener(e, a, r),
520
+ rel: (t, e, a, r) => t.removeEventListener(e, a, r),
511
521
  ce: (t, e) => new CustomEvent(t, e)
512
- }, Lt = /* @__PURE__ */ (() => {
522
+ }, Et = /* @__PURE__ */ (() => {
513
523
  let t = !1;
514
524
  try {
515
525
  m.addEventListener("e", null, Object.defineProperty({}, "passive", {
@@ -526,59 +536,59 @@ const h = (t, e, ...a) => {
526
536
  } catch {
527
537
  }
528
538
  return !1;
529
- })(), ye = [], Ae = [], Nt = (t, e) => (a) => {
530
- t.push(a), Z || (Z = !0, e && k.$flags$ & 4 ? Et(V) : k.raf(V));
531
- }, ge = (t) => {
539
+ })(), ge = [], Fe = [], Ot = (t, e) => (a) => {
540
+ t.push(a), Z || (Z = !0, e && v.$flags$ & 4 ? Nt(V) : v.raf(V));
541
+ }, ke = (t) => {
532
542
  for (let e = 0; e < t.length; e++)
533
543
  try {
534
544
  t[e](performance.now());
535
545
  } catch (a) {
536
- Y(a);
546
+ A(a);
537
547
  }
538
548
  t.length = 0;
539
549
  }, V = () => {
540
- ge(ye), ge(Ae), (Z = ye.length > 0) && k.raf(V);
541
- }, Et = (t) => Bt().then(t), Ot = /* @__PURE__ */ Nt(Ae, !0);
550
+ ke(ge), ke(Fe), (Z = ge.length > 0) && v.raf(V);
551
+ }, Nt = (t) => Bt().then(t), It = /* @__PURE__ */ Ot(Fe, !0);
542
552
  function P(t, e) {
543
553
  const a = new Date(t);
544
554
  return a.setDate(a.getDate() + e), a;
545
555
  }
546
- function At(t, e, a) {
547
- const s = [], r = se(t), i = r.getDay() === 0 ? 7 : r.getDay(), n = U(t), o = n.getDay() === 0 ? 7 : n.getDay(), c = a === 1 ? 7 : a - 1, l = [], u = [];
556
+ function Ft(t, e, a) {
557
+ const r = [], s = re(t), n = s.getDay() === 0 ? 7 : s.getDay(), i = U(t), o = i.getDay() === 0 ? 7 : i.getDay(), c = a === 1 ? 7 : a - 1, l = [], u = [];
548
558
  {
549
- let y = (7 - a + i) % 7, $ = Q(r);
550
- for (; y > 0; )
551
- l.push($), $ = Q($), y -= 1;
559
+ let g = (7 - a + n) % 7, $ = Q(s);
560
+ for (; g > 0; )
561
+ l.push($), $ = Q($), g -= 1;
552
562
  l.reverse();
553
- let T = (7 - o + c) % 7, L = I(n);
563
+ let T = (7 - o + c) % 7, L = I(i);
554
564
  for (; T > 0; )
555
565
  u.push(L), L = I(L), T -= 1;
556
566
  }
557
- let d = r;
567
+ let d = s;
558
568
  for (; d.getMonth() === t.getMonth(); )
559
- s.push(d), d = I(d);
560
- return [...l, ...s, ...u];
569
+ r.push(d), d = I(d);
570
+ return [...l, ...r, ...u];
561
571
  }
562
- function se(t) {
563
- return S(/* @__PURE__ */ new Date(`${String(Fe(t)).padStart(4, "0")}-${String(Ie(t)).padStart(2, "0")}-01`));
572
+ function re(t) {
573
+ return C(/* @__PURE__ */ new Date(`${String(qe(t)).padStart(4, "0")}-${String(Ae(t)).padStart(2, "0")}-01`));
564
574
  }
565
- function x(t) {
575
+ function S(t) {
566
576
  if (t instanceof Date)
567
577
  return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
568
578
  }
569
579
  function U(t) {
570
- const e = se(t);
580
+ const e = re(t);
571
581
  return e.setMonth(e.getMonth() + 1), e.setDate(e.getDate() - 1), e;
572
582
  }
573
- function Ie(t) {
583
+ function Ae(t) {
574
584
  return t.getMonth() + 1;
575
585
  }
576
- function It(t) {
586
+ function At(t) {
577
587
  return new Array(12).fill(void 0).map((e, a) => {
578
- const s = S(/* @__PURE__ */ new Date(`2006-${String(a + 1).padStart(2, "0")}-01`));
588
+ const r = C(/* @__PURE__ */ new Date(`2006-${String(a + 1).padStart(2, "0")}-01`));
579
589
  return Intl.DateTimeFormat(t, {
580
590
  month: "long"
581
- }).format(s);
591
+ }).format(r);
582
592
  });
583
593
  }
584
594
  function I(t) {
@@ -588,47 +598,47 @@ function ve(t) {
588
598
  const e = new Date(t);
589
599
  return e.setDate(1), e.setMonth(e.getMonth() + 1), e;
590
600
  }
591
- function ke(t) {
601
+ function be(t) {
592
602
  const e = new Date(t);
593
603
  return e.setFullYear(e.getFullYear() + 1), e;
594
604
  }
595
605
  function Q(t) {
596
606
  return W(t, 1);
597
607
  }
598
- function be(t) {
608
+ function $e(t) {
599
609
  const e = new Date(t);
600
610
  return e.setDate(1), e.setMonth(e.getMonth() - 1), e;
601
611
  }
602
- function $e(t) {
612
+ function _e(t) {
603
613
  const e = new Date(t);
604
614
  return e.setFullYear(e.getFullYear() - 1), e;
605
615
  }
606
- function Ft(t, e) {
607
- return new Array(7).fill(void 0).map((a, s) => (t + s) % 7 + 1).map((a) => {
608
- const s = S(/* @__PURE__ */ new Date(`2006-01-0${a}`));
616
+ function qt(t, e) {
617
+ return new Array(7).fill(void 0).map((a, r) => (t + r) % 7 + 1).map((a) => {
618
+ const r = C(/* @__PURE__ */ new Date(`2006-01-0${a}`));
609
619
  return [
610
620
  Intl.DateTimeFormat(e, {
611
621
  weekday: "short"
612
- }).format(s).slice(0, 3),
622
+ }).format(r).slice(0, 3),
613
623
  Intl.DateTimeFormat(e, {
614
624
  weekday: "long"
615
- }).format(s)
625
+ }).format(r)
616
626
  ];
617
627
  });
618
628
  }
619
- function Fe(t) {
629
+ function qe(t) {
620
630
  return t.getFullYear();
621
631
  }
622
- function _e(t, e) {
632
+ function me(t, e) {
623
633
  if (!t || !e || !e.from || !e.to)
624
634
  return !1;
625
- const a = e.from < e.to ? e.from : e.to, s = e.from < e.to ? e.to : e.from;
626
- return t >= a && t <= s;
635
+ const a = e.from < e.to ? e.from : e.to, r = e.from < e.to ? e.to : e.from;
636
+ return t >= a && t <= r;
627
637
  }
628
638
  function w(t, e) {
629
639
  return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
630
640
  }
631
- function S(t) {
641
+ function C(t) {
632
642
  const e = new Date(t);
633
643
  return e.setMinutes(e.getMinutes() + e.getTimezoneOffset()), e;
634
644
  }
@@ -636,7 +646,7 @@ function W(t, e) {
636
646
  const a = new Date(t);
637
647
  return a.setDate(a.getDate() - e), a;
638
648
  }
639
- const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%)}", qt = {
649
+ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%)}", Pt = {
640
650
  clearButton: "Clear value",
641
651
  monthSelect: "Select month",
642
652
  nextMonthButton: "Next month",
@@ -646,12 +656,12 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
646
656
  previousYearButton: "Previous year",
647
657
  todayButton: "Show today",
648
658
  yearSelect: "Select year"
649
- }, Pt = /* @__PURE__ */ wt(class extends Tt {
659
+ }, Ut = /* @__PURE__ */ Dt(class extends Lt {
650
660
  constructor() {
651
- super(), this.__registerHost(), this.selectDate = ce(this, "selectDate"), this.changeMonth = ce(this, "changeMonth"), this.disabled = !1, this.disableDate = () => !1, this.elementClassName = "wc-datepicker", this.firstDayOfWeek = 0, this.labels = qt, this.locale = navigator?.language || "en-US", this.showClearButton = !1, this.showMonthStepper = !0, this.showTodayButton = !1, this.showYearStepper = !1, this.startDate = x(/* @__PURE__ */ new Date()), this.maxSearchDays = 365, this.goToRangeStartOnSelect = !0, this.init = () => {
652
- this.currentDate = this.startDate ? S(new Date(this.startDate)) : /* @__PURE__ */ new Date(), this.updateWeekdays();
661
+ super(), this.__registerHost(), this.selectDate = le(this, "selectDate"), this.changeMonth = le(this, "changeMonth"), this.disabled = !1, this.disableDate = () => !1, this.elementClassName = "wc-datepicker", this.firstDayOfWeek = 0, this.labels = Pt, this.locale = navigator?.language || "en-US", this.showClearButton = !1, this.showMonthStepper = !0, this.showTodayButton = !1, this.showYearStepper = !1, this.startDate = S(/* @__PURE__ */ new Date()), this.maxSearchDays = 365, this.goToRangeStartOnSelect = !0, this.init = () => {
662
+ this.currentDate = this.startDate ? C(new Date(this.startDate)) : /* @__PURE__ */ new Date(), this.updateWeekdays();
653
663
  }, this.getAvailableDate = (t, e) => {
654
- let a, s = !1;
664
+ let a, r = !1;
655
665
  switch (e) {
656
666
  case "previousDay":
657
667
  a = Q(t);
@@ -666,25 +676,25 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
666
676
  a = P(t, 7);
667
677
  break;
668
678
  case "firstOfMonth":
669
- a = se(t);
679
+ a = re(t);
670
680
  break;
671
681
  case "lastOfMonth":
672
682
  a = U(t);
673
683
  break;
674
684
  case "previousMonth":
675
- a = be(t);
685
+ a = $e(t);
676
686
  break;
677
687
  case "nextMonth":
678
688
  a = ve(t);
679
689
  break;
680
690
  case "previousYear":
681
- a = $e(t);
691
+ a = _e(t);
682
692
  break;
683
693
  case "nextYear":
684
- a = ke(t);
694
+ a = be(t);
685
695
  break;
686
696
  }
687
- for (; this.disableDate(a) && !s; ) {
697
+ for (; this.disableDate(a) && !r; ) {
688
698
  switch (e) {
689
699
  case "previousDay":
690
700
  case "lastOfMonth":
@@ -710,31 +720,31 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
710
720
  case "lastOfMonth":
711
721
  case "previousYear":
712
722
  case "nextYear":
713
- s = a.getMonth() !== t.getMonth();
723
+ r = a.getMonth() !== t.getMonth();
714
724
  break;
715
725
  case "previousMonth":
716
- s = a.getMonth() !== t.getMonth() - 1;
726
+ r = a.getMonth() !== t.getMonth() - 1;
717
727
  break;
718
728
  case "nextMonth":
719
- s = a.getMonth() !== t.getMonth() + 1;
729
+ r = a.getMonth() !== t.getMonth() + 1;
720
730
  break;
721
731
  default:
722
- s = !_e(a, {
732
+ r = !me(a, {
723
733
  from: W(t, this.maxSearchDays),
724
734
  to: P(t, this.maxSearchDays)
725
735
  });
726
736
  break;
727
737
  }
728
738
  }
729
- return s ? t : a;
739
+ return r ? t : a;
730
740
  }, this.nextMonth = () => {
731
741
  this.updateCurrentDate(ve(this.currentDate));
732
742
  }, this.nextYear = () => {
733
- this.updateCurrentDate(ke(this.currentDate));
734
- }, this.previousMonth = () => {
735
743
  this.updateCurrentDate(be(this.currentDate));
736
- }, this.previousYear = () => {
744
+ }, this.previousMonth = () => {
737
745
  this.updateCurrentDate($e(this.currentDate));
746
+ }, this.previousYear = () => {
747
+ this.updateCurrentDate(_e(this.currentDate));
738
748
  }, this.showToday = () => {
739
749
  this.updateCurrentDate(/* @__PURE__ */ new Date());
740
750
  }, this.clear = () => {
@@ -745,28 +755,31 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
745
755
  const e = t.target.closest("[data-date]");
746
756
  if (!e)
747
757
  return;
748
- const a = S(new Date(e.dataset.date));
758
+ const a = C(new Date(e.dataset.date));
749
759
  this.updateCurrentDate(a), this.onSelectDate(a);
750
760
  }, this.onMonthSelect = (t) => {
751
- const e = +t.target.value - 1, a = this.currentDate.getDate(), s = new Date(this.currentDate.getFullYear(), e, 1), r = U(s).getDate(), i = Math.min(a, r), n = new Date(this.currentDate.getFullYear(), e, i);
752
- this.updateCurrentDate(n);
761
+ const e = +t.target.value - 1, a = this.currentDate.getDate(), r = new Date(this.currentDate.getFullYear(), e, 1), s = U(r).getDate(), n = Math.min(a, s), i = new Date(this.currentDate.getFullYear(), e, n);
762
+ this.updateCurrentDate(i);
753
763
  }, this.onYearSelect = (t) => {
754
764
  let e = +t.target.value;
755
765
  const a = t.target;
756
766
  isNaN(e) ? (e = (/* @__PURE__ */ new Date()).getFullYear(), a.value = String(e)) : e < 0 ? (e = 0, a.value = String(e)) : e > 9999 && (e = 9999, a.value = String(e));
757
- const s = this.currentDate.getDate(), r = this.currentDate.getMonth(), i = /* @__PURE__ */ new Date();
758
- i.setFullYear(e, r, 1);
759
- const n = U(i).getDate(), o = Math.min(s, n), c = /* @__PURE__ */ new Date();
760
- c.setFullYear(e, r, o), this.updateCurrentDate(c);
767
+ const r = this.currentDate.getDate(), s = this.currentDate.getMonth(), n = /* @__PURE__ */ new Date();
768
+ n.setFullYear(e, s, 1);
769
+ const i = U(n).getDate(), o = Math.min(r, i), c = /* @__PURE__ */ new Date();
770
+ c.setFullYear(e, s, o), this.updateCurrentDate(c);
761
771
  }, this.onKeyDown = (t) => {
762
772
  this.disabled || (t.code === "ArrowLeft" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousDay"), !0)) : t.code === "ArrowRight" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextDay"), !0)) : t.code === "ArrowUp" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousSameWeekDay"), !0)) : t.code === "ArrowDown" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextSameWeekDay"), !0)) : t.code === "PageUp" ? (t.preventDefault(), t.shiftKey ? this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousYear"), !0) : this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousMonth"), !0)) : t.code === "PageDown" ? (t.preventDefault(), t.shiftKey ? this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextYear"), !0) : this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextMonth"), !0)) : t.code === "Home" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "firstOfMonth"), !0)) : t.code === "End" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "lastOfMonth"), !0)) : (t.code === "Space" || t.code === "Enter") && (t.preventDefault(), this.onSelectDate(this.currentDate)));
763
773
  }, this.onMouseEnter = (t) => {
764
774
  if (this.disabled)
765
775
  return;
766
- const e = S(new Date(t.target.closest("td").dataset.date));
776
+ const e = C(new Date(t.target.closest("td").dataset.date));
767
777
  this.hoveredDate = e;
768
778
  }, this.onMouseLeave = () => {
769
779
  this.hoveredDate = void 0;
780
+ }, this.onFocus = (t) => {
781
+ const e = new Date(t.target.dataset.date);
782
+ w(e, this.currentDate) || this.updateCurrentDate(e);
770
783
  };
771
784
  }
772
785
  componentWillLoad() {
@@ -782,7 +795,7 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
782
795
  this.value = void 0, this.selectDate.emit(void 0);
783
796
  }
784
797
  watchStartDate() {
785
- this.currentDate = this.startDate ? S(new Date(this.startDate)) : /* @__PURE__ */ new Date();
798
+ this.currentDate = this.startDate ? C(new Date(this.startDate)) : /* @__PURE__ */ new Date();
786
799
  }
787
800
  watchValue() {
788
801
  this.value && (Array.isArray(this.value) ? this.currentDate = this.value.length > 1 && !this.goToRangeStartOnSelect ? this.value[1] : this.value[0] : this.value instanceof Date && (this.currentDate = this.value));
@@ -791,16 +804,16 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
791
804
  this.moveFocusAfterMonthChanged && (this.focusDate(this.currentDate), this.moveFocusAfterMonthChanged = !1);
792
805
  }
793
806
  updateWeekdays() {
794
- this.weekdays = Ft(this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek, this.locale);
807
+ this.weekdays = qt(this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek, this.locale);
795
808
  }
796
809
  getClassName(t) {
797
810
  return t ? `${this.elementClassName}__${t}` : this.elementClassName;
798
811
  }
799
812
  getCalendarRows() {
800
- const t = At(this.currentDate, !0, this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek), e = [];
813
+ const t = Ft(this.currentDate, !0, this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek), e = [];
801
814
  for (let a = 0; a < t.length; a += 7) {
802
- const s = t.slice(a, a + 7);
803
- e.push(s);
815
+ const r = t.slice(a, a + 7);
816
+ e.push(r);
804
817
  }
805
818
  return e;
806
819
  }
@@ -826,15 +839,15 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
826
839
  }
827
840
  focusDate(t) {
828
841
  var e;
829
- (e = this.el.querySelector(`[data-date="${x(t)}"]`)) === null || e === void 0 || e.focus();
842
+ (e = this.el.querySelector(`[data-date="${S(t)}"]`)) === null || e === void 0 || e.focus();
830
843
  }
831
844
  updateCurrentDate(t, e) {
832
- const a = t.getMonth(), s = t.getFullYear();
833
- if (s > 9999 || s < 0)
845
+ const a = t.getMonth(), r = t.getFullYear();
846
+ if (r > 9999 || r < 0)
834
847
  return;
835
- (a !== this.currentDate.getMonth() || s !== this.currentDate.getFullYear()) && (this.changeMonth.emit({
836
- month: Ie(t),
837
- year: Fe(t),
848
+ (a !== this.currentDate.getMonth() || r !== this.currentDate.getFullYear()) && (this.changeMonth.emit({
849
+ month: Ae(t),
850
+ year: qe(t),
838
851
  day: t.getDate()
839
852
  }), e && (this.moveFocusAfterMonthChanged = !0)), this.currentDate = t, e && this.focusDate(this.currentDate);
840
853
  }
@@ -842,14 +855,14 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
842
855
  var e, a;
843
856
  if (!this.disableDate(t))
844
857
  if (this.isRangeValue(this.value)) {
845
- const s = ((e = this.value) === null || e === void 0 ? void 0 : e[0]) === void 0 || this.value.length === 2 ? [t] : [this.value[0], t];
846
- s.length === 2 && s[0] > s[1] && s.reverse();
847
- const r = s[1] === void 0 ? [x(s[0])] : [x(s[0]), x(s[1])];
848
- this.value = s, this.selectDate.emit(r);
858
+ const r = ((e = this.value) === null || e === void 0 ? void 0 : e[0]) === void 0 || this.value.length === 2 ? [t] : [this.value[0], t];
859
+ r.length === 2 && r[0] > r[1] && r.reverse();
860
+ const s = r[1] === void 0 ? [S(r[0])] : [S(r[0]), S(r[1])];
861
+ this.value = r, this.selectDate.emit(s);
849
862
  } else {
850
863
  if (((a = this.value) === null || a === void 0 ? void 0 : a.getTime()) === t.getTime())
851
864
  return;
852
- this.value = t, this.selectDate.emit(x(t));
865
+ this.value = t, this.selectDate.emit(S(t));
853
866
  }
854
867
  }
855
868
  // @ts-ignore
@@ -858,20 +871,20 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
858
871
  }
859
872
  render() {
860
873
  const t = this.showTodayButton || this.showClearButton;
861
- return h(De, null, h("div", { "aria-disabled": String(this.disabled), "aria-label": this.labels.picker, class: {
874
+ return h(xe, null, h("div", { "aria-disabled": String(this.disabled), "aria-label": this.labels.picker, class: {
862
875
  [this.getClassName()]: !0,
863
876
  [`${this.getClassName()}--disabled`]: this.disabled
864
- }, role: "group" }, h("div", { class: this.getClassName("header") }, h("span", { "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle()), this.showYearStepper && h("button", { "aria-label": this.labels.previousYearButton, class: this.getClassName("previous-year-button"), disabled: this.disabled, innerHTML: this.previousYearButtonContent || void 0, onClick: this.previousYear, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "11 17 6 12 11 7" }), h("polyline", { points: "18 17 13 12 18 7" }))), this.showMonthStepper && h("button", { "aria-label": this.labels.previousMonthButton, class: this.getClassName("previous-month-button"), disabled: this.disabled, innerHTML: this.previousMonthButtonContent || void 0, onClick: this.previousMonth, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "15 18 9 12 15 6" }))), h("span", { class: this.getClassName("current-month") }, h("select", { title: this.labels.monthSelect, "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), disabled: this.disabled, name: "month", onChange: this.onMonthSelect }, It(this.locale).map((e, a) => h("option", { key: e, selected: this.currentDate.getMonth() === a, value: a + 1 }, e))), h("input", { title: this.labels.yearSelect, "aria-label": this.labels.yearSelect, class: this.getClassName("year-select"), disabled: this.disabled, max: 9999, maxLength: 4, min: 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && h("button", { "aria-label": this.labels.nextMonthButton, class: this.getClassName("next-month-button"), disabled: this.disabled, innerHTML: this.nextMonthButtonContent || void 0, onClick: this.nextMonth, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "9 18 15 12 9 6" }))), this.showYearStepper && h("button", { "aria-label": this.labels.nextYearButton, class: this.getClassName("next-year-button"), disabled: this.disabled, innerHTML: this.nextYearButtonContent || void 0, onClick: this.nextYear, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "13 17 18 12 13 7" }), h("polyline", { points: "6 17 11 12 6 7" })))), h("div", { class: this.getClassName("body") }, h("table", { class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid" }, h("thead", { class: this.getClassName("calendar-header") }, h("tr", { class: this.getClassName("weekday-row") }, this.weekdays.map((e) => h("th", { "aria-label": e[1], abbr: e[1], class: this.getClassName("weekday"), key: e[0], scope: "col" }, h("span", null, e[0]))))), h("tbody", null, this.getCalendarRows().map((e) => {
877
+ }, role: "group" }, h("div", { class: this.getClassName("header") }, h("span", { "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle()), this.showYearStepper && h("button", { "aria-label": this.labels.previousYearButton, class: this.getClassName("previous-year-button"), disabled: this.disabled, innerHTML: this.previousYearButtonContent || void 0, onClick: this.previousYear, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "11 17 6 12 11 7" }), h("polyline", { points: "18 17 13 12 18 7" }))), this.showMonthStepper && h("button", { "aria-label": this.labels.previousMonthButton, class: this.getClassName("previous-month-button"), disabled: this.disabled, innerHTML: this.previousMonthButtonContent || void 0, onClick: this.previousMonth, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "15 18 9 12 15 6" }))), h("span", { class: this.getClassName("current-month") }, h("select", { title: this.labels.monthSelect, "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), disabled: this.disabled, name: "month", onChange: this.onMonthSelect }, At(this.locale).map((e, a) => h("option", { key: e, selected: this.currentDate.getMonth() === a, value: a + 1 }, e))), h("input", { title: this.labels.yearSelect, "aria-label": this.labels.yearSelect, class: this.getClassName("year-select"), disabled: this.disabled, max: 9999, maxLength: 4, min: 1, name: "year", onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && h("button", { "aria-label": this.labels.nextMonthButton, class: this.getClassName("next-month-button"), disabled: this.disabled, innerHTML: this.nextMonthButtonContent || void 0, onClick: this.nextMonth, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "9 18 15 12 9 6" }))), this.showYearStepper && h("button", { "aria-label": this.labels.nextYearButton, class: this.getClassName("next-year-button"), disabled: this.disabled, innerHTML: this.nextYearButtonContent || void 0, onClick: this.nextYear, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "13 17 18 12 13 7" }), h("polyline", { points: "6 17 11 12 6 7" })))), h("div", { class: this.getClassName("body") }, h("table", { class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid" }, h("thead", { class: this.getClassName("calendar-header") }, h("tr", { class: this.getClassName("weekday-row") }, this.weekdays.map((e) => h("th", { "aria-label": e[1], abbr: e[1], class: this.getClassName("weekday"), key: e[0], scope: "col" }, h("span", null, e[0]))))), h("tbody", null, this.getCalendarRows().map((e) => {
865
878
  const a = `row-${e[0].getMonth()}-${e[0].getDate()}`;
866
- return h("tr", { class: this.getClassName("calendar-row"), key: a }, e.map((s) => {
867
- var r, i, n, o, c;
868
- const l = w(s, this.currentDate), u = s.getMonth() !== this.currentDate.getMonth(), d = Array.isArray(this.value) ? w(s, this.value[0]) || w(s, this.value[1]) : w(s, this.value), p = this.isRangeValue ? _e(s, {
869
- from: (r = this.value) === null || r === void 0 ? void 0 : r[0],
870
- to: ((i = this.value) === null || i === void 0 ? void 0 : i[1]) || this.hoveredDate || this.currentDate
871
- }) : !1, y = !((n = this.value) === null || n === void 0) && n[0] ? [
879
+ return h("tr", { class: this.getClassName("calendar-row"), key: a }, e.map((r) => {
880
+ var s, n, i, o, c;
881
+ const l = w(r, this.currentDate), u = r.getMonth() !== this.currentDate.getMonth(), d = Array.isArray(this.value) ? w(r, this.value[0]) || w(r, this.value[1]) : w(r, this.value), p = this.isRangeValue ? me(r, {
882
+ from: (s = this.value) === null || s === void 0 ? void 0 : s[0],
883
+ to: ((n = this.value) === null || n === void 0 ? void 0 : n[1]) || this.hoveredDate || this.currentDate
884
+ }) : !1, g = !((i = this.value) === null || i === void 0) && i[0] ? [
872
885
  (o = this.value) === null || o === void 0 ? void 0 : o[0],
873
886
  ((c = this.value) === null || c === void 0 ? void 0 : c[1]) || this.hoveredDate
874
- ].sort((Ue, We) => Ue - We) : [], $ = this.range && w(y[0], s), D = this.range && w(y[1], s), T = w(s, /* @__PURE__ */ new Date()), L = this.disableDate(s), Ye = `cell-${s.getMonth()}-${s.getDate()}`, qe = {
887
+ ].sort((We, ze) => We - ze) : [], $ = this.range && w(g[0], r), x = this.range && w(g[1], r), T = w(r, /* @__PURE__ */ new Date()), L = this.disableDate(r), Ye = `cell-${r.getMonth()}-${r.getDate()}`, Pe = {
875
888
  [this.getClassName("date")]: !0,
876
889
  [this.getClassName("date--current")]: l,
877
890
  [this.getClassName("date--disabled")]: L,
@@ -880,12 +893,13 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
880
893
  [this.getClassName("date--selected")]: d,
881
894
  [this.getClassName("date--in-range")]: p,
882
895
  [this.getClassName("date--start")]: $,
883
- [this.getClassName("date--end")]: D
884
- }, Pe = d ? "strong" : T ? "em" : "span";
885
- return h("td", { "aria-disabled": String(L), "aria-selected": d ? "true" : void 0, "aria-current": T ? "date" : void 0, class: qe, "data-date": x(s), key: Ye, onClick: this.onClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "gridcell", tabIndex: w(s, this.currentDate) && !this.disabled ? 0 : -1 }, h(Pe, { "aria-hidden": "true" }, s.getDate()), h("span", { class: "visually-hidden" }, Intl.DateTimeFormat(this.locale, {
896
+ [this.getClassName("date--end")]: x
897
+ }, Ue = d ? "strong" : T ? "em" : "span";
898
+ return h("td", { "aria-disabled": String(L), "aria-selected": d ? "true" : void 0, "aria-current": T ? "date" : d ? "true" : void 0, class: Pe, "data-date": S(r), key: Ye, onClick: this.onClick, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onFocus: this.onFocus, role: "gridcell", tabIndex: w(r, this.currentDate) && !this.disabled ? 0 : -1 }, h(Ue, { "aria-hidden": "true" }, r.getDate()), h("span", { class: "visually-hidden" }, Intl.DateTimeFormat(this.locale, {
886
899
  day: "numeric",
887
- month: "long"
888
- }).format(s)));
900
+ month: "long",
901
+ year: "numeric"
902
+ }).format(r)));
889
903
  }));
890
904
  })))), t && h("div", { class: this.getClassName("footer") }, this.showTodayButton && h("button", { class: this.getClassName("today-button"), disabled: this.disabled, innerHTML: this.todayButtonContent || void 0, onClick: this.showToday, type: "button" }, this.labels.todayButton), this.showClearButton && h("button", { class: this.getClassName("clear-button"), disabled: this.disabled, innerHTML: this.clearButtonContent || void 0, onClick: this.clear, type: "button" }, this.labels.clearButton))));
891
905
  }
@@ -929,26 +943,29 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
929
943
  currentDate: [32],
930
944
  hoveredDate: [32],
931
945
  weekdays: [32]
932
- }]), Ut = Pt;
933
- var Wt = Object.defineProperty, v = (t, e, a, s) => {
934
- for (var r = void 0, i = t.length - 1, n; i >= 0; i--)
935
- (n = t[i]) && (r = n(e, a, r) || r);
936
- return r && Wt(e, a, r), r;
946
+ }]), Wt = Ut;
947
+ var zt = Object.defineProperty, y = (t, e, a, r) => {
948
+ for (var s = void 0, n = t.length - 1, i; n >= 0; n--)
949
+ (i = t[n]) && (s = i(e, a, s) || s);
950
+ return s && zt(e, a, s), s;
937
951
  };
938
- customElements.get("wc-datepicker") || customElements.define("wc-datepicker", Ut);
939
- let zt = 0;
940
- var C;
941
- const f = (C = class extends ze {
952
+ customElements.get("wc-datepicker") || customElements.define("wc-datepicker", Wt);
953
+ let jt = 0;
954
+ var D;
955
+ const f = (D = class extends se {
942
956
  // allows use of elementInternals' API
943
957
  constructor() {
944
- super(), this.id = "", this.name = "", this.width = "md", this.hideTodayButton = !1, this.hideClearButton = !1, this.disabled = !1, this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.form = null, this.tooltip = "", this.type = "date", this.label = "", this.description = "", this.startDate = "", this.inverted = !1, this.value = void 0, this._hasUserInteracted = !1, this._internals = this.attachInternals();
958
+ super(), this.id = "", this.name = "", this.width = "md", this.hideTodayButton = !1, this.hideClearButton = !1, this.disabled = !1, this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.form = null, this.tooltip = "", this.type = "date", this.label = "", this.description = "", this.startDate = "", this.inverted = !1, this.value = void 0, this.datepickerIsOpen = !1, this._hasUserInteracted = !1, this._onKeydownEsc = (e) => {
959
+ if (e.key !== "Escape" || e.code !== "Escape" || !this.datepickerIsOpen) return;
960
+ e.preventDefault(), e.stopPropagation(), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active"), this.datepickerIsOpen = !1, this.removeEventListener("keydown", this._handleFocusTrap), this.shadowRoot?.querySelector("input")?.focus();
961
+ }, this._internals = this.attachInternals();
945
962
  }
946
963
  // Generate a unique ID if one is not provided
947
964
  connectedCallback() {
948
- super.connectedCallback(), this.id || (this.id = `nys-datepicker-${Date.now()}-${zt++}`), this.addEventListener("invalid", this._handleInvalid), this.addEventListener("focusout", this._handleBlur);
965
+ super.connectedCallback(), this.id || (this.id = `nys-datepicker-${Date.now()}-${jt++}`), this.addEventListener("invalid", this._handleInvalid), this.addEventListener("focusout", this._handleBlur), this.addEventListener("keydown", this._onKeydownEsc);
949
966
  }
950
967
  disconnectedCallback() {
951
- super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid), this.removeEventListener("focusout", this._handleBlur);
968
+ super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid), this.removeEventListener("focusout", this._handleBlur), this.removeEventListener("keydown", this._onKeydownEsc);
952
969
  }
953
970
  async firstUpdated() {
954
971
  this._setValue(this.value), !(this._shouldUseNativeDatepicker() || !await this._whenWcDatepickerReady()) && (setTimeout(() => this._replaceButtonSVG(), 0), setTimeout(() => this._addMonthDropdownIcon(), 0), setTimeout(() => this._handleDateChange(), 0), setTimeout(() => this._onDocumentClick(), 0));
@@ -978,16 +995,16 @@ const f = (C = class extends ze {
978
995
  this.value = void 0, this._internals.setFormValue(""), this._manageRequire();
979
996
  return;
980
997
  }
981
- const a = e instanceof Date ? e : this._parseLocalDate(e), s = [
998
+ const a = e instanceof Date ? e : this._parseLocalDate(e), r = [
982
999
  a.getFullYear(),
983
1000
  String(a.getMonth() + 1).padStart(2, "0"),
984
1001
  String(a.getDate()).padStart(2, "0")
985
1002
  ].join("-");
986
- this.value = a, this._internals.setFormValue(s);
987
- const r = this.shadowRoot?.querySelector("input");
988
- r && (r.value = s);
989
- const i = this.shadowRoot?.querySelector("wc-datepicker");
990
- i && (i.value = a), this._manageRequire();
1003
+ this.value = a, this._internals.setFormValue(r);
1004
+ const s = this.shadowRoot?.querySelector("input");
1005
+ s && (s.value = r);
1006
+ const n = this.shadowRoot?.querySelector("wc-datepicker");
1007
+ n && (n.value = a), this._manageRequire();
991
1008
  }
992
1009
  // Called to internally set the initial internalElement required flag.
993
1010
  _manageRequire() {
@@ -1034,9 +1051,9 @@ const f = (C = class extends ze {
1034
1051
  e.preventDefault(), this._hasUserInteracted = !0, this._validate();
1035
1052
  const a = this.shadowRoot?.querySelector("input");
1036
1053
  if (a) {
1037
- const s = this._internals.form;
1038
- s ? Array.from(s.elements).find(
1039
- (n) => typeof n.checkValidity == "function" && !n.checkValidity()
1054
+ const r = this._internals.form;
1055
+ r ? Array.from(r.elements).find(
1056
+ (i) => typeof i.checkValidity == "function" && !i.checkValidity()
1040
1057
  ) === this && a.focus() : a.focus();
1041
1058
  }
1042
1059
  }
@@ -1053,10 +1070,10 @@ const f = (C = class extends ze {
1053
1070
  if (!e) return;
1054
1071
  const a = e.querySelector(
1055
1072
  ".wc-datepicker__next-month-button"
1056
- ), s = e.querySelector(
1073
+ ), r = e.querySelector(
1057
1074
  ".wc-datepicker__previous-month-button"
1058
1075
  );
1059
- !a || !s || (s.innerHTML = `
1076
+ !a || !r || (r.innerHTML = `
1060
1077
  <nys-icon name="arrow_back" size="18"></nys-icon>
1061
1078
  `, a.innerHTML = `
1062
1079
  <nys-icon name="arrow_forward" size="18"></nys-icon>
@@ -1069,68 +1086,95 @@ const f = (C = class extends ze {
1069
1086
  ".wc-datepicker__month-select"
1070
1087
  );
1071
1088
  if (a && !a.parentElement?.classList.contains("month-wrapper")) {
1072
- const s = document.createElement("span");
1073
- s.className = "month-wrapper", a.parentNode?.insertBefore(s, a), s.appendChild(a);
1074
- const r = document.createElement("nys-icon");
1075
- r.setAttribute("name", "chevron_down"), r.setAttribute("id", "wc-month-dropdown-icon"), r.setAttribute("size", "20"), s.appendChild(r);
1089
+ const r = document.createElement("span");
1090
+ r.className = "month-wrapper", a.parentNode?.insertBefore(r, a), r.appendChild(a);
1091
+ const s = document.createElement("nys-icon");
1092
+ s.setAttribute("name", "chevron_down"), s.setAttribute("id", "wc-month-dropdown-icon"), s.setAttribute("size", "20"), r.appendChild(s);
1076
1093
  }
1077
1094
  }
1078
1095
  // Creates a Date at local midnight to avoid UTC timezone shifting
1079
1096
  _parseLocalDate(e) {
1080
- const [a, s, r] = e.split("-").map(Number);
1081
- return new Date(a, s - 1, r);
1097
+ const [a, r, s] = e.split("-").map(Number);
1098
+ return new Date(a, r - 1, s);
1099
+ }
1100
+ _setTodayDate() {
1101
+ const e = /* @__PURE__ */ new Date();
1102
+ e.setHours(0, 0, 0, 0), this._setValue(e), this._setFocusOnTodayDate();
1103
+ }
1104
+ async _setFocusOnTodayDate(e = !1) {
1105
+ const a = /* @__PURE__ */ new Date();
1106
+ a.setHours(0, 0, 0, 0);
1107
+ const r = [
1108
+ a.getFullYear(),
1109
+ String(a.getMonth() + 1).padStart(2, "0"),
1110
+ String(a.getDate()).padStart(2, "0")
1111
+ ].join("-"), s = this.shadowRoot?.querySelector("wc-datepicker");
1112
+ if (!s) return;
1113
+ const n = s.querySelector(
1114
+ `td[data-date="${r}"]`
1115
+ );
1116
+ n && (e || n.focus());
1117
+ }
1118
+ _dispatchInputEvent() {
1119
+ this.dispatchEvent(
1120
+ new CustomEvent("nys-input", {
1121
+ detail: { id: this.id, value: this.value },
1122
+ bubbles: !0,
1123
+ composed: !0
1124
+ })
1125
+ );
1082
1126
  }
1083
1127
  /**
1084
1128
  * Event Handlers
1085
1129
  * --------------------------------------------------------------------------
1086
1130
  */
1087
1131
  _handleInputKeydown(e) {
1088
- this.disabled || this._shouldUseNativeDatepicker() || (e.key == " " || e.code == "Space") && (e.preventDefault(), this._openDatepicker());
1132
+ this.disabled || this._shouldUseNativeDatepicker() || ((e.key == " " || e.code == "Space") && (e.preventDefault(), this._openDatepicker()), (e.key === "Escape" || e.code === "Escape") && (e.preventDefault(), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active")));
1089
1133
  }
1090
1134
  _handleBlur(e) {
1091
1135
  const a = e.relatedTarget;
1092
1136
  if (a && (this.contains(a) || this.shadowRoot?.contains(a))) return;
1093
- this._hasUserInteracted || (this._hasUserInteracted = !0), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active"), this._validate(), this.dispatchEvent(new Event("nys-blur"));
1137
+ this._hasUserInteracted || (this._hasUserInteracted = !0), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active"), this.datepickerIsOpen = !1, this._validate(), this.dispatchEvent(new Event("nys-blur")), this.removeEventListener("keydown", this._handleFocusTrap);
1094
1138
  }
1095
1139
  // For when users click outside of the datepicker, we remove the calendar popup
1096
1140
  _onDocumentClick() {
1097
1141
  if (this._shouldUseNativeDatepicker()) return;
1098
1142
  const e = (a) => {
1099
- const s = a.composedPath(), r = this.shadowRoot?.querySelector(
1143
+ const r = a.composedPath(), s = this.shadowRoot?.querySelector(
1100
1144
  ".nys-datepicker--input-container"
1101
- ), i = this.shadowRoot?.querySelector(
1145
+ ), n = this.shadowRoot?.querySelector(
1102
1146
  ".wc-datepicker--container"
1103
- ), n = this.shadowRoot?.querySelector("wc-datepicker");
1104
- r && s.includes(r) || i && s.includes(i) || n && s.includes(n) || n?.classList.remove("active");
1147
+ ), i = this.shadowRoot?.querySelector("wc-datepicker");
1148
+ s && r.includes(s) || n && r.includes(n) || i && r.includes(i) || i?.classList.remove("active");
1105
1149
  };
1106
1150
  document.addEventListener("click", e);
1107
1151
  }
1108
1152
  _toggleDatepicker() {
1109
1153
  if (this.disabled) return;
1110
1154
  if (this._shouldUseNativeDatepicker()) {
1111
- const a = this.shadowRoot?.querySelector(
1155
+ const r = this.shadowRoot?.querySelector(
1112
1156
  "input"
1113
1157
  );
1114
- a && a.focus();
1158
+ r && r.focus();
1115
1159
  return;
1116
1160
  }
1117
- this.shadowRoot?.querySelector("wc-datepicker")?.classList.toggle("active");
1161
+ const a = this.shadowRoot?.querySelector("wc-datepicker")?.classList.toggle("active");
1162
+ this.datepickerIsOpen = !!a, this.value || this._setFocusOnTodayDate(), this.addEventListener("keydown", this._handleFocusTrap);
1118
1163
  }
1119
1164
  _openDatepicker() {
1120
1165
  if (this.disabled || this._shouldUseNativeDatepicker()) return;
1121
- this.shadowRoot?.querySelector("wc-datepicker")?.classList.add("active");
1166
+ const e = this.shadowRoot?.querySelector("wc-datepicker");
1167
+ e && (this.value || this._setFocusOnTodayDate(!0), e?.classList.add("active"), this.datepickerIsOpen = !0, this.addEventListener("keydown", this._handleFocusTrap));
1122
1168
  }
1123
1169
  _handleDateChange() {
1124
1170
  const e = this.shadowRoot?.querySelector("wc-datepicker");
1125
1171
  e && e.addEventListener("selectDate", (a) => {
1126
- const s = a.detail, r = this._parseLocalDate(s);
1127
- this._setValue(r), this._validate(), e.classList.remove("active");
1172
+ const r = a.detail, s = this._parseLocalDate(r);
1173
+ this._setValue(s), this._validate(), this._dispatchInputEvent(), e.classList.remove("active"), this.datepickerIsOpen = !1, this.removeEventListener("keydown", this._handleFocusTrap);
1128
1174
  });
1129
1175
  }
1130
1176
  _handleTodayClick() {
1131
- if (this.disabled) return;
1132
- const e = /* @__PURE__ */ new Date();
1133
- e.setHours(0, 0, 0, 0), this._setValue(e), this._hasUserInteracted && this._validate();
1177
+ this.disabled || (this._setTodayDate(), this._hasUserInteracted && this._validate());
1134
1178
  }
1135
1179
  _handleClearClick() {
1136
1180
  if (this.disabled) return;
@@ -1141,18 +1185,38 @@ const f = (C = class extends ze {
1141
1185
  _handleInputChange(e) {
1142
1186
  const a = e.target;
1143
1187
  if (!a) return;
1144
- const s = this._getValidDateFromInput(a.value);
1145
- s && (this._setValue(s), this._hasUserInteracted && this._validate(), this.dispatchEvent(
1146
- new CustomEvent("nys-input", {
1147
- detail: { id: this.id, value: this.value },
1148
- bubbles: !0,
1149
- composed: !0
1150
- })
1151
- ));
1188
+ const r = this._getValidDateFromInput(a.value);
1189
+ if (!r) {
1190
+ a.value || (this.value = void 0, this._internals.setFormValue(""), this._hasUserInteracted && this._validate());
1191
+ return;
1192
+ }
1193
+ this._setValue(r), this._hasUserInteracted && this._validate(), this._dispatchInputEvent();
1152
1194
  }
1153
1195
  _getValidDateFromInput(e) {
1154
- const s = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
1155
- return !s || Number(s[1]) < 1e3 ? null : this._parseLocalDate(e);
1196
+ const r = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
1197
+ return !r || Number(r[1]) < 1e3 ? null : this._parseLocalDate(e);
1198
+ }
1199
+ _handleFocusTrap(e) {
1200
+ if (!this.datepickerIsOpen || e.key !== "Tab") return;
1201
+ const a = this.shadowRoot?.querySelector(
1202
+ ".wc-datepicker--container"
1203
+ );
1204
+ if (!a) return;
1205
+ const r = [
1206
+ "button:not([disabled])",
1207
+ "input:not([disabled])",
1208
+ "select:not([disabled])",
1209
+ "[tabindex]:not([tabindex='-1'])"
1210
+ ], s = [];
1211
+ if (a.querySelectorAll("nys-button").forEach((c) => {
1212
+ s.push(c);
1213
+ }), s.push(
1214
+ ...Array.from(
1215
+ a.querySelectorAll(r.join(","))
1216
+ ).filter((c) => c.offsetParent !== null)
1217
+ ), s.length === 0) return;
1218
+ const n = s[0], i = s[s.length - 1], o = this.shadowRoot?.activeElement;
1219
+ e.shiftKey ? o === n && (e.preventDefault(), i.focus()) : o === i && (e.preventDefault(), n.focus());
1156
1220
  }
1157
1221
  _isSafari() {
1158
1222
  const e = navigator.userAgent;
@@ -1177,9 +1241,9 @@ const f = (C = class extends ze {
1177
1241
  }
1178
1242
  render() {
1179
1243
  const e = this._shouldUseNativeDatepicker();
1180
- return O` <div class="nys-datepicker--container">
1244
+ return N` <div class="nys-datepicker--container">
1181
1245
  <nys-label
1182
- for=${this.id + "--native"}
1246
+ for=${this.id}
1183
1247
  label=${this.label}
1184
1248
  description=${this.description}
1185
1249
  flag=${this.required ? "required" : this.optional ? "optional" : ""}
@@ -1190,28 +1254,31 @@ const f = (C = class extends ze {
1190
1254
  class="nys-datepicker--input-container ${this.disabled ? "disabled" : ""}"
1191
1255
  >
1192
1256
  <input
1193
- id="nys-datepicker--input"
1257
+ id=${this.id}
1258
+ class="nys-datepicker--input"
1194
1259
  type="date"
1195
1260
  max="9999-12-31"
1196
1261
  ?required=${this.required}
1197
1262
  .value=${this.value instanceof Date ? this.value.toISOString().split("T")[0] : this.value || ""}
1198
1263
  ?disabled=${this.disabled}
1199
- aria-disabled=${A(this.disabled ? "true" : void 0)}
1200
- aria-required=${A(this.required ? "true" : void 0)}
1201
- aria-label=${A(this.label || void 0)}
1202
- aria-description=${A(this.description || void 0)}
1264
+ aria-label=${q(this.label || void 0)}
1265
+ aria-disabled=${q(this.disabled ? "true" : void 0)}
1266
+ aria-required=${q(this.required ? "true" : void 0)}
1203
1267
  @click=${this._openDatepicker}
1204
1268
  @input=${this._handleInputChange}
1205
1269
  @blur=${this._handleBlur}
1206
1270
  @keydown=${this._handleInputKeydown}
1207
1271
  />
1208
- ${e ? null : O`
1272
+ ${e ? null : N`
1209
1273
  <button
1210
1274
  id="calendar-button"
1211
1275
  @click=${this._toggleDatepicker}
1212
1276
  tabindex=${this.disabled ? "-1" : "0"}
1213
1277
  ?disabled=${this.disabled}
1214
1278
  aria-label="Open calendar"
1279
+ aria-haspopup="dialog"
1280
+ aria-controls="wc-datepicker-popup"
1281
+ aria-expanded=${this.datepickerIsOpen ? "true" : "false"}
1215
1282
  >
1216
1283
  <nys-icon name="calendar_month" size="24"></nys-icon>
1217
1284
  </button>
@@ -1220,13 +1287,16 @@ const f = (C = class extends ze {
1220
1287
 
1221
1288
  <div class="wc-datepicker--container">
1222
1289
  <wc-datepicker
1290
+ id="wc-datepicker-popup"
1223
1291
  .value=${this.value instanceof Date ? this.value : this.value ? this._parseLocalDate(this.value) : void 0}
1224
1292
  ?disabled=${this.disabled}
1225
- start-date=${A(this.startDate ? this.startDate : void 0)}
1293
+ start-date=${q(this.startDate ? this.startDate : void 0)}
1294
+ role="dialog"
1295
+ aria-modal=${this.datepickerIsOpen ? "true" : "false"}
1226
1296
  >
1227
- ${!this.hideTodayButton || !this.hideClearButton ? O`
1297
+ ${!this.hideTodayButton || !this.hideClearButton ? N`
1228
1298
  <div class="wc-datepicker--button-container">
1229
- ${this.hideTodayButton ? null : O`
1299
+ ${this.hideTodayButton ? null : N`
1230
1300
  <nys-button
1231
1301
  label="Today"
1232
1302
  size="sm"
@@ -1236,7 +1306,7 @@ const f = (C = class extends ze {
1236
1306
  @nys-click=${this._handleTodayClick}
1237
1307
  ></nys-button>
1238
1308
  `}
1239
- ${this.hideClearButton ? null : O`
1309
+ ${this.hideClearButton ? null : N`
1240
1310
  <nys-button
1241
1311
  label="Clear"
1242
1312
  size="sm"
@@ -1256,60 +1326,63 @@ const f = (C = class extends ze {
1256
1326
  errorMessage=${this._internals.validationMessage || this.errorMessage}
1257
1327
  ></nys-errormessage>`;
1258
1328
  }
1259
- }, C.styles = je(He), C.formAssociated = !0, C);
1260
- v([
1261
- g({ type: String, reflect: !0 })
1329
+ }, D.styles = je(Ke), D.shadowRootOptions = {
1330
+ ...se.shadowRootOptions,
1331
+ delegatesFocus: !0
1332
+ }, D.formAssociated = !0, D);
1333
+ y([
1334
+ k({ type: String, reflect: !0 })
1262
1335
  ], f.prototype, "id");
1263
- v([
1264
- g({ type: String, reflect: !0 })
1336
+ y([
1337
+ k({ type: String, reflect: !0 })
1265
1338
  ], f.prototype, "name");
1266
- v([
1267
- g({ type: String, reflect: !0 })
1339
+ y([
1340
+ k({ type: String, reflect: !0 })
1268
1341
  ], f.prototype, "width");
1269
- v([
1270
- g({ type: Boolean })
1342
+ y([
1343
+ k({ type: Boolean })
1271
1344
  ], f.prototype, "hideTodayButton");
1272
- v([
1273
- g({ type: Boolean })
1345
+ y([
1346
+ k({ type: Boolean })
1274
1347
  ], f.prototype, "hideClearButton");
1275
- v([
1276
- g({ type: Boolean, reflect: !0 })
1348
+ y([
1349
+ k({ type: Boolean, reflect: !0 })
1277
1350
  ], f.prototype, "disabled");
1278
- v([
1279
- g({ type: Boolean, reflect: !0 })
1351
+ y([
1352
+ k({ type: Boolean, reflect: !0 })
1280
1353
  ], f.prototype, "required");
1281
- v([
1282
- g({ type: Boolean, reflect: !0 })
1354
+ y([
1355
+ k({ type: Boolean, reflect: !0 })
1283
1356
  ], f.prototype, "optional");
1284
- v([
1285
- g({ type: Boolean, reflect: !0 })
1357
+ y([
1358
+ k({ type: Boolean, reflect: !0 })
1286
1359
  ], f.prototype, "showError");
1287
- v([
1288
- g({ type: String })
1360
+ y([
1361
+ k({ type: String })
1289
1362
  ], f.prototype, "errorMessage");
1290
- v([
1291
- g({ type: String, reflect: !0 })
1363
+ y([
1364
+ k({ type: String, reflect: !0 })
1292
1365
  ], f.prototype, "form");
1293
- v([
1294
- g({ type: String })
1366
+ y([
1367
+ k({ type: String })
1295
1368
  ], f.prototype, "tooltip");
1296
- v([
1297
- g({ type: String })
1369
+ y([
1370
+ k({ type: String })
1298
1371
  ], f.prototype, "type");
1299
- v([
1300
- g({ type: String })
1372
+ y([
1373
+ k({ type: String })
1301
1374
  ], f.prototype, "label");
1302
- v([
1303
- g({ type: String })
1375
+ y([
1376
+ k({ type: String })
1304
1377
  ], f.prototype, "description");
1305
- v([
1306
- g({ type: String })
1378
+ y([
1379
+ k({ type: String })
1307
1380
  ], f.prototype, "startDate");
1308
- v([
1309
- g({ type: Boolean, reflect: !0 })
1381
+ y([
1382
+ k({ type: Boolean, reflect: !0 })
1310
1383
  ], f.prototype, "inverted");
1311
- v([
1312
- g({
1384
+ y([
1385
+ k({
1313
1386
  type: Object,
1314
1387
  converter: {
1315
1388
  fromAttribute: (t) => t ? f.prototype._parseLocalDate(t) : void 0,
@@ -1317,9 +1390,12 @@ v([
1317
1390
  }
1318
1391
  })
1319
1392
  ], f.prototype, "value");
1320
- let jt = f;
1321
- customElements.get("nys-datepicker") || customElements.define("nys-datepicker", jt);
1393
+ y([
1394
+ He()
1395
+ ], f.prototype, "datepickerIsOpen");
1396
+ let Ht = f;
1397
+ customElements.get("nys-datepicker") || customElements.define("nys-datepicker", Ht);
1322
1398
  export {
1323
- jt as NysDatepicker
1399
+ Ht as NysDatepicker
1324
1400
  };
1325
1401
  //# sourceMappingURL=nys-datepicker.js.map