@everymatrix/loyalty-shop 0.1.15 → 0.1.19

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-5mlynRsD.js → LoyaltyPagination-D7m97E0W.js} +1973 -1943
  3. package/components/LoyaltyPagination-DzmuO9_8.cjs +14 -0
  4. package/components/{LoyaltyPagination-WMbwps-Y.js → LoyaltyPagination-o3rQCgms.js} +2011 -1982
  5. package/components/{LoyaltyPointsCard-BthOcyvZ.cjs → LoyaltyPointsCard-46BqNZEK.cjs} +3 -3
  6. package/components/{LoyaltyPointsCard-Ctxmn0pn.cjs → LoyaltyPointsCard-5kjF6xRz.cjs} +3 -3
  7. package/components/{LoyaltyPointsCard-DnyOr6RH.js → LoyaltyPointsCard-CdBEe40I.js} +64 -68
  8. package/components/{LoyaltyPointsCard-JV_Vm052.js → LoyaltyPointsCard-SZEIZzo0.js} +59 -63
  9. package/components/{LoyaltyShop-BvDigxmH.cjs → LoyaltyShop-B2lSw5jy.cjs} +3 -3
  10. package/components/{LoyaltyShop-CewjK7_m.js → LoyaltyShop-DGAZjo_P.js} +141 -149
  11. package/components/{LoyaltyShop-D78F7HNs.cjs → LoyaltyShop-DGLy6Hu5.cjs} +3 -3
  12. package/components/{LoyaltyShop-DORwVB2x.js → LoyaltyShop-_bWN39Rn.js} +135 -143
  13. package/components/{LoyaltyShopItem-qD3S4Ug2.js → LoyaltyShopItem-CtZFkxzA.js} +68 -72
  14. package/components/{LoyaltyShopItem-BDOJ0nlu.cjs → LoyaltyShopItem-DpFV9qnk.cjs} +3 -3
  15. package/components/{LoyaltyShopItem-B5HPzm1z.js → LoyaltyShopItem-DxwkafBG.js} +81 -85
  16. package/components/{LoyaltyShopItem-DETZUW3x.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-D7TGgpOl.cjs +0 -16
  23. package/components/LoyaltyPagination-DoaWx3gW.cjs +0 -16
@@ -1,4 +1,4 @@
1
- var F=(f,o,l)=>new Promise((i,y)=>{var d=r=>{try{c(l.next(r))}catch(v){y(v)}},p=r=>{try{c(l.throw(r))}catch(v){y(v)}},c=r=>r.done?i(r.value):Promise.resolve(r.value).then(d,p);c((l=l.apply(f,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-DoaWx3gW.cjs"),be=require("./LoyaltyShopItem-BDOJ0nlu.cjs");if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(i){if(i instanceof DOMException&&i.message.includes("has already been used with this registry")||i instanceof Error&&i.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw i}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-DoaWx3gW.cjs")).then(o=>o.LoyaltyPagination_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(i){if(i instanceof DOMException&&i.message.includes("has already been used with this registry")||i instanceof Error&&i.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw i}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-BDOJ0nlu.cjs")).then(o=>o.LoyaltyShopItem_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}const ke={en:{loading:"Loading…",noContent:"There are no bonus items available for redemption.",networkProblem:"Network problem. Please reload.",tokens:"Tokens",buyNow:"Buy Now",generalError:"Something went wrong... Please try again."},tr:{loading:"Yükleniyor…",noContent:"Kullanılabilir bonus öğesi bulunmamaktadır.",networkProblem:"Ağ sorunu. Lütfen yeniden yükleyin.",tokens:"Tokens",buyNow:"Satın Al",generalError:"Bir sorun oluştu, lütfen tekrar deneyin."},da:{loading:"Indlæser…",noContent:"Der er ingen bonusgenstande tilgængelige til indløsning.",networkProblem:"Netværksproblem. Genindlæs venligst siden.",tokens:"Tokens",buyNow:"Køb nu",generalError:"Noget gik galt. Prøv venligst igen."},de:{loading:"Wird geladen…",noContent:"Es sind keine Bonusartikel zum Einlösen verfügbar.",networkProblem:"Netzwerkproblem. Bitte lade die Seite neu.",tokens:"Token",buyNow:"Jetzt kaufen",generalError:"Etwas ist schiefgelaufen. Bitte versuche es erneut."},nl:{loading:"Laden…",noContent:"Er zijn geen bonusitems beschikbaar om in te wisselen.",networkProblem:"Netwerkprobleem. Laad de pagina opnieuw.",tokens:"Tokens",buyNow:"Nu kopen",generalError:"Er is iets misgegaan. Probeer het opnieuw."},fr:{loading:"Chargement…",noContent:"Aucun bonus n'est disponible pour être échangé.",networkProblem:"Problème de réseau. Veuillez recharger la page.",tokens:"Jetons",buyNow:"Acheter",generalError:"Une erreur s'est produite. Veuillez réessayer."},hu:{loading:"Betöltés…",noContent:"Nincsenek beváltható bónuszok.",networkProblem:"Hálózati probléma. Kérjük, töltsd újra az oldalt.",tokens:"Tokenek",buyNow:"Vásárlás",generalError:"Hiba történt. Kérjük, próbáld újra."}},we="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";var Ee=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),xe=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Se=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),qe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Ie=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),Le=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Te=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Me={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
1
+ var B=(f,o,l)=>new Promise((r,y)=>{var d=a=>{try{c(l.next(a))}catch(_){y(_)}},p=a=>{try{c(l.throw(a))}catch(_){y(_)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(d,p);c((l=l.apply(f,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-ChnSUs6d.cjs"),be=require("./LoyaltyShopItem-DpFV9qnk.cjs");if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-ChnSUs6d.cjs")).then(o=>o.LoyaltyPagination_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}if(typeof window!="undefined"){let f=function(o){return function(...l){try{return o.apply(this,l)}catch(r){if(r instanceof DOMException&&r.message.includes("has already been used with this registry")||r instanceof Error&&r.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw r}}};customElements.define=f(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-DpFV9qnk.cjs")).then(o=>o.LoyaltyShopItem_ce).then(o=>{const l=o.default||o;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",l.element||l)}).catch(o=>{console.error("BOOT ERROR:",o)})}const ke={en:{loading:"Loading…",noContent:"There are no bonus items available for redemption.",networkProblem:"Network problem. Please reload.",tokens:"Tokens",buyNow:"Buy Now",generalError:"Something went wrong... Please try again."},tr:{loading:"Yükleniyor…",noContent:"Kullanılabilir bonus öğesi bulunmamaktadır.",networkProblem:"Ağ sorunu. Lütfen yeniden yükleyin.",tokens:"Tokens",buyNow:"Satın Al",generalError:"Bir sorun oluştu, lütfen tekrar deneyin."},da:{loading:"Indlæser…",noContent:"Der er ingen bonusgenstande tilgængelige til indløsning.",networkProblem:"Netværksproblem. Genindlæs venligst siden.",tokens:"Tokens",buyNow:"Køb nu",generalError:"Noget gik galt. Prøv venligst igen."},de:{loading:"Wird geladen…",noContent:"Es sind keine Bonusartikel zum Einlösen verfügbar.",networkProblem:"Netzwerkproblem. Bitte lade die Seite neu.",tokens:"Token",buyNow:"Jetzt kaufen",generalError:"Etwas ist schiefgelaufen. Bitte versuche es erneut."},nl:{loading:"Laden…",noContent:"Er zijn geen bonusitems beschikbaar om in te wisselen.",networkProblem:"Netwerkprobleem. Laad de pagina opnieuw.",tokens:"Tokens",buyNow:"Nu kopen",generalError:"Er is iets misgegaan. Probeer het opnieuw."},fr:{loading:"Chargement…",noContent:"Aucun bonus n'est disponible pour être échangé.",networkProblem:"Problème de réseau. Veuillez recharger la page.",tokens:"Jetons",buyNow:"Acheter",generalError:"Une erreur s'est produite. Veuillez réessayer."},hu:{loading:"Betöltés…",noContent:"Nincsenek beváltható bónuszok.",networkProblem:"Hálózati probléma. Kérjük, töltsd újra az oldalt.",tokens:"Tokenek",buyNow:"Vásárlás",generalError:"Hiba történt. Kérjük, próbáld újra."}},we="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";var Ee=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),xe=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Se=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),qe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Ie=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),Le=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Te=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Me={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
2
2
  90deg,
3
3
  var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
4
4
  color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
@@ -23,5 +23,5 @@ var F=(f,o,l)=>new Promise((i,y)=>{var d=r=>{try{c(l.next(r))}catch(v){y(v)}},p=
23
23
  }
24
24
 
25
25
  @media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
26
- }`};function V(f,o){e.push(o,!0),e.append_styles(f,Me);const l=()=>e.store_get(e.$format,"$_",i),[i,y]=e.setup_stores(),d=e.prop(o,"apiEndpoint",7,""),p=e.prop(o,"userSession",7,""),c=e.prop(o,"locale",7,""),r=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),v=e.prop(o,"translationUrl");e.setupI18n({withLocale:c(),translations:{}});const G=()=>F(this,null,function*(){try{const t=new URL(v(),window.location.href),n=yield fetch(t.href);if(!n.ok)throw new Error("Failed to fetch translations");const s=yield n.json();Object.entries(s).forEach(([a,h])=>{e.addNewMessages(a,h)})}catch(t){console.error("loyalty shop translation url err:",t)}});Object.entries(ke).forEach(([t,n])=>{e.addNewMessages(t,n)});let m=e.state(e.proxy([])),x=e.state(void 0),L=e.state(0),b=e.state(0),w=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),N=e.state(!1),O=e.state(!1),S=e.state(void 0),k=e.state(!1),T=e.state(void 0),M=0;const Q=e.user_derived(()=>typeof r()=="number"?r():parseInt(r(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),H=()=>{if(!d()||!p())return;e.set(N,!0),e.set(O,!1);const t=++M,n=e.get(k)&&e.get(b)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:p(),locale:c()},e.get(b),e.get(w)).then(s=>{var h,_;if(t!==M)return;const a=(h=s.data)!=null?h:[];e.set(L,(_=s.total)!=null?_:0,!0),n?e.set(m,[...e.get(m),...a],!0):e.set(m,a,!0)}).catch(s=>{t===M&&(e.set(O,!0),console.error("Failed to load shop rewards:",s))}).finally(()=>{t===M&&e.set(N,!1)})};e.user_effect(()=>{d(),p(),c(),e.get(b),e.get(w),H()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),n=s=>{e.set(k,s.matches,!0)};return e.set(k,t.matches,!0),t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),e.user_effect(()=>{e.set(w,e.get(k)?e.MOBILE_LOAD_ITEMS:e.get(Q),!0)}),e.user_effect(()=>{if(!e.get(k)||!e.get(T))return;const t=new IntersectionObserver(n=>{n.some(s=>s.isIntersecting)&&e.get(m).length<e.get(L)&&e.set(b,e.get(b)+e.get(w))},{rootMargin:"200px"});return t.observe(e.get(T)),()=>t.disconnect()}),e.user_pre_effect(()=>{v()&&G()});const X=t=>{var n,s,a;return(a=(s=(n=t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?a:we},P=t=>{var n,s,a;return(a=(s=t.displayName)!=null?s:(n=t.presentation)==null?void 0:n.displayName)!=null?a:""},U=t=>t.available==="true",$=t=>{e.get(S)||!U(t)||e.sendRedeemRewardRequested(P(t),t.id)},ee=t=>F(this,null,function*(){if(!(!d()||e.get(S))){e.set(S,t,!0);try{yield e.redeemReward({apiEndpoint:d(),userSession:p()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),H()}catch(n){e.sendRedeemRewardFailed(t,n)}finally{e.set(S,void 0)}}});e.user_effect(()=>{const t=n=>{var _;const{type:s,id:a,source:h}=(_=n.data)!=null?_:{};switch(s){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:a&&e.get(m).some(q=>q.id===a)&&ee(a);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:h===e.SOURCE&&e.set(x,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const te=()=>e.get(m).length?l()("generalError"):l()("noContent"),ne=t=>{e.set(b,t,!0)},oe=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},K=t=>{e.set(x,t,!0),oe(t)},se=t=>n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),K(t))};var le={get apiEndpoint(){return d()},set apiEndpoint(t=""){d(t),e.flushSync()},get userSession(){return p()},set userSession(t=""){p(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get limitItem(){return r()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){r(t),e.flushSync()},get translationUrl(){return v()},set translationUrl(t){v(t),e.flushSync()}},D=Te(),re=e.child(D);{var ae=t=>{be.LoyaltyShopItem(t,{get itemId(){return e.get(x).id},get elevateReward(){return e.get(x)},get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return c()}})},ie=t=>{var n=xe();e.each(n,21,()=>Array(e.get(w)),e.index,(s,a,h,_)=>{var q=Ee();e.append(s,q)}),e.reset(n),e.append(t,n)},de=t=>{var n=Se(),s=e.child(n,!0);e.reset(n),e.template_effect(a=>e.set_text(s,a),[()=>te()]),e.append(t,n)},pe=t=>{var n=Le(),s=e.first_child(n);e.each(s,21,()=>e.get(m),u=>u.id,(u,g)=>{var E=qe();let Y;var I=e.child(E),ge=e.user_derived(()=>se(e.get(g))),Z=e.child(I);e.reset(I);var A=e.sibling(I,2),ue=e.child(A,!0);e.reset(A);var z=e.sibling(A,2),fe=e.child(z);e.reset(z);var C=e.sibling(z,2),me=e.child(C,!0);e.reset(C),e.reset(E),e.template_effect((B,R,he,ye,j,ve,_e)=>{var J;Y=e.set_class(E,1,"loyalty-shop__item svelte-1f1q033",null,Y,B),e.set_attribute(Z,"src",R),e.set_attribute(Z,"alt",he),e.set_text(ue,ye),e.set_text(fe,`${(J=e.get(g).points)!=null?J:""}
27
- ${j!=null?j:""}`),C.disabled=ve,e.set_text(me,_e)},[()=>({"loyalty-shop__item--unavailable":!U(e.get(g))}),()=>X(e.get(g)),()=>P(e.get(g)),()=>P(e.get(g)),()=>l()("tokens"),()=>!U(e.get(g))||e.get(S)===e.get(g).id,()=>l()("buyNow")]),e.delegated("click",I,()=>K(e.get(g))),e.delegated("keydown",I,function(...B){var R;(R=e.get(ge))==null||R.apply(this,B)}),e.delegated("click",C,()=>$(e.get(g))),e.append(u,E)}),e.reset(s);var a=e.sibling(s,2);{var h=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(b)},get limit(){return e.get(w)},get total(){return e.get(L)},onPageChange:ne,get locale(){return c()}})};e.if_block(a,u=>{e.get(k)||u(h)})}var _=e.sibling(a,2);{var q=u=>{var g=Ie();e.bind_this(g,E=>e.set(T,E),()=>e.get(T)),e.append(u,g)};e.if_block(_,u=>{e.get(k)&&e.get(m).length<e.get(L)&&u(q)})}e.append(t,n)};e.if_block(re,t=>{e.get(x)?t(ae):e.get(N)&&e.get(m).length===0?t(ie,1):!e.get(m).length||e.get(O)?t(de,2):t(pe,-1)})}e.reset(D),e.append(f,D);var ce=e.pop(le);return y(),ce}e.delegate(["click","keydown"]);e.create_custom_element(V,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function W(f,o){e.push(o,!0);let l=e.prop(o,"apiEndpoint",7,""),i=e.prop(o,"userSession",7,""),y=e.prop(o,"locale",7,""),d=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),p=e.prop(o,"translationUrl");var c={get apiEndpoint(){return l()},set apiEndpoint(r=""){l(r),e.flushSync()},get userSession(){return i()},set userSession(r=""){i(r),e.flushSync()},get locale(){return y()},set locale(r=""){y(r),e.flushSync()},get limitItem(){return d()},set limitItem(r=e.ITEMS_LIMIT_DEFAULT){d(r),e.flushSync()},get translationUrl(){return p()},set translationUrl(r){p(r),e.flushSync()}};return V(f,{get apiEndpoint(){return l()},get userSession(){return i()},get locale(){return y()},get limitItem(){return d()},get translationUrl(){return p()}}),e.pop(c)}customElements.define("loyalty-shop",e.create_custom_element(W,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Ce=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=V;exports.LoyaltyShop_ce=Ce;
26
+ }`};function j(f,o){e.push(o,!0),e.append_styles(f,Me);const l=()=>e.store_get(e.$format,"$_",r),[r,y]=e.setup_stores(),d=e.prop(o,"apiEndpoint",7,""),p=e.prop(o,"userSession",7,""),c=e.prop(o,"locale",7,""),a=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),_=e.prop(o,"translationUrl");e.setupI18n({withLocale:c(),translations:{}});const G=()=>B(this,null,function*(){try{const t=new URL(_(),window.location.href),n=yield fetch(t.href);if(!n.ok)throw new Error("Failed to fetch translations");const s=yield n.json();Object.entries(s).forEach(([i,h])=>{e.addNewMessages(i,h)})}catch(t){console.error("loyalty shop translation url err:",t)}});Object.entries(ke).forEach(([t,n])=>{e.addNewMessages(t,n)});let m=e.state(e.proxy([])),x=e.state(void 0),I=e.state(0),b=e.state(0),w=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),R=e.state(!1),N=e.state(!1),S=e.state(void 0),k=e.state(!1),L=e.state(void 0),T=0;const Q=e.user_derived(()=>typeof a()=="number"?a():parseInt(a(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),F=()=>{if(!d()||!p())return;e.set(R,!0),e.set(N,!1);const t=++T,n=e.get(k)&&e.get(b)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:p(),locale:c()},e.get(b),e.get(w)).then(s=>{var h,v;if(t!==T)return;const i=(h=s.data)!=null?h:[];e.set(I,(v=s.total)!=null?v:0,!0),n?e.set(m,[...e.get(m),...i],!0):e.set(m,i,!0)}).catch(s=>{t===T&&(e.set(N,!0),console.error("Failed to load shop rewards:",s))}).finally(()=>{t===T&&e.set(R,!1)})};e.user_effect(()=>{d(),p(),c(),e.get(b),e.get(w),F()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),n=s=>{e.set(k,s.matches,!0)};return e.set(k,t.matches,!0),t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),e.user_effect(()=>{e.set(w,e.get(k)?e.MOBILE_LOAD_ITEMS:e.get(Q),!0)}),e.user_effect(()=>{if(!e.get(k)||!e.get(L))return;const t=new IntersectionObserver(n=>{n.some(s=>s.isIntersecting)&&e.get(m).length<e.get(I)&&e.set(b,e.get(b)+e.get(w))},{rootMargin:"200px"});return t.observe(e.get(L)),()=>t.disconnect()}),e.user_pre_effect(()=>{_()&&G()});const X=t=>{var n,s,i;return(i=(s=(n=t.presentation)==null?void 0:n.assets)==null?void 0:s[0])!=null?i:we},O=t=>{var n,s,i;return(i=(s=t.displayName)!=null?s:(n=t.presentation)==null?void 0:n.displayName)!=null?i:""},P=t=>t.available==="true",$=t=>{e.get(S)||!P(t)||e.sendRedeemRewardRequested(O(t),t.id)},ee=t=>B(this,null,function*(){if(!(!d()||e.get(S))){e.set(S,t,!0);try{yield e.redeemReward({apiEndpoint:d(),userSession:p()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),F()}catch(n){e.sendRedeemRewardFailed(t,n)}finally{e.set(S,void 0)}}});e.user_effect(()=>{const t=n=>{var v;const{type:s,id:i,source:h}=(v=n.data)!=null?v:{};switch(s){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:i&&e.get(m).some(q=>q.id===i)&&ee(i);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:h===e.SOURCE&&e.set(x,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const te=()=>e.get(m).length?l()("generalError"):l()("noContent"),ne=t=>{e.set(b,t,!0)},oe=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},V=t=>{e.set(x,t,!0),oe(t)},se=t=>n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),V(t))};var le={get apiEndpoint(){return d()},set apiEndpoint(t=""){d(t),e.flushSync()},get userSession(){return p()},set userSession(t=""){p(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get limitItem(){return a()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){a(t),e.flushSync()},get translationUrl(){return _()},set translationUrl(t){_(t),e.flushSync()}},U=Te(),ae=e.child(U);{var ie=t=>{be.LoyaltyShopItem(t,{get itemId(){return e.get(x).id},get elevateReward(){return e.get(x)},get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return c()}})},re=t=>{var n=xe();e.each(n,21,()=>Array(e.get(w)),e.index,(s,i,h,v)=>{var q=Ee();e.append(s,q)}),e.reset(n),e.append(t,n)},de=t=>{var n=Se(),s=e.only_child(n,!0);e.template_effect(i=>e.set_text(s,i),[()=>te()]),e.append(t,n)},pe=t=>{var n=Le(),s=e.first_child(n);e.each(s,21,()=>e.get(m),u=>u.id,(u,g)=>{var E=qe();let H;var M=e.child(E),ge=e.user_derived(()=>se(e.get(g))),K=e.only_child(M),Y=e.sibling(M,2),ue=e.only_child(Y,!0),Z=e.sibling(Y,2),fe=e.only_child(Z),D=e.sibling(Z,2),me=e.only_child(D,!0);e.reset(E),e.template_effect((A,C,he,ye,z,_e,ve)=>{var J;H=e.set_class(E,1,"loyalty-shop__item svelte-1f1q033",null,H,{"loyalty-shop__item--unavailable":A}),e.set_attribute(K,"src",C),e.set_attribute(K,"alt",he),e.set_text(ue,ye),e.set_text(fe,`${(J=e.get(g).points)!=null?J:""}
27
+ ${z!=null?z:""}`),D.disabled=_e,e.set_text(me,ve)},[()=>!P(e.get(g)),()=>X(e.get(g)),()=>O(e.get(g)),()=>O(e.get(g)),()=>l()("tokens"),()=>!P(e.get(g))||e.get(S)===e.get(g).id,()=>l()("buyNow")]),e.delegated("click",M,()=>V(e.get(g))),e.delegated("keydown",M,function(...A){var C;(C=e.get(ge))==null||C.apply(this,A)}),e.delegated("click",D,()=>$(e.get(g))),e.append(u,E)}),e.reset(s);var i=e.sibling(s,2);{var h=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(b)},get limit(){return e.get(w)},get total(){return e.get(I)},onPageChange:ne,get locale(){return c()}})};e.if_block(i,u=>{e.get(k)||u(h)})}var v=e.sibling(i,2);{var q=u=>{var g=Ie();e.bind_this(g,E=>e.set(L,E),()=>e.get(L)),e.append(u,g)};e.if_block(v,u=>{e.get(k)&&e.get(m).length<e.get(I)&&u(q)})}e.append(t,n)};e.if_block(ae,t=>{e.get(x)?t(ie):e.get(R)&&e.get(m).length===0?t(re,1):!e.get(m).length||e.get(N)?t(de,2):t(pe,-1)})}e.reset(U),e.append(f,U);var ce=e.pop(le);return y(),ce}e.delegate(["click","keydown"]);e.create_custom_element(j,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function W(f,o){e.push(o,!0);let l=e.prop(o,"apiEndpoint",7,""),r=e.prop(o,"userSession",7,""),y=e.prop(o,"locale",7,""),d=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),p=e.prop(o,"translationUrl");var c={get apiEndpoint(){return l()},set apiEndpoint(a=""){l(a),e.flushSync()},get userSession(){return r()},set userSession(a=""){r(a),e.flushSync()},get locale(){return y()},set locale(a=""){y(a),e.flushSync()},get limitItem(){return d()},set limitItem(a=e.ITEMS_LIMIT_DEFAULT){d(a),e.flushSync()},get translationUrl(){return p()},set translationUrl(a){p(a),e.flushSync()}};return j(f,{get apiEndpoint(){return l()},get userSession(){return r()},get locale(){return y()},get limitItem(){return d()},get translationUrl(){return p()}}),e.pop(c)}customElements.define("loyalty-shop",e.create_custom_element(W,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Ce=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=j;exports.LoyaltyShop_ce=Ce;
@@ -1,21 +1,21 @@
1
- var ee = (f, s, o) => new Promise((r, w) => {
1
+ var X = (f, s, o) => new Promise((r, k) => {
2
2
  var u = (l) => {
3
3
  try {
4
4
  p(o.next(l));
5
- } catch (x) {
6
- w(x);
5
+ } catch (w) {
6
+ k(w);
7
7
  }
8
8
  }, c = (l) => {
9
9
  try {
10
10
  p(o.throw(l));
11
- } catch (x) {
12
- w(x);
11
+ } catch (w) {
12
+ k(w);
13
13
  }
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 { y as Fe, c as he, p as ye, a as Je, b as v, s as We, d as re, z as y, A as de, O as ue, C as U, m as t, E as d, B as Ye, G as ce, S as Ze, i as te, h as I, j as ve, P as T, Q as Ge, u as pe, H as Qe, I as Xe, J as $e, K as et, v as R, k as b, l as tt, n as C, r as k, R as me, T as nt, t as ge, q as K, g as st, o as B, w as at, $ as ot, U as lt, N as fe, L as ne, V as it, W as rt, M as dt, X as ut } from "./LoyaltyPagination-WMbwps-Y.js";
18
- import { L as ct } from "./LoyaltyShopItem-B5HPzm1z.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 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";
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-WMbwps-Y.js").then((s) => s.Y).then((s) => {
36
+ customElements.define = f(customElements.define), import("./LoyaltyPagination-o3rQCgms.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,14 +52,14 @@ if (typeof window != "undefined") {
52
52
  }
53
53
  };
54
54
  };
55
- customElements.define = f(customElements.define), import("./LoyaltyShopItem-B5HPzm1z.js").then((s) => s.a).then((s) => {
55
+ customElements.define = f(customElements.define), import("./LoyaltyShopItem-DxwkafBG.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) => {
59
59
  console.error("BOOT ERROR:", s);
60
60
  });
61
61
  }
62
- const pt = {
62
+ const mt = {
63
63
  en: {
64
64
  loading: "Loading…",
65
65
  noContent: "There are no bonus items available for redemption.",
@@ -116,9 +116,9 @@ const pt = {
116
116
  buyNow: "Vásárlás",
117
117
  generalError: "Hiba történt. Kérjük, próbáld újra."
118
118
  }
119
- }, mt = "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";
120
- var gt = R('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'), ft = R('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), ht = R('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), yt = R('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'), vt = R('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), bt = R('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), _t = R('<div class="loyalty-shop svelte-1f1q033"><!></div>');
121
- const kt = {
119
+ }, gt = "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";
120
+ var ft = I('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'), ht = I('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), yt = I('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), vt = I('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'), bt = I('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), _t = I('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), kt = I('<div class="loyalty-shop svelte-1f1q033"><!></div>');
121
+ const wt = {
122
122
  hash: "svelte-1f1q033",
123
123
  code: `.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
124
124
  90deg,
@@ -147,13 +147,13 @@ const kt = {
147
147
  @media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
148
148
  }`
149
149
  };
150
- function be(f, s) {
151
- ye(s, !0), Je(f, kt);
152
- const o = () => at(ot, "$_", r), [r, w] = tt(), u = v(s, "apiEndpoint", 7, ""), c = v(s, "userSession", 7, ""), p = v(s, "locale", 7, ""), l = v(s, "limitItem", 7, T), x = v(s, "translationUrl");
150
+ function _e(f, s) {
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");
153
153
  We({ withLocale: p(), translations: {} });
154
- const ke = () => ee(this, null, function* () {
154
+ const we = () => X(this, null, function* () {
155
155
  try {
156
- const e = new URL(x(), window.location.href), n = yield fetch(e.href);
156
+ const e = new URL(w(), window.location.href), n = yield fetch(e.href);
157
157
  if (!n.ok)
158
158
  throw new Error("Failed to fetch translations");
159
159
  const a = yield n.json();
@@ -164,101 +164,101 @@ function be(f, s) {
164
164
  console.error("loyalty shop translation url err:", e);
165
165
  }
166
166
  });
167
- Object.entries(pt).forEach(([e, n]) => {
167
+ Object.entries(mt).forEach(([e, n]) => {
168
168
  re(e, n);
169
169
  });
170
- let h = y(de([])), M = y(void 0), A = y(0), q = y(0), L = y(de(ue)), F = y(!1), J = y(!1), O = y(void 0), S = y(!1), D = y(void 0), j = 0;
171
- const we = pe(() => typeof l() == "number" ? l() : parseInt(l(), T) || T), se = () => {
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 = () => {
172
172
  if (!u() || !c())
173
173
  return;
174
- d(F, !0), d(J, !1);
175
- const e = ++j, n = t(S) && t(q) > 0;
176
- Ge(
174
+ d(K, !0), d(F, !1);
175
+ const e = ++A, n = t(q) && t(E) > 0;
176
+ Qe(
177
177
  {
178
178
  apiEndpoint: u(),
179
179
  userSession: c(),
180
180
  locale: p()
181
181
  },
182
- t(q),
183
- t(L)
182
+ t(E),
183
+ t(C)
184
184
  ).then((a) => {
185
- var _, E;
186
- if (e !== j)
185
+ var _, x;
186
+ if (e !== A)
187
187
  return;
188
188
  const i = (_ = a.data) != null ? _ : [];
189
- d(A, (E = a.total) != null ? E : 0, !0), n ? d(h, [...t(h), ...i], !0) : d(h, i, !0);
189
+ d(U, (x = a.total) != null ? x : 0, !0), n ? d(h, [...t(h), ...i], !0) : d(h, i, !0);
190
190
  }).catch((a) => {
191
- e === j && (d(J, !0), console.error("Failed to load shop rewards:", a));
191
+ e === A && (d(F, !0), console.error("Failed to load shop rewards:", a));
192
192
  }).finally(() => {
193
- e === j && d(F, !1);
193
+ e === A && d(K, !1);
194
194
  });
195
195
  };
196
- U(() => {
197
- u(), c(), p(), t(q), t(L), se();
198
- }), U(() => {
196
+ O(() => {
197
+ u(), c(), p(), t(E), t(C), te();
198
+ }), O(() => {
199
199
  const e = window.matchMedia("(max-width: 767px)"), n = (a) => {
200
- d(S, a.matches, !0);
200
+ d(q, a.matches, !0);
201
201
  };
202
- return d(S, e.matches, !0), e.addEventListener("change", n), () => e.removeEventListener("change", n);
203
- }), U(() => {
204
- d(L, t(S) ? ue : t(we), !0);
205
- }), U(() => {
206
- if (!t(S) || !t(D)) return;
202
+ return d(q, e.matches, !0), e.addEventListener("change", n), () => e.removeEventListener("change", n);
203
+ }), O(() => {
204
+ d(C, t(q) ? ue : t(xe), !0);
205
+ }), O(() => {
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(A) && d(q, t(q) + t(L));
209
+ n.some((a) => a.isIntersecting) && t(h).length < t(U) && d(E, t(E) + t(C));
210
210
  },
211
211
  { rootMargin: "200px" }
212
212
  );
213
- return e.observe(t(D)), () => e.disconnect();
213
+ return e.observe(t(B)), () => e.disconnect();
214
214
  }), Ye(() => {
215
- x() && ke();
215
+ w() && we();
216
216
  });
217
- const xe = (e) => {
217
+ const Ee = (e) => {
218
218
  var n, a, i;
219
- return (i = (a = (n = e.presentation) == null ? void 0 : n.assets) == null ? void 0 : a[0]) != null ? i : mt;
220
- }, W = (e) => {
219
+ return (i = (a = (n = e.presentation) == null ? void 0 : n.assets) == null ? void 0 : a[0]) != null ? i : gt;
220
+ }, Z = (e) => {
221
221
  var n, a, i;
222
222
  return (i = (a = e.displayName) != null ? a : (n = e.presentation) == null ? void 0 : n.displayName) != null ? i : "";
223
- }, Y = (e) => e.available === "true", Ee = (e) => {
224
- t(O) || !Y(e) || dt(W(e), e.id);
225
- }, qe = (e) => ee(this, null, function* () {
226
- if (!(!u() || t(O))) {
227
- d(O, e, !0);
223
+ }, J = (e) => e.available === "true", qe = (e) => {
224
+ t(T) || !J(e) || ut(Z(e), e.id);
225
+ }, Se = (e) => X(this, null, function* () {
226
+ if (!(!u() || t(T))) {
227
+ d(T, e, !0);
228
228
  try {
229
- yield Qe({ apiEndpoint: u(), userSession: c() }, e), Xe(e), $e(), se();
229
+ yield Xe({ apiEndpoint: u(), userSession: c() }, e), $e(e), et(), te();
230
230
  } catch (n) {
231
- et(e, n);
231
+ tt(e, n);
232
232
  } finally {
233
- d(O, void 0);
233
+ d(T, void 0);
234
234
  }
235
235
  }
236
236
  });
237
- U(() => {
237
+ O(() => {
238
238
  const e = (n) => {
239
- var E;
240
- const { type: a, id: i, source: _ } = (E = n.data) != null ? E : {};
239
+ var x;
240
+ const { type: a, id: i, source: _ } = (x = n.data) != null ? x : {};
241
241
  switch (a) {
242
242
  case ce.REDEEM_REWARD_CONFIRMED:
243
- i && t(h).some((z) => z.id === i) && qe(i);
243
+ i && t(h).some((M) => M.id === i) && Se(i);
244
244
  break;
245
245
  case ce.BACK_BUTTON_CLICKED:
246
- _ === Ze && d(M, void 0);
246
+ _ === Ge && d(N, void 0);
247
247
  break;
248
248
  }
249
249
  };
250
250
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
251
251
  });
252
- const Se = () => t(h).length ? o()("generalError") : o()("noContent"), Ie = (e) => {
253
- d(q, e, !0);
254
- }, Ce = (e) => {
255
- ut(e.displayName || e.presentation.displayName, e.id);
256
- }, ae = (e) => {
257
- d(M, e, !0), Ce(e);
258
- }, Re = (e) => (n) => {
259
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), ae(e));
252
+ const Ie = () => t(h).length ? o()("generalError") : o()("noContent"), Ce = (e) => {
253
+ d(E, e, !0);
254
+ }, Re = (e) => {
255
+ ct(e.displayName || e.presentation.displayName, e.id);
256
+ }, ne = (e) => {
257
+ d(N, e, !0), Re(e);
258
+ }, Le = (e) => (n) => {
259
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), ne(e));
260
260
  };
261
- var Le = {
261
+ var Ne = {
262
262
  get apiEndpoint() {
263
263
  return u();
264
264
  },
@@ -280,24 +280,24 @@ function be(f, s) {
280
280
  get limitItem() {
281
281
  return l();
282
282
  },
283
- set limitItem(e = T) {
283
+ set limitItem(e = L) {
284
284
  l(e), b();
285
285
  },
286
286
  get translationUrl() {
287
- return x();
287
+ return w();
288
288
  },
289
289
  set translationUrl(e) {
290
- x(e), b();
290
+ w(e), b();
291
291
  }
292
- }, Z = _t(), Ne = C(Z);
292
+ }, W = kt(), Te = me(W);
293
293
  {
294
- var Te = (e) => {
295
- ct(e, {
294
+ var Me = (e) => {
295
+ pt(e, {
296
296
  get itemId() {
297
- return t(M).id;
297
+ return t(N).id;
298
298
  },
299
299
  get elevateReward() {
300
- return t(M);
300
+ return t(N);
301
301
  },
302
302
  get apiEndpoint() {
303
303
  return u();
@@ -309,95 +309,87 @@ function be(f, s) {
309
309
  return p();
310
310
  }
311
311
  });
312
- }, Me = (e) => {
313
- var n = ft();
314
- me(n, 21, () => Array(t(L)), nt, (a, i, _, E) => {
315
- var z = gt();
316
- I(a, z);
317
- }), k(n), I(e, n);
318
312
  }, Oe = (e) => {
319
- var n = ht(), a = C(n, !0);
320
- k(n), ge((i) => K(a, i), [() => Se()]), I(e, n);
313
+ var n = ht();
314
+ ge(n, 21, () => Array(t(C)), st, (a, i, _, x) => {
315
+ var M = ft();
316
+ S(a, M);
317
+ }), V(n), S(e, n);
321
318
  }, ze = (e) => {
322
- var n = bt(), a = st(n);
323
- me(a, 21, () => t(h), (g) => g.id, (g, m) => {
324
- var N = yt();
325
- let oe;
326
- var P = C(N), Ue = pe(() => Re(t(m))), le = C(P);
327
- k(P);
328
- var G = B(P, 2), Be = C(G, !0);
329
- k(G);
330
- var Q = B(G, 2), Ae = C(Q);
331
- k(Q);
332
- var V = B(Q, 2), De = C(V, !0);
333
- k(V), k(N), ge(
334
- (X, H, je, Ve, $, He, Ke) => {
319
+ var n = yt(), a = z(n, !0);
320
+ fe((i) => H(a, i), [() => Ie()]), S(e, n);
321
+ }, Pe = (e) => {
322
+ var n = _t(), a = at(n);
323
+ ge(a, 21, () => t(h), (g) => g.id, (g, m) => {
324
+ var R = vt();
325
+ 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
+ (G, j, Ve, He, Q, Ke, Fe) => {
335
329
  var ie;
336
- oe = lt(N, 1, "loyalty-shop__item svelte-1f1q033", null, oe, X), fe(le, "src", H), fe(le, "alt", je), K(Be, Ve), K(Ae, `${(ie = t(m).points) != null ? ie : ""}
337
- ${$ != null ? $ : ""}`), V.disabled = He, K(De, Ke);
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 : ""}
331
+ ${Q != null ? Q : ""}`), Y.disabled = Ke, H(je, Fe);
338
332
  },
339
333
  [
340
- () => ({
341
- "loyalty-shop__item--unavailable": !Y(t(m))
342
- }),
343
- () => xe(t(m)),
344
- () => W(t(m)),
345
- () => W(t(m)),
334
+ () => !J(t(m)),
335
+ () => Ee(t(m)),
336
+ () => Z(t(m)),
337
+ () => Z(t(m)),
346
338
  () => o()("tokens"),
347
- () => !Y(t(m)) || t(O) === t(m).id,
339
+ () => !J(t(m)) || t(T) === t(m).id,
348
340
  () => o()("buyNow")
349
341
  ]
350
- ), ne("click", P, () => ae(t(m))), ne("keydown", P, function(...X) {
351
- var H;
352
- (H = t(Ue)) == null || H.apply(this, X);
353
- }), ne("click", V, () => Ee(t(m))), I(g, N);
354
- }), k(a);
355
- var i = B(a, 2);
342
+ ), ee("click", D, () => ne(t(m))), ee("keydown", D, function(...G) {
343
+ var j;
344
+ (j = t(Be)) == null || j.apply(this, G);
345
+ }), ee("click", Y, () => qe(t(m))), S(g, R);
346
+ }), V(a);
347
+ var i = P(a, 2);
356
348
  {
357
349
  var _ = (g) => {
358
- it(g, {
350
+ rt(g, {
359
351
  get offset() {
360
- return t(q);
352
+ return t(E);
361
353
  },
362
354
  get limit() {
363
- return t(L);
355
+ return t(C);
364
356
  },
365
357
  get total() {
366
- return t(A);
358
+ return t(U);
367
359
  },
368
- onPageChange: Ie,
360
+ onPageChange: Ce,
369
361
  get locale() {
370
362
  return p();
371
363
  }
372
364
  });
373
365
  };
374
- te(i, (g) => {
375
- t(S) || g(_);
366
+ $(i, (g) => {
367
+ t(q) || g(_);
376
368
  });
377
369
  }
378
- var E = B(i, 2);
370
+ var x = P(i, 2);
379
371
  {
380
- var z = (g) => {
381
- var m = vt();
382
- rt(m, (N) => d(D, N), () => t(D)), I(g, m);
372
+ var M = (g) => {
373
+ var m = bt();
374
+ dt(m, (R) => d(B, R), () => t(B)), S(g, m);
383
375
  };
384
- te(E, (g) => {
385
- t(S) && t(h).length < t(A) && g(z);
376
+ $(x, (g) => {
377
+ t(q) && t(h).length < t(U) && g(M);
386
378
  });
387
379
  }
388
- I(e, n);
380
+ S(e, n);
389
381
  };
390
- te(Ne, (e) => {
391
- t(M) ? e(Te) : t(F) && t(h).length === 0 ? e(Me, 1) : !t(h).length || t(J) ? e(Oe, 2) : e(ze, -1);
382
+ $(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);
392
384
  });
393
385
  }
394
- k(Z), I(f, Z);
395
- var Pe = ve(Le);
396
- return w(), Pe;
386
+ V(W), S(f, W);
387
+ var Ue = be(Ne);
388
+ return k(), Ue;
397
389
  }
398
- Fe(["click", "keydown"]);
399
- he(
400
- be,
390
+ Ze(["click", "keydown"]);
391
+ ye(
392
+ _e,
401
393
  {
402
394
  apiEndpoint: {},
403
395
  userSession: {},
@@ -409,9 +401,9 @@ he(
409
401
  [],
410
402
  { mode: "open" }
411
403
  );
412
- function _e(f, s) {
413
- ye(s, !0);
414
- let o = v(s, "apiEndpoint", 7, ""), r = v(s, "userSession", 7, ""), w = v(s, "locale", 7, ""), u = v(s, "limitItem", 7, T), c = v(s, "translationUrl");
404
+ function ke(f, s) {
405
+ 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");
415
407
  var p = {
416
408
  get apiEndpoint() {
417
409
  return o();
@@ -426,15 +418,15 @@ function _e(f, s) {
426
418
  r(l), b();
427
419
  },
428
420
  get locale() {
429
- return w();
421
+ return k();
430
422
  },
431
423
  set locale(l = "") {
432
- w(l), b();
424
+ k(l), b();
433
425
  },
434
426
  get limitItem() {
435
427
  return u();
436
428
  },
437
- set limitItem(l = T) {
429
+ set limitItem(l = L) {
438
430
  u(l), b();
439
431
  },
440
432
  get translationUrl() {
@@ -444,7 +436,7 @@ function _e(f, s) {
444
436
  c(l), b();
445
437
  }
446
438
  };
447
- return be(f, {
439
+ return _e(f, {
448
440
  get apiEndpoint() {
449
441
  return o();
450
442
  },
@@ -452,7 +444,7 @@ function _e(f, s) {
452
444
  return r();
453
445
  },
454
446
  get locale() {
455
- return w();
447
+ return k();
456
448
  },
457
449
  get limitItem() {
458
450
  return u();
@@ -460,10 +452,10 @@ function _e(f, s) {
460
452
  get translationUrl() {
461
453
  return c();
462
454
  }
463
- }), ve(p);
455
+ }), be(p);
464
456
  }
465
- customElements.define("loyalty-shop", he(
466
- _e,
457
+ customElements.define("loyalty-shop", ye(
458
+ ke,
467
459
  {
468
460
  apiEndpoint: {},
469
461
  userSession: {},
@@ -474,11 +466,11 @@ customElements.define("loyalty-shop", he(
474
466
  [],
475
467
  []
476
468
  ));
477
- const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
469
+ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
478
470
  __proto__: null,
479
- default: _e
471
+ default: ke
480
472
  }, Symbol.toStringTag, { value: "Module" }));
481
473
  export {
482
- be as L,
483
- qt as a
474
+ _e as L,
475
+ St as a
484
476
  };