@gengage/assistant-fe 0.4.0 → 0.4.2
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/chat/types.d.ts +12 -0
- package/dist/{chat-ChY1FmRk.js → chat-Ci4ZA37X.js} +134 -131
- package/dist/chat.iife.js +2 -2
- package/dist/chat.js +1 -1
- package/dist/common/client.d.ts +6 -1
- package/dist/common/config-schema.d.ts +1 -1
- package/dist/common/overlay.d.ts +6 -0
- package/dist/{common-B4si3_SB.js → common-DUMmqYxM.js} +112 -101
- package/dist/common.js +3 -3
- package/dist/index.js +3 -3
- package/dist/{native-webview-DnuKAW7i.js → native-webview-v2HYw_9X.js} +74 -75
- package/dist/native.iife.js +2 -2
- package/dist/native.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as da, _ as pa, a as ve, b as ha, c as v, d as ua, l as
|
|
2
|
-
import { $ as fa, A as va, B as xa, C as ya, D as wa, E as _a, F as ka, G as he, H as ue, I as ut, K as Ca, L as Sa, M as Ea, N as Pa, O as La, P as mt, R as Aa, S as Ta, T as Ia, U as de, W as oe, X as Na, Z as Ma, _ as pe, et as Ba, k as za, n as Ra, nt as
|
|
1
|
+
import { S as da, _ as pa, a as ve, b as ha, c as v, d as ua, l as He, n as J, o as V, p as ma, r as Se, s as Ee, t as Fe, u as ye, w as ba } from "./schemas-JFGRVTVz.js";
|
|
2
|
+
import { $ as fa, A as va, B as xa, C as ya, D as wa, E as _a, F as ka, G as he, H as ue, I as ut, K as Ca, L as Sa, M as Ea, N as Pa, O as La, P as mt, R as Aa, S as Ta, T as Ia, U as de, W as oe, X as Na, Z as Ma, _ as pe, et as Ba, k as za, n as Ra, nt as Da, o as Ft, q as Ha, r as Pe, rt as Fa, t as Oe, tt as Ua, w as Oa, x as ja, z as qa } from "./locale-MM0U5eeR.js";
|
|
3
3
|
import { a as Ut, i as Ot, n as xe, r as jt, t as Z } from "./price-formatter-CR6VT5z4.js";
|
|
4
4
|
function bt() {
|
|
5
5
|
const t = Date.now(), e = new Uint8Array(16);
|
|
@@ -1129,9 +1129,9 @@ var An = class {
|
|
|
1129
1129
|
P.className = "gengage-chat-conversation", P.dataset.gengagePart = "chat-conversation", this._conversationEl = P, P.appendChild(r);
|
|
1130
1130
|
const I = document.createElement("div");
|
|
1131
1131
|
I.className = "gengage-chat-offline-bar gds-evidence-card gds-evidence-card-warning", I.dataset.gengagePart = "chat-offline-bar", I.setAttribute("role", "status"), I.setAttribute("aria-live", "polite"), I.textContent = this.i18n.offlineMessage, typeof navigator < "u" && !navigator.onLine && I.classList.add("gengage-chat-offline-bar--visible"), P.appendChild(I);
|
|
1132
|
-
const
|
|
1133
|
-
window.addEventListener("offline",
|
|
1134
|
-
window.removeEventListener("offline",
|
|
1132
|
+
const H = () => I.classList.add("gengage-chat-offline-bar--visible"), ee = () => I.classList.remove("gengage-chat-offline-bar--visible");
|
|
1133
|
+
window.addEventListener("offline", H), window.addEventListener("online", ee), this._cleanups.push(() => {
|
|
1134
|
+
window.removeEventListener("offline", H), window.removeEventListener("online", ee);
|
|
1135
1135
|
}), this._kvkkSlot = document.createElement("div"), this._kvkkSlot.className = "gengage-chat-kvkk-slot", this._kvkkSlot.dataset.gengagePart = "chat-kvkk-slot", P.appendChild(this._kvkkSlot), this.messagesEl = document.createElement("div"), this.messagesEl.id = nt, this.messagesEl.className = "gengage-chat-messages", this.messagesEl.dataset.gengagePart = "chat-messages", this.messagesEl.setAttribute("role", "log"), this.messagesEl.setAttribute("aria-live", "polite"), this.messagesEl.setAttribute("aria-atomic", "false"), this.messagesEl.setAttribute("aria-label", this.i18n.chatMessagesAriaLabel), ft(this.messagesEl);
|
|
1136
1136
|
const ae = document.createElement("button");
|
|
1137
1137
|
ae.type = "button", ae.className = "gengage-chat-former-messages-btn gds-chip", ae.dataset.gengagePart = "chat-former-messages-button", ae.textContent = this.i18n.showFormerMessagesButton, ae.setAttribute("aria-label", this.i18n.showFormerMessagesButton), ae.style.display = "none", ae.addEventListener("click", () => {
|
|
@@ -1227,14 +1227,14 @@ var An = class {
|
|
|
1227
1227
|
Q.type = "button", Q.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", Q.dataset.gengagePart = "chat-attach-menu-select-photo", Q.setAttribute("role", "menuitem"), Q.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuSelectPhoto}</span>`, Q.addEventListener("click", (_) => {
|
|
1228
1228
|
_.stopPropagation(), this._closeAttachMenu(), this._fileInput.click();
|
|
1229
1229
|
});
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1230
|
+
const D = document.createElement("div");
|
|
1231
|
+
D.className = "gengage-chat-attach-menu-sep", D.dataset.gengagePart = "chat-attach-menu-separator", D.setAttribute("aria-hidden", "true");
|
|
1232
1232
|
const K = document.createElement("button");
|
|
1233
1233
|
K.type = "button", K.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", K.dataset.gengagePart = "chat-attach-menu-paste", K.setAttribute("role", "menuitem"), K.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H9a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/><path d="M16 4h2a2 2 0 0 1 2 2v4"/><path d="M21 14H11"/><path d="m15 10-4 4 4 4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuPaste}</span>`, K.addEventListener("click", (_) => {
|
|
1234
1234
|
_.stopPropagation();
|
|
1235
1235
|
const W = typeof navigator.clipboard?.read == "function" ? navigator.clipboard.read() : void 0;
|
|
1236
1236
|
this._pasteImageFromClipboardMenu(W);
|
|
1237
|
-
}), z.appendChild(Q), z.appendChild(
|
|
1237
|
+
}), z.appendChild(Q), z.appendChild(D), z.appendChild(K), R.appendChild(B), R.appendChild(z), this._previewStrip = document.createElement("div"), this._previewStrip.className = "gengage-chat-attachment-preview gengage-chat-attachment-preview--hidden gds-card-soft", this._previewStrip.dataset.gengagePart = "chat-attachment-preview";
|
|
1238
1238
|
const $ = document.createElement("img");
|
|
1239
1239
|
$.className = "gengage-chat-attachment-preview-thumb", $.dataset.gengagePart = "chat-attachment-preview-thumb", $.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
|
|
1240
1240
|
const se = document.createElement("button");
|
|
@@ -1619,8 +1619,8 @@ var An = class {
|
|
|
1619
1619
|
const x = document.createElement("ul");
|
|
1620
1620
|
x.className = "gengage-chat-comparison-skeleton-hl-list";
|
|
1621
1621
|
for (let P = 0; P < 3; P++) {
|
|
1622
|
-
const I = document.createElement("li"),
|
|
1623
|
-
|
|
1622
|
+
const I = document.createElement("li"), H = document.createElement("div");
|
|
1623
|
+
H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", P === 1 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), P === 2 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), I.appendChild(H), x.appendChild(I);
|
|
1624
1624
|
}
|
|
1625
1625
|
h.appendChild(x), o.appendChild(h), r.appendChild(o);
|
|
1626
1626
|
const u = document.createElement("div");
|
|
@@ -1647,19 +1647,19 @@ var An = class {
|
|
|
1647
1647
|
for (let P = 0; P < 3; P++) {
|
|
1648
1648
|
const I = document.createElement("div");
|
|
1649
1649
|
I.className = "gengage-chat-comparison-skeleton-table-col";
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1650
|
+
const H = document.createElement("div");
|
|
1651
|
+
H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
|
|
1652
1652
|
const ee = document.createElement("div");
|
|
1653
1653
|
ee.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
|
|
1654
1654
|
const ae = document.createElement("div");
|
|
1655
|
-
ae.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", I.appendChild(
|
|
1655
|
+
ae.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", I.appendChild(H), I.appendChild(ee), I.appendChild(ae), k.appendChild(I);
|
|
1656
1656
|
}
|
|
1657
1657
|
A.appendChild(k);
|
|
1658
1658
|
for (let P = 0; P < 3; P++) {
|
|
1659
1659
|
const I = document.createElement("div");
|
|
1660
1660
|
I.className = "gengage-chat-comparison-skeleton-table-row";
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1661
|
+
const H = document.createElement("div");
|
|
1662
|
+
H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", I.appendChild(H);
|
|
1663
1663
|
for (let ee = 0; ee < 3; ee++) {
|
|
1664
1664
|
const ae = document.createElement("div");
|
|
1665
1665
|
ae.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", I.appendChild(ae);
|
|
@@ -2117,10 +2117,10 @@ function Rn(t, e, a, n, i) {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
return !1;
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2120
|
+
function Dn(t) {
|
|
2121
2121
|
return t.renderHint === "photo_analysis";
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2123
|
+
function Hn(t, e) {
|
|
2124
2124
|
t.streamIncludedBeautyPhotoStep || e.drawer?.setBeautyPhotoStepCard({ visible: !1 }), t.pendingPhotoStepSkip && (t.pendingPhotoStepSkip = !1, e.sendSkipMessage());
|
|
2125
2125
|
}
|
|
2126
2126
|
function Fn(t, e) {
|
|
@@ -2344,7 +2344,7 @@ function Wn(t, e) {
|
|
|
2344
2344
|
function Kt(t) {
|
|
2345
2345
|
return /<\/?[a-z][\s\S]*>/i.test(t);
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2347
|
+
function De(t, e = 18) {
|
|
2348
2348
|
const a = "http://www.w3.org/2000/svg", n = document.createElementNS(a, "svg");
|
|
2349
2349
|
n.setAttribute("width", String(e)), n.setAttribute("height", String(e)), n.setAttribute("viewBox", "0 0 24 24"), n.setAttribute("fill", "none"), n.setAttribute("stroke", "currentColor"), n.setAttribute("stroke-width", "2"), n.setAttribute("stroke-linecap", "round"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("aria-hidden", "true");
|
|
2350
2350
|
for (const i of t) {
|
|
@@ -2371,7 +2371,7 @@ function Qn(t) {
|
|
|
2371
2371
|
return t.positive > t.negative ? "positive" : t.negative > t.positive ? "negative" : "neutral";
|
|
2372
2372
|
}
|
|
2373
2373
|
function Jn(t) {
|
|
2374
|
-
return
|
|
2374
|
+
return De(t === "positive" ? ["M7 17 17 7", "M7 7h10v10"] : t === "negative" ? ["M7 7 17 17", "M17 7v10H7"] : ["M5 12h14"], 14);
|
|
2375
2375
|
}
|
|
2376
2376
|
function ei(t, e = "1 customer mentions", a = "customers mention") {
|
|
2377
2377
|
return t === 1 ? e : `${t} ${a}`;
|
|
@@ -2630,16 +2630,16 @@ function oi(t, e, a) {
|
|
|
2630
2630
|
p.className = "gengage-chat-ai-toppick-price-stack", p.appendChild(Ye(r)), p.appendChild(d), e.appendChild(p);
|
|
2631
2631
|
} else e.appendChild(d);
|
|
2632
2632
|
}
|
|
2633
|
-
function si(t, e) {
|
|
2634
|
-
const
|
|
2635
|
-
if (!(!
|
|
2636
|
-
if (a) {
|
|
2637
|
-
const i = document.createElement("p");
|
|
2638
|
-
i.className = "gengage-chat-ai-toppick-reason", i.dataset.gengagePart = "ai-top-pick-reason", i.textContent = a, e.appendChild(i);
|
|
2639
|
-
}
|
|
2633
|
+
function si(t, e, a) {
|
|
2634
|
+
const n = typeof t.reason == "string" ? t.reason.trim() : "", i = a.hideUserReviews !== !0 && typeof t.reviewHighlight == "string" ? t.reviewHighlight.trim() : "";
|
|
2635
|
+
if (!(!n && !i)) {
|
|
2640
2636
|
if (n) {
|
|
2641
|
-
const
|
|
2642
|
-
|
|
2637
|
+
const r = document.createElement("p");
|
|
2638
|
+
r.className = "gengage-chat-ai-toppick-reason", r.dataset.gengagePart = "ai-top-pick-reason", r.textContent = n, e.appendChild(r);
|
|
2639
|
+
}
|
|
2640
|
+
if (i) {
|
|
2641
|
+
const r = document.createElement("div");
|
|
2642
|
+
r.className = "gengage-chat-ai-toppick-review", r.dataset.gengagePart = "ai-top-pick-review", r.textContent = i, e.appendChild(r);
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
@@ -2678,7 +2678,7 @@ function Ct(t, e, a) {
|
|
|
2678
2678
|
const m = ii(i);
|
|
2679
2679
|
m && u.appendChild(m), oi(i, u, e), t.labels && t.labels.length > 0 && u.appendChild(li(t.labels)), x.appendChild(u), n.appendChild(x);
|
|
2680
2680
|
const L = document.createElement("div");
|
|
2681
|
-
if (L.className = "gengage-chat-ai-toppick-detail", L.dataset.gengagePart = "ai-top-pick-detail", a) si(t, L);
|
|
2681
|
+
if (L.className = "gengage-chat-ai-toppick-detail", L.dataset.gengagePart = "ai-top-pick-detail", a) si(t, L, e);
|
|
2682
2682
|
else {
|
|
2683
2683
|
const k = typeof t.reason == "string" ? t.reason.trim() : "";
|
|
2684
2684
|
if (k) {
|
|
@@ -2754,7 +2754,7 @@ function gi(t, e) {
|
|
|
2754
2754
|
const a = document.createElement("div");
|
|
2755
2755
|
a.className = "gengage-chat-grounding-review gds-evidence-card", a.dataset.gengagePart = "grounding-review-card";
|
|
2756
2756
|
const n = t.props ?? {}, i = n.title, r = n.reviewCount, o = n.action, s = e.i18n?.groundingReviewCta ?? "Read Reviews", c = document.createElement("span");
|
|
2757
|
-
c.className = "gengage-chat-grounding-review-icon", c.appendChild(
|
|
2757
|
+
c.className = "gengage-chat-grounding-review-icon", c.appendChild(De([
|
|
2758
2758
|
"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",
|
|
2759
2759
|
"M8 9h8",
|
|
2760
2760
|
"M8 13h6"
|
|
@@ -2772,7 +2772,7 @@ function gi(t, e) {
|
|
|
2772
2772
|
const h = document.createElement("span");
|
|
2773
2773
|
h.textContent = s, p.appendChild(h);
|
|
2774
2774
|
const g = document.createElement("span");
|
|
2775
|
-
return g.className = "gengage-chat-grounding-review-cta-icon", g.appendChild(
|
|
2775
|
+
return g.className = "gengage-chat-grounding-review-cta-icon", g.appendChild(De(["M5 12h14", "M15 8l4 4-4 4"], 14)), p.appendChild(g), a.appendChild(p), o && (a.classList.add("gds-clickable"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.addEventListener("click", () => e.onAction(o)), a.addEventListener("keydown", (x) => {
|
|
2776
2776
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), e.onAction(o));
|
|
2777
2777
|
})), a;
|
|
2778
2778
|
}
|
|
@@ -3025,7 +3025,7 @@ function vi(t, e) {
|
|
|
3025
3025
|
m.textContent = L, m.title = L, r.appendChild(m);
|
|
3026
3026
|
}
|
|
3027
3027
|
const c = a.rating, l = a.reviewCount;
|
|
3028
|
-
if (typeof c == "number" && Number.isFinite(c) && c > 0) {
|
|
3028
|
+
if (e.hideUserReviews !== !0 && typeof c == "number" && Number.isFinite(c) && c > 0) {
|
|
3029
3029
|
const m = document.createElement("div");
|
|
3030
3030
|
if (m.className = "gengage-chat-product-summary__rating", m.dataset.gengagePart = "product-summary-rating", m.appendChild(Ut(c)), typeof l == "number" && Number.isFinite(l)) {
|
|
3031
3031
|
const L = document.createElement("span");
|
|
@@ -3048,8 +3048,8 @@ function vi(t, e) {
|
|
|
3048
3048
|
A.classList.add("gengage-chat-product-summary__price--inline"), A.appendChild(P);
|
|
3049
3049
|
const I = document.createElement("span");
|
|
3050
3050
|
I.className = "gengage-chat-product-summary__price-sep", I.setAttribute("aria-hidden", "true");
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3051
|
+
const H = document.createElement("span");
|
|
3052
|
+
H.className = "gengage-chat-product-summary__price-original", H.textContent = Z(p, e.pricing), A.appendChild(I), A.appendChild(H);
|
|
3053
3053
|
} else {
|
|
3054
3054
|
const I = document.createElement("span");
|
|
3055
3055
|
I.className = "gengage-chat-product-summary__price-original", I.textContent = Z(p, e.pricing), A.appendChild(I), A.appendChild(document.createTextNode(" ")), A.appendChild(P);
|
|
@@ -3062,8 +3062,8 @@ function vi(t, e) {
|
|
|
3062
3062
|
P.className = "gengage-chat-product-summary__price-current", P.textContent = Z(d, e.pricing);
|
|
3063
3063
|
const I = document.createElement("span");
|
|
3064
3064
|
I.className = "gengage-chat-product-summary__price-sep", I.setAttribute("aria-hidden", "true");
|
|
3065
|
-
const
|
|
3066
|
-
|
|
3065
|
+
const H = document.createElement("span");
|
|
3066
|
+
H.className = "gengage-chat-product-summary__price-original", H.textContent = Z(p, e.pricing), A.appendChild(P), A.appendChild(I), A.appendChild(H);
|
|
3067
3067
|
} else if (N) {
|
|
3068
3068
|
const P = document.createElement("span");
|
|
3069
3069
|
P.className = "gengage-chat-product-summary__price-original", P.textContent = Z(p, e.pricing), A.appendChild(P), A.appendChild(document.createTextNode(" "));
|
|
@@ -3113,7 +3113,7 @@ var Qt = {
|
|
|
3113
3113
|
ProductCard: ({ element: t, context: e }) => rt(t, e),
|
|
3114
3114
|
ProductDetailsPanel: ({ element: t, context: e }) => Vi(t, e),
|
|
3115
3115
|
ProductGrid: ({ element: t, spec: e, renderElement: a, context: n }) => Qi(t, e, a, n),
|
|
3116
|
-
ReviewHighlights: ({ element: t, context: e }) => ti(t, {
|
|
3116
|
+
ReviewHighlights: ({ element: t, context: e }) => e.hideUserReviews === !0 ? null : ti(t, {
|
|
3117
3117
|
emptyReviewsMessage: e.i18n?.emptyReviewsMessage,
|
|
3118
3118
|
reviewFilterPositive: e.i18n?.reviewFilterPositive,
|
|
3119
3119
|
reviewFilterNegative: e.i18n?.reviewFilterNegative,
|
|
@@ -3123,7 +3123,7 @@ var Qt = {
|
|
|
3123
3123
|
}),
|
|
3124
3124
|
ComparisonTable: ({ element: t, context: e }) => Ji(t, e),
|
|
3125
3125
|
AITopPicks: ({ element: t, context: e }) => ci(t, e),
|
|
3126
|
-
GroundingReviewCard: ({ element: t, context: e }) => gi(t, e),
|
|
3126
|
+
GroundingReviewCard: ({ element: t, context: e }) => e.hideUserReviews === !0 ? null : gi(t, e),
|
|
3127
3127
|
AIGroupingCards: ({ element: t, context: e }) => pi(t, e),
|
|
3128
3128
|
AISuggestedSearchCards: ({ element: t, context: e }) => hi(t, e),
|
|
3129
3129
|
ProsAndCons: ({ element: t }) => ui(t),
|
|
@@ -3257,7 +3257,7 @@ function Et(t, e, a, n, i, r, o) {
|
|
|
3257
3257
|
p.className = "gengage-chat-product-details-current-price", p.textContent = Z(n, e.pricing), t.appendChild(p);
|
|
3258
3258
|
}
|
|
3259
3259
|
const d = Ve(a, "discountPercent", "price_discount_rate");
|
|
3260
|
-
if (typeof d == "number" && d > 0) {
|
|
3260
|
+
if (!e.hideProductDiscountBadge && typeof d == "number" && d > 0) {
|
|
3261
3261
|
const p = document.createElement("span");
|
|
3262
3262
|
p.className = "gengage-chat-product-details-discount-badge", p.textContent = `%${jt(d)}`, t.appendChild(p);
|
|
3263
3263
|
}
|
|
@@ -3288,7 +3288,7 @@ function rt(t, e) {
|
|
|
3288
3288
|
const O = n.name;
|
|
3289
3289
|
O && (T.alt = O), xe(T), b.appendChild(T);
|
|
3290
3290
|
const j = n.discountPercent;
|
|
3291
|
-
if (typeof j == "number" && j > 0) {
|
|
3291
|
+
if (!e.hideProductDiscountBadge && typeof j == "number" && j > 0) {
|
|
3292
3292
|
const C = document.createElement("span");
|
|
3293
3293
|
C.className = "gengage-chat-product-card-discount-badge", C.textContent = `%${jt(j)}`, b.appendChild(C);
|
|
3294
3294
|
}
|
|
@@ -3361,12 +3361,12 @@ function rt(t, e) {
|
|
|
3361
3361
|
b.className = "gengage-chat-product-card-name", b.textContent = P, b.title = P, s.appendChild(b);
|
|
3362
3362
|
}
|
|
3363
3363
|
const I = n.inStock;
|
|
3364
|
-
if (typeof I == "boolean") {
|
|
3364
|
+
if (e.hideStockStatus !== !0 && typeof I == "boolean") {
|
|
3365
3365
|
const b = document.createElement("div");
|
|
3366
3366
|
b.className = `gengage-chat-product-card-stock ${I ? "is-in-stock" : "is-out-of-stock"}`, b.textContent = I ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", s.appendChild(b);
|
|
3367
3367
|
}
|
|
3368
3368
|
a.appendChild(s);
|
|
3369
|
-
const
|
|
3369
|
+
const H = n.url, ee = n.sku, ae = n.cartCode, E = !!(ae && ee && I !== !1), S = e.i18n?.productCtaLabel ?? "View";
|
|
3370
3370
|
if (E) {
|
|
3371
3371
|
const b = document.createElement("div");
|
|
3372
3372
|
b.className = "gengage-chat-product-card-buy-footer";
|
|
@@ -3391,16 +3391,16 @@ function rt(t, e) {
|
|
|
3391
3391
|
}
|
|
3392
3392
|
e.onAction(r);
|
|
3393
3393
|
}), a.appendChild(b);
|
|
3394
|
-
} else if (
|
|
3394
|
+
} else if (H && de(H)) {
|
|
3395
3395
|
const b = document.createElement("a");
|
|
3396
|
-
b.className = "gengage-chat-product-card-cta", oe(b, "href",
|
|
3396
|
+
b.className = "gengage-chat-product-card-cta", oe(b, "href", H), oe(b, "target", "_blank"), oe(b, "rel", "noopener noreferrer"), b.textContent = S, b.addEventListener("click", (T) => {
|
|
3397
3397
|
if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
|
|
3398
3398
|
T.preventDefault(), T.stopPropagation();
|
|
3399
3399
|
return;
|
|
3400
3400
|
}
|
|
3401
3401
|
e.onProductClick && ee && (T.preventDefault(), e.onProductClick({
|
|
3402
3402
|
sku: ee,
|
|
3403
|
-
url:
|
|
3403
|
+
url: H,
|
|
3404
3404
|
...P ? { name: P } : {}
|
|
3405
3405
|
}));
|
|
3406
3406
|
}), a.appendChild(b);
|
|
@@ -3577,10 +3577,10 @@ function Ri(t) {
|
|
|
3577
3577
|
if (zi(t))
|
|
3578
3578
|
return Lt(aa(t));
|
|
3579
3579
|
}
|
|
3580
|
-
function
|
|
3580
|
+
function Di(t) {
|
|
3581
3581
|
return ke(t, "image", "imageUrl", "image_url", "swatchImage", "swatch_image");
|
|
3582
3582
|
}
|
|
3583
|
-
function
|
|
3583
|
+
function Hi(t) {
|
|
3584
3584
|
return Pt(t, "price_discounted", "priceDiscounted") ?? ke(t, "price_discounted", "priceDiscounted") ?? Pt(t, "price") ?? ke(t, "price");
|
|
3585
3585
|
}
|
|
3586
3586
|
function Fi(t) {
|
|
@@ -3637,43 +3637,43 @@ function Vi(t, e) {
|
|
|
3637
3637
|
b.className = "gengage-chat-product-gallery-thumbs";
|
|
3638
3638
|
const T = 6;
|
|
3639
3639
|
let O = null, j = 0;
|
|
3640
|
-
const F = e.i18n, G = F?.galleryPrevAriaLabel ?? "Previous image", Y = F?.galleryNextAriaLabel ?? "Next image", f = (
|
|
3640
|
+
const F = e.i18n, G = F?.galleryPrevAriaLabel ?? "Previous image", Y = F?.galleryNextAriaLabel ?? "Next image", f = (D) => D === "prev" ? '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>' : '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>', C = document.createElement("button");
|
|
3641
3641
|
C.type = "button", C.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--prev gds-btn gds-btn-ghost gds-icon-btn", C.setAttribute("aria-label", G), C.innerHTML = f("prev");
|
|
3642
3642
|
const w = document.createElement("button");
|
|
3643
3643
|
w.type = "button", w.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--next gds-btn gds-btn-ghost gds-icon-btn", w.setAttribute("aria-label", Y), w.innerHTML = f("next");
|
|
3644
3644
|
const R = () => {
|
|
3645
3645
|
C.disabled = j <= 0, w.disabled = j >= m.length - 1;
|
|
3646
|
-
}, B = (
|
|
3647
|
-
if (
|
|
3648
|
-
const K = m[
|
|
3646
|
+
}, B = (D) => {
|
|
3647
|
+
if (D < 0 || D >= m.length || D === j) return;
|
|
3648
|
+
const K = m[D];
|
|
3649
3649
|
if (!K) return;
|
|
3650
3650
|
oe(S, "src", K);
|
|
3651
3651
|
const $ = b.querySelectorAll(".gengage-chat-product-gallery-thumb");
|
|
3652
|
-
O && O.classList.remove("gengage-chat-product-gallery-thumb--active"),
|
|
3652
|
+
O && O.classList.remove("gengage-chat-product-gallery-thumb--active"), D < T && $[D] ? ($[D].classList.add("gengage-chat-product-gallery-thumb--active"), O = $[D]) : O = null, j = D, R();
|
|
3653
3653
|
};
|
|
3654
|
-
for (let
|
|
3655
|
-
const K = m[
|
|
3656
|
-
if (
|
|
3654
|
+
for (let D = 0; D < m.length; D++) {
|
|
3655
|
+
const K = m[D];
|
|
3656
|
+
if (D >= T) break;
|
|
3657
3657
|
const $ = document.createElement("img");
|
|
3658
|
-
$.className = "gengage-chat-product-gallery-thumb",
|
|
3659
|
-
B(
|
|
3658
|
+
$.className = "gengage-chat-product-gallery-thumb", D === 0 && ($.classList.add("gengage-chat-product-gallery-thumb--active"), O = $), oe($, "src", K), $.alt = `${i ?? "Product"} ${D + 1}`, $.width = 48, $.height = 48, xe($), $.addEventListener("click", () => {
|
|
3659
|
+
B(D);
|
|
3660
3660
|
}), b.appendChild($);
|
|
3661
3661
|
}
|
|
3662
3662
|
if (m.length > T) {
|
|
3663
|
-
const
|
|
3664
|
-
|
|
3663
|
+
const D = document.createElement("span");
|
|
3664
|
+
D.className = "gengage-chat-product-gallery-thumb-more", D.textContent = `+${m.length - T}`, b.appendChild(D);
|
|
3665
3665
|
}
|
|
3666
|
-
C.addEventListener("click", (
|
|
3667
|
-
|
|
3668
|
-
}), w.addEventListener("click", (
|
|
3669
|
-
|
|
3666
|
+
C.addEventListener("click", (D) => {
|
|
3667
|
+
D.stopPropagation(), B(j - 1);
|
|
3668
|
+
}), w.addEventListener("click", (D) => {
|
|
3669
|
+
D.stopPropagation(), B(j + 1);
|
|
3670
3670
|
}), R();
|
|
3671
3671
|
let z = 0;
|
|
3672
3672
|
const Q = 50;
|
|
3673
|
-
S.addEventListener("touchstart", (
|
|
3674
|
-
z =
|
|
3675
|
-
}, { passive: !0 }), S.addEventListener("touchend", (
|
|
3676
|
-
const K =
|
|
3673
|
+
S.addEventListener("touchstart", (D) => {
|
|
3674
|
+
z = D.changedTouches[0].clientX;
|
|
3675
|
+
}, { passive: !0 }), S.addEventListener("touchend", (D) => {
|
|
3676
|
+
const K = D.changedTouches[0].clientX, $ = z - K;
|
|
3677
3677
|
Math.abs($) < Q || B($ > 0 ? Math.min(j + 1, m.length - 1) : Math.max(j - 1, 0));
|
|
3678
3678
|
}), E.appendChild(C), E.appendChild(w), E.appendChild(b), a.appendChild(E);
|
|
3679
3679
|
} else if (m.length === 1) {
|
|
@@ -3691,7 +3691,7 @@ function Vi(t, e) {
|
|
|
3691
3691
|
const E = document.createElement("h3");
|
|
3692
3692
|
E.className = "gengage-chat-product-details-title", E.textContent = i, E.title = i, N.appendChild(E);
|
|
3693
3693
|
}
|
|
3694
|
-
if (typeof y == "number" && Number.isFinite(y) && y > 0) {
|
|
3694
|
+
if (e.hideUserReviews !== !0 && typeof y == "number" && Number.isFinite(y) && y > 0) {
|
|
3695
3695
|
const E = document.createElement(o ? "button" : "div");
|
|
3696
3696
|
E.className = "gengage-chat-product-details-rating", o && (E.type = "button", E.classList.add("gengage-chat-product-details-rating--clickable"), E.setAttribute("aria-label", e.i18n?.groundingReviewCta ?? "Read Reviews"), E.addEventListener("click", () => {
|
|
3697
3697
|
e.onAction({
|
|
@@ -3732,7 +3732,7 @@ function Vi(t, e) {
|
|
|
3732
3732
|
T.classList.contains("gengage-chat-product-details-price-stack") && T.remove();
|
|
3733
3733
|
}
|
|
3734
3734
|
}
|
|
3735
|
-
if (typeof x == "boolean") {
|
|
3735
|
+
if (e.hideStockStatus !== !0 && typeof x == "boolean") {
|
|
3736
3736
|
const E = document.createElement("div");
|
|
3737
3737
|
E.className = `gengage-chat-product-details-stock ${x ? "is-in-stock" : "is-out-of-stock"}`, E.textContent = x ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", N.appendChild(E);
|
|
3738
3738
|
}
|
|
@@ -3777,7 +3777,7 @@ function Vi(t, e) {
|
|
|
3777
3777
|
F.title = G;
|
|
3778
3778
|
const Y = je(T, "in_stock", "inStock");
|
|
3779
3779
|
j && o && j === o ? (F.classList.add("gengage-chat-product-variant-btn--active"), F.setAttribute("aria-pressed", "true")) : F.setAttribute("aria-pressed", "false"), Y === !1 && (F.classList.add("gengage-chat-product-variant-btn--out"), F.disabled = !0);
|
|
3780
|
-
const f =
|
|
3780
|
+
const f = Di(T), C = Ri(T);
|
|
3781
3781
|
if (f && de(f)) {
|
|
3782
3782
|
const B = document.createElement("img");
|
|
3783
3783
|
B.className = "gengage-chat-product-variant-swatch gengage-chat-product-variant-swatch--image", oe(B, "src", f), B.alt = "", B.setAttribute("aria-hidden", "true"), xe(B), F.appendChild(B);
|
|
@@ -3787,7 +3787,7 @@ function Vi(t, e) {
|
|
|
3787
3787
|
}
|
|
3788
3788
|
const w = document.createElement("span");
|
|
3789
3789
|
w.className = "gengage-chat-product-variant-label", w.textContent = G, F.appendChild(w);
|
|
3790
|
-
const R =
|
|
3790
|
+
const R = Hi(T);
|
|
3791
3791
|
if (R && String(R) !== String(c)) {
|
|
3792
3792
|
const B = document.createElement("span");
|
|
3793
3793
|
B.className = "gengage-chat-product-variant-price", B.textContent = Z(String(R), e.pricing), F.appendChild(B);
|
|
@@ -3838,8 +3838,8 @@ function Vi(t, e) {
|
|
|
3838
3838
|
}));
|
|
3839
3839
|
}), M.appendChild(E);
|
|
3840
3840
|
}
|
|
3841
|
-
const
|
|
3842
|
-
if (
|
|
3841
|
+
const H = I;
|
|
3842
|
+
if (H && de(H)) {
|
|
3843
3843
|
let O = function(F, G) {
|
|
3844
3844
|
const Y = document.createElementNS(b, "circle");
|
|
3845
3845
|
Y.setAttribute("cx", F), Y.setAttribute("cy", G), Y.setAttribute("r", "3"), T.appendChild(Y);
|
|
@@ -3856,8 +3856,8 @@ function Vi(t, e) {
|
|
|
3856
3856
|
try {
|
|
3857
3857
|
navigator.share ? await navigator.share({
|
|
3858
3858
|
title: i ?? "",
|
|
3859
|
-
url:
|
|
3860
|
-
}) : navigator.clipboard && (await navigator.clipboard.writeText(
|
|
3859
|
+
url: H
|
|
3860
|
+
}) : navigator.clipboard && (await navigator.clipboard.writeText(H), E.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => E.classList.remove("gengage-chat-product-details-share--copied"), 1500));
|
|
3861
3861
|
} catch {
|
|
3862
3862
|
}
|
|
3863
3863
|
}), M.appendChild(E);
|
|
@@ -4046,12 +4046,12 @@ function Qi(t, e, a, n) {
|
|
|
4046
4046
|
M.className = "gengage-chat-product-sort-menu gds-menu", M.hidden = !0, M.setAttribute("role", "listbox"), M.setAttribute("aria-label", m);
|
|
4047
4047
|
const P = h.ownerDocument;
|
|
4048
4048
|
let I = null;
|
|
4049
|
-
const
|
|
4049
|
+
const H = () => {
|
|
4050
4050
|
M.hidden = !0, u.classList.remove("gengage-chat-product-sort-dropdown--open"), y.setAttribute("aria-expanded", "false"), I?.abort(), I = null;
|
|
4051
4051
|
}, ee = (S) => {
|
|
4052
|
-
u.classList.contains("gengage-chat-product-sort-dropdown--open") && (u.contains(S.target) ||
|
|
4052
|
+
u.classList.contains("gengage-chat-product-sort-dropdown--open") && (u.contains(S.target) || H());
|
|
4053
4053
|
}, ae = (S) => {
|
|
4054
|
-
S.key === "Escape" && (S.preventDefault(),
|
|
4054
|
+
S.key === "Escape" && (S.preventDefault(), H());
|
|
4055
4055
|
}, E = () => {
|
|
4056
4056
|
M.hidden = !1, u.classList.add("gengage-chat-product-sort-dropdown--open"), y.setAttribute("aria-expanded", "true"), I = new AbortController();
|
|
4057
4057
|
const { signal: S } = I;
|
|
@@ -4061,7 +4061,7 @@ function Qi(t, e, a, n) {
|
|
|
4061
4061
|
});
|
|
4062
4062
|
};
|
|
4063
4063
|
y.addEventListener("click", (S) => {
|
|
4064
|
-
S.stopPropagation(), u.classList.contains("gengage-chat-product-sort-dropdown--open") ?
|
|
4064
|
+
S.stopPropagation(), u.classList.contains("gengage-chat-product-sort-dropdown--open") ? H() : E();
|
|
4065
4065
|
});
|
|
4066
4066
|
for (const S of x) {
|
|
4067
4067
|
const b = document.createElement("button");
|
|
@@ -4079,7 +4079,7 @@ function Qi(t, e, a, n) {
|
|
|
4079
4079
|
g = S.sortState, n.onSortChange?.(S.sortState), Xi(c, s, e, S.sortState), M.querySelectorAll(".gengage-chat-product-sort-option").forEach((Y) => {
|
|
4080
4080
|
const f = Y, C = f.dataset.sortKey === O;
|
|
4081
4081
|
f.classList.toggle("gengage-chat-product-sort-option--active", C), f.classList.toggle("gds-menu-option-active", C), f.setAttribute("aria-selected", C ? "true" : "false"), f.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !C);
|
|
4082
|
-
}), A(S.sortState),
|
|
4082
|
+
}), A(S.sortState), H();
|
|
4083
4083
|
}), M.appendChild(b);
|
|
4084
4084
|
}
|
|
4085
4085
|
if (u.appendChild(y), u.appendChild(M), h.appendChild(u), n.onToggleComparisonSku) {
|
|
@@ -4258,16 +4258,16 @@ function pt(t, e) {
|
|
|
4258
4258
|
M.className = "gengage-chat-consulting-group-header";
|
|
4259
4259
|
const P = document.createElement("h4");
|
|
4260
4260
|
if (P.className = "gengage-chat-consulting-group-label", P.textContent = `${m} (${L.length})`, M.appendChild(P), typeof A == "string" && A.trim().length > 0) {
|
|
4261
|
-
const
|
|
4262
|
-
|
|
4261
|
+
const H = document.createElement("p");
|
|
4262
|
+
H.className = "gengage-chat-consulting-group-reason", H.textContent = A, M.appendChild(H);
|
|
4263
4263
|
}
|
|
4264
4264
|
k.appendChild(M);
|
|
4265
4265
|
const I = document.createElement("div");
|
|
4266
4266
|
I.className = "gengage-chat-product-grid gengage-chat-consulting-group-grid", N && I.classList.add("gengage-chat-consulting-group-grid--single-group"), I.style.setProperty("--consulting-group-columns", String(Math.max(1, Math.min(4, L.length))));
|
|
4267
|
-
for (const
|
|
4267
|
+
for (const H of L) {
|
|
4268
4268
|
const ee = rt({
|
|
4269
4269
|
type: "ProductCard",
|
|
4270
|
-
props: { product:
|
|
4270
|
+
props: { product: H }
|
|
4271
4271
|
}, r ?? { onAction: () => {
|
|
4272
4272
|
} });
|
|
4273
4273
|
I.appendChild(ee);
|
|
@@ -5216,8 +5216,8 @@ button[data-gengage-part="chat-launcher-button"] img {
|
|
|
5216
5216
|
if (!(M instanceof HTMLButtonElement)) return !1;
|
|
5217
5217
|
const P = k.querySelector('[data-gengage-part="chat-header-avatar"]');
|
|
5218
5218
|
if (P instanceof HTMLImageElement) {
|
|
5219
|
-
const
|
|
5220
|
-
(!
|
|
5219
|
+
const H = k.querySelector('[data-gengage-part="chat-launcher-button"] img');
|
|
5220
|
+
(!H || P.src === H.src) && P.classList.remove("gengage-chat-header-avatar--logo");
|
|
5221
5221
|
}
|
|
5222
5222
|
if (M.querySelector(`.${L}`)) return !0;
|
|
5223
5223
|
M.setAttribute("aria-label", e);
|
|
@@ -5241,12 +5241,12 @@ button[data-gengage-part="chat-launcher-button"] img {
|
|
|
5241
5241
|
const I = y()?.shadowRoot ?? null;
|
|
5242
5242
|
if (I && (m(I), N(I)))
|
|
5243
5243
|
return;
|
|
5244
|
-
await new Promise((
|
|
5244
|
+
await new Promise((H) => requestAnimationFrame(() => H()));
|
|
5245
5245
|
}
|
|
5246
5246
|
}
|
|
5247
5247
|
};
|
|
5248
5248
|
}
|
|
5249
|
-
var Rr = /^HTTP\s+\d{3}\b/i,
|
|
5249
|
+
var Rr = /^HTTP\s+\d{3}\b/i, Dr = [
|
|
5250
5250
|
/response body is null/i,
|
|
5251
5251
|
/streaming not supported/i,
|
|
5252
5252
|
/ECONNREFUSED/i,
|
|
@@ -5257,7 +5257,7 @@ var Rr = /^HTTP\s+\d{3}\b/i, Hr = [
|
|
|
5257
5257
|
/502\s+bad gateway/i,
|
|
5258
5258
|
/503\s+service unavailable/i,
|
|
5259
5259
|
/504\s+gateway timeout/i
|
|
5260
|
-
],
|
|
5260
|
+
], Hr = [
|
|
5261
5261
|
/Traceback\s*\(/i,
|
|
5262
5262
|
/\bSyntaxError\b/,
|
|
5263
5263
|
/\bReferenceError\b/,
|
|
@@ -5273,11 +5273,11 @@ var Rr = /^HTTP\s+\d{3}\b/i, Hr = [
|
|
|
5273
5273
|
function Ur(t, e) {
|
|
5274
5274
|
if (Ft(t)) return !0;
|
|
5275
5275
|
const a = t.message.trim();
|
|
5276
|
-
if (Rr.test(a) ||
|
|
5276
|
+
if (Rr.test(a) || Dr.some((r) => r.test(a))) return !0;
|
|
5277
5277
|
const n = e.trim();
|
|
5278
5278
|
if (n.length > Fr) return !0;
|
|
5279
5279
|
const i = n.split(/\n/).length;
|
|
5280
|
-
return !!(i >= 6 ||
|
|
5280
|
+
return !!(i >= 6 || Hr.some((r) => r.test(n)) || i >= 3 && /\bat\s+/.test(n));
|
|
5281
5281
|
}
|
|
5282
5282
|
var ca = "gengage_kvkk_shown", Or = [
|
|
5283
5283
|
"kvkk",
|
|
@@ -5430,8 +5430,8 @@ var Wr = ':where(:root,.gengage-chat-root,.gengage-qna-container,.gengage-simrel
|
|
|
5430
5430
|
attribute_name: v().optional(),
|
|
5431
5431
|
variant_name: v().optional(),
|
|
5432
5432
|
sku: v().optional(),
|
|
5433
|
-
price:
|
|
5434
|
-
price_discounted:
|
|
5433
|
+
price: He([ve(), v()]).optional(),
|
|
5434
|
+
price_discounted: He([ve(), v()]).optional(),
|
|
5435
5435
|
image: v().optional(),
|
|
5436
5436
|
imageUrl: v().optional(),
|
|
5437
5437
|
image_url: v().optional(),
|
|
@@ -5479,13 +5479,13 @@ var Wr = ':where(:root,.gengage-chat-root,.gengage-qna-container,.gengage-simrel
|
|
|
5479
5479
|
name: v().optional(),
|
|
5480
5480
|
key: v().optional(),
|
|
5481
5481
|
label: v().optional(),
|
|
5482
|
-
value:
|
|
5482
|
+
value: He([
|
|
5483
5483
|
v(),
|
|
5484
5484
|
ve(),
|
|
5485
5485
|
Se()
|
|
5486
5486
|
]).optional()
|
|
5487
5487
|
})).optional(),
|
|
5488
|
-
specifications:
|
|
5488
|
+
specifications: He([Ee(v(), v()), J(V({
|
|
5489
5489
|
key: v(),
|
|
5490
5490
|
value: v()
|
|
5491
5491
|
}))]).optional()
|
|
@@ -5498,7 +5498,7 @@ var Wr = ':where(:root,.gengage-chat-root,.gengage-qna-container,.gengage-simrel
|
|
|
5498
5498
|
}), co = V({
|
|
5499
5499
|
review_class: v().optional(),
|
|
5500
5500
|
review_text: v().optional(),
|
|
5501
|
-
review_rating:
|
|
5501
|
+
review_rating: He([v(), ve()]).optional(),
|
|
5502
5502
|
review_tag: v().optional()
|
|
5503
5503
|
}), lo = V({ reviews: J(co).optional() }), go = V({
|
|
5504
5504
|
productName: v().optional(),
|
|
@@ -5610,13 +5610,13 @@ var Wr = ':where(:root,.gengage-chat-root,.gengage-qna-container,.gengage-simrel
|
|
|
5610
5610
|
"launchProductList",
|
|
5611
5611
|
"launchHomepage"
|
|
5612
5612
|
]);
|
|
5613
|
-
function
|
|
5613
|
+
function Dt(t) {
|
|
5614
5614
|
return t.length > 120 ? !1 : /^[a-zA-Z0-9#(),.\s%/\-]+$/.test(t);
|
|
5615
5615
|
}
|
|
5616
5616
|
function at(t) {
|
|
5617
5617
|
return typeof t == "object" && t !== null && typeof t.type == "string";
|
|
5618
5618
|
}
|
|
5619
|
-
function
|
|
5619
|
+
function Ht(t) {
|
|
5620
5620
|
return t?.type === "ProductGrid" && t.props?.similarsAppend === !0;
|
|
5621
5621
|
}
|
|
5622
5622
|
var fo = class Te extends Ra {
|
|
@@ -5658,7 +5658,7 @@ var fo = class Te extends Ra {
|
|
|
5658
5658
|
const a = document.createElement("style");
|
|
5659
5659
|
a.textContent = Wr, this._shadow.appendChild(a);
|
|
5660
5660
|
const n = this.root, i = (u, y) => {
|
|
5661
|
-
y &&
|
|
5661
|
+
y && Dt(y) && n.style.setProperty(u, y);
|
|
5662
5662
|
};
|
|
5663
5663
|
if (i("--gengage-chat-header-bg", e.headerBg), i("--gengage-chat-header-foreground", e.headerForeground), e.theme)
|
|
5664
5664
|
for (const [u, y] of Object.entries(e.theme)) u.startsWith("--") && typeof y == "string" && i(u, y);
|
|
@@ -5988,7 +5988,7 @@ var fo = class Te extends Ra {
|
|
|
5988
5988
|
break;
|
|
5989
5989
|
case "bgColorChange": {
|
|
5990
5990
|
const a = e.payload?.color;
|
|
5991
|
-
typeof a == "string" &&
|
|
5991
|
+
typeof a == "string" && Dt(a) && this._shadow && this._shadow.host.style.setProperty("--gengage-chat-bg", a);
|
|
5992
5992
|
break;
|
|
5993
5993
|
}
|
|
5994
5994
|
default:
|
|
@@ -6382,11 +6382,11 @@ var fo = class Te extends Ra {
|
|
|
6382
6382
|
};
|
|
6383
6383
|
this.config.session?.userId !== void 0 && (L.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (L.view_id = this.config.session.viewId), m.payload !== void 0 && (L.payload = m.payload), this.config.pageContext?.sku !== void 0 && (L.sku = this.config.pageContext.sku), this.config.pageContext?.pageType !== void 0 && (L.page_type = this.config.pageContext.pageType);
|
|
6384
6384
|
const N = crypto.randomUUID(), A = Date.now();
|
|
6385
|
-
let k = 0, M = !1, P = !1, I = !1,
|
|
6385
|
+
let k = 0, M = !1, P = !1, I = !1, H = !1, ee = !1;
|
|
6386
6386
|
const ae = zn();
|
|
6387
6387
|
let E = null, S = null;
|
|
6388
6388
|
const b = () => {
|
|
6389
|
-
if (this._drawer && !
|
|
6389
|
+
if (this._drawer && !H) {
|
|
6390
6390
|
if (!I) {
|
|
6391
6391
|
this._drawer.setPanelAiZoneState("hidden");
|
|
6392
6392
|
return;
|
|
@@ -6398,14 +6398,14 @@ var fo = class Te extends Ra {
|
|
|
6398
6398
|
const C = this._buildRenderContext();
|
|
6399
6399
|
C.isStreaming = f;
|
|
6400
6400
|
const w = this._renderUISpec(E, C);
|
|
6401
|
-
|
|
6401
|
+
H = !0, this._drawer.setPanelAiZoneState("results", { resultEl: w }), E = null;
|
|
6402
6402
|
}, O = (f, C, w) => {
|
|
6403
6403
|
if (f === "ProductGrid" || f === "CategoriesContainer") {
|
|
6404
6404
|
I = !0, T(w), b();
|
|
6405
6405
|
return;
|
|
6406
6406
|
}
|
|
6407
|
-
C !== "appendSimilars" && C !== "append" && (I = !1,
|
|
6408
|
-
}, j = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (I ||
|
|
6407
|
+
C !== "appendSimilars" && C !== "append" && (I = !1, H = !1, E = null, this._drawer?.setPanelAiZoneState("hidden"));
|
|
6408
|
+
}, j = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (I || H || E !== null), F = (f, C, w) => {
|
|
6409
6409
|
if (!this._drawer || !this._panel) return;
|
|
6410
6410
|
const R = f.elements[f.root];
|
|
6411
6411
|
if (w === "ProductGrid" && R) {
|
|
@@ -6431,7 +6431,7 @@ var fo = class Te extends Ra {
|
|
|
6431
6431
|
const B = this._panel.currentType ?? f, z = C?.props?.panelTitle;
|
|
6432
6432
|
this._panel.updateTopBar(B, z), this._panel.updateExtendedMode(f), this._isMobileViewport && o && this._drawer?.hideMobilePanel(), O(f, w, R);
|
|
6433
6433
|
};
|
|
6434
|
-
this.track(
|
|
6434
|
+
this.track(Da(this.analyticsContext(), {
|
|
6435
6435
|
endpoint: "process_action",
|
|
6436
6436
|
request_id: N,
|
|
6437
6437
|
widget: "chat"
|
|
@@ -6452,8 +6452,8 @@ var fo = class Te extends Ra {
|
|
|
6452
6452
|
if (C && B) {
|
|
6453
6453
|
const Q = this.config.accountId;
|
|
6454
6454
|
if (!zt(Q)) {
|
|
6455
|
-
const
|
|
6456
|
-
|
|
6455
|
+
const D = Vr(R);
|
|
6456
|
+
D ? this._drawer?.showKvkkBanner(D, () => {
|
|
6457
6457
|
this._drawer?.hideKvkkBanner(), tt(Q);
|
|
6458
6458
|
}) : tt(Q);
|
|
6459
6459
|
}
|
|
@@ -6461,24 +6461,24 @@ var fo = class Te extends Ra {
|
|
|
6461
6461
|
}
|
|
6462
6462
|
const z = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
|
|
6463
6463
|
if (z ? z.innerHTML = he(R) : (g.content = R, g.role === "assistant" && g.threadId && !this._threadsWithFirstBot.has(g.threadId) && (this._threadsWithFirstBot.add(g.threadId), this._drawer.markFirstBotMessage(g.id)), this._drawer.addMessage(g)), C)
|
|
6464
|
-
if (g.content = R, g.status = "done", mt(),
|
|
6464
|
+
if (g.content = R, g.status = "done", mt(), Dn(g))
|
|
6465
6465
|
this._drawer?.updateBotMessage(g.id, R, "photo_analysis", g.photoAnalysis), g.threadId && this._focusPresentationThread(g.threadId, "auto");
|
|
6466
6466
|
else {
|
|
6467
6467
|
const Q = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
|
|
6468
6468
|
if (Q) {
|
|
6469
6469
|
this._activeTypewriter?.cancel();
|
|
6470
|
-
const
|
|
6470
|
+
const D = w?.productMentions;
|
|
6471
6471
|
this._activeTypewriter = br({
|
|
6472
6472
|
container: Q,
|
|
6473
6473
|
html: he(R),
|
|
6474
6474
|
onTick: () => this._drawer?.scrollToBottomIfNeeded(),
|
|
6475
6475
|
onComplete: () => {
|
|
6476
|
-
this._activeTypewriter = null,
|
|
6476
|
+
this._activeTypewriter = null, D && D.length > 0 && Q && fr({
|
|
6477
6477
|
container: Q,
|
|
6478
|
-
mentions:
|
|
6478
|
+
mentions: D,
|
|
6479
6479
|
onProductClick: (K) => {
|
|
6480
6480
|
this._sendAction({
|
|
6481
|
-
title:
|
|
6481
|
+
title: D.find(($) => $.sku === K)?.short_name ?? K,
|
|
6482
6482
|
type: "launchSingleProduct",
|
|
6483
6483
|
payload: { sku: K }
|
|
6484
6484
|
});
|
|
@@ -6505,8 +6505,8 @@ var fo = class Te extends Ra {
|
|
|
6505
6505
|
z === "PhotoAnalysisCard" && g.threadId && this._focusPresentationThread(g.threadId, "auto");
|
|
6506
6506
|
return;
|
|
6507
6507
|
}
|
|
6508
|
-
const Q =
|
|
6509
|
-
|
|
6508
|
+
const Q = Ht(B), D = this.config.productDetailsExtended !== !0 && (z === "ProductDetailsPanel" || Q);
|
|
6509
|
+
D && !R && (this._clearAssistantPanelLikeStreamClearPanel(), M = !1);
|
|
6510
6510
|
const K = z === "ProductDetailsPanel" && w !== "panel" ? "panel" : w;
|
|
6511
6511
|
this.track(Fa(this.analyticsContext(), {
|
|
6512
6512
|
request_id: N,
|
|
@@ -6524,7 +6524,7 @@ var fo = class Te extends Ra {
|
|
|
6524
6524
|
Sa(void 0, U);
|
|
6525
6525
|
}
|
|
6526
6526
|
const se = K === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
|
|
6527
|
-
if (K === "panel" && this._panel && !
|
|
6527
|
+
if (K === "panel" && this._panel && !D && z === "ProductGrid" && B) {
|
|
6528
6528
|
const U = lt(B);
|
|
6529
6529
|
if (U.isConsulting && !or(U)) {
|
|
6530
6530
|
S = f;
|
|
@@ -6532,7 +6532,7 @@ var fo = class Te extends Ra {
|
|
|
6532
6532
|
}
|
|
6533
6533
|
U.isConsulting && (S = null);
|
|
6534
6534
|
}
|
|
6535
|
-
if (K === "panel" && this._panel && !
|
|
6535
|
+
if (K === "panel" && this._panel && !D) {
|
|
6536
6536
|
const U = !P;
|
|
6537
6537
|
P = !0;
|
|
6538
6538
|
const X = B?.props?.replacePanel === !0, ne = B?.props?.rankingState, q = X || ne === "pending" || ne === "final" ? "replace" : Nr({
|
|
@@ -6568,17 +6568,17 @@ var fo = class Te extends Ra {
|
|
|
6568
6568
|
}
|
|
6569
6569
|
const ce = z === "AITopPicks" || z === "AIGroupingCards", we = z === "ActionButtons" ? B?.props?.buttons : void 0, Be = z === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray(we) && we.length > 0 && we.every((U) => U.action?.type === "inputText");
|
|
6570
6570
|
let _ = !1, W = !1;
|
|
6571
|
-
if (
|
|
6571
|
+
if (D && Q && ($.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), ce && (!g.silent || r)) if (I) {
|
|
6572
6572
|
const U = this._renderUISpec(f, $);
|
|
6573
|
-
|
|
6573
|
+
H = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: U }), _ = !0, E = null;
|
|
6574
6574
|
} else
|
|
6575
6575
|
E = f, W = !0;
|
|
6576
6576
|
const ie = r && (z === "GroundingReviewCard" || ce);
|
|
6577
|
-
if (!ce && (!g.silent || ie) && (K !== "panel" || z === "ProductCard" ||
|
|
6577
|
+
if (!ce && (!g.silent || ie) && (K !== "panel" || z === "ProductCard" || D && z === "ProductGrid" && !Q) && (z !== "ActionButtons" || Be) && !_ && !(W && ce)) {
|
|
6578
6578
|
const U = this._shadow?.querySelector(".gengage-chat-messages");
|
|
6579
6579
|
if (U) {
|
|
6580
6580
|
const X = this._renderUISpec(f, $);
|
|
6581
|
-
g.threadId && (X.dataset.threadId = g.threadId), U.appendChild(X), this._scrollInlineIntoView(X, g.threadId), this._drawer?.refreshPresentationCollapsed(),
|
|
6581
|
+
g.threadId && (X.dataset.threadId = g.threadId), U.appendChild(X), this._scrollInlineIntoView(X, g.threadId), this._drawer?.refreshPresentationCollapsed(), D && z === "ProductGrid" && (P = !0);
|
|
6582
6582
|
}
|
|
6583
6583
|
}
|
|
6584
6584
|
if ((z === "ProductGrid" || z === "ProductCard") && g.threadId) {
|
|
@@ -6598,7 +6598,7 @@ var fo = class Te extends Ra {
|
|
|
6598
6598
|
U.length > 0 && this._bridge?.send("previewImages", { images: U });
|
|
6599
6599
|
}
|
|
6600
6600
|
const re = B?.children?.length ?? 0;
|
|
6601
|
-
if (z === "ProductGrid" && K === "panel" && !
|
|
6601
|
+
if (z === "ProductGrid" && K === "panel" && !D && re > 1 && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Cr(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = _r({
|
|
6602
6602
|
heading: this._i18n.choicePrompterHeading,
|
|
6603
6603
|
suggestion: this._i18n.choicePrompterSuggestion,
|
|
6604
6604
|
ctaLabel: this._i18n.choicePrompterCta,
|
|
@@ -6725,7 +6725,7 @@ var fo = class Te extends Ra {
|
|
|
6725
6725
|
K >= 0 && this._messages.splice(K, 1);
|
|
6726
6726
|
};
|
|
6727
6727
|
let Q = !1;
|
|
6728
|
-
const
|
|
6728
|
+
const D = () => {
|
|
6729
6729
|
if (B) return;
|
|
6730
6730
|
this.emit("error", f);
|
|
6731
6731
|
const K = f.message;
|
|
@@ -6758,8 +6758,8 @@ var fo = class Te extends Ra {
|
|
|
6758
6758
|
g.content = K, g.status = "done", this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, K), this._markUnavailableProductContext();
|
|
6759
6759
|
} else g.status = "done";
|
|
6760
6760
|
else if (R)
|
|
6761
|
-
this._drawer?.setPills([]), g.silent ||
|
|
6762
|
-
else if (
|
|
6761
|
+
this._drawer?.setPills([]), g.silent || D();
|
|
6762
|
+
else if (D(), B) return;
|
|
6763
6763
|
r && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !Q && g.status === "streaming" && (g.status = "error"), B || this.track(Ua(this.analyticsContext(), {
|
|
6764
6764
|
request_id: N,
|
|
6765
6765
|
error_code: "STREAM_ERROR",
|
|
@@ -6780,7 +6780,7 @@ var fo = class Te extends Ra {
|
|
|
6780
6780
|
const Q = B?.type ?? "ProductGrid";
|
|
6781
6781
|
F(z, R, Q), G(Q, B, "replace", !1), P = !0;
|
|
6782
6782
|
}
|
|
6783
|
-
S = null, E && T(!1), b(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._bridge?.send("isResponding", !1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(),
|
|
6783
|
+
S = null, E && T(!1), b(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._bridge?.send("isResponding", !1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), Hn(ae, {
|
|
6784
6784
|
drawer: this._drawer,
|
|
6785
6785
|
ensureRendered: () => {
|
|
6786
6786
|
},
|
|
@@ -6815,7 +6815,7 @@ var fo = class Te extends Ra {
|
|
|
6815
6815
|
meter_key: "chat_request",
|
|
6816
6816
|
quantity: 1,
|
|
6817
6817
|
unit: "request"
|
|
6818
|
-
})), this.track(
|
|
6818
|
+
})), this.track(Ha(this.analyticsContext(), {
|
|
6819
6819
|
message_count: this._messages.length,
|
|
6820
6820
|
history_ref: this.config.session?.sessionId ?? "",
|
|
6821
6821
|
redaction_level: "none"
|
|
@@ -6914,7 +6914,7 @@ var fo = class Te extends Ra {
|
|
|
6914
6914
|
})));
|
|
6915
6915
|
return;
|
|
6916
6916
|
}
|
|
6917
|
-
this._drawer.setInputAreaChips([{
|
|
6917
|
+
this._drawer.setInputAreaChips([...this.config.hideUserReviews !== !0 ? [{
|
|
6918
6918
|
label: this._i18n.groundingReviewCta,
|
|
6919
6919
|
icon: "review",
|
|
6920
6920
|
onAction: () => this._sendAction({
|
|
@@ -6922,7 +6922,7 @@ var fo = class Te extends Ra {
|
|
|
6922
6922
|
type: "reviewSummary",
|
|
6923
6923
|
payload: { sku: e }
|
|
6924
6924
|
})
|
|
6925
|
-
}, {
|
|
6925
|
+
}] : [], {
|
|
6926
6926
|
label: this._i18n.findSimilarLabel,
|
|
6927
6927
|
icon: "similar",
|
|
6928
6928
|
onAction: () => this._sendAction({
|
|
@@ -7310,6 +7310,9 @@ var fo = class Te extends Ra {
|
|
|
7310
7310
|
i18n: this._i18n,
|
|
7311
7311
|
pricing: this.config.pricing,
|
|
7312
7312
|
productPriceUi: this.config.productPriceUi,
|
|
7313
|
+
hideProductDiscountBadge: this.config.hideProductDiscountBadge,
|
|
7314
|
+
hideUserReviews: this.config.hideUserReviews,
|
|
7315
|
+
hideStockStatus: this.config.hideStockStatus,
|
|
7313
7316
|
productSort: this._productSort,
|
|
7314
7317
|
onSortChange: (a) => {
|
|
7315
7318
|
this._productSort = a;
|
|
@@ -7451,7 +7454,7 @@ var fo = class Te extends Ra {
|
|
|
7451
7454
|
const a = e.uiSpec, n = a.elements[a.root];
|
|
7452
7455
|
if (!n) return;
|
|
7453
7456
|
const i = n.type;
|
|
7454
|
-
if (i === "ActionButtons" || i === "ComparisonTable" ||
|
|
7457
|
+
if (i === "ActionButtons" || i === "ComparisonTable" || Ht(n)) return;
|
|
7455
7458
|
const r = this._buildRenderContext(), o = this._shadow?.querySelector(".gengage-chat-messages");
|
|
7456
7459
|
if (!o) return;
|
|
7457
7460
|
if (i === "ProductDetailsPanel") {
|
|
@@ -7512,7 +7515,7 @@ export {
|
|
|
7512
7515
|
Co as n,
|
|
7513
7516
|
Mr as o,
|
|
7514
7517
|
_o as p,
|
|
7515
|
-
|
|
7518
|
+
Ht as r,
|
|
7516
7519
|
yi as s,
|
|
7517
7520
|
fo as t,
|
|
7518
7521
|
hn as u
|