@featherk/composables 0.10.8 → 0.10.9

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,31 +1,31 @@
1
- import { ref as U, onBeforeUnmount as Le, nextTick as B, computed as v, watchEffect as Fe, toValue as oe, reactive as Ke, watch as ue, getCurrentScope as qe, onScopeDispose as Ne, unref as Oe, onMounted as Me, readonly as X, shallowRef as Ue } from "vue";
2
- import { useFocusTrap as Be } from "@vueuse/integrations/useFocusTrap";
3
- const pt = (e, t) => {
4
- const o = U(null);
5
- let k = !1, h = null, y = null;
6
- const x = [], S = ".k-table-row[data-grid-row-index] [tabindex]", E = () => {
1
+ import { ref as U, onBeforeUnmount as Pe, nextTick as B, computed as v, watchEffect as Te, toValue as oe, reactive as Ve, watch as ue, unref as Le, onMounted as Me, readonly as X, shallowRef as Ke } from "vue";
2
+ import { useFocusTrap as qe } from "@vueuse/integrations/useFocusTrap";
3
+ const it = (e, t) => {
4
+ const r = U(null);
5
+ let g = !1, f = null, p = null;
6
+ const A = [], C = ".k-table-row[data-grid-row-index] [tabindex]", T = () => {
7
7
  const i = e?.value?.$el;
8
8
  return i ? i.closest(".k-grid") : null;
9
- }, F = (i) => {
10
- const D = E();
11
- if (!D) return !1;
9
+ }, q = (i) => {
10
+ const w = T();
11
+ if (!w) return !1;
12
12
  const d = i.closest(".k-grid-aria-root");
13
13
  if (d)
14
- return D.contains(d);
15
- const g = i.closest(
14
+ return w.contains(d);
15
+ const b = i.closest(
16
16
  ".k-grid-header, .k-grid-content, .k-grid-content-locked"
17
17
  );
18
- return g ? D.contains(g) : !1;
19
- }, w = (i) => i.key === "Enter" || i.code === "Enter" || i.code === "NumpadEnter", $ = () => e?.value?.columns, s = (i) => {
20
- const D = i.key || i.code;
21
- ([" ", "Spacebar", "Space"].includes(D) || w(i)) && (i.preventDefault(), i.stopPropagation(), o.value = i.target, i.target.click());
18
+ return b ? w.contains(b) : !1;
19
+ }, D = (i) => i.key === "Enter" || i.code === "Enter" || i.code === "NumpadEnter", $ = () => e?.value?.columns, s = (i) => {
20
+ const w = i.key || i.code;
21
+ ([" ", "Spacebar", "Space"].includes(w) || D(i)) && (i.preventDefault(), i.stopPropagation(), r.value = i.target, i.target.click());
22
22
  }, l = (i) => {
23
- if (!o.value) return;
23
+ if (!r.value) return;
24
24
  if (i.code === "Escape") {
25
- i.stopPropagation(), o.value && o.value.focus();
25
+ i.stopPropagation(), r.value && r.value.focus();
26
26
  return;
27
27
  }
28
- const D = Array.from(
28
+ const w = 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
  )
@@ -34,7 +34,7 @@ const pt = (e, t) => {
34
34
  );
35
35
  if (d) {
36
36
  if (i.code === "Tab") {
37
- const g = [
37
+ const b = [
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,86 +43,86 @@ const pt = (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
- ], M = t?.focusableMenuSelectors ?? g, b = Array.from(
47
- d.querySelectorAll(M.join(","))
46
+ ], I = t?.focusableMenuSelectors ?? b, S = Array.from(
47
+ d.querySelectorAll(I.join(","))
48
48
  );
49
- if (b.length === 0) return;
50
- const C = b.findIndex(
49
+ if (S.length === 0) return;
50
+ const M = S.findIndex(
51
51
  (W) => W === document.activeElement
52
52
  );
53
- let q;
54
- C === -1 ? q = 0 : i.shiftKey ? q = (C - 1 + b.length) % b.length : q = (C + 1) % b.length, i.preventDefault(), i.stopPropagation(), b[q]?.focus();
53
+ let K;
54
+ M === -1 ? K = 0 : i.shiftKey ? K = (M - 1 + S.length) % S.length : K = (M + 1) % S.length, i.preventDefault(), i.stopPropagation(), S[K]?.focus();
55
55
  }
56
56
  } else if (i.code === "ArrowUp" || i.code === "ArrowDown") {
57
57
  i.preventDefault(), i.stopPropagation();
58
- const g = D.findIndex(
59
- (b) => b === document.activeElement
58
+ const b = w.findIndex(
59
+ (S) => S === document.activeElement
60
60
  );
61
- let M = g;
62
- i.code === "ArrowUp" ? M = g > 0 ? g - 1 : D.length - 1 : i.code === "ArrowDown" && (M = g < D.length - 1 ? g + 1 : 0), D[M]?.focus();
61
+ let I = b;
62
+ i.code === "ArrowUp" ? I = b > 0 ? b - 1 : w.length - 1 : i.code === "ArrowDown" && (I = b < w.length - 1 ? b + 1 : 0), w[I]?.focus();
63
63
  return;
64
64
  }
65
65
  if (i.code === "Tab") {
66
66
  i.preventDefault(), i.stopPropagation();
67
- const g = o.value?.parentElement;
68
- (i.shiftKey ? g?.previousElementSibling : g?.nextElementSibling)?.querySelector(
67
+ const b = r.value?.parentElement;
68
+ (i.shiftKey ? b?.previousElementSibling : b?.nextElementSibling)?.querySelector(
69
69
  "button, [role='button'], .k-link"
70
70
  )?.focus();
71
71
  }
72
- }, p = () => {
73
- h = new MutationObserver((i) => {
74
- i.forEach((D) => {
75
- D.addedNodes.forEach((d) => {
72
+ }, y = () => {
73
+ f = new MutationObserver((i) => {
74
+ i.forEach((w) => {
75
+ w.addedNodes.forEach((d) => {
76
76
  if (d.nodeType === Node.ELEMENT_NODE) {
77
- const g = d;
78
- if (g.classList.contains("k-animation-container")) {
79
- const b = o.value;
80
- b && (b.dataset.featherKSortable === "true" || B(() => {
81
- g.querySelectorAll(
77
+ const b = d;
78
+ if (b.classList.contains("k-animation-container")) {
79
+ const S = r.value;
80
+ S && (S.dataset.featherKSortable === "true" || B(() => {
81
+ b.querySelectorAll(
82
82
  ".k-columnmenu-item-wrapper"
83
83
  ).forEach((W) => {
84
84
  W.textContent?.toLowerCase().includes("sort") && W.remove();
85
85
  });
86
- })), g.addEventListener(
86
+ })), b.addEventListener(
87
87
  "keydown",
88
88
  l
89
89
  ), B(() => {
90
- const C = () => {
91
- const q = Array.from(
92
- g.querySelectorAll(
90
+ const M = () => {
91
+ const K = Array.from(
92
+ b.querySelectorAll(
93
93
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
94
94
  )
95
95
  );
96
- if (q.length === 1)
97
- q[0].focus(), q[0].click(), C.attempts = 0;
98
- else if (q.length > 1) {
99
- C.attempts = 0;
96
+ if (K.length === 1)
97
+ K[0].focus(), K[0].click(), M.attempts = 0;
98
+ else if (K.length > 1) {
99
+ M.attempts = 0;
100
100
  return;
101
101
  } else
102
- C.attempts === void 0 && (C.attempts = 0), C.attempts++ < 3 && setTimeout(C, 200);
102
+ M.attempts === void 0 && (M.attempts = 0), M.attempts++ < 3 && setTimeout(M, 200);
103
103
  };
104
- C();
104
+ M();
105
105
  });
106
106
  }
107
- g.querySelectorAll(
107
+ b.querySelectorAll(
108
108
  ".k-animation-container"
109
- ).forEach((b) => {
110
- b.addEventListener(
109
+ ).forEach((S) => {
110
+ S.addEventListener(
111
111
  "keydown",
112
112
  l
113
113
  );
114
114
  });
115
115
  }
116
- }), D.removedNodes.forEach((d) => {
116
+ }), w.removedNodes.forEach((d) => {
117
117
  if (d.nodeType === Node.ELEMENT_NODE) {
118
- const g = d;
119
- g.classList.contains("k-animation-container") && g.removeEventListener(
118
+ const b = d;
119
+ b.classList.contains("k-animation-container") && b.removeEventListener(
120
120
  "keydown",
121
121
  l
122
- ), g.querySelectorAll(
122
+ ), b.querySelectorAll(
123
123
  ".k-animation-container"
124
- ).forEach((b) => {
125
- b.removeEventListener(
124
+ ).forEach((S) => {
125
+ S.removeEventListener(
126
126
  "keydown",
127
127
  l
128
128
  );
@@ -130,42 +130,42 @@ const pt = (e, t) => {
130
130
  }
131
131
  });
132
132
  });
133
- }), h.observe(document.body, {
133
+ }), f.observe(document.body, {
134
134
  childList: !0,
135
135
  subtree: !0
136
136
  });
137
- }, K = (i) => {
138
- const D = i.tagName.toLowerCase();
139
- return !!(["input", "textarea", "select", "button"].includes(D) || i.closest(
137
+ }, L = (i) => {
138
+ const w = i.tagName.toLowerCase();
139
+ return !!(["input", "textarea", "select", "button"].includes(w) || i.closest(
140
140
  '.k-picker-wrap, .k-input-inner, .k-textbox, [role="combobox"]'
141
141
  ));
142
- }, m = (i) => {
142
+ }, h = (i) => {
143
143
  if (!i.type || !i)
144
144
  return;
145
- const D = i.target;
146
- if (!D) return;
147
- const d = D.closest(
145
+ const w = i.target;
146
+ if (!w) return;
147
+ const d = w.closest(
148
148
  ".k-table-row[data-grid-row-index]"
149
149
  );
150
- if (!F(D))
150
+ if (!q(w))
151
151
  return;
152
- const g = ["ArrowLeft", "ArrowRight"].includes(
152
+ const b = ["ArrowLeft", "ArrowRight"].includes(
153
153
  i.code
154
154
  );
155
- if (!(K(D) && !(d && g))) {
155
+ if (!(L(w) && !(d && b))) {
156
156
  if (i.code === "Escape") {
157
- const M = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
- if (M) {
157
+ const I = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
+ if (I) {
159
159
  i.preventDefault(), i.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((C) => C.setAttribute("tabindex", "-1"));
165
+ ).forEach((M) => M.setAttribute("tabindex", "-1"));
166
166
  } catch {
167
167
  }
168
- M.setAttribute("tabindex", "0"), M.focus();
168
+ I.setAttribute("tabindex", "0"), I.focus();
169
169
  return;
170
170
  }
171
171
  }
@@ -178,15 +178,15 @@ const pt = (e, t) => {
178
178
  "NumpadEnter",
179
179
  "Space"
180
180
  ].includes(i.code)) {
181
- if (D.classList.contains("k-grid-header-menu") && D.classList.contains("k-grid-column-menu")) {
182
- o.value = D;
181
+ if (w.classList.contains("k-grid-header-menu") && w.classList.contains("k-grid-column-menu")) {
182
+ r.value = w;
183
183
  return;
184
184
  }
185
185
  if (d) {
186
186
  if (["ArrowDown", "ArrowUp"].includes(i.code)) {
187
187
  i.preventDefault(), i.stopPropagation();
188
- const M = (C, q) => {
189
- let W = q === "next" ? C.nextElementSibling : C.previousElementSibling;
188
+ const I = (M, K) => {
189
+ let W = K === "next" ? M.nextElementSibling : M.previousElementSibling;
190
190
  for (; W; ) {
191
191
  const ae = W;
192
192
  try {
@@ -194,204 +194,204 @@ const pt = (e, t) => {
194
194
  return ae;
195
195
  } catch {
196
196
  }
197
- W = q === "next" ? W.nextElementSibling : W.previousElementSibling;
197
+ W = K === "next" ? W.nextElementSibling : W.previousElementSibling;
198
198
  }
199
199
  return null;
200
- }, b = i.code === "ArrowDown" ? M(d, "next") : M(d, "previous");
201
- b && (d.setAttribute("tabindex", "-1"), b.setAttribute("tabindex", "0"), b.focus());
200
+ }, S = i.code === "ArrowDown" ? I(d, "next") : I(d, "previous");
201
+ S && (d.setAttribute("tabindex", "-1"), S.setAttribute("tabindex", "0"), S.focus());
202
202
  return;
203
203
  }
204
204
  if (["ArrowLeft", "ArrowRight"].includes(i.code)) {
205
205
  i.preventDefault(), i.stopPropagation();
206
- const M = d.querySelectorAll(
207
- S
206
+ const I = d.querySelectorAll(
207
+ C
208
208
  );
209
- if (M.length === 0) return;
210
- let b = Array.from(M).findIndex(
211
- (C) => C === document.activeElement
209
+ if (I.length === 0) return;
210
+ let S = Array.from(I).findIndex(
211
+ (M) => M === document.activeElement
212
212
  );
213
- if (b === -1 && document.activeElement === d) {
214
- M[0].focus();
213
+ if (S === -1 && document.activeElement === d) {
214
+ I[0].focus();
215
215
  return;
216
216
  }
217
- i.code === "ArrowRight" ? b = b === M.length - 1 ? 0 : b + 1 : i.code === "ArrowLeft" && (b = b === 0 ? M.length - 1 : b - 1), M[b].focus();
217
+ i.code === "ArrowRight" ? S = S === I.length - 1 ? 0 : S + 1 : i.code === "ArrowLeft" && (S = S === 0 ? I.length - 1 : S - 1), I[S].focus();
218
218
  return;
219
219
  }
220
220
  }
221
221
  }
222
222
  }
223
- }, A = () => {
223
+ }, k = () => {
224
224
  B(() => {
225
225
  const i = e.value?.$el;
226
226
  if (!i || typeof i.closest != "function") return;
227
- const D = i.closest(".k-grid");
228
- D && D.classList.add("fk-grid");
227
+ const w = i.closest(".k-grid");
228
+ w && w.classList.add("fk-grid");
229
229
  });
230
- }, P = () => {
231
- if (!y)
230
+ }, x = () => {
231
+ if (!p)
232
232
  try {
233
233
  const i = () => {
234
234
  try {
235
- const g = Array.from(
235
+ const b = Array.from(
236
236
  e.value.$el.querySelectorAll(
237
237
  ".k-table-row[data-grid-row-index]"
238
238
  )
239
239
  );
240
- if (!g || g.length === 0 || g.filter(
241
- (C) => C.getAttribute("tabindex") === "0"
240
+ if (!b || b.length === 0 || b.filter(
241
+ (M) => M.getAttribute("tabindex") === "0"
242
242
  ).length === 1) return;
243
- const b = g.find(
244
- (C) => C === document.activeElement || C.contains(document.activeElement)
243
+ const S = b.find(
244
+ (M) => M === document.activeElement || M.contains(document.activeElement)
245
245
  );
246
- if (g.forEach((C) => C.setAttribute("tabindex", "-1")), b) {
247
- b.setAttribute("tabindex", "0");
246
+ if (b.forEach((M) => M.setAttribute("tabindex", "-1")), S) {
247
+ S.setAttribute("tabindex", "0");
248
248
  return;
249
249
  }
250
- g[0].setAttribute("tabindex", "0");
251
- } catch (g) {
252
- console.error("ensureSingleTabindex error:", g);
250
+ b[0].setAttribute("tabindex", "0");
251
+ } catch (b) {
252
+ console.error("ensureSingleTabindex error:", b);
253
253
  }
254
- }, D = Array.from(
254
+ }, w = Array.from(
255
255
  e.value.$el.querySelectorAll(
256
256
  ".k-table-row[data-grid-row-index]"
257
257
  )
258
258
  );
259
- D.length > 0 && D.forEach((g, M) => {
260
- g.setAttribute("tabindex", M === 0 ? "0" : "-1");
259
+ w.length > 0 && w.forEach((b, I) => {
260
+ b.setAttribute("tabindex", I === 0 ? "0" : "-1");
261
261
  });
262
262
  const d = e.value.$el.querySelector(".k-table-tbody");
263
- d && (y = new MutationObserver(() => {
263
+ d && (p = new MutationObserver(() => {
264
264
  i();
265
- }), y.observe(d, { childList: !0, subtree: !0 }));
265
+ }), p.observe(d, { childList: !0, subtree: !0 }));
266
266
  } catch (i) {
267
267
  console.error("Error setting up row navigation:", i);
268
268
  }
269
- }, L = () => {
269
+ }, V = () => {
270
270
  B(() => {
271
- const D = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
- D && D.forEach((d) => {
271
+ const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
+ w && w.forEach((d) => {
273
273
  d.setAttribute("role", "button"), d.addEventListener(
274
274
  "keydown",
275
275
  s
276
276
  );
277
- }), p(), j();
277
+ }), y(), _();
278
278
  });
279
279
  }, Y = () => {
280
- const D = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
- D && D.forEach((d) => {
280
+ const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
+ w && w.forEach((d) => {
282
282
  d.removeEventListener(
283
283
  "keydown",
284
284
  s
285
285
  );
286
- }), h && (h.disconnect(), h = null), y && (y.disconnect(), y = null), x.forEach((d) => d()), x.length = 0;
287
- }, j = () => {
286
+ }), f && (f.disconnect(), f = null), p && (p.disconnect(), p = null), A.forEach((d) => d()), A.length = 0;
287
+ }, _ = () => {
288
288
  document.querySelectorAll(
289
289
  ".k-grid-header .k-table-thead th"
290
- ).forEach((d, g) => {
290
+ ).forEach((d, b) => {
291
291
  if (d.dataset.featherKHeaderBound === "true")
292
292
  return;
293
- const M = d.querySelector(
293
+ const I = d.querySelector(
294
294
  ".k-grid-header-menu.k-grid-column-menu"
295
295
  );
296
- if (!M) return;
297
- const b = $();
298
- if (b && b[g]) {
299
- const a = b[g].field ?? "";
296
+ if (!I) return;
297
+ const S = $();
298
+ if (S && S[b]) {
299
+ const a = S[b].field ?? "";
300
300
  d.setAttribute("data-feather-k-field", a), d.setAttribute(
301
301
  "data-feather-k-filterable",
302
- b[g].filterable === !1 ? "false" : "true"
302
+ S[b].filterable === !1 ? "false" : "true"
303
303
  ), d.setAttribute(
304
304
  "data-feather-k-sortable",
305
- b[g].sortable === !1 ? "false" : "true"
305
+ S[b].sortable === !1 ? "false" : "true"
306
306
  );
307
307
  }
308
- const C = d.dataset.featherKFilterable !== "false", q = d.dataset.featherKSortable !== "false";
309
- M.setAttribute("tabindex", "-1"), C || q ? d.style.cursor = "pointer" : d.style.cursor = "default", C ? (d.setAttribute("tabindex", "0"), d.setAttribute("role", "button"), d.setAttribute("aria-haspopup", "menu")) : (d.setAttribute("tabindex", "0"), d.setAttribute("role", "columnheader"), d.removeAttribute("aria-haspopup"));
308
+ const M = d.dataset.featherKFilterable !== "false", K = d.dataset.featherKSortable !== "false";
309
+ I.setAttribute("tabindex", "-1"), M || K ? d.style.cursor = "pointer" : d.style.cursor = "default", M ? (d.setAttribute("tabindex", "0"), d.setAttribute("role", "button"), d.setAttribute("aria-haspopup", "menu")) : (d.setAttribute("tabindex", "0"), d.setAttribute("role", "columnheader"), d.removeAttribute("aria-haspopup"));
310
310
  const W = (a) => {
311
- a.target?.closest(".k-column-resizer") || (o.value = d, M.click());
311
+ a.target?.closest(".k-column-resizer") || (r.value = d, I.click());
312
312
  }, ae = (a) => {
313
- if (C)
314
- o.value = d, a.preventDefault(), a.stopPropagation(), W(a);
315
- else if (q) {
316
- o.value = d;
317
- const f = d.querySelector(".k-link");
318
- f && f.click();
313
+ if (M)
314
+ r.value = d, a.preventDefault(), a.stopPropagation(), W(a);
315
+ else if (K) {
316
+ r.value = d;
317
+ const m = d.querySelector(".k-link");
318
+ m && m.click();
319
319
  }
320
320
  };
321
- d.addEventListener("click", ae), x.push(() => {
321
+ d.addEventListener("click", ae), A.push(() => {
322
322
  d.removeEventListener("click", ae);
323
323
  });
324
324
  const se = (a) => {
325
- if ((w(a) || a.code === "Space") && (C || q)) {
326
- if (a.preventDefault(), a.stopPropagation(), o.value = d, o.value.focus(), C)
325
+ if ((D(a) || a.code === "Space") && (M || K)) {
326
+ if (a.preventDefault(), a.stopPropagation(), r.value = d, r.value.focus(), M)
327
327
  W(a);
328
- else if (q) {
329
- const f = d.querySelector(".k-link");
330
- f && f.click();
328
+ else if (K) {
329
+ const m = d.querySelector(".k-link");
330
+ m && m.click();
331
331
  }
332
332
  }
333
333
  };
334
- d.addEventListener("keydown", se, !0), x.push(() => {
334
+ d.addEventListener("keydown", se, !0), A.push(() => {
335
335
  d.removeEventListener("keydown", se, !0);
336
336
  }), d.dataset.featherKHeaderBound = "true";
337
337
  });
338
- const D = document.querySelector(".k-grid-header .k-table-thead");
339
- if (D && D.dataset.featherKHeaderBound !== "true") {
340
- const d = (g) => {
341
- const M = g.target.closest("th");
342
- M && (w(g) || g.code === "Space") && M.dataset.featherKFilterable === "false" && M.dataset.featherKSortable === "false" && (g.preventDefault(), g.stopImmediatePropagation());
338
+ const w = document.querySelector(".k-grid-header .k-table-thead");
339
+ if (w && w.dataset.featherKHeaderBound !== "true") {
340
+ const d = (b) => {
341
+ const I = b.target.closest("th");
342
+ I && (D(b) || b.code === "Space") && I.dataset.featherKFilterable === "false" && I.dataset.featherKSortable === "false" && (b.preventDefault(), b.stopImmediatePropagation());
343
343
  };
344
- D.addEventListener(
344
+ w.addEventListener(
345
345
  "keydown",
346
346
  d,
347
347
  !0
348
348
  // NOTE: capture phase
349
- ), x.push(() => {
350
- D.removeEventListener(
349
+ ), A.push(() => {
350
+ w.removeEventListener(
351
351
  "keydown",
352
352
  d,
353
353
  !0
354
354
  );
355
- }), D.dataset.featherKHeaderBound = "true";
355
+ }), w.dataset.featherKHeaderBound = "true";
356
356
  }
357
- }, Q = function(i, D) {
358
- const d = i?.event?.event.target, g = $();
359
- if (!d || !g) return;
360
- const M = d.classList.contains("k-grid-header-menu"), b = d.classList.contains("k-columnmenu-item"), C = g.find((q) => q.field === i?.event?.field)?.sortable && !0;
361
- if (!M) {
362
- if (b && !C) {
357
+ }, Q = function(i, w) {
358
+ const d = i?.event?.event.target, b = $();
359
+ if (!d || !b) return;
360
+ const I = d.classList.contains("k-grid-header-menu"), S = d.classList.contains("k-columnmenu-item"), M = b.find((K) => K.field === i?.event?.field)?.sortable && !0;
361
+ if (!I) {
362
+ if (S && !M) {
363
363
  i?.event?.sort?.filter(
364
364
  (W) => W.field !== i?.event?.field
365
365
  );
366
366
  return;
367
367
  }
368
- typeof D == "function" && B(() => {
369
- o.value && o.value.focus(), D(i), B(() => {
370
- j();
368
+ typeof w == "function" && B(() => {
369
+ r.value && r.value.focus(), w(i), B(() => {
370
+ _();
371
371
  });
372
372
  });
373
373
  }
374
374
  }, le = () => {
375
- if (!k)
375
+ if (!g)
376
376
  try {
377
- A(), P(), L(), k = !0;
377
+ k(), x(), V(), g = !0;
378
378
  } catch (i) {
379
379
  console.error("initA11y failed:", i), Y();
380
380
  }
381
381
  };
382
- return Le(() => {
382
+ return Pe(() => {
383
383
  Y();
384
384
  }), {
385
- activeFilterButton: o,
386
- handleGridKeyDown: m,
385
+ activeFilterButton: r,
386
+ handleGridKeyDown: h,
387
387
  handleSortChange: Q,
388
388
  initA11y: le
389
389
  };
390
- }, ze = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), He = (e) => !!e && typeof e == "object" && "field" in e, Pe = (e, t) => !e || typeof e != "object" ? !1 : ze(e) ? e.filters.some(
391
- (o) => Pe(o, t)
392
- ) : He(e) ? e.field === t : !1, mt = (e) => (t) => e.value?.filters && e.value.filters.some(
393
- (o) => Pe(o, t)
394
- ) ? "active" : "", Ze = [
390
+ }, Ne = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), Oe = (e) => !!e && typeof e == "object" && "field" in e, Fe = (e, t) => !e || typeof e != "object" ? !1 : Ne(e) ? e.filters.some(
391
+ (r) => Fe(r, t)
392
+ ) : Oe(e) ? e.field === t : !1, st = (e) => (t) => e.value?.filters && e.value.filters.some(
393
+ (r) => Fe(r, t)
394
+ ) ? "active" : "", Ue = [
395
395
  "button",
396
396
  "a",
397
397
  "input",
@@ -409,29 +409,29 @@ const pt = (e, t) => {
409
409
  ".k-hierarchy-cell",
410
410
  ".k-grid-header-menu",
411
411
  ".k-column-menu"
412
- ], vt = (e) => {
412
+ ], ut = (e) => {
413
413
  const {
414
414
  onRowAction: t,
415
- gridRef: o,
416
- dataItems: k,
417
- ignoreSelectors: h = [],
418
- shouldIgnoreTarget: y,
419
- enableKeyboardAction: x = !0
420
- } = e, S = [
421
- ...Ze,
422
- ...h
423
- ], E = (s, l) => {
415
+ gridRef: r,
416
+ dataItems: g,
417
+ ignoreSelectors: f = [],
418
+ shouldIgnoreTarget: p,
419
+ enableKeyboardAction: A = !0
420
+ } = e, C = [
421
+ ...Ue,
422
+ ...f
423
+ ], T = (s, l) => {
424
424
  if (!s) return !1;
425
- const p = S.join(",");
426
- return s.closest && s.closest(p) ? !0 : y && l ? y(s, l) : !1;
427
- }, F = (s) => {
425
+ const y = C.join(",");
426
+ return s.closest && s.closest(y) ? !0 : p && l ? p(s, l) : !1;
427
+ }, q = (s) => {
428
428
  if (typeof window > "u") return !1;
429
429
  const l = window.getSelection();
430
430
  if (!l || l.isCollapsed || !l.toString().trim())
431
431
  return !1;
432
432
  if (s && l.anchorNode && l.focusNode) {
433
- const p = s.closest(".k-table-row") || s.closest(".k-grid") || s, K = l.anchorNode.nodeType === Node.ELEMENT_NODE ? l.anchorNode : l.anchorNode.parentElement, m = l.focusNode.nodeType === Node.ELEMENT_NODE ? l.focusNode : l.focusNode.parentElement, A = !!(K && p.contains(K)), P = !!(m && p.contains(m));
434
- return A || P;
433
+ const y = s.closest(".k-table-row") || s.closest(".k-grid") || s, L = l.anchorNode.nodeType === Node.ELEMENT_NODE ? l.anchorNode : l.anchorNode.parentElement, h = l.focusNode.nodeType === Node.ELEMENT_NODE ? l.focusNode : l.focusNode.parentElement, k = !!(L && y.contains(L)), x = !!(h && y.contains(h));
434
+ return k || x;
435
435
  }
436
436
  return !0;
437
437
  };
@@ -440,10 +440,10 @@ const pt = (e, t) => {
440
440
  const l = s?.htmlEvent || s?.event || s?.nativeEvent || (s instanceof Event ? s : void 0);
441
441
  if (l && l.button !== void 0 && l.button !== 0)
442
442
  return;
443
- const p = l?.target || s?.target;
444
- if (p && E(p, l || s) || F(p))
443
+ const y = l?.target || s?.target;
444
+ if (y && T(y, l || s) || q(y))
445
445
  return;
446
- const K = {
446
+ const L = {
447
447
  dataItem: s.dataItem,
448
448
  rowIndex: s.rowIndex,
449
449
  field: s.field,
@@ -454,30 +454,30 @@ const pt = (e, t) => {
454
454
  metaKey: !!l?.metaKey,
455
455
  altKey: !!l?.altKey
456
456
  };
457
- t(s.dataItem, K);
457
+ t(s.dataItem, L);
458
458
  },
459
459
  handleRowKeyDown: (s, l) => {
460
- if (!x) return;
461
- const p = s.key || s.code;
462
- if (!(p === "Enter" || p === "NumpadEnter" || p === " " || p === "Space" || s.code === "Enter" || s.code === "NumpadEnter" || s.code === "Space")) return;
463
- const m = s.target;
464
- if (!m) return;
465
- const A = m.closest(
460
+ if (!A) return;
461
+ const y = s.key || s.code;
462
+ if (!(y === "Enter" || y === "NumpadEnter" || y === " " || y === "Space" || s.code === "Enter" || s.code === "NumpadEnter" || s.code === "Space")) return;
463
+ const h = s.target;
464
+ if (!h) return;
465
+ const k = h.closest(
466
466
  ".k-table-row[data-grid-row-index], .k-table-row"
467
467
  );
468
- if (!A || E(m, s))
468
+ if (!k || T(h, s))
469
469
  return;
470
470
  s.preventDefault(), s.stopPropagation();
471
- const P = A.getAttribute("data-grid-row-index"), L = P !== null ? parseInt(P, 10) : void 0;
471
+ const x = k.getAttribute("data-grid-row-index"), V = x !== null ? parseInt(x, 10) : void 0;
472
472
  let Y = l;
473
473
  if (Y === void 0) {
474
- const Q = (Array.isArray(k) ? k : k?.value) || o?.value?.props?.dataItems || o?.value?.dataItems;
475
- Q && L !== void 0 && L >= 0 && L < Q.length && (Y = Q[L]);
474
+ const Q = (Array.isArray(g) ? g : g?.value) || r?.value?.props?.dataItems || r?.value?.dataItems;
475
+ Q && V !== void 0 && V >= 0 && V < Q.length && (Y = Q[V]);
476
476
  }
477
477
  if (Y === void 0) return;
478
- const j = {
478
+ const _ = {
479
479
  dataItem: Y,
480
- rowIndex: L,
480
+ rowIndex: V,
481
481
  event: s,
482
482
  triggerType: "keyboard",
483
483
  ctrlKey: !!s.ctrlKey,
@@ -485,117 +485,117 @@ const pt = (e, t) => {
485
485
  metaKey: !!s.metaKey,
486
486
  altKey: !!s.altKey
487
487
  };
488
- t(Y, j);
488
+ t(Y, _);
489
489
  },
490
- isIgnoredTarget: E
490
+ isIgnoredTarget: T
491
491
  };
492
- }, Ye = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
492
+ }, Be = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
493
493
  const t = e.replace(/\D/g, "").slice(0, 9);
494
494
  return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
495
- }, We = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, _e = (e) => e <= 5 ? e : Math.min(e + 1, 10), Ge = (e) => {
496
- const t = U(Ce(e.initialValue ?? "")), o = U(!1), k = U(
497
- e.errorMessage?.trim() || Ye
498
- ), h = v(() => t.value.replace(/\D/g, "")), y = v(() => {
499
- const l = h.value.length;
495
+ }, ze = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, He = (e) => e <= 5 ? e : Math.min(e + 1, 10), Ze = (e) => {
496
+ const t = U(Ce(e.initialValue ?? "")), r = U(!1), g = U(
497
+ e.errorMessage?.trim() || Be
498
+ ), f = v(() => t.value.replace(/\D/g, "")), p = v(() => {
499
+ const l = f.value.length;
500
500
  return l === 5 || l === 9;
501
- }), x = v(() => o.value && !y.value), S = v(() => !o.value || y.value), E = v(() => o.value), F = (l, p) => {
502
- const K = _e(p);
501
+ }), A = v(() => r.value && !p.value), C = v(() => !r.value || p.value), T = v(() => r.value), q = (l, y) => {
502
+ const L = He(y);
503
503
  B(() => {
504
- l.isConnected && l.setSelectionRange(K, K);
504
+ l.isConnected && l.setSelectionRange(L, L);
505
505
  });
506
506
  };
507
507
  return {
508
508
  // writable state
509
509
  zipDisplay: t,
510
- submitted: o,
511
- errorMessage: k,
510
+ submitted: r,
511
+ errorMessage: g,
512
512
  // bindings
513
513
  wrapperClass: "fk-zip-textbox",
514
514
  // derived state
515
- zipRaw: h,
516
- isZipValid: y,
517
- showZipError: x,
518
- textBoxValid: S,
519
- textBoxValidate: E,
515
+ zipRaw: f,
516
+ isZipValid: p,
517
+ showZipError: A,
518
+ textBoxValid: C,
519
+ textBoxValidate: T,
520
520
  // actions
521
521
  handleZipInput: (...l) => {
522
- const p = l[0], m = p?.event?.target, A = p?.value, P = Array.isArray(A) ? A.join("") : String(A ?? ""), L = m?.selectionStart !== void 0 && m.selectionStart !== null ? We(
523
- m.value,
524
- m.selectionStart
525
- ) : P.replace(/\D/g, "").length;
526
- t.value = Ce(P), m && F(m, L);
522
+ const y = l[0], h = y?.event?.target, k = y?.value, x = Array.isArray(k) ? k.join("") : String(k ?? ""), V = h?.selectionStart !== void 0 && h.selectionStart !== null ? ze(
523
+ h.value,
524
+ h.selectionStart
525
+ ) : x.replace(/\D/g, "").length;
526
+ t.value = Ce(x), h && q(h, V);
527
527
  },
528
528
  submitAndValidate: (l) => {
529
- o.value = !0;
530
- const p = y.value;
531
- return !p && l?.focus && B(() => {
529
+ r.value = !0;
530
+ const y = p.value;
531
+ return !y && l?.focus && B(() => {
532
532
  document.getElementById(
533
533
  e.id
534
534
  )?.focus();
535
- }), p;
535
+ }), y;
536
536
  },
537
- buildPayload: () => ({ zip: h.value })
537
+ buildPayload: () => ({ zip: f.value })
538
538
  };
539
539
  };
540
- function je(e, t) {
541
- const o = U(!1);
542
- Fe(() => {
540
+ function Ye(e, t) {
541
+ const r = U(!1);
542
+ Te(() => {
543
543
  e.value?.setAttribute("aria-invalid", String(!t.isValid()));
544
544
  });
545
- function k(y) {
546
- const x = e.value ?? y.currentTarget, S = y.relatedTarget;
547
- (!x || !x.contains(S)) && (o.value = !0);
545
+ function g(p) {
546
+ const A = e.value ?? p.currentTarget, C = p.relatedTarget;
547
+ (!A || !A.contains(C)) && (r.value = !0);
548
548
  }
549
- function h() {
550
- o.value = !1;
549
+ function f() {
550
+ r.value = !1;
551
551
  }
552
- return { touched: o, onFocusout: k, reset: h };
552
+ return { touched: r, onFocusout: g, reset: f };
553
553
  }
554
- function Je(e, t) {
555
- const o = U(!1), k = U(!1), h = v(
556
- () => oe(t.submitted) || o.value
557
- ), y = v(() => !h.value || t.isValid()), x = je(e, {
558
- isValid: () => y.value
554
+ function We(e, t) {
555
+ const r = U(!1), g = U(!1), f = v(
556
+ () => oe(t.submitted) || r.value
557
+ ), p = v(() => !f.value || t.isValid()), A = Ye(e, {
558
+ isValid: () => p.value
559
559
  });
560
- function S(s) {
561
- return v(() => !h.value || oe(s));
560
+ function C(s) {
561
+ return v(() => !f.value || oe(s));
562
562
  }
563
- function E(s) {
563
+ function T(s) {
564
564
  return Object.fromEntries(
565
- Object.entries(s).map(([l, p]) => [
565
+ Object.entries(s).map(([l, y]) => [
566
566
  l,
567
- S(p)
567
+ C(y)
568
568
  ])
569
569
  );
570
570
  }
571
- function F(s) {
571
+ function q(s) {
572
572
  const l = oe(s);
573
573
  if (!l) return;
574
574
  l.querySelector(
575
575
  '.k-invalid input, .k-invalid[tabindex="0"]'
576
576
  )?.focus();
577
577
  }
578
- function w(s) {
579
- if (k.value) {
580
- k.value = !1;
578
+ function D(s) {
579
+ if (g.value) {
580
+ g.value = !1;
581
581
  return;
582
582
  }
583
- x.onFocusout(s), x.touched.value && (o.value = !0);
583
+ A.onFocusout(s), A.touched.value && (r.value = !0);
584
584
  }
585
585
  function $() {
586
- o.value = !1, k.value = !0, x.reset();
586
+ r.value = !1, g.value = !0, A.reset();
587
587
  }
588
588
  return {
589
- touched: o,
590
- fieldsetValidate: h,
591
- onFocusout: w,
589
+ touched: r,
590
+ fieldsetValidate: f,
591
+ onFocusout: D,
592
592
  reset: $,
593
- createFieldValidity: S,
594
- createFieldValidationsMap: E,
595
- focusFirstInvalidField: F
593
+ createFieldValidity: C,
594
+ createFieldValidationsMap: T,
595
+ focusFirstInvalidField: q
596
596
  };
597
597
  }
598
- const Xe = [
598
+ const Ge = [
599
599
  { label: "Alabama", value: "AL" },
600
600
  { label: "Alaska", value: "AK" },
601
601
  { label: "Arizona", value: "AZ" },
@@ -654,8 +654,8 @@ function De(e) {
654
654
  }
655
655
  return "";
656
656
  }
657
- function Qe() {
658
- const e = Ke({
657
+ function je() {
658
+ const e = Ve({
659
659
  address1: "",
660
660
  address2: "",
661
661
  city: "",
@@ -664,373 +664,348 @@ function Qe() {
664
664
  });
665
665
  return {
666
666
  formData: e,
667
- onAddress1Input: (...x) => {
668
- e.address1 = De(x[0]);
667
+ onAddress1Input: (...A) => {
668
+ e.address1 = De(A[0]);
669
669
  },
670
- onAddress2Input: (...x) => {
671
- e.address2 = De(x[0]);
670
+ onAddress2Input: (...A) => {
671
+ e.address2 = De(A[0]);
672
672
  },
673
- onCityInput: (...x) => {
674
- e.city = De(x[0]);
673
+ onCityInput: (...A) => {
674
+ e.city = De(A[0]);
675
675
  },
676
- onStateChange: (x) => {
677
- e.state = x.value;
676
+ onStateChange: (A) => {
677
+ e.state = A.value;
678
678
  },
679
679
  resetFormData: () => {
680
680
  e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
681
681
  }
682
682
  };
683
683
  }
684
- function et(e, t = "zip") {
685
- const o = Ge({ id: t }), {
686
- zipDisplay: k,
687
- zipRaw: h,
688
- isZipValid: y,
689
- wrapperClass: x,
690
- handleZipInput: S
691
- } = o;
692
- return ue(h, (F) => {
693
- e.zip = F;
684
+ function _e(e, t = "zip") {
685
+ const r = Ze({ id: t }), {
686
+ zipDisplay: g,
687
+ zipRaw: f,
688
+ isZipValid: p,
689
+ wrapperClass: A,
690
+ handleZipInput: C
691
+ } = r;
692
+ return ue(f, (q) => {
693
+ e.zip = q;
694
694
  }), {
695
- zipDisplay: k,
696
- isZipValid: y,
697
- zipWrapperClass: x,
698
- onZipInput: S,
695
+ zipDisplay: g,
696
+ isZipValid: p,
697
+ zipWrapperClass: A,
698
+ onZipInput: C,
699
699
  resetZip: () => {
700
- k.value = "", e.zip = "";
700
+ g.value = "", e.zip = "";
701
701
  }
702
702
  };
703
703
  }
704
- function tt(e) {
704
+ function Je(e) {
705
705
  const t = v(
706
706
  () => e.formData.address1.trim() !== ""
707
- ), o = v(() => e.formData.city.trim() !== ""), k = v(() => !!e.formData.state), h = v(() => oe(e.isZipValid)), y = v(
708
- () => t.value && o.value && k.value && h.value
707
+ ), r = v(() => e.formData.city.trim() !== ""), g = v(() => !!e.formData.state), f = v(() => oe(e.isZipValid)), p = v(
708
+ () => t.value && r.value && g.value && f.value
709
709
  );
710
710
  return {
711
711
  strictAddress1Valid: t,
712
- strictCityValid: o,
713
- strictStateValid: k,
714
- strictZipValid: h,
715
- strictAddressValid: y
712
+ strictCityValid: r,
713
+ strictStateValid: g,
714
+ strictZipValid: f,
715
+ strictAddressValid: p
716
716
  };
717
717
  }
718
- function nt(e) {
718
+ function Xe(e) {
719
719
  if (!e) return;
720
720
  e.querySelector(
721
721
  '.k-invalid input, .k-invalid[tabindex="0"]'
722
722
  )?.focus();
723
723
  }
724
- function at(e, t) {
725
- const o = e ?? t.currentTarget, k = t.relatedTarget;
726
- return !o || !o.contains(k);
724
+ function Qe(e, t) {
725
+ const r = e ?? t.currentTarget, g = t.relatedTarget;
726
+ return !r || !r.contains(g);
727
727
  }
728
- function gt(e) {
728
+ function ct(e) {
729
729
  const t = U(
730
730
  oe(e.fieldsetRef)
731
731
  );
732
- Fe(() => {
732
+ Te(() => {
733
733
  t.value = oe(e.fieldsetRef);
734
734
  });
735
- const o = U(!1), k = U(!1), h = v(() => oe(e.required) ?? !0), {
736
- formData: y,
737
- onAddress1Input: x,
738
- onAddress2Input: S,
739
- onCityInput: E,
740
- onStateChange: F,
741
- resetFormData: w
742
- } = Qe(), $ = `${e.addressId}-zip`, { zipDisplay: s, isZipValid: l, zipWrapperClass: p, onZipInput: K, resetZip: m } = et(y, $), {
743
- strictAddress1Valid: A,
744
- strictCityValid: P,
745
- strictStateValid: L,
735
+ const r = U(!1), g = U(!1), f = v(() => oe(e.required) ?? !0), {
736
+ formData: p,
737
+ onAddress1Input: A,
738
+ onAddress2Input: C,
739
+ onCityInput: T,
740
+ onStateChange: q,
741
+ resetFormData: D
742
+ } = je(), $ = `${e.addressId}-zip`, { zipDisplay: s, isZipValid: l, zipWrapperClass: y, onZipInput: L, resetZip: h } = _e(p, $), {
743
+ strictAddress1Valid: k,
744
+ strictCityValid: x,
745
+ strictStateValid: V,
746
746
  strictZipValid: Y,
747
- strictAddressValid: j
748
- } = tt({
749
- formData: y,
747
+ strictAddressValid: _
748
+ } = Je({
749
+ formData: p,
750
750
  isZipValid: l
751
- }), Q = Je(t, {
752
- submitted: o,
753
- isValid: () => j.value
754
- }), { touched: le, fieldsetValidate: i, onFocusout: D, reset: d } = Q, g = Q.createFieldValidationsMap({
755
- address1: A,
756
- city: P,
757
- state: L,
751
+ }), Q = We(t, {
752
+ submitted: r,
753
+ isValid: () => _.value
754
+ }), { touched: le, fieldsetValidate: i, onFocusout: w, reset: d } = Q, b = Q.createFieldValidationsMap({
755
+ address1: k,
756
+ city: x,
757
+ state: V,
758
758
  zip: Y,
759
- address: j
759
+ address: _
760
760
  }), {
761
- address1: M,
762
- city: b,
763
- state: C,
764
- zip: q,
761
+ address1: I,
762
+ city: S,
763
+ state: M,
764
+ zip: K,
765
765
  address: W
766
- } = g, ae = v(
767
- () => h.value ? i.value : !1
766
+ } = b, ae = v(
767
+ () => f.value ? i.value : !1
768
768
  ), se = v(
769
- () => h.value ? M.value : !0
769
+ () => f.value ? I.value : !0
770
770
  ), a = v(
771
- () => h.value ? b.value : !0
772
- ), f = v(
773
- () => h.value ? C.value : !0
771
+ () => f.value ? S.value : !0
772
+ ), m = v(
773
+ () => f.value ? M.value : !0
774
774
  ), R = v(
775
- () => h.value ? q.value : !0
775
+ () => f.value ? K.value : !0
776
776
  ), z = v(
777
- () => h.value ? W.value : !0
778
- ), H = { value: null, label: "State" }, _ = Xe.map(({ label: c, value: I }) => ({
777
+ () => f.value ? W.value : !0
778
+ ), H = { value: null, label: "State" }, G = Ge.map(({ label: c, value: E }) => ({
779
779
  label: c,
780
- value: I
780
+ value: E
781
781
  })), n = v(() => ({
782
- address1: y.address1.trim(),
783
- address2: y.address2.trim(),
784
- city: y.city.trim(),
785
- state: (y.state ?? "").trim().toUpperCase(),
786
- zip: y.zip.replace(/\D/g, "")
787
- })), u = v(() => y.address1.trim() === "" && y.address2.trim() === "" && y.city.trim() === "" && (y.state ?? "").trim() === "" && y.zip.replace(/\D/g, "") === ""), T = v(() => !u.value), N = v(() => !h.value && T.value && (!A.value || !P.value || !L.value)), G = v(() => {
788
- const c = y.zip.replace(/\D/g, "");
789
- return !h.value && T.value && c.length !== 5 && c.length !== 9;
790
- }), ee = v(() => !h.value && T.value && !j.value), O = v(() => !h.value && ee.value && (k.value || o.value));
782
+ address1: p.address1.trim(),
783
+ address2: p.address2.trim(),
784
+ city: p.city.trim(),
785
+ state: (p.state ?? "").trim().toUpperCase(),
786
+ zip: p.zip.replace(/\D/g, "")
787
+ })), u = v(() => p.address1.trim() === "" && p.address2.trim() === "" && p.city.trim() === "" && (p.state ?? "").trim() === "" && p.zip.replace(/\D/g, "") === ""), F = v(() => !u.value), N = v(() => !f.value && F.value && (!k.value || !x.value || !V.value)), j = v(() => {
788
+ const c = p.zip.replace(/\D/g, "");
789
+ return !f.value && F.value && c.length !== 5 && c.length !== 9;
790
+ }), ee = v(() => !f.value && F.value && !_.value), O = v(() => !f.value && ee.value && (g.value || r.value));
791
791
  return ue(n, () => {
792
- h.value || (k.value = !1);
793
- }), ue(h, (c) => {
794
- c || (o.value = !1, k.value = !1, d());
792
+ f.value || (g.value = !1);
793
+ }), ue(f, (c) => {
794
+ c || (r.value = !1, g.value = !1, d());
795
795
  }), {
796
- formData: y,
797
- submitted: o,
796
+ formData: p,
797
+ submitted: r,
798
798
  touched: le,
799
799
  addressValidate: ae,
800
800
  address1Valid: se,
801
801
  cityValid: a,
802
- stateValid: f,
802
+ stateValid: m,
803
803
  zipValid: R,
804
804
  addressValid: z,
805
805
  optionalFeedbackActive: O,
806
806
  optionalPartialInvalid: ee,
807
807
  optionalMissingRequiredFields: N,
808
- optionalZipInvalid: G,
808
+ optionalZipInvalid: j,
809
809
  stateDefaultItem: H,
810
- stateOptions: _,
810
+ stateOptions: G,
811
811
  zipDisplay: s,
812
- zipWrapperClass: p,
813
- onAddress1Input: x,
814
- onAddress2Input: S,
815
- onCityInput: E,
816
- onStateChange: F,
817
- onZipInput: K,
812
+ zipWrapperClass: y,
813
+ onAddress1Input: A,
814
+ onAddress2Input: C,
815
+ onCityInput: T,
816
+ onStateChange: q,
817
+ onZipInput: L,
818
818
  onFieldsetFocusout: (c) => {
819
- const I = at(t.value, c);
820
- D(c), !h.value && I && (k.value = !0);
819
+ const E = Qe(t.value, c);
820
+ w(c), !f.value && E && (g.value = !0);
821
821
  },
822
822
  normalizedPayload: n,
823
- validateForSubmit: async () => h.value ? (o.value = !0, j.value ? {
823
+ validateForSubmit: async () => f.value ? (r.value = !0, _.value ? {
824
824
  isValid: !0,
825
825
  payload: n.value
826
- } : (await B(), nt(t.value), { isValid: !1, payload: null })) : u.value || j.value ? (o.value = !1, {
826
+ } : (await B(), Xe(t.value), { isValid: !1, payload: null })) : u.value || _.value ? (r.value = !1, {
827
827
  isValid: !0,
828
828
  payload: n.value
829
- }) : (o.value = !0, { isValid: !1, payload: null }),
829
+ }) : (r.value = !0, { isValid: !1, payload: null }),
830
830
  reset: () => {
831
- o.value = !1, k.value = !1, d(), w(), m();
831
+ r.value = !1, g.value = !1, d(), D(), h();
832
832
  }
833
833
  };
834
834
  }
835
- function rt(e) {
836
- return qe() ? (Ne(e), !0) : !1;
837
- }
838
- const Re = typeof window < "u" && typeof document < "u";
835
+ const et = typeof window < "u" && typeof document < "u";
839
836
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
840
- const ot = Object.prototype.toString, lt = (e) => ot.call(e) === "[object Object]", ye = () => {
841
- }, it = /* @__PURE__ */ st();
842
- function st() {
843
- var e, t;
844
- return Re && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
845
- }
837
+ const tt = Object.prototype.toString, nt = (e) => tt.call(e) === "[object Object]", Se = () => {
838
+ };
846
839
  function Ee(e) {
847
840
  return Array.isArray(e) ? e : [e];
848
841
  }
849
- function ut(e, t, o) {
850
- return ue(
851
- e,
852
- t,
853
- {
854
- ...o,
855
- immediate: !0
856
- }
857
- );
842
+ function at(e, t, r) {
843
+ return ue(e, t, {
844
+ ...r,
845
+ immediate: !0
846
+ });
858
847
  }
859
- const $e = Re ? window : void 0;
860
- function be(e) {
848
+ const Re = et ? window : void 0;
849
+ function he(e) {
861
850
  var t;
862
- const o = oe(e);
863
- return (t = o?.$el) != null ? t : o;
851
+ const r = oe(e);
852
+ return (t = r?.$el) !== null && t !== void 0 ? t : r;
864
853
  }
865
854
  function Ie(...e) {
866
- const t = [], o = () => {
867
- t.forEach((S) => S()), t.length = 0;
868
- }, k = (S, E, F, w) => (S.addEventListener(E, F, w), () => S.removeEventListener(E, F, w)), h = v(() => {
869
- const S = Ee(oe(e[0])).filter((E) => E != null);
870
- return S.every((E) => typeof E != "string") ? S : void 0;
871
- }), y = ut(
872
- () => {
873
- var S, E;
874
- return [
875
- (E = (S = h.value) == null ? void 0 : S.map((F) => be(F))) != null ? E : [$e].filter((F) => F != null),
876
- Ee(oe(h.value ? e[1] : e[0])),
877
- Ee(Oe(h.value ? e[2] : e[1])),
878
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
879
- oe(h.value ? e[3] : e[2])
880
- ];
881
- },
882
- ([S, E, F, w]) => {
883
- if (o(), !S?.length || !E?.length || !F?.length)
884
- return;
885
- const $ = lt(w) ? { ...w } : w;
886
- t.push(
887
- ...S.flatMap(
888
- (s) => E.flatMap(
889
- (l) => F.map((p) => k(s, l, p, $))
890
- )
891
- )
892
- );
893
- },
894
- { flush: "post" }
895
- ), x = () => {
896
- y(), o();
897
- };
898
- return rt(o), x;
855
+ const t = (g, f, p, A) => (g.addEventListener(f, p, A), () => g.removeEventListener(f, p, A)), r = v(() => {
856
+ const g = Ee(oe(e[0])).filter((f) => f != null);
857
+ return g.every((f) => typeof f != "string") ? g : void 0;
858
+ });
859
+ return at(() => {
860
+ var g, f;
861
+ return [
862
+ (g = (f = r.value) === null || f === void 0 ? void 0 : f.map((p) => he(p))) !== null && g !== void 0 ? g : [Re].filter((p) => p != null),
863
+ Ee(oe(r.value ? e[1] : e[0])),
864
+ Ee(Le(r.value ? e[2] : e[1])),
865
+ oe(r.value ? e[3] : e[2])
866
+ ];
867
+ }, ([g, f, p, A], C, T) => {
868
+ if (!g?.length || !f?.length || !p?.length) return;
869
+ const q = nt(A) ? { ...A } : A, D = g.flatMap(($) => f.flatMap((s) => p.map((l) => t($, s, l, q))));
870
+ T(() => {
871
+ D.forEach(($) => $());
872
+ });
873
+ }, { flush: "post" });
899
874
  }
900
- let Te = !1;
901
- function Ve(e, t, o = {}) {
902
- const { window: k = $e, ignore: h = [], capture: y = !0, detectIframe: x = !1, controls: S = !1 } = o;
903
- if (!k)
904
- return S ? { stop: ye, cancel: ye, trigger: ye } : ye;
905
- if (it && !Te) {
906
- Te = !0;
907
- const m = { passive: !0 };
908
- Array.from(k.document.body.children).forEach((A) => A.addEventListener("click", ye, m)), k.document.documentElement.addEventListener("click", ye, m);
909
- }
910
- let E = !0;
911
- const F = (m) => oe(h).some((A) => {
912
- if (typeof A == "string")
913
- return Array.from(k.document.querySelectorAll(A)).some((P) => P === m.target || m.composedPath().includes(P));
875
+ function $e(e, t, r = {}) {
876
+ const { window: g = Re, ignore: f = [], capture: p = !0, detectIframe: A = !1, controls: C = !1 } = r;
877
+ if (!g) return C ? {
878
+ stop: Se,
879
+ cancel: Se,
880
+ trigger: Se
881
+ } : Se;
882
+ let T = !0;
883
+ const q = (h) => oe(f).some((k) => {
884
+ if (typeof k == "string") return Array.from(g.document.querySelectorAll(k)).some((x) => x === h.target || h.composedPath().includes(x));
914
885
  {
915
- const P = be(A);
916
- return P && (m.target === P || m.composedPath().includes(P));
886
+ const x = he(k);
887
+ return x && (h.target === x || h.composedPath().includes(x));
917
888
  }
918
889
  });
919
- function w(m) {
920
- const A = oe(m);
921
- return A && A.$.subTree.shapeFlag === 16;
890
+ function D(h) {
891
+ const k = oe(h);
892
+ return k && k.$.subTree.shapeFlag === 16;
922
893
  }
923
- function $(m, A) {
924
- const P = oe(m), L = P.$.subTree && P.$.subTree.children;
925
- return L == null || !Array.isArray(L) ? !1 : L.some((Y) => Y.el === A.target || A.composedPath().includes(Y.el));
894
+ function $(h, k) {
895
+ const x = oe(h), V = x.$.subTree && x.$.subTree.children;
896
+ return V == null || !Array.isArray(V) ? !1 : V.some((Y) => Y.el === k.target || k.composedPath().includes(Y.el));
926
897
  }
927
- const s = (m) => {
928
- const A = be(e);
929
- if (m.target != null && !(!(A instanceof Element) && w(e) && $(e, m)) && !(!A || A === m.target || m.composedPath().includes(A))) {
930
- if ("detail" in m && m.detail === 0 && (E = !F(m)), !E) {
931
- E = !0;
898
+ const s = (h) => {
899
+ const k = he(e);
900
+ if (h.target != null && !(!(k instanceof Element) && D(e) && $(e, h)) && !(!k || k === h.target || h.composedPath().includes(k))) {
901
+ if ("detail" in h && h.detail === 0 && (T = !q(h)), !T) {
902
+ T = !0;
932
903
  return;
933
904
  }
934
- t(m);
905
+ t(h);
935
906
  }
936
907
  };
937
908
  let l = !1;
938
- const p = [
939
- Ie(k, "click", (m) => {
909
+ const y = [
910
+ Ie(g, "click", (h) => {
940
911
  l || (l = !0, setTimeout(() => {
941
912
  l = !1;
942
- }, 0), s(m));
943
- }, { passive: !0, capture: y }),
944
- Ie(k, "pointerdown", (m) => {
945
- const A = be(e);
946
- E = !F(m) && !!(A && !m.composedPath().includes(A));
913
+ }, 0), s(h));
914
+ }, {
915
+ passive: !0,
916
+ capture: p
917
+ }),
918
+ Ie(g, "pointerdown", (h) => {
919
+ const k = he(e);
920
+ T = !q(h) && !!(k && !h.composedPath().includes(k));
947
921
  }, { passive: !0 }),
948
- x && Ie(k, "blur", (m) => {
922
+ A && Ie(g, "blur", (h) => {
949
923
  setTimeout(() => {
950
- var A;
951
- const P = be(e);
952
- ((A = k.document.activeElement) == null ? void 0 : A.tagName) === "IFRAME" && !P?.contains(k.document.activeElement) && t(m);
924
+ const k = he(e);
925
+ let x = g.document.activeElement;
926
+ for (; x?.shadowRoot; ) x = x.shadowRoot.activeElement;
927
+ x?.tagName === "IFRAME" && !k?.contains(g.document.activeElement) && t(h);
953
928
  }, 0);
954
929
  }, { passive: !0 })
955
- ].filter(Boolean), K = () => p.forEach((m) => m());
956
- return S ? {
957
- stop: K,
930
+ ].filter(Boolean), L = () => y.forEach((h) => h());
931
+ return C ? {
932
+ stop: L,
958
933
  cancel: () => {
959
- E = !1;
934
+ T = !1;
960
935
  },
961
- trigger: (m) => {
962
- E = !0, s(m), E = !1;
936
+ trigger: (h) => {
937
+ T = !0, s(h), T = !1;
963
938
  }
964
- } : K;
939
+ } : L;
965
940
  }
966
941
  const xe = (e) => {
967
942
  if (e instanceof HTMLElement) return e;
968
943
  const t = e?.$el;
969
944
  return t instanceof HTMLElement ? t : null;
970
- }, ct = (e) => e instanceof HTMLButtonElement || e.getAttribute("role") === "button" || e.hasAttribute("aria-haspopup"), yt = (e) => {
971
- const t = U(null), o = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", k = () => xe(e.triggerRef.value), h = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), y = () => {
972
- const l = h();
945
+ }, rt = (e) => e instanceof HTMLButtonElement || e.getAttribute("role") === "button" || e.hasAttribute("aria-haspopup"), dt = (e) => {
946
+ const t = U(null), r = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", g = () => xe(e.triggerRef.value), f = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), p = () => {
947
+ const l = f();
973
948
  if (l)
974
949
  return l.focus(), !0;
975
- const p = k();
976
- return p?.focus(), !!p;
977
- }, x = () => {
978
- xe(e.menuRef.value)?.querySelector(o)?.focus();
979
- }, S = (l) => {
950
+ const y = g();
951
+ return y?.focus(), !!y;
952
+ }, A = () => {
953
+ xe(e.menuRef.value)?.querySelector(r)?.focus();
954
+ }, C = (l) => {
980
955
  e.isOpen.value && (t.value = l, e.requestHide());
981
956
  };
982
- Ve(e.menuRef, () => S("outside-click"), {
957
+ $e(e.menuRef, () => C("outside-click"), {
983
958
  ignore: [e.triggerRef]
984
959
  }), e.manageAriaExpanded !== !1 && ue(
985
960
  [e.isOpen, e.triggerRef],
986
961
  ([l]) => {
987
- const p = k();
988
- !p || !ct(p) || p.setAttribute("aria-expanded", l ? "true" : "false");
962
+ const y = g();
963
+ !y || !rt(y) || y.setAttribute("aria-expanded", l ? "true" : "false");
989
964
  },
990
965
  { immediate: !0, flush: "post" }
991
966
  );
992
- const E = () => {
967
+ const T = () => {
993
968
  if (e.isOpen.value) {
994
- S("trigger-click");
969
+ C("trigger-click");
995
970
  return;
996
971
  }
997
- e.requestShow(), B(x);
972
+ e.requestShow(), B(A);
998
973
  };
999
974
  return {
1000
975
  /**
1001
976
  * Handles Kendo Menu selection: records keyboard or mouse modality,
1002
977
  * requests popup close, then runs the optional caller-owned action.
1003
978
  */
1004
- handleMenuSelect: (l, p) => {
1005
- S(
979
+ handleMenuSelect: (l, y) => {
980
+ C(
1006
981
  l.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
1007
- ), p?.(l);
982
+ ), y?.(l);
1008
983
  },
1009
984
  /**
1010
985
  * Toggles the action menu. When opening, focuses the first enabled Kendo
1011
986
  * Menu item after Vue renders the popup.
1012
987
  */
1013
- handleActionButtonClick: E,
988
+ handleActionButtonClick: T,
1014
989
  /**
1015
990
  * Handles trigger keyboard input: Enter and Space toggle the menu; Escape
1016
991
  * closes an open menu or focuses the configured target when already closed.
1017
992
  */
1018
993
  handleActionButtonKeydown: (l) => {
1019
994
  if (l.key === "Enter" || l.code === "Space") {
1020
- l.preventDefault(), E();
995
+ l.preventDefault(), T();
1021
996
  return;
1022
997
  }
1023
998
  if (l.key === "Escape") {
1024
999
  if (l.preventDefault(), l.stopPropagation(), e.isOpen.value) {
1025
- S("keyboard");
1000
+ C("keyboard");
1026
1001
  return;
1027
1002
  }
1028
- y();
1003
+ p();
1029
1004
  }
1030
1005
  },
1031
1006
  /** Closes the open menu through the keyboard path when Escape is pressed inside it. */
1032
1007
  handleActionMenuEscape: (l) => {
1033
- l.preventDefault(), l.stopPropagation(), S("keyboard");
1008
+ l.preventDefault(), l.stopPropagation(), C("keyboard");
1034
1009
  },
1035
1010
  /**
1036
1011
  * Restores focus after Kendo Popup closes: keyboard closes prefer the
@@ -1039,92 +1014,92 @@ const xe = (e) => {
1039
1014
  */
1040
1015
  handlePopupClose: () => {
1041
1016
  B(() => {
1042
- t.value === "keyboard" ? y() : t.value === "mouse-selection" && k()?.focus(), t.value = null;
1017
+ t.value === "keyboard" ? p() : t.value === "mouse-selection" && g()?.focus(), t.value = null;
1043
1018
  });
1044
1019
  }
1045
1020
  };
1046
1021
  };
1047
- function ht(e) {
1048
- const t = U(""), o = U(void 0), k = U(!!e.debug), h = U(e.dateFormat ?? "mm/dd/yyyy"), y = v(() => !!e.required), x = 1e3, S = U(!1), E = ["ArrowUp", "ArrowDown"], F = ["ArrowLeft", "ArrowRight"], w = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : w.value.length <= 10 ? "yyyy" : "mm", s = v(() => {
1022
+ function ft(e) {
1023
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(e.dateFormat ?? "mm/dd/yyyy"), p = v(() => !!e.required), A = 1e3, C = U(!1), T = ["ArrowUp", "ArrowDown"], q = ["ArrowLeft", "ArrowRight"], D = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : D.value.length <= 10 ? "yyyy" : "mm", s = v(() => {
1049
1024
  const a = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
1050
1025
  return parseInt(a).toString().padStart(2, "0");
1051
1026
  }), l = v(() => {
1052
1027
  const a = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
1053
1028
  return parseInt(a).toString().padStart(2, "0");
1054
- }), p = v(() => {
1029
+ }), y = v(() => {
1055
1030
  const a = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
1056
1031
  return parseInt(a).toString().padStart(4, "0");
1057
- }), K = (a) => {
1058
- if (w.value.length === 0) {
1032
+ }), L = (a) => {
1033
+ if (D.value.length === 0) {
1059
1034
  e.onChange({ value: null, event: a });
1060
1035
  return;
1061
1036
  }
1062
- if (w.value.length < 8) {
1037
+ if (D.value.length < 8) {
1063
1038
  e.onChange({ value: null, event: a });
1064
1039
  return;
1065
1040
  }
1066
- if ((t.value ?? "").length === 10 && w.value.length === 8) {
1067
- const [f, R, z] = t.value.split("/"), H = parseInt(f), _ = parseInt(R), n = parseInt(z);
1068
- if (j(n, H, _)) {
1069
- const u = L(n, H, _);
1070
- m(u) ? e.onChange({ value: u, event: a }) : e.onChange({ value: null, event: a });
1041
+ if ((t.value ?? "").length === 10 && D.value.length === 8) {
1042
+ const [m, R, z] = t.value.split("/"), H = parseInt(m), G = parseInt(R), n = parseInt(z);
1043
+ if (_(n, H, G)) {
1044
+ const u = V(n, H, G);
1045
+ h(u) ? e.onChange({ value: u, event: a }) : e.onChange({ value: null, event: a });
1071
1046
  } else
1072
1047
  e.onChange({ value: null, event: a });
1073
1048
  }
1074
- }, m = (a) => {
1075
- const f = e.min ?? void 0, R = e.max ?? void 0;
1076
- return !(f && a < f || R && a > R);
1077
- }, A = v(() => {
1078
- if ((t.value ?? "").length === 10 && w.value.length === 8) {
1079
- const [a, f, R] = (t.value ?? "").split("/"), z = parseInt(a), H = parseInt(f), _ = parseInt(R);
1080
- if (j(_, z, H))
1081
- return L(_, z, H);
1049
+ }, h = (a) => {
1050
+ const m = e.min ?? void 0, R = e.max ?? void 0;
1051
+ return !(m && a < m || R && a > R);
1052
+ }, k = v(() => {
1053
+ if ((t.value ?? "").length === 10 && D.value.length === 8) {
1054
+ const [a, m, R] = (t.value ?? "").split("/"), z = parseInt(a), H = parseInt(m), G = parseInt(R);
1055
+ if (_(G, z, H))
1056
+ return V(G, z, H);
1082
1057
  }
1083
1058
  return null;
1084
- }), P = v(() => (t.value ?? "").length === 10 && w.value.length === 8), L = (a, f, R) => {
1059
+ }), x = v(() => (t.value ?? "").length === 10 && D.value.length === 8), V = (a, m, R) => {
1085
1060
  const z = /* @__PURE__ */ new Date(0);
1086
- return z.setFullYear(a, f - 1, R), z.setHours(0, 0, 0, 0), z;
1087
- }, Y = (a, f) => L(a, f + 1, 0).getDate(), j = (a, f, R) => f >= 1 && f <= 12 && a >= x && R >= 1 && R <= Y(a, f), Q = (a) => {
1061
+ return z.setFullYear(a, m - 1, R), z.setHours(0, 0, 0, 0), z;
1062
+ }, Y = (a, m) => V(a, m + 1, 0).getDate(), _ = (a, m, R) => m >= 1 && m <= 12 && a >= A && R >= 1 && R <= Y(a, m), Q = (a) => {
1088
1063
  t.value = a.value;
1089
- const f = a.event?.target;
1090
- o.value = f?.selectionStart ?? 0, K(a);
1064
+ const m = a.event?.target;
1065
+ r.value = m?.selectionStart ?? 0, L(a);
1091
1066
  }, le = (a) => {
1092
- o.value = a.target.selectionStart ?? 0;
1093
- }, i = (a, f, R) => {
1094
- const z = f?.selectionStart ?? o.value ?? 0;
1095
- o.value = z;
1096
- let H = parseInt(s.value), _ = parseInt(l.value), n = parseInt(p.value);
1097
- if (!(w.value.length >= 8) || !j(n, H, _)) {
1067
+ r.value = a.target.selectionStart ?? 0;
1068
+ }, i = (a, m, R) => {
1069
+ const z = m?.selectionStart ?? r.value ?? 0;
1070
+ r.value = z;
1071
+ let H = parseInt(s.value), G = parseInt(l.value), n = parseInt(y.value);
1072
+ if (!(D.value.length >= 8) || !_(n, H, G)) {
1098
1073
  const Z = e.defaultValue ?? /* @__PURE__ */ new Date();
1099
- H = Z.getMonth() + 1, _ = Z.getDate(), n = Z.getFullYear(), t.value = `${String(H).padStart(2, "0")}/${String(_).padStart(
1074
+ H = Z.getMonth() + 1, G = Z.getDate(), n = Z.getFullYear(), t.value = `${String(H).padStart(2, "0")}/${String(G).padStart(
1100
1075
  2,
1101
1076
  "0"
1102
1077
  )}/${String(n)}`;
1103
- const ce = L(n, H, _);
1104
- e.onChange({ value: m(ce) ? ce : null, event: R }), b({ useRAF: !0 });
1078
+ const ce = V(n, H, G);
1079
+ e.onChange({ value: h(ce) ? ce : null, event: R }), S({ useRAF: !0 });
1105
1080
  return;
1106
1081
  }
1107
- const T = $(z);
1108
- if (T === "mm")
1082
+ const F = $(z);
1083
+ if (F === "mm")
1109
1084
  H = a === "ArrowUp" ? H < 12 ? H + 1 : 1 : H > 1 ? H - 1 : 12;
1110
- else if (T === "dd") {
1085
+ else if (F === "dd") {
1111
1086
  const Z = new Date(n, H, 0).getDate();
1112
- _ = a === "ArrowUp" ? _ < Z ? _ + 1 : 1 : _ > 1 ? _ - 1 : Z;
1113
- } else T === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
1114
- t.value = `${String(H).padStart(2, "0")}/${String(_).padStart(
1087
+ G = a === "ArrowUp" ? G < Z ? G + 1 : 1 : G > 1 ? G - 1 : Z;
1088
+ } else F === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
1089
+ t.value = `${String(H).padStart(2, "0")}/${String(G).padStart(
1115
1090
  2,
1116
1091
  "0"
1117
1092
  )}/${String(n)}`;
1118
- const [N, G, ee] = t.value.split("/"), O = L(
1093
+ const [N, j, ee] = t.value.split("/"), O = V(
1119
1094
  parseInt(ee),
1120
1095
  parseInt(N),
1121
- parseInt(G)
1096
+ parseInt(j)
1122
1097
  );
1123
1098
  O.toString() !== "Invalid Date" && parseInt(ee) >= 1e3 ? e.onChange({
1124
- value: m(O) ? O : null,
1099
+ value: h(O) ? O : null,
1125
1100
  event: R
1126
- }) : e.onChange({ value: null, event: R }), b({ useRAF: !0 });
1127
- }, D = (a) => {
1101
+ }) : e.onChange({ value: null, event: R }), S({ useRAF: !0 });
1102
+ }, w = (a) => {
1128
1103
  if (a.code === "Space" || a.key === " ") {
1129
1104
  a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
1130
1105
  return;
@@ -1133,38 +1108,38 @@ function ht(e) {
1133
1108
  a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
1134
1109
  return;
1135
1110
  }
1136
- if (E.includes(a.key)) {
1111
+ if (T.includes(a.key)) {
1137
1112
  if (a.altKey) return;
1138
1113
  a.preventDefault(), a.stopPropagation();
1139
- const f = a.target;
1140
- i(a.key, f, a);
1114
+ const m = a.target;
1115
+ i(a.key, m, a);
1141
1116
  return;
1142
1117
  }
1143
1118
  }, d = (a) => {
1144
1119
  a.preventDefault();
1145
- const f = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1146
- i(f, a.target, a);
1147
- }, g = (a) => {
1148
- const f = a.target;
1149
- if (F.includes(a.key)) {
1150
- o.value = f?.selectionStart ?? 0;
1120
+ const m = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1121
+ i(m, a.target, a);
1122
+ }, b = (a) => {
1123
+ const m = a.target;
1124
+ if (q.includes(a.key)) {
1125
+ r.value = m?.selectionStart ?? 0;
1151
1126
  return;
1152
1127
  }
1153
- if (E.includes(a.key)) {
1128
+ if (T.includes(a.key)) {
1154
1129
  if (a.altKey) return;
1155
- o.value = f?.selectionStart ?? 0;
1130
+ r.value = m?.selectionStart ?? 0;
1156
1131
  }
1157
- }, M = (a) => {
1158
- S.value = !0, y.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && w.value.length === 0 && (e.externalValue.value = "");
1159
- const f = a.target;
1160
- f && (o.value = f.selectionStart ?? 0);
1161
- }, b = (a) => {
1162
- const f = () => {
1132
+ }, I = (a) => {
1133
+ C.value = !0, p.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && D.value.length === 0 && (e.externalValue.value = "");
1134
+ const m = a.target;
1135
+ m && (r.value = m.selectionStart ?? 0);
1136
+ }, S = (a) => {
1137
+ const m = () => {
1163
1138
  const R = document.getElementById(
1164
1139
  e.id
1165
1140
  );
1166
1141
  if (!R) return;
1167
- const z = a?.pos ?? o.value ?? R.value.length;
1142
+ const z = a?.pos ?? r.value ?? R.value.length;
1168
1143
  try {
1169
1144
  R.focus(), R.setSelectionRange(z, z);
1170
1145
  } catch {
@@ -1172,33 +1147,33 @@ function ht(e) {
1172
1147
  };
1173
1148
  B(() => {
1174
1149
  if (a?.delay && a.delay > 0) {
1175
- setTimeout(f, a.delay);
1150
+ setTimeout(m, a.delay);
1176
1151
  return;
1177
1152
  }
1178
1153
  if (a?.useRAF) {
1179
- requestAnimationFrame(f);
1154
+ requestAnimationFrame(m);
1180
1155
  return;
1181
1156
  }
1182
- f();
1157
+ m();
1183
1158
  });
1184
1159
  };
1185
1160
  e.externalValue && ue(
1186
1161
  e.externalValue,
1187
1162
  (a) => {
1188
1163
  if (a) {
1189
- const f = new Date(a);
1190
- if (f.toString() !== "Invalid Date") {
1191
- const R = (f.getMonth() + 1).toString().padStart(2, "0"), z = f.getDate().toString().padStart(2, "0"), H = f.getFullYear().toString();
1192
- t.value = `${R}/${z}/${H}`, b({ delay: 50 });
1164
+ const m = new Date(a);
1165
+ if (m.toString() !== "Invalid Date") {
1166
+ const R = (m.getMonth() + 1).toString().padStart(2, "0"), z = m.getDate().toString().padStart(2, "0"), H = m.getFullYear().toString();
1167
+ t.value = `${R}/${z}/${H}`, S({ delay: 50 });
1193
1168
  return;
1194
1169
  }
1195
1170
  }
1196
1171
  },
1197
1172
  { immediate: !0 }
1198
1173
  );
1199
- const C = v(() => [
1200
- ["Date", `${s.value} / ${l.value} / ${p.value}`],
1201
- ["Digits only", w.value],
1174
+ const M = v(() => [
1175
+ ["Date", `${s.value} / ${l.value} / ${y.value}`],
1176
+ ["Digits only", D.value],
1202
1177
  [
1203
1178
  "min",
1204
1179
  e.min?.toLocaleDateString("en-US", {
@@ -1215,34 +1190,34 @@ function ht(e) {
1215
1190
  day: "2-digit"
1216
1191
  }) ?? null
1217
1192
  ]
1218
- ]), q = v(() => {
1219
- if (!y.value) {
1220
- if (!P.value) return !0;
1221
- const f = A.value;
1222
- return f ? m(f) : !1;
1193
+ ]), K = v(() => {
1194
+ if (!p.value) {
1195
+ if (!x.value) return !0;
1196
+ const m = k.value;
1197
+ return m ? h(m) : !1;
1223
1198
  }
1224
- if (!S.value) return !0;
1225
- const a = A.value;
1226
- return !P.value || !a ? !1 : m(a);
1199
+ if (!C.value) return !0;
1200
+ const a = k.value;
1201
+ return !x.value || !a ? !1 : h(a);
1227
1202
  }), W = v(() => {
1228
- if (!y.value) {
1229
- if (!P.value) return;
1230
- const f = A.value;
1231
- return f ? m(f) ? "valid" : "out-of-bounds" : "invalid-date";
1203
+ if (!p.value) {
1204
+ if (!x.value) return;
1205
+ const m = k.value;
1206
+ return m ? h(m) ? "valid" : "out-of-bounds" : "invalid-date";
1232
1207
  }
1233
- if (!S.value) return;
1234
- if (w.value.length === 0 || !P.value)
1208
+ if (!C.value) return;
1209
+ if (D.value.length === 0 || !x.value)
1235
1210
  return "incomplete";
1236
- const a = A.value;
1237
- return a ? m(a) ? "valid" : "out-of-bounds" : "invalid-date";
1211
+ const a = k.value;
1212
+ return a ? h(a) ? "valid" : "out-of-bounds" : "invalid-date";
1238
1213
  }), ae = v(() => {
1239
1214
  const a = W.value;
1240
1215
  if (!a || a === "valid") return "";
1241
1216
  if (a === "incomplete")
1242
1217
  return "Required";
1243
1218
  if (a === "invalid-date")
1244
- return `Must be in ${h.value} format.`;
1245
- const f = e.min ? e.min.toLocaleDateString("en-US", {
1219
+ return `Must be in ${f.value} format.`;
1220
+ const m = e.min ? e.min.toLocaleDateString("en-US", {
1246
1221
  year: "numeric",
1247
1222
  month: "2-digit",
1248
1223
  day: "2-digit"
@@ -1252,8 +1227,8 @@ function ht(e) {
1252
1227
  day: "2-digit"
1253
1228
  }) : null;
1254
1229
  if (a === "out-of-bounds") {
1255
- if (f && R) return `Must be between ${f} and ${R}.`;
1256
- if (f) return `Must be on or after ${f}.`;
1230
+ if (m && R) return `Must be between ${m} and ${R}.`;
1231
+ if (m) return `Must be on or after ${m}.`;
1257
1232
  if (R) return `Must be on or before ${R}.`;
1258
1233
  }
1259
1234
  return "";
@@ -1266,12 +1241,12 @@ function ht(e) {
1266
1241
  console.warn(`ID (#${e.id}) not found for styling.`);
1267
1242
  return;
1268
1243
  }
1269
- const f = a.closest(".k-datepicker");
1270
- if (!f) {
1244
+ const m = a.closest(".k-datepicker");
1245
+ if (!m) {
1271
1246
  console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
1272
1247
  return;
1273
1248
  }
1274
- const R = f.parentElement;
1249
+ const R = m.parentElement;
1275
1250
  if (R) {
1276
1251
  if (R.classList.contains("fk-datepicker"))
1277
1252
  return;
@@ -1286,64 +1261,64 @@ function ht(e) {
1286
1261
  se();
1287
1262
  }), {
1288
1263
  raw: t,
1289
- cursorPos: o,
1290
- debugEnabled: k,
1291
- debugLines: C,
1292
- placeholder: h,
1293
- isValid: q,
1264
+ cursorPos: r,
1265
+ debugEnabled: g,
1266
+ debugLines: M,
1267
+ placeholder: f,
1268
+ isValid: K,
1294
1269
  reason: X(W),
1295
1270
  validationMessage: ae,
1296
- digitsOnly: w,
1271
+ digitsOnly: D,
1297
1272
  month: X(s),
1298
1273
  day: X(l),
1299
- year: X(p),
1274
+ year: X(y),
1300
1275
  datePart: $,
1301
1276
  handleChange: Q,
1302
- handleKeyDown: D,
1277
+ handleKeyDown: w,
1303
1278
  handleWheel: d,
1304
- handleKeyUp: g,
1279
+ handleKeyUp: b,
1305
1280
  handleClick: le,
1306
- handleBlur: M,
1281
+ handleBlur: I,
1307
1282
  // Expose so consumers can re-run styling when needed
1308
1283
  initStyling: se
1309
1284
  };
1310
1285
  }
1311
- function bt(e) {
1312
- const t = U(""), o = U(void 0), k = U(!!e.debug), h = U(!1), y = 1440 * 60 * 1e3, x = 365 * y, S = /* @__PURE__ */ new Date(), E = new Date(S.getTime() - x), F = new Date(S.getTime() + x);
1313
- e.min = e.min ?? E, e.max = e.max ?? F;
1314
- const w = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (r, c) => new Date(r, c, 0).getDate(), s = (r, c, I) => c >= 1 && c <= 12 && r >= 1e3 && I >= 1 && I <= $(r, c), l = (r) => Date.UTC(r.getFullYear(), r.getMonth(), r.getDate()), p = (r) => {
1315
- if (!r) return null;
1316
- const c = e.min ?? new Date(Date.now() - 90 * y), I = e.max ?? /* @__PURE__ */ new Date(), V = l(r);
1317
- return V < l(c) || V > l(I) ? null : r;
1318
- }, K = (r, c) => e.allowReverse ?? !1 ? !0 : r <= c, m = v(() => (t.value?.length ?? 0) >= 23 && w.value.length >= 16), A = (r) => {
1319
- if ((r ?? "").length < 23 || w.value.length < 16)
1286
+ function pt(e) {
1287
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(!1), p = 1440 * 60 * 1e3, A = 365 * p, C = /* @__PURE__ */ new Date(), T = new Date(C.getTime() - A), q = new Date(C.getTime() + A);
1288
+ e.min = e.min ?? T, e.max = e.max ?? q;
1289
+ const D = v(() => (t.value ?? "").replace(/\D/g, "")), $ = (o, c) => new Date(o, c, 0).getDate(), s = (o, c, E) => c >= 1 && c <= 12 && o >= 1e3 && E >= 1 && E <= $(o, c), l = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), y = (o) => {
1290
+ if (!o) return null;
1291
+ const c = e.min ?? new Date(Date.now() - 90 * p), E = e.max ?? /* @__PURE__ */ new Date(), P = l(o);
1292
+ return P < l(c) || P > l(E) ? null : o;
1293
+ }, L = (o, c) => e.allowReverse ?? !1 ? !0 : o <= c, h = v(() => (t.value?.length ?? 0) >= 23 && D.value.length >= 16), k = (o) => {
1294
+ if ((o ?? "").length < 23 || D.value.length < 16)
1320
1295
  return { start: null, end: null };
1321
- const c = r.substring(0, 10), I = r.substring(13, 23), [V, te, ne] = c.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = I.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ne, V - 1, te), he = new Date(ve, fe - 1, me), we = s(ne, V, te) && ge.toString() !== "Invalid Date", ke = s(ve, fe, me) && he.toString() !== "Invalid Date";
1322
- return { start: we ? ge : null, end: ke ? he : null };
1323
- }, P = e.externalValid ?? U(!0), L = v(() => A(t.value)), Y = v(() => {
1324
- const r = p(L.value.start), c = p(L.value.end);
1325
- return { start: r, end: c };
1326
- }), j = v(() => {
1327
- if (!m.value) return;
1328
- const r = Y.value.start, c = Y.value.end;
1329
- if (!r || !c) return;
1330
- const I = Math.abs(l(c) - l(r));
1331
- return Math.round(I / 864e5 + 1);
1296
+ const c = o.substring(0, 10), E = o.substring(13, 23), [P, te, ne] = c.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = E.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ne, P - 1, te), ye = new Date(ve, fe - 1, me), ke = s(ne, P, te) && ge.toString() !== "Invalid Date", we = s(ve, fe, me) && ye.toString() !== "Invalid Date";
1297
+ return { start: ke ? ge : null, end: we ? ye : null };
1298
+ }, x = e.externalValid ?? U(!0), V = v(() => k(t.value)), Y = v(() => {
1299
+ const o = y(V.value.start), c = y(V.value.end);
1300
+ return { start: o, end: c };
1301
+ }), _ = v(() => {
1302
+ if (!h.value) return;
1303
+ const o = Y.value.start, c = Y.value.end;
1304
+ if (!o || !c) return;
1305
+ const E = Math.abs(l(c) - l(o));
1306
+ return Math.round(E / 864e5 + 1);
1332
1307
  }), Q = U(!1), le = v(() => {
1333
1308
  if (!Q.value) return;
1334
- const { start: r, end: c } = L.value;
1335
- if (!m.value) return "incomplete";
1336
- if (!r || !c) return "invalid-date";
1309
+ const { start: o, end: c } = V.value;
1310
+ if (!h.value) return "incomplete";
1311
+ if (!o || !c) return "invalid-date";
1337
1312
  if (!Y.value.start || !Y.value.end) return "out-of-bounds";
1338
- const I = Y.value.start, V = Y.value.end;
1339
- return K(I, V) ? typeof e.maxSpanDays == "number" && j.value !== void 0 && j.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1313
+ const E = Y.value.start, P = Y.value.end;
1314
+ return L(E, P) ? typeof e.maxSpanDays == "number" && _.value !== void 0 && _.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1340
1315
  }), i = v(() => {
1341
- const r = le.value;
1342
- return r === void 0 || r === "valid";
1343
- }), D = v(() => {
1344
- const { min: r, max: c } = e, I = le.value;
1345
- if (!I) return "";
1346
- switch (I) {
1316
+ const o = le.value;
1317
+ return o === void 0 || o === "valid";
1318
+ }), w = v(() => {
1319
+ const { min: o, max: c } = e, E = le.value;
1320
+ if (!E) return "";
1321
+ switch (E) {
1347
1322
  case "incomplete":
1348
1323
  return "Required";
1349
1324
  case "invalid-date":
@@ -1351,118 +1326,118 @@ function bt(e) {
1351
1326
  case "reversed-range":
1352
1327
  return "End Date must be on or after Start Date.";
1353
1328
  case "out-of-bounds":
1354
- return r && c ? `Dates must be between ${b(r)} and ${b(c)}.` : "Dates must be within the allowed range.";
1329
+ return o && c ? `Dates must be between ${S(o)} and ${S(c)}.` : "Dates must be within the allowed range.";
1355
1330
  case "span-exceeds-limit":
1356
1331
  return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
1357
1332
  default:
1358
1333
  return "";
1359
1334
  }
1360
- }), d = ["ArrowUp", "ArrowDown"], g = ["ArrowLeft", "ArrowRight"], M = (r, c) => String(r).padStart(c, "0"), b = (r) => `${M(r.getMonth() + 1, 2)}/${M(r.getDate(), 2)}/${M(
1361
- r.getFullYear(),
1335
+ }), d = ["ArrowUp", "ArrowDown"], b = ["ArrowLeft", "ArrowRight"], I = (o, c) => String(o).padStart(c, "0"), S = (o) => `${I(o.getMonth() + 1, 2)}/${I(o.getDate(), 2)}/${I(
1336
+ o.getFullYear(),
1362
1337
  4
1363
- )}`, C = (r) => r <= 2 ? { side: "start", part: "mm" } : r <= 5 ? { side: "start", part: (r <= 3, "dd") } : r <= 11 ? { side: "start", part: "yyyy" } : r <= 15 ? { side: "end", part: "mm" } : r <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, q = (r, c, I) => {
1364
- const V = c?.selectionStart ?? o.value ?? 0;
1365
- o.value = V;
1366
- const { start: te, end: ne } = A(t.value);
1338
+ )}`, M = (o) => o <= 2 ? { side: "start", part: "mm" } : o <= 5 ? { side: "start", part: (o <= 3, "dd") } : o <= 11 ? { side: "start", part: "yyyy" } : o <= 15 ? { side: "end", part: "mm" } : o <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, K = (o, c, E) => {
1339
+ const P = c?.selectionStart ?? r.value ?? 0;
1340
+ r.value = P;
1341
+ const { start: te, end: ne } = k(t.value);
1367
1342
  if (!te && !ne) {
1368
- const J = /* @__PURE__ */ new Date(), de = b(J);
1369
- t.value = `${de} - ${de}`, e.onChange({ value: { start: J, end: J }, event: I }), B(() => {
1343
+ const J = /* @__PURE__ */ new Date(), de = S(J);
1344
+ t.value = `${de} - ${de}`, e.onChange({ value: { start: J, end: J }, event: E }), B(() => {
1370
1345
  requestAnimationFrame(() => {
1371
1346
  const re = document.getElementById(
1372
1347
  e.id
1373
- ), ie = o.value ?? 0;
1348
+ ), ie = r.value ?? 0;
1374
1349
  re && (re.focus(), re.setSelectionRange(ie, ie));
1375
1350
  });
1376
1351
  });
1377
1352
  return;
1378
1353
  }
1379
- const fe = /* @__PURE__ */ new Date(), me = C(V);
1354
+ const fe = /* @__PURE__ */ new Date(), me = M(P);
1380
1355
  let ve = te ? new Date(te) : new Date(fe), ge = ne ? new Date(ne) : new Date(fe);
1381
- const he = (J, de) => {
1356
+ const ye = (J, de) => {
1382
1357
  if (de === "mm") {
1383
- const re = J.getMonth() + 1, ie = r === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
1358
+ const re = J.getMonth() + 1, ie = o === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
1384
1359
  J.setMonth(ie - 1);
1385
- const Se = $(J.getFullYear(), ie);
1386
- J.getDate() > Se && J.setDate(Se);
1360
+ const be = $(J.getFullYear(), ie);
1361
+ J.getDate() > be && J.setDate(be);
1387
1362
  } else if (de === "dd") {
1388
- const re = $(J.getFullYear(), J.getMonth() + 1), ie = J.getDate(), Se = r === "ArrowUp" ? ie < re ? ie + 1 : 1 : ie > 1 ? ie - 1 : re;
1389
- J.setDate(Se);
1363
+ const re = $(J.getFullYear(), J.getMonth() + 1), ie = J.getDate(), be = o === "ArrowUp" ? ie < re ? ie + 1 : 1 : ie > 1 ? ie - 1 : re;
1364
+ J.setDate(be);
1390
1365
  } else if (de === "yyyy") {
1391
1366
  const re = J.getFullYear();
1392
- J.setFullYear(r === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
1367
+ J.setFullYear(o === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
1393
1368
  const ie = $(J.getFullYear(), J.getMonth() + 1);
1394
1369
  J.getDate() > ie && J.setDate(ie);
1395
1370
  }
1396
1371
  };
1397
- me.side === "start" ? he(ve, me.part) : he(ge, me.part);
1398
- const we = b(ve), ke = b(ge);
1399
- t.value = `${we} - ${ke}`;
1400
- const pe = p(ve), Ae = p(ge);
1401
- pe && Ae && K(pe, Ae) ? e.onChange({ value: { start: pe, end: Ae }, event: I }) : e.onChange({ value: null, event: I }), B(() => {
1372
+ me.side === "start" ? ye(ve, me.part) : ye(ge, me.part);
1373
+ const ke = S(ve), we = S(ge);
1374
+ t.value = `${ke} - ${we}`;
1375
+ const pe = y(ve), Ae = y(ge);
1376
+ pe && Ae && L(pe, Ae) ? e.onChange({ value: { start: pe, end: Ae }, event: E }) : e.onChange({ value: null, event: E }), B(() => {
1402
1377
  requestAnimationFrame(() => {
1403
1378
  const J = document.getElementById(
1404
1379
  e.id
1405
- ), de = o.value ?? 0;
1380
+ ), de = r.value ?? 0;
1406
1381
  J && (J.focus(), J.setSelectionRange(de, de));
1407
1382
  });
1408
1383
  });
1409
- }, W = (r) => {
1410
- const { start: c, end: I } = A(t.value);
1411
- if (!c || !I) {
1412
- e.onChange({ value: null, event: r });
1384
+ }, W = (o) => {
1385
+ const { start: c, end: E } = k(t.value);
1386
+ if (!c || !E) {
1387
+ e.onChange({ value: null, event: o });
1413
1388
  return;
1414
1389
  }
1415
- const V = p(c), te = p(I);
1416
- if (!V || !te) {
1417
- e.onChange({ value: null, event: r });
1390
+ const P = y(c), te = y(E);
1391
+ if (!P || !te) {
1392
+ e.onChange({ value: null, event: o });
1418
1393
  return;
1419
1394
  }
1420
- if (!K(V, te)) {
1421
- e.onChange({ value: null, event: r });
1395
+ if (!L(P, te)) {
1396
+ e.onChange({ value: null, event: o });
1422
1397
  return;
1423
1398
  }
1424
- e.onChange({ value: { start: V, end: te }, event: r });
1425
- }, ae = (r) => {
1426
- const c = r.value ?? "", I = r.event;
1427
- if (!c && I && I.type === "click") {
1428
- _(I);
1399
+ e.onChange({ value: { start: P, end: te }, event: o });
1400
+ }, ae = (o) => {
1401
+ const c = o.value ?? "", E = o.event;
1402
+ if (!c && E && E.type === "click") {
1403
+ G(E);
1429
1404
  return;
1430
1405
  }
1431
1406
  t.value = c;
1432
- const V = I?.target;
1433
- o.value = V?.selectionStart ?? 0, W(r);
1434
- }, se = (r) => {
1435
- o.value = r.target.selectionStart ?? 0;
1436
- }, a = (r) => {
1437
- if (r.code === "Space" || r.key === " ") {
1438
- r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
1407
+ const P = E?.target;
1408
+ r.value = P?.selectionStart ?? 0, W(o);
1409
+ }, se = (o) => {
1410
+ r.value = o.target.selectionStart ?? 0;
1411
+ }, a = (o) => {
1412
+ if (o.code === "Space" || o.key === " ") {
1413
+ o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1439
1414
  return;
1440
1415
  }
1441
- if (r.key === "ArrowDown" && r.altKey) {
1442
- r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
1416
+ if (o.key === "ArrowDown" && o.altKey) {
1417
+ o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1443
1418
  return;
1444
1419
  }
1445
- if (d.includes(r.key)) {
1446
- r.preventDefault(), r.stopPropagation();
1447
- const c = r.target;
1448
- q(r.key, c, r);
1420
+ if (d.includes(o.key)) {
1421
+ o.preventDefault(), o.stopPropagation();
1422
+ const c = o.target;
1423
+ K(o.key, c, o);
1449
1424
  return;
1450
1425
  }
1451
- }, f = (r) => {
1452
- r.preventDefault();
1453
- const c = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1454
- q(c, r.target, r);
1455
- }, R = (r) => {
1456
- if (g.includes(r.key) || d.includes(r.key)) {
1457
- const c = r.target;
1458
- o.value = c?.selectionStart ?? 0;
1426
+ }, m = (o) => {
1427
+ o.preventDefault();
1428
+ const c = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1429
+ K(c, o.target, o);
1430
+ }, R = (o) => {
1431
+ if (b.includes(o.key) || d.includes(o.key)) {
1432
+ const c = o.target;
1433
+ r.value = c?.selectionStart ?? 0;
1459
1434
  }
1460
1435
  }, z = () => {
1461
- Q.value = !0, (e.manageValid ?? !0) && (P.value = i.value);
1462
- }, H = (r) => {
1436
+ Q.value = !0, (e.manageValid ?? !0) && (x.value = i.value);
1437
+ }, H = (o) => {
1463
1438
  z();
1464
- }, _ = (r) => {
1465
- t.value = "", o.value = 0, e.onChange({ value: null, event: r }), z(), B(() => {
1439
+ }, G = (o) => {
1440
+ t.value = "", r.value = 0, e.onChange({ value: null, event: o }), z(), B(() => {
1466
1441
  const c = document.getElementById(
1467
1442
  e.id
1468
1443
  );
@@ -1471,14 +1446,14 @@ function bt(e) {
1471
1446
  };
1472
1447
  e.externalValue && ue(
1473
1448
  e.externalValue,
1474
- (r) => {
1475
- const c = r?.start ?? null, I = r?.end ?? null;
1476
- if (c && I) {
1477
- if (t.value = `${b(c)} - ${b(I)}`, e.isOpen?.value && h.value && e.onRequestClose) {
1478
- const V = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1449
+ (o) => {
1450
+ const c = o?.start ?? null, E = o?.end ?? null;
1451
+ if (c && E) {
1452
+ if (t.value = `${S(c)} - ${S(E)}`, e.isOpen?.value && f.value && e.onRequestClose) {
1453
+ const P = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1479
1454
  setTimeout(() => {
1480
- e.onRequestClose?.(), h.value = !1, z();
1481
- }, V);
1455
+ e.onRequestClose?.(), f.value = !1, z();
1456
+ }, P);
1482
1457
  }
1483
1458
  return;
1484
1459
  }
@@ -1489,16 +1464,16 @@ function bt(e) {
1489
1464
  () => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
1490
1465
  ), u = v(
1491
1466
  () => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
1492
- ), T = v(
1467
+ ), F = v(
1493
1468
  () => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
1494
1469
  ), N = v(
1495
1470
  () => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
1496
- ), G = v(
1471
+ ), j = v(
1497
1472
  () => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
1498
1473
  ), ee = v(
1499
1474
  () => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
1500
1475
  ), O = v(() => {
1501
- const { start: r, end: c } = A(t.value);
1476
+ const { start: o, end: c } = k(t.value);
1502
1477
  return [
1503
1478
  {
1504
1479
  label: "Raw",
@@ -1516,45 +1491,45 @@ function bt(e) {
1516
1491
  label: "Start",
1517
1492
  value: `${String(n.value).padStart(2, "0")} / ${String(
1518
1493
  u.value
1519
- ).padStart(2, "0")} / ${String(T.value).padStart(4, "0")}`
1494
+ ).padStart(2, "0")} / ${String(F.value).padStart(4, "0")}`
1520
1495
  },
1521
1496
  {
1522
1497
  label: "End",
1523
1498
  value: `${String(N.value).padStart(2, "0")} / ${String(
1524
- G.value
1499
+ j.value
1525
1500
  ).padStart(2, "0")} / ${String(ee.value).padStart(4, "0")}`
1526
1501
  },
1527
- { label: "Digits only", value: w.value },
1528
- { label: "Mask complete", value: `${m.value}` },
1502
+ { label: "Digits only", value: D.value },
1503
+ { label: "Mask complete", value: `${h.value}` },
1529
1504
  {
1530
1505
  label: "Parsed",
1531
- value: `${r ? r.toDateString() : "-"} | ${c ? c.toDateString() : "-"}`
1506
+ value: `${o ? o.toDateString() : "-"} | ${c ? c.toDateString() : "-"}`
1532
1507
  },
1533
1508
  {
1534
1509
  label: "Valid (managed)",
1535
- value: `${P.value ?? "-"}`
1510
+ value: `${x.value ?? "-"}`
1536
1511
  },
1537
- { label: "Span (days)", value: `${j.value ?? "-"}` },
1512
+ { label: "Span (days)", value: `${_.value ?? "-"}` },
1538
1513
  {
1539
1514
  label: "Reason",
1540
1515
  value: `${le.value ?? "-"}`
1541
1516
  },
1542
1517
  {
1543
1518
  label: "Cursor in",
1544
- value: `${o.value ?? "-"} (${(() => {
1545
- const I = o.value ?? 0, V = C(I);
1546
- return `${V.side}.${V.part}`;
1519
+ value: `${r.value ?? "-"} (${(() => {
1520
+ const E = r.value ?? 0, P = M(E);
1521
+ return `${P.side}.${P.part}`;
1547
1522
  })()})`
1548
1523
  }
1549
1524
  ];
1550
1525
  }), Z = () => {
1551
1526
  B(() => {
1552
- const r = document.getElementById(e.id);
1553
- if (!r) {
1527
+ const o = document.getElementById(e.id);
1528
+ if (!o) {
1554
1529
  console.warn(`#${e.id} not found for styling.`);
1555
1530
  return;
1556
1531
  }
1557
- const c = r.closest("div");
1532
+ const c = o.closest("div");
1558
1533
  if (!c) {
1559
1534
  console.warn(`Parent div of #${e.id} not found for styling.`);
1560
1535
  return;
@@ -1568,64 +1543,64 @@ function bt(e) {
1568
1543
  const ce = () => {
1569
1544
  B(() => {
1570
1545
  try {
1571
- const r = Array.from(
1546
+ const o = Array.from(
1572
1547
  document.querySelectorAll(".k-animation-container")
1573
1548
  );
1574
- if (!r.length) return;
1575
- const I = [...r].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
1549
+ if (!o.length) return;
1550
+ const E = [...o].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
1576
1551
  ".k-calendar"
1577
1552
  );
1578
- if (!I) return;
1579
- const V = I.querySelectorAll(
1553
+ if (!E) return;
1554
+ const P = E.querySelectorAll(
1580
1555
  ".k-calendar-table"
1581
1556
  );
1582
1557
  let te = !1;
1583
- V.forEach((ne) => {
1558
+ P.forEach((ne) => {
1584
1559
  ne.tabIndex === 0 && (te ? ne.tabIndex = -1 : te = !0);
1585
1560
  });
1586
- } catch (r) {
1587
- console.warn(r);
1561
+ } catch (o) {
1562
+ console.warn(o);
1588
1563
  }
1589
1564
  });
1590
1565
  };
1591
1566
  return e.isOpen && ue(
1592
1567
  e.isOpen,
1593
- (r) => {
1594
- r && setTimeout(() => ce(), 0);
1568
+ (o) => {
1569
+ o && setTimeout(() => ce(), 0);
1595
1570
  },
1596
1571
  { immediate: !1 }
1597
1572
  ), {
1598
1573
  raw: t,
1599
- cursorPos: o,
1600
- debugEnabled: k,
1574
+ cursorPos: r,
1575
+ debugEnabled: g,
1601
1576
  debugLines: O,
1602
- digitsOnly: w,
1603
- valid: P,
1577
+ digitsOnly: D,
1578
+ valid: x,
1604
1579
  validComputed: X(i),
1605
1580
  reason: X(le),
1606
- validationMessage: X(D),
1607
- spanDays: X(j),
1581
+ validationMessage: X(w),
1582
+ spanDays: X(_),
1608
1583
  month1: X(n),
1609
1584
  day1: X(u),
1610
- year1: X(T),
1585
+ year1: X(F),
1611
1586
  month2: X(N),
1612
- day2: X(G),
1587
+ day2: X(j),
1613
1588
  year2: X(ee),
1614
1589
  handleChange: ae,
1615
1590
  handleKeyDown: a,
1616
- handleWheel: f,
1591
+ handleWheel: m,
1617
1592
  handleKeyUp: R,
1618
1593
  handleClick: se,
1619
1594
  handleBlur: H,
1620
- handleClear: _,
1595
+ handleClear: G,
1621
1596
  onCalendarChange: () => {
1622
- h.value = !0;
1597
+ f.value = !0;
1623
1598
  },
1624
1599
  initStyling: Z
1625
1600
  };
1626
1601
  }
1627
- function St(e) {
1628
- const t = U(""), o = U(void 0), k = U(!!e.debug), h = U(e.timeFormat ?? "hh:mm AM"), y = v(() => !!e.required), x = U(!1), S = ["ArrowUp", "ArrowDown"], E = ["ArrowLeft", "ArrowRight"], F = v(() => (t.value ?? "").replace(/\D/g, "")), w = {
1602
+ function mt(e) {
1603
+ const t = U(""), r = U(void 0), g = U(!!e.debug), f = U(e.timeFormat ?? "hh:mm AM"), p = v(() => !!e.required), A = U(!1), C = ["ArrowUp", "ArrowDown"], T = ["ArrowLeft", "ArrowRight"], q = v(() => (t.value ?? "").replace(/\D/g, "")), D = {
1629
1604
  H: /[0-9]/,
1630
1605
  h: /[0-9]/,
1631
1606
  M: /[0-9]/,
@@ -1638,54 +1613,54 @@ function St(e) {
1638
1613
  }), l = v(() => {
1639
1614
  const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", u = parseInt(n);
1640
1615
  return Math.min(Math.max(u, 0), 59);
1641
- }), p = v(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), K = v(() => {
1642
- const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), u = p.value;
1616
+ }), y = v(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), L = v(() => {
1617
+ const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), u = y.value;
1643
1618
  return n === 12 ? u === "AM" ? 0 : 12 : u === "PM" ? n + 12 : n;
1644
- }), m = v(() => A.value ? `${String(K.value).padStart(2, "0")}:${String(l.value).padStart(2, "0")}:00` : null), A = v(
1619
+ }), h = v(() => k.value ? `${String(L.value).padStart(2, "0")}:${String(l.value).padStart(2, "0")}:00` : null), k = v(
1645
1620
  () => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
1646
- ), P = (n, u, T) => {
1621
+ ), x = (n, u, F) => {
1647
1622
  let N = n % 12;
1648
1623
  return N === 0 && (N = 12), `${String(N).padStart(2, "0")}:${String(u).padStart(
1649
1624
  2,
1650
1625
  "0"
1651
- )} ${T}`;
1652
- }, L = (n) => {
1626
+ )} ${F}`;
1627
+ }, V = (n) => {
1653
1628
  const u = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1654
1629
  if (!u) return null;
1655
- const T = parseInt(u[1]), N = parseInt(u[2]), G = u[3].toUpperCase();
1656
- if (T < 1 || T > 12 || N < 0 || N > 59) return null;
1657
- let ee = T % 12;
1658
- G === "PM" && (ee += 12);
1630
+ const F = parseInt(u[1]), N = parseInt(u[2]), j = u[3].toUpperCase();
1631
+ if (F < 1 || F > 12 || N < 0 || N > 59) return null;
1632
+ let ee = F % 12;
1633
+ j === "PM" && (ee += 12);
1659
1634
  const O = /* @__PURE__ */ new Date();
1660
1635
  return O.setSeconds(0, 0), O.setHours(ee), O.setMinutes(N), O;
1661
1636
  }, Y = (n) => {
1662
- if (F.value.length === 0) {
1637
+ if (q.value.length === 0) {
1663
1638
  e.onChange({ value: null, event: n });
1664
1639
  return;
1665
1640
  }
1666
- if (!A.value) {
1641
+ if (!k.value) {
1667
1642
  e.onChange({ value: null, event: n });
1668
1643
  return;
1669
1644
  }
1670
- const u = L(t.value);
1645
+ const u = V(t.value);
1671
1646
  u && Q(u) ? e.onChange({ value: u, event: n }) : e.onChange({ value: null, event: n });
1672
- }, j = (n) => n.getHours() * 60 + n.getMinutes(), Q = (n) => {
1673
- const u = e.min ?? void 0, T = e.max ?? void 0, N = j(n);
1647
+ }, _ = (n) => n.getHours() * 60 + n.getMinutes(), Q = (n) => {
1648
+ const u = e.min ?? void 0, F = e.max ?? void 0, N = _(n);
1674
1649
  if (u) {
1675
- const G = j(u);
1676
- if (N < G) return !1;
1650
+ const j = _(u);
1651
+ if (N < j) return !1;
1677
1652
  }
1678
- if (T) {
1679
- const G = j(T);
1680
- if (N > G) return !1;
1653
+ if (F) {
1654
+ const j = _(F);
1655
+ if (N > j) return !1;
1681
1656
  }
1682
1657
  return !0;
1683
1658
  }, le = (n) => {
1684
- const u = n.getHours(), T = u >= 12 ? "PM" : "AM";
1685
- t.value = P(u, n.getMinutes(), T);
1659
+ const u = n.getHours(), F = u >= 12 ? "PM" : "AM";
1660
+ t.value = x(u, n.getMinutes(), F);
1686
1661
  }, i = (n, u) => {
1687
1662
  e.onChange({ value: n, event: u });
1688
- }, D = () => {
1663
+ }, w = () => {
1689
1664
  B(() => {
1690
1665
  requestAnimationFrame(() => {
1691
1666
  requestAnimationFrame(() => {
@@ -1703,20 +1678,20 @@ function St(e) {
1703
1678
  }, d = (n) => {
1704
1679
  const u = n?.event?.target;
1705
1680
  return u ? u.closest(".k-time-now") ? "now" : u.closest(".k-time-accept") ? "set" : null : null;
1706
- }, g = (n, u) => {
1681
+ }, b = (n, u) => {
1707
1682
  n && Q(n) ? i(n, u) : i(null, u);
1708
- }, M = (...n) => {
1683
+ }, I = (...n) => {
1709
1684
  const u = n[0];
1710
1685
  if (!u) return;
1711
- const T = d(u);
1712
- if (T === "now") {
1713
- const G = /* @__PURE__ */ new Date();
1714
- le(G), g(G, u), D();
1686
+ const F = d(u);
1687
+ if (F === "now") {
1688
+ const j = /* @__PURE__ */ new Date();
1689
+ le(j), b(j, u), w();
1715
1690
  return;
1716
1691
  }
1717
1692
  if (u?.value instanceof Date) {
1718
- const G = new Date(u.value);
1719
- le(G), g(G, u), T === "set" && D();
1693
+ const j = new Date(u.value);
1694
+ le(j), b(j, u), F === "set" && w();
1720
1695
  return;
1721
1696
  }
1722
1697
  if (u?.value === null) {
@@ -1725,10 +1700,10 @@ function St(e) {
1725
1700
  }
1726
1701
  t.value = u.value;
1727
1702
  const N = u.event?.target;
1728
- o.value = N?.selectionStart ?? 0;
1703
+ r.value = N?.selectionStart ?? 0;
1729
1704
  try {
1730
- const G = o.value ?? 0;
1731
- if ($(G) === "ampm" && (t.value ?? "").length >= 8) {
1705
+ const j = r.value ?? 0;
1706
+ if ($(j) === "ampm" && (t.value ?? "").length >= 8) {
1732
1707
  const ee = t.value.charAt(6);
1733
1708
  /[Aa]/.test(ee) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
1734
1709
  requestAnimationFrame(() => {
@@ -1749,22 +1724,22 @@ function St(e) {
1749
1724
  } catch {
1750
1725
  }
1751
1726
  Y(u);
1752
- }, b = (n) => {
1753
- o.value = n.target.selectionStart ?? 0;
1754
- }, C = (n, u, T) => {
1755
- const N = u?.selectionStart ?? o.value ?? 0;
1756
- o.value = N;
1757
- const G = $(N), ee = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1727
+ }, S = (n) => {
1728
+ r.value = n.target.selectionStart ?? 0;
1729
+ }, M = (n, u, F) => {
1730
+ const N = u?.selectionStart ?? r.value ?? 0;
1731
+ r.value = N;
1732
+ const j = $(N), ee = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1758
1733
  if (!ee) {
1759
- if ((t.value ?? "").length === 0 || F.value.length === 0) {
1760
- const c = /* @__PURE__ */ new Date(), I = c.getHours(), V = I >= 12 ? "PM" : "AM";
1761
- t.value = P(I, c.getMinutes(), V);
1762
- const te = L(t.value);
1763
- g(te, T), B(() => {
1734
+ if ((t.value ?? "").length === 0 || q.value.length === 0) {
1735
+ const c = /* @__PURE__ */ new Date(), E = c.getHours(), P = E >= 12 ? "PM" : "AM";
1736
+ t.value = x(E, c.getMinutes(), P);
1737
+ const te = V(t.value);
1738
+ b(te, F), B(() => {
1764
1739
  requestAnimationFrame(() => {
1765
1740
  const ne = document.getElementById(
1766
1741
  e.id
1767
- ), fe = o.value ?? 0;
1742
+ ), fe = r.value ?? 0;
1768
1743
  ne && (ne.focus(), ne.setSelectionRange(fe, fe));
1769
1744
  });
1770
1745
  });
@@ -1772,36 +1747,36 @@ function St(e) {
1772
1747
  return;
1773
1748
  }
1774
1749
  let O = parseInt(ee[1]), Z = parseInt(ee[2]), ce = ee[3].toUpperCase();
1775
- if (G === "hh")
1750
+ if (j === "hh")
1776
1751
  n === "ArrowUp" ? O = O < 12 ? O + 1 : 1 : O = O > 1 ? O - 1 : 12;
1777
- else if (G === "mm") {
1752
+ else if (j === "mm") {
1778
1753
  const c = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
1779
1754
  if (c === 1)
1780
1755
  n === "ArrowUp" ? Z = Z < 59 ? Z + 1 : 0 : Z = Z > 0 ? Z - 1 : 59;
1781
1756
  else if (n === "ArrowUp") {
1782
- const I = Z % c;
1783
- let V = I === 0 ? Z + c : Z + (c - I);
1784
- V >= 60 && (V = 0), Z = V;
1757
+ const E = Z % c;
1758
+ let P = E === 0 ? Z + c : Z + (c - E);
1759
+ P >= 60 && (P = 0), Z = P;
1785
1760
  } else {
1786
- const I = Z % c;
1787
- let V = I === 0 ? Z - c : Z - I;
1788
- V < 0 && (V = 60 - c), Z = V;
1761
+ const E = Z % c;
1762
+ let P = E === 0 ? Z - c : Z - E;
1763
+ P < 0 && (P = 60 - c), Z = P;
1789
1764
  }
1790
- } else G === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
1765
+ } else j === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
1791
1766
  t.value = `${String(O).padStart(2, "0")}:${String(Z).padStart(
1792
1767
  2,
1793
1768
  "0"
1794
1769
  )} ${ce}`;
1795
- const r = L(t.value);
1796
- g(r, T), B(() => {
1770
+ const o = V(t.value);
1771
+ b(o, F), B(() => {
1797
1772
  requestAnimationFrame(() => {
1798
1773
  const c = document.getElementById(
1799
1774
  e.id
1800
- ), I = o.value ?? 0;
1801
- c && (c.focus(), c.setSelectionRange(I, I));
1775
+ ), E = r.value ?? 0;
1776
+ c && (c.focus(), c.setSelectionRange(E, E));
1802
1777
  });
1803
1778
  });
1804
- }, q = (n) => {
1779
+ }, K = (n) => {
1805
1780
  if (n.code === "Space" || n.key === " ") {
1806
1781
  n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
1807
1782
  return;
@@ -1810,31 +1785,31 @@ function St(e) {
1810
1785
  n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
1811
1786
  return;
1812
1787
  }
1813
- if (S.includes(n.key)) {
1788
+ if (C.includes(n.key)) {
1814
1789
  if (n.altKey) return;
1815
1790
  n.preventDefault(), n.stopPropagation();
1816
1791
  const u = n.target;
1817
- C(n.key, u, n);
1792
+ M(n.key, u, n);
1818
1793
  return;
1819
1794
  }
1820
1795
  }, W = (n) => {
1821
1796
  n.preventDefault();
1822
1797
  const u = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1823
- C(u, n.target, n);
1798
+ M(u, n.target, n);
1824
1799
  }, ae = (n) => {
1825
1800
  const u = n.target;
1826
- if (E.includes(n.key)) {
1827
- o.value = u?.selectionStart ?? 0;
1801
+ if (T.includes(n.key)) {
1802
+ r.value = u?.selectionStart ?? 0;
1828
1803
  return;
1829
1804
  }
1830
- if (S.includes(n.key)) {
1805
+ if (C.includes(n.key)) {
1831
1806
  if (n.altKey) return;
1832
- o.value = u?.selectionStart ?? 0;
1807
+ r.value = u?.selectionStart ?? 0;
1833
1808
  }
1834
1809
  }, se = (n) => {
1835
- x.value = !0, y.value && e.externalValue && e.externalValue.value === void 0 && F.value.length === 0 && (e.externalValue.value = "");
1810
+ A.value = !0, p.value && e.externalValue && e.externalValue.value === void 0 && q.value.length === 0 && (e.externalValue.value = "");
1836
1811
  const u = n.target;
1837
- u && (o.value = u.selectionStart ?? 0);
1812
+ u && (r.value = u.selectionStart ?? 0);
1838
1813
  };
1839
1814
  e.externalValue && ue(
1840
1815
  e.externalValue,
@@ -1842,8 +1817,8 @@ function St(e) {
1842
1817
  if (n) {
1843
1818
  const u = new Date(n);
1844
1819
  if (u.toString() !== "Invalid Date") {
1845
- const T = u.getHours(), N = T >= 12 ? "PM" : "AM";
1846
- t.value = P(T, u.getMinutes(), N);
1820
+ const F = u.getHours(), N = F >= 12 ? "PM" : "AM";
1821
+ t.value = x(F, u.getMinutes(), N);
1847
1822
  return;
1848
1823
  }
1849
1824
  }
@@ -1853,14 +1828,14 @@ function St(e) {
1853
1828
  const a = v(() => [
1854
1829
  ["Time", t.value || "--:-- --"],
1855
1830
  ["Hour (12h)", s.value],
1856
- ["Hour (24h)", K.value],
1831
+ ["Hour (24h)", L.value],
1857
1832
  ["Minute", l.value],
1858
- ["Period", p.value],
1859
- ["Time (24h)", m.value ?? "--:--:--"],
1860
- ["Digits only", F.value],
1833
+ ["Period", y.value],
1834
+ ["Time (24h)", h.value ?? "--:--:--"],
1835
+ ["Digits only", q.value],
1861
1836
  [
1862
1837
  "Parsed Date",
1863
- f.value?.toLocaleDateString("en-US", {
1838
+ m.value?.toLocaleDateString("en-US", {
1864
1839
  hour: "2-digit",
1865
1840
  minute: "2-digit"
1866
1841
  }) ?? null
@@ -1882,27 +1857,27 @@ function St(e) {
1882
1857
  ["valid", R.value],
1883
1858
  ["reason", z.value],
1884
1859
  ["validationMessage", H.value]
1885
- ]), f = v(
1886
- () => L(t.value) ?? null
1860
+ ]), m = v(
1861
+ () => V(t.value) ?? null
1887
1862
  ), R = v(() => {
1888
- if (!y.value) {
1889
- if (!A.value) return !0;
1890
- const u = f.value;
1863
+ if (!p.value) {
1864
+ if (!k.value) return !0;
1865
+ const u = m.value;
1891
1866
  return u ? Q(u) : !1;
1892
1867
  }
1893
- if (!x.value) return !0;
1894
- const n = f.value;
1895
- return !A.value || !n ? !1 : Q(n);
1868
+ if (!A.value) return !0;
1869
+ const n = m.value;
1870
+ return !k.value || !n ? !1 : Q(n);
1896
1871
  }), z = v(() => {
1897
- if (!y.value) {
1898
- if (!A.value) return;
1899
- const u = f.value;
1872
+ if (!p.value) {
1873
+ if (!k.value) return;
1874
+ const u = m.value;
1900
1875
  return u ? Q(u) ? "valid" : "out-of-bounds" : "invalid-time";
1901
1876
  }
1902
- if (!x.value) return;
1903
- if (F.value.length === 0 || !A.value)
1877
+ if (!A.value) return;
1878
+ if (q.value.length === 0 || !k.value)
1904
1879
  return "incomplete";
1905
- const n = f.value;
1880
+ const n = m.value;
1906
1881
  return n ? Q(n) ? "valid" : "out-of-bounds" : "invalid-time";
1907
1882
  }), H = v(() => {
1908
1883
  const n = z.value;
@@ -1910,18 +1885,18 @@ function St(e) {
1910
1885
  if (n === "incomplete")
1911
1886
  return "Required";
1912
1887
  if (n === "invalid-time")
1913
- return `Must be in ${h.value} format.`;
1888
+ return `Must be in ${f.value} format.`;
1914
1889
  const u = {
1915
1890
  hour: "2-digit",
1916
1891
  minute: "2-digit"
1917
- }, T = e.min ? e.min.toLocaleTimeString("en-US", u) : null, N = e.max ? e.max.toLocaleTimeString("en-US", u) : null;
1892
+ }, F = e.min ? e.min.toLocaleTimeString("en-US", u) : null, N = e.max ? e.max.toLocaleTimeString("en-US", u) : null;
1918
1893
  if (n === "out-of-bounds") {
1919
- if (T && N) return `Must be between ${T} and ${N}.`;
1920
- if (T) return `Must be ${T} or later.`;
1894
+ if (F && N) return `Must be between ${F} and ${N}.`;
1895
+ if (F) return `Must be ${F} or later.`;
1921
1896
  if (N) return `Must be ${N} or earlier.`;
1922
1897
  }
1923
1898
  return "";
1924
- }), _ = () => {
1899
+ }), G = () => {
1925
1900
  B(() => {
1926
1901
  const n = document.getElementById(e.id);
1927
1902
  if (!n) {
@@ -1935,99 +1910,99 @@ function St(e) {
1935
1910
  );
1936
1911
  return;
1937
1912
  }
1938
- const T = u.parentElement;
1939
- if (!T) {
1913
+ const F = u.parentElement;
1914
+ if (!F) {
1940
1915
  console.warn(
1941
1916
  `Parent of .k-timepicker not found for #${e.id} styling.`
1942
1917
  );
1943
1918
  return;
1944
1919
  }
1945
- T.classList.contains("fk-timepicker") || T.classList.add("fk-timepicker");
1920
+ F.classList.contains("fk-timepicker") || F.classList.add("fk-timepicker");
1946
1921
  });
1947
1922
  };
1948
1923
  return Me(() => {
1949
- _();
1924
+ G();
1950
1925
  }), {
1951
1926
  raw: t,
1952
- rules: w,
1953
- debugEnabled: k,
1927
+ rules: D,
1928
+ debugEnabled: g,
1954
1929
  debugLines: a,
1955
- placeholder: h,
1930
+ placeholder: f,
1956
1931
  isValid: R,
1957
1932
  reason: X(z),
1958
1933
  validationMessage: H,
1959
- isComplete: A,
1934
+ isComplete: k,
1960
1935
  inRangeTime: Q,
1961
- cursorPos: o,
1936
+ cursorPos: r,
1962
1937
  hour: X(s),
1963
- hour24: X(K),
1938
+ hour24: X(L),
1964
1939
  minute: X(l),
1965
- period: X(p),
1966
- time24: X(m),
1967
- parsedRawTime: X(f),
1968
- handleChange: M,
1969
- handleKeyDown: q,
1940
+ period: X(y),
1941
+ time24: X(h),
1942
+ parsedRawTime: X(m),
1943
+ handleChange: I,
1944
+ handleKeyDown: K,
1970
1945
  handleKeyUp: ae,
1971
- handleClick: b,
1946
+ handleClick: S,
1972
1947
  handleWheel: W,
1973
1948
  handleBlur: se,
1974
1949
  // Expose so consumers can reapply theming when Kendo updates DOM
1975
- initStyling: _
1950
+ initStyling: G
1976
1951
  };
1977
1952
  }
1978
- function wt(e) {
1979
- const t = Ue(null), o = [
1953
+ function vt(e) {
1954
+ const t = Ke(null), r = [
1980
1955
  ".k-animation-container .k-popup",
1981
1956
  ".k-popup",
1982
1957
  ".k-timepicker-popup",
1983
1958
  ".k-menu-popup"
1984
- ], k = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? o].flat(), h = (w) => w ? typeof e.initialFocus == "string" ? w.querySelector(e.initialFocus) ?? w : typeof e.initialFocus == "function" ? e.initialFocus(w) ?? w : w.querySelector(
1959
+ ], g = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), f = (D) => D ? typeof e.initialFocus == "string" ? D.querySelector(e.initialFocus) ?? D : typeof e.initialFocus == "function" ? e.initialFocus(D) ?? D : D.querySelector(
1985
1960
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1986
- ) ?? w : null, { activate: y, deactivate: x } = Be(t, {
1961
+ ) ?? D : null, { activate: p, deactivate: A } = qe(t, {
1987
1962
  escapeDeactivates: !1,
1988
1963
  clickOutsideDeactivates: !1,
1989
1964
  fallbackFocus: () => t.value,
1990
- initialFocus: () => h(t.value),
1965
+ initialFocus: () => f(t.value),
1991
1966
  ...e.focusTrapOptions ?? {}
1992
1967
  });
1993
- let S = null, E = U(null);
1994
- const F = () => {
1968
+ let C = null, T = U(null);
1969
+ const q = () => {
1995
1970
  if (e.resolvePopupEl) return e.resolvePopupEl();
1996
- const w = (s, l) => {
1997
- const p = Array.from(s.querySelectorAll(l));
1998
- if (!p.length) return null;
1999
- const K = p.filter(
2000
- (m) => m.offsetParent !== null || m.getClientRects().length > 0
1971
+ const D = (s, l) => {
1972
+ const y = Array.from(s.querySelectorAll(l));
1973
+ if (!y.length) return null;
1974
+ const L = y.filter(
1975
+ (h) => h.offsetParent !== null || h.getClientRects().length > 0
2001
1976
  );
2002
- return K[K.length - 1] ?? p[p.length - 1] ?? null;
1977
+ return L[L.length - 1] ?? y[y.length - 1] ?? null;
2003
1978
  }, $ = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
2004
- for (const s of k) {
2005
- const l = w($, s);
1979
+ for (const s of g) {
1980
+ const l = D($, s);
2006
1981
  if (l) return l;
2007
1982
  }
2008
- for (const s of k) {
2009
- const l = w(document, s);
1983
+ for (const s of g) {
1984
+ const l = D(document, s);
2010
1985
  if (l) return l;
2011
1986
  }
2012
1987
  return null;
2013
1988
  };
2014
- return Ve(t, (w) => {
2015
- E.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", w);
1989
+ return $e(t, (D) => {
1990
+ T.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", D);
2016
1991
  }), ue(
2017
1992
  () => e.isOpen.value,
2018
- (w) => {
2019
- w ? (E.value = null, B(() => {
2020
- const $ = F();
2021
- $ && (t.value = $, setTimeout(() => y(), 0), S || (S = (s) => {
2022
- s.key === "Escape" && (E.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", s));
2023
- }, document.addEventListener("keydown", S, !0)));
2024
- })) : (x(), S && (document.removeEventListener("keydown", S, !0), S = null), t.value = null, E.value === "outside" && B(() => {
1993
+ (D) => {
1994
+ D ? (T.value = null, B(() => {
1995
+ const $ = q();
1996
+ $ && (t.value = $, setTimeout(() => p(), 0), C || (C = (s) => {
1997
+ s.key === "Escape" && (T.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", s));
1998
+ }, document.addEventListener("keydown", C, !0)));
1999
+ })) : (A(), C && (document.removeEventListener("keydown", C, !0), C = null), t.value = null, T.value === "outside" && B(() => {
2025
2000
  const $ = () => {
2026
- const s = e.triggerEl?.value, l = s?.querySelector("input"), p = document.activeElement;
2027
- p && (p === l || s && s.contains(p)) && (l ?? s)?.blur?.();
2001
+ const s = e.triggerEl?.value, l = s?.querySelector("input"), y = document.activeElement;
2002
+ y && (y === l || s && s.contains(y)) && (l ?? s)?.blur?.();
2028
2003
  };
2029
2004
  requestAnimationFrame(() => setTimeout($, 0));
2030
- }), e.returnFocusToTrigger !== !1 && E.value === "escape" && e.triggerEl?.value && B(() => {
2005
+ }), e.returnFocusToTrigger !== !1 && T.value === "escape" && e.triggerEl?.value && B(() => {
2031
2006
  const $ = () => {
2032
2007
  const s = e.triggerEl?.value;
2033
2008
  if (!s) return;
@@ -2038,24 +2013,24 @@ function wt(e) {
2038
2013
  }
2039
2014
  ), {
2040
2015
  popupRef: t,
2041
- activate: y,
2042
- deactivate: x,
2043
- lastCloseReason: X(E),
2044
- setPopupEl: (w) => t.value = w
2016
+ activate: p,
2017
+ deactivate: A,
2018
+ lastCloseReason: X(T),
2019
+ setPopupEl: (D) => t.value = D
2045
2020
  };
2046
2021
  }
2047
2022
  export {
2048
- je as useFieldsetTouchTracker,
2049
- Je as useFieldsetValidationKit,
2050
- pt as useGridA11y,
2051
- mt as useGridActiveFilter,
2052
- vt as useGridRowAction,
2053
- ht as useMaskedDateInput,
2054
- bt as useMaskedDateRangeInput,
2055
- St as useMaskedTimeInput,
2056
- yt as usePopupMenu,
2057
- wt as usePopupTrap,
2058
- gt as useUSAddress,
2059
- Ge as useZipTextBox
2023
+ Ye as useFieldsetTouchTracker,
2024
+ We as useFieldsetValidationKit,
2025
+ it as useGridA11y,
2026
+ st as useGridActiveFilter,
2027
+ ut as useGridRowAction,
2028
+ ft as useMaskedDateInput,
2029
+ pt as useMaskedDateRangeInput,
2030
+ mt as useMaskedTimeInput,
2031
+ dt as usePopupMenu,
2032
+ vt as usePopupTrap,
2033
+ ct as useUSAddress,
2034
+ Ze as useZipTextBox
2060
2035
  };
2061
2036
  //# sourceMappingURL=featherk-composables.es.js.map