ads-web-sdkm 2.0.24 → 2.0.26
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/Brandshop.js +584 -509
- package/dist/Brandshop.js.map +1 -1
- package/dist/Brandshops.js +1 -1
- package/dist/Image-DBd789zZ.js +36 -0
- package/dist/Image-DBd789zZ.js.map +1 -0
- package/dist/components/Brandshop/Banner.d.ts +2 -1
- package/dist/components/Image/Image.d.ts +5 -3
- package/package.json +1 -1
- package/dist/Image-zvdPHg5N.js +0 -35
- package/dist/Image-zvdPHg5N.js.map +0 -1
package/dist/Brandshop.js
CHANGED
|
@@ -1,224 +1,235 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { g as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { h as B,
|
|
5
|
-
import { I as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { g as H, a as V, u as W, R as Z } from "./ReactQueryProvider-D__k2BsQ.js";
|
|
3
|
+
import { useState as k, useEffect as T, Component as F } from "react";
|
|
4
|
+
import { h as B, S as y, b as Q, c as j, d as K, e as q, f as z, g as J, u as X, a as e2, A as L } from "./ads-CChrT00a.js";
|
|
5
|
+
import { I as N } from "./Image-DBd789zZ.js";
|
|
6
|
+
const n2 = async ({
|
|
7
7
|
deviceType: e,
|
|
8
|
-
language:
|
|
9
|
-
brandshopId:
|
|
10
|
-
environment:
|
|
11
|
-
adServerApiKey:
|
|
8
|
+
language: n,
|
|
9
|
+
brandshopId: t,
|
|
10
|
+
environment: a,
|
|
11
|
+
adServerApiKey: r
|
|
12
12
|
}) => {
|
|
13
|
-
const [s,
|
|
13
|
+
const [s, c] = await H(r), d = V("adServer", a);
|
|
14
14
|
try {
|
|
15
15
|
return (await (await fetch(
|
|
16
|
-
`${
|
|
16
|
+
`${d}/api/v2/brandshop/server/${t}`,
|
|
17
17
|
{
|
|
18
18
|
headers: {
|
|
19
19
|
device: e,
|
|
20
|
-
lang:
|
|
20
|
+
lang: n,
|
|
21
21
|
"auth-token": s,
|
|
22
|
-
"auth-timestamp":
|
|
22
|
+
"auth-timestamp": c
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
)).json()).data;
|
|
26
|
-
} catch (
|
|
27
|
-
throw new Error(`Failed to fetch brandshop details - ${
|
|
26
|
+
} catch (u) {
|
|
27
|
+
throw new Error(`Failed to fetch brandshop details - ${u}`);
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, t2 = "brandshop", o2 = ({
|
|
30
30
|
deviceType: e,
|
|
31
|
-
language:
|
|
32
|
-
brandshopId:
|
|
33
|
-
environment:
|
|
34
|
-
adServerApiKey:
|
|
31
|
+
language: n,
|
|
32
|
+
brandshopId: t,
|
|
33
|
+
environment: a,
|
|
34
|
+
adServerApiKey: r,
|
|
35
35
|
enabled: s
|
|
36
|
-
}) =>
|
|
36
|
+
}) => W({
|
|
37
37
|
queryKey: [
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
t2,
|
|
39
|
+
t,
|
|
40
40
|
e,
|
|
41
|
-
|
|
41
|
+
n
|
|
42
42
|
],
|
|
43
|
-
queryFn: () =>
|
|
43
|
+
queryFn: () => n2({
|
|
44
44
|
deviceType: e,
|
|
45
|
-
language:
|
|
46
|
-
brandshopId:
|
|
47
|
-
environment:
|
|
48
|
-
adServerApiKey:
|
|
45
|
+
language: n,
|
|
46
|
+
brandshopId: t,
|
|
47
|
+
environment: a,
|
|
48
|
+
adServerApiKey: r
|
|
49
49
|
}),
|
|
50
50
|
enabled: s
|
|
51
|
-
}),
|
|
52
|
-
brandshopContent:
|
|
53
|
-
sectionContainer:
|
|
54
|
-
sectionTitle:
|
|
55
|
-
navigationSection:
|
|
56
|
-
navigationLogo:
|
|
57
|
-
navigationLinks:
|
|
58
|
-
navigationLink:
|
|
59
|
-
navigationSectionContainer:
|
|
60
|
-
bannerButton:
|
|
61
|
-
banner:
|
|
62
|
-
bannerCta:
|
|
63
|
-
bannerImage:
|
|
64
|
-
categoryContainer:
|
|
65
|
-
categoryTile:
|
|
66
|
-
categoryImageWrapper:
|
|
67
|
-
categoryImage:
|
|
68
|
-
categoryName:
|
|
69
|
-
categoryNameShrink:
|
|
70
|
-
categoryShrinkGap:
|
|
71
|
-
cols3:
|
|
72
|
-
cols2:
|
|
73
|
-
brandshopContainerSkeleton:
|
|
74
|
-
bannerSkeleton:
|
|
75
|
-
navContainerSkeleton:
|
|
76
|
-
navPillSkeleton:
|
|
77
|
-
categoryGridSkeleton:
|
|
78
|
-
categoryTileSkeleton:
|
|
79
|
-
promoSkeleton: $
|
|
80
|
-
brandshopError:
|
|
81
|
-
errorIcon:
|
|
82
|
-
errorContent:
|
|
83
|
-
errorText:
|
|
84
|
-
errorButton:
|
|
85
|
-
},
|
|
51
|
+
}), r2 = "_brandshopContent_1lmgx_7", a2 = "_sectionContainer_1lmgx_39", s2 = "_sectionTitle_1lmgx_55", i2 = "_navigationSection_1lmgx_121", c2 = "_navigationLogo_1lmgx_137", l2 = "_navigationLinks_1lmgx_147", _2 = "_navigationLink_1lmgx_147", d2 = "_navigationSectionContainer_1lmgx_187", u2 = "_bannerButton_1lmgx_281", m2 = "_banner_1lmgx_281", p2 = "_bannerCta_1lmgx_301", h2 = "_bannerImage_1lmgx_329", C2 = "_categoryContainer_1lmgx_409", g2 = "_categoryTile_1lmgx_423", f2 = "_categoryImageWrapper_1lmgx_443", y2 = "_categoryImage_1lmgx_443", v2 = "_categoryName_1lmgx_473", k2 = "_categoryNameShrink_1lmgx_503", N2 = "_categoryShrinkGap_1lmgx_511", b2 = "_cols3_1lmgx_533", S2 = "_cols2_1lmgx_541", x2 = "_brandshopContainerSkeleton_1lmgx_621", w2 = "_bannerSkeleton_1lmgx_639", T2 = "_navContainerSkeleton_1lmgx_651", P2 = "_navPillSkeleton_1lmgx_665", B2 = "_categoryGridSkeleton_1lmgx_677", I2 = "_categoryTileSkeleton_1lmgx_689", $2 = "_promoSkeleton_1lmgx_701", A2 = "_brandshopError_1lmgx_775", D2 = "_errorIcon_1lmgx_805", M2 = "_errorContent_1lmgx_817", E2 = "_errorText_1lmgx_833", L2 = "_errorButton_1lmgx_875", l = {
|
|
52
|
+
brandshopContent: r2,
|
|
53
|
+
sectionContainer: a2,
|
|
54
|
+
sectionTitle: s2,
|
|
55
|
+
navigationSection: i2,
|
|
56
|
+
navigationLogo: c2,
|
|
57
|
+
navigationLinks: l2,
|
|
58
|
+
navigationLink: _2,
|
|
59
|
+
navigationSectionContainer: d2,
|
|
60
|
+
bannerButton: u2,
|
|
61
|
+
banner: m2,
|
|
62
|
+
bannerCta: p2,
|
|
63
|
+
bannerImage: h2,
|
|
64
|
+
categoryContainer: C2,
|
|
65
|
+
categoryTile: g2,
|
|
66
|
+
categoryImageWrapper: f2,
|
|
67
|
+
categoryImage: y2,
|
|
68
|
+
categoryName: v2,
|
|
69
|
+
categoryNameShrink: k2,
|
|
70
|
+
categoryShrinkGap: N2,
|
|
71
|
+
cols3: b2,
|
|
72
|
+
cols2: S2,
|
|
73
|
+
brandshopContainerSkeleton: x2,
|
|
74
|
+
bannerSkeleton: w2,
|
|
75
|
+
navContainerSkeleton: T2,
|
|
76
|
+
navPillSkeleton: P2,
|
|
77
|
+
categoryGridSkeleton: B2,
|
|
78
|
+
categoryTileSkeleton: I2,
|
|
79
|
+
promoSkeleton: $2,
|
|
80
|
+
brandshopError: A2,
|
|
81
|
+
errorIcon: D2,
|
|
82
|
+
errorContent: M2,
|
|
83
|
+
errorText: E2,
|
|
84
|
+
errorButton: L2
|
|
85
|
+
}, O2 = ({
|
|
86
86
|
image: e,
|
|
87
|
-
text:
|
|
88
|
-
alt:
|
|
89
|
-
onClick:
|
|
90
|
-
}) => e ? /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
] }) : null,
|
|
87
|
+
text: n,
|
|
88
|
+
alt: t,
|
|
89
|
+
onClick: a
|
|
90
|
+
}) => e ? /* @__PURE__ */ C("button", { type: "button", className: l.bannerButton, onClick: a, children: [
|
|
91
|
+
/* @__PURE__ */ o(N, { src: e, alt: t, className: l.bannerImage }),
|
|
92
|
+
/* @__PURE__ */ o("div", { className: l.bannerCta, children: n })
|
|
93
|
+
] }) : null, H2 = ({ image: e, alt: n, index: t }) => /* @__PURE__ */ o("div", { className: l.banner, children: /* @__PURE__ */ o(
|
|
94
|
+
N,
|
|
95
|
+
{
|
|
96
|
+
src: e,
|
|
97
|
+
alt: n,
|
|
98
|
+
className: l.bannerImage,
|
|
99
|
+
fetchPriority: t === 0 ? "high" : "low"
|
|
100
|
+
}
|
|
101
|
+
) }), b = (e, n, t) => {
|
|
94
102
|
switch (e) {
|
|
95
103
|
case "ads_bs_pageload":
|
|
96
104
|
case "ads_bs_pageend": {
|
|
97
|
-
const { brandName:
|
|
98
|
-
|
|
99
|
-
brand_name:
|
|
100
|
-
user_status:
|
|
105
|
+
const { brandName: a, userStatus: r, platform: s } = n;
|
|
106
|
+
t?.(e, {
|
|
107
|
+
brand_name: a,
|
|
108
|
+
user_status: r,
|
|
101
109
|
platform: s
|
|
102
110
|
});
|
|
103
111
|
break;
|
|
104
112
|
}
|
|
105
113
|
case "ads_bs_section_view": {
|
|
106
|
-
const { brandName:
|
|
107
|
-
|
|
108
|
-
brand_name:
|
|
109
|
-
section_name:
|
|
114
|
+
const { brandName: a, sectionName: r, sectionOrder: s, userStatus: c, platform: d } = n;
|
|
115
|
+
t?.(e, {
|
|
116
|
+
brand_name: a,
|
|
117
|
+
section_name: r,
|
|
110
118
|
section_order: s,
|
|
111
|
-
user_status:
|
|
112
|
-
platform:
|
|
119
|
+
user_status: c,
|
|
120
|
+
platform: d
|
|
113
121
|
});
|
|
114
122
|
break;
|
|
115
123
|
}
|
|
116
124
|
case "ads_bs_content_click": {
|
|
117
|
-
const { contentName:
|
|
118
|
-
|
|
119
|
-
content_name:
|
|
120
|
-
content_order:
|
|
125
|
+
const { contentName: a, contentOrder: r, userStatus: s, platform: c } = n;
|
|
126
|
+
t?.(e, {
|
|
127
|
+
content_name: a,
|
|
128
|
+
content_order: r,
|
|
121
129
|
user_status: s,
|
|
122
|
-
platform:
|
|
130
|
+
platform: c
|
|
123
131
|
});
|
|
124
132
|
break;
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
|
-
},
|
|
135
|
+
}, V2 = ({
|
|
128
136
|
title: e,
|
|
129
|
-
hideTitle:
|
|
130
|
-
banners:
|
|
131
|
-
isLoggedin:
|
|
132
|
-
sectionTitle:
|
|
137
|
+
hideTitle: n,
|
|
138
|
+
banners: t,
|
|
139
|
+
isLoggedin: a,
|
|
140
|
+
sectionTitle: r,
|
|
133
141
|
onBannerClick: s,
|
|
134
|
-
trackBrandshopHandler:
|
|
142
|
+
trackBrandshopHandler: c
|
|
135
143
|
}) => {
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
|
|
144
|
+
const d = (u) => {
|
|
145
|
+
if (!u?.link?.link_destination) return;
|
|
146
|
+
b(
|
|
139
147
|
"ads_bs_content_click",
|
|
140
148
|
{
|
|
141
|
-
contentName:
|
|
142
|
-
contentOrder:
|
|
143
|
-
userStatus:
|
|
149
|
+
contentName: r,
|
|
150
|
+
contentOrder: u.display_order.toString(),
|
|
151
|
+
userStatus: a ? "logged_in" : "guest",
|
|
144
152
|
platform: "Web"
|
|
145
153
|
},
|
|
146
|
-
|
|
154
|
+
c
|
|
147
155
|
);
|
|
148
|
-
const
|
|
149
|
-
|
|
156
|
+
const h = B(u.link.link_destination);
|
|
157
|
+
h && s(h);
|
|
150
158
|
};
|
|
151
|
-
return
|
|
152
|
-
!
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
return t.length === 0 ? null : /* @__PURE__ */ C("div", { className: l.sectionContainer, children: [
|
|
160
|
+
!n && /* @__PURE__ */ o("h2", { className: l.sectionTitle, children: e }),
|
|
161
|
+
t.map((u, h) => u.link ? /* @__PURE__ */ o(
|
|
162
|
+
O2,
|
|
155
163
|
{
|
|
156
|
-
image:
|
|
157
|
-
text:
|
|
164
|
+
image: u.image,
|
|
165
|
+
text: u.link.link_text,
|
|
158
166
|
alt: e,
|
|
159
|
-
onClick: () => u
|
|
167
|
+
onClick: () => d(u)
|
|
160
168
|
},
|
|
161
|
-
|
|
162
|
-
) : /* @__PURE__ */
|
|
163
|
-
|
|
169
|
+
u.tracking_id
|
|
170
|
+
) : /* @__PURE__ */ o(
|
|
171
|
+
H2,
|
|
164
172
|
{
|
|
165
|
-
image:
|
|
166
|
-
alt: e
|
|
173
|
+
image: u.image,
|
|
174
|
+
alt: e,
|
|
175
|
+
index: h
|
|
167
176
|
},
|
|
168
|
-
|
|
177
|
+
u.tracking_id
|
|
169
178
|
))
|
|
170
179
|
] });
|
|
171
|
-
},
|
|
180
|
+
}, W2 = ({
|
|
172
181
|
title: e,
|
|
173
|
-
hideTitle:
|
|
174
|
-
categories:
|
|
175
|
-
isLoggedin:
|
|
176
|
-
onCategoryClick:
|
|
182
|
+
hideTitle: n,
|
|
183
|
+
categories: t,
|
|
184
|
+
isLoggedin: a,
|
|
185
|
+
onCategoryClick: r,
|
|
177
186
|
trackBrandshopHandler: s
|
|
178
187
|
}) => {
|
|
179
|
-
const
|
|
188
|
+
const c = (i) => {
|
|
180
189
|
if (!i?.link?.link_destination) return;
|
|
181
|
-
|
|
190
|
+
b(
|
|
182
191
|
"ads_bs_content_click",
|
|
183
192
|
{
|
|
184
193
|
contentName: i.category_name,
|
|
185
194
|
contentOrder: i.display_order.toString(),
|
|
186
|
-
userStatus:
|
|
195
|
+
userStatus: a ? "logged_in" : "guest",
|
|
187
196
|
platform: "Web"
|
|
188
197
|
},
|
|
189
198
|
s
|
|
190
199
|
);
|
|
191
200
|
const m = B(i.link.link_destination);
|
|
192
|
-
m &&
|
|
201
|
+
m && r(m);
|
|
193
202
|
};
|
|
194
|
-
if (
|
|
195
|
-
const
|
|
203
|
+
if (t.length < 2) return null;
|
|
204
|
+
const d = t.slice(0, 6), u = [...d].sort(
|
|
196
205
|
(i, m) => i.display_order - m.display_order
|
|
197
|
-
),
|
|
198
|
-
return /* @__PURE__ */
|
|
199
|
-
!
|
|
200
|
-
/* @__PURE__ */
|
|
206
|
+
), h = d.length === 2 || d.length === 4 ? 2 : 3;
|
|
207
|
+
return /* @__PURE__ */ C("div", { className: l.sectionContainer, children: [
|
|
208
|
+
!n && /* @__PURE__ */ o("h2", { className: l.sectionTitle, children: e }),
|
|
209
|
+
/* @__PURE__ */ o(
|
|
201
210
|
"div",
|
|
202
211
|
{
|
|
203
|
-
className: `${
|
|
204
|
-
children:
|
|
212
|
+
className: `${l.categoryContainer} ${l[`cols${h}`]} ${d.length === 6 ? l.categoryShrinkGap : ""}`,
|
|
213
|
+
children: u.map((i) => i ? /* @__PURE__ */ C(
|
|
205
214
|
"button",
|
|
206
215
|
{
|
|
207
|
-
className:
|
|
208
|
-
onClick: () =>
|
|
216
|
+
className: l.categoryTile,
|
|
217
|
+
onClick: () => c(i),
|
|
209
218
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
219
|
+
/* @__PURE__ */ o("div", { className: l.categoryImageWrapper, children: i.image && /* @__PURE__ */ o(
|
|
220
|
+
N,
|
|
212
221
|
{
|
|
213
222
|
src: i.image,
|
|
214
223
|
alt: i.category_name ?? e,
|
|
215
|
-
className:
|
|
224
|
+
className: l.categoryImage,
|
|
225
|
+
loading: "lazy",
|
|
226
|
+
fetchPriority: "low"
|
|
216
227
|
}
|
|
217
228
|
) }),
|
|
218
|
-
i.category_name && /* @__PURE__ */
|
|
229
|
+
i.category_name && /* @__PURE__ */ o(
|
|
219
230
|
"span",
|
|
220
231
|
{
|
|
221
|
-
className: `${
|
|
232
|
+
className: `${l.categoryName} ${d.length === 6 ? l.categoryNameShrink : ""}`,
|
|
222
233
|
children: i.category_name
|
|
223
234
|
}
|
|
224
235
|
)
|
|
@@ -229,54 +240,54 @@ const ee = async ({
|
|
|
229
240
|
}
|
|
230
241
|
)
|
|
231
242
|
] });
|
|
232
|
-
},
|
|
243
|
+
}, R2 = ({
|
|
233
244
|
title: e,
|
|
234
|
-
hideTitle:
|
|
235
|
-
logo:
|
|
236
|
-
navigationLinks:
|
|
237
|
-
isLoggedin:
|
|
245
|
+
hideTitle: n,
|
|
246
|
+
logo: t,
|
|
247
|
+
navigationLinks: a,
|
|
248
|
+
isLoggedin: r,
|
|
238
249
|
brandshopName: s,
|
|
239
|
-
onLinkClick:
|
|
240
|
-
trackBrandshopHandler:
|
|
250
|
+
onLinkClick: c,
|
|
251
|
+
trackBrandshopHandler: d
|
|
241
252
|
}) => {
|
|
242
|
-
const
|
|
243
|
-
|
|
253
|
+
const u = (i) => {
|
|
254
|
+
b(
|
|
244
255
|
"ads_bs_content_click",
|
|
245
256
|
{
|
|
246
257
|
contentName: i.link.link_text,
|
|
247
258
|
contentOrder: i.link.link_display_order.toString(),
|
|
248
|
-
userStatus:
|
|
259
|
+
userStatus: r ? "logged_in" : "guest",
|
|
249
260
|
platform: "Web"
|
|
250
261
|
},
|
|
251
|
-
|
|
262
|
+
d
|
|
252
263
|
);
|
|
253
264
|
const m = B(i.link.link_destination);
|
|
254
|
-
m &&
|
|
265
|
+
m && c(m);
|
|
255
266
|
};
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
267
|
+
if (a.length === 0) return null;
|
|
268
|
+
const h = [...a].sort(
|
|
258
269
|
(i, m) => i.link.link_display_order - m.link.link_display_order
|
|
259
270
|
);
|
|
260
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ C(
|
|
261
272
|
"div",
|
|
262
273
|
{
|
|
263
|
-
className: `${
|
|
274
|
+
className: `${l.sectionContainer} ${l.navigationSectionContainer}`,
|
|
264
275
|
children: [
|
|
265
|
-
!
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
|
|
268
|
-
|
|
276
|
+
!n && /* @__PURE__ */ o("h2", { className: l.sectionTitle, children: e }),
|
|
277
|
+
/* @__PURE__ */ C("div", { className: l.navigationSection, children: [
|
|
278
|
+
t && /* @__PURE__ */ o("h1", { children: /* @__PURE__ */ o(
|
|
279
|
+
N,
|
|
269
280
|
{
|
|
270
|
-
src:
|
|
281
|
+
src: t,
|
|
271
282
|
alt: s ?? e,
|
|
272
|
-
className:
|
|
283
|
+
className: l.navigationLogo
|
|
273
284
|
}
|
|
274
285
|
) }),
|
|
275
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ o("div", { className: l.navigationLinks, children: h.map((i) => /* @__PURE__ */ o(
|
|
276
287
|
"button",
|
|
277
288
|
{
|
|
278
|
-
className:
|
|
279
|
-
onClick: () =>
|
|
289
|
+
className: l.navigationLink,
|
|
290
|
+
onClick: () => u(i),
|
|
280
291
|
children: i.link.link_text
|
|
281
292
|
},
|
|
282
293
|
i.tracking_id
|
|
@@ -286,78 +297,82 @@ const ee = async ({
|
|
|
286
297
|
}
|
|
287
298
|
);
|
|
288
299
|
};
|
|
289
|
-
var
|
|
290
|
-
const
|
|
291
|
-
(
|
|
292
|
-
...
|
|
300
|
+
var R = /* @__PURE__ */ ((e) => (e.PERCENTAGE = "PERCENTAGE", e.AMOUNT = "AMOUNT", e))(R || {}), I = /* @__PURE__ */ ((e) => (e[e.PROMOTION = 1] = "PROMOTION", e[e.COUPON = 2] = "COUPON", e))(I || {});
|
|
301
|
+
const O = (e, n) => e.type === R.PERCENTAGE ? `${e.value}%` : `${e.discount_value} ${n}`, G = (e, n) => e.reduce(
|
|
302
|
+
(t, a) => a.order === I.PROMOTION ? {
|
|
303
|
+
...t,
|
|
293
304
|
promotion: {
|
|
294
|
-
value:
|
|
295
|
-
priceAfterDiscount:
|
|
305
|
+
value: O(a, n),
|
|
306
|
+
priceAfterDiscount: a.price_after_discount
|
|
296
307
|
}
|
|
297
|
-
} :
|
|
298
|
-
...
|
|
308
|
+
} : a.order === I.COUPON ? {
|
|
309
|
+
...t,
|
|
299
310
|
coupon: {
|
|
300
|
-
value:
|
|
301
|
-
priceAfterDiscount:
|
|
311
|
+
value: O(a, n),
|
|
312
|
+
priceAfterDiscount: a.price_after_discount
|
|
302
313
|
}
|
|
303
|
-
} :
|
|
314
|
+
} : t,
|
|
304
315
|
{ promotion: null, coupon: null }
|
|
305
|
-
),
|
|
306
|
-
chip:
|
|
316
|
+
), G2 = ({ children: e, className: n }) => /* @__PURE__ */ o("div", { className: n, children: e }), U2 = "_chip_fqk2t_3", Y2 = {
|
|
317
|
+
chip: U2
|
|
307
318
|
};
|
|
308
|
-
function
|
|
309
|
-
return /* @__PURE__ */
|
|
319
|
+
function Z2({ children: e, className: n }) {
|
|
320
|
+
return /* @__PURE__ */ o("div", { className: `${Y2.chip} ${n}`, children: e });
|
|
310
321
|
}
|
|
311
|
-
const
|
|
322
|
+
const F2 = (e) => {
|
|
312
323
|
const {
|
|
313
|
-
promotionValue:
|
|
314
|
-
hasCoupon:
|
|
315
|
-
isPriceDropped:
|
|
316
|
-
saveLabelText:
|
|
324
|
+
promotionValue: n,
|
|
325
|
+
hasCoupon: t,
|
|
326
|
+
isPriceDropped: a,
|
|
327
|
+
saveLabelText: r,
|
|
317
328
|
couponText: s,
|
|
318
|
-
priceDropText:
|
|
329
|
+
priceDropText: c
|
|
319
330
|
} = e;
|
|
320
|
-
return
|
|
321
|
-
label:
|
|
331
|
+
return a ? {
|
|
332
|
+
label: c,
|
|
322
333
|
variant: "priceDrop"
|
|
323
|
-
} :
|
|
334
|
+
} : t ? {
|
|
324
335
|
label: s,
|
|
325
336
|
variant: "coupon"
|
|
326
|
-
} :
|
|
327
|
-
label: `${
|
|
337
|
+
} : n ? {
|
|
338
|
+
label: `${r} ${n}`,
|
|
328
339
|
variant: "promotion"
|
|
329
340
|
} : null;
|
|
330
|
-
},
|
|
331
|
-
card:
|
|
332
|
-
header:
|
|
333
|
-
imageContainer:
|
|
334
|
-
image:
|
|
335
|
-
topControls:
|
|
336
|
-
footer:
|
|
337
|
-
priceSection:
|
|
338
|
-
priceWrapper:
|
|
339
|
-
priceCurrency:
|
|
340
|
-
withPromotion:
|
|
341
|
-
priceAmount:
|
|
342
|
-
priceOriginal:
|
|
343
|
-
brand:
|
|
344
|
-
ProductTitle:
|
|
345
|
-
couponBadge:
|
|
346
|
-
discountChipCoupon:
|
|
347
|
-
discountChipPromotion:
|
|
348
|
-
discountChipPriceDrop:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
341
|
+
}, Q2 = "_card_8c2od_3", j2 = "_header_8c2od_25", K2 = "_imageContainer_8c2od_47", q2 = "_image_8c2od_47", z2 = "_topControls_8c2od_77", J2 = "_footer_8c2od_91", X2 = "_priceSection_8c2od_105", ee = "_priceWrapper_8c2od_117", ne = "_priceCurrency_8c2od_129", te = "_withPromotion_8c2od_139", oe = "_priceAmount_8c2od_151", re = "_priceOriginal_8c2od_175", ae = "_brand_8c2od_221", se = "_ProductTitle_8c2od_233", ie = "_couponBadge_8c2od_261", ce = "_discountChipCoupon_8c2od_281", le = "_discountChipPromotion_8c2od_291", _e = "_discountChipPriceDrop_8c2od_293", de = "_myloContainer_8c2od_303", ue = "_myloText_8c2od_317", me = "_myloIcon_8c2od_329", pe = "_myloSkeleton_8c2od_339", he = "_container_8c2od_351", Ce = "_carousel_8c2od_391", ge = "_carouselContent_8c2od_421", fe = "_carouselItem_8c2od_429", ye = "_navButtonNext_8c2od_467", ve = "_navButtonPrev_8c2od_469", ke = "_navButtonPrevIcon_8c2od_521", Ne = "_navButtonNextIcon_8c2od_523", be = "_paginationContainer_8c2od_549", Se = "_paginationDot_8c2od_559", xe = "_paginationActiveDot_8c2od_571", _ = {
|
|
342
|
+
card: Q2,
|
|
343
|
+
header: j2,
|
|
344
|
+
imageContainer: K2,
|
|
345
|
+
image: q2,
|
|
346
|
+
topControls: z2,
|
|
347
|
+
footer: J2,
|
|
348
|
+
priceSection: X2,
|
|
349
|
+
priceWrapper: ee,
|
|
350
|
+
priceCurrency: ne,
|
|
351
|
+
withPromotion: te,
|
|
352
|
+
priceAmount: oe,
|
|
353
|
+
priceOriginal: re,
|
|
354
|
+
brand: ae,
|
|
355
|
+
ProductTitle: se,
|
|
356
|
+
couponBadge: ie,
|
|
357
|
+
discountChipCoupon: ce,
|
|
358
|
+
discountChipPromotion: le,
|
|
359
|
+
discountChipPriceDrop: _e,
|
|
360
|
+
myloContainer: de,
|
|
361
|
+
myloText: ue,
|
|
362
|
+
myloIcon: me,
|
|
363
|
+
myloSkeleton: pe,
|
|
364
|
+
container: he,
|
|
365
|
+
carousel: Ce,
|
|
366
|
+
carouselContent: ge,
|
|
367
|
+
carouselItem: fe,
|
|
368
|
+
navButtonNext: ye,
|
|
369
|
+
navButtonPrev: ve,
|
|
370
|
+
navButtonPrevIcon: ke,
|
|
371
|
+
navButtonNextIcon: Ne,
|
|
372
|
+
paginationContainer: be,
|
|
373
|
+
paginationDot: Se,
|
|
374
|
+
paginationActiveDot: xe
|
|
375
|
+
}, we = {
|
|
361
376
|
en: {
|
|
362
377
|
couponBadge: {
|
|
363
378
|
extra: "Extra",
|
|
@@ -388,135 +403,195 @@ const Ve = (e) => {
|
|
|
388
403
|
perMonth: "/الشهر مع"
|
|
389
404
|
}
|
|
390
405
|
}
|
|
391
|
-
},
|
|
406
|
+
}, A = (e) => we[e], Te = {
|
|
392
407
|
coupon: _.discountChipCoupon,
|
|
393
408
|
promotion: _.discountChipPromotion,
|
|
394
409
|
priceDrop: _.discountChipPriceDrop
|
|
395
410
|
};
|
|
396
|
-
function
|
|
411
|
+
function Pe({
|
|
397
412
|
language: e,
|
|
398
|
-
promotionValue:
|
|
399
|
-
coupon:
|
|
400
|
-
isPriceDropped:
|
|
401
|
-
className:
|
|
413
|
+
promotionValue: n,
|
|
414
|
+
coupon: t,
|
|
415
|
+
isPriceDropped: a,
|
|
416
|
+
className: r
|
|
402
417
|
}) {
|
|
403
|
-
const s =
|
|
404
|
-
promotionValue:
|
|
405
|
-
hasCoupon: !!
|
|
406
|
-
isPriceDropped:
|
|
418
|
+
const s = A(e), c = F2({
|
|
419
|
+
promotionValue: n,
|
|
420
|
+
hasCoupon: !!t,
|
|
421
|
+
isPriceDropped: a,
|
|
407
422
|
saveLabelText: s.discountChip.save,
|
|
408
423
|
couponText: s.discountChip.onlineExclusive,
|
|
409
424
|
priceDropText: s.discountChip.priceDrop
|
|
410
425
|
});
|
|
411
|
-
return
|
|
412
|
-
|
|
426
|
+
return c ? /* @__PURE__ */ o(
|
|
427
|
+
Z2,
|
|
413
428
|
{
|
|
414
|
-
className: `${
|
|
415
|
-
children:
|
|
429
|
+
className: `${r} ${Te[c.variant]}`,
|
|
430
|
+
children: c.label
|
|
416
431
|
}
|
|
417
432
|
) : null;
|
|
418
433
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
421
|
-
const
|
|
422
|
-
return /* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
434
|
+
const Be = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.94%206.38667L6.94%200.386667C6.7%200.146667%206.36667%200%206%200H1.33333C0.6%200%200%200.6%200%201.33333V6C0%206.36667%200.146667%206.7%200.393333%206.94667L6.39333%2012.9467C6.63333%2013.1867%206.96667%2013.3333%207.33333%2013.3333C7.7%2013.3333%208.03333%2013.1867%208.27333%2012.94L12.94%208.27333C13.1867%208.03333%2013.3333%207.7%2013.3333%207.33333C13.3333%206.96667%2013.18%206.62667%2012.94%206.38667ZM2.33333%203.33333C1.78%203.33333%201.33333%202.88667%201.33333%202.33333C1.33333%201.78%201.78%201.33333%202.33333%201.33333C2.88667%201.33333%203.33333%201.78%203.33333%202.33333C3.33333%202.88667%202.88667%203.33333%202.33333%203.33333Z'%20fill='%231AA573'/%3e%3c/svg%3e";
|
|
435
|
+
function Ie({ value: e, language: n }) {
|
|
436
|
+
const t = A(n);
|
|
437
|
+
return /* @__PURE__ */ C("div", { className: _.couponBadge, children: [
|
|
438
|
+
/* @__PURE__ */ o(N, { alt: "tag", src: Be, width: 13.3, height: 13.3 }),
|
|
439
|
+
/* @__PURE__ */ o("span", { children: `${t.couponBadge.extra} ${e} ${t.couponBadge.offAtCheckout}` })
|
|
425
440
|
] });
|
|
426
441
|
}
|
|
427
|
-
function
|
|
442
|
+
function $e({
|
|
428
443
|
price: e,
|
|
429
|
-
discounts:
|
|
444
|
+
discounts: n
|
|
430
445
|
}) {
|
|
431
|
-
const { promotion:
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
446
|
+
const { promotion: t } = G(n, e.currency), a = t?.priceAfterDiscount;
|
|
447
|
+
return /* @__PURE__ */ C("div", { className: _.priceWrapper, children: [
|
|
448
|
+
/* @__PURE__ */ o(
|
|
434
449
|
"span",
|
|
435
450
|
{
|
|
436
|
-
className: `${_.priceCurrency} ${
|
|
451
|
+
className: `${_.priceCurrency} ${a && _.withPromotion}`,
|
|
437
452
|
children: e.currency
|
|
438
453
|
}
|
|
439
454
|
),
|
|
440
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ o(
|
|
441
456
|
"span",
|
|
442
457
|
{
|
|
443
|
-
className: `${_.priceAmount} ${
|
|
444
|
-
children:
|
|
458
|
+
className: `${_.priceAmount} ${a && _.withPromotion}`,
|
|
459
|
+
children: t ? t.priceAfterDiscount : e.base
|
|
445
460
|
}
|
|
446
461
|
),
|
|
447
|
-
|
|
462
|
+
a && /* @__PURE__ */ o("span", { className: _.priceOriginal, children: e.base })
|
|
448
463
|
] });
|
|
449
464
|
}
|
|
450
|
-
function
|
|
451
|
-
return /* @__PURE__ */
|
|
465
|
+
function Ae({ title: e }) {
|
|
466
|
+
return /* @__PURE__ */ o("div", { className: _.ProductTitle, children: e });
|
|
452
467
|
}
|
|
453
|
-
|
|
468
|
+
var $;
|
|
469
|
+
(function(e) {
|
|
470
|
+
e.YEARLY = "yearly", e.MONTHLY = "monthly";
|
|
471
|
+
})($ || ($ = {}));
|
|
472
|
+
const De = [{ tenor_key: "2_Months", duration_in_days: 60, interest_percent_basis_points: 600, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "3_Months", duration_in_days: 90, interest_percent_basis_points: 1e3, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "6_Months", duration_in_days: 180, interest_percent_basis_points: 1900, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "9_Months", duration_in_days: 270, interest_percent_basis_points: 2900, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "12_Months", duration_in_days: 360, interest_percent_basis_points: 3800, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "15_Months", duration_in_days: 450, interest_percent_basis_points: 5e3, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "18_Months", duration_in_days: 540, interest_percent_basis_points: 6500, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "24_Months", duration_in_days: 720, interest_percent_basis_points: 8800, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "36_Months", duration_in_days: 1080, interest_percent_basis_points: 14400, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }, { tenor_key: "48_Months", duration_in_days: 1440, interest_percent_basis_points: 2e4, admin_fee_percent_basis_points: 0, murabaha_schema: "monthly" }];
|
|
473
|
+
async function Me() {
|
|
474
|
+
try {
|
|
475
|
+
const e = await fetch("https://mylosmsoffers.s3.eu-west-1.amazonaws.com/btechoffer.json", { method: "GET", cache: "default", headers: { "Content-Type": "application/json" } });
|
|
476
|
+
if (!e.ok) throw new Error(`Failed to fetch configs: ${e.status} ${e.statusText}`);
|
|
477
|
+
return await e.json();
|
|
478
|
+
} catch (e) {
|
|
479
|
+
return console.error("Failed to fetch tenor configs:", e), De;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function Ee(e, n) {
|
|
483
|
+
const t = n.interest_percent_basis_points / 1e4, a = e + e * t, r = n.duration_in_days / 30, s = n.tenor_key.match(/^(\d+)_/);
|
|
484
|
+
return { monthlyAmount: a / r, tenure: `${s ? s[1] : n.duration_in_days / 30} months`, murabaha: Number((n?.murabaha_schema === $.YEARLY ? t / r * 12 * 100 : t / r * 100).toFixed(2)) };
|
|
485
|
+
}
|
|
486
|
+
async function Le(e) {
|
|
487
|
+
const n = await Me();
|
|
488
|
+
if (n.length === 0) return null;
|
|
489
|
+
const t = n.map((r) => ({ config: r, installment: Ee(e, r) })).reduce((r, s) => s.installment.monthlyAmount < r.installment.monthlyAmount ? s : r), a = function(r) {
|
|
490
|
+
return new Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(r);
|
|
491
|
+
}(t.installment.monthlyAmount);
|
|
492
|
+
return { message: `Pay as low as ${a}/month`, tenure: `${String(t.config.duration_in_days / 30)}`, amount: a };
|
|
493
|
+
}
|
|
494
|
+
const Oe = "data:image/svg+xml,%3csvg%20width='29'%20height='14'%20viewBox='0%200%2029%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_5501_9441)'%3e%3cpath%20d='M0%202.77278H2.23046L2.7134%204.15232H2.72612C2.88286%203.69215%203.15714%203.32694%203.54992%203.05672C3.94175%202.78648%204.38158%202.65137%204.8694%202.65137C5.35722%202.65137%205.7706%202.77669%206.08407%203.02635C6.39752%203.27702%206.61303%203.64809%206.72861%204.13958H6.74135C6.93921%203.66375%207.23309%203.29659%207.62098%203.03812C8.0089%202.77963%208.45558%202.65039%208.95906%202.65039C9.33915%202.65039%209.66534%202.73655%209.93864%202.91083C10.2119%203.08413%2010.4196%203.3338%2010.5646%203.66081C10.7086%203.98783%2010.782%204.37751%2010.782%204.82887V9.0644H7.93151V5.59157C7.93151%205.3899%207.88352%205.23226%207.78947%205.11966C7.69446%205.00608%207.56419%204.95028%207.39961%204.95028C7.27619%204.95028%207.17039%204.97868%207.08322%205.03448C6.99701%205.09126%206.93041%205.17352%206.88534%205.28316C6.84028%205.39184%206.81775%205.52305%206.81775%205.67677V9.0654H3.96723V5.59257C3.96723%205.39087%203.91924%205.23323%203.82519%205.12063C3.73018%205.00706%203.59989%204.95125%203.43533%204.95125C3.25313%204.95125%203.11109%205.01391%203.00824%205.13826C2.90538%205.26358%202.85347%205.44276%202.85347%205.67677V9.0654H0V2.77278Z'%20fill='%23D52B92'/%3e%3cpath%20d='M15.2248%202.77148L14.4568%206.5596L13.8936%202.77148H11.0078L12.2832%209.06507H13.9475L13.5214%2011.1652H16.4062L18.1096%202.77148H15.2248Z'%20fill='%23D52B92'/%3e%3cpath%20d='M22.597%2011.1848H21.3668C19.4782%2011.1848%2018.6172%2010.2527%2018.6172%208.55498V2.76953H21.3855V8.71848C21.3855%208.90843%2021.5431%209.06312%2021.738%209.06312H22.597V11.1848Z'%20fill='%23D52B92'/%3e%3cpath%20d='M23.5082%208.8079C24.0518%209.07714%2024.6836%209.21226%2025.4036%209.21226C26.1236%209.21226%2026.7544%209.07714%2027.2992%208.8079C27.8427%208.53863%2028.263%208.15581%2028.5588%207.65942C28.8546%207.16302%2029.0025%206.58731%2029.0025%205.93133C29.0025%205.27533%2028.8546%204.69963%2028.5588%204.20324C28.263%203.70682%2027.8427%203.32499%2027.2992%203.05475C26.7554%202.78551%2026.1236%202.65039%2025.4036%202.65039C24.6836%202.65039%2024.0518%202.78551%2023.5082%203.05475C22.9645%203.324%2022.5444%203.70682%2022.2484%204.20324C21.9526%204.69963%2021.8047%205.27533%2021.8047%205.93133C21.8047%206.58731%2021.9526%207.16302%2022.2484%207.65942C22.5444%208.15581%2022.9637%208.53766%2023.5082%208.8079ZM25.8719%206.97112C25.7387%207.05532%2025.583%207.09742%2025.4036%207.09742C25.2244%207.09742%2025.0676%207.05532%2024.9354%206.97112C24.8023%206.88789%2024.7014%206.76354%2024.6318%206.59907C24.5622%206.43555%2024.527%206.23877%2024.527%206.01062C24.527%205.78249%2024.5622%205.58571%2024.6318%205.42219C24.7022%205.25869%2024.8031%205.13434%2024.9354%205.05014C25.0676%204.96691%2025.2244%204.92385%2025.4036%204.92385C25.583%204.92385%2025.7387%204.96594%2025.8719%205.05014C26.0041%205.13434%2026.106%205.25772%2026.1756%205.42219C26.245%205.58668%2026.2804%205.78249%2026.2804%206.01062C26.2804%206.23877%2026.245%206.43555%2026.1756%206.59907C26.105%206.76354%2026.0041%206.88692%2025.8719%206.97112Z'%20fill='%23D52B92'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_5501_9441'%3e%3crect%20width='29'%20height='12.4286'%20fill='white'%20transform='translate(0%200.785156)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", He = "data:image/svg+xml,%3csvg%20width='140'%20height='60'%20viewBox='0%200%20140%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.1656%2028.8946C22.7842%2029.8017%2022.2378%2030.4854%2021.5197%2030.9493C20.8016%2031.4166%2019.9563%2031.6434%2018.9874%2031.6434C18.0184%2031.6434%2017.1732%2031.4132%2016.4516%2030.9493C15.7369%2030.4854%2015.1872%2029.7982%2014.8058%2028.8946C14.4278%2027.9875%2014.2354%2026.8983%2014.2354%2025.6338C14.2354%2024.3694%2014.4244%2023.2836%2014.8058%2022.3731C15.1872%2021.466%2015.7369%2020.7822%2016.4516%2020.3183C17.1697%2019.8545%2018.0116%2019.6208%2018.9874%2019.6208C19.9632%2019.6208%2020.8016%2019.8545%2021.5197%2020.3183C22.2344%2020.7822%2022.7842%2021.4694%2023.1656%2022.3731C23.5435%2023.2836%2023.7359%2024.3694%2023.7359%2025.6338C23.7359%2026.8983%2023.547%2027.9875%2023.1656%2028.8946ZM62.0131%2026.2214C62.0131%2027.3965%2061.7416%2028.3105%2061.2022%2028.9702C60.6593%2029.6264%2059.9206%2029.9563%2058.9825%2029.9563C58.5565%2029.9563%2058.1751%2029.8876%2057.8246%2029.7673C57.8589%2029.2038%2057.8796%202.07324%2057.8796%202.07324H42.1152L42.1392%2027.4927C42.1392%2028.6644%2041.8678%2029.5852%2041.3283%2030.2415C40.7854%2030.8978%2040.0467%2031.2276%2039.1052%2031.2276C38.7032%2031.2276%2038.3355%2031.1623%2038.0023%2031.0558L37.9748%2031.0386V25.6338C37.9748%2022.0913%2037.1914%2018.9783%2035.6314%2016.2982C34.0715%2013.6182%2031.8552%2011.5497%2028.9862%2010.0963C26.1137%208.64285%2022.7842%207.91442%2018.9874%207.91442C15.1906%207.91442%2011.8542%208.64285%208.98516%2010.0963C6.11609%2011.5497%203.89987%2013.6182%202.33992%2016.2982C0.779974%2018.9783%200%2022.0913%200%2025.6338C0%2029.1763%200.779974%2032.2928%202.34336%2034.9694C3.90331%2037.6495%206.11953%2039.7145%208.9886%2041.1714C11.8577%2042.6248%2015.194%2043.3532%2018.9908%2043.3532C20.111%2043.3532%2021.1933%2043.2879%2022.231%2043.1608V43.6728C22.231%2045.3083%2020.9081%2046.6346%2019.2691%2046.6346H15.2078V58.8701H22.3375C33.0819%2058.8701%2037.9748%2053.4447%2037.9748%2043.5525V43.3498H38.0057H45.0942C49.6503%2043.3498%2053.612%2040.8037%2055.629%2037.0516L56.1478%2036.5225C57.2027%2038.4123%2058.5668%2039.9413%2060.2538%2041.0923C62.4632%2042.5973%2065.0024%2043.3498%2067.868%2043.3498C70.0293%2043.3498%2071.8882%2042.8447%2073.4378%2041.8345C74.9874%2040.8243%2076.1763%2039.3675%2076.9975%2037.4639C77.8187%2035.5604%2078.231%2033.2926%2078.231%2030.6607V14.1714H62.0165V26.2214H62.0131Z'%20fill='%23D52B92'/%3e%3cpath%20d='M125.191%2028.8145C124.81%2029.725%20124.263%2030.4088%20123.545%2030.8726C122.827%2031.3365%20121.982%2031.5667%20121.013%2031.5667C120.044%2031.5667%20119.198%2031.3365%20118.48%2030.8726C117.762%2030.4088%20117.212%2029.7216%20116.831%2028.8145C116.453%2027.9074%20116.261%2026.8216%20116.261%2025.5571C116.261%2024.2927%20116.453%2023.2069%20116.831%2022.2998C117.212%2021.3927%20117.759%2020.7055%20118.48%2020.2451C119.195%2019.7812%20120.04%2019.5476%20121.013%2019.5476C121.985%2019.5476%20122.827%2019.7812%20123.545%2020.2451C124.26%2020.709%20124.81%2021.3962%20125.191%2022.2998C125.569%2023.2104%20125.761%2024.2927%20125.761%2025.5571C125.761%2026.8216%20125.572%2027.9108%20125.191%2028.8145ZM137.66%2016.2181C136.097%2013.5415%20133.884%2011.473%20131.015%2010.0162C128.146%208.5593%20124.813%207.83087%20121.016%207.83087C117.219%207.83087%20113.883%208.5593%20111.014%2010.0162C108.145%2011.4696%20105.932%2013.5381%20104.369%2016.2181C102.805%2018.8982%20102.025%2022.0112%20102.025%2025.5537C102.025%2027.4676%20102.256%2029.2543%20102.713%2030.9173H101.094C99.4449%2030.9173%2098.1117%2029.5807%2098.1117%2027.9348V2H82.3679V27.9589C82.3679%2037.8511%2087.2608%2043.2765%2098.0052%2043.2765H107.485L107.533%2038.741C108.564%2039.6481%20109.719%2040.4384%20111.014%2041.0947C113.883%2042.5515%20117.219%2043.2765%20121.016%2043.2765C124.813%2043.2765%20128.146%2042.5481%20131.015%2041.0947C133.884%2039.6378%20136.1%2037.5728%20137.66%2034.8927C139.22%2032.2161%20140%2029.1031%20140%2025.5571C140%2022.0112%20139.22%2018.9016%20137.66%2016.2216'%20fill='%23D52B92'/%3e%3cpath%20d='M61.2086%2046.7405C58.2949%2046.7405%2055.9343%2049.101%2055.9343%2052.0147C55.9343%2054.9284%2058.2949%2057.289%2061.2086%2057.289C64.1223%2057.289%2066.4829%2054.9284%2066.4829%2052.0147C66.4829%2049.101%2064.1223%2046.7405%2061.2086%2046.7405Z'%20fill='%23D52B92'/%3e%3cpath%20d='M72.9519%2046.7405C70.0382%2046.7405%2067.6776%2049.101%2067.6776%2052.0147C67.6776%2054.9284%2070.0382%2057.289%2072.9519%2057.289C75.8656%2057.289%2078.2262%2054.9284%2078.2262%2052.0147C78.2262%2049.101%2075.8656%2046.7405%2072.9519%2046.7405Z'%20fill='%23D52B92'/%3e%3c/svg%3e";
|
|
495
|
+
function Ve(e, n = []) {
|
|
496
|
+
const [t, a] = k(null), [r, s] = k(!0);
|
|
497
|
+
return T(() => {
|
|
498
|
+
if (!e) return;
|
|
499
|
+
let c = !0;
|
|
500
|
+
return s(!0), e?.().then((d) => {
|
|
501
|
+
c && a(d);
|
|
502
|
+
}).finally(() => {
|
|
503
|
+
c && s(!1);
|
|
504
|
+
}), () => {
|
|
505
|
+
c = !1;
|
|
506
|
+
};
|
|
507
|
+
}, n), [t, r];
|
|
508
|
+
}
|
|
509
|
+
const We = (e) => {
|
|
510
|
+
if (!e) return 0;
|
|
511
|
+
const n = e.replaceAll(",", ""), t = Number(n);
|
|
512
|
+
return Number.isNaN(t) ? 0 : t;
|
|
513
|
+
}, Re = 500;
|
|
514
|
+
function Ge({
|
|
454
515
|
id: e,
|
|
455
|
-
title:
|
|
456
|
-
brand:
|
|
457
|
-
image:
|
|
458
|
-
price:
|
|
516
|
+
title: n,
|
|
517
|
+
brand: t,
|
|
518
|
+
image: a,
|
|
519
|
+
price: r,
|
|
459
520
|
discounts: s = [],
|
|
460
|
-
language:
|
|
461
|
-
className:
|
|
521
|
+
language: c,
|
|
522
|
+
className: d
|
|
462
523
|
}) {
|
|
463
|
-
const { promotion:
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
524
|
+
const { promotion: u, coupon: h } = G(s, r.currency), i = A(c), [m, g] = Ve(
|
|
525
|
+
() => Le(Number(r.final.replaceAll(",", ""))),
|
|
526
|
+
[r.final]
|
|
527
|
+
), f = `${i.mylo.from} ${m?.amount ?? "0"}${i.mylo.perMonth}`;
|
|
528
|
+
return /* @__PURE__ */ C(G2, { className: `${_.card} ${d}`, children: [
|
|
529
|
+
/* @__PURE__ */ C("header", { className: _.header, children: [
|
|
530
|
+
/* @__PURE__ */ o("div", { className: _.imageContainer, children: /* @__PURE__ */ o(N, { className: _.image, src: a, alt: n }) }),
|
|
531
|
+
/* @__PURE__ */ o("div", { className: _.topControls, children: /* @__PURE__ */ o(
|
|
532
|
+
Pe,
|
|
469
533
|
{
|
|
470
|
-
language:
|
|
471
|
-
coupon:
|
|
472
|
-
promotionValue:
|
|
473
|
-
isPriceDropped:
|
|
534
|
+
language: c,
|
|
535
|
+
coupon: h,
|
|
536
|
+
promotionValue: u?.value,
|
|
537
|
+
isPriceDropped: r.is_price_dropped
|
|
474
538
|
}
|
|
475
539
|
) })
|
|
476
540
|
] }),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
|
|
481
|
-
|
|
541
|
+
/* @__PURE__ */ C("footer", { className: _.footer, children: [
|
|
542
|
+
/* @__PURE__ */ o("div", { className: _.priceSection, children: /* @__PURE__ */ o($e, { price: r, discounts: s }) }),
|
|
543
|
+
g ? /* @__PURE__ */ o(y, { className: _.myloSkeleton }) : We(r.final) >= Re && /* @__PURE__ */ C("div", { className: _.myloContainer, children: [
|
|
544
|
+
/* @__PURE__ */ o("p", { className: _.myloText, children: f }),
|
|
545
|
+
/* @__PURE__ */ o(
|
|
546
|
+
N,
|
|
547
|
+
{
|
|
548
|
+
className: _.myloIcon,
|
|
549
|
+
src: c === "en" ? Oe : He,
|
|
550
|
+
alt: "mylo"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] }),
|
|
554
|
+
/* @__PURE__ */ o("h4", { className: _.brand, children: t }),
|
|
555
|
+
/* @__PURE__ */ o(Ae, { title: n }),
|
|
556
|
+
h && /* @__PURE__ */ o(Ie, { value: h.value, language: c })
|
|
482
557
|
] })
|
|
483
558
|
] }, e);
|
|
484
559
|
}
|
|
485
|
-
function
|
|
560
|
+
function Ue({
|
|
486
561
|
slidesToScroll: e,
|
|
487
|
-
products:
|
|
488
|
-
onProductClick:
|
|
489
|
-
language:
|
|
562
|
+
products: n,
|
|
563
|
+
onProductClick: t,
|
|
564
|
+
language: a
|
|
490
565
|
}) {
|
|
491
|
-
const [
|
|
492
|
-
return
|
|
493
|
-
if (!
|
|
566
|
+
const [r, s] = k(), [c, d] = k(0), [u, h] = k(0), [i, m] = k(!1), [g, f] = k(!1);
|
|
567
|
+
return T(() => {
|
|
568
|
+
if (!r)
|
|
494
569
|
return;
|
|
495
570
|
const p = () => {
|
|
496
|
-
|
|
571
|
+
h(r.scrollSnapList().length), d(r.selectedScrollSnap()), m(r.canScrollPrev()), f(r.canScrollNext());
|
|
497
572
|
};
|
|
498
|
-
return p(),
|
|
499
|
-
|
|
573
|
+
return p(), r.on("select", p), r.on("reInit", p), () => {
|
|
574
|
+
r.off("select", p), r.off("reInit", p);
|
|
500
575
|
};
|
|
501
|
-
}, [
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
|
|
576
|
+
}, [r]), /* @__PURE__ */ C("div", { className: _.container, children: [
|
|
577
|
+
/* @__PURE__ */ C(
|
|
578
|
+
Q,
|
|
504
579
|
{
|
|
505
580
|
opts: {
|
|
506
581
|
align: "start",
|
|
507
582
|
slidesToScroll: e ?? 1,
|
|
508
|
-
direction:
|
|
583
|
+
direction: a === "ar" ? "rtl" : "ltr"
|
|
509
584
|
},
|
|
510
585
|
setApi: s,
|
|
511
586
|
className: _.carousel,
|
|
512
587
|
children: [
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
|
|
588
|
+
/* @__PURE__ */ o(j, { className: _.carouselContent, children: n.map((p, v) => /* @__PURE__ */ o(
|
|
589
|
+
K,
|
|
515
590
|
{
|
|
516
591
|
className: _.carouselItem,
|
|
517
|
-
onClick: () =>
|
|
518
|
-
children: /* @__PURE__ */
|
|
519
|
-
|
|
592
|
+
onClick: () => t(p, v),
|
|
593
|
+
children: /* @__PURE__ */ o(
|
|
594
|
+
Ge,
|
|
520
595
|
{
|
|
521
596
|
id: p.offering_id,
|
|
522
597
|
brand: p.brand,
|
|
@@ -524,21 +599,21 @@ function $n({
|
|
|
524
599
|
price: p.price,
|
|
525
600
|
title: p.title,
|
|
526
601
|
discounts: p.discounts,
|
|
527
|
-
language:
|
|
602
|
+
language: a
|
|
528
603
|
}
|
|
529
604
|
)
|
|
530
605
|
},
|
|
531
|
-
`${p.offering_id}-${
|
|
606
|
+
`${p.offering_id}-${v}`
|
|
532
607
|
)) }),
|
|
533
|
-
i && /* @__PURE__ */
|
|
534
|
-
|
|
608
|
+
i && /* @__PURE__ */ o(
|
|
609
|
+
q,
|
|
535
610
|
{
|
|
536
611
|
className: _.navButtonPrev,
|
|
537
612
|
iconClassName: _.navButtonPrevIcon
|
|
538
613
|
}
|
|
539
614
|
),
|
|
540
|
-
|
|
541
|
-
|
|
615
|
+
g && /* @__PURE__ */ o(
|
|
616
|
+
z,
|
|
542
617
|
{
|
|
543
618
|
className: _.navButtonNext,
|
|
544
619
|
iconClassName: _.navButtonNextIcon
|
|
@@ -547,12 +622,12 @@ function $n({
|
|
|
547
622
|
]
|
|
548
623
|
}
|
|
549
624
|
),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
625
|
+
/* @__PURE__ */ o(
|
|
626
|
+
J,
|
|
552
627
|
{
|
|
553
|
-
slidesCount:
|
|
554
|
-
currentIndex:
|
|
555
|
-
onClick: (p) =>
|
|
628
|
+
slidesCount: u,
|
|
629
|
+
currentIndex: c,
|
|
630
|
+
onClick: (p) => r?.scrollTo(p),
|
|
556
631
|
showProgress: !1,
|
|
557
632
|
containerClassName: _.paginationContainer,
|
|
558
633
|
buttonClassName: _.paginationButton,
|
|
@@ -562,7 +637,7 @@ function $n({
|
|
|
562
637
|
)
|
|
563
638
|
] });
|
|
564
639
|
}
|
|
565
|
-
const
|
|
640
|
+
const Ye = (e) => ({
|
|
566
641
|
type: "single product",
|
|
567
642
|
val: [e.offering_id],
|
|
568
643
|
filters: [
|
|
@@ -571,348 +646,348 @@ const An = (e) => ({
|
|
|
571
646
|
value: [e.slug]
|
|
572
647
|
}
|
|
573
648
|
]
|
|
574
|
-
}),
|
|
649
|
+
}), Ze = async ({
|
|
575
650
|
language: e,
|
|
576
|
-
collectionId:
|
|
577
|
-
environment:
|
|
578
|
-
adServerApiKey:
|
|
651
|
+
collectionId: n,
|
|
652
|
+
environment: t,
|
|
653
|
+
adServerApiKey: a
|
|
579
654
|
}) => {
|
|
580
|
-
const [
|
|
655
|
+
const [r, s] = await H(a), c = V("adServer", t);
|
|
581
656
|
try {
|
|
582
657
|
return (await (await fetch(
|
|
583
|
-
`${
|
|
658
|
+
`${c}/api/v2/brandshop/server/collection/${n}`,
|
|
584
659
|
{
|
|
585
660
|
headers: {
|
|
586
661
|
lang: e,
|
|
587
662
|
device: "web",
|
|
588
|
-
"auth-token":
|
|
663
|
+
"auth-token": r,
|
|
589
664
|
"auth-timestamp": s,
|
|
590
665
|
"accept-language": e
|
|
591
666
|
}
|
|
592
667
|
}
|
|
593
668
|
)).json()).data;
|
|
594
|
-
} catch (
|
|
595
|
-
throw new Error(`Failed to fetch collection data - ${
|
|
669
|
+
} catch (d) {
|
|
670
|
+
throw new Error(`Failed to fetch collection data - ${d}`);
|
|
596
671
|
}
|
|
597
|
-
},
|
|
672
|
+
}, Fe = "collection", Qe = ({
|
|
598
673
|
language: e,
|
|
599
|
-
collectionId:
|
|
600
|
-
environment:
|
|
601
|
-
adServerApiKey:
|
|
602
|
-
}) =>
|
|
603
|
-
queryKey: [
|
|
604
|
-
queryFn: () =>
|
|
674
|
+
collectionId: n,
|
|
675
|
+
environment: t,
|
|
676
|
+
adServerApiKey: a
|
|
677
|
+
}) => W({
|
|
678
|
+
queryKey: [Fe, n, e],
|
|
679
|
+
queryFn: () => Ze({
|
|
605
680
|
language: e,
|
|
606
|
-
collectionId:
|
|
607
|
-
environment:
|
|
608
|
-
adServerApiKey:
|
|
681
|
+
collectionId: n,
|
|
682
|
+
environment: t,
|
|
683
|
+
adServerApiKey: a
|
|
609
684
|
})
|
|
610
|
-
}),
|
|
611
|
-
card:
|
|
612
|
-
imageSkeleton:
|
|
613
|
-
titleSkeleton:
|
|
614
|
-
descriptionSkeleton:
|
|
615
|
-
priceSkeleton:
|
|
616
|
-
buttonSkeleton:
|
|
617
|
-
},
|
|
618
|
-
const { className:
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
685
|
+
}), je = "_card_15xcs_1", Ke = "_imageSkeleton_15xcs_17", qe = "_titleSkeleton_15xcs_19", ze = "_descriptionSkeleton_15xcs_21", Je = "_priceSkeleton_15xcs_23", Xe = "_buttonSkeleton_15xcs_25", x = {
|
|
686
|
+
card: je,
|
|
687
|
+
imageSkeleton: Ke,
|
|
688
|
+
titleSkeleton: qe,
|
|
689
|
+
descriptionSkeleton: ze,
|
|
690
|
+
priceSkeleton: Je,
|
|
691
|
+
buttonSkeleton: Xe
|
|
692
|
+
}, en = (e) => {
|
|
693
|
+
const { className: n } = e;
|
|
694
|
+
return /* @__PURE__ */ C("div", { className: `${x.card} ${n || ""}`, children: [
|
|
695
|
+
/* @__PURE__ */ o(y, { className: x.imageSkeleton }),
|
|
696
|
+
/* @__PURE__ */ o(y, { className: x.titleSkeleton }),
|
|
697
|
+
/* @__PURE__ */ o(y, { className: x.descriptionSkeleton }),
|
|
698
|
+
/* @__PURE__ */ o(y, { className: x.priceSkeleton }),
|
|
699
|
+
/* @__PURE__ */ o(y, { className: x.buttonSkeleton })
|
|
625
700
|
] });
|
|
626
|
-
},
|
|
627
|
-
container:
|
|
628
|
-
header:
|
|
629
|
-
titleSkeleton:
|
|
630
|
-
carouselWrapper:
|
|
631
|
-
carouselContainer:
|
|
632
|
-
cardWrapper:
|
|
633
|
-
},
|
|
634
|
-
const { length:
|
|
635
|
-
return /* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
701
|
+
}, nn = "_container_gnnm8_1", tn = "_header_gnnm8_13", on = "_titleSkeleton_gnnm8_27", rn = "_carouselWrapper_gnnm8_37", an = "_carouselContainer_gnnm8_49", sn = "_cardWrapper_gnnm8_67", w = {
|
|
702
|
+
container: nn,
|
|
703
|
+
header: tn,
|
|
704
|
+
titleSkeleton: on,
|
|
705
|
+
carouselWrapper: rn,
|
|
706
|
+
carouselContainer: an,
|
|
707
|
+
cardWrapper: sn
|
|
708
|
+
}, cn = (e) => {
|
|
709
|
+
const { length: n } = e, t = n ?? 5;
|
|
710
|
+
return /* @__PURE__ */ C("div", { className: w.container, children: [
|
|
711
|
+
/* @__PURE__ */ o("div", { className: w.header, children: /* @__PURE__ */ o(y, { className: w.titleSkeleton }) }),
|
|
712
|
+
/* @__PURE__ */ o("div", { className: w.carouselWrapper, children: /* @__PURE__ */ o("div", { className: w.carouselContainer, children: Array.from({ length: t }, (a, r) => /* @__PURE__ */ o("div", { className: w.cardWrapper, children: /* @__PURE__ */ o(en, {}) }, r)) }) })
|
|
638
713
|
] });
|
|
639
714
|
};
|
|
640
|
-
function
|
|
715
|
+
function ln({
|
|
641
716
|
products: e,
|
|
642
|
-
title:
|
|
643
|
-
hideTitle:
|
|
644
|
-
isLoggedin:
|
|
645
|
-
language:
|
|
717
|
+
title: n,
|
|
718
|
+
hideTitle: t,
|
|
719
|
+
isLoggedin: a,
|
|
720
|
+
language: r,
|
|
646
721
|
environment: s,
|
|
647
|
-
adServerApiKey:
|
|
648
|
-
trackBrandshopHandler:
|
|
649
|
-
onProductClick:
|
|
722
|
+
adServerApiKey: c,
|
|
723
|
+
trackBrandshopHandler: d,
|
|
724
|
+
onProductClick: u
|
|
650
725
|
}) {
|
|
651
|
-
const { data:
|
|
652
|
-
language:
|
|
726
|
+
const { data: h, isLoading: i, error: m } = Qe({
|
|
727
|
+
language: r,
|
|
653
728
|
collectionId: e.collection_id ?? "",
|
|
654
729
|
environment: s,
|
|
655
|
-
adServerApiKey:
|
|
656
|
-
}),
|
|
657
|
-
|
|
730
|
+
adServerApiKey: c
|
|
731
|
+
}), g = (f, p) => {
|
|
732
|
+
b(
|
|
658
733
|
"ads_bs_content_click",
|
|
659
734
|
{
|
|
660
|
-
contentName:
|
|
735
|
+
contentName: f.title,
|
|
661
736
|
contentOrder: (p + 1).toString(),
|
|
662
|
-
userStatus:
|
|
737
|
+
userStatus: a ? "logged_in" : "guest",
|
|
663
738
|
platform: "Web"
|
|
664
739
|
},
|
|
665
|
-
|
|
740
|
+
d
|
|
666
741
|
);
|
|
667
|
-
const
|
|
668
|
-
|
|
742
|
+
const v = Ye(f), S = B(v);
|
|
743
|
+
S && u(S);
|
|
669
744
|
};
|
|
670
|
-
return i ? /* @__PURE__ */
|
|
671
|
-
!
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
|
|
745
|
+
return i ? /* @__PURE__ */ o(cn, {}) : m || !h ? null : /* @__PURE__ */ C("div", { className: l.sectionContainer, children: [
|
|
746
|
+
!t && /* @__PURE__ */ o("h2", { className: l.sectionTitle, children: n }),
|
|
747
|
+
/* @__PURE__ */ o(
|
|
748
|
+
Ue,
|
|
674
749
|
{
|
|
675
|
-
products:
|
|
676
|
-
onProductClick: (
|
|
677
|
-
language:
|
|
750
|
+
products: h.items,
|
|
751
|
+
onProductClick: (f, p) => g(f, p),
|
|
752
|
+
language: r
|
|
678
753
|
}
|
|
679
754
|
)
|
|
680
755
|
] });
|
|
681
756
|
}
|
|
682
|
-
const
|
|
757
|
+
const _n = ({
|
|
683
758
|
section: e,
|
|
684
|
-
onLinkClick:
|
|
685
|
-
trackBrandshopHandler:
|
|
686
|
-
isLoggedin:
|
|
687
|
-
brandName:
|
|
759
|
+
onLinkClick: n,
|
|
760
|
+
trackBrandshopHandler: t,
|
|
761
|
+
isLoggedin: a,
|
|
762
|
+
brandName: r,
|
|
688
763
|
language: s,
|
|
689
|
-
environment:
|
|
690
|
-
adServerApiKey:
|
|
691
|
-
brandshopName:
|
|
764
|
+
environment: c,
|
|
765
|
+
adServerApiKey: d,
|
|
766
|
+
brandshopName: u
|
|
692
767
|
}) => {
|
|
693
768
|
const {
|
|
694
|
-
section_type:
|
|
769
|
+
section_type: h,
|
|
695
770
|
section_title: i,
|
|
696
771
|
show_section_title: m,
|
|
697
|
-
data:
|
|
698
|
-
section_display_order:
|
|
699
|
-
} = e, { ref: p } =
|
|
700
|
-
onChange: (
|
|
701
|
-
|
|
772
|
+
data: g,
|
|
773
|
+
section_display_order: f
|
|
774
|
+
} = e, { ref: p } = X({
|
|
775
|
+
onChange: (v) => {
|
|
776
|
+
v && b(
|
|
702
777
|
"ads_bs_section_view",
|
|
703
778
|
{
|
|
704
|
-
brandName:
|
|
779
|
+
brandName: r,
|
|
705
780
|
sectionName: i,
|
|
706
|
-
sectionOrder:
|
|
707
|
-
userStatus:
|
|
781
|
+
sectionOrder: f.toString(),
|
|
782
|
+
userStatus: a ? "logged_in" : "guest",
|
|
708
783
|
platform: "Web"
|
|
709
784
|
},
|
|
710
|
-
|
|
785
|
+
t
|
|
711
786
|
);
|
|
712
787
|
}
|
|
713
788
|
});
|
|
714
|
-
return /* @__PURE__ */
|
|
715
|
-
switch (
|
|
789
|
+
return /* @__PURE__ */ o("div", { ref: p, style: { width: "100%" }, children: (() => {
|
|
790
|
+
switch (h) {
|
|
716
791
|
case "nav":
|
|
717
|
-
return /* @__PURE__ */
|
|
718
|
-
|
|
792
|
+
return /* @__PURE__ */ o(
|
|
793
|
+
R2,
|
|
719
794
|
{
|
|
720
795
|
title: i,
|
|
721
796
|
hideTitle: !m,
|
|
722
|
-
logo:
|
|
723
|
-
navigationLinks:
|
|
724
|
-
onLinkClick:
|
|
725
|
-
isLoggedin:
|
|
726
|
-
trackBrandshopHandler:
|
|
727
|
-
brandshopName:
|
|
797
|
+
logo: g[0].logo ?? "",
|
|
798
|
+
navigationLinks: g[0].navigation_links ?? [],
|
|
799
|
+
onLinkClick: n,
|
|
800
|
+
isLoggedin: a,
|
|
801
|
+
trackBrandshopHandler: t,
|
|
802
|
+
brandshopName: u
|
|
728
803
|
}
|
|
729
804
|
);
|
|
730
805
|
case "category":
|
|
731
|
-
return /* @__PURE__ */
|
|
732
|
-
|
|
806
|
+
return /* @__PURE__ */ o(
|
|
807
|
+
W2,
|
|
733
808
|
{
|
|
734
809
|
title: i,
|
|
735
810
|
hideTitle: !m,
|
|
736
|
-
categories:
|
|
737
|
-
onCategoryClick:
|
|
738
|
-
isLoggedin:
|
|
739
|
-
trackBrandshopHandler:
|
|
811
|
+
categories: g,
|
|
812
|
+
onCategoryClick: n,
|
|
813
|
+
isLoggedin: a,
|
|
814
|
+
trackBrandshopHandler: t
|
|
740
815
|
}
|
|
741
816
|
);
|
|
742
817
|
case "banner":
|
|
743
|
-
return /* @__PURE__ */
|
|
744
|
-
|
|
818
|
+
return /* @__PURE__ */ o(
|
|
819
|
+
V2,
|
|
745
820
|
{
|
|
746
821
|
title: i,
|
|
747
|
-
banners:
|
|
822
|
+
banners: g,
|
|
748
823
|
hideTitle: !m,
|
|
749
|
-
onBannerClick:
|
|
750
|
-
isLoggedin:
|
|
824
|
+
onBannerClick: n,
|
|
825
|
+
isLoggedin: a,
|
|
751
826
|
sectionTitle: i,
|
|
752
|
-
trackBrandshopHandler:
|
|
827
|
+
trackBrandshopHandler: t
|
|
753
828
|
}
|
|
754
829
|
);
|
|
755
830
|
case "productSlider":
|
|
756
|
-
return /* @__PURE__ */
|
|
757
|
-
|
|
831
|
+
return /* @__PURE__ */ o(
|
|
832
|
+
ln,
|
|
758
833
|
{
|
|
759
|
-
products:
|
|
834
|
+
products: g[0],
|
|
760
835
|
title: i,
|
|
761
836
|
hideTitle: !m,
|
|
762
|
-
isLoggedin:
|
|
763
|
-
trackBrandshopHandler:
|
|
764
|
-
onProductClick:
|
|
837
|
+
isLoggedin: a,
|
|
838
|
+
trackBrandshopHandler: t,
|
|
839
|
+
onProductClick: n,
|
|
765
840
|
language: s,
|
|
766
|
-
environment:
|
|
767
|
-
adServerApiKey:
|
|
841
|
+
environment: c,
|
|
842
|
+
adServerApiKey: d
|
|
768
843
|
}
|
|
769
844
|
);
|
|
770
845
|
default:
|
|
771
846
|
return null;
|
|
772
847
|
}
|
|
773
848
|
})() });
|
|
774
|
-
},
|
|
775
|
-
let
|
|
776
|
-
return (...
|
|
777
|
-
clearTimeout(
|
|
778
|
-
e(...
|
|
779
|
-
},
|
|
849
|
+
}, dn = (e, n) => {
|
|
850
|
+
let t;
|
|
851
|
+
return (...a) => {
|
|
852
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
853
|
+
e(...a);
|
|
854
|
+
}, n);
|
|
780
855
|
};
|
|
781
856
|
};
|
|
782
|
-
function
|
|
783
|
-
const [
|
|
784
|
-
return
|
|
785
|
-
const
|
|
786
|
-
const s = window.scrollY || document.documentElement.scrollTop,
|
|
787
|
-
|
|
857
|
+
function un(e = 5) {
|
|
858
|
+
const [n, t] = k(!1);
|
|
859
|
+
return T(() => {
|
|
860
|
+
const r = dn(() => {
|
|
861
|
+
const s = window.scrollY || document.documentElement.scrollTop, c = window.innerHeight, d = document.documentElement.scrollHeight, u = s + c >= d - e;
|
|
862
|
+
t(u);
|
|
788
863
|
}, 100);
|
|
789
|
-
return window.addEventListener("scroll",
|
|
790
|
-
window.removeEventListener("scroll",
|
|
864
|
+
return window.addEventListener("scroll", r, { passive: !0 }), r(), () => {
|
|
865
|
+
window.removeEventListener("scroll", r);
|
|
791
866
|
};
|
|
792
|
-
}, [e]),
|
|
867
|
+
}, [e]), n;
|
|
793
868
|
}
|
|
794
|
-
function
|
|
795
|
-
return /* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
869
|
+
function mn() {
|
|
870
|
+
return /* @__PURE__ */ C("div", { className: l.brandshopContainerSkeleton, children: [
|
|
871
|
+
/* @__PURE__ */ o(y, { className: l.bannerSkeleton }),
|
|
872
|
+
/* @__PURE__ */ o("div", { className: l.navContainerSkeleton, children: Array.from({ length: 3 }).map((t, a) => /* @__PURE__ */ o(y, { className: l.navPillSkeleton }, a)) }),
|
|
873
|
+
/* @__PURE__ */ o(
|
|
799
874
|
"div",
|
|
800
875
|
{
|
|
801
|
-
className:
|
|
876
|
+
className: l.categoryGridSkeleton,
|
|
802
877
|
style: {
|
|
803
878
|
gridTemplateColumns: `repeat(${Math.min(2, 2)}, 1fr)`
|
|
804
879
|
},
|
|
805
|
-
children: Array.from({ length: 2 }).map((
|
|
880
|
+
children: Array.from({ length: 2 }).map((t, a) => /* @__PURE__ */ o(y, { className: l.categoryTileSkeleton }, a))
|
|
806
881
|
}
|
|
807
882
|
),
|
|
808
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ o(y, { className: l.promoSkeleton })
|
|
809
884
|
] });
|
|
810
885
|
}
|
|
811
|
-
function
|
|
886
|
+
function pn({
|
|
812
887
|
language: e,
|
|
813
|
-
brandshopId:
|
|
814
|
-
environment:
|
|
815
|
-
adServerApiKey:
|
|
816
|
-
isLoggedin:
|
|
888
|
+
brandshopId: n,
|
|
889
|
+
environment: t,
|
|
890
|
+
adServerApiKey: a,
|
|
891
|
+
isLoggedin: r,
|
|
817
892
|
brandshop: s,
|
|
818
|
-
onLinkClick:
|
|
819
|
-
trackBrandshopHandler:
|
|
893
|
+
onLinkClick: c,
|
|
894
|
+
trackBrandshopHandler: d
|
|
820
895
|
}) {
|
|
821
|
-
const { isLaptop:
|
|
896
|
+
const { isLaptop: u, isDesktop: h } = e2(), i = u || h ? L.Web : L.Mobile;
|
|
822
897
|
let m = s;
|
|
823
898
|
const {
|
|
824
|
-
data:
|
|
825
|
-
isLoading:
|
|
899
|
+
data: g,
|
|
900
|
+
isLoading: f,
|
|
826
901
|
error: p
|
|
827
|
-
} =
|
|
902
|
+
} = o2({
|
|
828
903
|
language: e,
|
|
829
|
-
brandshopId:
|
|
830
|
-
environment:
|
|
831
|
-
adServerApiKey:
|
|
904
|
+
brandshopId: n,
|
|
905
|
+
environment: t,
|
|
906
|
+
adServerApiKey: a,
|
|
832
907
|
deviceType: i,
|
|
833
908
|
enabled: !s
|
|
834
909
|
});
|
|
835
|
-
m ??=
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
910
|
+
m ??= g;
|
|
911
|
+
const v = un(), S = m?.name || "", D = r ? "logged_in" : "guest", M = "Web";
|
|
912
|
+
if (T(() => {
|
|
838
913
|
window.scrollTo(0, 0);
|
|
839
|
-
}, []),
|
|
840
|
-
m &&
|
|
914
|
+
}, []), T(() => {
|
|
915
|
+
m && b(
|
|
841
916
|
"ads_bs_pageload",
|
|
842
|
-
{ brandName:
|
|
843
|
-
|
|
917
|
+
{ brandName: S, userStatus: D, platform: M },
|
|
918
|
+
d
|
|
844
919
|
);
|
|
845
|
-
}, [m]),
|
|
846
|
-
!m || !
|
|
920
|
+
}, [m]), T(() => {
|
|
921
|
+
!m || !v || b(
|
|
847
922
|
"ads_bs_pageend",
|
|
848
|
-
{ brandName:
|
|
849
|
-
|
|
923
|
+
{ brandName: S, userStatus: D, platform: M },
|
|
924
|
+
d
|
|
850
925
|
);
|
|
851
|
-
}, [
|
|
926
|
+
}, [v]), f) return /* @__PURE__ */ o(mn, {});
|
|
852
927
|
if (p)
|
|
853
928
|
throw new Error(
|
|
854
|
-
`brandshop with id ${
|
|
929
|
+
`brandshop with id ${n} failed to load} - ${p?.message || "unknown error"}`
|
|
855
930
|
);
|
|
856
931
|
const E = m?.content;
|
|
857
932
|
if (!Array.isArray(E)) return null;
|
|
858
|
-
const
|
|
859
|
-
(
|
|
933
|
+
const U = [...E].sort(
|
|
934
|
+
(P, Y) => P.section_display_order - Y.section_display_order
|
|
860
935
|
);
|
|
861
|
-
return /* @__PURE__ */
|
|
862
|
-
|
|
936
|
+
return /* @__PURE__ */ o("div", { className: l.brandshopContent, children: U.map((P) => /* @__PURE__ */ o(
|
|
937
|
+
_n,
|
|
863
938
|
{
|
|
864
|
-
section:
|
|
865
|
-
onLinkClick:
|
|
866
|
-
isLoggedin:
|
|
867
|
-
brandName:
|
|
868
|
-
trackBrandshopHandler:
|
|
939
|
+
section: P,
|
|
940
|
+
onLinkClick: c,
|
|
941
|
+
isLoggedin: r,
|
|
942
|
+
brandName: S,
|
|
943
|
+
trackBrandshopHandler: d,
|
|
869
944
|
language: e,
|
|
870
|
-
environment:
|
|
871
|
-
adServerApiKey:
|
|
945
|
+
environment: t,
|
|
946
|
+
adServerApiKey: a,
|
|
872
947
|
brandshopName: m?.name
|
|
873
948
|
},
|
|
874
|
-
|
|
949
|
+
P.tracking_id
|
|
875
950
|
)) });
|
|
876
951
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
879
|
-
const
|
|
880
|
-
return /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
952
|
+
const hn = "data:image/svg+xml,%3csvg%20width='49'%20height='48'%20viewBox='0%200%2049%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24.4941%2020.0311V24.0242M24.5%2030H24.52M22.7708%206.98426L6.27321%2034.9912C5.4892%2036.3221%206.45019%2038%207.9965%2038H40.9918C42.5381%2038%2043.4991%2036.3221%2042.7151%2034.9912L26.2174%206.98426C25.4444%205.67192%2023.5439%205.67191%2022.7708%206.98426ZM25%2030C25%2030.2761%2024.7761%2030.5%2024.5%2030.5C24.2239%2030.5%2024%2030.2761%2024%2030C24%2029.7239%2024.2239%2029.5%2024.5%2029.5C24.7761%2029.5%2025%2029.7239%2025%2030Z'%20stroke='%23DA1E28'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e";
|
|
953
|
+
function Cn({ language: e }) {
|
|
954
|
+
const n = e === "ar", t = n ? "حدث خطأ ما" : "Something went wrong", a = n ? "نواجه مشكلة في تحميل هذه الصفحة. يرجى الانتظار قليلاً؛ سيتم حلها قريباً." : "We're having trouble loading this page. Please bear with us; it should be resolved shortly.", r = n ? "إعادة المحاولة" : "Try again";
|
|
955
|
+
return /* @__PURE__ */ C("div", { className: l.brandshopError, children: [
|
|
956
|
+
/* @__PURE__ */ o(N, { src: hn, className: l.errorIcon, alt: "error" }),
|
|
957
|
+
/* @__PURE__ */ C("div", { className: l.errorContent, children: [
|
|
958
|
+
/* @__PURE__ */ C("div", { className: l.errorText, children: [
|
|
959
|
+
/* @__PURE__ */ o("h2", { children: t }),
|
|
960
|
+
/* @__PURE__ */ o("p", { children: a })
|
|
886
961
|
] }),
|
|
887
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ o(
|
|
888
963
|
"button",
|
|
889
964
|
{
|
|
890
|
-
className:
|
|
965
|
+
className: l.errorButton,
|
|
891
966
|
onClick: () => window.location.reload(),
|
|
892
|
-
children:
|
|
967
|
+
children: r
|
|
893
968
|
}
|
|
894
969
|
)
|
|
895
970
|
] })
|
|
896
971
|
] });
|
|
897
972
|
}
|
|
898
|
-
class
|
|
899
|
-
constructor(
|
|
900
|
-
super(
|
|
973
|
+
class gn extends F {
|
|
974
|
+
constructor(n) {
|
|
975
|
+
super(n), this.state = { hasError: !1, error: null, errorInfo: null };
|
|
901
976
|
}
|
|
902
|
-
static getDerivedStateFromError(
|
|
903
|
-
return { hasError: !0, error:
|
|
977
|
+
static getDerivedStateFromError(n) {
|
|
978
|
+
return { hasError: !0, error: n, errorInfo: null };
|
|
904
979
|
}
|
|
905
|
-
componentDidCatch(
|
|
906
|
-
this.setState({ error:
|
|
980
|
+
componentDidCatch(n, t) {
|
|
981
|
+
this.setState({ error: n, errorInfo: t });
|
|
907
982
|
}
|
|
908
983
|
render() {
|
|
909
984
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
910
985
|
}
|
|
911
986
|
}
|
|
912
|
-
function
|
|
913
|
-
return /* @__PURE__ */
|
|
987
|
+
function bn(e) {
|
|
988
|
+
return /* @__PURE__ */ o(Z, { children: /* @__PURE__ */ o(gn, { fallback: /* @__PURE__ */ o(Cn, { language: e.language }), children: /* @__PURE__ */ o(pn, { ...e }) }) });
|
|
914
989
|
}
|
|
915
990
|
export {
|
|
916
|
-
|
|
991
|
+
bn as Brandshop
|
|
917
992
|
};
|
|
918
993
|
//# sourceMappingURL=Brandshop.js.map
|