@foisit/vue-wrapper 2.4.5 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -3,22 +3,22 @@
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [], we = () => {
6
+ const se = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {}, ze = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [], ve = () => {
7
7
  }, Be = (i) => i.charCodeAt(0) === 111 && i.charCodeAt(1) === 110 && // uppercase letter
8
- (i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97), z = Object.assign, k = Array.isArray, I = (i) => typeof i == "function", R = (i) => typeof i == "string", xe = (i) => typeof i == "symbol", T = (i) => i !== null && typeof i == "object";
8
+ (i.charCodeAt(2) > 122 || i.charCodeAt(2) < 97), W = Object.assign, L = Array.isArray, R = (i) => typeof i == "function", $ = (i) => typeof i == "string", we = (i) => typeof i == "symbol", F = (i) => i !== null && typeof i == "object";
9
9
  let he;
10
10
  const Q = () => he || (he = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
11
11
  function le(i) {
12
- if (k(i)) {
12
+ if (L(i)) {
13
13
  const e = {};
14
14
  for (let t = 0; t < i.length; t++) {
15
- const s = i[t], n = R(s) ? Ye(s) : le(s);
15
+ const s = i[t], n = $(s) ? Ye(s) : le(s);
16
16
  if (n)
17
17
  for (const o in n)
18
18
  e[o] = n[o];
19
19
  }
20
20
  return e;
21
- } else if (R(i) || T(i))
21
+ } else if ($(i) || F(i))
22
22
  return i;
23
23
  }
24
24
  const Ue = /;(?![^(]*\))/g, We = /:([^]+)/, je = /\/\*[^]*?\*\//g;
@@ -33,14 +33,14 @@ function Ye(i) {
33
33
  }
34
34
  function ce(i) {
35
35
  let e = "";
36
- if (R(i))
36
+ if ($(i))
37
37
  e = i;
38
- else if (k(i))
38
+ else if (L(i))
39
39
  for (let t = 0; t < i.length; t++) {
40
40
  const s = ce(i[t]);
41
41
  s && (e += s + " ");
42
42
  }
43
- else if (T(i))
43
+ else if (F(i))
44
44
  for (const t in i)
45
45
  i[t] && (e += t + " ");
46
46
  return e.trim();
@@ -54,7 +54,7 @@ process.env.NODE_ENV;
54
54
  process.env.NODE_ENV;
55
55
  process.env.NODE_ENV;
56
56
  new Set(
57
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(xe)
57
+ /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((i) => i !== "arguments" && i !== "caller").map((i) => Symbol[i]).filter(we)
58
58
  );
59
59
  function Ce(i) {
60
60
  return ne(i) ? Ce(i.__v_raw) : !!(i && i.__v_isReactive);
@@ -68,9 +68,9 @@ function Z(i) {
68
68
  function oe(i) {
69
69
  return i ? !!i.__v_raw : !1;
70
70
  }
71
- function O(i) {
71
+ function H(i) {
72
72
  const e = i && i.__v_raw;
73
- return e ? O(e) : i;
73
+ return e ? H(e) : i;
74
74
  }
75
75
  function de(i) {
76
76
  return i ? i.__v_isRef === !0 : !1;
@@ -80,18 +80,18 @@ function de(i) {
80
80
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
81
81
  * @license MIT
82
82
  **/
83
- const $ = [];
83
+ const P = [];
84
84
  function Ge(i) {
85
- $.push(i);
85
+ P.push(i);
86
86
  }
87
87
  function Ke() {
88
- $.pop();
88
+ P.pop();
89
89
  }
90
90
  let ee = !1;
91
- function _(i, ...e) {
91
+ function M(i, ...e) {
92
92
  if (ee) return;
93
93
  ee = !0;
94
- const t = $.length ? $[$.length - 1].component : null, s = t && t.appContext.config.warnHandler, n = Je();
94
+ const t = P.length ? P[P.length - 1].component : null, s = t && t.appContext.config.warnHandler, n = Je();
95
95
  if (s)
96
96
  ue(
97
97
  s,
@@ -119,7 +119,7 @@ function _(i, ...e) {
119
119
  ee = !1;
120
120
  }
121
121
  function Je() {
122
- let i = $[$.length - 1];
122
+ let i = P[P.length - 1];
123
123
  if (!i)
124
124
  return [];
125
125
  const e = [];
@@ -152,13 +152,13 @@ function Qe({ vnode: i, recurseCount: e }) {
152
152
  function Ze(i) {
153
153
  const e = [], t = Object.keys(i);
154
154
  return t.slice(0, 3).forEach((s) => {
155
- e.push(...Se(s, i[s]));
155
+ e.push(...ke(s, i[s]));
156
156
  }), t.length > 3 && e.push(" ..."), e;
157
157
  }
158
- function Se(i, e, t) {
159
- return R(e) ? (e = JSON.stringify(e), t ? e : [`${i}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? t ? e : [`${i}=${e}`] : de(e) ? (e = Se(i, O(e.value), !0), t ? e : [`${i}=Ref<`, e, ">"]) : I(e) ? [`${i}=fn${e.name ? `<${e.name}>` : ""}`] : (e = O(e), t ? e : [`${i}=`, e]);
158
+ function ke(i, e, t) {
159
+ return $(e) ? (e = JSON.stringify(e), t ? e : [`${i}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? t ? e : [`${i}=${e}`] : de(e) ? (e = ke(i, H(e.value), !0), t ? e : [`${i}=Ref<`, e, ">"]) : R(e) ? [`${i}=fn${e.name ? `<${e.name}>` : ""}`] : (e = H(e), t ? e : [`${i}=`, e]);
160
160
  }
161
- const Ee = {
161
+ const Se = {
162
162
  sp: "serverPrefetch hook",
163
163
  bc: "beforeCreate hook",
164
164
  c: "created hook",
@@ -195,19 +195,19 @@ function ue(i, e, t, s) {
195
195
  try {
196
196
  return s ? i(...s) : i();
197
197
  } catch (n) {
198
- ke(n, e, t);
198
+ Ee(n, e, t);
199
199
  }
200
200
  }
201
- function ke(i, e, t, s = !0) {
201
+ function Ee(i, e, t, s = !0) {
202
202
  const n = e ? e.vnode : null, { errorHandler: o, throwUnhandledErrorInProduction: a } = e && e.appContext.config || se;
203
203
  if (e) {
204
204
  let r = e.parent;
205
- const c = e.proxy, h = process.env.NODE_ENV !== "production" ? Ee[t] : `https://vuejs.org/error-reference/#runtime-${t}`;
205
+ const l = e.proxy, m = process.env.NODE_ENV !== "production" ? Se[t] : `https://vuejs.org/error-reference/#runtime-${t}`;
206
206
  for (; r; ) {
207
207
  const d = r.ec;
208
208
  if (d) {
209
- for (let l = 0; l < d.length; l++)
210
- if (d[l](i, c, h) === !1)
209
+ for (let c = 0; c < d.length; c++)
210
+ if (d[c](i, l, m) === !1)
211
211
  return;
212
212
  }
213
213
  r = r.parent;
@@ -215,8 +215,8 @@ function ke(i, e, t, s = !0) {
215
215
  if (o) {
216
216
  ue(o, null, 10, [
217
217
  i,
218
- c,
219
- h
218
+ l,
219
+ m
220
220
  ]);
221
221
  return;
222
222
  }
@@ -225,8 +225,8 @@ function ke(i, e, t, s = !0) {
225
225
  }
226
226
  function et(i, e, t, s = !0, n = !1) {
227
227
  if (process.env.NODE_ENV !== "production") {
228
- const o = Ee[e];
229
- if (t && Ge(t), _(`Unhandled error${o ? ` during execution of ${o}` : ""}`), t && Ke(), s)
228
+ const o = Se[e];
229
+ if (t && Ge(t), M(`Unhandled error${o ? ` during execution of ${o}` : ""}`), t && Ke(), s)
230
230
  throw i;
231
231
  console.error(i);
232
232
  } else {
@@ -235,57 +235,57 @@ function et(i, e, t, s = !0, n = !1) {
235
235
  console.error(i);
236
236
  }
237
237
  }
238
- const S = [];
239
- let A = -1;
240
- const P = [];
241
- let N = null, F = 0;
238
+ const _ = [];
239
+ let N = -1;
240
+ const z = [];
241
+ let O = null, D = 0;
242
242
  const tt = /* @__PURE__ */ Promise.resolve();
243
243
  let re = null;
244
244
  const it = 100;
245
245
  function st(i) {
246
- let e = A + 1, t = S.length;
246
+ let e = N + 1, t = _.length;
247
247
  for (; e < t; ) {
248
- const s = e + t >>> 1, n = S[s], o = D(n);
248
+ const s = e + t >>> 1, n = _[s], o = B(n);
249
249
  o < i || o === i && n.flags & 2 ? e = s + 1 : t = s;
250
250
  }
251
251
  return e;
252
252
  }
253
253
  function nt(i) {
254
254
  if (!(i.flags & 1)) {
255
- const e = D(i), t = S[S.length - 1];
255
+ const e = B(i), t = _[_.length - 1];
256
256
  !t || // fast path when the job id is larger than the tail
257
- !(i.flags & 2) && e >= D(t) ? S.push(i) : S.splice(st(e), 0, i), i.flags |= 1, _e();
257
+ !(i.flags & 2) && e >= B(t) ? _.push(i) : _.splice(st(e), 0, i), i.flags |= 1, _e();
258
258
  }
259
259
  }
260
260
  function _e() {
261
261
  re || (re = tt.then(Ae));
262
262
  }
263
263
  function ot(i) {
264
- k(i) ? P.push(...i) : N && i.id === -1 ? N.splice(F + 1, 0, i) : i.flags & 1 || (P.push(i), i.flags |= 1), _e();
264
+ L(i) ? z.push(...i) : O && i.id === -1 ? O.splice(D + 1, 0, i) : i.flags & 1 || (z.push(i), i.flags |= 1), _e();
265
265
  }
266
266
  function rt(i) {
267
- if (P.length) {
268
- const e = [...new Set(P)].sort(
269
- (t, s) => D(t) - D(s)
267
+ if (z.length) {
268
+ const e = [...new Set(z)].sort(
269
+ (t, s) => B(t) - B(s)
270
270
  );
271
- if (P.length = 0, N) {
272
- N.push(...e);
271
+ if (z.length = 0, O) {
272
+ O.push(...e);
273
273
  return;
274
274
  }
275
- for (N = e, process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map()), F = 0; F < N.length; F++) {
276
- const t = N[F];
275
+ for (O = e, process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map()), D = 0; D < O.length; D++) {
276
+ const t = O[D];
277
277
  process.env.NODE_ENV !== "production" && Le(i, t) || (t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), t.flags &= -2);
278
278
  }
279
- N = null, F = 0;
279
+ O = null, D = 0;
280
280
  }
281
281
  }
282
- const D = (i) => i.id == null ? i.flags & 2 ? -1 : 1 / 0 : i.id;
282
+ const B = (i) => i.id == null ? i.flags & 2 ? -1 : 1 / 0 : i.id;
283
283
  function Ae(i) {
284
284
  process.env.NODE_ENV !== "production" && (i = i || /* @__PURE__ */ new Map());
285
- const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) : we;
285
+ const e = process.env.NODE_ENV !== "production" ? (t) => Le(i, t) : ve;
286
286
  try {
287
- for (A = 0; A < S.length; A++) {
288
- const t = S[A];
287
+ for (N = 0; N < _.length; N++) {
288
+ const t = _[N];
289
289
  if (t && !(t.flags & 8)) {
290
290
  if (process.env.NODE_ENV !== "production" && e(t))
291
291
  continue;
@@ -297,18 +297,18 @@ function Ae(i) {
297
297
  }
298
298
  }
299
299
  } finally {
300
- for (; A < S.length; A++) {
301
- const t = S[A];
300
+ for (; N < _.length; N++) {
301
+ const t = _[N];
302
302
  t && (t.flags &= -2);
303
303
  }
304
- A = -1, S.length = 0, rt(i), re = null, (S.length || P.length) && Ae(i);
304
+ N = -1, _.length = 0, rt(i), re = null, (_.length || z.length) && Ae(i);
305
305
  }
306
306
  }
307
307
  function Le(i, e) {
308
308
  const t = i.get(e) || 0;
309
309
  if (t > it) {
310
310
  const s = e.i, n = s && Pe(s.type);
311
- return ke(
311
+ return Ee(
312
312
  `Maximum recursive updates exceeded${n ? ` in component <${n}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
313
313
  null,
314
314
  10
@@ -357,7 +357,7 @@ function ct(i, e) {
357
357
  });
358
358
  }
359
359
  function pe(i, e) {
360
- z(i, e);
360
+ W(i, e);
361
361
  for (const t in i)
362
362
  t !== "__file" && !(t in e) && delete i[t];
363
363
  }
@@ -372,100 +372,100 @@ function ie(i) {
372
372
  }
373
373
  };
374
374
  }
375
- let H, j = [];
375
+ let q, j = [];
376
376
  function Me(i, e) {
377
377
  var t, s;
378
- H = i, H ? (H.enabled = !0, j.forEach(({ event: n, args: o }) => H.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
378
+ q = i, q ? (q.enabled = !0, j.forEach(({ event: n, args: o }) => q.emit(n, ...o)), j = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
379
379
  window.HTMLElement && // also exclude jsdom
380
380
  // eslint-disable-next-line no-restricted-syntax
381
381
  !((s = (t = window.navigator) == null ? void 0 : t.userAgent) != null && s.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((o) => {
382
382
  Me(o, e);
383
383
  }), setTimeout(() => {
384
- H || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
384
+ q || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, j = []);
385
385
  }, 3e3)) : j = [];
386
386
  }
387
- let M = null, dt = null;
387
+ let T = null, dt = null;
388
388
  function ut(i, e) {
389
- if (process.env.NODE_ENV !== "production" && (!L || L.isMounted) && _("provide() can only be used inside setup()."), L) {
390
- let t = L.provides;
391
- const s = L.parent && L.parent.provides;
392
- s === t && (t = L.provides = Object.create(s)), t[i] = e;
389
+ if (process.env.NODE_ENV !== "production" && (!I || I.isMounted) && M("provide() can only be used inside setup()."), I) {
390
+ let t = I.provides;
391
+ const s = I.parent && I.parent.provides;
392
+ s === t && (t = I.provides = Object.create(s)), t[i] = e;
393
393
  }
394
394
  }
395
395
  function ft(i, e, t = !1) {
396
- const s = It();
397
- if (s || vt) {
396
+ const s = Nt();
397
+ if (s || xt) {
398
398
  let n = s ? s.parent == null || s.ce ? s.vnode.appContext && s.vnode.appContext.provides : s.parent.provides : void 0;
399
399
  if (n && i in n)
400
400
  return n[i];
401
401
  if (arguments.length > 1)
402
- return t && I(e) ? e.call(s && s.proxy) : e;
403
- process.env.NODE_ENV !== "production" && _(`injection "${String(i)}" not found.`);
404
- } else process.env.NODE_ENV !== "production" && _("inject() can only be used inside setup() or functional components.");
402
+ return t && R(e) ? e.call(s && s.proxy) : e;
403
+ process.env.NODE_ENV !== "production" && M(`injection "${String(i)}" not found.`);
404
+ } else process.env.NODE_ENV !== "production" && M("inject() can only be used inside setup() or functional components.");
405
405
  }
406
406
  const mt = (i) => i.__isTeleport;
407
- function Ie(i, e) {
408
- i.shapeFlag & 6 && i.component ? (i.transition = e, Ie(i.component.subTree, e)) : i.shapeFlag & 128 ? (i.ssContent.transition = e.clone(i.ssContent), i.ssFallback.transition = e.clone(i.ssFallback)) : i.transition = e;
407
+ function Ne(i, e) {
408
+ i.shapeFlag & 6 && i.component ? (i.transition = e, Ne(i.component.subTree, e)) : i.shapeFlag & 128 ? (i.ssContent.transition = e.clone(i.ssContent), i.ssFallback.transition = e.clone(i.ssFallback)) : i.transition = e;
409
409
  }
410
410
  // @__NO_SIDE_EFFECTS__
411
411
  function ht(i, e) {
412
- return I(i) ? (
412
+ return R(i) ? (
413
413
  // #8236: extend call and options.name access are considered side-effects
414
414
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
415
- z({ name: i.name }, e, { setup: i })
415
+ W({ name: i.name }, e, { setup: i })
416
416
  ) : i;
417
417
  }
418
418
  Q().requestIdleCallback;
419
419
  Q().cancelIdleCallback;
420
420
  const pt = (i) => !!i.type.__asyncLoader, gt = /* @__PURE__ */ Symbol.for("v-ndc");
421
- function yt(i, e, t = {}, s, n) {
422
- if (M.ce || M.parent && pt(M.parent) && M.parent.ce) {
423
- const h = Object.keys(t).length > 0;
424
- return ge(), ye(
425
- q,
421
+ function bt(i, e, t = {}, s, n) {
422
+ if (T.ce || T.parent && pt(T.parent) && T.parent.ce) {
423
+ const m = Object.keys(t).length > 0;
424
+ return ge(), be(
425
+ U,
426
426
  null,
427
427
  [fe("slot", t, s)],
428
- h ? -2 : 64
428
+ m ? -2 : 64
429
429
  );
430
430
  }
431
431
  let o = i[e];
432
- process.env.NODE_ENV !== "production" && o && o.length > 1 && (_(
432
+ process.env.NODE_ENV !== "production" && o && o.length > 1 && (M(
433
433
  "SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."
434
434
  ), o = () => []), o && o._c && (o._d = !1), ge();
435
- const a = o && Ne(o(t)), r = t.key || // slot content array of a dynamic conditional slot may have a branch
435
+ const a = o && Ie(o(t)), r = t.key || // slot content array of a dynamic conditional slot may have a branch
436
436
  // key attached in the `createSlots` helper, respect that
437
- a && a.key, c = ye(
438
- q,
437
+ a && a.key, l = be(
438
+ U,
439
439
  {
440
- key: (r && !xe(r) ? r : `_${e}`) + // #7256 force differentiate fallback content from actual content
440
+ key: (r && !we(r) ? r : `_${e}`) + // #7256 force differentiate fallback content from actual content
441
441
  (!a && s ? "_fb" : "")
442
442
  },
443
443
  a || [],
444
444
  a && i._ === 1 ? 64 : -2
445
445
  );
446
- return c.scopeId && (c.slotScopeIds = [c.scopeId + "-s"]), o && o._c && (o._d = !0), c;
446
+ return l.scopeId && (l.slotScopeIds = [l.scopeId + "-s"]), o && o._c && (o._d = !0), l;
447
447
  }
448
- function Ne(i) {
449
- return i.some((e) => Oe(e) ? !(e.type === Te || e.type === q && !Ne(e.children)) : !0) ? i : null;
448
+ function Ie(i) {
449
+ return i.some((e) => Oe(e) ? !(e.type === Re || e.type === U && !Ie(e.children)) : !0) ? i : null;
450
450
  }
451
- const bt = {};
452
- process.env.NODE_ENV !== "production" && (bt.ownKeys = (i) => (_(
451
+ const yt = {};
452
+ process.env.NODE_ENV !== "production" && (yt.ownKeys = (i) => (M(
453
453
  "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
454
454
  ), Reflect.ownKeys(i)));
455
- let vt = null;
456
- const wt = {}, Re = (i) => Object.getPrototypeOf(i) === wt, xt = (i) => i.__isSuspense, q = /* @__PURE__ */ Symbol.for("v-fgt"), Ct = /* @__PURE__ */ Symbol.for("v-txt"), Te = /* @__PURE__ */ Symbol.for("v-cmt"), Y = [];
457
- let E = null;
455
+ let xt = null;
456
+ const vt = {}, Te = (i) => Object.getPrototypeOf(i) === vt, wt = (i) => i.__isSuspense, U = /* @__PURE__ */ Symbol.for("v-fgt"), Ct = /* @__PURE__ */ Symbol.for("v-txt"), Re = /* @__PURE__ */ Symbol.for("v-cmt"), Y = [];
457
+ let A = null;
458
458
  function ge(i = !1) {
459
- Y.push(E = i ? null : []);
459
+ Y.push(A = i ? null : []);
460
460
  }
461
- function St() {
462
- Y.pop(), E = Y[Y.length - 1] || null;
461
+ function kt() {
462
+ Y.pop(), A = Y[Y.length - 1] || null;
463
463
  }
464
- function Et(i) {
465
- return i.dynamicChildren = E || ze, St(), E && E.push(i), i;
464
+ function St(i) {
465
+ return i.dynamicChildren = A || ze, kt(), A && A.push(i), i;
466
466
  }
467
- function ye(i, e, t, s, n) {
468
- return Et(
467
+ function be(i, e, t, s, n) {
468
+ return St(
469
469
  fe(
470
470
  i,
471
471
  e,
@@ -479,15 +479,15 @@ function ye(i, e, t, s, n) {
479
479
  function Oe(i) {
480
480
  return i ? i.__v_isVNode === !0 : !1;
481
481
  }
482
- const kt = (...i) => Fe(
482
+ const Et = (...i) => Fe(
483
483
  ...i
484
484
  ), $e = ({ key: i }) => i ?? null, G = ({
485
485
  ref: i,
486
486
  ref_key: e,
487
487
  ref_for: t
488
- }) => (typeof i == "number" && (i = "" + i), i != null ? R(i) || de(i) || I(i) ? { i: M, r: i, k: e, f: !!t } : i : null);
489
- function _t(i, e = null, t = null, s = 0, n = null, o = i === q ? 0 : 1, a = !1, r = !1) {
490
- const c = {
488
+ }) => (typeof i == "number" && (i = "" + i), i != null ? $(i) || de(i) || R(i) ? { i: T, r: i, k: e, f: !!t } : i : null);
489
+ function _t(i, e = null, t = null, s = 0, n = null, o = i === U ? 0 : 1, a = !1, r = !1) {
490
+ const l = {
491
491
  __v_isVNode: !0,
492
492
  __v_skip: !0,
493
493
  type: i,
@@ -514,36 +514,36 @@ function _t(i, e = null, t = null, s = 0, n = null, o = i === q ? 0 : 1, a = !1,
514
514
  dynamicProps: n,
515
515
  dynamicChildren: null,
516
516
  appContext: null,
517
- ctx: M
517
+ ctx: T
518
518
  };
519
- return r ? (me(c, t), o & 128 && i.normalize(c)) : t && (c.shapeFlag |= R(t) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && _("VNode created with invalid key (NaN). VNode type:", c.type), // avoid a block node from tracking itself
519
+ return r ? (me(l, t), o & 128 && i.normalize(l)) : t && (l.shapeFlag |= $(t) ? 8 : 16), process.env.NODE_ENV !== "production" && l.key !== l.key && M("VNode created with invalid key (NaN). VNode type:", l.type), // avoid a block node from tracking itself
520
520
  !a && // has current parent block
521
- E && // presence of a patch flag indicates this node needs patching on updates.
521
+ A && // presence of a patch flag indicates this node needs patching on updates.
522
522
  // component nodes also should always be patched, because even if the
523
523
  // component doesn't need to update, it needs to persist the instance on to
524
524
  // the next vnode so that it can be properly unmounted later.
525
- (c.patchFlag > 0 || o & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
525
+ (l.patchFlag > 0 || o & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
526
526
  // vnode should not be considered dynamic due to handler caching.
527
- c.patchFlag !== 32 && E.push(c), c;
527
+ l.patchFlag !== 32 && A.push(l), l;
528
528
  }
529
- const fe = process.env.NODE_ENV !== "production" ? kt : Fe;
529
+ const fe = process.env.NODE_ENV !== "production" ? Et : Fe;
530
530
  function Fe(i, e = null, t = null, s = 0, n = null, o = !1) {
531
- if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i && _(`Invalid vnode type when creating vnode: ${i}.`), i = Te), Oe(i)) {
531
+ if ((!i || i === gt) && (process.env.NODE_ENV !== "production" && !i && M(`Invalid vnode type when creating vnode: ${i}.`), i = Re), Oe(i)) {
532
532
  const r = X(
533
533
  i,
534
534
  e,
535
535
  !0
536
536
  /* mergeRef: true */
537
537
  );
538
- return t && me(r, t), !o && E && (r.shapeFlag & 6 ? E[E.indexOf(i)] = r : E.push(r)), r.patchFlag = -2, r;
538
+ return t && me(r, t), !o && A && (r.shapeFlag & 6 ? A[A.indexOf(i)] = r : A.push(r)), r.patchFlag = -2, r;
539
539
  }
540
540
  if (De(i) && (i = i.__vccOpts), e) {
541
541
  e = At(e);
542
- let { class: r, style: c } = e;
543
- r && !R(r) && (e.class = ce(r)), T(c) && (oe(c) && !k(c) && (c = z({}, c)), e.style = le(c));
542
+ let { class: r, style: l } = e;
543
+ r && !$(r) && (e.class = ce(r)), F(l) && (oe(l) && !L(l) && (l = W({}, l)), e.style = le(l));
544
544
  }
545
- const a = R(i) ? 1 : xt(i) ? 128 : mt(i) ? 64 : T(i) ? 4 : I(i) ? 2 : 0;
546
- return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i = O(i), _(
545
+ const a = $(i) ? 1 : wt(i) ? 128 : mt(i) ? 64 : F(i) ? 4 : R(i) ? 2 : 0;
546
+ return process.env.NODE_ENV !== "production" && a & 4 && oe(i) && (i = H(i), M(
547
547
  "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
548
548
  `
549
549
  Component that was made reactive: `,
@@ -560,24 +560,24 @@ Component that was made reactive: `,
560
560
  );
561
561
  }
562
562
  function At(i) {
563
- return i ? oe(i) || Re(i) ? z({}, i) : i : null;
563
+ return i ? oe(i) || Te(i) ? W({}, i) : i : null;
564
564
  }
565
565
  function X(i, e, t = !1, s = !1) {
566
- const { props: n, ref: o, patchFlag: a, children: r, transition: c } = i, h = e ? Mt(n || {}, e) : n, d = {
566
+ const { props: n, ref: o, patchFlag: a, children: r, transition: l } = i, m = e ? Mt(n || {}, e) : n, d = {
567
567
  __v_isVNode: !0,
568
568
  __v_skip: !0,
569
569
  type: i.type,
570
- props: h,
571
- key: h && $e(h),
570
+ props: m,
571
+ key: m && $e(m),
572
572
  ref: e && e.ref ? (
573
573
  // #2078 in the case of <component :is="vnode" ref="extra"/>
574
574
  // if the vnode itself already has a ref, cloneVNode will need to merge
575
575
  // the refs so the single vnode can be set on multiple refs
576
- t && o ? k(o) ? o.concat(G(e)) : [o, G(e)] : G(e)
576
+ t && o ? L(o) ? o.concat(G(e)) : [o, G(e)] : G(e)
577
577
  ) : o,
578
578
  scopeId: i.scopeId,
579
579
  slotScopeIds: i.slotScopeIds,
580
- children: process.env.NODE_ENV !== "production" && a === -1 && k(r) ? r.map(He) : r,
580
+ children: process.env.NODE_ENV !== "production" && a === -1 && L(r) ? r.map(He) : r,
581
581
  target: i.target,
582
582
  targetStart: i.targetStart,
583
583
  targetAnchor: i.targetAnchor,
@@ -587,12 +587,12 @@ function X(i, e, t = !1, s = !1) {
587
587
  // existing patch flag to be reliable and need to add the FULL_PROPS flag.
588
588
  // note: preserve flag for fragments since they use the flag for children
589
589
  // fast paths only.
590
- patchFlag: e && i.type !== q ? a === -1 ? 16 : a | 16 : a,
590
+ patchFlag: e && i.type !== U ? a === -1 ? 16 : a | 16 : a,
591
591
  dynamicProps: i.dynamicProps,
592
592
  dynamicChildren: i.dynamicChildren,
593
593
  appContext: i.appContext,
594
594
  dirs: i.dirs,
595
- transition: c,
595
+ transition: l,
596
596
  // These should technically only be non-null on mounted VNodes. However,
597
597
  // they *should* be copied for kept-alive vnodes. So we just always copy
598
598
  // them since them being non-null during a mount doesn't affect the logic as
@@ -607,14 +607,14 @@ function X(i, e, t = !1, s = !1) {
607
607
  ctx: i.ctx,
608
608
  ce: i.ce
609
609
  };
610
- return c && s && Ie(
610
+ return l && s && Ne(
611
611
  d,
612
- c.clone(d)
612
+ l.clone(d)
613
613
  ), d;
614
614
  }
615
615
  function He(i) {
616
616
  const e = X(i);
617
- return k(i.children) && (e.children = i.children.map(He)), e;
617
+ return L(i.children) && (e.children = i.children.map(He)), e;
618
618
  }
619
619
  function Lt(i = " ", e = 0) {
620
620
  return fe(Ct, null, i, e);
@@ -624,7 +624,7 @@ function me(i, e) {
624
624
  const { shapeFlag: s } = i;
625
625
  if (e == null)
626
626
  e = null;
627
- else if (k(e))
627
+ else if (L(e))
628
628
  t = 16;
629
629
  else if (typeof e == "object")
630
630
  if (s & 65) {
@@ -632,8 +632,8 @@ function me(i, e) {
632
632
  n && (n._c && (n._d = !1), me(i, n()), n._c && (n._d = !0));
633
633
  return;
634
634
  } else
635
- t = 32, !e._ && !Re(e) && (e._ctx = M);
636
- else I(e) ? (e = { default: e, _ctx: M }, t = 32) : (e = String(e), s & 64 ? (t = 16, e = [Lt(e)]) : t = 8);
635
+ t = 32, !e._ && !Te(e) && (e._ctx = T);
636
+ else R(e) ? (e = { default: e, _ctx: T }, t = 32) : (e = String(e), s & 64 ? (t = 16, e = [Lt(e)]) : t = 8);
637
637
  i.children = e, i.shapeFlag |= t;
638
638
  }
639
639
  function Mt(...i) {
@@ -647,13 +647,13 @@ function Mt(...i) {
647
647
  e.style = le([e.style, s.style]);
648
648
  else if (Be(n)) {
649
649
  const o = e[n], a = s[n];
650
- a && o !== a && !(k(o) && o.includes(a)) && (e[n] = o ? [].concat(o, a) : a);
650
+ a && o !== a && !(L(o) && o.includes(a)) && (e[n] = o ? [].concat(o, a) : a);
651
651
  } else n !== "" && (e[n] = s[n]);
652
652
  }
653
653
  return e;
654
654
  }
655
- let L = null;
656
- const It = () => L || M;
655
+ let I = null;
656
+ const Nt = () => I || T;
657
657
  {
658
658
  const i = Q(), e = (t, s) => {
659
659
  let n;
@@ -663,16 +663,16 @@ const It = () => L || M;
663
663
  };
664
664
  e(
665
665
  "__VUE_INSTANCE_SETTERS__",
666
- (t) => L = t
666
+ (t) => I = t
667
667
  ), e(
668
668
  "__VUE_SSR_SETTERS__",
669
669
  (t) => t
670
670
  );
671
671
  }
672
672
  process.env.NODE_ENV;
673
- const Nt = /(?:^|[-_])\w/g, Rt = (i) => i.replace(Nt, (e) => e.toUpperCase()).replace(/[-_]/g, "");
673
+ const It = /(?:^|[-_])\w/g, Tt = (i) => i.replace(It, (e) => e.toUpperCase()).replace(/[-_]/g, "");
674
674
  function Pe(i, e = !0) {
675
- return I(i) ? i.displayName || i.name : i.name || e && i.__name;
675
+ return R(i) ? i.displayName || i.name : i.name || e && i.__name;
676
676
  }
677
677
  function Ve(i, e, t = !1) {
678
678
  let s = Pe(e);
@@ -690,72 +690,72 @@ function Ve(i, e, t = !1) {
690
690
  i.parent.type.components
691
691
  ) || n(i.appContext.components);
692
692
  }
693
- return s ? Rt(s) : t ? "App" : "Anonymous";
693
+ return s ? Tt(s) : t ? "App" : "Anonymous";
694
694
  }
695
695
  function De(i) {
696
- return I(i) && "__vccOpts" in i;
696
+ return R(i) && "__vccOpts" in i;
697
697
  }
698
- function Tt() {
698
+ function Rt() {
699
699
  if (process.env.NODE_ENV === "production" || typeof window > "u")
700
700
  return;
701
701
  const i = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, t = { style: "color:#f5222d" }, s = { style: "color:#eb2f96" }, n = {
702
702
  __vue_custom_formatter: !0,
703
- header(l) {
704
- if (!T(l))
703
+ header(c) {
704
+ if (!F(c))
705
705
  return null;
706
- if (l.__isVue)
706
+ if (c.__isVue)
707
707
  return ["div", i, "VueInstance"];
708
- if (de(l)) {
709
- const f = l.value;
708
+ if (de(c)) {
709
+ const u = c.value;
710
710
  return [
711
711
  "div",
712
712
  {},
713
- ["span", i, d(l)],
713
+ ["span", i, d(c)],
714
714
  "<",
715
- r(f),
715
+ r(u),
716
716
  ">"
717
717
  ];
718
718
  } else {
719
- if (Ce(l))
719
+ if (Ce(c))
720
720
  return [
721
721
  "div",
722
722
  {},
723
- ["span", i, Z(l) ? "ShallowReactive" : "Reactive"],
723
+ ["span", i, Z(c) ? "ShallowReactive" : "Reactive"],
724
724
  "<",
725
- r(l),
726
- `>${ne(l) ? " (readonly)" : ""}`
725
+ r(c),
726
+ `>${ne(c) ? " (readonly)" : ""}`
727
727
  ];
728
- if (ne(l))
728
+ if (ne(c))
729
729
  return [
730
730
  "div",
731
731
  {},
732
- ["span", i, Z(l) ? "ShallowReadonly" : "Readonly"],
732
+ ["span", i, Z(c) ? "ShallowReadonly" : "Readonly"],
733
733
  "<",
734
- r(l),
734
+ r(c),
735
735
  ">"
736
736
  ];
737
737
  }
738
738
  return null;
739
739
  },
740
- hasBody(l) {
741
- return l && l.__isVue;
740
+ hasBody(c) {
741
+ return c && c.__isVue;
742
742
  },
743
- body(l) {
744
- if (l && l.__isVue)
743
+ body(c) {
744
+ if (c && c.__isVue)
745
745
  return [
746
746
  "div",
747
747
  {},
748
- ...o(l.$)
748
+ ...o(c.$)
749
749
  ];
750
750
  }
751
751
  };
752
- function o(l) {
753
- const f = [];
754
- l.type.props && l.props && f.push(a("props", O(l.props))), l.setupState !== se && f.push(a("setup", l.setupState)), l.data !== se && f.push(a("data", O(l.data)));
755
- const m = c(l, "computed");
756
- m && f.push(a("computed", m));
757
- const y = c(l, "inject");
758
- return y && f.push(a("injected", y)), f.push([
752
+ function o(c) {
753
+ const u = [];
754
+ c.type.props && c.props && u.push(a("props", H(c.props))), c.setupState !== se && u.push(a("setup", c.setupState)), c.data !== se && u.push(a("data", H(c.data)));
755
+ const y = l(c, "computed");
756
+ y && u.push(a("computed", y));
757
+ const f = l(c, "inject");
758
+ return f && u.push(a("injected", f)), u.push([
759
759
  "div",
760
760
  {},
761
761
  [
@@ -765,11 +765,11 @@ function Tt() {
765
765
  },
766
766
  "$ (internal): "
767
767
  ],
768
- ["object", { object: l }]
769
- ]), f;
768
+ ["object", { object: c }]
769
+ ]), u;
770
770
  }
771
- function a(l, f) {
772
- return f = z({}, f), Object.keys(f).length ? [
771
+ function a(c, u) {
772
+ return u = W({}, u), Object.keys(u).length ? [
773
773
  "div",
774
774
  { style: "line-height:1.25em;margin-bottom:0.6em" },
775
775
  [
@@ -777,41 +777,41 @@ function Tt() {
777
777
  {
778
778
  style: "color:#476582"
779
779
  },
780
- l
780
+ c
781
781
  ],
782
782
  [
783
783
  "div",
784
784
  {
785
785
  style: "padding-left:1.25em"
786
786
  },
787
- ...Object.keys(f).map((m) => [
787
+ ...Object.keys(u).map((y) => [
788
788
  "div",
789
789
  {},
790
- ["span", s, m + ": "],
791
- r(f[m], !1)
790
+ ["span", s, y + ": "],
791
+ r(u[y], !1)
792
792
  ])
793
793
  ]
794
794
  ] : ["span", {}];
795
795
  }
796
- function r(l, f = !0) {
797
- return typeof l == "number" ? ["span", e, l] : typeof l == "string" ? ["span", t, JSON.stringify(l)] : typeof l == "boolean" ? ["span", s, l] : T(l) ? ["object", { object: f ? O(l) : l }] : ["span", t, String(l)];
796
+ function r(c, u = !0) {
797
+ return typeof c == "number" ? ["span", e, c] : typeof c == "string" ? ["span", t, JSON.stringify(c)] : typeof c == "boolean" ? ["span", s, c] : F(c) ? ["object", { object: u ? H(c) : c }] : ["span", t, String(c)];
798
798
  }
799
- function c(l, f) {
800
- const m = l.type;
801
- if (I(m))
799
+ function l(c, u) {
800
+ const y = c.type;
801
+ if (R(y))
802
802
  return;
803
- const y = {};
804
- for (const u in l.ctx)
805
- h(m, u, f) && (y[u] = l.ctx[u]);
806
- return y;
807
- }
808
- function h(l, f, m) {
809
- const y = l[m];
810
- if (k(y) && y.includes(f) || T(y) && f in y || l.extends && h(l.extends, f, m) || l.mixins && l.mixins.some((u) => h(u, f, m)))
803
+ const f = {};
804
+ for (const h in c.ctx)
805
+ m(y, h, u) && (f[h] = c.ctx[h]);
806
+ return f;
807
+ }
808
+ function m(c, u, y) {
809
+ const f = c[y];
810
+ if (L(f) && f.includes(u) || F(f) && u in f || c.extends && m(c.extends, u, y) || c.mixins && c.mixins.some((h) => m(h, u, y)))
811
811
  return !0;
812
812
  }
813
- function d(l) {
814
- return Z(l) ? "ShallowRef" : l.effect ? "ComputedRef" : "Ref";
813
+ function d(c) {
814
+ return Z(c) ? "ShallowRef" : c.effect ? "ComputedRef" : "Ref";
815
815
  }
816
816
  window.devtoolsFormatters ? window.devtoolsFormatters.push(n) : window.devtoolsFormatters = [n];
817
817
  }
@@ -824,10 +824,10 @@ process.env.NODE_ENV;
824
824
  * @license MIT
825
825
  **/
826
826
  function Ot() {
827
- Tt();
827
+ Rt();
828
828
  }
829
829
  process.env.NODE_ENV !== "production" && Ot();
830
- class be {
830
+ class ye {
831
831
  constructor(e) {
832
832
  this.endpoint = e || "https://foisit-ninja.netlify.app/.netlify/functions/intent";
833
833
  }
@@ -861,10 +861,10 @@ class be {
861
861
  class $t {
862
862
  constructor(e = !0) {
863
863
  if (this.commands = /* @__PURE__ */ new Map(), this.openAIService = null, this.context = null, this.pendingConfirmation = null, this.enableSmartIntent = !0, this.selectOptionsCache = /* @__PURE__ */ new Map(), typeof e == "boolean") {
864
- this.enableSmartIntent = e, this.enableSmartIntent && (this.openAIService = new be());
864
+ this.enableSmartIntent = e, this.enableSmartIntent && (this.openAIService = new ye());
865
865
  return;
866
866
  }
867
- this.enableSmartIntent = e.enableSmartIntent ?? !0, this.enableSmartIntent && (this.openAIService = new be(e.intentEndpoint));
867
+ this.enableSmartIntent = e.enableSmartIntent ?? !0, this.enableSmartIntent && (this.openAIService = new ye(e.intentEndpoint));
868
868
  }
869
869
  /** Add a new command (string or object) */
870
870
  addCommand(e, t) {
@@ -887,16 +887,16 @@ class $t {
887
887
  }
888
888
  /** Execute a command by matching input */
889
889
  async executeCommand(e) {
890
- if (typeof e == "object" && e !== null) {
890
+ if (Array.isArray(e) && (e = e.join(", ")), typeof e == "object" && e !== null) {
891
891
  if (this.isStructured(e)) {
892
- const c = String(e.commandId), h = e.params ?? {}, d = this.getCommandById(c);
892
+ const l = String(e.commandId), m = e.params ?? {}, d = this.getCommandById(l);
893
893
  if (!d) return { message: "That command is not available.", type: "error" };
894
- const l = this.sanitizeParamsForCommand(d, h), m = (d.parameters ?? []).filter((y) => y.required).filter((y) => l[y.name] == null || l[y.name] === "");
895
- return m.length > 0 ? (this.context = { commandId: this.getCommandIdentifier(d), params: l }, {
894
+ const c = this.sanitizeParamsForCommand(d, m), y = (d.parameters ?? []).filter((f) => f.required).filter((f) => c[f.name] == null || c[f.name] === "");
895
+ return y.length > 0 ? (this.context = { commandId: this.getCommandIdentifier(d), params: c }, {
896
896
  message: `Please provide the required details for "${d.command}".`,
897
897
  type: "form",
898
- fields: m
899
- }) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params: l }, this.buildConfirmResponse(d)) : this.safeRunAction(d, l);
898
+ fields: y
899
+ }) : d.critical ? (this.pendingConfirmation = { commandId: this.getCommandIdentifier(d), params: c }, this.buildConfirmResponse(d)) : this.safeRunAction(d, c);
900
900
  }
901
901
  if (!this.context)
902
902
  return { message: "Session expired or invalid context.", type: "error" };
@@ -923,8 +923,8 @@ class $t {
923
923
  if (["yes", "y", "confirm", "ok", "okay"].includes(o)) {
924
924
  const { commandId: a, params: r } = this.pendingConfirmation;
925
925
  this.pendingConfirmation = null;
926
- const c = this.getCommandById(a);
927
- return c ? this.safeRunAction(c, r) : { message: "That action is no longer available.", type: "error" };
926
+ const l = this.getCommandById(a);
927
+ return l ? this.safeRunAction(l, r) : { message: "That action is no longer available.", type: "error" };
928
928
  }
929
929
  return ["no", "n", "cancel", "stop"].includes(o) ? (this.pendingConfirmation = null, { message: "Cancelled.", type: "success" }) : {
930
930
  message: "Please confirm: Yes or No.",
@@ -966,12 +966,12 @@ class $t {
966
966
  return { message: "I'm not sure what you mean.", type: "error" };
967
967
  if (t.macro)
968
968
  return this.safeRunAction(t, {});
969
- const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((h) => h.required).filter((h) => o[h.name] == null || o[h.name] === "");
969
+ const s = e.params ?? {}, n = this.sanitizeParamsForCommand(t, s), o = t.allowAiParamExtraction === !1 ? {} : n, r = (t.parameters ?? []).filter((m) => m.required).filter((m) => o[m.name] == null || o[m.name] === "");
970
970
  if (e.incomplete || r.length > 0) {
971
971
  if (this.context = { commandId: this.getCommandIdentifier(t), params: o }, !(t.collectRequiredViaForm !== !1) && this.shouldAskSingleQuestion(r)) {
972
- const l = r.map((f) => f.name).join(" and ");
972
+ const c = r.map((u) => u.name).join(" and ");
973
973
  return {
974
- message: e.message || `Please provide ${l}.`,
974
+ message: e.message || `Please provide ${c}.`,
975
975
  type: "question"
976
976
  };
977
977
  }
@@ -986,8 +986,8 @@ class $t {
986
986
  commandId: this.getCommandIdentifier(t),
987
987
  params: o
988
988
  }, this.buildConfirmResponse(t);
989
- const c = await t.action(o);
990
- return this.normalizeResponse(c);
989
+ const l = await t.action(o);
990
+ return this.normalizeResponse(l);
991
991
  }
992
992
  return e.type === "ambiguous" && e.options && e.options.length ? {
993
993
  message: e.message || "Did you mean one of these?",
@@ -1045,15 +1045,15 @@ class $t {
1045
1045
  delete s[n.name];
1046
1046
  continue;
1047
1047
  }
1048
- if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((c) => String(c.value) === String(a))) {
1048
+ if (Array.isArray(n.options) && n.options.length > 0 && !n.options.some((l) => String(l.value) === String(a))) {
1049
1049
  delete s[n.name];
1050
1050
  continue;
1051
1051
  }
1052
1052
  s[n.name] = a;
1053
1053
  }
1054
1054
  if (n.type === "file") {
1055
- const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number", c = typeof a == "string" && /^data:[^;]+;base64,/.test(a);
1056
- (n.delivery ?? "file") === "base64" ? !c && !r && delete s[n.name] : r || delete s[n.name];
1055
+ const a = s[n.name], r = a && typeof a == "object" && typeof a.name == "string" && typeof a.size == "number", l = typeof a == "string" && /^data:[^;]+;base64,/.test(a);
1056
+ (n.delivery ?? "file") === "base64" ? !l && !r && delete s[n.name] : r || delete s[n.name];
1057
1057
  }
1058
1058
  }
1059
1059
  return s;
@@ -1081,18 +1081,18 @@ class $t {
1081
1081
  async tryDeterministicMatch(e) {
1082
1082
  const t = [];
1083
1083
  for (const r of this.commands.values()) {
1084
- let c = 0;
1085
- const h = r.command.toLowerCase();
1086
- e.includes(h) && (c += 5);
1084
+ let l = 0;
1085
+ const m = r.command.toLowerCase();
1086
+ e.includes(m) && (l += 5);
1087
1087
  const d = r.keywords ?? [];
1088
- for (const l of d) {
1089
- const f = l.toLowerCase().trim();
1090
- f && (e === f ? c += 4 : e.includes(f) && (c += 3));
1088
+ for (const c of d) {
1089
+ const u = c.toLowerCase().trim();
1090
+ u && (e === u ? l += 4 : e.includes(u) && (l += 3));
1091
1091
  }
1092
- c > 0 && t.push({ cmd: r, score: c });
1092
+ l > 0 && t.push({ cmd: r, score: l });
1093
1093
  }
1094
1094
  if (t.length === 0) return null;
1095
- t.sort((r, c) => c.score - r.score);
1095
+ t.sort((r, l) => l.score - r.score);
1096
1096
  const s = t[0].score, n = t.filter((r) => r.score === s).slice(0, 3);
1097
1097
  if (n.length > 1)
1098
1098
  return {
@@ -1209,7 +1209,7 @@ class Ft {
1209
1209
  return this.fallbackMessage;
1210
1210
  }
1211
1211
  }
1212
- const ve = () => {
1212
+ const xe = () => {
1213
1213
  if (typeof window > "u") return null;
1214
1214
  const i = window;
1215
1215
  return i.SpeechRecognition ?? i.webkitSpeechRecognition ?? null;
@@ -1227,7 +1227,7 @@ class Ht {
1227
1227
  }, this.onTTSEnd = () => {
1228
1228
  this.ttsSpeaking = !1, this.isListening && this.restartAllowed ? this.safeRestart() : this.emitStatus(this.isListening ? "listening" : "idle");
1229
1229
  };
1230
- const s = ve();
1230
+ const s = xe();
1231
1231
  if (s) {
1232
1232
  this.recognition = new s(), this.recognition.lang = e, this.recognition.interimResults = t.interimResults ?? !0, this.recognition.continuous = t.continuous ?? !0, this.recognition.onresult = (o) => this.handleResult(o, t), this.recognition.onend = () => this.handleEnd(), this.recognition.onstart = () => {
1233
1233
  this.log("recognition onstart"), this.engineActive = !0, this.hadResultThisSession = !1, this.restartTimer && (clearTimeout(this.restartTimer), this.restartTimer = null), this.backoffMs = 250, this.isListening && !this.ttsSpeaking && this.emitStatus("listening");
@@ -1259,7 +1259,7 @@ class Ht {
1259
1259
  }
1260
1260
  /** Check if SpeechRecognition is available */
1261
1261
  isSupported() {
1262
- return ve() !== null;
1262
+ return xe() !== null;
1263
1263
  }
1264
1264
  /** Allow consumers (wrappers) to observe status changes */
1265
1265
  onStatusChange(e) {
@@ -1298,10 +1298,10 @@ class Ht {
1298
1298
  if (!this.resultCallback) return;
1299
1299
  const s = t.confidenceThreshold ?? 0.6;
1300
1300
  for (let a = e.resultIndex; a < e.results.length; a++) {
1301
- const r = e.results[a], c = r && r[0], h = ((o = (n = c == null ? void 0 : c.transcript) == null ? void 0 : n.trim) == null ? void 0 : o.call(n)) || "", d = (c == null ? void 0 : c.confidence) ?? 0;
1302
- if (h && !(!r.isFinal && t.interimResults === !1) && !(r.isFinal && d < s))
1301
+ const r = e.results[a], l = r && r[0], m = ((o = (n = l == null ? void 0 : l.transcript) == null ? void 0 : n.trim) == null ? void 0 : o.call(n)) || "", d = (l == null ? void 0 : l.confidence) ?? 0;
1302
+ if (m && !(!r.isFinal && t.interimResults === !1) && !(r.isFinal && d < s))
1303
1303
  try {
1304
- this.hadResultThisSession = !0, this.resultCallback(h, !!r.isFinal);
1304
+ this.hadResultThisSession = !0, this.resultCallback(m, !!r.isFinal);
1305
1305
  } catch {
1306
1306
  this.error("VoiceProcessor: result callback error");
1307
1307
  }
@@ -1504,8 +1504,14 @@ class Bt {
1504
1504
  * - `showInvocation`: if true, show the invocation as a user message
1505
1505
  */
1506
1506
  async runCommand(e) {
1507
- if (!e || !e.commandId) throw new Error("runCommand requires a commandId");
1508
- const { commandId: t, params: s, openOverlay: n = !0, showInvocation: o = !0 } = e;
1507
+ if (!e || !e.commandId)
1508
+ throw new Error("runCommand requires a commandId");
1509
+ const {
1510
+ commandId: t,
1511
+ params: s,
1512
+ openOverlay: n = !0,
1513
+ showInvocation: o = !0
1514
+ } = e;
1509
1515
  n && !this.isOpen && this.toggle();
1510
1516
  const a = this.commandHandlers.get(t);
1511
1517
  if (a && o && this.messagesContainer && this.addMessage(`Command: ${t}`, "user"), a)
@@ -1523,7 +1529,10 @@ class Bt {
1523
1529
  else r == null || this.addMessage(String(r), "system");
1524
1530
  return r;
1525
1531
  } catch (r) {
1526
- throw this.hideLoading(), this.addMessage(`Command "${t}" failed: ${String(r)}`, "system"), r;
1532
+ throw this.hideLoading(), this.addMessage(
1533
+ `Command "${t}" failed: ${String(r)}`,
1534
+ "system"
1535
+ ), r;
1527
1536
  }
1528
1537
  if (this.externalCommandExecutor)
1529
1538
  try {
@@ -1531,9 +1540,15 @@ class Bt {
1531
1540
  const r = await this.externalCommandExecutor({ commandId: t, params: s });
1532
1541
  return this.hideLoading(), r;
1533
1542
  } catch (r) {
1534
- throw this.hideLoading(), this.addMessage(`Command "${t}" failed: ${String(r)}`, "system"), r;
1535
- }
1536
- this.addMessage(`No handler registered for command "${t}".`, "system");
1543
+ throw this.hideLoading(), this.addMessage(
1544
+ `Command "${t}" failed: ${String(r)}`,
1545
+ "system"
1546
+ ), r;
1547
+ }
1548
+ this.addMessage(
1549
+ `No handler registered for command "${t}".`,
1550
+ "system"
1551
+ );
1537
1552
  }
1538
1553
  init() {
1539
1554
  var t, s;
@@ -1541,17 +1556,23 @@ class Bt {
1541
1556
  this.injectOverlayStyles();
1542
1557
  const e = document.getElementById("foisit-overlay-container");
1543
1558
  if (e && e instanceof HTMLElement) {
1544
- this.container = e, this.chatWindow = e.querySelector(".foisit-chat"), this.messagesContainer = e.querySelector(".foisit-messages"), this.input = e.querySelector("input.foisit-input"), ((t = this.config.floatingButton) == null ? void 0 : t.visible) !== !1 && !e.querySelector(".foisit-floating-btn") && this.renderFloatingButton(), this.chatWindow || this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
1559
+ this.container = e, this.chatWindow = e.querySelector(
1560
+ ".foisit-chat"
1561
+ ), this.messagesContainer = e.querySelector(
1562
+ ".foisit-messages"
1563
+ ), this.input = e.querySelector(
1564
+ "input.foisit-input"
1565
+ ), ((t = this.config.floatingButton) == null ? void 0 : t.visible) !== !1 && !e.querySelector(".foisit-floating-btn") && this.renderFloatingButton(), this.chatWindow || this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
1545
1566
  return;
1546
1567
  }
1547
1568
  this.container = document.createElement("div"), this.container.id = "foisit-overlay-container", this.container.className = "foisit-overlay-container", document.body.appendChild(this.container), ((s = this.config.floatingButton) == null ? void 0 : s.visible) !== !1 && this.renderFloatingButton(), this.renderChatWindow(), this.config.enableGestureActivation && (this.gestureHandler = new ae(), this.gestureHandler.setupTripleTapListener(() => this.toggle()));
1548
1569
  }
1549
1570
  renderFloatingButton() {
1550
- var n, o, a, r, c, h;
1571
+ var n, o, a, r, l, m;
1551
1572
  const e = document.createElement("button");
1552
1573
  e.innerHTML = ((n = this.config.floatingButton) == null ? void 0 : n.customHtml) || "🎙️";
1553
- const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((c = (r = this.config.floatingButton) == null ? void 0 : r.position) == null ? void 0 : c.right) || "20px";
1554
- e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (h = this.container) == null || h.appendChild(e);
1574
+ const t = ((a = (o = this.config.floatingButton) == null ? void 0 : o.position) == null ? void 0 : a.bottom) || "20px", s = ((l = (r = this.config.floatingButton) == null ? void 0 : r.position) == null ? void 0 : l.right) || "20px";
1575
+ e.className = "foisit-floating-btn", e.style.bottom = t, e.style.right = s, e.onclick = () => this.toggle(), e.onmouseenter = () => e.style.transform = "scale(1.05)", e.onmouseleave = () => e.style.transform = "scale(1)", (m = this.container) == null || m.appendChild(e);
1555
1576
  }
1556
1577
  renderChatWindow() {
1557
1578
  var o;
@@ -1567,8 +1588,8 @@ class Bt {
1567
1588
  n.className = "foisit-input-area", this.input = document.createElement("input"), this.input.placeholder = this.config.inputPlaceholder || "Type a command...", this.input.className = "foisit-input", this.input.addEventListener("keydown", (a) => {
1568
1589
  var r;
1569
1590
  if (a.key === "Enter" && ((r = this.input) != null && r.value.trim())) {
1570
- const c = this.input.value.trim();
1571
- this.input.value = "", this.onSubmit && this.onSubmit(c);
1591
+ const l = this.input.value.trim();
1592
+ this.input.value = "", this.onSubmit && this.onSubmit(l);
1572
1593
  }
1573
1594
  }), n.appendChild(this.input), this.chatWindow.appendChild(e), this.chatWindow.appendChild(this.messagesContainer), this.chatWindow.appendChild(n), (o = this.container) == null || o.appendChild(this.chatWindow);
1574
1595
  }
@@ -1598,182 +1619,260 @@ class Bt {
1598
1619
  const n = (e || "").length || 0, o = Math.max(120, 700 - Math.min(600, Math.floor(n * 6)));
1599
1620
  s.style.opacity = "0", s.style.transform = "translateY(8px)", s.style.transition = "none", this.messagesContainer.appendChild(s), this.animateMessageEntrance(s, o), this.scrollToBottom();
1600
1621
  }
1601
- addOptions(e) {
1622
+ addOptions(e, t) {
1602
1623
  if (!this.messagesContainer) return;
1603
- const t = document.createElement("div");
1604
- t.className = "foisit-options-container", e.forEach((s) => {
1605
- const n = document.createElement("button");
1606
- n.textContent = s.label, n.className = "foisit-option-chip", n.setAttribute("type", "button"), n.setAttribute("aria-label", s.label);
1607
- const o = () => {
1608
- if (s.commandId) {
1609
- this.onSubmit && this.onSubmit({ commandId: s.commandId });
1610
- return;
1611
- }
1612
- const a = s && typeof s.value == "string" && s.value.trim() ? s.value : s.label;
1613
- this.onSubmit && this.onSubmit(a);
1614
- };
1615
- n.onclick = o, n.onkeydown = (a) => {
1616
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), o());
1617
- }, t.appendChild(n);
1618
- }), this.messagesContainer.appendChild(t), this.scrollToBottom();
1624
+ const s = (t == null ? void 0 : t.allowMultiple) === !0, n = document.createElement("div");
1625
+ if (n.className = "foisit-options-container", !s)
1626
+ e.forEach((o) => {
1627
+ const a = document.createElement("button");
1628
+ a.textContent = o.label, a.className = "foisit-option-chip", a.setAttribute("type", "button"), a.setAttribute("aria-label", o.label);
1629
+ const r = () => {
1630
+ if (o.commandId) {
1631
+ this.onSubmit && this.onSubmit({ commandId: o.commandId });
1632
+ return;
1633
+ }
1634
+ const l = o && typeof o.value == "string" && o.value.trim() ? o.value : o.label;
1635
+ this.onSubmit && this.onSubmit(l);
1636
+ };
1637
+ a.onclick = r, a.onkeydown = (l) => {
1638
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), r());
1639
+ }, n.appendChild(a);
1640
+ });
1641
+ else {
1642
+ const o = /* @__PURE__ */ new Set();
1643
+ e.forEach((r) => {
1644
+ const l = document.createElement("button");
1645
+ l.textContent = r.label, l.className = "foisit-option-chip", l.setAttribute("type", "button"), l.setAttribute("aria-label", r.label);
1646
+ const m = r && typeof r.value == "string" && r.value.trim() ? r.value : r.label;
1647
+ l.onclick = () => {
1648
+ o.has(m) ? (o.delete(m), l.classList.remove("selected")) : (o.add(m), l.classList.add("selected"));
1649
+ }, l.onkeydown = (d) => {
1650
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), l.click());
1651
+ }, n.appendChild(l);
1652
+ });
1653
+ const a = document.createElement("button");
1654
+ a.type = "button", a.className = "foisit-option-chip foisit-confirm", a.textContent = (t == null ? void 0 : t.confirmLabel) || "Submit", a.onclick = () => {
1655
+ const r = Array.from(o);
1656
+ this.onSubmit && this.onSubmit(r);
1657
+ }, n.appendChild(a);
1658
+ }
1659
+ this.messagesContainer.appendChild(n), this.scrollToBottom();
1619
1660
  }
1620
1661
  addForm(e, t, s) {
1621
1662
  if (!this.messagesContainer) return;
1622
1663
  this.addMessage(e, "system");
1623
1664
  const n = document.createElement("form");
1624
1665
  n.className = "foisit-form";
1625
- const o = [], a = (d, l) => {
1626
- const f = document.createElement("div");
1627
- return f.className = "foisit-form-label", f.innerHTML = d + (l ? ' <span class="foisit-req-star">*</span>' : ""), f;
1666
+ const o = [], a = (d, c) => {
1667
+ const u = document.createElement("div");
1668
+ return u.className = "foisit-form-label", u.innerHTML = d + (c ? ' <span class="foisit-req-star">*</span>' : ""), u;
1628
1669
  }, r = () => {
1629
1670
  const d = document.createElement("div");
1630
1671
  return d.className = "foisit-form-error", d.style.display = "none", d;
1631
1672
  };
1632
1673
  (t ?? []).forEach((d) => {
1633
- const l = document.createElement("div");
1634
- l.className = "foisit-form-group";
1635
- const f = d.description || d.name;
1636
- l.appendChild(a(f, d.required));
1637
- let m;
1674
+ const c = document.createElement("div");
1675
+ c.className = "foisit-form-group";
1676
+ const u = d.label || d.description || d.name;
1677
+ c.appendChild(a(u, d.required));
1678
+ let y;
1638
1679
  if (d.type === "select") {
1639
- const u = document.createElement("select");
1640
- u.className = "foisit-form-input";
1641
- const v = document.createElement("option");
1642
- v.value = "", v.textContent = "Select...", u.appendChild(v);
1643
- const x = (p) => {
1644
- (p ?? []).forEach((C) => {
1645
- const b = document.createElement("option");
1646
- b.value = String(C.value ?? C.label ?? ""), b.textContent = String(C.label ?? C.value ?? ""), u.appendChild(b);
1680
+ const h = d;
1681
+ if (h.multiple) {
1682
+ const b = document.createElement("div");
1683
+ b.className = "foisit-multiselect-container";
1684
+ const g = (k) => {
1685
+ k.forEach((p) => {
1686
+ const S = document.createElement("label");
1687
+ S.className = "foisit-multiselect-label";
1688
+ const v = document.createElement("input");
1689
+ v.type = "checkbox", v.value = String(p.value ?? p.label ?? ""), v.className = "foisit-form-checkbox", S.appendChild(v), S.appendChild(document.createTextNode(" " + String(p.label ?? p.value ?? ""))), b.appendChild(S), b.appendChild(document.createElement("br"));
1690
+ });
1691
+ };
1692
+ if (Array.isArray(h.options) && h.options.length)
1693
+ g(h.options);
1694
+ else if (typeof h.getOptions == "function") {
1695
+ const k = document.createElement("div");
1696
+ k.textContent = "Loading...", b.appendChild(k);
1697
+ const p = h.getOptions;
1698
+ Promise.resolve().then(() => p()).then((S) => {
1699
+ b.innerHTML = "", g(S);
1700
+ }).catch(() => {
1701
+ b.innerHTML = "";
1702
+ const S = document.createElement("div");
1703
+ S.textContent = "Error loading options", b.appendChild(S);
1704
+ });
1705
+ }
1706
+ y = b, o.push({ name: d.name, type: d.type, el: y, required: d.required, multiple: !0 }), c.appendChild(y);
1707
+ const w = r();
1708
+ c.appendChild(w), n.appendChild(c);
1709
+ return;
1710
+ }
1711
+ const x = document.createElement("select");
1712
+ x.className = "foisit-form-input";
1713
+ const E = document.createElement("option");
1714
+ E.value = "", E.textContent = "Select...", x.appendChild(E);
1715
+ const C = (b) => {
1716
+ (b ?? []).forEach((g) => {
1717
+ const w = document.createElement("option");
1718
+ w.value = String(g.value ?? g.label ?? ""), w.textContent = String(g.label ?? g.value ?? ""), x.appendChild(w);
1647
1719
  });
1648
1720
  };
1649
1721
  if (Array.isArray(d.options) && d.options.length)
1650
- x(d.options);
1722
+ C(d.options);
1651
1723
  else if (typeof d.getOptions == "function") {
1652
- const p = d.getOptions, C = document.createElement("option");
1653
- C.value = "", C.textContent = "Loading...", u.appendChild(C), Promise.resolve().then(() => p()).then((b) => {
1654
- for (; u.options.length > 1; ) u.remove(1);
1655
- x(b);
1724
+ const b = d.getOptions, g = document.createElement("option");
1725
+ g.value = "", g.textContent = "Loading...", x.appendChild(g), Promise.resolve().then(() => b()).then((w) => {
1726
+ for (; x.options.length > 1; ) x.remove(1);
1727
+ C(w);
1656
1728
  }).catch(() => {
1657
- for (; u.options.length > 1; ) u.remove(1);
1658
- const b = document.createElement("option");
1659
- b.value = "", b.textContent = "Error loading options", u.appendChild(b);
1729
+ for (; x.options.length > 1; ) x.remove(1);
1730
+ const w = document.createElement("option");
1731
+ w.value = "", w.textContent = "Error loading options", x.appendChild(w);
1660
1732
  });
1661
1733
  }
1662
- d.defaultValue != null && (u.value = String(d.defaultValue)), m = u;
1734
+ d.defaultValue != null && (x.value = String(d.defaultValue)), y = x;
1663
1735
  } else if (d.type === "file") {
1664
- const u = d, v = document.createElement("input");
1665
- v.className = "foisit-form-input", v.type = "file", u.accept && Array.isArray(u.accept) && (v.accept = u.accept.join(",")), u.multiple && (v.multiple = !0), u.capture && (u.capture === !0 ? v.setAttribute("capture", "") : v.setAttribute("capture", String(u.capture))), v.addEventListener("change", async () => {
1666
- const x = Array.from(v.files || []), p = y;
1667
- if (p.style.display = "none", p.textContent = "", x.length === 0) return;
1668
- const C = u.maxFiles ?? (u.multiple ? 10 : 1);
1669
- if (x.length > C) {
1670
- p.textContent = `Please select at most ${C} file(s).`, p.style.display = "block";
1736
+ const h = d, x = document.createElement("input");
1737
+ x.className = "foisit-form-input", x.type = "file", h.accept && Array.isArray(h.accept) && (x.accept = h.accept.join(",")), h.multiple && (x.multiple = !0), h.capture && (h.capture === !0 ? x.setAttribute("capture", "") : x.setAttribute("capture", String(h.capture))), x.addEventListener("change", async () => {
1738
+ const E = Array.from(x.files || []), C = f;
1739
+ if (C.style.display = "none", C.textContent = "", E.length === 0) return;
1740
+ const b = h.maxFiles ?? (h.multiple ? 10 : 1);
1741
+ if (E.length > b) {
1742
+ C.textContent = `Please select at most ${b} file(s).`, C.style.display = "block";
1671
1743
  return;
1672
1744
  }
1673
- const b = u.maxSizeBytes ?? 1 / 0, g = x.reduce((w, B) => w + B.size, 0);
1674
- if (x.some((w) => w.size > b)) {
1675
- p.textContent = `One or more files exceed the maximum size of ${Math.round(b / 1024)} KB.`, p.style.display = "block";
1745
+ const g = h.maxSizeBytes ?? 1 / 0, w = E.reduce((p, S) => p + S.size, 0);
1746
+ if (E.some((p) => p.size > g)) {
1747
+ C.textContent = `One or more files exceed the maximum size of ${Math.round(
1748
+ g / 1024
1749
+ )} KB.`, C.style.display = "block";
1676
1750
  return;
1677
1751
  }
1678
- const V = u.maxTotalBytes ?? 1 / 0;
1679
- if (g > V) {
1680
- p.textContent = `Total selected files exceed the maximum of ${Math.round(V / 1024)} KB.`, p.style.display = "block";
1752
+ const k = h.maxTotalBytes ?? 1 / 0;
1753
+ if (w > k) {
1754
+ C.textContent = `Total selected files exceed the maximum of ${Math.round(
1755
+ k / 1024
1756
+ )} KB.`, C.style.display = "block";
1681
1757
  return;
1682
1758
  }
1683
- if (u.accept && Array.isArray(u.accept)) {
1684
- const w = u.accept;
1685
- if (!x.every((U) => U.type ? w.some((W) => W.startsWith(".") ? U.name.toLowerCase().endsWith(W.toLowerCase()) : U.type === W || U.type.startsWith(W.split("/")[0] + "/")) : !0)) {
1686
- p.textContent = "One or more files have an unsupported type.", p.style.display = "block";
1759
+ if (h.accept && Array.isArray(h.accept)) {
1760
+ const p = h.accept;
1761
+ if (!E.every((v) => v.type ? p.some(
1762
+ (V) => V.startsWith(".") ? v.name.toLowerCase().endsWith(V.toLowerCase()) : v.type === V || v.type.startsWith(V.split("/")[0] + "/")
1763
+ ) : !0)) {
1764
+ C.textContent = "One or more files have an unsupported type.", C.style.display = "block";
1687
1765
  return;
1688
1766
  }
1689
1767
  }
1690
- }), m = v;
1768
+ }), y = x;
1691
1769
  } else {
1692
- const u = document.createElement("input");
1693
- u.className = "foisit-form-input", d.type === "string" && (u.placeholder = d.placeholder || "Type here..."), d.type === "number" ? (u.type = "number", typeof d.min == "number" && (u.min = String(d.min)), typeof d.max == "number" && (u.max = String(d.max)), typeof d.step == "number" && (u.step = String(d.step)), d.defaultValue != null && (u.value = String(d.defaultValue))) : d.type === "date" ? (u.type = "date", typeof d.min == "string" && (u.min = d.min), typeof d.max == "string" && (u.max = d.max), d.defaultValue != null && (u.value = String(d.defaultValue))) : (u.type = "text", d.defaultValue != null && (u.value = String(d.defaultValue))), m = u;
1770
+ const h = document.createElement("input");
1771
+ h.className = "foisit-form-input", d.type === "string" && (h.placeholder = d.placeholder || "Type here..."), d.type === "number" ? (h.type = "number", typeof d.min == "number" && (h.min = String(d.min)), typeof d.max == "number" && (h.max = String(d.max)), typeof d.step == "number" && (h.step = String(d.step)), d.defaultValue != null && (h.value = String(d.defaultValue))) : d.type === "date" ? (h.type = "date", typeof d.min == "string" && (h.min = d.min), typeof d.max == "string" && (h.max = d.max), d.defaultValue != null && (h.value = String(d.defaultValue))) : (h.type = "text", d.defaultValue != null && (h.value = String(d.defaultValue))), y = h;
1694
1772
  }
1695
- const y = r();
1696
- l.appendChild(m), l.appendChild(y), o.push({
1773
+ const f = r();
1774
+ c.appendChild(y), c.appendChild(f), o.push({
1697
1775
  name: d.name,
1698
1776
  type: d.type,
1699
- el: m,
1777
+ el: y,
1700
1778
  required: d.required
1701
- }), n.appendChild(l);
1779
+ }), n.appendChild(c);
1702
1780
  });
1703
- const c = document.createElement("div");
1704
- c.className = "foisit-form-actions";
1705
- const h = document.createElement("button");
1706
- h.type = "submit", h.textContent = "Submit", h.className = "foisit-option-chip", h.style.fontWeight = "600", c.appendChild(h), n.appendChild(c), n.onsubmit = async (d) => {
1781
+ const l = document.createElement("div");
1782
+ l.className = "foisit-form-actions";
1783
+ const m = document.createElement("button");
1784
+ m.type = "submit", m.textContent = "Submit", m.className = "foisit-option-chip", m.style.fontWeight = "600", l.appendChild(m), n.appendChild(l), n.onsubmit = async (d) => {
1785
+ var y;
1707
1786
  d.preventDefault();
1708
- const l = {};
1709
- let f = !1;
1710
- n.querySelectorAll(".foisit-form-error").forEach((m) => {
1711
- m.style.display = "none", m.textContent = "";
1712
- }), n.querySelectorAll(".foisit-form-input").forEach((m) => {
1713
- m.classList.remove("foisit-error-border");
1787
+ const c = {};
1788
+ let u = !1;
1789
+ n.querySelectorAll(".foisit-form-error").forEach((f) => {
1790
+ f.style.display = "none", f.textContent = "";
1791
+ }), n.querySelectorAll(".foisit-form-input").forEach((f) => {
1792
+ f.classList.remove("foisit-error-border");
1714
1793
  });
1715
- for (const m of o) {
1716
- if (m.type === "file") {
1717
- const x = m.el.parentElement, p = x == null ? void 0 : x.querySelector(".foisit-form-error"), C = m.el, b = Array.from(C.files || []);
1718
- if (m.required && b.length === 0) {
1719
- f = !0, C.classList.add("foisit-error-border"), p && (p.textContent = "This file is required", p.style.display = "block");
1794
+ for (const f of o) {
1795
+ if (f.multiple) {
1796
+ let b = [];
1797
+ if (f.el instanceof HTMLSelectElement ? b = Array.from(f.el.selectedOptions).map((g) => g.value) : b = Array.from(
1798
+ f.el.querySelectorAll("input[type=checkbox]:checked")
1799
+ ).map((w) => w.value), f.required && b.length === 0) {
1800
+ u = !0, f.el.classList.add("foisit-error-border");
1801
+ const g = (y = f.el.parentElement) == null ? void 0 : y.querySelector(
1802
+ ".foisit-form-error"
1803
+ );
1804
+ g && (g.textContent = "This field is required", g.style.display = "block");
1805
+ }
1806
+ b.length > 0 && (c[f.name] = b);
1807
+ continue;
1808
+ }
1809
+ if (f.type === "file") {
1810
+ const b = f.el.parentElement, g = b == null ? void 0 : b.querySelector(
1811
+ ".foisit-form-error"
1812
+ ), w = f.el, k = Array.from(w.files || []);
1813
+ if (f.required && k.length === 0) {
1814
+ u = !0, w.classList.add("foisit-error-border"), g && (g.textContent = "This file is required", g.style.display = "block");
1720
1815
  continue;
1721
1816
  }
1722
- if (b.length === 0) continue;
1723
- const g = (t ?? []).find((w) => w.name === m.name), V = (g == null ? void 0 : g.delivery) ?? "file";
1724
- if (g != null && g.maxWidth || g != null && g.maxHeight)
1817
+ if (k.length === 0) continue;
1818
+ const p = (t ?? []).find((v) => v.name === f.name), S = (p == null ? void 0 : p.delivery) ?? "file";
1819
+ if (p != null && p.maxWidth || p != null && p.maxHeight)
1725
1820
  try {
1726
- const w = await this.getImageDimensions(b[0]);
1727
- if (g.maxWidth && w.width > g.maxWidth) {
1728
- f = !0, p && (p.textContent = `Image width must be ≤ ${g.maxWidth}px`, p.style.display = "block");
1821
+ const v = await this.getImageDimensions(k[0]);
1822
+ if (p.maxWidth && v.width > p.maxWidth) {
1823
+ u = !0, g && (g.textContent = `Image width must be ≤ ${p.maxWidth}px`, g.style.display = "block");
1729
1824
  continue;
1730
1825
  }
1731
- if (g.maxHeight && w.height > g.maxHeight) {
1732
- f = !0, p && (p.textContent = `Image height must be ≤ ${g.maxHeight}px`, p.style.display = "block");
1826
+ if (p.maxHeight && v.height > p.maxHeight) {
1827
+ u = !0, g && (g.textContent = `Image height must be ≤ ${p.maxHeight}px`, g.style.display = "block");
1733
1828
  continue;
1734
1829
  }
1735
1830
  } catch {
1736
1831
  }
1737
- if (g != null && g.maxDurationSec)
1832
+ if (p != null && p.maxDurationSec)
1738
1833
  try {
1739
- const w = await this.getMediaDuration(b[0]);
1740
- if (w && w > g.maxDurationSec) {
1741
- f = !0, p && (p.textContent = `Media duration must be ≤ ${g.maxDurationSec}s`, p.style.display = "block");
1834
+ const v = await this.getMediaDuration(k[0]);
1835
+ if (v && v > p.maxDurationSec) {
1836
+ u = !0, g && (g.textContent = `Media duration must be ≤ ${p.maxDurationSec}s`, g.style.display = "block");
1742
1837
  continue;
1743
1838
  }
1744
1839
  } catch {
1745
1840
  }
1746
- if (V === "file")
1747
- l[m.name] = g != null && g.multiple ? b : b[0];
1748
- else if (V === "base64")
1841
+ if (S === "file")
1842
+ c[f.name] = p != null && p.multiple ? k : k[0];
1843
+ else if (S === "base64")
1749
1844
  try {
1750
- const w = await Promise.all(b.map((B) => this.readFileAsDataURL(B)));
1751
- l[m.name] = g != null && g.multiple ? w : w[0];
1845
+ const v = await Promise.all(
1846
+ k.map((V) => this.readFileAsDataURL(V))
1847
+ );
1848
+ c[f.name] = p != null && p.multiple ? v : v[0];
1752
1849
  } catch {
1753
- f = !0, p && (p.textContent = "Failed to encode file(s) to base64.", p.style.display = "block");
1850
+ u = !0, g && (g.textContent = "Failed to encode file(s) to base64.", g.style.display = "block");
1754
1851
  continue;
1755
1852
  }
1756
1853
  continue;
1757
1854
  }
1758
- const y = (m.el.value ?? "").toString().trim(), u = m.el.parentElement, v = u == null ? void 0 : u.querySelector(".foisit-form-error");
1759
- if (m.required && (y == null || y === "")) {
1760
- f = !0, m.el.classList.add("foisit-error-border"), v && (v.textContent = "This field is required", v.style.display = "block");
1855
+ const x = (f.el.value ?? "").toString().trim(), E = f.el.parentElement, C = E == null ? void 0 : E.querySelector(
1856
+ ".foisit-form-error"
1857
+ );
1858
+ if (f.required && (x == null || x === "")) {
1859
+ u = !0, f.el.classList.add("foisit-error-border"), C && (C.textContent = "This field is required", C.style.display = "block");
1761
1860
  continue;
1762
1861
  }
1763
- if (y !== "")
1764
- if (m.type === "number") {
1765
- const x = Number(y);
1766
- Number.isNaN(x) || (l[m.name] = x);
1862
+ if (x !== "")
1863
+ if (f.type === "number") {
1864
+ const b = Number(x);
1865
+ Number.isNaN(b) || (c[f.name] = b);
1767
1866
  } else
1768
- l[m.name] = y;
1867
+ c[f.name] = x;
1769
1868
  }
1770
- if (f) {
1869
+ if (u) {
1771
1870
  n.classList.add("foisit-shake"), setTimeout(() => n.classList.remove("foisit-shake"), 400);
1772
1871
  return;
1773
1872
  }
1774
- h.disabled = !0, h.style.opacity = "0.6", o.forEach((m) => {
1775
- m.el.disabled = !0;
1776
- }), s(l);
1873
+ m.disabled = !0, m.style.opacity = "0.6", o.forEach((f) => {
1874
+ f.el.disabled = !0;
1875
+ }), s(c);
1777
1876
  }, this.messagesContainer.appendChild(n), this.scrollToBottom();
1778
1877
  }
1779
1878
  showLoading() {
@@ -1796,7 +1895,10 @@ class Bt {
1796
1895
  /** Subtle entrance animation for new messages */
1797
1896
  animateMessageEntrance(e, t) {
1798
1897
  if (!e) return;
1799
- e.style.transition = `opacity ${t}ms cubic-bezier(0.22, 0.9, 0.32, 1), transform ${Math.max(120, t)}ms cubic-bezier(0.22, 0.9, 0.32, 1)`, requestAnimationFrame(() => {
1898
+ e.style.transition = `opacity ${t}ms cubic-bezier(0.22, 0.9, 0.32, 1), transform ${Math.max(
1899
+ 120,
1900
+ t
1901
+ )}ms cubic-bezier(0.22, 0.9, 0.32, 1)`, requestAnimationFrame(() => {
1800
1902
  e.style.opacity = "1", e.style.transform = "translateY(0)";
1801
1903
  });
1802
1904
  const s = () => {
@@ -1816,9 +1918,9 @@ class Bt {
1816
1918
  t.scrollTop = n;
1817
1919
  return;
1818
1920
  }
1819
- const o = n - s, a = performance.now(), r = (c) => {
1820
- const h = Math.min(1, (c - a) / e), d = 1 - Math.pow(1 - h, 3);
1821
- t.scrollTop = Math.round(s + o * d), h < 1 && requestAnimationFrame(r);
1921
+ const o = n - s, a = performance.now(), r = (l) => {
1922
+ const m = Math.min(1, (l - a) / e), d = 1 - Math.pow(1 - m, 3);
1923
+ t.scrollTop = Math.round(s + o * d), m < 1 && requestAnimationFrame(r);
1822
1924
  };
1823
1925
  requestAnimationFrame(r);
1824
1926
  }
@@ -1840,7 +1942,22 @@ class Bt {
1840
1942
  /** Simple markdown renderer for AI responses */
1841
1943
  renderMarkdown(e) {
1842
1944
  let t = this.escapeHtml(e);
1843
- return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (s, n, o) => `<pre class="foisit-code-block"><code${n ? ` class="language-${n}"` : ""}>${o.trim()}</code></pre>`), t = t.replace(/`([^`]+)`/g, '<code class="foisit-inline-code">$1</code>'), t = t.replace(/^###### (.+)$/gm, '<h6 class="foisit-md-h6">$1</h6>'), t = t.replace(/^##### (.+)$/gm, '<h5 class="foisit-md-h5">$1</h5>'), t = t.replace(/^#### (.+)$/gm, '<h4 class="foisit-md-h4">$1</h4>'), t = t.replace(/^### (.+)$/gm, '<h3 class="foisit-md-h3">$1</h3>'), t = t.replace(/^## (.+)$/gm, '<h2 class="foisit-md-h2">$1</h2>'), t = t.replace(/^# (.+)$/gm, '<h1 class="foisit-md-h1">$1</h1>'), t = t.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^_]+)__/g, "<strong>$1</strong>"), t = t.replace(/\*([^*]+)\*/g, "<em>$1</em>"), t = t.replace(new RegExp("(?<!_)_([^_]+)_(?!_)", "g"), "<em>$1</em>"), t = t.replace(/~~([^~]+)~~/g, "<del>$1</del>"), t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" class="foisit-md-link">$1</a>'), t = t.replace(/^[\-\*] (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(/(<li class="foisit-md-li">.*<\/li>\n?)+/g, (s) => `<ul class="foisit-md-ul">${s}</ul>`), t = t.replace(/^\d+\. (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(new RegExp('(?<!<\\/ul>)(<li class="foisit-md-li">.*<\\/li>\\n?)+', "g"), (s) => s.includes("<ul") ? s : `<ol class="foisit-md-ol">${s}</ol>`), t = t.replace(/^&gt; (.+)$/gm, '<blockquote class="foisit-md-blockquote">$1</blockquote>'), t = t.replace(/^(---|___|\*\*\*)$/gm, '<hr class="foisit-md-hr">'), t = t.replace(/\n\n+/g, '</p><p class="foisit-md-p">'), t = t.replace(/\n/g, "<br>"), t.match(/^<(h[1-6]|ul|ol|pre|blockquote|hr|p)/) || (t = `<p class="foisit-md-p">${t}</p>`), t;
1945
+ return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (s, n, o) => `<pre class="foisit-code-block"><code${n ? ` class="language-${n}"` : ""}>${o.trim()}</code></pre>`), t = t.replace(
1946
+ /`([^`]+)`/g,
1947
+ '<code class="foisit-inline-code">$1</code>'
1948
+ ), t = t.replace(/^###### (.+)$/gm, '<h6 class="foisit-md-h6">$1</h6>'), t = t.replace(/^##### (.+)$/gm, '<h5 class="foisit-md-h5">$1</h5>'), t = t.replace(/^#### (.+)$/gm, '<h4 class="foisit-md-h4">$1</h4>'), t = t.replace(/^### (.+)$/gm, '<h3 class="foisit-md-h3">$1</h3>'), t = t.replace(/^## (.+)$/gm, '<h2 class="foisit-md-h2">$1</h2>'), t = t.replace(/^# (.+)$/gm, '<h1 class="foisit-md-h1">$1</h1>'), t = t.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^_]+)__/g, "<strong>$1</strong>"), t = t.replace(/\*([^*]+)\*/g, "<em>$1</em>"), t = t.replace(new RegExp("(?<!_)_([^_]+)_(?!_)", "g"), "<em>$1</em>"), t = t.replace(/~~([^~]+)~~/g, "<del>$1</del>"), t = t.replace(
1949
+ /\[([^\]]+)\]\(([^)]+)\)/g,
1950
+ '<a href="$2" target="_blank" rel="noopener noreferrer" class="foisit-md-link">$1</a>'
1951
+ ), t = t.replace(/^[\-\*] (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(
1952
+ /(<li class="foisit-md-li">.*<\/li>\n?)+/g,
1953
+ (s) => `<ul class="foisit-md-ul">${s}</ul>`
1954
+ ), t = t.replace(/^\d+\. (.+)$/gm, '<li class="foisit-md-li">$1</li>'), t = t.replace(
1955
+ new RegExp('(?<!<\\/ul>)(<li class="foisit-md-li">.*<\\/li>\\n?)+', "g"),
1956
+ (s) => s.includes("<ul") ? s : `<ol class="foisit-md-ol">${s}</ol>`
1957
+ ), t = t.replace(
1958
+ /^&gt; (.+)$/gm,
1959
+ '<blockquote class="foisit-md-blockquote">$1</blockquote>'
1960
+ ), t = t.replace(/^(---|___|\*\*\*)$/gm, '<hr class="foisit-md-hr">'), t = t.replace(/\n\n+/g, '</p><p class="foisit-md-p">'), t = t.replace(/\n/g, "<br>"), t.match(/^<(h[1-6]|ul|ol|pre|blockquote|hr|p)/) || (t = `<p class="foisit-md-p">${t}</p>`), t;
1844
1961
  }
1845
1962
  readFileAsDataURL(e) {
1846
1963
  return new Promise((t, s) => {
@@ -1853,7 +1970,10 @@ class Bt {
1853
1970
  try {
1854
1971
  const s = URL.createObjectURL(e), n = new Image();
1855
1972
  n.onload = () => {
1856
- const o = { width: n.naturalWidth || n.width, height: n.naturalHeight || n.height };
1973
+ const o = {
1974
+ width: n.naturalWidth || n.width,
1975
+ height: n.naturalHeight || n.height
1976
+ };
1857
1977
  URL.revokeObjectURL(s), t(o);
1858
1978
  }, n.onerror = () => {
1859
1979
  URL.revokeObjectURL(s), t({ width: 0, height: 0 });
@@ -1874,8 +1994,8 @@ class Bt {
1874
1994
  n.preload = "metadata", n.onloadedmetadata = () => {
1875
1995
  if (o) return;
1876
1996
  o = !0, clearTimeout(a);
1877
- const c = n.duration || 0;
1878
- URL.revokeObjectURL(s), t(c);
1997
+ const l = n.duration || 0;
1998
+ URL.revokeObjectURL(s), t(l);
1879
1999
  }, n.onerror = () => {
1880
2000
  o || (o = !0, clearTimeout(a), URL.revokeObjectURL(s), t(0));
1881
2001
  }, n.src = s;
@@ -1887,57 +2007,104 @@ class Bt {
1887
2007
  injectOverlayStyles() {
1888
2008
  if (document.getElementById("foisit-overlay-styles")) return;
1889
2009
  const e = document.createElement("style");
1890
- e.id = "foisit-overlay-styles", e.textContent = `
1891
- :root {
1892
- /* LIGHT MODE (Default) - Smoother gradient */
1893
- /* Changed: Softer, right-focused radial highlight to avoid a heavy white bottom */
1894
- --foisit-bg: radial-gradient(ellipse at 75% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
1895
- --foisit-border: 1px solid rgba(255, 255, 255, 0.25);
1896
- --foisit-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
1897
- --foisit-text: #333;
2010
+ e.id = "foisit-overlay-styles";
2011
+ const t = this.config.theme || "glass", s = this.config.themeColors || {};
2012
+ if (t === "solid") {
2013
+ const n = s.background || "#1a1a2e", o = s.text || "#ffffff", a = s.accent || "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", r = s.checkboxAccent || "#667eea", l = s.checkboxBorder || "rgba(255,255,255,0.16)", m = s.checkboxCheck || "#ffffff", d = s.userBubbleBg || "rgba(102, 126, 234, 0.2)", c = s.systemBubbleBg || "rgba(255, 255, 255, 0.08)", u = s.border || "rgba(255, 255, 255, 0.1)";
2014
+ e.textContent = `
2015
+ :root {
2016
+ /* SOLID THEME - Custom Colors */
2017
+ --foisit-bg: ${n};
2018
+ --foisit-border: 1px solid ${u};
2019
+ --foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
2020
+ --foisit-text: ${o};
2021
+ --foisit-accent: ${a};
2022
+ --foisit-backdrop: none;
1898
2023
 
1899
- /* Input */
1900
- --foisit-input-color: #333;
1901
- --foisit-input-placeholder: rgba(60, 60, 67, 0.6);
2024
+ /* Input */
2025
+ --foisit-input-color: ${o};
2026
+ --foisit-input-placeholder: ${o}99;
1902
2027
 
1903
- /* Bubbles */
1904
- --foisit-bubble-user-bg: rgba(0, 0, 0, 0.04);
1905
- --foisit-bubble-user-text: #333;
2028
+ /* Bubbles */
2029
+ --foisit-bubble-user-bg: ${d};
2030
+ --foisit-bubble-user-text: ${o};
1906
2031
 
1907
- --foisit-bubble-sys-bg: rgba(255, 255, 255, 0.45);
1908
- --foisit-bubble-sys-text: #333;
2032
+ --foisit-bubble-sys-bg: ${c};
2033
+ --foisit-bubble-sys-text: ${o}ee;
1909
2034
 
1910
- /* Form Colors */
1911
- --foisit-req-star: #ef4444; /* Red asterisk */
1912
- --foisit-error-text: #dc2626;
1913
- --foisit-error-border: #fca5a5;
1914
- }
2035
+ /* Checkbox accent color for custom-styled checkboxes */
2036
+ --foisit-checkbox-accent: ${r};
2037
+ /* Checkbox border and checkmark colors */
2038
+ --foisit-checkbox-border: ${l};
2039
+ --foisit-checkbox-check: ${m};
1915
2040
 
1916
- @media (prefers-color-scheme: dark) {
2041
+ /* Form Colors */
2042
+ --foisit-req-star: #f87171;
2043
+ --foisit-error-text: #fca5a5;
2044
+ --foisit-error-border: #f87171;
2045
+ }
2046
+ `;
2047
+ } else
2048
+ e.textContent = `
1917
2049
  :root {
1918
- /* DARK MODE */
1919
- --foisit-bg: linear-gradient(135deg, rgba(40, 40, 40, 0.65), rgba(40, 40, 40, 0.25));
1920
- --foisit-border: 1px solid rgba(255, 255, 255, 0.1);
1921
- --foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
1922
- --foisit-text: #fff;
2050
+ /* LIGHT MODE (Default) - Smoother gradient */
2051
+ /* Changed: Softer, right-focused radial highlight to avoid a heavy white bottom */
2052
+ --foisit-bg: radial-gradient(ellipse at 75% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
2053
+ --foisit-border: 1px solid rgba(255, 255, 255, 0.25);
2054
+ --foisit-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
2055
+ --foisit-text: #333;
2056
+ --foisit-backdrop: blur(20px);
1923
2057
 
1924
2058
  /* Input */
1925
- --foisit-input-color: white;
1926
- --foisit-input-placeholder: rgba(235, 235, 245, 0.5);
2059
+ --foisit-input-color: #333;
2060
+ --foisit-input-placeholder: rgba(60, 60, 67, 0.6);
1927
2061
 
1928
2062
  /* Bubbles */
1929
- --foisit-bubble-user-bg: rgba(255, 255, 255, 0.1);
1930
- --foisit-bubble-user-text: white;
2063
+ --foisit-bubble-user-bg: rgba(0, 0, 0, 0.04);
2064
+ --foisit-bubble-user-text: #333;
1931
2065
 
1932
- --foisit-bubble-sys-bg: rgba(255, 255, 255, 0.05);
1933
- --foisit-bubble-sys-text: rgba(255, 255, 255, 0.9);
2066
+ --foisit-bubble-sys-bg: rgba(255, 255, 255, 0.45);
2067
+ --foisit-bubble-sys-text: #333;
1934
2068
 
1935
2069
  /* Form Colors */
1936
- --foisit-req-star: #f87171;
1937
- --foisit-error-text: #fca5a5;
1938
- --foisit-error-border: #f87171;
2070
+ --foisit-req-star: #ef4444; /* Red asterisk */
2071
+ --foisit-error-text: #dc2626;
2072
+ --foisit-error-border: #fca5a5;
2073
+ --foisit-checkbox-accent: #667eea;
2074
+ --foisit-checkbox-border: rgba(0,0,0,0.18);
2075
+ --foisit-checkbox-check: #ffffff;
1939
2076
  }
1940
- }
2077
+
2078
+ @media (prefers-color-scheme: dark) {
2079
+ :root {
2080
+ /* DARK MODE */
2081
+ --foisit-bg: linear-gradient(135deg, rgba(40, 40, 40, 0.65), rgba(40, 40, 40, 0.25));
2082
+ --foisit-border: 1px solid rgba(255, 255, 255, 0.1);
2083
+ --foisit-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
2084
+ --foisit-text: #fff;
2085
+ --foisit-backdrop: blur(20px);
2086
+
2087
+ /* Input */
2088
+ --foisit-input-color: white;
2089
+ --foisit-input-placeholder: rgba(235, 235, 245, 0.5);
2090
+
2091
+ /* Bubbles */
2092
+ --foisit-bubble-user-bg: rgba(255, 255, 255, 0.1);
2093
+ --foisit-bubble-user-text: white;
2094
+
2095
+ --foisit-bubble-sys-bg: rgba(255, 255, 255, 0.05);
2096
+ --foisit-bubble-sys-text: rgba(255, 255, 255, 0.9);
2097
+
2098
+ /* Form Colors */
2099
+ --foisit-req-star: #f87171;
2100
+ --foisit-error-text: #fca5a5;
2101
+ --foisit-error-border: #f87171;
2102
+ --foisit-checkbox-border: rgba(255,255,255,0.16);
2103
+ --foisit-checkbox-check: #ffffff;
2104
+ }
2105
+ }
2106
+ `;
2107
+ e.textContent += `
1941
2108
 
1942
2109
  @keyframes foisitPulse {
1943
2110
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
@@ -1985,8 +2152,8 @@ class Bt {
1985
2152
  border: var(--foisit-border);
1986
2153
  box-shadow: var(--foisit-shadow);
1987
2154
 
1988
- backdrop-filter: blur(20px);
1989
- -webkit-backdrop-filter: blur(20px);
2155
+ backdrop-filter: var(--foisit-backdrop);
2156
+ -webkit-backdrop-filter: var(--foisit-backdrop);
1990
2157
 
1991
2158
  border-radius: 18px;
1992
2159
  display: none;
@@ -2119,6 +2286,60 @@ class Bt {
2119
2286
  .foisit-option-chip:hover {
2120
2287
  background: rgba(127,127,127,0.15);
2121
2288
  }
2289
+ .foisit-option-chip.selected {
2290
+ background: rgba(127,127,127,0.25);
2291
+ }
2292
+
2293
+ .foisit-multiselect-container {
2294
+ display: flex;
2295
+ flex-direction: column;
2296
+ gap: 6px;
2297
+ margin-top: 6px;
2298
+ }
2299
+ .foisit-multiselect-label {
2300
+ font-size: 13px;
2301
+ color: var(--foisit-text);
2302
+ display: flex;
2303
+ align-items: center;
2304
+ gap: 10px;
2305
+ }
2306
+ .foisit-form-checkbox {
2307
+ margin-right: 8px;
2308
+ width: 18px;
2309
+ height: 18px;
2310
+ -webkit-appearance: none;
2311
+ appearance: none;
2312
+ border: 1.5px solid var(--foisit-checkbox-border);
2313
+ border-radius: 4px;
2314
+ display: inline-block;
2315
+ position: relative;
2316
+ vertical-align: middle;
2317
+ background: transparent;
2318
+ transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
2319
+ }
2320
+ .foisit-form-checkbox:focus {
2321
+ box-shadow: 0 0 0 5px rgba(100,150,255,0.12);
2322
+ outline: none;
2323
+ }
2324
+ .foisit-form-checkbox:checked {
2325
+ background: var(--foisit-checkbox-accent);
2326
+ border-color: var(--foisit-checkbox-accent);
2327
+ }
2328
+ .foisit-form-checkbox:checked::after {
2329
+ content: '';
2330
+ position: absolute;
2331
+ left: 5px;
2332
+ top: 3px;
2333
+ width: 5px;
2334
+ height: 9px;
2335
+ border: solid var(--foisit-checkbox-check);
2336
+ border-width: 0 2px 2px 0;
2337
+ transform: rotate(45deg);
2338
+ }
2339
+ .foisit-form-checkbox:disabled {
2340
+ opacity: 0.5;
2341
+ cursor: not-allowed;
2342
+ }
2122
2343
 
2123
2344
  /* Form Styling */
2124
2345
  .foisit-form {
@@ -2195,8 +2416,8 @@ class Bt {
2195
2416
  border: 1px solid rgba(255,255,255,0.2);
2196
2417
  background: var(--foisit-bg);
2197
2418
  color: var(--foisit-text);
2198
- backdrop-filter: blur(10px);
2199
- -webkit-backdrop-filter: blur(10px);
2419
+ backdrop-filter: var(--foisit-backdrop);
2420
+ -webkit-backdrop-filter: var(--foisit-backdrop);
2200
2421
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
2201
2422
  cursor: pointer;
2202
2423
  pointer-events: auto;
@@ -2304,11 +2525,17 @@ class Ut {
2304
2525
  }), this.fallbackHandler = new Ft(), this.voiceProcessor = new Ht(), this.textToSpeech = new qe(), this.stateManager = new zt(), this.gestureHandler = new ae(), this.overlayManager = new Bt({
2305
2526
  floatingButton: this.config.floatingButton,
2306
2527
  inputPlaceholder: this.config.inputPlaceholder,
2307
- enableGestureActivation: this.config.enableGestureActivation
2528
+ enableGestureActivation: this.config.enableGestureActivation,
2529
+ theme: this.config.theme,
2530
+ themeColors: this.config.themeColors
2308
2531
  }), this.overlayManager.setExternalCommandExecutor(async (t) => this.commandHandler.executeCommand(t)), this.config.commands.forEach((t) => this.commandHandler.addCommand(t)), this.config.fallbackResponse && this.fallbackHandler.setFallbackMessage(this.config.fallbackResponse), this.overlayManager.registerCallbacks(
2309
2532
  async (t) => {
2310
2533
  if (typeof t == "string")
2311
2534
  this.overlayManager.addMessage(t, "user");
2535
+ else if (Array.isArray(t))
2536
+ t.forEach(
2537
+ (s) => this.overlayManager.addMessage(String(s), "user")
2538
+ );
2312
2539
  else if (t && typeof t == "object") {
2313
2540
  const s = this.extractUserLabel(t);
2314
2541
  s && this.overlayManager.addMessage(s, "user");
@@ -2320,11 +2547,15 @@ class Ut {
2320
2547
  }
2321
2548
  /** Start listening for activation and commands */
2322
2549
  startListening() {
2323
- console.log("AssistantService: Voice is disabled; startListening() is a no-op.");
2550
+ console.log(
2551
+ "AssistantService: Voice is disabled; startListening() is a no-op."
2552
+ );
2324
2553
  }
2325
2554
  /** Stop listening */
2326
2555
  stopListening() {
2327
- console.log("AssistantService: Voice is disabled; stopListening() is a no-op."), this.isActivated = !1;
2556
+ console.log(
2557
+ "AssistantService: Voice is disabled; stopListening() is a no-op."
2558
+ ), this.isActivated = !1;
2328
2559
  }
2329
2560
  /** Reset activation state so the next activation flow can occur. */
2330
2561
  reactivate() {
@@ -2370,7 +2601,10 @@ class Ut {
2370
2601
  }
2371
2602
  if (t.type === "error") {
2372
2603
  const s = typeof e == "string" ? e : "";
2373
- s ? (this.fallbackHandler.handleFallback(s), this.overlayManager.addMessage(this.fallbackHandler.getFallbackMessage(), "system")) : t.message && this.overlayManager.addMessage(t.message, "system");
2604
+ s ? (this.fallbackHandler.handleFallback(s), this.overlayManager.addMessage(
2605
+ this.fallbackHandler.getFallbackMessage(),
2606
+ "system"
2607
+ )) : t.message && this.overlayManager.addMessage(t.message, "system");
2374
2608
  return;
2375
2609
  }
2376
2610
  if ((t.type === "ambiguous" || t.type === "confirm") && t.options) {
@@ -2441,6 +2675,10 @@ class Ut {
2441
2675
  async (s) => {
2442
2676
  if (typeof s == "string")
2443
2677
  this.overlayManager.addMessage(s, "user");
2678
+ else if (Array.isArray(s))
2679
+ s.forEach(
2680
+ (n) => this.overlayManager.addMessage(String(n), "user")
2681
+ );
2444
2682
  else if (s && typeof s == "object") {
2445
2683
  const n = this.extractUserLabel(s);
2446
2684
  n && this.overlayManager.addMessage(n, "user");
@@ -2481,7 +2719,7 @@ const Wt = /* @__PURE__ */ ht({
2481
2719
  return t;
2482
2720
  };
2483
2721
  function Yt(i, e, t, s, n, o) {
2484
- return yt(i.$slots, "default");
2722
+ return bt(i.$slots, "default");
2485
2723
  }
2486
2724
  const Gt = /* @__PURE__ */ jt(Wt, [["render", Yt]]), Kt = () => {
2487
2725
  const i = ft("assistantService");