@gymmymac/bob-widget 3.2.14 → 3.2.16
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/CHANGELOG.md +14 -0
- package/dist/index.js +12 -12
- package/dist/index.mjs +348 -338
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var Zn = (t) => {
|
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
4
|
var sn = (t, e, r) => e.has(t) || Zn("Cannot " + r);
|
|
5
|
-
var w = (t, e, r) => (sn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), ne = (t, e, r) => e.has(t) ? Zn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), H = (t, e, r, s) => (sn(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r),
|
|
5
|
+
var w = (t, e, r) => (sn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), ne = (t, e, r) => e.has(t) ? Zn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), H = (t, e, r, s) => (sn(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r), me = (t, e, r) => (sn(t, e, "access private method"), r);
|
|
6
6
|
var Fs = (t, e, r, s) => ({
|
|
7
7
|
set _(n) {
|
|
8
8
|
H(t, e, n, r);
|
|
@@ -13,7 +13,7 @@ var Fs = (t, e, r, s) => ({
|
|
|
13
13
|
});
|
|
14
14
|
import * as mt from "react";
|
|
15
15
|
import nr, { useRef as X, useCallback as Y, useEffect as ce, createContext as Ua, useMemo as Et, useContext as zn, useState as V, useImperativeHandle as Ma } from "react";
|
|
16
|
-
const ar = "3.2.
|
|
16
|
+
const ar = "3.2.16", nd = () => ar;
|
|
17
17
|
var gn = { exports: {} }, is = {};
|
|
18
18
|
/**
|
|
19
19
|
* @license React
|
|
@@ -70,10 +70,10 @@ function qa() {
|
|
|
70
70
|
{
|
|
71
71
|
var oe = b.ReactDebugCurrentFrame, fe = oe.getStackAddendum();
|
|
72
72
|
fe !== "" && (F += "%s", D = D.concat([fe]));
|
|
73
|
-
var
|
|
73
|
+
var ve = D.map(function(de) {
|
|
74
74
|
return String(de);
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
ve.unshift("Warning: " + F), Function.prototype.apply.call(console[y], console, ve);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
var v = !1, S = !1, R = !1, P = !1, k = !1, N;
|
|
@@ -130,9 +130,9 @@ function qa() {
|
|
|
130
130
|
var oe = y.displayName || null;
|
|
131
131
|
return oe !== null ? oe : A(y.type) || "Memo";
|
|
132
132
|
case f: {
|
|
133
|
-
var fe = y,
|
|
133
|
+
var fe = y, ve = fe._payload, de = fe._init;
|
|
134
134
|
try {
|
|
135
|
-
return A(de(
|
|
135
|
+
return A(de(ve));
|
|
136
136
|
} catch {
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
@@ -144,7 +144,7 @@ function qa() {
|
|
|
144
144
|
function re() {
|
|
145
145
|
}
|
|
146
146
|
re.__reactDisabledLog = !0;
|
|
147
|
-
function
|
|
147
|
+
function ke() {
|
|
148
148
|
{
|
|
149
149
|
if (W === 0) {
|
|
150
150
|
M = console.log, le = console.info, K = console.warn, U = console.error, G = console.group, he = console.groupCollapsed, ee = console.groupEnd;
|
|
@@ -216,25 +216,25 @@ function qa() {
|
|
|
216
216
|
` + O + y;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var Oe = !1, Ae;
|
|
220
220
|
{
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var Se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
222
|
+
Ae = new Se();
|
|
223
223
|
}
|
|
224
224
|
function Qe(y, F) {
|
|
225
|
-
if (!y ||
|
|
225
|
+
if (!y || Oe)
|
|
226
226
|
return "";
|
|
227
227
|
{
|
|
228
|
-
var D =
|
|
228
|
+
var D = Ae.get(y);
|
|
229
229
|
if (D !== void 0)
|
|
230
230
|
return D;
|
|
231
231
|
}
|
|
232
232
|
var oe;
|
|
233
|
-
|
|
233
|
+
Oe = !0;
|
|
234
234
|
var fe = Error.prepareStackTrace;
|
|
235
235
|
Error.prepareStackTrace = void 0;
|
|
236
|
-
var
|
|
237
|
-
|
|
236
|
+
var ve;
|
|
237
|
+
ve = se.current, se.current = null, ke();
|
|
238
238
|
try {
|
|
239
239
|
if (F) {
|
|
240
240
|
var de = function() {
|
|
@@ -271,26 +271,26 @@ function qa() {
|
|
|
271
271
|
if (I && oe && typeof I.stack == "string") {
|
|
272
272
|
for (var ue = I.stack.split(`
|
|
273
273
|
`), Ie = oe.stack.split(`
|
|
274
|
-
`),
|
|
275
|
-
|
|
276
|
-
for (;
|
|
277
|
-
if (ue[
|
|
278
|
-
if (
|
|
274
|
+
`), _e = ue.length - 1, Re = Ie.length - 1; _e >= 1 && Re >= 0 && ue[_e] !== Ie[Re]; )
|
|
275
|
+
Re--;
|
|
276
|
+
for (; _e >= 1 && Re >= 0; _e--, Re--)
|
|
277
|
+
if (ue[_e] !== Ie[Re]) {
|
|
278
|
+
if (_e !== 1 || Re !== 1)
|
|
279
279
|
do
|
|
280
|
-
if (
|
|
280
|
+
if (_e--, Re--, Re < 0 || ue[_e] !== Ie[Re]) {
|
|
281
281
|
var Ue = `
|
|
282
|
-
` + ue[
|
|
283
|
-
return y.displayName && Ue.includes("<anonymous>") && (Ue = Ue.replace("<anonymous>", y.displayName)), typeof y == "function" &&
|
|
282
|
+
` + ue[_e].replace(" at new ", " at ");
|
|
283
|
+
return y.displayName && Ue.includes("<anonymous>") && (Ue = Ue.replace("<anonymous>", y.displayName)), typeof y == "function" && Ae.set(y, Ue), Ue;
|
|
284
284
|
}
|
|
285
|
-
while (
|
|
285
|
+
while (_e >= 1 && Re >= 0);
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
} finally {
|
|
290
|
-
|
|
290
|
+
Oe = !1, se.current = ve, $(), Error.prepareStackTrace = fe;
|
|
291
291
|
}
|
|
292
292
|
var ze = y ? y.displayName || y.name : "", ct = ze ? ae(ze) : "";
|
|
293
|
-
return typeof y == "function" &&
|
|
293
|
+
return typeof y == "function" && Ae.set(y, ct), ct;
|
|
294
294
|
}
|
|
295
295
|
function et(y, F, D) {
|
|
296
296
|
return Qe(y, !1);
|
|
@@ -319,9 +319,9 @@ function qa() {
|
|
|
319
319
|
case h:
|
|
320
320
|
return st(y.type, F, D);
|
|
321
321
|
case f: {
|
|
322
|
-
var oe = y, fe = oe._payload,
|
|
322
|
+
var oe = y, fe = oe._payload, ve = oe._init;
|
|
323
323
|
try {
|
|
324
|
-
return st(
|
|
324
|
+
return st(ve(fe), F, D);
|
|
325
325
|
} catch {
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -338,9 +338,9 @@ function qa() {
|
|
|
338
338
|
}
|
|
339
339
|
function L(y, F, D, oe, fe) {
|
|
340
340
|
{
|
|
341
|
-
var
|
|
341
|
+
var ve = Function.call.bind(Ye);
|
|
342
342
|
for (var de in y)
|
|
343
|
-
if (
|
|
343
|
+
if (ve(y, de)) {
|
|
344
344
|
var ue = void 0;
|
|
345
345
|
try {
|
|
346
346
|
if (typeof y[de] != "function") {
|
|
@@ -348,16 +348,16 @@ function qa() {
|
|
|
348
348
|
throw Ie.name = "Invariant Violation", Ie;
|
|
349
349
|
}
|
|
350
350
|
ue = y[de](F, de, oe, D, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
351
|
-
} catch (
|
|
352
|
-
ue =
|
|
351
|
+
} catch (_e) {
|
|
352
|
+
ue = _e;
|
|
353
353
|
}
|
|
354
354
|
ue && !(ue instanceof Error) && (q(fe), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", oe || "React class", D, de, typeof ue), q(null)), ue instanceof Error && !(ue.message in nt) && (nt[ue.message] = !0, q(fe), _("Failed %s type: %s", D, ue.message), q(null));
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
var
|
|
358
|
+
var je = Array.isArray;
|
|
359
359
|
function Z(y) {
|
|
360
|
-
return
|
|
360
|
+
return je(y);
|
|
361
361
|
}
|
|
362
362
|
function pe(y) {
|
|
363
363
|
{
|
|
@@ -365,7 +365,7 @@ function qa() {
|
|
|
365
365
|
return D;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function we(y) {
|
|
369
369
|
try {
|
|
370
370
|
return We(y), !1;
|
|
371
371
|
} catch {
|
|
@@ -376,7 +376,7 @@ function qa() {
|
|
|
376
376
|
return "" + y;
|
|
377
377
|
}
|
|
378
378
|
function Be(y) {
|
|
379
|
-
if (
|
|
379
|
+
if (we(y))
|
|
380
380
|
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pe(y)), We(y);
|
|
381
381
|
}
|
|
382
382
|
var Ne = b.ReactCurrentOwner, Ke = {
|
|
@@ -404,7 +404,7 @@ function qa() {
|
|
|
404
404
|
function z(y, F) {
|
|
405
405
|
typeof y.ref == "string" && Ne.current;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function ye(y, F) {
|
|
408
408
|
{
|
|
409
409
|
var D = function() {
|
|
410
410
|
lr || (lr = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", F));
|
|
@@ -415,7 +415,7 @@ function qa() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ee(y, F) {
|
|
419
419
|
{
|
|
420
420
|
var D = function() {
|
|
421
421
|
ns || (ns = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", F));
|
|
@@ -426,7 +426,7 @@ function qa() {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var xe = function(y, F, D, oe, fe, ve, de) {
|
|
430
430
|
var ue = {
|
|
431
431
|
// This tag allows us to uniquely identify this as a React Element
|
|
432
432
|
$$typeof: e,
|
|
@@ -436,7 +436,7 @@ function qa() {
|
|
|
436
436
|
ref: D,
|
|
437
437
|
props: de,
|
|
438
438
|
// Record the component responsible for creating this element.
|
|
439
|
-
_owner:
|
|
439
|
+
_owner: ve
|
|
440
440
|
};
|
|
441
441
|
return ue._store = {}, Object.defineProperty(ue._store, "validated", {
|
|
442
442
|
configurable: !1,
|
|
@@ -457,20 +457,20 @@ function qa() {
|
|
|
457
457
|
};
|
|
458
458
|
function it(y, F, D, oe, fe) {
|
|
459
459
|
{
|
|
460
|
-
var
|
|
460
|
+
var ve, de = {}, ue = null, Ie = null;
|
|
461
461
|
D !== void 0 && (Be(D), ue = "" + D), Ns(F) && (Be(F.key), ue = "" + F.key), Is(F) && (Ie = F.ref, z(F, fe));
|
|
462
|
-
for (
|
|
463
|
-
Ye.call(F,
|
|
462
|
+
for (ve in F)
|
|
463
|
+
Ye.call(F, ve) && !Ke.hasOwnProperty(ve) && (de[ve] = F[ve]);
|
|
464
464
|
if (y && y.defaultProps) {
|
|
465
|
-
var
|
|
466
|
-
for (
|
|
467
|
-
de[
|
|
465
|
+
var _e = y.defaultProps;
|
|
466
|
+
for (ve in _e)
|
|
467
|
+
de[ve] === void 0 && (de[ve] = _e[ve]);
|
|
468
468
|
}
|
|
469
469
|
if (ue || Ie) {
|
|
470
|
-
var
|
|
471
|
-
ue &&
|
|
470
|
+
var Re = typeof y == "function" ? y.displayName || y.name || "Unknown" : y;
|
|
471
|
+
ue && ye(de, Re), Ie && Ee(de, Re);
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return xe(y, ue, Ie, fe, oe, Ne.current, de);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
var Pt = b.ReactCurrentOwner, Ut = b.ReactDebugCurrentFrame;
|
|
@@ -541,7 +541,7 @@ Check the top-level render call using <` + D + ">.");
|
|
|
541
541
|
else if (y) {
|
|
542
542
|
var fe = x(y);
|
|
543
543
|
if (typeof fe == "function" && fe !== y.entries)
|
|
544
|
-
for (var
|
|
544
|
+
for (var ve = fe.call(y), de; !(de = ve.next()).done; )
|
|
545
545
|
It(de.value) && yt(de.value, F);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
@@ -584,7 +584,7 @@ Check the top-level render call using <` + D + ">.");
|
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
var lt = {};
|
|
587
|
-
function zt(y, F, D, oe, fe,
|
|
587
|
+
function zt(y, F, D, oe, fe, ve) {
|
|
588
588
|
{
|
|
589
589
|
var de = E(y);
|
|
590
590
|
if (!de) {
|
|
@@ -592,12 +592,12 @@ Check the top-level render call using <` + D + ">.");
|
|
|
592
592
|
(y === void 0 || typeof y == "object" && y !== null && Object.keys(y).length === 0) && (ue += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
593
593
|
var Ie = bt();
|
|
594
594
|
Ie ? ue += Ie : ue += Wt();
|
|
595
|
-
var
|
|
596
|
-
y === null ?
|
|
595
|
+
var _e;
|
|
596
|
+
y === null ? _e = "null" : Z(y) ? _e = "array" : y !== void 0 && y.$$typeof === e ? (_e = "<" + (A(y.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : _e = typeof y, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _e, ue);
|
|
597
597
|
}
|
|
598
|
-
var
|
|
599
|
-
if (
|
|
600
|
-
return
|
|
598
|
+
var Re = it(y, F, D, fe, ve);
|
|
599
|
+
if (Re == null)
|
|
600
|
+
return Re;
|
|
601
601
|
if (de) {
|
|
602
602
|
var Ue = F.children;
|
|
603
603
|
if (Ue !== void 0)
|
|
@@ -612,20 +612,20 @@ Check the top-level render call using <` + D + ">.");
|
|
|
612
612
|
ur(Ue, y);
|
|
613
613
|
}
|
|
614
614
|
if (Ye.call(F, "key")) {
|
|
615
|
-
var ct = A(y), I = Object.keys(F).filter(function(
|
|
616
|
-
return
|
|
615
|
+
var ct = A(y), I = Object.keys(F).filter(function(Ce) {
|
|
616
|
+
return Ce !== "key";
|
|
617
617
|
}), Ht = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
618
618
|
if (!lt[ct + Ht]) {
|
|
619
|
-
var
|
|
619
|
+
var ge = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
|
|
620
620
|
_(`A props object containing a "key" prop is being spread into JSX:
|
|
621
621
|
let props = %s;
|
|
622
622
|
<%s {...props} />
|
|
623
623
|
React keys must be passed directly to JSX without using spread:
|
|
624
624
|
let props = %s;
|
|
625
|
-
<%s key={someKey} {...props} />`, Ht, ct,
|
|
625
|
+
<%s key={someKey} {...props} />`, Ht, ct, ge, ct), lt[ct + Ht] = !0;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
return y === s ? qt(
|
|
628
|
+
return y === s ? qt(Re) : Pr(Re), Re;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
function Xe(y, F, D) {
|
|
@@ -2126,10 +2126,10 @@ class ra {
|
|
|
2126
2126
|
}, this.timerCalc(this.tries + 1));
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
var
|
|
2129
|
+
var Pe;
|
|
2130
2130
|
(function(t) {
|
|
2131
2131
|
t.abstime = "abstime", t.bool = "bool", t.date = "date", t.daterange = "daterange", t.float4 = "float4", t.float8 = "float8", t.int2 = "int2", t.int4 = "int4", t.int4range = "int4range", t.int8 = "int8", t.int8range = "int8range", t.json = "json", t.jsonb = "jsonb", t.money = "money", t.numeric = "numeric", t.oid = "oid", t.reltime = "reltime", t.text = "text", t.time = "time", t.timestamp = "timestamp", t.timestamptz = "timestamptz", t.timetz = "timetz", t.tsrange = "tsrange", t.tstzrange = "tstzrange";
|
|
2132
|
-
})(
|
|
2132
|
+
})(Pe || (Pe = {}));
|
|
2133
2133
|
const oi = (t, e, r = {}) => {
|
|
2134
2134
|
var s;
|
|
2135
2135
|
const n = (s = r.skipTypes) !== null && s !== void 0 ? s : [];
|
|
@@ -2143,34 +2143,34 @@ const oi = (t, e, r = {}) => {
|
|
|
2143
2143
|
return po(e, r);
|
|
2144
2144
|
}
|
|
2145
2145
|
switch (t) {
|
|
2146
|
-
case
|
|
2146
|
+
case Pe.bool:
|
|
2147
2147
|
return uo(e);
|
|
2148
|
-
case
|
|
2149
|
-
case
|
|
2150
|
-
case
|
|
2151
|
-
case
|
|
2152
|
-
case
|
|
2153
|
-
case
|
|
2154
|
-
case
|
|
2148
|
+
case Pe.float4:
|
|
2149
|
+
case Pe.float8:
|
|
2150
|
+
case Pe.int2:
|
|
2151
|
+
case Pe.int4:
|
|
2152
|
+
case Pe.int8:
|
|
2153
|
+
case Pe.numeric:
|
|
2154
|
+
case Pe.oid:
|
|
2155
2155
|
return ho(e);
|
|
2156
|
-
case
|
|
2157
|
-
case
|
|
2156
|
+
case Pe.json:
|
|
2157
|
+
case Pe.jsonb:
|
|
2158
2158
|
return fo(e);
|
|
2159
|
-
case
|
|
2159
|
+
case Pe.timestamp:
|
|
2160
2160
|
return go(e);
|
|
2161
|
-
case
|
|
2162
|
-
case
|
|
2163
|
-
case
|
|
2164
|
-
case
|
|
2165
|
-
case
|
|
2166
|
-
case
|
|
2167
|
-
case
|
|
2168
|
-
case
|
|
2169
|
-
case
|
|
2170
|
-
case
|
|
2171
|
-
case
|
|
2172
|
-
case
|
|
2173
|
-
case
|
|
2161
|
+
case Pe.abstime:
|
|
2162
|
+
case Pe.date:
|
|
2163
|
+
case Pe.daterange:
|
|
2164
|
+
case Pe.int4range:
|
|
2165
|
+
case Pe.int8range:
|
|
2166
|
+
case Pe.money:
|
|
2167
|
+
case Pe.reltime:
|
|
2168
|
+
case Pe.text:
|
|
2169
|
+
case Pe.time:
|
|
2170
|
+
case Pe.timestamptz:
|
|
2171
|
+
case Pe.timetz:
|
|
2172
|
+
case Pe.tsrange:
|
|
2173
|
+
case Pe.tstzrange:
|
|
2174
2174
|
return vn(e);
|
|
2175
2175
|
default:
|
|
2176
2176
|
return vn(e);
|
|
@@ -10599,7 +10599,7 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10599
10599
|
}
|
|
10600
10600
|
setData(e, r) {
|
|
10601
10601
|
const s = Cn(this.state.data, e, this.options);
|
|
10602
|
-
return
|
|
10602
|
+
return me(this, kt, Ft).call(this, {
|
|
10603
10603
|
data: s,
|
|
10604
10604
|
type: "success",
|
|
10605
10605
|
dataUpdatedAt: r == null ? void 0 : r.updatedAt,
|
|
@@ -10607,7 +10607,7 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10607
10607
|
}), s;
|
|
10608
10608
|
}
|
|
10609
10609
|
setState(e, r) {
|
|
10610
|
-
|
|
10610
|
+
me(this, kt, Ft).call(this, { type: "setState", state: e, setStateOptions: r });
|
|
10611
10611
|
}
|
|
10612
10612
|
cancel(e) {
|
|
10613
10613
|
var s, n;
|
|
@@ -10661,7 +10661,7 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10661
10661
|
return this.observers.length;
|
|
10662
10662
|
}
|
|
10663
10663
|
invalidate() {
|
|
10664
|
-
this.state.isInvalidated ||
|
|
10664
|
+
this.state.isInvalidated || me(this, kt, Ft).call(this, { type: "invalidate" });
|
|
10665
10665
|
}
|
|
10666
10666
|
async fetch(e, r) {
|
|
10667
10667
|
var c, u, d, h, f, p, g, m, x, b, _, j;
|
|
@@ -10711,7 +10711,7 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10711
10711
|
};
|
|
10712
10712
|
return n(v), v;
|
|
10713
10713
|
})();
|
|
10714
|
-
(u = this.options.behavior) == null || u.onFetch(l, this), H(this, Vr, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = l.fetchOptions) == null ? void 0 : d.meta)) &&
|
|
10714
|
+
(u = this.options.behavior) == null || u.onFetch(l, this), H(this, Vr, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = l.fetchOptions) == null ? void 0 : d.meta)) && me(this, kt, Ft).call(this, { type: "fetch", meta: (h = l.fetchOptions) == null ? void 0 : h.meta }), H(this, He, wa({
|
|
10715
10715
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
10716
10716
|
fn: l.fetchFn,
|
|
10717
10717
|
onCancel: (v) => {
|
|
@@ -10721,13 +10721,13 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10721
10721
|
}), s.abort();
|
|
10722
10722
|
},
|
|
10723
10723
|
onFail: (v, S) => {
|
|
10724
|
-
|
|
10724
|
+
me(this, kt, Ft).call(this, { type: "failed", failureCount: v, error: S });
|
|
10725
10725
|
},
|
|
10726
10726
|
onPause: () => {
|
|
10727
|
-
|
|
10727
|
+
me(this, kt, Ft).call(this, { type: "pause" });
|
|
10728
10728
|
},
|
|
10729
10729
|
onContinue: () => {
|
|
10730
|
-
|
|
10730
|
+
me(this, kt, Ft).call(this, { type: "continue" });
|
|
10731
10731
|
},
|
|
10732
10732
|
retry: l.options.retry,
|
|
10733
10733
|
retryDelay: l.options.retryDelay,
|
|
@@ -10756,7 +10756,7 @@ var _r, Vi, xa = (Vi = class {
|
|
|
10756
10756
|
return this.state.data;
|
|
10757
10757
|
}
|
|
10758
10758
|
}
|
|
10759
|
-
throw
|
|
10759
|
+
throw me(this, kt, Ft).call(this, {
|
|
10760
10760
|
type: "error",
|
|
10761
10761
|
error: v
|
|
10762
10762
|
}), (b = (x = w(this, pt).config).onError) == null || b.call(
|
|
@@ -10880,12 +10880,12 @@ function Ci(t) {
|
|
|
10880
10880
|
fetchStatus: "idle"
|
|
10881
10881
|
};
|
|
10882
10882
|
}
|
|
10883
|
-
var at,
|
|
10883
|
+
var at, be, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Te, hs, Nn, Fn, Bn, $n, Ln, Dn, Un, ka, Ji, Fc = (Ji = class extends Cs {
|
|
10884
10884
|
constructor(e, r) {
|
|
10885
10885
|
super();
|
|
10886
|
-
ne(this,
|
|
10886
|
+
ne(this, Te);
|
|
10887
10887
|
ne(this, at);
|
|
10888
|
-
ne(this,
|
|
10888
|
+
ne(this, be);
|
|
10889
10889
|
ne(this, Es);
|
|
10890
10890
|
ne(this, rt);
|
|
10891
10891
|
ne(this, Er);
|
|
@@ -10907,52 +10907,52 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
10907
10907
|
this.refetch = this.refetch.bind(this);
|
|
10908
10908
|
}
|
|
10909
10909
|
onSubscribe() {
|
|
10910
|
-
this.listeners.size === 1 && (w(this,
|
|
10910
|
+
this.listeners.size === 1 && (w(this, be).addObserver(this), Pi(w(this, be), this.options) ? me(this, Te, hs).call(this) : this.updateResult(), me(this, Te, $n).call(this));
|
|
10911
10911
|
}
|
|
10912
10912
|
onUnsubscribe() {
|
|
10913
10913
|
this.hasListeners() || this.destroy();
|
|
10914
10914
|
}
|
|
10915
10915
|
shouldFetchOnReconnect() {
|
|
10916
10916
|
return Mn(
|
|
10917
|
-
w(this,
|
|
10917
|
+
w(this, be),
|
|
10918
10918
|
this.options,
|
|
10919
10919
|
this.options.refetchOnReconnect
|
|
10920
10920
|
);
|
|
10921
10921
|
}
|
|
10922
10922
|
shouldFetchOnWindowFocus() {
|
|
10923
10923
|
return Mn(
|
|
10924
|
-
w(this,
|
|
10924
|
+
w(this, be),
|
|
10925
10925
|
this.options,
|
|
10926
10926
|
this.options.refetchOnWindowFocus
|
|
10927
10927
|
);
|
|
10928
10928
|
}
|
|
10929
10929
|
destroy() {
|
|
10930
|
-
this.listeners = /* @__PURE__ */ new Set(),
|
|
10930
|
+
this.listeners = /* @__PURE__ */ new Set(), me(this, Te, Ln).call(this), me(this, Te, Dn).call(this), w(this, be).removeObserver(this);
|
|
10931
10931
|
}
|
|
10932
10932
|
setOptions(e) {
|
|
10933
|
-
const r = this.options, s = w(this,
|
|
10934
|
-
if (this.options = w(this, at).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof gt(this.options.enabled, w(this,
|
|
10933
|
+
const r = this.options, s = w(this, be);
|
|
10934
|
+
if (this.options = w(this, at).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof gt(this.options.enabled, w(this, be)) != "boolean")
|
|
10935
10935
|
throw new Error(
|
|
10936
10936
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
10937
10937
|
);
|
|
10938
|
-
|
|
10938
|
+
me(this, Te, Un).call(this), w(this, be).setOptions(this.options), r._defaulted && !An(this.options, r) && w(this, at).getQueryCache().notify({
|
|
10939
10939
|
type: "observerOptionsUpdated",
|
|
10940
|
-
query: w(this,
|
|
10940
|
+
query: w(this, be),
|
|
10941
10941
|
observer: this
|
|
10942
10942
|
});
|
|
10943
10943
|
const n = this.hasListeners();
|
|
10944
10944
|
n && Ii(
|
|
10945
|
-
w(this,
|
|
10945
|
+
w(this, be),
|
|
10946
10946
|
s,
|
|
10947
10947
|
this.options,
|
|
10948
10948
|
r
|
|
10949
|
-
) &&
|
|
10950
|
-
const i =
|
|
10951
|
-
n && (w(this,
|
|
10949
|
+
) && me(this, Te, hs).call(this), this.updateResult(), n && (w(this, be) !== s || gt(this.options.enabled, w(this, be)) !== gt(r.enabled, w(this, be)) || ir(this.options.staleTime, w(this, be)) !== ir(r.staleTime, w(this, be))) && me(this, Te, Nn).call(this);
|
|
10950
|
+
const i = me(this, Te, Fn).call(this);
|
|
10951
|
+
n && (w(this, be) !== s || gt(this.options.enabled, w(this, be)) !== gt(r.enabled, w(this, be)) || i !== w(this, er)) && me(this, Te, Bn).call(this, i);
|
|
10952
10952
|
}
|
|
10953
10953
|
getOptimisticResult(e) {
|
|
10954
10954
|
const r = w(this, at).getQueryCache().build(w(this, at), e), s = this.createResult(r, e);
|
|
10955
|
-
return $c(this, s) && (H(this, rt, s), H(this, Gr, this.options), H(this, Er, w(this,
|
|
10955
|
+
return $c(this, s) && (H(this, rt, s), H(this, Gr, this.options), H(this, Er, w(this, be).state)), s;
|
|
10956
10956
|
}
|
|
10957
10957
|
getCurrentResult() {
|
|
10958
10958
|
return w(this, rt);
|
|
@@ -10970,7 +10970,7 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
10970
10970
|
w(this, Yr).add(e);
|
|
10971
10971
|
}
|
|
10972
10972
|
getCurrentQuery() {
|
|
10973
|
-
return w(this,
|
|
10973
|
+
return w(this, be);
|
|
10974
10974
|
}
|
|
10975
10975
|
refetch({ ...e } = {}) {
|
|
10976
10976
|
return this.fetch({
|
|
@@ -10982,14 +10982,14 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
10982
10982
|
return s.fetch().then(() => this.createResult(s, r));
|
|
10983
10983
|
}
|
|
10984
10984
|
fetch(e) {
|
|
10985
|
-
return
|
|
10985
|
+
return me(this, Te, hs).call(this, {
|
|
10986
10986
|
...e,
|
|
10987
10987
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
10988
10988
|
}).then(() => (this.updateResult(), w(this, rt)));
|
|
10989
10989
|
}
|
|
10990
10990
|
createResult(e, r) {
|
|
10991
10991
|
var N;
|
|
10992
|
-
const s = w(this,
|
|
10992
|
+
const s = w(this, be), n = this.options, i = w(this, rt), a = w(this, Er), l = w(this, Gr), u = e !== s ? e.state : w(this, Es), { state: d } = e;
|
|
10993
10993
|
let h = { ...d }, f = !1, p;
|
|
10994
10994
|
if (r._optimisticResults) {
|
|
10995
10995
|
const E = this.hasListeners(), T = !E && Pi(e, r), C = E && Ii(e, s, r, n);
|
|
@@ -11072,8 +11072,8 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
11072
11072
|
return k;
|
|
11073
11073
|
}
|
|
11074
11074
|
updateResult() {
|
|
11075
|
-
const e = w(this, rt), r = this.createResult(w(this,
|
|
11076
|
-
if (H(this, Er, w(this,
|
|
11075
|
+
const e = w(this, rt), r = this.createResult(w(this, be), this.options);
|
|
11076
|
+
if (H(this, Er, w(this, be).state), H(this, Gr, this.options), w(this, Er).data !== void 0 && H(this, Qr, w(this, be)), An(r, e))
|
|
11077
11077
|
return;
|
|
11078
11078
|
H(this, rt, r);
|
|
11079
11079
|
const s = () => {
|
|
@@ -11090,23 +11090,23 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
11090
11090
|
return w(this, rt)[c] !== e[c] && a.has(c);
|
|
11091
11091
|
});
|
|
11092
11092
|
};
|
|
11093
|
-
|
|
11093
|
+
me(this, Te, ka).call(this, { listeners: s() });
|
|
11094
11094
|
}
|
|
11095
11095
|
onQueryUpdate() {
|
|
11096
|
-
this.updateResult(), this.hasListeners() &&
|
|
11096
|
+
this.updateResult(), this.hasListeners() && me(this, Te, $n).call(this);
|
|
11097
11097
|
}
|
|
11098
|
-
}, at = new WeakMap(),
|
|
11099
|
-
|
|
11100
|
-
let r = w(this,
|
|
11098
|
+
}, at = new WeakMap(), be = new WeakMap(), Es = new WeakMap(), rt = new WeakMap(), Er = new WeakMap(), Gr = new WeakMap(), $t = new WeakMap(), Zt = new WeakMap(), Ts = new WeakMap(), Jr = new WeakMap(), Qr = new WeakMap(), Tr = new WeakMap(), Rr = new WeakMap(), er = new WeakMap(), Yr = new WeakMap(), Te = new WeakSet(), hs = function(e) {
|
|
11099
|
+
me(this, Te, Un).call(this);
|
|
11100
|
+
let r = w(this, be).fetch(
|
|
11101
11101
|
this.options,
|
|
11102
11102
|
e
|
|
11103
11103
|
);
|
|
11104
11104
|
return e != null && e.throwOnError || (r = r.catch(ot)), r;
|
|
11105
11105
|
}, Nn = function() {
|
|
11106
|
-
|
|
11106
|
+
me(this, Te, Ln).call(this);
|
|
11107
11107
|
const e = ir(
|
|
11108
11108
|
this.options.staleTime,
|
|
11109
|
-
w(this,
|
|
11109
|
+
w(this, be)
|
|
11110
11110
|
);
|
|
11111
11111
|
if (Or || w(this, rt).isStale || !Tn(e))
|
|
11112
11112
|
return;
|
|
@@ -11115,29 +11115,29 @@ var at, me, Es, rt, Er, Gr, $t, Zt, Ts, Jr, Qr, Tr, Rr, er, Yr, Ee, hs, Nn, Fn,
|
|
|
11115
11115
|
w(this, rt).isStale || this.updateResult();
|
|
11116
11116
|
}, s));
|
|
11117
11117
|
}, Fn = function() {
|
|
11118
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(w(this,
|
|
11118
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(w(this, be)) : this.options.refetchInterval) ?? !1;
|
|
11119
11119
|
}, Bn = function(e) {
|
|
11120
|
-
|
|
11121
|
-
(this.options.refetchIntervalInBackground || Gn.isFocused()) &&
|
|
11120
|
+
me(this, Te, Dn).call(this), H(this, er, e), !(Or || gt(this.options.enabled, w(this, be)) === !1 || !Tn(w(this, er)) || w(this, er) === 0) && H(this, Rr, vr.setInterval(() => {
|
|
11121
|
+
(this.options.refetchIntervalInBackground || Gn.isFocused()) && me(this, Te, hs).call(this);
|
|
11122
11122
|
}, w(this, er)));
|
|
11123
11123
|
}, $n = function() {
|
|
11124
|
-
|
|
11124
|
+
me(this, Te, Nn).call(this), me(this, Te, Bn).call(this, me(this, Te, Fn).call(this));
|
|
11125
11125
|
}, Ln = function() {
|
|
11126
11126
|
w(this, Tr) && (vr.clearTimeout(w(this, Tr)), H(this, Tr, void 0));
|
|
11127
11127
|
}, Dn = function() {
|
|
11128
11128
|
w(this, Rr) && (vr.clearInterval(w(this, Rr)), H(this, Rr, void 0));
|
|
11129
11129
|
}, Un = function() {
|
|
11130
11130
|
const e = w(this, at).getQueryCache().build(w(this, at), this.options);
|
|
11131
|
-
if (e === w(this,
|
|
11131
|
+
if (e === w(this, be))
|
|
11132
11132
|
return;
|
|
11133
|
-
const r = w(this,
|
|
11134
|
-
H(this,
|
|
11133
|
+
const r = w(this, be);
|
|
11134
|
+
H(this, be, e), H(this, Es, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this));
|
|
11135
11135
|
}, ka = function(e) {
|
|
11136
11136
|
Je.batch(() => {
|
|
11137
11137
|
e.listeners && this.listeners.forEach((r) => {
|
|
11138
11138
|
r(w(this, rt));
|
|
11139
11139
|
}), w(this, at).getQueryCache().notify({
|
|
11140
|
-
query: w(this,
|
|
11140
|
+
query: w(this, be),
|
|
11141
11141
|
type: "observerResultsUpdated"
|
|
11142
11142
|
});
|
|
11143
11143
|
});
|
|
@@ -11286,7 +11286,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11286
11286
|
async execute(e) {
|
|
11287
11287
|
var a, l, c, u, d, h, f, p, g, m, x, b, _, j, v, S, R, P;
|
|
11288
11288
|
const r = () => {
|
|
11289
|
-
|
|
11289
|
+
me(this, Ot, Gt).call(this, { type: "continue" });
|
|
11290
11290
|
}, s = {
|
|
11291
11291
|
client: w(this, Rs),
|
|
11292
11292
|
meta: this.options.meta,
|
|
@@ -11295,10 +11295,10 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11295
11295
|
H(this, Ar, wa({
|
|
11296
11296
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
|
|
11297
11297
|
onFail: (k, N) => {
|
|
11298
|
-
|
|
11298
|
+
me(this, Ot, Gt).call(this, { type: "failed", failureCount: k, error: N });
|
|
11299
11299
|
},
|
|
11300
11300
|
onPause: () => {
|
|
11301
|
-
|
|
11301
|
+
me(this, Ot, Gt).call(this, { type: "pause" });
|
|
11302
11302
|
},
|
|
11303
11303
|
onContinue: r,
|
|
11304
11304
|
retry: this.options.retry ?? 0,
|
|
@@ -11311,7 +11311,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11311
11311
|
if (n)
|
|
11312
11312
|
r();
|
|
11313
11313
|
else {
|
|
11314
|
-
|
|
11314
|
+
me(this, Ot, Gt).call(this, { type: "pending", variables: e, isPaused: i }), w(this, Ze).config.onMutate && await w(this, Ze).config.onMutate(
|
|
11315
11315
|
e,
|
|
11316
11316
|
this,
|
|
11317
11317
|
s
|
|
@@ -11321,7 +11321,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11321
11321
|
e,
|
|
11322
11322
|
s
|
|
11323
11323
|
));
|
|
11324
|
-
N !== this.state.context &&
|
|
11324
|
+
N !== this.state.context && me(this, Ot, Gt).call(this, {
|
|
11325
11325
|
type: "pending",
|
|
11326
11326
|
context: N,
|
|
11327
11327
|
variables: e,
|
|
@@ -11357,7 +11357,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11357
11357
|
e,
|
|
11358
11358
|
this.state.context,
|
|
11359
11359
|
s
|
|
11360
|
-
)),
|
|
11360
|
+
)), me(this, Ot, Gt).call(this, { type: "success", data: k }), k;
|
|
11361
11361
|
} catch (k) {
|
|
11362
11362
|
try {
|
|
11363
11363
|
await ((b = (x = w(this, Ze).config).onError) == null ? void 0 : b.call(
|
|
@@ -11407,7 +11407,7 @@ var Rs, At, Ze, Ar, Ot, Gt, Qi, Dc = (Qi = class extends xa {
|
|
|
11407
11407
|
} catch (N) {
|
|
11408
11408
|
Promise.reject(N);
|
|
11409
11409
|
}
|
|
11410
|
-
throw
|
|
11410
|
+
throw me(this, Ot, Gt).call(this, { type: "error", error: k }), k;
|
|
11411
11411
|
} finally {
|
|
11412
11412
|
w(this, Ze).runNext(this);
|
|
11413
11413
|
}
|
|
@@ -12507,7 +12507,7 @@ const Wn = (t) => {
|
|
|
12507
12507
|
hostContext: v,
|
|
12508
12508
|
callbacks: S,
|
|
12509
12509
|
enabled: P
|
|
12510
|
-
}), { isReturningUser: N } = uu(), [E, T] = V([]), [C, A] = V(""), [B, W] = V(!1), [M, le] = V(!1), [K, U] = V(null), G = X(null), he = X(!1), ee = X(!1), re = X(""),
|
|
12510
|
+
}), { isReturningUser: N } = uu(), [E, T] = V([]), [C, A] = V(""), [B, W] = V(!1), [M, le] = V(!1), [K, U] = V(null), G = X(null), he = X(!1), ee = X(!1), re = X(""), ke = X(!1), $ = X(null);
|
|
12511
12511
|
X(null);
|
|
12512
12512
|
const se = X({
|
|
12513
12513
|
source: "none",
|
|
@@ -12516,36 +12516,36 @@ const Wn = (t) => {
|
|
|
12516
12516
|
cannedUrl: null,
|
|
12517
12517
|
currentAudio: null,
|
|
12518
12518
|
searchingQueue: []
|
|
12519
|
-
}), O = X([]), ae = X("AWAITING_REGO"), [
|
|
12519
|
+
}), O = X([]), ae = X("AWAITING_REGO"), [Oe, Ae] = V(!1), Se = () => {
|
|
12520
12520
|
const z = se.current;
|
|
12521
12521
|
if (z.currentAudio) {
|
|
12522
12522
|
try {
|
|
12523
12523
|
z.currentAudio.pause(), z.currentAudio.currentTime = 0;
|
|
12524
|
-
} catch (
|
|
12525
|
-
console.warn("[BobWidget] Error stopping audio:",
|
|
12524
|
+
} catch (ye) {
|
|
12525
|
+
console.warn("[BobWidget] Error stopping audio:", ye);
|
|
12526
12526
|
}
|
|
12527
12527
|
z.currentAudio = null;
|
|
12528
12528
|
}
|
|
12529
|
-
z.isPlaying = !1, z.source = "none", z.searchingQueue = [],
|
|
12530
|
-
}, Qe = (z,
|
|
12531
|
-
const
|
|
12532
|
-
if (
|
|
12533
|
-
if (
|
|
12534
|
-
|
|
12535
|
-
else if (
|
|
12529
|
+
z.isPlaying = !1, z.source = "none", z.searchingQueue = [], Ae(!1), Ye();
|
|
12530
|
+
}, Qe = (z, ye, Ee) => {
|
|
12531
|
+
const xe = se.current;
|
|
12532
|
+
if (xe.isPlaying) {
|
|
12533
|
+
if (ye === "canned" || ye === "searching" && xe.source === "tts")
|
|
12534
|
+
Se();
|
|
12535
|
+
else if (xe.source === "canned") {
|
|
12536
12536
|
console.log("[BobWidget Audio] Skipping lower priority audio while canned is playing");
|
|
12537
12537
|
return;
|
|
12538
12538
|
}
|
|
12539
12539
|
}
|
|
12540
12540
|
const it = new Audio(z);
|
|
12541
|
-
|
|
12542
|
-
console.log(`[BobWidget Audio] ${
|
|
12541
|
+
xe.currentAudio = it, xe.source = ye, xe.isPlaying = !0, it.onplay = () => {
|
|
12542
|
+
console.log(`[BobWidget Audio] ${ye} STARTED:`, z.split("/").pop()), Ae(!0), e || q(r);
|
|
12543
12543
|
}, it.onended = () => {
|
|
12544
|
-
console.log(`[BobWidget Audio] ${
|
|
12544
|
+
console.log(`[BobWidget Audio] ${ye} ENDED`), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ae(!1), Ee == null || Ee();
|
|
12545
12545
|
}, it.onerror = () => {
|
|
12546
|
-
console.warn(`[BobWidget Audio] ${
|
|
12546
|
+
console.warn(`[BobWidget Audio] ${ye} FAILED:`, z), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ae(!1), Ee == null || Ee();
|
|
12547
12547
|
}, it.play().catch((Pt) => {
|
|
12548
|
-
console.warn(`[BobWidget Audio] ${
|
|
12548
|
+
console.warn(`[BobWidget Audio] ${ye} autoplay blocked:`, Pt), xe.currentAudio = null, xe.isPlaying = !1, xe.source = "none", Ee == null || Ee();
|
|
12549
12549
|
});
|
|
12550
12550
|
}, et = () => {
|
|
12551
12551
|
const z = se.current;
|
|
@@ -12557,20 +12557,20 @@ const Wn = (t) => {
|
|
|
12557
12557
|
!e && z.source === "searching" && q(s);
|
|
12558
12558
|
return;
|
|
12559
12559
|
}
|
|
12560
|
-
const
|
|
12561
|
-
Qe(
|
|
12560
|
+
const ye = z.searchingQueue.shift();
|
|
12561
|
+
Qe(ye, "searching", () => {
|
|
12562
12562
|
et();
|
|
12563
12563
|
});
|
|
12564
12564
|
}, De = () => {
|
|
12565
12565
|
$.current && (clearTimeout($.current), $.current = null);
|
|
12566
12566
|
}, { speak: st, stop: Ye, isSpeaking: nt, retryPendingGreeting: tt } = lu({
|
|
12567
12567
|
onStart: () => {
|
|
12568
|
-
De(),
|
|
12568
|
+
De(), ke.current = !0, console.log("[BobWidget STATE] Speech STARTED - transitioning to TALK state"), k.trackSpeechPlayed(re.current.length), h == null || h(), e || (console.log("[BobWidget STATE] Setting state to:", r), q(r));
|
|
12569
12569
|
},
|
|
12570
12570
|
onEnd: () => {
|
|
12571
12571
|
De(), console.log("[BobWidget STATE] Speech ENDED - transitioning out of TALK state");
|
|
12572
12572
|
const z = Li.some(
|
|
12573
|
-
(
|
|
12573
|
+
(ye) => re.current.toLowerCase().includes(ye.toLowerCase())
|
|
12574
12574
|
);
|
|
12575
12575
|
e || (z && u ? (console.log("[BobWidget STATE] Has products - calling onShowingProduct"), u()) : c ? (console.log("[BobWidget STATE] Calling onStreamComplete"), c()) : (console.log("[BobWidget STATE] Setting state to:", n), q(n), setTimeout(() => {
|
|
12576
12576
|
console.log("[BobWidget STATE] Post-complete transition to:", a), q(a);
|
|
@@ -12582,14 +12582,14 @@ const Wn = (t) => {
|
|
|
12582
12582
|
});
|
|
12583
12583
|
ce(() => {
|
|
12584
12584
|
var z;
|
|
12585
|
-
(z = S.onStopSpeechReady) == null || z.call(S,
|
|
12585
|
+
(z = S.onStopSpeechReady) == null || z.call(S, Se);
|
|
12586
12586
|
}, []), ce(() => {
|
|
12587
12587
|
var z;
|
|
12588
12588
|
(z = G.current) == null || z.scrollIntoView({ behavior: "smooth" });
|
|
12589
12589
|
}, [E]), ce(() => {
|
|
12590
|
-
var
|
|
12591
|
-
const z = (
|
|
12592
|
-
z && !K && (console.log("[BobWidget] Setting vehicle from host context:", z), U(z), (
|
|
12590
|
+
var ye, Ee;
|
|
12591
|
+
const z = (ye = v.vehicle) == null ? void 0 : ye.selectedVehicle;
|
|
12592
|
+
z && !K && (console.log("[BobWidget] Setting vehicle from host context:", z), U(z), (Ee = S.onVehicleIdentified) == null || Ee.call(S, z), k.trackVehicleIdentified({
|
|
12593
12593
|
make: z.make,
|
|
12594
12594
|
model: z.model,
|
|
12595
12595
|
year: z.year,
|
|
@@ -12599,10 +12599,10 @@ const Wn = (t) => {
|
|
|
12599
12599
|
var z;
|
|
12600
12600
|
if (E.length === 0 && !ee.current) {
|
|
12601
12601
|
ee.current = !0;
|
|
12602
|
-
const
|
|
12603
|
-
let
|
|
12604
|
-
N ? (
|
|
12605
|
-
console.log("[BobWidget] Speaking initial greeting (priority)"), st(
|
|
12602
|
+
const ye = (z = v.vehicle) == null ? void 0 : z.selectedVehicle;
|
|
12603
|
+
let Ee;
|
|
12604
|
+
N ? (Ee = "Ah hey... you again! What you after this time?", console.log("[BobWidget] Using returning user greeting")) : ye ? Ee = `G'day! Saw you've got the ${`${ye.year} ${ye.make} ${ye.model}`} - choice wagon! What can I help you find for it today?` : Ee = "G'day! Bob from CARFIX here. How can I help ya today?", T([{ role: "assistant", content: Ee }]), M || setTimeout(() => {
|
|
12605
|
+
console.log("[BobWidget] Speaking initial greeting (priority)"), st(Ee, !0);
|
|
12606
12606
|
}, 500);
|
|
12607
12607
|
}
|
|
12608
12608
|
}, [(ns = v.vehicle) == null ? void 0 : ns.selectedVehicle, E.length, M, st]), ce(() => {
|
|
@@ -12616,13 +12616,13 @@ const Wn = (t) => {
|
|
|
12616
12616
|
var Ut, ft;
|
|
12617
12617
|
const z = (Ut = v.vehicle) == null ? void 0 : Ut.selectedVehicle;
|
|
12618
12618
|
if (!z || he.current) return;
|
|
12619
|
-
const
|
|
12620
|
-
if (!Number.isFinite(
|
|
12619
|
+
const ye = z.vehicle_id ?? z.id, Ee = Number.parseInt(String(ye), 10);
|
|
12620
|
+
if (!Number.isFinite(Ee)) {
|
|
12621
12621
|
console.warn("[BobWidget] Vehicle has invalid vehicle_id, cannot auto-fetch:", z);
|
|
12622
12622
|
return;
|
|
12623
12623
|
}
|
|
12624
12624
|
he.current = !0;
|
|
12625
|
-
const
|
|
12625
|
+
const xe = { ...z, vehicle_id: String(Ee) }, it = (ft = v.user) == null ? void 0 : ft.email;
|
|
12626
12626
|
(async () => {
|
|
12627
12627
|
var It, Wt;
|
|
12628
12628
|
const Mt = `${_.supabaseUrl}/functions/v1/bob-chat`;
|
|
@@ -12635,7 +12635,7 @@ const Wn = (t) => {
|
|
|
12635
12635
|
},
|
|
12636
12636
|
body: JSON.stringify({
|
|
12637
12637
|
messages: [],
|
|
12638
|
-
vehicleContext:
|
|
12638
|
+
vehicleContext: xe,
|
|
12639
12639
|
customerEmail: it,
|
|
12640
12640
|
autoFetchParts: !0,
|
|
12641
12641
|
hostConfig: j,
|
|
@@ -12665,7 +12665,7 @@ const Wn = (t) => {
|
|
|
12665
12665
|
dr.title && b.current.add(dr.title);
|
|
12666
12666
|
})), Xe.type === "parts_found" && Xe.parts && (console.log("[useBobChat autoFetch] Received parts_found:", Xe.parts.length, "parts"), (Wt = S.onPartsFound) == null || Wt.call(S, Xe.parts), k.trackPartsViewed(
|
|
12667
12667
|
Array.isArray(Xe.parts) ? Xe.parts.length : 0,
|
|
12668
|
-
String(
|
|
12668
|
+
String(Ee)
|
|
12669
12669
|
));
|
|
12670
12670
|
} catch {
|
|
12671
12671
|
}
|
|
@@ -12685,19 +12685,19 @@ const Wn = (t) => {
|
|
|
12685
12685
|
}
|
|
12686
12686
|
}, L = async (z) => {
|
|
12687
12687
|
var it, Pt, Ut, ft, Mt, It, Wt, bt, cr, Cr, yt, ur, Pr, qt, lt, zt, Xe, dr;
|
|
12688
|
-
const
|
|
12689
|
-
let
|
|
12688
|
+
const ye = `${_.supabaseUrl}/functions/v1/bob-chat`, Ee = (it = v.user) == null ? void 0 : it.email;
|
|
12689
|
+
let xe = !1;
|
|
12690
12690
|
try {
|
|
12691
12691
|
const vt = {
|
|
12692
12692
|
messages: [...E, z],
|
|
12693
12693
|
hostConfig: j,
|
|
12694
12694
|
hostContext: v
|
|
12695
12695
|
};
|
|
12696
|
-
b != null && b.current && b.current.size > 0 && (vt.shelfContext = Array.from(b.current).join(", ")), K && (vt.vehicleContext = K),
|
|
12696
|
+
b != null && b.current && b.current.size > 0 && (vt.shelfContext = Array.from(b.current).join(", ")), K && (vt.vehicleContext = K), Ee && (vt.customerEmail = Ee), console.log(
|
|
12697
12697
|
"[useBobChat DEBUG] vehicleCandidatesRef.current:",
|
|
12698
12698
|
JSON.stringify((Pt = O.current) == null ? void 0 : Pt.slice(0, 2))
|
|
12699
12699
|
), console.log("[useBobChat DEBUG] vehicleCandidatesRef.current.length:", (Ut = O.current) == null ? void 0 : Ut.length), console.log("[useBobChat DEBUG] conversationStateRef.current:", ae.current), O.current && O.current.length > 0 ? (vt.vehicleCandidates = O.current, console.log("[useBobChat] ✅ Including", O.current.length, "vehicle candidates in request")) : console.log("[useBobChat] ⚠️ No vehicle candidates to include - ref is empty");
|
|
12700
|
-
const wt = await fetch(
|
|
12700
|
+
const wt = await fetch(ye, {
|
|
12701
12701
|
method: "POST",
|
|
12702
12702
|
headers: {
|
|
12703
12703
|
"Content-Type": "application/json",
|
|
@@ -12720,9 +12720,9 @@ const Wn = (t) => {
|
|
|
12720
12720
|
const y = wt.body.getReader(), F = new TextDecoder();
|
|
12721
12721
|
let D = "", oe = !1, fe = "";
|
|
12722
12722
|
for (; !oe; ) {
|
|
12723
|
-
const { done:
|
|
12724
|
-
if (
|
|
12725
|
-
D += F.decode(
|
|
12723
|
+
const { done: _e, value: Re } = await y.read();
|
|
12724
|
+
if (_e) break;
|
|
12725
|
+
D += F.decode(Re, { stream: !0 });
|
|
12726
12726
|
let Ue;
|
|
12727
12727
|
for (; (Ue = D.indexOf(`
|
|
12728
12728
|
`)) !== -1; ) {
|
|
@@ -12740,8 +12740,8 @@ const Wn = (t) => {
|
|
|
12740
12740
|
continue;
|
|
12741
12741
|
}
|
|
12742
12742
|
if (I.type === "variant_selection_required") {
|
|
12743
|
-
const
|
|
12744
|
-
console.log("[useBobChat] 🎴 variant_selection_required event received:",
|
|
12743
|
+
const ge = Array.isArray(I.candidates) ? I.candidates.length : 0;
|
|
12744
|
+
console.log("[useBobChat] 🎴 variant_selection_required event received:", ge, "cards"), Array.isArray(I.candidates) ? x == null || x(
|
|
12745
12745
|
I.candidates,
|
|
12746
12746
|
typeof I.make == "string" ? I.make : "",
|
|
12747
12747
|
typeof I.model == "string" ? I.model : ""
|
|
@@ -12762,15 +12762,15 @@ const Wn = (t) => {
|
|
|
12762
12762
|
continue;
|
|
12763
12763
|
}
|
|
12764
12764
|
if (I.type === "service_packages_found" && I.packages) {
|
|
12765
|
-
(Wt = S.onServicePackagesFound) == null || Wt.call(S, I.packages), b != null && b.current && (I.packages.forEach((
|
|
12766
|
-
|
|
12765
|
+
(Wt = S.onServicePackagesFound) == null || Wt.call(S, I.packages), b != null && b.current && (I.packages.forEach((ge) => {
|
|
12766
|
+
ge.title && b.current.add(ge.title);
|
|
12767
12767
|
}), console.log("[useBobChat] Eagerly added service package titles to shelfCategories:", Array.from(b.current)));
|
|
12768
12768
|
continue;
|
|
12769
12769
|
}
|
|
12770
12770
|
if (I.type === "parts_found" && I.parts) {
|
|
12771
|
-
console.log("[useBobChat] Received parts_found event:", I.parts.length, "parts"), (bt = S.onPartsFound) == null || bt.call(S, I.parts), b != null && b.current && Array.isArray(I.parts) && I.parts.forEach((
|
|
12772
|
-
const
|
|
12773
|
-
|
|
12771
|
+
console.log("[useBobChat] Received parts_found event:", I.parts.length, "parts"), (bt = S.onPartsFound) == null || bt.call(S, I.parts), b != null && b.current && Array.isArray(I.parts) && I.parts.forEach((ge) => {
|
|
12772
|
+
const Ce = ge.partslot_description || "Other Parts";
|
|
12773
|
+
Ce && b.current.add(Ce);
|
|
12774
12774
|
}), k.trackPartsViewed(
|
|
12775
12775
|
Array.isArray(I.parts) ? I.parts.length : 0,
|
|
12776
12776
|
(cr = K == null ? void 0 : K.vehicle_id) == null ? void 0 : cr.toString()
|
|
@@ -12778,16 +12778,16 @@ const Wn = (t) => {
|
|
|
12778
12778
|
continue;
|
|
12779
12779
|
}
|
|
12780
12780
|
if (I.type === "bob_suggestions" && I.products) {
|
|
12781
|
-
console.log("[useBobChat] Received bob_suggestions:", I.products.length, "products", I.title), T((
|
|
12781
|
+
console.log("[useBobChat] Received bob_suggestions:", I.products.length, "products", I.title), T((ge) => {
|
|
12782
12782
|
var Kt;
|
|
12783
|
-
const
|
|
12784
|
-
return console.log("[useBobChat] Attaching to message:", Fe == null ? void 0 : Fe.role, (Kt = Fe == null ? void 0 : Fe.content) == null ? void 0 : Kt.slice(0, 40)), (Fe == null ? void 0 : Fe.role) === "assistant" ?
|
|
12785
|
-
(hr, rn) => rn ===
|
|
12783
|
+
const Ce = [...ge], Fe = Ce[Ce.length - 1];
|
|
12784
|
+
return console.log("[useBobChat] Attaching to message:", Fe == null ? void 0 : Fe.role, (Kt = Fe == null ? void 0 : Fe.content) == null ? void 0 : Kt.slice(0, 40)), (Fe == null ? void 0 : Fe.role) === "assistant" ? Ce.map(
|
|
12785
|
+
(hr, rn) => rn === Ce.length - 1 ? {
|
|
12786
12786
|
...hr,
|
|
12787
12787
|
suggestedProducts: I.products,
|
|
12788
12788
|
suggestionsTitle: I.title
|
|
12789
12789
|
} : hr
|
|
12790
|
-
) :
|
|
12790
|
+
) : Ce;
|
|
12791
12791
|
}), console.log("[useBobChat] bob_suggestions processed for inline display only");
|
|
12792
12792
|
continue;
|
|
12793
12793
|
}
|
|
@@ -12796,7 +12796,7 @@ const Wn = (t) => {
|
|
|
12796
12796
|
continue;
|
|
12797
12797
|
}
|
|
12798
12798
|
if (I.type === "highlight_category" && I.category) {
|
|
12799
|
-
console.log("[useBobChat] highlight_category event:", I.category),
|
|
12799
|
+
console.log("[useBobChat] highlight_category event:", I.category), xe = !0, f == null || f(I.category);
|
|
12800
12800
|
continue;
|
|
12801
12801
|
}
|
|
12802
12802
|
if (I.type === "navigate_url" && I.url) {
|
|
@@ -12804,44 +12804,54 @@ const Wn = (t) => {
|
|
|
12804
12804
|
continue;
|
|
12805
12805
|
}
|
|
12806
12806
|
if (I.type === "quick_replies" && Array.isArray(I.replies)) {
|
|
12807
|
-
console.log("[useBobChat] quick_replies event:", I.replies.length, "buttons"), T((
|
|
12807
|
+
console.log("[useBobChat] quick_replies event:", I.replies.length, "buttons"), T((ge) => {
|
|
12808
12808
|
var Kt;
|
|
12809
|
-
const
|
|
12810
|
-
return ((Kt =
|
|
12809
|
+
const Ce = [...ge], Fe = Ce.length - 1;
|
|
12810
|
+
return ((Kt = Ce[Fe]) == null ? void 0 : Kt.role) === "assistant" ? Ce.map(
|
|
12811
12811
|
(hr, rn) => rn === Fe ? { ...hr, quickReplies: I.replies } : hr
|
|
12812
|
-
) :
|
|
12812
|
+
) : Ce;
|
|
12813
12813
|
});
|
|
12814
12814
|
continue;
|
|
12815
12815
|
}
|
|
12816
12816
|
if (I.type === "audio_hint" && I.audio_url) {
|
|
12817
12817
|
console.log("[useBobChat] Audio hint received:", I.clip_key, I.audio_url);
|
|
12818
|
-
const
|
|
12819
|
-
|
|
12818
|
+
const ge = se.current;
|
|
12819
|
+
ge.hasCannedAudio = !0, ge.cannedUrl = I.audio_url, Se();
|
|
12820
12820
|
continue;
|
|
12821
12821
|
}
|
|
12822
12822
|
if (I.type === "bob_searching" && I.audio_url) {
|
|
12823
|
-
console.log("[useBobChat] Bob searching:", I.search_type, I.clip_key), I.transcript && T((
|
|
12824
|
-
const Fe =
|
|
12825
|
-
return (Fe == null ? void 0 : Fe.role) !== "assistant" || (Fe == null ? void 0 : Fe.content) !== I.transcript ? [...
|
|
12823
|
+
console.log("[useBobChat] Bob searching:", I.search_type, I.clip_key), I.transcript && T((Ce) => {
|
|
12824
|
+
const Fe = Ce[Ce.length - 1];
|
|
12825
|
+
return (Fe == null ? void 0 : Fe.role) !== "assistant" || (Fe == null ? void 0 : Fe.content) !== I.transcript ? [...Ce, { role: "assistant", content: I.transcript }] : Ce;
|
|
12826
12826
|
});
|
|
12827
|
-
const
|
|
12828
|
-
|
|
12827
|
+
const ge = se.current;
|
|
12828
|
+
ge.searchingQueue.push(I.audio_url), !ge.isPlaying && !ge.hasCannedAudio && !M && et();
|
|
12829
12829
|
continue;
|
|
12830
12830
|
}
|
|
12831
12831
|
if (I.type === "cart_updated" && I.items) {
|
|
12832
|
-
(Pr = S.onCartUpdated) == null || Pr.call(S, I.items)
|
|
12832
|
+
if ((Pr = S.onCartUpdated) == null || Pr.call(S, I.items), S.onAddToCart)
|
|
12833
|
+
for (const ge of I.items)
|
|
12834
|
+
S.onAddToCart({
|
|
12835
|
+
product_id: ge.product_id || ge.productName || "",
|
|
12836
|
+
product_name: ge.product_name || ge.productName || "",
|
|
12837
|
+
quantity: ge.quantity || 1,
|
|
12838
|
+
unit_price: ge.unit_price || 0,
|
|
12839
|
+
vehicle_id: ge.vehicle_id,
|
|
12840
|
+
sku: ge.sku,
|
|
12841
|
+
brand: ge.brand
|
|
12842
|
+
});
|
|
12833
12843
|
continue;
|
|
12834
12844
|
}
|
|
12835
12845
|
const Ht = (zt = (lt = (qt = I.choices) == null ? void 0 : qt[0]) == null ? void 0 : lt.delta) == null ? void 0 : zt.content;
|
|
12836
12846
|
if (Ht) {
|
|
12837
12847
|
fe += Ht;
|
|
12838
|
-
let
|
|
12839
|
-
|
|
12840
|
-
const Fe =
|
|
12841
|
-
return (Fe == null ? void 0 : Fe.role) === "assistant" ?
|
|
12842
|
-
(Kt, hr) => hr ===
|
|
12843
|
-
) : [...
|
|
12844
|
-
}), (Xe = S.onBobMessage) == null || Xe.call(S,
|
|
12848
|
+
let ge = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
|
|
12849
|
+
ge = Wn(ge), T((Ce) => {
|
|
12850
|
+
const Fe = Ce[Ce.length - 1];
|
|
12851
|
+
return (Fe == null ? void 0 : Fe.role) === "assistant" ? Ce.map(
|
|
12852
|
+
(Kt, hr) => hr === Ce.length - 1 ? { ...Kt, content: ge } : Kt
|
|
12853
|
+
) : [...Ce, { role: "assistant", content: ge }];
|
|
12854
|
+
}), (Xe = S.onBobMessage) == null || Xe.call(S, ge);
|
|
12845
12855
|
}
|
|
12846
12856
|
} catch {
|
|
12847
12857
|
D = ze + `
|
|
@@ -12850,39 +12860,39 @@ const Wn = (t) => {
|
|
|
12850
12860
|
}
|
|
12851
12861
|
}
|
|
12852
12862
|
}
|
|
12853
|
-
let
|
|
12854
|
-
|
|
12863
|
+
let ve = fe.replace(/\[VEHICLE_CONFIRMED:\{[\s\S]*?\}\]/g, "");
|
|
12864
|
+
ve = Wn(ve), re.current = ve;
|
|
12855
12865
|
const de = Li.some(
|
|
12856
|
-
(
|
|
12866
|
+
(_e) => fe.toLowerCase().includes(_e.toLowerCase())
|
|
12857
12867
|
);
|
|
12858
|
-
if (console.log("[useBobChat] v3.2.10 scroll debug: highlightCategoryReceived=",
|
|
12859
|
-
const
|
|
12860
|
-
let
|
|
12868
|
+
if (console.log("[useBobChat] v3.2.10 scroll debug: highlightCategoryReceived=", xe, "shelfCategories=", b != null && b.current ? Array.from(b.current) : "none"), !xe && (b != null && b.current) && b.current.size > 0) {
|
|
12869
|
+
const _e = ve.toLowerCase();
|
|
12870
|
+
let Re = null, Ue = 0;
|
|
12861
12871
|
for (const ze of b.current) {
|
|
12862
|
-
const ct = ze.toLowerCase().split(/\s+/).filter(Boolean), I = ct.filter((Ht) =>
|
|
12863
|
-
I === ct.length && I > Ue && (Ue = I,
|
|
12872
|
+
const ct = ze.toLowerCase().split(/\s+/).filter(Boolean), I = ct.filter((Ht) => _e.includes(Ht)).length;
|
|
12873
|
+
I === ct.length && I > Ue && (Ue = I, Re = ze);
|
|
12864
12874
|
}
|
|
12865
|
-
|
|
12875
|
+
Re && (console.log("[useBobChat] v3.2.10 shelf category match:", Re, `(${Ue} words)`), f == null || f(Re));
|
|
12866
12876
|
}
|
|
12867
12877
|
const ue = fe.match(/(?:go with|recommend|suggest|grab|try)\s+(?:the\s+)?(\w+)\s+(?:at|for)\s+\$(\d+(?:\.\d{2})?)/i);
|
|
12868
12878
|
if (ue) {
|
|
12869
|
-
const [,
|
|
12870
|
-
p == null || p({ brand:
|
|
12879
|
+
const [, _e, Re] = ue;
|
|
12880
|
+
p == null || p({ brand: _e, price: parseFloat(Re) });
|
|
12871
12881
|
}
|
|
12872
12882
|
const Ie = se.current;
|
|
12873
12883
|
if (!M && re.current.trim()) {
|
|
12874
|
-
if (
|
|
12875
|
-
console.log("[BobWidget] Playing canned audio (priority):", Ie.cannedUrl),
|
|
12884
|
+
if (ke.current = !1, De(), Ie.hasCannedAudio && Ie.cannedUrl)
|
|
12885
|
+
console.log("[BobWidget] Playing canned audio (priority):", Ie.cannedUrl), Se(), Qe(Ie.cannedUrl, "canned", () => {
|
|
12876
12886
|
Ie.hasCannedAudio = !1, Ie.cannedUrl = null, De(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3)));
|
|
12877
|
-
}),
|
|
12887
|
+
}), ke.current = !0, h == null || h();
|
|
12878
12888
|
else if (Ie.isPlaying)
|
|
12879
12889
|
console.log("[BobWidget] Skipping TTS - audio already playing:", Ie.source);
|
|
12880
12890
|
else {
|
|
12881
|
-
const
|
|
12882
|
-
console.log("[BobWidget] Playing TTS (no canned audio)"), st(
|
|
12891
|
+
const _e = du(re.current);
|
|
12892
|
+
console.log("[BobWidget] Playing TTS (no canned audio)"), st(_e);
|
|
12883
12893
|
}
|
|
12884
12894
|
$.current = setTimeout(() => {
|
|
12885
|
-
|
|
12895
|
+
ke.current || (console.warn("[BobWidget] Speech fallback after 5s"), h == null || h(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3))));
|
|
12886
12896
|
}, 5e3);
|
|
12887
12897
|
} else
|
|
12888
12898
|
h == null || h(), e || (de && u ? u() : c ? c() : (q(n), setTimeout(() => q(a), 3e3)));
|
|
@@ -12894,15 +12904,15 @@ const Wn = (t) => {
|
|
|
12894
12904
|
wt.message || "Unknown chat error"
|
|
12895
12905
|
), e || q(i);
|
|
12896
12906
|
}
|
|
12897
|
-
},
|
|
12907
|
+
}, je = async () => {
|
|
12898
12908
|
if (!C.trim() || B) return;
|
|
12899
12909
|
tt(), Ye();
|
|
12900
12910
|
const z = { role: "user", content: C };
|
|
12901
|
-
T((
|
|
12902
|
-
const
|
|
12903
|
-
if (hu.some((
|
|
12904
|
-
const
|
|
12905
|
-
T((it) => [...it, { role: "assistant", content:
|
|
12911
|
+
T((xe) => [...xe, z]), A(""), k.trackMessageSent(C.length, !!K);
|
|
12912
|
+
const ye = C.toLowerCase();
|
|
12913
|
+
if (hu.some((xe) => ye.includes(xe))) {
|
|
12914
|
+
const xe = `G'day mate! I'm running Bob v${ar} - she's running sweet as! Anything else I can help ya with?`;
|
|
12915
|
+
T((it) => [...it, { role: "assistant", content: xe }]), M || st(xe);
|
|
12906
12916
|
return;
|
|
12907
12917
|
}
|
|
12908
12918
|
W(!0), console.log("[BobWidget STATE] User sent message - switching to RESEARCH state:", s), d == null || d(), e || q(s), await L(z), W(!1);
|
|
@@ -12912,9 +12922,9 @@ const Wn = (t) => {
|
|
|
12912
12922
|
input: C,
|
|
12913
12923
|
setInput: A,
|
|
12914
12924
|
isLoading: B,
|
|
12915
|
-
handleSend:
|
|
12925
|
+
handleSend: je,
|
|
12916
12926
|
handleKeyPress: (z) => {
|
|
12917
|
-
z.key === "Enter" && !z.shiftKey && (z.preventDefault(),
|
|
12927
|
+
z.key === "Enter" && !z.shiftKey && (z.preventDefault(), je());
|
|
12918
12928
|
},
|
|
12919
12929
|
handleInputFocus: () => {
|
|
12920
12930
|
tt();
|
|
@@ -12933,7 +12943,7 @@ const Wn = (t) => {
|
|
|
12933
12943
|
le((z) => !z), M || Ye();
|
|
12934
12944
|
},
|
|
12935
12945
|
// Bug #3 fix: composite isSpeaking — true when EITHER TTS or canned/searching audio is playing
|
|
12936
|
-
isSpeaking: nt ||
|
|
12946
|
+
isSpeaking: nt || Oe,
|
|
12937
12947
|
identifiedVehicle: K,
|
|
12938
12948
|
clearVehicle: () => {
|
|
12939
12949
|
U(null);
|
|
@@ -12941,10 +12951,10 @@ const Wn = (t) => {
|
|
|
12941
12951
|
sendDirectMessage: (z) => {
|
|
12942
12952
|
if (!z.trim()) return;
|
|
12943
12953
|
console.log("[BobWidget] sendDirectMessage:", z), Ye(), W(!1), A("");
|
|
12944
|
-
const
|
|
12945
|
-
T((
|
|
12954
|
+
const ye = { role: "user", content: z };
|
|
12955
|
+
T((Ee) => [...Ee, ye]), d == null || d(), e || q(s), W(!0), L(ye).finally(() => W(!1));
|
|
12946
12956
|
},
|
|
12947
|
-
stopAllAudio:
|
|
12957
|
+
stopAllAudio: Se
|
|
12948
12958
|
};
|
|
12949
12959
|
}, pu = {
|
|
12950
12960
|
states: [],
|
|
@@ -13037,7 +13047,7 @@ const Wn = (t) => {
|
|
|
13037
13047
|
return le.forEach((K) => {
|
|
13038
13048
|
const U = b.configs.filter((re) => re.animation_state === K), G = U.map((re) => re.image_url), he = U.map((re) => re.vertical_offset || 0), ee = U.map((re) => re.scale || 100);
|
|
13039
13049
|
if (G.length > 0) {
|
|
13040
|
-
const re = b.states.find((
|
|
13050
|
+
const re = b.states.find((ke) => ke.state_key === K);
|
|
13041
13051
|
A[K] = {
|
|
13042
13052
|
url: G[0],
|
|
13043
13053
|
animation_speed: (re == null ? void 0 : re.animation_speed) || 400,
|
|
@@ -14309,7 +14319,7 @@ const fn = (t, e) => {
|
|
|
14309
14319
|
const ae = se.scrollTop / O;
|
|
14310
14320
|
W(Math.max(0, Math.min(1, ae)));
|
|
14311
14321
|
}
|
|
14312
|
-
}, le = ((g == null ? void 0 : g.length) ?? 0) > 0, K = t.length > 0 || e.length > 0 || le, U = c && !K, G = K && !U, he = u || K, ee = j === "mobile" ? 92 : j === "tablet" ? 65 : 70, re = j === "desktop" ? "900px" : j === "tablet" ? "500px" : "100%",
|
|
14322
|
+
}, le = ((g == null ? void 0 : g.length) ?? 0) > 0, K = t.length > 0 || e.length > 0 || le, U = c && !K, G = K && !U, he = u || K, ee = j === "mobile" ? 92 : j === "tablet" ? 65 : 70, re = j === "desktop" ? "900px" : j === "tablet" ? "500px" : "100%", ke = j === "mobile" ? "calc(8px + env(safe-area-inset-top, 4px))" : "6px";
|
|
14313
14323
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
14314
14324
|
K && u && /* @__PURE__ */ o.jsx(
|
|
14315
14325
|
"div",
|
|
@@ -14338,7 +14348,7 @@ const fn = (t, e) => {
|
|
|
14338
14348
|
maxWidth: re,
|
|
14339
14349
|
right: "0",
|
|
14340
14350
|
left: "auto",
|
|
14341
|
-
top:
|
|
14351
|
+
top: ke,
|
|
14342
14352
|
bottom: j === "mobile" ? "calc(100px + env(safe-area-inset-bottom, 0px))" : "52px",
|
|
14343
14353
|
paddingTop: "4px",
|
|
14344
14354
|
paddingRight: "16px",
|
|
@@ -14425,7 +14435,7 @@ const fn = (t, e) => {
|
|
|
14425
14435
|
O.fuelType
|
|
14426
14436
|
].filter(Boolean).join(" · ") || O.displayTitle), se = $.reduce((O, ae) => (O[ae] = (O[ae] || 0) + 1, O), {});
|
|
14427
14437
|
return (g || []).map((O, ae) => {
|
|
14428
|
-
const
|
|
14438
|
+
const Oe = $[ae], Se = se[Oe] > 1 && O.displaySubtitle ? O.displaySubtitle : Oe;
|
|
14429
14439
|
return /* @__PURE__ */ o.jsx(
|
|
14430
14440
|
"button",
|
|
14431
14441
|
{
|
|
@@ -14449,7 +14459,7 @@ const fn = (t, e) => {
|
|
|
14449
14459
|
children: O.optionNumber
|
|
14450
14460
|
}
|
|
14451
14461
|
),
|
|
14452
|
-
/* @__PURE__ */ o.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ o.jsx("p", { className: "font-semibold text-gray-900 text-base leading-tight", children:
|
|
14462
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ o.jsx("p", { className: "font-semibold text-gray-900 text-base leading-tight", children: Se }) }),
|
|
14453
14463
|
/* @__PURE__ */ o.jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center shrink-0", style: { background: "rgba(0, 102, 204, 0.1)" }, children: /* @__PURE__ */ o.jsx("svg", { className: "w-4 h-4 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ o.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M9 5l7 7-7 7" }) }) })
|
|
14454
14464
|
] })
|
|
14455
14465
|
},
|
|
@@ -14472,13 +14482,13 @@ const fn = (t, e) => {
|
|
|
14472
14482
|
] }) }),
|
|
14473
14483
|
G && e.length > 0 && /* @__PURE__ */ o.jsx("div", { className: "space-y-4", children: e.map(($) => {
|
|
14474
14484
|
var tt, q;
|
|
14475
|
-
const se = Na($), O = ($.preparedTiers || []).filter((L) => !L.isHidden), { hasDisc: ae, hasDrum:
|
|
14476
|
-
let
|
|
14477
|
-
se && (
|
|
14478
|
-
const
|
|
14479
|
-
return { ...L, products:
|
|
14485
|
+
const se = Na($), O = ($.preparedTiers || []).filter((L) => !L.isHidden), { hasDisc: ae, hasDrum: Oe } = se ? $a(O) : { hasDisc: !1, hasDrum: !1 }, Ae = se && ae && !Oe ? "disc" : se && Oe && !ae ? "drum" : T[$.id] || "disc";
|
|
14486
|
+
let Se = O;
|
|
14487
|
+
se && (Se = O.map((L) => {
|
|
14488
|
+
const je = Fa(L.products, Ae);
|
|
14489
|
+
return { ...L, products: je, totalPrice: Ba(je), productCount: je.length };
|
|
14480
14490
|
}));
|
|
14481
|
-
const Qe = ((tt =
|
|
14491
|
+
const Qe = ((tt = Se.find((L) => L.isRecommended)) == null ? void 0 : tt.tierName) || ((q = Se[0]) == null ? void 0 : q.tierName) || "", et = N[$.id] || Qe, De = Se.find((L) => L.tierName === et), Ye = Aa($.title).split(".")[0] + ".", nt = P === $.id;
|
|
14482
14492
|
return /* @__PURE__ */ o.jsxs(
|
|
14483
14493
|
"div",
|
|
14484
14494
|
{
|
|
@@ -14514,7 +14524,7 @@ const fn = (t, e) => {
|
|
|
14514
14524
|
),
|
|
14515
14525
|
/* @__PURE__ */ o.jsxs("div", { className: "px-4 py-3 border-b", style: { borderColor: J.border }, children: [
|
|
14516
14526
|
/* @__PURE__ */ o.jsx("p", { className: "text-sm leading-relaxed", style: { color: J.mutedForeground }, children: Ye }),
|
|
14517
|
-
se && ae &&
|
|
14527
|
+
se && ae && Oe && /* @__PURE__ */ o.jsxs("div", { className: "mt-2 mb-1", children: [
|
|
14518
14528
|
/* @__PURE__ */ o.jsx("p", { className: "text-[11px] mb-1.5", style: { color: J.mutedForeground }, children: "Select your vehicle's rear brake type" }),
|
|
14519
14529
|
/* @__PURE__ */ o.jsxs("div", { className: "flex rounded-xl overflow-hidden border", style: { borderColor: J.border }, children: [
|
|
14520
14530
|
/* @__PURE__ */ o.jsx(
|
|
@@ -14523,8 +14533,8 @@ const fn = (t, e) => {
|
|
|
14523
14533
|
onClick: () => C((L) => ({ ...L, [$.id]: "disc" })),
|
|
14524
14534
|
className: "flex-1 py-2 px-3 text-xs font-semibold transition-all",
|
|
14525
14535
|
style: {
|
|
14526
|
-
background:
|
|
14527
|
-
color:
|
|
14536
|
+
background: Ae === "disc" ? J.primary : "transparent",
|
|
14537
|
+
color: Ae === "disc" ? "#FFFFFF" : J.mutedForeground
|
|
14528
14538
|
},
|
|
14529
14539
|
children: "Disc Brakes (Pads + Rotors)"
|
|
14530
14540
|
}
|
|
@@ -14535,8 +14545,8 @@ const fn = (t, e) => {
|
|
|
14535
14545
|
onClick: () => C((L) => ({ ...L, [$.id]: "drum" })),
|
|
14536
14546
|
className: "flex-1 py-2 px-3 text-xs font-semibold transition-all",
|
|
14537
14547
|
style: {
|
|
14538
|
-
background:
|
|
14539
|
-
color:
|
|
14548
|
+
background: Ae === "drum" ? J.primary : "transparent",
|
|
14549
|
+
color: Ae === "drum" ? "#FFFFFF" : J.mutedForeground
|
|
14540
14550
|
},
|
|
14541
14551
|
children: "Drum Brakes (Shoes + Drums)"
|
|
14542
14552
|
}
|
|
@@ -14544,17 +14554,17 @@ const fn = (t, e) => {
|
|
|
14544
14554
|
] })
|
|
14545
14555
|
] })
|
|
14546
14556
|
] }),
|
|
14547
|
-
|
|
14557
|
+
Se.length > 0 && /* @__PURE__ */ o.jsxs("div", { className: "p-3", children: [
|
|
14548
14558
|
/* @__PURE__ */ o.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide mb-2 px-1", style: { color: J.mutedForeground }, children: "Choose Your Value Level" }),
|
|
14549
|
-
/* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(
|
|
14550
|
-
const
|
|
14559
|
+
/* @__PURE__ */ o.jsx("div", { className: "grid gap-2", style: { gridTemplateColumns: `repeat(${Math.min(Se.length, 4)}, 1fr)` }, children: Se.map((L) => {
|
|
14560
|
+
const je = qn[L.tierName], Z = L.tierName === et;
|
|
14551
14561
|
return /* @__PURE__ */ o.jsxs(
|
|
14552
14562
|
"div",
|
|
14553
14563
|
{
|
|
14554
14564
|
onClick: () => E((pe) => ({ ...pe, [$.id]: L.tierName })),
|
|
14555
14565
|
className: "relative rounded-xl text-center transition-all cursor-pointer",
|
|
14556
14566
|
style: {
|
|
14557
|
-
padding:
|
|
14567
|
+
padding: Se.length >= 4 ? "6px 4px" : "8px",
|
|
14558
14568
|
background: L.isRecommended ? `${J.primary}10` : Z ? `${J.primary}05` : J.background,
|
|
14559
14569
|
border: `2px solid ${L.isRecommended ? J.primary : Z ? J.primary + "80" : J.border}`
|
|
14560
14570
|
},
|
|
@@ -14567,20 +14577,20 @@ const fn = (t, e) => {
|
|
|
14567
14577
|
children: "Carfix Value"
|
|
14568
14578
|
}
|
|
14569
14579
|
),
|
|
14570
|
-
/* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (
|
|
14571
|
-
|
|
14580
|
+
/* @__PURE__ */ o.jsxs("p", { className: "text-sm font-bold mt-1", style: { color: (je == null ? void 0 : je.textColor) || J.foreground }, children: [
|
|
14581
|
+
je == null ? void 0 : je.emoji,
|
|
14572
14582
|
" ",
|
|
14573
14583
|
L.displayName
|
|
14574
14584
|
] }),
|
|
14575
|
-
/* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight:
|
|
14585
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex flex-col items-center gap-1 mt-2", style: { minHeight: Se.length >= 4 ? "40px" : "48px" }, children: L.brands.slice(0, 1).map((pe, we) => {
|
|
14576
14586
|
const We = `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${pe.fullName.replace(/\s+/g, "")}.jpg`;
|
|
14577
14587
|
return /* @__PURE__ */ o.jsx(
|
|
14578
14588
|
"div",
|
|
14579
14589
|
{
|
|
14580
14590
|
className: "w-full bg-white rounded-lg flex items-center justify-center overflow-hidden",
|
|
14581
14591
|
style: {
|
|
14582
|
-
height:
|
|
14583
|
-
maxWidth:
|
|
14592
|
+
height: Se.length >= 4 ? "36px" : "44px",
|
|
14593
|
+
maxWidth: Se.length >= 4 ? "64px" : "80px",
|
|
14584
14594
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
14585
14595
|
border: "1px solid #F1F5F9"
|
|
14586
14596
|
},
|
|
@@ -14590,7 +14600,7 @@ const fn = (t, e) => {
|
|
|
14590
14600
|
src: pe.imageUrl,
|
|
14591
14601
|
alt: pe.fullName,
|
|
14592
14602
|
className: "w-auto object-contain",
|
|
14593
|
-
style: { height:
|
|
14603
|
+
style: { height: Se.length >= 4 ? "26px" : "32px" },
|
|
14594
14604
|
onError: (Be) => {
|
|
14595
14605
|
const Ne = Be.target;
|
|
14596
14606
|
Ne.src !== We ? Ne.src = We : (Ne.style.display = "none", Ne.parentElement.innerHTML = `<span class="text-[10px] font-semibold text-gray-600 truncate px-1">${pe.fullName}</span>`);
|
|
@@ -14598,7 +14608,7 @@ const fn = (t, e) => {
|
|
|
14598
14608
|
}
|
|
14599
14609
|
)
|
|
14600
14610
|
},
|
|
14601
|
-
|
|
14611
|
+
we
|
|
14602
14612
|
);
|
|
14603
14613
|
}) }),
|
|
14604
14614
|
/* @__PURE__ */ o.jsxs("p", { className: "text-[10px] mt-2", style: { color: J.mutedForeground }, children: [
|
|
@@ -14623,11 +14633,11 @@ const fn = (t, e) => {
|
|
|
14623
14633
|
{
|
|
14624
14634
|
onClick: (pe) => {
|
|
14625
14635
|
pe.stopPropagation();
|
|
14626
|
-
const
|
|
14636
|
+
const we = L.bundleDiscountPercentage || 0, We = 1 - we / 100, Be = L.products.map((Ne) => ({
|
|
14627
14637
|
id: Ne.sku,
|
|
14628
14638
|
name: Ne.name,
|
|
14629
14639
|
brand: Ne.brand,
|
|
14630
|
-
price:
|
|
14640
|
+
price: we > 0 ? Math.round(Ne.displayPrice * We * 100) / 100 : Ne.displayPrice,
|
|
14631
14641
|
sku: Ne.sku,
|
|
14632
14642
|
partNumber: Ne.partNumber || void 0,
|
|
14633
14643
|
image_url: Ne.productImageUrl,
|
|
@@ -14635,7 +14645,7 @@ const fn = (t, e) => {
|
|
|
14635
14645
|
quantity: 1,
|
|
14636
14646
|
_bundleMeta: {
|
|
14637
14647
|
is_bundle_item: !0,
|
|
14638
|
-
bundle_discount_percentage:
|
|
14648
|
+
bundle_discount_percentage: we,
|
|
14639
14649
|
service_package_name: $.title,
|
|
14640
14650
|
service_package_id: $.id,
|
|
14641
14651
|
quality_tier: L.tierName
|
|
@@ -14799,19 +14809,19 @@ const fn = (t, e) => {
|
|
|
14799
14809
|
]
|
|
14800
14810
|
}
|
|
14801
14811
|
),
|
|
14802
|
-
/* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: se.map((ae,
|
|
14803
|
-
const
|
|
14812
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex flex-col gap-3", children: se.map((ae, Oe) => {
|
|
14813
|
+
const Ae = !!(s && Iu(ae, s));
|
|
14804
14814
|
return /* @__PURE__ */ o.jsx("div", { "data-testid": "partslot-product", children: /* @__PURE__ */ o.jsx(
|
|
14805
14815
|
Nu,
|
|
14806
14816
|
{
|
|
14807
14817
|
product: ae,
|
|
14808
|
-
isSpotlighted:
|
|
14818
|
+
isSpotlighted: Ae,
|
|
14809
14819
|
spotlightedRef: R,
|
|
14810
14820
|
onProductClick: a,
|
|
14811
14821
|
onAddToCart: f,
|
|
14812
14822
|
viewportSize: j
|
|
14813
14823
|
}
|
|
14814
|
-
) }, `${ae.id}-${
|
|
14824
|
+
) }, `${ae.id}-${Oe}`);
|
|
14815
14825
|
}) })
|
|
14816
14826
|
]
|
|
14817
14827
|
},
|
|
@@ -14917,7 +14927,7 @@ const fn = (t, e) => {
|
|
|
14917
14927
|
onInterrupt: m,
|
|
14918
14928
|
counterHeightPercent: x = 22
|
|
14919
14929
|
}) => {
|
|
14920
|
-
var
|
|
14930
|
+
var ke;
|
|
14921
14931
|
const [b, _] = V(!1), j = X(null), v = X(!1), { bottomOffset: S, zIndexBase: R } = Ra(), {
|
|
14922
14932
|
isListening: P,
|
|
14923
14933
|
interimTranscript: k,
|
|
@@ -14943,7 +14953,7 @@ const fn = (t, e) => {
|
|
|
14943
14953
|
v.current && (v.current = !1, navigator.vibrate && navigator.vibrate([20, 50, 20]), C(), setTimeout(() => {
|
|
14944
14954
|
n();
|
|
14945
14955
|
}, 150));
|
|
14946
|
-
}, [C, n]), M = [...t].reverse().find(($) => $.role === "assistant"), le = ((
|
|
14956
|
+
}, [C, n]), M = [...t].reverse().find(($) => $.role === "assistant"), le = ((ke = M == null ? void 0 : M.suggestedProducts) == null ? void 0 : ke.length) || 0, K = M != null && M.content ? M.content.length > 50 ? M.content.slice(0, 50) + "..." : M.content : "Ask Bob about car parts...", U = le > 0 ? ` (${le} products)` : "", G = {
|
|
14947
14957
|
idle: {
|
|
14948
14958
|
background: "linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.95) 100%)",
|
|
14949
14959
|
backdropFilter: "blur(16px) saturate(180%)",
|
|
@@ -15077,11 +15087,11 @@ const fn = (t, e) => {
|
|
|
15077
15087
|
onProductClick: p
|
|
15078
15088
|
}
|
|
15079
15089
|
),
|
|
15080
|
-
$.role === "assistant" && $.quickReplies && $.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: $.quickReplies.map((ae,
|
|
15090
|
+
$.role === "assistant" && $.quickReplies && $.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: $.quickReplies.map((ae, Oe) => /* @__PURE__ */ o.jsx(
|
|
15081
15091
|
"button",
|
|
15082
15092
|
{
|
|
15083
|
-
onClick: (
|
|
15084
|
-
|
|
15093
|
+
onClick: (Ae) => {
|
|
15094
|
+
Ae.stopPropagation(), m == null || m(), g == null || g(ae.url);
|
|
15085
15095
|
},
|
|
15086
15096
|
style: {
|
|
15087
15097
|
padding: "6px 14px",
|
|
@@ -15099,7 +15109,7 @@ const fn = (t, e) => {
|
|
|
15099
15109
|
},
|
|
15100
15110
|
children: ae.label
|
|
15101
15111
|
},
|
|
15102
|
-
|
|
15112
|
+
Oe
|
|
15103
15113
|
)) })
|
|
15104
15114
|
] }) }, se);
|
|
15105
15115
|
}),
|
|
@@ -15358,7 +15368,7 @@ const fn = (t, e) => {
|
|
|
15358
15368
|
backdropUrl: (r == null ? void 0 : r.substring(0, 50)) || "NONE",
|
|
15359
15369
|
counterOverlayUrl: (s == null ? void 0 : s.substring(0, 50)) || "NONE"
|
|
15360
15370
|
});
|
|
15361
|
-
const ee = tn(), [re,
|
|
15371
|
+
const ee = tn(), [re, ke] = V("center"), [$, se] = V("hidden"), O = b.length > 0 || _.length > 0, ae = ((W == null ? void 0 : W.length) ?? 0) > 0, Oe = O || ae, Qe = (() => {
|
|
15362
15372
|
switch (ee) {
|
|
15363
15373
|
case "desktop":
|
|
15364
15374
|
return 70;
|
|
@@ -15372,18 +15382,18 @@ const fn = (t, e) => {
|
|
|
15372
15382
|
})() * G / 100;
|
|
15373
15383
|
ce(() => {
|
|
15374
15384
|
if (N && $ !== "loading" && $ !== "visible")
|
|
15375
|
-
se("loading"), re === "center" &&
|
|
15376
|
-
else if (
|
|
15385
|
+
se("loading"), re === "center" && ke("partial-left");
|
|
15386
|
+
else if (Oe && $ !== "visible")
|
|
15377
15387
|
if (re === "center") {
|
|
15378
|
-
|
|
15388
|
+
ke("partial-left"), se("transitioning");
|
|
15379
15389
|
const De = setTimeout(() => {
|
|
15380
15390
|
se("visible");
|
|
15381
15391
|
}, 400);
|
|
15382
15392
|
return () => clearTimeout(De);
|
|
15383
15393
|
} else
|
|
15384
15394
|
se("visible");
|
|
15385
|
-
else !
|
|
15386
|
-
}, [
|
|
15395
|
+
else !Oe && !N && $ !== "hidden" && (se("hidden"), ke("center"));
|
|
15396
|
+
}, [Oe, N, $, re]);
|
|
15387
15397
|
const et = $ !== "hidden";
|
|
15388
15398
|
return /* @__PURE__ */ o.jsxs(
|
|
15389
15399
|
"div",
|
|
@@ -15659,8 +15669,8 @@ const fn = (t, e) => {
|
|
|
15659
15669
|
G.role === "assistant" && G.quickReplies && G.quickReplies.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px", marginTop: "8px" }, children: G.quickReplies.map((ee, re) => /* @__PURE__ */ o.jsx(
|
|
15660
15670
|
"button",
|
|
15661
15671
|
{
|
|
15662
|
-
onClick: (
|
|
15663
|
-
|
|
15672
|
+
onClick: (ke) => {
|
|
15673
|
+
ke.stopPropagation(), p == null || p(), f == null || f(ee.url);
|
|
15664
15674
|
},
|
|
15665
15675
|
style: {
|
|
15666
15676
|
padding: "6px 14px",
|
|
@@ -16401,11 +16411,11 @@ const fn = (t, e) => {
|
|
|
16401
16411
|
bobOffset: G = 0,
|
|
16402
16412
|
bobScale: he = 100
|
|
16403
16413
|
}) => {
|
|
16404
|
-
const [ee, re] = V("center"), [
|
|
16414
|
+
const [ee, re] = V("center"), [ke, $] = V("hidden"), [se, O] = V("products"), [ae, Oe] = V(null), [Ae, Se] = V(null), Qe = b.length > 0 || _.length > 0, et = ((M == null ? void 0 : M.length) ?? 0) > 0, De = Qe || et, nt = (se === "productDetail" ? 70 : ee === "center" && !De ? 140 : 98) * he / 100;
|
|
16405
16415
|
ce(() => {
|
|
16406
|
-
if (N &&
|
|
16416
|
+
if (N && ke !== "loading" && ke !== "visible")
|
|
16407
16417
|
$("loading"), ee === "center" && re("partial-left");
|
|
16408
|
-
else if (De &&
|
|
16418
|
+
else if (De && ke !== "visible")
|
|
16409
16419
|
if (ee === "center") {
|
|
16410
16420
|
re("partial-left"), $("transitioning");
|
|
16411
16421
|
const pe = setTimeout(() => {
|
|
@@ -16414,19 +16424,19 @@ const fn = (t, e) => {
|
|
|
16414
16424
|
return () => clearTimeout(pe);
|
|
16415
16425
|
} else
|
|
16416
16426
|
$("visible");
|
|
16417
|
-
else !De && !N &&
|
|
16418
|
-
}, [De, N,
|
|
16427
|
+
else !De && !N && ke !== "hidden" && ($("hidden"), re("center"));
|
|
16428
|
+
}, [De, N, ke, ee]);
|
|
16419
16429
|
const tt = (pe) => {
|
|
16420
16430
|
if (T) {
|
|
16421
16431
|
T(pe), P == null || P(pe);
|
|
16422
16432
|
return;
|
|
16423
16433
|
}
|
|
16424
|
-
|
|
16434
|
+
Oe(pe), O("productDetail"), P == null || P(pe);
|
|
16425
16435
|
}, q = () => {
|
|
16426
|
-
|
|
16436
|
+
Oe(null), Se(null), O("products");
|
|
16427
16437
|
}, L = (pe) => {
|
|
16428
|
-
console.log("[ContainedMobileBobLayout] Package selected:", pe.title),
|
|
16429
|
-
},
|
|
16438
|
+
console.log("[ContainedMobileBobLayout] Package selected:", pe.title), Se(pe), O("packageDetail"), k == null || k(pe);
|
|
16439
|
+
}, je = ke !== "hidden" && se === "products", Z = ke !== "hidden";
|
|
16430
16440
|
return /* @__PURE__ */ o.jsxs(
|
|
16431
16441
|
"div",
|
|
16432
16442
|
{
|
|
@@ -16477,7 +16487,7 @@ const fn = (t, e) => {
|
|
|
16477
16487
|
onProductClick: tt,
|
|
16478
16488
|
onPackageSelect: L,
|
|
16479
16489
|
isResearching: N,
|
|
16480
|
-
visible:
|
|
16490
|
+
visible: je,
|
|
16481
16491
|
counterHeightPercent: n,
|
|
16482
16492
|
hasVehicle: !!B,
|
|
16483
16493
|
onAddToCart: E,
|
|
@@ -16497,29 +16507,29 @@ const fn = (t, e) => {
|
|
|
16497
16507
|
onNavigateToProductPage: T
|
|
16498
16508
|
}
|
|
16499
16509
|
),
|
|
16500
|
-
se === "packageDetail" &&
|
|
16510
|
+
se === "packageDetail" && Ae && /* @__PURE__ */ o.jsx(
|
|
16501
16511
|
Du,
|
|
16502
16512
|
{
|
|
16503
|
-
package:
|
|
16513
|
+
package: Ae,
|
|
16504
16514
|
onBack: q,
|
|
16505
16515
|
onAddToCart: (pe) => {
|
|
16506
|
-
pe.forEach((
|
|
16516
|
+
pe.forEach((we) => {
|
|
16507
16517
|
var We;
|
|
16508
16518
|
E == null || E({
|
|
16509
|
-
id:
|
|
16510
|
-
name:
|
|
16511
|
-
brand:
|
|
16512
|
-
price:
|
|
16513
|
-
sku:
|
|
16514
|
-
partNumber:
|
|
16515
|
-
image_url:
|
|
16516
|
-
partslotDescription:
|
|
16519
|
+
id: we.sku || ((We = we.partslotId) == null ? void 0 : We.toString()) || "unknown",
|
|
16520
|
+
name: we.name || we.partslotName || "Unknown Part",
|
|
16521
|
+
brand: we.brand,
|
|
16522
|
+
price: we.displayPrice,
|
|
16523
|
+
sku: we.sku,
|
|
16524
|
+
partNumber: we.partNumber,
|
|
16525
|
+
image_url: we.productImageUrl,
|
|
16526
|
+
partslotDescription: we.partslotName
|
|
16517
16527
|
});
|
|
16518
16528
|
});
|
|
16519
16529
|
},
|
|
16520
16530
|
onNavigateToProductPage: (pe) => {
|
|
16521
|
-
const
|
|
16522
|
-
|
|
16531
|
+
const we = b.find((We) => We.sku === pe);
|
|
16532
|
+
we && T && T(we);
|
|
16523
16533
|
}
|
|
16524
16534
|
}
|
|
16525
16535
|
),
|
|
@@ -16580,7 +16590,7 @@ const fn = (t, e) => {
|
|
|
16580
16590
|
}), K.current = q;
|
|
16581
16591
|
}
|
|
16582
16592
|
}, [k]);
|
|
16583
|
-
const [U, G] = V([]), [he, ee] = V(""), [re,
|
|
16593
|
+
const [U, G] = V([]), [he, ee] = V(""), [re, ke] = V(""), $ = X(null), se = X(null);
|
|
16584
16594
|
ce(() => {
|
|
16585
16595
|
$.current = (q) => {
|
|
16586
16596
|
if (W(!1), !q || q.length === 0) {
|
|
@@ -16589,12 +16599,12 @@ const fn = (t, e) => {
|
|
|
16589
16599
|
}
|
|
16590
16600
|
const L = q[0];
|
|
16591
16601
|
console.log("[Bob] First part raw keys:", Object.keys(L));
|
|
16592
|
-
const
|
|
16593
|
-
const
|
|
16602
|
+
const je = q.map((Z, pe) => {
|
|
16603
|
+
const we = Z.Brand || Z.brand || "";
|
|
16594
16604
|
return {
|
|
16595
16605
|
id: Z.SKU || Z.sku || `part-${pe}`,
|
|
16596
16606
|
name: Z["Part Product Type"] || Z.partslot_description || Z.name || "Unknown Part",
|
|
16597
|
-
brand:
|
|
16607
|
+
brand: we,
|
|
16598
16608
|
price: Z["Metro Retail Price"] || Z.price || 0,
|
|
16599
16609
|
sku: Z.SKU || Z.sku,
|
|
16600
16610
|
partNumber: Z["Part Number"] || Z.part_number || null,
|
|
@@ -16605,15 +16615,15 @@ const fn = (t, e) => {
|
|
|
16605
16615
|
perCarQty: Z["Per Car Qty"] || Z.per_car_qty || 1,
|
|
16606
16616
|
volume: Z.volume || null,
|
|
16607
16617
|
viscosity: Z.viscosity || null,
|
|
16608
|
-
brandImageUrl:
|
|
16618
|
+
brandImageUrl: we ? `https://flpzjbasdsfwoeruyxgp.supabase.co/storage/v1/object/public/brand_images/${we.replace(/\s+/g, "")}.jpg` : void 0
|
|
16609
16619
|
};
|
|
16610
16620
|
});
|
|
16611
16621
|
P((Z) => {
|
|
16612
16622
|
var Ne;
|
|
16613
|
-
const pe = new Set(Z.map((Ke) => Ke.sku).filter(Boolean)),
|
|
16614
|
-
if (console.log("[Bob] Products mapped:",
|
|
16623
|
+
const pe = new Set(Z.map((Ke) => Ke.sku).filter(Boolean)), we = new Set(Z.map((Ke) => Ke.partslotDescription || "Other Parts")), We = /* @__PURE__ */ new Set(), Be = je.filter((Ke) => !Ke.sku || We.has(Ke.sku) || pe.has(Ke.sku) ? !1 : (We.add(Ke.sku), !0));
|
|
16624
|
+
if (console.log("[Bob] Products mapped:", je.length, "-> new unique:", Be.length, "-> existing:", Z.length), Be.length > 0 && Z.length > 0) {
|
|
16615
16625
|
const Ke = (Ne = Be.find(
|
|
16616
|
-
(lr) => !
|
|
16626
|
+
(lr) => !we.has(lr.partslotDescription || "Other Parts")
|
|
16617
16627
|
)) == null ? void 0 : Ne.partslotDescription;
|
|
16618
16628
|
Ke && setTimeout(() => le(Ke), 100);
|
|
16619
16629
|
}
|
|
@@ -16639,8 +16649,8 @@ const fn = (t, e) => {
|
|
|
16639
16649
|
onResearchStart: () => {
|
|
16640
16650
|
W(!0);
|
|
16641
16651
|
},
|
|
16642
|
-
onVariantSelectionRequired: (q, L,
|
|
16643
|
-
W(!1), G(q), ee(L),
|
|
16652
|
+
onVariantSelectionRequired: (q, L, je) => {
|
|
16653
|
+
W(!1), G(q), ee(L), ke(je);
|
|
16644
16654
|
},
|
|
16645
16655
|
onHighlightPart: (q) => {
|
|
16646
16656
|
T(q), setTimeout(() => T(null), 8e3);
|
|
@@ -16654,7 +16664,7 @@ const fn = (t, e) => {
|
|
|
16654
16664
|
shelfCategoriesRef: K
|
|
16655
16665
|
});
|
|
16656
16666
|
ce(() => {
|
|
16657
|
-
O.identifiedVehicle && (G([]), ee(""),
|
|
16667
|
+
O.identifiedVehicle && (G([]), ee(""), ke(""));
|
|
16658
16668
|
}, [(nt = O.identifiedVehicle) == null ? void 0 : nt.vehicle_id, (tt = O.identifiedVehicle) == null ? void 0 : tt.id]);
|
|
16659
16669
|
const ae = (q) => {
|
|
16660
16670
|
O.sendDirectMessage(`Option ${q.optionNumber}`);
|
|
@@ -16663,19 +16673,19 @@ const fn = (t, e) => {
|
|
|
16663
16673
|
g(O.isSpeaking);
|
|
16664
16674
|
}, [O.isSpeaking]), ce(() => {
|
|
16665
16675
|
const q = f.onPartsFound, L = f.onServicePackagesFound;
|
|
16666
|
-
return f.onPartsFound = (
|
|
16676
|
+
return f.onPartsFound = (je) => {
|
|
16667
16677
|
var Z;
|
|
16668
|
-
(Z = $.current) == null || Z.call($,
|
|
16669
|
-
}, f.onServicePackagesFound = (
|
|
16678
|
+
(Z = $.current) == null || Z.call($, je), q == null || q(je);
|
|
16679
|
+
}, f.onServicePackagesFound = (je) => {
|
|
16670
16680
|
var Z;
|
|
16671
|
-
(Z = se.current) == null || Z.call(se,
|
|
16681
|
+
(Z = se.current) == null || Z.call(se, je), L == null || L(je);
|
|
16672
16682
|
}, () => {
|
|
16673
16683
|
f.onPartsFound = q, f.onServicePackagesFound = L;
|
|
16674
16684
|
};
|
|
16675
16685
|
}, [f]);
|
|
16676
|
-
const
|
|
16677
|
-
var Z, pe,
|
|
16678
|
-
const L = Array.isArray(q) ? q : [q],
|
|
16686
|
+
const Oe = n || (S == null ? void 0 : S.image_url), Ae = i || (S == null ? void 0 : S.counter_overlay_url) || void 0, Se = a || (S == null ? void 0 : S.counter_height_percent) || 12, Qe = b() || l || "", et = _(), De = j(), st = Y((q) => {
|
|
16687
|
+
var Z, pe, we, We;
|
|
16688
|
+
const L = Array.isArray(q) ? q : [q], je = ((pe = (Z = O.identifiedVehicle) == null ? void 0 : Z.vehicle_id) == null ? void 0 : pe.toString()) || ((We = (we = O.identifiedVehicle) == null ? void 0 : we.id) == null ? void 0 : We.toString());
|
|
16679
16689
|
L.forEach((Be) => {
|
|
16680
16690
|
var Ke;
|
|
16681
16691
|
const Ne = {
|
|
@@ -16686,7 +16696,7 @@ const fn = (t, e) => {
|
|
|
16686
16696
|
sku: Be.sku,
|
|
16687
16697
|
brand: Be.brand,
|
|
16688
16698
|
image_url: Be.image_url,
|
|
16689
|
-
vehicle_id:
|
|
16699
|
+
vehicle_id: je,
|
|
16690
16700
|
...Be._bundleMeta || {}
|
|
16691
16701
|
};
|
|
16692
16702
|
(Ke = f.onAddToCart) == null || Ke.call(f, Ne);
|
|
@@ -16698,9 +16708,9 @@ const fn = (t, e) => {
|
|
|
16698
16708
|
{
|
|
16699
16709
|
currentImage: Qe,
|
|
16700
16710
|
animationState: m,
|
|
16701
|
-
backdropUrl:
|
|
16702
|
-
counterOverlayUrl:
|
|
16703
|
-
counterHeightPercent:
|
|
16711
|
+
backdropUrl: Oe,
|
|
16712
|
+
counterOverlayUrl: Ae,
|
|
16713
|
+
counterHeightPercent: Se,
|
|
16704
16714
|
bobOffset: et,
|
|
16705
16715
|
bobScale: De,
|
|
16706
16716
|
embedded: h,
|
|
@@ -16747,9 +16757,9 @@ const fn = (t, e) => {
|
|
|
16747
16757
|
{
|
|
16748
16758
|
currentImage: Qe,
|
|
16749
16759
|
animationState: m,
|
|
16750
|
-
backdropUrl:
|
|
16751
|
-
counterOverlayUrl:
|
|
16752
|
-
counterHeightPercent:
|
|
16760
|
+
backdropUrl: Oe,
|
|
16761
|
+
counterOverlayUrl: Ae,
|
|
16762
|
+
counterHeightPercent: Se,
|
|
16753
16763
|
bobOffset: et,
|
|
16754
16764
|
bobScale: De,
|
|
16755
16765
|
messages: O.messages,
|
|
@@ -16799,9 +16809,9 @@ const fn = (t, e) => {
|
|
|
16799
16809
|
{
|
|
16800
16810
|
currentImage: Qe,
|
|
16801
16811
|
animationState: m,
|
|
16802
|
-
backdropUrl:
|
|
16803
|
-
counterOverlayUrl:
|
|
16804
|
-
counterHeightPercent:
|
|
16812
|
+
backdropUrl: Oe,
|
|
16813
|
+
counterOverlayUrl: Ae,
|
|
16814
|
+
counterHeightPercent: Se,
|
|
16805
16815
|
verticalOffset: et,
|
|
16806
16816
|
scale: De
|
|
16807
16817
|
}
|