@featherk/composables 0.10.7 → 0.10.8

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