@everymatrix/loyalty-shop 0.2.3 → 0.2.5

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-B8amLojn.cjs → LoyaltyPagination-B7JqsoUi.cjs} +8 -8
  2. package/components/{LoyaltyPagination-B2XwqERr.cjs → LoyaltyPagination-BRav_RW5.cjs} +8 -8
  3. package/components/{LoyaltyPagination-DOu-qNFO.js → LoyaltyPagination-Cw2snZwZ.js} +10 -10
  4. package/components/{LoyaltyPagination-BqHc2i2H.js → LoyaltyPagination-CyjgdUPo.js} +10 -10
  5. package/components/LoyaltyPointsCard-CFk3DpjI.js +249 -0
  6. package/components/LoyaltyPointsCard-DTOQlcMH.js +242 -0
  7. package/components/LoyaltyPointsCard-Xb627em8.cjs +18 -0
  8. package/components/LoyaltyPointsCard-njx77PMq.cjs +18 -0
  9. package/components/LoyaltyShop-8d3N_F-0.cjs +27 -0
  10. package/components/LoyaltyShop-BKubFlFr.js +478 -0
  11. package/components/LoyaltyShop-D_Oyu_cp.cjs +27 -0
  12. package/components/LoyaltyShop-Dfybp9ut.js +452 -0
  13. package/components/{LoyaltyShopItem-DL7R43c_.js → LoyaltyShopItem-BXrrNl9f.js} +72 -72
  14. package/components/LoyaltyShopItem-CGOptttz.cjs +5 -0
  15. package/components/{LoyaltyShopItem-bzNnPlQa.js → LoyaltyShopItem-CqY63kaT.js} +103 -103
  16. package/components/LoyaltyShopItem-DEz9OVzD.cjs +5 -0
  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/LoyaltyPointsCard-BjF9SVWO.js +0 -249
  23. package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +0 -18
  24. package/components/LoyaltyPointsCard-DKq6yH_i.js +0 -242
  25. package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +0 -18
  26. package/components/LoyaltyShop-CBH93UYT.js +0 -452
  27. package/components/LoyaltyShop-CCeVtHJ7.cjs +0 -27
  28. package/components/LoyaltyShop-CnX4zXMd.cjs +0 -27
  29. package/components/LoyaltyShop-aSar2Vkc.js +0 -478
  30. package/components/LoyaltyShopItem-BvxV4bEm.cjs +0 -5
  31. package/components/LoyaltyShopItem-CYoPPSZj.cjs +0 -5
@@ -1,31 +1,31 @@
1
- var q = (g, a, o) => new Promise((d, _) => {
2
- var u = (l) => {
1
+ var q = (_, a, r) => new Promise((d, v) => {
2
+ var c = (l) => {
3
3
  try {
4
- c(o.next(l));
5
- } catch (r) {
6
- _(r);
4
+ u(r.next(l));
5
+ } catch (o) {
6
+ v(o);
7
7
  }
8
- }, v = (l) => {
8
+ }, f = (l) => {
9
9
  try {
10
- c(o.throw(l));
11
- } catch (r) {
12
- _(r);
10
+ u(r.throw(l));
11
+ } catch (o) {
12
+ v(o);
13
13
  }
14
- }, c = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(u, v);
15
- c((o = o.apply(g, a)).next());
14
+ }, u = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(c, f);
15
+ u((r = r.apply(_, a)).next());
16
16
  });
17
- import { z as ve, c as Y, p as Q, a as fe, b as p, s as he, d as G, A as C, B as ye, C as ge, E as K, F as b, G as _e, H as we, m as s, f as be, g as xe, i as U, h as S, j as X, I as Ee, J as Re, K as ke, L as Se, k as m, l as Ie, n as M, q as E, o as I, r as O, t as z, v as N, M as Ne, w as j, u as T, x as Te, $ as Le, N as Ce, O as W } from "./LoyaltyPagination-DOu-qNFO.js";
18
- import { L as Ue } from "./LoyaltyPointsCard-BjF9SVWO.js";
17
+ import { z as fe, c as Y, p as Q, a as he, b as p, s as ye, d as G, A as C, B as ge, C as _e, E as K, F as b, G as ve, H as we, m as s, f as be, g as xe, i as U, h as S, j as X, I as Ee, J as Re, K as ke, L as Se, k as m, l as Ie, n as M, q as E, o as I, r as O, t as z, v as N, M as Ne, w as j, u as T, x as Te, $ as Le, N as Ce, O as W } from "./LoyaltyPagination-Cw2snZwZ.js";
18
+ import { L as Ue } from "./LoyaltyPointsCard-CFk3DpjI.js";
19
19
  typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
20
20
  }, globalThis.customElements = { define() {
21
21
  }, get() {
22
22
  }, whenDefined() {
23
23
  } });
24
24
  if (typeof window != "undefined") {
25
- let g = function(a) {
26
- return function(...o) {
25
+ let _ = function(a) {
26
+ return function(...r) {
27
27
  try {
28
- return a.apply(this, o);
28
+ return a.apply(this, r);
29
29
  } catch (d) {
30
30
  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"))
31
31
  return !1;
@@ -33,9 +33,9 @@ if (typeof window != "undefined") {
33
33
  }
34
34
  };
35
35
  };
36
- customElements.define = g(customElements.define), import("./LoyaltyPointsCard-BjF9SVWO.js").then((a) => a.a).then((a) => {
37
- const o = a.default || a;
38
- customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", o.element || o);
36
+ customElements.define = _(customElements.define), import("./LoyaltyPointsCard-CFk3DpjI.js").then((a) => a.a).then((a) => {
37
+ const r = a.default || a;
38
+ customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", r.element || r);
39
39
  }).catch((a) => {
40
40
  console.error("BOOT ERROR:", a);
41
41
  });
@@ -77,27 +77,27 @@ const Me = {
77
77
  back: "Vissza"
78
78
  }
79
79
  }, Oe = "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";
80
- var ze = j('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), je = j('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), Ve = j('<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>');
80
+ var ze = j('<img class="loyalty-shop-item__image"/>'), je = j('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'), Ve = j('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');
81
81
  const Ae = {
82
82
  hash: "svelte-ravnpu",
83
- 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;}
83
+ code: `.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
84
84
 
85
- @media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
85
+ @media (min-width: 768px) {.loyalty-shop-item__image {height:clamp(170px, 30vw, 400px);object-fit:cover;}
86
86
  }`
87
87
  };
88
- function $(g, a) {
89
- Q(a, !0), fe(g, Ae);
90
- const o = () => Te(Le, "$_", d), [d, _] = Ie(), u = p(a, "apiEndpoint", 7, ""), v = p(a, "userSession", 7, ""), c = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), r = p(a, "elevateReward"), R = p(a, "translationUrl");
91
- he({ withLocale: c(), translations: {} }), Object.entries(Me).forEach(([e, t]) => {
88
+ function $(_, a) {
89
+ Q(a, !0), he(_, Ae);
90
+ const r = () => Te(Le, "$_", d), [d, v] = Ie(), c = p(a, "apiEndpoint", 7, ""), f = p(a, "userSession", 7, ""), u = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), o = p(a, "elevateReward"), R = p(a, "translationUrl");
91
+ ye({ withLocale: u(), translations: {} }), Object.entries(Me).forEach(([e, t]) => {
92
92
  G(e, t);
93
93
  });
94
- let i = C(ye(r())), x = C(!1), V = C("");
94
+ let i = C(ge(o())), x = C(!1), V = C("");
95
95
  const A = T(() => {
96
- var e, t, n, f;
97
- return (f = (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.assets) == null ? void 0 : n[0]) != null ? f : "";
96
+ var e, t, n, h;
97
+ return (h = (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.assets) == null ? void 0 : n[0]) != null ? h : "";
98
98
  }), B = T(() => {
99
- var e, t, n, f, w;
100
- return (w = (f = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.displayName) != null ? f : (n = s(i)) == null ? void 0 : n.displayName) != null ? w : "";
99
+ var e, t, n, h, w;
100
+ return (w = (h = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.displayName) != null ? h : (n = s(i)) == null ? void 0 : n.displayName) != null ? w : "";
101
101
  }), D = T(() => {
102
102
  var e, t, n;
103
103
  return (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.description) != null ? n : "";
@@ -114,21 +114,21 @@ function $(g, a) {
114
114
  console.log("loyalty shop item translation url err:", t);
115
115
  });
116
116
  };
117
- ge(() => {
117
+ _e(() => {
118
118
  R() && te();
119
119
  }), K(() => {
120
- if (r()) {
121
- b(i, r(), !0);
120
+ if (o()) {
121
+ b(i, o(), !0);
122
122
  return;
123
123
  }
124
- if (!u() || !l())
124
+ if (!c() || !l())
125
125
  return;
126
126
  let e = !1;
127
- return _e(
127
+ return ve(
128
128
  {
129
- apiEndpoint: u(),
130
- userSession: v(),
131
- locale: c()
129
+ apiEndpoint: c(),
130
+ userSession: f(),
131
+ locale: u()
132
132
  },
133
133
  l()
134
134
  ).then((t) => {
@@ -141,12 +141,12 @@ function $(g, a) {
141
141
  s(x) || !s(H) || !s(i) || Ce(s(i).displayName || s(i).presentation.displayName, s(i).id);
142
142
  }, se = () => q(this, null, function* () {
143
143
  var t;
144
- if (!u() || !s(i) || s(x))
144
+ if (!c() || !s(i) || s(x))
145
145
  return;
146
146
  b(x, !0), b(V, "");
147
147
  const e = s(i).id;
148
148
  try {
149
- yield Ee({ apiEndpoint: u(), userSession: v() }, e), Re(e), ke();
149
+ yield Ee({ apiEndpoint: c(), userSession: f() }, e), Re(e), ke();
150
150
  } catch (n) {
151
151
  b(V, (t = n == null ? void 0 : n.message) != null ? t : "Redeem failed", !0), Se(e, n);
152
152
  } finally {
@@ -155,29 +155,29 @@ function $(g, a) {
155
155
  });
156
156
  K(() => {
157
157
  const e = (t) => {
158
- var n, f, w;
159
- ((n = t.data) == null ? void 0 : n.type) === we.REDEEM_REWARD_CONFIRMED && ((f = t.data) == null ? void 0 : f.id) === ((w = s(i)) == null ? void 0 : w.id) && se();
158
+ var n, h, w;
159
+ ((n = t.data) == null ? void 0 : n.type) === we.REDEEM_REWARD_CONFIRMED && ((h = t.data) == null ? void 0 : h.id) === ((w = s(i)) == null ? void 0 : w.id) && se();
160
160
  };
161
161
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
162
162
  });
163
163
  var ne = {
164
164
  get apiEndpoint() {
165
- return u();
165
+ return c();
166
166
  },
167
167
  set apiEndpoint(e = "") {
168
- u(e), m();
168
+ c(e), m();
169
169
  },
170
170
  get userSession() {
171
- return v();
171
+ return f();
172
172
  },
173
173
  set userSession(e = "") {
174
- v(e), m();
174
+ f(e), m();
175
175
  },
176
176
  get locale() {
177
- return c();
177
+ return u();
178
178
  },
179
179
  set locale(e = "") {
180
- c(e), m();
180
+ u(e), m();
181
181
  },
182
182
  get itemId() {
183
183
  return l();
@@ -186,10 +186,10 @@ function $(g, a) {
186
186
  l(e), m();
187
187
  },
188
188
  get elevateReward() {
189
- return r();
189
+ return o();
190
190
  },
191
191
  set elevateReward(e) {
192
- r(e), m();
192
+ o(e), m();
193
193
  },
194
194
  get translationUrl() {
195
195
  return R();
@@ -197,63 +197,63 @@ function $(g, a) {
197
197
  set translationUrl(e) {
198
198
  R(e), m();
199
199
  }
200
- }, F = be(), re = xe(F);
200
+ }, F = be(), oe = xe(F);
201
201
  {
202
- var oe = (e) => {
203
- var t = Ve(), n = M(t), f = M(n);
202
+ var re = (e) => {
203
+ var t = Ve(), n = M(t), h = M(n);
204
204
  {
205
- var w = (h) => {
206
- var y = ze();
205
+ var w = (y) => {
206
+ var g = ze();
207
207
  z(() => {
208
- W(y, "src", s(A) || Oe), W(y, "alt", s(B));
209
- }), S(h, y);
208
+ W(g, "src", s(A) || Oe), W(g, "alt", s(B));
209
+ }), S(y, g);
210
210
  };
211
- U(f, (h) => {
212
- s(A) && h(w);
211
+ U(h, (y) => {
212
+ s(A) && y(w);
213
213
  });
214
214
  }
215
- var P = E(f, 2), le = I(P, !0), Z = E(P, 2), de = I(Z), L = E(Z, 2), ue = I(L, !0);
215
+ var P = E(h, 2), le = I(P, !0), Z = E(P, 2), de = I(Z), L = E(Z, 2), ce = I(L, !0);
216
216
  O(n);
217
217
  var J = E(n, 2);
218
218
  Ue(J, {
219
219
  get apiEndpoint() {
220
- return u();
220
+ return c();
221
221
  },
222
222
  get userSession() {
223
- return v();
223
+ return f();
224
224
  },
225
225
  get locale() {
226
- return c();
226
+ return u();
227
227
  }
228
228
  });
229
- var ce = E(J, 2);
229
+ var ue = E(J, 2);
230
230
  {
231
- var pe = (h) => {
232
- var y = je(), k = M(y), me = I(k, !0);
233
- O(y), z(() => N(me, s(D))), S(h, y);
231
+ var pe = (y) => {
232
+ var g = je(), k = M(g), me = I(k, !0);
233
+ O(g), z(() => N(me, s(D))), S(y, g);
234
234
  };
235
- U(ce, (h) => {
236
- s(D) && h(pe);
235
+ U(ue, (y) => {
236
+ s(D) && y(pe);
237
237
  });
238
238
  }
239
239
  O(t), z(
240
- (h, y) => {
240
+ (y, g) => {
241
241
  var k;
242
242
  N(le, s(B)), N(de, `${(k = s(i).points) != null ? k : ""}
243
- ${h != null ? h : ""}`), L.disabled = !s(H) || s(x), N(ue, y);
243
+ ${y != null ? y : ""}`), L.disabled = !s(H) || s(x), N(ce, g);
244
244
  },
245
- [() => o()("tokens"), () => o()("buyNow")]
245
+ [() => r()("tokens"), () => r()("buyNow")]
246
246
  ), Ne("click", L, ae), S(e, t);
247
247
  };
248
- U(re, (e) => {
249
- s(i) && e(oe);
248
+ U(oe, (e) => {
249
+ s(i) && e(re);
250
250
  });
251
251
  }
252
- S(g, F);
252
+ S(_, F);
253
253
  var ie = X(ne);
254
- return _(), ie;
254
+ return v(), ie;
255
255
  }
256
- ve(["click"]);
256
+ fe(["click"]);
257
257
  Y(
258
258
  $,
259
259
  {
@@ -268,65 +268,65 @@ Y(
268
268
  [],
269
269
  { mode: "open" }
270
270
  );
271
- function ee(g, a) {
271
+ function ee(_, a) {
272
272
  Q(a, !0);
273
- let o = p(a, "apiEndpoint", 7, ""), d = p(a, "userSession", 7, ""), _ = p(a, "locale", 7, ""), u = p(a, "itemId", 7, ""), v = p(a, "elevateReward"), c = p(a, "translationUrl");
273
+ let r = p(a, "apiEndpoint", 7, ""), d = p(a, "userSession", 7, ""), v = p(a, "locale", 7, ""), c = p(a, "itemId", 7, ""), f = p(a, "elevateReward"), u = p(a, "translationUrl");
274
274
  var l = {
275
275
  get apiEndpoint() {
276
- return o();
276
+ return r();
277
277
  },
278
- set apiEndpoint(r = "") {
279
- o(r), m();
278
+ set apiEndpoint(o = "") {
279
+ r(o), m();
280
280
  },
281
281
  get userSession() {
282
282
  return d();
283
283
  },
284
- set userSession(r = "") {
285
- d(r), m();
284
+ set userSession(o = "") {
285
+ d(o), m();
286
286
  },
287
287
  get locale() {
288
- return _();
288
+ return v();
289
289
  },
290
- set locale(r = "") {
291
- _(r), m();
290
+ set locale(o = "") {
291
+ v(o), m();
292
292
  },
293
293
  get itemId() {
294
- return u();
294
+ return c();
295
295
  },
296
- set itemId(r = "") {
297
- u(r), m();
296
+ set itemId(o = "") {
297
+ c(o), m();
298
298
  },
299
299
  get elevateReward() {
300
- return v();
300
+ return f();
301
301
  },
302
- set elevateReward(r) {
303
- v(r), m();
302
+ set elevateReward(o) {
303
+ f(o), m();
304
304
  },
305
305
  get translationUrl() {
306
- return c();
306
+ return u();
307
307
  },
308
- set translationUrl(r) {
309
- c(r), m();
308
+ set translationUrl(o) {
309
+ u(o), m();
310
310
  }
311
311
  };
312
- return $(g, {
312
+ return $(_, {
313
313
  get apiEndpoint() {
314
- return o();
314
+ return r();
315
315
  },
316
316
  get userSession() {
317
317
  return d();
318
318
  },
319
319
  get locale() {
320
- return _();
320
+ return v();
321
321
  },
322
322
  get itemId() {
323
- return u();
323
+ return c();
324
324
  },
325
325
  get elevateReward() {
326
- return v();
326
+ return f();
327
327
  },
328
328
  get translationUrl() {
329
- return c();
329
+ return u();
330
330
  }
331
331
  }), X(l);
332
332
  }
@@ -0,0 +1,5 @@
1
+ var M=(y,o,r)=>new Promise((d,g)=>{var c=l=>{try{p(r.next(l))}catch(s){g(s)}},u=l=>{try{p(r.throw(l))}catch(s){g(s)}},p=l=>l.done?d(l.value):Promise.resolve(l.value).then(c,u);p((r=r.apply(y,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BRav_RW5.cjs"),K=require("./LoyaltyPointsCard-njx77PMq.cjs");if(typeof window!="undefined"){let y=function(o){return function(...r){try{return o.apply(this,r)}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-njx77PMq.cjs")).then(o=>o.LoyaltyPointsCard_ce).then(o=>{const r=o.default||o;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",r.element||r)}).catch(o=>{console.error("BOOT ERROR:",o)})}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"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
2
+
3
+ @media (min-width: 768px) {.loyalty-shop-item__image {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
+ }`};function S(y,o){e.push(o,!0),e.append_styles(y,ee);const r=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),c=e.prop(o,"apiEndpoint",7,""),u=e.prop(o,"userSession",7,""),p=e.prop(o,"locale",7,""),l=e.prop(o,"itemId",7,""),s=e.prop(o,"elevateReward"),b=e.prop(o,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let i=e.state(e.proxy(s())),v=e.state(!1),E=e.state("");const k=e.user_derived(()=>{var t,n,a,m;return(m=(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:a[0])!=null?m:""}),R=e.user_derived(()=>{var t,n,a,m,_;return(_=(m=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(a=e.get(i))==null?void 0:a.displayName)!=null?_:""}),I=e.user_derived(()=>{var t,n,a;return(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.description)!=null?a:""}),N=e.user_derived(()=>{var t;return((t=e.get(i))==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(a=>{e.addNewMessages(a,n[a])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(s()){e.set(i,s(),!0);return}if(!c()||!l())return;let t=!1;return e.fetchShopItem({apiEndpoint:c(),userSession:u(),locale:p()},l()).then(n=>{t||e.set(i,n,!0)}).catch(n=>console.error("Failed to load shop item:",n)),()=>{t=!0}});const z=()=>{e.get(v)||!e.get(N)||!e.get(i)||e.sendRedeemRewardRequested(e.get(i).displayName||e.get(i).presentation.displayName,e.get(i).id)},V=()=>M(this,null,function*(){var n;if(!c()||!e.get(i)||e.get(v))return;e.set(v,!0),e.set(E,"");const t=e.get(i).id;try{yield e.redeemReward({apiEndpoint:c(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(a){e.set(E,(n=a==null?void 0:a.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,a)}finally{e.set(v,!1)}});e.user_effect(()=>{const t=n=>{var a,m,_;((a=n.data)==null?void 0:a.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((_=e.get(i))==null?void 0:_.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 l()},set itemId(t=""){l(t),e.flushSync()},get elevateReward(){return s()},set elevateReward(t){s(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=$(),a=e.child(n),m=e.child(a);{var _=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(_)})}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(a);var U=e.sibling(a,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(i).points)!=null?w:""}
5
+ ${h!=null?h:""}`),x.disabled=!e.get(N)||e.get(v),e.set_text(Z,f)},[()=>r()("tokens"),()=>r()("buyNow")]),e.delegated("click",x,z),e.append(t,n)};e.if_block(D,t=>{e.get(i)&&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,o){e.push(o,!0);let r=e.prop(o,"apiEndpoint",7,""),d=e.prop(o,"userSession",7,""),g=e.prop(o,"locale",7,""),c=e.prop(o,"itemId",7,""),u=e.prop(o,"elevateReward"),p=e.prop(o,"translationUrl");var l={get apiEndpoint(){return r()},set apiEndpoint(s=""){r(s),e.flushSync()},get userSession(){return d()},set userSession(s=""){d(s),e.flushSync()},get locale(){return g()},set locale(s=""){g(s),e.flushSync()},get itemId(){return c()},set itemId(s=""){c(s),e.flushSync()},get elevateReward(){return u()},set elevateReward(s){u(s),e.flushSync()},get translationUrl(){return p()},set translationUrl(s){p(s),e.flushSync()}};return S(y,{get apiEndpoint(){return r()},get userSession(){return d()},get locale(){return g()},get itemId(){return c()},get elevateReward(){return u()},get translationUrl(){return p()}}),e.pop(l)}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;
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-CCeVtHJ7.cjs");if(typeof window!="undefined"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-CCeVtHJ7.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
1
+ typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-D_Oyu_cp.cjs");if(typeof window!="undefined"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-D_Oyu_cp.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-aSar2Vkc.js";
1
+ import { L as a } from "../components/LoyaltyShop-BKubFlFr.js";
2
2
  typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
3
3
  }, globalThis.customElements = { define() {
4
4
  }, get() {
@@ -16,7 +16,7 @@ if (typeof window != "undefined") {
16
16
  }
17
17
  };
18
18
  };
19
- customElements.define = s(customElements.define), import("../components/LoyaltyShop-aSar2Vkc.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-BKubFlFr.js").then((e) => e.a).then((e) => {
20
20
  const n = e.default || e;
21
21
  customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
22
22
  }).catch((e) => {
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-CnX4zXMd.cjs");if(typeof window<"u"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-CnX4zXMd.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-8d3N_F-0.cjs");if(typeof window<"u"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-8d3N_F-0.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-CBH93UYT.js";
1
+ import { L as a } from "../components/LoyaltyShop-Dfybp9ut.js";
2
2
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
3
3
  }, globalThis.customElements = { define() {
4
4
  }, get() {
@@ -16,7 +16,7 @@ if (typeof window < "u") {
16
16
  }
17
17
  };
18
18
  };
19
- customElements.define = s(customElements.define), import("../components/LoyaltyShop-CBH93UYT.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-Dfybp9ut.js").then((e) => e.a).then((e) => {
20
20
  const n = e.default || e;
21
21
  customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
22
22
  }).catch((e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/loyalty-shop",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "main": "./esnext/loyalty-shop.cjs",
6
6
  "module": "./esnext/loyalty-shop.js",