@vonage/vivid 5.4.0 → 5.5.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.
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +2 -2
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +73 -204
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +16 -16
- package/bundled/definition19.js +87 -84
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +1 -1
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -35
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +172 -144
- package/color-picker/definition.cjs +208 -112
- package/color-picker/definition.js +208 -112
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +49 -0
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/icon/icon.d.ts +1 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +16 -3
- package/locales/de-DE.js +16 -3
- package/locales/en-GB.cjs +17 -4
- package/locales/en-GB.js +17 -4
- package/locales/en-US.cjs +17 -4
- package/locales/en-US.js +17 -4
- package/locales/ja-JP.cjs +16 -3
- package/locales/ja-JP.js +16 -3
- package/locales/zh-CN.cjs +15 -2
- package/locales/zh-CN.js +15 -2
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +3 -3
- package/select/definition.cjs +6 -3
- package/select/definition.js +6 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +8 -6
- package/simple-color-picker/definition.js +8 -6
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +34 -14
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +2 -2
- package/tooltip/definition.js +2 -2
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +1 -1
- package/unbundled/calendar-picker.template.js +1 -1
- package/unbundled/picker-field.template.cjs +2 -35
- package/unbundled/picker-field.template.js +2 -34
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h as S, V as N, o as h, d as H, a as f, n as C, O as R, E as q, U as V, v as j } from "./vivid-element.js";
|
|
2
|
-
import {
|
|
3
|
-
import { S as
|
|
4
|
-
import { s as
|
|
2
|
+
import { P as B } from "./picker-field.template.js";
|
|
3
|
+
import { S as z } from "./single-value-picker.js";
|
|
4
|
+
import { s as U } from "./scrollIntoView.js";
|
|
5
5
|
import { w as O } from "./when.js";
|
|
6
|
+
import { i as W } from "./trapped-focus.js";
|
|
6
7
|
import { r as K } from "./repeat.js";
|
|
7
8
|
import { c as G } from "./class-names.js";
|
|
8
9
|
import { L as J } from "./localized.js";
|
|
@@ -27,7 +28,7 @@ const w = (e) => {
|
|
|
27
28
|
seconds: s,
|
|
28
29
|
meridiem: i < 12 ? "AM" : "PM"
|
|
29
30
|
};
|
|
30
|
-
},
|
|
31
|
+
}, ye = (e, t) => e > t ? 1 : e < t ? -1 : 0, M = (e) => e % 12 || 12, X = (e, t) => e === "AM" && t < 12 || e === "PM" && t >= 12, Y = (e, t, o) => {
|
|
31
32
|
const r = [], i = e ? l(e).hours : 0, n = t ? l(t).hours : 23;
|
|
32
33
|
for (let s = i; s <= n; s++)
|
|
33
34
|
o && !X(o, s) || r.push({
|
|
@@ -158,11 +159,11 @@ const w = (e) => {
|
|
|
158
159
|
const i = e.shadowRoot.querySelector(
|
|
159
160
|
`#${t}-${o}`
|
|
160
161
|
);
|
|
161
|
-
i &&
|
|
162
|
+
i && U(i, i.parentElement, r);
|
|
162
163
|
}, ie = (e, t) => {
|
|
163
164
|
if (t.key === "Tab") {
|
|
164
165
|
const o = e.shadowRoot.querySelectorAll(".picker"), r = t.shiftKey ? o[0] : o[o.length - 1];
|
|
165
|
-
e.shadowRoot.activeElement !== r &&
|
|
166
|
+
e.shadowRoot.activeElement !== r && W(t), e._applyFocusedClass();
|
|
166
167
|
}
|
|
167
168
|
return !0;
|
|
168
169
|
}, L = (e, t) => {
|
|
@@ -288,7 +289,7 @@ v([
|
|
|
288
289
|
v([
|
|
289
290
|
h
|
|
290
291
|
], p.prototype, "max");
|
|
291
|
-
const ae = ':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}',
|
|
292
|
+
const ae = ':host{display:inline-block}.time-pickers{display:flex;overflow:hidden;justify-content:center;padding:4px;block-size:calc(28px * var(--_inline-time-picker-num-options-visible) + 4px * (var(--_inline-time-picker-num-options-visible) - 1));gap:4px}.time-pickers .picker-wrapper{position:relative;display:flex;flex-direction:column;border-radius:4px}.time-pickers .picker-wrapper.focused:has(.picker:focus-visible){--focus-stroke-gap-color: transparent;--focus-inset: -2px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.time-pickers .picker{position:relative;display:flex;overflow:hidden scroll;flex-direction:column;padding:0 4px;border-radius:4px;margin:0 -4px;gap:4px;inline-size:50px;list-style:none;scrollbar-width:none}@media (hover: hover){.time-pickers .picker:hover{scrollbar-width:auto}}.time-pickers .picker:after{display:block;flex-shrink:0;block-size:calc(28px * (var(--_inline-time-picker-num-options-visible) - 1) + 4px * (var(--_inline-time-picker-num-options-visible) - 1 - 1));content:""}.time-pickers .picker:focus-visible{outline:none}.time-pickers .option{--_connotation-color-primary: var(--vvd-time-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-time-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-time-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-time-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-time-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-time-picker-accent-pale, var(--vvd-color-neutral-300))}.time-pickers .option{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.time-pickers .option.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.time-pickers .option:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.time-pickers .option.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.time-pickers .option.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.time-pickers .option.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.time-pickers .option.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.time-pickers .option{display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:4px;background-color:var(--_appearance-color-fill);block-size:28px;color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);inline-size:50px}.time-pickers .picker-wrapper:not(.focused) .picker:focus-visible .option.selected{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}', $e = H(
|
|
292
293
|
"inline-time-picker",
|
|
293
294
|
p,
|
|
294
295
|
ne,
|
|
@@ -427,7 +428,7 @@ const F = {
|
|
|
427
428
|
}
|
|
428
429
|
};
|
|
429
430
|
class D extends de(
|
|
430
|
-
|
|
431
|
+
z(B)
|
|
431
432
|
) {
|
|
432
433
|
// --- Core ---
|
|
433
434
|
constructor() {
|
|
@@ -542,7 +543,7 @@ A([
|
|
|
542
543
|
A([
|
|
543
544
|
f({ converter: F })
|
|
544
545
|
], D.prototype, "max");
|
|
545
|
-
const
|
|
546
|
+
const we = (e, t) => {
|
|
546
547
|
const o = e.tagFor(p);
|
|
547
548
|
return S`
|
|
548
549
|
<${o}
|
|
@@ -565,9 +566,9 @@ const $e = (e, t) => {
|
|
|
565
566
|
export {
|
|
566
567
|
de as T,
|
|
567
568
|
F as V,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
we as a,
|
|
570
|
+
$e as b,
|
|
571
|
+
ye as c,
|
|
571
572
|
D as d,
|
|
572
573
|
le as f,
|
|
573
574
|
w as i,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=new WeakSet,u=s=>{c.add(s)},i=s=>{class r extends s{_trappedFocus(e,a){if(!c.has(e)&&e.key==="Tab"){const t=a(),o=t[0],n=t[t.length-1];if(e.shiftKey){if(this.shadowRoot.activeElement===o)return n.focus(),!0}else if(this.shadowRoot.activeElement===n)return o.focus(),!0}return!1}}return r};exports.TrappedFocus=i;exports.ignoreEventInFocusTraps=u;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const n = /* @__PURE__ */ new WeakSet(), l = (s) => {
|
|
2
|
+
n.add(s);
|
|
3
|
+
}, i = (s) => {
|
|
4
|
+
class c extends s {
|
|
5
|
+
/**
|
|
6
|
+
* @returns Whether focus was trapped.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
_trappedFocus(e, r) {
|
|
10
|
+
if (!n.has(e) && e.key === "Tab") {
|
|
11
|
+
const t = r(), o = t[0], a = t[t.length - 1];
|
|
12
|
+
if (e.shiftKey) {
|
|
13
|
+
if (this.shadowRoot.activeElement === o)
|
|
14
|
+
return a.focus(), !0;
|
|
15
|
+
} else if (this.shadowRoot.activeElement === a)
|
|
16
|
+
return o.focus(), !0;
|
|
17
|
+
}
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return c;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
i as T,
|
|
25
|
+
l as i
|
|
26
|
+
};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Mismatch Details:`,` - Expected target node ID: "${d.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw d.targetTagName&&b.push(` - Expected tag name: "${d.targetTagName}"`),u.sourceAspect&&b.push(` - Source aspect: "${u.sourceAspect}"`),u.aspectType!==void 0&&b.push(` - Aspect type: ${u.aspectType}`),b.push(`
|
|
3
3
|
This usually means:`," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`
|
|
4
4
|
Template: ${l.slice(0,200)}${l.length>200?"...":""}`),new Oe(b.join(`
|
|
5
|
-
`),d,ie(this.firstChild,this.lastChild).cloneContents(),l)}}}else{this.source!==null&&this.evaluateUnbindables(),this.isBound=!1,this.source=t,this.context=e;for(let r=0,a=n.length;r<a;++r)n[r].bind(this)}this.isBound=!0,this._hydrationStage=B.hydrated}unbind(){!this.isBound||this.source===null||(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){lt(this.firstChild,this.lastChild),this.unbind()}onUnbind(t){this.unbindables.push(t)}evaluateUnbindables(){const t=this.unbindables;for(let e=0,s=t.length;e<s;++e)t[e].unbind(this);t.length=0}}se=Q;E(_e);function Re(i){return i.create!==void 0}function Le(i,t,e,s){if(e==null&&(e=""),Re(e)){i.textContent="";let n=i.$fastView;if(n===void 0)if(V(s)&&V(e)&&s.bindingViewBoundaries[this.targetNodeId]!==void 0&&s.hydrationStage!==B.hydrated){const r=s.bindingViewBoundaries[this.targetNodeId];n=e.hydrate(r.first,r.last)}else n=e.create();else i.$fastTemplate!==e&&(n.isComposed&&(n.remove(),n.unbind()),n=e.create());n.isComposed?n.needsBindOnly&&(n.needsBindOnly=!1,n.bind(s.source,s.context)):(n.isComposed=!0,n.bind(s.source,s.context),n.insertBefore(i),i.$fastView=n,i.$fastTemplate=e)}else{const n=i.$fastView;n!==void 0&&n.isComposed&&(n.isComposed=!1,n.remove(),n.needsBindOnly?n.needsBindOnly=!1:n.unbind()),i.textContent=e}}function Ve(i,t,e){var s;const n=`${this.id}-t`,r=(s=i[n])!==null&&s!==void 0?s:i[n]={v:0,cv:Object.create(null)},a=r.cv;let c=r.v;const d=i[t];if(e!=null&&e.length){const l=e.split(/\s+/);for(let o=0,h=l.length;o<h;++o){const u=l[o];u!==""&&(a[u]=c,d.add(u))}}if(r.v=c+1,c!==0){c-=1;for(const l in a)a[l]===c&&d.remove(l)}}const je={[g.attribute]:C.setAttribute,[g.booleanAttribute]:C.setBooleanAttribute,[g.property]:(i,t,e)=>i[t]=e,[g.content]:Le,[g.tokenList]:Ve,[g.event]:()=>{}};class O{constructor(t){this.dataBinding=t,this.updateTarget=null,this.aspectType=g.content}createHTML(t){return pt.interpolation(t(this))}createBehavior(){var t;if(this.updateTarget===null){const e=je[this.aspectType],s=(t=this.dataBinding.policy)!==null&&t!==void 0?t:this.policy;if(!e)throw y.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,e)}return this}bind(t){var e;const s=t.targets[this.targetNodeId],n=V(t)&&t.hydrationStage&&t.hydrationStage!==B.hydrated;switch(this.aspectType){case g.event:s[this.data]=t,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case g.content:t.onUnbind(this);default:const r=(e=s[this.data])!==null&&e!==void 0?e:s[this.data]=this.dataBinding.createObserver(this,this);if(r.target=s,r.controller=t,n&&(this.aspectType===g.attribute||this.aspectType===g.booleanAttribute)){r.bind(t);break}this.updateTarget(s,this.targetAspect,r.bind(t),t);break}}unbind(t){const s=t.targets[this.targetNodeId].$fastView;s!==void 0&&s.isComposed&&(s.unbind(),s.needsBindOnly=!0)}handleEvent(t){const e=t.currentTarget[this.data];if(e.isBound){A.setEvent(t);const s=this.dataBinding.evaluate(e.source,e.context);A.setEvent(null),s!==!0&&t.preventDefault()}}handleChange(t,e){const s=e.target,n=e.controller;this.updateTarget(s,this.targetAspect,e.bind(n),n)}}T.define(O,{aspected:!0});const re=(i,t)=>`${i}.${t}`,_t={},S={index:0,node:null};function Rt(i){i.startsWith("fast-")||y.warn(1204,{name:i})}const Fe=new Proxy(document.createElement("div"),{get(i,t){Rt(t);const e=Reflect.get(i,t);return M(e)?e.bind(i):e},set(i,t,e){return Rt(t),Reflect.set(i,t,e)}});class He{constructor(t,e,s){this.fragment=t,this.directives=e,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(t,e,s,n,r){var a,c;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(e,s,n)),t.id=(a=t.id)!==null&&a!==void 0?a:j(),t.targetNodeId=s,t.targetTagName=r,t.policy=(c=t.policy)!==null&&c!==void 0?c:this.policy,this.factories.push(t)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(t,e,s){const n=this.descriptors;if(e==="r"||e==="h"||n[e])return;if(!n[t]){const a=t.lastIndexOf("."),c=t.substring(0,a),d=parseInt(t.substring(a+1));this.addTargetDescriptor(c,t,d)}let r=_t[e];if(!r){const a=`_${e}`;_t[e]=r={get(){var c;return(c=this[a])!==null&&c!==void 0?c:this[a]=this[t].childNodes[s]}}}n[e]=r}createView(t){const e=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=e,s.h=t??Fe;for(const n of this.nodeIds)s[n];return new H(e,this.factories,s)}}function oe(i,t,e,s,n,r=!1){const a=e.attributes,c=i.directives;for(let d=0,l=a.length;d<l;++d){const o=a[d],h=o.value,u=et.parse(h,c);let b=null;u===null?r&&(b=new O(ut(()=>h,i.policy)),T.assignAspect(b,o.name)):b=gt.aggregate(u,i.policy),b!==null&&(e.removeAttributeNode(o),d--,l--,i.addFactory(b,t,s,n,e.tagName))}}function Ie(i,t,e,s,n){const r=et.parse(t.textContent,i.directives);if(r===null)return S.node=t.nextSibling,S.index=n+1,S;let a,c=a=t;for(let d=0,l=r.length;d<l;++d){const o=r[d];d!==0&&(n++,s=re(e,n),a=c.parentNode.insertBefore(document.createTextNode(""),c.nextSibling)),N(o)?a.textContent=o:(a.textContent=" ",T.assignAspect(o),i.addFactory(o,e,s,n,null)),c=a}return S.index=n+1,S.node=c.nextSibling,S}function ae(i,t,e){let s=0,n=t.firstChild;for(;n;){const r=De(i,e,n,s);n=r.node,s=r.index}}function De(i,t,e,s){const n=re(t,s);switch(e.nodeType){case 1:oe(i,t,e,n,s),ae(i,e,n);break;case 3:return Ie(i,e,t,n,s);case 8:const r=et.parse(e.data,i.directives);r!==null&&i.addFactory(gt.aggregate(r),t,n,s,null);break}return S.index=s+1,S.node=e.nextSibling,S}function Pe(i,t){return i&&i.nodeType==8&&et.parse(i.data,t)!==null}const Lt="TEMPLATE",gt={compile(i,t,e=C.policy){let s;if(N(i)){s=document.createElement(Lt),s.innerHTML=e.createHTML(i);const a=s.content.firstElementChild;a!==null&&a.tagName===Lt&&(s=a)}else s=i;!s.content.firstChild&&!s.content.lastChild&&s.content.appendChild(document.createComment(""));const n=document.adoptNode(s.content),r=new He(n,t,e);return oe(r,"",s,"h",0,!0),(Pe(n.firstChild,t)||n.childNodes.length===1&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),ae(r,n,"r"),S.node=null,r.freeze()},setDefaultStrategy(i){this.compile=i},aggregate(i,t=C.policy){if(i.length===1)return i[0];let e,s=!1,n;const r=i.length,a=i.map(l=>N(l)?()=>l:(e=l.sourceAspect||e,s=s||l.dataBinding.isVolatile,n=n||l.dataBinding.policy,l.dataBinding.evaluate)),c=(l,o)=>{let h="";for(let u=0;u<r;++u)h+=a[u](l,o);return h},d=new O(ht(c,n??t,s));return T.assignAspect(d,e),d}},ze=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ue=Object.create(null);class F{constructor(t,e=Ue){this.html=t,this.factories=e}createHTML(t){const e=this.factories;for(const s in e)t(e[s]);return this.html}}F.empty=new F("");T.define(F);function We(i,t,e,s=T.getForInstance(i)){if(s.aspected){const n=ze.exec(t);n!==null&&T.assignAspect(i,n[2])}return i.createHTML(e)}class it{constructor(t,e={},s){this.policy=s,this.result=null,this.html=t,this.factories=e}compile(){return this.result===null&&(this.result=gt.compile(this.html,this.factories,this.policy)),this.result}create(t){return this.compile().createView(t)}inline(){return new F(N(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(t){if(this.result)throw y.error(1208);if(this.policy)throw y.error(1207);return this.policy=t,this}render(t,e,s){const n=this.create(s);return n.bind(t),n.appendTo(e),n}static create(t,e,s){let n="";const r=Object.create(null),a=c=>{var d;const l=(d=c.id)!==null&&d!==void 0?d:c.id=j();return r[l]=c,l};for(let c=0,d=t.length-1;c<d;++c){const l=t[c];let o=e[c],h;if(n+=l,M(o))o=new O(ht(o));else if(o instanceof tt)o=new O(o);else if(!(h=T.getForInstance(o))){const u=o;o=new O(ut(()=>u))}n+=We(o,l,a,h)}return new it(n+t[t.length-1],r,s)}}E(it);const yt=(i,...t)=>{if(Array.isArray(i)&&Array.isArray(i.raw))return it.create(i,t);throw y.error(1206)};yt.partial=i=>new F(i);const Vt="boolean",jt="reflect",le=Object.freeze({locate:Jt()}),qe={toView(i){return i?"true":"false"},fromView(i){return!(i==null||i==="false"||i===!1||i===0)}};function Ft(i){if(i==null)return null;const t=i*1;return isNaN(t)?null:t}const Qe={toView(i){const t=Ft(i);return t&&t.toString()},fromView:Ft};class J{constructor(t,e,s=e.toLowerCase(),n=jt,r){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=s,this.mode=n,this.converter=r,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,n===Vt&&r===void 0&&(this.converter=qe)}setValue(t,e){const s=t[this.fieldName],n=this.converter;n!==void 0&&(e=n.fromView(e)),s!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](s,e),t.$fastController.notify(this.name))}getValue(t){return p.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){const e=this.mode,s=this.guards;s.has(t)||e==="fromView"||dt.enqueue(()=>{s.add(t);const n=t[this.fieldName];switch(e){case jt:const r=this.converter;C.setAttribute(t,this.attribute,r!==void 0?r.toView(n):n);break;case Vt:C.setBooleanAttribute(t,this.attribute,n);break}s.delete(t)})}static collect(t,...e){const s=[];e.push(le.locate(t));for(let n=0,r=e.length;n<r;++n){const a=e[n];if(a!==void 0)for(let c=0,d=a.length;c<d;++c){const l=a[c];N(l)?s.push(new J(t,l)):s.push(new J(t,l.property,l.attribute,l.mode,l.converter))}}return s}}function ce(i,t){let e;function s(n,r){arguments.length>1&&(e.property=r),le.locate(n.constructor).push(e)}if(arguments.length>1){e={},s(i,t);return}return e=i===void 0?{}:i,s}var Ge=function(i,t,e,s){function n(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(h){a(h)}}function d(o){try{l(s.throw(o))}catch(h){a(h)}}function l(o){o.done?r(o.value):n(o.value).then(c,d)}l((s=s.apply(i,t||[])).next())})};const Ht={mode:"open"},It={},rt=new Set,R=y.getById(x.elementRegistry,()=>Gt()),Je={deferAndHydrate:"defer-and-hydrate"};class f{constructor(t,e=t.definition){var s;this.platformDefined=!1,N(e)&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template,this.templateOptions=e.templateOptions,this.registry=(s=e.registry)!==null&&s!==void 0?s:customElements;const n=t.prototype,r=J.collect(t,e.attributes),a=new Array(r.length),c={},d={};for(let l=0,o=r.length;l<o;++l){const h=r[l];a[l]=h.attribute,c[h.name]=h,d[h.attribute]=h,p.defineProperty(n,h)}Reflect.defineProperty(t,"observedAttributes",{value:a,enumerable:!0}),this.attributes=r,this.propertyLookup=c,this.attributeLookup=d,this.shadowOptions=e.shadowOptions===void 0?Ht:e.shadowOptions===null?void 0:Object.assign(Object.assign({},Ht),e.shadowOptions),this.elementOptions=e.elementOptions===void 0?It:Object.assign(Object.assign({},It),e.elementOptions),this.styles=m.normalize(e.styles),R.register(this),p.defineProperty(f.isRegistered,this.name),f.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(t=this.registry){var e,s;const n=this.type;return t.get(this.name)||(this.platformDefined=!0,t.define(this.name,n,this.elementOptions),(s=(e=this.lifecycleCallbacks)===null||e===void 0?void 0:e.elementDidDefine)===null||s===void 0||s.call(e,this.name)),this}static compose(t,e){return rt.has(t)||R.getByType(t)?new f(class extends t{},e):new f(t,e)}static registerBaseType(t){rt.add(t)}static composeAsync(t,e){return new Promise(s=>{(rt.has(t)||R.getByType(t))&&s(new f(class extends t{},e));const n=new f(t,e);p.getNotifier(n).subscribe({handleChange:()=>{var r,a;(a=(r=n.lifecycleCallbacks)===null||r===void 0?void 0:r.templateDidUpdate)===null||a===void 0||a.call(r,n.name),s(n)}},"template")})}}f.isRegistered={};f.getByType=R.getByType;f.getForInstance=R.getForInstance;f.registerAsync=i=>Ge(void 0,void 0,void 0,function*(){return new Promise(t=>{f.isRegistered[i]&&t(f.isRegistered[i]),p.getNotifier(f.isRegistered).subscribe({handleChange:()=>t(f.isRegistered[i])},i)})});p.defineProperty(f.prototype,"template");class Ke extends MutationObserver{constructor(t){function e(s){this.callback.call(null,s.filter(n=>this.observedNodes.has(n.target)))}super(e),this.callback=t,this.observedNodes=new Set}observe(t,e){this.observedNodes.add(t),super.observe(t,e)}unobserve(t){this.observedNodes.delete(t),this.observedNodes.size<1&&this.disconnect()}}const Xe=Object.freeze({create(i){const t=[],e={};let s=null,n=!1;return{source:i,context:A.default,targets:e,get isBound(){return n},addBehaviorFactory(r,a){var c,d,l,o;const h=r;h.id=(c=h.id)!==null&&c!==void 0?c:j(),h.targetNodeId=(d=h.targetNodeId)!==null&&d!==void 0?d:j(),h.targetTagName=(l=a.tagName)!==null&&l!==void 0?l:null,h.policy=(o=h.policy)!==null&&o!==void 0?o:C.policy,this.addTarget(h.targetNodeId,a),this.addBehavior(h.createBehavior())},addTarget(r,a){e[r]=a},addBehavior(r){t.push(r),n&&r.bind(this)},onUnbind(r){s===null&&(s=[]),s.push(r)},connectedCallback(r){n||(n=!0,t.forEach(a=>a.bind(this)))},disconnectedCallback(r){n&&(n=!1,s!==null&&s.forEach(a=>a.unbind(this)))}}}}),Ye={bubbles:!0,composed:!0,cancelable:!0},W="isConnected",de=new WeakMap;function L(i){var t,e;return(e=(t=i.shadowRoot)!==null&&t!==void 0?t:de.get(i))!==null&&e!==void 0?e:null}let Dt;class $ extends Kt{constructor(t,e){super(t),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=t,this.definition=e,this.shadowOptions=e.shadowOptions;const s=p.getAccessors(t);if(s.length>0){const n=this.boundObservables=Object.create(null);for(let r=0,a=s.length;r<a;++r){const c=s[r].name,d=t[c];d!==void 0&&(delete t[c],n[c]=d)}}}get isConnected(){return p.track(this,W),this.stage===1}get context(){var t,e;return(e=(t=this.view)===null||t===void 0?void 0:t.context)!==null&&e!==void 0?e:A.default}get isBound(){var t,e;return(e=(t=this.view)===null||t===void 0?void 0:t.isBound)!==null&&e!==void 0?e:!1}get sourceLifetime(){var t;return(t=this.view)===null||t===void 0?void 0:t.sourceLifetime}get template(){var t;if(this._template===null){const e=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():e.template&&(this._template=(t=e.template)!==null&&t!==void 0?t:null)}return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(t){if(this._shadowRootOptions===void 0&&t!==void 0){this._shadowRootOptions=t;let e=this.source.shadowRoot;e?this.hasExistingShadowRoot=!0:(e=this.source.attachShadow(t),t.mode==="closed"&&de.set(this.source,e))}}get mainStyles(){var t;if(this._mainStyles===null){const e=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():e.styles&&(this._mainStyles=(t=e.styles)!==null&&t!==void 0?t:null)}return this._mainStyles}set mainStyles(t){this._mainStyles!==t&&(this._mainStyles!==null&&this.removeStyles(this._mainStyles),this._mainStyles=t,this.needsInitialization||this.addStyles(t))}onUnbind(t){var e;(e=this.view)===null||e===void 0||e.onUnbind(t)}addBehavior(t){var e,s;const n=(e=this.behaviors)!==null&&e!==void 0?e:this.behaviors=new Map,r=(s=n.get(t))!==null&&s!==void 0?s:0;r===0?(n.set(t,1),t.addedCallback&&t.addedCallback(this),t.connectedCallback&&!this.guardBehaviorConnection&&(this.stage===1||this.stage===0)&&t.connectedCallback(this)):n.set(t,r+1)}removeBehavior(t,e=!1){const s=this.behaviors;if(s===null)return;const n=s.get(t);n!==void 0&&(n===1||e?(s.delete(t),t.disconnectedCallback&&this.stage!==3&&t.disconnectedCallback(this),t.removedCallback&&t.removedCallback(this)):s.set(t,n-1))}addStyles(t){var e;if(!t)return;const s=this.source;if(t instanceof HTMLElement)((e=L(s))!==null&&e!==void 0?e:this.source).append(t);else if(!t.isAttachedTo(s)){const n=t.behaviors;if(t.addStylesTo(s),n!==null)for(let r=0,a=n.length;r<a;++r)this.addBehavior(n[r])}}removeStyles(t){var e;if(!t)return;const s=this.source;if(t instanceof HTMLElement)((e=L(s))!==null&&e!==void 0?e:s).removeChild(t);else if(t.isAttachedTo(s)){const n=t.behaviors;if(t.removeStylesFrom(s),n!==null)for(let r=0,a=n.length;r<a;++r)this.removeBehavior(n[r])}}connect(){this.stage===3&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):this.view!==null&&this.view.bind(this.source),this.stage=1,p.notify(this,W))}bindObservables(){if(this.boundObservables!==null){const t=this.source,e=this.boundObservables,s=Object.keys(e);for(let n=0,r=s.length;n<r;++n){const a=s[n];t[a]=e[a]}this.boundObservables=null}}connectBehaviors(){if(this.behaviorsConnected===!1){const t=this.behaviors;if(t!==null){this.guardBehaviorConnection=!0;for(const e of t.keys())e.connectedCallback&&e.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(this.behaviorsConnected===!0){const t=this.behaviors;if(t!==null)for(const e of t.keys())e.disconnectedCallback&&e.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===1&&(this.stage=2,p.notify(this,W),this.view!==null&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(t,e,s){const n=this.definition.attributeLookup[t];n!==void 0&&n.onAttributeChangedCallback(this.source,s)}emit(t,e,s){return this.stage===1?this.source.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},Ye),s))):!1}renderTemplate(t){var e;const s=this.source,n=(e=L(s))!==null&&e!==void 0?e:s;if(this.view!==null)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let r=n.firstChild;r!==null;r=n.firstChild)n.removeChild(r)}t&&(this.view=t.render(s,n,s),this.view.sourceLifetime=Z.coupled)}static forCustomElement(t,e=!1){const s=t.$fastController;if(s!==void 0&&!e)return s;const n=f.getForInstance(t);if(n===void 0)throw y.error(1401);return p.getNotifier(n).subscribe({handleChange:()=>{$.forCustomElement(t,!0),t.$fastController.connect()}},"template"),p.getNotifier(n).subscribe({handleChange:()=>{$.forCustomElement(t,!0),t.$fastController.connect()}},"shadowOptions"),t.$fastController=new Dt(t,n)}static setStrategy(t){Dt=t}}E($);$.setStrategy($);function K(i){var t;return"adoptedStyleSheets"in i?i:(t=L(i))!==null&&t!==void 0?t:i.getRootNode()}class st{constructor(t){const e=st.styleSheetCache;this.sheets=t.map(s=>{if(s instanceof CSSStyleSheet)return s;let n=e.get(s);return n===void 0&&(n=new CSSStyleSheet,n.replaceSync(s),e.set(s,n)),n})}addStylesTo(t){he(K(t),this.sheets)}removeStylesFrom(t){ue(K(t),this.sheets)}}st.styleSheetCache=new Map;let Ze=0;const ti=()=>`fast-${++Ze}`;function Pt(i){return i===document?document.body:i}class ei{constructor(t){this.styles=t,this.styleClass=ti()}addStylesTo(t){t=Pt(K(t));const e=this.styles,s=this.styleClass;for(let n=0;n<e.length;n++){const r=document.createElement("style");r.innerHTML=e[n],r.className=s,t.append(r)}}removeStylesFrom(t){t=Pt(K(t));const e=t.querySelectorAll(`.${this.styleClass}`);for(let s=0,n=e.length;s<n;++s)t.removeChild(e[s])}}let he=(i,t)=>{i.adoptedStyleSheets=[...i.adoptedStyleSheets,...t]},ue=(i,t)=>{i.adoptedStyleSheets=i.adoptedStyleSheets.filter(e=>t.indexOf(e)===-1)};if(m.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),he=(i,t)=>{i.adoptedStyleSheets.push(...t)},ue=(i,t)=>{for(const e of t){const s=i.adoptedStyleSheets.indexOf(e);s!==-1&&i.adoptedStyleSheets.splice(s,1)}}}catch{}m.setDefaultStrategy(st)}else m.setDefaultStrategy(ei);const ot="defer-hydration",I="needs-hydration";class v extends ${static config(t){return v.lifecycleCallbacks=t,this}static hydrationObserverHandler(t){for(const e of t)v.hydrationObserver.unobserve(e.target),e.target.$fastController.connect()}static checkHydrationComplete(){var t,e;document.querySelector(`[${I}]`)||(e=(t=v.lifecycleCallbacks)===null||t===void 0?void 0:t.hydrationComplete)===null||e===void 0||e.call(t)}static forCustomElement(t,e){const s=f.getForInstance(t);return s?.templateOptions===Je.deferAndHydrate&&!s.template&&(t.toggleAttribute(ot,!0),t.toggleAttribute(I,!0)),super.forCustomElement(t,e)}connect(){var t,e,s,n,r,a;if(this.needsHydration===void 0&&(this.needsHydration=this.source.getAttribute(I)!==null),this.source.hasAttribute(ot)){v.hydrationObserver.observe(this.source,{attributeFilter:[ot]});return}if(!this.needsHydration){super.connect();return}if(this.stage!==3)return;(e=(t=v.lifecycleCallbacks)===null||t===void 0?void 0:t.elementWillHydrate)===null||e===void 0||e.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors();const c=this.source,d=(s=L(c))!==null&&s!==void 0?s:c;if(this.template)if(V(this.template)){let l=d.firstChild,o=d.lastChild;c.shadowRoot===null&&(w.isElementBoundaryStartMarker(l)&&(l.data="",l=l.nextSibling),w.isElementBoundaryEndMarker(o)&&(o.data="",o=o.previousSibling)),this.view=this.template.hydrate(l,o,c),(n=this.view)===null||n===void 0||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(I),this.needsInitialization=this.needsHydration=!1,p.notify(this,W),(a=(r=v.lifecycleCallbacks)===null||r===void 0?void 0:r.elementDidHydrate)===null||a===void 0||a.call(r,this.definition.name),v.checkHydrationComplete()}disconnect(){super.disconnect(),v.hydrationObserver.unobserve(this.source)}static install(){$.setStrategy(v)}}v.hydrationObserver=new Ke(v.hydrationObserverHandler);var ii=function(i,t,e,s){function n(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(h){a(h)}}function d(o){try{l(s.throw(o))}catch(h){a(h)}}function l(o){o.done?r(o.value):n(o.value).then(c,d)}l((s=s.apply(i,t||[])).next())})};function fe(i){const t=class extends i{constructor(){super(),$.forCustomElement(this)}$emit(e,s,n){return this.$fastController.emit(e,s,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,s,n){this.$fastController.onAttributeChangedCallback(e,s,n)}};return f.registerBaseType(t),t}function si(i,t){return M(i)?f.compose(i,t):f.compose(this,i)}function ni(i,t){return ii(this,void 0,void 0,function*(){return M(i)?(yield f.composeAsync(i,t)).define().type:(yield f.composeAsync(this,i)).define().type})}function ri(i,t){return M(i)?f.compose(i,t).define().type:f.compose(this,i).define().type}function oi(i){return fe(i)}const ai=Object.assign(fe(HTMLElement),{from:oi,define:ri,compose:si,defineAsync:ni});function li(i,t){return i instanceof Function?i(t):i}const zt=new Set,at=new Map,ci=i=>(t="vwc")=>{const e=n=>`${t}-${n}`,s=n=>{const r=e(n.name);let a=n.type;if(a.componentName=n.name,zt.has(r))return;at.has(a)&&at.get(a)!==r&&(a=class extends a{}),zt.add(r),at.set(a,r);for(const o of n.dependencies)s(o);const c=new Map([[n.type,r],...n.dependencies.map(o=>[o.type,e(o.name)])]),l={tagFor:(o,h)=>{if(!c.has(o))throw new Error(`Could not get tag for ${o.name} as it is not a dependency of ${n.name}.`);const u=c.get(o);return h?u:yt.partial(u)},tagForNonDependency(o){return e(o)}};f.compose(a,{...n.options,template:li(n.template,l),name:`${t}-${n.name}`}).define()};s(i)},di=(i,t,e,s,n)=>({name:i,type:t,template:e,dependencies:s,options:n}),Ut=new WeakMap,pe=i=>{let t=Ut.get(i);return t||(t=[],Ut.set(i,t)),t},hi=(i,t)=>{pe(i).push(t)},ui=(i,t)=>{pe(i).forEach(e=>e(i,t))},fi=i=>i==="delegate",Wt=i=>`vvd${i.charAt(0).toUpperCase()}${i.slice(1)}`,be=(i,t)=>{if(fi(i._vividAriaBehaviour)){const e=i[t];i[`_${t}`]=null,i.removeAttribute(Y(t)),i[`_${t}`]=e,i[t]!==null?i.dataset[Wt(t)]=i[t]:delete i.dataset[Wt(t)]}else C.setAttribute(i,Y(t),i[t])},X=new WeakMap,pi=(i,t)=>{const e=X.get(i);e?e.add(t):X.set(i,new Set([t]))},bi=(i,t)=>{i.isConnected?be(i,t):pi(i,t)},gi=i=>{const t=X.get(i);if(t){for(const e of t)be(i,e);X.delete(i)}},ct=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColIndexText","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowIndexText","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","ariaRelevant"],Y=i=>i.replace("aria","aria-").toLowerCase(),yi=i=>{class t extends i{constructor(...s){super(...s),this._vividAriaBehaviour="default";for(const n of ct)this[`_${n}`]=null}connectedCallback(){super.connectedCallback(),gi(this)}}for(const e of ct)ce({attribute:Y(e),mode:"fromView"})(t.prototype,e),t.prototype[`${e}Changed`]=function(){bi(this,e),this._vividAriaBehaviour!=="default"&&ui(this,e)};return t};function vi(){const i=new WeakMap;return t=>(i.has(t)||i.set(t,[]),i.get(t))}const ge=vi(),mi=i=>(t,e)=>{ge(t.constructor).push({newPropertyName:e,...i})},wi=i=>{class t extends i{#t(s){let n=!1,r=!1;const a=o=>r&&s.fromDeprecated(o[s.deprecatedPropertyName])===o[s.newPropertyName],c=o=>n&&s.toDeprecated&&s.toDeprecated(o[s.newPropertyName])===o[s.deprecatedPropertyName],d={handleChange(o,h){if(h===s.newPropertyName){if(n=!0,!s.toDeprecated||a(o))return;o[s.deprecatedPropertyName]=s.toDeprecated(o[s.newPropertyName])}if(h===s.deprecatedPropertyName){if(r=!0,c(o))return;o[s.newPropertyName]=s.fromDeprecated(o[s.deprecatedPropertyName])}}},l=p.getNotifier(this);l.subscribe(d,s.newPropertyName),l.subscribe(d,s.deprecatedPropertyName)}constructor(...s){super(...s);for(const n of ge(this.constructor))this.#t(n)}}return t};class Si extends yi(wi(ai)){static{this.VIVID_VERSION="5.4.0"}connectedCallback(){super.connectedCallback();const t=this.constructor.componentName;this.setAttribute("data-vvd-component",t)}}exports.Binding=tt;exports.DOM=C;exports.ElementStyles=m;exports.ExecutionContext=A;exports.HTMLDirective=T;exports.HTMLView=H;exports.HydrationMarkup=w;exports.HydrationStage=B;exports.Markup=pt;exports.Observable=p;exports.StatelessAttachedAttributeDirective=Zt;exports.SubscriberSet=q;exports.Updates=dt;exports.ViewBehaviorOrchestrator=Xe;exports.VividElement=Si;exports.ariaAttributeName=Y;exports.ariaMixinProperties=ct;exports.attr=ce;exports.commonjsGlobal=P;exports.createRegisterFunction=ci;exports.defineVividComponent=di;exports.emptyArray=me;exports.getAugmentedNamespace=ve;exports.getDefaultExportFromCjs=ye;exports.html=yt;exports.isFunction=M;exports.isHydratable=V;exports.isString=N;exports.noop=qt;exports.nullableNumberConverter=Qe;exports.observable=Ce;exports.oneTime=ut;exports.oneWay=ht;exports.replaces=mi;exports.subscribeToAriaPropertyChanges=hi;exports.volatile=Te;
|
|
5
|
+
`),d,ie(this.firstChild,this.lastChild).cloneContents(),l)}}}else{this.source!==null&&this.evaluateUnbindables(),this.isBound=!1,this.source=t,this.context=e;for(let r=0,a=n.length;r<a;++r)n[r].bind(this)}this.isBound=!0,this._hydrationStage=B.hydrated}unbind(){!this.isBound||this.source===null||(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){lt(this.firstChild,this.lastChild),this.unbind()}onUnbind(t){this.unbindables.push(t)}evaluateUnbindables(){const t=this.unbindables;for(let e=0,s=t.length;e<s;++e)t[e].unbind(this);t.length=0}}se=Q;E(_e);function Re(i){return i.create!==void 0}function Le(i,t,e,s){if(e==null&&(e=""),Re(e)){i.textContent="";let n=i.$fastView;if(n===void 0)if(V(s)&&V(e)&&s.bindingViewBoundaries[this.targetNodeId]!==void 0&&s.hydrationStage!==B.hydrated){const r=s.bindingViewBoundaries[this.targetNodeId];n=e.hydrate(r.first,r.last)}else n=e.create();else i.$fastTemplate!==e&&(n.isComposed&&(n.remove(),n.unbind()),n=e.create());n.isComposed?n.needsBindOnly&&(n.needsBindOnly=!1,n.bind(s.source,s.context)):(n.isComposed=!0,n.bind(s.source,s.context),n.insertBefore(i),i.$fastView=n,i.$fastTemplate=e)}else{const n=i.$fastView;n!==void 0&&n.isComposed&&(n.isComposed=!1,n.remove(),n.needsBindOnly?n.needsBindOnly=!1:n.unbind()),i.textContent=e}}function Ve(i,t,e){var s;const n=`${this.id}-t`,r=(s=i[n])!==null&&s!==void 0?s:i[n]={v:0,cv:Object.create(null)},a=r.cv;let c=r.v;const d=i[t];if(e!=null&&e.length){const l=e.split(/\s+/);for(let o=0,h=l.length;o<h;++o){const u=l[o];u!==""&&(a[u]=c,d.add(u))}}if(r.v=c+1,c!==0){c-=1;for(const l in a)a[l]===c&&d.remove(l)}}const je={[g.attribute]:C.setAttribute,[g.booleanAttribute]:C.setBooleanAttribute,[g.property]:(i,t,e)=>i[t]=e,[g.content]:Le,[g.tokenList]:Ve,[g.event]:()=>{}};class O{constructor(t){this.dataBinding=t,this.updateTarget=null,this.aspectType=g.content}createHTML(t){return pt.interpolation(t(this))}createBehavior(){var t;if(this.updateTarget===null){const e=je[this.aspectType],s=(t=this.dataBinding.policy)!==null&&t!==void 0?t:this.policy;if(!e)throw y.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,e)}return this}bind(t){var e;const s=t.targets[this.targetNodeId],n=V(t)&&t.hydrationStage&&t.hydrationStage!==B.hydrated;switch(this.aspectType){case g.event:s[this.data]=t,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case g.content:t.onUnbind(this);default:const r=(e=s[this.data])!==null&&e!==void 0?e:s[this.data]=this.dataBinding.createObserver(this,this);if(r.target=s,r.controller=t,n&&(this.aspectType===g.attribute||this.aspectType===g.booleanAttribute)){r.bind(t);break}this.updateTarget(s,this.targetAspect,r.bind(t),t);break}}unbind(t){const s=t.targets[this.targetNodeId].$fastView;s!==void 0&&s.isComposed&&(s.unbind(),s.needsBindOnly=!0)}handleEvent(t){const e=t.currentTarget[this.data];if(e.isBound){A.setEvent(t);const s=this.dataBinding.evaluate(e.source,e.context);A.setEvent(null),s!==!0&&t.preventDefault()}}handleChange(t,e){const s=e.target,n=e.controller;this.updateTarget(s,this.targetAspect,e.bind(n),n)}}T.define(O,{aspected:!0});const re=(i,t)=>`${i}.${t}`,_t={},S={index:0,node:null};function Rt(i){i.startsWith("fast-")||y.warn(1204,{name:i})}const Fe=new Proxy(document.createElement("div"),{get(i,t){Rt(t);const e=Reflect.get(i,t);return M(e)?e.bind(i):e},set(i,t,e){return Rt(t),Reflect.set(i,t,e)}});class He{constructor(t,e,s){this.fragment=t,this.directives=e,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(t,e,s,n,r){var a,c;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(e,s,n)),t.id=(a=t.id)!==null&&a!==void 0?a:j(),t.targetNodeId=s,t.targetTagName=r,t.policy=(c=t.policy)!==null&&c!==void 0?c:this.policy,this.factories.push(t)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(t,e,s){const n=this.descriptors;if(e==="r"||e==="h"||n[e])return;if(!n[t]){const a=t.lastIndexOf("."),c=t.substring(0,a),d=parseInt(t.substring(a+1));this.addTargetDescriptor(c,t,d)}let r=_t[e];if(!r){const a=`_${e}`;_t[e]=r={get(){var c;return(c=this[a])!==null&&c!==void 0?c:this[a]=this[t].childNodes[s]}}}n[e]=r}createView(t){const e=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=e,s.h=t??Fe;for(const n of this.nodeIds)s[n];return new H(e,this.factories,s)}}function oe(i,t,e,s,n,r=!1){const a=e.attributes,c=i.directives;for(let d=0,l=a.length;d<l;++d){const o=a[d],h=o.value,u=et.parse(h,c);let b=null;u===null?r&&(b=new O(ut(()=>h,i.policy)),T.assignAspect(b,o.name)):b=gt.aggregate(u,i.policy),b!==null&&(e.removeAttributeNode(o),d--,l--,i.addFactory(b,t,s,n,e.tagName))}}function Ie(i,t,e,s,n){const r=et.parse(t.textContent,i.directives);if(r===null)return S.node=t.nextSibling,S.index=n+1,S;let a,c=a=t;for(let d=0,l=r.length;d<l;++d){const o=r[d];d!==0&&(n++,s=re(e,n),a=c.parentNode.insertBefore(document.createTextNode(""),c.nextSibling)),N(o)?a.textContent=o:(a.textContent=" ",T.assignAspect(o),i.addFactory(o,e,s,n,null)),c=a}return S.index=n+1,S.node=c.nextSibling,S}function ae(i,t,e){let s=0,n=t.firstChild;for(;n;){const r=De(i,e,n,s);n=r.node,s=r.index}}function De(i,t,e,s){const n=re(t,s);switch(e.nodeType){case 1:oe(i,t,e,n,s),ae(i,e,n);break;case 3:return Ie(i,e,t,n,s);case 8:const r=et.parse(e.data,i.directives);r!==null&&i.addFactory(gt.aggregate(r),t,n,s,null);break}return S.index=s+1,S.node=e.nextSibling,S}function Pe(i,t){return i&&i.nodeType==8&&et.parse(i.data,t)!==null}const Lt="TEMPLATE",gt={compile(i,t,e=C.policy){let s;if(N(i)){s=document.createElement(Lt),s.innerHTML=e.createHTML(i);const a=s.content.firstElementChild;a!==null&&a.tagName===Lt&&(s=a)}else s=i;!s.content.firstChild&&!s.content.lastChild&&s.content.appendChild(document.createComment(""));const n=document.adoptNode(s.content),r=new He(n,t,e);return oe(r,"",s,"h",0,!0),(Pe(n.firstChild,t)||n.childNodes.length===1&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),ae(r,n,"r"),S.node=null,r.freeze()},setDefaultStrategy(i){this.compile=i},aggregate(i,t=C.policy){if(i.length===1)return i[0];let e,s=!1,n;const r=i.length,a=i.map(l=>N(l)?()=>l:(e=l.sourceAspect||e,s=s||l.dataBinding.isVolatile,n=n||l.dataBinding.policy,l.dataBinding.evaluate)),c=(l,o)=>{let h="";for(let u=0;u<r;++u)h+=a[u](l,o);return h},d=new O(ht(c,n??t,s));return T.assignAspect(d,e),d}},ze=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ue=Object.create(null);class F{constructor(t,e=Ue){this.html=t,this.factories=e}createHTML(t){const e=this.factories;for(const s in e)t(e[s]);return this.html}}F.empty=new F("");T.define(F);function We(i,t,e,s=T.getForInstance(i)){if(s.aspected){const n=ze.exec(t);n!==null&&T.assignAspect(i,n[2])}return i.createHTML(e)}class it{constructor(t,e={},s){this.policy=s,this.result=null,this.html=t,this.factories=e}compile(){return this.result===null&&(this.result=gt.compile(this.html,this.factories,this.policy)),this.result}create(t){return this.compile().createView(t)}inline(){return new F(N(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(t){if(this.result)throw y.error(1208);if(this.policy)throw y.error(1207);return this.policy=t,this}render(t,e,s){const n=this.create(s);return n.bind(t),n.appendTo(e),n}static create(t,e,s){let n="";const r=Object.create(null),a=c=>{var d;const l=(d=c.id)!==null&&d!==void 0?d:c.id=j();return r[l]=c,l};for(let c=0,d=t.length-1;c<d;++c){const l=t[c];let o=e[c],h;if(n+=l,M(o))o=new O(ht(o));else if(o instanceof tt)o=new O(o);else if(!(h=T.getForInstance(o))){const u=o;o=new O(ut(()=>u))}n+=We(o,l,a,h)}return new it(n+t[t.length-1],r,s)}}E(it);const yt=(i,...t)=>{if(Array.isArray(i)&&Array.isArray(i.raw))return it.create(i,t);throw y.error(1206)};yt.partial=i=>new F(i);const Vt="boolean",jt="reflect",le=Object.freeze({locate:Jt()}),qe={toView(i){return i?"true":"false"},fromView(i){return!(i==null||i==="false"||i===!1||i===0)}};function Ft(i){if(i==null)return null;const t=i*1;return isNaN(t)?null:t}const Qe={toView(i){const t=Ft(i);return t&&t.toString()},fromView:Ft};class J{constructor(t,e,s=e.toLowerCase(),n=jt,r){this.guards=new Set,this.Owner=t,this.name=e,this.attribute=s,this.mode=n,this.converter=r,this.fieldName=`_${e}`,this.callbackName=`${e}Changed`,this.hasCallback=this.callbackName in t.prototype,n===Vt&&r===void 0&&(this.converter=qe)}setValue(t,e){const s=t[this.fieldName],n=this.converter;n!==void 0&&(e=n.fromView(e)),s!==e&&(t[this.fieldName]=e,this.tryReflectToAttribute(t),this.hasCallback&&t[this.callbackName](s,e),t.$fastController.notify(this.name))}getValue(t){return p.track(t,this.name),t[this.fieldName]}onAttributeChangedCallback(t,e){this.guards.has(t)||(this.guards.add(t),this.setValue(t,e),this.guards.delete(t))}tryReflectToAttribute(t){const e=this.mode,s=this.guards;s.has(t)||e==="fromView"||dt.enqueue(()=>{s.add(t);const n=t[this.fieldName];switch(e){case jt:const r=this.converter;C.setAttribute(t,this.attribute,r!==void 0?r.toView(n):n);break;case Vt:C.setBooleanAttribute(t,this.attribute,n);break}s.delete(t)})}static collect(t,...e){const s=[];e.push(le.locate(t));for(let n=0,r=e.length;n<r;++n){const a=e[n];if(a!==void 0)for(let c=0,d=a.length;c<d;++c){const l=a[c];N(l)?s.push(new J(t,l)):s.push(new J(t,l.property,l.attribute,l.mode,l.converter))}}return s}}function ce(i,t){let e;function s(n,r){arguments.length>1&&(e.property=r),le.locate(n.constructor).push(e)}if(arguments.length>1){e={},s(i,t);return}return e=i===void 0?{}:i,s}var Ge=function(i,t,e,s){function n(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(h){a(h)}}function d(o){try{l(s.throw(o))}catch(h){a(h)}}function l(o){o.done?r(o.value):n(o.value).then(c,d)}l((s=s.apply(i,t||[])).next())})};const Ht={mode:"open"},It={},rt=new Set,R=y.getById(x.elementRegistry,()=>Gt()),Je={deferAndHydrate:"defer-and-hydrate"};class f{constructor(t,e=t.definition){var s;this.platformDefined=!1,N(e)&&(e={name:e}),this.type=t,this.name=e.name,this.template=e.template,this.templateOptions=e.templateOptions,this.registry=(s=e.registry)!==null&&s!==void 0?s:customElements;const n=t.prototype,r=J.collect(t,e.attributes),a=new Array(r.length),c={},d={};for(let l=0,o=r.length;l<o;++l){const h=r[l];a[l]=h.attribute,c[h.name]=h,d[h.attribute]=h,p.defineProperty(n,h)}Reflect.defineProperty(t,"observedAttributes",{value:a,enumerable:!0}),this.attributes=r,this.propertyLookup=c,this.attributeLookup=d,this.shadowOptions=e.shadowOptions===void 0?Ht:e.shadowOptions===null?void 0:Object.assign(Object.assign({},Ht),e.shadowOptions),this.elementOptions=e.elementOptions===void 0?It:Object.assign(Object.assign({},It),e.elementOptions),this.styles=m.normalize(e.styles),R.register(this),p.defineProperty(f.isRegistered,this.name),f.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(t=this.registry){var e,s;const n=this.type;return t.get(this.name)||(this.platformDefined=!0,t.define(this.name,n,this.elementOptions),(s=(e=this.lifecycleCallbacks)===null||e===void 0?void 0:e.elementDidDefine)===null||s===void 0||s.call(e,this.name)),this}static compose(t,e){return rt.has(t)||R.getByType(t)?new f(class extends t{},e):new f(t,e)}static registerBaseType(t){rt.add(t)}static composeAsync(t,e){return new Promise(s=>{(rt.has(t)||R.getByType(t))&&s(new f(class extends t{},e));const n=new f(t,e);p.getNotifier(n).subscribe({handleChange:()=>{var r,a;(a=(r=n.lifecycleCallbacks)===null||r===void 0?void 0:r.templateDidUpdate)===null||a===void 0||a.call(r,n.name),s(n)}},"template")})}}f.isRegistered={};f.getByType=R.getByType;f.getForInstance=R.getForInstance;f.registerAsync=i=>Ge(void 0,void 0,void 0,function*(){return new Promise(t=>{f.isRegistered[i]&&t(f.isRegistered[i]),p.getNotifier(f.isRegistered).subscribe({handleChange:()=>t(f.isRegistered[i])},i)})});p.defineProperty(f.prototype,"template");class Ke extends MutationObserver{constructor(t){function e(s){this.callback.call(null,s.filter(n=>this.observedNodes.has(n.target)))}super(e),this.callback=t,this.observedNodes=new Set}observe(t,e){this.observedNodes.add(t),super.observe(t,e)}unobserve(t){this.observedNodes.delete(t),this.observedNodes.size<1&&this.disconnect()}}const Xe=Object.freeze({create(i){const t=[],e={};let s=null,n=!1;return{source:i,context:A.default,targets:e,get isBound(){return n},addBehaviorFactory(r,a){var c,d,l,o;const h=r;h.id=(c=h.id)!==null&&c!==void 0?c:j(),h.targetNodeId=(d=h.targetNodeId)!==null&&d!==void 0?d:j(),h.targetTagName=(l=a.tagName)!==null&&l!==void 0?l:null,h.policy=(o=h.policy)!==null&&o!==void 0?o:C.policy,this.addTarget(h.targetNodeId,a),this.addBehavior(h.createBehavior())},addTarget(r,a){e[r]=a},addBehavior(r){t.push(r),n&&r.bind(this)},onUnbind(r){s===null&&(s=[]),s.push(r)},connectedCallback(r){n||(n=!0,t.forEach(a=>a.bind(this)))},disconnectedCallback(r){n&&(n=!1,s!==null&&s.forEach(a=>a.unbind(this)))}}}}),Ye={bubbles:!0,composed:!0,cancelable:!0},W="isConnected",de=new WeakMap;function L(i){var t,e;return(e=(t=i.shadowRoot)!==null&&t!==void 0?t:de.get(i))!==null&&e!==void 0?e:null}let Dt;class $ extends Kt{constructor(t,e){super(t),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=t,this.definition=e,this.shadowOptions=e.shadowOptions;const s=p.getAccessors(t);if(s.length>0){const n=this.boundObservables=Object.create(null);for(let r=0,a=s.length;r<a;++r){const c=s[r].name,d=t[c];d!==void 0&&(delete t[c],n[c]=d)}}}get isConnected(){return p.track(this,W),this.stage===1}get context(){var t,e;return(e=(t=this.view)===null||t===void 0?void 0:t.context)!==null&&e!==void 0?e:A.default}get isBound(){var t,e;return(e=(t=this.view)===null||t===void 0?void 0:t.isBound)!==null&&e!==void 0?e:!1}get sourceLifetime(){var t;return(t=this.view)===null||t===void 0?void 0:t.sourceLifetime}get template(){var t;if(this._template===null){const e=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():e.template&&(this._template=(t=e.template)!==null&&t!==void 0?t:null)}return this._template}set template(t){this._template!==t&&(this._template=t,this.needsInitialization||this.renderTemplate(t))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(t){if(this._shadowRootOptions===void 0&&t!==void 0){this._shadowRootOptions=t;let e=this.source.shadowRoot;e?this.hasExistingShadowRoot=!0:(e=this.source.attachShadow(t),t.mode==="closed"&&de.set(this.source,e))}}get mainStyles(){var t;if(this._mainStyles===null){const e=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():e.styles&&(this._mainStyles=(t=e.styles)!==null&&t!==void 0?t:null)}return this._mainStyles}set mainStyles(t){this._mainStyles!==t&&(this._mainStyles!==null&&this.removeStyles(this._mainStyles),this._mainStyles=t,this.needsInitialization||this.addStyles(t))}onUnbind(t){var e;(e=this.view)===null||e===void 0||e.onUnbind(t)}addBehavior(t){var e,s;const n=(e=this.behaviors)!==null&&e!==void 0?e:this.behaviors=new Map,r=(s=n.get(t))!==null&&s!==void 0?s:0;r===0?(n.set(t,1),t.addedCallback&&t.addedCallback(this),t.connectedCallback&&!this.guardBehaviorConnection&&(this.stage===1||this.stage===0)&&t.connectedCallback(this)):n.set(t,r+1)}removeBehavior(t,e=!1){const s=this.behaviors;if(s===null)return;const n=s.get(t);n!==void 0&&(n===1||e?(s.delete(t),t.disconnectedCallback&&this.stage!==3&&t.disconnectedCallback(this),t.removedCallback&&t.removedCallback(this)):s.set(t,n-1))}addStyles(t){var e;if(!t)return;const s=this.source;if(t instanceof HTMLElement)((e=L(s))!==null&&e!==void 0?e:this.source).append(t);else if(!t.isAttachedTo(s)){const n=t.behaviors;if(t.addStylesTo(s),n!==null)for(let r=0,a=n.length;r<a;++r)this.addBehavior(n[r])}}removeStyles(t){var e;if(!t)return;const s=this.source;if(t instanceof HTMLElement)((e=L(s))!==null&&e!==void 0?e:s).removeChild(t);else if(t.isAttachedTo(s)){const n=t.behaviors;if(t.removeStylesFrom(s),n!==null)for(let r=0,a=n.length;r<a;++r)this.removeBehavior(n[r])}}connect(){this.stage===3&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):this.view!==null&&this.view.bind(this.source),this.stage=1,p.notify(this,W))}bindObservables(){if(this.boundObservables!==null){const t=this.source,e=this.boundObservables,s=Object.keys(e);for(let n=0,r=s.length;n<r;++n){const a=s[n];t[a]=e[a]}this.boundObservables=null}}connectBehaviors(){if(this.behaviorsConnected===!1){const t=this.behaviors;if(t!==null){this.guardBehaviorConnection=!0;for(const e of t.keys())e.connectedCallback&&e.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(this.behaviorsConnected===!0){const t=this.behaviors;if(t!==null)for(const e of t.keys())e.disconnectedCallback&&e.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===1&&(this.stage=2,p.notify(this,W),this.view!==null&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(t,e,s){const n=this.definition.attributeLookup[t];n!==void 0&&n.onAttributeChangedCallback(this.source,s)}emit(t,e,s){return this.stage===1?this.source.dispatchEvent(new CustomEvent(t,Object.assign(Object.assign({detail:e},Ye),s))):!1}renderTemplate(t){var e;const s=this.source,n=(e=L(s))!==null&&e!==void 0?e:s;if(this.view!==null)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let r=n.firstChild;r!==null;r=n.firstChild)n.removeChild(r)}t&&(this.view=t.render(s,n,s),this.view.sourceLifetime=Z.coupled)}static forCustomElement(t,e=!1){const s=t.$fastController;if(s!==void 0&&!e)return s;const n=f.getForInstance(t);if(n===void 0)throw y.error(1401);return p.getNotifier(n).subscribe({handleChange:()=>{$.forCustomElement(t,!0),t.$fastController.connect()}},"template"),p.getNotifier(n).subscribe({handleChange:()=>{$.forCustomElement(t,!0),t.$fastController.connect()}},"shadowOptions"),t.$fastController=new Dt(t,n)}static setStrategy(t){Dt=t}}E($);$.setStrategy($);function K(i){var t;return"adoptedStyleSheets"in i?i:(t=L(i))!==null&&t!==void 0?t:i.getRootNode()}class st{constructor(t){const e=st.styleSheetCache;this.sheets=t.map(s=>{if(s instanceof CSSStyleSheet)return s;let n=e.get(s);return n===void 0&&(n=new CSSStyleSheet,n.replaceSync(s),e.set(s,n)),n})}addStylesTo(t){he(K(t),this.sheets)}removeStylesFrom(t){ue(K(t),this.sheets)}}st.styleSheetCache=new Map;let Ze=0;const ti=()=>`fast-${++Ze}`;function Pt(i){return i===document?document.body:i}class ei{constructor(t){this.styles=t,this.styleClass=ti()}addStylesTo(t){t=Pt(K(t));const e=this.styles,s=this.styleClass;for(let n=0;n<e.length;n++){const r=document.createElement("style");r.innerHTML=e[n],r.className=s,t.append(r)}}removeStylesFrom(t){t=Pt(K(t));const e=t.querySelectorAll(`.${this.styleClass}`);for(let s=0,n=e.length;s<n;++s)t.removeChild(e[s])}}let he=(i,t)=>{i.adoptedStyleSheets=[...i.adoptedStyleSheets,...t]},ue=(i,t)=>{i.adoptedStyleSheets=i.adoptedStyleSheets.filter(e=>t.indexOf(e)===-1)};if(m.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),he=(i,t)=>{i.adoptedStyleSheets.push(...t)},ue=(i,t)=>{for(const e of t){const s=i.adoptedStyleSheets.indexOf(e);s!==-1&&i.adoptedStyleSheets.splice(s,1)}}}catch{}m.setDefaultStrategy(st)}else m.setDefaultStrategy(ei);const ot="defer-hydration",I="needs-hydration";class v extends ${static config(t){return v.lifecycleCallbacks=t,this}static hydrationObserverHandler(t){for(const e of t)v.hydrationObserver.unobserve(e.target),e.target.$fastController.connect()}static checkHydrationComplete(){var t,e;document.querySelector(`[${I}]`)||(e=(t=v.lifecycleCallbacks)===null||t===void 0?void 0:t.hydrationComplete)===null||e===void 0||e.call(t)}static forCustomElement(t,e){const s=f.getForInstance(t);return s?.templateOptions===Je.deferAndHydrate&&!s.template&&(t.toggleAttribute(ot,!0),t.toggleAttribute(I,!0)),super.forCustomElement(t,e)}connect(){var t,e,s,n,r,a;if(this.needsHydration===void 0&&(this.needsHydration=this.source.getAttribute(I)!==null),this.source.hasAttribute(ot)){v.hydrationObserver.observe(this.source,{attributeFilter:[ot]});return}if(!this.needsHydration){super.connect();return}if(this.stage!==3)return;(e=(t=v.lifecycleCallbacks)===null||t===void 0?void 0:t.elementWillHydrate)===null||e===void 0||e.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors();const c=this.source,d=(s=L(c))!==null&&s!==void 0?s:c;if(this.template)if(V(this.template)){let l=d.firstChild,o=d.lastChild;c.shadowRoot===null&&(w.isElementBoundaryStartMarker(l)&&(l.data="",l=l.nextSibling),w.isElementBoundaryEndMarker(o)&&(o.data="",o=o.previousSibling)),this.view=this.template.hydrate(l,o,c),(n=this.view)===null||n===void 0||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(I),this.needsInitialization=this.needsHydration=!1,p.notify(this,W),(a=(r=v.lifecycleCallbacks)===null||r===void 0?void 0:r.elementDidHydrate)===null||a===void 0||a.call(r,this.definition.name),v.checkHydrationComplete()}disconnect(){super.disconnect(),v.hydrationObserver.unobserve(this.source)}static install(){$.setStrategy(v)}}v.hydrationObserver=new Ke(v.hydrationObserverHandler);var ii=function(i,t,e,s){function n(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(o){try{l(s.next(o))}catch(h){a(h)}}function d(o){try{l(s.throw(o))}catch(h){a(h)}}function l(o){o.done?r(o.value):n(o.value).then(c,d)}l((s=s.apply(i,t||[])).next())})};function fe(i){const t=class extends i{constructor(){super(),$.forCustomElement(this)}$emit(e,s,n){return this.$fastController.emit(e,s,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,s,n){this.$fastController.onAttributeChangedCallback(e,s,n)}};return f.registerBaseType(t),t}function si(i,t){return M(i)?f.compose(i,t):f.compose(this,i)}function ni(i,t){return ii(this,void 0,void 0,function*(){return M(i)?(yield f.composeAsync(i,t)).define().type:(yield f.composeAsync(this,i)).define().type})}function ri(i,t){return M(i)?f.compose(i,t).define().type:f.compose(this,i).define().type}function oi(i){return fe(i)}const ai=Object.assign(fe(HTMLElement),{from:oi,define:ri,compose:si,defineAsync:ni});function li(i,t){return i instanceof Function?i(t):i}const zt=new Set,at=new Map,ci=i=>(t="vwc")=>{const e=n=>`${t}-${n}`,s=n=>{const r=e(n.name);let a=n.type;if(a.componentName=n.name,zt.has(r))return;at.has(a)&&at.get(a)!==r&&(a=class extends a{}),zt.add(r),at.set(a,r);for(const o of n.dependencies)s(o);const c=new Map([[n.type,r],...n.dependencies.map(o=>[o.type,e(o.name)])]),l={tagFor:(o,h)=>{if(!c.has(o))throw new Error(`Could not get tag for ${o.name} as it is not a dependency of ${n.name}.`);const u=c.get(o);return h?u:yt.partial(u)},tagForNonDependency(o){return e(o)}};f.compose(a,{...n.options,template:li(n.template,l),name:`${t}-${n.name}`}).define()};s(i)},di=(i,t,e,s,n)=>({name:i,type:t,template:e,dependencies:s,options:n}),Ut=new WeakMap,pe=i=>{let t=Ut.get(i);return t||(t=[],Ut.set(i,t)),t},hi=(i,t)=>{pe(i).push(t)},ui=(i,t)=>{pe(i).forEach(e=>e(i,t))},fi=i=>i==="delegate",Wt=i=>`vvd${i.charAt(0).toUpperCase()}${i.slice(1)}`,be=(i,t)=>{if(fi(i._vividAriaBehaviour)){const e=i[t];i[`_${t}`]=null,i.removeAttribute(Y(t)),i[`_${t}`]=e,i[t]!==null?i.dataset[Wt(t)]=i[t]:delete i.dataset[Wt(t)]}else C.setAttribute(i,Y(t),i[t])},X=new WeakMap,pi=(i,t)=>{const e=X.get(i);e?e.add(t):X.set(i,new Set([t]))},bi=(i,t)=>{i.isConnected?be(i,t):pi(i,t)},gi=i=>{const t=X.get(i);if(t){for(const e of t)be(i,e);X.delete(i)}},ct=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColIndexText","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowIndexText","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","ariaRelevant"],Y=i=>i.replace("aria","aria-").toLowerCase(),yi=i=>{class t extends i{constructor(...s){super(...s),this._vividAriaBehaviour="default";for(const n of ct)this[`_${n}`]=null}connectedCallback(){super.connectedCallback(),gi(this)}}for(const e of ct)ce({attribute:Y(e),mode:"fromView"})(t.prototype,e),t.prototype[`${e}Changed`]=function(){bi(this,e),this._vividAriaBehaviour!=="default"&&ui(this,e)};return t};function vi(){const i=new WeakMap;return t=>(i.has(t)||i.set(t,[]),i.get(t))}const ge=vi(),mi=i=>(t,e)=>{ge(t.constructor).push({newPropertyName:e,...i})},wi=i=>{class t extends i{#t(s){let n=!1,r=!1;const a=o=>r&&s.fromDeprecated(o[s.deprecatedPropertyName])===o[s.newPropertyName],c=o=>n&&s.toDeprecated&&s.toDeprecated(o[s.newPropertyName])===o[s.deprecatedPropertyName],d={handleChange(o,h){if(h===s.newPropertyName){if(n=!0,!s.toDeprecated||a(o))return;o[s.deprecatedPropertyName]=s.toDeprecated(o[s.newPropertyName])}if(h===s.deprecatedPropertyName){if(r=!0,c(o))return;o[s.newPropertyName]=s.fromDeprecated(o[s.deprecatedPropertyName])}}},l=p.getNotifier(this);l.subscribe(d,s.newPropertyName),l.subscribe(d,s.deprecatedPropertyName)}constructor(...s){super(...s);for(const n of ge(this.constructor))this.#t(n)}}return t};class Si extends yi(wi(ai)){static{this.VIVID_VERSION="5.5.0"}connectedCallback(){super.connectedCallback();const t=this.constructor.componentName;this.setAttribute("data-vvd-component",t)}}exports.Binding=tt;exports.DOM=C;exports.ElementStyles=m;exports.ExecutionContext=A;exports.HTMLDirective=T;exports.HTMLView=H;exports.HydrationMarkup=w;exports.HydrationStage=B;exports.Markup=pt;exports.Observable=p;exports.StatelessAttachedAttributeDirective=Zt;exports.SubscriberSet=q;exports.Updates=dt;exports.ViewBehaviorOrchestrator=Xe;exports.VividElement=Si;exports.ariaAttributeName=Y;exports.ariaMixinProperties=ct;exports.attr=ce;exports.commonjsGlobal=P;exports.createRegisterFunction=ci;exports.defineVividComponent=di;exports.emptyArray=me;exports.getAugmentedNamespace=ve;exports.getDefaultExportFromCjs=ye;exports.html=yt;exports.isFunction=M;exports.isHydratable=V;exports.isString=N;exports.noop=qt;exports.nullableNumberConverter=Qe;exports.observable=Ce;exports.oneTime=ut;exports.oneWay=ht;exports.replaces=mi;exports.subscribeToAriaPropertyChanges=hi;exports.volatile=Te;
|
package/bundled/vivid-element.js
CHANGED
|
@@ -2706,7 +2706,7 @@ const fe = li(), wi = (i) => (t, e) => {
|
|
|
2706
2706
|
};
|
|
2707
2707
|
class Si extends ai(ci(ti)) {
|
|
2708
2708
|
static {
|
|
2709
|
-
this.VIVID_VERSION = "5.
|
|
2709
|
+
this.VIVID_VERSION = "5.5.0";
|
|
2710
2710
|
}
|
|
2711
2711
|
/**
|
|
2712
2712
|
* Add data-vvd-component attribute with component name globally,
|
package/calendar/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";const l=require("../bundled/vivid-element.cjs"),q=require("../bundled/enums.cjs"),x=require("../bundled/calendar-event.cjs"),a=require("../bundled/_has.cjs"),m=require("../bundled/repeat.cjs"),I=require("../bundled/class-names.cjs"),$=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function v(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function w(t,e,r){for(var n=0,o=r.length;n<o;){if(t(e,r[n]))return!0;n+=1}return!1}function z(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function H(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}const g=typeof Object.is=="function"?Object.is:H;var b=Object.prototype.toString,D=function(){return b.call(arguments)==="[object Arguments]"?function(e){return b.call(e)==="[object Arguments]"}:function(e){return a._has("callee",e)}}(),R=!{toString:null}.propertyIsEnumerable("toString"),A=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=function(){return arguments.propertyIsEnumerable("length")}(),T=function(e,r){for(var n=0;n<e.length;){if(e[n]===r)return!0;n+=1}return!1},_=typeof Object.keys=="function"&&!k?a._curry1(function(e){return Object(e)!==e?[]:Object.keys(e)}):a._curry1(function(e){if(Object(e)!==e)return[];var r,n,o=[],i=k&&D(e);for(r in e)a._has(r,e)&&(!i||r!=="length")&&(o[o.length]=r);if(R)for(n=A.length-1;n>=0;)r=A[n],a._has(r,e)&&!T(o,r)&&(o[o.length]=r),n-=1;return o}),O=a._curry1(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function E(t,e,r,n){var o=v(t),i=v(e);function s(c,d){return y(c,d,r.slice(),n.slice())}return!w(function(c,d){return!w(s,d,c)},i,o)}function y(t,e,r,n){if(g(t,e))return!0;var o=O(t);if(o!==O(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(o){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&z(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&g(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!g(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var i=r.length-1;i>=0;){if(r[i]===t)return n[i]===e;i-=1}switch(o){case"Map":return t.size!==e.size?!1:E(t.entries(),e.entries(),r.concat([t]),n.concat([e]));case"Set":return t.size!==e.size?!1:E(t.values(),e.values(),r.concat([t]),n.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var s=_(t);if(s.length!==_(e).length)return!1;var c=r.concat([t]),d=n.concat([e]);for(i=s.length-1;i>=0;){var f=s[i];if(!(a._has(f,e)&&y(e[f],t[f],c,d)))return!1;i-=1}return!0}var M=a._curry2(function(e,r){return y(e,r,[],[])});function F(t){return Object.prototype.toString.call(t)==="[object Object]"}function N(t){return Object.prototype.toString.call(t)==="[object String]"}var U=a._curry1(function(e){return!e});function P(t){var e=Object.prototype.toString.call(t);return e==="[object Uint8ClampedArray]"||e==="[object Int8Array]"||e==="[object Uint8Array]"||e==="[object Int16Array]"||e==="[object Uint16Array]"||e==="[object Int32Array]"||e==="[object Uint32Array]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object BigInt64Array]"||e==="[object BigUint64Array]"}var L=a._curry1(function(e){return e!=null&&typeof e["fantasy-land/empty"]=="function"?e["fantasy-land/empty"]():e!=null&&e.constructor!=null&&typeof e.constructor["fantasy-land/empty"]=="function"?e.constructor["fantasy-land/empty"]():e!=null&&typeof e.empty=="function"?e.empty():e!=null&&e.constructor!=null&&typeof e.constructor.empty=="function"?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:$(e)?[]:N(e)?"":F(e)?{}:D(e)?function(){return arguments}():P(e)?e.constructor.from(""):void 0}),W=a._curry1(function(e){return e!=null&&M(e,L(e))});const B=':host{display:block;overflow:auto;block-size:inherit;max-block-size:inherit}ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:"filler column-headers" "row-headers calendar";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.sticky-column .row-headers,.sticky-all .row-headers{position:sticky;z-index:1;background-color:var(--calendar-column-background-color, var(--vvd-color-canvas));inset-inline-start:0;margin-inline-end:3px}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;border-radius:8px;background:var(--vvd-color-surface-2dp);counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:"";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:"";inset:0}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:"";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content;inset-inline-start:0}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}.sticky-header .column-headers,.sticky-all .column-headers{position:sticky;z-index:1;background-color:var(--calendar-header-background-color, var(--vvd-color-canvas));inset-block-start:0;margin-block-end:3px}.filler{background-color:transparent;grid-area:filler}.sticky-header .filler,.sticky-all .filler,.sticky-column .filler{position:sticky;z-index:2;background-color:var(--calendar-header-background-color, var(--vvd-color-canvas));margin-block-end:3px}.sticky-column .filler{inset-inline-start:0}.sticky-header .filler{inset-block-start:0}.sticky-all .filler{inset-block-start:0;inset-inline-start:0}',S="ArrowUp",C="ArrowRight",p="ArrowDown",j="ArrowLeft";function K(t){return t instanceof HTMLElement&&(t.matches('[role="gridcell"i]')||t.matches('[role="columnheader"i]'))}const Y=t=>t.matches('[role="columnheader"i]')?'[role="gridcell"i]':'[role="columnheader"i]';function V(t,e){if(e.parentNode instanceof HTMLElement)switch(t){case C:return e.nextElementSibling||e.parentNode.firstElementChild;case j:return e.previousElementSibling||e.parentNode.lastElementChild;case S:case p:{const{children:r}=e.parentNode,n=Array.from(r).indexOf(e);return this.shadowRoot.querySelector(`${Y(e)}:nth-child(${n+1})`)}}}function G(t,e){if(t!==p)return;const r=e.closest('[role="columnheader"i]'),n=this.shadowRoot.querySelectorAll('[role="columnheader"i]'),o=Array.from(n).indexOf(r);return this.shadowRoot.querySelector(`[role="gridcell"i]:nth-child(${o+1})`)}function X(t){const e=t.closest('[role="gridcell"i], [role="columnheader"i]');if(e){const{parentElement:r}=e;if(r)return r.children&&Array.from(r.children).indexOf(e)}}function J(t,e,r){const n=e.closest('[role="rowheader"], [role="gridcell"i]');if(n){const o=n.getBoundingClientRect(),i=t.clientY-o.y,s=o.height/r,c=i/s;return Math.round((c+Number.EPSILON)*100)/100}}const Q=function(t){if(!(t instanceof KeyboardEvent||t instanceof MouseEvent))throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");const[e]=t.composedPath();if(!(e&&e instanceof HTMLElement&&this.shadowRoot.contains(e)))throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");const r=X(e);let n;t instanceof MouseEvent&&(n=J(t,e,this._hours));const o={...r!=null&&{day:r},...n!=null&&{hour:n}};return U(W(o))?o:null};var Z=Object.defineProperty,h=(t,e,r,n)=>{for(var o=void 0,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=s(e,r,o)||o);return o&&Z(e,r,o),o};const ee=t=>{const e=window.getComputedStyle(t).overflowY,r=window.getComputedStyle(t).overflowX;return{vertical:(e==="auto"||e==="scroll")&&t.scrollHeight>t.clientHeight,horizontal:(r==="auto"||r==="scroll")&&t.scrollWidth>t.clientWidth}};class u extends l.VividElement{constructor(){super(...arguments),this.hour12=!1,this.stickyMode=q.Sticky.All,this._hours=24,this._days=7,this.hoursAsDatetime=Array.from({length:this._hours-1}).fill(new Date(new Date().setHours(0,0,0))).map((e,r)=>new Date(e.setHours(++r))),this._generateDaysArr=e=>{if(e.length==this._days)return e;const r=new Date(e[e.length-1]);return r.setDate(r.getDate()+1),this._generateDaysArr([...e,r])},this.getEventContext=Q}get#e(){const{activeElement:e}=document;return e instanceof x.CalendarEvent?e:null}getCalendarEventContainingCell(e){const r=e.getAttribute("slot");return this.shadowRoot.querySelector(`slot[name="${r}"i]`).parentElement}arrowKeysInteractions(e){const{activeElement:r}=this.shadowRoot;let n;K(r)?n=V.call(this,e,r):this.#e?n=this.getCalendarEventContainingCell(this.#e):r?.matches('em[role="button"i]')?n=G.call(this,e,r):n=this.shadowRoot.querySelector('[role="columnheader"i]'),this.activateElement(n)}activateElement(e){const r=({target:n})=>n.setAttribute("tabindex","-1");e?.addEventListener("blur",r,{once:!0}),e?.setAttribute("tabindex","0"),e?.focus()}onKeydown({key:e}){const r=[S,C,p,j].some(n=>n==e);return r&&this.arrowKeysInteractions(e),!r}connectedCallback(){super.connectedCallback(),this.initializeScrollPosition()}initializeScrollPosition(){if(!ee(this).vertical)return;const n=this.scrollHeight/this._hours*(8-1);l.Updates.enqueue(()=>{this.scrollTo({top:n})})}}h([l.attr],u.prototype,"datetime");h([l.attr({attribute:"start-day"})],u.prototype,"startDay");h([l.attr],u.prototype,"locales");h([l.attr({mode:"boolean"})],u.prototype,"hour12");h([l.attr({attribute:"sticky-mode",mode:"fromView"})],u.prototype,"stickyMode");function te(t){const e=r=>`0${r}`.slice(-2);return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}`}const re=new Map([["sunday",0],["monday",1]]);function ne(t=new Date,e){t=new Date(t);let r=re.get(e);r??=1;const n=t.getDate()-(t.getDay()+7-r)%7;return new Date(t.setDate(n))}const oe=({stickyMode:t})=>I.classNames([`sticky-${t}`,!!t]),ie=()=>l.html` <div class="row-headers" role="row">
|
|
2
|
-
${
|
|
1
|
+
"use strict";const l=require("../bundled/vivid-element.cjs"),I=require("../bundled/enums.cjs"),$=require("../bundled/calendar-event.cjs"),f=require("../bundled/repeat.cjs"),z=require("../bundled/class-names.cjs"),H=':host{display:block;overflow:auto;block-size:inherit;max-block-size:inherit}ol{padding:0;margin:0;list-style:none}[role=grid i]{position:relative;z-index:0;display:grid;margin:auto;grid-template-areas:"filler column-headers" "row-headers calendar";grid-template-columns:min-content auto;inline-size:max(100%,500px);min-inline-size:880px}.row-headers{display:grid;grid-area:row-headers;grid-template-rows:repeat(24,1fr);margin-inline-end:2px}.row-headers>[role=rowheader i]{display:flex;align-items:flex-end;justify-content:flex-end}.row-headers>[role=rowheader i]>time{font:var(--vvd-typography-base-condensed);font-size:small;line-height:1;text-transform:uppercase;white-space:nowrap}.sticky-column .row-headers,.sticky-all .row-headers{position:sticky;z-index:1;background-color:var(--calendar-column-background-color, var(--vvd-color-canvas));inset-inline-start:0;margin-inline-end:3px}.calendar-row{display:contents}.calendar-grid-presentation{display:grid;overflow:hidden;border-radius:8px;background:var(--vvd-color-surface-2dp);counter-reset:listing;filter:var(--vvd-shadow-surface-2dp);gap:1px;grid-area:calendar;grid-auto-flow:column;grid-template:repeat(24,1fr)/repeat(7,1fr)}.hours{display:contents}.hours>[role=listitem i]{position:relative;grid-column:1/8;grid-row:var(--row);min-block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));pointer-events:none}.hours>[role=listitem i]:not(:first-child):after{position:absolute;border-block-end:var(--vvd-color-neutral-100) 1px solid;content:"";inline-size:100%;margin-block-start:-1px}.hours>[role=listitem i]:nth-child(24n+1){--row: 1}.hours>[role=listitem i]:nth-child(24n+2){--row: 2}.hours>[role=listitem i]:nth-child(24n+3){--row: 3}.hours>[role=listitem i]:nth-child(24n+4){--row: 4}.hours>[role=listitem i]:nth-child(24n+5){--row: 5}.hours>[role=listitem i]:nth-child(24n+6){--row: 6}.hours>[role=listitem i]:nth-child(24n+7){--row: 7}.hours>[role=listitem i]:nth-child(24n+8){--row: 8}.hours>[role=listitem i]:nth-child(24n+9){--row: 9}.hours>[role=listitem i]:nth-child(24n+10){--row: 10}.hours>[role=listitem i]:nth-child(24n+11){--row: 11}.hours>[role=listitem i]:nth-child(24n+12){--row: 12}.hours>[role=listitem i]:nth-child(24n+13){--row: 13}.hours>[role=listitem i]:nth-child(24n+14){--row: 14}.hours>[role=listitem i]:nth-child(24n+15){--row: 15}.hours>[role=listitem i]:nth-child(24n+16){--row: 16}.hours>[role=listitem i]:nth-child(24n+17){--row: 17}.hours>[role=listitem i]:nth-child(24n+18){--row: 18}.hours>[role=listitem i]:nth-child(24n+19){--row: 19}.hours>[role=listitem i]:nth-child(24n+20){--row: 20}.hours>[role=listitem i]:nth-child(24n+21){--row: 21}.hours>[role=listitem i]:nth-child(24n+22){--row: 22}.hours>[role=listitem i]:nth-child(24n+23){--row: 23}.hours>[role=listitem i]:nth-child(24n+24){--row: 24}[role=gridcell i]{display:grid;gap:1px;grid-auto-flow:column}[role=gridcell i],[role=columnheader i],[role=columnheader i] [role=button i]{position:relative}[role=gridcell i]:before,[role=columnheader i]:before,[role=columnheader i] [role=button i]:before{position:absolute;z-index:-1;background-color:var(--vvd-color-information-400);content:"";inset:0}[role=gridcell i]:focus,[role=columnheader i]:focus,[role=columnheader i] [role=button i]:focus{outline:none}[role=gridcell i]:not(:focus-visible):before,[role=columnheader i]:not(:focus-visible):before,[role=columnheader i] [role=button i]:not(:focus-visible):before{display:none}.columns{display:contents}.columns>[role=gridcell i]{position:relative;grid-column:var(--column);grid-row:1/25}.columns>[role=gridcell i]:nth-child(1){--column: 1}.columns>[role=gridcell i]:nth-child(2){--column: 2}.columns>[role=gridcell i]:nth-child(3){--column: 3}.columns>[role=gridcell i]:nth-child(4){--column: 4}.columns>[role=gridcell i]:nth-child(5){--column: 5}.columns>[role=gridcell i]:nth-child(6){--column: 6}.columns>[role=gridcell i]:nth-child(7){--column: 7}.columns>[role=gridcell i]:not(:first-child):after{position:absolute;block-size:100%;border-inline-end:var(--vvd-color-neutral-100) 1px solid;content:"";margin-inline-start:-1px}.column-headers{display:grid;grid-area:column-headers;grid-template-columns:repeat(7,1fr)}.column-headers [role=columnheader i] h2{display:grid;align-items:baseline;margin:0;font:var(--vvd-typography-heading-4);grid-template-columns:1fr auto 1fr}.column-headers [role=columnheader i] h2>em{font:inherit;inline-size:min-content;inset-inline-start:0}.column-headers [role=columnheader i] h2>small{font:var(--vvd-typography-base-condensed);text-transform:uppercase}.sticky-header .column-headers,.sticky-all .column-headers{position:sticky;z-index:1;background-color:var(--calendar-header-background-color, var(--vvd-color-canvas));inset-block-start:0;margin-block-end:3px}.filler{background-color:transparent;grid-area:filler}.sticky-header .filler,.sticky-all .filler,.sticky-column .filler{position:sticky;z-index:2;background-color:var(--calendar-header-background-color, var(--vvd-color-canvas));margin-block-end:3px}.sticky-column .filler{inset-inline-start:0}.sticky-header .filler{inset-block-start:0}.sticky-all .filler{inset-block-start:0;inset-inline-start:0}',C="ArrowUp",j="ArrowRight",v="ArrowDown",q="ArrowLeft";function R(t){return t instanceof HTMLElement&&(t.matches('[role="gridcell"i]')||t.matches('[role="columnheader"i]'))}const T=t=>t.matches('[role="columnheader"i]')?'[role="gridcell"i]':'[role="columnheader"i]';function M(t,e){if(e.parentNode instanceof HTMLElement)switch(t){case j:return e.nextElementSibling||e.parentNode.firstElementChild;case q:return e.previousElementSibling||e.parentNode.lastElementChild;case C:case v:{const{children:r}=e.parentNode,n=Array.from(r).indexOf(e);return this.shadowRoot.querySelector(`${T(e)}:nth-child(${n+1})`)}}}function F(t,e){if(t!==v)return;const r=e.closest('[role="columnheader"i]'),n=this.shadowRoot.querySelectorAll('[role="columnheader"i]'),o=Array.from(n).indexOf(r);return this.shadowRoot.querySelector(`[role="gridcell"i]:nth-child(${o+1})`)}function u(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function s(t){return function e(r){return arguments.length===0||u(r)?e:t.apply(this,arguments)}}function N(t){return function e(r,n){switch(arguments.length){case 0:return e;case 1:return u(r)?e:s(function(o){return t(r,o)});default:return u(r)&&u(n)?e:u(r)?s(function(o){return t(o,n)}):u(n)?s(function(o){return t(r,o)}):t(r,n)}}}const P=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function b(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function A(t,e,r){for(var n=0,o=r.length;n<o;){if(t(e,r[n]))return!0;n+=1}return!1}function U(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function g(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function L(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}const y=typeof Object.is=="function"?Object.is:L;var k=Object.prototype.toString,x=function(){return k.call(arguments)==="[object Arguments]"?function(e){return k.call(e)==="[object Arguments]"}:function(e){return g("callee",e)}}(),W=!{toString:null}.propertyIsEnumerable("toString"),O=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],E=function(){return arguments.propertyIsEnumerable("length")}(),B=function(e,r){for(var n=0;n<e.length;){if(e[n]===r)return!0;n+=1}return!1},D=s(typeof Object.keys=="function"&&!E?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var r,n,o=[],i=E&&x(e);for(r in e)g(r,e)&&(!i||r!=="length")&&(o[o.length]=r);if(W)for(n=O.length-1;n>=0;)r=O[n],g(r,e)&&!B(o,r)&&(o[o.length]=r),n-=1;return o}),S=s(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function _(t,e,r,n){var o=b(t),i=b(e);function a(c,h){return w(c,h,r.slice(),n.slice())}return!A(function(c,h){return!A(a,h,c)},i,o)}function w(t,e,r,n){if(y(t,e))return!0;var o=S(t);if(o!==S(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(o){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&U(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&y(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!y(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var i=r.length-1;i>=0;){if(r[i]===t)return n[i]===e;i-=1}switch(o){case"Map":return t.size!==e.size?!1:_(t.entries(),e.entries(),r.concat([t]),n.concat([e]));case"Set":return t.size!==e.size?!1:_(t.values(),e.values(),r.concat([t]),n.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=D(t);if(a.length!==D(e).length)return!1;var c=r.concat([t]),h=n.concat([e]);for(i=a.length-1;i>=0;){var p=a[i];if(!(g(p,e)&&w(e[p],t[p],c,h)))return!1;i-=1}return!0}var K=N(function(e,r){return w(e,r,[],[])});function Y(t){return Object.prototype.toString.call(t)==="[object Object]"}function V(t){return Object.prototype.toString.call(t)==="[object String]"}var G=s(function(e){return!e});function X(t){var e=Object.prototype.toString.call(t);return e==="[object Uint8ClampedArray]"||e==="[object Int8Array]"||e==="[object Uint8Array]"||e==="[object Int16Array]"||e==="[object Uint16Array]"||e==="[object Int32Array]"||e==="[object Uint32Array]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object BigInt64Array]"||e==="[object BigUint64Array]"}var J=s(function(e){return e!=null&&typeof e["fantasy-land/empty"]=="function"?e["fantasy-land/empty"]():e!=null&&e.constructor!=null&&typeof e.constructor["fantasy-land/empty"]=="function"?e.constructor["fantasy-land/empty"]():e!=null&&typeof e.empty=="function"?e.empty():e!=null&&e.constructor!=null&&typeof e.constructor.empty=="function"?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:P(e)?[]:V(e)?"":Y(e)?{}:x(e)?function(){return arguments}():X(e)?e.constructor.from(""):void 0}),Q=s(function(e){return e!=null&&K(e,J(e))});function Z(t){const e=t.closest('[role="gridcell"i], [role="columnheader"i]');if(e){const{parentElement:r}=e;if(r)return r.children&&Array.from(r.children).indexOf(e)}}function ee(t,e,r){const n=e.closest('[role="rowheader"], [role="gridcell"i]');if(n){const o=n.getBoundingClientRect(),i=t.clientY-o.y,a=o.height/r,c=i/a;return Math.round((c+Number.EPSILON)*100)/100}}const te=function(t){if(!(t instanceof KeyboardEvent||t instanceof MouseEvent))throw new Error("Invalid event. Event must be instance of KeyboardEvent or MouseEvent");const[e]=t.composedPath();if(!(e&&e instanceof HTMLElement&&this.shadowRoot.contains(e)))throw new Error("Invalid event. Event must contain a target object which is a direct descendant of calendar");const r=Z(e);let n;t instanceof MouseEvent&&(n=ee(t,e,this._hours));const o={...r!=null&&{day:r},...n!=null&&{hour:n}};return G(Q(o))?o:null};var re=Object.defineProperty,m=(t,e,r,n)=>{for(var o=void 0,i=t.length-1,a;i>=0;i--)(a=t[i])&&(o=a(e,r,o)||o);return o&&re(e,r,o),o};const ne=t=>{const e=window.getComputedStyle(t).overflowY,r=window.getComputedStyle(t).overflowX;return{vertical:(e==="auto"||e==="scroll")&&t.scrollHeight>t.clientHeight,horizontal:(r==="auto"||r==="scroll")&&t.scrollWidth>t.clientWidth}};class d extends l.VividElement{constructor(){super(...arguments),this.hour12=!1,this.stickyMode=I.Sticky.All,this._hours=24,this._days=7,this.hoursAsDatetime=Array.from({length:this._hours-1}).fill(new Date(new Date().setHours(0,0,0))).map((e,r)=>new Date(e.setHours(++r))),this._generateDaysArr=e=>{if(e.length==this._days)return e;const r=new Date(e[e.length-1]);return r.setDate(r.getDate()+1),this._generateDaysArr([...e,r])},this.getEventContext=te}get#e(){const{activeElement:e}=document;return e instanceof $.CalendarEvent?e:null}getCalendarEventContainingCell(e){const r=e.getAttribute("slot");return this.shadowRoot.querySelector(`slot[name="${r}"i]`).parentElement}arrowKeysInteractions(e){const{activeElement:r}=this.shadowRoot;let n;R(r)?n=M.call(this,e,r):this.#e?n=this.getCalendarEventContainingCell(this.#e):r?.matches('em[role="button"i]')?n=F.call(this,e,r):n=this.shadowRoot.querySelector('[role="columnheader"i]'),this.activateElement(n)}activateElement(e){const r=({target:n})=>n.setAttribute("tabindex","-1");e?.addEventListener("blur",r,{once:!0}),e?.setAttribute("tabindex","0"),e?.focus()}onKeydown({key:e}){const r=[C,j,v,q].some(n=>n==e);return r&&this.arrowKeysInteractions(e),!r}connectedCallback(){super.connectedCallback(),this.initializeScrollPosition()}initializeScrollPosition(){if(!ne(this).vertical)return;const n=this.scrollHeight/this._hours*(8-1);l.Updates.enqueue(()=>{this.scrollTo({top:n})})}}m([l.attr],d.prototype,"datetime");m([l.attr({attribute:"start-day"})],d.prototype,"startDay");m([l.attr],d.prototype,"locales");m([l.attr({mode:"boolean"})],d.prototype,"hour12");m([l.attr({attribute:"sticky-mode",mode:"fromView"})],d.prototype,"stickyMode");function oe(t){const e=r=>`0${r}`.slice(-2);return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}`}const ie=new Map([["sunday",0],["monday",1]]);function le(t=new Date,e){t=new Date(t);let r=ie.get(e);r??=1;const n=t.getDate()-(t.getDay()+7-r)%7;return new Date(t.setDate(n))}const ae=({stickyMode:t})=>z.classNames([`sticky-${t}`,!!t]),se=()=>l.html` <div class="row-headers" role="row">
|
|
2
|
+
${f.repeat(t=>t.hoursAsDatetime,l.html`<span role="rowheader">
|
|
3
3
|
<time
|
|
4
4
|
datetime="${(t,e)=>new Intl.DateTimeFormat(e.parent.locales,{hour:"numeric",minute:"numeric",hour12:!1}).format(t)}"
|
|
5
5
|
>
|
|
6
6
|
${(t,e)=>new Intl.DateTimeFormat(e.parent.locales,{hour:"numeric",hour12:e.parent.hour12}).format(t)}
|
|
7
7
|
</time>
|
|
8
8
|
</span>`)}
|
|
9
|
-
</div>`,
|
|
10
|
-
${
|
|
11
|
-
<time datetime=${t=>
|
|
9
|
+
</div>`,ce=()=>l.html` <div class="column-headers" role="row">
|
|
10
|
+
${f.repeat(t=>t._generateDaysArr([le(t.datetime,t.startDay)]),l.html` <div role="columnheader" tabindex="-1">
|
|
11
|
+
<time datetime=${t=>oe(t)}>
|
|
12
12
|
<h2>
|
|
13
13
|
<!-- TODO add to column aria-labelledby or describedby to count
|
|
14
14
|
events and related day e.g. "3 events, Sunday, March 8" -->
|
|
@@ -25,29 +25,29 @@
|
|
|
25
25
|
</h2>
|
|
26
26
|
</time>
|
|
27
27
|
</div>`)}
|
|
28
|
-
</div>`,
|
|
28
|
+
</div>`,ue=l.html`
|
|
29
29
|
<div role="gridcell" tabindex="-1">
|
|
30
30
|
<slot name="day-${(t,e)=>e.index}"></slot>
|
|
31
31
|
</div>
|
|
32
|
-
`,
|
|
32
|
+
`,de=l.html`
|
|
33
33
|
<div
|
|
34
34
|
role="grid"
|
|
35
|
-
class="${
|
|
35
|
+
class="${ae}"
|
|
36
36
|
@keydown=${(t,e)=>t.onKeydown(e.event)}
|
|
37
37
|
>
|
|
38
38
|
<div class="filler"></div>
|
|
39
|
-
${
|
|
39
|
+
${ce}
|
|
40
40
|
<div class="calendar-row" role="rowgroup">
|
|
41
|
-
${
|
|
41
|
+
${se}
|
|
42
42
|
<div class="calendar-grid-presentation" role="presentation">
|
|
43
43
|
<div class="hours" role="list">
|
|
44
|
-
${
|
|
44
|
+
${f.repeat(t=>Array.from({length:t.hoursAsDatetime.length+1}),l.html` <div role="listitem"></div>`)}
|
|
45
45
|
</div>
|
|
46
46
|
<div class="columns" role="row">
|
|
47
|
-
${
|
|
47
|
+
${f.repeat(t=>Array.from(Array(t._days)),ue,{positioning:!0})}
|
|
48
48
|
</div>
|
|
49
49
|
<slot></slot>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
52
|
</div>
|
|
53
|
-
`,
|
|
53
|
+
`,he=l.defineVividComponent("calendar",d,de,[],{styles:H,shadowOptions:{delegatesFocus:!0}}),me=l.createRegisterFunction(he);me();
|