@everymatrix/loyalty-shop 0.1.22 → 0.1.24

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 (23) hide show
  1. package/components/LoyaltyPagination-BISbknCY.cjs +14 -0
  2. package/components/{LoyaltyPagination-o3rQCgms.js → LoyaltyPagination-BZk1S01e.js} +1493 -1467
  3. package/components/{LoyaltyPagination-D7m97E0W.js → LoyaltyPagination-CfB2kCYx.js} +819 -793
  4. package/components/LoyaltyPagination-n22faI_k.cjs +14 -0
  5. package/components/{LoyaltyPointsCard-5kjF6xRz.cjs → LoyaltyPointsCard-Bk2oWu8Y.cjs} +1 -1
  6. package/components/{LoyaltyPointsCard-46BqNZEK.cjs → LoyaltyPointsCard-C4TY5Odb.cjs} +1 -1
  7. package/components/{LoyaltyPointsCard-SZEIZzo0.js → LoyaltyPointsCard-DgrWMn_V.js} +1 -1
  8. package/components/{LoyaltyPointsCard-CdBEe40I.js → LoyaltyPointsCard-jP0P8jiI.js} +1 -1
  9. package/components/{LoyaltyShop-DGLy6Hu5.cjs → LoyaltyShop-9D4_2iLM.cjs} +3 -3
  10. package/components/{LoyaltyShop-B2lSw5jy.cjs → LoyaltyShop-BYXBV-P0.cjs} +3 -3
  11. package/components/{LoyaltyShop-DGAZjo_P.js → LoyaltyShop-CUN0MKDN.js} +29 -27
  12. package/components/{LoyaltyShop-_bWN39Rn.js → LoyaltyShop-D-Gsl4ZM.js} +38 -36
  13. package/components/{LoyaltyShopItem-DpFV9qnk.cjs → LoyaltyShopItem-CC3RrQxC.cjs} +3 -3
  14. package/components/{LoyaltyShopItem-CtZFkxzA.js → LoyaltyShopItem-DF8vUi7m.js} +45 -40
  15. package/components/{LoyaltyShopItem-PkfmBV5A.cjs → LoyaltyShopItem-WgDbYlQa.cjs} +3 -3
  16. package/components/{LoyaltyShopItem-DxwkafBG.js → LoyaltyShopItem-bTc7oBXE.js} +26 -21
  17. package/es2015/loyalty-shop.cjs +1 -1
  18. package/es2015/loyalty-shop.js +2 -2
  19. package/esnext/loyalty-shop.cjs +1 -1
  20. package/esnext/loyalty-shop.js +2 -2
  21. package/package.json +1 -1
  22. package/components/LoyaltyPagination-ChnSUs6d.cjs +0 -14
  23. package/components/LoyaltyPagination-DzmuO9_8.cjs +0 -14
@@ -14,8 +14,8 @@ var X = (f, s, o) => new Promise((r, k) => {
14
14
  }, p = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(u, c);
15
15
  p((o = o.apply(f, s)).next());
16
16
  });
17
- import { z as Ze, c as ye, p as ve, a as Je, b as v, s as We, d as re, A as y, B as de, P as ue, E as O, m as t, F as d, C as Ye, H as ce, S as Ge, i as $, h as S, j as be, Q as L, R as Qe, u as pe, I as Xe, J as $e, K as et, L as tt, w as I, k as b, l as nt, n as me, r as V, T as ge, U as st, o as z, t as fe, v as H, g as at, q as P, x as ot, $ as lt, V as it, O as he, M as ee, W as rt, X as dt, N as ut, Y as ct } from "./LoyaltyPagination-o3rQCgms.js";
18
- import { L as pt } from "./LoyaltyShopItem-DxwkafBG.js";
17
+ import { z as Ze, c as ye, p as ve, a as Je, b as v, s as We, d as re, A as y, B as de, P as ue, E as O, m as t, F as d, C as Ye, H as ce, S as Ge, i as $, h as S, j as be, Q as N, R as Qe, u as pe, I as Xe, J as $e, K as et, L as tt, w as I, k as b, l as nt, n as me, r as V, T as ge, U as st, o as z, t as fe, v as H, g as at, q as P, x as ot, $ as lt, V as it, O as he, M as ee, W as rt, X as dt, N as ut, Y as ct } from "./LoyaltyPagination-BZk1S01e.js";
18
+ import { L as pt } from "./LoyaltyShopItem-bTc7oBXE.js";
19
19
  typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
20
20
  }, globalThis.customElements = { define() {
21
21
  }, get() {
@@ -33,7 +33,7 @@ if (typeof window != "undefined") {
33
33
  }
34
34
  };
35
35
  };
36
- customElements.define = f(customElements.define), import("./LoyaltyPagination-o3rQCgms.js").then((s) => s.Z).then((s) => {
36
+ customElements.define = f(customElements.define), import("./LoyaltyPagination-BZk1S01e.js").then((s) => s.Z).then((s) => {
37
37
  const o = s.default || s;
38
38
  customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", o.element || o);
39
39
  }).catch((s) => {
@@ -52,7 +52,7 @@ if (typeof window != "undefined") {
52
52
  }
53
53
  };
54
54
  };
55
- customElements.define = f(customElements.define), import("./LoyaltyShopItem-DxwkafBG.js").then((s) => s.a).then((s) => {
55
+ customElements.define = f(customElements.define), import("./LoyaltyShopItem-bTc7oBXE.js").then((s) => s.a).then((s) => {
56
56
  const o = s.default || s;
57
57
  customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", o.element || o);
58
58
  }).catch((s) => {
@@ -149,7 +149,7 @@ const wt = {
149
149
  };
150
150
  function _e(f, s) {
151
151
  ve(s, !0), Je(f, wt);
152
- const o = () => ot(lt, "$_", r), [r, k] = nt(), u = v(s, "apiEndpoint", 7, ""), c = v(s, "userSession", 7, ""), p = v(s, "locale", 7, ""), l = v(s, "limitItem", 7, L), w = v(s, "translationUrl");
152
+ const o = () => ot(lt, "$_", r), [r, k] = nt(), u = v(s, "apiEndpoint", 7, ""), c = v(s, "userSession", 7, ""), p = v(s, "locale", 7, ""), l = v(s, "limitItem", 7, N), w = v(s, "translationUrl");
153
153
  We({ withLocale: p(), translations: {} });
154
154
  const we = () => X(this, null, function* () {
155
155
  try {
@@ -167,8 +167,8 @@ function _e(f, s) {
167
167
  Object.entries(mt).forEach(([e, n]) => {
168
168
  re(e, n);
169
169
  });
170
- let h = y(de([])), N = y(void 0), U = y(0), E = y(0), C = y(de(ue)), K = y(!1), F = y(!1), T = y(void 0), q = y(!1), B = y(void 0), A = 0;
171
- const xe = pe(() => typeof l() == "number" ? l() : parseInt(l(), L) || L), te = () => {
170
+ let h = y(de([])), C = y(void 0), U = y(0), E = y(0), R = y(de(ue)), K = y(!1), F = y(!1), T = y(void 0), q = y(!1), B = y(void 0), A = 0;
171
+ const xe = pe(() => typeof l() == "number" ? l() : parseInt(l(), N) || N), te = () => {
172
172
  if (!u() || !c())
173
173
  return;
174
174
  d(K, !0), d(F, !1);
@@ -180,7 +180,7 @@ function _e(f, s) {
180
180
  locale: p()
181
181
  },
182
182
  t(E),
183
- t(C)
183
+ t(R)
184
184
  ).then((a) => {
185
185
  var _, x;
186
186
  if (e !== A)
@@ -194,19 +194,19 @@ function _e(f, s) {
194
194
  });
195
195
  };
196
196
  O(() => {
197
- u(), c(), p(), t(E), t(C), te();
197
+ u(), c(), p(), t(E), t(R), te();
198
198
  }), O(() => {
199
199
  const e = window.matchMedia("(max-width: 767px)"), n = (a) => {
200
200
  d(q, a.matches, !0);
201
201
  };
202
202
  return d(q, e.matches, !0), e.addEventListener("change", n), () => e.removeEventListener("change", n);
203
203
  }), O(() => {
204
- d(C, t(q) ? ue : t(xe), !0);
204
+ d(R, t(q) ? ue : t(xe), !0);
205
205
  }), O(() => {
206
206
  if (!t(q) || !t(B)) return;
207
207
  const e = new IntersectionObserver(
208
208
  (n) => {
209
- n.some((a) => a.isIntersecting) && t(h).length < t(U) && d(E, t(E) + t(C));
209
+ n.some((a) => a.isIntersecting) && t(h).length < t(U) && d(E, t(E) + t(R));
210
210
  },
211
211
  { rootMargin: "200px" }
212
212
  );
@@ -240,10 +240,12 @@ function _e(f, s) {
240
240
  const { type: a, id: i, source: _ } = (x = n.data) != null ? x : {};
241
241
  switch (a) {
242
242
  case ce.REDEEM_REWARD_CONFIRMED:
243
+ if (t(C))
244
+ break;
243
245
  i && t(h).some((M) => M.id === i) && Se(i);
244
246
  break;
245
247
  case ce.BACK_BUTTON_CLICKED:
246
- _ === Ge && d(N, void 0);
248
+ _ === Ge && d(C, void 0);
247
249
  break;
248
250
  }
249
251
  };
@@ -254,7 +256,7 @@ function _e(f, s) {
254
256
  }, Re = (e) => {
255
257
  ct(e.displayName || e.presentation.displayName, e.id);
256
258
  }, ne = (e) => {
257
- d(N, e, !0), Re(e);
259
+ d(C, e, !0), Re(e);
258
260
  }, Le = (e) => (n) => {
259
261
  (n.key === "Enter" || n.key === " ") && (n.preventDefault(), ne(e));
260
262
  };
@@ -280,7 +282,7 @@ function _e(f, s) {
280
282
  get limitItem() {
281
283
  return l();
282
284
  },
283
- set limitItem(e = L) {
285
+ set limitItem(e = N) {
284
286
  l(e), b();
285
287
  },
286
288
  get translationUrl() {
@@ -294,10 +296,10 @@ function _e(f, s) {
294
296
  var Me = (e) => {
295
297
  pt(e, {
296
298
  get itemId() {
297
- return t(N).id;
299
+ return t(C).id;
298
300
  },
299
301
  get elevateReward() {
300
- return t(N);
302
+ return t(C);
301
303
  },
302
304
  get apiEndpoint() {
303
305
  return u();
@@ -311,7 +313,7 @@ function _e(f, s) {
311
313
  });
312
314
  }, Oe = (e) => {
313
315
  var n = ht();
314
- ge(n, 21, () => Array(t(C)), st, (a, i, _, x) => {
316
+ ge(n, 21, () => Array(t(R)), st, (a, i, _, x) => {
315
317
  var M = ft();
316
318
  S(a, M);
317
319
  }), V(n), S(e, n);
@@ -321,13 +323,13 @@ function _e(f, s) {
321
323
  }, Pe = (e) => {
322
324
  var n = _t(), a = at(n);
323
325
  ge(a, 21, () => t(h), (g) => g.id, (g, m) => {
324
- var R = vt();
326
+ var L = vt();
325
327
  let se;
326
- var D = me(R), Be = pe(() => Le(t(m))), ae = z(D), oe = P(D, 2), Ae = z(oe, !0), le = P(oe, 2), De = z(le), Y = P(le, 2), je = z(Y, !0);
327
- V(R), fe(
328
+ var D = me(L), Be = pe(() => Le(t(m))), ae = z(D), oe = P(D, 2), Ae = z(oe, !0), le = P(oe, 2), De = z(le), Y = P(le, 2), je = z(Y, !0);
329
+ V(L), fe(
328
330
  (G, j, Ve, He, Q, Ke, Fe) => {
329
331
  var ie;
330
- se = it(R, 1, "loyalty-shop__item svelte-1f1q033", null, se, { "loyalty-shop__item--unavailable": G }), he(ae, "src", j), he(ae, "alt", Ve), H(Ae, He), H(De, `${(ie = t(m).points) != null ? ie : ""}
332
+ se = it(L, 1, "loyalty-shop__item svelte-1f1q033", null, se, { "loyalty-shop__item--unavailable": G }), he(ae, "src", j), he(ae, "alt", Ve), H(Ae, He), H(De, `${(ie = t(m).points) != null ? ie : ""}
331
333
  ${Q != null ? Q : ""}`), Y.disabled = Ke, H(je, Fe);
332
334
  },
333
335
  [
@@ -342,7 +344,7 @@ function _e(f, s) {
342
344
  ), ee("click", D, () => ne(t(m))), ee("keydown", D, function(...G) {
343
345
  var j;
344
346
  (j = t(Be)) == null || j.apply(this, G);
345
- }), ee("click", Y, () => qe(t(m))), S(g, R);
347
+ }), ee("click", Y, () => qe(t(m))), S(g, L);
346
348
  }), V(a);
347
349
  var i = P(a, 2);
348
350
  {
@@ -352,7 +354,7 @@ function _e(f, s) {
352
354
  return t(E);
353
355
  },
354
356
  get limit() {
355
- return t(C);
357
+ return t(R);
356
358
  },
357
359
  get total() {
358
360
  return t(U);
@@ -371,7 +373,7 @@ function _e(f, s) {
371
373
  {
372
374
  var M = (g) => {
373
375
  var m = bt();
374
- dt(m, (R) => d(B, R), () => t(B)), S(g, m);
376
+ dt(m, (L) => d(B, L), () => t(B)), S(g, m);
375
377
  };
376
378
  $(x, (g) => {
377
379
  t(q) && t(h).length < t(U) && g(M);
@@ -380,7 +382,7 @@ function _e(f, s) {
380
382
  S(e, n);
381
383
  };
382
384
  $(Te, (e) => {
383
- t(N) ? e(Me) : t(K) && t(h).length === 0 ? e(Oe, 1) : !t(h).length || t(F) ? e(ze, 2) : e(Pe, -1);
385
+ t(C) ? e(Me) : t(K) && t(h).length === 0 ? e(Oe, 1) : !t(h).length || t(F) ? e(ze, 2) : e(Pe, -1);
384
386
  });
385
387
  }
386
388
  V(W), S(f, W);
@@ -403,7 +405,7 @@ ye(
403
405
  );
404
406
  function ke(f, s) {
405
407
  ve(s, !0);
406
- let o = v(s, "apiEndpoint", 7, ""), r = v(s, "userSession", 7, ""), k = v(s, "locale", 7, ""), u = v(s, "limitItem", 7, L), c = v(s, "translationUrl");
408
+ let o = v(s, "apiEndpoint", 7, ""), r = v(s, "userSession", 7, ""), k = v(s, "locale", 7, ""), u = v(s, "limitItem", 7, N), c = v(s, "translationUrl");
407
409
  var p = {
408
410
  get apiEndpoint() {
409
411
  return o();
@@ -426,7 +428,7 @@ function ke(f, s) {
426
428
  get limitItem() {
427
429
  return u();
428
430
  },
429
- set limitItem(l = L) {
431
+ set limitItem(l = N) {
430
432
  u(l), b();
431
433
  },
432
434
  get translationUrl() {
@@ -1,5 +1,5 @@
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 I, 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-D7m97E0W.js";
2
- import { L as ut } from "./LoyaltyShopItem-CtZFkxzA.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-CfB2kCYx.js";
2
+ import { L as ut } from "./LoyaltyShopItem-DF8vUi7m.js";
3
3
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
4
  }, globalThis.customElements = { define() {
5
5
  }, get() {
@@ -17,7 +17,7 @@ if (typeof window < "u") {
17
17
  }
18
18
  };
19
19
  };
20
- customElements.define = b(customElements.define), import("./LoyaltyPagination-D7m97E0W.js").then((n) => n.Z).then((n) => {
20
+ customElements.define = b(customElements.define), import("./LoyaltyPagination-CfB2kCYx.js").then((n) => n.Z).then((n) => {
21
21
  const o = n.default || n;
22
22
  customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", o.element || o);
23
23
  }).catch((n) => {
@@ -36,7 +36,7 @@ if (typeof window < "u") {
36
36
  }
37
37
  };
38
38
  };
39
- customElements.define = b(customElements.define), import("./LoyaltyShopItem-CtZFkxzA.js").then((n) => n.a).then((n) => {
39
+ customElements.define = b(customElements.define), import("./LoyaltyShopItem-DF8vUi7m.js").then((n) => n.a).then((n) => {
40
40
  const o = n.default || n;
41
41
  customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", o.element || o);
42
42
  }).catch((n) => {
@@ -133,7 +133,7 @@ const _t = {
133
133
  };
134
134
  function he(b, n) {
135
135
  ge(n, !0), Fe(b, _t);
136
- const o = () => st(at, "$_", l), [l, C] = et(), c = h(n, "apiEndpoint", 7, ""), p = h(n, "userSession", 7, ""), v = h(n, "locale", 7, ""), r = h(n, "limitItem", 7, I), O = h(n, "translationUrl");
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
137
  Ze({ withLocale: v(), translations: {} });
138
138
  const ve = async () => {
139
139
  try {
@@ -141,8 +141,8 @@ function he(b, n) {
141
141
  if (!s.ok)
142
142
  throw new Error("Failed to fetch translations");
143
143
  const a = await s.json();
144
- Object.entries(a).forEach(([d, q]) => {
145
- ae(d, q);
144
+ Object.entries(a).forEach(([d, S]) => {
145
+ ae(d, S);
146
146
  });
147
147
  } catch (e) {
148
148
  console.error("loyalty shop translation url err:", e);
@@ -151,8 +151,8 @@ function he(b, n) {
151
151
  Object.entries(ct).forEach(([e, s]) => {
152
152
  ae(e, s);
153
153
  });
154
- let g = f(oe([])), R = f(void 0), z = f(0), _ = f(0), E = 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(), I) || I), X = () => {
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 = () => {
156
156
  if (!c() || !p())
157
157
  return;
158
158
  i(V, !0), i(H, !1);
@@ -164,7 +164,7 @@ function he(b, n) {
164
164
  locale: v()
165
165
  },
166
166
  t(_),
167
- t(E)
167
+ t(q)
168
168
  ).then((a) => {
169
169
  if (e !== U)
170
170
  return;
@@ -177,19 +177,19 @@ function he(b, n) {
177
177
  });
178
178
  };
179
179
  N(() => {
180
- c(), p(), v(), t(_), t(E), X();
180
+ c(), p(), v(), t(_), t(q), X();
181
181
  }), N(() => {
182
182
  const e = window.matchMedia("(max-width: 767px)"), s = (a) => {
183
183
  i(k, a.matches, !0);
184
184
  };
185
185
  return i(k, e.matches, !0), e.addEventListener("change", s), () => e.removeEventListener("change", s);
186
186
  }), N(() => {
187
- i(E, t(k) ? le : t(be), !0);
187
+ i(q, t(k) ? le : t(be), !0);
188
188
  }), N(() => {
189
189
  if (!t(k) || !t(P)) return;
190
190
  const e = new IntersectionObserver(
191
191
  (s) => {
192
- s.some((a) => a.isIntersecting) && t(g).length < t(z) && i(_, t(_) + t(E));
192
+ s.some((a) => a.isIntersecting) && t(g).length < t(z) && i(_, t(_) + t(q));
193
193
  },
194
194
  { rootMargin: "200px" }
195
195
  );
@@ -213,13 +213,15 @@ function he(b, n) {
213
213
  };
214
214
  N(() => {
215
215
  const e = (s) => {
216
- const { type: a, id: d, source: q } = s.data ?? {};
216
+ const { type: a, id: d, source: S } = s.data ?? {};
217
217
  switch (a) {
218
218
  case ie.REDEEM_REWARD_CONFIRMED:
219
+ if (t(E))
220
+ break;
219
221
  d && t(g).some((B) => B.id === d) && we(d);
220
222
  break;
221
223
  case ie.BACK_BUTTON_CLICKED:
222
- q === We && i(R, void 0);
224
+ S === We && i(E, void 0);
223
225
  break;
224
226
  }
225
227
  };
@@ -230,7 +232,7 @@ function he(b, n) {
230
232
  }, qe = (e) => {
231
233
  dt(e.displayName || e.presentation.displayName, e.id);
232
234
  }, $ = (e) => {
233
- i(R, e, !0), qe(e);
235
+ i(E, e, !0), qe(e);
234
236
  }, Se = (e) => (s) => {
235
237
  (s.key === "Enter" || s.key === " ") && (s.preventDefault(), $(e));
236
238
  };
@@ -256,7 +258,7 @@ function he(b, n) {
256
258
  get limitItem() {
257
259
  return r();
258
260
  },
259
- set limitItem(e = I) {
261
+ set limitItem(e = C) {
260
262
  r(e), y();
261
263
  },
262
264
  get translationUrl() {
@@ -270,10 +272,10 @@ function he(b, n) {
270
272
  var Re = (e) => {
271
273
  ut(e, {
272
274
  get itemId() {
273
- return t(R).id;
275
+ return t(E).id;
274
276
  },
275
277
  get elevateReward() {
276
- return t(R);
278
+ return t(E);
277
279
  },
278
280
  get apiEndpoint() {
279
281
  return c();
@@ -287,7 +289,7 @@ function he(b, n) {
287
289
  });
288
290
  }, Le = (e) => {
289
291
  var s = gt();
290
- ue(s, 21, () => Array(t(E)), tt, (a, d, q, B) => {
292
+ ue(s, 21, () => Array(t(q)), tt, (a, d, S, B) => {
291
293
  var J = mt();
292
294
  w(a, J);
293
295
  }), D(s), w(e, s);
@@ -297,12 +299,12 @@ function he(b, n) {
297
299
  }, Te = (e) => {
298
300
  var s = vt(), a = nt(s);
299
301
  ue(a, 21, () => t(g), (m) => m.id, (m, u) => {
300
- var S = ht();
302
+ var I = ht();
301
303
  let ee;
302
- var A = de(S), 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);
303
- D(S), ce(
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(
304
306
  (Y, Be, Ae, De, je, Ve, He) => {
305
- ee = ot(S, 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 ?? ""}
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 ?? ""}
306
308
  ${je ?? ""}`), W.disabled = Ve, j(Ue, He);
307
309
  },
308
310
  [
@@ -316,17 +318,17 @@ function he(b, n) {
316
318
  ]
317
319
  ), Q("click", A, () => $(t(u))), Q("keydown", A, function(...Y) {
318
320
  t(Oe)?.apply(this, Y);
319
- }), Q("click", W, () => ke(t(u))), w(m, S);
321
+ }), Q("click", W, () => ke(t(u))), w(m, I);
320
322
  }), D(a);
321
323
  var d = M(a, 2);
322
324
  {
323
- var q = (m) => {
325
+ var S = (m) => {
324
326
  lt(m, {
325
327
  get offset() {
326
328
  return t(_);
327
329
  },
328
330
  get limit() {
329
- return t(E);
331
+ return t(q);
330
332
  },
331
333
  get total() {
332
334
  return t(z);
@@ -338,14 +340,14 @@ function he(b, n) {
338
340
  });
339
341
  };
340
342
  G(d, (m) => {
341
- t(k) || m(q);
343
+ t(k) || m(S);
342
344
  });
343
345
  }
344
346
  var B = M(d, 2);
345
347
  {
346
348
  var J = (m) => {
347
349
  var u = yt();
348
- it(u, (S) => i(P, S), () => t(P)), w(m, u);
350
+ it(u, (I) => i(P, I), () => t(P)), w(m, u);
349
351
  };
350
352
  G(B, (m) => {
351
353
  t(k) && t(g).length < t(z) && m(J);
@@ -354,12 +356,12 @@ function he(b, n) {
354
356
  w(e, s);
355
357
  };
356
358
  G(Ce, (e) => {
357
- t(R) ? e(Re) : t(V) && t(g).length === 0 ? e(Le, 1) : !t(g).length || t(H) ? e(Ne, 2) : e(Te, -1);
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);
358
360
  });
359
361
  }
360
362
  D(Z), w(b, Z);
361
363
  var Me = fe(Ie);
362
- return C(), Me;
364
+ return R(), Me;
363
365
  }
364
366
  Ke(["click", "keydown"]);
365
367
  me(
@@ -377,7 +379,7 @@ me(
377
379
  );
378
380
  function ye(b, n) {
379
381
  ge(n, !0);
380
- let o = h(n, "apiEndpoint", 7, ""), l = h(n, "userSession", 7, ""), C = h(n, "locale", 7, ""), c = h(n, "limitItem", 7, I), p = h(n, "translationUrl");
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");
381
383
  var v = {
382
384
  get apiEndpoint() {
383
385
  return o();
@@ -392,15 +394,15 @@ function ye(b, n) {
392
394
  l(r), y();
393
395
  },
394
396
  get locale() {
395
- return C();
397
+ return R();
396
398
  },
397
399
  set locale(r = "") {
398
- C(r), y();
400
+ R(r), y();
399
401
  },
400
402
  get limitItem() {
401
403
  return c();
402
404
  },
403
- set limitItem(r = I) {
405
+ set limitItem(r = C) {
404
406
  c(r), y();
405
407
  },
406
408
  get translationUrl() {
@@ -418,7 +420,7 @@ function ye(b, n) {
418
420
  return l();
419
421
  },
420
422
  get locale() {
421
- return C();
423
+ return R();
422
424
  },
423
425
  get limitItem() {
424
426
  return c();
@@ -1,5 +1,5 @@
1
- var M=(f,a,o)=>new Promise((d,g)=>{var p=i=>{try{c(o.next(i))}catch(r){g(r)}},u=i=>{try{c(o.throw(i))}catch(r){g(r)}},c=i=>i.done?d(i.value):Promise.resolve(i.value).then(p,u);c((o=o.apply(f,a)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-ChnSUs6d.cjs"),K=require("./LoyaltyPointsCard-5kjF6xRz.cjs");if(typeof window!="undefined"){let f=function(a){return function(...o){try{return a.apply(this,o)}catch(d){if(d instanceof DOMException&&d.message.includes("has already been used with this registry")||d instanceof Error&&d.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw d}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-5kjF6xRz.cjs")).then(a=>a.LoyaltyPointsCard_ce).then(a=>{const o=a.default||a;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(a=>{console.error("BOOT ERROR:",a)})}const W={en:{tokens:"Tokens",buyNow:"Buy Now",back:"Back"},tr:{tokens:"Tokens",buyNow:"Şimdi Satın Al",back:"Geri"},da:{tokens:"Tokens",buyNow:"Køb nu",back:"Tilbage"},de:{tokens:"Token",buyNow:"Jetzt kaufen",back:"Zurück"},nl:{tokens:"Tokens",buyNow:"Nu kopen",back:"Terug"},fr:{tokens:"Jetons",buyNow:"Acheter",back:"Retour"},hu:{tokens:"Tokenek",buyNow:"Vásárlás",back:"Vissza"}},Y="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 Q=e.from_html('<img class="loyalty-shop-item__image svelte-ravnpu"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item svelte-ravnpu"><div class="loyalty-shop-item__card svelte-ravnpu"><!> <span class="loyalty-shop-item__title svelte-ravnpu"> </span> <span class="loyalty-shop-item__points svelte-ravnpu"> </span> <button class="loyalty-shop-item__button svelte-ravnpu" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item.svelte-ravnpu {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card.svelte-ravnpu {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-default, #022652);}.loyalty-shop-item__card--description.svelte-ravnpu {min-height:120px;}.loyalty-shop-item__image.svelte-ravnpu {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title.svelte-ravnpu {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button.svelte-ravnpu {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-ravnpu:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
1
+ var M=(y,a,o)=>new Promise((d,g)=>{var c=i=>{try{p(o.next(i))}catch(r){g(r)}},u=i=>{try{p(o.throw(i))}catch(r){g(r)}},p=i=>i.done?d(i.value):Promise.resolve(i.value).then(c,u);p((o=o.apply(y,a)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-n22faI_k.cjs"),K=require("./LoyaltyPointsCard-Bk2oWu8Y.cjs");if(typeof window!="undefined"){let y=function(a){return function(...o){try{return a.apply(this,o)}catch(d){if(d instanceof DOMException&&d.message.includes("has already been used with this registry")||d instanceof Error&&d.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw d}}};customElements.define=y(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-Bk2oWu8Y.cjs")).then(a=>a.LoyaltyPointsCard_ce).then(a=>{const o=a.default||a;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(a=>{console.error("BOOT ERROR:",a)})}const W={en:{tokens:"Tokens",buyNow:"Buy Now",back:"Back"},tr:{tokens:"Tokens",buyNow:"Şimdi Satın Al",back:"Geri"},da:{tokens:"Tokens",buyNow:"Køb nu",back:"Tilbage"},de:{tokens:"Token",buyNow:"Jetzt kaufen",back:"Zurück"},nl:{tokens:"Tokens",buyNow:"Nu kopen",back:"Terug"},fr:{tokens:"Jetons",buyNow:"Acheter",back:"Retour"},hu:{tokens:"Tokenek",buyNow:"Vásárlás",back:"Vissza"}},Y="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 Q=e.from_html('<img class="loyalty-shop-item__image svelte-ravnpu"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item svelte-ravnpu"><div class="loyalty-shop-item__card svelte-ravnpu"><!> <span class="loyalty-shop-item__title svelte-ravnpu"> </span> <span class="loyalty-shop-item__points svelte-ravnpu"> </span> <button class="loyalty-shop-item__button svelte-ravnpu" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item.svelte-ravnpu {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card.svelte-ravnpu {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-default, #022652);}.loyalty-shop-item__card--description.svelte-ravnpu {min-height:120px;}.loyalty-shop-item__image.svelte-ravnpu {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title.svelte-ravnpu {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button.svelte-ravnpu {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-ravnpu:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
2
2
 
3
3
  @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
- }`};function S(f,a){e.push(a,!0),e.append_styles(f,ee);const o=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),p=e.prop(a,"apiEndpoint",7,""),u=e.prop(a,"userSession",7,""),c=e.prop(a,"locale",7,""),i=e.prop(a,"itemId",7,""),r=e.prop(a,"elevateReward"),_=e.prop(a,"translationUrl");e.setupI18n({withLocale:c(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let l=e.state(e.proxy(r())),b=e.state(!1),E=e.state("");const k=e.user_derived(()=>{var t,n,s,m;return(m=(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?m:""}),R=e.user_derived(()=>{var t,n,s,m,v;return(v=(m=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(s=e.get(l))==null?void 0:s.displayName)!=null?v:""}),I=e.user_derived(()=>{var t,n,s;return(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.description)!=null?s:""}),N=e.user_derived(()=>{var t;return((t=e.get(l))==null?void 0:t.available)==="true"}),P=()=>{let t=new URL(_(),window.location.href);fetch(t.href).then(n=>n.json()).then(n=>{Object.keys(n).forEach(s=>{e.addNewMessages(s,n[s])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{_()&&P()}),e.user_effect(()=>{if(r()){e.set(l,r(),!0);return}!p()||!i()||e.fetchShopItem({apiEndpoint:p(),userSession:u(),locale:c()},i()).then(t=>{e.set(l,t,!0)}).catch(t=>console.error("Failed to load shop item:",t))});const z=()=>{e.get(b)||!e.get(N)||!e.get(l)||e.sendRedeemRewardRequested(e.get(l).displayName||e.get(l).presentation.displayName,e.get(l).id)},V=()=>M(this,null,function*(){var n;if(!p()||!e.get(l))return;e.set(b,!0),e.set(E,"");const t=e.get(l).id;try{yield e.redeemReward({apiEndpoint:p(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(s){e.set(E,(n=s==null?void 0:s.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,s)}finally{e.set(b,!1)}});e.user_effect(()=>{const t=n=>{var s,m,v;((s=n.data)==null?void 0:s.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((v=e.get(l))==null?void 0:v.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return p()},set apiEndpoint(t=""){p(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get itemId(){return i()},set itemId(t=""){i(t),e.flushSync()},get elevateReward(){return r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return _()},set translationUrl(t){_(t),e.flushSync()}},T=e.comment(),D=e.first_child(T);{var A=t=>{var n=$(),s=e.child(n),m=e.child(s);{var v=h=>{var y=Q();e.template_effect(()=>{e.set_attribute(y,"src",e.get(k)||Y),e.set_attribute(y,"alt",e.get(R))}),e.append(h,y)};e.if_block(m,h=>{e.get(k)&&h(v)})}var L=e.sibling(m,2),H=e.only_child(L,!0),C=e.sibling(L,2),q=e.only_child(C),x=e.sibling(C,2),Z=e.only_child(x,!0);e.reset(s);var U=e.sibling(s,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return p()},get userSession(){return u()},get locale(){return c()}});var F=e.sibling(U,2);{var J=h=>{var y=X(),w=e.child(y),G=e.only_child(w,!0);e.reset(y),e.template_effect(()=>e.set_text(G,e.get(I))),e.append(h,y)};e.if_block(F,h=>{e.get(I)&&h(J)})}e.reset(n),e.template_effect((h,y)=>{var w;e.set_text(H,e.get(R)),e.set_text(q,`${(w=e.get(l).points)!=null?w:""}
5
- ${h!=null?h:""}`),x.disabled=!e.get(N)||e.get(b),e.set_text(Z,y)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",x,z),e.append(t,n)};e.if_block(D,t=>{e.get(l)&&t(A)})}e.append(f,T);var B=e.pop(j);return g(),B}e.delegate(["click"]);e.create_custom_element(S,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function O(f,a){e.push(a,!0);let o=e.prop(a,"apiEndpoint",7,""),d=e.prop(a,"userSession",7,""),g=e.prop(a,"locale",7,""),p=e.prop(a,"itemId",7,""),u=e.prop(a,"elevateReward"),c=e.prop(a,"translationUrl");var i={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return d()},set userSession(r=""){d(r),e.flushSync()},get locale(){return g()},set locale(r=""){g(r),e.flushSync()},get itemId(){return p()},set itemId(r=""){p(r),e.flushSync()},get elevateReward(){return u()},set elevateReward(r){u(r),e.flushSync()},get translationUrl(){return c()},set translationUrl(r){c(r),e.flushSync()}};return S(f,{get apiEndpoint(){return o()},get userSession(){return d()},get locale(){return g()},get itemId(){return p()},get elevateReward(){return u()},get translationUrl(){return c()}}),e.pop(i)}customElements.define("loyalty-shop-item",e.create_custom_element(O,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[]));const te=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=S;exports.LoyaltyShopItem_ce=te;
4
+ }`};function S(y,a){e.push(a,!0),e.append_styles(y,ee);const o=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),c=e.prop(a,"apiEndpoint",7,""),u=e.prop(a,"userSession",7,""),p=e.prop(a,"locale",7,""),i=e.prop(a,"itemId",7,""),r=e.prop(a,"elevateReward"),b=e.prop(a,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let l=e.state(e.proxy(r())),_=e.state(!1),E=e.state("");const k=e.user_derived(()=>{var t,n,s,m;return(m=(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?m:""}),R=e.user_derived(()=>{var t,n,s,m,v;return(v=(m=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(s=e.get(l))==null?void 0:s.displayName)!=null?v:""}),I=e.user_derived(()=>{var t,n,s;return(s=(n=(t=e.get(l))==null?void 0:t.presentation)==null?void 0:n.description)!=null?s:""}),N=e.user_derived(()=>{var t;return((t=e.get(l))==null?void 0:t.available)==="true"}),P=()=>{let t=new URL(b(),window.location.href);fetch(t.href).then(n=>n.json()).then(n=>{Object.keys(n).forEach(s=>{e.addNewMessages(s,n[s])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(r()){e.set(l,r(),!0);return}if(!c()||!i())return;let t=!1;return e.fetchShopItem({apiEndpoint:c(),userSession:u(),locale:p()},i()).then(n=>{t||e.set(l,n,!0)}).catch(n=>console.error("Failed to load shop item:",n)),()=>{t=!0}});const z=()=>{e.get(_)||!e.get(N)||!e.get(l)||e.sendRedeemRewardRequested(e.get(l).displayName||e.get(l).presentation.displayName,e.get(l).id)},V=()=>M(this,null,function*(){var n;if(!c()||!e.get(l)||e.get(_))return;e.set(_,!0),e.set(E,"");const t=e.get(l).id;try{yield e.redeemReward({apiEndpoint:c(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(s){e.set(E,(n=s==null?void 0:s.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,s)}finally{e.set(_,!1)}});e.user_effect(()=>{const t=n=>{var s,m,v;((s=n.data)==null?void 0:s.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((v=e.get(l))==null?void 0:v.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return c()},set apiEndpoint(t=""){c(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return p()},set locale(t=""){p(t),e.flushSync()},get itemId(){return i()},set itemId(t=""){i(t),e.flushSync()},get elevateReward(){return r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return b()},set translationUrl(t){b(t),e.flushSync()}},T=e.comment(),D=e.first_child(T);{var A=t=>{var n=$(),s=e.child(n),m=e.child(s);{var v=h=>{var f=Q();e.template_effect(()=>{e.set_attribute(f,"src",e.get(k)||Y),e.set_attribute(f,"alt",e.get(R))}),e.append(h,f)};e.if_block(m,h=>{e.get(k)&&h(v)})}var L=e.sibling(m,2),H=e.only_child(L,!0),C=e.sibling(L,2),q=e.only_child(C),x=e.sibling(C,2),Z=e.only_child(x,!0);e.reset(s);var U=e.sibling(s,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return c()},get userSession(){return u()},get locale(){return p()}});var F=e.sibling(U,2);{var J=h=>{var f=X(),w=e.child(f),G=e.only_child(w,!0);e.reset(f),e.template_effect(()=>e.set_text(G,e.get(I))),e.append(h,f)};e.if_block(F,h=>{e.get(I)&&h(J)})}e.reset(n),e.template_effect((h,f)=>{var w;e.set_text(H,e.get(R)),e.set_text(q,`${(w=e.get(l).points)!=null?w:""}
5
+ ${h!=null?h:""}`),x.disabled=!e.get(N)||e.get(_),e.set_text(Z,f)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",x,z),e.append(t,n)};e.if_block(D,t=>{e.get(l)&&t(A)})}e.append(y,T);var B=e.pop(j);return g(),B}e.delegate(["click"]);e.create_custom_element(S,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function O(y,a){e.push(a,!0);let o=e.prop(a,"apiEndpoint",7,""),d=e.prop(a,"userSession",7,""),g=e.prop(a,"locale",7,""),c=e.prop(a,"itemId",7,""),u=e.prop(a,"elevateReward"),p=e.prop(a,"translationUrl");var i={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return d()},set userSession(r=""){d(r),e.flushSync()},get locale(){return g()},set locale(r=""){g(r),e.flushSync()},get itemId(){return c()},set itemId(r=""){c(r),e.flushSync()},get elevateReward(){return u()},set elevateReward(r){u(r),e.flushSync()},get translationUrl(){return p()},set translationUrl(r){p(r),e.flushSync()}};return S(y,{get apiEndpoint(){return o()},get userSession(){return d()},get locale(){return g()},get itemId(){return c()},get elevateReward(){return u()},get translationUrl(){return p()}}),e.pop(i)}customElements.define("loyalty-shop-item",e.create_custom_element(O,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[]));const te=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=S;exports.LoyaltyShopItem_ce=te;