@signal24/vue-foundation 4.25.3 → 4.25.5

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,19 +1,19 @@
1
- var Ht = Object.defineProperty;
2
- var Vt = (e, t, n) => t in e ? Ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var D = (e, t, n) => Vt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as R, ref as T, computed as M, watch as H, onMounted as _, createElementBlock as k, withDirectives as ne, openBlock as b, createElementVNode as B, toDisplayString as W, createCommentVNode as A, Fragment as oe, renderList as se, vModelSelect as At, getCurrentInstance as we, withModifiers as Ee, normalizeStyle as $t, normalizeClass as $, renderSlot as j, reactive as Bt, h as ie, Teleport as _t, markRaw as Nt, onBeforeUnmount as be, resolveDirective as Rt, createBlock as Je, createSlots as Wt, withCtx as pe, createTextVNode as X, vModelText as jt, onActivated as Qe, onDeactivated as et } from "vue";
5
- import { compact as tt, uniq as Ut, groupBy as Pt, debounce as qt, isEqual as nt, startCase as zt, upperFirst as Kt, cloneDeep as Yt, remove as Xt, last as Zt } from "lodash";
6
- import { escapeHtml as Gt } from "@vue/shared";
7
- import { escapeHtml as ms } from "@vue/shared";
8
- import { format as P, addDays as Jt, parse as Qt } from "date-fns";
9
- import { configureOpenApiClient as en, OpenApiError as tn } from "@signal24/openapi-client-codegen/browser";
10
- const nn = {
1
+ var At = Object.defineProperty;
2
+ var $t = (e, t, n) => t in e ? At(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var D = (e, t, n) => $t(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as R, ref as T, computed as M, watch as H, onMounted as _, createElementBlock as k, withDirectives as ne, openBlock as b, createElementVNode as B, toDisplayString as W, createCommentVNode as A, Fragment as oe, renderList as se, vModelSelect as Bt, getCurrentInstance as ge, withModifiers as we, normalizeStyle as _t, normalizeClass as $, renderSlot as U, reactive as Nt, h as ie, Teleport as Rt, markRaw as Wt, onBeforeUnmount as Ee, resolveDirective as Ut, createBlock as et, createSlots as jt, withCtx as me, createTextVNode as X, vModelText as Pt, onActivated as tt, onDeactivated as nt } from "vue";
5
+ import { compact as ot, cloneDeep as qt, uniq as zt, groupBy as Kt, debounce as Yt, isEqual as st, startCase as Xt, upperFirst as Zt, remove as Gt, last as Jt } from "lodash";
6
+ import { configureOpenApiClient as Qt, OpenApiError as en } from "@signal24/openapi-client-codegen/browser";
7
+ import { escapeHtml as tn } from "@vue/shared";
8
+ import { escapeHtml as hs } from "@vue/shared";
9
+ import { format as P, addDays as nn, parse as on } from "date-fns";
10
+ const sn = {
11
11
  key: 0,
12
12
  disabled: ""
13
- }, on = {
13
+ }, ln = {
14
14
  key: 0,
15
15
  value: null
16
- }, sn = ["value"], Ro = /* @__PURE__ */ R({
16
+ }, rn = ["value"], Uo = /* @__PURE__ */ R({
17
17
  __name: "vf-ajax-select",
18
18
  props: {
19
19
  modelValue: {},
@@ -36,32 +36,32 @@ const nn = {
36
36
  async function r() {
37
37
  l.value = await n.loadFn();
38
38
  }
39
- return _(r), (u, p) => s.value ? ne((b(), k("select", {
39
+ return _(r), (c, p) => s.value ? ne((b(), k("select", {
40
40
  key: 1,
41
41
  "onUpdate:modelValue": p[0] || (p[0] = (E) => a.value = E)
42
42
  }, [
43
- n.nullText ? (b(), k("option", on, W(n.nullText), 1)) : A("", !0),
43
+ n.nullText ? (b(), k("option", ln, W(n.nullText), 1)) : A("", !0),
44
44
  (b(!0), k(oe, null, se(s.value, (E, v) => {
45
45
  var w;
46
46
  return b(), k("option", {
47
47
  key: v,
48
48
  value: (w = l.value) == null ? void 0 : w[v]
49
- }, W(E), 9, sn);
49
+ }, W(E), 9, rn);
50
50
  }), 128))
51
51
  ], 512)), [
52
- [At, a.value]
53
- ]) : (b(), k("select", nn, [
52
+ [Bt, a.value]
53
+ ]) : (b(), k("select", sn, [
54
54
  B("option", null, W(n.loadingText || "Loading..."), 1)
55
55
  ]));
56
56
  }
57
- }), ln = /* @__PURE__ */ R({
57
+ }), an = /* @__PURE__ */ R({
58
58
  __name: "overlay-anchor",
59
59
  props: {
60
60
  overlayId: {},
61
61
  anchor: {}
62
62
  },
63
63
  setup(e) {
64
- const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = T({ visibility: "hidden", top: "0", left: "0" }), l = T([]), s = we();
64
+ const t = e, n = t.anchor instanceof HTMLElement ? t.anchor : t.anchor.el, o = T({ visibility: "hidden", top: "0", left: "0" }), l = T([]), s = ge();
65
65
  _(a);
66
66
  function a() {
67
67
  if (!s) return;
@@ -71,19 +71,19 @@ const nn = {
71
71
  function r(p, E) {
72
72
  const v = t.anchor instanceof HTMLElement ? {} : t.anchor, w = E.getBoundingClientRect(), g = p.getBoundingClientRect();
73
73
  v.matchWidth && (g.width = w.width), v.matchHeight && (g.height = w.height);
74
- const c = v.class ? Array.isArray(v.class) ? v.class : [v.class] : [];
74
+ const u = v.class ? Array.isArray(v.class) ? v.class : [v.class] : [];
75
75
  let d, S;
76
76
  if (v.y === "center")
77
- d = w.top + w.height / 2 - g.height / 2, c.push("anchored-center-y");
77
+ d = w.top + w.height / 2 - g.height / 2, u.push("anchored-center-y");
78
78
  else {
79
79
  const L = (w.bottom + g.height < window.innerHeight || v.y === "below") && v.y !== "above";
80
- d = L ? w.bottom : w.top - g.height, c.push(L ? "anchored-top" : "anchored-bottom");
80
+ d = L ? w.bottom : w.top - g.height, u.push(L ? "anchored-top" : "anchored-bottom");
81
81
  }
82
82
  if (v.x === "center")
83
- S = w.left + w.width / 2 - g.width / 2, c.push("anchored-center-x");
83
+ S = w.left + w.width / 2 - g.width / 2, u.push("anchored-center-x");
84
84
  else {
85
85
  const L = (w.left + g.width < window.innerWidth || v.x === "left") && v.x !== "right";
86
- S = L ? w.left : w.right - g.width, c.push(L ? "anchored-left" : "anchored-right");
86
+ S = L ? w.left : w.right - g.width, u.push(L ? "anchored-left" : "anchored-right");
87
87
  }
88
88
  return {
89
89
  styles: {
@@ -92,37 +92,37 @@ const nn = {
92
92
  ...v.matchWidth ? { width: `${g.width}px` } : {},
93
93
  ...v.matchHeight ? { height: `${g.height}px` } : {}
94
94
  },
95
- classes: c
95
+ classes: u
96
96
  };
97
97
  }
98
- function u() {
99
- window.removeEventListener("click", u), un(t.overlayId);
98
+ function c() {
99
+ window.removeEventListener("click", c), dn(t.overlayId);
100
100
  }
101
101
  return _(() => {
102
102
  setTimeout(() => {
103
- window.addEventListener("click", u);
103
+ window.addEventListener("click", c);
104
104
  }, 10);
105
105
  }), (p, E) => (b(), k("div", {
106
106
  class: $(["vf-overlay-anchor", l.value]),
107
- style: $t(o.value),
108
- onClick: Ee(u, ["stop"])
107
+ style: _t(o.value),
108
+ onClick: we(c, ["stop"])
109
109
  }, [
110
- j(p.$slots, "default")
110
+ U(p.$slots, "default")
111
111
  ], 6));
112
112
  }
113
113
  });
114
- let rn = 0;
115
- const N = Bt([]), Wo = R({
114
+ let un = 0;
115
+ const N = Nt([]), jo = R({
116
116
  setup() {
117
117
  return () => ie("div", [
118
- se(N, (e) => ie(_t, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
118
+ se(N, (e) => ie(Rt, { key: e.id, to: "#vf-overlay-target" }, [e.wrapperVnode ?? e.vnode]))
119
119
  ]);
120
120
  }
121
121
  });
122
- function ke(e, t, n) {
122
+ function be(e, t, n) {
123
123
  const o = document.getElementById("vf-overlay-target") ?? document.createElement("div");
124
124
  o.id = "vf-overlay-target", o.removeAttribute("inert"), document.body.appendChild(o);
125
- const l = String(++rn), s = Nt(e), a = ie(s, t), r = n != null && n.anchor ? ie(ln, { overlayId: l, anchor: n.anchor }, () => [a]) : void 0, u = {
125
+ const l = String(++un), s = Wt(e), a = ie(s, t), r = n != null && n.anchor ? ie(an, { overlayId: l, anchor: n.anchor }, () => [a]) : void 0, c = {
126
126
  id: l,
127
127
  component: s,
128
128
  props: t,
@@ -130,21 +130,21 @@ function ke(e, t, n) {
130
130
  vnode: a,
131
131
  wrapperVnode: r
132
132
  };
133
- return N.push(u), u;
133
+ return N.push(c), c;
134
134
  }
135
- function jo(e) {
136
- e.$ && ot(e.$);
135
+ function Po(e) {
136
+ e.$ && it(e.$);
137
137
  }
138
- function ot(e) {
138
+ function it(e) {
139
139
  let t = e;
140
- for (; t && !an(t.vnode); )
140
+ for (; t && !cn(t.vnode); )
141
141
  t = t.parent;
142
142
  }
143
- function an(e) {
143
+ function cn(e) {
144
144
  const t = N.findIndex((n) => n.vnode.component === e.component);
145
145
  return t >= 0 ? (N[t].props.callback(), !0) : !1;
146
146
  }
147
- function un(e) {
147
+ function dn(e) {
148
148
  const t = N.findIndex((n) => n.id === e);
149
149
  return t >= 0 ? (N[t].props.callback(), !0) : !1;
150
150
  }
@@ -152,18 +152,18 @@ function le(e) {
152
152
  const t = N.indexOf(e);
153
153
  t >= 0 && N.splice(t, 1);
154
154
  }
155
- async function Te(e, t, n) {
155
+ async function ke(e, t, n) {
156
156
  return new Promise((o) => {
157
157
  let l = null;
158
158
  const a = { ...t, callback: async (r) => {
159
159
  if (n != null && n.onCallback) {
160
- const u = n.onCallback(r);
161
- if (typeof u == "object" && "then" in u && typeof u.then == "function" && await u === !1)
160
+ const c = n.onCallback(r);
161
+ if (typeof c == "object" && "then" in c && typeof c.then == "function" && await c === !1)
162
162
  return;
163
163
  }
164
164
  le(l), o(r);
165
165
  } };
166
- l = ke(e, a, n);
166
+ l = be(e, a, n);
167
167
  });
168
168
  }
169
169
  function re(e, t) {
@@ -172,26 +172,26 @@ function re(e, t) {
172
172
  classes: e.classes ?? []
173
173
  } : { title: t ? e : void 0, message: t ?? e, classes: [] };
174
174
  }
175
- async function cn(e, t) {
176
- await Te(ue, re(e, t));
175
+ async function fn(e, t) {
176
+ await ke(ue, re(e, t));
177
177
  }
178
- async function Uo(e, t) {
178
+ async function qo(e, t) {
179
179
  const n = re(e, t);
180
- return await Te(ue, {
180
+ return await ke(ue, {
181
181
  ...n,
182
182
  shouldConfirm: !0
183
183
  }) === !0;
184
184
  }
185
- async function Po(e, t) {
185
+ async function zo(e, t) {
186
186
  const n = re(e, t);
187
- return await Te(ue, {
187
+ return await ke(ue, {
188
188
  ...n,
189
189
  shouldConfirm: !0,
190
190
  classes: ["destructive", ...n.classes]
191
191
  }) === !0;
192
192
  }
193
- function qo(e, t) {
194
- const n = re(e, t), o = ke(ue, {
193
+ function Ko(e, t) {
194
+ const n = re(e, t), o = be(ue, {
195
195
  ...n,
196
196
  isBare: !0,
197
197
  classes: ["wait", ...n.classes],
@@ -200,70 +200,70 @@ function qo(e, t) {
200
200
  });
201
201
  return () => le(o);
202
202
  }
203
- const F = {
203
+ const I = {
204
204
  unhandledErrorSupportText: "please contact support",
205
205
  errorHandler: (e) => console.error("Unhandled error:", e),
206
206
  defaultDateFormat: "M/d/yy",
207
207
  defaultTimeFormat: "H:mm",
208
208
  defaultCurrencyDivisor: 1
209
209
  };
210
- function zo(e) {
211
- Object.assign(F, e);
210
+ function Yo(e) {
211
+ Object.assign(I, e);
212
212
  }
213
213
  class ae extends Error {
214
214
  constructor(t) {
215
215
  super(t), this.name = "UserError";
216
216
  }
217
217
  }
218
- function dn(e) {
218
+ function vn(e) {
219
219
  return e instanceof ae ? e.message : `An application error has occurred:
220
220
 
221
- ${Ce(e).message}
221
+ ${Te(e).message}
222
222
 
223
- Please refresh the page and try again. If this error persists, ${F.unhandledErrorSupportText}.`;
223
+ Please refresh the page and try again. If this error persists, ${I.unhandledErrorSupportText}.`;
224
224
  }
225
- function Ce(e) {
226
- return fn(e) ? e : new Error(String(e));
225
+ function Te(e) {
226
+ return mn(e) ? e : new Error(String(e));
227
227
  }
228
- function fn(e) {
228
+ function mn(e) {
229
229
  return e instanceof Error || typeof e == "object" && e !== null && "message" in e && "name" in e;
230
230
  }
231
- async function Ko(e, t) {
232
- const n = Ce(e);
233
- return n instanceof ae || F.errorHandler(n), cn({
231
+ async function Xo(e, t) {
232
+ const n = Te(e);
233
+ return n instanceof ae || I.errorHandler(n), fn({
234
234
  title: t == null ? void 0 : t.title,
235
235
  message: n,
236
236
  classes: t == null ? void 0 : t.classes
237
237
  });
238
238
  }
239
- async function Yo(e) {
240
- const t = Ce(e);
241
- t instanceof ae || F.errorHandler(t);
239
+ async function Zo(e) {
240
+ const t = Te(e);
241
+ t instanceof ae || I.errorHandler(t);
242
242
  }
243
243
  const Z = Symbol("MaskState");
244
- function Xo(e, t) {
244
+ function Go(e, t) {
245
245
  var l;
246
246
  const n = (l = e.$) == null ? void 0 : l.vnode.el, o = n.closest(".vf-modal");
247
- return vn(o ?? n, t);
247
+ return pn(o ?? n, t);
248
248
  }
249
- function Zo(e) {
249
+ function Jo(e) {
250
250
  var o;
251
251
  const t = (o = e.$) == null ? void 0 : o.vnode.el, n = t.closest(".vf-modal");
252
- return st(n ?? t);
252
+ return lt(n ?? t);
253
253
  }
254
- function vn(e, t) {
254
+ function pn(e, t) {
255
255
  if (!e[Z]) {
256
256
  const n = document.createElement("div");
257
257
  n.classList.add("vf-mask"), e.appendChild(n), e[Z] = { maskEl: n };
258
258
  }
259
- return e[Z].maskEl.innerText = t ?? "", () => st(e);
259
+ return e[Z].maskEl.innerText = t ?? "", () => lt(e);
260
260
  }
261
- function st(e) {
261
+ function lt(e) {
262
262
  e[Z] && e.removeChild(e[Z].maskEl);
263
263
  }
264
- const ge = Symbol("FormMaskState");
265
- function mn(e, t, n) {
266
- const o = e instanceof Element ? e : lt(e);
264
+ const ye = Symbol("FormMaskState");
265
+ function hn(e, t, n) {
266
+ const o = e instanceof Element ? e : at(e);
267
267
  if (!o) return () => {
268
268
  };
269
269
  o.classList.add("vf-masked");
@@ -271,30 +271,30 @@ function mn(e, t, n) {
271
271
  let s;
272
272
  l && (s = l.tagName === "INPUT" ? l.value : l.innerHTML, l.setAttribute("disabled", "disabled"), l.innerText = n ?? "Please wait...");
273
273
  const r = [...o.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])")];
274
- return r.forEach((u) => u.setAttribute("disabled", "disabled")), o[ge] = {
274
+ return r.forEach((c) => c.setAttribute("disabled", "disabled")), o[ye] = {
275
275
  disabledElements: r,
276
276
  waitButton: l,
277
277
  buttonHtml: s
278
- }, () => it(o);
278
+ }, () => rt(o);
279
279
  }
280
- function it(e) {
281
- const t = e instanceof Element ? e : lt(e);
280
+ function rt(e) {
281
+ const t = e instanceof Element ? e : at(e);
282
282
  if (!t) return;
283
- const n = t[ge];
284
- n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ge]);
283
+ const n = t[ye];
284
+ n && (t.classList.remove("vf-masked"), n.disabledElements.forEach((o) => o.removeAttribute("disabled")), n.waitButton && (n.waitButton.innerHTML = n.buttonHtml, n.waitButton.removeAttribute("disabled")), delete t[ye]);
285
285
  }
286
- function lt(e) {
286
+ function at(e) {
287
287
  var n;
288
288
  const t = (n = e == null ? void 0 : e.$) == null ? void 0 : n.vnode.el;
289
289
  return t ? t.tagName === "FORM" ? t : t.querySelector("form") : null;
290
290
  }
291
- const pn = ["id"], hn = {
291
+ const yn = ["id"], gn = {
292
292
  key: 0,
293
293
  class: "vf-modal-header"
294
- }, yn = { class: "vf-modal-content" }, gn = {
294
+ }, wn = { class: "vf-modal-content" }, En = {
295
295
  key: 1,
296
296
  class: "vf-modal-footer"
297
- }, wn = /* @__PURE__ */ R({
297
+ }, bn = /* @__PURE__ */ R({
298
298
  __name: "vf-modal",
299
299
  props: {
300
300
  id: {},
@@ -305,16 +305,16 @@ const pn = ["id"], hn = {
305
305
  },
306
306
  emits: ["formSubmit"],
307
307
  setup(e, { expose: t }) {
308
- const n = we(), o = e;
309
- t({ mask: v, unmask: w, hide: g, unhide: c });
310
- const l = T(), s = T(), a = T(!1), r = M(() => tt([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
308
+ const n = ge(), o = e;
309
+ t({ mask: v, unmask: w, hide: g, unhide: u });
310
+ const l = T(), s = T(), a = T(!1), r = M(() => ot([...Array.isArray(o.class) ? o.class : [o.class], a.value && "hidden"]));
311
311
  _(() => {
312
312
  var d;
313
- document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", p), (d = l.value) == null || d.addEventListener("click", u));
314
- }), be(() => {
313
+ document.body.classList.add("vf-modal-open"), o.closeOnMaskClick && (window.addEventListener("keydown", p), (d = l.value) == null || d.addEventListener("click", c));
314
+ }), Ee(() => {
315
315
  window.removeEventListener("keydown", p), document.body.querySelectorAll(".vf-modal").length > 0 || document.body.classList.remove("vf-modal-open");
316
316
  });
317
- function u(d) {
317
+ function c(d) {
318
318
  d.target == l.value && E();
319
319
  }
320
320
  function p(d) {
@@ -324,18 +324,18 @@ const pn = ["id"], hn = {
324
324
  }
325
325
  }
326
326
  function E() {
327
- ot(n);
327
+ it(n);
328
328
  }
329
329
  function v() {
330
- return mn(s.value), () => w();
330
+ return hn(s.value), () => w();
331
331
  }
332
332
  function w() {
333
- it(s.value);
333
+ rt(s.value);
334
334
  }
335
335
  function g() {
336
- return a.value = !0, () => c();
336
+ return a.value = !0, () => u();
337
337
  }
338
- function c() {
338
+ function u() {
339
339
  a.value = !1;
340
340
  }
341
341
  return (d, S) => (b(), k("div", {
@@ -349,26 +349,26 @@ const pn = ["id"], hn = {
349
349
  ref: s,
350
350
  action: ".",
351
351
  class: $(["vf-modal", { scrolls: d.scrolls }]),
352
- onSubmit: S[0] || (S[0] = Ee((O) => d.$emit("formSubmit"), ["prevent"]))
352
+ onSubmit: S[0] || (S[0] = we((O) => d.$emit("formSubmit"), ["prevent"]))
353
353
  }, [
354
- d.$slots.header ? (b(), k("div", hn, [
355
- j(d.$slots, "header"),
354
+ d.$slots.header ? (b(), k("div", gn, [
355
+ U(d.$slots, "header"),
356
356
  o.closeX ? (b(), k("i", {
357
357
  key: 0,
358
358
  class: "close",
359
359
  onClick: E
360
360
  })) : A("", !0)
361
361
  ])) : A("", !0),
362
- B("div", yn, [
363
- j(d.$slots, "default")
362
+ B("div", wn, [
363
+ U(d.$slots, "default")
364
364
  ]),
365
- d.$slots.footer ? (b(), k("div", gn, [
366
- j(d.$slots, "footer")
365
+ d.$slots.footer ? (b(), k("div", En, [
366
+ U(d.$slots, "footer")
367
367
  ])) : A("", !0)
368
368
  ], 34)
369
- ], 10, pn));
369
+ ], 10, yn));
370
370
  }
371
- }), En = ["innerHtml"], bn = ["innerText"], ue = /* @__PURE__ */ R({
371
+ }), kn = ["innerHtml"], Tn = ["innerText"], ue = /* @__PURE__ */ R({
372
372
  __name: "vf-alert-modal",
373
373
  props: {
374
374
  isBare: { type: Boolean },
@@ -381,13 +381,13 @@ const pn = ["id"], hn = {
381
381
  callback: { type: Function }
382
382
  },
383
383
  setup(e) {
384
- const t = e, n = M(() => t.message instanceof Error ? dn(t.message) : t.message);
384
+ const t = e, n = M(() => t.message instanceof Error ? vn(t.message) : t.message);
385
385
  return (o, l) => {
386
- const s = Rt("autofocus");
387
- return b(), Je(wn, {
386
+ const s = Ut("autofocus");
387
+ return b(), et(bn, {
388
388
  class: $(["vf-alert", ...o.classes ?? []])
389
- }, Wt({
390
- default: pe(() => [
389
+ }, jt({
390
+ default: me(() => [
391
391
  o.iconClass ? (b(), k("i", {
392
392
  key: 0,
393
393
  class: $(["vf-alert-icon", o.iconClass])
@@ -396,23 +396,23 @@ const pn = ["id"], hn = {
396
396
  key: 1,
397
397
  innerHtml: o.message,
398
398
  class: "user-message"
399
- }, null, 8, En)) : (b(), k("div", {
399
+ }, null, 8, kn)) : (b(), k("div", {
400
400
  key: 2,
401
401
  innerText: n.value
402
- }, null, 8, bn))
402
+ }, null, 8, Tn))
403
403
  ]),
404
404
  _: 2
405
405
  }, [
406
406
  o.title ? {
407
407
  name: "header",
408
- fn: pe(() => [
408
+ fn: me(() => [
409
409
  X(W(o.title), 1)
410
410
  ]),
411
411
  key: "0"
412
412
  } : void 0,
413
413
  o.isBare ? void 0 : {
414
414
  name: "footer",
415
- fn: pe(() => [
415
+ fn: me(() => [
416
416
  o.shouldConfirm ? (b(), k(oe, { key: 0 }, [
417
417
  ne((b(), k("button", {
418
418
  class: "primary",
@@ -442,6 +442,70 @@ const pn = ["id"], hn = {
442
442
  };
443
443
  }
444
444
  });
445
+ function Qo(e, t, n) {
446
+ const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
447
+ return o === -1 ? !1 : (e.splice(o, 1, n), !0);
448
+ }
449
+ function es(e, t) {
450
+ const n = document.createElement("div");
451
+ n.classList.add("vf-overlay"), n.addEventListener("click", v), document.body.appendChild(n);
452
+ const o = document.createElement("div");
453
+ o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
454
+ const l = e.currentTarget;
455
+ l.style.userSelect = "none", l.classList.add("context-menu-active"), t.targetClass && l.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((g) => {
456
+ if (g == "-") {
457
+ const d = document.createElement("div");
458
+ d.classList.add("separator"), o.appendChild(d);
459
+ return;
460
+ }
461
+ const u = document.createElement("div");
462
+ u.classList.add("item"), u.style.userSelect = "none", u.innerText = g.title, o.appendChild(u), g.class && u.classList.add(g.class), g.shouldConfirm ? u.addEventListener("click", (d) => w(d, u, g.handler)) : u.addEventListener("click", () => g.handler());
463
+ });
464
+ const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, r = o.offsetHeight, c = o.offsetWidth, p = s < c ? e.clientX - c - 1 : e.clientX + 1, E = a < r ? e.clientY - r - 1 : e.clientY + 1;
465
+ o.style.left = p + "px", o.style.top = E + "px", setTimeout(() => {
466
+ o.style.width = o.offsetWidth + "px";
467
+ }, 50);
468
+ function v() {
469
+ t.targetClass && l.classList.remove(t.targetClass), l.classList.remove("context-menu-active"), l.style.userSelect = "", n.remove();
470
+ }
471
+ function w(g, u, d) {
472
+ if (u.classList.contains("pending-confirm"))
473
+ return d();
474
+ const S = u.innerHTML;
475
+ u.classList.add("pending-confirm"), u.innerText = "Confirm";
476
+ const O = () => {
477
+ u.classList.remove("pending-confirm"), u.innerHTML = S, u.removeEventListener("mouseleave", O);
478
+ };
479
+ u.addEventListener("mouseleave", O), g.stopPropagation();
480
+ }
481
+ }
482
+ const Cn = (e) => new Promise((t) => setTimeout(t, e)), ts = (e) => Cn(e * 1e3);
483
+ function Sn(e) {
484
+ return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
485
+ }
486
+ function ns(e, t) {
487
+ return e != null ? qt(e) : t;
488
+ }
489
+ function os(e, t) {
490
+ const n = { ...e };
491
+ for (const o of t)
492
+ n[o] === "" && (n[o] = null);
493
+ return n;
494
+ }
495
+ function je(e) {
496
+ return e != null;
497
+ }
498
+ function ss(e, t) {
499
+ Qt(e, {
500
+ ...t,
501
+ onError(n, o) {
502
+ var s;
503
+ n instanceof en && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new ae(n.body.error));
504
+ const l = (s = t.onError) == null ? void 0 : s.call(t, n, o);
505
+ return l !== void 0 ? l : n;
506
+ }
507
+ });
508
+ }
445
509
  /*!
446
510
  * currency.js - v2.0.4
447
511
  * http://scurker.github.io/currency.js
@@ -449,7 +513,7 @@ const pn = ["id"], hn = {
449
513
  * Copyright (c) 2021 Jason Wilson
450
514
  * Released under MIT license
451
515
  */
452
- var kn = {
516
+ var Mn = {
453
517
  symbol: "$",
454
518
  separator: ",",
455
519
  decimal: ".",
@@ -457,24 +521,24 @@ var kn = {
457
521
  precision: 2,
458
522
  pattern: "!#",
459
523
  negativePattern: "-!#",
460
- format: Mn,
524
+ format: In,
461
525
  fromCents: !1
462
- }, rt = function(t) {
526
+ }, ut = function(t) {
463
527
  return Math.round(t);
464
- }, Se = function(t) {
528
+ }, Ce = function(t) {
465
529
  return Math.pow(10, t);
466
- }, Tn = function(t, n) {
467
- return rt(t / n) * n;
468
- }, Cn = /(\d)(?=(\d{3})+\b)/g, Sn = /(\d)(?=(\d\d)+\d\b)/g;
530
+ }, Ln = function(t, n) {
531
+ return ut(t / n) * n;
532
+ }, xn = /(\d)(?=(\d{3})+\b)/g, Fn = /(\d)(?=(\d\d)+\d\b)/g;
469
533
  function V(e, t) {
470
534
  var n = this;
471
535
  if (!(n instanceof V))
472
536
  return new V(e, t);
473
- var o = Object.assign({}, kn, t), l = Se(o.precision), s = te(e, o);
474
- n.intValue = s, n.value = s / l, o.increment = o.increment || 1 / l, o.useVedic ? o.groups = Sn : o.groups = Cn, this.s = o, this.p = l;
537
+ var o = Object.assign({}, Mn, t), l = Ce(o.precision), s = te(e, o);
538
+ n.intValue = s, n.value = s / l, o.increment = o.increment || 1 / l, o.useVedic ? o.groups = Fn : o.groups = xn, this.s = o, this.p = l;
475
539
  }
476
540
  function te(e, t) {
477
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, a = t.precision, r = t.fromCents, u = Se(a), p = typeof e == "number", E = e instanceof V;
541
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, o = 0, l = t.decimal, s = t.errorOnInvalid, a = t.precision, r = t.fromCents, c = Ce(a), p = typeof e == "number", E = e instanceof V;
478
542
  if (E && r)
479
543
  return e.intValue;
480
544
  if (p || E)
@@ -487,10 +551,10 @@ function te(e, t) {
487
551
  throw Error("Invalid Input");
488
552
  o = 0;
489
553
  }
490
- return r || (o *= u, o = o.toFixed(4)), n ? rt(o) : o;
554
+ return r || (o *= c, o = o.toFixed(4)), n ? ut(o) : o;
491
555
  }
492
- function Mn(e, t) {
493
- var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, a = t.decimal, r = t.groups, u = ("" + e).replace(/^-/, "").split("."), p = u[0], E = u[1];
556
+ function In(e, t) {
557
+ var n = t.pattern, o = t.negativePattern, l = t.symbol, s = t.separator, a = t.decimal, r = t.groups, c = ("" + e).replace(/^-/, "").split("."), p = c[0], E = c[1];
494
558
  return (e.value >= 0 ? n : o).replace("!", l).replace("#", p.replace(r, "$1" + s) + (E ? a + E : ""));
495
559
  }
496
560
  V.prototype = {
@@ -519,7 +583,7 @@ V.prototype = {
519
583
  */
520
584
  multiply: function(t) {
521
585
  var n = this.intValue, o = this.s;
522
- return V((n *= t) / (o.fromCents ? 1 : Se(o.precision)), o);
586
+ return V((n *= t) / (o.fromCents ? 1 : Ce(o.precision)), o);
523
587
  },
524
588
  /**
525
589
  * Divides value.
@@ -537,9 +601,9 @@ V.prototype = {
537
601
  * @returns {array}
538
602
  */
539
603
  distribute: function(t) {
540
- for (var n = this.intValue, o = this.p, l = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), r = Math.abs(n - a * t), u = l.fromCents ? 1 : o; t !== 0; t--) {
541
- var p = V(a / u, l);
542
- r-- > 0 && (p = p[n >= 0 ? "add" : "subtract"](1 / u)), s.push(p);
604
+ for (var n = this.intValue, o = this.p, l = this.s, s = [], a = Math[n >= 0 ? "floor" : "ceil"](n / t), r = Math.abs(n - a * t), c = l.fromCents ? 1 : o; t !== 0; t--) {
605
+ var p = V(a / c, l);
606
+ r-- > 0 && (p = p[n >= 0 ? "add" : "subtract"](1 / c)), s.push(p);
543
607
  }
544
608
  return s;
545
609
  },
@@ -573,7 +637,7 @@ V.prototype = {
573
637
  */
574
638
  toString: function() {
575
639
  var t = this.intValue, n = this.p, o = this.s;
576
- return Tn(t / n, o.increment).toFixed(o.precision);
640
+ return Ln(t / n, o.increment).toFixed(o.precision);
577
641
  },
578
642
  /**
579
643
  * Value for JSON serialization.
@@ -586,59 +650,60 @@ V.prototype = {
586
650
  const x = [];
587
651
  for (let e = 0; e < 256; ++e)
588
652
  x.push((e + 256).toString(16).slice(1));
589
- function Ln(e, t = 0) {
653
+ function On(e, t = 0) {
590
654
  return (x[e[t + 0]] + x[e[t + 1]] + x[e[t + 2]] + x[e[t + 3]] + "-" + x[e[t + 4]] + x[e[t + 5]] + "-" + x[e[t + 6]] + x[e[t + 7]] + "-" + x[e[t + 8]] + x[e[t + 9]] + "-" + x[e[t + 10]] + x[e[t + 11]] + x[e[t + 12]] + x[e[t + 13]] + x[e[t + 14]] + x[e[t + 15]]).toLowerCase();
591
655
  }
592
- let he;
593
- const xn = new Uint8Array(16);
594
- function In() {
595
- if (!he) {
656
+ let pe;
657
+ const Dn = new Uint8Array(16);
658
+ function Hn() {
659
+ if (!pe) {
596
660
  if (typeof crypto > "u" || !crypto.getRandomValues)
597
661
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
598
- he = crypto.getRandomValues.bind(crypto);
662
+ pe = crypto.getRandomValues.bind(crypto);
599
663
  }
600
- return he(xn);
664
+ return pe(Dn);
601
665
  }
602
- const Fn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), je = { randomUUID: Fn };
603
- function On(e, t, n) {
666
+ const Vn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Pe = { randomUUID: Vn };
667
+ function An(e, t, n) {
604
668
  var l;
605
- if (je.randomUUID && !e)
606
- return je.randomUUID();
669
+ if (Pe.randomUUID && !e)
670
+ return Pe.randomUUID();
607
671
  e = e || {};
608
- const o = e.random ?? ((l = e.rng) == null ? void 0 : l.call(e)) ?? In();
672
+ const o = e.random ?? ((l = e.rng) == null ? void 0 : l.call(e)) ?? Hn();
609
673
  if (o.length < 16)
610
674
  throw new Error("Random bytes length must be >= 16");
611
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ln(o);
675
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, On(o);
612
676
  }
613
- function Go(e) {
677
+ function is(e) {
614
678
  return e.replace(/\n/g, "<br>");
615
679
  }
616
- function Dn(e) {
680
+ function $n(e) {
617
681
  return e.replace(/_/g, " ");
618
682
  }
619
- function Hn(e) {
683
+ function Bn(e) {
620
684
  const t = e.replace(/\D/g, "").replace(/^1/, "");
621
685
  return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
622
686
  }
623
- function Vn(e, t) {
624
- return V(e).divide(t ?? F.defaultCurrencyDivisor).format();
687
+ function _n(e, t) {
688
+ return V(e).divide(t ?? I.defaultCurrencyDivisor).format();
625
689
  }
626
- function Jo() {
627
- return On();
690
+ function ls() {
691
+ return An();
628
692
  }
629
- const An = ["disabled", "placeholder", "required", "name"], $n = {
693
+ const Nn = ["disabled", "placeholder", "required", "name"], Rn = {
630
694
  key: 0,
631
695
  class: "no-results"
632
- }, Bn = {
696
+ }, Wn = {
633
697
  key: 0,
634
698
  class: "group-title"
635
- }, _n = ["onMousemove", "onMousedown"], Nn = ["innerHTML"], Rn = ["innerHTML"], Wn = {
699
+ }, Un = ["onMousemove", "onMousedown"], jn = ["innerHTML"], Pn = ["innerHTML"], qn = {
636
700
  key: 1,
637
701
  class: "no-results"
638
- }, jn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Un = /* @__PURE__ */ R({
702
+ }, zn = "`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM", Kn = /* @__PURE__ */ R({
639
703
  __name: "vf-smart-select",
640
704
  props: {
641
705
  modelValue: {},
706
+ loadingText: {},
642
707
  loadOptions: { type: Function },
643
708
  options: {},
644
709
  prependOptions: {},
@@ -658,6 +723,7 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
658
723
  formatter: { type: Function },
659
724
  subtitleFormatter: { type: Function },
660
725
  classForOption: { type: Function },
726
+ selectionFormatter: { type: Function },
661
727
  nullTitle: {},
662
728
  noResultsText: {},
663
729
  disabled: { type: Boolean },
@@ -672,28 +738,28 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
672
738
  setup(e, { expose: t, emit: n }) {
673
739
  const o = Symbol("null"), l = Symbol("create"), s = e, a = n;
674
740
  t({
675
- addRemoteOption: Dt
741
+ addRemoteOption: Vt
676
742
  });
677
- const r = T(), u = T(), p = T(), E = T(!1), v = T(!1), w = T([]), g = T(!1), c = T(""), d = T(null), S = T(null), O = T(!1), L = T(null), xe = T(!1), ht = M(() => s.showCreateTextOnNewItem ?? !0), yt = M(() => s.prependOptions ?? []), gt = M(() => s.appendOptions ?? []), Ie = M(() => !!s.disabled), wt = M(() => !v.value && s.preload ? "Loading..." : s.nullTitle ? s.nullTitle : s.placeholder || ""), Et = M(() => s.noResultsText || "No options match your search."), q = M(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), z = M(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), ce = M(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), de = M(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Fe = M(() => [...yt.value, ...w.value, ...gt.value]), Oe = M(() => !!(s.groupField || s.groupFormatter)), fe = M(() => Fe.value.map((i, m) => {
678
- var _e, Ne, Re;
679
- const h = (_e = ce.value) == null ? void 0 : _e.call(ce, i), f = de.value(i), y = (Ne = s.subtitleFormatter) == null ? void 0 : Ne.call(s, i), C = f ? f.trim().toLowerCase() : "", Be = y ? y.trim().toLowerCase() : "", ee = [];
680
- return s.searchFields ? s.searchFields.forEach((We) => {
681
- i[We] && ee.push(String(i[We]).toLowerCase());
682
- }) : (ee.push(C), Be && ee.push(Be)), {
683
- key: ((Re = z.value) == null ? void 0 : Re.call(z, i)) ?? String(m),
743
+ const r = T(), c = T(), p = T(), E = T(!1), v = T(!1), w = T(), g = T(!1), u = T(""), d = T(null), S = T(null), O = T(!1), L = T(null), Le = T(!1), gt = M(() => s.showCreateTextOnNewItem ?? !0), wt = M(() => s.prependOptions ?? []), Et = M(() => s.appendOptions ?? []), xe = M(() => !!s.disabled || !s.options && !w.value), bt = M(() => !v.value && s.preload ? "Loading..." : s.nullTitle ? s.nullTitle : s.placeholder || ""), kt = M(() => s.noResultsText || "No options match your search."), q = M(() => s.valueExtractor ? s.valueExtractor : s.valueField ? (i) => i[s.valueField] : null), z = M(() => s.keyExtractor ? s.keyExtractor : s.keyField ? (i) => String(i[s.keyField]) : q.value ? (i) => String(q.value(i)) : null), ce = M(() => s.groupFormatter ? s.groupFormatter : s.groupField ? (i) => String(i[s.groupField]) : null), Fe = M(() => s.formatter ? s.formatter : s.labelField ? (i) => String(i[s.labelField]) : (i) => String(i)), Ie = M(() => s.selectionFormatter ? s.selectionFormatter : Fe.value), Oe = M(() => [...wt.value, ...w.value ?? [], ...Et.value]), De = M(() => !!(s.groupField || s.groupFormatter)), de = M(() => Oe.value.map((i, m) => {
744
+ var Ne, Re, We;
745
+ const h = (Ne = ce.value) == null ? void 0 : Ne.call(ce, i), f = Fe.value(i), y = (Re = s.subtitleFormatter) == null ? void 0 : Re.call(s, i), C = f ? f.trim().toLowerCase() : "", _e = y ? y.trim().toLowerCase() : "", ee = [];
746
+ return s.searchFields ? s.searchFields.forEach((Ue) => {
747
+ i[Ue] && ee.push(String(i[Ue]).toLowerCase());
748
+ }) : (ee.push(C), _e && ee.push(_e)), {
749
+ key: ((We = z.value) == null ? void 0 : We.call(z, i)) ?? String(m),
684
750
  group: h,
685
751
  title: f,
686
752
  subtitle: y,
687
753
  searchContent: ee.join(""),
688
754
  ref: i
689
755
  };
690
- })), I = M(() => {
691
- let i = [...fe.value];
756
+ })), F = M(() => {
757
+ let i = [...de.value];
692
758
  if (g.value) {
693
- const m = c.value.trim().toLowerCase();
759
+ const m = u.value.trim().toLowerCase();
694
760
  if (m.length) {
695
761
  i = i.filter((y) => y.searchContent.includes(m));
696
- const h = Gt(c.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), f = new RegExp(`(${h})`, "ig");
762
+ const h = tn(u.value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), f = new RegExp(`(${h})`, "ig");
697
763
  i = i.map((y) => {
698
764
  var C;
699
765
  return {
@@ -701,9 +767,9 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
701
767
  title: y.title.replace(f, "<mark>$1</mark>"),
702
768
  subtitle: (C = y.subtitle) == null ? void 0 : C.replace(f, "<mark>$1</mark>")
703
769
  };
704
- }), xe.value && (i.find((C) => C.searchContent === m) !== void 0 || i.push({
770
+ }), Le.value && (i.find((C) => C.searchContent === m) !== void 0 || i.push({
705
771
  key: l,
706
- title: ht.value ? "Create <strong>" + c.value.trim() + "</strong>..." : c.value.trim()
772
+ title: gt.value ? "Create <strong>" + u.value.trim() + "</strong>..." : u.value.trim()
707
773
  }));
708
774
  }
709
775
  } else s.nullTitle && i.unshift({
@@ -711,56 +777,56 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
711
777
  title: s.nullTitle
712
778
  });
713
779
  return i;
714
- }), bt = M(() => {
715
- if (!Oe.value)
780
+ }), Tt = M(() => {
781
+ if (!De.value)
716
782
  return [
717
783
  {
718
784
  groupTitle: "",
719
- options: I.value
785
+ options: F.value
720
786
  }
721
787
  ];
722
- const i = Ut(I.value.map((h) => h.group ?? "")), m = Pt(I.value, (h) => h.group ?? "");
788
+ const i = zt(F.value.map((h) => h.group ?? "")), m = Kt(F.value, (h) => h.group ?? "");
723
789
  return i.map((h) => ({
724
790
  groupTitle: h,
725
791
  options: m[h]
726
792
  }));
727
793
  });
728
- H(() => s.modelValue, me), H(
794
+ H(() => s.modelValue, ve), H(
729
795
  () => s.options,
730
796
  () => {
731
- w.value = s.options ?? [], v.value = !0;
797
+ w.value = s.options, v.value = !0;
732
798
  }
733
- ), H(fe, () => {
734
- O.value && setTimeout(Ve, 0);
735
- }), H(c, () => {
736
- g.value && !s.remoteSearch && !c.value.trim().length && (g.value = !1);
799
+ ), H(de, () => {
800
+ O.value && setTimeout(Ae, 0);
801
+ }), H(u, () => {
802
+ g.value && !s.remoteSearch && !u.value.trim().length && (g.value = !1);
737
803
  }), H(O, () => {
738
- O.value ? setTimeout(It, 0) : (g.value = !1, c.value = S.value ?? "", p.value && (p.value.style.visibility = "hidden"));
739
- }), H(I, () => {
804
+ O.value ? setTimeout(Ot, 0) : (g.value = !1, u.value = S.value ?? "", p.value && (p.value.style.visibility = "hidden"));
805
+ }), H(F, () => {
740
806
  var i;
741
- s.modelValue !== null && d.value === null && me(), (L.value !== null || g.value) && !I.value.find((m) => m.key == L.value) && (L.value = ((i = I.value[0]) == null ? void 0 : i.key) ?? o);
807
+ s.modelValue !== null && d.value === null && ve(), (L.value !== null || g.value) && !F.value.find((m) => m.key == L.value) && (L.value = ((i = F.value[0]) == null ? void 0 : i.key) ?? o);
742
808
  }), _(async () => {
743
- xe.value = s.onCreateItem !== void 0, s.options ? (w.value = [...s.options], v.value = !0) : s.preload && await De(), me(), H(d, () => {
809
+ Le.value = s.onCreateItem !== void 0, s.options ? (w.value = [...s.options], v.value = !0) : s.loadOptions && s.preload && await He(), !s.options && (s.valueField || s.valueExtractor) ? u.value = s.loadingText ?? "..." : ve(), H(d, () => {
744
810
  d.value !== s.modelValue && a(
745
811
  "update:modelValue",
746
- d.value !== null && q.value !== null ? q.value(d.value) : d.value
812
+ je(d.value) && q.value !== null ? q.value(d.value) : d.value
747
813
  );
748
- }), s.remoteSearch && H(c, qt(kt, 250));
814
+ }), s.remoteSearch && H(u, Yt(Ct, 250));
749
815
  });
750
- async function De() {
751
- await He(), w.value && a("optionsLoaded", w.value);
752
- }
753
816
  async function He() {
817
+ await Ve(), w.value && a("optionsLoaded", w.value);
818
+ }
819
+ async function Ve() {
754
820
  var m;
755
- const i = s.remoteSearch && g.value && c.value.length ? c.value : null;
821
+ const i = s.remoteSearch && g.value && u.value.length ? u.value : null;
756
822
  E.value = !0, w.value = await ((m = s.loadOptions) == null ? void 0 : m.call(s, i)) ?? [], E.value = !1, v.value = !0;
757
823
  }
758
- function kt() {
759
- g.value && (He(), g.value = c.value.trim().length > 0);
824
+ function Ct() {
825
+ g.value && (Ve(), g.value = u.value.trim().length > 0);
760
826
  }
761
- function Tt(i) {
827
+ function St(i) {
762
828
  if (i.key == "Escape") {
763
- i.stopPropagation(), i.target.blur(), $e();
829
+ i.stopPropagation(), i.target.blur(), Be();
764
830
  return;
765
831
  }
766
832
  if (!(i.key == "ArrowLeft" || i.key == "ArrowRight") && i.key != "Tab") {
@@ -769,51 +835,51 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
769
835
  return;
770
836
  }
771
837
  if (i.key == "ArrowUp" || i.key == "ArrowDown")
772
- return i.preventDefault(), ve(i.key == "ArrowUp" ? -1 : 1);
838
+ return i.preventDefault(), fe(i.key == "ArrowUp" ? -1 : 1);
773
839
  if (i.key == "PageUp" || i.key == "PageDown")
774
- return i.preventDefault(), ve(i.key == "PageUp" ? -10 : 10);
840
+ return i.preventDefault(), fe(i.key == "PageUp" ? -10 : 10);
775
841
  if (i.key == "Home" || i.key == "End")
776
- return i.preventDefault(), ve(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
842
+ return i.preventDefault(), fe(i.key == "Home" ? -Number.MAX_SAFE_INTEGER : Number.MAX_SAFE_INTEGER);
777
843
  if (i.key == "Enter") {
778
844
  i.preventDefault();
779
- const m = I.value.find((h) => h.key == L.value);
780
- if (m) return Ae(m);
845
+ const m = F.value.find((h) => h.key == L.value);
846
+ if (m) return $e(m);
781
847
  }
782
848
  if (i.key === "Delete" || i.key === "Backspace") {
783
- c.value.length > 1 && (g.value = !0);
849
+ u.value.length > 1 && (g.value = !0);
784
850
  return;
785
851
  }
786
- !i.metaKey && jn.includes(i.key) && (g.value = !0);
852
+ !i.metaKey && zn.includes(i.key) && (g.value = !0);
787
853
  }
788
854
  }
789
- function Ct() {
790
- St(), O.value = !0, setTimeout(() => {
855
+ function Mt() {
856
+ Lt(), O.value = !0, setTimeout(() => {
791
857
  var i;
792
- return (i = u.value) == null ? void 0 : i.select();
858
+ return (i = c.value) == null ? void 0 : i.select();
793
859
  }, 0);
794
860
  }
795
- function St(i) {
796
- d.value ? L.value = Mt(d.value) : s.nullTitle && (L.value = o);
861
+ function Lt(i) {
862
+ d.value ? L.value = xt(d.value) : s.nullTitle && (L.value = o);
797
863
  }
798
- function Mt(i) {
864
+ function xt(i) {
799
865
  var m;
800
- return z.value ? z.value(d.value) : ((m = Lt(i)) == null ? void 0 : m.key) ?? "";
866
+ return z.value ? z.value(d.value) : ((m = Ft(i)) == null ? void 0 : m.key) ?? "";
801
867
  }
802
- function Lt(i) {
803
- const m = I.value.find((y) => y.ref === i);
868
+ function Ft(i) {
869
+ const m = F.value.find((y) => y.ref === i);
804
870
  if (m)
805
871
  return m;
806
- const h = s.keyExtractor ? (y, C) => s.keyExtractor(y) === s.keyExtractor(C) : nt, f = I.value.find((y) => h(y.ref, i));
872
+ const h = s.keyExtractor ? (y, C) => s.keyExtractor(y) === s.keyExtractor(C) : st, f = F.value.find((y) => h(y.ref, i));
807
873
  return f || null;
808
874
  }
809
- function xt() {
810
- s.debug || (!c.value.length && s.nullTitle && (d.value = null, S.value = null), O.value = !1);
811
- }
812
875
  function It() {
876
+ s.debug || (!u.value.length && s.nullTitle && (d.value = null, S.value = null), O.value = !1);
877
+ }
878
+ function Ot() {
813
879
  var i;
814
- v.value || De(), s.optionsListId && ((i = p.value) == null || i.setAttribute("id", s.optionsListId)), Ft();
880
+ v.value || He(), s.optionsListId && ((i = p.value) == null || i.setAttribute("id", s.optionsListId)), Dt();
815
881
  }
816
- function Ft() {
882
+ function Dt() {
817
883
  const i = r.value.getBoundingClientRect(), m = i.y + i.height + 2, h = i.x, f = p.value, y = window.getComputedStyle(r.value);
818
884
  for (let C in y)
819
885
  /^(font|text)/.test(C) && (f.style[C] = y[C]);
@@ -821,44 +887,44 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
821
887
  const C = window.innerHeight - m - 12;
822
888
  f.style.maxHeight = C + "px";
823
889
  }
824
- f.style.visibility = "visible", document.body.appendChild(f), setTimeout(Ve, 0);
890
+ f.style.visibility = "visible", document.body.appendChild(f), setTimeout(Ae, 0);
825
891
  }
826
- function Ve() {
892
+ function Ae() {
827
893
  if (!v.value || !L.value) return;
828
- const i = I.value.findIndex((f) => f.key == L.value), m = p.value, h = m == null ? void 0 : m.querySelectorAll(".option")[i];
894
+ const i = F.value.findIndex((f) => f.key == L.value), m = p.value, h = m == null ? void 0 : m.querySelectorAll(".option")[i];
829
895
  h && (m.scrollTop = h.offsetTop);
830
896
  }
831
- function Ot(i) {
897
+ function Ht(i) {
832
898
  L.value = i ? i.key : null;
833
899
  }
834
- function ve(i) {
835
- const m = I.value.findIndex((C) => C.key == L.value);
900
+ function fe(i) {
901
+ const m = F.value.findIndex((C) => C.key == L.value);
836
902
  let h = m + i;
837
- if (h < 0 ? h = 0 : h >= I.value.length && (h = I.value.length - 1), m == h) return;
838
- L.value = I.value[h].key;
903
+ if (h < 0 ? h = 0 : h >= F.value.length && (h = F.value.length - 1), m == h) return;
904
+ L.value = F.value[h].key;
839
905
  const f = p.value, y = f == null ? void 0 : f.querySelectorAll(".option")[h];
840
906
  y && (y.offsetTop < f.scrollTop ? f.scrollTop = y.offsetTop : y.offsetTop + y.offsetHeight > f.scrollTop + f.clientHeight && (f.scrollTop = y.offsetTop + y.offsetHeight - f.clientHeight));
841
907
  }
842
- function Ae(i) {
908
+ function $e(i) {
843
909
  var m, h;
844
910
  if (g.value = !1, i.key === o)
845
- c.value = "", d.value = null, S.value = null;
911
+ u.value = "", d.value = null, S.value = null;
846
912
  else if (i.key === l) {
847
- const f = c.value.trim();
848
- c.value = "", d.value = null, S.value = null, (m = s.onCreateItem) == null || m.call(s, f);
913
+ const f = u.value.trim();
914
+ u.value = "", d.value = null, S.value = null, (m = s.onCreateItem) == null || m.call(s, f);
849
915
  } else {
850
- const y = fe.value.find((C) => C.key == i.key).ref;
851
- d.value = y, S.value = de.value(y), c.value = S.value ?? "";
916
+ const y = de.value.find((C) => C.key == i.key).ref;
917
+ d.value = y, S.value = Ie.value(y), u.value = S.value ?? "";
852
918
  }
853
- (h = u.value) == null || h.blur(), $e();
919
+ (h = c.value) == null || h.blur(), Be();
854
920
  }
855
- function me() {
856
- s.modelValue !== null ? (d.value = q.value ? Fe.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, S.value = d.value !== null ? de.value(d.value) : null, c.value = S.value ?? "") : (d.value = null, S.value = null, c.value = "");
921
+ function ve() {
922
+ s.modelValue !== null ? (d.value = q.value ? Oe.value.find((i) => s.modelValue === q.value(i)) : s.modelValue, S.value = je(d.value) ? Ie.value(d.value) : null, u.value = S.value ?? "") : (d.value = null, S.value = null, u.value = "");
857
923
  }
858
- function Dt(i) {
924
+ function Vt(i) {
859
925
  w.value.unshift(i);
860
926
  }
861
- function $e() {
927
+ function Be() {
862
928
  var y;
863
929
  if (!s.autoNext) return;
864
930
  let i = (y = r.value) == null ? void 0 : y.parentElement;
@@ -867,43 +933,43 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
867
933
  if (!i) return;
868
934
  const m = i.querySelectorAll('input, button, textarea, select, [tabindex]:not([tabindex="-1"])');
869
935
  if (!m) return;
870
- const h = Array.from(m).findIndex((C) => C === u.value), f = m[h + 1];
936
+ const h = Array.from(m).findIndex((C) => C === c.value), f = m[h + 1];
871
937
  f && setTimeout(() => f.focus(), 0);
872
938
  }
873
939
  return (i, m) => (b(), k("div", {
874
940
  ref_key: "el",
875
941
  ref: r,
876
- class: $(["vf-smart-select", { disabled: Ie.value, open: O.value }])
942
+ class: $(["vf-smart-select", { disabled: xe.value, open: O.value }])
877
943
  }, [
878
944
  ne(B("input", {
879
945
  ref_key: "searchField",
880
- ref: u,
881
- "onUpdate:modelValue": m[0] || (m[0] = (h) => c.value = h),
946
+ ref: c,
947
+ "onUpdate:modelValue": m[0] || (m[0] = (h) => u.value = h),
882
948
  type: "text",
883
- disabled: Ie.value,
949
+ disabled: xe.value,
884
950
  class: $({ nullable: !!i.nullTitle }),
885
- placeholder: wt.value,
951
+ placeholder: bt.value,
886
952
  required: i.required,
887
953
  name: i.name,
888
954
  "data-1p-ignore": "",
889
- onKeydown: Tt,
890
- onFocus: Ct,
891
- onBlur: xt
892
- }, null, 42, An), [
893
- [jt, c.value]
955
+ onKeydown: St,
956
+ onFocus: Mt,
957
+ onBlur: It
958
+ }, null, 42, Nn), [
959
+ [Pt, u.value]
894
960
  ]),
895
961
  O.value ? (b(), k("div", {
896
962
  key: 0,
897
963
  ref_key: "optionsContainer",
898
964
  ref: p,
899
- class: $(["vf-smart-select-options", { grouped: Oe.value }])
965
+ class: $(["vf-smart-select-options", { grouped: De.value }])
900
966
  }, [
901
- v.value ? (b(!0), k(oe, { key: 1 }, se(bt.value, (h) => (b(), k("div", {
967
+ v.value ? (b(!0), k(oe, { key: 1 }, se(Tt.value, (h) => (b(), k("div", {
902
968
  key: h.groupTitle,
903
969
  class: "group"
904
970
  }, [
905
- h.groupTitle ? (b(), k("div", Bn, [
906
- j(i.$slots, "group", {
971
+ h.groupTitle ? (b(), k("div", Wn, [
972
+ U(i.$slots, "group", {
907
973
  group: h.groupTitle
908
974
  }, () => [
909
975
  X(W(h.groupTitle), 1)
@@ -914,32 +980,32 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
914
980
  return b(), k("div", {
915
981
  key: f.key,
916
982
  class: $(["option", [L.value === f.key && "highlighted", f.ref && ((y = i.classForOption) == null ? void 0 : y.call(i, f.ref))]]),
917
- onMousemove: (C) => Ot(f),
918
- onMousedown: (C) => Ae(f)
983
+ onMousemove: (C) => Ht(f),
984
+ onMousedown: (C) => $e(f)
919
985
  }, [
920
- j(i.$slots, "option", { option: f }, () => [
986
+ U(i.$slots, "option", { option: f }, () => [
921
987
  B("div", {
922
988
  class: "title",
923
989
  innerHTML: f.title
924
- }, null, 8, Nn),
990
+ }, null, 8, jn),
925
991
  f.subtitle ? (b(), k("div", {
926
992
  key: 0,
927
993
  class: "subtitle",
928
994
  innerHTML: f.subtitle
929
- }, null, 8, Rn)) : A("", !0)
995
+ }, null, 8, Pn)) : A("", !0)
930
996
  ])
931
- ], 42, _n);
997
+ ], 42, Un);
932
998
  }), 128)),
933
- !I.value.length && c.value ? (b(), k("div", Wn, [
934
- j(i.$slots, "no-results", {}, () => [
935
- X(W(Et.value), 1)
999
+ !F.value.length && u.value ? (b(), k("div", qn, [
1000
+ U(i.$slots, "no-results", {}, () => [
1001
+ X(W(kt.value), 1)
936
1002
  ])
937
1003
  ])) : A("", !0)
938
- ]))), 128)) : (b(), k("div", $n, "Loading..."))
1004
+ ]))), 128)) : (b(), k("div", Rn, "Loading..."))
939
1005
  ], 2)) : A("", !0)
940
1006
  ], 2));
941
1007
  }
942
- }), Qo = /* @__PURE__ */ R({
1008
+ }), rs = /* @__PURE__ */ R({
943
1009
  __name: "vf-ez-smart-select",
944
1010
  props: {
945
1011
  modelValue: {},
@@ -951,22 +1017,22 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
951
1017
  },
952
1018
  emits: ["update:modelValue"],
953
1019
  setup(e, { emit: t }) {
954
- const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: String(r) })) : Object.entries(n.options).map(([r, u]) => ({
1020
+ const n = e, o = M(() => Array.isArray(n.options) ? n.options.map((r) => ({ value: r, label: String(r) })) : Object.entries(n.options).map(([r, c]) => ({
955
1021
  value: r,
956
- label: u
1022
+ label: c
957
1023
  }))), l = M(() => n.formatter ? (r) => n.formatter(r.label, r.value) : (r) => r.label), s = t, a = T(o.value.find((r) => r.value === n.modelValue) ?? null);
958
1024
  return H(
959
1025
  () => n.modelValue,
960
1026
  (r) => {
961
- a.value = o.value.find((u) => u.value === r) ?? null;
1027
+ a.value = o.value.find((c) => c.value === r) ?? null;
962
1028
  }
963
1029
  ), H(a, (r) => {
964
1030
  var p;
965
- const u = r ? (p = o.value.find((E) => nt(E, r))) == null ? void 0 : p.value : null;
966
- s("update:modelValue", u ?? null);
967
- }), (r, u) => (b(), Je(Un, {
1031
+ const c = r ? (p = o.value.find((E) => st(E, r))) == null ? void 0 : p.value : null;
1032
+ s("update:modelValue", c ?? null);
1033
+ }), (r, c) => (b(), et(Kn, {
968
1034
  modelValue: a.value,
969
- "onUpdate:modelValue": u[0] || (u[0] = (p) => a.value = p),
1035
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => a.value = p),
970
1036
  options: o.value,
971
1037
  formatter: l.value,
972
1038
  "null-title": r.nullTitle,
@@ -975,16 +1041,16 @@ const An = ["disabled", "placeholder", "required", "name"], $n = {
975
1041
  }, null, 8, ["modelValue", "options", "formatter", "null-title", "placeholder", "name"]));
976
1042
  }
977
1043
  });
978
- function es() {
1044
+ function as() {
979
1045
  return T();
980
1046
  }
981
- const Pn = { class: "content" }, qn = { class: "message" }, zn = {
1047
+ const Yn = { class: "content" }, Xn = { class: "message" }, Zn = {
982
1048
  key: 0,
983
1049
  class: "close"
984
- }, Kn = {
1050
+ }, Gn = {
985
1051
  key: 0,
986
1052
  class: "progress-bar"
987
- }, Yn = /* @__PURE__ */ R({
1053
+ }, Jn = /* @__PURE__ */ R({
988
1054
  __name: "vf-toast",
989
1055
  props: {
990
1056
  message: {},
@@ -1009,13 +1075,13 @@ const Pn = { class: "content" }, qn = { class: "message" }, zn = {
1009
1075
  }), setTimeout(() => t.callback(), l * 1e3);
1010
1076
  }), (l, s) => (b(), k("div", {
1011
1077
  class: $(["vf-toast", l.className]),
1012
- onClick: Ee(n, ["stop"])
1078
+ onClick: we(n, ["stop"])
1013
1079
  }, [
1014
- B("div", Pn, [
1015
- B("div", qn, W(l.message), 1),
1016
- l.disableClose ? A("", !0) : (b(), k("div", zn, "x"))
1080
+ B("div", Yn, [
1081
+ B("div", Xn, W(l.message), 1),
1082
+ l.disableClose ? A("", !0) : (b(), k("div", Zn, "x"))
1017
1083
  ]),
1018
- l.durationSecs !== null ? (b(), k("div", Kn, [
1084
+ l.durationSecs !== null ? (b(), k("div", Gn, [
1019
1085
  B("div", {
1020
1086
  ref_key: "progressInnerEl",
1021
1087
  ref: o,
@@ -1025,173 +1091,111 @@ const Pn = { class: "content" }, qn = { class: "message" }, zn = {
1025
1091
  ], 2));
1026
1092
  }
1027
1093
  });
1028
- function ts(e) {
1029
- const t = ke(Yn, {
1094
+ function us(e) {
1095
+ const t = be(Jn, {
1030
1096
  ...e,
1031
1097
  callback: () => le(t)
1032
1098
  });
1033
1099
  return () => le(t);
1034
1100
  }
1035
- function Xn(e) {
1101
+ function Qn(e) {
1036
1102
  const t = Math.floor(Math.log(e) / Math.log(1024)), o = (e / Math.pow(1024, t)).toFixed(2), l = ["B", "KB", "MB", "GB", "TB"][t];
1037
1103
  return `${o} ${l}`;
1038
1104
  }
1039
- function Zn(e) {
1040
- return e != null && String(e).length ? e : "-";
1041
- }
1042
- function Gn(e) {
1043
- return e || "-";
1044
- }
1045
- function Jn(e) {
1046
- return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : fo(Number(e));
1047
- }
1048
- function Qn(e) {
1049
- return e && Hn(e);
1050
- }
1051
1105
  function eo(e) {
1052
- return e ? Kt(e) : null;
1053
- }
1054
- function at(e) {
1055
- return e ? zt(e) : null;
1106
+ return e != null && String(e).length ? e : "-";
1056
1107
  }
1057
1108
  function to(e) {
1058
- return e ? e.toUpperCase() : null;
1109
+ return e || "-";
1059
1110
  }
1060
1111
  function no(e) {
1061
- return e ? at(e.toLowerCase()) : null;
1112
+ return e === null || typeof e == "string" && !/^\d+$/.test(e) ? e : Sn(Number(e));
1062
1113
  }
1063
1114
  function oo(e) {
1064
- return e ? Dn(e) : null;
1115
+ return e && Bn(e);
1065
1116
  }
1066
- function so(e, t) {
1067
- return Vn(e, t);
1117
+ function so(e) {
1118
+ return e ? Zt(e) : null;
1068
1119
  }
1069
- function io(e, t) {
1070
- return V(e).divide(t).value;
1120
+ function ct(e) {
1121
+ return e ? Xt(e) : null;
1071
1122
  }
1072
- function lo(e, t) {
1073
- return e && P(new Date(e), t ?? F.defaultDateFormat);
1123
+ function io(e) {
1124
+ return e ? e.toUpperCase() : null;
1074
1125
  }
1075
- function ro(e, t) {
1076
- return e && P(new Date(e), t ?? F.defaultTimeFormat);
1126
+ function lo(e) {
1127
+ return e ? ct(e.toLowerCase()) : null;
1077
1128
  }
1078
- function ao(e, t) {
1079
- return e && P(new Date(e), t ?? `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1080
- }
1081
- function uo(e) {
1082
- return e && P(Jt(Qt(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), F.defaultDateFormat);
1083
- }
1084
- const Ue = {
1085
- bytes: Xn,
1086
- dash: Zn,
1087
- dashZeros: Gn,
1088
- number: Jn,
1089
- phone: Qn,
1090
- upperFirst: eo,
1091
- startCase: at,
1092
- upperCase: to,
1093
- upperWords: no,
1094
- desnake: oo,
1095
- usCurrency: so,
1096
- divide: io,
1097
- date: lo,
1098
- time: ro,
1099
- dateTime: ao,
1100
- oneDayForward: uo
1101
- }, ns = (e) => ({
1102
- ...Ue,
1103
- ...e(Ue)
1104
- });
1105
- function os(e, t, n) {
1106
- const o = typeof t == "function" ? e.findIndex(t) : e.indexOf(t);
1107
- return o === -1 ? !1 : (e.splice(o, 1, n), !0);
1129
+ function ro(e) {
1130
+ return e ? $n(e) : null;
1108
1131
  }
1109
- function ss(e, t) {
1110
- const n = document.createElement("div");
1111
- n.classList.add("vf-overlay"), n.addEventListener("click", v), document.body.appendChild(n);
1112
- const o = document.createElement("div");
1113
- o.classList.add("vf-context-menu"), o.style.position = "absolute", n.appendChild(o);
1114
- const l = e.currentTarget;
1115
- l.style.userSelect = "none", l.classList.add("context-menu-active"), t.targetClass && l.classList.add(t.targetClass), t.class && o.classList.add(t.class), t.items.forEach((g) => {
1116
- if (g == "-") {
1117
- const d = document.createElement("div");
1118
- d.classList.add("separator"), o.appendChild(d);
1119
- return;
1120
- }
1121
- const c = document.createElement("div");
1122
- c.classList.add("item"), c.style.userSelect = "none", c.innerText = g.title, o.appendChild(c), g.class && c.classList.add(g.class), g.shouldConfirm ? c.addEventListener("click", (d) => w(d, c, g.handler)) : c.addEventListener("click", () => g.handler());
1123
- });
1124
- const s = window.innerWidth - e.clientX, a = window.innerHeight - e.clientY, r = o.offsetHeight, u = o.offsetWidth, p = s < u ? e.clientX - u - 1 : e.clientX + 1, E = a < r ? e.clientY - r - 1 : e.clientY + 1;
1125
- o.style.left = p + "px", o.style.top = E + "px", setTimeout(() => {
1126
- o.style.width = o.offsetWidth + "px";
1127
- }, 50);
1128
- function v() {
1129
- t.targetClass && l.classList.remove(t.targetClass), l.classList.remove("context-menu-active"), l.style.userSelect = "", n.remove();
1130
- }
1131
- function w(g, c, d) {
1132
- if (c.classList.contains("pending-confirm"))
1133
- return d();
1134
- const S = c.innerHTML;
1135
- c.classList.add("pending-confirm"), c.innerText = "Confirm";
1136
- const O = () => {
1137
- c.classList.remove("pending-confirm"), c.innerHTML = S, c.removeEventListener("mouseleave", O);
1138
- };
1139
- c.addEventListener("mouseleave", O), g.stopPropagation();
1140
- }
1132
+ function ao(e, t) {
1133
+ return _n(e, t);
1141
1134
  }
1142
- const co = (e) => new Promise((t) => setTimeout(t, e)), is = (e) => co(e * 1e3);
1143
- function fo(e) {
1144
- return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1135
+ function uo(e, t) {
1136
+ return V(e).divide(t).value;
1145
1137
  }
1146
- function ls(e, t) {
1147
- return e != null ? Yt(e) : t;
1138
+ function co(e, t) {
1139
+ return e && P(new Date(e), t ?? I.defaultDateFormat);
1148
1140
  }
1149
- function rs(e, t) {
1150
- const n = { ...e };
1151
- for (const o of t)
1152
- n[o] === "" && (n[o] = null);
1153
- return n;
1154
- }
1155
- function as(e, t) {
1156
- en(e, {
1157
- ...t,
1158
- onError(n, o) {
1159
- var s;
1160
- n instanceof tn && n.response.status === 422 && typeof n.body == "object" && n.body && "error" in n.body && typeof n.body.error == "string" && (n = new ae(n.body.error));
1161
- const l = (s = t.onError) == null ? void 0 : s.call(t, n, o);
1162
- return l !== void 0 ? l : n;
1163
- }
1164
- });
1165
- }
1166
- const Me = Symbol("HookState");
1167
- function us(e, t) {
1168
- const n = t ?? we();
1169
- _(() => vo(n, e), n), Qe(() => mo(n), n), et(() => Pe(n), n), be(() => Pe(n), n);
1141
+ function fo(e, t) {
1142
+ return e && P(new Date(e), t ?? I.defaultTimeFormat);
1170
1143
  }
1171
1144
  function vo(e, t) {
1145
+ return e && P(new Date(e), t ?? `${I.defaultDateFormat} ${I.defaultTimeFormat}`);
1146
+ }
1147
+ function mo(e) {
1148
+ return e && P(nn(on(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()), 1), I.defaultDateFormat);
1149
+ }
1150
+ const qe = {
1151
+ bytes: Qn,
1152
+ dash: eo,
1153
+ dashZeros: to,
1154
+ number: no,
1155
+ phone: oo,
1156
+ upperFirst: so,
1157
+ startCase: ct,
1158
+ upperCase: io,
1159
+ upperWords: lo,
1160
+ desnake: ro,
1161
+ usCurrency: ao,
1162
+ divide: uo,
1163
+ date: co,
1164
+ time: fo,
1165
+ dateTime: vo,
1166
+ oneDayForward: mo
1167
+ }, cs = (e) => ({
1168
+ ...qe,
1169
+ ...e(qe)
1170
+ }), Se = Symbol("HookState");
1171
+ function ds(e, t) {
1172
+ const n = t ?? ge();
1173
+ _(() => po(n, e), n), tt(() => ho(n), n), nt(() => ze(n), n), Ee(() => ze(n), n);
1174
+ }
1175
+ function po(e, t) {
1172
1176
  const n = {};
1173
1177
  if (t.elScrolledToBottom && (n.el = new G(e.vnode.el, t.elScrolledToBottom)), t.ancestorScrolledToBottom) {
1174
- const o = ut(e.vnode.el);
1178
+ const o = dt(e.vnode.el);
1175
1179
  o ? n.ancestor = new G(o, t.ancestorScrolledToBottom) : console.warn("[VueFoundation] No scollable ancestor found for component:", e);
1176
1180
  }
1177
- t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[Me] = n;
1181
+ t.windowScrolledToBottom && (n.window = new G(window, t.windowScrolledToBottom)), e[Se] = n;
1178
1182
  }
1179
- function mo(e) {
1183
+ function ho(e) {
1180
1184
  var n, o, l;
1181
- const t = e[Me];
1185
+ const t = e[Se];
1182
1186
  (n = t == null ? void 0 : t.el) == null || n.install(), (o = t == null ? void 0 : t.ancestor) == null || o.install(), (l = t == null ? void 0 : t.window) == null || l.install();
1183
1187
  }
1184
- function Pe(e) {
1188
+ function ze(e) {
1185
1189
  var n, o, l;
1186
- const t = e[Me];
1190
+ const t = e[Se];
1187
1191
  (n = t == null ? void 0 : t.el) == null || n.uninstall(), (o = t == null ? void 0 : t.ancestor) == null || o.uninstall(), (l = t == null ? void 0 : t.window) == null || l.uninstall();
1188
1192
  }
1189
- const ye = ["auto", "scroll"];
1190
- function ut(e) {
1193
+ const he = ["auto", "scroll"];
1194
+ function dt(e) {
1191
1195
  const t = e.parentElement;
1192
1196
  if (!t) return null;
1193
1197
  const n = window.getComputedStyle(t);
1194
- return ye.includes(n.overflow) || ye.includes(n.overflowX) || ye.includes(n.overflowY) ? t : ut(t);
1198
+ return he.includes(n.overflow) || he.includes(n.overflowX) || he.includes(n.overflowY) ? t : dt(t);
1195
1199
  }
1196
1200
  class G {
1197
1201
  constructor(t, n) {
@@ -1209,23 +1213,23 @@ class G {
1209
1213
  Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight ? this.isTripped || (this.handler(t), this.isTripped = !0) : this.isTripped && (this.isTripped = !1);
1210
1214
  }
1211
1215
  }
1212
- function cs(e) {
1213
- _(() => window.addEventListener("resize", e)), Qe(() => window.addEventListener("resize", e)), et(() => window.removeEventListener("resize", e)), be(() => window.removeEventListener("resize", e));
1216
+ function fs(e) {
1217
+ _(() => window.addEventListener("resize", e)), tt(() => window.addEventListener("resize", e)), nt(() => window.removeEventListener("resize", e)), Ee(() => window.removeEventListener("resize", e));
1214
1218
  }
1215
- const po = {
1216
- mounted: ze,
1217
- updated: ze
1218
- }, qe = Symbol("HasAutoFocused");
1219
- function ze(e, t) {
1220
- if (t.value === void 0 && e[qe] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1221
- e[qe] = !0;
1219
+ const yo = {
1220
+ mounted: Ye,
1221
+ updated: Ye
1222
+ }, Ke = Symbol("HasAutoFocused");
1223
+ function Ye(e, t) {
1224
+ if (t.value === void 0 && e[Ke] || t.value !== void 0 && !t.value || t.oldValue !== void 0 && t.value == t.oldValue) return;
1225
+ e[Ke] = !0;
1222
1226
  const n = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"].indexOf(e.tagName) > -1 ? e : e.querySelectorAll("input")[0];
1223
1227
  setTimeout(() => n.focus(), 10);
1224
1228
  }
1225
- const ho = {
1226
- mounted: yo
1229
+ const go = {
1230
+ mounted: wo
1227
1231
  }, K = Symbol("ConfirmState");
1228
- function yo(e, t) {
1232
+ function wo(e, t) {
1229
1233
  e.addEventListener("click", (n) => {
1230
1234
  var a, r;
1231
1235
  const o = Date.now(), l = ((a = t.value) == null ? void 0 : a.text) !== void 0 ? t.value.text : "Confirm";
@@ -1240,17 +1244,17 @@ function yo(e, t) {
1240
1244
  initTime: o,
1241
1245
  preconfirmHtml: e.innerHTML,
1242
1246
  resetHandler: () => {
1243
- var u;
1244
- l && (e.innerHTML = s.preconfirmHtml), (u = t.value) != null && u.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
1247
+ var c;
1248
+ l && (e.innerHTML = s.preconfirmHtml), (c = t.value) != null && c.class && e.classList.remove(t.value.class), e.blur(), e.removeEventListener("mouseout", s.resetHandler), delete e[K];
1245
1249
  }
1246
1250
  };
1247
1251
  e[K] = s, l && (e.innerHTML = l), (r = t.value) != null && r.class && e.classList.add(t.value.class), e.addEventListener("mouseout", s.resetHandler);
1248
1252
  });
1249
1253
  }
1250
- const go = {
1251
- beforeMount: wo
1254
+ const Eo = {
1255
+ beforeMount: bo
1252
1256
  };
1253
- function wo(e) {
1257
+ function bo(e) {
1254
1258
  e.addEventListener("blur", () => {
1255
1259
  let t = e.value;
1256
1260
  /^\d{1,2}\/\d{1,2}$/.test(t) && (t += "/" + P(/* @__PURE__ */ new Date(), "yy"));
@@ -1258,14 +1262,14 @@ function wo(e) {
1258
1262
  isNaN(n) ? e.value = "" : e.value = P(n, "MM/dd/yyyy"), e.dispatchEvent(new Event("input"));
1259
1263
  });
1260
1264
  }
1261
- const Eo = {
1262
- beforeMount: Ke,
1263
- updated: Ke
1265
+ const ko = {
1266
+ beforeMount: Xe,
1267
+ updated: Xe
1264
1268
  };
1265
- function Ke(e, t) {
1266
- t.value == t.oldValue && e.innerHTML.length || (e.innerText = bo(e, t));
1269
+ function Xe(e, t) {
1270
+ t.value == t.oldValue && e.innerHTML.length || (e.innerText = To(e, t));
1267
1271
  }
1268
- function bo(e, t) {
1272
+ function To(e, t) {
1269
1273
  var p, E;
1270
1274
  if (!t.value)
1271
1275
  return ((p = e.attributes.getNamedItem("placeholder")) == null ? void 0 : p.value) ?? "";
@@ -1282,51 +1286,51 @@ function bo(e, t) {
1282
1286
  let v = null;
1283
1287
  const w = /* @__PURE__ */ new Date();
1284
1288
  w.getFullYear() === s.getFullYear() ? (w.getMonth() !== s.getMonth() || w.getDate() !== s.getDate()) && (v = "M/d") : v = "M/d/yy";
1285
- const g = r ? null : F.defaultTimeFormat;
1286
- a = tt([v, g]).join(" ");
1289
+ const g = r ? null : I.defaultTimeFormat;
1290
+ a = ot([v, g]).join(" ");
1287
1291
  }
1288
- a || (r ? a = F.defaultDateFormat : a = `${F.defaultDateFormat} ${F.defaultTimeFormat}`);
1289
- let u = P(s, a);
1290
- return n && (u = n + " " + u), u;
1292
+ a || (r ? a = I.defaultDateFormat : a = `${I.defaultDateFormat} ${I.defaultTimeFormat}`);
1293
+ let c = P(s, a);
1294
+ return n && (c = n + " " + c), c;
1291
1295
  }
1292
- const ko = {
1293
- beforeMount: Ye,
1294
- updated: Ye,
1295
- unmounted: To
1296
+ const Co = {
1297
+ beforeMount: Ze,
1298
+ updated: Ze,
1299
+ unmounted: So
1296
1300
  };
1297
- function Ye(e, t) {
1301
+ function Ze(e, t) {
1298
1302
  e.tagName === "LABEL" && (t.value ? e.classList.remove("disabled") : e.classList.add("disabled"), e = e.querySelector("input")), t.value ? e.setAttribute("disabled", "disabled") : e.removeAttribute("disabled");
1299
1303
  }
1300
- function To(e) {
1304
+ function So(e) {
1301
1305
  e.tagName === "LABEL" && (e.classList.remove("disabled"), e = e.querySelector("input")), e.removeAttribute("disabled");
1302
1306
  }
1303
- const Co = {
1304
- beforeMount: Xe,
1305
- updated: Xe,
1306
- unmounted: dt
1307
- }, Q = Symbol("HasAutoFocused"), Le = [];
1308
- function So() {
1309
- Le.forEach(ct);
1307
+ const Mo = {
1308
+ beforeMount: Ge,
1309
+ updated: Ge,
1310
+ unmounted: vt
1311
+ }, Q = Symbol("HasAutoFocused"), Me = [];
1312
+ function Lo() {
1313
+ Me.forEach(ft);
1310
1314
  }
1311
- setInterval(So, 1e3);
1312
- function Xe(e, t) {
1315
+ setInterval(Lo, 1e3);
1316
+ function Ge(e, t) {
1313
1317
  var a;
1314
1318
  if (t.value == t.oldValue) return;
1315
- if (!t.value) return dt(e);
1319
+ if (!t.value) return vt(e);
1316
1320
  const n = new Date(t.value), o = (a = e.attributes.getNamedItem("base-time")) == null ? void 0 : a.value, l = n.getTime() - (o ? new Date(o).getTime() - t.value * 1e3 : 0), s = e.getAttribute("no-seconds") === null;
1317
- e[Q] || Le.push(e), e[Q] = {
1321
+ e[Q] || Me.push(e), e[Q] = {
1318
1322
  startTs: l,
1319
1323
  includeSeconds: s
1320
- }, ct(e);
1324
+ }, ft(e);
1321
1325
  }
1322
- function ct(e) {
1326
+ function ft(e) {
1323
1327
  const t = e[Q], n = Math.round((Date.now() - t.startTs) / 1e3);
1324
- e.innerText = Mo(n, t.includeSeconds);
1328
+ e.innerText = xo(n, t.includeSeconds);
1325
1329
  }
1326
- function dt(e) {
1327
- e[Q] && (Xt(Le, e), delete e[Q]), e.innerText = "-";
1330
+ function vt(e) {
1331
+ e[Q] && (Gt(Me, e), delete e[Q]), e.innerText = "-";
1328
1332
  }
1329
- function Mo(e, t) {
1333
+ function xo(e, t) {
1330
1334
  const n = [], o = Math.floor(e / 86400);
1331
1335
  o && n.push(o + "d"), e -= o * 86400;
1332
1336
  const l = Math.floor(e / 3600);
@@ -1334,34 +1338,34 @@ function Mo(e, t) {
1334
1338
  const s = Math.floor(e / 60);
1335
1339
  return (o || l || s) && n.push(s + "m"), t ? n.length || n.push("0m") : (e -= s * 60, n.push(e + "s")), n.join(" ");
1336
1340
  }
1337
- const Lo = {
1338
- mounted: ft,
1339
- updated: xo,
1340
- unmounted: vt
1341
- }, U = /* @__PURE__ */ new Map();
1342
- function ft(e, t) {
1343
- U.size === 0 && window.addEventListener("keydown", mt), U.set(t.value.toLowerCase(), [...U.get(t.value.toLowerCase()) ?? [], e]);
1341
+ const Fo = {
1342
+ mounted: mt,
1343
+ updated: Io,
1344
+ unmounted: pt
1345
+ }, j = /* @__PURE__ */ new Map();
1346
+ function mt(e, t) {
1347
+ j.size === 0 && window.addEventListener("keydown", ht), j.set(t.value.toLowerCase(), [...j.get(t.value.toLowerCase()) ?? [], e]);
1344
1348
  }
1345
- function vt(e, t) {
1346
- const n = U.get(t.value.toLowerCase());
1349
+ function pt(e, t) {
1350
+ const n = j.get(t.value.toLowerCase());
1347
1351
  if (n) {
1348
1352
  const o = n.indexOf(e);
1349
- o !== -1 && n.splice(o, 1), n.length === 0 && U.delete(t.value.toLowerCase());
1353
+ o !== -1 && n.splice(o, 1), n.length === 0 && j.delete(t.value.toLowerCase());
1350
1354
  }
1351
- U.size === 0 && window.removeEventListener("keydown", mt);
1355
+ j.size === 0 && window.removeEventListener("keydown", ht);
1352
1356
  }
1353
- function xo(e, t) {
1354
- vt(e, t), ft(e, t);
1357
+ function Io(e, t) {
1358
+ pt(e, t), mt(e, t);
1355
1359
  }
1356
- function mt(e) {
1360
+ function ht(e) {
1357
1361
  if (typeof e.key != "string") return;
1358
- const t = e.key.toLowerCase(), n = U.get(t);
1362
+ const t = e.key.toLowerCase(), n = j.get(t);
1359
1363
  if (n) {
1360
- const o = Zt(n);
1364
+ const o = Jt(n);
1361
1365
  o == null || o.click(), e.preventDefault();
1362
1366
  }
1363
1367
  }
1364
- const Y = Symbol("InfiniteScrollHandler"), Io = {
1368
+ const Y = Symbol("InfiniteScrollHandler"), Oo = {
1365
1369
  mounted(e, t) {
1366
1370
  e[Y] = new G(e, t.value);
1367
1371
  },
@@ -1373,19 +1377,19 @@ const Y = Symbol("InfiniteScrollHandler"), Io = {
1373
1377
  var t;
1374
1378
  (t = e[Y]) == null || t.uninstall(), delete e[Y];
1375
1379
  }
1376
- }, Fo = {
1377
- beforeMount: Ze,
1378
- updated: Ze
1380
+ }, Do = {
1381
+ beforeMount: Je,
1382
+ updated: Je
1379
1383
  };
1380
- function Ze(e, t) {
1384
+ function Je(e, t) {
1381
1385
  e.tagName == "LABEL" && (e = e.querySelector("input")), t.value ? e.setAttribute("readonly", "readonly") : e.removeAttribute("readonly");
1382
1386
  }
1383
- const Oo = {
1384
- mounted: Ge,
1385
- updated: Ge,
1386
- unmounted: pt
1387
+ const Ho = {
1388
+ mounted: Qe,
1389
+ updated: Qe,
1390
+ unmounted: yt
1387
1391
  }, J = Symbol("TooltipState");
1388
- function Ge(e, t) {
1392
+ function Qe(e, t) {
1389
1393
  var o;
1390
1394
  let n = ((o = e.attributes.getNamedItem("tip")) == null ? void 0 : o.value) ?? t.value;
1391
1395
  if (t.value || (n = null), n) {
@@ -1393,15 +1397,15 @@ function Ge(e, t) {
1393
1397
  content: n,
1394
1398
  html: e.getAttribute("html") !== null
1395
1399
  };
1396
- e[J] ? e[J].configure(l) : e[J] = new Do(e, l);
1400
+ e[J] ? e[J].configure(l) : e[J] = new Vo(e, l);
1397
1401
  } else
1398
- pt(e);
1402
+ yt(e);
1399
1403
  }
1400
- function pt(e) {
1404
+ function yt(e) {
1401
1405
  var t;
1402
1406
  (t = e[J]) == null || t.destroy(), delete e[J];
1403
1407
  }
1404
- class Do {
1408
+ class Vo {
1405
1409
  constructor(t, n) {
1406
1410
  D(this, "lastMoveEvt");
1407
1411
  D(this, "checkInterval");
@@ -1449,61 +1453,62 @@ class Do {
1449
1453
  this.shouldShow = !1, this.removeTooltip(), this.el.removeEventListener("mouseenter", this.handleTargetMouseEnterWithContext), this.el.removeEventListener("mouseleave", this.handleTargetMouseLeaveWithContext), this.el.removeEventListener("click", this.handleTargetMouseLeaveWithContext);
1450
1454
  }
1451
1455
  }
1452
- function Ho(e) {
1453
- e.directive("autofocus", po), e.directive("confirm-button", ho), e.directive("date-input", go), e.directive("datetime", Eo), e.directive("disabled", ko), e.directive("duration", Co), e.directive("hotkey", Lo), e.directive("infinite-scroll", Io), e.directive("readonly", Fo), e.directive("tooltip", Oo);
1456
+ function Ao(e) {
1457
+ e.directive("autofocus", yo), e.directive("confirm-button", go), e.directive("date-input", Eo), e.directive("datetime", ko), e.directive("disabled", Co), e.directive("duration", Mo), e.directive("hotkey", Fo), e.directive("infinite-scroll", Oo), e.directive("readonly", Do), e.directive("tooltip", Ho);
1454
1458
  }
1455
- function ds(e) {
1456
- Ho(e);
1459
+ function vs(e) {
1460
+ Ao(e);
1457
1461
  }
1458
1462
  export {
1459
- Wo as OverlayContainer,
1463
+ jo as OverlayContainer,
1460
1464
  ae as UserError,
1461
- Ro as VfAjaxSelect,
1465
+ Uo as VfAjaxSelect,
1462
1466
  ue as VfAlertModal,
1463
- Qo as VfEzSmartSelect,
1464
- wn as VfModal,
1465
- Un as VfSmartSelect,
1466
- ls as cloneProp,
1467
- zo as configureVf,
1468
- as as configureVfOpenApiClient,
1469
- ns as createFilters,
1470
- ke as createOverlayInjection,
1471
- Dn as desnakeCase,
1472
- un as dismissOverlayInjectionById,
1473
- jo as dismissOverlayInjectionByInstance,
1474
- ot as dismissOverlayInjectionByInternalInstance,
1475
- an as dismissOverlayInjectionByVnode,
1476
- ms as escapeHtml,
1477
- dn as formatError,
1478
- fo as formatNumber,
1479
- Hn as formatPhone,
1480
- Vn as formatUSCurrency,
1481
- Yo as handleError,
1482
- Ko as handleErrorAndAlert,
1483
- ds as installVf,
1484
- fn as isError,
1485
- Xo as maskComponent,
1486
- vn as maskEl,
1487
- mn as maskForm,
1488
- Go as nl2br,
1489
- rs as nullifyEmptyInputs,
1490
- Te as presentOverlay,
1467
+ rs as VfEzSmartSelect,
1468
+ bn as VfModal,
1469
+ Kn as VfSmartSelect,
1470
+ ns as cloneProp,
1471
+ Yo as configureVf,
1472
+ ss as configureVfOpenApiClient,
1473
+ cs as createFilters,
1474
+ be as createOverlayInjection,
1475
+ $n as desnakeCase,
1476
+ dn as dismissOverlayInjectionById,
1477
+ Po as dismissOverlayInjectionByInstance,
1478
+ it as dismissOverlayInjectionByInternalInstance,
1479
+ cn as dismissOverlayInjectionByVnode,
1480
+ hs as escapeHtml,
1481
+ vn as formatError,
1482
+ Sn as formatNumber,
1483
+ Bn as formatPhone,
1484
+ _n as formatUSCurrency,
1485
+ Zo as handleError,
1486
+ Xo as handleErrorAndAlert,
1487
+ vs as installVf,
1488
+ mn as isError,
1489
+ je as isNotNullOrUndefined,
1490
+ Go as maskComponent,
1491
+ pn as maskEl,
1492
+ hn as maskForm,
1493
+ is as nl2br,
1494
+ os as nullifyEmptyInputs,
1495
+ ke as presentOverlay,
1491
1496
  le as removeOverlayInjection,
1492
- os as replaceElement,
1493
- cn as showAlert,
1494
- Uo as showConfirm,
1495
- Po as showConfirmDestroy,
1496
- ss as showContextMenu,
1497
- ts as showToast,
1498
- qo as showWait,
1499
- co as sleep,
1500
- is as sleepSecs,
1501
- Ce as toError,
1502
- Zo as unmaskComponent,
1503
- st as unmaskEl,
1504
- it as unmaskForm,
1505
- us as useInfiniteScroll,
1506
- cs as useResizeWatcher,
1507
- Jo as uuid,
1508
- es as vfModalRef
1497
+ Qo as replaceElement,
1498
+ fn as showAlert,
1499
+ qo as showConfirm,
1500
+ zo as showConfirmDestroy,
1501
+ es as showContextMenu,
1502
+ us as showToast,
1503
+ Ko as showWait,
1504
+ Cn as sleep,
1505
+ ts as sleepSecs,
1506
+ Te as toError,
1507
+ Jo as unmaskComponent,
1508
+ lt as unmaskEl,
1509
+ rt as unmaskForm,
1510
+ ds as useInfiniteScroll,
1511
+ fs as useResizeWatcher,
1512
+ ls as uuid,
1513
+ as as vfModalRef
1509
1514
  };