@gengage/assistant-fe 0.5.7 → 0.6.1

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 (191) hide show
  1. package/README.md +6 -22
  2. package/dist/agentic/adaptor/create-adaptor.d.ts +19 -0
  3. package/dist/agentic/adaptor/fetch-bridge.d.ts +11 -0
  4. package/dist/agentic/adaptor/mount.d.ts +38 -0
  5. package/dist/agentic/context/chat-context.d.ts +15 -0
  6. package/dist/agentic/context/context-store.d.ts +20 -0
  7. package/dist/agentic/context/persistence.d.ts +12 -0
  8. package/dist/agentic/events/builders.d.ts +10 -0
  9. package/dist/agentic/events/error-taxonomy.d.ts +27 -0
  10. package/dist/agentic/events/product-normalize.d.ts +47 -0
  11. package/dist/agentic/events/ui-specs.d.ts +37 -0
  12. package/dist/agentic/flow/beauty-consulting-turn.d.ts +1 -0
  13. package/dist/agentic/flow/create-flow.d.ts +2 -0
  14. package/dist/agentic/flow/dispatch.d.ts +3 -0
  15. package/dist/agentic/index.d.ts +18 -0
  16. package/dist/agentic/index.js +624 -0
  17. package/dist/agentic/types.d.ts +212 -0
  18. package/dist/agentic/util/assistant-host.d.ts +11 -0
  19. package/dist/agentic/util/be-url.d.ts +4 -0
  20. package/dist/agentic/util/browser-memory.d.ts +13 -0
  21. package/dist/agentic/util/browser-tools.d.ts +31 -0
  22. package/dist/agentic/util/lazy-runtime-loader.d.ts +9 -0
  23. package/dist/agentic/util/request-text.d.ts +3 -0
  24. package/dist/agentic/util/time.d.ts +2 -0
  25. package/dist/agentic/worker/be-client.d.ts +15 -0
  26. package/dist/agentic/worker/entry.d.ts +2 -0
  27. package/dist/agentic/worker/flow-runner.d.ts +24 -0
  28. package/dist/agentic/worker/jwt-mint.d.ts +21 -0
  29. package/dist/agentic/worker/rpc.d.ts +24 -0
  30. package/dist/agentic/worker/tool-bridge.d.ts +2 -0
  31. package/dist/agentic/worker.d.ts +16 -0
  32. package/dist/agentic/worker.js +119 -0
  33. package/dist/agentic.iife.js +5 -0
  34. package/dist/{api-paths-CwzwbgQZ.js → api-paths-C4WzXzyY.js} +1 -1
  35. package/dist/beauty-consulting-turn-BmPXbkQg.js +1019 -0
  36. package/dist/chat/api.d.ts +17 -0
  37. package/dist/chat/assistant-mode.d.ts +20 -0
  38. package/dist/chat/attachment-utils.d.ts +9 -0
  39. package/dist/chat/catalog.d.ts +455 -0
  40. package/dist/chat/chat-presentation-state.d.ts +53 -0
  41. package/dist/chat/components/AIGroupingCards.d.ts +15 -0
  42. package/dist/chat/components/AISuggestedSearchCards.d.ts +13 -0
  43. package/dist/chat/components/AITopPicks.d.ts +9 -0
  44. package/dist/chat/components/BeautyPhotoStep.d.ts +31 -0
  45. package/dist/chat/components/CategoriesContainer.d.ts +11 -0
  46. package/dist/chat/components/ChatDrawer.d.ts +362 -0
  47. package/dist/chat/components/ChoicePrompter.d.ts +21 -0
  48. package/dist/chat/components/ComparisonTable.d.ts +66 -0
  49. package/dist/chat/components/ConsultingStylePicker.d.ts +40 -0
  50. package/dist/chat/components/FloatingComparisonButton.d.ts +7 -0
  51. package/dist/chat/components/FloatingLauncher.d.ts +79 -0
  52. package/dist/chat/components/GroundingReviewCard.d.ts +11 -0
  53. package/dist/chat/components/HandoffNotice.d.ts +9 -0
  54. package/dist/chat/components/KvkkBanner.d.ts +6 -0
  55. package/dist/chat/components/Launcher.d.ts +28 -0
  56. package/dist/chat/components/PanelRestoreCard.d.ts +4 -0
  57. package/dist/chat/components/PanelTopBar.d.ts +32 -0
  58. package/dist/chat/components/PhotoAnalysisCard.d.ts +27 -0
  59. package/dist/chat/components/ProductSummaryCard.d.ts +12 -0
  60. package/dist/chat/components/ProsAndCons.d.ts +8 -0
  61. package/dist/chat/components/ReviewHighlights.d.ts +16 -0
  62. package/dist/chat/components/actionClassifier.d.ts +12 -0
  63. package/dist/chat/components/product-price-layout.d.ts +17 -0
  64. package/dist/chat/components/productMentionLinker.d.ts +26 -0
  65. package/dist/chat/components/renderUISpec.d.ts +15 -0
  66. package/dist/chat/components/typewriter.d.ts +24 -0
  67. package/dist/chat/extendedModeManager.d.ts +32 -0
  68. package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +38 -0
  69. package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +22 -0
  70. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +59 -0
  71. package/dist/chat/features/beauty-consulting/registry.d.ts +9 -0
  72. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +45 -0
  73. package/dist/chat/history-storage.d.ts +85 -0
  74. package/dist/chat/index.d.ts +6 -0
  75. package/dist/chat/kvkk.d.ts +20 -0
  76. package/dist/chat/locales/en.d.ts +2 -0
  77. package/dist/chat/locales/index.d.ts +5 -0
  78. package/dist/chat/locales/tr.d.ts +2 -0
  79. package/dist/chat/panel-manager.d.ts +142 -0
  80. package/dist/chat/runtime.d.ts +417 -0
  81. package/dist/chat/session-persistence.d.ts +73 -0
  82. package/dist/chat/stream-error-display.d.ts +6 -0
  83. package/dist/chat/types.d.ts +547 -0
  84. package/dist/chat/utils/chat-presentation-debug.d.ts +18 -0
  85. package/dist/chat/utils/get-chat-scroll-element.d.ts +10 -0
  86. package/dist/chat/utils/ui.d.ts +10 -0
  87. package/dist/chat-runtime.js +1 -1
  88. package/dist/chat.iife.js +12 -12
  89. package/dist/chat.js +1 -1
  90. package/dist/common/action-router.d.ts +26 -0
  91. package/dist/common/api-paths.d.ts +23 -0
  92. package/dist/common/client.d.ts +27 -0
  93. package/dist/common/communication-bridge.d.ts +51 -0
  94. package/dist/common/config-constants.d.ts +1 -0
  95. package/dist/common/config-schema.d.ts +54 -0
  96. package/dist/common/connection-warning.d.ts +8 -0
  97. package/dist/common/consulting-sources.d.ts +8 -0
  98. package/dist/common/context.d.ts +64 -0
  99. package/dist/common/css-escape.d.ts +1 -0
  100. package/dist/common/customization-factories.d.ts +59 -0
  101. package/dist/common/debug.d.ts +13 -0
  102. package/dist/common/events.d.ts +55 -0
  103. package/dist/common/fastIntent.d.ts +1 -0
  104. package/dist/common/find-similar-payload.d.ts +3 -0
  105. package/dist/common/ga-datalayer.d.ts +80 -0
  106. package/dist/common/global-error-toast.d.ts +6 -0
  107. package/dist/common/index.d.ts +47 -0
  108. package/dist/common/indexed-db.d.ts +89 -0
  109. package/dist/common/locale.d.ts +1 -0
  110. package/dist/common/native-webview.d.ts +60 -0
  111. package/dist/common/navigation.d.ts +1 -0
  112. package/dist/common/overlay.d.ts +172 -0
  113. package/dist/common/page-detect.d.ts +36 -0
  114. package/dist/common/pill-launcher.d.ts +51 -0
  115. package/dist/common/preflight.d.ts +13 -0
  116. package/dist/common/price-formatter.d.ts +35 -0
  117. package/dist/common/product-utils.d.ts +35 -0
  118. package/dist/common/protocol-adapter.d.ts +108 -0
  119. package/dist/common/renderer/dom.d.ts +3 -0
  120. package/dist/common/renderer/index.d.ts +4 -0
  121. package/dist/common/renderer/overrides.d.ts +23 -0
  122. package/dist/common/renderer/registry.d.ts +2 -0
  123. package/dist/common/renderer/types.d.ts +19 -0
  124. package/dist/common/safe-html.d.ts +22 -0
  125. package/dist/common/sdk-version.d.ts +3 -0
  126. package/dist/common/streaming.d.ts +52 -0
  127. package/dist/common/suggested-search-keywords.d.ts +18 -0
  128. package/dist/common/theme-utils.d.ts +15 -0
  129. package/dist/common/transport.d.ts +75 -0
  130. package/dist/common/tts-player.d.ts +13 -0
  131. package/dist/common/types.d.ts +379 -0
  132. package/dist/common/ui-theme.d.ts +9 -0
  133. package/dist/common/uuidv7.d.ts +7 -0
  134. package/dist/common/voice-input.d.ts +74 -0
  135. package/dist/common/widget-base.d.ts +82 -0
  136. package/dist/{common-KpJP1YwP.js → common-DstAcheX.js} +90 -139
  137. package/dist/common.js +41 -41
  138. package/dist/{connection-warning-B5T_1oBn.js → connection-warning-Ddr91Y9x.js} +1 -1
  139. package/dist/{fastIntent--Ukm2nOh.js → fastIntent-XtUvISni.js} +199 -137
  140. package/dist/index.d.ts +25 -0
  141. package/dist/index.js +50 -50
  142. package/dist/native/index.d.ts +2 -0
  143. package/dist/{native-webview-qfjm4SHx.js → native-webview-JDC1vtde.js} +1 -1
  144. package/dist/native.iife.js +14 -14
  145. package/dist/native.js +1 -1
  146. package/dist/{overlay-CP5A0Hhf.js → overlay-BetAvpVZ.js} +19 -19
  147. package/dist/overlay.d.ts +4 -0
  148. package/dist/overlay.js +1 -1
  149. package/dist/qna/api.d.ts +23 -0
  150. package/dist/qna/catalog.d.ts +60 -0
  151. package/dist/qna/components/ButtonRow.d.ts +15 -0
  152. package/dist/qna/components/TextInput.d.ts +11 -0
  153. package/dist/qna/components/renderUISpec.d.ts +7 -0
  154. package/dist/qna/index.d.ts +3 -0
  155. package/dist/qna/locales/en.d.ts +2 -0
  156. package/dist/qna/locales/index.d.ts +4 -0
  157. package/dist/qna/locales/tr.d.ts +2 -0
  158. package/dist/qna/normalize-ui-specs.d.ts +15 -0
  159. package/dist/qna/runtime.d.ts +73 -0
  160. package/dist/qna/types.d.ts +98 -0
  161. package/dist/qna-runtime.js +1 -1
  162. package/dist/qna.iife.js +1 -1
  163. package/dist/qna.js +1 -1
  164. package/dist/{runtime-G3idwfkM.js → runtime-C66Wp6OR.js} +967 -923
  165. package/dist/{runtime-C3yOvNFK.js → runtime-CcA_r8pw.js} +3 -3
  166. package/dist/{runtime-BPyXOyyp.js → runtime-DJMUL882.js} +3 -3
  167. package/dist/simbut/index.d.ts +31 -0
  168. package/dist/simbut/locales.d.ts +3 -0
  169. package/dist/simbut/types.d.ts +43 -0
  170. package/dist/{simbut-CiknJI6-.js → simbut-B6L3fwI7.js} +1 -1
  171. package/dist/simbut.iife.js +1 -1
  172. package/dist/simbut.js +1 -1
  173. package/dist/simrel/api.d.ts +25 -0
  174. package/dist/simrel/catalog.d.ts +77 -0
  175. package/dist/simrel/components/GroupTabs.d.ts +24 -0
  176. package/dist/simrel/components/ProductCard.d.ts +19 -0
  177. package/dist/simrel/components/ProductGrid.d.ts +17 -0
  178. package/dist/simrel/components/renderUISpec.d.ts +7 -0
  179. package/dist/simrel/index.d.ts +5 -0
  180. package/dist/simrel/locales/en.d.ts +2 -0
  181. package/dist/simrel/locales/index.d.ts +4 -0
  182. package/dist/simrel/locales/tr.d.ts +2 -0
  183. package/dist/simrel/renderers/default.d.ts +41 -0
  184. package/dist/simrel/runtime.d.ts +68 -0
  185. package/dist/simrel/types.d.ts +145 -0
  186. package/dist/{simrel-C1YN71aW.js → simrel-BB4Jrr32.js} +1 -1
  187. package/dist/simrel-runtime.js +1 -1
  188. package/dist/simrel.iife.js +1 -1
  189. package/dist/simrel.js +2 -2
  190. package/dist/{widget-base-UmvgIqDk.js → widget-base-B3Oq8pjs.js} +1 -1
  191. package/package.json +21 -39
@@ -1,55 +1,55 @@
1
- import { i as g } from "./widget-base-UmvgIqDk.js";
2
- import { c as l, i as p, o as d, r as u, t as w } from "./schemas-CLo8wCjs.js";
3
- import { a as y, i as h } from "./overlay-CP5A0Hhf.js";
4
- var c = d({ enabled: u().default(!0) }), v = d({
1
+ import { i as g } from "./widget-base-B3Oq8pjs.js";
2
+ import { c as l, i as p, o as u, r as c, t as y } from "./schemas-CLo8wCjs.js";
3
+ import { a as w, i as v } from "./overlay-BetAvpVZ.js";
4
+ var d = u({ enabled: c().default(!0) }), h = u({
5
5
  chat: l().optional(),
6
6
  qna: l().optional(),
7
7
  simrel: l().optional(),
8
8
  simbut: l().optional()
9
- }), b = d({}), U = d({
10
- idempotencyKey: l().default(y),
11
- requireDomReady: u().default(!0)
12
- }), I = w([
9
+ }), b = u({}), S = u({
10
+ idempotencyKey: l().default(w),
11
+ requireDomReady: c().default(!0)
12
+ }), T = y([
13
13
  "log-and-ignore",
14
14
  "throw",
15
15
  "delegate"
16
- ]), T = d({
17
- unknownActionPolicy: I.default("log-and-ignore"),
18
- allowScriptCall: u().default(!1)
19
- }), f = d({
16
+ ]), U = u({
17
+ unknownActionPolicy: T.default("log-and-ignore"),
18
+ allowScriptCall: c().default(!1)
19
+ }), f = u({
20
20
  version: p("1", { error: 'version must be "1"' }),
21
21
  accountId: l({ error: "accountId must be a non-empty string" }).min(1, { error: "accountId must be a non-empty string" }),
22
22
  middlewareUrl: l({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }).url({ error: 'middlewareUrl must be a valid URL (e.g. "https://your-backend.example.com")' }),
23
23
  locale: l().optional(),
24
- widgets: d({
25
- chat: c.default({ enabled: !0 }),
26
- qna: c.default({ enabled: !0 }),
27
- simrel: c.optional(),
28
- simbut: c.default({ enabled: !1 })
24
+ widgets: u({
25
+ chat: d.default({ enabled: !0 }),
26
+ qna: d.default({ enabled: !0 }),
27
+ simrel: d.optional(),
28
+ simbut: d.default({ enabled: !1 })
29
29
  }),
30
- mounts: v.default({}),
30
+ mounts: h.default({}),
31
31
  transport: b.default({}),
32
- gtm: U.default({
32
+ gtm: S.default({
33
33
  idempotencyKey: "__gengageWidgetsInit",
34
34
  requireDomReady: !0
35
35
  }),
36
- actionHandling: T.default({
36
+ actionHandling: U.default({
37
37
  unknownActionPolicy: "log-and-ignore",
38
38
  allowScriptCall: !1
39
39
  })
40
40
  });
41
41
  function C(e) {
42
42
  g("config", "parsing account runtime config", e);
43
- const n = f.parse(e);
43
+ const r = f.parse(e);
44
44
  return g("config", "config resolved", {
45
- accountId: n.accountId,
46
- middlewareUrl: n.middlewareUrl
47
- }), n;
45
+ accountId: r.accountId,
46
+ middlewareUrl: r.middlewareUrl
47
+ }), r;
48
48
  }
49
- function S(e) {
49
+ function P(e) {
50
50
  return f.safeParse(e);
51
51
  }
52
- function x(e) {
52
+ function $(e) {
53
53
  return C({
54
54
  version: "1",
55
55
  accountId: e.accountId,
@@ -62,102 +62,58 @@ function x(e) {
62
62
  }
63
63
  });
64
64
  }
65
- var M = "tr";
66
- function N(e) {
67
- return {
68
- ACCOUNT_ID: e.accountId,
69
- MIDDLEWARE_URL: e.middlewareUrl,
70
- LOCALE: e.locale ?? "tr"
71
- };
72
- }
73
- function $(e, n = {}) {
74
- const t = {
75
- accountId: e.accountId,
76
- middlewareUrl: e.middlewareUrl,
77
- session: { sessionId: e.sessionId },
78
- variant: "floating",
79
- locale: e.locale ?? "tr",
80
- ...n
81
- };
82
- return e.theme !== void 0 && (t.theme = e.theme), t;
83
- }
84
- function F(e, n = {}) {
85
- const t = {
86
- accountId: e.accountId,
87
- middlewareUrl: e.middlewareUrl,
88
- session: { sessionId: e.sessionId },
89
- pageContext: {
90
- pageType: "pdp",
91
- sku: e.sku
92
- },
93
- mountTarget: e.mountTarget,
94
- ...n
95
- };
96
- return e.theme !== void 0 && (t.theme = e.theme), t;
97
- }
98
- function K(e, n = {}) {
99
- const t = {
100
- accountId: e.accountId,
101
- middlewareUrl: e.middlewareUrl,
102
- session: { sessionId: e.sessionId },
103
- sku: e.sku,
104
- mountTarget: e.mountTarget,
105
- ...n
106
- };
107
- return e.theme !== void 0 && (t.theme = e.theme), t;
108
- }
109
- function E(e) {
65
+ function R(e) {
110
66
  try {
111
67
  return document.querySelector(e), !0;
112
68
  } catch {
113
69
  return !1;
114
70
  }
115
71
  }
116
- function P(e, n) {
117
- const t = [], r = e.mounts, i = [
118
- ["qna", r.qna],
119
- ["simrel", r.simrel],
120
- ["simbut", r.simbut],
121
- ["chat", r.chat]
72
+ function E(e, r) {
73
+ const n = [], t = e.mounts, i = [
74
+ ["qna", t.qna],
75
+ ["simrel", t.simrel],
76
+ ["simbut", t.simbut],
77
+ ["chat", t.chat]
122
78
  ];
123
79
  for (const [a, s] of i)
124
80
  if (s !== void 0) {
125
81
  if (a === "simrel" && e.widgets.simrel === void 0) {
126
- t.push({
82
+ n.push({
127
83
  code: "SIMREL_MOUNT_IGNORED",
128
84
  message: "[gengage preflight] mounts.simrel is set but widgets.simrel is not declared — SimRel will not initialize. Add widgets.simrel: { enabled: true } to enable it.",
129
85
  severity: "warn"
130
86
  });
131
87
  continue;
132
88
  }
133
- if (!E(s)) {
134
- t.push({
89
+ if (!R(s)) {
90
+ n.push({
135
91
  code: "INVALID_SELECTOR",
136
92
  message: `[gengage preflight] ${a} mount selector is invalid CSS: "${s}"`,
137
93
  severity: "error"
138
94
  });
139
95
  continue;
140
96
  }
141
- document.querySelector(s) || t.push({
97
+ document.querySelector(s) || n.push({
142
98
  code: "MOUNT_NOT_FOUND",
143
99
  message: `[gengage preflight] ${a} mount target not found: "${s}" — widget will skip or wait for DOM`,
144
100
  severity: "warn"
145
101
  });
146
102
  }
147
- if (e.widgets.simbut.enabled && r.simbut === void 0) {
103
+ if (e.widgets.simbut.enabled && t.simbut === void 0) {
148
104
  const a = "#gengage-simbut";
149
- document.querySelector(a) || t.push({
105
+ document.querySelector(a) || n.push({
150
106
  code: "SIMBUT_MOUNT_REQUIRED",
151
107
  message: `[gengage preflight] SimBut is enabled but no mount target is configured. Set mounts.simbut to your product image wrapper selector (e.g. "#product-gallery"). The default "${a}" was not found in the DOM.`,
152
108
  severity: "error"
153
109
  });
154
110
  }
155
111
  const o = e.gtm.idempotencyKey;
156
- if (window[o] !== void 0 && t.push({
112
+ if (window[o] !== void 0 && n.push({
157
113
  code: "DUPLICATE_IDEMPOTENCY",
158
114
  message: `[gengage preflight] window["${o}"] already exists — widgets may have already initialized`,
159
115
  severity: "warn"
160
- }), !n?.skipCspCheck) {
116
+ }), !r?.skipCspCheck) {
161
117
  let a = !1;
162
118
  const s = (m) => {
163
119
  m.blockedURI && e.middlewareUrl.startsWith(m.blockedURI) && (a = !0);
@@ -172,61 +128,61 @@ function P(e, n) {
172
128
  } catch {
173
129
  a = !0;
174
130
  }
175
- document.removeEventListener("securitypolicyviolation", s), a && t.push({
131
+ document.removeEventListener("securitypolicyviolation", s), a && n.push({
176
132
  code: "CSP_BLOCKED",
177
133
  message: `[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,
178
134
  severity: "warn"
179
135
  });
180
136
  }
181
- for (const a of t) a.severity === "error" ? console.error(a.message) : console.warn(a.message);
137
+ for (const a of n) a.severity === "error" ? console.error(a.message) : console.warn(a.message);
182
138
  return {
183
- ok: t.every((a) => a.severity !== "error"),
184
- warnings: t
139
+ ok: n.every((a) => a.severity !== "error"),
140
+ warnings: n
185
141
  };
186
142
  }
187
- function R(e) {
188
- const n = S(e);
189
- if (!n.success) {
190
- const t = n.error.issues.map((r) => `${r.path.join(".")}: ${r.message}`).join("; ");
191
- throw new Error(`[gengage] Invalid runtime config: ${t}`);
143
+ function k(e) {
144
+ const r = P(e);
145
+ if (!r.success) {
146
+ const n = r.error.issues.map((t) => `${t.path.join(".")}: ${t.message}`).join("; ");
147
+ throw new Error(`[gengage] Invalid runtime config: ${n}`);
192
148
  }
193
- return n.data;
149
+ return r.data;
194
150
  }
195
- function k(e, n, t) {
196
- const r = {
151
+ function I(e, r, n) {
152
+ const t = {
197
153
  accountId: e.accountId,
198
154
  middlewareUrl: e.middlewareUrl,
199
155
  idempotencyKey: e.gtm.idempotencyKey
200
156
  };
201
- return e.locale !== void 0 && (r.locale = e.locale), t !== void 0 && (r.pageContext = t, t.sku !== void 0 && (r.sku = t.sku)), r.chat = { enabled: e.widgets.chat.enabled }, e.mounts.chat !== void 0 && (r.chat.mountTarget = e.mounts.chat), r.qna = { enabled: e.widgets.qna.enabled }, e.mounts.qna !== void 0 && (r.qna.mountTarget = e.mounts.qna), e.widgets.simrel !== void 0 && (r.simrel = {
157
+ return e.locale !== void 0 && (t.locale = e.locale), n !== void 0 && (t.pageContext = n, n.sku !== void 0 && (t.sku = n.sku)), t.chat = { enabled: e.widgets.chat.enabled }, e.mounts.chat !== void 0 && (t.chat.mountTarget = e.mounts.chat), t.qna = { enabled: e.widgets.qna.enabled }, e.mounts.qna !== void 0 && (t.qna.mountTarget = e.mounts.qna), e.widgets.simrel !== void 0 && (t.simrel = {
202
158
  enabled: e.widgets.simrel.enabled,
203
159
  ...e.mounts.simrel !== void 0 ? { mountTarget: e.mounts.simrel } : {}
204
- }), r.simbut = { enabled: e.widgets.simbut.enabled }, e.mounts.simbut !== void 0 && (r.simbut.mountTarget = e.mounts.simbut), n?.onAddToCart !== void 0 && (r.onAddToCart = n.onAddToCart), n?.onProductNavigate !== void 0 && (r.onProductNavigate = n.onProductNavigate), n?.onFindSimilar !== void 0 && (r.simbut.onFindSimilar = n.onFindSimilar), n?.onScriptCall !== void 0 && (r.onScriptCall = n.onScriptCall), r;
160
+ }), t.simbut = { enabled: e.widgets.simbut.enabled }, e.mounts.simbut !== void 0 && (t.simbut.mountTarget = e.mounts.simbut), r?.onAddToCart !== void 0 && (t.onAddToCart = r.onAddToCart), r?.onProductNavigate !== void 0 && (t.onProductNavigate = r.onProductNavigate), r?.onFindSimilar !== void 0 && (t.simbut.onFindSimilar = r.onFindSimilar), r?.onScriptCall !== void 0 && (t.onScriptCall = r.onScriptCall), t;
205
161
  }
206
- async function B(e) {
207
- const n = R(e.runtimeConfig);
162
+ async function A(e) {
163
+ const r = k(e.runtimeConfig);
208
164
  if (e.preflight !== !1) {
209
- const i = P(n);
165
+ const i = E(r);
210
166
  if (!i.ok) {
211
167
  const o = i.warnings.filter((a) => a.severity === "error");
212
168
  throw new Error(`[gengage] Preflight failed: ${o.map((a) => a.message).join("; ")}`);
213
169
  }
214
170
  }
215
- const t = e.contextResolver?.(), r = await h(k(n, e.hostActions, t));
171
+ const n = e.contextResolver?.(), t = await v(I(r, e.hostActions, n));
216
172
  if (e.contextResolver !== void 0) {
217
173
  const i = e.contextResolver, o = () => {
218
174
  const s = i();
219
- r.updateContext(s);
175
+ t.updateContext(s);
220
176
  };
221
177
  window.addEventListener("gengage:context:update", o);
222
- const a = r.destroy.bind(r);
223
- r.destroy = () => {
178
+ const a = t.destroy.bind(t);
179
+ t.destroy = () => {
224
180
  window.removeEventListener("gengage:context:update", o), a();
225
181
  };
226
182
  }
227
- return r;
183
+ return t;
228
184
  }
229
- var L = [
185
+ var q = [
230
186
  {
231
187
  pageType: "home",
232
188
  urlPatterns: [
@@ -274,51 +230,46 @@ var L = [
274
230
  ]
275
231
  }
276
232
  ];
277
- function D(e, n) {
278
- const t = n ?? (typeof window < "u" ? new URL(window.location.href) : null);
279
- if (!t) return "other";
280
- const r = e ?? L, i = t.pathname;
281
- for (const o of r)
233
+ function D(e, r) {
234
+ const n = r ?? (typeof window < "u" ? new URL(window.location.href) : null);
235
+ if (!n) return "other";
236
+ const t = e ?? q, i = n.pathname;
237
+ for (const o of t)
282
238
  if (!(o.urlPatterns && !o.urlPatterns.some((a) => {
283
239
  try {
284
240
  return new RegExp(a, "i").test(i);
285
241
  } catch {
286
242
  return !1;
287
243
  }
288
- })) && !(o.queryParam && !t.searchParams.has(o.queryParam)) && !(o.selector && typeof document < "u" && !document.querySelector(o.selector)))
244
+ })) && !(o.queryParam && !n.searchParams.has(o.queryParam)) && !(o.selector && typeof document < "u" && !document.querySelector(o.selector)))
289
245
  return o.pageType;
290
246
  return "other";
291
247
  }
292
- function q(e) {
293
- const n = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
294
- if (!n) return;
295
- const t = n.pathname, r = t.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
296
- if (r?.[1]) return r[1];
297
- const i = t.match(/-p-(\d+)/i);
248
+ function L(e) {
249
+ const r = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
250
+ if (!r) return;
251
+ const n = r.pathname, t = n.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
252
+ if (t?.[1]) return t[1];
253
+ const i = n.match(/-p-(\d+)/i);
298
254
  if (i?.[1]) return i[1];
299
255
  }
300
- function W(e) {
301
- const n = D(e), t = { pageType: n };
302
- if (n === "pdp") {
303
- const r = q();
304
- r && (t.sku = r);
256
+ function M(e) {
257
+ const r = D(e), n = { pageType: r };
258
+ if (r === "pdp") {
259
+ const t = L();
260
+ t && (n.sku = t);
305
261
  }
306
- return typeof window < "u" && (t.url = window.location.href), t;
262
+ return typeof window < "u" && (n.url = window.location.href), n;
307
263
  }
308
264
  export {
309
- P as a,
265
+ E as a,
310
266
  $ as c,
311
- f as d,
312
- I as f,
313
- S as h,
314
- B as i,
315
- F as l,
316
- C as m,
267
+ A as i,
268
+ C as l,
317
269
  D as n,
318
- M as o,
319
- x as p,
320
- q as r,
321
- N as s,
322
- W as t,
323
- K as u
270
+ f as o,
271
+ L as r,
272
+ T as s,
273
+ M as t,
274
+ P as u
324
275
  };
package/dist/common.js CHANGED
@@ -1,72 +1,72 @@
1
- import { a, d as t, f as s, h as r, i, l as o, m as n, n as c, o as m, p as l, r as d, t as g, u as p } from "./api-paths-CwzwbgQZ.js";
2
- import { N as f, a as E, c as S, i as h, k as C, n as T, o as y, r as A, s as G, t as I } from "./context-BBuSsXZ9.js";
3
- import { a as R, c as W, d as v, f as N, l as P, n as U, o as O, p as D, r as _, t as L, u as b } from "./widget-base-UmvgIqDk.js";
4
- import { i as x, n as B, o as F, r as z, t as M } from "./fastIntent--Ukm2nOh.js";
5
- import { n as K, t as H } from "./connection-warning-B5T_1oBn.js";
6
- import { i as q, n as Z, r as j, t as J } from "./overlay-CP5A0Hhf.js";
7
- import { a as Y, i as $, n as ee, r as ae } from "./native-webview-qfjm4SHx.js";
8
- import { a as se, c as re, d as ie, f as oe, h as ne, i as ce, l as me, m as le, n as de, o as ge, p as pe, r as ue, s as fe, t as Ee, u as Se } from "./common-KpJP1YwP.js";
1
+ import { a, d as t, f as s, h as r, i, l as o, m as n, n as c, o as l, p as m, r as g, t as d, u as p } from "./api-paths-C4WzXzyY.js";
2
+ import { N as f, a as E, c as S, i as C, k as T, n as h, o as y, r as A, s as G, t as I } from "./context-BBuSsXZ9.js";
3
+ import { a as R, c as W, d as v, f as N, l as P, n as U, o as O, p as D, r as _, t as L, u as b } from "./widget-base-B3Oq8pjs.js";
4
+ import { a as x, c as B, f as F, i as z, l as M, n as V, o as K, r as H, s as Q, t as q } from "./fastIntent-XtUvISni.js";
5
+ import { n as j, t as J } from "./connection-warning-Ddr91Y9x.js";
6
+ import { i as Y, n as $, r as ee, t as ae } from "./overlay-BetAvpVZ.js";
7
+ import { a as se, i as re, n as ie, r as oe } from "./native-webview-JDC1vtde.js";
8
+ import { a as ce, c as le, i as me, l as ge, n as de, o as pe, r as ue, s as fe, t as Ee, u as Se } from "./common-DstAcheX.js";
9
9
  export {
10
- ie as AccountRuntimeConfigSchema,
10
+ pe as AccountRuntimeConfigSchema,
11
11
  b as BASE_WIDGET_THEME,
12
12
  L as BaseWidget,
13
- ge as DEFAULT_CUSTOMIZATION_LOCALE,
13
+ x as DEFAULT_CUSTOMIZATION_LOCALE,
14
14
  N as DEFAULT_WIDGET_THEME_TOKENS,
15
15
  U as GENGAGE_BUILD_FLAVOR,
16
16
  _ as GENGAGE_VERSION,
17
- oe as UnknownActionPolicySchema,
18
- z as VoiceInput,
19
- d as adaptBackendEvent,
20
- ee as applyNativeSession,
17
+ fe as UnknownActionPolicySchema,
18
+ H as VoiceInput,
19
+ g as adaptBackendEvent,
20
+ ie as applyNativeSession,
21
21
  Ee as autoDetectPageContext,
22
22
  I as bootstrapSession,
23
- g as buildChatEndpointUrl,
24
- J as buildOverlayIdempotencyKey,
25
- H as configureConnectionWarning,
23
+ d as buildChatEndpointUrl,
24
+ ae as buildOverlayIdempotencyKey,
25
+ J as configureConnectionWarning,
26
26
  t as consumeStream,
27
- fe as createAccountIdentity,
28
- pe as createDefaultAccountRuntimeConfig,
29
- re as createFloatingChatConfig,
30
- ae as createNativeWebViewBridge,
31
- me as createPdpQnaConfig,
32
- Se as createPdpSimRelConfig,
27
+ K as createAccountIdentity,
28
+ le as createDefaultAccountRuntimeConfig,
29
+ Q as createFloatingChatConfig,
30
+ oe as createNativeWebViewBridge,
31
+ B as createPdpQnaConfig,
32
+ M as createPdpSimRelConfig,
33
33
  n as defaultUnknownUISpecRenderer,
34
- Z as destroyOverlayWidgets,
35
- M as detectFastIntent,
36
- $ as detectNativeEnvironment,
34
+ $ as destroyOverlayWidgets,
35
+ q as detectFastIntent,
36
+ re as detectNativeEnvironment,
37
37
  de as detectPageType,
38
38
  R as dismissGlobalErrorToast,
39
39
  E as dispatch,
40
40
  ue as extractSkuFromUrl,
41
41
  O as getGlobalErrorMessage,
42
- j as getOverlayWidgets,
42
+ ee as getOverlayWidgets,
43
43
  o as getSuggestedSearchKeywords,
44
44
  p as getSuggestedSearchKeywordsText,
45
- T as getWindowPageContext,
46
- ce as initGengageClient,
47
- Y as initNativeOverlayWidgets,
48
- q as initOverlayWidgets,
49
- x as isVoiceInputSupported,
45
+ h as getWindowPageContext,
46
+ me as initGengageClient,
47
+ se as initNativeOverlayWidgets,
48
+ Y as initOverlayWidgets,
49
+ z as isVoiceInputSupported,
50
50
  y as listen,
51
- B as makePillLauncher,
52
- l as mergeUISpecRegistry,
51
+ V as makePillLauncher,
52
+ m as mergeUISpecRegistry,
53
53
  c as normalizeMiddlewareUrl,
54
54
  i as normalizeProductGroupingsResponse,
55
55
  a as normalizeSimilarProductsResponse,
56
- le as parseAccountRuntimeConfig,
57
- se as preflightDiagnostics,
58
- m as productToNormalized,
56
+ ge as parseAccountRuntimeConfig,
57
+ ce as preflightDiagnostics,
58
+ l as productToNormalized,
59
59
  W as registerGlobalErrorToastListener,
60
60
  r as renderUISpecWithRegistry,
61
61
  A as resolveSession,
62
62
  F as routeStreamAction,
63
- ne as safeParseAccountRuntimeConfig,
63
+ Se as safeParseAccountRuntimeConfig,
64
64
  f as sanitizeHtml,
65
65
  P as showGlobalErrorToast,
66
66
  s as streamPost,
67
- K as trackConnectionWarningRequest,
68
- h as updatePageContext,
69
- C as wireGADataLayer,
67
+ j as trackConnectionWarningRequest,
68
+ C as updatePageContext,
69
+ T as wireGADataLayer,
70
70
  G as wireQNAToChat,
71
71
  S as wireSimilarToChat,
72
72
  v as withBaseTheme,
@@ -1,4 +1,4 @@
1
- import { a as y, l as d } from "./widget-base-UmvgIqDk.js";
1
+ import { a as y, l as d } from "./widget-base-B3Oq8pjs.js";
2
2
  var h = 8e3, m = 5e3, g = "https://www.google.com/favicon.ico";
3
3
  function b(e) {
4
4
  e.probeUrl && (g = e.probeUrl);