@gengage/assistant-fe 0.5.7 → 0.6.0
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/create-adaptor.d.ts +19 -0
- package/dist/agentic/adaptor/fetch-bridge.d.ts +11 -0
- package/dist/agentic/adaptor/mount.d.ts +38 -0
- package/dist/agentic/context/chat-context.d.ts +15 -0
- package/dist/agentic/context/context-store.d.ts +20 -0
- package/dist/agentic/context/persistence.d.ts +12 -0
- package/dist/agentic/events/builders.d.ts +10 -0
- package/dist/agentic/events/error-taxonomy.d.ts +27 -0
- package/dist/agentic/events/product-normalize.d.ts +47 -0
- package/dist/agentic/events/ui-specs.d.ts +37 -0
- package/dist/agentic/flow/beauty-consulting-turn.d.ts +1 -0
- package/dist/agentic/flow/create-flow.d.ts +2 -0
- package/dist/agentic/flow/dispatch.d.ts +3 -0
- package/dist/agentic/index.d.ts +18 -0
- package/dist/agentic/index.js +620 -0
- package/dist/agentic/types.d.ts +212 -0
- package/dist/agentic/util/assistant-host.d.ts +11 -0
- package/dist/agentic/util/be-url.d.ts +4 -0
- package/dist/agentic/util/browser-memory.d.ts +13 -0
- package/dist/agentic/util/browser-tools.d.ts +31 -0
- package/dist/agentic/util/lazy-runtime-loader.d.ts +9 -0
- package/dist/agentic/util/request-text.d.ts +3 -0
- package/dist/agentic/util/time.d.ts +2 -0
- package/dist/agentic/worker/be-client.d.ts +15 -0
- package/dist/agentic/worker/entry.d.ts +2 -0
- package/dist/agentic/worker/flow-runner.d.ts +24 -0
- package/dist/agentic/worker/jwt-mint.d.ts +21 -0
- package/dist/agentic/worker/rpc.d.ts +24 -0
- package/dist/agentic/worker/tool-bridge.d.ts +2 -0
- package/dist/agentic/worker.d.ts +16 -0
- package/dist/agentic/worker.js +119 -0
- package/dist/agentic.iife.js +5 -0
- package/dist/{api-paths-CwzwbgQZ.js → api-paths-DJFF9RuZ.js} +1 -1
- package/dist/beauty-consulting-turn-BmPXbkQg.js +1019 -0
- package/dist/chat/api.d.ts +17 -0
- package/dist/chat/assistant-mode.d.ts +20 -0
- package/dist/chat/attachment-utils.d.ts +9 -0
- package/dist/chat/catalog.d.ts +455 -0
- package/dist/chat/chat-presentation-state.d.ts +53 -0
- package/dist/chat/components/AIGroupingCards.d.ts +15 -0
- package/dist/chat/components/AISuggestedSearchCards.d.ts +13 -0
- package/dist/chat/components/AITopPicks.d.ts +9 -0
- package/dist/chat/components/BeautyPhotoStep.d.ts +31 -0
- package/dist/chat/components/CategoriesContainer.d.ts +11 -0
- package/dist/chat/components/ChatDrawer.d.ts +362 -0
- package/dist/chat/components/ChoicePrompter.d.ts +21 -0
- package/dist/chat/components/ComparisonTable.d.ts +66 -0
- package/dist/chat/components/ConsultingStylePicker.d.ts +40 -0
- package/dist/chat/components/FloatingComparisonButton.d.ts +7 -0
- package/dist/chat/components/FloatingLauncher.d.ts +79 -0
- package/dist/chat/components/GroundingReviewCard.d.ts +11 -0
- package/dist/chat/components/HandoffNotice.d.ts +9 -0
- package/dist/chat/components/KvkkBanner.d.ts +6 -0
- package/dist/chat/components/Launcher.d.ts +28 -0
- package/dist/chat/components/PanelRestoreCard.d.ts +4 -0
- package/dist/chat/components/PanelTopBar.d.ts +32 -0
- package/dist/chat/components/PhotoAnalysisCard.d.ts +27 -0
- package/dist/chat/components/ProductSummaryCard.d.ts +12 -0
- package/dist/chat/components/ProsAndCons.d.ts +8 -0
- package/dist/chat/components/ReviewHighlights.d.ts +16 -0
- package/dist/chat/components/actionClassifier.d.ts +12 -0
- package/dist/chat/components/product-price-layout.d.ts +17 -0
- package/dist/chat/components/productMentionLinker.d.ts +26 -0
- package/dist/chat/components/renderUISpec.d.ts +15 -0
- package/dist/chat/components/typewriter.d.ts +24 -0
- package/dist/chat/extendedModeManager.d.ts +32 -0
- package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +38 -0
- package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +22 -0
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +59 -0
- package/dist/chat/features/beauty-consulting/registry.d.ts +9 -0
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +45 -0
- package/dist/chat/history-storage.d.ts +85 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/kvkk.d.ts +20 -0
- package/dist/chat/locales/en.d.ts +2 -0
- package/dist/chat/locales/index.d.ts +5 -0
- package/dist/chat/locales/tr.d.ts +2 -0
- package/dist/chat/panel-manager.d.ts +142 -0
- package/dist/chat/runtime.d.ts +416 -0
- package/dist/chat/session-persistence.d.ts +73 -0
- package/dist/chat/stream-error-display.d.ts +6 -0
- package/dist/chat/types.d.ts +547 -0
- package/dist/chat/utils/chat-presentation-debug.d.ts +18 -0
- package/dist/chat/utils/get-chat-scroll-element.d.ts +10 -0
- package/dist/chat/utils/ui.d.ts +10 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +12 -12
- package/dist/chat.js +1 -1
- package/dist/common/action-router.d.ts +26 -0
- package/dist/common/api-paths.d.ts +23 -0
- package/dist/common/client.d.ts +27 -0
- package/dist/common/communication-bridge.d.ts +51 -0
- package/dist/common/config-constants.d.ts +1 -0
- package/dist/common/config-schema.d.ts +54 -0
- package/dist/common/connection-warning.d.ts +8 -0
- package/dist/common/consulting-sources.d.ts +8 -0
- package/dist/common/context.d.ts +64 -0
- package/dist/common/css-escape.d.ts +1 -0
- package/dist/common/customization-factories.d.ts +59 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/events.d.ts +55 -0
- package/dist/common/fastIntent.d.ts +1 -0
- package/dist/common/find-similar-payload.d.ts +3 -0
- package/dist/common/ga-datalayer.d.ts +80 -0
- package/dist/common/global-error-toast.d.ts +6 -0
- package/dist/common/index.d.ts +47 -0
- package/dist/common/indexed-db.d.ts +89 -0
- package/dist/common/locale.d.ts +1 -0
- package/dist/common/native-webview.d.ts +60 -0
- package/dist/common/navigation.d.ts +1 -0
- package/dist/common/overlay.d.ts +172 -0
- package/dist/common/page-detect.d.ts +36 -0
- package/dist/common/pill-launcher.d.ts +51 -0
- package/dist/common/preflight.d.ts +13 -0
- package/dist/common/price-formatter.d.ts +35 -0
- package/dist/common/product-utils.d.ts +35 -0
- package/dist/common/protocol-adapter.d.ts +108 -0
- package/dist/common/renderer/dom.d.ts +3 -0
- package/dist/common/renderer/index.d.ts +4 -0
- package/dist/common/renderer/overrides.d.ts +23 -0
- package/dist/common/renderer/registry.d.ts +2 -0
- package/dist/common/renderer/types.d.ts +19 -0
- package/dist/common/safe-html.d.ts +22 -0
- package/dist/common/sdk-version.d.ts +3 -0
- package/dist/common/streaming.d.ts +52 -0
- package/dist/common/suggested-search-keywords.d.ts +18 -0
- package/dist/common/theme-utils.d.ts +15 -0
- package/dist/common/transport.d.ts +75 -0
- package/dist/common/tts-player.d.ts +13 -0
- package/dist/common/types.d.ts +379 -0
- package/dist/common/ui-theme.d.ts +9 -0
- package/dist/common/uuidv7.d.ts +7 -0
- package/dist/common/voice-input.d.ts +74 -0
- package/dist/common/widget-base.d.ts +82 -0
- package/dist/{common-KpJP1YwP.js → common-BydCGBNn.js} +90 -139
- package/dist/common.js +41 -41
- package/dist/{connection-warning-B5T_1oBn.js → connection-warning-Pbvk3J8k.js} +1 -1
- package/dist/{fastIntent--Ukm2nOh.js → fastIntent-CkYN2UOl.js} +199 -137
- package/dist/index.d.ts +25 -0
- package/dist/index.js +50 -50
- package/dist/native/index.d.ts +2 -0
- package/dist/{native-webview-qfjm4SHx.js → native-webview-JDC1vtde.js} +1 -1
- package/dist/native.iife.js +14 -14
- package/dist/native.js +1 -1
- package/dist/{overlay-CP5A0Hhf.js → overlay-BetAvpVZ.js} +19 -19
- package/dist/overlay.d.ts +4 -0
- package/dist/overlay.js +1 -1
- package/dist/qna/api.d.ts +23 -0
- package/dist/qna/catalog.d.ts +60 -0
- package/dist/qna/components/ButtonRow.d.ts +15 -0
- package/dist/qna/components/TextInput.d.ts +11 -0
- package/dist/qna/components/renderUISpec.d.ts +7 -0
- package/dist/qna/index.d.ts +3 -0
- package/dist/qna/locales/en.d.ts +2 -0
- package/dist/qna/locales/index.d.ts +4 -0
- package/dist/qna/locales/tr.d.ts +2 -0
- package/dist/qna/normalize-ui-specs.d.ts +15 -0
- package/dist/qna/runtime.d.ts +73 -0
- package/dist/qna/types.d.ts +98 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/{runtime-BPyXOyyp.js → runtime-DbZO1qG5.js} +3 -3
- package/dist/{runtime-G3idwfkM.js → runtime-OpNoB3cu.js} +894 -853
- package/dist/{runtime-C3yOvNFK.js → runtime-iCLkUjI3.js} +3 -3
- package/dist/simbut/index.d.ts +31 -0
- package/dist/simbut/locales.d.ts +3 -0
- package/dist/simbut/types.d.ts +43 -0
- package/dist/{simbut-CiknJI6-.js → simbut-FyXolmZY.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/simrel/api.d.ts +25 -0
- package/dist/simrel/catalog.d.ts +77 -0
- package/dist/simrel/components/GroupTabs.d.ts +24 -0
- package/dist/simrel/components/ProductCard.d.ts +19 -0
- package/dist/simrel/components/ProductGrid.d.ts +17 -0
- package/dist/simrel/components/renderUISpec.d.ts +7 -0
- package/dist/simrel/index.d.ts +5 -0
- package/dist/simrel/locales/en.d.ts +2 -0
- package/dist/simrel/locales/index.d.ts +4 -0
- package/dist/simrel/locales/tr.d.ts +2 -0
- package/dist/simrel/renderers/default.d.ts +41 -0
- package/dist/simrel/runtime.d.ts +68 -0
- package/dist/simrel/types.d.ts +145 -0
- package/dist/{simrel-C1YN71aW.js → simrel-CbLe5OAr.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-UmvgIqDk.js → widget-base-COP8QwU3.js} +1 -1
- package/package.json +20 -6
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { i as g } from "./widget-base-
|
|
2
|
-
import { c as l, i as p, o as
|
|
3
|
-
import { a as
|
|
4
|
-
var
|
|
1
|
+
import { i as g } from "./widget-base-COP8QwU3.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 =
|
|
10
|
-
idempotencyKey: l().default(
|
|
11
|
-
requireDomReady:
|
|
12
|
-
}),
|
|
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
|
-
]),
|
|
17
|
-
unknownActionPolicy:
|
|
18
|
-
allowScriptCall:
|
|
19
|
-
}), f =
|
|
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:
|
|
25
|
-
chat:
|
|
26
|
-
qna:
|
|
27
|
-
simrel:
|
|
28
|
-
simbut:
|
|
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:
|
|
30
|
+
mounts: h.default({}),
|
|
31
31
|
transport: b.default({}),
|
|
32
|
-
gtm:
|
|
32
|
+
gtm: S.default({
|
|
33
33
|
idempotencyKey: "__gengageWidgetsInit",
|
|
34
34
|
requireDomReady: !0
|
|
35
35
|
}),
|
|
36
|
-
actionHandling:
|
|
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
|
|
43
|
+
const r = f.parse(e);
|
|
44
44
|
return g("config", "config resolved", {
|
|
45
|
-
accountId:
|
|
46
|
-
middlewareUrl:
|
|
47
|
-
}),
|
|
45
|
+
accountId: r.accountId,
|
|
46
|
+
middlewareUrl: r.middlewareUrl
|
|
47
|
+
}), r;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function P(e) {
|
|
50
50
|
return f.safeParse(e);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
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
|
-
|
|
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
|
|
117
|
-
const
|
|
118
|
-
["qna",
|
|
119
|
-
["simrel",
|
|
120
|
-
["simbut",
|
|
121
|
-
["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
|
-
|
|
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 (!
|
|
134
|
-
|
|
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) ||
|
|
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 &&
|
|
103
|
+
if (e.widgets.simbut.enabled && t.simbut === void 0) {
|
|
148
104
|
const a = "#gengage-simbut";
|
|
149
|
-
document.querySelector(a) ||
|
|
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 &&
|
|
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
|
-
}), !
|
|
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 &&
|
|
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
|
|
137
|
+
for (const a of n) a.severity === "error" ? console.error(a.message) : console.warn(a.message);
|
|
182
138
|
return {
|
|
183
|
-
ok:
|
|
184
|
-
warnings:
|
|
139
|
+
ok: n.every((a) => a.severity !== "error"),
|
|
140
|
+
warnings: n
|
|
185
141
|
};
|
|
186
142
|
}
|
|
187
|
-
function
|
|
188
|
-
const
|
|
189
|
-
if (!
|
|
190
|
-
const
|
|
191
|
-
throw new Error(`[gengage] Invalid runtime config: ${
|
|
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
|
|
149
|
+
return r.data;
|
|
194
150
|
}
|
|
195
|
-
function
|
|
196
|
-
const
|
|
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 && (
|
|
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
|
-
}),
|
|
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
|
|
207
|
-
const
|
|
162
|
+
async function A(e) {
|
|
163
|
+
const r = k(e.runtimeConfig);
|
|
208
164
|
if (e.preflight !== !1) {
|
|
209
|
-
const i =
|
|
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
|
|
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
|
-
|
|
175
|
+
t.updateContext(s);
|
|
220
176
|
};
|
|
221
177
|
window.addEventListener("gengage:context:update", o);
|
|
222
|
-
const a =
|
|
223
|
-
|
|
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
|
|
183
|
+
return t;
|
|
228
184
|
}
|
|
229
|
-
var
|
|
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,
|
|
278
|
-
const
|
|
279
|
-
if (!
|
|
280
|
-
const
|
|
281
|
-
for (const o of
|
|
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 && !
|
|
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
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const 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
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
|
|
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" && (
|
|
262
|
+
return typeof window < "u" && (n.url = window.location.href), n;
|
|
307
263
|
}
|
|
308
264
|
export {
|
|
309
|
-
|
|
265
|
+
E as a,
|
|
310
266
|
$ as c,
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
2
|
-
import { N as f, a as E, c as S, i as
|
|
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-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { i as
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as
|
|
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-DJFF9RuZ.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-COP8QwU3.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-CkYN2UOl.js";
|
|
5
|
+
import { n as j, t as J } from "./connection-warning-Pbvk3J8k.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-BydCGBNn.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
pe as AccountRuntimeConfigSchema,
|
|
11
11
|
b as BASE_WIDGET_THEME,
|
|
12
12
|
L as BaseWidget,
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
d as buildChatEndpointUrl,
|
|
24
|
+
ae as buildOverlayIdempotencyKey,
|
|
25
|
+
J as configureConnectionWarning,
|
|
26
26
|
t as consumeStream,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
42
|
+
ee as getOverlayWidgets,
|
|
43
43
|
o as getSuggestedSearchKeywords,
|
|
44
44
|
p as getSuggestedSearchKeywordsText,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
51
|
+
V as makePillLauncher,
|
|
52
|
+
m as mergeUISpecRegistry,
|
|
53
53
|
c as normalizeMiddlewareUrl,
|
|
54
54
|
i as normalizeProductGroupingsResponse,
|
|
55
55
|
a as normalizeSimilarProductsResponse,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
63
|
+
Se as safeParseAccountRuntimeConfig,
|
|
64
64
|
f as sanitizeHtml,
|
|
65
65
|
P as showGlobalErrorToast,
|
|
66
66
|
s as streamPost,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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,
|