@everymatrix/loyalty-shop 0.1.18 → 0.1.20

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-ChnSUs6d.cjs +14 -0
  2. package/components/{LoyaltyPagination-Bdx-smp6.js → LoyaltyPagination-D7m97E0W.js} +2283 -2227
  3. package/components/LoyaltyPagination-DzmuO9_8.cjs +14 -0
  4. package/components/{LoyaltyPagination-kvqB9vki.js → LoyaltyPagination-o3rQCgms.js} +2287 -2232
  5. package/components/{LoyaltyPointsCard-a-ERcIbF.cjs → LoyaltyPointsCard-46BqNZEK.cjs} +3 -3
  6. package/components/{LoyaltyPointsCard-DAwt9_VW.cjs → LoyaltyPointsCard-5kjF6xRz.cjs} +3 -3
  7. package/components/{LoyaltyPointsCard-Dte4kVve.js → LoyaltyPointsCard-CdBEe40I.js} +64 -68
  8. package/components/{LoyaltyPointsCard-CpUgbUoh.js → LoyaltyPointsCard-SZEIZzo0.js} +59 -63
  9. package/components/{LoyaltyShop-ICV4lgAz.cjs → LoyaltyShop-B2lSw5jy.cjs} +3 -3
  10. package/components/{LoyaltyShop-D4hhy3SS.js → LoyaltyShop-DGAZjo_P.js} +141 -149
  11. package/components/{LoyaltyShop-Dvy8bKVO.cjs → LoyaltyShop-DGLy6Hu5.cjs} +3 -3
  12. package/components/{LoyaltyShop-B5kW3Kng.js → LoyaltyShop-_bWN39Rn.js} +135 -143
  13. package/components/{LoyaltyShopItem-B-9ignkf.js → LoyaltyShopItem-CtZFkxzA.js} +68 -72
  14. package/components/{LoyaltyShopItem-DY4h5OAR.cjs → LoyaltyShopItem-DpFV9qnk.cjs} +3 -3
  15. package/components/{LoyaltyShopItem-Dwm024JF.js → LoyaltyShopItem-DxwkafBG.js} +81 -85
  16. package/components/{LoyaltyShopItem-DCnDun5S.cjs → LoyaltyShopItem-PkfmBV5A.cjs} +3 -3
  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-ClX3N4HA.cjs +0 -16
  23. package/components/LoyaltyPagination-DdJI2Ptf.cjs +0 -16
@@ -1,12 +1,12 @@
1
- import { y as pe, c as G, p as K, a as me, b as o, s as ve, d as Z, z as C, A as fe, B as he, C as J, E as w, F as ye, G as ge, m as a, f as _e, g as we, i as U, h as S, j as W, H as be, I as xe, J as Ee, K as Re, k as i, l as ke, n as f, o as x, r as h, t as M, q as I, L as Se, v as O, u as N, w as Ie, $ as Ne, M as Te, N as q } from "./LoyaltyPagination-Bdx-smp6.js";
2
- import { L as Le } from "./LoyaltyPointsCard-CpUgbUoh.js";
1
+ import { z as me, c as G, p as K, a as ve, b as o, s as fe, d as Z, A as N, B as he, C as ye, E as J, F as g, G as ge, H as _e, m as a, f as we, g as be, i as T, h as E, j as W, I as xe, J as Ee, K as Re, L as ke, k as i, l as Se, n as L, q as w, o as R, r as C, t as U, v as k, M as Ie, w as M, u as S, x as Ne, $ as Te, N as Le, O as q } from "./LoyaltyPagination-D7m97E0W.js";
2
+ import { L as Ce } from "./LoyaltyPointsCard-SZEIZzo0.js";
3
3
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
4
  }, globalThis.customElements = { define() {
5
5
  }, get() {
6
6
  }, whenDefined() {
7
7
  } });
8
8
  if (typeof window < "u") {
9
- let y = function(t) {
9
+ let f = function(t) {
10
10
  return function(...l) {
11
11
  try {
12
12
  return t.apply(this, l);
@@ -17,14 +17,14 @@ if (typeof window < "u") {
17
17
  }
18
18
  };
19
19
  };
20
- customElements.define = y(customElements.define), import("./LoyaltyPointsCard-CpUgbUoh.js").then((t) => t.a).then((t) => {
20
+ customElements.define = f(customElements.define), import("./LoyaltyPointsCard-SZEIZzo0.js").then((t) => t.a).then((t) => {
21
21
  const l = t.default || t;
22
22
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
23
23
  }).catch((t) => {
24
24
  console.error("BOOT ERROR:", t);
25
25
  });
26
26
  }
27
- const Ce = {
27
+ const Ue = {
28
28
  en: {
29
29
  tokens: "Tokens",
30
30
  buyNow: "Buy Now",
@@ -60,68 +60,68 @@ const Ce = {
60
60
  buyNow: "Vásárlás",
61
61
  back: "Vissza"
62
62
  }
63
- }, Ue = "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";
64
- var Me = O('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), Oe = O('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), ze = O('<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>');
65
- const je = {
63
+ }, Me = "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";
64
+ var Oe = M('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), ze = M('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), je = M('<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>');
65
+ const Ve = {
66
66
  hash: "svelte-ravnpu",
67
67
  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;}
68
68
 
69
69
  @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
70
70
  }`
71
71
  };
72
- function Y(y, t) {
73
- K(t, !0), me(y, je);
74
- const l = () => Ie(Ne, "$_", d), [d, b] = ke(), u = o(t, "apiEndpoint", 7, ""), c = o(t, "userSession", 7, ""), p = o(t, "locale", 7, ""), g = o(t, "itemId", 7, ""), n = o(t, "elevateReward"), E = o(t, "translationUrl");
75
- ve({ withLocale: p(), translations: {} }), Object.entries(Ce).forEach(([e, s]) => {
72
+ function Y(f, t) {
73
+ K(t, !0), ve(f, Ve);
74
+ const l = () => Ne(Te, "$_", d), [d, _] = Se(), u = o(t, "apiEndpoint", 7, ""), c = o(t, "userSession", 7, ""), p = o(t, "locale", 7, ""), h = o(t, "itemId", 7, ""), n = o(t, "elevateReward"), b = o(t, "translationUrl");
75
+ fe({ withLocale: p(), translations: {} }), Object.entries(Ue).forEach(([e, s]) => {
76
76
  Z(e, s);
77
77
  });
78
- let r = C(fe(n())), R = C(!1), z = C("");
79
- const j = N(() => a(r)?.presentation?.assets?.[0] ?? ""), V = N(() => a(r)?.presentation?.displayName ?? a(r)?.displayName ?? ""), A = N(() => a(r)?.presentation?.description ?? ""), B = N(() => a(r)?.available === "true"), X = () => {
80
- let e = new URL(E(), window.location.href);
78
+ let r = N(he(n())), x = N(!1), O = N("");
79
+ const z = S(() => a(r)?.presentation?.assets?.[0] ?? ""), j = S(() => a(r)?.presentation?.displayName ?? a(r)?.displayName ?? ""), V = S(() => a(r)?.presentation?.description ?? ""), A = S(() => a(r)?.available === "true"), X = () => {
80
+ let e = new URL(b(), window.location.href);
81
81
  fetch(e.href).then((s) => s.json()).then((s) => {
82
- Object.keys(s).forEach((_) => {
83
- Z(_, s[_]);
82
+ Object.keys(s).forEach((y) => {
83
+ Z(y, s[y]);
84
84
  });
85
85
  }).catch((s) => {
86
86
  console.log("loyalty shop item translation url err:", s);
87
87
  });
88
88
  };
89
- he(() => {
90
- E() && X();
89
+ ye(() => {
90
+ b() && X();
91
91
  }), J(() => {
92
92
  if (n()) {
93
- w(r, n(), !0);
93
+ g(r, n(), !0);
94
94
  return;
95
95
  }
96
- !u() || !g() || ye(
96
+ !u() || !h() || ge(
97
97
  {
98
98
  apiEndpoint: u(),
99
99
  userSession: c(),
100
100
  locale: p()
101
101
  },
102
- g()
102
+ h()
103
103
  ).then((e) => {
104
- w(r, e, !0);
104
+ g(r, e, !0);
105
105
  }).catch((e) => console.error("Failed to load shop item:", e));
106
106
  });
107
107
  const $ = () => {
108
- a(R) || !a(B) || !a(r) || Te(a(r).displayName || a(r).presentation.displayName, a(r).id);
108
+ a(x) || !a(A) || !a(r) || Le(a(r).displayName || a(r).presentation.displayName, a(r).id);
109
109
  }, ee = async () => {
110
110
  if (!u() || !a(r))
111
111
  return;
112
- w(R, !0), w(z, "");
112
+ g(x, !0), g(O, "");
113
113
  const e = a(r).id;
114
114
  try {
115
- await be({ apiEndpoint: u(), userSession: c() }, e), xe(e), Ee();
115
+ await xe({ apiEndpoint: u(), userSession: c() }, e), Ee(e), Re();
116
116
  } catch (s) {
117
- w(z, s?.message ?? "Redeem failed", !0), Re(e, s);
117
+ g(O, s?.message ?? "Redeem failed", !0), ke(e, s);
118
118
  } finally {
119
- w(R, !1);
119
+ g(x, !1);
120
120
  }
121
121
  };
122
122
  J(() => {
123
123
  const e = (s) => {
124
- s.data?.type === ge.REDEEM_REWARD_CONFIRMED && s.data?.id === a(r)?.id && ee();
124
+ s.data?.type === _e.REDEEM_REWARD_CONFIRMED && s.data?.id === a(r)?.id && ee();
125
125
  };
126
126
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
127
127
  });
@@ -145,10 +145,10 @@ function Y(y, t) {
145
145
  p(e), i();
146
146
  },
147
147
  get itemId() {
148
- return g();
148
+ return h();
149
149
  },
150
150
  set itemId(e = "") {
151
- g(e), i();
151
+ h(e), i();
152
152
  },
153
153
  get elevateReward() {
154
154
  return n();
@@ -157,34 +157,30 @@ function Y(y, t) {
157
157
  n(e), i();
158
158
  },
159
159
  get translationUrl() {
160
- return E();
160
+ return b();
161
161
  },
162
162
  set translationUrl(e) {
163
- E(e), i();
163
+ b(e), i();
164
164
  }
165
- }, D = _e(), ae = we(D);
165
+ }, B = we(), ae = be(B);
166
166
  {
167
167
  var se = (e) => {
168
- var s = ze(), _ = f(s), H = f(_);
168
+ var s = je(), y = L(s), D = L(y);
169
169
  {
170
170
  var re = (m) => {
171
- var v = Me();
172
- M(() => {
173
- q(v, "src", a(j) || Ue), q(v, "alt", a(V));
174
- }), S(m, v);
171
+ var v = Oe();
172
+ U(() => {
173
+ q(v, "src", a(z) || Me), q(v, "alt", a(j));
174
+ }), E(m, v);
175
175
  };
176
- U(H, (m) => {
177
- a(j) && m(re);
176
+ T(D, (m) => {
177
+ a(z) && m(re);
178
178
  });
179
179
  }
180
- var T = x(H, 2), oe = f(T, !0);
181
- h(T);
182
- var L = x(T, 2), ie = f(L);
183
- h(L);
184
- var k = x(L, 2), le = f(k, !0);
185
- h(k), h(_);
186
- var F = x(_, 2);
187
- Le(F, {
180
+ var H = w(D, 2), oe = R(H, !0), F = w(H, 2), ie = R(F), I = w(F, 2), le = R(I, !0);
181
+ C(y);
182
+ var P = w(y, 2);
183
+ Ce(P, {
188
184
  get apiEndpoint() {
189
185
  return u();
190
186
  },
@@ -195,33 +191,33 @@ function Y(y, t) {
195
191
  return p();
196
192
  }
197
193
  });
198
- var de = x(F, 2);
194
+ var de = w(P, 2);
199
195
  {
200
196
  var ue = (m) => {
201
- var v = Oe(), P = f(v), ce = f(P, !0);
202
- h(P), h(v), M(() => I(ce, a(A))), S(m, v);
197
+ var v = ze(), ce = L(v), pe = R(ce, !0);
198
+ C(v), U(() => k(pe, a(V))), E(m, v);
203
199
  };
204
- U(de, (m) => {
205
- a(A) && m(ue);
200
+ T(de, (m) => {
201
+ a(V) && m(ue);
206
202
  });
207
203
  }
208
- h(s), M(
204
+ C(s), U(
209
205
  (m, v) => {
210
- I(oe, a(V)), I(ie, `${a(r).points ?? ""}
211
- ${m ?? ""}`), k.disabled = !a(B) || a(R), I(le, v);
206
+ k(oe, a(j)), k(ie, `${a(r).points ?? ""}
207
+ ${m ?? ""}`), I.disabled = !a(A) || a(x), k(le, v);
212
208
  },
213
209
  [() => l()("tokens"), () => l()("buyNow")]
214
- ), Se("click", k, $), S(e, s);
210
+ ), Ie("click", I, $), E(e, s);
215
211
  };
216
- U(ae, (e) => {
212
+ T(ae, (e) => {
217
213
  a(r) && e(se);
218
214
  });
219
215
  }
220
- S(y, D);
216
+ E(f, B);
221
217
  var ne = W(te);
222
- return b(), ne;
218
+ return _(), ne;
223
219
  }
224
- pe(["click"]);
220
+ me(["click"]);
225
221
  G(
226
222
  Y,
227
223
  {
@@ -236,10 +232,10 @@ G(
236
232
  [],
237
233
  { mode: "open" }
238
234
  );
239
- function Q(y, t) {
235
+ function Q(f, t) {
240
236
  K(t, !0);
241
- let l = o(t, "apiEndpoint", 7, ""), d = o(t, "userSession", 7, ""), b = o(t, "locale", 7, ""), u = o(t, "itemId", 7, ""), c = o(t, "elevateReward"), p = o(t, "translationUrl");
242
- var g = {
237
+ let l = o(t, "apiEndpoint", 7, ""), d = o(t, "userSession", 7, ""), _ = o(t, "locale", 7, ""), u = o(t, "itemId", 7, ""), c = o(t, "elevateReward"), p = o(t, "translationUrl");
238
+ var h = {
243
239
  get apiEndpoint() {
244
240
  return l();
245
241
  },
@@ -253,10 +249,10 @@ function Q(y, t) {
253
249
  d(n), i();
254
250
  },
255
251
  get locale() {
256
- return b();
252
+ return _();
257
253
  },
258
254
  set locale(n = "") {
259
- b(n), i();
255
+ _(n), i();
260
256
  },
261
257
  get itemId() {
262
258
  return u();
@@ -277,7 +273,7 @@ function Q(y, t) {
277
273
  p(n), i();
278
274
  }
279
275
  };
280
- return Y(y, {
276
+ return Y(f, {
281
277
  get apiEndpoint() {
282
278
  return l();
283
279
  },
@@ -285,7 +281,7 @@ function Q(y, t) {
285
281
  return d();
286
282
  },
287
283
  get locale() {
288
- return b();
284
+ return _();
289
285
  },
290
286
  get itemId() {
291
287
  return u();
@@ -296,7 +292,7 @@ function Q(y, t) {
296
292
  get translationUrl() {
297
293
  return p();
298
294
  }
299
- }), W(g);
295
+ }), W(h);
300
296
  }
301
297
  customElements.define("loyalty-shop-item", G(
302
298
  Q,
@@ -311,11 +307,11 @@ customElements.define("loyalty-shop-item", G(
311
307
  [],
312
308
  []
313
309
  ));
314
- const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
310
+ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
315
311
  __proto__: null,
316
312
  default: Q
317
313
  }, Symbol.toStringTag, { value: "Module" }));
318
314
  export {
319
315
  Y as L,
320
- Be as a
316
+ De as a
321
317
  };
@@ -1,5 +1,5 @@
1
- var M=(y,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(y,a)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-DdJI2Ptf.cjs"),K=require("./LoyaltyPointsCard-DAwt9_VW.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-DAwt9_VW.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=(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;}
2
2
 
3
3
  @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
- }`};function k(y,a){e.push(a,!0),e.append_styles(y,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"),b=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())),w=e.state(!1),R=e.state("");const I=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:""}),N=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:""}),T=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:""}),L=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}!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(w)||!e.get(L)||!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(w,!0),e.set(R,"");const t=e.get(l).id;try{yield e.redeemReward({apiEndpoint:p(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(s){e.set(R,(n=s==null?void 0:s.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,s)}finally{e.set(w,!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 b()},set translationUrl(t){b(t),e.flushSync()}},C=e.comment(),D=e.first_child(C);{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(I)||Y),e.set_attribute(f,"alt",e.get(N))}),e.append(h,f)};e.if_block(m,h=>{e.get(I)&&h(v)})}var S=e.sibling(m,2),H=e.child(S,!0);e.reset(S);var E=e.sibling(S,2),q=e.child(E);e.reset(E);var x=e.sibling(E,2),Z=e.child(x,!0);e.reset(x),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 f=X(),_=e.child(f),G=e.child(_,!0);e.reset(_),e.reset(f),e.template_effect(()=>e.set_text(G,e.get(T))),e.append(h,f)};e.if_block(F,h=>{e.get(T)&&h(J)})}e.reset(n),e.template_effect((h,f)=>{var _;e.set_text(H,e.get(N)),e.set_text(q,`${(_=e.get(l).points)!=null?_:""}
5
- ${h!=null?h:""}`),x.disabled=!e.get(L)||e.get(w),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,C);var B=e.pop(j);return g(),B}e.delegate(["click"]);e.create_custom_element(k,{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,""),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 k(y,{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=k;exports.LoyaltyShopItem_ce=te;
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;