@featherk/composables 0.13.4 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,40 @@
1
- import { ref as Y, onBeforeUnmount as Ke, nextTick as _, computed as y, watchEffect as Le, toValue as ne, reactive as ze, watch as le, useId as Ue, unref as Be, onUnmounted as Te, shallowRef as ye, shallowReactive as Ye, readonly as te, onMounted as Re } from "vue";
2
- import { useFocusTrap as He } from "@vueuse/integrations/useFocusTrap";
3
- const wt = (e, t) => {
4
- const r = Y(null);
5
- let c = !1, a = null, d = null;
6
- const w = [], S = ".k-table-row[data-grid-row-index] [tabindex]", $ = () => {
7
- const s = e?.value?.$el;
8
- return s ? s.closest(".k-grid") : null;
9
- }, V = (s) => {
10
- const x = $();
11
- if (!x) return !1;
12
- const m = s.closest(".k-grid-aria-root");
13
- if (m)
14
- return x.contains(m);
15
- const k = s.closest(
1
+ import { ref as Y, onBeforeUnmount as Be, nextTick as G, computed as y, watchEffect as ze, toValue as re, reactive as Ye, watch as ae, useId as He, unref as We, onUnmounted as Te, shallowRef as ve, shallowReactive as Xe, readonly as te, isRef as Fe, onScopeDispose as Pe, onMounted as Re } from "vue";
2
+ import { useFocusTrap as Ze } from "@vueuse/integrations/useFocusTrap";
3
+ const Et = (e, t) => {
4
+ const n = Y(null);
5
+ let u = !1, o = null, c = null;
6
+ const b = [], k = ".k-table-row[data-grid-row-index] [tabindex]", P = () => {
7
+ const a = e?.value?.$el;
8
+ return a ? a.closest(".k-grid") : null;
9
+ }, N = (a) => {
10
+ const m = P();
11
+ if (!m) return !1;
12
+ const v = a.closest(".k-grid-aria-root");
13
+ if (v)
14
+ return m.contains(v);
15
+ const A = a.closest(
16
16
  ".k-grid-header, .k-grid-content, .k-grid-content-locked"
17
17
  );
18
- return k ? x.contains(k) : !1;
19
- }, M = (s) => s.key === "Enter" || s.code === "Enter" || s.code === "NumpadEnter", R = () => e?.value?.columns, E = (s) => {
20
- const x = s.key || s.code;
21
- ([" ", "Spacebar", "Space"].includes(x) || M(s)) && (s.preventDefault(), s.stopPropagation(), r.value = s.target, s.target.click());
22
- }, A = (s) => {
23
- if (!r.value) return;
24
- if (s.code === "Escape") {
25
- s.stopPropagation(), r.value && r.value.focus();
18
+ return A ? m.contains(A) : !1;
19
+ }, M = (a) => a.key === "Enter" || a.code === "Enter" || a.code === "NumpadEnter", R = () => e?.value?.columns, x = (a) => {
20
+ const m = a.key || a.code;
21
+ ([" ", "Spacebar", "Space"].includes(m) || M(a)) && (a.preventDefault(), a.stopPropagation(), n.value = a.target, a.target.click());
22
+ }, D = (a) => {
23
+ if (!n.value) return;
24
+ if (a.code === "Escape") {
25
+ a.stopPropagation(), n.value && n.value.focus();
26
26
  return;
27
27
  }
28
- const x = Array.from(
28
+ const m = Array.from(
29
29
  document.querySelectorAll(
30
30
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
31
31
  )
32
- ), m = document.querySelector(
32
+ ), v = document.querySelector(
33
33
  ".k-animation-container .k-popup .k-column-menu .k-filter-menu-container"
34
34
  );
35
- if (m) {
36
- if (s.code === "Tab") {
37
- const k = [
35
+ if (v) {
36
+ if (a.code === "Tab") {
37
+ const A = [
38
38
  // ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
39
39
  // ".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])",
40
40
  // ".k-filter-menu-container button:not([tabindex='-1']):not([disabled])",
@@ -43,126 +43,126 @@ const wt = (e, t) => {
43
43
  "input.k-input-inner:not([tabindex='-1']):not([disabled])",
44
44
  "button:not([tabindex='-1']):not([disabled])",
45
45
  ".k-checkbox"
46
- ], C = t?.focusableMenuSelectors ?? k, D = Array.from(
47
- m.querySelectorAll(C.join(","))
46
+ ], C = t?.focusableMenuSelectors ?? A, E = Array.from(
47
+ v.querySelectorAll(C.join(","))
48
48
  );
49
- if (D.length === 0) return;
50
- const P = D.findIndex(
51
- (j) => j === document.activeElement
49
+ if (E.length === 0) return;
50
+ const L = E.findIndex(
51
+ (Z) => Z === document.activeElement
52
52
  );
53
- let U;
54
- P === -1 ? U = 0 : s.shiftKey ? U = (P - 1 + D.length) % D.length : U = (P + 1) % D.length, s.preventDefault(), s.stopPropagation(), D[U]?.focus();
53
+ let K;
54
+ L === -1 ? K = 0 : a.shiftKey ? K = (L - 1 + E.length) % E.length : K = (L + 1) % E.length, a.preventDefault(), a.stopPropagation(), E[K]?.focus();
55
55
  }
56
- } else if (s.code === "ArrowUp" || s.code === "ArrowDown") {
57
- s.preventDefault(), s.stopPropagation();
58
- const k = x.findIndex(
59
- (D) => D === document.activeElement
56
+ } else if (a.code === "ArrowUp" || a.code === "ArrowDown") {
57
+ a.preventDefault(), a.stopPropagation();
58
+ const A = m.findIndex(
59
+ (E) => E === document.activeElement
60
60
  );
61
- let C = k;
62
- s.code === "ArrowUp" ? C = k > 0 ? k - 1 : x.length - 1 : s.code === "ArrowDown" && (C = k < x.length - 1 ? k + 1 : 0), x[C]?.focus();
61
+ let C = A;
62
+ a.code === "ArrowUp" ? C = A > 0 ? A - 1 : m.length - 1 : a.code === "ArrowDown" && (C = A < m.length - 1 ? A + 1 : 0), m[C]?.focus();
63
63
  return;
64
64
  }
65
- if (s.code === "Tab") {
66
- s.preventDefault(), s.stopPropagation();
67
- const k = r.value?.parentElement;
68
- (s.shiftKey ? k?.previousElementSibling : k?.nextElementSibling)?.querySelector(
65
+ if (a.code === "Tab") {
66
+ a.preventDefault(), a.stopPropagation();
67
+ const A = n.value?.parentElement;
68
+ (a.shiftKey ? A?.previousElementSibling : A?.nextElementSibling)?.querySelector(
69
69
  "button, [role='button'], .k-link"
70
70
  )?.focus();
71
71
  }
72
72
  }, O = () => {
73
- a = new MutationObserver((s) => {
74
- s.forEach((x) => {
75
- x.addedNodes.forEach((m) => {
76
- if (m.nodeType === Node.ELEMENT_NODE) {
77
- const k = m;
78
- if (k.classList.contains("k-animation-container")) {
79
- const D = r.value;
80
- D && (D.dataset.featherKSortable === "true" || _(() => {
81
- k.querySelectorAll(
73
+ o = new MutationObserver((a) => {
74
+ a.forEach((m) => {
75
+ m.addedNodes.forEach((v) => {
76
+ if (v.nodeType === Node.ELEMENT_NODE) {
77
+ const A = v;
78
+ if (A.classList.contains("k-animation-container")) {
79
+ const E = n.value;
80
+ E && (E.dataset.featherKSortable === "true" || G(() => {
81
+ A.querySelectorAll(
82
82
  ".k-columnmenu-item-wrapper"
83
- ).forEach((j) => {
84
- j.textContent?.toLowerCase().includes("sort") && j.remove();
83
+ ).forEach((Z) => {
84
+ Z.textContent?.toLowerCase().includes("sort") && Z.remove();
85
85
  });
86
- })), k.addEventListener(
86
+ })), A.addEventListener(
87
87
  "keydown",
88
- A
89
- ), _(() => {
90
- const P = () => {
91
- const U = Array.from(
92
- k.querySelectorAll(
88
+ D
89
+ ), G(() => {
90
+ const L = () => {
91
+ const K = Array.from(
92
+ A.querySelectorAll(
93
93
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
94
94
  )
95
95
  );
96
- if (U.length === 1)
97
- U[0].focus(), U[0].click(), P.attempts = 0;
98
- else if (U.length > 1) {
99
- P.attempts = 0;
96
+ if (K.length === 1)
97
+ K[0].focus(), K[0].click(), L.attempts = 0;
98
+ else if (K.length > 1) {
99
+ L.attempts = 0;
100
100
  return;
101
101
  } else
102
- P.attempts === void 0 && (P.attempts = 0), P.attempts++ < 3 && setTimeout(P, 200);
102
+ L.attempts === void 0 && (L.attempts = 0), L.attempts++ < 3 && setTimeout(L, 200);
103
103
  };
104
- P();
104
+ L();
105
105
  });
106
106
  }
107
- k.querySelectorAll(
107
+ A.querySelectorAll(
108
108
  ".k-animation-container"
109
- ).forEach((D) => {
110
- D.addEventListener(
109
+ ).forEach((E) => {
110
+ E.addEventListener(
111
111
  "keydown",
112
- A
112
+ D
113
113
  );
114
114
  });
115
115
  }
116
- }), x.removedNodes.forEach((m) => {
117
- if (m.nodeType === Node.ELEMENT_NODE) {
118
- const k = m;
119
- k.classList.contains("k-animation-container") && k.removeEventListener(
116
+ }), m.removedNodes.forEach((v) => {
117
+ if (v.nodeType === Node.ELEMENT_NODE) {
118
+ const A = v;
119
+ A.classList.contains("k-animation-container") && A.removeEventListener(
120
120
  "keydown",
121
- A
122
- ), k.querySelectorAll(
121
+ D
122
+ ), A.querySelectorAll(
123
123
  ".k-animation-container"
124
- ).forEach((D) => {
125
- D.removeEventListener(
124
+ ).forEach((E) => {
125
+ E.removeEventListener(
126
126
  "keydown",
127
- A
127
+ D
128
128
  );
129
129
  });
130
130
  }
131
131
  });
132
132
  });
133
- }), a.observe(document.body, {
133
+ }), o.observe(document.body, {
134
134
  childList: !0,
135
135
  subtree: !0
136
136
  });
137
- }, p = (s) => {
138
- const x = s.tagName.toLowerCase();
139
- return !!(["input", "textarea", "select", "button"].includes(x) || s.closest(
137
+ }, f = (a) => {
138
+ const m = a.tagName.toLowerCase();
139
+ return !!(["input", "textarea", "select", "button"].includes(m) || a.closest(
140
140
  '.k-picker-wrap, .k-input-inner, .k-textbox, [role="combobox"]'
141
141
  ));
142
- }, i = (s) => {
143
- if (!s.type || !s)
142
+ }, s = (a) => {
143
+ if (!a.type || !a)
144
144
  return;
145
- const x = s.target;
146
- if (!x) return;
147
- const m = x.closest(
145
+ const m = a.target;
146
+ if (!m) return;
147
+ const v = m.closest(
148
148
  ".k-table-row[data-grid-row-index]"
149
149
  );
150
- if (!V(x))
150
+ if (!N(m))
151
151
  return;
152
- const k = ["ArrowLeft", "ArrowRight"].includes(
153
- s.code
152
+ const A = ["ArrowLeft", "ArrowRight"].includes(
153
+ a.code
154
154
  );
155
- if (!(p(x) && !(m && k))) {
156
- if (s.code === "Escape") {
155
+ if (!(f(m) && !(v && A))) {
156
+ if (a.code === "Escape") {
157
157
  const C = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
158
  if (C) {
159
- s.preventDefault(), s.stopPropagation();
159
+ a.preventDefault(), a.stopPropagation();
160
160
  try {
161
161
  Array.from(
162
162
  e?.value.$el.querySelectorAll(
163
163
  ".k-table-row[data-grid-row-index]"
164
164
  )
165
- ).forEach((P) => P.setAttribute("tabindex", "-1"));
165
+ ).forEach((L) => L.setAttribute("tabindex", "-1"));
166
166
  } catch {
167
167
  }
168
168
  C.setAttribute("tabindex", "0"), C.focus();
@@ -177,221 +177,221 @@ const wt = (e, t) => {
177
177
  "Enter",
178
178
  "NumpadEnter",
179
179
  "Space"
180
- ].includes(s.code)) {
181
- if (x.classList.contains("k-grid-header-menu") && x.classList.contains("k-grid-column-menu")) {
182
- r.value = x;
180
+ ].includes(a.code)) {
181
+ if (m.classList.contains("k-grid-header-menu") && m.classList.contains("k-grid-column-menu")) {
182
+ n.value = m;
183
183
  return;
184
184
  }
185
- if (m) {
186
- if (["ArrowDown", "ArrowUp"].includes(s.code)) {
187
- s.preventDefault(), s.stopPropagation();
188
- const C = (P, U) => {
189
- let j = U === "next" ? P.nextElementSibling : P.previousElementSibling;
190
- for (; j; ) {
191
- const re = j;
185
+ if (v) {
186
+ if (["ArrowDown", "ArrowUp"].includes(a.code)) {
187
+ a.preventDefault(), a.stopPropagation();
188
+ const C = (L, K) => {
189
+ let Z = K === "next" ? L.nextElementSibling : L.previousElementSibling;
190
+ for (; Z; ) {
191
+ const ne = Z;
192
192
  try {
193
- if (re.classList.contains("k-table-row"))
194
- return re;
193
+ if (ne.classList.contains("k-table-row"))
194
+ return ne;
195
195
  } catch {
196
196
  }
197
- j = U === "next" ? j.nextElementSibling : j.previousElementSibling;
197
+ Z = K === "next" ? Z.nextElementSibling : Z.previousElementSibling;
198
198
  }
199
199
  return null;
200
- }, D = s.code === "ArrowDown" ? C(m, "next") : C(m, "previous");
201
- D && (m.setAttribute("tabindex", "-1"), D.setAttribute("tabindex", "0"), D.focus());
200
+ }, E = a.code === "ArrowDown" ? C(v, "next") : C(v, "previous");
201
+ E && (v.setAttribute("tabindex", "-1"), E.setAttribute("tabindex", "0"), E.focus());
202
202
  return;
203
203
  }
204
- if (["ArrowLeft", "ArrowRight"].includes(s.code)) {
205
- s.preventDefault(), s.stopPropagation();
206
- const C = m.querySelectorAll(
207
- S
204
+ if (["ArrowLeft", "ArrowRight"].includes(a.code)) {
205
+ a.preventDefault(), a.stopPropagation();
206
+ const C = v.querySelectorAll(
207
+ k
208
208
  );
209
209
  if (C.length === 0) return;
210
- let D = Array.from(C).findIndex(
211
- (P) => P === document.activeElement
210
+ let E = Array.from(C).findIndex(
211
+ (L) => L === document.activeElement
212
212
  );
213
- if (D === -1 && document.activeElement === m) {
213
+ if (E === -1 && document.activeElement === v) {
214
214
  C[0].focus();
215
215
  return;
216
216
  }
217
- s.code === "ArrowRight" ? D = D === C.length - 1 ? 0 : D + 1 : s.code === "ArrowLeft" && (D = D === 0 ? C.length - 1 : D - 1), C[D].focus();
217
+ a.code === "ArrowRight" ? E = E === C.length - 1 ? 0 : E + 1 : a.code === "ArrowLeft" && (E = E === 0 ? C.length - 1 : E - 1), C[E].focus();
218
218
  return;
219
219
  }
220
220
  }
221
221
  }
222
222
  }
223
- }, v = () => {
224
- _(() => {
225
- const s = e.value?.$el;
226
- if (!s || typeof s.closest != "function") return;
227
- const x = s.closest(".k-grid");
228
- x && x.classList.add("fk-grid");
223
+ }, g = () => {
224
+ G(() => {
225
+ const a = e.value?.$el;
226
+ if (!a || typeof a.closest != "function") return;
227
+ const m = a.closest(".k-grid");
228
+ m && m.classList.add("fk-grid");
229
229
  });
230
230
  }, I = () => {
231
- if (!d)
231
+ if (!c)
232
232
  try {
233
- const s = () => {
233
+ const a = () => {
234
234
  try {
235
- const k = Array.from(
235
+ const A = Array.from(
236
236
  e.value.$el.querySelectorAll(
237
237
  ".k-table-row[data-grid-row-index]"
238
238
  )
239
239
  );
240
- if (!k || k.length === 0 || k.filter(
241
- (P) => P.getAttribute("tabindex") === "0"
240
+ if (!A || A.length === 0 || A.filter(
241
+ (L) => L.getAttribute("tabindex") === "0"
242
242
  ).length === 1) return;
243
- const D = k.find(
244
- (P) => P === document.activeElement || P.contains(document.activeElement)
243
+ const E = A.find(
244
+ (L) => L === document.activeElement || L.contains(document.activeElement)
245
245
  );
246
- if (k.forEach((P) => P.setAttribute("tabindex", "-1")), D) {
247
- D.setAttribute("tabindex", "0");
246
+ if (A.forEach((L) => L.setAttribute("tabindex", "-1")), E) {
247
+ E.setAttribute("tabindex", "0");
248
248
  return;
249
249
  }
250
- k[0].setAttribute("tabindex", "0");
251
- } catch (k) {
252
- console.error("ensureSingleTabindex error:", k);
250
+ A[0].setAttribute("tabindex", "0");
251
+ } catch (A) {
252
+ console.error("ensureSingleTabindex error:", A);
253
253
  }
254
- }, x = Array.from(
254
+ }, m = Array.from(
255
255
  e.value.$el.querySelectorAll(
256
256
  ".k-table-row[data-grid-row-index]"
257
257
  )
258
258
  );
259
- x.length > 0 && x.forEach((k, C) => {
260
- k.setAttribute("tabindex", C === 0 ? "0" : "-1");
259
+ m.length > 0 && m.forEach((A, C) => {
260
+ A.setAttribute("tabindex", C === 0 ? "0" : "-1");
261
261
  });
262
- const m = e.value.$el.querySelector(".k-table-tbody");
263
- m && (d = new MutationObserver(() => {
264
- s();
265
- }), d.observe(m, { childList: !0, subtree: !0 }));
266
- } catch (s) {
267
- console.error("Error setting up row navigation:", s);
262
+ const v = e.value.$el.querySelector(".k-table-tbody");
263
+ v && (c = new MutationObserver(() => {
264
+ a();
265
+ }), c.observe(v, { childList: !0, subtree: !0 }));
266
+ } catch (a) {
267
+ console.error("Error setting up row navigation:", a);
268
268
  }
269
- }, N = () => {
270
- _(() => {
271
- const x = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
- x && x.forEach((m) => {
273
- m.setAttribute("role", "button"), m.addEventListener(
269
+ }, V = () => {
270
+ G(() => {
271
+ const m = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
+ m && m.forEach((v) => {
273
+ v.setAttribute("role", "button"), v.addEventListener(
274
274
  "keydown",
275
- E
275
+ x
276
276
  );
277
277
  }), O(), X();
278
278
  });
279
- }, H = () => {
280
- const x = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
- x && x.forEach((m) => {
282
- m.removeEventListener(
279
+ }, W = () => {
280
+ const m = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
+ m && m.forEach((v) => {
282
+ v.removeEventListener(
283
283
  "keydown",
284
- E
284
+ x
285
285
  );
286
- }), a && (a.disconnect(), a = null), d && (d.disconnect(), d = null), w.forEach((m) => m()), w.length = 0;
286
+ }), o && (o.disconnect(), o = null), c && (c.disconnect(), c = null), b.forEach((v) => v()), b.length = 0;
287
287
  }, X = () => {
288
288
  document.querySelectorAll(
289
289
  ".k-grid-header .k-table-thead th"
290
- ).forEach((m, k) => {
291
- if (m.dataset.featherKHeaderBound === "true")
290
+ ).forEach((v, A) => {
291
+ if (v.dataset.featherKHeaderBound === "true")
292
292
  return;
293
- const C = m.querySelector(
293
+ const C = v.querySelector(
294
294
  ".k-grid-header-menu.k-grid-column-menu"
295
295
  );
296
296
  if (!C) return;
297
- const D = R();
298
- if (D && D[k]) {
299
- const o = D[k].field ?? "";
300
- m.setAttribute("data-feather-k-field", o), m.setAttribute(
297
+ const E = R();
298
+ if (E && E[A]) {
299
+ const l = E[A].field ?? "";
300
+ v.setAttribute("data-feather-k-field", l), v.setAttribute(
301
301
  "data-feather-k-filterable",
302
- D[k].filterable === !1 ? "false" : "true"
303
- ), m.setAttribute(
302
+ E[A].filterable === !1 ? "false" : "true"
303
+ ), v.setAttribute(
304
304
  "data-feather-k-sortable",
305
- D[k].sortable === !1 ? "false" : "true"
305
+ E[A].sortable === !1 ? "false" : "true"
306
306
  );
307
307
  }
308
- const P = m.dataset.featherKFilterable !== "false", U = m.dataset.featherKSortable !== "false";
309
- C.setAttribute("tabindex", "-1"), P || U ? m.style.cursor = "pointer" : m.style.cursor = "default", P ? (m.setAttribute("tabindex", "0"), m.setAttribute("role", "button"), m.setAttribute("aria-haspopup", "menu")) : (m.setAttribute("tabindex", "0"), m.setAttribute("role", "columnheader"), m.removeAttribute("aria-haspopup"));
310
- const j = (o) => {
311
- o.target?.closest(".k-column-resizer") || (r.value = m, C.click());
312
- }, re = (o) => {
313
- if (P)
314
- r.value = m, o.preventDefault(), o.stopPropagation(), j(o);
315
- else if (U) {
316
- r.value = m;
317
- const b = m.querySelector(".k-link");
318
- b && b.click();
308
+ const L = v.dataset.featherKFilterable !== "false", K = v.dataset.featherKSortable !== "false";
309
+ C.setAttribute("tabindex", "-1"), L || K ? v.style.cursor = "pointer" : v.style.cursor = "default", L ? (v.setAttribute("tabindex", "0"), v.setAttribute("role", "button"), v.setAttribute("aria-haspopup", "menu")) : (v.setAttribute("tabindex", "0"), v.setAttribute("role", "columnheader"), v.removeAttribute("aria-haspopup"));
310
+ const Z = (l) => {
311
+ l.target?.closest(".k-column-resizer") || (n.value = v, C.click());
312
+ }, ne = (l) => {
313
+ if (L)
314
+ n.value = v, l.preventDefault(), l.stopPropagation(), Z(l);
315
+ else if (K) {
316
+ n.value = v;
317
+ const S = v.querySelector(".k-link");
318
+ S && S.click();
319
319
  }
320
320
  };
321
- m.addEventListener("click", re), w.push(() => {
322
- m.removeEventListener("click", re);
321
+ v.addEventListener("click", ne), b.push(() => {
322
+ v.removeEventListener("click", ne);
323
323
  });
324
- const ue = (o) => {
325
- if ((M(o) || o.code === "Space") && (P || U)) {
326
- if (o.preventDefault(), o.stopPropagation(), r.value = m, r.value.focus(), P)
327
- j(o);
328
- else if (U) {
329
- const b = m.querySelector(".k-link");
330
- b && b.click();
324
+ const ie = (l) => {
325
+ if ((M(l) || l.code === "Space") && (L || K)) {
326
+ if (l.preventDefault(), l.stopPropagation(), n.value = v, n.value.focus(), L)
327
+ Z(l);
328
+ else if (K) {
329
+ const S = v.querySelector(".k-link");
330
+ S && S.click();
331
331
  }
332
332
  }
333
333
  };
334
- m.addEventListener("keydown", ue, !0), w.push(() => {
335
- m.removeEventListener("keydown", ue, !0);
336
- }), m.dataset.featherKHeaderBound = "true";
334
+ v.addEventListener("keydown", ie, !0), b.push(() => {
335
+ v.removeEventListener("keydown", ie, !0);
336
+ }), v.dataset.featherKHeaderBound = "true";
337
337
  });
338
- const x = document.querySelector(".k-grid-header .k-table-thead");
339
- if (x && x.dataset.featherKHeaderBound !== "true") {
340
- const m = (k) => {
341
- const C = k.target.closest("th");
342
- C && (M(k) || k.code === "Space") && C.dataset.featherKFilterable === "false" && C.dataset.featherKSortable === "false" && (k.preventDefault(), k.stopImmediatePropagation());
338
+ const m = document.querySelector(".k-grid-header .k-table-thead");
339
+ if (m && m.dataset.featherKHeaderBound !== "true") {
340
+ const v = (A) => {
341
+ const C = A.target.closest("th");
342
+ C && (M(A) || A.code === "Space") && C.dataset.featherKFilterable === "false" && C.dataset.featherKSortable === "false" && (A.preventDefault(), A.stopImmediatePropagation());
343
343
  };
344
- x.addEventListener(
344
+ m.addEventListener(
345
345
  "keydown",
346
- m,
346
+ v,
347
347
  !0
348
348
  // NOTE: capture phase
349
- ), w.push(() => {
350
- x.removeEventListener(
349
+ ), b.push(() => {
350
+ m.removeEventListener(
351
351
  "keydown",
352
- m,
352
+ v,
353
353
  !0
354
354
  );
355
- }), x.dataset.featherKHeaderBound = "true";
355
+ }), m.dataset.featherKHeaderBound = "true";
356
356
  }
357
- }, Z = function(s, x) {
358
- const m = s?.event?.event.target, k = R();
359
- if (!m || !k) return;
360
- const C = m.classList.contains("k-grid-header-menu"), D = m.classList.contains("k-columnmenu-item"), P = k.find((U) => U.field === s?.event?.field)?.sortable && !0;
357
+ }, _ = function(a, m) {
358
+ const v = a?.event?.event.target, A = R();
359
+ if (!v || !A) return;
360
+ const C = v.classList.contains("k-grid-header-menu"), E = v.classList.contains("k-columnmenu-item"), L = A.find((K) => K.field === a?.event?.field)?.sortable && !0;
361
361
  if (!C) {
362
- if (D && !P) {
363
- s?.event?.sort?.filter(
364
- (j) => j.field !== s?.event?.field
362
+ if (E && !L) {
363
+ a?.event?.sort?.filter(
364
+ (Z) => Z.field !== a?.event?.field
365
365
  );
366
366
  return;
367
367
  }
368
- typeof x == "function" && _(() => {
369
- r.value && r.value.focus(), x(s), _(() => {
368
+ typeof m == "function" && G(() => {
369
+ n.value && n.value.focus(), m(a), G(() => {
370
370
  X();
371
371
  });
372
372
  });
373
373
  }
374
- }, J = () => {
375
- if (!c)
374
+ }, F = () => {
375
+ if (!u)
376
376
  try {
377
- v(), I(), N(), c = !0;
378
- } catch (s) {
379
- console.error("initA11y failed:", s), H();
377
+ g(), I(), V(), u = !0;
378
+ } catch (a) {
379
+ console.error("initA11y failed:", a), W();
380
380
  }
381
381
  };
382
- return Ke(() => {
383
- H();
382
+ return Be(() => {
383
+ W();
384
384
  }), {
385
- activeFilterButton: r,
386
- handleGridKeyDown: i,
387
- handleSortChange: Z,
388
- initA11y: J
385
+ activeFilterButton: n,
386
+ handleGridKeyDown: s,
387
+ handleSortChange: _,
388
+ initA11y: F
389
389
  };
390
- }, Xe = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), We = (e) => !!e && typeof e == "object" && "field" in e, Ve = (e, t) => !e || typeof e != "object" ? !1 : Xe(e) ? e.filters.some(
391
- (r) => Ve(r, t)
392
- ) : We(e) ? e.field === t : !1, St = (e) => (t) => e.value?.filters && e.value.filters.some(
393
- (r) => Ve(r, t)
394
- ) ? "active" : "", Ze = [
390
+ }, _e = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), je = (e) => !!e && typeof e == "object" && "field" in e, qe = (e, t) => !e || typeof e != "object" ? !1 : _e(e) ? e.filters.some(
391
+ (n) => qe(n, t)
392
+ ) : je(e) ? e.field === t : !1, xt = (e) => (t) => e.value?.filters && e.value.filters.some(
393
+ (n) => qe(n, t)
394
+ ) ? "active" : "", Ge = [
395
395
  "button",
396
396
  "a",
397
397
  "input",
@@ -409,228 +409,228 @@ const wt = (e, t) => {
409
409
  ".k-hierarchy-cell",
410
410
  ".k-grid-header-menu",
411
411
  ".k-column-menu"
412
- ], kt = (e) => {
412
+ ], Mt = (e) => {
413
413
  const {
414
414
  onRowAction: t,
415
- gridRef: r,
416
- dataItems: c,
417
- ignoreSelectors: a = [],
418
- shouldIgnoreTarget: d,
419
- enableKeyboardAction: w = !0
420
- } = e, S = [
421
- ...Ze,
422
- ...a
423
- ], $ = (p, i) => {
424
- if (!p) return !1;
425
- const v = S.join(",");
426
- return p.closest && p.closest(v) ? !0 : d && i ? d(p, i) : !1;
427
- }, V = (p) => {
428
- const v = p?.closest?.(
415
+ gridRef: n,
416
+ dataItems: u,
417
+ ignoreSelectors: o = [],
418
+ shouldIgnoreTarget: c,
419
+ enableKeyboardAction: b = !0
420
+ } = e, k = [
421
+ ...Ge,
422
+ ...o
423
+ ], P = (f, s) => {
424
+ if (!f) return !1;
425
+ const g = k.join(",");
426
+ return f.closest && f.closest(g) ? !0 : c && s ? c(f, s) : !1;
427
+ }, N = (f) => {
428
+ const g = f?.closest?.(
429
429
  ".k-table-row[data-grid-row-index]"
430
430
  )?.getAttribute("data-grid-row-index");
431
- if (v == null) return;
432
- const I = parseInt(v, 10);
431
+ if (g == null) return;
432
+ const I = parseInt(g, 10);
433
433
  return Number.isNaN(I) ? void 0 : I;
434
- }, M = (p) => {
435
- if (!p || typeof p.clientX != "number")
434
+ }, M = (f) => {
435
+ if (!f || typeof f.clientX != "number")
436
436
  return;
437
- const i = typeof window < "u" && window.scrollX || 0, v = typeof window < "u" && window.scrollY || 0, I = typeof window < "u" && window.screenX || 0, N = typeof window < "u" && window.screenY || 0;
437
+ const s = typeof window < "u" && window.scrollX || 0, g = typeof window < "u" && window.scrollY || 0, I = typeof window < "u" && window.screenX || 0, V = typeof window < "u" && window.screenY || 0;
438
438
  return {
439
- clientX: p.clientX,
440
- clientY: p.clientY,
441
- pageX: typeof p.pageX == "number" ? p.pageX : p.clientX + i,
442
- pageY: typeof p.pageY == "number" ? p.pageY : p.clientY + v,
443
- screenX: typeof p.screenX == "number" ? p.screenX : p.clientX + I,
444
- screenY: typeof p.screenY == "number" ? p.screenY : p.clientY + N
439
+ clientX: f.clientX,
440
+ clientY: f.clientY,
441
+ pageX: typeof f.pageX == "number" ? f.pageX : f.clientX + s,
442
+ pageY: typeof f.pageY == "number" ? f.pageY : f.clientY + g,
443
+ screenX: typeof f.screenX == "number" ? f.screenX : f.clientX + I,
444
+ screenY: typeof f.screenY == "number" ? f.screenY : f.clientY + V
445
445
  };
446
- }, R = (p) => {
447
- if (!p || typeof p.getBoundingClientRect != "function")
446
+ }, R = (f) => {
447
+ if (!f || typeof f.getBoundingClientRect != "function")
448
448
  return;
449
- const i = p.getBoundingClientRect();
450
- if (!i) return;
451
- const v = i.left, I = i.bottom, N = typeof window < "u" && window.scrollX || 0, H = typeof window < "u" && window.scrollY || 0;
449
+ const s = f.getBoundingClientRect();
450
+ if (!s) return;
451
+ const g = s.left, I = s.bottom, V = typeof window < "u" && window.scrollX || 0, W = typeof window < "u" && window.scrollY || 0;
452
452
  return {
453
- clientX: v,
453
+ clientX: g,
454
454
  clientY: I,
455
- pageX: v + N,
456
- pageY: I + H,
457
- screenX: v,
455
+ pageX: g + V,
456
+ pageY: I + W,
457
+ screenX: g,
458
458
  screenY: I
459
459
  };
460
- }, E = (p) => {
460
+ }, x = (f) => {
461
461
  if (typeof window > "u") return !1;
462
- const i = window.getSelection();
463
- if (!i || i.isCollapsed || !i.toString().trim())
462
+ const s = window.getSelection();
463
+ if (!s || s.isCollapsed || !s.toString().trim())
464
464
  return !1;
465
- if (p && i.anchorNode && i.focusNode) {
466
- const v = p.closest(".k-table-row") || p.closest(".k-grid") || p, I = i.anchorNode.nodeType === Node.ELEMENT_NODE ? i.anchorNode : i.anchorNode.parentElement, N = i.focusNode.nodeType === Node.ELEMENT_NODE ? i.focusNode : i.focusNode.parentElement, H = !!(I && v.contains(I)), X = !!(N && v.contains(N));
467
- return H || X;
465
+ if (f && s.anchorNode && s.focusNode) {
466
+ const g = f.closest(".k-table-row") || f.closest(".k-grid") || f, I = s.anchorNode.nodeType === Node.ELEMENT_NODE ? s.anchorNode : s.anchorNode.parentElement, V = s.focusNode.nodeType === Node.ELEMENT_NODE ? s.focusNode : s.focusNode.parentElement, W = !!(I && g.contains(I)), X = !!(V && g.contains(V));
467
+ return W || X;
468
468
  }
469
469
  return !0;
470
470
  };
471
471
  return {
472
- handleRowClick: (p) => {
473
- const i = p?.htmlEvent || p?.event || p?.nativeEvent || (p instanceof Event ? p : void 0);
474
- if (i && i.button !== void 0 && i.button !== 0)
472
+ handleRowClick: (f) => {
473
+ const s = f?.htmlEvent || f?.event || f?.nativeEvent || (f instanceof Event ? f : void 0);
474
+ if (s && s.button !== void 0 && s.button !== 0)
475
475
  return;
476
- const v = i?.target || p?.target;
477
- if (v && $(v, i || p) || E(v))
476
+ const g = s?.target || f?.target;
477
+ if (g && P(g, s || f) || x(g))
478
478
  return;
479
479
  const I = {
480
- dataItem: p.dataItem,
481
- rowIndex: p.rowIndex ?? V(v),
482
- field: p.field,
483
- event: i || p,
480
+ dataItem: f.dataItem,
481
+ rowIndex: f.rowIndex ?? N(g),
482
+ field: f.field,
483
+ event: s || f,
484
484
  triggerType: "click",
485
- ctrlKey: !!i?.ctrlKey,
486
- shiftKey: !!i?.shiftKey,
487
- metaKey: !!i?.metaKey,
488
- altKey: !!i?.altKey,
489
- coordinates: M(i) ?? R(v)
485
+ ctrlKey: !!s?.ctrlKey,
486
+ shiftKey: !!s?.shiftKey,
487
+ metaKey: !!s?.metaKey,
488
+ altKey: !!s?.altKey,
489
+ coordinates: M(s) ?? R(g)
490
490
  };
491
- t(p.dataItem, I);
491
+ t(f.dataItem, I);
492
492
  },
493
- handleRowKeyDown: (p, i) => {
494
- if (!w) return;
495
- const v = p.key || p.code;
496
- if (!(v === "Enter" || v === "NumpadEnter" || v === " " || v === "Space" || p.code === "Enter" || p.code === "NumpadEnter" || p.code === "Space")) return;
497
- const N = p.target;
498
- if (!N) return;
499
- const H = N.closest(
493
+ handleRowKeyDown: (f, s) => {
494
+ if (!b) return;
495
+ const g = f.key || f.code;
496
+ if (!(g === "Enter" || g === "NumpadEnter" || g === " " || g === "Space" || f.code === "Enter" || f.code === "NumpadEnter" || f.code === "Space")) return;
497
+ const V = f.target;
498
+ if (!V) return;
499
+ const W = V.closest(
500
500
  ".k-table-row[data-grid-row-index], .k-table-row"
501
501
  );
502
- if (!H || $(N, p))
502
+ if (!W || P(V, f))
503
503
  return;
504
- p.preventDefault(), p.stopPropagation();
505
- const X = H.getAttribute("data-grid-row-index"), Z = X !== null ? parseInt(X, 10) : void 0;
506
- let J = i;
507
- if (J === void 0) {
508
- const x = (Array.isArray(c) ? c : c?.value) || r?.value?.props?.dataItems || r?.value?.dataItems;
509
- x && Z !== void 0 && Z >= 0 && Z < x.length && (J = x[Z]);
504
+ f.preventDefault(), f.stopPropagation();
505
+ const X = W.getAttribute("data-grid-row-index"), _ = X !== null ? parseInt(X, 10) : void 0;
506
+ let F = s;
507
+ if (F === void 0) {
508
+ const m = (Array.isArray(u) ? u : u?.value) || n?.value?.props?.dataItems || n?.value?.dataItems;
509
+ m && _ !== void 0 && _ >= 0 && _ < m.length && (F = m[_]);
510
510
  }
511
- if (J === void 0) return;
512
- const s = {
513
- dataItem: J,
514
- rowIndex: Z,
515
- event: p,
511
+ if (F === void 0) return;
512
+ const a = {
513
+ dataItem: F,
514
+ rowIndex: _,
515
+ event: f,
516
516
  triggerType: "keyboard",
517
- ctrlKey: !!p.ctrlKey,
518
- shiftKey: !!p.shiftKey,
519
- metaKey: !!p.metaKey,
520
- altKey: !!p.altKey,
521
- coordinates: R(H)
517
+ ctrlKey: !!f.ctrlKey,
518
+ shiftKey: !!f.shiftKey,
519
+ metaKey: !!f.metaKey,
520
+ altKey: !!f.altKey,
521
+ coordinates: R(W)
522
522
  };
523
- t(J, s);
523
+ t(F, a);
524
524
  },
525
- isIgnoredTarget: $
525
+ isIgnoredTarget: P
526
526
  };
527
- }, _e = "Enter a valid ZIP code with exactly 5 or 9 digits.", Fe = (e) => {
527
+ }, Je = "Enter a valid ZIP code with exactly 5 or 9 digits.", Le = (e) => {
528
528
  const t = e.replace(/\D/g, "").slice(0, 9);
529
529
  return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
530
- }, je = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, Ge = (e) => e <= 5 ? e : Math.min(e + 1, 10), Je = (e) => {
531
- const t = Y(Fe(e.initialValue ?? "")), r = Y(!1), c = Y(
532
- e.errorMessage?.trim() || _e
533
- ), a = y(() => t.value.replace(/\D/g, "")), d = y(() => {
534
- const A = a.value.length;
535
- return A === 5 || A === 9;
536
- }), w = y(() => r.value && !d.value), S = y(() => !r.value || d.value), $ = y(() => r.value), V = (A, O) => {
537
- const p = Ge(O);
538
- _(() => {
539
- A.isConnected && A.setSelectionRange(p, p);
530
+ }, Qe = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, et = (e) => e <= 5 ? e : Math.min(e + 1, 10), tt = (e) => {
531
+ const t = Y(Le(e.initialValue ?? "")), n = Y(!1), u = Y(
532
+ e.errorMessage?.trim() || Je
533
+ ), o = y(() => t.value.replace(/\D/g, "")), c = y(() => {
534
+ const D = o.value.length;
535
+ return D === 5 || D === 9;
536
+ }), b = y(() => n.value && !c.value), k = y(() => !n.value || c.value), P = y(() => n.value), N = (D, O) => {
537
+ const f = et(O);
538
+ G(() => {
539
+ D.isConnected && D.setSelectionRange(f, f);
540
540
  });
541
541
  };
542
542
  return {
543
543
  // writable state
544
544
  zipDisplay: t,
545
- submitted: r,
546
- errorMessage: c,
545
+ submitted: n,
546
+ errorMessage: u,
547
547
  // bindings
548
548
  wrapperClass: "fk-zip-textbox",
549
549
  // derived state
550
- zipRaw: a,
551
- isZipValid: d,
552
- showZipError: w,
553
- textBoxValid: S,
554
- textBoxValidate: $,
550
+ zipRaw: o,
551
+ isZipValid: c,
552
+ showZipError: b,
553
+ textBoxValid: k,
554
+ textBoxValidate: P,
555
555
  // actions
556
- handleZipInput: (...A) => {
557
- const O = A[0], i = O?.event?.target, v = O?.value, I = Array.isArray(v) ? v.join("") : String(v ?? ""), N = i?.selectionStart !== void 0 && i.selectionStart !== null ? je(
558
- i.value,
559
- i.selectionStart
556
+ handleZipInput: (...D) => {
557
+ const O = D[0], s = O?.event?.target, g = O?.value, I = Array.isArray(g) ? g.join("") : String(g ?? ""), V = s?.selectionStart !== void 0 && s.selectionStart !== null ? Qe(
558
+ s.value,
559
+ s.selectionStart
560
560
  ) : I.replace(/\D/g, "").length;
561
- t.value = Fe(I), i && V(i, N);
561
+ t.value = Le(I), s && N(s, V);
562
562
  },
563
- submitAndValidate: (A) => {
564
- r.value = !0;
565
- const O = d.value;
566
- return !O && A?.focus && _(() => {
563
+ submitAndValidate: (D) => {
564
+ n.value = !0;
565
+ const O = c.value;
566
+ return !O && D?.focus && G(() => {
567
567
  document.getElementById(
568
568
  e.id
569
569
  )?.focus();
570
570
  }), O;
571
571
  },
572
- buildPayload: () => ({ zip: a.value })
572
+ buildPayload: () => ({ zip: o.value })
573
573
  };
574
574
  };
575
- function Qe(e, t) {
576
- const r = Y(!1);
577
- Le(() => {
575
+ function nt(e, t) {
576
+ const n = Y(!1);
577
+ ze(() => {
578
578
  e.value?.setAttribute("aria-invalid", String(!t.isValid()));
579
579
  });
580
- function c(d) {
581
- const w = e.value ?? d.currentTarget, S = d.relatedTarget;
582
- (!w || !w.contains(S)) && (r.value = !0);
580
+ function u(c) {
581
+ const b = e.value ?? c.currentTarget, k = c.relatedTarget;
582
+ (!b || !b.contains(k)) && (n.value = !0);
583
583
  }
584
- function a() {
585
- r.value = !1;
584
+ function o() {
585
+ n.value = !1;
586
586
  }
587
- return { touched: r, onFocusout: c, reset: a };
587
+ return { touched: n, onFocusout: u, reset: o };
588
588
  }
589
- function et(e, t) {
590
- const r = Y(!1), c = Y(!1), a = y(
591
- () => ne(t.submitted) || r.value
592
- ), d = y(() => !a.value || t.isValid()), w = Qe(e, {
593
- isValid: () => d.value
589
+ function rt(e, t) {
590
+ const n = Y(!1), u = Y(!1), o = y(
591
+ () => re(t.submitted) || n.value
592
+ ), c = y(() => !o.value || t.isValid()), b = nt(e, {
593
+ isValid: () => c.value
594
594
  });
595
- function S(E) {
596
- return y(() => !a.value || ne(E));
595
+ function k(x) {
596
+ return y(() => !o.value || re(x));
597
597
  }
598
- function $(E) {
598
+ function P(x) {
599
599
  return Object.fromEntries(
600
- Object.entries(E).map(([A, O]) => [
601
- A,
602
- S(O)
600
+ Object.entries(x).map(([D, O]) => [
601
+ D,
602
+ k(O)
603
603
  ])
604
604
  );
605
605
  }
606
- function V(E) {
607
- const A = ne(E);
608
- if (!A) return;
609
- A.querySelector(
606
+ function N(x) {
607
+ const D = re(x);
608
+ if (!D) return;
609
+ D.querySelector(
610
610
  '.k-invalid input, .k-invalid[tabindex="0"]'
611
611
  )?.focus();
612
612
  }
613
- function M(E) {
614
- if (c.value) {
615
- c.value = !1;
613
+ function M(x) {
614
+ if (u.value) {
615
+ u.value = !1;
616
616
  return;
617
617
  }
618
- w.onFocusout(E), w.touched.value && (r.value = !0);
618
+ b.onFocusout(x), b.touched.value && (n.value = !0);
619
619
  }
620
620
  function R() {
621
- r.value = !1, c.value = !0, w.reset();
621
+ n.value = !1, u.value = !0, b.reset();
622
622
  }
623
623
  return {
624
- touched: r,
625
- fieldsetValidate: a,
624
+ touched: n,
625
+ fieldsetValidate: o,
626
626
  onFocusout: M,
627
627
  reset: R,
628
- createFieldValidity: S,
629
- createFieldValidationsMap: $,
630
- focusFirstInvalidField: V
628
+ createFieldValidity: k,
629
+ createFieldValidationsMap: P,
630
+ focusFirstInvalidField: N
631
631
  };
632
632
  }
633
- const tt = [
633
+ const at = [
634
634
  { label: "Alabama", value: "AL" },
635
635
  { label: "Alaska", value: "AK" },
636
636
  { label: "Arizona", value: "AZ" },
@@ -689,8 +689,8 @@ function xe(e) {
689
689
  }
690
690
  return "";
691
691
  }
692
- function nt() {
693
- const e = ze({
692
+ function ot() {
693
+ const e = Ye({
694
694
  address1: "",
695
695
  address2: "",
696
696
  city: "",
@@ -699,393 +699,393 @@ function nt() {
699
699
  });
700
700
  return {
701
701
  formData: e,
702
- onAddress1Input: (...w) => {
703
- e.address1 = xe(w[0]);
702
+ onAddress1Input: (...b) => {
703
+ e.address1 = xe(b[0]);
704
704
  },
705
- onAddress2Input: (...w) => {
706
- e.address2 = xe(w[0]);
705
+ onAddress2Input: (...b) => {
706
+ e.address2 = xe(b[0]);
707
707
  },
708
- onCityInput: (...w) => {
709
- e.city = xe(w[0]);
708
+ onCityInput: (...b) => {
709
+ e.city = xe(b[0]);
710
710
  },
711
- onStateChange: (w) => {
712
- e.state = w.value;
711
+ onStateChange: (b) => {
712
+ e.state = b.value;
713
713
  },
714
714
  resetFormData: () => {
715
715
  e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
716
716
  }
717
717
  };
718
718
  }
719
- function rt(e, t = "zip") {
720
- const r = Je({ id: t }), {
721
- zipDisplay: c,
722
- zipRaw: a,
723
- isZipValid: d,
724
- wrapperClass: w,
725
- handleZipInput: S
726
- } = r;
727
- return le(a, (V) => {
728
- e.zip = V;
719
+ function lt(e, t = "zip") {
720
+ const n = tt({ id: t }), {
721
+ zipDisplay: u,
722
+ zipRaw: o,
723
+ isZipValid: c,
724
+ wrapperClass: b,
725
+ handleZipInput: k
726
+ } = n;
727
+ return ae(o, (N) => {
728
+ e.zip = N;
729
729
  }), {
730
- zipDisplay: c,
731
- isZipValid: d,
732
- zipWrapperClass: w,
733
- onZipInput: S,
730
+ zipDisplay: u,
731
+ isZipValid: c,
732
+ zipWrapperClass: b,
733
+ onZipInput: k,
734
734
  resetZip: () => {
735
- c.value = "", e.zip = "";
735
+ u.value = "", e.zip = "";
736
736
  }
737
737
  };
738
738
  }
739
- function at(e) {
739
+ function it(e) {
740
740
  const t = y(
741
741
  () => e.formData.address1.trim() !== ""
742
- ), r = y(() => e.formData.city.trim() !== ""), c = y(() => !!e.formData.state), a = y(() => ne(e.isZipValid)), d = y(
743
- () => t.value && r.value && c.value && a.value
742
+ ), n = y(() => e.formData.city.trim() !== ""), u = y(() => !!e.formData.state), o = y(() => re(e.isZipValid)), c = y(
743
+ () => t.value && n.value && u.value && o.value
744
744
  );
745
745
  return {
746
746
  strictAddress1Valid: t,
747
- strictCityValid: r,
748
- strictStateValid: c,
749
- strictZipValid: a,
750
- strictAddressValid: d
747
+ strictCityValid: n,
748
+ strictStateValid: u,
749
+ strictZipValid: o,
750
+ strictAddressValid: c
751
751
  };
752
752
  }
753
- function ot(e) {
753
+ function st(e) {
754
754
  if (!e) return;
755
755
  e.querySelector(
756
756
  '.k-invalid input, .k-invalid[tabindex="0"]'
757
757
  )?.focus();
758
758
  }
759
- function lt(e, t) {
760
- const r = e ?? t.currentTarget, c = t.relatedTarget;
761
- return !r || !r.contains(c);
759
+ function ut(e, t) {
760
+ const n = e ?? t.currentTarget, u = t.relatedTarget;
761
+ return !n || !n.contains(u);
762
762
  }
763
- function At(e) {
763
+ function It(e) {
764
764
  const t = Y(
765
- ne(e.fieldsetRef)
765
+ re(e.fieldsetRef)
766
766
  );
767
- Le(() => {
768
- t.value = ne(e.fieldsetRef);
767
+ ze(() => {
768
+ t.value = re(e.fieldsetRef);
769
769
  });
770
- const r = Y(!1), c = Y(!1), a = y(() => ne(e.required) ?? !0), {
771
- formData: d,
772
- onAddress1Input: w,
773
- onAddress2Input: S,
774
- onCityInput: $,
775
- onStateChange: V,
770
+ const n = Y(!1), u = Y(!1), o = y(() => re(e.required) ?? !0), {
771
+ formData: c,
772
+ onAddress1Input: b,
773
+ onAddress2Input: k,
774
+ onCityInput: P,
775
+ onStateChange: N,
776
776
  resetFormData: M
777
- } = nt(), R = `${e.addressId}-zip`, { zipDisplay: E, isZipValid: A, zipWrapperClass: O, onZipInput: p, resetZip: i } = rt(d, R), {
778
- strictAddress1Valid: v,
777
+ } = ot(), R = `${e.addressId}-zip`, { zipDisplay: x, isZipValid: D, zipWrapperClass: O, onZipInput: f, resetZip: s } = lt(c, R), {
778
+ strictAddress1Valid: g,
779
779
  strictCityValid: I,
780
- strictStateValid: N,
781
- strictZipValid: H,
780
+ strictStateValid: V,
781
+ strictZipValid: W,
782
782
  strictAddressValid: X
783
- } = at({
784
- formData: d,
785
- isZipValid: A
786
- }), Z = et(t, {
787
- submitted: r,
783
+ } = it({
784
+ formData: c,
785
+ isZipValid: D
786
+ }), _ = rt(t, {
787
+ submitted: n,
788
788
  isValid: () => X.value
789
- }), { touched: J, fieldsetValidate: s, onFocusout: x, reset: m } = Z, k = Z.createFieldValidationsMap({
790
- address1: v,
789
+ }), { touched: F, fieldsetValidate: a, onFocusout: m, reset: v } = _, A = _.createFieldValidationsMap({
790
+ address1: g,
791
791
  city: I,
792
- state: N,
793
- zip: H,
792
+ state: V,
793
+ zip: W,
794
794
  address: X
795
795
  }), {
796
796
  address1: C,
797
- city: D,
798
- state: P,
799
- zip: U,
800
- address: j
801
- } = k, re = y(
802
- () => a.value ? s.value : !1
803
- ), ue = y(
804
- () => a.value ? C.value : !0
805
- ), o = y(
806
- () => a.value ? D.value : !0
807
- ), b = y(
808
- () => a.value ? P.value : !0
797
+ city: E,
798
+ state: L,
799
+ zip: K,
800
+ address: Z
801
+ } = A, ne = y(
802
+ () => o.value ? a.value : !1
803
+ ), ie = y(
804
+ () => o.value ? C.value : !0
805
+ ), l = y(
806
+ () => o.value ? E.value : !0
807
+ ), S = y(
808
+ () => o.value ? L.value : !0
809
809
  ), q = y(
810
- () => a.value ? U.value : !0
811
- ), f = y(
812
- () => a.value ? j.value : !0
813
- ), h = { value: null, label: "State" }, L = tt.map(({ label: g, value: F }) => ({
814
- label: g,
815
- value: F
816
- })), n = y(() => ({
817
- address1: d.address1.trim(),
818
- address2: d.address2.trim(),
819
- city: d.city.trim(),
820
- state: (d.state ?? "").trim().toUpperCase(),
821
- zip: d.zip.replace(/\D/g, "")
822
- })), u = y(() => d.address1.trim() === "" && d.address2.trim() === "" && d.city.trim() === "" && (d.state ?? "").trim() === "" && d.zip.replace(/\D/g, "") === ""), T = y(() => !u.value), K = y(() => !a.value && T.value && (!v.value || !I.value || !N.value)), z = y(() => {
823
- const g = d.zip.replace(/\D/g, "");
824
- return !a.value && T.value && g.length !== 5 && g.length !== 9;
825
- }), Q = y(() => !a.value && T.value && !X.value), W = y(() => !a.value && Q.value && (c.value || r.value));
826
- return le(n, () => {
827
- a.value || (c.value = !1);
828
- }), le(a, (g) => {
829
- g || (r.value = !1, c.value = !1, m());
810
+ () => o.value ? K.value : !0
811
+ ), p = y(
812
+ () => o.value ? Z.value : !0
813
+ ), w = { value: null, label: "State" }, z = at.map(({ label: h, value: $ }) => ({
814
+ label: h,
815
+ value: $
816
+ })), r = y(() => ({
817
+ address1: c.address1.trim(),
818
+ address2: c.address2.trim(),
819
+ city: c.city.trim(),
820
+ state: (c.state ?? "").trim().toUpperCase(),
821
+ zip: c.zip.replace(/\D/g, "")
822
+ })), d = y(() => c.address1.trim() === "" && c.address2.trim() === "" && c.city.trim() === "" && (c.state ?? "").trim() === "" && c.zip.replace(/\D/g, "") === ""), T = y(() => !d.value), U = y(() => !o.value && T.value && (!g.value || !I.value || !V.value)), B = y(() => {
823
+ const h = c.zip.replace(/\D/g, "");
824
+ return !o.value && T.value && h.length !== 5 && h.length !== 9;
825
+ }), Q = y(() => !o.value && T.value && !X.value), j = y(() => !o.value && Q.value && (u.value || n.value));
826
+ return ae(r, () => {
827
+ o.value || (u.value = !1);
828
+ }), ae(o, (h) => {
829
+ h || (n.value = !1, u.value = !1, v());
830
830
  }), {
831
- formData: d,
832
- submitted: r,
833
- touched: J,
834
- addressValidate: re,
835
- address1Valid: ue,
836
- cityValid: o,
837
- stateValid: b,
831
+ formData: c,
832
+ submitted: n,
833
+ touched: F,
834
+ addressValidate: ne,
835
+ address1Valid: ie,
836
+ cityValid: l,
837
+ stateValid: S,
838
838
  zipValid: q,
839
- addressValid: f,
840
- optionalFeedbackActive: W,
839
+ addressValid: p,
840
+ optionalFeedbackActive: j,
841
841
  optionalPartialInvalid: Q,
842
- optionalMissingRequiredFields: K,
843
- optionalZipInvalid: z,
844
- stateDefaultItem: h,
845
- stateOptions: L,
846
- zipDisplay: E,
842
+ optionalMissingRequiredFields: U,
843
+ optionalZipInvalid: B,
844
+ stateDefaultItem: w,
845
+ stateOptions: z,
846
+ zipDisplay: x,
847
847
  zipWrapperClass: O,
848
- onAddress1Input: w,
849
- onAddress2Input: S,
850
- onCityInput: $,
851
- onStateChange: V,
852
- onZipInput: p,
853
- onFieldsetFocusout: (g) => {
854
- const F = lt(t.value, g);
855
- x(g), !a.value && F && (c.value = !0);
848
+ onAddress1Input: b,
849
+ onAddress2Input: k,
850
+ onCityInput: P,
851
+ onStateChange: N,
852
+ onZipInput: f,
853
+ onFieldsetFocusout: (h) => {
854
+ const $ = ut(t.value, h);
855
+ m(h), !o.value && $ && (u.value = !0);
856
856
  },
857
- normalizedPayload: n,
858
- validateForSubmit: async () => a.value ? (r.value = !0, X.value ? {
857
+ normalizedPayload: r,
858
+ validateForSubmit: async () => o.value ? (n.value = !0, X.value ? {
859
859
  isValid: !0,
860
- payload: n.value
861
- } : (await _(), ot(t.value), { isValid: !1, payload: null })) : u.value || X.value ? (r.value = !1, {
860
+ payload: r.value
861
+ } : (await G(), st(t.value), { isValid: !1, payload: null })) : d.value || X.value ? (n.value = !1, {
862
862
  isValid: !0,
863
- payload: n.value
864
- }) : (r.value = !0, { isValid: !1, payload: null }),
863
+ payload: r.value
864
+ }) : (n.value = !0, { isValid: !1, payload: null }),
865
865
  reset: () => {
866
- r.value = !1, c.value = !1, m(), M(), i();
866
+ n.value = !1, u.value = !1, v(), M(), s();
867
867
  }
868
868
  };
869
869
  }
870
- const Pe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", $e = (e) => e === "top" ? "bottom" : e === "bottom" ? "top" : "center", Me = (e, t, r, c) => {
871
- const a = e.left + (r.horizontal === "right" ? e.width : r.horizontal === "center" ? e.width / 2 : 0), d = e.top + (r.vertical === "bottom" ? e.height : r.vertical === "center" ? e.height / 2 : 0), w = t ? c.horizontal === "right" ? t.width : c.horizontal === "center" ? t.width / 2 : 0 : 0, S = t ? c.vertical === "bottom" ? t.height : c.vertical === "center" ? t.height / 2 : 0 : 0;
872
- return { left: a - w, top: d - S };
873
- }, Oe = (e, t, r, c) => t >= c - r ? r : Math.min(Math.max(e, r), c - t), it = ({
870
+ const $e = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", Oe = (e) => e === "top" ? "bottom" : e === "bottom" ? "top" : "center", Me = (e, t, n, u) => {
871
+ const o = e.left + (n.horizontal === "right" ? e.width : n.horizontal === "center" ? e.width / 2 : 0), c = e.top + (n.vertical === "bottom" ? e.height : n.vertical === "center" ? e.height / 2 : 0), b = t ? u.horizontal === "right" ? t.width : u.horizontal === "center" ? t.width / 2 : 0 : 0, k = t ? u.vertical === "bottom" ? t.height : u.vertical === "center" ? t.height / 2 : 0 : 0;
872
+ return { left: o - b, top: c - k };
873
+ }, Ve = (e, t, n, u) => t >= u - n ? n : Math.min(Math.max(e, n), u - t), ct = ({
874
874
  anchor: e,
875
875
  popup: t,
876
- anchorAlign: r,
877
- popupAlign: c,
878
- bounds: a,
879
- collision: d
876
+ anchorAlign: n,
877
+ popupAlign: u,
878
+ bounds: o,
879
+ collision: c
880
880
  }) => {
881
- const w = Me(e, t, r, c);
882
- if (!t) return w;
883
- let { left: S, top: $ } = w;
884
- if (d.horizontal === "fit")
885
- S = Oe(S, t.width, a.left, a.right);
881
+ const b = Me(e, t, n, u);
882
+ if (!t) return b;
883
+ let { left: k, top: P } = b;
884
+ if (c.horizontal === "fit")
885
+ k = Ve(k, t.width, o.left, o.right);
886
886
  else {
887
- const V = S + t.width - a.right, M = a.left - S;
888
- if (V > 0 || M > 0) {
887
+ const N = k + t.width - o.right, M = o.left - k;
888
+ if (N > 0 || M > 0) {
889
889
  const R = Me(
890
890
  e,
891
891
  t,
892
892
  {
893
- horizontal: Pe(r.horizontal),
894
- vertical: r.vertical
893
+ horizontal: $e(n.horizontal),
894
+ vertical: n.vertical
895
895
  },
896
896
  {
897
- horizontal: Pe(c.horizontal),
898
- vertical: c.vertical
897
+ horizontal: $e(u.horizontal),
898
+ vertical: u.vertical
899
899
  }
900
- ), E = Math.max(V, 0) + Math.max(M, 0);
901
- Math.max(R.left + t.width - a.right, 0) + Math.max(a.left - R.left, 0) < E && (S = R.left);
900
+ ), x = Math.max(N, 0) + Math.max(M, 0);
901
+ Math.max(R.left + t.width - o.right, 0) + Math.max(o.left - R.left, 0) < x && (k = R.left);
902
902
  }
903
903
  }
904
- if (d.vertical === "fit")
905
- $ = Oe($, t.height, a.top, a.bottom);
904
+ if (c.vertical === "fit")
905
+ P = Ve(P, t.height, o.top, o.bottom);
906
906
  else {
907
- const V = $ + t.height - a.bottom, M = a.top - $;
908
- if (V > 0 || M > 0) {
907
+ const N = P + t.height - o.bottom, M = o.top - P;
908
+ if (N > 0 || M > 0) {
909
909
  const R = Me(
910
910
  e,
911
911
  t,
912
912
  {
913
- horizontal: r.horizontal,
914
- vertical: $e(r.vertical)
913
+ horizontal: n.horizontal,
914
+ vertical: Oe(n.vertical)
915
915
  },
916
916
  {
917
- horizontal: c.horizontal,
918
- vertical: $e(c.vertical)
917
+ horizontal: u.horizontal,
918
+ vertical: Oe(u.vertical)
919
919
  }
920
- ), E = Math.max(V, 0) + Math.max(M, 0);
921
- Math.max(R.top + t.height - a.bottom, 0) + Math.max(a.top - R.top, 0) < E && ($ = R.top);
920
+ ), x = Math.max(N, 0) + Math.max(M, 0);
921
+ Math.max(R.top + t.height - o.bottom, 0) + Math.max(o.top - R.top, 0) < x && (P = R.top);
922
922
  }
923
923
  }
924
- return { left: S, top: $ };
925
- }, Dt = (e = "fkid") => {
926
- const t = `${e}-${Ue()}`;
927
- return { instanceId: t, compose: (...c) => [t, ...c].filter((a) => a != null).map(String).join("-") };
928
- }, st = typeof window < "u" && typeof document < "u";
924
+ return { left: k, top: P };
925
+ }, Ct = (e = "fkid") => {
926
+ const t = `${e}-${He()}`;
927
+ return { instanceId: t, compose: (...u) => [t, ...u].filter((o) => o != null).map(String).join("-") };
928
+ }, dt = typeof window < "u" && typeof document < "u";
929
929
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
930
- const ut = Object.prototype.toString, ct = (e) => ut.call(e) === "[object Object]", ke = () => {
930
+ const ft = Object.prototype.toString, pt = (e) => ft.call(e) === "[object Object]", ke = () => {
931
931
  };
932
932
  function Ie(e) {
933
933
  return Array.isArray(e) ? e : [e];
934
934
  }
935
- function dt(e, t, r) {
936
- return le(e, t, {
937
- ...r,
935
+ function vt(e, t, n) {
936
+ return ae(e, t, {
937
+ ...n,
938
938
  immediate: !0
939
939
  });
940
940
  }
941
- const Ne = st ? window : void 0;
942
- function we(e) {
941
+ const Ke = dt ? window : void 0;
942
+ function be(e) {
943
943
  var t;
944
- const r = ne(e);
945
- return (t = r?.$el) !== null && t !== void 0 ? t : r;
944
+ const n = re(e);
945
+ return (t = n?.$el) !== null && t !== void 0 ? t : n;
946
946
  }
947
947
  function Ce(...e) {
948
- const t = (c, a, d, w) => (c.addEventListener(a, d, w), () => c.removeEventListener(a, d, w)), r = y(() => {
949
- const c = Ie(ne(e[0])).filter((a) => a != null);
950
- return c.every((a) => typeof a != "string") ? c : void 0;
948
+ const t = (u, o, c, b) => (u.addEventListener(o, c, b), () => u.removeEventListener(o, c, b)), n = y(() => {
949
+ const u = Ie(re(e[0])).filter((o) => o != null);
950
+ return u.every((o) => typeof o != "string") ? u : void 0;
951
951
  });
952
- return dt(() => {
953
- var c, a;
952
+ return vt(() => {
953
+ var u, o;
954
954
  return [
955
- (c = (a = r.value) === null || a === void 0 ? void 0 : a.map((d) => we(d))) !== null && c !== void 0 ? c : [Ne].filter((d) => d != null),
956
- Ie(ne(r.value ? e[1] : e[0])),
957
- Ie(Be(r.value ? e[2] : e[1])),
958
- ne(r.value ? e[3] : e[2])
955
+ (u = (o = n.value) === null || o === void 0 ? void 0 : o.map((c) => be(c))) !== null && u !== void 0 ? u : [Ke].filter((c) => c != null),
956
+ Ie(re(n.value ? e[1] : e[0])),
957
+ Ie(We(n.value ? e[2] : e[1])),
958
+ re(n.value ? e[3] : e[2])
959
959
  ];
960
- }, ([c, a, d, w], S, $) => {
961
- if (!c?.length || !a?.length || !d?.length) return;
962
- const V = ct(w) ? { ...w } : w, M = c.flatMap((R) => a.flatMap((E) => d.map((A) => t(R, E, A, V))));
963
- $(() => {
960
+ }, ([u, o, c, b], k, P) => {
961
+ if (!u?.length || !o?.length || !c?.length) return;
962
+ const N = pt(b) ? { ...b } : b, M = u.flatMap((R) => o.flatMap((x) => c.map((D) => t(R, x, D, N))));
963
+ P(() => {
964
964
  M.forEach((R) => R());
965
965
  });
966
966
  }, { flush: "post" });
967
967
  }
968
- function qe(e, t, r = {}) {
969
- const { window: c = Ne, ignore: a = [], capture: d = !0, detectIframe: w = !1, controls: S = !1 } = r;
970
- if (!c) return S ? {
968
+ function Ue(e, t, n = {}) {
969
+ const { window: u = Ke, ignore: o = [], capture: c = !0, detectIframe: b = !1, controls: k = !1 } = n;
970
+ if (!u) return k ? {
971
971
  stop: ke,
972
972
  cancel: ke,
973
973
  trigger: ke
974
974
  } : ke;
975
- let $ = !0;
976
- const V = (i) => ne(a).some((v) => {
977
- if (typeof v == "string") return Array.from(c.document.querySelectorAll(v)).some((I) => I === i.target || i.composedPath().includes(I));
975
+ let P = !0;
976
+ const N = (s) => re(o).some((g) => {
977
+ if (typeof g == "string") return Array.from(u.document.querySelectorAll(g)).some((I) => I === s.target || s.composedPath().includes(I));
978
978
  {
979
- const I = we(v);
980
- return I && (i.target === I || i.composedPath().includes(I));
979
+ const I = be(g);
980
+ return I && (s.target === I || s.composedPath().includes(I));
981
981
  }
982
982
  });
983
- function M(i) {
984
- const v = ne(i);
985
- return v && v.$.subTree.shapeFlag === 16;
983
+ function M(s) {
984
+ const g = re(s);
985
+ return g && g.$.subTree.shapeFlag === 16;
986
986
  }
987
- function R(i, v) {
988
- const I = ne(i), N = I.$.subTree && I.$.subTree.children;
989
- return N == null || !Array.isArray(N) ? !1 : N.some((H) => H.el === v.target || v.composedPath().includes(H.el));
987
+ function R(s, g) {
988
+ const I = re(s), V = I.$.subTree && I.$.subTree.children;
989
+ return V == null || !Array.isArray(V) ? !1 : V.some((W) => W.el === g.target || g.composedPath().includes(W.el));
990
990
  }
991
- const E = (i) => {
992
- const v = we(e);
993
- if (i.target != null && !(!(v instanceof Element) && M(e) && R(e, i)) && !(!v || v === i.target || i.composedPath().includes(v))) {
994
- if ("detail" in i && i.detail === 0 && ($ = !V(i)), !$) {
995
- $ = !0;
991
+ const x = (s) => {
992
+ const g = be(e);
993
+ if (s.target != null && !(!(g instanceof Element) && M(e) && R(e, s)) && !(!g || g === s.target || s.composedPath().includes(g))) {
994
+ if ("detail" in s && s.detail === 0 && (P = !N(s)), !P) {
995
+ P = !0;
996
996
  return;
997
997
  }
998
- t(i);
998
+ t(s);
999
999
  }
1000
1000
  };
1001
- let A = !1;
1001
+ let D = !1;
1002
1002
  const O = [
1003
- Ce(c, "click", (i) => {
1004
- A || (A = !0, setTimeout(() => {
1005
- A = !1;
1006
- }, 0), E(i));
1003
+ Ce(u, "click", (s) => {
1004
+ D || (D = !0, setTimeout(() => {
1005
+ D = !1;
1006
+ }, 0), x(s));
1007
1007
  }, {
1008
1008
  passive: !0,
1009
- capture: d
1009
+ capture: c
1010
1010
  }),
1011
- Ce(c, "pointerdown", (i) => {
1012
- const v = we(e);
1013
- $ = !V(i) && !!(v && !i.composedPath().includes(v));
1011
+ Ce(u, "pointerdown", (s) => {
1012
+ const g = be(e);
1013
+ P = !N(s) && !!(g && !s.composedPath().includes(g));
1014
1014
  }, { passive: !0 }),
1015
- w && Ce(c, "blur", (i) => {
1015
+ b && Ce(u, "blur", (s) => {
1016
1016
  setTimeout(() => {
1017
- const v = we(e);
1018
- let I = c.document.activeElement;
1017
+ const g = be(e);
1018
+ let I = u.document.activeElement;
1019
1019
  for (; I?.shadowRoot; ) I = I.shadowRoot.activeElement;
1020
- I?.tagName === "IFRAME" && !v?.contains(c.document.activeElement) && t(i);
1020
+ I?.tagName === "IFRAME" && !g?.contains(u.document.activeElement) && t(s);
1021
1021
  }, 0);
1022
1022
  }, { passive: !0 })
1023
- ].filter(Boolean), p = () => O.forEach((i) => i());
1024
- return S ? {
1025
- stop: p,
1023
+ ].filter(Boolean), f = () => O.forEach((s) => s());
1024
+ return k ? {
1025
+ stop: f,
1026
1026
  cancel: () => {
1027
- $ = !1;
1027
+ P = !1;
1028
1028
  },
1029
- trigger: (i) => {
1030
- $ = !0, E(i), $ = !1;
1029
+ trigger: (s) => {
1030
+ P = !0, x(s), P = !1;
1031
1031
  }
1032
- } : p;
1032
+ } : f;
1033
1033
  }
1034
- const ft = (e) => {
1034
+ const mt = (e) => {
1035
1035
  let t = null;
1036
- const r = () => {
1036
+ const n = () => {
1037
1037
  t?.disconnect(), t = null;
1038
1038
  };
1039
- return typeof window < "u" && typeof window.IntersectionObserver == "function" && le(
1039
+ return typeof window < "u" && typeof window.IntersectionObserver == "function" && ae(
1040
1040
  [e.target, () => e.root()],
1041
- ([a, d]) => {
1042
- r(), a && (t = new IntersectionObserver(
1043
- ([w]) => {
1044
- w && e.onChange(w);
1041
+ ([o, c]) => {
1042
+ n(), o && (t = new IntersectionObserver(
1043
+ ([b]) => {
1044
+ b && e.onChange(b);
1045
1045
  },
1046
- { root: d, threshold: e.threshold ?? 1 }
1047
- ), t.observe(a));
1046
+ { root: c, threshold: e.threshold ?? 1 }
1047
+ ), t.observe(o));
1048
1048
  },
1049
1049
  { immediate: !0 }
1050
- ), Te(r), { disconnect: r };
1051
- }, pt = ".k-table-row", he = (e) => {
1050
+ ), Te(n), { disconnect: n };
1051
+ }, gt = ".k-table-row", ye = (e) => {
1052
1052
  if (e instanceof HTMLElement) return e;
1053
1053
  const t = e?.$el;
1054
1054
  return t instanceof HTMLElement ? t : null;
1055
- }, mt = (e, t) => t === "row" ? e.matches("tr.k-table-row") : !e.matches("tr.k-table-row"), vt = (e, t) => {
1055
+ }, ht = (e, t) => t === "row" ? e.matches("tr.k-table-row") : !e.matches("tr.k-table-row"), yt = (e, t) => {
1056
1056
  console.warn(
1057
1057
  `usePopupMenu: triggerMode "${t}" does not match resolved element <${e.tagName.toLowerCase()}${e.className ? `.${e.className.split(" ").join(".")}` : ""}>; ARIA management skipped.`
1058
1058
  );
1059
- }, gt = (e) => {
1060
- let t = e.parentElement, r = null;
1059
+ }, wt = (e) => {
1060
+ let t = e.parentElement, n = null;
1061
1061
  for (; t; ) {
1062
- const { overflow: c, overflowX: a, overflowY: d } = window.getComputedStyle(t), w = /auto|scroll|overlay/.test(`${c} ${a}`), S = /auto|scroll|overlay/.test(`${c} ${d}`);
1063
- if ((w || S) && (r ??= t), w && t.scrollWidth > t.clientWidth || S && t.scrollHeight > t.clientHeight)
1062
+ const { overflow: u, overflowX: o, overflowY: c } = window.getComputedStyle(t), b = /auto|scroll|overlay/.test(`${u} ${o}`), k = /auto|scroll|overlay/.test(`${u} ${c}`);
1063
+ if ((b || k) && (n ??= t), b && t.scrollWidth > t.clientWidth || k && t.scrollHeight > t.clientHeight)
1064
1064
  return t;
1065
1065
  t = t.parentElement;
1066
1066
  }
1067
- return r;
1068
- }, Et = (e) => {
1069
- const t = Y(null), r = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", c = e.triggerMode, a = e.anchor === !0 ? {} : e.anchor, d = a?.activationPoint ? a.activationPoint === !0 ? {} : a.activationPoint : null, w = ye(null), S = ye(null), $ = a?.anchorAlign ?? {
1067
+ return n;
1068
+ }, Tt = (e) => {
1069
+ const t = Y(null), n = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", u = e.triggerMode, o = e.anchor === !0 ? {} : e.anchor, c = o?.activationPoint ? o.activationPoint === !0 ? {} : o.activationPoint : null, b = ve(null), k = ve(null), P = o?.anchorAlign ?? {
1070
1070
  horizontal: "left",
1071
1071
  vertical: "bottom"
1072
- }, V = a?.popupAlign ?? {
1072
+ }, N = o?.popupAlign ?? {
1073
1073
  horizontal: "left",
1074
1074
  vertical: "top"
1075
- }, M = a?.collision ?? {
1075
+ }, M = o?.collision ?? {
1076
1076
  horizontal: "flip",
1077
1077
  vertical: "flip"
1078
- }, R = ye(null), E = () => he(e.triggerRef.value), A = y(() => E()), O = y(
1079
- () => a && a.hideWhenAnchorClipped !== !1 ? A.value : null
1080
- ), p = () => {
1081
- const f = a?.clipRoot ? ne(a.clipRoot) : null;
1082
- if (f) {
1083
- const h = f.getBoundingClientRect();
1078
+ }, R = ve(null), x = () => ye(e.triggerRef.value), D = y(() => x()), O = y(
1079
+ () => o && o.hideWhenAnchorClipped !== !1 ? D.value : null
1080
+ ), f = () => {
1081
+ const p = o?.clipRoot ? re(o.clipRoot) : null;
1082
+ if (p) {
1083
+ const w = p.getBoundingClientRect();
1084
1084
  return {
1085
- left: h.left,
1086
- top: h.top,
1087
- right: h.right,
1088
- bottom: h.bottom
1085
+ left: w.left,
1086
+ top: w.top,
1087
+ right: w.right,
1088
+ bottom: w.bottom
1089
1089
  };
1090
1090
  }
1091
1091
  return {
@@ -1094,193 +1094,193 @@ const ft = (e) => {
1094
1094
  right: window.innerWidth,
1095
1095
  bottom: window.innerHeight
1096
1096
  };
1097
- }, i = y(() => {
1098
- const f = w.value;
1099
- if (!e.isOpen.value || !f) return { left: 0, top: 0 };
1100
- const h = p(), L = it({
1101
- anchor: f,
1097
+ }, s = y(() => {
1098
+ const p = b.value;
1099
+ if (!e.isOpen.value || !p) return { left: 0, top: 0 };
1100
+ const w = f(), z = ct({
1101
+ anchor: p,
1102
1102
  popup: R.value,
1103
- anchorAlign: $,
1104
- popupAlign: V,
1105
- bounds: h,
1103
+ anchorAlign: P,
1104
+ popupAlign: N,
1105
+ bounds: w,
1106
1106
  collision: M
1107
1107
  });
1108
1108
  return {
1109
- left: L.left + window.scrollX,
1110
- top: L.top + window.scrollY
1109
+ left: z.left + window.scrollX,
1110
+ top: z.top + window.scrollY
1111
1111
  };
1112
- }), v = () => {
1113
- const f = e.resolveFocusTarget?.() ?? he(e.focusTargetRef?.value);
1114
- return f || (e.focusTargetContainerSelector ? E()?.closest(
1112
+ }), g = () => {
1113
+ const p = e.resolveFocusTarget?.() ?? ye(e.focusTargetRef?.value);
1114
+ return p || (e.focusTargetContainerSelector ? x()?.closest(
1115
1115
  e.focusTargetContainerSelector
1116
1116
  ) ?? null : null);
1117
- }, I = (f, h) => {
1118
- if (!d) return !1;
1119
- const L = he(f);
1120
- if (!L)
1121
- return S.value = null, !1;
1122
- const n = L.getBoundingClientRect();
1123
- if (h.triggerType === "keyboard") {
1124
- const u = d.keyboardPosition, T = u?.y ?? "center", K = typeof T == "number" ? T : T === "top" ? 0 : T === "bottom" ? n.height : n.height / 2;
1125
- return S.value = {
1126
- trigger: L,
1127
- point: { x: u?.x ?? 8, y: K },
1117
+ }, I = (p, w) => {
1118
+ if (!c) return !1;
1119
+ const z = ye(p);
1120
+ if (!z)
1121
+ return k.value = null, !1;
1122
+ const r = z.getBoundingClientRect();
1123
+ if (w.triggerType === "keyboard") {
1124
+ const d = c.keyboardPosition, T = d?.y ?? "center", U = typeof T == "number" ? T : T === "top" ? 0 : T === "bottom" ? r.height : r.height / 2;
1125
+ return k.value = {
1126
+ trigger: z,
1127
+ point: { x: d?.x ?? 8, y: U },
1128
1128
  hasMatchedTrigger: !1
1129
1129
  }, !0;
1130
1130
  }
1131
- return h.coordinates ? (S.value = {
1132
- trigger: L,
1131
+ return w.coordinates ? (k.value = {
1132
+ trigger: z,
1133
1133
  point: {
1134
- x: h.coordinates.clientX - n.left + (d.pointerOffset?.x ?? 0),
1135
- y: h.coordinates.clientY - n.top + (d.pointerOffset?.y ?? 0)
1134
+ x: w.coordinates.clientX - r.left + (c.pointerOffset?.x ?? 0),
1135
+ y: w.coordinates.clientY - r.top + (c.pointerOffset?.y ?? 0)
1136
1136
  },
1137
1137
  hasMatchedTrigger: !1
1138
- }, !0) : (S.value = null, !1);
1139
- }, N = () => {
1140
- if (c !== "button") return null;
1138
+ }, !0) : (k.value = null, !1);
1139
+ }, V = () => {
1140
+ if (u !== "button") return null;
1141
1141
  if (e.escapeFocusTarget) return e.escapeFocusTarget();
1142
- const f = e.escapeFocusContainerSelector ?? pt;
1143
- return (E() ?? document.activeElement)?.closest(f) ?? null;
1144
- }, H = () => {
1145
- const f = v() ?? N();
1146
- if (f)
1147
- return f.focus(), !0;
1148
- const h = E();
1149
- return h?.focus(), !!h;
1142
+ const p = e.escapeFocusContainerSelector ?? gt;
1143
+ return (x() ?? document.activeElement)?.closest(p) ?? null;
1144
+ }, W = () => {
1145
+ const p = g() ?? V();
1146
+ if (p)
1147
+ return p.focus(), !0;
1148
+ const w = x();
1149
+ return w?.focus(), !!w;
1150
1150
  }, X = () => {
1151
- he(e.menuRef.value)?.querySelector(r)?.focus({ preventScroll: !0 });
1152
- }, Z = ye(null), J = ye(null);
1153
- let s = !1;
1154
- const x = () => {
1155
- const f = t.value;
1156
- if (f === "keyboard" || f === "escape") {
1157
- const h = Z.value ?? J.value;
1158
- h?.focus(), f === "keyboard" && h && h === J.value && (s = !0);
1159
- } else t.value === "mouse-selection" && J.value?.focus();
1160
- t.value = null, Z.value = null, J.value = null;
1161
- }, m = (f) => {
1162
- e.isOpen.value && (t.value = f, Z.value = v() ?? (f === "escape" ? N() : null), J.value = E(), U(!1), e.requestHide(), _(x));
1151
+ ye(e.menuRef.value)?.querySelector(n)?.focus({ preventScroll: !0 });
1152
+ }, _ = ve(null), F = ve(null);
1153
+ let a = !1;
1154
+ const m = () => {
1155
+ const p = t.value;
1156
+ if (p === "keyboard" || p === "escape") {
1157
+ const w = _.value ?? F.value;
1158
+ w?.focus(), p === "keyboard" && w && w === F.value && (a = !0);
1159
+ } else t.value === "mouse-selection" && F.value?.focus();
1160
+ t.value = null, _.value = null, F.value = null;
1161
+ }, v = (p) => {
1162
+ e.isOpen.value && (t.value = p, _.value = g() ?? (p === "escape" ? V() : null), F.value = x(), K(!1), e.requestHide(), G(m));
1163
1163
  };
1164
- le(
1165
- [A, S],
1166
- ([f], h, L) => {
1167
- if (!a || !f) {
1168
- w.value = null;
1164
+ ae(
1165
+ [D, k],
1166
+ ([p], w, z) => {
1167
+ if (!o || !p) {
1168
+ b.value = null;
1169
1169
  return;
1170
1170
  }
1171
- let n = null;
1172
- const u = () => {
1173
- n = null;
1174
- const z = S.value;
1175
- if (d) {
1176
- z && z.trigger === f ? z.hasMatchedTrigger = !0 : z?.hasMatchedTrigger && (z.trigger = f);
1177
- const Q = f.getBoundingClientRect();
1178
- w.value = z?.trigger === f ? new DOMRect(
1179
- Q.left + z.point.x,
1180
- Q.top + z.point.y,
1171
+ let r = null;
1172
+ const d = () => {
1173
+ r = null;
1174
+ const B = k.value;
1175
+ if (c) {
1176
+ B && B.trigger === p ? B.hasMatchedTrigger = !0 : B?.hasMatchedTrigger && (B.trigger = p);
1177
+ const Q = p.getBoundingClientRect();
1178
+ b.value = B?.trigger === p ? new DOMRect(
1179
+ Q.left + B.point.x,
1180
+ Q.top + B.point.y,
1181
1181
  0,
1182
1182
  0
1183
1183
  ) : null;
1184
1184
  return;
1185
1185
  }
1186
- w.value = a.getRect?.(f) ?? f.getBoundingClientRect();
1186
+ b.value = o.getRect?.(p) ?? p.getBoundingClientRect();
1187
1187
  }, T = () => {
1188
- n === null && (n = window.requestAnimationFrame(u));
1189
- }, K = typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
1190
- K?.observe(f), window.addEventListener("scroll", T, {
1188
+ r === null && (r = window.requestAnimationFrame(d));
1189
+ }, U = typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
1190
+ U?.observe(p), window.addEventListener("scroll", T, {
1191
1191
  capture: !0,
1192
1192
  passive: !0
1193
- }), window.addEventListener("resize", T, { passive: !0 }), T(), L(() => {
1194
- n !== null && window.cancelAnimationFrame(n), K?.disconnect(), window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
1193
+ }), window.addEventListener("resize", T, { passive: !0 }), T(), z(() => {
1194
+ r !== null && window.cancelAnimationFrame(r), U?.disconnect(), window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
1195
1195
  });
1196
1196
  },
1197
1197
  { immediate: !0, flush: "post" }
1198
1198
  );
1199
- const k = () => {
1200
- const f = he(
1199
+ const A = () => {
1200
+ const p = ye(
1201
1201
  e.popupContentRef?.value ?? e.menuRef.value
1202
1202
  );
1203
- return f?.closest(".k-popup") ?? f;
1203
+ return p?.closest(".k-popup") ?? p;
1204
1204
  };
1205
- a && le(
1205
+ o && ae(
1206
1206
  e.isOpen,
1207
- (f, h, L) => {
1208
- if (!f) {
1207
+ (p, w, z) => {
1208
+ if (!p) {
1209
1209
  R.value = null;
1210
1210
  return;
1211
1211
  }
1212
- let n = null;
1213
- const u = () => {
1214
- n = null;
1215
- const Q = k();
1212
+ let r = null;
1213
+ const d = () => {
1214
+ r = null;
1215
+ const Q = A();
1216
1216
  R.value = Q?.getBoundingClientRect() ?? null;
1217
1217
  }, T = () => {
1218
- n === null && (n = window.requestAnimationFrame(u));
1219
- }, K = k(), z = K && typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
1220
- z?.observe(K), T(), L(() => {
1221
- n !== null && window.cancelAnimationFrame(n), z?.disconnect();
1218
+ r === null && (r = window.requestAnimationFrame(d));
1219
+ }, U = A(), B = U && typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
1220
+ B?.observe(U), T(), z(() => {
1221
+ r !== null && window.cancelAnimationFrame(r), B?.disconnect();
1222
1222
  });
1223
1223
  },
1224
1224
  { immediate: !0, flush: "post" }
1225
- ), ft({
1225
+ ), mt({
1226
1226
  target: O,
1227
- root: () => a?.clipRoot ? ne(a.clipRoot) : A.value ? gt(A.value) : null,
1228
- threshold: a?.intersectionThreshold ?? (d ? 0 : 0.5),
1229
- onChange: (f) => {
1230
- f.isIntersecting || m("anchor-hidden");
1227
+ root: () => o?.clipRoot ? re(o.clipRoot) : D.value ? wt(D.value) : null,
1228
+ threshold: o?.intersectionThreshold ?? (c ? 0 : 0.5),
1229
+ onChange: (p) => {
1230
+ p.isIntersecting || v("anchor-hidden");
1231
1231
  }
1232
- }), qe(e.menuRef, () => m("outside-click"), {
1233
- ignore: [A]
1232
+ }), Ue(e.menuRef, () => v("outside-click"), {
1233
+ ignore: [D]
1234
1234
  });
1235
- let C = null, D = null;
1236
- const P = () => {
1235
+ let C = null, E = null;
1236
+ const L = () => {
1237
1237
  C?.isConnected && C.setAttribute("aria-expanded", "false"), C = null;
1238
- }, U = (f) => {
1238
+ }, K = (p) => {
1239
1239
  if (e.manageMenuTriggerAria === !1) return;
1240
- const h = A.value;
1241
- if (!h) {
1242
- C?.isConnected && C.setAttribute("aria-expanded", f ? "true" : "false");
1240
+ const w = D.value;
1241
+ if (!w) {
1242
+ C?.isConnected && C.setAttribute("aria-expanded", p ? "true" : "false");
1243
1243
  return;
1244
1244
  }
1245
- if (!mt(h, c)) {
1246
- vt(h, c), P();
1245
+ if (!ht(w, u)) {
1246
+ yt(w, u), L();
1247
1247
  return;
1248
1248
  }
1249
- C && C !== h && P(), h.setAttribute("aria-expanded", f ? "true" : "false"), C = h;
1250
- }, j = () => {
1251
- const f = he(e.menuRef.value), h = f?.matches('[role="menubar"]') ? f : f?.querySelector('[role="menubar"]'), L = ne(e.menuLabel)?.trim();
1252
- D && D !== h && D.removeAttribute("aria-label"), h && (L ? h.setAttribute("aria-label", L) : h.removeAttribute("aria-label")), D = h ?? null;
1249
+ C && C !== w && L(), w.setAttribute("aria-expanded", p ? "true" : "false"), C = w;
1250
+ }, Z = () => {
1251
+ const p = ye(e.menuRef.value), w = p?.matches('[role="menubar"]') ? p : p?.querySelector('[role="menubar"]'), z = re(e.menuLabel)?.trim();
1252
+ E && E !== w && E.removeAttribute("aria-label"), w && (z ? w.setAttribute("aria-label", z) : w.removeAttribute("aria-label")), E = w ?? null;
1253
1253
  };
1254
- le(
1254
+ ae(
1255
1255
  [e.isOpen, e.triggerRef],
1256
- ([f]) => {
1257
- U(f), !f && d && (S.value = null, w.value = null);
1256
+ ([p]) => {
1257
+ K(p), !p && c && (k.value = null, b.value = null);
1258
1258
  },
1259
1259
  { immediate: !0, flush: "post" }
1260
- ), le(
1261
- [e.isOpen, e.menuRef, () => ne(e.menuLabel)],
1262
- j,
1260
+ ), ae(
1261
+ [e.isOpen, e.menuRef, () => re(e.menuLabel)],
1262
+ Z,
1263
1263
  { immediate: !0, flush: "post" }
1264
1264
  ), Te(() => {
1265
- S.value = null, P(), D?.removeAttribute("aria-label");
1266
- }), le(
1265
+ k.value = null, L(), E?.removeAttribute("aria-label");
1266
+ }), ae(
1267
1267
  e.isOpen,
1268
- (f) => {
1269
- f && X();
1268
+ (p) => {
1269
+ p && X();
1270
1270
  },
1271
1271
  { flush: "post" }
1272
1272
  );
1273
- const re = (...f) => {
1274
- const h = f[0];
1275
- if (s) {
1276
- s = !1;
1273
+ const ne = (...p) => {
1274
+ const w = p[0];
1275
+ if (a) {
1276
+ a = !1;
1277
1277
  return;
1278
1278
  }
1279
1279
  if (e.isOpen.value) {
1280
- m("trigger-click");
1280
+ v("trigger-click");
1281
1281
  return;
1282
1282
  }
1283
- e.requestShow(h);
1283
+ e.requestShow(w);
1284
1284
  };
1285
1285
  return {
1286
1286
  /**
@@ -1292,37 +1292,37 @@ const ft = (e) => {
1292
1292
  * Handles Kendo Menu selection: records keyboard or mouse modality,
1293
1293
  * requests popup close, then runs the optional caller-owned action.
1294
1294
  */
1295
- handleMenuSelect: (f, h) => {
1296
- m(
1297
- f.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
1298
- ), h?.(f);
1295
+ handleMenuSelect: (p, w) => {
1296
+ v(
1297
+ p.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
1298
+ ), w?.(p);
1299
1299
  },
1300
1300
  /**
1301
1301
  * Toggles the action menu. When opening, focuses the first enabled Kendo
1302
1302
  * Menu item after Vue renders the popup.
1303
1303
  */
1304
- handleTriggerClick: re,
1304
+ handleTriggerClick: ne,
1305
1305
  /**
1306
1306
  * Handles trigger keyboard input: Enter and Space toggle the menu; Escape
1307
1307
  * closes an open menu or focuses the configured target when already closed.
1308
1308
  */
1309
- handleTriggerKeydown: (...f) => {
1310
- const h = f[0], L = f[1];
1311
- if (h.key === "Enter" || h.code === "Space") {
1312
- h.preventDefault(), re(L);
1309
+ handleTriggerKeydown: (...p) => {
1310
+ const w = p[0], z = p[1];
1311
+ if (w.key === "Enter" || w.code === "Space") {
1312
+ w.preventDefault(), ne(z);
1313
1313
  return;
1314
1314
  }
1315
- if (h.key === "Escape") {
1316
- if (h.preventDefault(), h.stopPropagation(), e.isOpen.value) {
1317
- m("escape");
1315
+ if (w.key === "Escape") {
1316
+ if (w.preventDefault(), w.stopPropagation(), e.isOpen.value) {
1317
+ v("escape");
1318
1318
  return;
1319
1319
  }
1320
- H();
1320
+ W();
1321
1321
  }
1322
1322
  },
1323
1323
  /** Closes the open menu through the keyboard path when Escape is pressed inside it. */
1324
- handleMenuEscape: (f) => {
1325
- f.preventDefault(), f.stopPropagation(), m("escape");
1324
+ handleMenuEscape: (p) => {
1325
+ p.preventDefault(), p.stopPropagation(), v("escape");
1326
1326
  },
1327
1327
  /**
1328
1328
  * Restores focus after Kendo Popup closes: keyboard menu selection and
@@ -1331,201 +1331,324 @@ const ft = (e) => {
1331
1331
  * outside clicks do not move focus.
1332
1332
  */
1333
1333
  handlePopupClose: () => {
1334
- _(x);
1334
+ G(m);
1335
1335
  },
1336
- offset: i
1336
+ offset: s
1337
1337
  };
1338
- }, xt = () => {
1338
+ }, Rt = () => {
1339
1339
  const e = /* @__PURE__ */ new Set();
1340
- return { register: (a) => {
1341
- e.add(a), Te(() => e.delete(a));
1342
- }, deactivateOthers: (a) => {
1343
- e.forEach((d) => {
1344
- d !== a && d.deactivate();
1340
+ return { register: (o) => {
1341
+ e.add(o), Te(() => e.delete(o));
1342
+ }, deactivateOthers: (o) => {
1343
+ e.forEach((c) => {
1344
+ c !== o && c.deactivate();
1345
1345
  });
1346
1346
  }, deactivateAll: () => {
1347
- e.forEach((a) => a.deactivate());
1347
+ e.forEach((o) => o.deactivate());
1348
1348
  } };
1349
- }, ht = (e) => {
1349
+ }, bt = (e) => {
1350
1350
  if (e instanceof HTMLElement) return e;
1351
1351
  const t = e && "$el" in e ? e.$el : null;
1352
1352
  return t instanceof HTMLElement ? t : null;
1353
- }, Mt = () => {
1354
- const e = Ye(/* @__PURE__ */ new Map()), t = Y(null), r = (S, $) => {
1355
- const V = ht($);
1356
- V ? e.set(S, V) : e.delete(S);
1357
- }, c = (S) => e.get(S) ?? null, a = (S) => {
1358
- t.value = S;
1359
- }, d = () => {
1353
+ }, Ft = () => {
1354
+ const e = Xe(/* @__PURE__ */ new Map()), t = Y(null), n = (k, P) => {
1355
+ const N = bt(P);
1356
+ N ? e.set(k, N) : e.delete(k);
1357
+ }, u = (k) => e.get(k) ?? null, o = (k) => {
1358
+ t.value = k;
1359
+ }, c = () => {
1360
1360
  t.value = null;
1361
- }, w = (S) => t.value === S;
1361
+ }, b = (k) => t.value === k;
1362
1362
  return {
1363
1363
  activeId: te(t),
1364
1364
  isActive: y(() => t.value !== null),
1365
1365
  activeElement: y(
1366
- () => t.value !== null ? c(t.value) : null
1366
+ () => t.value !== null ? u(t.value) : null
1367
1367
  ),
1368
- register: r,
1369
- resolve: c,
1370
- activate: a,
1371
- deactivate: d,
1372
- isIdActive: w
1368
+ register: n,
1369
+ resolve: u,
1370
+ activate: o,
1371
+ deactivate: c,
1372
+ isIdActive: b
1373
1373
  };
1374
- };
1375
- function It(e) {
1376
- const t = Y(""), r = Y(void 0), c = Y(!!e.debug), a = Y(e.dateFormat ?? "mm/dd/yyyy"), d = y(() => !!e.required), w = 1e3, S = Y(!1), $ = ["ArrowUp", "ArrowDown"], V = ["ArrowLeft", "ArrowRight"], M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (o) => o <= 2 ? "mm" : o <= 5 ? "dd" : M.value.length <= 10 ? "yyyy" : "mm", E = y(() => {
1377
- const o = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
1378
- return parseInt(o).toString().padStart(2, "0");
1379
- }), A = y(() => {
1380
- const o = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
1381
- return parseInt(o).toString().padStart(2, "0");
1374
+ }, Ne = {
1375
+ title: "My Window",
1376
+ draggable: !0,
1377
+ resizable: !0,
1378
+ closable: !0,
1379
+ fixed: !0,
1380
+ minimizeButton: !0,
1381
+ maximizeButton: !0,
1382
+ initialWidth: 500,
1383
+ initialHeight: 500,
1384
+ width: 500,
1385
+ height: 500,
1386
+ left: void 0,
1387
+ top: void 0
1388
+ }, St = (e) => e === "DEFAULT" || e === "MINIMIZED" || e === "FULLSCREEN", kt = (e, t, n) => Math.max(e - t - n, 0);
1389
+ function Pt(e = {}) {
1390
+ Fe(e.settings) && (e.settings.value = {
1391
+ ...Ne,
1392
+ ...e.settings.value
1393
+ });
1394
+ const t = Fe(e.settings) ? e.settings : Y({ ...Ne, ...e.settings }), n = ve(null), u = Y(!1), o = Y(e.initialStage ?? "DEFAULT"), c = Y(!1), b = Y(!1), k = Y(0), P = Y(0), N = async (F) => {
1395
+ const a = t.value.left !== void 0 && t.value.top !== void 0;
1396
+ if (F?.resetPosition || !a) {
1397
+ const m = Number.parseFloat(
1398
+ window.getComputedStyle(document.documentElement).fontSize
1399
+ ), v = Number.isFinite(m) ? m : 16, A = t.value.fixed ? 0 : window.scrollX, C = t.value.fixed ? 0 : window.scrollY;
1400
+ t.value.left = void 0, t.value.top = void 0, t.value.width = void 0, t.value.height = void 0, k.value = A + kt(
1401
+ window.innerWidth,
1402
+ t.value.initialWidth,
1403
+ v
1404
+ ), P.value = C + v, u.value = !0, await G(), t.value.width = t.value.initialWidth, t.value.height = t.value.initialHeight;
1405
+ } else
1406
+ u.value = !0;
1407
+ e.onOpen?.();
1408
+ }, M = () => {
1409
+ o.value = "DEFAULT", u.value = !1, e.onClose?.();
1410
+ }, R = (...F) => {
1411
+ const a = F[2];
1412
+ if (typeof a != "object" || a === null || !("state" in a) || !St(a.state))
1413
+ return;
1414
+ const m = a.state;
1415
+ m !== o.value && (o.value = m, e.onStageChange?.(m));
1416
+ }, x = (...F) => {
1417
+ const a = F[0];
1418
+ if (typeof a == "object" && a !== null && "drag" in a && "left" in a && "top" in a && "width" in a && "height" in a && typeof a.left == "number" && typeof a.top == "number" && typeof a.width == "number" && typeof a.height == "number") {
1419
+ const m = a, v = n.value?.$el, C = (v instanceof Element ? v.querySelector(".k-window-titlebar") : null)?.getBoundingClientRect(), E = C?.width ?? m.width, L = C?.height ?? m.height, K = t.value.fixed ? 0 : window.scrollX, Z = t.value.fixed ? 0 : window.scrollY, ne = K + document.documentElement.clientWidth, ie = Z + document.documentElement.clientHeight, l = Math.max(ne - E, K), S = Math.max(ie - L, Z);
1420
+ t.value.left = Math.min(
1421
+ Math.max(m.left, K),
1422
+ l
1423
+ ), t.value.top = Math.min(
1424
+ Math.max(m.top, Z),
1425
+ S
1426
+ ), c.value = m.drag && !m.end, e.onMove?.(m);
1427
+ }
1428
+ }, D = (...F) => {
1429
+ const a = F[0];
1430
+ if (typeof a == "object" && a !== null && "drag" in a && "left" in a && "top" in a && "width" in a && "height" in a && typeof a.left == "number" && typeof a.top == "number" && typeof a.width == "number" && typeof a.height == "number") {
1431
+ const m = a;
1432
+ t.value.left = m.left, t.value.top = m.top, t.value.width = m.width, t.value.height = m.height, b.value = m.drag && !m.end, e.onResize?.(m);
1433
+ }
1434
+ }, O = (F) => {
1435
+ F.target instanceof Element && F.target.closest(".k-resize-handle") && F.preventDefault();
1436
+ }, f = (F) => {
1437
+ re(e.titlebarDoubleClick) === !1 && F.target instanceof Element && F.target.closest(".k-window-titlebar") && (F.preventDefault(), F.stopPropagation());
1438
+ };
1439
+ let s, g;
1440
+ const I = () => {
1441
+ s?.(), s = void 0;
1442
+ }, V = () => {
1443
+ g?.(), g = void 0;
1444
+ };
1445
+ ae(
1446
+ n,
1447
+ (F) => {
1448
+ I(), V();
1449
+ const a = F?.$el;
1450
+ a instanceof HTMLElement && (a.addEventListener("pointerdown", O, {
1451
+ capture: !0
1452
+ }), s = () => a.removeEventListener("pointerdown", O, {
1453
+ capture: !0
1454
+ }), a.addEventListener("dblclick", f, {
1455
+ capture: !0
1456
+ }), g = () => a.removeEventListener("dblclick", f, {
1457
+ capture: !0
1458
+ }));
1459
+ },
1460
+ { flush: "post" }
1461
+ ), Pe(I), Pe(V);
1462
+ const W = y(() => {
1463
+ const F = ["fk-window"];
1464
+ return t.value.draggable && o.value !== "FULLSCREEN" && F.push("fk-window-can-drag"), c.value && F.push("fk-window-is-dragging"), b.value && F.push("fk-window-is-resizing"), t.value.fixed && F.push("fk-window-fixed"), t.value.minimizeButton || F.push("fk-window-hide-minimize"), t.value.maximizeButton || F.push("fk-window-hide-maximize"), t.value.closable || F.push("fk-window-hide-close"), F.join(" ");
1465
+ }), X = y(() => ({
1466
+ title: t.value.title,
1467
+ draggable: t.value.draggable,
1468
+ resizable: t.value.resizable,
1469
+ left: t.value.left,
1470
+ top: t.value.top,
1471
+ initialLeft: k.value,
1472
+ initialTop: P.value,
1473
+ initialWidth: t.value.initialWidth,
1474
+ initialHeight: t.value.initialHeight,
1475
+ width: t.value.width,
1476
+ height: t.value.height,
1477
+ stage: o.value,
1478
+ windowClass: W.value
1479
+ }));
1480
+ return {
1481
+ windowRef: n,
1482
+ settings: t,
1483
+ visible: u,
1484
+ stage: o,
1485
+ isDragging: c,
1486
+ isResizing: b,
1487
+ props: X,
1488
+ events: {
1489
+ move: x,
1490
+ resize: D,
1491
+ stagechange: R,
1492
+ close: M
1493
+ },
1494
+ open: N,
1495
+ close: M
1496
+ };
1497
+ }
1498
+ function Lt(e) {
1499
+ const t = Y(""), n = Y(void 0), u = Y(!!e.debug), o = Y(e.dateFormat ?? "mm/dd/yyyy"), c = y(() => !!e.required), b = 1e3, k = Y(!1), P = ["ArrowUp", "ArrowDown"], N = ["ArrowLeft", "ArrowRight"], M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (l) => l <= 2 ? "mm" : l <= 5 ? "dd" : M.value.length <= 10 ? "yyyy" : "mm", x = y(() => {
1500
+ const l = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
1501
+ return parseInt(l).toString().padStart(2, "0");
1502
+ }), D = y(() => {
1503
+ const l = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
1504
+ return parseInt(l).toString().padStart(2, "0");
1382
1505
  }), O = y(() => {
1383
- const o = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
1384
- return parseInt(o).toString().padStart(4, "0");
1385
- }), p = (o) => {
1506
+ const l = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
1507
+ return parseInt(l).toString().padStart(4, "0");
1508
+ }), f = (l) => {
1386
1509
  if (M.value.length === 0) {
1387
- e.onChange({ value: null, event: o });
1510
+ e.onChange({ value: null, event: l });
1388
1511
  return;
1389
1512
  }
1390
1513
  if (M.value.length < 8) {
1391
- e.onChange({ value: null, event: o });
1514
+ e.onChange({ value: null, event: l });
1392
1515
  return;
1393
1516
  }
1394
1517
  if ((t.value ?? "").length === 10 && M.value.length === 8) {
1395
- const [b, q, f] = t.value.split("/"), h = parseInt(b), L = parseInt(q), n = parseInt(f);
1396
- if (X(n, h, L)) {
1397
- const u = N(n, h, L);
1398
- i(u) ? e.onChange({ value: u, event: o }) : e.onChange({ value: null, event: o });
1518
+ const [S, q, p] = t.value.split("/"), w = parseInt(S), z = parseInt(q), r = parseInt(p);
1519
+ if (X(r, w, z)) {
1520
+ const d = V(r, w, z);
1521
+ s(d) ? e.onChange({ value: d, event: l }) : e.onChange({ value: null, event: l });
1399
1522
  } else
1400
- e.onChange({ value: null, event: o });
1523
+ e.onChange({ value: null, event: l });
1401
1524
  }
1402
- }, i = (o) => {
1403
- const b = e.min ?? void 0, q = e.max ?? void 0;
1404
- return !(b && o < b || q && o > q);
1405
- }, v = y(() => {
1525
+ }, s = (l) => {
1526
+ const S = e.min ?? void 0, q = e.max ?? void 0;
1527
+ return !(S && l < S || q && l > q);
1528
+ }, g = y(() => {
1406
1529
  if ((t.value ?? "").length === 10 && M.value.length === 8) {
1407
- const [o, b, q] = (t.value ?? "").split("/"), f = parseInt(o), h = parseInt(b), L = parseInt(q);
1408
- if (X(L, f, h))
1409
- return N(L, f, h);
1530
+ const [l, S, q] = (t.value ?? "").split("/"), p = parseInt(l), w = parseInt(S), z = parseInt(q);
1531
+ if (X(z, p, w))
1532
+ return V(z, p, w);
1410
1533
  }
1411
1534
  return null;
1412
- }), I = y(() => (t.value ?? "").length === 10 && M.value.length === 8), N = (o, b, q) => {
1413
- const f = /* @__PURE__ */ new Date(0);
1414
- return f.setFullYear(o, b - 1, q), f.setHours(0, 0, 0, 0), f;
1415
- }, H = (o, b) => N(o, b + 1, 0).getDate(), X = (o, b, q) => b >= 1 && b <= 12 && o >= w && q >= 1 && q <= H(o, b), Z = (o) => {
1416
- t.value = o.value;
1417
- const b = o.event?.target;
1418
- r.value = b?.selectionStart ?? 0, p(o);
1419
- }, J = (o) => {
1420
- r.value = o.target.selectionStart ?? 0;
1421
- }, s = (o, b, q) => {
1422
- const f = b?.selectionStart ?? r.value ?? 0;
1423
- r.value = f;
1424
- let h = parseInt(E.value), L = parseInt(A.value), n = parseInt(O.value);
1425
- if (!(M.value.length >= 8) || !X(n, h, L)) {
1426
- const G = e.defaultValue ?? /* @__PURE__ */ new Date();
1427
- h = G.getMonth() + 1, L = G.getDate(), n = G.getFullYear(), t.value = `${String(h).padStart(2, "0")}/${String(L).padStart(
1535
+ }), I = y(() => (t.value ?? "").length === 10 && M.value.length === 8), V = (l, S, q) => {
1536
+ const p = /* @__PURE__ */ new Date(0);
1537
+ return p.setFullYear(l, S - 1, q), p.setHours(0, 0, 0, 0), p;
1538
+ }, W = (l, S) => V(l, S + 1, 0).getDate(), X = (l, S, q) => S >= 1 && S <= 12 && l >= b && q >= 1 && q <= W(l, S), _ = (l) => {
1539
+ t.value = l.value;
1540
+ const S = l.event?.target;
1541
+ n.value = S?.selectionStart ?? 0, f(l);
1542
+ }, F = (l) => {
1543
+ n.value = l.target.selectionStart ?? 0;
1544
+ }, a = (l, S, q) => {
1545
+ const p = S?.selectionStart ?? n.value ?? 0;
1546
+ n.value = p;
1547
+ let w = parseInt(x.value), z = parseInt(D.value), r = parseInt(O.value);
1548
+ if (!(M.value.length >= 8) || !X(r, w, z)) {
1549
+ const J = e.defaultValue ?? /* @__PURE__ */ new Date();
1550
+ w = J.getMonth() + 1, z = J.getDate(), r = J.getFullYear(), t.value = `${String(w).padStart(2, "0")}/${String(z).padStart(
1428
1551
  2,
1429
1552
  "0"
1430
- )}/${String(n)}`;
1431
- const ce = N(n, h, L);
1432
- e.onChange({ value: i(ce) ? ce : null, event: q }), D({ useRAF: !0 });
1553
+ )}/${String(r)}`;
1554
+ const ce = V(r, w, z);
1555
+ e.onChange({ value: s(ce) ? ce : null, event: q }), E({ useRAF: !0 });
1433
1556
  return;
1434
1557
  }
1435
- const T = R(f);
1558
+ const T = R(p);
1436
1559
  if (T === "mm")
1437
- h = o === "ArrowUp" ? h < 12 ? h + 1 : 1 : h > 1 ? h - 1 : 12;
1560
+ w = l === "ArrowUp" ? w < 12 ? w + 1 : 1 : w > 1 ? w - 1 : 12;
1438
1561
  else if (T === "dd") {
1439
- const G = new Date(n, h, 0).getDate();
1440
- L = o === "ArrowUp" ? L < G ? L + 1 : 1 : L > 1 ? L - 1 : G;
1441
- } else T === "yyyy" && (n = o === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
1442
- t.value = `${String(h).padStart(2, "0")}/${String(L).padStart(
1562
+ const J = new Date(r, w, 0).getDate();
1563
+ z = l === "ArrowUp" ? z < J ? z + 1 : 1 : z > 1 ? z - 1 : J;
1564
+ } else T === "yyyy" && (r = l === "ArrowUp" ? r + 1 : Math.max(1, r - 1));
1565
+ t.value = `${String(w).padStart(2, "0")}/${String(z).padStart(
1443
1566
  2,
1444
1567
  "0"
1445
- )}/${String(n)}`;
1446
- const [K, z, Q] = t.value.split("/"), W = N(
1568
+ )}/${String(r)}`;
1569
+ const [U, B, Q] = t.value.split("/"), j = V(
1447
1570
  parseInt(Q),
1448
- parseInt(K),
1449
- parseInt(z)
1571
+ parseInt(U),
1572
+ parseInt(B)
1450
1573
  );
1451
- W.toString() !== "Invalid Date" && parseInt(Q) >= 1e3 ? e.onChange({
1452
- value: i(W) ? W : null,
1574
+ j.toString() !== "Invalid Date" && parseInt(Q) >= 1e3 ? e.onChange({
1575
+ value: s(j) ? j : null,
1453
1576
  event: q
1454
- }) : e.onChange({ value: null, event: q }), D({ useRAF: !0 });
1455
- }, x = (o) => {
1456
- if (o.code === "Space" || o.key === " ") {
1457
- o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1577
+ }) : e.onChange({ value: null, event: q }), E({ useRAF: !0 });
1578
+ }, m = (l) => {
1579
+ if (l.code === "Space" || l.key === " ") {
1580
+ l.preventDefault(), l.stopPropagation(), e.onShowCalendar(l);
1458
1581
  return;
1459
1582
  }
1460
- if (o.key === "ArrowDown" && o.altKey) {
1461
- o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1583
+ if (l.key === "ArrowDown" && l.altKey) {
1584
+ l.preventDefault(), l.stopPropagation(), e.onShowCalendar(l);
1462
1585
  return;
1463
1586
  }
1464
- if ($.includes(o.key)) {
1465
- if (o.altKey) return;
1466
- o.preventDefault(), o.stopPropagation();
1467
- const b = o.target;
1468
- s(o.key, b, o);
1587
+ if (P.includes(l.key)) {
1588
+ if (l.altKey) return;
1589
+ l.preventDefault(), l.stopPropagation();
1590
+ const S = l.target;
1591
+ a(l.key, S, l);
1469
1592
  return;
1470
1593
  }
1471
- }, m = (o) => {
1472
- o.preventDefault();
1473
- const b = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1474
- s(b, o.target, o);
1475
- }, k = (o) => {
1476
- const b = o.target;
1477
- if (V.includes(o.key)) {
1478
- r.value = b?.selectionStart ?? 0;
1594
+ }, v = (l) => {
1595
+ l.preventDefault();
1596
+ const S = l.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1597
+ a(S, l.target, l);
1598
+ }, A = (l) => {
1599
+ const S = l.target;
1600
+ if (N.includes(l.key)) {
1601
+ n.value = S?.selectionStart ?? 0;
1479
1602
  return;
1480
1603
  }
1481
- if ($.includes(o.key)) {
1482
- if (o.altKey) return;
1483
- r.value = b?.selectionStart ?? 0;
1604
+ if (P.includes(l.key)) {
1605
+ if (l.altKey) return;
1606
+ n.value = S?.selectionStart ?? 0;
1484
1607
  }
1485
- }, C = (o) => {
1486
- S.value = !0, d.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && M.value.length === 0 && (e.externalValue.value = "");
1487
- const b = o.target;
1488
- b && (r.value = b.selectionStart ?? 0);
1489
- }, D = (o) => {
1490
- const b = () => {
1608
+ }, C = (l) => {
1609
+ k.value = !0, c.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && M.value.length === 0 && (e.externalValue.value = "");
1610
+ const S = l.target;
1611
+ S && (n.value = S.selectionStart ?? 0);
1612
+ }, E = (l) => {
1613
+ const S = () => {
1491
1614
  const q = document.getElementById(
1492
1615
  e.id
1493
1616
  );
1494
1617
  if (!q) return;
1495
- const f = o?.pos ?? r.value ?? q.value.length;
1618
+ const p = l?.pos ?? n.value ?? q.value.length;
1496
1619
  try {
1497
- q.focus(), q.setSelectionRange(f, f);
1620
+ q.focus(), q.setSelectionRange(p, p);
1498
1621
  } catch {
1499
1622
  }
1500
1623
  };
1501
- _(() => {
1502
- if (o?.delay && o.delay > 0) {
1503
- setTimeout(b, o.delay);
1624
+ G(() => {
1625
+ if (l?.delay && l.delay > 0) {
1626
+ setTimeout(S, l.delay);
1504
1627
  return;
1505
1628
  }
1506
- if (o?.useRAF) {
1507
- requestAnimationFrame(b);
1629
+ if (l?.useRAF) {
1630
+ requestAnimationFrame(S);
1508
1631
  return;
1509
1632
  }
1510
- b();
1633
+ S();
1511
1634
  });
1512
1635
  };
1513
- e.externalValue && le(
1636
+ e.externalValue && ae(
1514
1637
  e.externalValue,
1515
- (o) => {
1516
- if (o) {
1517
- const b = new Date(o);
1518
- if (b.toString() !== "Invalid Date") {
1519
- const q = (b.getMonth() + 1).toString().padStart(2, "0"), f = b.getDate().toString().padStart(2, "0"), h = b.getFullYear().toString();
1520
- t.value = `${q}/${f}/${h}`, D({ delay: 50 });
1638
+ (l) => {
1639
+ if (l) {
1640
+ const S = new Date(l);
1641
+ if (S.toString() !== "Invalid Date") {
1642
+ const q = (S.getMonth() + 1).toString().padStart(2, "0"), p = S.getDate().toString().padStart(2, "0"), w = S.getFullYear().toString();
1643
+ t.value = `${q}/${p}/${w}`, E({ delay: 50 });
1521
1644
  return;
1522
1645
  }
1523
1646
  }
1524
1647
  },
1525
1648
  { immediate: !0 }
1526
1649
  );
1527
- const P = y(() => [
1528
- ["Date", `${E.value} / ${A.value} / ${O.value}`],
1650
+ const L = y(() => [
1651
+ ["Date", `${x.value} / ${D.value} / ${O.value}`],
1529
1652
  ["Digits only", M.value],
1530
1653
  [
1531
1654
  "min",
@@ -1543,34 +1666,34 @@ function It(e) {
1543
1666
  day: "2-digit"
1544
1667
  }) ?? null
1545
1668
  ]
1546
- ]), U = y(() => {
1547
- if (!d.value) {
1669
+ ]), K = y(() => {
1670
+ if (!c.value) {
1548
1671
  if (!I.value) return !0;
1549
- const b = v.value;
1550
- return b ? i(b) : !1;
1551
- }
1552
- if (!S.value) return !0;
1553
- const o = v.value;
1554
- return !I.value || !o ? !1 : i(o);
1555
- }), j = y(() => {
1556
- if (!d.value) {
1672
+ const S = g.value;
1673
+ return S ? s(S) : !1;
1674
+ }
1675
+ if (!k.value) return !0;
1676
+ const l = g.value;
1677
+ return !I.value || !l ? !1 : s(l);
1678
+ }), Z = y(() => {
1679
+ if (!c.value) {
1557
1680
  if (!I.value) return;
1558
- const b = v.value;
1559
- return b ? i(b) ? "valid" : "out-of-bounds" : "invalid-date";
1681
+ const S = g.value;
1682
+ return S ? s(S) ? "valid" : "out-of-bounds" : "invalid-date";
1560
1683
  }
1561
- if (!S.value) return;
1684
+ if (!k.value) return;
1562
1685
  if (M.value.length === 0 || !I.value)
1563
1686
  return "incomplete";
1564
- const o = v.value;
1565
- return o ? i(o) ? "valid" : "out-of-bounds" : "invalid-date";
1566
- }), re = y(() => {
1567
- const o = j.value;
1568
- if (!o || o === "valid") return "";
1569
- if (o === "incomplete")
1687
+ const l = g.value;
1688
+ return l ? s(l) ? "valid" : "out-of-bounds" : "invalid-date";
1689
+ }), ne = y(() => {
1690
+ const l = Z.value;
1691
+ if (!l || l === "valid") return "";
1692
+ if (l === "incomplete")
1570
1693
  return "Required";
1571
- if (o === "invalid-date")
1572
- return `Must be in ${a.value} format.`;
1573
- const b = e.min ? e.min.toLocaleDateString("en-US", {
1694
+ if (l === "invalid-date")
1695
+ return `Must be in ${o.value} format.`;
1696
+ const S = e.min ? e.min.toLocaleDateString("en-US", {
1574
1697
  year: "numeric",
1575
1698
  month: "2-digit",
1576
1699
  day: "2-digit"
@@ -1579,27 +1702,27 @@ function It(e) {
1579
1702
  month: "2-digit",
1580
1703
  day: "2-digit"
1581
1704
  }) : null;
1582
- if (o === "out-of-bounds") {
1583
- if (b && q) return `Must be between ${b} and ${q}.`;
1584
- if (b) return `Must be on or after ${b}.`;
1705
+ if (l === "out-of-bounds") {
1706
+ if (S && q) return `Must be between ${S} and ${q}.`;
1707
+ if (S) return `Must be on or after ${S}.`;
1585
1708
  if (q) return `Must be on or before ${q}.`;
1586
1709
  }
1587
1710
  return "";
1588
- }), ue = () => {
1589
- _(() => {
1590
- const o = document.getElementById(
1711
+ }), ie = () => {
1712
+ G(() => {
1713
+ const l = document.getElementById(
1591
1714
  e.id
1592
1715
  );
1593
- if (!o) {
1716
+ if (!l) {
1594
1717
  console.warn(`ID (#${e.id}) not found for styling.`);
1595
1718
  return;
1596
1719
  }
1597
- const b = o.closest(".k-datepicker");
1598
- if (!b) {
1720
+ const S = l.closest(".k-datepicker");
1721
+ if (!S) {
1599
1722
  console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
1600
1723
  return;
1601
1724
  }
1602
- const q = b.parentElement;
1725
+ const q = S.parentElement;
1603
1726
  if (q) {
1604
1727
  if (q.classList.contains("fk-datepicker"))
1605
1728
  return;
@@ -1611,67 +1734,67 @@ function It(e) {
1611
1734
  });
1612
1735
  };
1613
1736
  return Re(() => {
1614
- ue();
1737
+ ie();
1615
1738
  }), {
1616
1739
  raw: t,
1617
- cursorPos: r,
1618
- debugEnabled: c,
1619
- debugLines: P,
1620
- placeholder: a,
1621
- isValid: U,
1622
- reason: te(j),
1623
- validationMessage: re,
1740
+ cursorPos: n,
1741
+ debugEnabled: u,
1742
+ debugLines: L,
1743
+ placeholder: o,
1744
+ isValid: K,
1745
+ reason: te(Z),
1746
+ validationMessage: ne,
1624
1747
  digitsOnly: M,
1625
- month: te(E),
1626
- day: te(A),
1748
+ month: te(x),
1749
+ day: te(D),
1627
1750
  year: te(O),
1628
1751
  datePart: R,
1629
- handleChange: Z,
1630
- handleKeyDown: x,
1631
- handleWheel: m,
1632
- handleKeyUp: k,
1633
- handleClick: J,
1752
+ handleChange: _,
1753
+ handleKeyDown: m,
1754
+ handleWheel: v,
1755
+ handleKeyUp: A,
1756
+ handleClick: F,
1634
1757
  handleBlur: C,
1635
1758
  // Expose so consumers can re-run styling when needed
1636
- initStyling: ue
1759
+ initStyling: ie
1637
1760
  };
1638
1761
  }
1639
- function Ct(e) {
1640
- const t = Y(""), r = Y(void 0), c = Y(!!e.debug), a = Y(!1), d = 1440 * 60 * 1e3, w = 365 * d, S = /* @__PURE__ */ new Date(), $ = new Date(S.getTime() - w), V = new Date(S.getTime() + w);
1641
- e.min = e.min ?? $, e.max = e.max ?? V;
1642
- const M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (l, g) => new Date(l, g, 0).getDate(), E = (l, g, F) => g >= 1 && g <= 12 && l >= 1e3 && F >= 1 && F <= R(l, g), A = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate()), O = (l) => {
1643
- if (!l) return null;
1644
- const g = e.min ?? new Date(Date.now() - 90 * d), F = e.max ?? /* @__PURE__ */ new Date(), B = A(l);
1645
- return B < A(g) || B > A(F) ? null : l;
1646
- }, p = (l, g) => e.allowReverse ?? !1 ? !0 : l <= g, i = y(() => (t.value?.length ?? 0) >= 23 && M.value.length >= 16), v = (l) => {
1647
- if ((l ?? "").length < 23 || M.value.length < 16)
1762
+ function $t(e) {
1763
+ const t = Y(""), n = Y(void 0), u = Y(!!e.debug), o = Y(!1), c = 1440 * 60 * 1e3, b = 365 * c, k = /* @__PURE__ */ new Date(), P = new Date(k.getTime() - b), N = new Date(k.getTime() + b);
1764
+ e.min = e.min ?? P, e.max = e.max ?? N;
1765
+ const M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (i, h) => new Date(i, h, 0).getDate(), x = (i, h, $) => h >= 1 && h <= 12 && i >= 1e3 && $ >= 1 && $ <= R(i, h), D = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), O = (i) => {
1766
+ if (!i) return null;
1767
+ const h = e.min ?? new Date(Date.now() - 90 * c), $ = e.max ?? /* @__PURE__ */ new Date(), H = D(i);
1768
+ return H < D(h) || H > D($) ? null : i;
1769
+ }, f = (i, h) => e.allowReverse ?? !1 ? !0 : i <= h, s = y(() => (t.value?.length ?? 0) >= 23 && M.value.length >= 16), g = (i) => {
1770
+ if ((i ?? "").length < 23 || M.value.length < 16)
1648
1771
  return { start: null, end: null };
1649
- const g = l.substring(0, 10), F = l.substring(13, 23), [B, ae, oe] = g.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = F.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(oe, B - 1, ae), be = new Date(ve, fe - 1, me), Ae = E(oe, B, ae) && ge.toString() !== "Invalid Date", De = E(ve, fe, me) && be.toString() !== "Invalid Date";
1650
- return { start: Ae ? ge : null, end: De ? be : null };
1651
- }, I = e.externalValid ?? Y(!0), N = y(() => v(t.value)), H = y(() => {
1652
- const l = O(N.value.start), g = O(N.value.end);
1653
- return { start: l, end: g };
1772
+ const h = i.substring(0, 10), $ = i.substring(13, 23), [H, oe, le] = h.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ge] = $.split("/").map((pe) => parseInt(pe || "0", 10)), he = new Date(le, H - 1, oe), we = new Date(ge, fe - 1, me), Ae = x(le, H, oe) && he.toString() !== "Invalid Date", De = x(ge, fe, me) && we.toString() !== "Invalid Date";
1773
+ return { start: Ae ? he : null, end: De ? we : null };
1774
+ }, I = e.externalValid ?? Y(!0), V = y(() => g(t.value)), W = y(() => {
1775
+ const i = O(V.value.start), h = O(V.value.end);
1776
+ return { start: i, end: h };
1654
1777
  }), X = y(() => {
1655
- if (!i.value) return;
1656
- const l = H.value.start, g = H.value.end;
1657
- if (!l || !g) return;
1658
- const F = Math.abs(A(g) - A(l));
1659
- return Math.round(F / 864e5 + 1);
1660
- }), Z = Y(!1), J = y(() => {
1661
- if (!Z.value) return;
1662
- const { start: l, end: g } = N.value;
1663
- if (!i.value) return "incomplete";
1664
- if (!l || !g) return "invalid-date";
1665
- if (!H.value.start || !H.value.end) return "out-of-bounds";
1666
- const F = H.value.start, B = H.value.end;
1667
- return p(F, B) ? typeof e.maxSpanDays == "number" && X.value !== void 0 && X.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1668
- }), s = y(() => {
1669
- const l = J.value;
1670
- return l === void 0 || l === "valid";
1671
- }), x = y(() => {
1672
- const { min: l, max: g } = e, F = J.value;
1673
- if (!F) return "";
1674
- switch (F) {
1778
+ if (!s.value) return;
1779
+ const i = W.value.start, h = W.value.end;
1780
+ if (!i || !h) return;
1781
+ const $ = Math.abs(D(h) - D(i));
1782
+ return Math.round($ / 864e5 + 1);
1783
+ }), _ = Y(!1), F = y(() => {
1784
+ if (!_.value) return;
1785
+ const { start: i, end: h } = V.value;
1786
+ if (!s.value) return "incomplete";
1787
+ if (!i || !h) return "invalid-date";
1788
+ if (!W.value.start || !W.value.end) return "out-of-bounds";
1789
+ const $ = W.value.start, H = W.value.end;
1790
+ return f($, H) ? typeof e.maxSpanDays == "number" && X.value !== void 0 && X.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1791
+ }), a = y(() => {
1792
+ const i = F.value;
1793
+ return i === void 0 || i === "valid";
1794
+ }), m = y(() => {
1795
+ const { min: i, max: h } = e, $ = F.value;
1796
+ if (!$) return "";
1797
+ switch ($) {
1675
1798
  case "incomplete":
1676
1799
  return "Required";
1677
1800
  case "invalid-date":
@@ -1679,154 +1802,154 @@ function Ct(e) {
1679
1802
  case "reversed-range":
1680
1803
  return "End Date must be on or after Start Date.";
1681
1804
  case "out-of-bounds":
1682
- return l && g ? `Dates must be between ${D(l)} and ${D(g)}.` : "Dates must be within the allowed range.";
1805
+ return i && h ? `Dates must be between ${E(i)} and ${E(h)}.` : "Dates must be within the allowed range.";
1683
1806
  case "span-exceeds-limit":
1684
1807
  return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
1685
1808
  default:
1686
1809
  return "";
1687
1810
  }
1688
- }), m = ["ArrowUp", "ArrowDown"], k = ["ArrowLeft", "ArrowRight"], C = (l, g) => String(l).padStart(g, "0"), D = (l) => `${C(l.getMonth() + 1, 2)}/${C(l.getDate(), 2)}/${C(
1689
- l.getFullYear(),
1811
+ }), v = ["ArrowUp", "ArrowDown"], A = ["ArrowLeft", "ArrowRight"], C = (i, h) => String(i).padStart(h, "0"), E = (i) => `${C(i.getMonth() + 1, 2)}/${C(i.getDate(), 2)}/${C(
1812
+ i.getFullYear(),
1690
1813
  4
1691
- )}`, P = (l) => l <= 2 ? { side: "start", part: "mm" } : l <= 5 ? { side: "start", part: (l <= 3, "dd") } : l <= 11 ? { side: "start", part: "yyyy" } : l <= 15 ? { side: "end", part: "mm" } : l <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, U = (l, g, F) => {
1692
- const B = g?.selectionStart ?? r.value ?? 0;
1693
- r.value = B;
1694
- const { start: ae, end: oe } = v(t.value);
1695
- if (!ae && !oe) {
1696
- const ee = /* @__PURE__ */ new Date(), de = D(ee);
1697
- t.value = `${de} - ${de}`, e.onChange({ value: { start: ee, end: ee }, event: F }), _(() => {
1814
+ )}`, L = (i) => i <= 2 ? { side: "start", part: "mm" } : i <= 5 ? { side: "start", part: (i <= 3, "dd") } : i <= 11 ? { side: "start", part: "yyyy" } : i <= 15 ? { side: "end", part: "mm" } : i <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, K = (i, h, $) => {
1815
+ const H = h?.selectionStart ?? n.value ?? 0;
1816
+ n.value = H;
1817
+ const { start: oe, end: le } = g(t.value);
1818
+ if (!oe && !le) {
1819
+ const ee = /* @__PURE__ */ new Date(), de = E(ee);
1820
+ t.value = `${de} - ${de}`, e.onChange({ value: { start: ee, end: ee }, event: $ }), G(() => {
1698
1821
  requestAnimationFrame(() => {
1699
- const ie = document.getElementById(
1822
+ const se = document.getElementById(
1700
1823
  e.id
1701
- ), se = r.value ?? 0;
1702
- ie && (ie.focus(), ie.setSelectionRange(se, se));
1824
+ ), ue = n.value ?? 0;
1825
+ se && (se.focus(), se.setSelectionRange(ue, ue));
1703
1826
  });
1704
1827
  });
1705
1828
  return;
1706
1829
  }
1707
- const fe = /* @__PURE__ */ new Date(), me = P(B);
1708
- let ve = ae ? new Date(ae) : new Date(fe), ge = oe ? new Date(oe) : new Date(fe);
1709
- const be = (ee, de) => {
1830
+ const fe = /* @__PURE__ */ new Date(), me = L(H);
1831
+ let ge = oe ? new Date(oe) : new Date(fe), he = le ? new Date(le) : new Date(fe);
1832
+ const we = (ee, de) => {
1710
1833
  if (de === "mm") {
1711
- const ie = ee.getMonth() + 1, se = l === "ArrowUp" ? ie < 12 ? ie + 1 : 1 : ie > 1 ? ie - 1 : 12;
1712
- ee.setMonth(se - 1);
1713
- const Se = R(ee.getFullYear(), se);
1834
+ const se = ee.getMonth() + 1, ue = i === "ArrowUp" ? se < 12 ? se + 1 : 1 : se > 1 ? se - 1 : 12;
1835
+ ee.setMonth(ue - 1);
1836
+ const Se = R(ee.getFullYear(), ue);
1714
1837
  ee.getDate() > Se && ee.setDate(Se);
1715
1838
  } else if (de === "dd") {
1716
- const ie = R(ee.getFullYear(), ee.getMonth() + 1), se = ee.getDate(), Se = l === "ArrowUp" ? se < ie ? se + 1 : 1 : se > 1 ? se - 1 : ie;
1839
+ const se = R(ee.getFullYear(), ee.getMonth() + 1), ue = ee.getDate(), Se = i === "ArrowUp" ? ue < se ? ue + 1 : 1 : ue > 1 ? ue - 1 : se;
1717
1840
  ee.setDate(Se);
1718
1841
  } else if (de === "yyyy") {
1719
- const ie = ee.getFullYear();
1720
- ee.setFullYear(l === "ArrowUp" ? ie + 1 : Math.max(1, ie - 1));
1721
- const se = R(ee.getFullYear(), ee.getMonth() + 1);
1722
- ee.getDate() > se && ee.setDate(se);
1842
+ const se = ee.getFullYear();
1843
+ ee.setFullYear(i === "ArrowUp" ? se + 1 : Math.max(1, se - 1));
1844
+ const ue = R(ee.getFullYear(), ee.getMonth() + 1);
1845
+ ee.getDate() > ue && ee.setDate(ue);
1723
1846
  }
1724
1847
  };
1725
- me.side === "start" ? be(ve, me.part) : be(ge, me.part);
1726
- const Ae = D(ve), De = D(ge);
1848
+ me.side === "start" ? we(ge, me.part) : we(he, me.part);
1849
+ const Ae = E(ge), De = E(he);
1727
1850
  t.value = `${Ae} - ${De}`;
1728
- const pe = O(ve), Ee = O(ge);
1729
- pe && Ee && p(pe, Ee) ? e.onChange({ value: { start: pe, end: Ee }, event: F }) : e.onChange({ value: null, event: F }), _(() => {
1851
+ const pe = O(ge), Ee = O(he);
1852
+ pe && Ee && f(pe, Ee) ? e.onChange({ value: { start: pe, end: Ee }, event: $ }) : e.onChange({ value: null, event: $ }), G(() => {
1730
1853
  requestAnimationFrame(() => {
1731
1854
  const ee = document.getElementById(
1732
1855
  e.id
1733
- ), de = r.value ?? 0;
1856
+ ), de = n.value ?? 0;
1734
1857
  ee && (ee.focus(), ee.setSelectionRange(de, de));
1735
1858
  });
1736
1859
  });
1737
- }, j = (l) => {
1738
- const { start: g, end: F } = v(t.value);
1739
- if (!g || !F) {
1740
- e.onChange({ value: null, event: l });
1860
+ }, Z = (i) => {
1861
+ const { start: h, end: $ } = g(t.value);
1862
+ if (!h || !$) {
1863
+ e.onChange({ value: null, event: i });
1741
1864
  return;
1742
1865
  }
1743
- const B = O(g), ae = O(F);
1744
- if (!B || !ae) {
1745
- e.onChange({ value: null, event: l });
1866
+ const H = O(h), oe = O($);
1867
+ if (!H || !oe) {
1868
+ e.onChange({ value: null, event: i });
1746
1869
  return;
1747
1870
  }
1748
- if (!p(B, ae)) {
1749
- e.onChange({ value: null, event: l });
1871
+ if (!f(H, oe)) {
1872
+ e.onChange({ value: null, event: i });
1750
1873
  return;
1751
1874
  }
1752
- e.onChange({ value: { start: B, end: ae }, event: l });
1753
- }, re = (l) => {
1754
- const g = l.value ?? "", F = l.event;
1755
- if (!g && F && F.type === "click") {
1756
- L(F);
1875
+ e.onChange({ value: { start: H, end: oe }, event: i });
1876
+ }, ne = (i) => {
1877
+ const h = i.value ?? "", $ = i.event;
1878
+ if (!h && $ && $.type === "click") {
1879
+ z($);
1757
1880
  return;
1758
1881
  }
1759
- t.value = g;
1760
- const B = F?.target;
1761
- r.value = B?.selectionStart ?? 0, j(l);
1762
- }, ue = (l) => {
1763
- r.value = l.target.selectionStart ?? 0;
1764
- }, o = (l) => {
1765
- if (l.code === "Space" || l.key === " ") {
1766
- l.preventDefault(), l.stopPropagation(), e.onShowCalendar(l);
1882
+ t.value = h;
1883
+ const H = $?.target;
1884
+ n.value = H?.selectionStart ?? 0, Z(i);
1885
+ }, ie = (i) => {
1886
+ n.value = i.target.selectionStart ?? 0;
1887
+ }, l = (i) => {
1888
+ if (i.code === "Space" || i.key === " ") {
1889
+ i.preventDefault(), i.stopPropagation(), e.onShowCalendar(i);
1767
1890
  return;
1768
1891
  }
1769
- if (l.key === "ArrowDown" && l.altKey) {
1770
- l.preventDefault(), l.stopPropagation(), e.onShowCalendar(l);
1892
+ if (i.key === "ArrowDown" && i.altKey) {
1893
+ i.preventDefault(), i.stopPropagation(), e.onShowCalendar(i);
1771
1894
  return;
1772
1895
  }
1773
- if (m.includes(l.key)) {
1774
- l.preventDefault(), l.stopPropagation();
1775
- const g = l.target;
1776
- U(l.key, g, l);
1896
+ if (v.includes(i.key)) {
1897
+ i.preventDefault(), i.stopPropagation();
1898
+ const h = i.target;
1899
+ K(i.key, h, i);
1777
1900
  return;
1778
1901
  }
1779
- }, b = (l) => {
1780
- l.preventDefault();
1781
- const g = l.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1782
- U(g, l.target, l);
1783
- }, q = (l) => {
1784
- if (k.includes(l.key) || m.includes(l.key)) {
1785
- const g = l.target;
1786
- r.value = g?.selectionStart ?? 0;
1787
- }
1788
- }, f = () => {
1789
- Z.value = !0, (e.manageValid ?? !0) && (I.value = s.value);
1790
- }, h = (l) => {
1791
- f();
1792
- }, L = (l) => {
1793
- t.value = "", r.value = 0, e.onChange({ value: null, event: l }), f(), _(() => {
1794
- const g = document.getElementById(
1902
+ }, S = (i) => {
1903
+ i.preventDefault();
1904
+ const h = i.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1905
+ K(h, i.target, i);
1906
+ }, q = (i) => {
1907
+ if (A.includes(i.key) || v.includes(i.key)) {
1908
+ const h = i.target;
1909
+ n.value = h?.selectionStart ?? 0;
1910
+ }
1911
+ }, p = () => {
1912
+ _.value = !0, (e.manageValid ?? !0) && (I.value = a.value);
1913
+ }, w = (i) => {
1914
+ p();
1915
+ }, z = (i) => {
1916
+ t.value = "", n.value = 0, e.onChange({ value: null, event: i }), p(), G(() => {
1917
+ const h = document.getElementById(
1795
1918
  e.id
1796
1919
  );
1797
- g && (g.focus(), g.setSelectionRange(0, 0));
1920
+ h && (h.focus(), h.setSelectionRange(0, 0));
1798
1921
  });
1799
1922
  };
1800
- e.externalValue && le(
1923
+ e.externalValue && ae(
1801
1924
  e.externalValue,
1802
- (l) => {
1803
- const g = l?.start ?? null, F = l?.end ?? null;
1804
- if (g && F) {
1805
- if (t.value = `${D(g)} - ${D(F)}`, e.isOpen?.value && a.value && e.onRequestClose) {
1806
- const B = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1925
+ (i) => {
1926
+ const h = i?.start ?? null, $ = i?.end ?? null;
1927
+ if (h && $) {
1928
+ if (t.value = `${E(h)} - ${E($)}`, e.isOpen?.value && o.value && e.onRequestClose) {
1929
+ const H = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1807
1930
  setTimeout(() => {
1808
- e.onRequestClose?.(), a.value = !1, f();
1809
- }, B);
1931
+ e.onRequestClose?.(), o.value = !1, p();
1932
+ }, H);
1810
1933
  }
1811
1934
  return;
1812
1935
  }
1813
1936
  },
1814
1937
  { immediate: !0 }
1815
1938
  );
1816
- const n = y(
1939
+ const r = y(
1817
1940
  () => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
1818
- ), u = y(
1941
+ ), d = y(
1819
1942
  () => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
1820
1943
  ), T = y(
1821
1944
  () => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
1822
- ), K = y(
1945
+ ), U = y(
1823
1946
  () => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
1824
- ), z = y(
1947
+ ), B = y(
1825
1948
  () => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
1826
1949
  ), Q = y(
1827
1950
  () => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
1828
- ), W = y(() => {
1829
- const { start: l, end: g } = v(t.value);
1951
+ ), j = y(() => {
1952
+ const { start: i, end: h } = g(t.value);
1830
1953
  return [
1831
1954
  {
1832
1955
  label: "Raw",
@@ -1842,21 +1965,21 @@ function Ct(e) {
1842
1965
  },
1843
1966
  {
1844
1967
  label: "Start",
1845
- value: `${String(n.value).padStart(2, "0")} / ${String(
1846
- u.value
1968
+ value: `${String(r.value).padStart(2, "0")} / ${String(
1969
+ d.value
1847
1970
  ).padStart(2, "0")} / ${String(T.value).padStart(4, "0")}`
1848
1971
  },
1849
1972
  {
1850
1973
  label: "End",
1851
- value: `${String(K.value).padStart(2, "0")} / ${String(
1852
- z.value
1974
+ value: `${String(U.value).padStart(2, "0")} / ${String(
1975
+ B.value
1853
1976
  ).padStart(2, "0")} / ${String(Q.value).padStart(4, "0")}`
1854
1977
  },
1855
1978
  { label: "Digits only", value: M.value },
1856
- { label: "Mask complete", value: `${i.value}` },
1979
+ { label: "Mask complete", value: `${s.value}` },
1857
1980
  {
1858
1981
  label: "Parsed",
1859
- value: `${l ? l.toDateString() : "-"} | ${g ? g.toDateString() : "-"}`
1982
+ value: `${i ? i.toDateString() : "-"} | ${h ? h.toDateString() : "-"}`
1860
1983
  },
1861
1984
  {
1862
1985
  label: "Valid (managed)",
@@ -1865,330 +1988,330 @@ function Ct(e) {
1865
1988
  { label: "Span (days)", value: `${X.value ?? "-"}` },
1866
1989
  {
1867
1990
  label: "Reason",
1868
- value: `${J.value ?? "-"}`
1991
+ value: `${F.value ?? "-"}`
1869
1992
  },
1870
1993
  {
1871
1994
  label: "Cursor in",
1872
- value: `${r.value ?? "-"} (${(() => {
1873
- const F = r.value ?? 0, B = P(F);
1874
- return `${B.side}.${B.part}`;
1995
+ value: `${n.value ?? "-"} (${(() => {
1996
+ const $ = n.value ?? 0, H = L($);
1997
+ return `${H.side}.${H.part}`;
1875
1998
  })()})`
1876
1999
  }
1877
2000
  ];
1878
- }), G = () => {
1879
- _(() => {
1880
- const l = document.getElementById(e.id);
1881
- if (!l) {
2001
+ }), J = () => {
2002
+ G(() => {
2003
+ const i = document.getElementById(e.id);
2004
+ if (!i) {
1882
2005
  console.warn(`#${e.id} not found for styling.`);
1883
2006
  return;
1884
2007
  }
1885
- const g = l.closest("div");
1886
- if (!g) {
2008
+ const h = i.closest("div");
2009
+ if (!h) {
1887
2010
  console.warn(`Parent div of #${e.id} not found for styling.`);
1888
2011
  return;
1889
2012
  }
1890
- g.classList.contains("fk-daterangepicker") || g.classList.add("fk-daterangepicker");
2013
+ h.classList.contains("fk-daterangepicker") || h.classList.add("fk-daterangepicker");
1891
2014
  });
1892
2015
  };
1893
2016
  Re(() => {
1894
- G();
2017
+ J();
1895
2018
  });
1896
2019
  const ce = () => {
1897
- _(() => {
2020
+ G(() => {
1898
2021
  try {
1899
- const l = Array.from(
2022
+ const i = Array.from(
1900
2023
  document.querySelectorAll(".k-animation-container")
1901
2024
  );
1902
- if (!l.length) return;
1903
- const F = [...l].reverse().find((oe) => oe.querySelector(".k-calendar"))?.querySelector(
2025
+ if (!i.length) return;
2026
+ const $ = [...i].reverse().find((le) => le.querySelector(".k-calendar"))?.querySelector(
1904
2027
  ".k-calendar"
1905
2028
  );
1906
- if (!F) return;
1907
- const B = F.querySelectorAll(
2029
+ if (!$) return;
2030
+ const H = $.querySelectorAll(
1908
2031
  ".k-calendar-table"
1909
2032
  );
1910
- let ae = !1;
1911
- B.forEach((oe) => {
1912
- oe.tabIndex === 0 && (ae ? oe.tabIndex = -1 : ae = !0);
2033
+ let oe = !1;
2034
+ H.forEach((le) => {
2035
+ le.tabIndex === 0 && (oe ? le.tabIndex = -1 : oe = !0);
1913
2036
  });
1914
- } catch (l) {
1915
- console.warn(l);
2037
+ } catch (i) {
2038
+ console.warn(i);
1916
2039
  }
1917
2040
  });
1918
2041
  };
1919
- return e.isOpen && le(
2042
+ return e.isOpen && ae(
1920
2043
  e.isOpen,
1921
- (l) => {
1922
- l && setTimeout(() => ce(), 0);
2044
+ (i) => {
2045
+ i && setTimeout(() => ce(), 0);
1923
2046
  },
1924
2047
  { immediate: !1 }
1925
2048
  ), {
1926
2049
  raw: t,
1927
- cursorPos: r,
1928
- debugEnabled: c,
1929
- debugLines: W,
2050
+ cursorPos: n,
2051
+ debugEnabled: u,
2052
+ debugLines: j,
1930
2053
  digitsOnly: M,
1931
2054
  valid: I,
1932
- validComputed: te(s),
1933
- reason: te(J),
1934
- validationMessage: te(x),
2055
+ validComputed: te(a),
2056
+ reason: te(F),
2057
+ validationMessage: te(m),
1935
2058
  spanDays: te(X),
1936
- month1: te(n),
1937
- day1: te(u),
2059
+ month1: te(r),
2060
+ day1: te(d),
1938
2061
  year1: te(T),
1939
- month2: te(K),
1940
- day2: te(z),
2062
+ month2: te(U),
2063
+ day2: te(B),
1941
2064
  year2: te(Q),
1942
- handleChange: re,
1943
- handleKeyDown: o,
1944
- handleWheel: b,
2065
+ handleChange: ne,
2066
+ handleKeyDown: l,
2067
+ handleWheel: S,
1945
2068
  handleKeyUp: q,
1946
- handleClick: ue,
1947
- handleBlur: h,
1948
- handleClear: L,
2069
+ handleClick: ie,
2070
+ handleBlur: w,
2071
+ handleClear: z,
1949
2072
  onCalendarChange: () => {
1950
- a.value = !0;
2073
+ o.value = !0;
1951
2074
  },
1952
- initStyling: G
2075
+ initStyling: J
1953
2076
  };
1954
2077
  }
1955
- function Tt(e) {
1956
- const t = Y(""), r = Y(void 0), c = Y(!!e.debug), a = Y(e.timeFormat ?? "hh:mm AM"), d = y(() => !!e.required), w = Y(!1), S = ["ArrowUp", "ArrowDown"], $ = ["ArrowLeft", "ArrowRight"], V = y(() => (t.value ?? "").replace(/\D/g, "")), M = {
2078
+ function Ot(e) {
2079
+ const t = Y(""), n = Y(void 0), u = Y(!!e.debug), o = Y(e.timeFormat ?? "hh:mm AM"), c = y(() => !!e.required), b = Y(!1), k = ["ArrowUp", "ArrowDown"], P = ["ArrowLeft", "ArrowRight"], N = y(() => (t.value ?? "").replace(/\D/g, "")), M = {
1957
2080
  H: /[0-9]/,
1958
2081
  h: /[0-9]/,
1959
2082
  M: /[0-9]/,
1960
2083
  m: /[0-9]/,
1961
2084
  A: /[AaPp]/,
1962
2085
  a: /[Mm]/
1963
- }, R = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = y(() => {
1964
- const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", u = parseInt(n);
1965
- return Math.min(Math.max(u, 0), 23);
1966
- }), A = y(() => {
1967
- const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", u = parseInt(n);
1968
- return Math.min(Math.max(u, 0), 59);
1969
- }), O = y(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), p = y(() => {
1970
- const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), u = O.value;
1971
- return n === 12 ? u === "AM" ? 0 : 12 : u === "PM" ? n + 12 : n;
1972
- }), i = y(() => v.value ? `${String(p.value).padStart(2, "0")}:${String(A.value).padStart(2, "0")}:00` : null), v = y(
2086
+ }, R = (r) => r <= 2 ? "hh" : r <= 5 ? "mm" : "ampm", x = y(() => {
2087
+ const r = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", d = parseInt(r);
2088
+ return Math.min(Math.max(d, 0), 23);
2089
+ }), D = y(() => {
2090
+ const r = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", d = parseInt(r);
2091
+ return Math.min(Math.max(d, 0), 59);
2092
+ }), O = y(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), f = y(() => {
2093
+ const r = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), d = O.value;
2094
+ return r === 12 ? d === "AM" ? 0 : 12 : d === "PM" ? r + 12 : r;
2095
+ }), s = y(() => g.value ? `${String(f.value).padStart(2, "0")}:${String(D.value).padStart(2, "0")}:00` : null), g = y(
1973
2096
  () => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
1974
- ), I = (n, u, T) => {
1975
- let K = n % 12;
1976
- return K === 0 && (K = 12), `${String(K).padStart(2, "0")}:${String(u).padStart(
2097
+ ), I = (r, d, T) => {
2098
+ let U = r % 12;
2099
+ return U === 0 && (U = 12), `${String(U).padStart(2, "0")}:${String(d).padStart(
1977
2100
  2,
1978
2101
  "0"
1979
2102
  )} ${T}`;
1980
- }, N = (n) => {
1981
- const u = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1982
- if (!u) return null;
1983
- const T = parseInt(u[1]), K = parseInt(u[2]), z = u[3].toUpperCase();
1984
- if (T < 1 || T > 12 || K < 0 || K > 59) return null;
2103
+ }, V = (r) => {
2104
+ const d = r.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2105
+ if (!d) return null;
2106
+ const T = parseInt(d[1]), U = parseInt(d[2]), B = d[3].toUpperCase();
2107
+ if (T < 1 || T > 12 || U < 0 || U > 59) return null;
1985
2108
  let Q = T % 12;
1986
- z === "PM" && (Q += 12);
1987
- const W = /* @__PURE__ */ new Date();
1988
- return W.setSeconds(0, 0), W.setHours(Q), W.setMinutes(K), W;
1989
- }, H = (n) => {
1990
- if (V.value.length === 0) {
1991
- e.onChange({ value: null, event: n });
2109
+ B === "PM" && (Q += 12);
2110
+ const j = /* @__PURE__ */ new Date();
2111
+ return j.setSeconds(0, 0), j.setHours(Q), j.setMinutes(U), j;
2112
+ }, W = (r) => {
2113
+ if (N.value.length === 0) {
2114
+ e.onChange({ value: null, event: r });
1992
2115
  return;
1993
2116
  }
1994
- if (!v.value) {
1995
- e.onChange({ value: null, event: n });
2117
+ if (!g.value) {
2118
+ e.onChange({ value: null, event: r });
1996
2119
  return;
1997
2120
  }
1998
- const u = N(t.value);
1999
- u && Z(u) ? e.onChange({ value: u, event: n }) : e.onChange({ value: null, event: n });
2000
- }, X = (n) => n.getHours() * 60 + n.getMinutes(), Z = (n) => {
2001
- const u = e.min ?? void 0, T = e.max ?? void 0, K = X(n);
2002
- if (u) {
2003
- const z = X(u);
2004
- if (K < z) return !1;
2121
+ const d = V(t.value);
2122
+ d && _(d) ? e.onChange({ value: d, event: r }) : e.onChange({ value: null, event: r });
2123
+ }, X = (r) => r.getHours() * 60 + r.getMinutes(), _ = (r) => {
2124
+ const d = e.min ?? void 0, T = e.max ?? void 0, U = X(r);
2125
+ if (d) {
2126
+ const B = X(d);
2127
+ if (U < B) return !1;
2005
2128
  }
2006
2129
  if (T) {
2007
- const z = X(T);
2008
- if (K > z) return !1;
2130
+ const B = X(T);
2131
+ if (U > B) return !1;
2009
2132
  }
2010
2133
  return !0;
2011
- }, J = (n) => {
2012
- const u = n.getHours(), T = u >= 12 ? "PM" : "AM";
2013
- t.value = I(u, n.getMinutes(), T);
2014
- }, s = (n, u) => {
2015
- e.onChange({ value: n, event: u });
2016
- }, x = () => {
2017
- _(() => {
2134
+ }, F = (r) => {
2135
+ const d = r.getHours(), T = d >= 12 ? "PM" : "AM";
2136
+ t.value = I(d, r.getMinutes(), T);
2137
+ }, a = (r, d) => {
2138
+ e.onChange({ value: r, event: d });
2139
+ }, m = () => {
2140
+ G(() => {
2018
2141
  requestAnimationFrame(() => {
2019
2142
  requestAnimationFrame(() => {
2020
- const n = document.getElementById(
2143
+ const r = document.getElementById(
2021
2144
  e.id
2022
2145
  );
2023
- if (n) {
2024
- n.focus();
2025
- const u = (n.value ?? "").length;
2026
- n.setSelectionRange(u, u);
2146
+ if (r) {
2147
+ r.focus();
2148
+ const d = (r.value ?? "").length;
2149
+ r.setSelectionRange(d, d);
2027
2150
  }
2028
2151
  });
2029
2152
  });
2030
2153
  });
2031
- }, m = (n) => {
2032
- const u = n?.event?.target;
2033
- return u ? u.closest(".k-time-now") ? "now" : u.closest(".k-time-accept") ? "set" : null : null;
2034
- }, k = (n, u) => {
2035
- n && Z(n) ? s(n, u) : s(null, u);
2036
- }, C = (...n) => {
2037
- const u = n[0];
2038
- if (!u) return;
2039
- const T = m(u);
2154
+ }, v = (r) => {
2155
+ const d = r?.event?.target;
2156
+ return d ? d.closest(".k-time-now") ? "now" : d.closest(".k-time-accept") ? "set" : null : null;
2157
+ }, A = (r, d) => {
2158
+ r && _(r) ? a(r, d) : a(null, d);
2159
+ }, C = (...r) => {
2160
+ const d = r[0];
2161
+ if (!d) return;
2162
+ const T = v(d);
2040
2163
  if (T === "now") {
2041
- const z = /* @__PURE__ */ new Date();
2042
- J(z), k(z, u), x();
2164
+ const B = /* @__PURE__ */ new Date();
2165
+ F(B), A(B, d), m();
2043
2166
  return;
2044
2167
  }
2045
- if (u?.value instanceof Date) {
2046
- const z = new Date(u.value);
2047
- J(z), k(z, u), T === "set" && x();
2168
+ if (d?.value instanceof Date) {
2169
+ const B = new Date(d.value);
2170
+ F(B), A(B, d), T === "set" && m();
2048
2171
  return;
2049
2172
  }
2050
- if (u?.value === null) {
2051
- t.value = "", s(null, u);
2173
+ if (d?.value === null) {
2174
+ t.value = "", a(null, d);
2052
2175
  return;
2053
2176
  }
2054
- t.value = u.value;
2055
- const K = u.event?.target;
2056
- r.value = K?.selectionStart ?? 0;
2177
+ t.value = d.value;
2178
+ const U = d.event?.target;
2179
+ n.value = U?.selectionStart ?? 0;
2057
2180
  try {
2058
- const z = r.value ?? 0;
2059
- if (R(z) === "ampm" && (t.value ?? "").length >= 8) {
2181
+ const B = n.value ?? 0;
2182
+ if (R(B) === "ampm" && (t.value ?? "").length >= 8) {
2060
2183
  const Q = t.value.charAt(6);
2061
- /[Aa]/.test(Q) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, _(() => {
2184
+ /[Aa]/.test(Q) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, G(() => {
2062
2185
  requestAnimationFrame(() => {
2063
- const W = document.getElementById(
2186
+ const j = document.getElementById(
2064
2187
  e.id
2065
2188
  );
2066
- W && (W.focus(), W.setSelectionRange(8, 8));
2189
+ j && (j.focus(), j.setSelectionRange(8, 8));
2067
2190
  });
2068
- })) : /[Pp]/.test(Q) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, _(() => {
2191
+ })) : /[Pp]/.test(Q) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, G(() => {
2069
2192
  requestAnimationFrame(() => {
2070
- const W = document.getElementById(
2193
+ const j = document.getElementById(
2071
2194
  e.id
2072
2195
  );
2073
- W && (W.focus(), W.setSelectionRange(8, 8));
2196
+ j && (j.focus(), j.setSelectionRange(8, 8));
2074
2197
  });
2075
2198
  }));
2076
2199
  }
2077
2200
  } catch {
2078
2201
  }
2079
- H(u);
2080
- }, D = (n) => {
2081
- r.value = n.target.selectionStart ?? 0;
2082
- }, P = (n, u, T) => {
2083
- const K = u?.selectionStart ?? r.value ?? 0;
2084
- r.value = K;
2085
- const z = R(K), Q = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2202
+ W(d);
2203
+ }, E = (r) => {
2204
+ n.value = r.target.selectionStart ?? 0;
2205
+ }, L = (r, d, T) => {
2206
+ const U = d?.selectionStart ?? n.value ?? 0;
2207
+ n.value = U;
2208
+ const B = R(U), Q = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2086
2209
  if (!Q) {
2087
- if ((t.value ?? "").length === 0 || V.value.length === 0) {
2088
- const g = /* @__PURE__ */ new Date(), F = g.getHours(), B = F >= 12 ? "PM" : "AM";
2089
- t.value = I(F, g.getMinutes(), B);
2090
- const ae = N(t.value);
2091
- k(ae, T), _(() => {
2210
+ if ((t.value ?? "").length === 0 || N.value.length === 0) {
2211
+ const h = /* @__PURE__ */ new Date(), $ = h.getHours(), H = $ >= 12 ? "PM" : "AM";
2212
+ t.value = I($, h.getMinutes(), H);
2213
+ const oe = V(t.value);
2214
+ A(oe, T), G(() => {
2092
2215
  requestAnimationFrame(() => {
2093
- const oe = document.getElementById(
2216
+ const le = document.getElementById(
2094
2217
  e.id
2095
- ), fe = r.value ?? 0;
2096
- oe && (oe.focus(), oe.setSelectionRange(fe, fe));
2218
+ ), fe = n.value ?? 0;
2219
+ le && (le.focus(), le.setSelectionRange(fe, fe));
2097
2220
  });
2098
2221
  });
2099
2222
  }
2100
2223
  return;
2101
2224
  }
2102
- let W = parseInt(Q[1]), G = parseInt(Q[2]), ce = Q[3].toUpperCase();
2103
- if (z === "hh")
2104
- n === "ArrowUp" ? W = W < 12 ? W + 1 : 1 : W = W > 1 ? W - 1 : 12;
2105
- else if (z === "mm") {
2106
- const g = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
2107
- if (g === 1)
2108
- n === "ArrowUp" ? G = G < 59 ? G + 1 : 0 : G = G > 0 ? G - 1 : 59;
2109
- else if (n === "ArrowUp") {
2110
- const F = G % g;
2111
- let B = F === 0 ? G + g : G + (g - F);
2112
- B >= 60 && (B = 0), G = B;
2225
+ let j = parseInt(Q[1]), J = parseInt(Q[2]), ce = Q[3].toUpperCase();
2226
+ if (B === "hh")
2227
+ r === "ArrowUp" ? j = j < 12 ? j + 1 : 1 : j = j > 1 ? j - 1 : 12;
2228
+ else if (B === "mm") {
2229
+ const h = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
2230
+ if (h === 1)
2231
+ r === "ArrowUp" ? J = J < 59 ? J + 1 : 0 : J = J > 0 ? J - 1 : 59;
2232
+ else if (r === "ArrowUp") {
2233
+ const $ = J % h;
2234
+ let H = $ === 0 ? J + h : J + (h - $);
2235
+ H >= 60 && (H = 0), J = H;
2113
2236
  } else {
2114
- const F = G % g;
2115
- let B = F === 0 ? G - g : G - F;
2116
- B < 0 && (B = 60 - g), G = B;
2237
+ const $ = J % h;
2238
+ let H = $ === 0 ? J - h : J - $;
2239
+ H < 0 && (H = 60 - h), J = H;
2117
2240
  }
2118
- } else z === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
2119
- t.value = `${String(W).padStart(2, "0")}:${String(G).padStart(
2241
+ } else B === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
2242
+ t.value = `${String(j).padStart(2, "0")}:${String(J).padStart(
2120
2243
  2,
2121
2244
  "0"
2122
2245
  )} ${ce}`;
2123
- const l = N(t.value);
2124
- k(l, T), _(() => {
2246
+ const i = V(t.value);
2247
+ A(i, T), G(() => {
2125
2248
  requestAnimationFrame(() => {
2126
- const g = document.getElementById(
2249
+ const h = document.getElementById(
2127
2250
  e.id
2128
- ), F = r.value ?? 0;
2129
- g && (g.focus(), g.setSelectionRange(F, F));
2251
+ ), $ = n.value ?? 0;
2252
+ h && (h.focus(), h.setSelectionRange($, $));
2130
2253
  });
2131
2254
  });
2132
- }, U = (n) => {
2133
- if (n.code === "Space" || n.key === " ") {
2134
- n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
2255
+ }, K = (r) => {
2256
+ if (r.code === "Space" || r.key === " ") {
2257
+ r.preventDefault(), r.stopPropagation(), e.onShowPicker(r);
2135
2258
  return;
2136
2259
  }
2137
- if (n.key === "ArrowDown" && n.altKey) {
2138
- n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
2260
+ if (r.key === "ArrowDown" && r.altKey) {
2261
+ r.preventDefault(), r.stopPropagation(), e.onShowPicker(r);
2139
2262
  return;
2140
2263
  }
2141
- if (S.includes(n.key)) {
2142
- if (n.altKey) return;
2143
- n.preventDefault(), n.stopPropagation();
2144
- const u = n.target;
2145
- P(n.key, u, n);
2264
+ if (k.includes(r.key)) {
2265
+ if (r.altKey) return;
2266
+ r.preventDefault(), r.stopPropagation();
2267
+ const d = r.target;
2268
+ L(r.key, d, r);
2146
2269
  return;
2147
2270
  }
2148
- }, j = (n) => {
2149
- n.preventDefault();
2150
- const u = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
2151
- P(u, n.target, n);
2152
- }, re = (n) => {
2153
- const u = n.target;
2154
- if ($.includes(n.key)) {
2155
- r.value = u?.selectionStart ?? 0;
2271
+ }, Z = (r) => {
2272
+ r.preventDefault();
2273
+ const d = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
2274
+ L(d, r.target, r);
2275
+ }, ne = (r) => {
2276
+ const d = r.target;
2277
+ if (P.includes(r.key)) {
2278
+ n.value = d?.selectionStart ?? 0;
2156
2279
  return;
2157
2280
  }
2158
- if (S.includes(n.key)) {
2159
- if (n.altKey) return;
2160
- r.value = u?.selectionStart ?? 0;
2281
+ if (k.includes(r.key)) {
2282
+ if (r.altKey) return;
2283
+ n.value = d?.selectionStart ?? 0;
2161
2284
  }
2162
- }, ue = (n) => {
2163
- w.value = !0, d.value && e.externalValue && e.externalValue.value === void 0 && V.value.length === 0 && (e.externalValue.value = "");
2164
- const u = n.target;
2165
- u && (r.value = u.selectionStart ?? 0);
2285
+ }, ie = (r) => {
2286
+ b.value = !0, c.value && e.externalValue && e.externalValue.value === void 0 && N.value.length === 0 && (e.externalValue.value = "");
2287
+ const d = r.target;
2288
+ d && (n.value = d.selectionStart ?? 0);
2166
2289
  };
2167
- e.externalValue && le(
2290
+ e.externalValue && ae(
2168
2291
  e.externalValue,
2169
- (n) => {
2170
- if (n) {
2171
- const u = new Date(n);
2172
- if (u.toString() !== "Invalid Date") {
2173
- const T = u.getHours(), K = T >= 12 ? "PM" : "AM";
2174
- t.value = I(T, u.getMinutes(), K);
2292
+ (r) => {
2293
+ if (r) {
2294
+ const d = new Date(r);
2295
+ if (d.toString() !== "Invalid Date") {
2296
+ const T = d.getHours(), U = T >= 12 ? "PM" : "AM";
2297
+ t.value = I(T, d.getMinutes(), U);
2175
2298
  return;
2176
2299
  }
2177
2300
  }
2178
2301
  },
2179
2302
  { immediate: !0 }
2180
2303
  );
2181
- const o = y(() => [
2304
+ const l = y(() => [
2182
2305
  ["Time", t.value || "--:-- --"],
2183
- ["Hour (12h)", E.value],
2184
- ["Hour (24h)", p.value],
2185
- ["Minute", A.value],
2306
+ ["Hour (12h)", x.value],
2307
+ ["Hour (24h)", f.value],
2308
+ ["Minute", D.value],
2186
2309
  ["Period", O.value],
2187
- ["Time (24h)", i.value ?? "--:--:--"],
2188
- ["Digits only", V.value],
2310
+ ["Time (24h)", s.value ?? "--:--:--"],
2311
+ ["Digits only", N.value],
2189
2312
  [
2190
2313
  "Parsed Date",
2191
- b.value?.toLocaleDateString("en-US", {
2314
+ S.value?.toLocaleDateString("en-US", {
2192
2315
  hour: "2-digit",
2193
2316
  minute: "2-digit"
2194
2317
  }) ?? null
@@ -2208,62 +2331,62 @@ function Tt(e) {
2208
2331
  }) ?? null
2209
2332
  ],
2210
2333
  ["valid", q.value],
2211
- ["reason", f.value],
2212
- ["validationMessage", h.value]
2213
- ]), b = y(
2214
- () => N(t.value) ?? null
2334
+ ["reason", p.value],
2335
+ ["validationMessage", w.value]
2336
+ ]), S = y(
2337
+ () => V(t.value) ?? null
2215
2338
  ), q = y(() => {
2216
- if (!d.value) {
2217
- if (!v.value) return !0;
2218
- const u = b.value;
2219
- return u ? Z(u) : !1;
2220
- }
2221
- if (!w.value) return !0;
2222
- const n = b.value;
2223
- return !v.value || !n ? !1 : Z(n);
2224
- }), f = y(() => {
2225
- if (!d.value) {
2226
- if (!v.value) return;
2227
- const u = b.value;
2228
- return u ? Z(u) ? "valid" : "out-of-bounds" : "invalid-time";
2229
- }
2230
- if (!w.value) return;
2231
- if (V.value.length === 0 || !v.value)
2339
+ if (!c.value) {
2340
+ if (!g.value) return !0;
2341
+ const d = S.value;
2342
+ return d ? _(d) : !1;
2343
+ }
2344
+ if (!b.value) return !0;
2345
+ const r = S.value;
2346
+ return !g.value || !r ? !1 : _(r);
2347
+ }), p = y(() => {
2348
+ if (!c.value) {
2349
+ if (!g.value) return;
2350
+ const d = S.value;
2351
+ return d ? _(d) ? "valid" : "out-of-bounds" : "invalid-time";
2352
+ }
2353
+ if (!b.value) return;
2354
+ if (N.value.length === 0 || !g.value)
2232
2355
  return "incomplete";
2233
- const n = b.value;
2234
- return n ? Z(n) ? "valid" : "out-of-bounds" : "invalid-time";
2235
- }), h = y(() => {
2236
- const n = f.value;
2237
- if (!n || n === "valid") return "";
2238
- if (n === "incomplete")
2356
+ const r = S.value;
2357
+ return r ? _(r) ? "valid" : "out-of-bounds" : "invalid-time";
2358
+ }), w = y(() => {
2359
+ const r = p.value;
2360
+ if (!r || r === "valid") return "";
2361
+ if (r === "incomplete")
2239
2362
  return "Required";
2240
- if (n === "invalid-time")
2241
- return `Must be in ${a.value} format.`;
2242
- const u = {
2363
+ if (r === "invalid-time")
2364
+ return `Must be in ${o.value} format.`;
2365
+ const d = {
2243
2366
  hour: "2-digit",
2244
2367
  minute: "2-digit"
2245
- }, T = e.min ? e.min.toLocaleTimeString("en-US", u) : null, K = e.max ? e.max.toLocaleTimeString("en-US", u) : null;
2246
- if (n === "out-of-bounds") {
2247
- if (T && K) return `Must be between ${T} and ${K}.`;
2368
+ }, T = e.min ? e.min.toLocaleTimeString("en-US", d) : null, U = e.max ? e.max.toLocaleTimeString("en-US", d) : null;
2369
+ if (r === "out-of-bounds") {
2370
+ if (T && U) return `Must be between ${T} and ${U}.`;
2248
2371
  if (T) return `Must be ${T} or later.`;
2249
- if (K) return `Must be ${K} or earlier.`;
2372
+ if (U) return `Must be ${U} or earlier.`;
2250
2373
  }
2251
2374
  return "";
2252
- }), L = () => {
2253
- _(() => {
2254
- const n = document.getElementById(e.id);
2255
- if (!n) {
2375
+ }), z = () => {
2376
+ G(() => {
2377
+ const r = document.getElementById(e.id);
2378
+ if (!r) {
2256
2379
  console.warn(`#${e.id} not found for styling.`);
2257
2380
  return;
2258
2381
  }
2259
- const u = n.closest(".k-timepicker");
2260
- if (!u) {
2382
+ const d = r.closest(".k-timepicker");
2383
+ if (!d) {
2261
2384
  console.warn(
2262
2385
  `.k-timepicker parent of #${e.id} not found for styling.`
2263
2386
  );
2264
2387
  return;
2265
2388
  }
2266
- const T = u.parentElement;
2389
+ const T = d.parentElement;
2267
2390
  if (!T) {
2268
2391
  console.warn(
2269
2392
  `Parent of .k-timepicker not found for #${e.id} styling.`
@@ -2274,50 +2397,50 @@ function Tt(e) {
2274
2397
  });
2275
2398
  };
2276
2399
  return Re(() => {
2277
- L();
2400
+ z();
2278
2401
  }), {
2279
2402
  raw: t,
2280
2403
  rules: M,
2281
- debugEnabled: c,
2282
- debugLines: o,
2283
- placeholder: a,
2404
+ debugEnabled: u,
2405
+ debugLines: l,
2406
+ placeholder: o,
2284
2407
  isValid: q,
2285
- reason: te(f),
2286
- validationMessage: h,
2287
- isComplete: v,
2288
- inRangeTime: Z,
2289
- cursorPos: r,
2290
- hour: te(E),
2291
- hour24: te(p),
2292
- minute: te(A),
2408
+ reason: te(p),
2409
+ validationMessage: w,
2410
+ isComplete: g,
2411
+ inRangeTime: _,
2412
+ cursorPos: n,
2413
+ hour: te(x),
2414
+ hour24: te(f),
2415
+ minute: te(D),
2293
2416
  period: te(O),
2294
- time24: te(i),
2295
- parsedRawTime: te(b),
2417
+ time24: te(s),
2418
+ parsedRawTime: te(S),
2296
2419
  handleChange: C,
2297
- handleKeyDown: U,
2298
- handleKeyUp: re,
2299
- handleClick: D,
2300
- handleWheel: j,
2301
- handleBlur: ue,
2420
+ handleKeyDown: K,
2421
+ handleKeyUp: ne,
2422
+ handleClick: E,
2423
+ handleWheel: Z,
2424
+ handleBlur: ie,
2302
2425
  // Expose so consumers can reapply theming when Kendo updates DOM
2303
- initStyling: L
2426
+ initStyling: z
2304
2427
  };
2305
2428
  }
2306
- const Rt = {
2429
+ const Vt = {
2307
2430
  returnFocusToTrigger: !1,
2308
2431
  focusTrapOptions: {
2309
2432
  returnFocusOnDeactivate: !1
2310
2433
  }
2311
2434
  };
2312
- function Ft(e) {
2313
- const t = ye(null), r = [
2435
+ function Nt(e) {
2436
+ const t = ve(null), n = [
2314
2437
  ".k-animation-container .k-popup",
2315
2438
  ".k-popup",
2316
2439
  ".k-timepicker-popup",
2317
2440
  ".k-menu-popup"
2318
- ], c = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), a = (M) => M ? typeof e.initialFocus == "string" ? M.querySelector(e.initialFocus) ?? M : typeof e.initialFocus == "function" ? e.initialFocus(M) ?? M : M.querySelector(
2441
+ ], u = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? n].flat(), o = (M) => M ? typeof e.initialFocus == "string" ? M.querySelector(e.initialFocus) ?? M : typeof e.initialFocus == "function" ? e.initialFocus(M) ?? M : M.querySelector(
2319
2442
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
2320
- ) ?? M : null, { activate: d, deactivate: w } = He(t, {
2443
+ ) ?? M : null, { activate: c, deactivate: b } = Ze(t, {
2321
2444
  escapeDeactivates: !1,
2322
2445
  clickOutsideDeactivates: !1,
2323
2446
  // Without this, focus-trap's own default (false) preventDefault()s and
@@ -2326,90 +2449,92 @@ function Ft(e) {
2326
2449
  // page (e.g. another trigger in the same row) until the trap deactivates.
2327
2450
  allowOutsideClick: !0,
2328
2451
  fallbackFocus: () => t.value,
2329
- initialFocus: () => a(t.value),
2452
+ initialFocus: () => o(t.value),
2330
2453
  ...e.focusTrapOptions ?? {}
2331
2454
  });
2332
- let S = null, $ = Y(null);
2333
- const V = () => {
2455
+ let k = null, P = Y(null);
2456
+ const N = () => {
2334
2457
  if (e.resolvePopupEl) return e.resolvePopupEl();
2335
- const M = (E, A) => {
2336
- const O = Array.from(E.querySelectorAll(A));
2458
+ const M = (x, D) => {
2459
+ const O = Array.from(x.querySelectorAll(D));
2337
2460
  if (!O.length) return null;
2338
- const p = O.filter(
2339
- (i) => i.offsetParent !== null || i.getClientRects().length > 0
2461
+ const f = O.filter(
2462
+ (s) => s.offsetParent !== null || s.getClientRects().length > 0
2340
2463
  );
2341
- return p[p.length - 1] ?? O[O.length - 1] ?? null;
2464
+ return f[f.length - 1] ?? O[O.length - 1] ?? null;
2342
2465
  }, R = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
2343
- for (const E of c) {
2344
- const A = M(R, E);
2345
- if (A) return A;
2466
+ for (const x of u) {
2467
+ const D = M(R, x);
2468
+ if (D) return D;
2346
2469
  }
2347
- for (const E of c) {
2348
- const A = M(document, E);
2349
- if (A) return A;
2470
+ for (const x of u) {
2471
+ const D = M(document, x);
2472
+ if (D) return D;
2350
2473
  }
2351
2474
  return null;
2352
2475
  };
2353
- return qe(t, (M) => {
2354
- $.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", M);
2355
- }), le(
2476
+ return Ue(t, (M) => {
2477
+ P.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", M);
2478
+ }), ae(
2356
2479
  () => e.isOpen.value,
2357
2480
  (M) => {
2358
- M ? ($.value = null, _(() => {
2359
- const R = V();
2481
+ M ? (P.value = null, G(() => {
2482
+ const R = N();
2360
2483
  R && (R.tabIndex < 0 && (R.tabIndex = -1), t.value = R, setTimeout(() => {
2361
2484
  try {
2362
- d();
2363
- } catch (E) {
2485
+ c();
2486
+ } catch (x) {
2364
2487
  console.warn(
2365
2488
  "usePopupTrap: focus trap failed to activate",
2366
- E
2489
+ x
2367
2490
  );
2368
2491
  }
2369
- }, 0), S || (S = (E) => {
2370
- E.key === "Escape" && ($.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", E));
2371
- }, document.addEventListener("keydown", S, !0)));
2372
- })) : (w(), S && (document.removeEventListener("keydown", S, !0), S = null), t.value = null, $.value === "outside" && _(() => {
2492
+ }, 0), k || (k = (x) => {
2493
+ x.key === "Escape" && (P.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", x));
2494
+ }, document.addEventListener("keydown", k, !0)));
2495
+ })) : (b(), k && (document.removeEventListener("keydown", k, !0), k = null), t.value = null, P.value === "outside" && G(() => {
2373
2496
  const R = () => {
2374
- const E = e.triggerEl?.value, A = E?.querySelector("input"), O = document.activeElement;
2375
- O && (O === A || E && E.contains(O)) && (A ?? E)?.blur?.();
2497
+ const x = e.triggerEl?.value, D = x?.querySelector("input"), O = document.activeElement;
2498
+ O && (O === D || x && x.contains(O)) && (D ?? x)?.blur?.();
2376
2499
  };
2377
2500
  requestAnimationFrame(() => setTimeout(R, 0));
2378
- }), e.returnFocusToTrigger !== !1 && $.value === "escape" && e.triggerEl?.value && _(() => {
2501
+ }), e.returnFocusToTrigger !== !1 && P.value === "escape" && e.triggerEl?.value && G(() => {
2379
2502
  const R = () => {
2380
- const E = e.triggerEl?.value;
2381
- if (!E) return;
2382
- (E.querySelector("input") ?? E)?.focus?.();
2503
+ const x = e.triggerEl?.value;
2504
+ if (!x) return;
2505
+ (x.querySelector("input") ?? x)?.focus?.();
2383
2506
  };
2384
2507
  requestAnimationFrame(() => setTimeout(R, 0));
2385
2508
  }));
2386
2509
  }
2387
2510
  ), {
2388
2511
  popupRef: t,
2389
- activate: d,
2390
- deactivate: w,
2391
- lastCloseReason: te($),
2512
+ activate: c,
2513
+ deactivate: b,
2514
+ lastCloseReason: te(P),
2392
2515
  setPopupEl: (M) => t.value = M
2393
2516
  };
2394
2517
  }
2395
2518
  export {
2396
- Rt as POPUP_MENU_TRAP_OPTIONS,
2397
- it as computeCollisionOffset,
2398
- Mt as useActiveIdRegistry,
2399
- Dt as useCompositeId,
2400
- xt as useExclusiveGroup,
2401
- Qe as useFieldsetTouchTracker,
2402
- et as useFieldsetValidationKit,
2403
- wt as useGridA11y,
2404
- St as useGridActiveFilter,
2405
- kt as useGridRowAction,
2406
- ft as useIntersectionObserver,
2407
- It as useMaskedDateInput,
2408
- Ct as useMaskedDateRangeInput,
2409
- Tt as useMaskedTimeInput,
2410
- Et as usePopupMenu,
2411
- Ft as usePopupTrap,
2412
- At as useUSAddress,
2413
- Je as useZipTextBox
2519
+ Vt as POPUP_MENU_TRAP_OPTIONS,
2520
+ Ne as WINDOW_SETTINGS_DEFAULTS,
2521
+ ct as computeCollisionOffset,
2522
+ Ft as useActiveIdRegistry,
2523
+ Ct as useCompositeId,
2524
+ Rt as useExclusiveGroup,
2525
+ nt as useFieldsetTouchTracker,
2526
+ rt as useFieldsetValidationKit,
2527
+ Et as useGridA11y,
2528
+ xt as useGridActiveFilter,
2529
+ Mt as useGridRowAction,
2530
+ mt as useIntersectionObserver,
2531
+ Lt as useMaskedDateInput,
2532
+ $t as useMaskedDateRangeInput,
2533
+ Ot as useMaskedTimeInput,
2534
+ Tt as usePopupMenu,
2535
+ Nt as usePopupTrap,
2536
+ It as useUSAddress,
2537
+ Pt as useWindow,
2538
+ tt as useZipTextBox
2414
2539
  };
2415
2540
  //# sourceMappingURL=featherk-composables.es.js.map