@gengage/assistant-fe 0.4.5 → 0.4.6

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/api-paths-C4GDpeTf.js +1214 -0
  3. package/dist/chat/index.d.ts +1 -374
  4. package/dist/chat/runtime.d.ts +374 -0
  5. package/dist/chat-BRKK63lt.js +303 -0
  6. package/dist/chat-runtime.js +13 -0
  7. package/dist/chat.iife.js +6 -6
  8. package/dist/chat.js +11 -10
  9. package/dist/common/config-constants.d.ts +1 -0
  10. package/dist/common/config-schema.d.ts +0 -1
  11. package/dist/common/overlay.d.ts +4 -4
  12. package/dist/common-CEN5OW7E.js +491 -0
  13. package/dist/common.js +78 -76
  14. package/dist/{connection-warning-n88bjkqL.js → connection-warning-B6oIU-9s.js} +1 -1
  15. package/dist/context-VIG4SVcS.js +529 -0
  16. package/dist/index.js +70 -67
  17. package/dist/locale-CfqNifrU.js +7 -0
  18. package/dist/native-webview-DudQ7nHe.js +273 -0
  19. package/dist/native.iife.js +28 -91
  20. package/dist/native.js +1 -1
  21. package/dist/overlay-1EO41ZC7.js +212 -0
  22. package/dist/overlay.d.ts +4 -0
  23. package/dist/overlay.js +10 -0
  24. package/dist/pill-launcher-57nrdLRr.js +364 -0
  25. package/dist/qna/index.d.ts +1 -61
  26. package/dist/qna/runtime.d.ts +61 -0
  27. package/dist/qna-BNvttR6s.js +40 -0
  28. package/dist/qna-runtime.js +8 -0
  29. package/dist/qna.iife.js +4 -4
  30. package/dist/qna.js +6 -5
  31. package/dist/{simrel-K2TGFi1r.js → runtime-BdwZZIrO.js} +244 -293
  32. package/dist/{chat-B1lLKIxj.js → runtime-C0qZk0y7.js} +1643 -2297
  33. package/dist/{qna-C5Ok3wd0.js → runtime-DDu8Wk0z.js} +87 -121
  34. package/dist/schemas-CLo8wCjs.js +3207 -0
  35. package/dist/{simbut-Cb5RfaAp.js → simbut-BMWC6x_t.js} +24 -22
  36. package/dist/simbut.js +1 -1
  37. package/dist/simrel/index.d.ts +1 -59
  38. package/dist/simrel/runtime.d.ts +59 -0
  39. package/dist/simrel-ohfkluhp.js +55 -0
  40. package/dist/simrel-runtime.js +8 -0
  41. package/dist/simrel.iife.js +4 -4
  42. package/dist/simrel.js +7 -6
  43. package/dist/widget-base-TgwiA8cD.js +578 -0
  44. package/package.json +17 -1
  45. package/dist/common-C5e2gLuG.js +0 -387
  46. package/dist/locale-MM0U5eeR.js +0 -1109
  47. package/dist/native-webview-niMtkiHX.js +0 -586
  48. package/dist/schemas-JpRGzRQT.js +0 -4419
  49. /package/dist/{price-formatter-CR6VT5z4.js → price-formatter-xI3g9Cd4.js} +0 -0
@@ -1,8 +1,10 @@
1
- import { S as H, b as O, c as _, d as U, l as j, n as M, o as A, p as D, r as F, t as P, u as W, w as z } from "./schemas-JpRGzRQT.js";
2
- import { A as $, R as G, _ as E, a as J, et as V, it as Y, n as Z, nt as K, t as C, tt as X, z as tt } from "./locale-MM0U5eeR.js";
3
- import { n as et } from "./connection-warning-n88bjkqL.js";
4
- async function nt(t, n, e) {
5
- const o = U("launcher_action", n), i = {
1
+ import { f as R, m as Q, r as H, t as N, u as O } from "./api-paths-C4GDpeTf.js";
2
+ import { S as U, b as j, i as M, t as D, w as F, x as W } from "./widget-base-TgwiA8cD.js";
3
+ import { D as $, E as z, a as T, v as G } from "./context-VIG4SVcS.js";
4
+ import { t as q } from "./locale-CfqNifrU.js";
5
+ import { n as J } from "./connection-warning-B6oIU-9s.js";
6
+ async function V(t, n, e) {
7
+ const o = N("launcher_action", n), i = {
6
8
  uiSpecs: [],
7
9
  actions: []
8
10
  }, a = {
@@ -14,7 +16,7 @@ async function nt(t, n, e) {
14
16
  const s = await fetch(o, a);
15
17
  if (!s.ok) throw new Error(`HTTP ${s.status}: ${s.statusText}`);
16
18
  const r = { onEvent: (l) => {
17
- const c = D(l);
19
+ const c = H(l);
18
20
  if (c && (c.type === "ui_spec" && i.uiSpecs.push(c.spec), c.type === "ui_spec" && c.spec.elements)) {
19
21
  for (const d of Object.values(c.spec.elements)) if (d.type === "ActionButton" && d.props?.action) {
20
22
  const m = d.props.action;
@@ -24,7 +26,7 @@ async function nt(t, n, e) {
24
26
  } };
25
27
  return e !== void 0 && (r.signal = e), await O(s, r), i;
26
28
  }
27
- function k(t) {
29
+ function E(t) {
28
30
  const n = document.createElement("div");
29
31
  n.className = "gengage-qna-buttons gds-toolbar", n.dataset.gengagePart = "qna-button-row", n.setAttribute("role", "group"), n.setAttribute("aria-label", t.quickQuestionsAriaLabel ?? "Quick questions"), t.orientation === "vertical" && (n.style.flexDirection = "column");
30
32
  for (const e of t.actions) {
@@ -45,7 +47,7 @@ function k(t) {
45
47
  }
46
48
  return n;
47
49
  }
48
- function ot(t) {
50
+ function Y(t) {
49
51
  const n = document.createElement("div");
50
52
  n.className = "gengage-qna-input-wrapper", n.dataset.gengagePart = "qna-input-wrapper";
51
53
  const e = document.createElement("div");
@@ -73,7 +75,7 @@ function ot(t) {
73
75
  const b = () => {
74
76
  const u = o.value.trim().length > 0;
75
77
  p.classList.toggle("gengage-qna-icon-btn--hidden", !u), h.classList.toggle("gengage-qna-icon-btn--hidden", !u), h.classList.toggle("gengage-qna-send--active", u), h.disabled = !u;
76
- }, T = () => {
78
+ }, v = () => {
77
79
  const u = o.value.trim();
78
80
  u && (t.onSubmit({
79
81
  title: u,
@@ -83,7 +85,7 @@ function ot(t) {
83
85
  };
84
86
  return p.addEventListener("click", () => {
85
87
  o.value = "", b(), o.focus({ preventScroll: !0 });
86
- }), h.addEventListener("click", T), o.addEventListener("focus", () => {
88
+ }), h.addEventListener("click", v), o.addEventListener("focus", () => {
87
89
  c = !0, d(), o.placeholder = "";
88
90
  }), o.addEventListener("blur", () => {
89
91
  c = !1, o.value.trim().length === 0 && (o.placeholder = s), y();
@@ -94,12 +96,12 @@ function ot(t) {
94
96
  }
95
97
  o.placeholder = c ? "" : s, y();
96
98
  }), o.addEventListener("keydown", (u) => {
97
- u.key === "Enter" && (u.preventDefault(), T()), u.key === "Escape" && o.value.length > 0 && (o.value = "", b(), y());
99
+ u.key === "Enter" && (u.preventDefault(), v()), u.key === "Escape" && o.value.length > 0 && (o.value = "", b(), y());
98
100
  }), g.appendChild(p), g.appendChild(h), e.appendChild(o), e.appendChild(g), n.appendChild(e), b(), y(), n._cleanup = () => {
99
101
  d();
100
102
  }, n;
101
103
  }
102
- function q(t, n) {
104
+ function A(t, n) {
103
105
  if (!t || typeof t != "object") return null;
104
106
  const e = t, o = e.type;
105
107
  if (typeof o != "string" || o.length === 0) return null;
@@ -111,59 +113,59 @@ function q(t, n) {
111
113
  };
112
114
  return a !== void 0 && (r.payload = a), r;
113
115
  }
114
- function S(t) {
116
+ function C(t) {
115
117
  const n = {
116
118
  title: t.title,
117
119
  type: t.type
118
120
  };
119
121
  return t.payload !== void 0 && (n.payload = t.payload), n;
120
122
  }
121
- function I(t, n) {
123
+ function k(t, n) {
122
124
  const e = [], o = t.props?.actions;
123
125
  if (Array.isArray(o)) for (const s of o) {
124
- const r = q(s);
126
+ const r = A(s);
125
127
  r && e.push(r);
126
128
  }
127
129
  const i = t.props?.buttons;
128
130
  if (Array.isArray(i)) for (const s of i) {
129
131
  if (!s || typeof s != "object") continue;
130
- const r = s, l = typeof r.label == "string" ? r.label : void 0, c = q(r.action, l);
132
+ const r = s, l = typeof r.label == "string" ? r.label : void 0, c = A(r.action, l);
131
133
  c && e.push(c);
132
134
  }
133
135
  if (t.children) for (const s of t.children) {
134
136
  const r = n.elements[s];
135
137
  if (!r || r.type !== "ActionButton") continue;
136
- const l = typeof r.props?.label == "string" ? r.props.label : void 0, c = q(r.props?.action, l);
138
+ const l = typeof r.props?.label == "string" ? r.props.label : void 0, c = A(r.props?.action, l);
137
139
  c && e.push(c);
138
140
  }
139
141
  const a = /* @__PURE__ */ new Set();
140
142
  return e.filter((s) => a.has(s.title) ? !1 : (a.add(s.title), !0));
141
143
  }
142
- var x = {
144
+ var L = {
143
145
  ButtonRow: ({ element: t, spec: n, context: e }) => {
144
- const o = I(t, n).map(S), i = t.props?.orientation, a = {
146
+ const o = k(t, n).map(C), i = t.props?.orientation, a = {
145
147
  actions: o,
146
148
  onAction: e.onAction,
147
149
  defaultCtaText: e.i18n.defaultCtaText,
148
150
  quickQuestionsAriaLabel: e.i18n.quickQuestionsAriaLabel
149
151
  };
150
- return e.onOpenChat !== void 0 && (a.onOpenChat = e.onOpenChat), e.ctaText !== void 0 && (a.ctaText = e.ctaText), (i === "horizontal" || i === "vertical") && (a.orientation = i), k(a);
152
+ return e.onOpenChat !== void 0 && (a.onOpenChat = e.onOpenChat), e.ctaText !== void 0 && (a.ctaText = e.ctaText), (i === "horizontal" || i === "vertical") && (a.orientation = i), E(a);
151
153
  },
152
154
  ActionButtons: ({ element: t, spec: n, context: e }) => {
153
155
  const o = {
154
- actions: I(t, n).map(S),
156
+ actions: k(t, n).map(C),
155
157
  onAction: e.onAction,
156
158
  defaultCtaText: e.i18n.defaultCtaText,
157
159
  quickQuestionsAriaLabel: e.i18n.quickQuestionsAriaLabel
158
160
  };
159
- return e.onOpenChat !== void 0 && (o.onOpenChat = e.onOpenChat), e.ctaText !== void 0 && (o.ctaText = e.ctaText), k(o);
161
+ return e.onOpenChat !== void 0 && (o.onOpenChat = e.onOpenChat), e.ctaText !== void 0 && (o.ctaText = e.ctaText), E(o);
160
162
  },
161
163
  ActionButton: ({ element: t, context: n }) => {
162
164
  const e = document.createElement("button");
163
165
  e.className = "gengage-qna-button gds-chip", e.type = "button", e.dataset.gengagePart = "qna-action-button";
164
166
  const o = t.props?.label;
165
167
  typeof o == "string" ? e.textContent = o : e.textContent = n.i18n.defaultCtaText;
166
- const i = q(t.props?.action, typeof o == "string" ? o : void 0);
168
+ const i = A(t.props?.action, typeof o == "string" ? o : void 0);
167
169
  return i && e.addEventListener("click", () => n.onAction(i)), e;
168
170
  },
169
171
  TextInput: ({ element: t, context: n }) => {
@@ -174,7 +176,7 @@ var x = {
174
176
  sendButtonText: n.i18n.sendButton,
175
177
  sendQuestionAriaLabel: n.i18n.sendQuestionAriaLabel
176
178
  };
177
- return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), ot(a);
179
+ return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), Y(a);
178
180
  },
179
181
  QuestionHeading: ({ element: t, context: n }) => {
180
182
  const e = document.createElement("h3");
@@ -183,7 +185,7 @@ var x = {
183
185
  return e.textContent = typeof i == "string" && i.trim().length > 0 ? i : typeof o == "string" ? o : "", e;
184
186
  },
185
187
  ProductCard: () => null
186
- }, B = ({ element: t, renderElement: n }) => {
188
+ }, w = ({ element: t, renderElement: n }) => {
187
189
  if (!t.children || t.children.length === 0) return null;
188
190
  const e = document.createElement("div");
189
191
  for (const o of t.children) {
@@ -192,11 +194,11 @@ var x = {
192
194
  }
193
195
  return e;
194
196
  };
195
- function it() {
196
- return { ...x };
197
+ function Z() {
198
+ return { ...L };
197
199
  }
198
- function at(t, n, e = x, o = B) {
199
- return z({
200
+ function K(t, n, e = L, o = w) {
201
+ return Q({
200
202
  spec: t,
201
203
  context: n,
202
204
  registry: e,
@@ -204,7 +206,7 @@ function at(t, n, e = x, o = B) {
204
206
  unknownRenderer: o
205
207
  });
206
208
  }
207
- function st(t) {
209
+ function X(t) {
208
210
  if (!t) return;
209
211
  const n = t.extra;
210
212
  if (n && typeof n == "object" && !Array.isArray(n)) {
@@ -217,7 +219,7 @@ function st(t) {
217
219
  const e = typeof t.sku == "string" && t.sku.trim() ? t.sku.trim() : void 0;
218
220
  return e ? [e] : void 0;
219
221
  }
220
- function Q(t, n) {
222
+ function P(t, n) {
221
223
  if (!t) return null;
222
224
  const e = t.action;
223
225
  if (!e || typeof e != "object") return null;
@@ -231,7 +233,7 @@ function Q(t, n) {
231
233
  };
232
234
  return r !== void 0 && (l.payload = r), l;
233
235
  }
234
- function rt(t, n) {
236
+ function tt(t, n) {
235
237
  const e = t.elements[t.root];
236
238
  if (!e) return !1;
237
239
  const o = (i) => {
@@ -239,7 +241,7 @@ function rt(t, n) {
239
241
  const a = i.props;
240
242
  if (!a || typeof a != "object") return !1;
241
243
  const s = typeof a.label == "string" ? a.label : void 0;
242
- return s === n ? !0 : Q(a, s)?.title === n;
244
+ return s === n ? !0 : P(a, s)?.title === n;
243
245
  };
244
246
  if (e.type === "ActionButton") return o(e);
245
247
  if (e.children) for (const i of e.children) {
@@ -252,14 +254,14 @@ function rt(t, n) {
252
254
  }
253
255
  return !1;
254
256
  }
255
- var w = 0;
256
- function R() {
257
- return w += 1, `gengage-merge-${w}`;
257
+ var S = 0;
258
+ function x() {
259
+ return S += 1, `gengage-merge-${S}`;
258
260
  }
259
- function lt(t, n) {
261
+ function et(t, n) {
260
262
  const e = t.elements[t.root];
261
263
  if (!e || e.type !== "ButtonRow") return;
262
- const o = R();
264
+ const o = x();
263
265
  t.elements[o] = {
264
266
  type: "ActionButton",
265
267
  props: {
@@ -272,10 +274,10 @@ function lt(t, n) {
272
274
  }
273
275
  }, e.children = e.children ? [o, ...e.children] : [o];
274
276
  }
275
- function ct(t, n) {
277
+ function nt(t, n) {
276
278
  const e = t.elements[t.root];
277
279
  if (!e || e.type !== "ActionButtons") return;
278
- const o = R();
280
+ const o = x();
279
281
  t.elements[o] = {
280
282
  type: "ActionButton",
281
283
  props: {
@@ -300,7 +302,7 @@ function ct(t, n) {
300
302
  buttons: [a, ...i]
301
303
  };
302
304
  }
303
- function dt(t) {
305
+ function ot(t) {
304
306
  const n = {}, e = [];
305
307
  for (let o = 0; o < t.length; o++) {
306
308
  const i = t[o], a = `action-${o}`;
@@ -324,13 +326,13 @@ function dt(t) {
324
326
  elements: n
325
327
  };
326
328
  }
327
- function ut(t) {
329
+ function it(t) {
328
330
  return t.find((n) => {
329
331
  const e = n.elements[n.root];
330
332
  return e?.type === "ActionButtons" || e?.type === "ButtonRow";
331
333
  });
332
334
  }
333
- function L(t, n) {
335
+ function I(t, n) {
334
336
  const e = t.productContextQuickPillLabel, o = { text: e };
335
337
  return n && n.length > 0 && (o.sku_list = n), {
336
338
  title: e,
@@ -338,29 +340,29 @@ function L(t, n) {
338
340
  payload: o
339
341
  };
340
342
  }
341
- function pt(t, n, e) {
343
+ function at(t, n, e) {
342
344
  const o = e?.skuList, i = [], a = [];
343
345
  for (const l of t) {
344
346
  const c = l.elements[l.root];
345
347
  if (c?.type === "ActionButton") {
346
348
  const d = c.props;
347
- if (Q(d, typeof d?.label == "string" ? d.label : void 0)?.type === "findSimilar") {
348
- i.push(L(n, o));
349
+ if (P(d, typeof d?.label == "string" ? d.label : void 0)?.type === "findSimilar") {
350
+ i.push(I(n, o));
349
351
  continue;
350
352
  }
351
353
  }
352
354
  a.push(l);
353
355
  }
354
356
  if (i.length === 0) return t;
355
- const s = L(n, o), r = ut(a);
356
- if (!r) return [...a, dt([s])];
357
- if (!rt(r, s.title)) {
357
+ const s = I(n, o), r = it(a);
358
+ if (!r) return [...a, ot([s])];
359
+ if (!tt(r, s.title)) {
358
360
  const l = r.elements[r.root];
359
- l?.type === "ActionButtons" ? ct(r, s) : l?.type === "ButtonRow" && lt(r, s);
361
+ l?.type === "ActionButtons" ? nt(r, s) : l?.type === "ButtonRow" && et(r, s);
360
362
  }
361
363
  return a;
362
364
  }
363
- var N = {
365
+ var B = {
364
366
  quickQuestionsAriaLabel: "Hızlı sorular",
365
367
  askQuestionAriaLabel: "Soru sorun",
366
368
  defaultInputPlaceholder: "Bir soru sorun...",
@@ -369,7 +371,7 @@ var N = {
369
371
  defaultCtaText: "Başka bir şey sor",
370
372
  redirectingToChat: "Sohbete yönlendiriliyor...",
371
373
  productContextQuickPillLabel: "Bu ürün hakkında ne bilmeliyim?"
372
- }, ht = {
374
+ }, st = {
373
375
  quickQuestionsAriaLabel: "Quick questions",
374
376
  askQuestionAriaLabel: "Ask a question",
375
377
  defaultInputPlaceholder: "Ask a question...",
@@ -379,55 +381,20 @@ var N = {
379
381
  redirectingToChat: "Redirecting to chat...",
380
382
  productContextQuickPillLabel: "What should I know about this product?"
381
383
  };
382
- function gt(t) {
384
+ function rt(t) {
383
385
  return t ? t.toLowerCase().split("-")[0] ?? "tr" : "tr";
384
386
  }
385
- function ft(t) {
386
- return gt(t) === "en" ? ht : N;
387
+ function lt(t) {
388
+ return rt(t) === "en" ? st : B;
387
389
  }
388
- var yt = A({
389
- title: _(),
390
- type: _(),
391
- payload: W().optional()
392
- }), mt = A({
393
- label: _(),
394
- action: yt,
395
- variant: P([
396
- "primary",
397
- "outline",
398
- "ghost"
399
- ]).optional()
400
- }), bt = A({
401
- orientation: P(["horizontal", "vertical"]).optional(),
402
- wrap: F().optional()
403
- }), _t = A({
404
- placeholder: j([_(), M(_())]).optional(),
405
- ctaLabel: _().optional()
406
- }), vt = A({ text: _() }), Ct = { components: {
407
- ActionButton: {
408
- schema: mt,
409
- description: "A single clickable QNA action button."
410
- },
411
- ButtonRow: {
412
- schema: bt,
413
- description: "Container for a group of QNA action buttons."
414
- },
415
- TextInput: {
416
- schema: _t,
417
- description: "Free-text input with rotating placeholder and CTA button."
418
- },
419
- QuestionHeading: {
420
- schema: vt,
421
- description: "A heading displayed above the QNA button group."
422
- }
423
- } }, At = class extends Z {
390
+ var ct = class extends D {
424
391
  constructor(...t) {
425
- super(...t), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = N, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
392
+ super(...t), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = B, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
426
393
  }
427
394
  async onInit(t) {
428
- this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = C(t.locale), this.root.appendChild(this._contentEl);
395
+ this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = q(t.locale), this.root.appendChild(this._contentEl);
429
396
  const n = t.pageContext?.sku;
430
- n && (this._lastSku = n, await this._fetchAndRender(n)), $("qna");
397
+ n && (this._lastSku = n, await this._fetchAndRender(n)), G("qna");
431
398
  }
432
399
  onUpdate(t) {
433
400
  const n = t.sku;
@@ -464,11 +431,11 @@ var yt = A({
464
431
  this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
465
432
  const n = this._createLoadingIndicator();
466
433
  this._contentEl.appendChild(n);
467
- const e = { middlewareUrl: this.config.middlewareUrl }, o = crypto.randomUUID(), i = Date.now(), a = et({
434
+ const e = { middlewareUrl: this.config.middlewareUrl }, o = crypto.randomUUID(), i = Date.now(), a = J({
468
435
  source: "qna",
469
436
  locale: this.config.locale
470
437
  });
471
- this.track(K(this.analyticsContext(), {
438
+ this.track(U(this.analyticsContext(), {
472
439
  endpoint: "launcher_action",
473
440
  request_id: o,
474
441
  widget: "qna"
@@ -479,16 +446,16 @@ var yt = A({
479
446
  session_id: this.config.session?.sessionId ?? "",
480
447
  correlation_id: this.config.session?.sessionId ?? "",
481
448
  sku: t,
482
- locale: C(this.config.locale)
449
+ locale: q(this.config.locale)
483
450
  }, r = this.config.pageContext?.pageType;
484
451
  r !== void 0 && (s.page_type = r);
485
- const l = await nt(s, e, this._abortController.signal);
486
- if (this.track(V(this.analyticsContext(), {
452
+ const l = await V(s, e, this._abortController.signal);
453
+ if (this.track(j(this.analyticsContext(), {
487
454
  request_id: o,
488
455
  latency_ms: Date.now() - i,
489
456
  chunk_count: l.actions.length,
490
457
  widget: "qna"
491
- })), this.track(Y(this.analyticsContext(), {
458
+ })), this.track(F(this.analyticsContext(), {
492
459
  message_count: l.actions.length,
493
460
  history_ref: o,
494
461
  redaction_level: "none",
@@ -506,7 +473,7 @@ var yt = A({
506
473
  let g;
507
474
  if (y !== !0) g = y ?? this._i18n.defaultInputPlaceholder;
508
475
  else if (l.actions.length > 0) {
509
- const f = l.actions.filter((v) => v.type === "user_message" || v.title.includes("?")).map((v) => v.title);
476
+ const f = l.actions.filter((_) => _.type === "user_message" || _.title.includes("?")).map((_) => _.title);
510
477
  g = f.length > 0 ? f : this._i18n.defaultInputPlaceholder;
511
478
  } else g = this._i18n.defaultInputPlaceholder;
512
479
  const p = {
@@ -514,19 +481,19 @@ var yt = A({
514
481
  i18n: this._i18n
515
482
  }, h = this._resolvedQnaHeaderTitle();
516
483
  h !== void 0 && (p.headingTitleOverride = h), this.config.hideButtonRowCta || (p.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (p.ctaText = this.config.ctaText)), g !== void 0 && (p.inputPlaceholder = g);
517
- const b = this._buildFallbackActionsSpec(l.actions), T = st(this.config.pageContext), u = (l.uiSpecs.length > 0 ? pt(l.uiSpecs, this._i18n, { skuList: T }) : [b]).filter((f) => Object.keys(f.elements).length > 0);
484
+ const b = this._buildFallbackActionsSpec(l.actions), v = X(this.config.pageContext), u = (l.uiSpecs.length > 0 ? at(l.uiSpecs, this._i18n, { skuList: v }) : [b]).filter((f) => Object.keys(f.elements).length > 0);
518
485
  for (const f of u) {
519
- const v = this._renderUISpec(f, p);
520
- c.appendChild(v);
486
+ const _ = this._renderUISpec(f, p);
487
+ c.appendChild(_);
521
488
  }
522
- u.length > 0 && G("qna"), this._specIncludesType(u, "TextInput") || this._insertStandaloneInputBeforePills(c, p, g);
489
+ u.length > 0 && z("qna"), this._specIncludesType(u, "TextInput") || this._insertStandaloneInputBeforePills(c, p, g);
523
490
  } catch (s) {
524
491
  if (s instanceof DOMException && s.name === "AbortError") return;
525
- if (E("gengage:global:error", {
492
+ if (T("gengage:global:error", {
526
493
  source: "qna",
527
494
  code: "FETCH_ERROR",
528
- message: J(this.config.locale, s)
529
- }), this.track(X(this.analyticsContext(), {
495
+ message: M(this.config.locale, s)
496
+ }), this.track(W(this.analyticsContext(), {
530
497
  request_id: o,
531
498
  error_code: "FETCH_ERROR",
532
499
  error_message: s instanceof Error ? s.message : String(s),
@@ -557,15 +524,15 @@ var yt = A({
557
524
  }
558
525
  _resolveI18n(t) {
559
526
  return {
560
- ...ft(t.locale),
527
+ ...lt(t.locale),
561
528
  ...t.i18n
562
529
  };
563
530
  }
564
531
  _resolveUISpecRegistry() {
565
- return H(it(), this.config.renderer?.registry);
532
+ return R(Z(), this.config.renderer?.registry);
566
533
  }
567
534
  _renderUISpec(t, n) {
568
- const e = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? B, i = (s, r) => at(s, r, e, o), a = this.config.renderer?.renderUISpec;
535
+ const e = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? w, i = (s, r) => K(s, r, e, o), a = this.config.renderer?.renderUISpec;
569
536
  return a ? a(t, n, {
570
537
  registry: e,
571
538
  unknownRenderer: o,
@@ -636,10 +603,10 @@ var yt = A({
636
603
  (e ?? this._contentEl).appendChild(i);
637
604
  }
638
605
  _handleAction(t) {
639
- this._showTransitionIndicator(), tt(t.title, t.type), this.config.onActionSelected?.(t), setTimeout(() => E("gengage:qna:action", t), 350);
606
+ this._showTransitionIndicator(), $(t.title, t.type), this.config.onActionSelected?.(t), setTimeout(() => T("gengage:qna:action", t), 350);
640
607
  }
641
608
  _handleOpenChat() {
642
- this._showTransitionIndicator(), this.config.onOpenChat?.(), setTimeout(() => E("gengage:qna:open-chat", {}), 350);
609
+ this._showTransitionIndicator(), this.config.onOpenChat?.(), setTimeout(() => T("gengage:qna:open-chat", {}), 350);
643
610
  }
644
611
  _showTransitionIndicator() {
645
612
  if (!this._contentEl) return;
@@ -650,14 +617,13 @@ var yt = A({
650
617
  }, 600);
651
618
  }
652
619
  };
653
- function kt() {
654
- return new At();
620
+ function ft() {
621
+ return new ct();
655
622
  }
656
623
  export {
657
- B as a,
658
- it as i,
659
- kt as n,
660
- at as o,
661
- Ct as r,
662
- At as t
624
+ K as a,
625
+ w as i,
626
+ ft as n,
627
+ Z as r,
628
+ ct as t
663
629
  };