@featherk/composables 0.13.5 → 0.13.7

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