@everymatrix/casino-categories 1.0.16 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -569,19 +569,19 @@ e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"}
569
569
  PERFORMANCE OF THIS SOFTWARE.
570
570
  ***************************************************************************** */function Ut(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}const Gt={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Dt(){return Gt}const $t=D(!1);let xt;const kt=D(null);function Ft(e){return e.split("-").map(((e,t,r)=>r.slice(0,t+1).join("-"))).reverse()}function jt(e,t=Dt().fallbackLocale){const r=Ft(e);return t?[...new Set([...r,...Ft(t)])]:r}function Vt(){return null!=xt?xt:void 0}kt.subscribe((e=>{xt=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const Xt=Object.assign(Object.assign({},kt),{set:e=>{if(e&&function(e){if(null==e)return;const t=jt(e);for(let e=0;e<t.length;e++){const r=t[e];if(St(r))return r}}(e)&&wt(e)){const{loadingDelay:t}=Dt();let r;return"undefined"!=typeof window&&null!=Vt()&&t?r=window.setTimeout((()=>$t.set(!0)),t):$t.set(!0),Rt(e).then((()=>{kt.set(e)})).finally((()=>{clearTimeout(r),$t.set(!1)}))}return kt.set(e)}}),Kt=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}},Yt=(e,t)=>{const{formats:r}=Dt();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Zt=Kt((e=>{var{locale:t,format:r}=e,n=Ut(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(n=Yt("number",r)),new Intl.NumberFormat(t,n)})),zt=Kt((e=>{var{locale:t,format:r}=e,n=Ut(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?n=Yt("date",r):0===Object.keys(n).length&&(n=Yt("date","short")),new Intl.DateTimeFormat(t,n)})),Wt=Kt((e=>{var{locale:t,format:r}=e,n=Ut(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?n=Yt("time",r):0===Object.keys(n).length&&(n=Yt("time","short")),new Intl.DateTimeFormat(t,n)})),Qt=Kt(((e,t=Vt())=>new Ht(e,t,Dt().formats,{ignoreTag:Dt().ignoreTag}))),Jt=(e,t={})=>{var r,n,i,o;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:h=Vt(),default:l}=s;if(null==h)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let c=Bt(e,h);if(c){if("string"!=typeof c)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),c}else c=null!==(o=null!==(i=null===(n=(r=Dt()).handleMissingMessage)||void 0===n?void 0:n.call(r,{locale:h,id:e,defaultValue:l}))&&void 0!==i?i:l)&&void 0!==o?o:e;if(!a)return c;let u=c;try{u=Qt(c,h).format(a)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return u},qt=(e,t)=>((e={})=>{var{locale:t=Vt()}=e,r=Ut(e,["locale"]);return Wt(Object.assign({locale:t},r))})(t).format(e),er=(e,t)=>((e={})=>{var{locale:t=Vt()}=e,r=Ut(e,["locale"]);return zt(Object.assign({locale:t},r))})(t).format(e),tr=(e,t)=>((e={})=>{var{locale:t=Vt()}=e,r=Ut(e,["locale"]);return Zt(Object.assign({locale:t},r))})(t).format(e),rr=(e,t=Vt())=>Bt(e,t),nr=$([Xt,Lt],(()=>Jt));function ir(e,t){Ot(e,t)}$([Xt],(()=>qt)),$([Xt],(()=>er)),$([Xt],(()=>tr)),$([Xt,Lt],(()=>rr));const or={en:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},zh:{Translations:{topCategories:"热门类别",otherCategories:"其他类别",loading:"加载请稍候...",games:"游戏"}},de:{Translations:{topCategories:"Top Kategorien",otherCategories:"Andere Kategorien",loading:"Es lädt, bitte warten...",games:"Spiele"}},it:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},fr:{Translations:{topCategories:"Catégories principales",otherCategories:"Autres catégories",loading:"Chargement, veuillez patienter...",games:"jeux"}},es:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},tr:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},ru:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},ro:{Translations:{topCategories:"Categorii de top",otherCategories:"Alte categorii",loading:"Se incarca, te rugam asteapta…",games:"jocuri"}},hr:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},hu:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},pl:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},pt:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},sl:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}},sr:{Translations:{topCategories:"Top Categories",otherCategories:"Other Categories",loading:"Loading, please wait...",games:"games"}}};
571
571
  /* src/CasinoCategories.svelte generated by Svelte v3.48.0 */function sr(e,t,r){const n=e.slice();return n[24]=t[r],n}function ar(e,t,r){const n=e.slice();return n[24]=t[r],n}
572
- // (82:2) {:else}
572
+ // (80:2) {:else}
573
573
  function hr(e){let t,r,n,i,o,s,a,h,l=/*$_*/e[5]("Translations.topCategories")+"",E=/*$_*/e[5]("Translations.otherCategories")+"",T=/*topCategories*/e[3],v=[];for(let t=0;t<T.length;t+=1)v[t]=cr(ar(e,T,t));let H=/*otherCategories*/e[4],_=[];for(let t=0;t<H.length;t+=1)_[t]=ur(sr(e,H,t));return{c(){t=g("div"),r=g("h4"),n=m(l),i=d();for(let e=0;e<v.length;e+=1)v[e].c();o=d(),s=g("h4"),a=m(E),h=d();for(let e=0;e<_.length;e+=1)_[e].c();b(r,"class","CategoryTitle"),b(s,"class","CategoryTitle"),b(t,"class","CasinoCategories")},m(e,l){u(e,t,l),c(t,r),c(r,n),c(t,i);for(let e=0;e<v.length;e+=1)v[e].m(t,null);c(t,o),c(t,s),c(s,a),c(t,h);for(let e=0;e<_.length;e+=1)_[e].m(t,null)},p(e,r){if(/*$_*/32&r&&l!==(l=/*$_*/e[5]("Translations.topCategories")+"")&&y(n,l),/*activecategory, topCategories, $_, openGameCategory*/105&r){let n;for(T=/*topCategories*/e[3],n=0;n<T.length;n+=1){const i=ar(e,T,n);v[n]?v[n].p(i,r):(v[n]=cr(i),v[n].c(),v[n].m(t,o))}for(;n<v.length;n+=1)v[n].d(1);v.length=T.length}if(/*$_*/32&r&&E!==(E=/*$_*/e[5]("Translations.otherCategories")+"")&&y(a,E),/*activecategory, otherCategories, $_, openGameCategory*/113&r){let n;for(H=/*otherCategories*/e[4],n=0;n<H.length;n+=1){const i=sr(e,H,n);_[n]?_[n].p(i,r):(_[n]=ur(i),_[n].c(),_[n].m(t,null))}for(;n<_.length;n+=1)_[n].d(1);_.length=H.length}},d(e){e&&f(t),p(v,e),p(_,e)}}}
574
- // (80:2) {#if isLoading}
574
+ // (78:2) {#if isLoading}
575
575
  function lr(t){let r;return{c(){r=g("p"),r.textContent="Loading, please wait...",b(r,"class","Message")},m(e,t){u(e,r,t)},p:e,d(e){e&&f(r)}}}
576
- // (85:4) {#each topCategories as category}
576
+ // (83:4) {#each topCategories as category}
577
577
  function cr(e){let t,r,n,i,o,s,a,l,p,T,v,H,_,C,B,A,L=/*category*/e[24].name+"",S=/*category*/e[24].games.count+"",P=/*$_*/e[5]("Translations.games")+"";function O(){/*click_handler*/
578
578
  return e[14](/*category*/e[24])}return{c(){t=g("div"),r=g("img"),o=d(),s=g("div"),a=g("p"),l=m(L),p=d(),T=g("p"),v=m(S),H=d(),_=m(P),h(r.src,n=/*category*/e[24].icon)||b(r,"src",n),b(r,"alt",i=/*category*/e[24].name),b(r,"class","CategoryImage"),b(s,"class","CategoryTextContainer"),b(t,"class",C="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))},m(e,n){u(e,t,n),c(t,r),c(t,o),c(t,s),c(s,a),c(a,l),c(s,p),c(s,T),c(T,v),c(T,H),c(T,_),B||(A=E(r,"click",O),B=!0)},p(o,s){e=o,/*topCategories*/8&s&&!h(r.src,n=/*category*/e[24].icon)&&b(r,"src",n),/*topCategories*/8&s&&i!==(i=/*category*/e[24].name)&&b(r,"alt",i),/*topCategories*/8&s&&L!==(L=/*category*/e[24].name+"")&&y(l,L),/*topCategories*/8&s&&S!==(S=/*category*/e[24].games.count+"")&&y(v,S),/*$_*/32&s&&P!==(P=/*$_*/e[5]("Translations.games")+"")&&y(_,P),/*activecategory, topCategories*/9&s&&C!==(C="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))&&b(t,"class",C)},d(e){e&&f(t),B=!1,A()}}}
579
- // (95:4) {#each otherCategories as category}
579
+ // (93:4) {#each otherCategories as category}
580
580
  function ur(e){let t,r,n,i,o,s,a,l,p,T,v,H,_,C,B,A,L,S=/*category*/e[24].name+"",P=/*category*/e[24].games.count+"",O=/*$_*/e[5]("Translations.games")+"";function N(){/*click_handler_1*/
581
581
  return e[15](/*category*/e[24])}return{c(){t=g("div"),r=g("img"),o=d(),s=g("div"),a=g("p"),l=m(S),p=d(),T=g("p"),v=m(P),H=d(),_=m(O),C=d(),h(r.src,n=/*category*/e[24].icon)||b(r,"src",n),b(r,"alt",i=/*category*/e[24].name),b(r,"class","CategoryImage"),b(s,"class","CategoryTextContainer"),b(t,"class",B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))},m(e,n){u(e,t,n),c(t,r),c(t,o),c(t,s),c(s,a),c(a,l),c(s,p),c(s,T),c(T,v),c(T,H),c(T,_),c(t,C),A||(L=E(r,"click",N),A=!0)},p(o,s){e=o,/*otherCategories*/16&s&&!h(r.src,n=/*category*/e[24].icon)&&b(r,"src",n),/*otherCategories*/16&s&&i!==(i=/*category*/e[24].name)&&b(r,"alt",i),/*otherCategories*/16&s&&S!==(S=/*category*/e[24].name+"")&&y(l,S),/*otherCategories*/16&s&&P!==(P=/*category*/e[24].games.count+"")&&y(v,P),/*$_*/32&s&&O!==(O=/*$_*/e[5]("Translations.games")+"")&&y(_,O),/*activecategory, otherCategories*/17&s&&B!==(B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))&&b(t,"class",B)},d(e){e&&f(t),A=!1,L()}}}function fr(t){let r;function n(e,t){/*isLoading*/
582
582
  return e[2]?lr:hr}let i=n(t),o=i(t);return{c(){r=g("div"),o.c(),this.c=e},m(e,n){u(e,r,n),o.m(r,null),
583
583
  /*div_binding*/t[16](r)},p(e,[t]){i===(i=n(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(r,null)))},i:e,o:e,d(e){e&&f(r),o.d(),
584
584
  /*div_binding*/t[16](null)}}}function pr(e,t,r){let n;var i,o;i=nr,o=e=>r(5,n=e),e.$$.on_destroy.push(l(i,o));let s,{endpoint:a=""}=t,{datasource:h=""}=t,{lang:c="en"}=t,{activecategory:u=""}=t,{excludedflags:f=""}=t,{clientstyling:p=""}=t,{clientstylingurl:g=""}=t,{translationUrl:m=""}=t,d=!1;const E=[];let b=[],y=[];Object.keys(or).forEach((e=>{ir(e,or[e])}));const T=e=>{window.postMessage({type:"OpenGameCategory",categoryId:e})},v=()=>{var e;e=c,Xt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(7,a=e.endpoint),"datasource"in e&&r(8,h=e.datasource),"lang"in e&&r(9,c=e.lang),"activecategory"in e&&r(0,u=e.activecategory),"excludedflags"in e&&r(10,f=e.excludedflags),"clientstyling"in e&&r(11,p=e.clientstyling),"clientstylingurl"in e&&r(12,g=e.clientstylingurl),"translationUrl"in e&&r(13,m=e.translationUrl)},e.$$.update=()=>{/*endpoint, datasource*/384&e.$$.dirty&&a&&h&&(()=>{r(2,d=!0);const e=new URL(`${a}/casino/groups/${h}`);e.searchParams.append("language",c),fetch(e).then((e=>e.json())).then((e=>{r(2,d=!1);const t=f.split(",").map((e=>e.trim()));E.push(...e.items);
585
585
  // remove those items which have a flag matching the excluded flags
586
- const n=E.filter((e=>!t.some((t=>{var r;return(null===(r=e.flags)||void 0===r?void 0:r.indexOf(t))>=0}))));r(3,b=n.filter((e=>!0===e.isTopCategory))),r(4,y=n.filter((e=>!1===e.isTopCategory)))}))})(),/*translationUrl*/8192&e.$$.dirty&&m&&fetch(m).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{ir(t,e[t])}))})).catch((e=>{console.log(e)})),/*lang*/512&e.$$.dirty&&c&&v(),/*clientstyling, customStylingContainer*/2050&e.$$.dirty&&p&&s&&(()=>{let e=document.createElement("style");e.innerHTML=p,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/4098&e.$$.dirty&&g&&s&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,s&&(setTimeout((()=>{s.appendChild(t)}),1),setTimeout((()=>{}),500))}))})()},[u,s,d,b,y,n,T,a,h,c,f,p,g,m,e=>T(e.id),e=>T(e.id),function(e){_[e?"unshift":"push"]((()=>{s=e,r(1,s)}))}]}class gr extends U{constructor(e){super(),this.shadowRoot.innerHTML="<style>:host{font-family:system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'}*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CasinoCategories{display:flex;flex-direction:column;gap:1rem;padding:10px 60px}.CategoryTitle{font-weight:500;position:relative;right:30px;margin:10px 0}.Category{border-radius:7px;display:flex;align-items:center;gap:16px;max-width:300px}.Category.Active{box-shadow:15px 15px 30px #e4e2e2}.CategoryTextContainer{display:flex;flex-direction:column;justify-content:center;gap:10px;font-size:15px}.CategoryTextContainer p:first-child{font-weight:600}.CategoryTextContainer p:last-child{color:#828282;font-weight:300}.CategoryImage{border-radius:4px;object-fit:cover;height:64px;width:64px;font-weight:100}.Message{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-weight:600}</style>",R(this,{target:this.shadowRoot,props:T(this.attributes),customElement:!0},pr,fr,o,{endpoint:7,datasource:8,lang:9,activecategory:0,excludedflags:10,clientstyling:11,clientstylingurl:12,translationUrl:13},null),e&&(e.target&&u(e.target,this,e.anchor),e.props&&(this.$set(e.props),N()))}static get observedAttributes(){return["endpoint","datasource","lang","activecategory","excludedflags","clientstyling","clientstylingurl","translationUrl"]}get endpoint(){return this.$$.ctx[7]}set endpoint(e){this.$$set({endpoint:e}),N()}get datasource(){return this.$$.ctx[8]}set datasource(e){this.$$set({datasource:e}),N()}get lang(){return this.$$.ctx[9]}set lang(e){this.$$set({lang:e}),N()}get activecategory(){return this.$$.ctx[0]}set activecategory(e){this.$$set({activecategory:e}),N()}get excludedflags(){return this.$$.ctx[10]}set excludedflags(e){this.$$set({excludedflags:e}),N()}get clientstyling(){return this.$$.ctx[11]}set clientstyling(e){this.$$set({clientstyling:e}),N()}get clientstylingurl(){return this.$$.ctx[12]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),N()}get translationUrl(){return this.$$.ctx[13]}set translationUrl(e){this.$$set({translationUrl:e}),N()}}return!customElements.get("casino-categories")&&customElements.define("casino-categories",gr),gr}));
586
+ const n=E.filter((e=>!t.some((t=>{var r;return(null===(r=e.flags)||void 0===r?void 0:r.indexOf(t))>=0}))));r(3,b=n.filter((e=>!0===e.isTopCategory))),r(4,y=n.filter((e=>!1===e.isTopCategory)))}))})(),/*translationUrl*/8192&e.$$.dirty&&m&&fetch(m).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{ir(t,e[t])}))})).catch((e=>{console.log(e)})),/*lang*/512&e.$$.dirty&&c&&v(),/*clientstyling, customStylingContainer*/2050&e.$$.dirty&&p&&s&&(()=>{let e=document.createElement("style");e.innerHTML=p,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/4098&e.$$.dirty&&g&&s&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{s.appendChild(t)}),1),setTimeout((()=>{}),500)}))})()},[u,s,d,b,y,n,T,a,h,c,f,p,g,m,e=>T(e.id),e=>T(e.id),function(e){_[e?"unshift":"push"]((()=>{s=e,r(1,s)}))}]}class gr extends U{constructor(e){super(),this.shadowRoot.innerHTML="<style>:host{font-family:system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'}*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CasinoCategories{display:flex;flex-direction:column;gap:1rem;padding:10px 60px}.CategoryTitle{font-weight:500;position:relative;right:30px;margin:10px 0}.Category{border-radius:7px;display:flex;align-items:center;gap:16px;max-width:300px}.Category.Active{box-shadow:15px 15px 30px #e4e2e2}.CategoryTextContainer{display:flex;flex-direction:column;justify-content:center;gap:10px;font-size:15px}.CategoryTextContainer p:first-child{font-weight:600}.CategoryTextContainer p:last-child{color:#828282;font-weight:300}.CategoryImage{border-radius:4px;object-fit:cover;height:64px;width:64px;font-weight:100}.Message{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-weight:600}</style>",R(this,{target:this.shadowRoot,props:T(this.attributes),customElement:!0},pr,fr,o,{endpoint:7,datasource:8,lang:9,activecategory:0,excludedflags:10,clientstyling:11,clientstylingurl:12,translationUrl:13},null),e&&(e.target&&u(e.target,this,e.anchor),e.props&&(this.$set(e.props),N()))}static get observedAttributes(){return["endpoint","datasource","lang","activecategory","excludedflags","clientstyling","clientstylingurl","translationUrl"]}get endpoint(){return this.$$.ctx[7]}set endpoint(e){this.$$set({endpoint:e}),N()}get datasource(){return this.$$.ctx[8]}set datasource(e){this.$$set({datasource:e}),N()}get lang(){return this.$$.ctx[9]}set lang(e){this.$$set({lang:e}),N()}get activecategory(){return this.$$.ctx[0]}set activecategory(e){this.$$set({activecategory:e}),N()}get excludedflags(){return this.$$.ctx[10]}set excludedflags(e){this.$$set({excludedflags:e}),N()}get clientstyling(){return this.$$.ctx[11]}set clientstyling(e){this.$$set({clientstyling:e}),N()}get clientstylingurl(){return this.$$.ctx[12]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),N()}get translationUrl(){return this.$$.ctx[13]}set translationUrl(e){this.$$set({translationUrl:e}),N()}}return!customElements.get("casino-categories")&&customElements.define("casino-categories",gr),gr}));
587
587
  //# sourceMappingURL=casino-categories.js.map