@everymatrix/loyalty-shop 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/components/LoyaltyPagination-B2XwqERr.cjs +14 -0
  2. package/components/LoyaltyPagination-B8amLojn.cjs +14 -0
  3. package/components/{LoyaltyPagination-CvGlrsHL.js → LoyaltyPagination-BqHc2i2H.js} +2841 -2576
  4. package/components/LoyaltyPagination-DOu-qNFO.js +7260 -0
  5. package/components/LoyaltyPointsCard-BjF9SVWO.js +249 -0
  6. package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +18 -0
  7. package/components/{LoyaltyPointsCard-4xMK1Yj3.js → LoyaltyPointsCard-DKq6yH_i.js} +60 -59
  8. package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +18 -0
  9. package/components/{LoyaltyShop-BolB3kh1.js → LoyaltyShop-CBH93UYT.js} +168 -169
  10. package/components/LoyaltyShop-CCeVtHJ7.cjs +27 -0
  11. package/components/LoyaltyShop-CnX4zXMd.cjs +27 -0
  12. package/components/LoyaltyShop-aSar2Vkc.js +478 -0
  13. package/components/LoyaltyShopItem-BvxV4bEm.cjs +5 -0
  14. package/components/LoyaltyShopItem-CYoPPSZj.cjs +5 -0
  15. package/components/{LoyaltyShopItem-BF51hsPa.js → LoyaltyShopItem-DL7R43c_.js} +115 -109
  16. package/components/LoyaltyShopItem-bzNnPlQa.js +353 -0
  17. package/es2015/loyalty-shop.cjs +1 -0
  18. package/es2015/loyalty-shop.js +28 -0
  19. package/esnext/loyalty-shop.cjs +1 -1
  20. package/esnext/loyalty-shop.js +7 -2
  21. package/package.json +10 -4
  22. package/components/LoyaltyPagination-BfDVbl1b.js +0 -138
  23. package/components/LoyaltyPagination-BqAUwwMS.cjs +0 -16
  24. package/components/LoyaltyPagination-Ct4i2m7L.cjs +0 -12
  25. package/components/LoyaltyPagination-UwvULUW0.js +0 -137
  26. package/components/LoyaltyPointsCard-Cqwkhg0M.cjs +0 -18
  27. package/components/LoyaltyShop-B-D5synj.js +0 -6724
  28. package/components/LoyaltyShop-CIrwO8kv.cjs +0 -31
  29. package/components/LoyaltyShop-ChhuDPwH.js +0 -6624
  30. package/components/LoyaltyShop-DLj15-su.cjs +0 -27
  31. package/components/LoyaltyShopItem-lB3kVETK.cjs +0 -5
@@ -1,18 +1,23 @@
1
- import { y as Ke, c as pe, p as me, a as He, b as h, s as Fe, d as ae, z as f, A as oe, O as ie, C as M, m as t, E as r, B as Je, G as re, S as We, i as X, h as x, j as ge, P as R, Q as Ye, u as le, H as Ze, I as Ge, J as Qe, K as Xe, v as q, k as v, l as $e, n as E, r as b, R as de, T as et, t as ue, q as V, g as tt, o as z, w as nt, $ as st, U as at, N as ce, L as $, V as ot, W as it, M as rt, X as lt } from "./LoyaltyPagination-CvGlrsHL.js";
2
- import { L as dt } from "./LoyaltyShopItem-BF51hsPa.js";
1
+ import { z as Ke, c as me, p as ge, a as Fe, b as h, s as Ze, d as ae, A as f, B as oe, P as le, E as N, m as t, F as i, C as Je, H as ie, S as We, i as G, h as w, j as fe, Q as C, R as Ye, u as re, I as Ge, J as Qe, K as Xe, L as $e, w as x, k as y, l as et, n as de, r as D, T as ue, U as tt, o as T, t as ce, v as j, g as nt, q as M, x as st, $ as at, V as ot, O as pe, M as Q, W as lt, X as it, N as rt, Y as dt } from "./LoyaltyPagination-BqHc2i2H.js";
2
+ import { L as ut } from "./LoyaltyShopItem-DL7R43c_.js";
3
+ typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
+ }, globalThis.customElements = { define() {
5
+ }, get() {
6
+ }, whenDefined() {
7
+ } });
3
8
  if (typeof window < "u") {
4
- let _ = function(n) {
9
+ let b = function(n) {
5
10
  return function(...o) {
6
11
  try {
7
12
  return n.apply(this, o);
8
- } catch (i) {
9
- if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i instanceof Error && i.message.includes("Cannot define multiple custom elements with the same tag name"))
13
+ } catch (l) {
14
+ if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l instanceof Error && l.message.includes("Cannot define multiple custom elements with the same tag name"))
10
15
  return !1;
11
- throw i;
16
+ throw l;
12
17
  }
13
18
  };
14
19
  };
15
- customElements.define = _(customElements.define), import("./LoyaltyPagination-CvGlrsHL.js").then((n) => n.Y).then((n) => {
20
+ customElements.define = b(customElements.define), import("./LoyaltyPagination-BqHc2i2H.js").then((n) => n.Z).then((n) => {
16
21
  const o = n.default || n;
17
22
  customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", o.element || o);
18
23
  }).catch((n) => {
@@ -20,25 +25,25 @@ if (typeof window < "u") {
20
25
  });
21
26
  }
22
27
  if (typeof window < "u") {
23
- let _ = function(n) {
28
+ let b = function(n) {
24
29
  return function(...o) {
25
30
  try {
26
31
  return n.apply(this, o);
27
- } catch (i) {
28
- if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i instanceof Error && i.message.includes("Cannot define multiple custom elements with the same tag name"))
32
+ } catch (l) {
33
+ if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l instanceof Error && l.message.includes("Cannot define multiple custom elements with the same tag name"))
29
34
  return !1;
30
- throw i;
35
+ throw l;
31
36
  }
32
37
  };
33
38
  };
34
- customElements.define = _(customElements.define), import("./LoyaltyShopItem-BF51hsPa.js").then((n) => n.a).then((n) => {
39
+ customElements.define = b(customElements.define), import("./LoyaltyShopItem-DL7R43c_.js").then((n) => n.a).then((n) => {
35
40
  const o = n.default || n;
36
41
  customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", o.element || o);
37
42
  }).catch((n) => {
38
43
  console.error("BOOT ERROR:", n);
39
44
  });
40
45
  }
41
- const ut = {
46
+ const ct = {
42
47
  en: {
43
48
  loading: "Loading…",
44
49
  noContent: "There are no bonus items available for redemption.",
@@ -95,9 +100,9 @@ const ut = {
95
100
  buyNow: "Vásárlás",
96
101
  generalError: "Hiba történt. Kérjük, próbáld újra."
97
102
  }
98
- }, ct = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";
99
- var pt = q('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'), mt = q('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), gt = q('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), ft = q('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'), ht = q('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), vt = q('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), yt = q('<div class="loyalty-shop svelte-1f1q033"><!></div>');
100
- const bt = {
103
+ }, pt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";
104
+ var mt = x('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'), gt = x('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), ft = x('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), ht = x('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'), yt = x('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), vt = x('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), bt = x('<div class="loyalty-shop svelte-1f1q033"><!></div>');
105
+ const _t = {
101
106
  hash: "svelte-1f1q033",
102
107
  code: `.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
103
108
  90deg,
@@ -126,149 +131,151 @@ const bt = {
126
131
  @media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
127
132
  }`
128
133
  };
129
- function fe(_, n) {
130
- me(n, !0), He(_, bt);
131
- const o = () => nt(st, "$_", i), [i, L] = $e(), c = h(n, "apiEndpoint", 7, ""), p = h(n, "userSession", 7, ""), y = h(n, "locale", 7, ""), l = h(n, "limitItem", 7, R), P = h(n, "translationUrl");
132
- Fe({ withLocale: y(), translations: {} });
134
+ function he(b, n) {
135
+ ge(n, !0), Fe(b, _t);
136
+ const o = () => st(at, "$_", l), [l, R] = et(), c = h(n, "apiEndpoint", 7, ""), p = h(n, "userSession", 7, ""), v = h(n, "locale", 7, ""), r = h(n, "limitItem", 7, C), O = h(n, "translationUrl");
137
+ Ze({ withLocale: v(), translations: {} });
133
138
  const ve = async () => {
134
139
  try {
135
- const e = new URL(P(), window.location.href), s = await fetch(e.href);
140
+ const e = new URL(O(), window.location.href), s = await fetch(e.href);
136
141
  if (!s.ok)
137
142
  throw new Error("Failed to fetch translations");
138
143
  const a = await s.json();
139
- Object.entries(a).forEach(([d, I]) => {
140
- ae(d, I);
144
+ Object.entries(a).forEach(([d, S]) => {
145
+ ae(d, S);
141
146
  });
142
147
  } catch (e) {
143
148
  console.error("loyalty shop translation url err:", e);
144
149
  }
145
150
  };
146
- Object.entries(ut).forEach(([e, s]) => {
151
+ Object.entries(ct).forEach(([e, s]) => {
147
152
  ae(e, s);
148
153
  });
149
- let g = f(oe([])), N = f(void 0), U = f(0), k = f(0), S = f(oe(ie)), K = f(!1), H = f(!1), O = f(void 0), w = f(!1), B = f(void 0), A = 0;
150
- const ye = le(() => typeof l() == "number" ? l() : parseInt(l(), R) || R), ee = () => {
154
+ let g = f(oe([])), E = f(void 0), z = f(0), _ = f(0), q = f(oe(le)), V = f(!1), H = f(!1), L = f(void 0), k = f(!1), P = f(void 0), U = 0;
155
+ const be = re(() => typeof r() == "number" ? r() : parseInt(r(), C) || C), X = () => {
151
156
  if (!c() || !p())
152
157
  return;
153
- r(K, !0), r(H, !1);
154
- const e = ++A, s = t(w) && t(k) > 0;
158
+ i(V, !0), i(H, !1);
159
+ const e = ++U, s = t(k) && t(_) > 0;
155
160
  Ye(
156
161
  {
157
162
  apiEndpoint: c(),
158
163
  userSession: p(),
159
- locale: y()
164
+ locale: v()
160
165
  },
161
- t(k),
162
- t(S)
166
+ t(_),
167
+ t(q)
163
168
  ).then((a) => {
164
- if (e !== A)
169
+ if (e !== U)
165
170
  return;
166
171
  const d = a.data ?? [];
167
- r(U, a.total ?? 0, !0), s ? r(g, [...t(g), ...d], !0) : r(g, d, !0);
172
+ i(z, a.total ?? 0, !0), s ? i(g, [...t(g), ...d], !0) : i(g, d, !0);
168
173
  }).catch((a) => {
169
- e === A && (r(H, !0), console.error("Failed to load shop rewards:", a));
174
+ e === U && (i(H, !0), console.error("Failed to load shop rewards:", a));
170
175
  }).finally(() => {
171
- e === A && r(K, !1);
176
+ e === U && i(V, !1);
172
177
  });
173
178
  };
174
- M(() => {
175
- c(), p(), y(), t(k), t(S), ee();
176
- }), M(() => {
179
+ N(() => {
180
+ c(), p(), v(), t(_), t(q), X();
181
+ }), N(() => {
177
182
  const e = window.matchMedia("(max-width: 767px)"), s = (a) => {
178
- r(w, a.matches, !0);
183
+ i(k, a.matches, !0);
179
184
  };
180
- return r(w, e.matches, !0), e.addEventListener("change", s), () => e.removeEventListener("change", s);
181
- }), M(() => {
182
- r(S, t(w) ? ie : t(ye), !0);
183
- }), M(() => {
184
- if (!t(w) || !t(B)) return;
185
+ return i(k, e.matches, !0), e.addEventListener("change", s), () => e.removeEventListener("change", s);
186
+ }), N(() => {
187
+ i(q, t(k) ? le : t(be), !0);
188
+ }), N(() => {
189
+ if (!t(k) || !t(P)) return;
185
190
  const e = new IntersectionObserver(
186
191
  (s) => {
187
- s.some((a) => a.isIntersecting) && t(g).length < t(U) && r(k, t(k) + t(S));
192
+ s.some((a) => a.isIntersecting) && t(g).length < t(z) && i(_, t(_) + t(q));
188
193
  },
189
194
  { rootMargin: "200px" }
190
195
  );
191
- return e.observe(t(B)), () => e.disconnect();
196
+ return e.observe(t(P)), () => e.disconnect();
192
197
  }), Je(() => {
193
- P() && ve();
198
+ O() && ve();
194
199
  });
195
- const be = (e) => e.presentation?.assets?.[0] ?? ct, F = (e) => e.displayName ?? e.presentation?.displayName ?? "", J = (e) => e.available === "true", _e = (e) => {
196
- t(O) || !J(e) || rt(F(e), e.id);
197
- }, ke = async (e) => {
198
- if (!(!c() || t(O))) {
199
- r(O, e, !0);
200
+ const _e = (e) => e.presentation?.assets?.[0] ?? pt, K = (e) => e.displayName ?? e.presentation?.displayName ?? "", F = (e) => e.available === "true", ke = (e) => {
201
+ t(L) || !F(e) || rt(K(e), e.id);
202
+ }, we = async (e) => {
203
+ if (!(!c() || t(L))) {
204
+ i(L, e, !0);
200
205
  try {
201
- await Ze({ apiEndpoint: c(), userSession: p() }, e), Ge(e), Qe(), ee();
206
+ await Ge({ apiEndpoint: c(), userSession: p() }, e), Qe(e), Xe(), X();
202
207
  } catch (s) {
203
- Xe(e, s);
208
+ $e(e, s);
204
209
  } finally {
205
- r(O, void 0);
210
+ i(L, void 0);
206
211
  }
207
212
  }
208
213
  };
209
- M(() => {
214
+ N(() => {
210
215
  const e = (s) => {
211
- const { type: a, id: d, source: I } = s.data ?? {};
216
+ const { type: a, id: d, source: S } = s.data ?? {};
212
217
  switch (a) {
213
- case re.REDEEM_REWARD_CONFIRMED:
214
- d && t(g).some((D) => D.id === d) && ke(d);
218
+ case ie.REDEEM_REWARD_CONFIRMED:
219
+ if (t(E))
220
+ break;
221
+ d && t(g).some((B) => B.id === d) && we(d);
215
222
  break;
216
- case re.BACK_BUTTON_CLICKED:
217
- I === We && r(N, void 0);
223
+ case ie.BACK_BUTTON_CLICKED:
224
+ S === We && i(E, void 0);
218
225
  break;
219
226
  }
220
227
  };
221
228
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
222
229
  });
223
- const we = () => t(g).length ? o()("generalError") : o()("noContent"), xe = (e) => {
224
- r(k, e, !0);
225
- }, Ee = (e) => {
226
- lt(e.displayName || e.presentation.displayName, e.id);
227
- }, te = (e) => {
228
- r(N, e, !0), Ee(e);
229
- }, qe = (e) => (s) => {
230
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), te(e));
230
+ const xe = () => t(g).length ? o()("generalError") : o()("noContent"), Ee = (e) => {
231
+ i(_, e, !0);
232
+ }, qe = (e) => {
233
+ dt(e.displayName || e.presentation.displayName, e.id);
234
+ }, $ = (e) => {
235
+ i(E, e, !0), qe(e);
236
+ }, Se = (e) => (s) => {
237
+ (s.key === "Enter" || s.key === " ") && (s.preventDefault(), $(e));
231
238
  };
232
- var Se = {
239
+ var Ie = {
233
240
  get apiEndpoint() {
234
241
  return c();
235
242
  },
236
243
  set apiEndpoint(e = "") {
237
- c(e), v();
244
+ c(e), y();
238
245
  },
239
246
  get userSession() {
240
247
  return p();
241
248
  },
242
249
  set userSession(e = "") {
243
- p(e), v();
250
+ p(e), y();
244
251
  },
245
252
  get locale() {
246
- return y();
253
+ return v();
247
254
  },
248
255
  set locale(e = "") {
249
- y(e), v();
256
+ v(e), y();
250
257
  },
251
258
  get limitItem() {
252
- return l();
259
+ return r();
253
260
  },
254
- set limitItem(e = R) {
255
- l(e), v();
261
+ set limitItem(e = C) {
262
+ r(e), y();
256
263
  },
257
264
  get translationUrl() {
258
- return P();
265
+ return O();
259
266
  },
260
267
  set translationUrl(e) {
261
- P(e), v();
268
+ O(e), y();
262
269
  }
263
- }, W = yt(), Ie = E(W);
270
+ }, Z = bt(), Ce = de(Z);
264
271
  {
265
- var Ce = (e) => {
266
- dt(e, {
272
+ var Re = (e) => {
273
+ ut(e, {
267
274
  get itemId() {
268
- return t(N).id;
275
+ return t(E).id;
269
276
  },
270
277
  get elevateReward() {
271
- return t(N);
278
+ return t(E);
272
279
  },
273
280
  get apiEndpoint() {
274
281
  return c();
@@ -277,96 +284,88 @@ function fe(_, n) {
277
284
  return p();
278
285
  },
279
286
  get locale() {
280
- return y();
287
+ return v();
281
288
  }
282
289
  });
283
- }, Re = (e) => {
284
- var s = mt();
285
- de(s, 21, () => Array(t(S)), et, (a, d, I, D) => {
286
- var Y = pt();
287
- x(a, Y);
288
- }), b(s), x(e, s);
289
290
  }, Le = (e) => {
290
- var s = gt(), a = E(s, !0);
291
- b(s), ue((d) => V(a, d), [we]), x(e, s);
291
+ var s = gt();
292
+ ue(s, 21, () => Array(t(q)), tt, (a, d, S, B) => {
293
+ var J = mt();
294
+ w(a, J);
295
+ }), D(s), w(e, s);
292
296
  }, Ne = (e) => {
293
- var s = vt(), a = tt(s);
294
- de(a, 21, () => t(g), (m) => m.id, (m, u) => {
295
- var C = ft();
296
- let ne;
297
- var T = E(C), Te = le(() => qe(t(u))), se = E(T);
298
- b(T);
299
- var Z = z(T, 2), Me = E(Z, !0);
300
- b(Z);
301
- var G = z(Z, 2), ze = E(G);
302
- b(G);
303
- var j = z(G, 2), Pe = E(j, !0);
304
- b(j), b(C), ue(
305
- (Q, Ue, Be, Ae, De, je, Ve) => {
306
- ne = at(C, 1, "loyalty-shop__item svelte-1f1q033", null, ne, Q), ce(se, "src", Ue), ce(se, "alt", Be), V(Me, Ae), V(ze, `${t(u).points ?? ""}
307
- ${De ?? ""}`), j.disabled = je, V(Pe, Ve);
297
+ var s = ft(), a = T(s, !0);
298
+ ce((d) => j(a, d), [() => xe()]), w(e, s);
299
+ }, Te = (e) => {
300
+ var s = vt(), a = nt(s);
301
+ ue(a, 21, () => t(g), (m) => m.id, (m, u) => {
302
+ var I = ht();
303
+ let ee;
304
+ var A = de(I), Oe = re(() => Se(t(u))), te = T(A), ne = M(A, 2), ze = T(ne, !0), se = M(ne, 2), Pe = T(se), W = M(se, 2), Ue = T(W, !0);
305
+ D(I), ce(
306
+ (Y, Be, Ae, De, je, Ve, He) => {
307
+ ee = ot(I, 1, "loyalty-shop__item svelte-1f1q033", null, ee, { "loyalty-shop__item--unavailable": Y }), pe(te, "src", Be), pe(te, "alt", Ae), j(ze, De), j(Pe, `${t(u).points ?? ""}
308
+ ${je ?? ""}`), W.disabled = Ve, j(Ue, He);
308
309
  },
309
310
  [
310
- () => ({
311
- "loyalty-shop__item--unavailable": !J(t(u))
312
- }),
313
- () => be(t(u)),
314
- () => F(t(u)),
315
- () => F(t(u)),
311
+ () => !F(t(u)),
312
+ () => _e(t(u)),
313
+ () => K(t(u)),
314
+ () => K(t(u)),
316
315
  () => o()("tokens"),
317
- () => !J(t(u)) || t(O) === t(u).id,
316
+ () => !F(t(u)) || t(L) === t(u).id,
318
317
  () => o()("buyNow")
319
318
  ]
320
- ), $("click", T, () => te(t(u))), $("keydown", T, function(...Q) {
321
- t(Te)?.apply(this, Q);
322
- }), $("click", j, () => _e(t(u))), x(m, C);
323
- }), b(a);
324
- var d = z(a, 2);
319
+ ), Q("click", A, () => $(t(u))), Q("keydown", A, function(...Y) {
320
+ t(Oe)?.apply(this, Y);
321
+ }), Q("click", W, () => ke(t(u))), w(m, I);
322
+ }), D(a);
323
+ var d = M(a, 2);
325
324
  {
326
- var I = (m) => {
327
- ot(m, {
325
+ var S = (m) => {
326
+ lt(m, {
328
327
  get offset() {
329
- return t(k);
328
+ return t(_);
330
329
  },
331
330
  get limit() {
332
- return t(S);
331
+ return t(q);
333
332
  },
334
333
  get total() {
335
- return t(U);
334
+ return t(z);
336
335
  },
337
- onPageChange: xe,
336
+ onPageChange: Ee,
338
337
  get locale() {
339
- return y();
338
+ return v();
340
339
  }
341
340
  });
342
341
  };
343
- X(d, (m) => {
344
- t(w) || m(I);
342
+ G(d, (m) => {
343
+ t(k) || m(S);
345
344
  });
346
345
  }
347
- var D = z(d, 2);
346
+ var B = M(d, 2);
348
347
  {
349
- var Y = (m) => {
350
- var u = ht();
351
- it(u, (C) => r(B, C), () => t(B)), x(m, u);
348
+ var J = (m) => {
349
+ var u = yt();
350
+ it(u, (I) => i(P, I), () => t(P)), w(m, u);
352
351
  };
353
- X(D, (m) => {
354
- t(w) && t(g).length < t(U) && m(Y);
352
+ G(B, (m) => {
353
+ t(k) && t(g).length < t(z) && m(J);
355
354
  });
356
355
  }
357
- x(e, s);
356
+ w(e, s);
358
357
  };
359
- X(Ie, (e) => {
360
- t(N) ? e(Ce) : t(K) && t(g).length === 0 ? e(Re, 1) : !t(g).length || t(H) ? e(Le, 2) : e(Ne, -1);
358
+ G(Ce, (e) => {
359
+ t(E) ? e(Re) : t(V) && t(g).length === 0 ? e(Le, 1) : !t(g).length || t(H) ? e(Ne, 2) : e(Te, -1);
361
360
  });
362
361
  }
363
- b(W), x(_, W);
364
- var Oe = ge(Se);
365
- return L(), Oe;
362
+ D(Z), w(b, Z);
363
+ var Me = fe(Ie);
364
+ return R(), Me;
366
365
  }
367
366
  Ke(["click", "keydown"]);
368
- pe(
369
- fe,
367
+ me(
368
+ he,
370
369
  {
371
370
  apiEndpoint: {},
372
371
  userSession: {},
@@ -378,50 +377,50 @@ pe(
378
377
  [],
379
378
  { mode: "open" }
380
379
  );
381
- function he(_, n) {
382
- me(n, !0);
383
- let o = h(n, "apiEndpoint", 7, ""), i = h(n, "userSession", 7, ""), L = h(n, "locale", 7, ""), c = h(n, "limitItem", 7, R), p = h(n, "translationUrl");
384
- var y = {
380
+ function ye(b, n) {
381
+ ge(n, !0);
382
+ let o = h(n, "apiEndpoint", 7, ""), l = h(n, "userSession", 7, ""), R = h(n, "locale", 7, ""), c = h(n, "limitItem", 7, C), p = h(n, "translationUrl");
383
+ var v = {
385
384
  get apiEndpoint() {
386
385
  return o();
387
386
  },
388
- set apiEndpoint(l = "") {
389
- o(l), v();
387
+ set apiEndpoint(r = "") {
388
+ o(r), y();
390
389
  },
391
390
  get userSession() {
392
- return i();
391
+ return l();
393
392
  },
394
- set userSession(l = "") {
395
- i(l), v();
393
+ set userSession(r = "") {
394
+ l(r), y();
396
395
  },
397
396
  get locale() {
398
- return L();
397
+ return R();
399
398
  },
400
- set locale(l = "") {
401
- L(l), v();
399
+ set locale(r = "") {
400
+ R(r), y();
402
401
  },
403
402
  get limitItem() {
404
403
  return c();
405
404
  },
406
- set limitItem(l = R) {
407
- c(l), v();
405
+ set limitItem(r = C) {
406
+ c(r), y();
408
407
  },
409
408
  get translationUrl() {
410
409
  return p();
411
410
  },
412
- set translationUrl(l) {
413
- p(l), v();
411
+ set translationUrl(r) {
412
+ p(r), y();
414
413
  }
415
414
  };
416
- return fe(_, {
415
+ return he(b, {
417
416
  get apiEndpoint() {
418
417
  return o();
419
418
  },
420
419
  get userSession() {
421
- return i();
420
+ return l();
422
421
  },
423
422
  get locale() {
424
- return L();
423
+ return R();
425
424
  },
426
425
  get limitItem() {
427
426
  return c();
@@ -429,10 +428,10 @@ function he(_, n) {
429
428
  get translationUrl() {
430
429
  return p();
431
430
  }
432
- }), ge(y);
431
+ }), fe(v);
433
432
  }
434
- customElements.define("loyalty-shop", pe(
435
- he,
433
+ customElements.define("loyalty-shop", me(
434
+ ye,
436
435
  {
437
436
  apiEndpoint: {},
438
437
  userSession: {},
@@ -443,11 +442,11 @@ customElements.define("loyalty-shop", pe(
443
442
  [],
444
443
  []
445
444
  ));
446
- const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
445
+ const xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
447
446
  __proto__: null,
448
- default: he
447
+ default: ye
449
448
  }, Symbol.toStringTag, { value: "Module" }));
450
449
  export {
451
- fe as L,
452
- wt as a
450
+ he as L,
451
+ xt as a
453
452
  };
@@ -0,0 +1,27 @@
1
+ var B=(f,o,l)=>new Promise((r,y)=>{var d=a=>{try{c(l.next(a))}catch(_){y(_)}},p=a=>{try{c(l.throw(a))}catch(_){y(_)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(d,p);c((l=l.apply(f,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-B2XwqERr.cjs"),be=require("./LoyaltyShopItem-BvxV4bEm.cjs");if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-B2XwqERr.cjs")).then(o=>o.LoyaltyPagination_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-BvxV4bEm.cjs")).then(o=>o.LoyaltyShopItem_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}const ke={en:{loading:"Loading…",noContent:"There are no bonus items available for redemption.",networkProblem:"Network problem. Please reload.",tokens:"Tokens",buyNow:"Buy Now",generalError:"Something went wrong... Please try again."},tr:{loading:"Yükleniyor…",noContent:"Kullanılabilir bonus öğesi bulunmamaktadır.",networkProblem:"Ağ sorunu. Lütfen yeniden yükleyin.",tokens:"Tokens",buyNow:"Satın Al",generalError:"Bir sorun oluştu, lütfen tekrar deneyin."},da:{loading:"Indlæser…",noContent:"Der er ingen bonusgenstande tilgængelige til indløsning.",networkProblem:"Netværksproblem. Genindlæs venligst siden.",tokens:"Tokens",buyNow:"Køb nu",generalError:"Noget gik galt. Prøv venligst igen."},de:{loading:"Wird geladen…",noContent:"Es sind keine Bonusartikel zum Einlösen verfügbar.",networkProblem:"Netzwerkproblem. Bitte lade die Seite neu.",tokens:"Token",buyNow:"Jetzt kaufen",generalError:"Etwas ist schiefgelaufen. Bitte versuche es erneut."},nl:{loading:"Laden…",noContent:"Er zijn geen bonusitems beschikbaar om in te wisselen.",networkProblem:"Netwerkprobleem. Laad de pagina opnieuw.",tokens:"Tokens",buyNow:"Nu kopen",generalError:"Er is iets misgegaan. Probeer het opnieuw."},fr:{loading:"Chargement…",noContent:"Aucun bonus n'est disponible pour être échangé.",networkProblem:"Problème de réseau. Veuillez recharger la page.",tokens:"Jetons",buyNow:"Acheter",generalError:"Une erreur s'est produite. Veuillez réessayer."},hu:{loading:"Betöltés…",noContent:"Nincsenek beváltható bónuszok.",networkProblem:"Hálózati probléma. Kérjük, töltsd újra az oldalt.",tokens:"Tokenek",buyNow:"Vásárlás",generalError:"Hiba történt. Kérjük, próbáld újra."}},we="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";var Ee=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),xe=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Se=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),qe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Ie=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),Le=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Te=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Me={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
2
+ 90deg,
3
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
4
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
5
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
6
+ );background-size:200% 100%;
7
+ animation: svelte-1f1q033-shimmer 3s linear infinite;border-radius:6px;}.skeleton-line.svelte-1f1q033 {height:14px;border-radius:6px;background:linear-gradient(
8
+ 90deg,
9
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
10
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
11
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
12
+ );background-size:200% 100%;
13
+ animation: svelte-1f1q033-shimmer 3s linear infinite;}.skeleton-line--short.svelte-1f1q033 {width:40%;}.loyalty-shop__item--skeleton.svelte-1f1q033 {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-title:where(.svelte-1f1q033) {width:90%;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-points:where(.svelte-1f1q033) {width:40%;}.loyalty-shop__item-button-skeleton.svelte-1f1q033 {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container.svelte-1f1q033 {cursor:pointer;}
14
+
15
+ @keyframes svelte-1f1q033-shimmer {
16
+ 0% {
17
+ background-position: 200% 0;
18
+ }
19
+
20
+ 100% {
21
+ background-position: -200% 0;
22
+ }
23
+ }
24
+
25
+ @media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
26
+ }`};function j(f,o){e.push(o,!0),e.append_styles(f,Me);const l=()=>e.store_get(e.$format,"$_",r),[r,y]=e.setup_stores(),d=e.prop(o,"apiEndpoint",7,""),p=e.prop(o,"userSession",7,""),c=e.prop(o,"locale",7,""),a=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),_=e.prop(o,"translationUrl");e.setupI18n({withLocale:c(),translations:{}});const G=()=>B(this,null,function*(){try{const t=new URL(_(),window.location.href),n=yield fetch(t.href);if(!n.ok)throw new Error("Failed to fetch translations");const s=yield n.json();Object.entries(s).forEach(([i,h])=>{e.addNewMessages(i,h)})}catch(t){console.error("loyalty shop translation url err:",t)}});Object.entries(ke).forEach(([t,n])=>{e.addNewMessages(t,n)});let m=e.state(e.proxy([])),w=e.state(void 0),I=e.state(0),b=e.state(0),E=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),R=e.state(!1),N=e.state(!1),S=e.state(void 0),k=e.state(!1),L=e.state(void 0),T=0;const Q=e.user_derived(()=>typeof a()=="number"?a():parseInt(a(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),F=()=>{if(!d()||!p())return;e.set(R,!0),e.set(N,!1);const t=++T,n=e.get(k)&&e.get(b)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:p(),locale:c()},e.get(b),e.get(E)).then(s=>{var h,v;if(t!==T)return;const i=(h=s.data)!=null?h:[];e.set(I,(v=s.total)!=null?v:0,!0),n?e.set(m,[...e.get(m),...i],!0):e.set(m,i,!0)}).catch(s=>{t===T&&(e.set(N,!0),console.error("Failed to load shop rewards:",s))}).finally(()=>{t===T&&e.set(R,!1)})};e.user_effect(()=>{d(),p(),c(),e.get(b),e.get(E),F()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),n=s=>{e.set(k,s.matches,!0)};return e.set(k,t.matches,!0),t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),e.user_effect(()=>{e.set(E,e.get(k)?e.MOBILE_LOAD_ITEMS:e.get(Q),!0)}),e.user_effect(()=>{if(!e.get(k)||!e.get(L))return;const t=new IntersectionObserver(n=>{n.some(s=>s.isIntersecting)&&e.get(m).length<e.get(I)&&e.set(b,e.get(b)+e.get(E))},{rootMargin:"200px"});return t.observe(e.get(L)),()=>t.disconnect()}),e.user_pre_effect(()=>{_()&&G()});const X=t=>{var n,s,i;return(i=(s=(n=t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?i:we},O=t=>{var n,s,i;return(i=(s=t.displayName)!=null?s:(n=t.presentation)==null?void 0:n.displayName)!=null?i:""},P=t=>t.available==="true",$=t=>{e.get(S)||!P(t)||e.sendRedeemRewardRequested(O(t),t.id)},ee=t=>B(this,null,function*(){if(!(!d()||e.get(S))){e.set(S,t,!0);try{yield e.redeemReward({apiEndpoint:d(),userSession:p()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),F()}catch(n){e.sendRedeemRewardFailed(t,n)}finally{e.set(S,void 0)}}});e.user_effect(()=>{const t=n=>{var v;const{type:s,id:i,source:h}=(v=n.data)!=null?v:{};switch(s){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:if(e.get(w))break;i&&e.get(m).some(q=>q.id===i)&&ee(i);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:h===e.SOURCE&&e.set(w,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const te=()=>e.get(m).length?l()("generalError"):l()("noContent"),ne=t=>{e.set(b,t,!0)},oe=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},V=t=>{e.set(w,t,!0),oe(t)},se=t=>n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),V(t))};var le={get apiEndpoint(){return d()},set apiEndpoint(t=""){d(t),e.flushSync()},get userSession(){return p()},set userSession(t=""){p(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get limitItem(){return a()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){a(t),e.flushSync()},get translationUrl(){return _()},set translationUrl(t){_(t),e.flushSync()}},U=Te(),ae=e.child(U);{var ie=t=>{be.LoyaltyShopItem(t,{get itemId(){return e.get(w).id},get elevateReward(){return e.get(w)},get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return c()}})},re=t=>{var n=xe();e.each(n,21,()=>Array(e.get(E)),e.index,(s,i,h,v)=>{var q=Ee();e.append(s,q)}),e.reset(n),e.append(t,n)},de=t=>{var n=Se(),s=e.only_child(n,!0);e.template_effect(i=>e.set_text(s,i),[()=>te()]),e.append(t,n)},pe=t=>{var n=Le(),s=e.first_child(n);e.each(s,21,()=>e.get(m),u=>u.id,(u,g)=>{var x=qe();let H;var M=e.child(x),ge=e.user_derived(()=>se(e.get(g))),K=e.only_child(M),Y=e.sibling(M,2),ue=e.only_child(Y,!0),Z=e.sibling(Y,2),fe=e.only_child(Z),D=e.sibling(Z,2),me=e.only_child(D,!0);e.reset(x),e.template_effect((A,C,he,ye,z,_e,ve)=>{var J;H=e.set_class(x,1,"loyalty-shop__item svelte-1f1q033",null,H,{"loyalty-shop__item--unavailable":A}),e.set_attribute(K,"src",C),e.set_attribute(K,"alt",he),e.set_text(ue,ye),e.set_text(fe,`${(J=e.get(g).points)!=null?J:""}
27
+ ${z!=null?z:""}`),D.disabled=_e,e.set_text(me,ve)},[()=>!P(e.get(g)),()=>X(e.get(g)),()=>O(e.get(g)),()=>O(e.get(g)),()=>l()("tokens"),()=>!P(e.get(g))||e.get(S)===e.get(g).id,()=>l()("buyNow")]),e.delegated("click",M,()=>V(e.get(g))),e.delegated("keydown",M,function(...A){var C;(C=e.get(ge))==null||C.apply(this,A)}),e.delegated("click",D,()=>$(e.get(g))),e.append(u,x)}),e.reset(s);var i=e.sibling(s,2);{var h=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(b)},get limit(){return e.get(E)},get total(){return e.get(I)},onPageChange:ne,get locale(){return c()}})};e.if_block(i,u=>{e.get(k)||u(h)})}var v=e.sibling(i,2);{var q=u=>{var g=Ie();e.bind_this(g,x=>e.set(L,x),()=>e.get(L)),e.append(u,g)};e.if_block(v,u=>{e.get(k)&&e.get(m).length<e.get(I)&&u(q)})}e.append(t,n)};e.if_block(ae,t=>{e.get(w)?t(ie):e.get(R)&&e.get(m).length===0?t(re,1):!e.get(m).length||e.get(N)?t(de,2):t(pe,-1)})}e.reset(U),e.append(f,U);var ce=e.pop(le);return y(),ce}e.delegate(["click","keydown"]);e.create_custom_element(j,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function W(f,o){e.push(o,!0);let l=e.prop(o,"apiEndpoint",7,""),r=e.prop(o,"userSession",7,""),y=e.prop(o,"locale",7,""),d=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),p=e.prop(o,"translationUrl");var c={get apiEndpoint(){return l()},set apiEndpoint(a=""){l(a),e.flushSync()},get userSession(){return r()},set userSession(a=""){r(a),e.flushSync()},get locale(){return y()},set locale(a=""){y(a),e.flushSync()},get limitItem(){return d()},set limitItem(a=e.ITEMS_LIMIT_DEFAULT){d(a),e.flushSync()},get translationUrl(){return p()},set translationUrl(a){p(a),e.flushSync()}};return j(f,{get apiEndpoint(){return l()},get userSession(){return r()},get locale(){return y()},get limitItem(){return d()},get translationUrl(){return p()}}),e.pop(c)}customElements.define("loyalty-shop",e.create_custom_element(W,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Ce=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=j;exports.LoyaltyShop_ce=Ce;