ads-web-sdkm 2.0.24 → 2.0.25

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 CHANGED
@@ -1,224 +1,224 @@
1
- import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
- import { g as L, a as W, u as G, R as K } from "./ReactQueryProvider-D__k2BsQ.js";
3
- import { useState as T, useEffect as P, Component as V } from "react";
4
- import { h as B, b as F, c as q, d as j, e as Z, f as H, g as z, S as k, u as J, a as X, A as O } from "./ads-CChrT00a.js";
5
- import { I as f } from "./Image-zvdPHg5N.js";
6
- const ee = async ({
1
+ import { jsxs as h, jsx as t } 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-zvdPHg5N.js";
6
+ const n2 = async ({
7
7
  deviceType: e,
8
- language: t,
8
+ language: n,
9
9
  brandshopId: o,
10
- environment: r,
11
- adServerApiKey: a
10
+ environment: a,
11
+ adServerApiKey: r
12
12
  }) => {
13
- const [s, l] = await L(a), u = W("adServer", r);
13
+ const [s, c] = await H(r), d = V("adServer", a);
14
14
  try {
15
15
  return (await (await fetch(
16
- `${u}/api/v2/brandshop/server/${o}`,
16
+ `${d}/api/v2/brandshop/server/${o}`,
17
17
  {
18
18
  headers: {
19
19
  device: e,
20
- lang: t,
20
+ lang: n,
21
21
  "auth-token": s,
22
- "auth-timestamp": l
22
+ "auth-timestamp": c
23
23
  }
24
24
  }
25
25
  )).json()).data;
26
- } catch (d) {
27
- throw new Error(`Failed to fetch brandshop details - ${d}`);
26
+ } catch (u) {
27
+ throw new Error(`Failed to fetch brandshop details - ${u}`);
28
28
  }
29
- }, ne = "brandshop", te = ({
29
+ }, t2 = "brandshop", o2 = ({
30
30
  deviceType: e,
31
- language: t,
31
+ language: n,
32
32
  brandshopId: o,
33
- environment: r,
34
- adServerApiKey: a,
33
+ environment: a,
34
+ adServerApiKey: r,
35
35
  enabled: s
36
- }) => G({
36
+ }) => W({
37
37
  queryKey: [
38
- ne,
38
+ t2,
39
39
  o,
40
40
  e,
41
- t
41
+ n
42
42
  ],
43
- queryFn: () => ee({
43
+ queryFn: () => n2({
44
44
  deviceType: e,
45
- language: t,
45
+ language: n,
46
46
  brandshopId: o,
47
- environment: r,
48
- adServerApiKey: a
47
+ environment: a,
48
+ adServerApiKey: r
49
49
  }),
50
50
  enabled: s
51
- }), oe = "_brandshopContent_1lmgx_7", re = "_sectionContainer_1lmgx_39", ae = "_sectionTitle_1lmgx_55", ce = "_navigationSection_1lmgx_121", ie = "_navigationLogo_1lmgx_137", se = "_navigationLinks_1lmgx_147", le = "_navigationLink_1lmgx_147", de = "_navigationSectionContainer_1lmgx_187", _e = "_bannerButton_1lmgx_281", ue = "_banner_1lmgx_281", me = "_bannerCta_1lmgx_301", pe = "_bannerImage_1lmgx_329", ge = "_categoryContainer_1lmgx_409", he = "_categoryTile_1lmgx_423", Ce = "_categoryImageWrapper_1lmgx_443", ve = "_categoryImage_1lmgx_443", ke = "_categoryName_1lmgx_473", Se = "_categoryNameShrink_1lmgx_503", Ne = "_categoryShrinkGap_1lmgx_511", fe = "_cols3_1lmgx_533", be = "_cols2_1lmgx_541", ye = "_brandshopContainerSkeleton_1lmgx_621", xe = "_bannerSkeleton_1lmgx_639", Te = "_navContainerSkeleton_1lmgx_651", Pe = "_navPillSkeleton_1lmgx_665", we = "_categoryGridSkeleton_1lmgx_677", Be = "_categoryTileSkeleton_1lmgx_689", $e = "_promoSkeleton_1lmgx_701", Ae = "_brandshopError_1lmgx_775", Ie = "_errorIcon_1lmgx_805", Ee = "_errorContent_1lmgx_817", Oe = "_errorText_1lmgx_833", De = "_errorButton_1lmgx_875", c = {
52
- brandshopContent: oe,
53
- sectionContainer: re,
54
- sectionTitle: ae,
55
- navigationSection: ce,
56
- navigationLogo: ie,
57
- navigationLinks: se,
58
- navigationLink: le,
59
- navigationSectionContainer: de,
60
- bannerButton: _e,
61
- banner: ue,
62
- bannerCta: me,
63
- bannerImage: pe,
64
- categoryContainer: ge,
65
- categoryTile: he,
66
- categoryImageWrapper: Ce,
67
- categoryImage: ve,
68
- categoryName: ke,
69
- categoryNameShrink: Se,
70
- categoryShrinkGap: Ne,
71
- cols3: fe,
72
- cols2: be,
73
- brandshopContainerSkeleton: ye,
74
- bannerSkeleton: xe,
75
- navContainerSkeleton: Te,
76
- navPillSkeleton: Pe,
77
- categoryGridSkeleton: we,
78
- categoryTileSkeleton: Be,
79
- promoSkeleton: $e,
80
- brandshopError: Ae,
81
- errorIcon: Ie,
82
- errorContent: Ee,
83
- errorText: Oe,
84
- errorButton: De
85
- }, Le = ({
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: t,
87
+ text: n,
88
88
  alt: o,
89
- onClick: r
90
- }) => e ? /* @__PURE__ */ h("button", { type: "button", className: c.bannerButton, onClick: r, children: [
91
- /* @__PURE__ */ n(f, { src: e, alt: o, className: c.bannerImage }),
92
- /* @__PURE__ */ n("div", { className: c.bannerCta, children: t })
93
- ] }) : null, We = ({ image: e, alt: t }) => /* @__PURE__ */ n("div", { className: c.banner, children: /* @__PURE__ */ n(f, { src: e, alt: t, className: c.bannerImage, fetchPriority: "high" }) }), N = (e, t, o) => {
89
+ onClick: a
90
+ }) => e ? /* @__PURE__ */ h("button", { type: "button", className: l.bannerButton, onClick: a, children: [
91
+ /* @__PURE__ */ t(N, { src: e, alt: o, className: l.bannerImage }),
92
+ /* @__PURE__ */ t("div", { className: l.bannerCta, children: n })
93
+ ] }) : null, H2 = ({ image: e, alt: n }) => /* @__PURE__ */ t("div", { className: l.banner, children: /* @__PURE__ */ t(N, { src: e, alt: n, className: l.bannerImage, fetchPriority: "high" }) }), b = (e, n, o) => {
94
94
  switch (e) {
95
95
  case "ads_bs_pageload":
96
96
  case "ads_bs_pageend": {
97
- const { brandName: r, userStatus: a, platform: s } = t;
97
+ const { brandName: a, userStatus: r, platform: s } = n;
98
98
  o?.(e, {
99
- brand_name: r,
100
- user_status: a,
99
+ brand_name: a,
100
+ user_status: r,
101
101
  platform: s
102
102
  });
103
103
  break;
104
104
  }
105
105
  case "ads_bs_section_view": {
106
- const { brandName: r, sectionName: a, sectionOrder: s, userStatus: l, platform: u } = t;
106
+ const { brandName: a, sectionName: r, sectionOrder: s, userStatus: c, platform: d } = n;
107
107
  o?.(e, {
108
- brand_name: r,
109
- section_name: a,
108
+ brand_name: a,
109
+ section_name: r,
110
110
  section_order: s,
111
- user_status: l,
112
- platform: u
111
+ user_status: c,
112
+ platform: d
113
113
  });
114
114
  break;
115
115
  }
116
116
  case "ads_bs_content_click": {
117
- const { contentName: r, contentOrder: a, userStatus: s, platform: l } = t;
117
+ const { contentName: a, contentOrder: r, userStatus: s, platform: c } = n;
118
118
  o?.(e, {
119
- content_name: r,
120
- content_order: a,
119
+ content_name: a,
120
+ content_order: r,
121
121
  user_status: s,
122
- platform: l
122
+ platform: c
123
123
  });
124
124
  break;
125
125
  }
126
126
  }
127
- }, Ge = ({
127
+ }, V2 = ({
128
128
  title: e,
129
- hideTitle: t,
129
+ hideTitle: n,
130
130
  banners: o,
131
- isLoggedin: r,
132
- sectionTitle: a,
131
+ isLoggedin: a,
132
+ sectionTitle: r,
133
133
  onBannerClick: s,
134
- trackBrandshopHandler: l
134
+ trackBrandshopHandler: c
135
135
  }) => {
136
- const u = (d) => {
137
- if (!d?.link?.link_destination) return;
138
- N(
136
+ const d = (u) => {
137
+ if (!u?.link?.link_destination) return;
138
+ b(
139
139
  "ads_bs_content_click",
140
140
  {
141
- contentName: a,
142
- contentOrder: d.display_order.toString(),
143
- userStatus: r ? "logged_in" : "guest",
141
+ contentName: r,
142
+ contentOrder: u.display_order.toString(),
143
+ userStatus: a ? "logged_in" : "guest",
144
144
  platform: "Web"
145
145
  },
146
- l
146
+ c
147
147
  );
148
- const g = B(d.link.link_destination);
149
- g && s(g);
148
+ const C = B(u.link.link_destination);
149
+ C && s(C);
150
150
  };
151
- return o.length === 0 ? null : /* @__PURE__ */ h("div", { className: c.sectionContainer, children: [
152
- !t && /* @__PURE__ */ n("h2", { className: c.sectionTitle, children: e }),
153
- o.map((d) => d.link ? /* @__PURE__ */ n(
154
- Le,
151
+ return o.length === 0 ? null : /* @__PURE__ */ h("div", { className: l.sectionContainer, children: [
152
+ !n && /* @__PURE__ */ t("h2", { className: l.sectionTitle, children: e }),
153
+ o.map((u) => u.link ? /* @__PURE__ */ t(
154
+ O2,
155
155
  {
156
- image: d.image,
157
- text: d.link.link_text,
156
+ image: u.image,
157
+ text: u.link.link_text,
158
158
  alt: e,
159
- onClick: () => u(d)
159
+ onClick: () => d(u)
160
160
  },
161
- d.tracking_id
162
- ) : /* @__PURE__ */ n(
163
- We,
161
+ u.tracking_id
162
+ ) : /* @__PURE__ */ t(
163
+ H2,
164
164
  {
165
- image: d.image,
165
+ image: u.image,
166
166
  alt: e
167
167
  },
168
- d.tracking_id
168
+ u.tracking_id
169
169
  ))
170
170
  ] });
171
- }, Me = ({
171
+ }, W2 = ({
172
172
  title: e,
173
- hideTitle: t,
173
+ hideTitle: n,
174
174
  categories: o,
175
- isLoggedin: r,
176
- onCategoryClick: a,
175
+ isLoggedin: a,
176
+ onCategoryClick: r,
177
177
  trackBrandshopHandler: s
178
178
  }) => {
179
- const l = (i) => {
179
+ const c = (i) => {
180
180
  if (!i?.link?.link_destination) return;
181
- N(
181
+ b(
182
182
  "ads_bs_content_click",
183
183
  {
184
184
  contentName: i.category_name,
185
185
  contentOrder: i.display_order.toString(),
186
- userStatus: r ? "logged_in" : "guest",
186
+ userStatus: a ? "logged_in" : "guest",
187
187
  platform: "Web"
188
188
  },
189
189
  s
190
190
  );
191
191
  const m = B(i.link.link_destination);
192
- m && a(m);
192
+ m && r(m);
193
193
  };
194
194
  if (o.length < 2) return null;
195
- const u = o.slice(0, 6), d = [...u].sort(
195
+ const d = o.slice(0, 6), u = [...d].sort(
196
196
  (i, m) => i.display_order - m.display_order
197
- ), g = u.length === 2 || u.length === 4 ? 2 : 3;
198
- return /* @__PURE__ */ h("div", { className: c.sectionContainer, children: [
199
- !t && /* @__PURE__ */ n("h2", { className: c.sectionTitle, children: e }),
200
- /* @__PURE__ */ n(
197
+ ), C = d.length === 2 || d.length === 4 ? 2 : 3;
198
+ return /* @__PURE__ */ h("div", { className: l.sectionContainer, children: [
199
+ !n && /* @__PURE__ */ t("h2", { className: l.sectionTitle, children: e }),
200
+ /* @__PURE__ */ t(
201
201
  "div",
202
202
  {
203
- className: `${c.categoryContainer} ${c[`cols${g}`]} ${u.length === 6 ? c.categoryShrinkGap : ""}`,
204
- children: d.map((i) => i ? /* @__PURE__ */ h(
203
+ className: `${l.categoryContainer} ${l[`cols${C}`]} ${d.length === 6 ? l.categoryShrinkGap : ""}`,
204
+ children: u.map((i) => i ? /* @__PURE__ */ h(
205
205
  "button",
206
206
  {
207
- className: c.categoryTile,
208
- onClick: () => l(i),
207
+ className: l.categoryTile,
208
+ onClick: () => c(i),
209
209
  children: [
210
- /* @__PURE__ */ n("div", { className: c.categoryImageWrapper, children: i.image && /* @__PURE__ */ n(
211
- f,
210
+ /* @__PURE__ */ t("div", { className: l.categoryImageWrapper, children: i.image && /* @__PURE__ */ t(
211
+ N,
212
212
  {
213
213
  src: i.image,
214
214
  alt: i.category_name ?? e,
215
- className: c.categoryImage
215
+ className: l.categoryImage
216
216
  }
217
217
  ) }),
218
- i.category_name && /* @__PURE__ */ n(
218
+ i.category_name && /* @__PURE__ */ t(
219
219
  "span",
220
220
  {
221
- className: `${c.categoryName} ${u.length === 6 ? c.categoryNameShrink : ""}`,
221
+ className: `${l.categoryName} ${d.length === 6 ? l.categoryNameShrink : ""}`,
222
222
  children: i.category_name
223
223
  }
224
224
  )
@@ -229,54 +229,54 @@ const ee = async ({
229
229
  }
230
230
  )
231
231
  ] });
232
- }, Re = ({
232
+ }, R2 = ({
233
233
  title: e,
234
- hideTitle: t,
234
+ hideTitle: n,
235
235
  logo: o,
236
- navigationLinks: r,
237
- isLoggedin: a,
236
+ navigationLinks: a,
237
+ isLoggedin: r,
238
238
  brandshopName: s,
239
- onLinkClick: l,
240
- trackBrandshopHandler: u
239
+ onLinkClick: c,
240
+ trackBrandshopHandler: d
241
241
  }) => {
242
- const d = (i) => {
243
- N(
242
+ const u = (i) => {
243
+ b(
244
244
  "ads_bs_content_click",
245
245
  {
246
246
  contentName: i.link.link_text,
247
247
  contentOrder: i.link.link_display_order.toString(),
248
- userStatus: a ? "logged_in" : "guest",
248
+ userStatus: r ? "logged_in" : "guest",
249
249
  platform: "Web"
250
250
  },
251
- u
251
+ d
252
252
  );
253
253
  const m = B(i.link.link_destination);
254
- m && l(m);
254
+ m && c(m);
255
255
  };
256
- if (r.length === 0) return null;
257
- const g = [...r].sort(
256
+ if (a.length === 0) return null;
257
+ const C = [...a].sort(
258
258
  (i, m) => i.link.link_display_order - m.link.link_display_order
259
259
  );
260
260
  return /* @__PURE__ */ h(
261
261
  "div",
262
262
  {
263
- className: `${c.sectionContainer} ${c.navigationSectionContainer}`,
263
+ className: `${l.sectionContainer} ${l.navigationSectionContainer}`,
264
264
  children: [
265
- !t && /* @__PURE__ */ n("h2", { className: c.sectionTitle, children: e }),
266
- /* @__PURE__ */ h("div", { className: c.navigationSection, children: [
267
- o && /* @__PURE__ */ n("h1", { children: /* @__PURE__ */ n(
268
- f,
265
+ !n && /* @__PURE__ */ t("h2", { className: l.sectionTitle, children: e }),
266
+ /* @__PURE__ */ h("div", { className: l.navigationSection, children: [
267
+ o && /* @__PURE__ */ t("h1", { children: /* @__PURE__ */ t(
268
+ N,
269
269
  {
270
270
  src: o,
271
271
  alt: s ?? e,
272
- className: c.navigationLogo
272
+ className: l.navigationLogo
273
273
  }
274
274
  ) }),
275
- /* @__PURE__ */ n("div", { className: c.navigationLinks, children: g.map((i) => /* @__PURE__ */ n(
275
+ /* @__PURE__ */ t("div", { className: l.navigationLinks, children: C.map((i) => /* @__PURE__ */ t(
276
276
  "button",
277
277
  {
278
- className: c.navigationLink,
279
- onClick: () => d(i),
278
+ className: l.navigationLink,
279
+ onClick: () => u(i),
280
280
  children: i.link.link_text
281
281
  },
282
282
  i.tracking_id
@@ -286,78 +286,82 @@ const ee = async ({
286
286
  }
287
287
  );
288
288
  };
289
- var M = /* @__PURE__ */ ((e) => (e.PERCENTAGE = "PERCENTAGE", e.AMOUNT = "AMOUNT", e))(M || {}), $ = /* @__PURE__ */ ((e) => (e[e.PROMOTION = 1] = "PROMOTION", e[e.COUPON = 2] = "COUPON", e))($ || {});
290
- const D = (e, t) => e.type === M.PERCENTAGE ? `${e.value}%` : `${e.discount_value} ${t}`, R = (e, t) => e.reduce(
291
- (o, r) => r.order === $.PROMOTION ? {
289
+ 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 || {});
290
+ const O = (e, n) => e.type === R.PERCENTAGE ? `${e.value}%` : `${e.discount_value} ${n}`, G = (e, n) => e.reduce(
291
+ (o, a) => a.order === I.PROMOTION ? {
292
292
  ...o,
293
293
  promotion: {
294
- value: D(r, t),
295
- priceAfterDiscount: r.price_after_discount
294
+ value: O(a, n),
295
+ priceAfterDiscount: a.price_after_discount
296
296
  }
297
- } : r.order === $.COUPON ? {
297
+ } : a.order === I.COUPON ? {
298
298
  ...o,
299
299
  coupon: {
300
- value: D(r, t),
301
- priceAfterDiscount: r.price_after_discount
300
+ value: O(a, n),
301
+ priceAfterDiscount: a.price_after_discount
302
302
  }
303
303
  } : o,
304
304
  { promotion: null, coupon: null }
305
- ), Ue = ({ children: e, className: t }) => /* @__PURE__ */ n("div", { className: t, children: e }), Qe = "_chip_fqk2t_3", Ye = {
306
- chip: Qe
305
+ ), G2 = ({ children: e, className: n }) => /* @__PURE__ */ t("div", { className: n, children: e }), U2 = "_chip_fqk2t_3", Y2 = {
306
+ chip: U2
307
307
  };
308
- function Ke({ children: e, className: t }) {
309
- return /* @__PURE__ */ n("div", { className: `${Ye.chip} ${t}`, children: e });
308
+ function Z2({ children: e, className: n }) {
309
+ return /* @__PURE__ */ t("div", { className: `${Y2.chip} ${n}`, children: e });
310
310
  }
311
- const Ve = (e) => {
311
+ const F2 = (e) => {
312
312
  const {
313
- promotionValue: t,
313
+ promotionValue: n,
314
314
  hasCoupon: o,
315
- isPriceDropped: r,
316
- saveLabelText: a,
315
+ isPriceDropped: a,
316
+ saveLabelText: r,
317
317
  couponText: s,
318
- priceDropText: l
318
+ priceDropText: c
319
319
  } = e;
320
- return r ? {
321
- label: l,
320
+ return a ? {
321
+ label: c,
322
322
  variant: "priceDrop"
323
323
  } : o ? {
324
324
  label: s,
325
325
  variant: "coupon"
326
- } : t ? {
327
- label: `${a} ${t}`,
326
+ } : n ? {
327
+ label: `${r} ${n}`,
328
328
  variant: "promotion"
329
329
  } : null;
330
- }, Fe = "_card_8c2od_3", qe = "_header_8c2od_25", je = "_imageContainer_8c2od_47", Ze = "_image_8c2od_47", He = "_topControls_8c2od_77", ze = "_footer_8c2od_91", Je = "_priceSection_8c2od_105", Xe = "_priceWrapper_8c2od_117", en = "_priceCurrency_8c2od_129", nn = "_withPromotion_8c2od_139", tn = "_priceAmount_8c2od_151", on = "_priceOriginal_8c2od_175", rn = "_brand_8c2od_221", an = "_ProductTitle_8c2od_233", cn = "_couponBadge_8c2od_261", sn = "_discountChipCoupon_8c2od_281", ln = "_discountChipPromotion_8c2od_291", dn = "_discountChipPriceDrop_8c2od_293", _n = "_container_8c2od_351", un = "_carousel_8c2od_391", mn = "_carouselContent_8c2od_421", pn = "_carouselItem_8c2od_429", gn = "_navButtonNext_8c2od_467", hn = "_navButtonPrev_8c2od_469", Cn = "_navButtonPrevIcon_8c2od_521", vn = "_navButtonNextIcon_8c2od_523", kn = "_paginationContainer_8c2od_549", Sn = "_paginationDot_8c2od_559", Nn = "_paginationActiveDot_8c2od_571", _ = {
331
- card: Fe,
332
- header: qe,
333
- imageContainer: je,
334
- image: Ze,
335
- topControls: He,
336
- footer: ze,
337
- priceSection: Je,
338
- priceWrapper: Xe,
339
- priceCurrency: en,
340
- withPromotion: nn,
341
- priceAmount: tn,
342
- priceOriginal: on,
343
- brand: rn,
344
- ProductTitle: an,
345
- couponBadge: cn,
346
- discountChipCoupon: sn,
347
- discountChipPromotion: ln,
348
- discountChipPriceDrop: dn,
349
- container: _n,
350
- carousel: un,
351
- carouselContent: mn,
352
- carouselItem: pn,
353
- navButtonNext: gn,
354
- navButtonPrev: hn,
355
- navButtonPrevIcon: Cn,
356
- navButtonNextIcon: vn,
357
- paginationContainer: kn,
358
- paginationDot: Sn,
359
- paginationActiveDot: Nn
360
- }, fn = {
330
+ }, 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", _ = {
331
+ card: Q2,
332
+ header: j2,
333
+ imageContainer: K2,
334
+ image: q2,
335
+ topControls: z2,
336
+ footer: J2,
337
+ priceSection: X2,
338
+ priceWrapper: ee,
339
+ priceCurrency: ne,
340
+ withPromotion: te,
341
+ priceAmount: oe,
342
+ priceOriginal: re,
343
+ brand: ae,
344
+ ProductTitle: se,
345
+ couponBadge: ie,
346
+ discountChipCoupon: ce,
347
+ discountChipPromotion: le,
348
+ discountChipPriceDrop: _e,
349
+ myloContainer: de,
350
+ myloText: ue,
351
+ myloIcon: me,
352
+ myloSkeleton: pe,
353
+ container: he,
354
+ carousel: Ce,
355
+ carouselContent: ge,
356
+ carouselItem: fe,
357
+ navButtonNext: ye,
358
+ navButtonPrev: ve,
359
+ navButtonPrevIcon: ke,
360
+ navButtonNextIcon: Ne,
361
+ paginationContainer: be,
362
+ paginationDot: Se,
363
+ paginationActiveDot: xe
364
+ }, we = {
361
365
  en: {
362
366
  couponBadge: {
363
367
  extra: "Extra",
@@ -388,135 +392,195 @@ const Ve = (e) => {
388
392
  perMonth: "/الشهر مع"
389
393
  }
390
394
  }
391
- }, U = (e) => fn[e], bn = {
395
+ }, A = (e) => we[e], Te = {
392
396
  coupon: _.discountChipCoupon,
393
397
  promotion: _.discountChipPromotion,
394
398
  priceDrop: _.discountChipPriceDrop
395
399
  };
396
- function yn({
400
+ function Pe({
397
401
  language: e,
398
- promotionValue: t,
402
+ promotionValue: n,
399
403
  coupon: o,
400
- isPriceDropped: r,
401
- className: a
404
+ isPriceDropped: a,
405
+ className: r
402
406
  }) {
403
- const s = U(e), l = Ve({
404
- promotionValue: t,
407
+ const s = A(e), c = F2({
408
+ promotionValue: n,
405
409
  hasCoupon: !!o,
406
- isPriceDropped: r,
410
+ isPriceDropped: a,
407
411
  saveLabelText: s.discountChip.save,
408
412
  couponText: s.discountChip.onlineExclusive,
409
413
  priceDropText: s.discountChip.priceDrop
410
414
  });
411
- return l ? /* @__PURE__ */ n(
412
- Ke,
415
+ return c ? /* @__PURE__ */ t(
416
+ Z2,
413
417
  {
414
- className: `${a} ${bn[l.variant]}`,
415
- children: l.label
418
+ className: `${r} ${Te[c.variant]}`,
419
+ children: c.label
416
420
  }
417
421
  ) : null;
418
422
  }
419
- const xn = "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";
420
- function Tn({ value: e, language: t }) {
421
- const o = U(t);
423
+ 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";
424
+ function Ie({ value: e, language: n }) {
425
+ const o = A(n);
422
426
  return /* @__PURE__ */ h("div", { className: _.couponBadge, children: [
423
- /* @__PURE__ */ n(f, { alt: "tag", src: xn, width: 13.3, height: 13.3 }),
424
- /* @__PURE__ */ n("span", { children: `${o.couponBadge.extra} ${e} ${o.couponBadge.offAtCheckout}` })
427
+ /* @__PURE__ */ t(N, { alt: "tag", src: Be, width: 13.3, height: 13.3 }),
428
+ /* @__PURE__ */ t("span", { children: `${o.couponBadge.extra} ${e} ${o.couponBadge.offAtCheckout}` })
425
429
  ] });
426
430
  }
427
- function Pn({
431
+ function $e({
428
432
  price: e,
429
- discounts: t
433
+ discounts: n
430
434
  }) {
431
- const { promotion: o } = R(t, e.currency), r = o?.priceAfterDiscount;
435
+ const { promotion: o } = G(n, e.currency), a = o?.priceAfterDiscount;
432
436
  return /* @__PURE__ */ h("div", { className: _.priceWrapper, children: [
433
- /* @__PURE__ */ n(
437
+ /* @__PURE__ */ t(
434
438
  "span",
435
439
  {
436
- className: `${_.priceCurrency} ${r && _.withPromotion}`,
440
+ className: `${_.priceCurrency} ${a && _.withPromotion}`,
437
441
  children: e.currency
438
442
  }
439
443
  ),
440
- /* @__PURE__ */ n(
444
+ /* @__PURE__ */ t(
441
445
  "span",
442
446
  {
443
- className: `${_.priceAmount} ${r && _.withPromotion}`,
447
+ className: `${_.priceAmount} ${a && _.withPromotion}`,
444
448
  children: o ? o.priceAfterDiscount : e.base
445
449
  }
446
450
  ),
447
- r && /* @__PURE__ */ n("span", { className: _.priceOriginal, children: e.base })
451
+ a && /* @__PURE__ */ t("span", { className: _.priceOriginal, children: e.base })
448
452
  ] });
449
453
  }
450
- function wn({ title: e }) {
451
- return /* @__PURE__ */ n("div", { className: _.ProductTitle, children: e });
454
+ function Ae({ title: e }) {
455
+ return /* @__PURE__ */ t("div", { className: _.ProductTitle, children: e });
456
+ }
457
+ var $;
458
+ (function(e) {
459
+ e.YEARLY = "yearly", e.MONTHLY = "monthly";
460
+ })($ || ($ = {}));
461
+ 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" }];
462
+ async function Me() {
463
+ try {
464
+ const e = await fetch("https://mylosmsoffers.s3.eu-west-1.amazonaws.com/btechoffer.json", { method: "GET", cache: "default", headers: { "Content-Type": "application/json" } });
465
+ if (!e.ok) throw new Error(`Failed to fetch configs: ${e.status} ${e.statusText}`);
466
+ return await e.json();
467
+ } catch (e) {
468
+ return console.error("Failed to fetch tenor configs:", e), De;
469
+ }
470
+ }
471
+ function Ee(e, n) {
472
+ const o = n.interest_percent_basis_points / 1e4, a = e + e * o, r = n.duration_in_days / 30, s = n.tenor_key.match(/^(\d+)_/);
473
+ return { monthlyAmount: a / r, tenure: `${s ? s[1] : n.duration_in_days / 30} months`, murabaha: Number((n?.murabaha_schema === $.YEARLY ? o / r * 12 * 100 : o / r * 100).toFixed(2)) };
452
474
  }
453
- function Bn({
475
+ async function Le(e) {
476
+ const n = await Me();
477
+ if (n.length === 0) return null;
478
+ const o = n.map((r) => ({ config: r, installment: Ee(e, r) })).reduce((r, s) => s.installment.monthlyAmount < r.installment.monthlyAmount ? s : r), a = function(r) {
479
+ return new Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(r);
480
+ }(o.installment.monthlyAmount);
481
+ return { message: `Pay as low as ${a}/month`, tenure: `${String(o.config.duration_in_days / 30)}`, amount: a };
482
+ }
483
+ 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";
484
+ function Ve(e, n = []) {
485
+ const [o, a] = k(null), [r, s] = k(!0);
486
+ return T(() => {
487
+ if (!e) return;
488
+ let c = !0;
489
+ return s(!0), e?.().then((d) => {
490
+ c && a(d);
491
+ }).finally(() => {
492
+ c && s(!1);
493
+ }), () => {
494
+ c = !1;
495
+ };
496
+ }, n), [o, r];
497
+ }
498
+ const We = (e) => {
499
+ if (!e) return 0;
500
+ const n = e.replaceAll(",", ""), o = Number(n);
501
+ return Number.isNaN(o) ? 0 : o;
502
+ }, Re = 500;
503
+ function Ge({
454
504
  id: e,
455
- title: t,
505
+ title: n,
456
506
  brand: o,
457
- image: r,
458
- price: a,
507
+ image: a,
508
+ price: r,
459
509
  discounts: s = [],
460
- language: l,
461
- className: u
510
+ language: c,
511
+ className: d
462
512
  }) {
463
- const { promotion: d, coupon: g } = R(s, a.currency);
464
- return /* @__PURE__ */ h(Ue, { className: `${_.card} ${u}`, children: [
513
+ const { promotion: u, coupon: C } = G(s, r.currency), i = A(c), [m, g] = Ve(
514
+ () => Le(Number(r.final.replaceAll(",", ""))),
515
+ [r.final]
516
+ ), f = `${i.mylo.from} ${m?.amount ?? "0"}${i.mylo.perMonth}`;
517
+ return /* @__PURE__ */ h(G2, { className: `${_.card} ${d}`, children: [
465
518
  /* @__PURE__ */ h("header", { className: _.header, children: [
466
- /* @__PURE__ */ n("div", { className: _.imageContainer, children: /* @__PURE__ */ n(f, { className: _.image, src: r, alt: t }) }),
467
- /* @__PURE__ */ n("div", { className: _.topControls, children: /* @__PURE__ */ n(
468
- yn,
519
+ /* @__PURE__ */ t("div", { className: _.imageContainer, children: /* @__PURE__ */ t(N, { className: _.image, src: a, alt: n }) }),
520
+ /* @__PURE__ */ t("div", { className: _.topControls, children: /* @__PURE__ */ t(
521
+ Pe,
469
522
  {
470
- language: l,
471
- coupon: g,
472
- promotionValue: d?.value,
473
- isPriceDropped: a.is_price_dropped
523
+ language: c,
524
+ coupon: C,
525
+ promotionValue: u?.value,
526
+ isPriceDropped: r.is_price_dropped
474
527
  }
475
528
  ) })
476
529
  ] }),
477
530
  /* @__PURE__ */ h("footer", { className: _.footer, children: [
478
- /* @__PURE__ */ n("div", { className: _.priceSection, children: /* @__PURE__ */ n(Pn, { price: a, discounts: s }) }),
479
- /* @__PURE__ */ n("h4", { className: _.brand, children: o }),
480
- /* @__PURE__ */ n(wn, { title: t }),
481
- g && /* @__PURE__ */ n(Tn, { value: g.value, language: l })
531
+ /* @__PURE__ */ t("div", { className: _.priceSection, children: /* @__PURE__ */ t($e, { price: r, discounts: s }) }),
532
+ g ? /* @__PURE__ */ t(y, { className: _.myloSkeleton }) : We(r.final) >= Re && /* @__PURE__ */ h("div", { className: _.myloContainer, children: [
533
+ /* @__PURE__ */ t("p", { className: _.myloText, children: f }),
534
+ /* @__PURE__ */ t(
535
+ N,
536
+ {
537
+ className: _.myloIcon,
538
+ src: c === "en" ? Oe : He,
539
+ alt: "mylo"
540
+ }
541
+ )
542
+ ] }),
543
+ /* @__PURE__ */ t("h4", { className: _.brand, children: o }),
544
+ /* @__PURE__ */ t(Ae, { title: n }),
545
+ C && /* @__PURE__ */ t(Ie, { value: C.value, language: c })
482
546
  ] })
483
547
  ] }, e);
484
548
  }
485
- function $n({
549
+ function Ue({
486
550
  slidesToScroll: e,
487
- products: t,
551
+ products: n,
488
552
  onProductClick: o,
489
- language: r
553
+ language: a
490
554
  }) {
491
- const [a, s] = T(), [l, u] = T(0), [d, g] = T(0), [i, m] = T(!1), [C, v] = T(!1);
492
- return P(() => {
493
- if (!a)
555
+ const [r, s] = k(), [c, d] = k(0), [u, C] = k(0), [i, m] = k(!1), [g, f] = k(!1);
556
+ return T(() => {
557
+ if (!r)
494
558
  return;
495
559
  const p = () => {
496
- g(a.scrollSnapList().length), u(a.selectedScrollSnap()), m(a.canScrollPrev()), v(a.canScrollNext());
560
+ C(r.scrollSnapList().length), d(r.selectedScrollSnap()), m(r.canScrollPrev()), f(r.canScrollNext());
497
561
  };
498
- return p(), a.on("select", p), a.on("reInit", p), () => {
499
- a.off("select", p), a.off("reInit", p);
562
+ return p(), r.on("select", p), r.on("reInit", p), () => {
563
+ r.off("select", p), r.off("reInit", p);
500
564
  };
501
- }, [a]), /* @__PURE__ */ h("div", { className: _.container, children: [
565
+ }, [r]), /* @__PURE__ */ h("div", { className: _.container, children: [
502
566
  /* @__PURE__ */ h(
503
- F,
567
+ Q,
504
568
  {
505
569
  opts: {
506
570
  align: "start",
507
571
  slidesToScroll: e ?? 1,
508
- direction: r === "ar" ? "rtl" : "ltr"
572
+ direction: a === "ar" ? "rtl" : "ltr"
509
573
  },
510
574
  setApi: s,
511
575
  className: _.carousel,
512
576
  children: [
513
- /* @__PURE__ */ n(q, { className: _.carouselContent, children: t.map((p, S) => /* @__PURE__ */ n(
514
- j,
577
+ /* @__PURE__ */ t(j, { className: _.carouselContent, children: n.map((p, v) => /* @__PURE__ */ t(
578
+ K,
515
579
  {
516
580
  className: _.carouselItem,
517
- onClick: () => o(p, S),
518
- children: /* @__PURE__ */ n(
519
- Bn,
581
+ onClick: () => o(p, v),
582
+ children: /* @__PURE__ */ t(
583
+ Ge,
520
584
  {
521
585
  id: p.offering_id,
522
586
  brand: p.brand,
@@ -524,21 +588,21 @@ function $n({
524
588
  price: p.price,
525
589
  title: p.title,
526
590
  discounts: p.discounts,
527
- language: r
591
+ language: a
528
592
  }
529
593
  )
530
594
  },
531
- `${p.offering_id}-${S}`
595
+ `${p.offering_id}-${v}`
532
596
  )) }),
533
- i && /* @__PURE__ */ n(
534
- Z,
597
+ i && /* @__PURE__ */ t(
598
+ q,
535
599
  {
536
600
  className: _.navButtonPrev,
537
601
  iconClassName: _.navButtonPrevIcon
538
602
  }
539
603
  ),
540
- C && /* @__PURE__ */ n(
541
- H,
604
+ g && /* @__PURE__ */ t(
605
+ z,
542
606
  {
543
607
  className: _.navButtonNext,
544
608
  iconClassName: _.navButtonNextIcon
@@ -547,12 +611,12 @@ function $n({
547
611
  ]
548
612
  }
549
613
  ),
550
- /* @__PURE__ */ n(
551
- z,
614
+ /* @__PURE__ */ t(
615
+ J,
552
616
  {
553
- slidesCount: d,
554
- currentIndex: l,
555
- onClick: (p) => a?.scrollTo(p),
617
+ slidesCount: u,
618
+ currentIndex: c,
619
+ onClick: (p) => r?.scrollTo(p),
556
620
  showProgress: !1,
557
621
  containerClassName: _.paginationContainer,
558
622
  buttonClassName: _.paginationButton,
@@ -562,7 +626,7 @@ function $n({
562
626
  )
563
627
  ] });
564
628
  }
565
- const An = (e) => ({
629
+ const Ye = (e) => ({
566
630
  type: "single product",
567
631
  val: [e.offering_id],
568
632
  filters: [
@@ -571,348 +635,348 @@ const An = (e) => ({
571
635
  value: [e.slug]
572
636
  }
573
637
  ]
574
- }), In = async ({
638
+ }), Ze = async ({
575
639
  language: e,
576
- collectionId: t,
640
+ collectionId: n,
577
641
  environment: o,
578
- adServerApiKey: r
642
+ adServerApiKey: a
579
643
  }) => {
580
- const [a, s] = await L(r), l = W("adServer", o);
644
+ const [r, s] = await H(a), c = V("adServer", o);
581
645
  try {
582
646
  return (await (await fetch(
583
- `${l}/api/v2/brandshop/server/collection/${t}`,
647
+ `${c}/api/v2/brandshop/server/collection/${n}`,
584
648
  {
585
649
  headers: {
586
650
  lang: e,
587
651
  device: "web",
588
- "auth-token": a,
652
+ "auth-token": r,
589
653
  "auth-timestamp": s,
590
654
  "accept-language": e
591
655
  }
592
656
  }
593
657
  )).json()).data;
594
- } catch (u) {
595
- throw new Error(`Failed to fetch collection data - ${u}`);
658
+ } catch (d) {
659
+ throw new Error(`Failed to fetch collection data - ${d}`);
596
660
  }
597
- }, En = "collection", On = ({
661
+ }, Fe = "collection", Qe = ({
598
662
  language: e,
599
- collectionId: t,
663
+ collectionId: n,
600
664
  environment: o,
601
- adServerApiKey: r
602
- }) => G({
603
- queryKey: [En, t, e],
604
- queryFn: () => In({
665
+ adServerApiKey: a
666
+ }) => W({
667
+ queryKey: [Fe, n, e],
668
+ queryFn: () => Ze({
605
669
  language: e,
606
- collectionId: t,
670
+ collectionId: n,
607
671
  environment: o,
608
- adServerApiKey: r
672
+ adServerApiKey: a
609
673
  })
610
- }), Dn = "_card_15xcs_1", Ln = "_imageSkeleton_15xcs_17", Wn = "_titleSkeleton_15xcs_19", Gn = "_descriptionSkeleton_15xcs_21", Mn = "_priceSkeleton_15xcs_23", Rn = "_buttonSkeleton_15xcs_25", y = {
611
- card: Dn,
612
- imageSkeleton: Ln,
613
- titleSkeleton: Wn,
614
- descriptionSkeleton: Gn,
615
- priceSkeleton: Mn,
616
- buttonSkeleton: Rn
617
- }, Un = (e) => {
618
- const { className: t } = e;
619
- return /* @__PURE__ */ h("div", { className: `${y.card} ${t || ""}`, children: [
620
- /* @__PURE__ */ n(k, { className: y.imageSkeleton }),
621
- /* @__PURE__ */ n(k, { className: y.titleSkeleton }),
622
- /* @__PURE__ */ n(k, { className: y.descriptionSkeleton }),
623
- /* @__PURE__ */ n(k, { className: y.priceSkeleton }),
624
- /* @__PURE__ */ n(k, { className: y.buttonSkeleton })
674
+ }), 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 = {
675
+ card: je,
676
+ imageSkeleton: Ke,
677
+ titleSkeleton: qe,
678
+ descriptionSkeleton: ze,
679
+ priceSkeleton: Je,
680
+ buttonSkeleton: Xe
681
+ }, en = (e) => {
682
+ const { className: n } = e;
683
+ return /* @__PURE__ */ h("div", { className: `${x.card} ${n || ""}`, children: [
684
+ /* @__PURE__ */ t(y, { className: x.imageSkeleton }),
685
+ /* @__PURE__ */ t(y, { className: x.titleSkeleton }),
686
+ /* @__PURE__ */ t(y, { className: x.descriptionSkeleton }),
687
+ /* @__PURE__ */ t(y, { className: x.priceSkeleton }),
688
+ /* @__PURE__ */ t(y, { className: x.buttonSkeleton })
625
689
  ] });
626
- }, Qn = "_container_gnnm8_1", Yn = "_header_gnnm8_13", Kn = "_titleSkeleton_gnnm8_27", Vn = "_carouselWrapper_gnnm8_37", Fn = "_carouselContainer_gnnm8_49", qn = "_cardWrapper_gnnm8_67", x = {
627
- container: Qn,
628
- header: Yn,
629
- titleSkeleton: Kn,
630
- carouselWrapper: Vn,
631
- carouselContainer: Fn,
632
- cardWrapper: qn
633
- }, jn = (e) => {
634
- const { length: t } = e, o = t ?? 5;
635
- return /* @__PURE__ */ h("div", { className: x.container, children: [
636
- /* @__PURE__ */ n("div", { className: x.header, children: /* @__PURE__ */ n(k, { className: x.titleSkeleton }) }),
637
- /* @__PURE__ */ n("div", { className: x.carouselWrapper, children: /* @__PURE__ */ n("div", { className: x.carouselContainer, children: Array.from({ length: o }, (r, a) => /* @__PURE__ */ n("div", { className: x.cardWrapper, children: /* @__PURE__ */ n(Un, {}) }, a)) }) })
690
+ }, 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 = {
691
+ container: nn,
692
+ header: tn,
693
+ titleSkeleton: on,
694
+ carouselWrapper: rn,
695
+ carouselContainer: an,
696
+ cardWrapper: sn
697
+ }, cn = (e) => {
698
+ const { length: n } = e, o = n ?? 5;
699
+ return /* @__PURE__ */ h("div", { className: w.container, children: [
700
+ /* @__PURE__ */ t("div", { className: w.header, children: /* @__PURE__ */ t(y, { className: w.titleSkeleton }) }),
701
+ /* @__PURE__ */ t("div", { className: w.carouselWrapper, children: /* @__PURE__ */ t("div", { className: w.carouselContainer, children: Array.from({ length: o }, (a, r) => /* @__PURE__ */ t("div", { className: w.cardWrapper, children: /* @__PURE__ */ t(en, {}) }, r)) }) })
638
702
  ] });
639
703
  };
640
- function Zn({
704
+ function ln({
641
705
  products: e,
642
- title: t,
706
+ title: n,
643
707
  hideTitle: o,
644
- isLoggedin: r,
645
- language: a,
708
+ isLoggedin: a,
709
+ language: r,
646
710
  environment: s,
647
- adServerApiKey: l,
648
- trackBrandshopHandler: u,
649
- onProductClick: d
711
+ adServerApiKey: c,
712
+ trackBrandshopHandler: d,
713
+ onProductClick: u
650
714
  }) {
651
- const { data: g, isLoading: i, error: m } = On({
652
- language: a,
715
+ const { data: C, isLoading: i, error: m } = Qe({
716
+ language: r,
653
717
  collectionId: e.collection_id ?? "",
654
718
  environment: s,
655
- adServerApiKey: l
656
- }), C = (v, p) => {
657
- N(
719
+ adServerApiKey: c
720
+ }), g = (f, p) => {
721
+ b(
658
722
  "ads_bs_content_click",
659
723
  {
660
- contentName: v.title,
724
+ contentName: f.title,
661
725
  contentOrder: (p + 1).toString(),
662
- userStatus: r ? "logged_in" : "guest",
726
+ userStatus: a ? "logged_in" : "guest",
663
727
  platform: "Web"
664
728
  },
665
- u
729
+ d
666
730
  );
667
- const S = An(v), b = B(S);
668
- b && d(b);
731
+ const v = Ye(f), S = B(v);
732
+ S && u(S);
669
733
  };
670
- return i ? /* @__PURE__ */ n(jn, {}) : m || !g ? null : /* @__PURE__ */ h("div", { className: c.sectionContainer, children: [
671
- !o && /* @__PURE__ */ n("h2", { className: c.sectionTitle, children: t }),
672
- /* @__PURE__ */ n(
673
- $n,
734
+ return i ? /* @__PURE__ */ t(cn, {}) : m || !C ? null : /* @__PURE__ */ h("div", { className: l.sectionContainer, children: [
735
+ !o && /* @__PURE__ */ t("h2", { className: l.sectionTitle, children: n }),
736
+ /* @__PURE__ */ t(
737
+ Ue,
674
738
  {
675
- products: g.items,
676
- onProductClick: (v, p) => C(v, p),
677
- language: a
739
+ products: C.items,
740
+ onProductClick: (f, p) => g(f, p),
741
+ language: r
678
742
  }
679
743
  )
680
744
  ] });
681
745
  }
682
- const Hn = ({
746
+ const _n = ({
683
747
  section: e,
684
- onLinkClick: t,
748
+ onLinkClick: n,
685
749
  trackBrandshopHandler: o,
686
- isLoggedin: r,
687
- brandName: a,
750
+ isLoggedin: a,
751
+ brandName: r,
688
752
  language: s,
689
- environment: l,
690
- adServerApiKey: u,
691
- brandshopName: d
753
+ environment: c,
754
+ adServerApiKey: d,
755
+ brandshopName: u
692
756
  }) => {
693
757
  const {
694
- section_type: g,
758
+ section_type: C,
695
759
  section_title: i,
696
760
  show_section_title: m,
697
- data: C,
698
- section_display_order: v
699
- } = e, { ref: p } = J({
700
- onChange: (S) => {
701
- S && N(
761
+ data: g,
762
+ section_display_order: f
763
+ } = e, { ref: p } = X({
764
+ onChange: (v) => {
765
+ v && b(
702
766
  "ads_bs_section_view",
703
767
  {
704
- brandName: a,
768
+ brandName: r,
705
769
  sectionName: i,
706
- sectionOrder: v.toString(),
707
- userStatus: r ? "logged_in" : "guest",
770
+ sectionOrder: f.toString(),
771
+ userStatus: a ? "logged_in" : "guest",
708
772
  platform: "Web"
709
773
  },
710
774
  o
711
775
  );
712
776
  }
713
777
  });
714
- return /* @__PURE__ */ n("div", { ref: p, style: { width: "100%" }, children: (() => {
715
- switch (g) {
778
+ return /* @__PURE__ */ t("div", { ref: p, style: { width: "100%" }, children: (() => {
779
+ switch (C) {
716
780
  case "nav":
717
- return /* @__PURE__ */ n(
718
- Re,
781
+ return /* @__PURE__ */ t(
782
+ R2,
719
783
  {
720
784
  title: i,
721
785
  hideTitle: !m,
722
- logo: C[0].logo ?? "",
723
- navigationLinks: C[0].navigation_links ?? [],
724
- onLinkClick: t,
725
- isLoggedin: r,
786
+ logo: g[0].logo ?? "",
787
+ navigationLinks: g[0].navigation_links ?? [],
788
+ onLinkClick: n,
789
+ isLoggedin: a,
726
790
  trackBrandshopHandler: o,
727
- brandshopName: d
791
+ brandshopName: u
728
792
  }
729
793
  );
730
794
  case "category":
731
- return /* @__PURE__ */ n(
732
- Me,
795
+ return /* @__PURE__ */ t(
796
+ W2,
733
797
  {
734
798
  title: i,
735
799
  hideTitle: !m,
736
- categories: C,
737
- onCategoryClick: t,
738
- isLoggedin: r,
800
+ categories: g,
801
+ onCategoryClick: n,
802
+ isLoggedin: a,
739
803
  trackBrandshopHandler: o
740
804
  }
741
805
  );
742
806
  case "banner":
743
- return /* @__PURE__ */ n(
744
- Ge,
807
+ return /* @__PURE__ */ t(
808
+ V2,
745
809
  {
746
810
  title: i,
747
- banners: C,
811
+ banners: g,
748
812
  hideTitle: !m,
749
- onBannerClick: t,
750
- isLoggedin: r,
813
+ onBannerClick: n,
814
+ isLoggedin: a,
751
815
  sectionTitle: i,
752
816
  trackBrandshopHandler: o
753
817
  }
754
818
  );
755
819
  case "productSlider":
756
- return /* @__PURE__ */ n(
757
- Zn,
820
+ return /* @__PURE__ */ t(
821
+ ln,
758
822
  {
759
- products: C[0],
823
+ products: g[0],
760
824
  title: i,
761
825
  hideTitle: !m,
762
- isLoggedin: r,
826
+ isLoggedin: a,
763
827
  trackBrandshopHandler: o,
764
- onProductClick: t,
828
+ onProductClick: n,
765
829
  language: s,
766
- environment: l,
767
- adServerApiKey: u
830
+ environment: c,
831
+ adServerApiKey: d
768
832
  }
769
833
  );
770
834
  default:
771
835
  return null;
772
836
  }
773
837
  })() });
774
- }, zn = (e, t) => {
838
+ }, dn = (e, n) => {
775
839
  let o;
776
- return (...r) => {
840
+ return (...a) => {
777
841
  clearTimeout(o), o = setTimeout(() => {
778
- e(...r);
779
- }, t);
842
+ e(...a);
843
+ }, n);
780
844
  };
781
845
  };
782
- function Jn(e = 5) {
783
- const [t, o] = T(!1);
784
- return P(() => {
785
- const a = zn(() => {
786
- const s = window.scrollY || document.documentElement.scrollTop, l = window.innerHeight, u = document.documentElement.scrollHeight, d = s + l >= u - e;
787
- o(d);
846
+ function un(e = 5) {
847
+ const [n, o] = k(!1);
848
+ return T(() => {
849
+ const r = dn(() => {
850
+ const s = window.scrollY || document.documentElement.scrollTop, c = window.innerHeight, d = document.documentElement.scrollHeight, u = s + c >= d - e;
851
+ o(u);
788
852
  }, 100);
789
- return window.addEventListener("scroll", a, { passive: !0 }), a(), () => {
790
- window.removeEventListener("scroll", a);
853
+ return window.addEventListener("scroll", r, { passive: !0 }), r(), () => {
854
+ window.removeEventListener("scroll", r);
791
855
  };
792
- }, [e]), t;
856
+ }, [e]), n;
793
857
  }
794
- function Xn() {
795
- return /* @__PURE__ */ h("div", { className: c.brandshopContainerSkeleton, children: [
796
- /* @__PURE__ */ n(k, { className: c.bannerSkeleton }),
797
- /* @__PURE__ */ n("div", { className: c.navContainerSkeleton, children: Array.from({ length: 3 }).map((o, r) => /* @__PURE__ */ n(k, { className: c.navPillSkeleton }, r)) }),
798
- /* @__PURE__ */ n(
858
+ function mn() {
859
+ return /* @__PURE__ */ h("div", { className: l.brandshopContainerSkeleton, children: [
860
+ /* @__PURE__ */ t(y, { className: l.bannerSkeleton }),
861
+ /* @__PURE__ */ t("div", { className: l.navContainerSkeleton, children: Array.from({ length: 3 }).map((o, a) => /* @__PURE__ */ t(y, { className: l.navPillSkeleton }, a)) }),
862
+ /* @__PURE__ */ t(
799
863
  "div",
800
864
  {
801
- className: c.categoryGridSkeleton,
865
+ className: l.categoryGridSkeleton,
802
866
  style: {
803
867
  gridTemplateColumns: `repeat(${Math.min(2, 2)}, 1fr)`
804
868
  },
805
- children: Array.from({ length: 2 }).map((o, r) => /* @__PURE__ */ n(k, { className: c.categoryTileSkeleton }, r))
869
+ children: Array.from({ length: 2 }).map((o, a) => /* @__PURE__ */ t(y, { className: l.categoryTileSkeleton }, a))
806
870
  }
807
871
  ),
808
- /* @__PURE__ */ n(k, { className: c.promoSkeleton })
872
+ /* @__PURE__ */ t(y, { className: l.promoSkeleton })
809
873
  ] });
810
874
  }
811
- function et({
875
+ function pn({
812
876
  language: e,
813
- brandshopId: t,
877
+ brandshopId: n,
814
878
  environment: o,
815
- adServerApiKey: r,
816
- isLoggedin: a,
879
+ adServerApiKey: a,
880
+ isLoggedin: r,
817
881
  brandshop: s,
818
- onLinkClick: l,
819
- trackBrandshopHandler: u
882
+ onLinkClick: c,
883
+ trackBrandshopHandler: d
820
884
  }) {
821
- const { isLaptop: d, isDesktop: g } = X(), i = d || g ? O.Web : O.Mobile;
885
+ const { isLaptop: u, isDesktop: C } = e2(), i = u || C ? L.Web : L.Mobile;
822
886
  let m = s;
823
887
  const {
824
- data: C,
825
- isLoading: v,
888
+ data: g,
889
+ isLoading: f,
826
890
  error: p
827
- } = te({
891
+ } = o2({
828
892
  language: e,
829
- brandshopId: t,
893
+ brandshopId: n,
830
894
  environment: o,
831
- adServerApiKey: r,
895
+ adServerApiKey: a,
832
896
  deviceType: i,
833
897
  enabled: !s
834
898
  });
835
- m ??= C;
836
- const S = Jn(), b = m?.name || "", A = a ? "logged_in" : "guest", I = "Web";
837
- if (P(() => {
899
+ m ??= g;
900
+ const v = un(), S = m?.name || "", D = r ? "logged_in" : "guest", M = "Web";
901
+ if (T(() => {
838
902
  window.scrollTo(0, 0);
839
- }, []), P(() => {
840
- m && N(
903
+ }, []), T(() => {
904
+ m && b(
841
905
  "ads_bs_pageload",
842
- { brandName: b, userStatus: A, platform: I },
843
- u
906
+ { brandName: S, userStatus: D, platform: M },
907
+ d
844
908
  );
845
- }, [m]), P(() => {
846
- !m || !S || N(
909
+ }, [m]), T(() => {
910
+ !m || !v || b(
847
911
  "ads_bs_pageend",
848
- { brandName: b, userStatus: A, platform: I },
849
- u
912
+ { brandName: S, userStatus: D, platform: M },
913
+ d
850
914
  );
851
- }, [S]), v) return /* @__PURE__ */ n(Xn, {});
915
+ }, [v]), f) return /* @__PURE__ */ t(mn, {});
852
916
  if (p)
853
917
  throw new Error(
854
- `brandshop with id ${t} failed to load} - ${p?.message || "unknown error"}`
918
+ `brandshop with id ${n} failed to load} - ${p?.message || "unknown error"}`
855
919
  );
856
920
  const E = m?.content;
857
921
  if (!Array.isArray(E)) return null;
858
- const Q = [...E].sort(
859
- (w, Y) => w.section_display_order - Y.section_display_order
922
+ const U = [...E].sort(
923
+ (P, Y) => P.section_display_order - Y.section_display_order
860
924
  );
861
- return /* @__PURE__ */ n("div", { className: c.brandshopContent, children: Q.map((w) => /* @__PURE__ */ n(
862
- Hn,
925
+ return /* @__PURE__ */ t("div", { className: l.brandshopContent, children: U.map((P) => /* @__PURE__ */ t(
926
+ _n,
863
927
  {
864
- section: w,
865
- onLinkClick: l,
866
- isLoggedin: a,
867
- brandName: b,
868
- trackBrandshopHandler: u,
928
+ section: P,
929
+ onLinkClick: c,
930
+ isLoggedin: r,
931
+ brandName: S,
932
+ trackBrandshopHandler: d,
869
933
  language: e,
870
934
  environment: o,
871
- adServerApiKey: r,
935
+ adServerApiKey: a,
872
936
  brandshopName: m?.name
873
937
  },
874
- w.tracking_id
938
+ P.tracking_id
875
939
  )) });
876
940
  }
877
- const nt = "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";
878
- function tt({ language: e }) {
879
- const t = e === "ar", o = t ? "حدث خطأ ما" : "Something went wrong", r = t ? "نواجه مشكلة في تحميل هذه الصفحة. يرجى الانتظار قليلاً؛ سيتم حلها قريباً." : "We're having trouble loading this page. Please bear with us; it should be resolved shortly.", a = t ? "إعادة المحاولة" : "Try again";
880
- return /* @__PURE__ */ h("div", { className: c.brandshopError, children: [
881
- /* @__PURE__ */ n(f, { src: nt, className: c.errorIcon, alt: "error" }),
882
- /* @__PURE__ */ h("div", { className: c.errorContent, children: [
883
- /* @__PURE__ */ h("div", { className: c.errorText, children: [
884
- /* @__PURE__ */ n("h2", { children: o }),
885
- /* @__PURE__ */ n("p", { children: r })
941
+ 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";
942
+ function Cn({ language: e }) {
943
+ const n = e === "ar", o = 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";
944
+ return /* @__PURE__ */ h("div", { className: l.brandshopError, children: [
945
+ /* @__PURE__ */ t(N, { src: hn, className: l.errorIcon, alt: "error" }),
946
+ /* @__PURE__ */ h("div", { className: l.errorContent, children: [
947
+ /* @__PURE__ */ h("div", { className: l.errorText, children: [
948
+ /* @__PURE__ */ t("h2", { children: o }),
949
+ /* @__PURE__ */ t("p", { children: a })
886
950
  ] }),
887
- /* @__PURE__ */ n(
951
+ /* @__PURE__ */ t(
888
952
  "button",
889
953
  {
890
- className: c.errorButton,
954
+ className: l.errorButton,
891
955
  onClick: () => window.location.reload(),
892
- children: a
956
+ children: r
893
957
  }
894
958
  )
895
959
  ] })
896
960
  ] });
897
961
  }
898
- class ot extends V {
899
- constructor(t) {
900
- super(t), this.state = { hasError: !1, error: null, errorInfo: null };
962
+ class gn extends F {
963
+ constructor(n) {
964
+ super(n), this.state = { hasError: !1, error: null, errorInfo: null };
901
965
  }
902
- static getDerivedStateFromError(t) {
903
- return { hasError: !0, error: t, errorInfo: null };
966
+ static getDerivedStateFromError(n) {
967
+ return { hasError: !0, error: n, errorInfo: null };
904
968
  }
905
- componentDidCatch(t, o) {
906
- this.setState({ error: t, errorInfo: o });
969
+ componentDidCatch(n, o) {
970
+ this.setState({ error: n, errorInfo: o });
907
971
  }
908
972
  render() {
909
973
  return this.state.hasError ? this.props.fallback : this.props.children;
910
974
  }
911
975
  }
912
- function lt(e) {
913
- return /* @__PURE__ */ n(K, { children: /* @__PURE__ */ n(ot, { fallback: /* @__PURE__ */ n(tt, { language: e.language }), children: /* @__PURE__ */ n(et, { ...e }) }) });
976
+ function bn(e) {
977
+ return /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(gn, { fallback: /* @__PURE__ */ t(Cn, { language: e.language }), children: /* @__PURE__ */ t(pn, { ...e }) }) });
914
978
  }
915
979
  export {
916
- lt as Brandshop
980
+ bn as Brandshop
917
981
  };
918
982
  //# sourceMappingURL=Brandshop.js.map