@gengage/assistant-fe 0.6.24 → 0.6.26
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/dist/agentic/index.d.ts +1 -1
- package/dist/agentic/index.js +684 -639
- package/dist/agentic/types.d.ts +17 -2
- package/dist/agentic/worker.d.ts +1 -1
- package/dist/agentic/worker.js +294 -237
- package/dist/agentic.iife.js +8 -8
- package/dist/api-paths-CmFRzaMd.js +1274 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +13 -13
- package/dist/chat.js +1 -1
- package/dist/{common-CzYj5Rg3.js → common-uHKZ-s5H.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-B1BbjAAP.js → connection-warning-xRmq7uJ3.js} +1 -1
- package/dist/{fastIntent-DtvKVSIo.js → fastIntent-B3qZhCis.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/native.iife.js +11 -11
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +25 -25
- package/dist/qna.js +1 -1
- package/dist/{route-params-5KSvTyeb.js → route-params-UDemctx_.js} +330 -313
- package/dist/{runtime-C2RFDcMJ.js → runtime-C1mVW5y1.js} +4 -4
- package/dist/{runtime-BwKxrcVs.js → runtime-Cpi9hXiL.js} +3 -3
- package/dist/{runtime-DLqO5X8q.js → runtime-DhhnaNUQ.js} +3 -3
- package/dist/{simbut-C5AbbA4L.js → simbut-csGdfd9_.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-mH70kmF9.js → simrel-B1VHfhBf.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +38 -38
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-Cfjsry5x.js → widget-base-DNT8SYtf.js} +1 -1
- package/package.json +1 -1
- package/dist/api-paths-Bgg7-gUO.js +0 -1235
package/dist/agentic/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { buildPhotoSimilarityProfile as
|
|
2
|
-
import { $ as
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { buildPhotoSimilarityProfile as bo, buildProductSimilarityProfile as yo, buildSimilarityQueries as wo, normalizeSimilarityText as vo, rankSimilarProducts as xo, rankSimilarProductsAsync as ko, scoreSimilarityCandidate as _o, tokenizeSimilarityText as Eo } from "./algos/similarity.js";
|
|
2
|
+
import { $ as To, A as Co, B as ft, C as Ao, D as Ro, E as Po, F as Lo, G as jo, H as No, I as Io, J as Uo, K as qo, L as Bo, M as Oo, N as $o, O as Mo, P as Fo, Q as Do, R as Go, S as zo, T as Ho, U as Wo, V as Vo, W as ue, X as Ko, Y as Jo, Z as Yo, _ as Zo, _t as Qo, a as Xo, at as pt, b as ei, c as mt, d as ti, dt as ri, et as ni, f as oi, ft as ii, g as ai, gt, h as si, ht, i as ci, it as li, j as ui, k as di, l as fi, lt as bt, m as pi, mt as Oe, n as mi, nt as yt, o as gi, ot as hi, p as bi, q as yi, r as wi, rt as vi, s as xi, st as $e, t as ki, tt as _i, u as Ei, ut as Si, v as Ti, vt as Ci, w as Ai, x as Ri, y as Pi, z as wt } from "../route-params-UDemctx_.js";
|
|
3
|
+
var vt = 512, xt = 0.74;
|
|
4
|
+
function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: c, confirmation: d, memory: f = Oe() }) {
|
|
5
5
|
let b = 1;
|
|
6
6
|
const m = /* @__PURE__ */ new Map();
|
|
7
|
-
return
|
|
7
|
+
return ht({
|
|
8
8
|
worker: t,
|
|
9
9
|
tools: s,
|
|
10
10
|
beacon: (l) => c?.({
|
|
@@ -14,7 +14,12 @@ function vt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
14
14
|
...d ? { confirmation: d } : {},
|
|
15
15
|
memory: f
|
|
16
16
|
}), t.addEventListener("message", (l) => {
|
|
17
|
-
const p = l.data || {}
|
|
17
|
+
const p = l.data || {};
|
|
18
|
+
if (p.type === "activity" && p.entry) {
|
|
19
|
+
Me(p.entry);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const g = typeof p.id == "number" ? p.id : null;
|
|
18
23
|
if (g == null) return;
|
|
19
24
|
const u = m.get(g);
|
|
20
25
|
if (u) {
|
|
@@ -51,7 +56,8 @@ function vt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
51
56
|
tokenBrokerAudience: i,
|
|
52
57
|
defaultLocale: a,
|
|
53
58
|
request: v,
|
|
54
|
-
parentUrl: window.location.href
|
|
59
|
+
parentUrl: window.location.href,
|
|
60
|
+
debugActivity: _t()
|
|
55
61
|
});
|
|
56
62
|
};
|
|
57
63
|
if (g.aborted) {
|
|
@@ -59,7 +65,7 @@ function vt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
59
65
|
return;
|
|
60
66
|
}
|
|
61
67
|
if (g.addEventListener("abort", w, { once: !0 }), u) {
|
|
62
|
-
|
|
68
|
+
Fe(l, u).then(k).catch((v) => {
|
|
63
69
|
m.delete(h), p.onError(v instanceof Error ? v : /* @__PURE__ */ new Error("Failed to read image attachment"));
|
|
64
70
|
});
|
|
65
71
|
return;
|
|
@@ -67,23 +73,31 @@ function vt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
67
73
|
k(l);
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
|
-
function
|
|
76
|
+
function Me(e) {
|
|
77
|
+
const t = window;
|
|
78
|
+
(t.__GENGAGE_AGENTIC_DEBUG_RECORD__ || t.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__)?.(e);
|
|
79
|
+
}
|
|
80
|
+
function _t() {
|
|
81
|
+
const e = window;
|
|
82
|
+
return typeof (e.__GENGAGE_AGENTIC_DEBUG_RECORD__ || e.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__) == "function";
|
|
83
|
+
}
|
|
84
|
+
function Et({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: c, confirmation: d, memory: f }) {
|
|
71
85
|
let b = null;
|
|
72
|
-
const m =
|
|
86
|
+
const m = St({
|
|
73
87
|
accountId: e,
|
|
74
88
|
tools: s,
|
|
75
89
|
beacon: c,
|
|
76
90
|
confirmation: d,
|
|
77
|
-
memory: f ??
|
|
78
|
-
}), l =
|
|
91
|
+
memory: f ?? Oe()
|
|
92
|
+
}), l = wt(m), p = $e({
|
|
79
93
|
accountId: e,
|
|
80
94
|
...n ? { devJwtSecret: n } : {},
|
|
81
95
|
...o ? { tokenBrokerUrl: o } : {},
|
|
82
96
|
...i ? { tokenBrokerAudience: i } : {}
|
|
83
97
|
});
|
|
84
98
|
return async (g, u, h, w) => {
|
|
85
|
-
const k = await
|
|
86
|
-
b ||= new
|
|
99
|
+
const k = await Fe(g || {}, w);
|
|
100
|
+
b ||= new bt({
|
|
87
101
|
accountId: e,
|
|
88
102
|
locale: k?.locale || a,
|
|
89
103
|
parentUrl: window.location.href,
|
|
@@ -95,23 +109,29 @@ function xt({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
95
109
|
threadTtlMs: t.contextPersistence?.threadTtlMs
|
|
96
110
|
});
|
|
97
111
|
try {
|
|
98
|
-
await
|
|
112
|
+
await ft({
|
|
99
113
|
request: k,
|
|
100
114
|
accountModule: {
|
|
101
115
|
...t,
|
|
102
|
-
accountId: e
|
|
116
|
+
accountId: e,
|
|
117
|
+
trace: async (v) => {
|
|
118
|
+
Me({
|
|
119
|
+
kind: "flow/trace",
|
|
120
|
+
event: v
|
|
121
|
+
}), await t.trace?.(v);
|
|
122
|
+
}
|
|
103
123
|
},
|
|
104
124
|
contextStore: b,
|
|
105
|
-
beClient: { invoke({ op: v, input:
|
|
106
|
-
return
|
|
125
|
+
beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey: M, browserCache: z }) {
|
|
126
|
+
return yt({
|
|
107
127
|
beUrl: r,
|
|
108
128
|
accountId: e,
|
|
109
129
|
jwtProvider: p,
|
|
110
130
|
parentUrl: window.location.href,
|
|
111
131
|
op: v,
|
|
112
|
-
input:
|
|
132
|
+
input: T,
|
|
113
133
|
cacheTtlS: C,
|
|
114
|
-
cacheKey:
|
|
134
|
+
cacheKey: M,
|
|
115
135
|
browserCache: z,
|
|
116
136
|
...x ? { signal: x } : {}
|
|
117
137
|
});
|
|
@@ -122,26 +142,26 @@ function xt({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
122
142
|
signal: h
|
|
123
143
|
});
|
|
124
144
|
} catch (v) {
|
|
125
|
-
h?.aborted || (oe(u,
|
|
145
|
+
h?.aborted || (oe(u, pt(v)), u.onDone());
|
|
126
146
|
}
|
|
127
147
|
};
|
|
128
148
|
}
|
|
129
|
-
function
|
|
149
|
+
function St({ accountId: e, tools: t, beacon: r, confirmation: n, memory: o }) {
|
|
130
150
|
const i = (a) => r?.({
|
|
131
151
|
...a,
|
|
132
152
|
accountId: a.accountId || e
|
|
133
153
|
});
|
|
134
|
-
return ((a, s) =>
|
|
154
|
+
return ((a, s) => gt(a, s, {
|
|
135
155
|
tools: t,
|
|
136
156
|
beacon: i,
|
|
137
157
|
confirmation: n,
|
|
138
158
|
memory: o
|
|
139
159
|
}));
|
|
140
160
|
}
|
|
141
|
-
async function
|
|
161
|
+
async function Fe(e, t) {
|
|
142
162
|
if (!t || !t.type?.startsWith("image/")) return e;
|
|
143
|
-
const r = await
|
|
144
|
-
...
|
|
163
|
+
const r = await At(t), n = {
|
|
164
|
+
...Tt(e.payload ?? e.action?.payload),
|
|
145
165
|
image_data_url: r.dataUrl,
|
|
146
166
|
image_mime: r.mime
|
|
147
167
|
};
|
|
@@ -154,32 +174,32 @@ async function Oe(e, t) {
|
|
|
154
174
|
} } : {}
|
|
155
175
|
};
|
|
156
176
|
}
|
|
157
|
-
function
|
|
158
|
-
return
|
|
177
|
+
function Tt(e) {
|
|
178
|
+
return Ct(e) ? { ...e } : typeof e == "string" ? { text: e } : {};
|
|
159
179
|
}
|
|
160
|
-
function
|
|
180
|
+
function Ct(e) {
|
|
161
181
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
162
182
|
}
|
|
163
|
-
async function
|
|
164
|
-
const t = await
|
|
183
|
+
async function At(e) {
|
|
184
|
+
const t = await Rt(e);
|
|
165
185
|
return t || {
|
|
166
|
-
dataUrl: await
|
|
186
|
+
dataUrl: await De(e),
|
|
167
187
|
mime: e.type
|
|
168
188
|
};
|
|
169
189
|
}
|
|
170
|
-
async function
|
|
190
|
+
async function Rt(e) {
|
|
171
191
|
if (typeof createImageBitmap != "function" || typeof document > "u") return null;
|
|
172
192
|
let t = null;
|
|
173
193
|
try {
|
|
174
194
|
t = await createImageBitmap(e);
|
|
175
|
-
const r = Math.min(1,
|
|
195
|
+
const r = Math.min(1, vt / Math.max(t.width, t.height)), n = Math.max(1, Math.round(t.width * r)), o = Math.max(1, Math.round(t.height * r)), i = document.createElement("canvas");
|
|
176
196
|
i.width = n, i.height = o;
|
|
177
197
|
const a = i.getContext("2d");
|
|
178
198
|
if (!a) return null;
|
|
179
199
|
a.drawImage(t, 0, 0, n, o);
|
|
180
|
-
const s = await new Promise((c) => i.toBlob(c, "image/jpeg",
|
|
200
|
+
const s = await new Promise((c) => i.toBlob(c, "image/jpeg", xt));
|
|
181
201
|
return s ? {
|
|
182
|
-
dataUrl: await
|
|
202
|
+
dataUrl: await De(s),
|
|
183
203
|
mime: s.type || "image/jpeg"
|
|
184
204
|
} : null;
|
|
185
205
|
} catch {
|
|
@@ -188,7 +208,7 @@ async function Et(e) {
|
|
|
188
208
|
t?.close();
|
|
189
209
|
}
|
|
190
210
|
}
|
|
191
|
-
async function
|
|
211
|
+
async function De(e) {
|
|
192
212
|
const t = new Uint8Array(await e.arrayBuffer());
|
|
193
213
|
let r = "";
|
|
194
214
|
const n = 32768;
|
|
@@ -214,7 +234,7 @@ function oe(e, t) {
|
|
|
214
234
|
e.onMetadata(t);
|
|
215
235
|
break;
|
|
216
236
|
case "error":
|
|
217
|
-
e.onError(
|
|
237
|
+
e.onError(Pt(t));
|
|
218
238
|
break;
|
|
219
239
|
case "done":
|
|
220
240
|
e.onDone();
|
|
@@ -223,16 +243,16 @@ function oe(e, t) {
|
|
|
223
243
|
break;
|
|
224
244
|
}
|
|
225
245
|
}
|
|
226
|
-
function
|
|
246
|
+
function Pt(e) {
|
|
227
247
|
const t = new Error(e.message || e.code || "Agent error");
|
|
228
248
|
return e.code && (t.code = e.code), t;
|
|
229
249
|
}
|
|
230
|
-
var
|
|
250
|
+
var Lt = "entries", jt = 1, Nt = {
|
|
231
251
|
volatile: "Hot per-page state and sensitive request context.",
|
|
232
252
|
session: "Current-visit tool context without raw tokens or PII-heavy payloads.",
|
|
233
253
|
local: "Small, non-sensitive capability facts or user preferences.",
|
|
234
254
|
indexedDb: "Larger product/search payload caches with short TTLs."
|
|
235
|
-
},
|
|
255
|
+
}, _e = /* @__PURE__ */ new Map();
|
|
236
256
|
function ie() {
|
|
237
257
|
return Date.now();
|
|
238
258
|
}
|
|
@@ -246,7 +266,7 @@ function de(e, t) {
|
|
|
246
266
|
expiresAt: t ? ie() + t : null
|
|
247
267
|
};
|
|
248
268
|
}
|
|
249
|
-
function
|
|
269
|
+
function It(e, t, r) {
|
|
250
270
|
try {
|
|
251
271
|
const n = e.getItem(`${t}${r}`);
|
|
252
272
|
if (!n) return null;
|
|
@@ -256,20 +276,20 @@ function Pt(e, t, r) {
|
|
|
256
276
|
return null;
|
|
257
277
|
}
|
|
258
278
|
}
|
|
259
|
-
function
|
|
279
|
+
function Ut(e, t, r, n, o) {
|
|
260
280
|
try {
|
|
261
281
|
return e.setItem(`${t}${r}`, JSON.stringify(de(n, o))), !0;
|
|
262
282
|
} catch {
|
|
263
283
|
return !1;
|
|
264
284
|
}
|
|
265
285
|
}
|
|
266
|
-
function
|
|
286
|
+
function qt(e, t, r) {
|
|
267
287
|
try {
|
|
268
288
|
e.removeItem(`${t}${r}`);
|
|
269
289
|
} catch {
|
|
270
290
|
}
|
|
271
291
|
}
|
|
272
|
-
function
|
|
292
|
+
function Ee(e, t) {
|
|
273
293
|
if (!e) return 0;
|
|
274
294
|
let r = 0;
|
|
275
295
|
try {
|
|
@@ -289,18 +309,18 @@ function _e(e, t) {
|
|
|
289
309
|
}
|
|
290
310
|
return r;
|
|
291
311
|
}
|
|
292
|
-
function
|
|
312
|
+
function Se(e) {
|
|
293
313
|
try {
|
|
294
314
|
return window[e];
|
|
295
315
|
} catch {
|
|
296
316
|
return null;
|
|
297
317
|
}
|
|
298
318
|
}
|
|
299
|
-
function
|
|
319
|
+
function Te(e, t) {
|
|
300
320
|
return e ? {
|
|
301
|
-
get: (r) =>
|
|
302
|
-
set: (r, n, o = {}) =>
|
|
303
|
-
remove: (r) =>
|
|
321
|
+
get: (r) => It(e, t, r),
|
|
322
|
+
set: (r, n, o = {}) => Ut(e, t, r, n, o.ttlMs),
|
|
323
|
+
remove: (r) => qt(e, t, r)
|
|
304
324
|
} : {
|
|
305
325
|
get: () => null,
|
|
306
326
|
set: () => !1,
|
|
@@ -308,8 +328,8 @@ function Ee(e, t) {
|
|
|
308
328
|
}
|
|
309
329
|
};
|
|
310
330
|
}
|
|
311
|
-
function
|
|
312
|
-
const r = t.dbName || `gengage-${e}`, n = t.dbStore ||
|
|
331
|
+
function Bt(e, t) {
|
|
332
|
+
const r = t.dbName || `gengage-${e}`, n = t.dbStore || Lt, o = t.dbVersion || jt, i = /* @__PURE__ */ new Map();
|
|
313
333
|
let a = null;
|
|
314
334
|
const s = () => "indexedDB" in window ? a || (a = new Promise((m) => {
|
|
315
335
|
const l = indexedDB.open(r, o);
|
|
@@ -362,12 +382,12 @@ function Ut(e, t) {
|
|
|
362
382
|
}
|
|
363
383
|
};
|
|
364
384
|
}
|
|
365
|
-
function
|
|
385
|
+
function Ge(e, t = {}) {
|
|
366
386
|
const r = window, n = r.gengage || (r.gengage = {}), o = n.memory || (n.memory = {}), i = o[e];
|
|
367
387
|
if (i) return i;
|
|
368
|
-
const a =
|
|
369
|
-
|
|
370
|
-
const s = t.sessionPrefix || `gengage:${e}:session:`, c = t.localPrefix || `gengage:${e}:local:`, d =
|
|
388
|
+
const a = _e.get(e) || Bt(e, t);
|
|
389
|
+
_e.set(e, a);
|
|
390
|
+
const s = t.sessionPrefix || `gengage:${e}:session:`, c = t.localPrefix || `gengage:${e}:local:`, d = Se("sessionStorage"), f = Se("localStorage"), m = {
|
|
371
391
|
get: (u) => {
|
|
372
392
|
const h = a.volatileEntries.get(u);
|
|
373
393
|
return h ? U(h) ? (a.volatileEntries.delete(u), null) : h.value : null;
|
|
@@ -383,9 +403,9 @@ function $e(e, t = {}) {
|
|
|
383
403
|
remove: a.idbRemove
|
|
384
404
|
}, p = async () => {
|
|
385
405
|
let u = 0;
|
|
386
|
-
for (const [v,
|
|
387
|
-
U(
|
|
388
|
-
const h =
|
|
406
|
+
for (const [v, T] of a.volatileEntries)
|
|
407
|
+
U(T) && (a.volatileEntries.delete(v), u += 1);
|
|
408
|
+
const h = Ee(d, s), w = Ee(f, c), k = await a.idbGc();
|
|
389
409
|
return {
|
|
390
410
|
volatile: u,
|
|
391
411
|
session: h,
|
|
@@ -395,21 +415,21 @@ function $e(e, t = {}) {
|
|
|
395
415
|
}, g = {
|
|
396
416
|
accountId: e,
|
|
397
417
|
volatile: m,
|
|
398
|
-
session:
|
|
399
|
-
local:
|
|
418
|
+
session: Te(d, s),
|
|
419
|
+
local: Te(f, c),
|
|
400
420
|
indexedDb: l,
|
|
401
421
|
gc: p,
|
|
402
422
|
stableKey: ue,
|
|
403
423
|
policy: {
|
|
404
|
-
...
|
|
424
|
+
...Nt,
|
|
405
425
|
...t.policy || {}
|
|
406
426
|
}
|
|
407
427
|
};
|
|
408
428
|
o[e] = g;
|
|
409
429
|
for (const u of t.aliases || []) o[u] = g;
|
|
410
|
-
return
|
|
430
|
+
return Ot(g), g;
|
|
411
431
|
}
|
|
412
|
-
function
|
|
432
|
+
function Ot(e) {
|
|
413
433
|
const t = window, r = () => {
|
|
414
434
|
e.gc().catch(() => {
|
|
415
435
|
});
|
|
@@ -420,11 +440,11 @@ function qt(e) {
|
|
|
420
440
|
}
|
|
421
441
|
setTimeout(r, 5e3);
|
|
422
442
|
}
|
|
423
|
-
var
|
|
424
|
-
function
|
|
443
|
+
var V = "__gengageAgentFetchBridge", $t = 1e3 * 60 * 60 * 24 * 14;
|
|
444
|
+
function Li({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache: n }) {
|
|
425
445
|
if (!e) throw new Error("accountId is required.");
|
|
426
446
|
if (typeof t != "function") throw new Error("streamTransport is required.");
|
|
427
|
-
const o = Mt(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ?
|
|
447
|
+
const o = Mt(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ? Wt({
|
|
428
448
|
accountId: e,
|
|
429
449
|
endpointCache: n,
|
|
430
450
|
fetchImpl: o.originalFetch
|
|
@@ -448,7 +468,7 @@ function _i({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache
|
|
|
448
468
|
};
|
|
449
469
|
}
|
|
450
470
|
function Mt() {
|
|
451
|
-
const e = window, t = e[
|
|
471
|
+
const e = window, t = e[V];
|
|
452
472
|
if (t) return t;
|
|
453
473
|
const r = e.fetch.bind(e), n = {
|
|
454
474
|
routes: /* @__PURE__ */ new Map(),
|
|
@@ -456,27 +476,27 @@ function Mt() {
|
|
|
456
476
|
installedFetch: r
|
|
457
477
|
};
|
|
458
478
|
return n.installedFetch = (o, i) => {
|
|
459
|
-
const a =
|
|
460
|
-
return s ?
|
|
461
|
-
}, e.fetch = n.installedFetch, e[
|
|
479
|
+
const a = ze(o), s = n.routes.get(a);
|
|
480
|
+
return s ? Gt(s, o, i) : r(o, i);
|
|
481
|
+
}, e.fetch = n.installedFetch, e[V] = n, n;
|
|
462
482
|
}
|
|
463
483
|
function Ft(e) {
|
|
464
484
|
if (e.routes.size > 0) return;
|
|
465
485
|
const t = window;
|
|
466
|
-
t.fetch === e.installedFetch && (t.fetch = e.originalFetch), t[
|
|
486
|
+
t.fetch === e.installedFetch && (t.fetch = e.originalFetch), t[V] === e && delete t[V];
|
|
467
487
|
}
|
|
468
|
-
function
|
|
488
|
+
function ze(e) {
|
|
469
489
|
return typeof e == "string" ? e : e instanceof URL ? e.href : e?.url || "";
|
|
470
490
|
}
|
|
471
491
|
function Ce(e, t) {
|
|
472
492
|
if (t?.signal) return t.signal;
|
|
473
493
|
if (typeof Request < "u" && e instanceof Request) return e.signal;
|
|
474
494
|
}
|
|
475
|
-
function
|
|
495
|
+
function He(e, t) {
|
|
476
496
|
return t?.body !== void 0 && t?.body !== null ? t.body : typeof Request < "u" && e instanceof Request ? e.clone().text() : null;
|
|
477
497
|
}
|
|
478
|
-
async function
|
|
479
|
-
const r =
|
|
498
|
+
async function Dt(e, t) {
|
|
499
|
+
const r = He(e, t);
|
|
480
500
|
if (r instanceof FormData) {
|
|
481
501
|
const o = r.get("request"), i = r.get("attachment");
|
|
482
502
|
return {
|
|
@@ -487,7 +507,7 @@ async function Ot(e, t) {
|
|
|
487
507
|
const n = await Promise.resolve(r);
|
|
488
508
|
return typeof n == "string" ? { request: JSON.parse(n || "{}") } : { request: {} };
|
|
489
509
|
}
|
|
490
|
-
async function
|
|
510
|
+
async function Gt(e, t, r) {
|
|
491
511
|
if (e.endpoint && e.endpoint !== "process_action" && e.endpointHandler) {
|
|
492
512
|
const d = new AbortController(), f = Ce(t, r);
|
|
493
513
|
let b = null;
|
|
@@ -496,17 +516,17 @@ async function Bt(e, t, r) {
|
|
|
496
516
|
f.aborted && m(), f.addEventListener("abort", m, { once: !0 }), b = () => f.removeEventListener("abort", m);
|
|
497
517
|
}
|
|
498
518
|
try {
|
|
499
|
-
const m = await
|
|
500
|
-
accountId:
|
|
519
|
+
const m = await zt(t, r), l = {
|
|
520
|
+
accountId: Ht(t),
|
|
501
521
|
endpoint: e.endpoint,
|
|
502
522
|
signal: d.signal
|
|
503
|
-
}, p =
|
|
523
|
+
}, p = Vt(e.endpointCache, e.endpoint, m, l.accountId);
|
|
504
524
|
if (p) {
|
|
505
|
-
const u = await
|
|
506
|
-
if (u) return
|
|
525
|
+
const u = await Kt(e.endpointCache, p, d.signal);
|
|
526
|
+
if (u) return er(u);
|
|
507
527
|
}
|
|
508
528
|
const g = await e.endpointHandler(m, l);
|
|
509
|
-
return p && g.ok && await
|
|
529
|
+
return p && g.ok && await Jt(e.endpointCache, p, g.clone(), d.signal), g;
|
|
510
530
|
} finally {
|
|
511
531
|
b?.();
|
|
512
532
|
}
|
|
@@ -538,7 +558,7 @@ async function Bt(e, t, r) {
|
|
|
538
558
|
i.addEventListener("abort", l, { once: !0 }), s = () => i.removeEventListener("abort", l);
|
|
539
559
|
}
|
|
540
560
|
try {
|
|
541
|
-
const { request: l, attachment: p } = await
|
|
561
|
+
const { request: l, attachment: p } = await Dt(t, r), g = e.streamTransport(l, {
|
|
542
562
|
onTextChunk: (u, h, w = {}) => f({
|
|
543
563
|
type: "text_chunk",
|
|
544
564
|
content: u,
|
|
@@ -569,7 +589,7 @@ async function Bt(e, t, r) {
|
|
|
569
589
|
f({ type: "done" }), b();
|
|
570
590
|
}
|
|
571
591
|
}, o.signal, p);
|
|
572
|
-
|
|
592
|
+
or(g) && (await g, o.signal.aborted || (f({ type: "done" }), b()));
|
|
573
593
|
} catch (l) {
|
|
574
594
|
o.signal.aborted || m(l);
|
|
575
595
|
}
|
|
@@ -583,27 +603,27 @@ async function Bt(e, t, r) {
|
|
|
583
603
|
headers: { "Content-Type": "application/x-ndjson" }
|
|
584
604
|
});
|
|
585
605
|
}
|
|
586
|
-
async function
|
|
587
|
-
const r = await Promise.resolve(
|
|
606
|
+
async function zt(e, t) {
|
|
607
|
+
const r = await Promise.resolve(He(e, t));
|
|
588
608
|
return typeof r != "string" || r.trim() === "" ? {} : JSON.parse(r);
|
|
589
609
|
}
|
|
590
|
-
function
|
|
610
|
+
function Ht(e) {
|
|
591
611
|
try {
|
|
592
|
-
const [t] = new URL(
|
|
612
|
+
const [t] = new URL(ze(e)).pathname.split("/").filter(Boolean);
|
|
593
613
|
return decodeURIComponent(t || "");
|
|
594
614
|
} catch {
|
|
595
615
|
return "";
|
|
596
616
|
}
|
|
597
617
|
}
|
|
598
|
-
function
|
|
618
|
+
function Wt({ accountId: e, endpointCache: t, fetchImpl: r }) {
|
|
599
619
|
return {
|
|
600
620
|
accountId: e,
|
|
601
621
|
beUrl: t.beUrl,
|
|
602
622
|
...t.parentUrl ? { parentUrl: t.parentUrl } : {},
|
|
603
|
-
ttlMs: t.ttlMs ??
|
|
623
|
+
ttlMs: t.ttlMs ?? $t,
|
|
604
624
|
policies: t.policies,
|
|
605
625
|
fetchImpl: r,
|
|
606
|
-
jwtProvider:
|
|
626
|
+
jwtProvider: $e({
|
|
607
627
|
accountId: e,
|
|
608
628
|
...t.devJwtSecret ? { devJwtSecret: t.devJwtSecret } : {},
|
|
609
629
|
...t.tokenBrokerUrl ? { tokenBrokerUrl: t.tokenBrokerUrl } : {},
|
|
@@ -612,7 +632,7 @@ function zt({ accountId: e, endpointCache: t, fetchImpl: r }) {
|
|
|
612
632
|
})
|
|
613
633
|
};
|
|
614
634
|
}
|
|
615
|
-
function
|
|
635
|
+
function Vt(e, t, r, n) {
|
|
616
636
|
if (!e) return null;
|
|
617
637
|
const o = e.policies[t];
|
|
618
638
|
if (!o) return null;
|
|
@@ -626,26 +646,26 @@ function Gt(e, t, r, n) {
|
|
|
626
646
|
ttlMs: i.ttlMs ?? e.ttlMs
|
|
627
647
|
};
|
|
628
648
|
}
|
|
629
|
-
async function
|
|
630
|
-
const n =
|
|
631
|
-
if (
|
|
632
|
-
const i = await
|
|
633
|
-
return i ? (await
|
|
649
|
+
async function Kt(e, t, r) {
|
|
650
|
+
const n = Je(e.accountId, t), o = await tr(e.accountId, n);
|
|
651
|
+
if (Ke(o)) return o;
|
|
652
|
+
const i = await Yt(e, t, r);
|
|
653
|
+
return i ? (await Ye(e.accountId, n, i, t.ttlMs), i) : null;
|
|
634
654
|
}
|
|
635
|
-
async function
|
|
655
|
+
async function Jt(e, t, r, n) {
|
|
636
656
|
try {
|
|
637
|
-
const o = await
|
|
638
|
-
if (
|
|
639
|
-
const i =
|
|
640
|
-
await
|
|
657
|
+
const o = await Xt(r);
|
|
658
|
+
if (nr(o.body)) return;
|
|
659
|
+
const i = Je(e.accountId, t);
|
|
660
|
+
await Ye(e.accountId, i, o, t.ttlMs), Zt(e, t, o, n);
|
|
641
661
|
} catch {
|
|
642
662
|
}
|
|
643
663
|
}
|
|
644
|
-
async function
|
|
664
|
+
async function Yt(e, t, r) {
|
|
645
665
|
try {
|
|
646
|
-
const n = await e.fetchImpl(
|
|
666
|
+
const n = await e.fetchImpl(Ve(e.beUrl), {
|
|
647
667
|
method: "POST",
|
|
648
|
-
headers: await
|
|
668
|
+
headers: await We(e, r),
|
|
649
669
|
body: JSON.stringify({
|
|
650
670
|
partition: t.partition,
|
|
651
671
|
key: t.key
|
|
@@ -654,16 +674,16 @@ async function Vt(e, t, r) {
|
|
|
654
674
|
});
|
|
655
675
|
if (!n.ok) return null;
|
|
656
676
|
const o = await n.json();
|
|
657
|
-
return o.hit === !0 &&
|
|
677
|
+
return o.hit === !0 && Ke(o.payload) ? o.payload : null;
|
|
658
678
|
} catch {
|
|
659
679
|
return null;
|
|
660
680
|
}
|
|
661
681
|
}
|
|
662
|
-
async function
|
|
682
|
+
async function Zt(e, t, r, n) {
|
|
663
683
|
try {
|
|
664
|
-
await e.fetchImpl(
|
|
684
|
+
await e.fetchImpl(Ve(e.beUrl), {
|
|
665
685
|
method: "POST",
|
|
666
|
-
headers: await
|
|
686
|
+
headers: await We(e, n),
|
|
667
687
|
body: JSON.stringify({
|
|
668
688
|
partition: t.partition,
|
|
669
689
|
key: t.key,
|
|
@@ -675,84 +695,84 @@ async function Kt(e, t, r, n) {
|
|
|
675
695
|
} catch {
|
|
676
696
|
}
|
|
677
697
|
}
|
|
678
|
-
async function
|
|
698
|
+
async function We(e, t) {
|
|
679
699
|
return {
|
|
680
700
|
authorization: `Bearer ${await e.jwtProvider({
|
|
681
701
|
signal: t,
|
|
682
|
-
parentUrl: e.parentUrl ||
|
|
702
|
+
parentUrl: e.parentUrl || Qt()
|
|
683
703
|
})}`,
|
|
684
704
|
"content-type": "application/json",
|
|
685
705
|
accept: "application/json"
|
|
686
706
|
};
|
|
687
707
|
}
|
|
688
|
-
function
|
|
708
|
+
function Qt() {
|
|
689
709
|
try {
|
|
690
710
|
return window.location?.href || "";
|
|
691
711
|
} catch {
|
|
692
712
|
return "";
|
|
693
713
|
}
|
|
694
714
|
}
|
|
695
|
-
function
|
|
715
|
+
function Ve(e) {
|
|
696
716
|
return `${String(e).replace(/\/+$/u, "")}/v1/cache`;
|
|
697
717
|
}
|
|
698
|
-
async function
|
|
718
|
+
async function Xt(e) {
|
|
699
719
|
return {
|
|
700
720
|
status: e.status,
|
|
701
721
|
statusText: e.statusText,
|
|
702
|
-
headers: [...e.headers.entries()].filter(([t]) =>
|
|
722
|
+
headers: [...e.headers.entries()].filter(([t]) => rr(t)),
|
|
703
723
|
body: await e.text()
|
|
704
724
|
};
|
|
705
725
|
}
|
|
706
|
-
function
|
|
726
|
+
function er(e) {
|
|
707
727
|
return new Response(e.body, {
|
|
708
728
|
status: e.status,
|
|
709
729
|
statusText: e.statusText,
|
|
710
730
|
headers: new Headers(e.headers)
|
|
711
731
|
});
|
|
712
732
|
}
|
|
713
|
-
function
|
|
733
|
+
function Ke(e) {
|
|
714
734
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
715
735
|
const t = e;
|
|
716
736
|
return typeof t.status == "number" && typeof t.statusText == "string" && typeof t.body == "string" && Array.isArray(t.headers);
|
|
717
737
|
}
|
|
718
|
-
function
|
|
738
|
+
function Je(e, t) {
|
|
719
739
|
return `endpoint-response:${ue({
|
|
720
740
|
accountId: e,
|
|
721
741
|
partition: t.partition,
|
|
722
742
|
key: t.key
|
|
723
743
|
})}`;
|
|
724
744
|
}
|
|
725
|
-
async function
|
|
726
|
-
const r =
|
|
745
|
+
async function tr(e, t) {
|
|
746
|
+
const r = Ge(e);
|
|
727
747
|
return r.volatile.get(t) || await r.indexedDb.get(t) || r.local.get(t);
|
|
728
748
|
}
|
|
729
|
-
async function
|
|
730
|
-
const o =
|
|
749
|
+
async function Ye(e, t, r, n) {
|
|
750
|
+
const o = Ge(e);
|
|
731
751
|
o.volatile.set(t, r, { ttlMs: n }), await o.indexedDb.set(t, r, { ttlMs: n }) || o.local.set(t, r, { ttlMs: n });
|
|
732
752
|
}
|
|
733
|
-
function
|
|
753
|
+
function rr(e) {
|
|
734
754
|
return ["content-type", "cache-control"].includes(e.toLowerCase());
|
|
735
755
|
}
|
|
736
|
-
function
|
|
756
|
+
function nr(e) {
|
|
737
757
|
return /"_error"\s*:/u.test(e) || /"type"\s*:\s*"error"/u.test(e);
|
|
738
758
|
}
|
|
739
|
-
function
|
|
759
|
+
function or(e) {
|
|
740
760
|
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
741
761
|
}
|
|
742
|
-
function
|
|
762
|
+
function ji({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: i, defaultLocale: a = "en-GB", accountModule: s, tools: c = {}, beacon: d, confirmation: f, memory: b, allowBlobWorker: m = !1, signal: l }) {
|
|
743
763
|
if (!e) throw new Error("accountId is required.");
|
|
744
764
|
if (!t) throw new Error("beUrl is required. The injector owns backend URLs; the SDK has no default.");
|
|
745
765
|
if (!i) throw new Error("workerUrl is required.");
|
|
746
766
|
const p = window, g = p.GengageAssistantInjector || (p.GengageAssistantInjector = {}), u = g[e] || (g[e] = {});
|
|
747
767
|
if (u.agentController) return u.agentController;
|
|
748
|
-
const h =
|
|
768
|
+
const h = Ze(i) || m ? ir(i, `gengage-${e}-agent`, { allowBlobWorker: m }) : null;
|
|
749
769
|
h || d?.({
|
|
750
770
|
type: "agentRuntime",
|
|
751
771
|
accountId: e,
|
|
752
772
|
transport: "main-thread",
|
|
753
773
|
reason: "cross-origin-worker-url",
|
|
754
774
|
workerUrl: i
|
|
755
|
-
}), u.streamTransport = h ?
|
|
775
|
+
}), u.streamTransport = h ? kt({
|
|
756
776
|
accountId: e,
|
|
757
777
|
worker: h.worker,
|
|
758
778
|
beUrl: t,
|
|
@@ -764,7 +784,7 @@ function Ti({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
|
|
|
764
784
|
...d ? { beacon: d } : {},
|
|
765
785
|
...f ? { confirmation: f } : {},
|
|
766
786
|
...b ? { memory: b } : {}
|
|
767
|
-
}) :
|
|
787
|
+
}) : Et({
|
|
768
788
|
accountId: e,
|
|
769
789
|
accountModule: s,
|
|
770
790
|
beUrl: t,
|
|
@@ -785,10 +805,10 @@ function Ti({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
|
|
|
785
805
|
} catch {
|
|
786
806
|
}
|
|
787
807
|
}
|
|
788
|
-
},
|
|
789
|
-
w.signal.aborted || (w.abort(), l?.removeEventListener("abort",
|
|
808
|
+
}, T = () => {
|
|
809
|
+
w.signal.aborted || (w.abort(), l?.removeEventListener("abort", T), delete u.streamTransport, h?.worker.terminate(), h?.cleanup(), v(), delete u.agentController);
|
|
790
810
|
};
|
|
791
|
-
l?.addEventListener("abort",
|
|
811
|
+
l?.addEventListener("abort", T, { once: !0 });
|
|
792
812
|
const x = {
|
|
793
813
|
type: "agent",
|
|
794
814
|
signal: w.signal,
|
|
@@ -801,7 +821,7 @@ function Ti({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
|
|
|
801
821
|
k.push(C);
|
|
802
822
|
}
|
|
803
823
|
},
|
|
804
|
-
stop:
|
|
824
|
+
stop: T,
|
|
805
825
|
diagnostics() {
|
|
806
826
|
return {
|
|
807
827
|
accountId: e,
|
|
@@ -816,13 +836,13 @@ function Ti({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenB
|
|
|
816
836
|
};
|
|
817
837
|
return u.agentController = x, x;
|
|
818
838
|
}
|
|
819
|
-
function
|
|
839
|
+
function Ze(e) {
|
|
820
840
|
const t = new URL(e, window.location.href);
|
|
821
841
|
return t.origin === window.location.origin || t.protocol === "blob:";
|
|
822
842
|
}
|
|
823
|
-
function
|
|
843
|
+
function ir(e, t, r = {}) {
|
|
824
844
|
const n = new URL(e, window.location.href);
|
|
825
|
-
if (
|
|
845
|
+
if (Ze(e)) return {
|
|
826
846
|
worker: new Worker(n.href, {
|
|
827
847
|
type: "module",
|
|
828
848
|
name: t
|
|
@@ -847,16 +867,16 @@ function rr(e, t, r = {}) {
|
|
|
847
867
|
throw URL.revokeObjectURL(i), a;
|
|
848
868
|
}
|
|
849
869
|
}
|
|
850
|
-
function
|
|
870
|
+
function ar(e, t, r = "v1") {
|
|
851
871
|
return `endpoint:${r}:${ue({
|
|
852
872
|
endpoint: e,
|
|
853
873
|
request: t
|
|
854
874
|
})}`;
|
|
855
875
|
}
|
|
856
|
-
function
|
|
876
|
+
function Ni(e) {
|
|
857
877
|
const t = e.version || "v1", r = (n) => (o) => ({
|
|
858
878
|
partition: `${e.partitionPrefix}/${n}`,
|
|
859
|
-
key:
|
|
879
|
+
key: ar(n, o, t),
|
|
860
880
|
...e.ttlMs ? { ttlMs: e.ttlMs } : {}
|
|
861
881
|
});
|
|
862
882
|
return {
|
|
@@ -865,10 +885,10 @@ function Ei(e) {
|
|
|
865
885
|
product_groupings: r("product_groupings")
|
|
866
886
|
};
|
|
867
887
|
}
|
|
868
|
-
function
|
|
888
|
+
function Ii(e) {
|
|
869
889
|
return { ...e };
|
|
870
890
|
}
|
|
871
|
-
function
|
|
891
|
+
function Ui(e, t = {}) {
|
|
872
892
|
return new Response(e.map((r) => JSON.stringify(r)).join(`
|
|
873
893
|
`) + `
|
|
874
894
|
`, {
|
|
@@ -879,7 +899,7 @@ function Ai(e, t = {}) {
|
|
|
879
899
|
}
|
|
880
900
|
});
|
|
881
901
|
}
|
|
882
|
-
function
|
|
902
|
+
function qi(e, t = {}) {
|
|
883
903
|
return new Response(JSON.stringify(e), {
|
|
884
904
|
...t,
|
|
885
905
|
headers: {
|
|
@@ -888,23 +908,23 @@ function Li(e, t = {}) {
|
|
|
888
908
|
}
|
|
889
909
|
});
|
|
890
910
|
}
|
|
891
|
-
function
|
|
911
|
+
function sr(e) {
|
|
892
912
|
const t = (e?.chat || e?._chat)?.root || e?._chat?.root;
|
|
893
913
|
return t ? t.getRootNode?.()?.host || t : Array.from(document.querySelectorAll("*")).find((r) => r.shadowRoot?.querySelector?.(".gengage-chat-root, .gengage-chat-launcher-container"));
|
|
894
914
|
}
|
|
895
|
-
function
|
|
896
|
-
const r =
|
|
915
|
+
function Bi(e, t) {
|
|
916
|
+
const r = sr(e);
|
|
897
917
|
r?.style && (t ? r.style.removeProperty("display") : r.style.setProperty("display", "none", "important")), t || (e?.chat || e?._chat)?.close?.();
|
|
898
918
|
}
|
|
899
|
-
var
|
|
900
|
-
function
|
|
901
|
-
const r =
|
|
919
|
+
var cr = "nd_be_url";
|
|
920
|
+
function Oi(e, t) {
|
|
921
|
+
const r = lr() || e.beUrl || t;
|
|
902
922
|
if (!r) throw new Error("resolveBeUrl: backend URL is required. The injector must supply a fallback URL; the SDK has no default.");
|
|
903
923
|
return r;
|
|
904
924
|
}
|
|
905
|
-
function
|
|
925
|
+
function lr() {
|
|
906
926
|
try {
|
|
907
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
927
|
+
const e = new URLSearchParams(window.location.search).get(cr)?.trim();
|
|
908
928
|
if (!e) return null;
|
|
909
929
|
const t = new URL(e);
|
|
910
930
|
return t.protocol !== "https:" && t.protocol !== "http:" ? null : t.toString().replace(/\/+$/u, "");
|
|
@@ -912,7 +932,7 @@ function ar() {
|
|
|
912
932
|
return null;
|
|
913
933
|
}
|
|
914
934
|
}
|
|
915
|
-
var
|
|
935
|
+
var ur = [
|
|
916
936
|
"addToCart",
|
|
917
937
|
"search",
|
|
918
938
|
"searchKeyword",
|
|
@@ -920,17 +940,17 @@ var sr = [
|
|
|
920
940
|
"searchGiftOptions",
|
|
921
941
|
"similaritySearch"
|
|
922
942
|
];
|
|
923
|
-
function
|
|
943
|
+
function $i(e, t, r = {}) {
|
|
924
944
|
const n = window, o = n.gengage || (n.gengage = {}), i = o.tools || (o.tools = {});
|
|
925
945
|
i[e] = t;
|
|
926
946
|
for (const a of r.accountAliases || []) i[a] = t;
|
|
927
|
-
if (r.exposeStandardAliases !== !1) for (const a of r.standardAliases ||
|
|
947
|
+
if (r.exposeStandardAliases !== !1) for (const a of r.standardAliases || ur) {
|
|
928
948
|
const s = t[a];
|
|
929
949
|
typeof s == "function" && (i[a] = i[a] || s);
|
|
930
950
|
}
|
|
931
951
|
return t;
|
|
932
952
|
}
|
|
933
|
-
function
|
|
953
|
+
function Mi({ getPageType: e, getProduct: t }) {
|
|
934
954
|
return () => ({
|
|
935
955
|
url: window.location.href,
|
|
936
956
|
title: document.title,
|
|
@@ -938,7 +958,7 @@ function Ii({ getPageType: e, getProduct: t }) {
|
|
|
938
958
|
product: t()
|
|
939
959
|
});
|
|
940
960
|
}
|
|
941
|
-
function
|
|
961
|
+
function Fi({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: i }) {
|
|
942
962
|
return async () => ({
|
|
943
963
|
accountId: e,
|
|
944
964
|
url: window.location.href,
|
|
@@ -950,7 +970,7 @@ function Ui({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getS
|
|
|
950
970
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
951
971
|
});
|
|
952
972
|
}
|
|
953
|
-
function
|
|
973
|
+
function Di({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "start", globalBaseUrlKey: n, errorLabel: o, trustedRuntimeOrigins: i } = {}) {
|
|
954
974
|
if (!e) throw new Error("accountId is required.");
|
|
955
975
|
const a = o || e, s = window, c = () => {
|
|
956
976
|
const l = s.GengageInjectorConfig || {}, p = l[e] || {};
|
|
@@ -967,8 +987,8 @@ function qi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
|
|
|
967
987
|
}, f = (l) => {
|
|
968
988
|
if (i === !0) return l;
|
|
969
989
|
const p = new URL(l, window.location.href).origin, g = /* @__PURE__ */ new Set([window.location.origin]), u = c();
|
|
970
|
-
|
|
971
|
-
for (const h of i || [])
|
|
990
|
+
F(g, document.currentScript?.getAttribute("src")), F(g, u.assetBaseUrl), F(g, u.baseUrl), F(g, n ? s[n] : void 0);
|
|
991
|
+
for (const h of i || []) F(g, h);
|
|
972
992
|
if (!g.has(p)) throw new Error(`${a} runtime origin ${p} is not trusted.`);
|
|
973
993
|
return l;
|
|
974
994
|
}, b = s.GengageAssistantInjector || (s.GengageAssistantInjector = {}), m = b[e] || (b[e] = {});
|
|
@@ -983,7 +1003,7 @@ function qi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
|
|
|
983
1003
|
throw delete m.loaderPromise, console.error(`[Gengage][${e}] runtime load failed`, l), l;
|
|
984
1004
|
})), m.loaderPromise;
|
|
985
1005
|
}
|
|
986
|
-
function
|
|
1006
|
+
function F(e, t) {
|
|
987
1007
|
if (t)
|
|
988
1008
|
try {
|
|
989
1009
|
const r = new URL(t, window.location.href);
|
|
@@ -992,8 +1012,8 @@ function B(e, t) {
|
|
|
992
1012
|
e.add(t);
|
|
993
1013
|
}
|
|
994
1014
|
}
|
|
995
|
-
var
|
|
996
|
-
function
|
|
1015
|
+
var dr = 500, Ae = "__GENGAGE_AGENTIC_ACTIVITY__";
|
|
1016
|
+
function fr({ accountId: e, clock: t = () => Date.now() } = {}) {
|
|
997
1017
|
const r = /* @__PURE__ */ new Set();
|
|
998
1018
|
let n = 1;
|
|
999
1019
|
const o = {
|
|
@@ -1001,13 +1021,13 @@ function lr({ accountId: e, clock: t = () => Date.now() } = {}) {
|
|
|
1001
1021
|
entries: []
|
|
1002
1022
|
};
|
|
1003
1023
|
function i(a) {
|
|
1004
|
-
const s =
|
|
1024
|
+
const s = mr({
|
|
1005
1025
|
id: n++,
|
|
1006
1026
|
at: t(),
|
|
1007
1027
|
accountId: e,
|
|
1008
1028
|
...a
|
|
1009
1029
|
});
|
|
1010
|
-
o.entries.push(s), o.entries.length >
|
|
1030
|
+
o.entries.push(s), o.entries.length > dr && (o.entries = o.entries.slice(-500));
|
|
1011
1031
|
for (const c of r) c(s, o.entries);
|
|
1012
1032
|
return s;
|
|
1013
1033
|
}
|
|
@@ -1027,37 +1047,37 @@ function lr({ accountId: e, clock: t = () => Date.now() } = {}) {
|
|
|
1027
1047
|
}
|
|
1028
1048
|
};
|
|
1029
1049
|
}
|
|
1030
|
-
function
|
|
1050
|
+
function pr(e) {
|
|
1031
1051
|
const t = window[Ae];
|
|
1032
1052
|
if (t?.accountId === e && typeof t.record == "function") return t;
|
|
1033
|
-
const r =
|
|
1053
|
+
const r = fr({ accountId: e });
|
|
1034
1054
|
return window[Ae] = r, r;
|
|
1035
1055
|
}
|
|
1036
|
-
function
|
|
1037
|
-
const t = String(e.kind || e.type || "activity"), r =
|
|
1056
|
+
function mr(e) {
|
|
1057
|
+
const t = String(e.kind || e.type || "activity"), r = gr(t);
|
|
1038
1058
|
return {
|
|
1039
1059
|
...e,
|
|
1040
1060
|
kind: t,
|
|
1041
1061
|
section: r,
|
|
1042
|
-
severity: e.severity ||
|
|
1062
|
+
severity: e.severity || hr({
|
|
1043
1063
|
...e,
|
|
1044
1064
|
kind: t
|
|
1045
1065
|
}),
|
|
1046
|
-
group: e.group ||
|
|
1066
|
+
group: e.group || br({
|
|
1047
1067
|
...e,
|
|
1048
1068
|
kind: t,
|
|
1049
1069
|
section: r
|
|
1050
1070
|
})
|
|
1051
1071
|
};
|
|
1052
1072
|
}
|
|
1053
|
-
function
|
|
1073
|
+
function gr(e) {
|
|
1054
1074
|
return e.startsWith("flow/") ? "Flow" : e.startsWith("intent/") ? "Intent" : e.startsWith("be/") ? "Backend" : e.startsWith("tool/") ? "Tools" : e === "beacon" ? "Telemetry" : "Runtime";
|
|
1055
1075
|
}
|
|
1056
|
-
function
|
|
1076
|
+
function hr(e) {
|
|
1057
1077
|
const t = String(e?.kind || "");
|
|
1058
1078
|
return /\/(?:error|rejected|thrown)$/u.test(t) || e?.error || t === "be/response" && Number(e?.status) >= 400 ? "error" : t === "flow/metadata" && /fallback|retry|missing|empty/iu.test(String(e?.event?.phase || e?.event?.type || "")) || t === "be/response" && Number(e?.status) >= 300 ? "warn" : "info";
|
|
1059
1079
|
}
|
|
1060
|
-
function
|
|
1080
|
+
function br(e) {
|
|
1061
1081
|
const t = String(e?.kind || "");
|
|
1062
1082
|
if (t.startsWith("tool/")) return e?.tool ? `Tool: ${e.tool}` : "Tools";
|
|
1063
1083
|
if (t.startsWith("be/")) return e?.op ? `BE: ${e.op}` : "Backend";
|
|
@@ -1071,8 +1091,8 @@ function mr(e) {
|
|
|
1071
1091
|
}
|
|
1072
1092
|
return t === "flow/ui" ? e?.widget ? `UI: ${e.widget}` : "UI" : t.startsWith("flow/") ? "Flow lifecycle" : t.startsWith("intent/") ? e?.intent?.kind ? `Intent: ${e.intent.kind}` : "Intent" : t === "beacon" ? e?.payload?.type ? `Beacon: ${e.payload.type}` : "Beacon" : e?.section || "Runtime";
|
|
1073
1093
|
}
|
|
1074
|
-
var
|
|
1075
|
-
function
|
|
1094
|
+
var yr = 8, fe = 120;
|
|
1095
|
+
function wr(e = []) {
|
|
1076
1096
|
const t = Array.isArray(e) ? e : [], r = {
|
|
1077
1097
|
status: "idle",
|
|
1078
1098
|
sessionId: "",
|
|
@@ -1098,7 +1118,7 @@ function hr(e = []) {
|
|
|
1098
1118
|
ui: null,
|
|
1099
1119
|
lastText: ""
|
|
1100
1120
|
};
|
|
1101
|
-
for (const o of t)
|
|
1121
|
+
for (const o of t) vr(r, n, o);
|
|
1102
1122
|
return r.tools = te(r.tools).slice(-8), r.beOps = te(r.beOps).slice(-8), r.uiSurfaces = te(r.uiSurfaces).slice(-8), r.timeline = r.timeline.slice(-36), !r.lastAt && t.length && (r.lastAt = t.at(-1)?.at || null), {
|
|
1103
1123
|
flow: r,
|
|
1104
1124
|
context: n
|
|
@@ -1106,13 +1126,13 @@ function hr(e = []) {
|
|
|
1106
1126
|
}
|
|
1107
1127
|
function Y(e, t = "") {
|
|
1108
1128
|
if (!e || typeof e != "object") return null;
|
|
1109
|
-
const r =
|
|
1129
|
+
const r = S({
|
|
1110
1130
|
source: t,
|
|
1111
1131
|
panel: ae(e.panel || e.panel_state),
|
|
1112
|
-
threadExtensions:
|
|
1113
|
-
pageProduct:
|
|
1114
|
-
products:
|
|
1115
|
-
ui:
|
|
1132
|
+
threadExtensions: Rr(e.thread?.extensions || e.threadExtensions || e.extensions),
|
|
1133
|
+
pageProduct: Ir(e.product || e.page?.product),
|
|
1134
|
+
products: I(e.products || e.last_search_products || e.items),
|
|
1135
|
+
ui: Qe(e.spec),
|
|
1116
1136
|
intent: pe(e.intent),
|
|
1117
1137
|
route: Q({
|
|
1118
1138
|
searchParams: e.searchParams || e.search_params,
|
|
@@ -1123,24 +1143,24 @@ function Y(e, t = "") {
|
|
|
1123
1143
|
}
|
|
1124
1144
|
function ae(e) {
|
|
1125
1145
|
if (!e || typeof e != "object") return null;
|
|
1126
|
-
const t =
|
|
1127
|
-
return
|
|
1146
|
+
const t = I(e.last_search_products || e.current_panel_products), r = q(e.screen_sku_list || e.search_suggestions_skus);
|
|
1147
|
+
return S({
|
|
1128
1148
|
source: e.list_source || e.source,
|
|
1129
1149
|
screenType: y(e.screen_type || e.screen),
|
|
1130
1150
|
screenSummary: y(e.screen_summary || e.ai_plist_summary),
|
|
1131
1151
|
screenSkus: r,
|
|
1132
1152
|
chatMentionedSkus: q(e.chat_mentioned_skus),
|
|
1133
|
-
lastSearch:
|
|
1153
|
+
lastSearch: Pr(e.last_search),
|
|
1134
1154
|
productCount: t?.count ?? me(e.current_panel_product_count),
|
|
1135
1155
|
productSkus: t?.skus
|
|
1136
1156
|
});
|
|
1137
1157
|
}
|
|
1138
|
-
function
|
|
1158
|
+
function Qe(e, t = "", r = "") {
|
|
1139
1159
|
if (!e || typeof e != "object") return null;
|
|
1140
|
-
const n =
|
|
1160
|
+
const n = Ur(e);
|
|
1141
1161
|
if (!n) return null;
|
|
1142
|
-
const o = n.props || {}, i =
|
|
1143
|
-
return
|
|
1162
|
+
const o = n.props || {}, i = Lr(e, n, o), a = Array.isArray(o.buttons) ? o.buttons : Array.isArray(o.actions) ? o.actions : [], s = Array.isArray(o.rows) ? o.rows.length : Array.isArray(o.comparison_table) ? o.comparison_table.length : void 0;
|
|
1163
|
+
return S({
|
|
1144
1164
|
widget: t,
|
|
1145
1165
|
panelHint: r,
|
|
1146
1166
|
rootType: n.type,
|
|
@@ -1151,80 +1171,87 @@ function Ye(e, t = "", r = "") {
|
|
|
1151
1171
|
comparisonRows: s
|
|
1152
1172
|
});
|
|
1153
1173
|
}
|
|
1154
|
-
function
|
|
1174
|
+
function vr(e, t, r = {}) {
|
|
1155
1175
|
if (!(!r || typeof r != "object"))
|
|
1156
1176
|
switch (e.lastAt = r.at || e.lastAt, r.severity === "error" && (e.errors += 1), r.severity === "warn" && (e.warnings += 1), r.state && Z(t, r.state), r.kind) {
|
|
1157
1177
|
case "flow/request":
|
|
1158
|
-
|
|
1178
|
+
xr(e, t, r);
|
|
1159
1179
|
break;
|
|
1160
1180
|
case "flow/metadata":
|
|
1161
|
-
|
|
1181
|
+
kr(e, t, r);
|
|
1182
|
+
break;
|
|
1183
|
+
case "flow/trace":
|
|
1184
|
+
Er(e, r);
|
|
1162
1185
|
break;
|
|
1163
1186
|
case "flow/ui":
|
|
1164
|
-
|
|
1187
|
+
_r(e, t, r);
|
|
1165
1188
|
break;
|
|
1166
1189
|
case "flow/text-final":
|
|
1167
|
-
t.lastText = y(r.content, fe),
|
|
1190
|
+
t.lastText = y(r.content, fe), E(e, r, "Text", t.lastText, "done");
|
|
1168
1191
|
break;
|
|
1169
1192
|
case "flow/done":
|
|
1170
|
-
e.status = e.status === "error" ? "error" : "done", e.current = "Done",
|
|
1193
|
+
e.status = e.status === "error" ? "error" : "done", e.current = "Done", E(e, r, "Done", "Flow completed", "done");
|
|
1171
1194
|
break;
|
|
1172
1195
|
case "flow/error":
|
|
1173
1196
|
case "flow/rejected":
|
|
1174
1197
|
case "flow/thrown":
|
|
1175
|
-
e.status = "error", e.current = "Flow error",
|
|
1198
|
+
e.status = "error", e.current = "Flow error", E(e, r, "Error", y(r.error || r.kind), "error");
|
|
1176
1199
|
break;
|
|
1177
1200
|
case "tool/start":
|
|
1178
|
-
e.status = e.status === "idle" ? "running" : e.status, e.current = `Tool: ${r.tool || "tool"}`, e.tools.push(r.tool || "tool"),
|
|
1201
|
+
e.status = e.status === "idle" ? "running" : e.status, e.current = `Tool: ${r.tool || "tool"}`, e.tools.push(r.tool || "tool"), E(e, r, "Tool", r.tool || "tool", "running");
|
|
1179
1202
|
break;
|
|
1180
1203
|
case "tool/done":
|
|
1181
|
-
e.tools.push(r.tool || "tool"),
|
|
1204
|
+
e.tools.push(r.tool || "tool"), E(e, r, "Tool", r.tool || "tool", "done");
|
|
1182
1205
|
break;
|
|
1183
1206
|
case "tool/error":
|
|
1184
|
-
e.status = "error", e.current = `Tool error: ${r.tool || "tool"}`, e.tools.push(r.tool || "tool"),
|
|
1207
|
+
e.status = "error", e.current = `Tool error: ${r.tool || "tool"}`, e.tools.push(r.tool || "tool"), E(e, r, "Tool", r.tool || "tool", "error");
|
|
1185
1208
|
break;
|
|
1186
1209
|
case "be/request":
|
|
1187
|
-
e.status = e.status === "idle" ? "running" : e.status, e.current = `BE: ${r.op || "request"}`, e.beOps.push(r.op || "unknown"),
|
|
1210
|
+
e.status = e.status === "idle" ? "running" : e.status, e.current = `BE: ${r.op || "request"}`, e.beOps.push(r.op || "unknown"), Sr(t, r), E(e, r, "BE", r.op || "request", "running");
|
|
1188
1211
|
break;
|
|
1189
1212
|
case "be/response":
|
|
1190
|
-
e.beOps.push(r.op || r.result?.op || "unknown"),
|
|
1213
|
+
e.beOps.push(r.op || r.result?.op || "unknown"), Tr(t, r.result), E(e, r, "BE", r.op || r.result?.intent?.kind || "response", r.severity || "done");
|
|
1191
1214
|
break;
|
|
1192
1215
|
case "intent/selected":
|
|
1193
1216
|
t.intent = pe(r.intent), t.route = Q({
|
|
1194
1217
|
searchParams: r.searchParams,
|
|
1195
1218
|
flowParams: r.flowParams
|
|
1196
|
-
}), e.current = `Intent: ${t.intent?.kind || "selected"}`,
|
|
1219
|
+
}), e.current = `Intent: ${t.intent?.kind || "selected"}`, E(e, r, "Intent", t.intent?.kind || "selected", "done");
|
|
1197
1220
|
break;
|
|
1198
1221
|
default:
|
|
1199
|
-
r.kind?.startsWith?.("runtime/") &&
|
|
1222
|
+
r.kind?.startsWith?.("runtime/") && E(e, r, "Runtime", r.title || r.kind, "done");
|
|
1200
1223
|
break;
|
|
1201
1224
|
}
|
|
1202
1225
|
}
|
|
1203
|
-
function
|
|
1226
|
+
function xr(e, t, r) {
|
|
1204
1227
|
const n = r.request || {};
|
|
1205
|
-
e.status = "running", e.startedAt = r.at || e.startedAt, e.sessionId = y(n.session_id || n.sessionId || e.sessionId), e.requestType = y(n.type || e.requestType), e.actionType = y(n.action?.type || n.payload?.type || e.actionType), e.current = e.actionType || e.requestType || "Flow request", Z(t, Y(n.context || {}, "request.context")),
|
|
1228
|
+
e.status = "running", e.startedAt = r.at || e.startedAt, e.sessionId = y(n.session_id || n.sessionId || e.sessionId), e.requestType = y(n.type || e.requestType), e.actionType = y(n.action?.type || n.payload?.type || e.actionType), e.current = e.actionType || e.requestType || "Flow request", Z(t, Y(n.context || {}, "request.context")), E(e, r, "Request", [e.requestType, e.actionType].filter(Boolean).join(" / ") || "request", "running");
|
|
1206
1229
|
}
|
|
1207
|
-
function
|
|
1230
|
+
function kr(e, t, r) {
|
|
1208
1231
|
const n = r.event || {};
|
|
1209
|
-
e.sessionId = y(n.sessionId || n.session_id || e.sessionId), e.model = y(n.model || e.model), n.panelLoading === !0 && (e.current = "Panel loading"), Z(t, Y(n, "flow.metadata")),
|
|
1232
|
+
e.sessionId = y(n.sessionId || n.session_id || e.sessionId), e.model = y(n.model || e.model), n.panelLoading === !0 && (e.current = "Panel loading"), Z(t, Y(n, "flow.metadata")), E(e, r, "Metadata", y(n.name || n.phase || n.type || "metadata"), r.severity);
|
|
1210
1233
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const n =
|
|
1213
|
-
n && (t.ui = n, t.products =
|
|
1234
|
+
function _r(e, t, r) {
|
|
1235
|
+
const n = Qe(r.spec, r.widget, r.panelHint);
|
|
1236
|
+
n && (t.ui = n, typeof n.productCount == "number" && (t.products = {
|
|
1214
1237
|
count: n.productCount,
|
|
1215
1238
|
skus: n.productSkus || []
|
|
1216
|
-
}
|
|
1239
|
+
}), e.uiSurfaces.push(n.rootType), e.current = `UI: ${n.rootType}`, E(e, r, "UI", n.rootType || "ui", "done"));
|
|
1217
1240
|
}
|
|
1218
|
-
function
|
|
1241
|
+
function Er(e, t) {
|
|
1242
|
+
const r = t.event || {}, n = y(r.type || "trace"), o = y(r.stepName || r.stepKind || "");
|
|
1243
|
+
e.sessionId = y(r.sessionId || e.sessionId), e.current = o ? `${n}: ${o}` : n, E(e, t, "Trace", [n, o].filter(Boolean).join(" / ") || "trace", qr(n));
|
|
1244
|
+
}
|
|
1245
|
+
function Sr(e, t) {
|
|
1219
1246
|
const r = t.params || {};
|
|
1220
|
-
Z(e, Y(r, "be.params")), r.panel_state && (e.panel = ae(r.panel_state)), r.structured_context && (e.panel =
|
|
1247
|
+
Z(e, Y(r, "be.params")), r.panel_state && (e.panel = ae(r.panel_state)), r.structured_context && (e.panel = Xe(e.panel, ae(r.structured_context)));
|
|
1221
1248
|
const n = Q({
|
|
1222
1249
|
searchParams: r.search_params,
|
|
1223
1250
|
flowParams: r.flow_params
|
|
1224
1251
|
});
|
|
1225
1252
|
n && (e.route = n);
|
|
1226
1253
|
}
|
|
1227
|
-
function
|
|
1254
|
+
function Tr(e, t) {
|
|
1228
1255
|
if (!t || typeof t != "object") return;
|
|
1229
1256
|
t.intent && (e.intent = pe(t.intent));
|
|
1230
1257
|
const r = Q({
|
|
@@ -1234,19 +1261,19 @@ function kr(e, t) {
|
|
|
1234
1261
|
r && (e.route = r);
|
|
1235
1262
|
}
|
|
1236
1263
|
function Z(e, t) {
|
|
1237
|
-
!t || typeof t != "object" || (t.panel && (e.panel =
|
|
1264
|
+
!t || typeof t != "object" || (t.panel && (e.panel = Xe(e.panel, t.panel)), t.threadExtensions && (e.threadExtensions = {
|
|
1238
1265
|
...e.threadExtensions,
|
|
1239
1266
|
...t.threadExtensions
|
|
1240
1267
|
}), t.pageProduct && (e.pageProduct = t.pageProduct), t.products && (e.products = t.products), t.ui && (e.ui = t.ui), t.intent && (e.intent = t.intent), t.route && (e.route = t.route));
|
|
1241
1268
|
}
|
|
1242
|
-
function
|
|
1243
|
-
return e ? t ?
|
|
1269
|
+
function Xe(e, t) {
|
|
1270
|
+
return e ? t ? S({
|
|
1244
1271
|
...e,
|
|
1245
1272
|
...t
|
|
1246
1273
|
}) : e : t || null;
|
|
1247
1274
|
}
|
|
1248
|
-
function
|
|
1249
|
-
e.timeline.push(
|
|
1275
|
+
function E(e, t, r, n, o = "done") {
|
|
1276
|
+
e.timeline.push(S({
|
|
1250
1277
|
id: t.id,
|
|
1251
1278
|
at: t.at,
|
|
1252
1279
|
label: r,
|
|
@@ -1256,21 +1283,21 @@ function _(e, t, r, n, o = "done") {
|
|
|
1256
1283
|
}));
|
|
1257
1284
|
}
|
|
1258
1285
|
function pe(e) {
|
|
1259
|
-
return !e || typeof e != "object" ? null :
|
|
1286
|
+
return !e || typeof e != "object" ? null : S({
|
|
1260
1287
|
kind: y(e.kind || e.intent || e.type),
|
|
1261
1288
|
target: y(e.target),
|
|
1262
1289
|
confidence: typeof e.confidence == "number" ? Math.round(e.confidence * 100) / 100 : void 0
|
|
1263
1290
|
});
|
|
1264
1291
|
}
|
|
1265
1292
|
function Q({ searchParams: e, flowParams: t } = {}) {
|
|
1266
|
-
const r =
|
|
1267
|
-
search:
|
|
1268
|
-
flow:
|
|
1293
|
+
const r = S({
|
|
1294
|
+
search: Cr(e),
|
|
1295
|
+
flow: Ar(t)
|
|
1269
1296
|
});
|
|
1270
1297
|
return Object.keys(r).length ? r : null;
|
|
1271
1298
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return !e || typeof e != "object" ? null :
|
|
1299
|
+
function Cr(e) {
|
|
1300
|
+
return !e || typeof e != "object" ? null : S({
|
|
1274
1301
|
query: y(e.query || e.search_query),
|
|
1275
1302
|
category: y(e.category || e.category_name || e.categoryName),
|
|
1276
1303
|
categoryId: y(e.categoryId || e.category_id),
|
|
@@ -1278,54 +1305,69 @@ function Sr(e) {
|
|
|
1278
1305
|
facets: Array.isArray(e.facets) ? e.facets.length : void 0
|
|
1279
1306
|
});
|
|
1280
1307
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return !e || typeof e != "object" ? null :
|
|
1308
|
+
function Ar(e) {
|
|
1309
|
+
return !e || typeof e != "object" ? null : S({
|
|
1283
1310
|
target: y(e.target),
|
|
1284
1311
|
sku: y(e.sku || e.product_sku),
|
|
1285
1312
|
skus: q(e.skus || e.sku_list),
|
|
1286
1313
|
action: y(e.action || e.action_type)
|
|
1287
1314
|
});
|
|
1288
1315
|
}
|
|
1289
|
-
function
|
|
1316
|
+
function Rr(e) {
|
|
1290
1317
|
if (!e || typeof e != "object") return {};
|
|
1291
1318
|
const t = {};
|
|
1292
1319
|
for (const [r, n] of Object.entries(e))
|
|
1293
|
-
n != null && (t[r] = n && typeof n == "object" ?
|
|
1320
|
+
n != null && (t[r] = n && typeof n == "object" ? S({
|
|
1294
1321
|
keys: Object.keys(n).slice(0, 8),
|
|
1295
1322
|
summary: y(n.summary || n.occasion || n.target_date_iso || n.type)
|
|
1296
1323
|
}) : y(n));
|
|
1297
1324
|
return t;
|
|
1298
1325
|
}
|
|
1299
|
-
function
|
|
1300
|
-
return !e || typeof e != "object" ? null :
|
|
1326
|
+
function Pr(e) {
|
|
1327
|
+
return !e || typeof e != "object" ? null : S({
|
|
1301
1328
|
query: y(e.query),
|
|
1302
1329
|
source: y(e.source),
|
|
1303
1330
|
category: y(e.category || e.category_name),
|
|
1304
1331
|
count: me(e.count)
|
|
1305
1332
|
});
|
|
1306
1333
|
}
|
|
1307
|
-
function
|
|
1334
|
+
function I(e) {
|
|
1308
1335
|
if (!Array.isArray(e)) return null;
|
|
1309
1336
|
const t = e.filter(Boolean);
|
|
1310
|
-
return
|
|
1337
|
+
return S({
|
|
1311
1338
|
count: t.length,
|
|
1312
1339
|
skus: q(t.map((r) => r?.sku || r?.code || r?.id)),
|
|
1313
1340
|
names: q(t.map((r) => r?.name || r?.title), 4)
|
|
1314
1341
|
});
|
|
1315
1342
|
}
|
|
1316
|
-
function
|
|
1317
|
-
|
|
1343
|
+
function Lr(e, t, r) {
|
|
1344
|
+
if (t.type === "ProductDetailsPanel") return I([r.product || r.item].filter(Boolean));
|
|
1345
|
+
if (t.type === "ProductGrid") {
|
|
1346
|
+
const n = jr(r.products, r.items, r.cards);
|
|
1347
|
+
return I(n || Nr(e, t));
|
|
1348
|
+
}
|
|
1349
|
+
return I(r.products || r.items || r.cards);
|
|
1350
|
+
}
|
|
1351
|
+
function jr(...e) {
|
|
1352
|
+
return e.find((t) => Array.isArray(t)) || null;
|
|
1353
|
+
}
|
|
1354
|
+
function Nr(e, t) {
|
|
1355
|
+
const r = e.elements || {};
|
|
1356
|
+
return (Array.isArray(t.children) ? t.children : []).map((n) => r[n]).filter((n) => n?.type === "ProductCard").map((n) => n.props?.product || n.props?.item || n.props).filter(Boolean);
|
|
1357
|
+
}
|
|
1358
|
+
function Ir(e) {
|
|
1359
|
+
return !e || typeof e != "object" ? null : S({
|
|
1318
1360
|
sku: y(e.sku || e.code || e.id),
|
|
1319
1361
|
name: y(e.name || e.title),
|
|
1320
1362
|
category: y(e.category),
|
|
1321
1363
|
url: y(e.url)
|
|
1322
1364
|
});
|
|
1323
1365
|
}
|
|
1324
|
-
function
|
|
1366
|
+
function Ur(e) {
|
|
1325
1367
|
const t = e.elements || {};
|
|
1326
1368
|
return t[e.root || "root"] || t.root || e.rootElement || null;
|
|
1327
1369
|
}
|
|
1328
|
-
function q(e, t =
|
|
1370
|
+
function q(e, t = yr) {
|
|
1329
1371
|
if (!Array.isArray(e)) return;
|
|
1330
1372
|
const r = e.map((n) => y(n)).filter(Boolean);
|
|
1331
1373
|
return r.length ? r.slice(0, t) : void 0;
|
|
@@ -1336,14 +1378,17 @@ function te(e) {
|
|
|
1336
1378
|
function me(e) {
|
|
1337
1379
|
return Number.isFinite(Number(e)) ? Number(e) : void 0;
|
|
1338
1380
|
}
|
|
1381
|
+
function qr(e) {
|
|
1382
|
+
return /error$/u.test(e) ? "error" : /start$/u.test(e) ? "running" : "done";
|
|
1383
|
+
}
|
|
1339
1384
|
function y(e, t = fe) {
|
|
1340
1385
|
const r = String(e ?? "").replace(/\s+/gu, " ").trim();
|
|
1341
1386
|
return r.length > t ? `${r.slice(0, t - 1)}...` : r;
|
|
1342
1387
|
}
|
|
1343
|
-
function
|
|
1388
|
+
function S(e) {
|
|
1344
1389
|
return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t == null || t === "" ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "object" ? Object.keys(t).length > 0 : !0));
|
|
1345
1390
|
}
|
|
1346
|
-
function
|
|
1391
|
+
function Br(e, t) {
|
|
1347
1392
|
if (!e || typeof e != "object" || !t) return e;
|
|
1348
1393
|
const r = { ...e };
|
|
1349
1394
|
for (const [n, o] of Object.entries(e))
|
|
@@ -1359,7 +1404,7 @@ function Lr(e, t) {
|
|
|
1359
1404
|
kind: "tool/done",
|
|
1360
1405
|
tool: n,
|
|
1361
1406
|
params: a,
|
|
1362
|
-
result:
|
|
1407
|
+
result: Yr(c),
|
|
1363
1408
|
state: Y(c, `tool:${n}`)
|
|
1364
1409
|
}), c;
|
|
1365
1410
|
} catch (c) {
|
|
@@ -1367,19 +1412,19 @@ function Lr(e, t) {
|
|
|
1367
1412
|
kind: "tool/error",
|
|
1368
1413
|
tool: n,
|
|
1369
1414
|
params: a,
|
|
1370
|
-
error:
|
|
1415
|
+
error: B(c)
|
|
1371
1416
|
}), c;
|
|
1372
1417
|
}
|
|
1373
1418
|
}, Object.defineProperty(r[n], "__gengageActivityWrapped", { value: !0 }));
|
|
1374
1419
|
return r;
|
|
1375
1420
|
}
|
|
1376
|
-
function
|
|
1421
|
+
function Or(e, t) {
|
|
1377
1422
|
return t ? (r) => (t.record({
|
|
1378
1423
|
kind: "beacon",
|
|
1379
1424
|
payload: r
|
|
1380
1425
|
}), e?.(r)) : e;
|
|
1381
1426
|
}
|
|
1382
|
-
function
|
|
1427
|
+
function $r(e, t) {
|
|
1383
1428
|
if (!t) return !1;
|
|
1384
1429
|
const r = window.GengageAssistantInjector?.[e], n = r?.streamTransport;
|
|
1385
1430
|
if (typeof n != "function" || n.__gengageActivityWrapped) return !1;
|
|
@@ -1389,19 +1434,19 @@ function Pr(e, t) {
|
|
|
1389
1434
|
request: a
|
|
1390
1435
|
});
|
|
1391
1436
|
try {
|
|
1392
|
-
const f = n.call(this, a,
|
|
1437
|
+
const f = n.call(this, a, Fr(s, t), c, d);
|
|
1393
1438
|
return f && typeof f.then == "function" ? f.catch((b) => {
|
|
1394
1439
|
throw t.record({
|
|
1395
1440
|
kind: "flow/rejected",
|
|
1396
1441
|
requestType: a?.type,
|
|
1397
|
-
error:
|
|
1442
|
+
error: B(b)
|
|
1398
1443
|
}), b;
|
|
1399
1444
|
}) : f;
|
|
1400
1445
|
} catch (f) {
|
|
1401
1446
|
throw t.record({
|
|
1402
1447
|
kind: "flow/thrown",
|
|
1403
1448
|
requestType: a?.type,
|
|
1404
|
-
error:
|
|
1449
|
+
error: B(f)
|
|
1405
1450
|
}), f;
|
|
1406
1451
|
}
|
|
1407
1452
|
};
|
|
@@ -1410,12 +1455,12 @@ function Pr(e, t) {
|
|
|
1410
1455
|
title: "streamTransport wrapped"
|
|
1411
1456
|
}), !0;
|
|
1412
1457
|
}
|
|
1413
|
-
function
|
|
1458
|
+
function Mr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
1414
1459
|
if (!t || window.__GENGAGE_ACTIVITY_FETCH_PATCHED__) return;
|
|
1415
1460
|
window.__GENGAGE_ACTIVITY_FETCH_PATCHED__ = !0;
|
|
1416
1461
|
const n = window.fetch?.bind(window);
|
|
1417
1462
|
typeof n == "function" && (window.fetch = async (o, i) => {
|
|
1418
|
-
const a =
|
|
1463
|
+
const a = Wr(o, i), s = Kr(a.url);
|
|
1419
1464
|
let c = "";
|
|
1420
1465
|
s && (c = a.body?.op_name || a.body?.op || "unknown", t.record({
|
|
1421
1466
|
kind: "be/request",
|
|
@@ -1423,7 +1468,7 @@ function jr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
|
1423
1468
|
url: a.url,
|
|
1424
1469
|
op: c,
|
|
1425
1470
|
opDomain: a.body?.op_domain || "",
|
|
1426
|
-
prompt: await
|
|
1471
|
+
prompt: await Dr({
|
|
1427
1472
|
accountId: e,
|
|
1428
1473
|
opName: c,
|
|
1429
1474
|
promptBaseUrl: r
|
|
@@ -1433,7 +1478,7 @@ function jr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
|
1433
1478
|
}));
|
|
1434
1479
|
const d = await n(o, i);
|
|
1435
1480
|
return s && d.clone().text().then((f) => {
|
|
1436
|
-
const b =
|
|
1481
|
+
const b = Jr(f);
|
|
1437
1482
|
t.record({
|
|
1438
1483
|
kind: "be/response",
|
|
1439
1484
|
source: "main-thread-fetch",
|
|
@@ -1442,7 +1487,7 @@ function jr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
|
1442
1487
|
op: c,
|
|
1443
1488
|
result: b,
|
|
1444
1489
|
rawText: f
|
|
1445
|
-
}),
|
|
1490
|
+
}), et(t, b);
|
|
1446
1491
|
}).catch((f) => {
|
|
1447
1492
|
t.record({
|
|
1448
1493
|
kind: "be/response",
|
|
@@ -1450,12 +1495,12 @@ function jr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
|
1450
1495
|
url: a.url,
|
|
1451
1496
|
status: d.status,
|
|
1452
1497
|
op: c,
|
|
1453
|
-
error:
|
|
1498
|
+
error: B(f)
|
|
1454
1499
|
});
|
|
1455
1500
|
}), d;
|
|
1456
1501
|
});
|
|
1457
1502
|
}
|
|
1458
|
-
function
|
|
1503
|
+
function Fr(e, t) {
|
|
1459
1504
|
if (!e || e.__gengageActivityWrapped) return e;
|
|
1460
1505
|
const r = { ...e };
|
|
1461
1506
|
Object.defineProperty(r, "__gengageActivityWrapped", { value: !0 });
|
|
@@ -1485,16 +1530,16 @@ function Ir(e, t) {
|
|
|
1485
1530
|
extra: o[2]
|
|
1486
1531
|
}) : n === "onError" ? t.record({
|
|
1487
1532
|
kind: "flow/error",
|
|
1488
|
-
error:
|
|
1533
|
+
error: B(o[0])
|
|
1489
1534
|
}) : n === "onDone" && t.record({ kind: "flow/done" }), e[n](...o)));
|
|
1490
1535
|
return r;
|
|
1491
1536
|
}
|
|
1492
|
-
function
|
|
1493
|
-
!e || !t || (e.record(t), t.kind === "be/response" &&
|
|
1537
|
+
function Re(e, t) {
|
|
1538
|
+
!e || !t || (e.record(t), t.kind === "be/response" && et(e, t.result));
|
|
1494
1539
|
}
|
|
1495
|
-
async function
|
|
1540
|
+
async function Dr({ accountId: e, opName: t, promptBaseUrl: r }) {
|
|
1496
1541
|
if (!e || !t) return null;
|
|
1497
|
-
const n =
|
|
1542
|
+
const n = Gr({
|
|
1498
1543
|
accountId: e,
|
|
1499
1544
|
baseId: String(e).replace(/-agentic$/u, ""),
|
|
1500
1545
|
promptBaseUrl: r
|
|
@@ -1510,15 +1555,15 @@ async function qr({ accountId: e, opName: t, promptBaseUrl: r }) {
|
|
|
1510
1555
|
error: `HTTP ${i.status}`
|
|
1511
1556
|
};
|
|
1512
1557
|
} catch (o) {
|
|
1513
|
-
return { error:
|
|
1558
|
+
return { error: B(o) };
|
|
1514
1559
|
}
|
|
1515
1560
|
}
|
|
1516
|
-
function
|
|
1561
|
+
function Gr({ accountId: e, baseId: t, promptBaseUrl: r }) {
|
|
1517
1562
|
if (typeof r == "string" && r.trim()) return r;
|
|
1518
|
-
const n =
|
|
1519
|
-
return n ||
|
|
1563
|
+
const n = zr(e, t);
|
|
1564
|
+
return n || Hr(t);
|
|
1520
1565
|
}
|
|
1521
|
-
function
|
|
1566
|
+
function zr(e, t) {
|
|
1522
1567
|
const r = window.__GENGAGE_AGENTIC_PROMPT_BASE_URL__;
|
|
1523
1568
|
if (typeof r == "string" && r.trim()) return r;
|
|
1524
1569
|
if (r && typeof r == "object") {
|
|
@@ -1528,7 +1573,7 @@ function Mr(e, t) {
|
|
|
1528
1573
|
const n = (window.GengageInjectorConfig?.[e] || window.GengageInjectorConfig?.[t])?.agenticActivityPromptBaseUrl;
|
|
1529
1574
|
return typeof n == "string" && n.trim() ? n : null;
|
|
1530
1575
|
}
|
|
1531
|
-
function
|
|
1576
|
+
function Hr(e) {
|
|
1532
1577
|
const t = Array.from(document.scripts || []);
|
|
1533
1578
|
for (const r of t) {
|
|
1534
1579
|
const n = r?.src || "";
|
|
@@ -1537,7 +1582,7 @@ function Fr(e) {
|
|
|
1537
1582
|
}
|
|
1538
1583
|
return null;
|
|
1539
1584
|
}
|
|
1540
|
-
function
|
|
1585
|
+
function et(e, t) {
|
|
1541
1586
|
const r = t?.intent;
|
|
1542
1587
|
r && e.record({
|
|
1543
1588
|
kind: "intent/selected",
|
|
@@ -1546,14 +1591,14 @@ function Qe(e, t) {
|
|
|
1546
1591
|
flowParams: t?.flow_params
|
|
1547
1592
|
});
|
|
1548
1593
|
}
|
|
1549
|
-
function
|
|
1594
|
+
function Wr(e, t) {
|
|
1550
1595
|
const r = typeof e == "string" ? e : e?.url || "", n = t?.body || (typeof e != "string" ? e?.body : null);
|
|
1551
1596
|
return {
|
|
1552
1597
|
url: String(r || ""),
|
|
1553
|
-
body:
|
|
1598
|
+
body: Vr(n)
|
|
1554
1599
|
};
|
|
1555
1600
|
}
|
|
1556
|
-
function
|
|
1601
|
+
function Vr(e) {
|
|
1557
1602
|
if (!e || typeof e != "string") return {};
|
|
1558
1603
|
try {
|
|
1559
1604
|
return JSON.parse(e);
|
|
@@ -1561,7 +1606,7 @@ function Br(e) {
|
|
|
1561
1606
|
return { raw: e };
|
|
1562
1607
|
}
|
|
1563
1608
|
}
|
|
1564
|
-
function
|
|
1609
|
+
function Kr(e) {
|
|
1565
1610
|
try {
|
|
1566
1611
|
const t = new URL(e, window.location.href);
|
|
1567
1612
|
return t.pathname === "/v1/execute" && /agentic\.gengage\.ai$/u.test(t.hostname);
|
|
@@ -1569,7 +1614,7 @@ function $r(e) {
|
|
|
1569
1614
|
return !1;
|
|
1570
1615
|
}
|
|
1571
1616
|
}
|
|
1572
|
-
function
|
|
1617
|
+
function Jr(e) {
|
|
1573
1618
|
const t = {};
|
|
1574
1619
|
for (const r of String(e || "").split(/\r?\n/u)) {
|
|
1575
1620
|
const n = r.trim();
|
|
@@ -1583,7 +1628,7 @@ function Dr(e) {
|
|
|
1583
1628
|
}
|
|
1584
1629
|
return t;
|
|
1585
1630
|
}
|
|
1586
|
-
function
|
|
1631
|
+
function Yr(e) {
|
|
1587
1632
|
if (Array.isArray(e)) return {
|
|
1588
1633
|
type: "array",
|
|
1589
1634
|
length: e.length,
|
|
@@ -1601,32 +1646,32 @@ function zr(e) {
|
|
|
1601
1646
|
} : t[r] = n;
|
|
1602
1647
|
return t;
|
|
1603
1648
|
}
|
|
1604
|
-
function
|
|
1649
|
+
function B(e) {
|
|
1605
1650
|
return e?.message || String(e);
|
|
1606
1651
|
}
|
|
1607
|
-
var
|
|
1652
|
+
var Pe = "gengage-agentic-activity-overlay", G = "all", se = "all", Le = [
|
|
1608
1653
|
"Flow",
|
|
1609
1654
|
"Tools",
|
|
1610
1655
|
"Backend",
|
|
1611
1656
|
"Intent",
|
|
1612
1657
|
"Telemetry",
|
|
1613
1658
|
"Runtime"
|
|
1614
|
-
],
|
|
1659
|
+
], je = [
|
|
1615
1660
|
"info",
|
|
1616
1661
|
"warn",
|
|
1617
1662
|
"error"
|
|
1618
1663
|
];
|
|
1619
|
-
function
|
|
1664
|
+
function Zr(e) {
|
|
1620
1665
|
if (!e || typeof e.subscribe != "function") return null;
|
|
1621
|
-
const t = document.getElementById(
|
|
1666
|
+
const t = document.getElementById(Pe);
|
|
1622
1667
|
if (t?.shadowRoot) return t;
|
|
1623
1668
|
const r = document.createElement("div");
|
|
1624
|
-
r.id =
|
|
1669
|
+
r.id = Pe, r.style.cssText = "position:fixed;left:10px;top:10px;z-index:2147483647;";
|
|
1625
1670
|
const n = r.attachShadow({ mode: "open" });
|
|
1626
|
-
n.innerHTML =
|
|
1671
|
+
n.innerHTML = _n(e.accountId), document.documentElement.appendChild(r);
|
|
1627
1672
|
const o = {
|
|
1628
1673
|
entries: [],
|
|
1629
|
-
section:
|
|
1674
|
+
section: G,
|
|
1630
1675
|
severity: se,
|
|
1631
1676
|
search: "",
|
|
1632
1677
|
grouped: !0,
|
|
@@ -1645,8 +1690,8 @@ function Gr(e) {
|
|
|
1645
1690
|
followToggle: n.querySelector('[data-action="follow"]'),
|
|
1646
1691
|
stateToggle: n.querySelector('[data-action="state"]')
|
|
1647
1692
|
};
|
|
1648
|
-
|
|
1649
|
-
const a = () =>
|
|
1693
|
+
Qr(r, i.list);
|
|
1694
|
+
const a = () => en(i, o);
|
|
1650
1695
|
return n.querySelector('[data-action="clear"]')?.addEventListener("click", () => e.clear()), n.querySelector('[data-action="toggle"]')?.addEventListener("click", (s) => {
|
|
1651
1696
|
i.panel.classList.toggle("is-minimized"), s.currentTarget.textContent = i.panel.classList.contains("is-minimized") ? "Open" : "Min";
|
|
1652
1697
|
}), i.search?.addEventListener("input", () => {
|
|
@@ -1675,56 +1720,56 @@ function Gr(e) {
|
|
|
1675
1720
|
const c = s.target?.closest?.('[data-action="copy-json"]');
|
|
1676
1721
|
if (!c) return;
|
|
1677
1722
|
const d = Number(c.dataset.entryId || 0);
|
|
1678
|
-
|
|
1723
|
+
vn(o.entries.find((f) => f.id === d), c);
|
|
1679
1724
|
}), e.subscribe((s, c) => {
|
|
1680
1725
|
o.entries = c.slice(), a();
|
|
1681
1726
|
}), r;
|
|
1682
1727
|
}
|
|
1683
|
-
function
|
|
1728
|
+
function Qr(e, t) {
|
|
1684
1729
|
e.addEventListener("wheel", (r) => {
|
|
1685
|
-
const n =
|
|
1730
|
+
const n = Xr(r.composedPath?.() || [], t);
|
|
1686
1731
|
n && (n.scrollTop += r.deltaY, n.scrollLeft += r.deltaX, r.preventDefault(), r.stopPropagation());
|
|
1687
1732
|
}, {
|
|
1688
1733
|
passive: !1,
|
|
1689
1734
|
capture: !0
|
|
1690
1735
|
});
|
|
1691
1736
|
}
|
|
1692
|
-
function
|
|
1737
|
+
function Xr(e, t) {
|
|
1693
1738
|
for (const r of e)
|
|
1694
|
-
if (!(!r || r.nodeType !== 1) &&
|
|
1739
|
+
if (!(!r || r.nodeType !== 1) && Ne(r))
|
|
1695
1740
|
return r;
|
|
1696
|
-
return
|
|
1741
|
+
return Ne(t) ? t : null;
|
|
1697
1742
|
}
|
|
1698
|
-
function
|
|
1743
|
+
function Ne(e) {
|
|
1699
1744
|
return !!(e && (e.scrollHeight > e.clientHeight + 1 || e.scrollWidth > e.clientWidth + 1) && getComputedStyle(e).overflow !== "hidden");
|
|
1700
1745
|
}
|
|
1701
|
-
function
|
|
1702
|
-
const r =
|
|
1703
|
-
Ie(e.sections, t.entries, t.section, "section"), Ie(e.severities, t.entries, t.severity, "severity"), e.count && (e.count.textContent = String(t.entries.length)), e.visibleCount && (e.visibleCount.textContent = String(r.length)),
|
|
1746
|
+
function en(e, t) {
|
|
1747
|
+
const r = tn(t.entries, t), n = r.slice(-260);
|
|
1748
|
+
Ie(e.sections, t.entries, t.section, "section"), Ie(e.severities, t.entries, t.severity, "severity"), e.count && (e.count.textContent = String(t.entries.length)), e.visibleCount && (e.visibleCount.textContent = String(r.length)), an(e.stateView, wr(t.entries), t.stateVisible), on(e.list, n, t);
|
|
1704
1749
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const r = t.section ||
|
|
1707
|
-
return (Array.isArray(e) ? e : []).filter((i) => r !==
|
|
1750
|
+
function tn(e, t = {}) {
|
|
1751
|
+
const r = t.section || G, n = t.severity || se, o = nt(t.search);
|
|
1752
|
+
return (Array.isArray(e) ? e : []).filter((i) => r !== G && i.section !== r || n !== se && i.severity !== n ? !1 : o ? kn(i).includes(o) : !0);
|
|
1708
1753
|
}
|
|
1709
1754
|
function Ie(e, t, r, n) {
|
|
1710
1755
|
if (!e) return;
|
|
1711
1756
|
e.textContent = "";
|
|
1712
|
-
const o = n === "section" ?
|
|
1713
|
-
i.type = "button", i.dataset[`${n}Filter`] =
|
|
1757
|
+
const o = n === "section" ? rn(t) : nn(t), i = document.createElement("button");
|
|
1758
|
+
i.type = "button", i.dataset[`${n}Filter`] = G, i.className = r === G ? "chip is-active" : "chip", i.textContent = `All ${t.length}`, e.appendChild(i);
|
|
1714
1759
|
for (const a of o) {
|
|
1715
1760
|
const s = t.filter((d) => d[n] === a).length, c = document.createElement("button");
|
|
1716
|
-
c.type = "button", c.dataset[`${n}Filter`] = a, c.className = r === a ? `chip is-active ${n}-${
|
|
1761
|
+
c.type = "button", c.dataset[`${n}Filter`] = a, c.className = r === a ? `chip is-active ${n}-${O(a)}` : `chip ${n}-${O(a)}`, c.textContent = `${at(a)} ${s}`, e.appendChild(c);
|
|
1717
1762
|
}
|
|
1718
1763
|
}
|
|
1719
|
-
function
|
|
1764
|
+
function rn(e) {
|
|
1720
1765
|
const t = new Set(e.map((r) => r.section).filter(Boolean));
|
|
1721
|
-
return
|
|
1766
|
+
return Le.filter((r) => t.has(r)).concat([...t].filter((r) => !Le.includes(r)).sort());
|
|
1722
1767
|
}
|
|
1723
|
-
function
|
|
1768
|
+
function nn(e) {
|
|
1724
1769
|
const t = new Set(e.map((r) => r.severity).filter(Boolean));
|
|
1725
|
-
return
|
|
1770
|
+
return je.filter((r) => t.has(r)).concat([...t].filter((r) => !je.includes(r)).sort());
|
|
1726
1771
|
}
|
|
1727
|
-
function
|
|
1772
|
+
function on(e, t, r) {
|
|
1728
1773
|
if (!e) return;
|
|
1729
1774
|
if (e.textContent = "", !t.length) {
|
|
1730
1775
|
const o = document.createElement("div");
|
|
@@ -1732,18 +1777,18 @@ function Zr(e, t, r) {
|
|
|
1732
1777
|
return;
|
|
1733
1778
|
}
|
|
1734
1779
|
const n = document.createDocumentFragment();
|
|
1735
|
-
if (r.grouped) for (const o of
|
|
1736
|
-
else for (const o of t) n.appendChild(
|
|
1780
|
+
if (r.grouped) for (const o of bn(t)) n.appendChild(yn(o));
|
|
1781
|
+
else for (const o of t) n.appendChild(rt(o));
|
|
1737
1782
|
e.appendChild(n), r.follow && requestAnimationFrame(() => e.scrollTop = e.scrollHeight);
|
|
1738
1783
|
}
|
|
1739
|
-
function
|
|
1784
|
+
function an(e, t, r) {
|
|
1740
1785
|
if (!e || (e.textContent = "", e.classList.toggle("is-hidden", !r), !r)) return;
|
|
1741
1786
|
const { flow: n, context: o } = t, i = document.createDocumentFragment();
|
|
1742
|
-
i.appendChild(
|
|
1787
|
+
i.appendChild(sn(n)), i.appendChild(cn(o)), i.appendChild(ln(n.timeline)), e.appendChild(i);
|
|
1743
1788
|
}
|
|
1744
|
-
function
|
|
1789
|
+
function sn(e) {
|
|
1745
1790
|
const t = document.createElement("section");
|
|
1746
|
-
return t.className = `viz-card flow-card status-${
|
|
1791
|
+
return t.className = `viz-card flow-card status-${O(e.status)}`, t.appendChild(ge("Flow State", e.status)), tt(t, [
|
|
1747
1792
|
["Current", e.current],
|
|
1748
1793
|
["Session", e.sessionId],
|
|
1749
1794
|
["Request", [e.requestType, e.actionType].filter(Boolean).join(" / ")],
|
|
@@ -1751,32 +1796,32 @@ function Xr(e) {
|
|
|
1751
1796
|
["Tools", e.tools?.join(", ")],
|
|
1752
1797
|
["BE ops", e.beOps?.join(", ")],
|
|
1753
1798
|
["UI", e.uiSurfaces?.join(", ")],
|
|
1754
|
-
["Health",
|
|
1799
|
+
["Health", un(e)]
|
|
1755
1800
|
]), t;
|
|
1756
1801
|
}
|
|
1757
|
-
function
|
|
1802
|
+
function cn(e) {
|
|
1758
1803
|
const t = document.createElement("section");
|
|
1759
|
-
return t.className = "viz-card context-card", t.appendChild(ge("Context State", e.panel?.screenType || e.ui?.rootType || "empty")),
|
|
1760
|
-
["Intent",
|
|
1761
|
-
["Route",
|
|
1762
|
-
["Screen",
|
|
1763
|
-
["Last search",
|
|
1764
|
-
["Products",
|
|
1765
|
-
["Page product",
|
|
1804
|
+
return t.className = "viz-card context-card", t.appendChild(ge("Context State", e.panel?.screenType || e.ui?.rootType || "empty")), tt(t, [
|
|
1805
|
+
["Intent", dn(e.intent)],
|
|
1806
|
+
["Route", fn(e.route)],
|
|
1807
|
+
["Screen", pn(e)],
|
|
1808
|
+
["Last search", mn(e.panel?.lastSearch)],
|
|
1809
|
+
["Products", gn(e.panel, e.products)],
|
|
1810
|
+
["Page product", hn(e.pageProduct)],
|
|
1766
1811
|
["Extensions", Object.keys(e.threadExtensions || {}).join(", ")],
|
|
1767
1812
|
["Last text", e.lastText]
|
|
1768
1813
|
]), t;
|
|
1769
1814
|
}
|
|
1770
|
-
function
|
|
1815
|
+
function ln(e) {
|
|
1771
1816
|
const t = document.createElement("section");
|
|
1772
1817
|
t.className = "viz-card timeline-card", t.appendChild(ge("Flow Timeline", `${e.length} steps`));
|
|
1773
1818
|
const r = document.createElement("ol");
|
|
1774
1819
|
if (r.className = "timeline", e.length)
|
|
1775
1820
|
for (const n of e) {
|
|
1776
1821
|
const o = document.createElement("li");
|
|
1777
|
-
o.className = `timeline-step step-${
|
|
1822
|
+
o.className = `timeline-step step-${O(n.status || "done")}`;
|
|
1778
1823
|
const i = document.createElement("span");
|
|
1779
|
-
i.className = "timeline-time", i.textContent =
|
|
1824
|
+
i.className = "timeline-time", i.textContent = it(n.at);
|
|
1780
1825
|
const a = document.createElement("span");
|
|
1781
1826
|
a.className = "timeline-label", a.textContent = n.label || n.kind || "Step";
|
|
1782
1827
|
const s = document.createElement("span");
|
|
@@ -1796,7 +1841,7 @@ function ge(e, t) {
|
|
|
1796
1841
|
const o = document.createElement("span");
|
|
1797
1842
|
return o.className = "viz-badge", o.textContent = t || "idle", r.append(n, o), r;
|
|
1798
1843
|
}
|
|
1799
|
-
function
|
|
1844
|
+
function tt(e, t) {
|
|
1800
1845
|
for (const [r, n] of t) {
|
|
1801
1846
|
if (n == null || n === "") continue;
|
|
1802
1847
|
const o = document.createElement("div");
|
|
@@ -1807,17 +1852,17 @@ function Xe(e, t) {
|
|
|
1807
1852
|
a.className = "viz-value", a.textContent = String(n), o.append(i, a), e.appendChild(o);
|
|
1808
1853
|
}
|
|
1809
1854
|
}
|
|
1810
|
-
function
|
|
1855
|
+
function un(e) {
|
|
1811
1856
|
return !e.errors && !e.warnings ? "clean" : `${e.errors || 0} errors, ${e.warnings || 0} warnings`;
|
|
1812
1857
|
}
|
|
1813
|
-
function
|
|
1858
|
+
function dn(e) {
|
|
1814
1859
|
return e ? [
|
|
1815
1860
|
e.kind,
|
|
1816
1861
|
e.target,
|
|
1817
1862
|
e.confidence != null ? `conf ${e.confidence}` : ""
|
|
1818
1863
|
].filter(Boolean).join(" / ") : "";
|
|
1819
1864
|
}
|
|
1820
|
-
function
|
|
1865
|
+
function fn(e) {
|
|
1821
1866
|
return e ? [e.search ? [
|
|
1822
1867
|
e.search.query,
|
|
1823
1868
|
e.search.category,
|
|
@@ -1830,7 +1875,7 @@ function on(e) {
|
|
|
1830
1875
|
e.flow.action
|
|
1831
1876
|
].filter(Boolean).join(" / ") : ""].filter(Boolean).join(" -> ") : "";
|
|
1832
1877
|
}
|
|
1833
|
-
function
|
|
1878
|
+
function pn(e) {
|
|
1834
1879
|
const t = e.panel || {}, r = e.ui || {};
|
|
1835
1880
|
return [
|
|
1836
1881
|
t.screenType,
|
|
@@ -1839,7 +1884,7 @@ function an(e) {
|
|
|
1839
1884
|
r.panelHint
|
|
1840
1885
|
].filter(Boolean).join(" / ");
|
|
1841
1886
|
}
|
|
1842
|
-
function
|
|
1887
|
+
function mn(e) {
|
|
1843
1888
|
return e ? [
|
|
1844
1889
|
e.query,
|
|
1845
1890
|
e.source,
|
|
@@ -1847,18 +1892,18 @@ function sn(e) {
|
|
|
1847
1892
|
e.count != null ? `${e.count} results` : ""
|
|
1848
1893
|
].filter(Boolean).join(" / ") : "";
|
|
1849
1894
|
}
|
|
1850
|
-
function
|
|
1895
|
+
function gn(e, t) {
|
|
1851
1896
|
const r = e?.productSkus || e?.screenSkus || t?.skus || [], n = e?.productCount ?? t?.count;
|
|
1852
1897
|
return n == null && !r.length ? "" : [`${n ?? r.length} products`, r.join(", ")].filter(Boolean).join(" / ");
|
|
1853
1898
|
}
|
|
1854
|
-
function
|
|
1899
|
+
function hn(e) {
|
|
1855
1900
|
return e ? [
|
|
1856
1901
|
e.sku,
|
|
1857
1902
|
e.name,
|
|
1858
1903
|
e.category
|
|
1859
1904
|
].filter(Boolean).join(" / ") : "";
|
|
1860
1905
|
}
|
|
1861
|
-
function
|
|
1906
|
+
function bn(e) {
|
|
1862
1907
|
const t = /* @__PURE__ */ new Map();
|
|
1863
1908
|
for (const r of e) {
|
|
1864
1909
|
const n = `${r.section || "Runtime"}:${r.group || r.kind}`, o = t.get(n) || {
|
|
@@ -1868,13 +1913,13 @@ function un(e) {
|
|
|
1868
1913
|
title: r.group || r.kind,
|
|
1869
1914
|
entries: []
|
|
1870
1915
|
};
|
|
1871
|
-
o.entries.push(r), o.severity =
|
|
1916
|
+
o.entries.push(r), o.severity = xn(o.severity, r.severity), t.set(n, o);
|
|
1872
1917
|
}
|
|
1873
1918
|
return [...t.values()];
|
|
1874
1919
|
}
|
|
1875
|
-
function
|
|
1920
|
+
function yn(e) {
|
|
1876
1921
|
const t = document.createElement("section");
|
|
1877
|
-
t.className = `group group-${
|
|
1922
|
+
t.className = `group group-${O(e.severity)}`, t.dataset.section = e.section;
|
|
1878
1923
|
const r = document.createElement("div");
|
|
1879
1924
|
r.className = "group-head";
|
|
1880
1925
|
const n = document.createElement("span");
|
|
@@ -1883,20 +1928,20 @@ function dn(e) {
|
|
|
1883
1928
|
o.className = "group-title", o.textContent = e.title;
|
|
1884
1929
|
const i = document.createElement("span");
|
|
1885
1930
|
i.className = "group-count", i.textContent = String(e.entries.length), r.append(n, o, i), t.appendChild(r);
|
|
1886
|
-
for (const a of e.entries) t.appendChild(
|
|
1931
|
+
for (const a of e.entries) t.appendChild(rt(a));
|
|
1887
1932
|
return t;
|
|
1888
1933
|
}
|
|
1889
|
-
function
|
|
1934
|
+
function rt(e) {
|
|
1890
1935
|
const t = document.createElement("details");
|
|
1891
|
-
t.dataset.entryId = String(e.id || ""), t.dataset.section = e.section || "Runtime", t.dataset.severity = e.severity || "info", t.className = `entry entry-${
|
|
1936
|
+
t.dataset.entryId = String(e.id || ""), t.dataset.section = e.section || "Runtime", t.dataset.severity = e.severity || "info", t.className = `entry entry-${O(e.severity || "info")}`, t.open = e.severity === "error";
|
|
1892
1937
|
const r = document.createElement("summary"), n = document.createElement("span");
|
|
1893
|
-
n.className = "time", n.textContent =
|
|
1938
|
+
n.className = "time", n.textContent = it(e.at);
|
|
1894
1939
|
const o = document.createElement("span");
|
|
1895
1940
|
o.className = "section", o.textContent = e.section || "Runtime";
|
|
1896
1941
|
const i = document.createElement("span");
|
|
1897
|
-
i.className = "severity", i.textContent =
|
|
1942
|
+
i.className = "severity", i.textContent = at(e.severity || "info");
|
|
1898
1943
|
const a = document.createElement("span");
|
|
1899
|
-
a.className = "title", a.textContent =
|
|
1944
|
+
a.className = "title", a.textContent = ot(e), r.append(n, o, i, a);
|
|
1900
1945
|
const s = document.createElement("div");
|
|
1901
1946
|
s.className = "entry-body";
|
|
1902
1947
|
const c = document.createElement("div");
|
|
@@ -1908,20 +1953,20 @@ function et(e) {
|
|
|
1908
1953
|
const b = document.createElement("button");
|
|
1909
1954
|
b.type = "button", b.dataset.action = "copy-json", b.dataset.entryId = String(e.id || ""), b.textContent = "Copy JSON", c.append(d, f, b);
|
|
1910
1955
|
const m = document.createElement("pre"), l = document.createElement("code");
|
|
1911
|
-
return l.innerHTML =
|
|
1956
|
+
return l.innerHTML = wn(e), m.appendChild(l), s.append(c, m), t.append(r, s), t;
|
|
1912
1957
|
}
|
|
1913
|
-
function
|
|
1958
|
+
function wn(e) {
|
|
1914
1959
|
const t = he(e), r = /("(?:\\u[\da-fA-F]{4}|\\[^u]|[^\\"])*"(?:\s*:)?|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/gu;
|
|
1915
1960
|
let n = "", o = 0;
|
|
1916
1961
|
for (const i of t.matchAll(r)) {
|
|
1917
1962
|
const a = i[0];
|
|
1918
|
-
n +=
|
|
1963
|
+
n += H(t.slice(o, i.index));
|
|
1919
1964
|
let s = "json-number";
|
|
1920
|
-
a.startsWith('"') ? s = a.endsWith(":") ? "json-key" : "json-string" : a === "true" || a === "false" ? s = "json-boolean" : a === "null" && (s = "json-null"), n += `<span class="${s}">${
|
|
1965
|
+
a.startsWith('"') ? s = a.endsWith(":") ? "json-key" : "json-string" : a === "true" || a === "false" ? s = "json-boolean" : a === "null" && (s = "json-null"), n += `<span class="${s}">${H(a)}</span>`, o = i.index + a.length;
|
|
1921
1966
|
}
|
|
1922
|
-
return n +
|
|
1967
|
+
return n + H(t.slice(o));
|
|
1923
1968
|
}
|
|
1924
|
-
function
|
|
1969
|
+
function vn(e, t) {
|
|
1925
1970
|
if (!e) return;
|
|
1926
1971
|
const r = he(e), n = () => {
|
|
1927
1972
|
const o = t.textContent;
|
|
@@ -1944,7 +1989,7 @@ function Ue(e, t) {
|
|
|
1944
1989
|
r.remove();
|
|
1945
1990
|
}
|
|
1946
1991
|
}
|
|
1947
|
-
function
|
|
1992
|
+
function xn(e, t) {
|
|
1948
1993
|
const r = {
|
|
1949
1994
|
info: 0,
|
|
1950
1995
|
warn: 1,
|
|
@@ -1952,13 +1997,13 @@ function mn(e, t) {
|
|
|
1952
1997
|
};
|
|
1953
1998
|
return (r[t] || 0) > (r[e] || 0) ? t : e;
|
|
1954
1999
|
}
|
|
1955
|
-
function
|
|
1956
|
-
return
|
|
2000
|
+
function kn(e) {
|
|
2001
|
+
return nt([
|
|
1957
2002
|
e.kind,
|
|
1958
2003
|
e.section,
|
|
1959
2004
|
e.severity,
|
|
1960
2005
|
e.group,
|
|
1961
|
-
|
|
2006
|
+
ot(e),
|
|
1962
2007
|
e.tool,
|
|
1963
2008
|
e.op,
|
|
1964
2009
|
e.request?.type,
|
|
@@ -1969,15 +2014,15 @@ function gn(e) {
|
|
|
1969
2014
|
he(e)
|
|
1970
2015
|
].join(" "));
|
|
1971
2016
|
}
|
|
1972
|
-
function
|
|
2017
|
+
function nt(e) {
|
|
1973
2018
|
return String(e || "").toLocaleLowerCase("tr-TR").trim();
|
|
1974
2019
|
}
|
|
1975
|
-
function
|
|
2020
|
+
function ot(e) {
|
|
1976
2021
|
if (e.kind === "flow/request") return e.request?.type || e.request?.action?.type || "request";
|
|
1977
2022
|
if (e.kind === "flow/action") return e.event?.name || e.event?.action || e.event?.type || "action";
|
|
1978
2023
|
if (e.kind === "flow/metadata") return e.event?.name || e.event?.phase || e.event?.type || "metadata";
|
|
1979
2024
|
if (e.kind === "flow/ui") return e.widget || e.panelHint || "ui";
|
|
1980
|
-
if (e.kind === "flow/text-final") return
|
|
2025
|
+
if (e.kind === "flow/text-final") return En(e.content || "final text", 90);
|
|
1981
2026
|
if (e.kind === "be/request") return e.op || "BE request";
|
|
1982
2027
|
if (e.kind === "be/response") {
|
|
1983
2028
|
const t = e.result?.intent?.kind || e.result?.intent_kind || e.result?.kind;
|
|
@@ -1985,7 +2030,7 @@ function rt(e) {
|
|
|
1985
2030
|
}
|
|
1986
2031
|
return e.kind === "intent/selected" ? e.intent?.kind || e.kind : e.kind.startsWith("tool/") ? e.tool || "tool" : e.kind === "beacon" ? e.payload?.type || "beacon" : e.title || e.kind;
|
|
1987
2032
|
}
|
|
1988
|
-
function
|
|
2033
|
+
function _n(e) {
|
|
1989
2034
|
return `
|
|
1990
2035
|
<style>
|
|
1991
2036
|
:host { all: initial; }
|
|
@@ -2308,7 +2353,7 @@ function hn(e) {
|
|
|
2308
2353
|
<div class="panel" data-role="panel">
|
|
2309
2354
|
<div class="head">
|
|
2310
2355
|
<div class="meta">
|
|
2311
|
-
<span class="name">Agentic Activity - ${
|
|
2356
|
+
<span class="name">Agentic Activity - ${H(e)}</span>
|
|
2312
2357
|
<span class="count"><span data-role="visible-count">0</span>/<span data-role="count">0</span></span>
|
|
2313
2358
|
</div>
|
|
2314
2359
|
<div class="actions">
|
|
@@ -2340,29 +2385,29 @@ function he(e) {
|
|
|
2340
2385
|
return String(e);
|
|
2341
2386
|
}
|
|
2342
2387
|
}
|
|
2343
|
-
function
|
|
2388
|
+
function it(e) {
|
|
2344
2389
|
try {
|
|
2345
2390
|
return new Date(e || Date.now()).toLocaleTimeString();
|
|
2346
2391
|
} catch {
|
|
2347
2392
|
return "";
|
|
2348
2393
|
}
|
|
2349
2394
|
}
|
|
2350
|
-
function
|
|
2395
|
+
function En(e, t) {
|
|
2351
2396
|
const r = String(e || "");
|
|
2352
2397
|
return r.length > t ? `${r.slice(0, t - 1)}...` : r;
|
|
2353
2398
|
}
|
|
2354
|
-
function
|
|
2399
|
+
function at(e) {
|
|
2355
2400
|
const t = String(e || "");
|
|
2356
2401
|
return t ? `${t.slice(0, 1).toLocaleUpperCase("en-US")}${t.slice(1)}` : "";
|
|
2357
2402
|
}
|
|
2358
|
-
function
|
|
2403
|
+
function O(e) {
|
|
2359
2404
|
return String(e || "").toLocaleLowerCase("en-US").replace(/[^a-z0-9]+/gu, "-").replace(/^-|-$/gu, "");
|
|
2360
2405
|
}
|
|
2361
|
-
function
|
|
2406
|
+
function H(e) {
|
|
2362
2407
|
return String(e).replace(/[&<>"']/gu, (t) => t === "&" ? "&" : t === "<" ? "<" : t === ">" ? ">" : t === '"' ? """ : "'");
|
|
2363
2408
|
}
|
|
2364
|
-
function
|
|
2365
|
-
if (!
|
|
2409
|
+
function Gi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
2410
|
+
if (!Sn(e, t)) return {
|
|
2366
2411
|
enabled: !1,
|
|
2367
2412
|
tools: r,
|
|
2368
2413
|
beacon: n,
|
|
@@ -2371,8 +2416,8 @@ function Ni({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
|
2371
2416
|
wrapTransport() {
|
|
2372
2417
|
}
|
|
2373
2418
|
};
|
|
2374
|
-
const o =
|
|
2375
|
-
return window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) =>
|
|
2419
|
+
const o = pr(e);
|
|
2420
|
+
return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Zr(o), Mr({
|
|
2376
2421
|
accountId: e,
|
|
2377
2422
|
collector: o,
|
|
2378
2423
|
promptBaseUrl: t.agenticActivityPromptBaseUrl
|
|
@@ -2382,22 +2427,22 @@ function Ni({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
|
2382
2427
|
}), {
|
|
2383
2428
|
enabled: !0,
|
|
2384
2429
|
collector: o,
|
|
2385
|
-
tools:
|
|
2386
|
-
beacon:
|
|
2430
|
+
tools: Br(r, o),
|
|
2431
|
+
beacon: Or(n, o),
|
|
2387
2432
|
record: (i) => o.record(i),
|
|
2388
|
-
wrapTransport: () =>
|
|
2433
|
+
wrapTransport: () => $r(e, o)
|
|
2389
2434
|
};
|
|
2390
2435
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return t.agenticActivityDebug === !1 ? !1 : t.agenticActivityDebug === !0 || window.__GENGAGE_PWTEST_ACCOUNT__ === e || window.__GENGAGE_AGENTIC_ACTIVITY_DEBUG__ === !0 ? !0 : !!(t.debug === !0 &&
|
|
2436
|
+
function Sn(e, t = {}) {
|
|
2437
|
+
return t.agenticActivityDebug === !1 ? !1 : t.agenticActivityDebug === !0 || window.__GENGAGE_PWTEST_ACCOUNT__ === e || window.__GENGAGE_AGENTIC_ACTIVITY_DEBUG__ === !0 ? !0 : !!(t.debug === !0 && Tn(e));
|
|
2393
2438
|
}
|
|
2394
|
-
function
|
|
2439
|
+
function Tn(e) {
|
|
2395
2440
|
return Array.from(document.scripts || []).some((t) => {
|
|
2396
2441
|
const r = t?.src || "";
|
|
2397
2442
|
return r.includes(`/${e}/glov.js`) && /[?&]pwtest=/u.test(r);
|
|
2398
2443
|
});
|
|
2399
2444
|
}
|
|
2400
|
-
var
|
|
2445
|
+
var Cn = [
|
|
2401
2446
|
"sku",
|
|
2402
2447
|
"group_id",
|
|
2403
2448
|
"name",
|
|
@@ -2417,7 +2462,7 @@ var vn = [
|
|
|
2417
2462
|
"in_stock",
|
|
2418
2463
|
"promotions",
|
|
2419
2464
|
"variants"
|
|
2420
|
-
],
|
|
2465
|
+
], An = [
|
|
2421
2466
|
"description",
|
|
2422
2467
|
"description_html",
|
|
2423
2468
|
"features",
|
|
@@ -2428,7 +2473,7 @@ var vn = [
|
|
|
2428
2473
|
"documents",
|
|
2429
2474
|
"delivery",
|
|
2430
2475
|
"payment"
|
|
2431
|
-
],
|
|
2476
|
+
], Rn = [
|
|
2432
2477
|
"accountId",
|
|
2433
2478
|
"query",
|
|
2434
2479
|
"products",
|
|
@@ -2439,14 +2484,14 @@ var vn = [
|
|
|
2439
2484
|
"available_facets",
|
|
2440
2485
|
"logs",
|
|
2441
2486
|
"meta"
|
|
2442
|
-
],
|
|
2487
|
+
], Pn = [
|
|
2443
2488
|
"source",
|
|
2444
2489
|
"sourceType",
|
|
2445
2490
|
"sourceProfile",
|
|
2446
2491
|
"products",
|
|
2447
2492
|
"queries",
|
|
2448
2493
|
"logs"
|
|
2449
|
-
],
|
|
2494
|
+
], Ln = [
|
|
2450
2495
|
"items",
|
|
2451
2496
|
"kind",
|
|
2452
2497
|
"label",
|
|
@@ -2454,11 +2499,11 @@ var vn = [
|
|
|
2454
2499
|
"count",
|
|
2455
2500
|
"privacy"
|
|
2456
2501
|
];
|
|
2457
|
-
function
|
|
2502
|
+
function zi({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: c = [] } = {}) {
|
|
2458
2503
|
return {
|
|
2459
|
-
searchKeyword: async (f = {}, b = {}) => t(
|
|
2504
|
+
searchKeyword: async (f = {}, b = {}) => t(Nn(f, b)),
|
|
2460
2505
|
facetedSearch: typeof r == "function" ? (f = {}, b = {}) => r(qe(f, b)) : async (f = {}, b = {}) => t(qe(f, b)),
|
|
2461
|
-
getSearchCapabilities: () =>
|
|
2506
|
+
getSearchCapabilities: () => jn({
|
|
2462
2507
|
accountId: e,
|
|
2463
2508
|
hasSimilarity: typeof n == "function",
|
|
2464
2509
|
hasGiftSearch: typeof o == "function",
|
|
@@ -2469,10 +2514,10 @@ function Mi({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, se
|
|
|
2469
2514
|
})
|
|
2470
2515
|
};
|
|
2471
2516
|
}
|
|
2472
|
-
function
|
|
2517
|
+
function jn({ accountId: e, hasSimilarity: t = !0, hasGiftSearch: r = !1, filters: n = {}, resultContract: o = {}, limitations: i = [], extraTools: a = [] } = {}) {
|
|
2473
2518
|
return {
|
|
2474
2519
|
accountId: e,
|
|
2475
|
-
tools:
|
|
2520
|
+
tools: In([
|
|
2476
2521
|
"search",
|
|
2477
2522
|
"searchKeyword",
|
|
2478
2523
|
"facetedSearch",
|
|
@@ -2501,11 +2546,11 @@ function Tn({ accountId: e, hasSimilarity: t = !0, hasGiftSearch: r = !1, filter
|
|
|
2501
2546
|
...n
|
|
2502
2547
|
},
|
|
2503
2548
|
resultContract: {
|
|
2504
|
-
productItemFields:
|
|
2505
|
-
productDetailFields:
|
|
2506
|
-
searchResultFields:
|
|
2507
|
-
similarityResultFields:
|
|
2508
|
-
siteContentFields:
|
|
2549
|
+
productItemFields: Cn,
|
|
2550
|
+
productDetailFields: An,
|
|
2551
|
+
searchResultFields: Rn,
|
|
2552
|
+
similarityResultFields: Pn,
|
|
2553
|
+
siteContentFields: Ln,
|
|
2509
2554
|
...o
|
|
2510
2555
|
},
|
|
2511
2556
|
privacy: [
|
|
@@ -2517,7 +2562,7 @@ function Tn({ accountId: e, hasSimilarity: t = !0, hasGiftSearch: r = !1, filter
|
|
|
2517
2562
|
limitations: i
|
|
2518
2563
|
};
|
|
2519
2564
|
}
|
|
2520
|
-
function
|
|
2565
|
+
function Nn(e, t) {
|
|
2521
2566
|
return ce(typeof e == "string" ? {
|
|
2522
2567
|
...t,
|
|
2523
2568
|
query: e
|
|
@@ -2541,7 +2586,7 @@ function qe(e, t) {
|
|
|
2541
2586
|
});
|
|
2542
2587
|
return n === "" && (o.query = ""), o;
|
|
2543
2588
|
}
|
|
2544
|
-
function
|
|
2589
|
+
function In(e) {
|
|
2545
2590
|
const t = /* @__PURE__ */ new Set();
|
|
2546
2591
|
return e.filter((r) => {
|
|
2547
2592
|
const n = String(r || "");
|
|
@@ -2551,8 +2596,8 @@ function Cn(e) {
|
|
|
2551
2596
|
function ce(e) {
|
|
2552
2597
|
return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t != null && t !== "" && (!Array.isArray(t) || t.length)));
|
|
2553
2598
|
}
|
|
2554
|
-
var
|
|
2555
|
-
function
|
|
2599
|
+
var Un = 15e3, qn = "glov_agentic_iframe", Bn = "position:absolute;width:1px;height:1px;left:-9999px;top:-9999px;opacity:0;pointer-events:none;";
|
|
2600
|
+
function Hi({ markerParam: e = qn, markerValue: t = "agentic-scraper", frameName: r = t, sandbox: n = "allow-same-origin", timeoutMs: o = Un, hiddenStyle: i = Bn, messageType: a, parser: s, isBlockedDocument: c } = {}) {
|
|
2556
2601
|
const d = a || `gengage:agentic-iframe-scraper:${t}`;
|
|
2557
2602
|
function f(p, g = {}) {
|
|
2558
2603
|
const u = new URL(String(p), re());
|
|
@@ -2577,15 +2622,15 @@ function Fi({ markerParam: e = Ln, markerValue: t = "agentic-scraper", frameName
|
|
|
2577
2622
|
timedOut: !1,
|
|
2578
2623
|
via: "unavailable"
|
|
2579
2624
|
};
|
|
2580
|
-
const
|
|
2625
|
+
const T = f(p), x = k.createElement("iframe");
|
|
2581
2626
|
x.name = r;
|
|
2582
2627
|
try {
|
|
2583
2628
|
x.sandbox = n;
|
|
2584
2629
|
} catch {
|
|
2585
2630
|
}
|
|
2586
2631
|
return x.style && (x.style.cssText = i), new Promise((C) => {
|
|
2587
|
-
let
|
|
2588
|
-
const z = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function",
|
|
2632
|
+
let M = !1;
|
|
2633
|
+
const z = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function", ut = v.setTimeout(() => {
|
|
2589
2634
|
ee({
|
|
2590
2635
|
attempted: !0,
|
|
2591
2636
|
doc: null,
|
|
@@ -2595,20 +2640,20 @@ function Fi({ markerParam: e = Ln, markerValue: t = "agentic-scraper", frameName
|
|
|
2595
2640
|
via: "timeout"
|
|
2596
2641
|
});
|
|
2597
2642
|
}, o);
|
|
2598
|
-
function
|
|
2599
|
-
v.clearTimeout(
|
|
2643
|
+
function dt() {
|
|
2644
|
+
v.clearTimeout(ut), z && v.removeEventListener("message", ke), typeof x.remove == "function" && x.remove();
|
|
2600
2645
|
}
|
|
2601
2646
|
function ee(A) {
|
|
2602
|
-
|
|
2647
|
+
M || (M = !0, dt(), C(A));
|
|
2603
2648
|
}
|
|
2604
2649
|
function ke(A) {
|
|
2605
2650
|
if (A.source && x.contentWindow && A.source !== x.contentWindow) return;
|
|
2606
|
-
const
|
|
2607
|
-
!
|
|
2651
|
+
const L = A.data;
|
|
2652
|
+
!L || L.type !== d || L.marker !== t || ee({
|
|
2608
2653
|
attempted: !0,
|
|
2609
2654
|
doc: null,
|
|
2610
|
-
result:
|
|
2611
|
-
blocked: !!
|
|
2655
|
+
result: L.payload || null,
|
|
2656
|
+
blocked: !!L.blocked,
|
|
2612
2657
|
timedOut: !1,
|
|
2613
2658
|
via: "postMessage"
|
|
2614
2659
|
});
|
|
@@ -2616,21 +2661,21 @@ function Fi({ markerParam: e = Ln, markerValue: t = "agentic-scraper", frameName
|
|
|
2616
2661
|
x.addEventListener("load", () => {
|
|
2617
2662
|
if (x.contentWindow?.location?.href !== "about:blank")
|
|
2618
2663
|
try {
|
|
2619
|
-
const A = x.contentDocument || x.contentWindow?.document || null,
|
|
2664
|
+
const A = x.contentDocument || x.contentWindow?.document || null, L = !!w?.(A);
|
|
2620
2665
|
ee({
|
|
2621
2666
|
attempted: !0,
|
|
2622
2667
|
doc: A,
|
|
2623
2668
|
result: typeof h == "function" ? h(A, {
|
|
2624
|
-
url:
|
|
2669
|
+
url: T,
|
|
2625
2670
|
input: g
|
|
2626
2671
|
}) : null,
|
|
2627
|
-
blocked:
|
|
2672
|
+
blocked: L,
|
|
2628
2673
|
timedOut: !1,
|
|
2629
2674
|
via: "contentDocument"
|
|
2630
2675
|
});
|
|
2631
2676
|
} catch {
|
|
2632
2677
|
}
|
|
2633
|
-
}), z && v.addEventListener("message", ke), k.body.appendChild(x), x.src =
|
|
2678
|
+
}), z && v.addEventListener("message", ke), k.body.appendChild(x), x.src = T;
|
|
2634
2679
|
});
|
|
2635
2680
|
}
|
|
2636
2681
|
function l(p = s, { targetOrigin: g = re() } = {}) {
|
|
@@ -2657,24 +2702,24 @@ function Fi({ markerParam: e = Ln, markerValue: t = "agentic-scraper", frameName
|
|
|
2657
2702
|
postCurrentDocument: l
|
|
2658
2703
|
};
|
|
2659
2704
|
}
|
|
2660
|
-
function
|
|
2705
|
+
function Wi(e, { accountId: t, type: r = "agenticSearchFrame" } = {}) {
|
|
2661
2706
|
return e?.isScraperFrame?.() ? (t && globalThis.window && (globalThis.window.GengageAssistantInjector ||= {}, globalThis.window.GengageAssistantInjector[t] ||= { type: r }), !0) : !1;
|
|
2662
2707
|
}
|
|
2663
2708
|
function re() {
|
|
2664
2709
|
return globalThis.window?.location?.origin || globalThis.location?.origin || "https://example.invalid";
|
|
2665
2710
|
}
|
|
2666
|
-
function
|
|
2711
|
+
function Vi({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, missingUrlMessage: n = "Ürün sayfasını açmak için ürün bağlantısı gerekiyor." } = {}) {
|
|
2667
2712
|
const o = new URL(e).origin;
|
|
2668
2713
|
return async function(a = {}) {
|
|
2669
|
-
const s = a.product || {}, c =
|
|
2670
|
-
return c ?
|
|
2714
|
+
const s = a.product || {}, c = On(a.url || a.productUrl || s.url, e, o), d = a.sku || s.sku || null;
|
|
2715
|
+
return c ? Mn(c) ? {
|
|
2671
2716
|
ok: !0,
|
|
2672
2717
|
sku: d,
|
|
2673
2718
|
url: c,
|
|
2674
2719
|
method: "already-current-page",
|
|
2675
2720
|
alreadyCurrentPage: !0,
|
|
2676
2721
|
message: r || t
|
|
2677
|
-
} : (
|
|
2722
|
+
} : ($n(c), {
|
|
2678
2723
|
ok: !0,
|
|
2679
2724
|
sku: d,
|
|
2680
2725
|
url: c,
|
|
@@ -2688,7 +2733,7 @@ function Bi({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, m
|
|
|
2688
2733
|
};
|
|
2689
2734
|
};
|
|
2690
2735
|
}
|
|
2691
|
-
function
|
|
2736
|
+
function On(e, t, r = new URL(t).origin) {
|
|
2692
2737
|
if (!e) return "";
|
|
2693
2738
|
try {
|
|
2694
2739
|
const n = new URL(e, t);
|
|
@@ -2697,7 +2742,7 @@ function Pn(e, t, r = new URL(t).origin) {
|
|
|
2697
2742
|
return "";
|
|
2698
2743
|
}
|
|
2699
2744
|
}
|
|
2700
|
-
function
|
|
2745
|
+
function $n(e) {
|
|
2701
2746
|
if (typeof document > "u") {
|
|
2702
2747
|
window.location.href = e;
|
|
2703
2748
|
return;
|
|
@@ -2707,7 +2752,7 @@ function jn(e) {
|
|
|
2707
2752
|
window.location.href !== e && window.location.assign(e);
|
|
2708
2753
|
}, 0);
|
|
2709
2754
|
}
|
|
2710
|
-
function
|
|
2755
|
+
function Mn(e) {
|
|
2711
2756
|
try {
|
|
2712
2757
|
const t = new URL(globalThis.window?.location?.href || "", e), r = new URL(e, t.href);
|
|
2713
2758
|
return t.hash = "", r.hash = "", t.href === r.href;
|
|
@@ -2715,12 +2760,12 @@ function In(e) {
|
|
|
2715
2760
|
return !1;
|
|
2716
2761
|
}
|
|
2717
2762
|
}
|
|
2718
|
-
function
|
|
2719
|
-
const c =
|
|
2763
|
+
function Fn({ accountId: e, supplied: t = [], pageProduct: r = null, listingProducts: n = [], skus: o = [], limit: i = 4, storedProducts: a = [], getStoredPanelProducts: s } = {}) {
|
|
2764
|
+
const c = st(o), d = Array.isArray(n) ? n : [], f = typeof s == "function" ? s({
|
|
2720
2765
|
accountId: e,
|
|
2721
2766
|
visibleProducts: d
|
|
2722
2767
|
}) : a;
|
|
2723
|
-
return
|
|
2768
|
+
return Dn([
|
|
2724
2769
|
...K(t),
|
|
2725
2770
|
...K(f),
|
|
2726
2771
|
r,
|
|
@@ -2730,11 +2775,11 @@ function Un({ accountId: e, supplied: t = [], pageProduct: r = null, listingProd
|
|
|
2730
2775
|
limit: i
|
|
2731
2776
|
});
|
|
2732
2777
|
}
|
|
2733
|
-
function
|
|
2778
|
+
function Ki({ accountId: e, rootUrl: t, getProduct: r, getProducts: n, getStoredPanelProducts: o, limit: i = 4 } = {}) {
|
|
2734
2779
|
return async function(s = {}) {
|
|
2735
2780
|
return {
|
|
2736
2781
|
accountId: e,
|
|
2737
|
-
products:
|
|
2782
|
+
products: Fn({
|
|
2738
2783
|
accountId: e,
|
|
2739
2784
|
supplied: Array.isArray(s.products) ? s.products : [],
|
|
2740
2785
|
pageProduct: r?.(),
|
|
@@ -2747,41 +2792,41 @@ function $i({ accountId: e, rootUrl: t, getProduct: r, getProducts: n, getStored
|
|
|
2747
2792
|
};
|
|
2748
2793
|
};
|
|
2749
2794
|
}
|
|
2750
|
-
function
|
|
2751
|
-
const n = new Set(
|
|
2795
|
+
function Dn(e, { skus: t = [], limit: r = 4 } = {}) {
|
|
2796
|
+
const n = new Set(st(t)), o = /* @__PURE__ */ new Set(), i = [];
|
|
2752
2797
|
for (const a of K(e)) {
|
|
2753
2798
|
if (!a) continue;
|
|
2754
|
-
const s =
|
|
2799
|
+
const s = W(a?.sku);
|
|
2755
2800
|
if (n.size && !n.has(s)) continue;
|
|
2756
|
-
const c = s ||
|
|
2801
|
+
const c = s || W(a?.url) || W(a?.name || a?.title);
|
|
2757
2802
|
if (!(c && o.has(c)) && (c && o.add(c), i.push(a), i.length >= r))
|
|
2758
2803
|
break;
|
|
2759
2804
|
}
|
|
2760
2805
|
return i;
|
|
2761
2806
|
}
|
|
2762
|
-
function
|
|
2763
|
-
return K(e).map(
|
|
2807
|
+
function st(e) {
|
|
2808
|
+
return K(e).map(W).filter(Boolean);
|
|
2764
2809
|
}
|
|
2765
|
-
function
|
|
2810
|
+
function W(e) {
|
|
2766
2811
|
return String(e || "").trim();
|
|
2767
2812
|
}
|
|
2768
2813
|
function K(e) {
|
|
2769
2814
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
2770
2815
|
}
|
|
2771
|
-
var
|
|
2816
|
+
var N = {
|
|
2772
2817
|
headings: 8,
|
|
2773
2818
|
products: 8,
|
|
2774
2819
|
controls: 12,
|
|
2775
2820
|
textMatches: 8,
|
|
2776
2821
|
snippetChars: 180
|
|
2777
|
-
}, J = /\b(?:checkout|payment|pay now|place order|delete|remove|confirm|submit|ödeme|odeme|siparişi tamamla|siparisi tamamla|satın al|satin al|sil|kaldır|kaldir|onayla|gönder|gonder)\b/iu,
|
|
2822
|
+
}, J = /\b(?:checkout|payment|pay now|place order|delete|remove|confirm|submit|ödeme|odeme|siparişi tamamla|siparisi tamamla|satın al|satin al|sil|kaldır|kaldir|onayla|gönder|gonder)\b/iu, Gn = /(?:token|session|sid|auth|code|csrf|secret|key|password|passwd|phone|email|address|postcode|zip|jwt|bearer)/iu, zn = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}|\+?\d[\d\s().-]{8,}\d|[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}|[A-Za-z0-9_-]{24,}/iu, Hn = {
|
|
2778
2823
|
campaign: /\b(?:campaign|promotion|discount|deal|coupon|kampanya|indirim|firsat|fırsat|kupon)\b/iu,
|
|
2779
2824
|
blog: /\b(?:blog|journal|guide|article|editorial|inspiration|rehber|makale|ilham|icerik|içerik)\b/iu,
|
|
2780
2825
|
category: /\b(?:category|collection|department|kategori|koleksiyon|reyon)\b/iu
|
|
2781
2826
|
};
|
|
2782
|
-
function
|
|
2827
|
+
function Ji({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o = (i) => i }) {
|
|
2783
2828
|
return {
|
|
2784
|
-
scanSite: (i = {}) =>
|
|
2829
|
+
scanSite: (i = {}) => Wn({
|
|
2785
2830
|
accountId: e,
|
|
2786
2831
|
getPageType: t,
|
|
2787
2832
|
getProduct: r,
|
|
@@ -2789,33 +2834,33 @@ function Di({ accountId: e, getPageType: t, getProduct: r, getProducts: n, norma
|
|
|
2789
2834
|
normalizeProduct: o,
|
|
2790
2835
|
input: i
|
|
2791
2836
|
}),
|
|
2792
|
-
siteGrep: (i = {}) =>
|
|
2793
|
-
discoverSiteContent: (i = {}) =>
|
|
2794
|
-
runSiteCommand: (i = {}) =>
|
|
2795
|
-
describeVisualContext: (i = {}) =>
|
|
2796
|
-
inspectProductSurface:
|
|
2837
|
+
siteGrep: (i = {}) => Vn(i),
|
|
2838
|
+
discoverSiteContent: (i = {}) => ct(i, e),
|
|
2839
|
+
runSiteCommand: (i = {}) => Kn(i),
|
|
2840
|
+
describeVisualContext: (i = {}) => Jn(i, e),
|
|
2841
|
+
inspectProductSurface: mt({
|
|
2797
2842
|
accountId: e,
|
|
2798
2843
|
getPageType: t,
|
|
2799
2844
|
getProduct: r,
|
|
2800
2845
|
getProducts: n,
|
|
2801
2846
|
normalizeProduct: o
|
|
2802
2847
|
}),
|
|
2803
|
-
getSiteCapabilities: () =>
|
|
2848
|
+
getSiteCapabilities: () => Qn(e)
|
|
2804
2849
|
};
|
|
2805
2850
|
}
|
|
2806
|
-
function
|
|
2807
|
-
const a =
|
|
2851
|
+
function Wn({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o, input: i }) {
|
|
2852
|
+
const a = _(i.query || i.text || ""), s = ve(i), c = ne(r), d = ne(n) || [];
|
|
2808
2853
|
return xe({
|
|
2809
2854
|
accountId: e,
|
|
2810
|
-
url:
|
|
2811
|
-
title:
|
|
2855
|
+
url: po(),
|
|
2856
|
+
title: P(document.title || ""),
|
|
2812
2857
|
pageType: ne(t) || "other",
|
|
2813
|
-
viewport:
|
|
2814
|
-
product:
|
|
2815
|
-
products: d.map(o).map(
|
|
2816
|
-
content: i.includeContent === !1 ? void 0 :
|
|
2817
|
-
headings:
|
|
2818
|
-
controls: i.includeControls === !1 ? void 0 :
|
|
2858
|
+
viewport: mo(),
|
|
2859
|
+
product: Be(o(c)),
|
|
2860
|
+
products: d.map(o).map(Be).filter(Boolean).slice(0, s.products),
|
|
2861
|
+
content: i.includeContent === !1 ? void 0 : ct(i, e).items,
|
|
2862
|
+
headings: Xn(s.headings),
|
|
2863
|
+
controls: i.includeControls === !1 ? void 0 : eo(s.controls),
|
|
2819
2864
|
textMatches: a ? be(a, s) : [],
|
|
2820
2865
|
privacy: {
|
|
2821
2866
|
rawHtml: !1,
|
|
@@ -2825,22 +2870,22 @@ function On({ accountId: e, getPageType: t, getProduct: r, getProducts: n, norma
|
|
|
2825
2870
|
}
|
|
2826
2871
|
});
|
|
2827
2872
|
}
|
|
2828
|
-
function
|
|
2829
|
-
const r = ve(e), n = new Set(
|
|
2873
|
+
function ct(e = {}, t = "") {
|
|
2874
|
+
const r = ve(e), n = new Set(no(e.kinds || e.kind)), o = to(r.controls).filter((i) => !n.size || n.has(i.kind)).slice(0, r.controls);
|
|
2830
2875
|
return {
|
|
2831
2876
|
accountId: t,
|
|
2832
2877
|
items: o,
|
|
2833
2878
|
count: o.length,
|
|
2834
|
-
privacy:
|
|
2879
|
+
privacy: R()
|
|
2835
2880
|
};
|
|
2836
2881
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const t =
|
|
2882
|
+
function Vn(e = {}) {
|
|
2883
|
+
const t = _(e.query || e.text || e.pattern || "");
|
|
2839
2884
|
if (!t) return {
|
|
2840
2885
|
ok: !1,
|
|
2841
2886
|
matches: [],
|
|
2842
2887
|
message: "Provide a query to scan visible page text.",
|
|
2843
|
-
privacy:
|
|
2888
|
+
privacy: R()
|
|
2844
2889
|
};
|
|
2845
2890
|
const r = be(t, ve(e));
|
|
2846
2891
|
return {
|
|
@@ -2848,34 +2893,34 @@ function Bn(e = {}) {
|
|
|
2848
2893
|
query: t,
|
|
2849
2894
|
matches: r,
|
|
2850
2895
|
count: r.length,
|
|
2851
|
-
privacy:
|
|
2896
|
+
privacy: R()
|
|
2852
2897
|
};
|
|
2853
2898
|
}
|
|
2854
|
-
function
|
|
2855
|
-
const t =
|
|
2856
|
-
return t === "scroll_to_text" || t === "scrolltotext" ?
|
|
2899
|
+
function Kn(e = {}) {
|
|
2900
|
+
const t = _(e.command || e.action || "").toLowerCase();
|
|
2901
|
+
return t === "scroll_to_text" || t === "scrolltotext" ? Yn(e) : t === "click_visible_text" || t === "clickvisibletext" ? Zn(e) : t === "scroll_top" || t === "scrolltotop" ? (window.scrollTo({
|
|
2857
2902
|
top: 0,
|
|
2858
2903
|
behavior: "smooth"
|
|
2859
2904
|
}), {
|
|
2860
2905
|
ok: !0,
|
|
2861
2906
|
command: "scroll_top",
|
|
2862
2907
|
message: "Scrolled to the top of the page.",
|
|
2863
|
-
privacy:
|
|
2908
|
+
privacy: R()
|
|
2864
2909
|
}) : {
|
|
2865
2910
|
ok: !1,
|
|
2866
2911
|
command: t,
|
|
2867
2912
|
message: "Supported commands are scroll_to_text, click_visible_text, and scroll_top.",
|
|
2868
|
-
privacy:
|
|
2913
|
+
privacy: R()
|
|
2869
2914
|
};
|
|
2870
2915
|
}
|
|
2871
|
-
function
|
|
2872
|
-
const r = e.visual_consent === !0 || e.visualConsent === !0 || e.consent === !0, n = r ?
|
|
2916
|
+
function Jn(e = {}, t) {
|
|
2917
|
+
const r = e.visual_consent === !0 || e.visualConsent === !0 || e.consent === !0, n = r ? io(e.visual_observations || e.visualObservations) : [], o = oo(Number(e.maxImages || 8));
|
|
2873
2918
|
return {
|
|
2874
2919
|
accountId: t,
|
|
2875
2920
|
ok: r || o.length > 0,
|
|
2876
2921
|
consentedObservations: n,
|
|
2877
2922
|
visibleImages: o,
|
|
2878
|
-
message:
|
|
2923
|
+
message: ao({
|
|
2879
2924
|
consented: r,
|
|
2880
2925
|
observations: n,
|
|
2881
2926
|
visibleImages: o
|
|
@@ -2890,8 +2935,8 @@ function Dn(e = {}, t) {
|
|
|
2890
2935
|
}
|
|
2891
2936
|
};
|
|
2892
2937
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const t =
|
|
2938
|
+
function Yn(e) {
|
|
2939
|
+
const t = _(e.query || e.text || e.label || ""), r = t ? lo(t) : null;
|
|
2895
2940
|
return r ? (r.scrollIntoView({
|
|
2896
2941
|
block: "center",
|
|
2897
2942
|
inline: "nearest",
|
|
@@ -2899,17 +2944,17 @@ function zn(e) {
|
|
|
2899
2944
|
}), {
|
|
2900
2945
|
ok: !0,
|
|
2901
2946
|
command: "scroll_to_text",
|
|
2902
|
-
label:
|
|
2947
|
+
label: $(r),
|
|
2903
2948
|
message: "Scrolled to the matching page area.",
|
|
2904
|
-
privacy:
|
|
2949
|
+
privacy: R()
|
|
2905
2950
|
}) : {
|
|
2906
2951
|
ok: !1,
|
|
2907
2952
|
command: "scroll_to_text",
|
|
2908
2953
|
message: "No visible matching text found."
|
|
2909
2954
|
};
|
|
2910
2955
|
}
|
|
2911
|
-
function
|
|
2912
|
-
const t =
|
|
2956
|
+
function Zn(e) {
|
|
2957
|
+
const t = _(e.label || e.query || e.text || "");
|
|
2913
2958
|
if (!t) return {
|
|
2914
2959
|
ok: !1,
|
|
2915
2960
|
command: "click_visible_text",
|
|
@@ -2920,31 +2965,31 @@ function Gn(e) {
|
|
|
2920
2965
|
blocked: !0,
|
|
2921
2966
|
command: "click_visible_text",
|
|
2922
2967
|
message: "This looks like a checkout, payment, destructive, or final confirmation action, so it was not clicked.",
|
|
2923
|
-
privacy:
|
|
2968
|
+
privacy: R()
|
|
2924
2969
|
};
|
|
2925
|
-
const r =
|
|
2970
|
+
const r = co(t);
|
|
2926
2971
|
if (!r) return {
|
|
2927
2972
|
ok: !1,
|
|
2928
2973
|
command: "click_visible_text",
|
|
2929
2974
|
message: "No safe visible clickable control found."
|
|
2930
2975
|
};
|
|
2931
|
-
const n =
|
|
2976
|
+
const n = $(r);
|
|
2932
2977
|
return J.test(n) ? {
|
|
2933
2978
|
ok: !1,
|
|
2934
2979
|
blocked: !0,
|
|
2935
2980
|
command: "click_visible_text",
|
|
2936
2981
|
label: n,
|
|
2937
2982
|
message: "The matched control is blocked by the safe-click policy.",
|
|
2938
|
-
privacy:
|
|
2983
|
+
privacy: R()
|
|
2939
2984
|
} : (r.click(), {
|
|
2940
2985
|
ok: !0,
|
|
2941
2986
|
command: "click_visible_text",
|
|
2942
2987
|
label: n,
|
|
2943
2988
|
message: "Clicked the safe visible control.",
|
|
2944
|
-
privacy:
|
|
2989
|
+
privacy: R()
|
|
2945
2990
|
});
|
|
2946
2991
|
}
|
|
2947
|
-
function
|
|
2992
|
+
function Qn(e) {
|
|
2948
2993
|
return {
|
|
2949
2994
|
accountId: e,
|
|
2950
2995
|
tools: [
|
|
@@ -2972,21 +3017,21 @@ function Hn(e) {
|
|
|
2972
3017
|
]
|
|
2973
3018
|
};
|
|
2974
3019
|
}
|
|
2975
|
-
function
|
|
2976
|
-
return [...document.querySelectorAll('h1,h2,h3,[role="heading"]')].filter(j).map((t) =>
|
|
3020
|
+
function Xn(e) {
|
|
3021
|
+
return [...document.querySelectorAll('h1,h2,h3,[role="heading"]')].filter(j).map((t) => P(_(t.textContent))).filter(Boolean).slice(0, e);
|
|
2977
3022
|
}
|
|
2978
|
-
function
|
|
3023
|
+
function eo(e) {
|
|
2979
3024
|
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).map((t) => ({
|
|
2980
|
-
label:
|
|
3025
|
+
label: $(t),
|
|
2981
3026
|
tag: t.tagName?.toLowerCase(),
|
|
2982
3027
|
role: t.getAttribute?.("role") || null,
|
|
2983
|
-
href:
|
|
2984
|
-
safeClick: !J.test(
|
|
3028
|
+
href: lt(t),
|
|
3029
|
+
safeClick: !J.test($(t))
|
|
2985
3030
|
})).filter((t) => t.label).filter(X((t) => `${t.tag}:${t.label}:${t.href || ""}`)).slice(0, e);
|
|
2986
3031
|
}
|
|
2987
|
-
function
|
|
3032
|
+
function to(e) {
|
|
2988
3033
|
return [...document.querySelectorAll('a[href],button,[role="button"],summary')].filter(j).map((t) => {
|
|
2989
|
-
const r =
|
|
3034
|
+
const r = $(t), n = lt(t), o = ro([
|
|
2990
3035
|
r,
|
|
2991
3036
|
n,
|
|
2992
3037
|
le(t)
|
|
@@ -3000,37 +3045,37 @@ function Kn(e) {
|
|
|
3000
3045
|
}) : null;
|
|
3001
3046
|
}).filter(Boolean).filter(X((t) => `${t.kind}:${t.label}:${t.href || ""}`)).slice(0, Math.max(1, Math.min(e, 30)));
|
|
3002
3047
|
}
|
|
3003
|
-
function
|
|
3004
|
-
for (const [t, r] of Object.entries(
|
|
3048
|
+
function ro(e) {
|
|
3049
|
+
for (const [t, r] of Object.entries(Hn)) if (r.test(e)) return t;
|
|
3005
3050
|
return "";
|
|
3006
3051
|
}
|
|
3007
|
-
function
|
|
3008
|
-
return (Array.isArray(e) ? e : String(e || "").split(/[,|]/u)).map((t) =>
|
|
3052
|
+
function no(e) {
|
|
3053
|
+
return (Array.isArray(e) ? e : String(e || "").split(/[,|]/u)).map((t) => _(t).toLowerCase()).filter(Boolean);
|
|
3009
3054
|
}
|
|
3010
3055
|
function be(e, t) {
|
|
3011
3056
|
const r = e.toLocaleLowerCase("tr-TR");
|
|
3012
|
-
return
|
|
3057
|
+
return so(document.body).map((n) => ({
|
|
3013
3058
|
node: n,
|
|
3014
|
-
text:
|
|
3059
|
+
text: _(n.nodeValue || "")
|
|
3015
3060
|
})).filter(({ text: n }) => n && n.toLocaleLowerCase("tr-TR").includes(r)).map(({ node: n, text: o }) => ({
|
|
3016
|
-
snippet:
|
|
3061
|
+
snippet: uo(o, e, t.snippetChars),
|
|
3017
3062
|
tag: n.parentElement?.tagName?.toLowerCase() || "",
|
|
3018
3063
|
heading: le(n.parentElement)
|
|
3019
3064
|
})).filter((n) => n.snippet).filter(X((n) => n.snippet)).slice(0, t.textMatches);
|
|
3020
3065
|
}
|
|
3021
|
-
function
|
|
3066
|
+
function oo(e) {
|
|
3022
3067
|
return [...document.querySelectorAll("img")].filter(j).map((t) => ({
|
|
3023
|
-
alt:
|
|
3024
|
-
title:
|
|
3068
|
+
alt: P(_(t.getAttribute("alt") || t.getAttribute("aria-label") || "")),
|
|
3069
|
+
title: P(_(t.getAttribute("title") || "")),
|
|
3025
3070
|
src: ye(t.currentSrc || t.getAttribute("src")),
|
|
3026
3071
|
width: Math.round(t.getBoundingClientRect().width),
|
|
3027
3072
|
height: Math.round(t.getBoundingClientRect().height)
|
|
3028
3073
|
})).filter((t) => t.alt || t.title || t.src).filter(X((t) => `${t.alt}:${t.title}:${t.src}`)).slice(0, Math.max(1, Math.min(Number.isFinite(e) && e > 0 ? Math.floor(e) : 8, 20)));
|
|
3029
3074
|
}
|
|
3030
|
-
function
|
|
3031
|
-
return (Array.isArray(e) ? e : String(e || "").split(/\n|;|\|/u)).map((t) =>
|
|
3075
|
+
function io(e) {
|
|
3076
|
+
return (Array.isArray(e) ? e : String(e || "").split(/\n|;|\|/u)).map((t) => P(t).slice(0, 180)).filter(Boolean).slice(0, 8);
|
|
3032
3077
|
}
|
|
3033
|
-
function
|
|
3078
|
+
function ao({ consented: e, observations: t, visibleImages: r }) {
|
|
3034
3079
|
const n = [];
|
|
3035
3080
|
if (t.length && n.push(`Consented visual observations: ${t.slice(0, 3).join(" | ")}.`), r.length) {
|
|
3036
3081
|
const o = r.map((i) => i.alt || i.title).filter(Boolean).slice(0, 3);
|
|
@@ -3038,11 +3083,11 @@ function Xn({ consented: e, observations: t, visibleImages: r }) {
|
|
|
3038
3083
|
}
|
|
3039
3084
|
return !n.length && !e && n.push("I can use visible image labels, but external visual observations need explicit shopper consent."), n.push("No screenshots or pixels were captured or sent."), n.join(" ");
|
|
3040
3085
|
}
|
|
3041
|
-
function
|
|
3086
|
+
function so(e) {
|
|
3042
3087
|
if (!e) return [];
|
|
3043
3088
|
const t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(n) {
|
|
3044
3089
|
const o = n.parentElement;
|
|
3045
|
-
return !o || !j(o) || /^(script|style|noscript|template|svg)$/iu.test(o.tagName || "") ||
|
|
3090
|
+
return !o || !j(o) || /^(script|style|noscript|template|svg)$/iu.test(o.tagName || "") || fo(o) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3046
3091
|
} }), r = [];
|
|
3047
3092
|
for (; r.length < 500; ) {
|
|
3048
3093
|
const n = t.nextNode();
|
|
@@ -3051,42 +3096,42 @@ function eo(e) {
|
|
|
3051
3096
|
}
|
|
3052
3097
|
return r;
|
|
3053
3098
|
}
|
|
3054
|
-
function
|
|
3055
|
-
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) =>
|
|
3099
|
+
function co(e) {
|
|
3100
|
+
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) => $(t).toLocaleLowerCase("tr-TR").includes(e.toLocaleLowerCase("tr-TR")));
|
|
3056
3101
|
}
|
|
3057
|
-
function
|
|
3102
|
+
function lo(e) {
|
|
3058
3103
|
const t = be(e, {
|
|
3059
|
-
...
|
|
3104
|
+
...N,
|
|
3060
3105
|
textMatches: 1
|
|
3061
3106
|
})[0];
|
|
3062
|
-
return t ? [...document.querySelectorAll("body *")].filter(j).find((r) =>
|
|
3107
|
+
return t ? [...document.querySelectorAll("body *")].filter(j).find((r) => _(r.textContent).includes(t.snippet.slice(0, 24))) : null;
|
|
3063
3108
|
}
|
|
3064
|
-
function
|
|
3065
|
-
return e ?
|
|
3109
|
+
function $(e) {
|
|
3110
|
+
return e ? P(_(e.getAttribute?.("aria-label") || e.getAttribute?.("title") || e.getAttribute?.("alt") || e.value || e.textContent || "")).slice(0, 90) : "";
|
|
3066
3111
|
}
|
|
3067
3112
|
function le(e) {
|
|
3068
3113
|
let t = e;
|
|
3069
3114
|
for (let r = 0; t && r < 5; r += 1) {
|
|
3070
|
-
const n =
|
|
3071
|
-
if (n) return
|
|
3115
|
+
const n = _((t.matches?.('h1,h2,h3,[role="heading"]') ? t : t.querySelector?.('h1,h2,h3,[role="heading"]'))?.textContent || "");
|
|
3116
|
+
if (n) return P(n).slice(0, 90);
|
|
3072
3117
|
t = t.parentElement;
|
|
3073
3118
|
}
|
|
3074
3119
|
return "";
|
|
3075
3120
|
}
|
|
3076
|
-
function
|
|
3121
|
+
function Be(e) {
|
|
3077
3122
|
return e ? xe({
|
|
3078
|
-
sku:
|
|
3079
|
-
name:
|
|
3123
|
+
sku: _(e.sku || e.id || ""),
|
|
3124
|
+
name: _(e.name || e.title || ""),
|
|
3080
3125
|
url: ye(e.url),
|
|
3081
|
-
price_text:
|
|
3126
|
+
price_text: _(e.price_text || e.priceText || ""),
|
|
3082
3127
|
price: e.price,
|
|
3083
3128
|
currency: e.price_currency || e.currency,
|
|
3084
3129
|
in_stock: e.in_stock,
|
|
3085
|
-
category:
|
|
3130
|
+
category: _(e.category || "")
|
|
3086
3131
|
}) : null;
|
|
3087
3132
|
}
|
|
3088
|
-
function
|
|
3089
|
-
const n =
|
|
3133
|
+
function uo(e, t, r) {
|
|
3134
|
+
const n = P(e), o = n.toLocaleLowerCase("tr-TR").indexOf(t.toLocaleLowerCase("tr-TR")), i = Math.max(0, o - Math.floor(r / 3));
|
|
3090
3135
|
return n.slice(i, i + r).trim();
|
|
3091
3136
|
}
|
|
3092
3137
|
function j(e) {
|
|
@@ -3096,10 +3141,10 @@ function j(e) {
|
|
|
3096
3141
|
const r = window.getComputedStyle(e);
|
|
3097
3142
|
return r.visibility !== "hidden" && r.display !== "none" && Number(r.opacity || 1) > 0;
|
|
3098
3143
|
}
|
|
3099
|
-
function
|
|
3144
|
+
function fo(e) {
|
|
3100
3145
|
return !!e.closest?.('input,textarea,select,[contenteditable="true"]');
|
|
3101
3146
|
}
|
|
3102
|
-
function
|
|
3147
|
+
function lt(e) {
|
|
3103
3148
|
return e.tagName?.toLowerCase() !== "a" ? null : ye(e.getAttribute("href"));
|
|
3104
3149
|
}
|
|
3105
3150
|
function ye(e) {
|
|
@@ -3111,11 +3156,11 @@ function ye(e) {
|
|
|
3111
3156
|
return "";
|
|
3112
3157
|
}
|
|
3113
3158
|
}
|
|
3114
|
-
function
|
|
3159
|
+
function po() {
|
|
3115
3160
|
const e = new URL(window.location.href);
|
|
3116
3161
|
return we(e), `${e.origin}${e.pathname}${e.search}`;
|
|
3117
3162
|
}
|
|
3118
|
-
function
|
|
3163
|
+
function mo() {
|
|
3119
3164
|
return {
|
|
3120
3165
|
width: window.innerWidth,
|
|
3121
3166
|
height: window.innerHeight,
|
|
@@ -3123,10 +3168,10 @@ function ao() {
|
|
|
3123
3168
|
documentHeight: Math.round(document.documentElement?.scrollHeight || 0)
|
|
3124
3169
|
};
|
|
3125
3170
|
}
|
|
3126
|
-
function
|
|
3127
|
-
return
|
|
3171
|
+
function P(e) {
|
|
3172
|
+
return _(e).replace(/https?:\/\/[^\s?#]+(?:\?[^#\s]*)?/giu, go).replace(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/giu, "<email>").replace(/\b(?:\+?\d[\d\s().-]{8,}\d)\b/gu, "<phone>").replace(/\b[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}\b/giu, "<postcode>").replace(/\btoken\s*=\s*[\w.-]+/giu, "token=<redacted>").replace(/\b(?:api[_-]?key|session|csrf|secret)\s*[:=]\s*[\w.-]+/giu, "<secret>");
|
|
3128
3173
|
}
|
|
3129
|
-
function
|
|
3174
|
+
function go(e) {
|
|
3130
3175
|
try {
|
|
3131
3176
|
const t = new URL(e);
|
|
3132
3177
|
return t.hash = "", we(t), t.href;
|
|
@@ -3137,27 +3182,27 @@ function so(e) {
|
|
|
3137
3182
|
function we(e) {
|
|
3138
3183
|
for (const [t, r] of [...e.searchParams.entries()]) {
|
|
3139
3184
|
const n = String(r || "");
|
|
3140
|
-
(
|
|
3185
|
+
(Gn.test(t) || zn.test(n)) && e.searchParams.set(t, "redacted");
|
|
3141
3186
|
}
|
|
3142
3187
|
return e;
|
|
3143
3188
|
}
|
|
3144
|
-
function
|
|
3189
|
+
function _(e) {
|
|
3145
3190
|
return String(e || "").replace(/\s+/gu, " ").trim();
|
|
3146
3191
|
}
|
|
3147
3192
|
function ve(e) {
|
|
3148
3193
|
return {
|
|
3149
|
-
headings:
|
|
3150
|
-
products:
|
|
3151
|
-
controls:
|
|
3152
|
-
textMatches:
|
|
3153
|
-
snippetChars:
|
|
3194
|
+
headings: D(e.maxHeadings, N.headings, 20),
|
|
3195
|
+
products: D(e.maxProducts, N.products, 20),
|
|
3196
|
+
controls: D(e.maxControls, N.controls, 30),
|
|
3197
|
+
textMatches: D(e.maxMatches || e.limit, N.textMatches, 20),
|
|
3198
|
+
snippetChars: D(e.snippetChars, N.snippetChars, 320)
|
|
3154
3199
|
};
|
|
3155
3200
|
}
|
|
3156
|
-
function
|
|
3201
|
+
function D(e, t, r) {
|
|
3157
3202
|
const n = Number(e);
|
|
3158
3203
|
return !Number.isFinite(n) || n <= 0 ? t : Math.min(Math.floor(n), r);
|
|
3159
3204
|
}
|
|
3160
|
-
function
|
|
3205
|
+
function R() {
|
|
3161
3206
|
return {
|
|
3162
3207
|
rawHtml: !1,
|
|
3163
3208
|
formValues: !1,
|
|
@@ -3183,124 +3228,124 @@ function X(e) {
|
|
|
3183
3228
|
};
|
|
3184
3229
|
}
|
|
3185
3230
|
export {
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3231
|
+
vi as AgentError,
|
|
3232
|
+
bt as ContextStore,
|
|
3233
|
+
Zo as FALLBACK_STATUS,
|
|
3234
|
+
Ko as action,
|
|
3235
|
+
ui as actionButtonsUiSpec,
|
|
3236
|
+
Lo as alignProductsToTable,
|
|
3237
|
+
Ho as anonymousRequestText,
|
|
3238
|
+
li as beErrorToAgentError,
|
|
3239
|
+
wr as buildActivityVisualization,
|
|
3240
|
+
bo as buildPhotoSimilarityProfile,
|
|
3241
|
+
yo as buildProductSimilarityProfile,
|
|
3242
|
+
wo as buildSimilarityQueries,
|
|
3243
|
+
Ze as canUseModuleWorker,
|
|
3244
|
+
pt as caughtToStreamError,
|
|
3245
|
+
Ao as compactAccountConfig,
|
|
3246
|
+
Go as compactContextProducts,
|
|
3247
|
+
si as compactObject,
|
|
3248
|
+
xi as compactProductSurfaceForLlm,
|
|
3249
|
+
Io as comparisonResultForUi,
|
|
3250
|
+
Oo as comparisonUiSpec,
|
|
3251
|
+
fr as createActivityCollector,
|
|
3252
|
+
Ge as createBrowserMemory,
|
|
3253
|
+
Fi as createDiagnosticsTool,
|
|
3254
|
+
Ni as createEndpointCachePolicies,
|
|
3255
|
+
Ii as createEndpointHandlers,
|
|
3256
|
+
Co as createFlow,
|
|
3257
|
+
zi as createGssToolAliases,
|
|
3258
|
+
Hi as createIframeScraper,
|
|
3259
|
+
kt as createInjectorAdapter,
|
|
3260
|
+
Qo as createLocalRefStore,
|
|
3261
|
+
Et as createMainThreadInjectorAdapter,
|
|
3262
|
+
ir as createModuleWorker,
|
|
3263
|
+
Vi as createOpenProductPageTool,
|
|
3264
|
+
oi as createPrivacyHelpers,
|
|
3265
|
+
mt as createProductSurfaceInspector,
|
|
3266
|
+
ai as createReadPageStep,
|
|
3267
|
+
Mi as createReadPageTool,
|
|
3268
|
+
Ki as createResolveProductsTool,
|
|
3269
|
+
Ji as createSiteAwarenessTools,
|
|
3270
|
+
ei as declarativeBeOpCache,
|
|
3271
|
+
Po as defaultPiiPatternPack,
|
|
3272
|
+
Ro as defaultPiiPatterns,
|
|
3273
|
+
Yo as done,
|
|
3274
|
+
ri as elapsedMs,
|
|
3275
|
+
ar as endpointStableKey,
|
|
3276
|
+
Do as error,
|
|
3277
|
+
Ti as fallbackStatus,
|
|
3278
|
+
tn as filterActivityEntries,
|
|
3279
|
+
ki as firstArrayValue,
|
|
3280
|
+
wn as formatJsonHtml,
|
|
3281
|
+
pr as getOrCreateActivityCollector,
|
|
3282
|
+
br as groupForEntry,
|
|
3283
|
+
jn as gssSearchCapabilities,
|
|
3284
|
+
pi as homePanelReset,
|
|
3285
|
+
hi as httpErrorToAgentError,
|
|
3286
|
+
Ri as inputHashCachePolicy,
|
|
3287
|
+
fi as inspectProductSurface,
|
|
3288
|
+
Mr as installActivityFetchPatch,
|
|
3289
|
+
$i as installBrowserTools,
|
|
3290
|
+
Li as installFetchTransportBridge,
|
|
3291
|
+
Wi as installIframeScraperBypass,
|
|
3292
|
+
Gi as installLocalAgenticActivityDebug,
|
|
3293
|
+
Pi as isFallbackStatus,
|
|
3294
|
+
Ci as isRef,
|
|
3295
|
+
qi as jsonResponse,
|
|
3296
|
+
Vo as llmCacheKey,
|
|
3297
|
+
Ei as mergeProductSurfaceEvidence,
|
|
3298
|
+
To as metadata,
|
|
3299
|
+
ji as mountAccount,
|
|
3300
|
+
Zr as mountActivityOverlay,
|
|
3301
|
+
$n as navigateSameTab,
|
|
3302
|
+
Ui as ndjsonResponse,
|
|
3303
|
+
Bo as normalizeComparisonTable,
|
|
3304
|
+
mr as normalizeEntry,
|
|
3305
|
+
qo as normalizeProduct,
|
|
3306
|
+
On as normalizeSameOriginUrl,
|
|
3307
|
+
vo as normalizeSimilarityText,
|
|
3308
|
+
ii as nowIso,
|
|
3309
|
+
bi as plainMessageContent,
|
|
3310
|
+
$o as productDetailsUiSpec,
|
|
3311
|
+
No as productFactsKey,
|
|
3312
|
+
Wo as productSkuKey,
|
|
3313
|
+
ti as productSurfaceReviewText,
|
|
3314
|
+
Fo as productsUiSpec,
|
|
3315
|
+
xo as rankSimilarProducts,
|
|
3316
|
+
ko as rankSimilarProductsAsync,
|
|
3317
|
+
Re as recordBeDebugPayload,
|
|
3318
|
+
Mo as redactPii,
|
|
3319
|
+
di as requestText,
|
|
3320
|
+
Oi as resolveBeUrl,
|
|
3321
|
+
Jo as resolveFlow,
|
|
3322
|
+
Fn as resolveProductCandidates,
|
|
3323
|
+
ci as retailAnonymizeMessages,
|
|
3324
|
+
Xo as retailAnonymousRequestText,
|
|
3325
|
+
gi as retailRedactPii,
|
|
3326
|
+
mi as routeFlowParams,
|
|
3327
|
+
wi as routeSkuList,
|
|
3328
|
+
_o as scoreSimilarityCandidate,
|
|
3329
|
+
gr as sectionForKind,
|
|
3330
|
+
Bi as setAssistantHostVisible,
|
|
3331
|
+
hr as severityForEntry,
|
|
3332
|
+
Sn as shouldInstallActivityDebug,
|
|
3288
3333
|
ue as stableKey,
|
|
3289
|
-
|
|
3290
|
-
|
|
3334
|
+
Di as startLazyRuntimeLoader,
|
|
3335
|
+
Si as stickyContextKey,
|
|
3291
3336
|
Y as summarizeDebugState,
|
|
3292
3337
|
ae as summarizePanelState,
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3338
|
+
Qe as summarizeUiSpec,
|
|
3339
|
+
ni as textChunk,
|
|
3340
|
+
jo as textKey,
|
|
3341
|
+
Eo as tokenizeSimilarityText,
|
|
3342
|
+
yi as trimProductFactsCore,
|
|
3343
|
+
Uo as trimProductFactsListCore,
|
|
3344
|
+
_i as uiSpec,
|
|
3345
|
+
Dn as uniqueProductsBySku,
|
|
3346
|
+
Ai as withAccountConfig,
|
|
3347
|
+
zo as withDeclarativeBeOpCache,
|
|
3348
|
+
Or as wrapActivityBeacon,
|
|
3349
|
+
Br as wrapActivityTools,
|
|
3350
|
+
$r as wrapActivityTransport
|
|
3306
3351
|
};
|