@gengage/assistant-fe 0.1.0 → 0.1.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.
- package/LICENSE +2 -2
- package/README.md +2 -2
- package/dist/assistant-fe.css +1 -1
- package/dist/chat/api.d.ts +12 -2
- package/dist/chat/api.d.ts.map +1 -1
- package/dist/chat/catalog.d.ts +246 -896
- package/dist/chat/catalog.d.ts.map +1 -1
- package/dist/chat/components/AIGroupingCards.d.ts.map +1 -1
- package/dist/chat/components/AISuggestedSearchCards.d.ts.map +1 -1
- package/dist/chat/components/AITopPicks.d.ts.map +1 -1
- package/dist/chat/components/CategoriesContainer.d.ts.map +1 -1
- package/dist/chat/components/ChatDrawer.d.ts +11 -2
- package/dist/chat/components/ChatDrawer.d.ts.map +1 -1
- package/dist/chat/components/ComparisonTable.d.ts +9 -0
- package/dist/chat/components/ComparisonTable.d.ts.map +1 -1
- package/dist/chat/components/GroundingReviewCard.d.ts.map +1 -1
- package/dist/chat/components/HandoffNotice.d.ts +5 -0
- package/dist/chat/components/HandoffNotice.d.ts.map +1 -0
- package/dist/chat/components/KvkkBanner.d.ts +1 -0
- package/dist/chat/components/KvkkBanner.d.ts.map +1 -1
- package/dist/chat/components/ProactivePopup.d.ts +2 -0
- package/dist/chat/components/ProactivePopup.d.ts.map +1 -1
- package/dist/chat/components/ProductSummaryCard.d.ts +4 -0
- package/dist/chat/components/ProductSummaryCard.d.ts.map +1 -0
- package/dist/chat/components/ReviewHighlights.d.ts +3 -1
- package/dist/chat/components/ReviewHighlights.d.ts.map +1 -1
- package/dist/chat/components/ThumbnailsColumn.d.ts.map +1 -1
- package/dist/chat/components/renderUISpec.d.ts +4 -3
- package/dist/chat/components/renderUISpec.d.ts.map +1 -1
- package/dist/chat/heartbeat.d.ts +71 -0
- package/dist/chat/heartbeat.d.ts.map +1 -0
- package/dist/chat/index.d.ts +33 -78
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/kvkk.d.ts +21 -0
- package/dist/chat/kvkk.d.ts.map +1 -0
- package/dist/chat/locales/en.d.ts.map +1 -1
- package/dist/chat/locales/tr.d.ts.map +1 -1
- package/dist/chat/panel-manager.d.ts +81 -0
- package/dist/chat/panel-manager.d.ts.map +1 -0
- package/dist/chat/session-persistence.d.ts +52 -0
- package/dist/chat/session-persistence.d.ts.map +1 -0
- package/dist/chat/types.d.ts +33 -1
- package/dist/chat/types.d.ts.map +1 -1
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +48 -10
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +9 -8
- package/dist/chat.js.map +1 -1
- package/dist/common/analytics-events.d.ts +2 -0
- package/dist/common/analytics-events.d.ts.map +1 -1
- package/dist/common/analytics.d.ts.map +1 -1
- package/dist/common/api-paths.d.ts +5 -0
- package/dist/common/api-paths.d.ts.map +1 -1
- package/dist/common/client.d.ts +4 -1
- package/dist/common/client.d.ts.map +1 -1
- package/dist/common/communication-bridge.d.ts.map +1 -1
- package/dist/common/config-schema.d.ts +33 -195
- package/dist/common/config-schema.d.ts.map +1 -1
- package/dist/common/ga-datalayer.d.ts +62 -0
- package/dist/common/ga-datalayer.d.ts.map +1 -0
- package/dist/common/index.d.ts +7 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/indexed-db.d.ts +1 -1
- package/dist/common/indexed-db.d.ts.map +1 -1
- package/dist/common/merchant-configs.d.ts +22 -0
- package/dist/common/merchant-configs.d.ts.map +1 -0
- package/dist/common/overlay.d.ts +5 -0
- package/dist/common/overlay.d.ts.map +1 -1
- package/dist/common/page-detect.d.ts +31 -0
- package/dist/common/page-detect.d.ts.map +1 -0
- package/dist/common/preflight.d.ts +3 -1
- package/dist/common/preflight.d.ts.map +1 -1
- package/dist/common/price-formatter.d.ts +33 -0
- package/dist/common/price-formatter.d.ts.map +1 -0
- package/dist/common/product-utils.d.ts +26 -0
- package/dist/common/product-utils.d.ts.map +1 -0
- package/dist/common/quantity-stepper.d.ts +22 -0
- package/dist/common/quantity-stepper.d.ts.map +1 -0
- package/dist/common/safe-html.d.ts +10 -6
- package/dist/common/safe-html.d.ts.map +1 -1
- package/dist/common/streaming.d.ts.map +1 -1
- package/dist/common/tts-player.d.ts +12 -0
- package/dist/common/tts-player.d.ts.map +1 -0
- package/dist/common/types.d.ts +51 -0
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/v1-protocol-adapter.d.ts +9 -0
- package/dist/common/v1-protocol-adapter.d.ts.map +1 -1
- package/dist/common/voice-input.d.ts +74 -0
- package/dist/common/voice-input.d.ts.map +1 -0
- package/dist/common/widget-base.d.ts +17 -1
- package/dist/common/widget-base.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js +564 -244
- package/dist/common.js.map +1 -1
- package/dist/index-CmlYMq-h.js +4218 -0
- package/dist/index-CmlYMq-h.js.map +1 -0
- package/dist/index-DK4lqi85.cjs +13 -0
- package/dist/index-DK4lqi85.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -53
- package/dist/qna/catalog.d.ts +30 -96
- package/dist/qna/catalog.d.ts.map +1 -1
- package/dist/qna/components/TextInput.d.ts.map +1 -1
- package/dist/qna/index.d.ts +2 -0
- package/dist/qna/index.d.ts.map +1 -1
- package/dist/qna.cjs +1 -1
- package/dist/qna.cjs.map +1 -1
- package/dist/qna.iife.js +46 -8
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +90 -83
- package/dist/qna.js.map +1 -1
- package/dist/quantity-stepper-B8kX8GbN.js +209 -0
- package/dist/quantity-stepper-B8kX8GbN.js.map +1 -0
- package/dist/quantity-stepper-UbAp53Ow.cjs +2 -0
- package/dist/quantity-stepper-UbAp53Ow.cjs.map +1 -0
- package/dist/schemas-DbbfBnZe.cjs +86 -0
- package/dist/schemas-DbbfBnZe.cjs.map +1 -0
- package/dist/schemas-SGuXpngy.js +4558 -0
- package/dist/schemas-SGuXpngy.js.map +1 -0
- package/dist/simrel/api.d.ts.map +1 -1
- package/dist/simrel/catalog.d.ts +32 -240
- package/dist/simrel/catalog.d.ts.map +1 -1
- package/dist/simrel/components/GroupTabs.d.ts.map +1 -1
- package/dist/simrel/components/ProductCard.d.ts +2 -0
- package/dist/simrel/components/ProductCard.d.ts.map +1 -1
- package/dist/simrel/components/renderUISpec.d.ts.map +1 -1
- package/dist/simrel/index.d.ts.map +1 -1
- package/dist/simrel/types.d.ts +5 -0
- package/dist/simrel/types.d.ts.map +1 -1
- package/dist/simrel.cjs +1 -1
- package/dist/simrel.cjs.map +1 -1
- package/dist/simrel.css +1 -1
- package/dist/simrel.iife.js +46 -8
- package/dist/simrel.iife.js.map +1 -1
- package/dist/simrel.js +319 -279
- package/dist/simrel.js.map +1 -1
- package/package.json +26 -7
- package/dist/index-CFA70IGF.js +0 -3626
- package/dist/index-CFA70IGF.js.map +0 -1
- package/dist/index-Dfl89zpe.cjs +0 -13
- package/dist/index-Dfl89zpe.cjs.map +0 -1
- package/dist/types-CeON7iBO.cjs +0 -48
- package/dist/types-CeON7iBO.cjs.map +0 -1
- package/dist/types-yxW8WA7u.js +0 -4132
- package/dist/types-yxW8WA7u.js.map +0 -1
package/dist/common.js
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { o as
|
|
2
|
-
import { B as
|
|
3
|
-
import { G as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { o as u, s as d, U as A, _ as v, d as f, v as y, V as S, W as x, A as E } from "./schemas-SGuXpngy.js";
|
|
2
|
+
import { B as Pe, X as Ue, a as Re, z as qe, Y as Fe, b as Me, N as Be, Z as Le, $ as ze, c as De, a0 as Ne, a1 as Oe, j as We, k as $e, a2 as He, a3 as Ge, P as Ke, m as Qe, M as Ye, a4 as je, q as Ve, p as Xe, a5 as Ze, a6 as Je, r as et, a7 as tt, T as ot, h as it, l as nt, a8 as at, g as rt, Q as st, a9 as lt, w as dt, aa as ct, ab as ut, ac as ft } from "./schemas-SGuXpngy.js";
|
|
3
|
+
import { G as P } from "./index-CmlYMq-h.js";
|
|
4
|
+
import { V as gt, i as mt, r as pt } from "./index-CmlYMq-h.js";
|
|
5
|
+
import { s as wt } from "./quantity-stepper-B8kX8GbN.js";
|
|
6
|
+
import { GengageQNA as U } from "./qna.js";
|
|
7
|
+
import { GengageSimRel as R } from "./simrel.js";
|
|
8
|
+
const m = u({
|
|
9
|
+
enabled: f().default(!0)
|
|
10
|
+
}), q = u({
|
|
10
11
|
chat: d().optional(),
|
|
11
12
|
qna: d().optional(),
|
|
12
13
|
simrel: d().optional()
|
|
13
|
-
}),
|
|
14
|
-
mode:
|
|
14
|
+
}), F = u({}), M = v(["none", "x-api-key-header", "bearer-header", "body-api-key"]), B = u({
|
|
15
|
+
mode: M.default("none"),
|
|
15
16
|
key: d().optional(),
|
|
16
17
|
headerName: d().optional(),
|
|
17
18
|
bodyField: d().default("api_key")
|
|
18
|
-
}),
|
|
19
|
-
enabled:
|
|
19
|
+
}), L = u({
|
|
20
|
+
enabled: f().default(!0),
|
|
20
21
|
endpoint: d().default("/analytics"),
|
|
21
|
-
auth:
|
|
22
|
-
fireAndForget:
|
|
23
|
-
useBeacon:
|
|
24
|
-
keepaliveFetch:
|
|
25
|
-
timeoutMs:
|
|
26
|
-
maxRetries:
|
|
27
|
-
}),
|
|
28
|
-
idempotencyKey: d().default(
|
|
29
|
-
requireDomReady:
|
|
30
|
-
}),
|
|
31
|
-
unknownActionPolicy:
|
|
32
|
-
allowScriptCall:
|
|
33
|
-
}),
|
|
34
|
-
version:
|
|
22
|
+
auth: B.default({ mode: "none", bodyField: "api_key" }),
|
|
23
|
+
fireAndForget: f().default(!0),
|
|
24
|
+
useBeacon: f().default(!0),
|
|
25
|
+
keepaliveFetch: f().default(!0),
|
|
26
|
+
timeoutMs: y().int().positive().default(4e3),
|
|
27
|
+
maxRetries: y().int().min(0).max(5).default(1)
|
|
28
|
+
}), _ = "__gengageWidgetsInit", z = u({
|
|
29
|
+
idempotencyKey: d().default(_),
|
|
30
|
+
requireDomReady: f().default(!0)
|
|
31
|
+
}), D = v(["log-and-ignore", "throw", "delegate"]), N = u({
|
|
32
|
+
unknownActionPolicy: D.default("log-and-ignore"),
|
|
33
|
+
allowScriptCall: f().default(!1)
|
|
34
|
+
}), C = u({
|
|
35
|
+
version: A("1"),
|
|
35
36
|
accountId: d().min(1),
|
|
36
37
|
middlewareUrl: d().url(),
|
|
37
38
|
locale: d().optional(),
|
|
38
|
-
widgets:
|
|
39
|
-
chat:
|
|
40
|
-
qna:
|
|
41
|
-
simrel:
|
|
39
|
+
widgets: u({
|
|
40
|
+
chat: m.default({ enabled: !0 }),
|
|
41
|
+
qna: m.default({ enabled: !0 }),
|
|
42
|
+
simrel: m.default({ enabled: !0 })
|
|
42
43
|
}),
|
|
43
|
-
mounts:
|
|
44
|
-
transport:
|
|
45
|
-
analytics:
|
|
44
|
+
mounts: q.default({}),
|
|
45
|
+
transport: F.default({}),
|
|
46
|
+
analytics: L.default({
|
|
46
47
|
enabled: !0,
|
|
47
48
|
endpoint: "/analytics",
|
|
48
49
|
auth: { mode: "none", bodyField: "api_key" },
|
|
@@ -52,23 +53,23 @@ const g = l({
|
|
|
52
53
|
timeoutMs: 4e3,
|
|
53
54
|
maxRetries: 1
|
|
54
55
|
}),
|
|
55
|
-
gtm:
|
|
56
|
+
gtm: z.default({
|
|
56
57
|
idempotencyKey: "__gengageWidgetsInit",
|
|
57
58
|
requireDomReady: !0
|
|
58
59
|
}),
|
|
59
|
-
actionHandling:
|
|
60
|
+
actionHandling: N.default({
|
|
60
61
|
unknownActionPolicy: "log-and-ignore",
|
|
61
|
-
allowScriptCall: !
|
|
62
|
+
allowScriptCall: !1
|
|
62
63
|
})
|
|
63
64
|
});
|
|
64
|
-
function
|
|
65
|
-
return
|
|
65
|
+
function O(e) {
|
|
66
|
+
return C.parse(e);
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
68
|
+
function W(e) {
|
|
69
|
+
return C.safeParse(e);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
71
|
+
function ge(e) {
|
|
72
|
+
return O({
|
|
72
73
|
version: "1",
|
|
73
74
|
accountId: e.accountId,
|
|
74
75
|
middlewareUrl: e.middlewareUrl,
|
|
@@ -80,37 +81,37 @@ function le(e) {
|
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
const
|
|
84
|
-
function
|
|
84
|
+
const b = `${_}_overlay_`, $ = "#gengage-qna", H = "#gengage-simrel";
|
|
85
|
+
function p() {
|
|
85
86
|
const e = window;
|
|
86
87
|
return e.__gengageOverlayRegistry || (e.__gengageOverlayRegistry = {
|
|
87
88
|
instances: {},
|
|
88
89
|
pending: {}
|
|
89
90
|
}), e.__gengageOverlayRegistry;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function G(e) {
|
|
92
93
|
const t = {
|
|
93
94
|
pageType: e.pageContext?.pageType ?? (e.sku !== void 0 ? "pdp" : "other")
|
|
94
|
-
},
|
|
95
|
-
return
|
|
95
|
+
}, o = e.pageContext;
|
|
96
|
+
return o?.sku !== void 0 && (t.sku = o.sku), o?.price !== void 0 && (t.price = o.price), o?.categoryTree !== void 0 && (t.categoryTree = o.categoryTree), o?.url !== void 0 && (t.url = o.url), o?.extra !== void 0 && (t.extra = o.extra), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
98
|
+
function K(e, t) {
|
|
99
|
+
const o = {
|
|
99
100
|
...e,
|
|
100
101
|
...t,
|
|
101
102
|
pageType: t.pageType ?? e.pageType
|
|
102
103
|
};
|
|
103
|
-
return t.sku === void 0 && e.sku !== void 0 && (
|
|
104
|
+
return t.sku === void 0 && e.sku !== void 0 && (o.sku = e.sku), o;
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function w(e) {
|
|
106
107
|
return e instanceof HTMLElement || document.querySelector(e) ? e : null;
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
return e.idempotencyKey ?? `${
|
|
109
|
+
function T(e) {
|
|
110
|
+
return e.idempotencyKey ?? `${b}${e.accountId}`;
|
|
110
111
|
}
|
|
111
|
-
class
|
|
112
|
-
constructor(t,
|
|
113
|
-
this.options = t, this.onDestroy =
|
|
112
|
+
class Q {
|
|
113
|
+
constructor(t, o) {
|
|
114
|
+
this.options = t, this.onDestroy = o, this._chat = null, this._qna = null, this._simrel = null, this._analyticsClient = null, this._destroyed = !1, this._queue = Promise.resolve(), this._warnedQnaMountMissing = !1, this._warnedSimRelMountMissing = !1, this.idempotencyKey = T(t), this.session = S(t.session), this._pageContext = G(t);
|
|
114
115
|
}
|
|
115
116
|
get chat() {
|
|
116
117
|
return this._chat;
|
|
@@ -121,6 +122,9 @@ class G {
|
|
|
121
122
|
get simrel() {
|
|
122
123
|
return this._simrel;
|
|
123
124
|
}
|
|
125
|
+
get analyticsClient() {
|
|
126
|
+
return this._analyticsClient;
|
|
127
|
+
}
|
|
124
128
|
async init() {
|
|
125
129
|
window.gengage || (window.gengage = {}), window.gengage.sessionId = this.session.sessionId, window.gengage.pageContext = this._pageContext, await this._initChat(), await this._syncPdpWidgets(), this.options.wireQnaToChat !== !1 && x(), window.gengage.overlay = this;
|
|
126
130
|
}
|
|
@@ -132,25 +136,25 @@ class G {
|
|
|
132
136
|
}
|
|
133
137
|
async updateContext(t) {
|
|
134
138
|
this._destroyed || await this._enqueue(async () => {
|
|
135
|
-
this._pageContext =
|
|
139
|
+
this._pageContext = K(this._pageContext, t), window.gengage || (window.gengage = {}), window.gengage.pageContext = this._pageContext, this._chat?.update(t), this._qna?.update(t), this._simrel?.update(t), await this._syncPdpWidgets();
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
|
-
async updateSku(t,
|
|
139
|
-
await this.updateContext({ sku: t, pageType:
|
|
142
|
+
async updateSku(t, o = "pdp") {
|
|
143
|
+
await this.updateContext({ sku: t, pageType: o });
|
|
140
144
|
}
|
|
141
145
|
destroy() {
|
|
142
146
|
this._destroyed || (this._destroyed = !0, this._chat?.destroy(), this._qna?.destroy(), this._simrel?.destroy(), this._chat = null, this._qna = null, this._simrel = null, window.gengage?.overlay === this && delete window.gengage.overlay, this.onDestroy());
|
|
143
147
|
}
|
|
144
148
|
async _initChat() {
|
|
145
149
|
if (this.options.chat?.enabled === !1) return;
|
|
146
|
-
const t = this.options.middlewareUrl,
|
|
150
|
+
const t = this.options.middlewareUrl, o = {
|
|
147
151
|
accountId: this.options.accountId,
|
|
148
152
|
middlewareUrl: t,
|
|
149
153
|
session: this.session,
|
|
150
154
|
pageContext: this._pageContext,
|
|
151
155
|
variant: this.options.chat?.variant ?? "floating"
|
|
152
156
|
};
|
|
153
|
-
this.options.theme !== void 0 && (
|
|
157
|
+
this.options.theme !== void 0 && (o.theme = this.options.theme), this.options.locale !== void 0 && (o.locale = this.options.locale), this.options.pricing !== void 0 && (o.pricing = this.options.pricing), this.options.chat?.mountTarget !== void 0 && (o.mountTarget = this.options.chat.mountTarget), this.options.chat?.launcherSvg !== void 0 && (o.launcherSvg = this.options.chat.launcherSvg), this.options.chat?.hideMobileLauncher !== void 0 && (o.hideMobileLauncher = this.options.chat.hideMobileLauncher), this.options.chat?.mobileBreakpoint !== void 0 && (o.mobileBreakpoint = this.options.chat.mobileBreakpoint), this.options.chat?.mobileInitialState !== void 0 && (o.mobileInitialState = this.options.chat.mobileInitialState), this.options.chat?.i18n !== void 0 && (o.i18n = this.options.chat.i18n), this.options.chat?.actionHandling !== void 0 && (o.actionHandling = this.options.chat.actionHandling), this.options.onScriptCall !== void 0 && (o.onScriptCall = this.options.onScriptCall), this._chat = new P(), await this._chat.init(o);
|
|
154
158
|
}
|
|
155
159
|
async _syncPdpWidgets() {
|
|
156
160
|
if (this._destroyed) return;
|
|
@@ -159,45 +163,45 @@ class G {
|
|
|
159
163
|
this._destroyPdpWidgets();
|
|
160
164
|
return;
|
|
161
165
|
}
|
|
162
|
-
const
|
|
166
|
+
const i = this.options.middlewareUrl;
|
|
163
167
|
if (this.options.qna?.enabled !== !1) {
|
|
164
|
-
const a = this.options.qna?.mountTarget ??
|
|
165
|
-
if (
|
|
168
|
+
const a = this.options.qna?.mountTarget ?? $, r = w(a);
|
|
169
|
+
if (r)
|
|
166
170
|
if (this._warnedQnaMountMissing = !1, this._qna)
|
|
167
171
|
this._qna.show(), this._qna.update({ pageType: "pdp", sku: t });
|
|
168
172
|
else {
|
|
169
|
-
const
|
|
173
|
+
const s = new U(), n = {
|
|
170
174
|
accountId: this.options.accountId,
|
|
171
|
-
middlewareUrl:
|
|
175
|
+
middlewareUrl: i,
|
|
172
176
|
session: this.session,
|
|
173
177
|
pageContext: {
|
|
174
178
|
pageType: "pdp",
|
|
175
179
|
sku: t
|
|
176
180
|
},
|
|
177
|
-
mountTarget:
|
|
181
|
+
mountTarget: r
|
|
178
182
|
};
|
|
179
|
-
this.options.theme !== void 0 && (
|
|
183
|
+
this.options.theme !== void 0 && (n.theme = this.options.theme), this.options.qna?.ctaText !== void 0 && (n.ctaText = this.options.qna.ctaText), this.options.qna?.inputPlaceholder !== void 0 && (n.inputPlaceholder = this.options.qna.inputPlaceholder), await s.init(n), this._qna = s;
|
|
180
184
|
}
|
|
181
185
|
else
|
|
182
186
|
this._qna?.destroy(), this._qna = null, this._warnedQnaMountMissing || (console.warn(`[gengage] QNA mount target not found: ${a}`), this._warnedQnaMountMissing = !0);
|
|
183
187
|
} else
|
|
184
188
|
this._qna?.destroy(), this._qna = null;
|
|
185
189
|
if (this.options.simrel?.enabled !== !1) {
|
|
186
|
-
const a = this.options.simrel?.mountTarget ??
|
|
187
|
-
if (
|
|
190
|
+
const a = this.options.simrel?.mountTarget ?? H, r = w(a);
|
|
191
|
+
if (r)
|
|
188
192
|
if (this._warnedSimRelMountMissing = !1, this._simrel)
|
|
189
193
|
this._simrel.show(), this._simrel.update({ pageType: "pdp", sku: t });
|
|
190
194
|
else {
|
|
191
|
-
const
|
|
195
|
+
const s = new R(), n = {
|
|
192
196
|
accountId: this.options.accountId,
|
|
193
|
-
middlewareUrl:
|
|
197
|
+
middlewareUrl: i,
|
|
194
198
|
session: this.session,
|
|
195
199
|
sku: t,
|
|
196
|
-
mountTarget:
|
|
200
|
+
mountTarget: r
|
|
197
201
|
};
|
|
198
|
-
this.options.theme !== void 0 && (
|
|
199
|
-
this._chat?.saveSession(
|
|
200
|
-
}, await
|
|
202
|
+
this.options.theme !== void 0 && (n.theme = this.options.theme), this.options.pricing !== void 0 && (n.pricing = this.options.pricing), this.options.simrel?.discountType !== void 0 && (n.discountType = this.options.simrel.discountType), this.options.onAddToCart !== void 0 && (n.onAddToCart = this.options.onAddToCart), this.options.onProductNavigate !== void 0 ? n.onProductNavigate = this.options.onProductNavigate : n.onProductNavigate = (c, h, g) => {
|
|
203
|
+
this._chat?.saveSession(g ?? this.session.sessionId, h), window.location.href = c;
|
|
204
|
+
}, await s.init(n), this._simrel = s;
|
|
201
205
|
}
|
|
202
206
|
else
|
|
203
207
|
this._simrel?.destroy(), this._simrel = null, this._warnedSimRelMountMissing || (console.warn(`[gengage] SimRel mount target not found: ${a}`), this._warnedSimRelMountMissing = !0);
|
|
@@ -208,34 +212,34 @@ class G {
|
|
|
208
212
|
this._qna?.destroy(), this._simrel?.destroy(), this._qna = null, this._simrel = null;
|
|
209
213
|
}
|
|
210
214
|
_enqueue(t) {
|
|
211
|
-
const
|
|
212
|
-
return this._queue =
|
|
213
|
-
}),
|
|
215
|
+
const o = this._queue.then(t);
|
|
216
|
+
return this._queue = o.catch((i) => {
|
|
217
|
+
}), o;
|
|
214
218
|
}
|
|
215
219
|
}
|
|
216
|
-
async function
|
|
217
|
-
const t =
|
|
218
|
-
if (
|
|
219
|
-
const a =
|
|
220
|
+
async function Y(e) {
|
|
221
|
+
const t = T(e), o = p(), i = o.instances[t];
|
|
222
|
+
if (i) return i;
|
|
223
|
+
const a = o.pending[t];
|
|
220
224
|
if (a) return a;
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
delete
|
|
224
|
-
}),
|
|
225
|
-
throw delete
|
|
225
|
+
const r = new Q(e, () => {
|
|
226
|
+
const n = p();
|
|
227
|
+
delete n.instances[t], delete n.pending[t];
|
|
228
|
+
}), s = r.init().then(() => (o.instances[t] = r, delete o.pending[t], r)).catch((n) => {
|
|
229
|
+
throw delete o.pending[t], n;
|
|
226
230
|
});
|
|
227
|
-
return
|
|
231
|
+
return o.pending[t] = s, s;
|
|
228
232
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
233
|
+
function j(e) {
|
|
234
|
+
return p().instances[e] ?? null;
|
|
231
235
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
236
|
+
function me(e) {
|
|
237
|
+
j(e)?.destroy();
|
|
234
238
|
}
|
|
235
|
-
function
|
|
236
|
-
return `${
|
|
239
|
+
function pe(e) {
|
|
240
|
+
return `${b}${e}`;
|
|
237
241
|
}
|
|
238
|
-
const
|
|
242
|
+
const V = {
|
|
239
243
|
enabled: !0,
|
|
240
244
|
endpoint: "/analytics",
|
|
241
245
|
fireAndForget: !0,
|
|
@@ -245,19 +249,19 @@ const j = {
|
|
|
245
249
|
maxRetries: 1,
|
|
246
250
|
batchSize: 10,
|
|
247
251
|
flushIntervalMs: 250
|
|
248
|
-
},
|
|
252
|
+
}, X = {
|
|
249
253
|
mode: "none",
|
|
250
254
|
key: "",
|
|
251
255
|
headerName: "X-API-Key",
|
|
252
256
|
bodyField: "api_key"
|
|
253
257
|
};
|
|
254
|
-
class
|
|
258
|
+
class Z {
|
|
255
259
|
constructor(t) {
|
|
256
260
|
this.queue = [], this.flushTimer = null, this.config = {
|
|
257
|
-
...
|
|
261
|
+
...V,
|
|
258
262
|
...t,
|
|
259
263
|
auth: {
|
|
260
|
-
...
|
|
264
|
+
...X,
|
|
261
265
|
...t.auth ?? {}
|
|
262
266
|
}
|
|
263
267
|
}, this.onPageHideBound = () => {
|
|
@@ -266,8 +270,8 @@ class V {
|
|
|
266
270
|
}
|
|
267
271
|
track(t) {
|
|
268
272
|
if (!this.config.enabled) return;
|
|
269
|
-
const
|
|
270
|
-
if (this.queue.push(
|
|
273
|
+
const o = J(t);
|
|
274
|
+
if (this.queue.push(o), this.queue.length >= this.config.batchSize) {
|
|
271
275
|
this.scheduleImmediateFlush();
|
|
272
276
|
return;
|
|
273
277
|
}
|
|
@@ -275,8 +279,8 @@ class V {
|
|
|
275
279
|
}
|
|
276
280
|
async flush(t = {}) {
|
|
277
281
|
if (!this.config.enabled || this.queue.length === 0) return;
|
|
278
|
-
const
|
|
279
|
-
await this.sendWithRetry(a,
|
|
282
|
+
const o = this.queue.splice(0, this.config.batchSize), i = this.buildTransportBody(o), a = ee(this.config.endpoint, this.config.middlewareUrl), r = t.preferBeacon ?? this.config.useBeacon;
|
|
283
|
+
await this.sendWithRetry(a, i, r);
|
|
280
284
|
}
|
|
281
285
|
/** Drain the entire queue, flushing in batch-sized chunks. */
|
|
282
286
|
async flushAll(t = {}) {
|
|
@@ -284,7 +288,7 @@ class V {
|
|
|
284
288
|
await this.flush(t);
|
|
285
289
|
}
|
|
286
290
|
destroy() {
|
|
287
|
-
this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), typeof window < "u" && window.removeEventListener("pagehide", this.onPageHideBound);
|
|
291
|
+
this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.queue.length > 0 && this.flushAll({ preferBeacon: !0 }), typeof window < "u" && window.removeEventListener("pagehide", this.onPageHideBound);
|
|
288
292
|
}
|
|
289
293
|
scheduleFlush() {
|
|
290
294
|
this.flushTimer || (this.flushTimer = setTimeout(() => {
|
|
@@ -295,44 +299,47 @@ class V {
|
|
|
295
299
|
this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.flush();
|
|
296
300
|
}
|
|
297
301
|
buildTransportBody(t) {
|
|
298
|
-
const
|
|
299
|
-
return this.config.auth.mode === "body-api-key" && this.config.auth.key && (
|
|
302
|
+
const o = { events: t };
|
|
303
|
+
return this.config.auth.mode === "body-api-key" && this.config.auth.key && (o[this.config.auth.bodyField] = this.config.auth.key), o;
|
|
300
304
|
}
|
|
301
|
-
async sendWithRetry(t,
|
|
305
|
+
async sendWithRetry(t, o, i) {
|
|
302
306
|
let a = 0;
|
|
303
307
|
for (; a <= this.config.maxRetries; ) {
|
|
304
308
|
a += 1;
|
|
305
309
|
try {
|
|
306
|
-
if (await this.send(t,
|
|
310
|
+
if (await this.send(t, o, i)) return;
|
|
307
311
|
} catch {
|
|
308
312
|
}
|
|
313
|
+
a <= this.config.maxRetries && await new Promise((r) => setTimeout(r, Math.min(1e3, 100 * Math.pow(2, a - 1))));
|
|
309
314
|
}
|
|
310
315
|
}
|
|
311
|
-
async send(t,
|
|
312
|
-
const a = JSON.stringify(
|
|
313
|
-
if (
|
|
314
|
-
|
|
316
|
+
async send(t, o, i) {
|
|
317
|
+
const a = JSON.stringify(o);
|
|
318
|
+
if (i && this.config.useBeacon && this.config.auth.mode !== "x-api-key-header" && this.config.auth.mode !== "bearer-header" && te()) {
|
|
319
|
+
const h = new Blob([a], { type: "application/json" });
|
|
320
|
+
if (navigator.sendBeacon(t, h)) return !0;
|
|
321
|
+
}
|
|
315
322
|
if (typeof fetch > "u") return !1;
|
|
316
|
-
const
|
|
323
|
+
const s = {
|
|
317
324
|
"Content-Type": "application/json"
|
|
318
325
|
};
|
|
319
|
-
this.config.auth.mode === "x-api-key-header" && this.config.auth.key && (
|
|
320
|
-
const
|
|
326
|
+
this.config.auth.mode === "x-api-key-header" && this.config.auth.key && (s[this.config.auth.headerName] = this.config.auth.key), this.config.auth.mode === "bearer-header" && this.config.auth.key && (s.Authorization = `Bearer ${this.config.auth.key}`);
|
|
327
|
+
const n = typeof AbortController < "u" ? new AbortController() : null, c = n ? setTimeout(() => n.abort(), this.config.timeoutMs) : null;
|
|
321
328
|
try {
|
|
322
|
-
const
|
|
329
|
+
const h = {
|
|
323
330
|
method: "POST",
|
|
324
|
-
headers:
|
|
331
|
+
headers: s,
|
|
325
332
|
body: a,
|
|
326
333
|
keepalive: this.config.keepaliveFetch && this.config.fireAndForget
|
|
327
334
|
};
|
|
328
|
-
return
|
|
335
|
+
return n && (h.signal = n.signal), (await fetch(t, h)).ok;
|
|
329
336
|
} finally {
|
|
330
|
-
|
|
337
|
+
c && clearTimeout(c);
|
|
331
338
|
}
|
|
332
339
|
}
|
|
333
340
|
}
|
|
334
|
-
function
|
|
335
|
-
return new
|
|
341
|
+
function ye(e) {
|
|
342
|
+
return new Z(e);
|
|
336
343
|
}
|
|
337
344
|
function J(e) {
|
|
338
345
|
const t = {
|
|
@@ -346,15 +353,15 @@ function J(e) {
|
|
|
346
353
|
};
|
|
347
354
|
return e.view_id !== void 0 && (t.view_id = e.view_id), e.user_id !== void 0 && (t.user_id = e.user_id), e.widget !== void 0 && (t.widget = e.widget), e.page_type !== void 0 && (t.page_type = e.page_type), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
348
355
|
}
|
|
349
|
-
function
|
|
356
|
+
function ee(e, t) {
|
|
350
357
|
if (/^https?:\/\//i.test(e)) return e;
|
|
351
|
-
const
|
|
352
|
-
return `${
|
|
358
|
+
const o = E(t), i = e.startsWith("/") ? e : `/${e}`;
|
|
359
|
+
return `${o}${i}`;
|
|
353
360
|
}
|
|
354
|
-
function
|
|
361
|
+
function te() {
|
|
355
362
|
return typeof navigator < "u" && typeof navigator.sendBeacon == "function";
|
|
356
363
|
}
|
|
357
|
-
const
|
|
364
|
+
const oe = {
|
|
358
365
|
primaryColor: "#000000",
|
|
359
366
|
primaryForeground: "#ffffff",
|
|
360
367
|
backgroundColor: "#ffffff",
|
|
@@ -379,30 +386,30 @@ const ee = {
|
|
|
379
386
|
"--gengage-qna-input-radius": "14px",
|
|
380
387
|
"--gengage-simrel-card-radius": "14px"
|
|
381
388
|
};
|
|
382
|
-
function
|
|
383
|
-
return { ...
|
|
389
|
+
function we(e) {
|
|
390
|
+
return { ...oe, ...e };
|
|
384
391
|
}
|
|
385
|
-
const
|
|
386
|
-
function
|
|
392
|
+
const k = "tr";
|
|
393
|
+
function ve(e) {
|
|
387
394
|
return {
|
|
388
395
|
ACCOUNT_ID: e.accountId,
|
|
389
396
|
MIDDLEWARE_URL: e.middlewareUrl,
|
|
390
|
-
LOCALE: e.locale ??
|
|
397
|
+
LOCALE: e.locale ?? k
|
|
391
398
|
};
|
|
392
399
|
}
|
|
393
|
-
function
|
|
394
|
-
const
|
|
400
|
+
function _e(e, t = {}) {
|
|
401
|
+
const o = {
|
|
395
402
|
accountId: e.accountId,
|
|
396
403
|
middlewareUrl: e.middlewareUrl,
|
|
397
404
|
session: { sessionId: e.sessionId },
|
|
398
405
|
variant: "floating",
|
|
399
|
-
locale: e.locale ??
|
|
406
|
+
locale: e.locale ?? k,
|
|
400
407
|
...t
|
|
401
408
|
};
|
|
402
|
-
return e.theme !== void 0 && (
|
|
409
|
+
return e.theme !== void 0 && (o.theme = e.theme), o;
|
|
403
410
|
}
|
|
404
|
-
function
|
|
405
|
-
const
|
|
411
|
+
function Ce(e, t = {}) {
|
|
412
|
+
const o = {
|
|
406
413
|
accountId: e.accountId,
|
|
407
414
|
middlewareUrl: e.middlewareUrl,
|
|
408
415
|
session: { sessionId: e.sessionId },
|
|
@@ -410,10 +417,10 @@ function pe(e, t = {}) {
|
|
|
410
417
|
mountTarget: e.mountTarget,
|
|
411
418
|
...t
|
|
412
419
|
};
|
|
413
|
-
return e.theme !== void 0 && (
|
|
420
|
+
return e.theme !== void 0 && (o.theme = e.theme), o;
|
|
414
421
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
422
|
+
function be(e, t = {}) {
|
|
423
|
+
const o = {
|
|
417
424
|
accountId: e.accountId,
|
|
418
425
|
middlewareUrl: e.middlewareUrl,
|
|
419
426
|
session: { sessionId: e.sessionId },
|
|
@@ -421,9 +428,9 @@ function ye(e, t = {}) {
|
|
|
421
428
|
mountTarget: e.mountTarget,
|
|
422
429
|
...t
|
|
423
430
|
};
|
|
424
|
-
return e.theme !== void 0 && (
|
|
431
|
+
return e.theme !== void 0 && (o.theme = e.theme), o;
|
|
425
432
|
}
|
|
426
|
-
function
|
|
433
|
+
function Te(e, t = {}) {
|
|
427
434
|
return {
|
|
428
435
|
enabled: !0,
|
|
429
436
|
middlewareUrl: e,
|
|
@@ -433,152 +440,465 @@ function ve(e, t = {}) {
|
|
|
433
440
|
...t
|
|
434
441
|
};
|
|
435
442
|
}
|
|
436
|
-
function
|
|
443
|
+
function ie(e) {
|
|
437
444
|
try {
|
|
438
445
|
return document.querySelector(e), !0;
|
|
439
446
|
} catch {
|
|
440
447
|
return !1;
|
|
441
448
|
}
|
|
442
449
|
}
|
|
443
|
-
function
|
|
444
|
-
const
|
|
450
|
+
function ne(e, t) {
|
|
451
|
+
const o = [], i = e.mounts, a = [
|
|
445
452
|
["qna", i.qna],
|
|
446
453
|
["simrel", i.simrel],
|
|
447
454
|
["chat", i.chat]
|
|
448
455
|
];
|
|
449
|
-
for (const [s,
|
|
450
|
-
if (
|
|
451
|
-
if (!
|
|
452
|
-
|
|
456
|
+
for (const [s, n] of a)
|
|
457
|
+
if (n !== void 0) {
|
|
458
|
+
if (!ie(n)) {
|
|
459
|
+
o.push({
|
|
453
460
|
code: "INVALID_SELECTOR",
|
|
454
|
-
message: `[gengage preflight] ${s} mount selector is invalid CSS: "${
|
|
461
|
+
message: `[gengage preflight] ${s} mount selector is invalid CSS: "${n}"`,
|
|
455
462
|
severity: "error"
|
|
456
463
|
});
|
|
457
464
|
continue;
|
|
458
465
|
}
|
|
459
|
-
document.querySelector(
|
|
466
|
+
document.querySelector(n) || o.push({
|
|
460
467
|
code: "MOUNT_NOT_FOUND",
|
|
461
|
-
message: `[gengage preflight] ${s} mount target not found: "${
|
|
468
|
+
message: `[gengage preflight] ${s} mount target not found: "${n}" — widget will skip or wait for DOM`,
|
|
462
469
|
severity: "warn"
|
|
463
470
|
});
|
|
464
471
|
}
|
|
465
|
-
const
|
|
466
|
-
window[
|
|
472
|
+
const r = e.gtm.idempotencyKey;
|
|
473
|
+
if (window[r] !== void 0 && o.push({
|
|
467
474
|
code: "DUPLICATE_IDEMPOTENCY",
|
|
468
|
-
message: `[gengage preflight] window["${
|
|
475
|
+
message: `[gengage preflight] window["${r}"] already exists — widgets may have already initialized`,
|
|
469
476
|
severity: "warn"
|
|
470
|
-
})
|
|
471
|
-
|
|
477
|
+
}), !t?.skipCspCheck) {
|
|
478
|
+
let s = !1;
|
|
479
|
+
const n = (c) => {
|
|
480
|
+
c.blockedURI && e.middlewareUrl.startsWith(c.blockedURI) && (s = !0);
|
|
481
|
+
};
|
|
482
|
+
document.addEventListener("securitypolicyviolation", n);
|
|
483
|
+
try {
|
|
484
|
+
fetch(e.middlewareUrl, { method: "HEAD", mode: "no-cors" }).catch(() => {
|
|
485
|
+
});
|
|
486
|
+
} catch {
|
|
487
|
+
s = !0;
|
|
488
|
+
}
|
|
489
|
+
document.removeEventListener("securitypolicyviolation", n), s && o.push({
|
|
490
|
+
code: "CSP_BLOCKED",
|
|
491
|
+
message: `[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,
|
|
492
|
+
severity: "warn"
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
for (const s of o)
|
|
472
496
|
s.severity === "error" ? console.error(s.message) : console.warn(s.message);
|
|
473
497
|
return {
|
|
474
|
-
ok:
|
|
475
|
-
warnings:
|
|
498
|
+
ok: o.every((s) => s.severity !== "error"),
|
|
499
|
+
warnings: o
|
|
476
500
|
};
|
|
477
501
|
}
|
|
478
|
-
function
|
|
479
|
-
const t =
|
|
502
|
+
function ae(e) {
|
|
503
|
+
const t = W(e);
|
|
480
504
|
if (!t.success) {
|
|
481
|
-
const
|
|
482
|
-
throw new Error(`[gengage] Invalid runtime config: ${
|
|
505
|
+
const o = t.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
|
|
506
|
+
throw new Error(`[gengage] Invalid runtime config: ${o}`);
|
|
483
507
|
}
|
|
484
508
|
return t.data;
|
|
485
509
|
}
|
|
486
|
-
function
|
|
487
|
-
const
|
|
510
|
+
function re(e, t, o) {
|
|
511
|
+
const i = {
|
|
488
512
|
accountId: e.accountId,
|
|
489
513
|
middlewareUrl: e.middlewareUrl,
|
|
490
514
|
idempotencyKey: e.gtm.idempotencyKey
|
|
491
515
|
};
|
|
492
|
-
return e.locale !== void 0 && (
|
|
516
|
+
return e.locale !== void 0 && (i.locale = e.locale), o !== void 0 && (i.pageContext = o, o.sku !== void 0 && (i.sku = o.sku)), i.chat = {
|
|
493
517
|
enabled: e.widgets.chat.enabled
|
|
494
|
-
}, e.mounts.chat !== void 0 && (
|
|
518
|
+
}, e.mounts.chat !== void 0 && (i.chat.mountTarget = e.mounts.chat), i.qna = {
|
|
495
519
|
enabled: e.widgets.qna.enabled
|
|
496
|
-
}, e.mounts.qna !== void 0 && (
|
|
520
|
+
}, e.mounts.qna !== void 0 && (i.qna.mountTarget = e.mounts.qna), i.simrel = {
|
|
497
521
|
enabled: e.widgets.simrel.enabled
|
|
498
|
-
}, e.mounts.simrel !== void 0 && (
|
|
522
|
+
}, e.mounts.simrel !== void 0 && (i.simrel.mountTarget = e.mounts.simrel), t?.onAddToCart !== void 0 && (i.onAddToCart = t.onAddToCart), t?.onProductNavigate !== void 0 && (i.onProductNavigate = t.onProductNavigate), t?.onScriptCall !== void 0 && (i.onScriptCall = t.onScriptCall), i;
|
|
499
523
|
}
|
|
500
|
-
async function
|
|
501
|
-
const t =
|
|
524
|
+
async function ke(e) {
|
|
525
|
+
const t = ae(e.runtimeConfig);
|
|
502
526
|
if (e.preflight !== !1) {
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
const
|
|
506
|
-
throw new Error(`[gengage] Preflight failed: ${
|
|
527
|
+
const r = ne(t);
|
|
528
|
+
if (!r.ok) {
|
|
529
|
+
const s = r.warnings.filter((n) => n.severity === "error");
|
|
530
|
+
throw new Error(`[gengage] Preflight failed: ${s.map((n) => n.message).join("; ")}`);
|
|
507
531
|
}
|
|
508
532
|
}
|
|
509
|
-
const
|
|
533
|
+
const o = e.contextResolver?.(), i = re(t, e.hostActions, o), a = await Y(i);
|
|
510
534
|
if (e.contextResolver !== void 0) {
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
535
|
+
const r = e.contextResolver, s = () => {
|
|
536
|
+
const c = r();
|
|
537
|
+
a.updateContext(c);
|
|
538
|
+
};
|
|
539
|
+
window.addEventListener("gengage:context:update", s);
|
|
540
|
+
const n = a.destroy.bind(a);
|
|
541
|
+
a.destroy = () => {
|
|
542
|
+
window.removeEventListener("gengage:context:update", s), n();
|
|
543
|
+
};
|
|
516
544
|
}
|
|
517
545
|
return a;
|
|
518
546
|
}
|
|
547
|
+
const se = [
|
|
548
|
+
{
|
|
549
|
+
pageType: "home",
|
|
550
|
+
urlPatterns: ["^/$", "^/index\\.html?$", "^/anasayfa$"]
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
pageType: "search",
|
|
554
|
+
urlPatterns: ["/arama", "/search", "/ara\\?"],
|
|
555
|
+
queryParam: "q"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
pageType: "cart",
|
|
559
|
+
urlPatterns: ["/sepet", "/cart", "/basket", "/sepetim"]
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
pageType: "plp",
|
|
563
|
+
urlPatterns: ["/kategori/", "/category/", "/c/", "/koleksiyon/", "/collection/"]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
pageType: "pdp",
|
|
567
|
+
urlPatterns: ["/urun/", "/product/", "/p/", "/-p-", "/-pm-"]
|
|
568
|
+
}
|
|
569
|
+
];
|
|
570
|
+
function le(e, t) {
|
|
571
|
+
const o = t ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
572
|
+
if (!o) return "other";
|
|
573
|
+
const i = e ?? se, a = o.pathname;
|
|
574
|
+
for (const r of i)
|
|
575
|
+
if (!(r.urlPatterns && !r.urlPatterns.some((n) => {
|
|
576
|
+
try {
|
|
577
|
+
return new RegExp(n, "i").test(a);
|
|
578
|
+
} catch {
|
|
579
|
+
return !1;
|
|
580
|
+
}
|
|
581
|
+
})) && !(r.queryParam && !o.searchParams.has(r.queryParam)) && !(r.selector && typeof document < "u" && !document.querySelector(r.selector)))
|
|
582
|
+
return r.pageType;
|
|
583
|
+
return "other";
|
|
584
|
+
}
|
|
585
|
+
function de(e) {
|
|
586
|
+
const t = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
587
|
+
if (!t) return;
|
|
588
|
+
const o = t.pathname, i = o.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
|
|
589
|
+
if (i?.[1]) return i[1];
|
|
590
|
+
const a = o.match(/-p-(\d+)/i);
|
|
591
|
+
if (a?.[1]) return a[1];
|
|
592
|
+
}
|
|
593
|
+
function Ie(e) {
|
|
594
|
+
const t = le(e), o = { pageType: t };
|
|
595
|
+
if (t === "pdp") {
|
|
596
|
+
const i = de();
|
|
597
|
+
i && (o.sku = i);
|
|
598
|
+
}
|
|
599
|
+
return typeof window < "u" && (o.url = window.location.href), o;
|
|
600
|
+
}
|
|
601
|
+
const l = "https://chatbe-dev.gengage.ai", I = {
|
|
602
|
+
koctascomtr: {
|
|
603
|
+
accountId: "koctascomtr",
|
|
604
|
+
locale: "tr",
|
|
605
|
+
middlewareUrl: l,
|
|
606
|
+
theme: {
|
|
607
|
+
primaryColor: "#ec6e00",
|
|
608
|
+
primaryForeground: "#ffffff",
|
|
609
|
+
backgroundColor: "#ffffff",
|
|
610
|
+
foregroundColor: "#222222",
|
|
611
|
+
borderRadius: "8px",
|
|
612
|
+
fontFamily: '"Source Sans Pro", "Helvetica Neue", Arial, sans-serif',
|
|
613
|
+
fontSize: "14px"
|
|
614
|
+
},
|
|
615
|
+
chatI18n: {
|
|
616
|
+
inputPlaceholder: "Ürün ara, soru sor",
|
|
617
|
+
poweredBy: "Koçtaş AI Asistan"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
n11com: {
|
|
621
|
+
accountId: "n11com",
|
|
622
|
+
locale: "tr",
|
|
623
|
+
middlewareUrl: l,
|
|
624
|
+
theme: {
|
|
625
|
+
primaryColor: "#ff44ef",
|
|
626
|
+
primaryForeground: "#ffffff",
|
|
627
|
+
backgroundColor: "#ffffff",
|
|
628
|
+
foregroundColor: "#222222",
|
|
629
|
+
borderRadius: "8px",
|
|
630
|
+
fontFamily: "Arial, Helvetica, sans-serif",
|
|
631
|
+
fontSize: "14px"
|
|
632
|
+
},
|
|
633
|
+
chatI18n: {
|
|
634
|
+
inputPlaceholder: "Ne aramıştınız?",
|
|
635
|
+
poweredBy: "n11 AI Asistan"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
hepsiburadacom: {
|
|
639
|
+
accountId: "hepsiburadacom",
|
|
640
|
+
locale: "tr",
|
|
641
|
+
middlewareUrl: l,
|
|
642
|
+
theme: {
|
|
643
|
+
primaryColor: "#ff6000",
|
|
644
|
+
primaryForeground: "#ffffff",
|
|
645
|
+
backgroundColor: "#ffffff",
|
|
646
|
+
foregroundColor: "#333333",
|
|
647
|
+
borderRadius: "8px",
|
|
648
|
+
fontFamily: '"Open Sans", Arial, sans-serif',
|
|
649
|
+
fontSize: "14px"
|
|
650
|
+
},
|
|
651
|
+
chatI18n: {
|
|
652
|
+
inputPlaceholder: "Ürün ara veya soru sor",
|
|
653
|
+
poweredBy: "Hepsiburada AI Asistan"
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
arcelikcomtr: {
|
|
657
|
+
accountId: "arcelikcomtr",
|
|
658
|
+
locale: "tr",
|
|
659
|
+
middlewareUrl: l,
|
|
660
|
+
theme: {
|
|
661
|
+
primaryColor: "#e4002b",
|
|
662
|
+
primaryForeground: "#ffffff",
|
|
663
|
+
backgroundColor: "#ffffff",
|
|
664
|
+
foregroundColor: "#222222",
|
|
665
|
+
borderRadius: "8px",
|
|
666
|
+
fontFamily: '"Arcelik Sans", "Helvetica Neue", Arial, sans-serif',
|
|
667
|
+
fontSize: "14px"
|
|
668
|
+
},
|
|
669
|
+
chatI18n: {
|
|
670
|
+
inputPlaceholder: "Size nasıl yardımcı olabilirim?",
|
|
671
|
+
poweredBy: "Arçelik AI Asistan"
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
yatasbeddingcomtr: {
|
|
675
|
+
accountId: "yatasbeddingcomtr",
|
|
676
|
+
locale: "tr",
|
|
677
|
+
middlewareUrl: l,
|
|
678
|
+
theme: {
|
|
679
|
+
primaryColor: "#c8102e",
|
|
680
|
+
primaryForeground: "#ffffff",
|
|
681
|
+
backgroundColor: "#ffffff",
|
|
682
|
+
foregroundColor: "#333333",
|
|
683
|
+
borderRadius: "8px",
|
|
684
|
+
fontFamily: '"Nunito Sans", Arial, sans-serif',
|
|
685
|
+
fontSize: "14px"
|
|
686
|
+
},
|
|
687
|
+
chatI18n: {
|
|
688
|
+
inputPlaceholder: "Yatak, baza veya ürün arayın",
|
|
689
|
+
poweredBy: "Yataş AI Asistan"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
trendyolcom: {
|
|
693
|
+
accountId: "trendyolcom",
|
|
694
|
+
locale: "tr",
|
|
695
|
+
middlewareUrl: l,
|
|
696
|
+
theme: {
|
|
697
|
+
primaryColor: "#f27a1a",
|
|
698
|
+
primaryForeground: "#ffffff",
|
|
699
|
+
backgroundColor: "#ffffff",
|
|
700
|
+
foregroundColor: "#333333",
|
|
701
|
+
borderRadius: "6px",
|
|
702
|
+
fontFamily: '"Source Sans Pro", Arial, sans-serif',
|
|
703
|
+
fontSize: "14px"
|
|
704
|
+
},
|
|
705
|
+
chatI18n: {
|
|
706
|
+
inputPlaceholder: "Ne aramıştınız?",
|
|
707
|
+
poweredBy: "Trendyol AI Asistan"
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
boynercomtr: {
|
|
711
|
+
accountId: "boynercomtr",
|
|
712
|
+
locale: "tr",
|
|
713
|
+
middlewareUrl: l,
|
|
714
|
+
theme: {
|
|
715
|
+
primaryColor: "#000000",
|
|
716
|
+
primaryForeground: "#ffffff",
|
|
717
|
+
backgroundColor: "#ffffff",
|
|
718
|
+
foregroundColor: "#333333",
|
|
719
|
+
borderRadius: "4px",
|
|
720
|
+
fontFamily: '"Montserrat", Arial, sans-serif',
|
|
721
|
+
fontSize: "14px"
|
|
722
|
+
},
|
|
723
|
+
chatI18n: {
|
|
724
|
+
inputPlaceholder: "Moda, kozmetik veya ev ürünleri arayın",
|
|
725
|
+
poweredBy: "Boyner AI Asistan"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
evideacom: {
|
|
729
|
+
accountId: "evideacom",
|
|
730
|
+
locale: "tr",
|
|
731
|
+
middlewareUrl: l,
|
|
732
|
+
theme: {
|
|
733
|
+
primaryColor: "#e84393",
|
|
734
|
+
primaryForeground: "#ffffff",
|
|
735
|
+
backgroundColor: "#ffffff",
|
|
736
|
+
foregroundColor: "#2d3436",
|
|
737
|
+
borderRadius: "8px",
|
|
738
|
+
fontFamily: '"Poppins", Arial, sans-serif',
|
|
739
|
+
fontSize: "14px"
|
|
740
|
+
},
|
|
741
|
+
chatI18n: {
|
|
742
|
+
inputPlaceholder: "Ev dekorasyon ürünleri arayın",
|
|
743
|
+
poweredBy: "Evidea AI Asistan"
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
aygazcomtr: {
|
|
747
|
+
accountId: "aygazcomtr",
|
|
748
|
+
locale: "tr",
|
|
749
|
+
middlewareUrl: l,
|
|
750
|
+
theme: {
|
|
751
|
+
primaryColor: "#e30613",
|
|
752
|
+
primaryForeground: "#ffffff",
|
|
753
|
+
backgroundColor: "#ffffff",
|
|
754
|
+
foregroundColor: "#333333",
|
|
755
|
+
borderRadius: "8px",
|
|
756
|
+
fontFamily: "Arial, Helvetica, sans-serif",
|
|
757
|
+
fontSize: "14px"
|
|
758
|
+
},
|
|
759
|
+
chatI18n: {
|
|
760
|
+
inputPlaceholder: "Aygaz ürünleri hakkında sorun",
|
|
761
|
+
poweredBy: "Aygaz AI Asistan"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
otokoccomtr: {
|
|
765
|
+
accountId: "otokoccomtr",
|
|
766
|
+
locale: "tr",
|
|
767
|
+
middlewareUrl: l,
|
|
768
|
+
theme: {
|
|
769
|
+
primaryColor: "#003087",
|
|
770
|
+
primaryForeground: "#ffffff",
|
|
771
|
+
backgroundColor: "#ffffff",
|
|
772
|
+
foregroundColor: "#333333",
|
|
773
|
+
borderRadius: "8px",
|
|
774
|
+
fontFamily: '"Roboto", Arial, sans-serif',
|
|
775
|
+
fontSize: "14px"
|
|
776
|
+
},
|
|
777
|
+
chatI18n: {
|
|
778
|
+
inputPlaceholder: "Araç veya hizmet arayın",
|
|
779
|
+
poweredBy: "Otokoç AI Asistan"
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
divanpastanelericomtr: {
|
|
783
|
+
accountId: "divanpastanelericomtr",
|
|
784
|
+
locale: "tr",
|
|
785
|
+
middlewareUrl: l,
|
|
786
|
+
theme: {
|
|
787
|
+
primaryColor: "#8b1a2d",
|
|
788
|
+
primaryForeground: "#ffffff",
|
|
789
|
+
backgroundColor: "#faf8f5",
|
|
790
|
+
foregroundColor: "#3d2c2e",
|
|
791
|
+
borderRadius: "8px",
|
|
792
|
+
fontFamily: '"Georgia", serif',
|
|
793
|
+
fontSize: "14px"
|
|
794
|
+
},
|
|
795
|
+
chatI18n: {
|
|
796
|
+
inputPlaceholder: "Ürün veya mağaza arayın",
|
|
797
|
+
poweredBy: "Divan AI Asistan"
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
screwfixcom: {
|
|
801
|
+
accountId: "screwfixcom",
|
|
802
|
+
locale: "en",
|
|
803
|
+
middlewareUrl: l,
|
|
804
|
+
theme: {
|
|
805
|
+
primaryColor: "#f6a623",
|
|
806
|
+
primaryForeground: "#1a1a1a",
|
|
807
|
+
backgroundColor: "#ffffff",
|
|
808
|
+
foregroundColor: "#333333",
|
|
809
|
+
borderRadius: "4px",
|
|
810
|
+
fontFamily: '"Arial", Helvetica, sans-serif',
|
|
811
|
+
fontSize: "14px"
|
|
812
|
+
},
|
|
813
|
+
pricing: {
|
|
814
|
+
currencySymbol: "£",
|
|
815
|
+
currencyPosition: "prefix",
|
|
816
|
+
thousandsSeparator: ",",
|
|
817
|
+
decimalSeparator: "."
|
|
818
|
+
},
|
|
819
|
+
chatI18n: {
|
|
820
|
+
inputPlaceholder: "Search products or ask a question",
|
|
821
|
+
poweredBy: "Screwfix AI Assistant"
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
function Ae(e) {
|
|
826
|
+
return I[e];
|
|
827
|
+
}
|
|
828
|
+
function Se() {
|
|
829
|
+
return Object.keys(I);
|
|
830
|
+
}
|
|
519
831
|
export {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
832
|
+
C as AccountRuntimeConfigSchema,
|
|
833
|
+
M as AnalyticsAuthModeSchema,
|
|
834
|
+
Z as AnalyticsClient,
|
|
835
|
+
oe as BASE_WIDGET_THEME,
|
|
836
|
+
Pe as BaseWidget,
|
|
837
|
+
k as DEFAULT_CUSTOMIZATION_LOCALE,
|
|
838
|
+
Ue as DEFAULT_WIDGET_THEME_TOKENS,
|
|
839
|
+
D as UnknownActionPolicySchema,
|
|
840
|
+
gt as VoiceInput,
|
|
841
|
+
Re as adaptV1Event,
|
|
842
|
+
Ie as autoDetectPageContext,
|
|
843
|
+
qe as basketAddEvent,
|
|
844
|
+
Fe as bootstrapSession,
|
|
845
|
+
Me as buildChatEndpointUrl,
|
|
846
|
+
pe as buildOverlayIdempotencyKey,
|
|
847
|
+
Be as chatHistorySnapshotEvent,
|
|
848
|
+
Le as checkoutCompleteEvent,
|
|
849
|
+
ze as checkoutStartEvent,
|
|
850
|
+
De as consumeStream,
|
|
851
|
+
ve as createAccountIdentity,
|
|
852
|
+
ye as createAnalyticsClient,
|
|
853
|
+
ge as createDefaultAccountRuntimeConfig,
|
|
854
|
+
Te as createDefaultAnalyticsConfig,
|
|
855
|
+
_e as createFloatingChatConfig,
|
|
856
|
+
Ce as createPdpQnaConfig,
|
|
857
|
+
be as createPdpSimRelConfig,
|
|
858
|
+
Ne as defaultUnknownUISpecRenderer,
|
|
859
|
+
me as destroyOverlayWidgets,
|
|
860
|
+
le as detectPageType,
|
|
861
|
+
Oe as dismissGlobalErrorToast,
|
|
862
|
+
We as dispatch,
|
|
863
|
+
de as extractSkuFromUrl,
|
|
864
|
+
$e as getGlobalErrorMessage,
|
|
865
|
+
Ae as getMerchantConfig,
|
|
866
|
+
Se as getMerchantIds,
|
|
867
|
+
j as getOverlayWidgets,
|
|
868
|
+
He as getWindowPageContext,
|
|
869
|
+
ke as initGengageClient,
|
|
870
|
+
Y as initOverlayWidgets,
|
|
871
|
+
mt as isVoiceInputSupported,
|
|
872
|
+
Ge as listen,
|
|
873
|
+
Ke as llmUsageEvent,
|
|
874
|
+
Qe as mergeUISpecRegistry,
|
|
875
|
+
Ye as meteringIncrementEvent,
|
|
876
|
+
je as meteringSummaryEvent,
|
|
558
877
|
E as normalizeMiddlewareUrl,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
878
|
+
Ve as normalizeProductGroupingsResponse,
|
|
879
|
+
Xe as normalizeSimilarProductsResponse,
|
|
880
|
+
O as parseAccountRuntimeConfig,
|
|
881
|
+
ne as preflightDiagnostics,
|
|
882
|
+
Ze as productToNormalized,
|
|
883
|
+
Je as registerGlobalErrorToastListener,
|
|
884
|
+
et as renderUISpecWithRegistry,
|
|
885
|
+
S as resolveSession,
|
|
886
|
+
pt as routeStreamAction,
|
|
887
|
+
W as safeParseAccountRuntimeConfig,
|
|
888
|
+
wt as sanitizeHtml,
|
|
889
|
+
tt as showGlobalErrorToast,
|
|
890
|
+
ot as streamChunkEvent,
|
|
891
|
+
it as streamDoneEvent,
|
|
892
|
+
nt as streamErrorEvent,
|
|
893
|
+
at as streamPost,
|
|
894
|
+
rt as streamStartEvent,
|
|
895
|
+
st as streamUiSpecEvent,
|
|
896
|
+
lt as updatePageContext,
|
|
897
|
+
dt as widgetHistorySnapshotEvent,
|
|
898
|
+
ct as wireGADataLayer,
|
|
579
899
|
x as wireQNAToChat,
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
900
|
+
ut as wireSimilarToChat,
|
|
901
|
+
we as withBaseTheme,
|
|
902
|
+
ft as withDefaultWidgetTheme
|
|
583
903
|
};
|
|
584
904
|
//# sourceMappingURL=common.js.map
|