@gengage/assistant-fe 0.4.6 → 0.4.7
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/README.md +21 -1
- package/dist/{api-paths-C4GDpeTf.js → api-paths-DR5bPNhi.js} +2 -3
- package/dist/assistant-fe.css +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +2 -2
- package/dist/chat.js +1 -1
- package/dist/common/overlay.d.ts +4 -0
- package/dist/common/protocol-adapter.d.ts +1 -1
- package/dist/common/safe-html.d.ts +1 -1
- package/dist/{common-CEN5OW7E.js → common-c-awF96O.js} +3 -3
- package/dist/common.js +8 -8
- package/dist/{connection-warning-B6oIU-9s.js → connection-warning-ecZqpczd.js} +1 -1
- package/dist/{context-VIG4SVcS.js → context-DGz5F81j.js} +82 -79
- package/dist/index.d.ts +4 -4
- package/dist/index.js +44 -42
- package/dist/{native-webview-DudQ7nHe.js → native-webview-C_PmKnzm.js} +1 -1
- package/dist/native.iife.js +7 -7
- package/dist/native.js +1 -1
- package/dist/{overlay-1EO41ZC7.js → overlay-DJ1ZRMfI.js} +75 -75
- package/dist/overlay.js +2 -2
- package/dist/{pill-launcher-57nrdLRr.js → pill-launcher-DSEeJT9h.js} +2 -2
- package/dist/qna/runtime.d.ts +2 -1
- package/dist/qna/types.d.ts +14 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.css +1 -1
- package/dist/qna.iife.js +21 -21
- package/dist/qna.js +1 -1
- package/dist/{runtime-BdwZZIrO.js → runtime-BsZZ8zTg.js} +5 -4
- package/dist/{runtime-C0qZk0y7.js → runtime-DNbjpTCh.js} +4 -4
- package/dist/runtime-SKDvc0Xc.js +660 -0
- package/dist/simbut/index.d.ts +3 -1
- package/dist/simbut/types.d.ts +11 -0
- package/dist/simbut-Bw3vBFtW.js +109 -0
- package/dist/simbut.css +1 -1
- package/dist/simbut.iife.js +10 -10
- package/dist/simbut.js +1 -1
- package/dist/simrel/index.d.ts +2 -0
- package/dist/simrel/renderers/default.d.ts +40 -0
- package/dist/simrel-DJZ983BF.js +513 -0
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.css +3 -0
- package/dist/simrel.iife.js +38 -38
- package/dist/simrel.js +4 -3
- package/dist/{widget-base-TgwiA8cD.js → widget-base-2-B1Ch5I.js} +1 -1
- package/package.json +6 -1
- package/dist/runtime-DDu8Wk0z.js +0 -629
- package/dist/simbut-BMWC6x_t.js +0 -81
- package/dist/simrel-ohfkluhp.js +0 -55
package/dist/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, i as r, l as s, n as i, o as n, r as l, s as o, t as C, u as c } from "./runtime-
|
|
1
|
+
import { a as e, c as t, i as r, l as s, n as i, o as n, r as l, s as o, t as C, u as c } from "./runtime-DNbjpTCh.js";
|
|
2
2
|
import { t as p } from "./chat-BRKK63lt.js";
|
|
3
3
|
export {
|
|
4
4
|
t as CHAT_SCROLL_ELEMENT_ID,
|
package/dist/common/overlay.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface OverlayChatOptions {
|
|
|
47
47
|
export interface OverlayQNAOptions {
|
|
48
48
|
enabled?: boolean;
|
|
49
49
|
mountTarget?: HTMLElement | string;
|
|
50
|
+
chrome?: QNAWidgetConfig['chrome'];
|
|
50
51
|
ctaText?: string;
|
|
51
52
|
hideButtonRowCta?: boolean;
|
|
52
53
|
inputPlaceholder?: QNAWidgetConfig['inputPlaceholder'];
|
|
@@ -66,6 +67,7 @@ export interface OverlaySimRelOptions {
|
|
|
66
67
|
enabled?: boolean;
|
|
67
68
|
mountTarget?: HTMLElement | string;
|
|
68
69
|
discountType?: SimRelWidgetConfig['discountType'];
|
|
70
|
+
gridColumns?: SimRelWidgetConfig['gridColumns'];
|
|
69
71
|
/** Custom card element renderer for the direct rendering path (GroupTabs/ProductGrid). */
|
|
70
72
|
renderCardElement?: SimRelWidgetConfig['renderCardElement'];
|
|
71
73
|
/** UISpec renderer overrides for simrel components. */
|
|
@@ -74,6 +76,8 @@ export interface OverlaySimRelOptions {
|
|
|
74
76
|
export interface OverlaySimButOptions {
|
|
75
77
|
enabled?: boolean;
|
|
76
78
|
mountTarget?: HTMLElement | string;
|
|
79
|
+
layout?: SimButWidgetConfig['layout'];
|
|
80
|
+
inlineCard?: SimButWidgetConfig['inlineCard'];
|
|
77
81
|
/** `findSimilar` yüküne eklenecek ürün görseli URL’si. */
|
|
78
82
|
imageUrl?: string;
|
|
79
83
|
i18n?: SimButWidgetConfig['i18n'];
|
|
@@ -26,7 +26,6 @@ export interface V1Product {
|
|
|
26
26
|
key: string;
|
|
27
27
|
value: string;
|
|
28
28
|
}>;
|
|
29
|
-
facet_tags?: string[];
|
|
30
29
|
short_name?: string;
|
|
31
30
|
category_ids?: string[];
|
|
32
31
|
category_names?: string[];
|
|
@@ -74,6 +73,7 @@ export interface NormalizedProduct {
|
|
|
74
73
|
value: string;
|
|
75
74
|
}>;
|
|
76
75
|
facetHits?: Record<string, unknown>;
|
|
76
|
+
categoryNames?: string[];
|
|
77
77
|
shortName?: string;
|
|
78
78
|
/** Pass-through bag for backend fields not consumed by the SDK. */
|
|
79
79
|
extras?: Record<string, unknown>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* WARNING: Any new injection point that uses innerHTML must call this function first.
|
|
9
9
|
*/
|
|
10
|
-
/** Check if
|
|
10
|
+
/** Check if an image URL uses a safe protocol or same-origin absolute path. */
|
|
11
11
|
export declare function isSafeImageUrl(url: string): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Check if a URL is safe for use in href/src attributes.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as w } from "./api-paths-
|
|
2
|
-
import { n as f } from "./widget-base-
|
|
1
|
+
import { n as w } from "./api-paths-DR5bPNhi.js";
|
|
2
|
+
import { n as f } from "./widget-base-2-B1Ch5I.js";
|
|
3
3
|
import { a as h, c as s, i as b, o as d, r as u, t as p } from "./schemas-CLo8wCjs.js";
|
|
4
|
-
import { a as T, i as k } from "./overlay-
|
|
4
|
+
import { a as T, i as k } from "./overlay-DJ1ZRMfI.js";
|
|
5
5
|
var c = d({ enabled: u().default(!0) }), S = d({
|
|
6
6
|
chat: s().optional(),
|
|
7
7
|
qna: s().optional(),
|
package/dist/common.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a, c as t, d as s, f as r, i, l as n, m as o, n as c, o as m, p as l, r as g, t as d, u as p } from "./api-paths-
|
|
2
|
-
import { C as E, S, _ as h, b as v, c as f, d as y, f as C, g as A, h as T, i as w, l as U, m as W, o as I, p as P, r as k, s as D, t as R, u as b, v as G, w as N, x as O, y as _ } from "./widget-base-
|
|
3
|
-
import { N as L, a as M, c as z, i as B, k as H, n as F, o as K, r as V, s as Q, t as q } from "./context-
|
|
4
|
-
import { a as j, n as J, r as X, t as Y } from "./pill-launcher-
|
|
5
|
-
import { n as ee, t as ae } from "./connection-warning-
|
|
6
|
-
import { i as se, n as re, r as ie, t as ne } from "./overlay-
|
|
7
|
-
import { a as ce, i as me, n as le, r as ge } from "./native-webview-
|
|
8
|
-
import { _ as pe, a as ue, c as Ee, d as Se, f as he, g as ve, h as fe, i as ye, l as Ce, m as Ae, n as Te, o as we, p as Ue, r as We, s as Ie, t as Pe, u as ke, v as De, y as Re } from "./common-
|
|
1
|
+
import { a, c as t, d as s, f as r, i, l as n, m as o, n as c, o as m, p as l, r as g, t as d, u as p } from "./api-paths-DR5bPNhi.js";
|
|
2
|
+
import { C as E, S, _ as h, b as v, c as f, d as y, f as C, g as A, h as T, i as w, l as U, m as W, o as I, p as P, r as k, s as D, t as R, u as b, v as G, w as N, x as O, y as _ } from "./widget-base-2-B1Ch5I.js";
|
|
3
|
+
import { N as L, a as M, c as z, i as B, k as H, n as F, o as K, r as V, s as Q, t as q } from "./context-DGz5F81j.js";
|
|
4
|
+
import { a as j, n as J, r as X, t as Y } from "./pill-launcher-DSEeJT9h.js";
|
|
5
|
+
import { n as ee, t as ae } from "./connection-warning-ecZqpczd.js";
|
|
6
|
+
import { i as se, n as re, r as ie, t as ne } from "./overlay-DJ1ZRMfI.js";
|
|
7
|
+
import { a as ce, i as me, n as le, r as ge } from "./native-webview-C_PmKnzm.js";
|
|
8
|
+
import { _ as pe, a as ue, c as Ee, d as Se, f as he, g as ve, h as fe, i as ye, l as Ce, m as Ae, n as Te, o as we, p as Ue, r as We, s as Ie, t as Pe, u as ke, v as De, y as Re } from "./common-c-awF96O.js";
|
|
9
9
|
export {
|
|
10
10
|
Ae as AccountRuntimeConfigSchema,
|
|
11
11
|
fe as AnalyticsAuthModeSchema,
|
|
@@ -129,8 +129,8 @@ function N(e) {
|
|
|
129
129
|
if (!i) continue;
|
|
130
130
|
const a = i.indexOf(":");
|
|
131
131
|
if (a === -1) continue;
|
|
132
|
-
const
|
|
133
|
-
O.has(
|
|
132
|
+
const s = i.slice(0, a).trim().toLowerCase(), u = i.slice(a + 1).trim();
|
|
133
|
+
O.has(s) && (P.test(u) || t.push(i));
|
|
134
134
|
}
|
|
135
135
|
return t.join("; ");
|
|
136
136
|
}
|
|
@@ -146,48 +146,51 @@ function w(e, t) {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (!T.has(i)) {
|
|
149
|
-
const
|
|
150
|
-
for (const c of
|
|
149
|
+
const o = Array.from(n.childNodes);
|
|
150
|
+
for (const c of o) t.insertBefore(c, n);
|
|
151
151
|
t.removeChild(n);
|
|
152
|
-
for (const c of
|
|
152
|
+
for (const c of o) w(c, t);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
const a = b["*"] ?? /* @__PURE__ */ new Set(),
|
|
156
|
-
for (const
|
|
157
|
-
const c =
|
|
158
|
-
if (!a.has(c) && !
|
|
159
|
-
n.removeAttribute(
|
|
155
|
+
const a = b["*"] ?? /* @__PURE__ */ new Set(), s = b[i] ?? /* @__PURE__ */ new Set(), u = Array.from(n.attributes);
|
|
156
|
+
for (const o of u) {
|
|
157
|
+
const c = o.name.toLowerCase();
|
|
158
|
+
if (!a.has(c) && !s.has(c)) {
|
|
159
|
+
n.removeAttribute(o.name);
|
|
160
160
|
continue;
|
|
161
161
|
}
|
|
162
|
-
if (I(
|
|
163
|
-
n.removeAttribute(
|
|
162
|
+
if (I(o.value)) {
|
|
163
|
+
n.removeAttribute(o.name);
|
|
164
164
|
continue;
|
|
165
165
|
}
|
|
166
166
|
if (c === "style") {
|
|
167
|
-
const d = N(
|
|
167
|
+
const d = N(o.value);
|
|
168
168
|
d ? n.setAttribute("style", d) : n.removeAttribute("style");
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
if (i === "a") {
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
const c =
|
|
173
|
+
const o = n.getAttribute("href");
|
|
174
|
+
if (o !== null) {
|
|
175
|
+
const c = o.trim().toLowerCase();
|
|
176
176
|
!c.startsWith("http://") && !c.startsWith("https://") && !c.startsWith("mailto:") && n.removeAttribute("href");
|
|
177
177
|
}
|
|
178
178
|
n.setAttribute("target", "_blank"), n.setAttribute("rel", "noopener noreferrer");
|
|
179
179
|
}
|
|
180
180
|
if (i === "img") {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const o = n.getAttribute("src");
|
|
182
|
+
o !== null && (o.trim().toLowerCase().startsWith("https://") || n.removeAttribute("src"));
|
|
183
183
|
}
|
|
184
184
|
const p = Array.from(n.childNodes);
|
|
185
|
-
for (const
|
|
185
|
+
for (const o of p) w(o, n);
|
|
186
186
|
}
|
|
187
187
|
var k = ["http:", "https:"];
|
|
188
188
|
function J(e) {
|
|
189
|
+
const t = e.trim();
|
|
190
|
+
if (!t) return !1;
|
|
191
|
+
if (t.startsWith("/") && !t.startsWith("//")) return !0;
|
|
189
192
|
try {
|
|
190
|
-
return k.includes(new URL(
|
|
193
|
+
return k.includes(new URL(t).protocol);
|
|
191
194
|
} catch {
|
|
192
195
|
return !1;
|
|
193
196
|
}
|
|
@@ -213,7 +216,7 @@ function K(e) {
|
|
|
213
216
|
function W() {
|
|
214
217
|
return typeof window < "u" && Array.isArray(window.dataLayer);
|
|
215
218
|
}
|
|
216
|
-
function
|
|
219
|
+
function r(e, t) {
|
|
217
220
|
const n = {
|
|
218
221
|
event: e,
|
|
219
222
|
...t
|
|
@@ -221,58 +224,58 @@ function o(e, t) {
|
|
|
221
224
|
W() && window.dataLayer.push(n);
|
|
222
225
|
}
|
|
223
226
|
function D(e) {
|
|
224
|
-
|
|
227
|
+
r("gengage-on-init", { gengage_widget: e });
|
|
225
228
|
}
|
|
226
229
|
function v(e) {
|
|
227
|
-
|
|
230
|
+
r("gengage-show", { gengage_widget: e });
|
|
228
231
|
}
|
|
229
232
|
function U(e) {
|
|
230
|
-
|
|
233
|
+
r("gengage-hide", { gengage_widget: e });
|
|
231
234
|
}
|
|
232
235
|
function z(e, t) {
|
|
233
|
-
|
|
236
|
+
r("gengage-suggested-question", {
|
|
234
237
|
gengage_question_title: e,
|
|
235
238
|
gengage_action_type: t
|
|
236
239
|
});
|
|
237
240
|
}
|
|
238
241
|
function Y(e) {
|
|
239
|
-
|
|
242
|
+
r("gengage-find-similars", { gengage_sku: e });
|
|
240
243
|
}
|
|
241
244
|
function Z(e) {
|
|
242
|
-
|
|
245
|
+
r("gengage-compare-preselection", { gengage_sku: e });
|
|
243
246
|
}
|
|
244
247
|
function $(e) {
|
|
245
|
-
|
|
248
|
+
r("gengage-compare-selected", {
|
|
246
249
|
gengage_skus: e,
|
|
247
250
|
gengage_product_count: e.length
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
function ee() {
|
|
251
|
-
|
|
254
|
+
r("gengage-compare-clear");
|
|
252
255
|
}
|
|
253
256
|
function te(e) {
|
|
254
|
-
|
|
257
|
+
r("gengage-compare-received", { gengage_product_count: e });
|
|
255
258
|
}
|
|
256
259
|
function ne(e) {
|
|
257
|
-
|
|
260
|
+
r("gengage-like-product", { gengage_sku: e });
|
|
258
261
|
}
|
|
259
262
|
function ie() {
|
|
260
|
-
|
|
263
|
+
r("gengage-like-list");
|
|
261
264
|
}
|
|
262
|
-
function
|
|
263
|
-
|
|
265
|
+
function re(e, t) {
|
|
266
|
+
r("gengage-search", {
|
|
264
267
|
gengage_search_query: e,
|
|
265
268
|
gengage_result_count: t
|
|
266
269
|
});
|
|
267
270
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
271
|
+
function oe(e, t) {
|
|
272
|
+
r("gengage-product-detail", {
|
|
270
273
|
gengage_sku: e,
|
|
271
274
|
gengage_product_name: t
|
|
272
275
|
});
|
|
273
276
|
}
|
|
274
277
|
function M(e, t) {
|
|
275
|
-
|
|
278
|
+
r("gengage-similar-product-click", {
|
|
276
279
|
gengage_sku: e,
|
|
277
280
|
...t?.url !== void 0 ? { gengage_product_url: t.url } : {},
|
|
278
281
|
...t?.name !== void 0 ? { gengage_product_name: t.name } : {},
|
|
@@ -280,13 +283,13 @@ function M(e, t) {
|
|
|
280
283
|
});
|
|
281
284
|
}
|
|
282
285
|
function R(e, t) {
|
|
283
|
-
|
|
286
|
+
r("gengage-similar-grouping-click", {
|
|
284
287
|
gengage_grouping_label: e,
|
|
285
288
|
gengage_grouping_index: t
|
|
286
289
|
});
|
|
287
290
|
}
|
|
288
291
|
function j(e) {
|
|
289
|
-
|
|
292
|
+
r("gengage-similar-products-impression", {
|
|
290
293
|
gengage_source_sku: e.source_sku,
|
|
291
294
|
gengage_product_count: e.product_count,
|
|
292
295
|
gengage_grouped: e.grouped,
|
|
@@ -294,41 +297,41 @@ function j(e) {
|
|
|
294
297
|
});
|
|
295
298
|
}
|
|
296
299
|
function ae(e) {
|
|
297
|
-
|
|
300
|
+
r("gengage-compare-product", {
|
|
298
301
|
gengage_skus: e,
|
|
299
302
|
gengage_product_count: e.length
|
|
300
303
|
});
|
|
301
304
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
305
|
+
function se() {
|
|
306
|
+
r("gengage-chatbot-maximized");
|
|
304
307
|
}
|
|
305
308
|
function q(e) {
|
|
306
|
-
|
|
309
|
+
r("gengage-interface-not-ready", {
|
|
307
310
|
...e?.reason !== void 0 ? { gengage_reason: e.reason } : {},
|
|
308
311
|
...e?.attempts !== void 0 ? { gengage_attempts: e.attempts } : {},
|
|
309
312
|
...e?.message !== void 0 ? { gengage_message: e.message } : {}
|
|
310
313
|
});
|
|
311
314
|
}
|
|
312
315
|
function G(e, t) {
|
|
313
|
-
|
|
316
|
+
r("gengage-cart-add", {
|
|
314
317
|
gengage_sku: e,
|
|
315
318
|
gengage_quantity: t
|
|
316
319
|
});
|
|
317
320
|
}
|
|
318
|
-
function
|
|
319
|
-
|
|
321
|
+
function ge() {
|
|
322
|
+
r("gengage-message-sent");
|
|
320
323
|
}
|
|
321
324
|
function ce() {
|
|
322
|
-
|
|
325
|
+
r("gengage-message-received");
|
|
323
326
|
}
|
|
324
327
|
function le() {
|
|
325
|
-
|
|
328
|
+
r("gengage-conversation-start");
|
|
326
329
|
}
|
|
327
330
|
function F() {
|
|
328
|
-
|
|
331
|
+
r("gengage-voice-input");
|
|
329
332
|
}
|
|
330
333
|
function Q(e, t) {
|
|
331
|
-
|
|
334
|
+
r("gengage-error", {
|
|
332
335
|
gengage_widget: e,
|
|
333
336
|
gengage_error: t
|
|
334
337
|
});
|
|
@@ -340,25 +343,25 @@ function ue() {
|
|
|
340
343
|
if (f) return f;
|
|
341
344
|
const e = [];
|
|
342
345
|
function t(n, i) {
|
|
343
|
-
const a = (
|
|
346
|
+
const a = (s) => i(s.detail);
|
|
344
347
|
window.addEventListener(n, a), e.push(() => window.removeEventListener(n, a));
|
|
345
348
|
}
|
|
346
349
|
return t("gengage:chat:open", () => v("chat")), t("gengage:chat:close", () => U("chat")), t("gengage:chat:ready", () => D("chat")), t("gengage:similar:add-to-cart", ({ sku: n, quantity: i }) => {
|
|
347
350
|
G(n, i);
|
|
348
|
-
}), t("gengage:similar:product-click", ({ sku: n, url: i, sessionId: a, productName:
|
|
351
|
+
}), t("gengage:similar:product-click", ({ sku: n, url: i, sessionId: a, productName: s }) => {
|
|
349
352
|
const u = {
|
|
350
353
|
url: i,
|
|
351
354
|
session_id: a
|
|
352
355
|
};
|
|
353
|
-
|
|
356
|
+
s !== void 0 && s !== "" && (u.name = s), M(n, u);
|
|
354
357
|
}), t("gengage:similar:grouping-click", ({ grouping_label: n, grouping_index: i }) => {
|
|
355
358
|
R(n, i);
|
|
356
|
-
}), t("gengage:similar:products-impression", ({ source_sku: n, product_count: i, grouped: a, sessionId:
|
|
359
|
+
}), t("gengage:similar:products-impression", ({ source_sku: n, product_count: i, grouped: a, sessionId: s }) => {
|
|
357
360
|
j({
|
|
358
361
|
source_sku: n,
|
|
359
362
|
product_count: i,
|
|
360
363
|
grouped: a,
|
|
361
|
-
session_id:
|
|
364
|
+
session_id: s
|
|
362
365
|
});
|
|
363
366
|
}), t("gengage:qna:action", ({ title: n, type: i }) => {
|
|
364
367
|
z(n, i);
|
|
@@ -408,23 +411,23 @@ function V(e) {
|
|
|
408
411
|
function fe(e) {
|
|
409
412
|
let t = !1;
|
|
410
413
|
const n = [];
|
|
411
|
-
let i = 0, a = null,
|
|
414
|
+
let i = 0, a = null, s = 0;
|
|
412
415
|
const u = 500, p = 10;
|
|
413
|
-
function
|
|
416
|
+
function o() {
|
|
414
417
|
return window.gengage?.chat ?? null;
|
|
415
418
|
}
|
|
416
419
|
function c() {
|
|
417
420
|
t || (console.warn("[gengage] QNA tried to open chat, but chat widget is not initialized. Ensure GengageChat is initialized before calling wireQNAToChat()."), t = !0), e?.onChatUnavailable?.();
|
|
418
421
|
}
|
|
419
|
-
function d(
|
|
420
|
-
if (
|
|
422
|
+
function d(g, l) {
|
|
423
|
+
if (g.openWithAction) {
|
|
421
424
|
const L = l.type === "inputText" || l.type === "user_message" ? V(l) : l;
|
|
422
|
-
|
|
425
|
+
g.openWithAction(L);
|
|
423
426
|
return;
|
|
424
427
|
}
|
|
425
428
|
const h = H(l);
|
|
426
|
-
if (h &&
|
|
427
|
-
|
|
429
|
+
if (h && g.sendMessage) {
|
|
430
|
+
g.open?.(), g.sendMessage(h);
|
|
428
431
|
return;
|
|
429
432
|
}
|
|
430
433
|
}
|
|
@@ -432,33 +435,33 @@ function fe(e) {
|
|
|
432
435
|
a !== null && (window.clearInterval(a), a = null);
|
|
433
436
|
}
|
|
434
437
|
function A() {
|
|
435
|
-
const
|
|
436
|
-
if (!
|
|
437
|
-
if (i > 0 && (
|
|
438
|
+
const g = o();
|
|
439
|
+
if (!g) return !1;
|
|
440
|
+
if (i > 0 && (g.open?.(), i = 0), n.length > 0) {
|
|
438
441
|
const l = n.splice(0, n.length);
|
|
439
|
-
for (const h of l) d(
|
|
442
|
+
for (const h of l) d(g, h);
|
|
440
443
|
}
|
|
441
444
|
return m(), !0;
|
|
442
445
|
}
|
|
443
446
|
function y() {
|
|
444
|
-
a === null && (
|
|
445
|
-
A() || (
|
|
447
|
+
a === null && (s = 0, a = window.setInterval(() => {
|
|
448
|
+
A() || (s += 1, s >= p && ((n.length > 0 || i > 0) && q({
|
|
446
449
|
reason: "chat_unavailable_after_poll",
|
|
447
450
|
attempts: p
|
|
448
451
|
}), n.length = 0, i = 0, m()));
|
|
449
452
|
}, u));
|
|
450
453
|
}
|
|
451
|
-
const C = _("gengage:qna:action", (
|
|
452
|
-
const l =
|
|
454
|
+
const C = _("gengage:qna:action", (g) => {
|
|
455
|
+
const l = o();
|
|
453
456
|
if (l) {
|
|
454
|
-
d(l,
|
|
457
|
+
d(l, g);
|
|
455
458
|
return;
|
|
456
459
|
}
|
|
457
|
-
c(), n.length >= 20 && n.shift(), n.push(
|
|
460
|
+
c(), n.length >= 20 && n.shift(), n.push(g), y();
|
|
458
461
|
}), x = _("gengage:qna:open-chat", () => {
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
461
|
-
|
|
462
|
+
const g = o();
|
|
463
|
+
if (g) {
|
|
464
|
+
g.open?.();
|
|
462
465
|
return;
|
|
463
466
|
}
|
|
464
467
|
c(), i += 1, y();
|
|
@@ -494,14 +497,14 @@ function we(e) {
|
|
|
494
497
|
}
|
|
495
498
|
export {
|
|
496
499
|
J as A,
|
|
497
|
-
|
|
500
|
+
ge as C,
|
|
498
501
|
z as D,
|
|
499
502
|
v as E,
|
|
500
503
|
X as M,
|
|
501
504
|
K as N,
|
|
502
505
|
F as O,
|
|
503
506
|
ce as S,
|
|
504
|
-
|
|
507
|
+
re as T,
|
|
505
508
|
Y as _,
|
|
506
509
|
de as a,
|
|
507
510
|
ie as b,
|
|
@@ -521,9 +524,9 @@ export {
|
|
|
521
524
|
we as r,
|
|
522
525
|
fe as s,
|
|
523
526
|
B as t,
|
|
524
|
-
|
|
527
|
+
se as u,
|
|
525
528
|
D as v,
|
|
526
|
-
|
|
529
|
+
oe as w,
|
|
527
530
|
ne as x,
|
|
528
531
|
q as y
|
|
529
532
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { GengageChat, createChatWidget } from './chat/index.js';
|
|
13
13
|
export { GengageQNA, createQNAWidget } from './qna/index.js';
|
|
14
|
-
export { GengageSimRel, createSimRelWidget } from './simrel/index.js';
|
|
14
|
+
export { GengageSimRel, createSimRelWidget, createSimRelRenderer } from './simrel/index.js';
|
|
15
15
|
export { GengageSimBut, createSimButWidget } from './simbut/index.js';
|
|
16
16
|
export { renderUISpec as renderChatUISpec, createDefaultChatUISpecRegistry, defaultChatUnknownUISpecRenderer, } from './chat/index.js';
|
|
17
17
|
export { renderQnaUISpec, createDefaultQnaUISpecRegistry, defaultQnaUnknownUISpecRenderer } from './qna/index.js';
|
|
@@ -20,6 +20,6 @@ export { bootstrapSession, updatePageContext, initOverlayWidgets, getOverlayWidg
|
|
|
20
20
|
export type { PageContext, SessionContext, BaseWidgetConfig, GengageWidget, StreamEvent, UISpec, UIElement, ActionPayload, GengageEventName, ChatPublicAPI, ChatTransportConfig, ChatEndpointName, AccountRuntimeConfig, AnalyticsAuthMode, UnknownActionPolicy, HostActionHandlers, ActionRouterOptions, AnalyticsEnvelope, AnalyticsInput, AnalyticsAuthConfig, AnalyticsClientConfig, UISpecDomComponentRenderParams, UISpecDomComponentRenderer, UISpecDomRegistry, UISpecDomUnknownRendererParams, UISpecDomUnknownRenderer, RenderUISpecWithRegistryOptions, OverlayWidgetsController, OverlayWidgetsOptions, OverlayChatOptions, OverlayQNAOptions, OverlaySimRelOptions, OverlaySimButOptions, NativeBridgeEnvironment, NativeSessionPayload, NativeBridgeMessage, NativeWebViewBridgeOptions, NativeWebViewBridge, NativeOverlayInitOptions, NativeOverlayInitResult, AccountIdentityConfig, AccountIdentity, GengageClientOptions, HostActions, PreflightResult, PreflightWarning, WireQNAToChatOptions, VoiceInputState, VoiceInputErrorCode, VoiceInputCallbacks, VoiceInputOptions, DetectablePageType, PageDetectionRule, PillLauncherOptions, PillLauncherKit, } from './common/index.js';
|
|
21
21
|
export type { ChatWidgetConfig, ChatMessage, ChatSession, ChatI18n, ChatRendererConfig } from './chat/index.js';
|
|
22
22
|
export type { ChatUISpecRegistry, UISpecRenderContext as ChatUISpecRenderContext } from './chat/index.js';
|
|
23
|
-
export type { QNAWidgetConfig, QNAI18n, QNAUISpecRenderContext, QNAUISpecRegistry, QNARendererConfig, } from './qna/index.js';
|
|
24
|
-
export type { SimRelWidgetConfig, SimilarProduct, SimRelI18n, SimRelUISpecRenderContext, SimRelUISpecRegistry, SimRelRendererConfig, } from './simrel/index.js';
|
|
25
|
-
export type { SimButWidgetConfig, SimButI18n } from './simbut/index.js';
|
|
23
|
+
export type { QNAWidgetConfig, QNAI18n, QNAChromeLayout, QNAChromeConfig, QNAUISpecRenderContext, QNAUISpecRegistry, QNARendererConfig, } from './qna/index.js';
|
|
24
|
+
export type { SimRelWidgetConfig, SimilarProduct, SimRelI18n, SimRelUISpecRenderContext, SimRelUISpecRegistry, SimRelRendererConfig, SimRelFieldPath, SimRelRendererFields, SimRelRendererLabels, SimRelRendererMedia, SimRelRendererOptions, } from './simrel/index.js';
|
|
25
|
+
export type { SimButWidgetConfig, SimButI18n, SimButInlineCardConfig, SimButLayout } from './simbut/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,74 +1,76 @@
|
|
|
1
|
-
import { d as a, m as t, n as
|
|
2
|
-
import { c, d as m, l, u as p } from "./widget-base-
|
|
3
|
-
import { a as g, c as u, i as f, k as S, o as C, s as U, t as h } from "./context-
|
|
4
|
-
import { a as A, n as I, o as R, s as T, t as W } from "./runtime-
|
|
5
|
-
import { a as E, n as w, r as v, t as N } from "./pill-launcher-
|
|
6
|
-
import { t as P } from "./connection-warning-
|
|
7
|
-
import { a as G, i as _, n as Q, r as L, t as B } from "./runtime-
|
|
8
|
-
import { a as b, i as x, n as F, r as V, t as H } from "./runtime-
|
|
9
|
-
import { n as z
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { d as a, m as t, n as r, p as i, t as s, u as n } from "./api-paths-DR5bPNhi.js";
|
|
2
|
+
import { c, d as m, l, u as p } from "./widget-base-2-B1Ch5I.js";
|
|
3
|
+
import { a as g, c as u, i as f, k as S, o as C, s as U, t as h } from "./context-DGz5F81j.js";
|
|
4
|
+
import { a as A, n as I, o as R, s as T, t as W } from "./runtime-DNbjpTCh.js";
|
|
5
|
+
import { a as E, n as w, r as v, t as N } from "./pill-launcher-DSEeJT9h.js";
|
|
6
|
+
import { t as P } from "./connection-warning-ecZqpczd.js";
|
|
7
|
+
import { a as G, i as _, n as Q, r as L, t as B } from "./runtime-SKDvc0Xc.js";
|
|
8
|
+
import { a as b, i as x, n as F, r as V, t as H } from "./runtime-BsZZ8zTg.js";
|
|
9
|
+
import { n as z } from "./simrel-DJZ983BF.js";
|
|
10
|
+
import { n as j, t as q } from "./simbut-Bw3vBFtW.js";
|
|
11
|
+
import { i as X, n as Y, r as $, t as ee } from "./overlay-DJ1ZRMfI.js";
|
|
12
|
+
import { a as te, i as re, n as ie, r as se } from "./native-webview-C_PmKnzm.js";
|
|
13
|
+
import { _ as oe, a as ce, c as me, d as le, g as pe, h as de, i as ge, l as ue, m as fe, n as Se, o as Ce, p as Ue, r as he, s as ye, t as Ae, u as Ie, v as Re, y as Te } from "./common-c-awF96O.js";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
fe as AccountRuntimeConfigSchema,
|
|
16
|
+
de as AnalyticsAuthModeSchema,
|
|
16
17
|
c as BASE_WIDGET_THEME,
|
|
17
|
-
|
|
18
|
+
Ce as DEFAULT_CUSTOMIZATION_LOCALE,
|
|
18
19
|
p as DEFAULT_WIDGET_THEME_TOKENS,
|
|
19
20
|
W as GengageChat,
|
|
20
21
|
B as GengageQNA,
|
|
21
|
-
|
|
22
|
+
q as GengageSimBut,
|
|
22
23
|
H as GengageSimRel,
|
|
23
|
-
|
|
24
|
+
pe as UnknownActionPolicySchema,
|
|
24
25
|
w as VoiceInput,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
ie as applyNativeSession,
|
|
27
|
+
Ae as autoDetectPageContext,
|
|
27
28
|
h as bootstrapSession,
|
|
28
29
|
s as buildChatEndpointUrl,
|
|
29
|
-
|
|
30
|
+
ee as buildOverlayIdempotencyKey,
|
|
30
31
|
P as configureConnectionWarning,
|
|
31
32
|
n as consumeStream,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
ye as createAccountIdentity,
|
|
34
|
+
Ue as createAnalyticsClient,
|
|
34
35
|
I as createChatWidget,
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
oe as createDefaultAccountRuntimeConfig,
|
|
37
|
+
me as createDefaultAnalyticsConfig,
|
|
37
38
|
A as createDefaultChatUISpecRegistry,
|
|
38
39
|
L as createDefaultQnaUISpecRegistry,
|
|
39
40
|
V as createDefaultSimRelUISpecRegistry,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
ue as createFloatingChatConfig,
|
|
42
|
+
se as createNativeWebViewBridge,
|
|
43
|
+
Ie as createPdpQnaConfig,
|
|
44
|
+
le as createPdpSimRelConfig,
|
|
44
45
|
Q as createQNAWidget,
|
|
45
|
-
|
|
46
|
+
j as createSimButWidget,
|
|
47
|
+
z as createSimRelRenderer,
|
|
46
48
|
F as createSimRelWidget,
|
|
47
49
|
R as defaultChatUnknownUISpecRenderer,
|
|
48
50
|
_ as defaultQnaUnknownUISpecRenderer,
|
|
49
51
|
x as defaultSimRelUnknownUISpecRenderer,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
i as defaultUnknownUISpecRenderer,
|
|
53
|
+
Y as destroyOverlayWidgets,
|
|
54
|
+
re as detectNativeEnvironment,
|
|
55
|
+
Se as detectPageType,
|
|
54
56
|
g as dispatch,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
he as extractSkuFromUrl,
|
|
58
|
+
$ as getOverlayWidgets,
|
|
59
|
+
ge as initGengageClient,
|
|
60
|
+
te as initNativeOverlayWidgets,
|
|
61
|
+
X as initOverlayWidgets,
|
|
60
62
|
v as isVoiceInputSupported,
|
|
61
63
|
C as listen,
|
|
62
64
|
N as makePillLauncher,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
r as normalizeMiddlewareUrl,
|
|
66
|
+
Re as parseAccountRuntimeConfig,
|
|
67
|
+
ce as preflightDiagnostics,
|
|
66
68
|
T as renderChatUISpec,
|
|
67
69
|
G as renderQnaUISpec,
|
|
68
70
|
b as renderSimRelUISpec,
|
|
69
71
|
t as renderUISpecWithRegistry,
|
|
70
72
|
E as routeStreamAction,
|
|
71
|
-
|
|
73
|
+
Te as safeParseAccountRuntimeConfig,
|
|
72
74
|
a as streamPost,
|
|
73
75
|
f as updatePageContext,
|
|
74
76
|
S as wireGADataLayer,
|