@featherk/composables 0.10.10 → 0.11.0

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