@gengage/assistant-fe 0.6.11 → 0.6.13
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/adaptor/mount.d.ts +1 -0
- package/dist/agentic/context/context-store.d.ts +2 -1
- package/dist/agentic/context/persistence.d.ts +2 -1
- package/dist/agentic/index.d.ts +3 -1
- package/dist/agentic/index.js +244 -240
- package/dist/agentic/types.d.ts +39 -21
- package/dist/agentic/util/browser-memory.d.ts +2 -2
- package/dist/agentic/util/cache-key.d.ts +15 -0
- package/dist/agentic/worker/be-client.d.ts +3 -1
- package/dist/agentic/worker.d.ts +3 -1
- package/dist/agentic/worker.js +92 -86
- package/dist/agentic.iife.js +5 -5
- package/dist/{api-paths-D65Uavfh.js → api-paths-ChCMvKkx.js} +1 -1
- package/dist/{chat-CrEa2W-e.js → chat-BP-yXukW.js} +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +17 -17
- package/dist/chat.js +2 -2
- package/dist/common/request-response-cache.d.ts +9 -0
- package/dist/{common-D9p39tcK.js → common-BD_DSsqY.js} +3 -3
- package/dist/common.js +7 -7
- package/dist/{connection-warning-B4WXvW_P.js → connection-warning-CPeEsQ35.js} +1 -1
- package/dist/{fastIntent-CtaxOsQe.js → fastIntent-C1WeEqW8.js} +1 -1
- package/dist/index.js +12 -12
- package/dist/{native-webview-BlHM7cLs.js → native-webview-DbKq9lN8.js} +1 -1
- package/dist/native.iife.js +14 -14
- package/dist/native.js +1 -1
- package/dist/overlay.js +1 -1
- package/dist/{qna-BNvttR6s.js → qna-B3lMzHvS.js} +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +13 -13
- package/dist/qna.js +2 -2
- package/dist/request-response-cache-zsgz3Awp.js +154 -0
- package/dist/request-text-su3Vlhrs.js +1318 -0
- package/dist/{runtime-BozDJELC.js → runtime-Dbwwd8yF.js} +38 -37
- package/dist/{runtime-CDjc7MP2.js → runtime-DclobJaN.js} +365 -364
- package/dist/{runtime-Brx9ReJA.js → runtime-Duvrignh.js} +69 -68
- package/dist/{simbut-DFRlkncH.js → simbut-5C5EAfoM.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-Cizk0RY8.js → simrel-DCcSBFez.js} +3 -3
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +12 -12
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-Bux39ZWf.js → widget-base-BolzGV28.js} +1 -1
- package/package.json +1 -1
- package/dist/agentic/flow/beauty-consulting-turn.d.ts +0 -1
- package/dist/similarity-CqRK9i75.js +0 -1251
- /package/dist/{overlay-fgrzmFTR.js → overlay-CyoB1K0w.js} +0 -0
- /package/dist/{price-formatter-xI3g9Cd4.js → price-formatter-CFsWT0lP.js} +0 -0
- /package/dist/{schemas-CLo8wCjs.js → schemas-Cq2blsO_.js} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { d as x, h as Q, p as R, r as N, t as H } from "./api-paths-
|
|
1
|
+
import { d as x, h as Q, p as R, r as N, t as H } from "./api-paths-ChCMvKkx.js";
|
|
2
2
|
import { A as O, D as U, E as j, a as q, v as M } from "./context-BBuSsXZ9.js";
|
|
3
|
-
import { o as F, t as W } from "./widget-base-
|
|
3
|
+
import { o as F, t as W } from "./widget-base-BolzGV28.js";
|
|
4
4
|
import { t as A } from "./locale-CfqNifrU.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { t as D } from "./request-response-cache-zsgz3Awp.js";
|
|
6
|
+
import { n as z } from "./connection-warning-CPeEsQ35.js";
|
|
7
|
+
async function $(e, t, n) {
|
|
7
8
|
const o = H("launcher_action", t), i = {
|
|
8
9
|
uiSpecs: [],
|
|
9
10
|
actions: []
|
|
@@ -13,7 +14,7 @@ async function z(e, t, n) {
|
|
|
13
14
|
body: JSON.stringify(e)
|
|
14
15
|
};
|
|
15
16
|
n !== void 0 && (a.signal = n);
|
|
16
|
-
const l = await
|
|
17
|
+
const l = await D(o, a);
|
|
17
18
|
if (!l.ok) throw new Error(`HTTP ${l.status}: ${l.statusText}`);
|
|
18
19
|
const s = { onEvent: (c) => {
|
|
19
20
|
const r = N(c);
|
|
@@ -47,7 +48,7 @@ function T(e) {
|
|
|
47
48
|
}
|
|
48
49
|
return t;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function G(e) {
|
|
51
52
|
const t = document.createElement("div");
|
|
52
53
|
t.className = "gengage-qna-input-wrapper", t.dataset.gengagePart = "qna-input-wrapper";
|
|
53
54
|
const n = document.createElement("div");
|
|
@@ -176,7 +177,7 @@ var L = {
|
|
|
176
177
|
sendButtonText: t.i18n.sendButton,
|
|
177
178
|
sendQuestionAriaLabel: t.i18n.sendQuestionAriaLabel
|
|
178
179
|
};
|
|
179
|
-
return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i),
|
|
180
|
+
return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), G(a);
|
|
180
181
|
},
|
|
181
182
|
QuestionHeading: ({ element: e, context: t }) => {
|
|
182
183
|
const n = document.createElement("h3");
|
|
@@ -194,10 +195,10 @@ var L = {
|
|
|
194
195
|
}
|
|
195
196
|
return n;
|
|
196
197
|
};
|
|
197
|
-
function
|
|
198
|
+
function J() {
|
|
198
199
|
return { ...L };
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
+
function V(e, t, n = L, o = S) {
|
|
201
202
|
return Q({
|
|
202
203
|
spec: e,
|
|
203
204
|
context: t,
|
|
@@ -206,7 +207,7 @@ function J(e, t, n = L, o = S) {
|
|
|
206
207
|
unknownRenderer: o
|
|
207
208
|
});
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
+
function Y(e) {
|
|
210
211
|
if (!e) return;
|
|
211
212
|
const t = e.extra;
|
|
212
213
|
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
@@ -233,7 +234,7 @@ function P(e, t) {
|
|
|
233
234
|
};
|
|
234
235
|
return s !== void 0 && (c.payload = s), c;
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function Z(e, t) {
|
|
237
238
|
const n = e.elements[e.root];
|
|
238
239
|
if (!n) return !1;
|
|
239
240
|
const o = (i) => {
|
|
@@ -258,7 +259,7 @@ var I = 0;
|
|
|
258
259
|
function w() {
|
|
259
260
|
return I += 1, `gengage-merge-${I}`;
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function K(e, t) {
|
|
262
263
|
const n = e.elements[e.root];
|
|
263
264
|
if (!n || n.type !== "ButtonRow") return;
|
|
264
265
|
const o = w();
|
|
@@ -274,7 +275,7 @@ function Z(e, t) {
|
|
|
274
275
|
}
|
|
275
276
|
}, n.children = n.children ? [o, ...n.children] : [o];
|
|
276
277
|
}
|
|
277
|
-
function
|
|
278
|
+
function X(e, t) {
|
|
278
279
|
const n = e.elements[e.root];
|
|
279
280
|
if (!n || n.type !== "ActionButtons") return;
|
|
280
281
|
const o = w();
|
|
@@ -302,7 +303,7 @@ function K(e, t) {
|
|
|
302
303
|
buttons: [a, ...i]
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function tt(e) {
|
|
306
307
|
const t = {}, n = [];
|
|
307
308
|
for (let o = 0; o < e.length; o++) {
|
|
308
309
|
const i = e[o], a = `action-${o}`;
|
|
@@ -326,7 +327,7 @@ function X(e) {
|
|
|
326
327
|
elements: t
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function et(e) {
|
|
330
331
|
return e.find((t) => {
|
|
331
332
|
const n = t.elements[t.root];
|
|
332
333
|
return n?.type === "ActionButtons" || n?.type === "ButtonRow";
|
|
@@ -340,7 +341,7 @@ function k(e, t) {
|
|
|
340
341
|
payload: o
|
|
341
342
|
};
|
|
342
343
|
}
|
|
343
|
-
function
|
|
344
|
+
function nt(e, t, n) {
|
|
344
345
|
const o = n?.skuList, i = [], a = [];
|
|
345
346
|
for (const c of e) {
|
|
346
347
|
const r = c.elements[c.root];
|
|
@@ -354,11 +355,11 @@ function et(e, t, n) {
|
|
|
354
355
|
a.push(c);
|
|
355
356
|
}
|
|
356
357
|
if (i.length === 0) return e;
|
|
357
|
-
const l = k(t, o), s =
|
|
358
|
-
if (!s) return [...a,
|
|
359
|
-
if (!
|
|
358
|
+
const l = k(t, o), s = et(a);
|
|
359
|
+
if (!s) return [...a, tt([l])];
|
|
360
|
+
if (!Z(s, l.title)) {
|
|
360
361
|
const c = s.elements[s.root];
|
|
361
|
-
c?.type === "ActionButtons" ?
|
|
362
|
+
c?.type === "ActionButtons" ? X(s, l) : c?.type === "ButtonRow" && K(s, l);
|
|
362
363
|
}
|
|
363
364
|
return a;
|
|
364
365
|
}
|
|
@@ -371,7 +372,7 @@ var B = {
|
|
|
371
372
|
defaultCtaText: "Başka bir şey sor",
|
|
372
373
|
redirectingToChat: "Sohbete yönlendiriliyor...",
|
|
373
374
|
productContextQuickPillLabel: "Bu ürün hakkında ne bilmeliyim?"
|
|
374
|
-
},
|
|
375
|
+
}, ot = {
|
|
375
376
|
quickQuestionsAriaLabel: "Quick questions",
|
|
376
377
|
askQuestionAriaLabel: "Ask a question",
|
|
377
378
|
defaultInputPlaceholder: "Ask a question...",
|
|
@@ -381,13 +382,13 @@ var B = {
|
|
|
381
382
|
redirectingToChat: "Redirecting to chat...",
|
|
382
383
|
productContextQuickPillLabel: "What should I know about this product?"
|
|
383
384
|
};
|
|
384
|
-
function
|
|
385
|
+
function it(e) {
|
|
385
386
|
return e ? e.toLowerCase().split("-")[0] ?? "tr" : "tr";
|
|
386
387
|
}
|
|
387
|
-
function
|
|
388
|
-
return
|
|
388
|
+
function at(e) {
|
|
389
|
+
return it(e) === "en" ? ot : B;
|
|
389
390
|
}
|
|
390
|
-
var
|
|
391
|
+
var st = class extends W {
|
|
391
392
|
constructor(...e) {
|
|
392
393
|
super(...e), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = B, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
|
|
393
394
|
}
|
|
@@ -436,7 +437,7 @@ var at = class extends W {
|
|
|
436
437
|
this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
|
|
437
438
|
const t = this._createLoadingIndicator();
|
|
438
439
|
this._contentEl.appendChild(t);
|
|
439
|
-
const n = { middlewareUrl: this.config.middlewareUrl }, o =
|
|
440
|
+
const n = { middlewareUrl: this.config.middlewareUrl }, o = z({
|
|
440
441
|
source: "qna",
|
|
441
442
|
locale: this.config.locale
|
|
442
443
|
});
|
|
@@ -451,7 +452,7 @@ var at = class extends W {
|
|
|
451
452
|
this.config.session?.userId !== void 0 && (a.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (a.view_id = this.config.session.viewId);
|
|
452
453
|
const l = this.config.pageContext?.pageType;
|
|
453
454
|
l !== void 0 && (a.page_type = l);
|
|
454
|
-
const s = await
|
|
455
|
+
const s = await $(a, n, this._abortController.signal);
|
|
455
456
|
if (!this._contentEl) return;
|
|
456
457
|
this._contentEl.innerHTML = "";
|
|
457
458
|
const c = document.createElement("div");
|
|
@@ -473,7 +474,7 @@ var at = class extends W {
|
|
|
473
474
|
i18n: this._i18n
|
|
474
475
|
}, f = this._resolvedQnaHeaderTitle();
|
|
475
476
|
f !== void 0 && (h.headingTitleOverride = f), this.config.hideButtonRowCta || (h.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (h.ctaText = this.config.ctaText)), g !== void 0 && (h.inputPlaceholder = g);
|
|
476
|
-
const p = this._buildFallbackActionsSpec(s.actions), y =
|
|
477
|
+
const p = this._buildFallbackActionsSpec(s.actions), y = Y(this.config.pageContext), b = (s.uiSpecs.length > 0 ? nt(s.uiSpecs, this._i18n, { skuList: y }) : [p]).filter((d) => Object.keys(d.elements).length > 0);
|
|
477
478
|
for (const d of b) {
|
|
478
479
|
const _ = this._renderUISpec(d, h);
|
|
479
480
|
c.appendChild(_);
|
|
@@ -511,7 +512,7 @@ var at = class extends W {
|
|
|
511
512
|
}
|
|
512
513
|
_resolveI18n(e) {
|
|
513
514
|
return {
|
|
514
|
-
...
|
|
515
|
+
...at(e.locale),
|
|
515
516
|
...e.i18n
|
|
516
517
|
};
|
|
517
518
|
}
|
|
@@ -542,10 +543,10 @@ var at = class extends W {
|
|
|
542
543
|
return s.children.length === 0 ? null : s;
|
|
543
544
|
}
|
|
544
545
|
_resolveUISpecRegistry() {
|
|
545
|
-
return R(
|
|
546
|
+
return R(J(), this.config.renderer?.registry);
|
|
546
547
|
}
|
|
547
548
|
_renderUISpec(e, t) {
|
|
548
|
-
const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? S, i = (l, s) =>
|
|
549
|
+
const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? S, i = (l, s) => V(l, s, n, o), a = this.config.renderer?.renderUISpec;
|
|
549
550
|
return a ? a(e, t, {
|
|
550
551
|
registry: n,
|
|
551
552
|
unknownRenderer: o,
|
|
@@ -630,13 +631,13 @@ var at = class extends W {
|
|
|
630
631
|
}, 600);
|
|
631
632
|
}
|
|
632
633
|
};
|
|
633
|
-
function
|
|
634
|
-
return new
|
|
634
|
+
function gt() {
|
|
635
|
+
return new st();
|
|
635
636
|
}
|
|
636
637
|
export {
|
|
637
|
-
|
|
638
|
+
V as a,
|
|
638
639
|
S as i,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
640
|
+
gt as n,
|
|
641
|
+
J as r,
|
|
642
|
+
st as t
|
|
642
643
|
};
|