@everymatrix/tournament-details-page 0.0.2 → 0.0.4

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 (29) hide show
  1. package/components/{TournamentDetails-upe3WFia.cjs → TournamentDetails-AYkmST0l.cjs} +5 -5
  2. package/components/{TournamentDetails-CJVSWVXD.js → TournamentDetails-CIK1Vnx8.js} +684 -684
  3. package/components/{TournamentDetails-amGR_-Hv.js → TournamentDetails-glnpe9gf.js} +306 -306
  4. package/components/TournamentDetailsPage-85B_WTCl.cjs +63 -0
  5. package/components/{TournamentDetailsPage-B21wsWnv.js → TournamentDetailsPage-D6daHDII.js} +116 -116
  6. package/components/{TournamentDetailsPage-DW00w9RP.js → TournamentDetailsPage-DCB9anwm.js} +153 -153
  7. package/components/TournamentGames-0RUJ48Xu.js +362 -0
  8. package/components/TournamentGames-3qu_5rFn.cjs +26 -0
  9. package/components/TournamentGames-CDfNoeoq.js +335 -0
  10. package/components/TournamentLeaderboard-5oGHOpP6.js +794 -0
  11. package/components/TournamentLeaderboard-BUiKtCk5.cjs +36 -0
  12. package/components/TournamentLeaderboard-CF-QWN1C.js +810 -0
  13. package/es2015/tournament-details-page.cjs +1 -1
  14. package/es2015/tournament-details-page.js +1 -1
  15. package/esnext/tournament-details-page.js +1 -1
  16. package/package.json +1 -1
  17. package/components/TournamentDetailsPage-BlWvqhbK.js +0 -953
  18. package/components/TournamentDetailsPage-BsjnqhIP.cjs +0 -63
  19. package/components/TournamentDetailsPage-DnknTo0Y.js +0 -976
  20. package/components/TournamentDetailsPage-FO-PGATk.cjs +0 -63
  21. package/components/TournamentGames-B0ap9lHo.cjs +0 -26
  22. package/components/TournamentGames-BqZd-C9h.js +0 -351
  23. package/components/TournamentGames-C0-voJOi.js +0 -324
  24. package/components/TournamentGames-Cb2LP2tF.js +0 -324
  25. package/components/TournamentGames-D5Nyb0Nx.cjs +0 -26
  26. package/components/TournamentGames-DIIgfZ-E.js +0 -351
  27. package/components/TournamentLeaderboard-BjmkrtNX.js +0 -800
  28. package/components/TournamentLeaderboard-C1tIH5FA.js +0 -784
  29. package/components/TournamentLeaderboard-DWYhqHPh.cjs +0 -36
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-AYkmST0l.cjs");function ze(ee,z){e.addMessages(ee,z)}function Ue(ee){e.$locale.set(ee)}const He={en:{rank:"Rank",user:"User",points:"Points",prize:"Prize",notEnrolledRank:"You are currently not enrolled in this torunament",myRanking:"My Ranking",showMore:"Show More",showLess:"Show Less",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"},tr:{rank:"Sıralama",user:"Kullanıcı",points:"Puanlar",prize:"Ödül",notEnrolledRank:"Şu anda bu turnuvaya kayıtlı değilsiniz",myRanking:"Sıralamam",showMore:"Daha Fazla Göster",showLess:"Daha Az Göster",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"}};var Ie={exports:{}};/** @license
2
+ * eventsource.js
3
+ * Available under MIT License (MIT)
4
+ * https://github.com/Yaffle/EventSource/
5
+ */(function(ee,z){(function(y){var U=y.setTimeout,te=y.clearTimeout,j=y.XMLHttpRequest,K=y.XDomainRequest,X=y.ActiveXObject,H=y.EventSource,C=y.document,Ne=y.Promise,A=y.fetch,oe=y.Response,q=y.TextDecoder,fe=y.TextEncoder,W=y.AbortController;if(typeof window!="undefined"&&typeof C!="undefined"&&!("readyState"in C)&&C.body==null&&(C.readyState="loading",window.addEventListener("load",function(t){C.readyState="complete"},!1)),j==null&&X!=null&&(j=function(){return new X("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),W==null){var O=A;A=function(t,o){var i=o.signal;return O(t,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(a){var h=a.body.getReader();return i._reader=h,i._aborted&&i._reader.cancel(),{status:a.status,statusText:a.statusText,headers:a.headers,body:{getReader:function(){return h}}}})},W=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function N(){this.bitsNeeded=0,this.codePoint=0}N.prototype.decode=function(t){function o(c,v,s){if(s===1)return c>=128>>v&&c<<v<=2047;if(s===2)return c>=2048>>v&&c<<v<=55295||c>=57344>>v&&c<<v<=65535;if(s===3)return c>=65536>>v&&c<<v<=1114111;throw new Error}function i(c,v){if(c===6*1)return v>>6>15?3:v>31?2:1;if(c===6*2)return v>15?3:2;if(c===6*3)return 3;throw new Error}for(var a=65533,h="",d=this.bitsNeeded,r=this.codePoint,l=0;l<t.length;l+=1){var n=t[l];d!==0&&(n<128||n>191||!o(r<<6|n&63,d-6,i(d,r)))&&(d=0,r=a,h+=String.fromCharCode(r)),d===0?(n>=0&&n<=127?(d=0,r=n):n>=192&&n<=223?(d=6*1,r=n&31):n>=224&&n<=239?(d=6*2,r=n&15):n>=240&&n<=247?(d=6*3,r=n&7):(d=0,r=a),d!==0&&!o(r,d,i(d,r))&&(d=0,r=a)):(d-=6,r=r<<6|n&63),d===0&&(r<=65535?h+=String.fromCharCode(r):(h+=String.fromCharCode(55296+(r-65535-1>>10)),h+=String.fromCharCode(56320+(r-65535-1&1023))))}return this.bitsNeeded=d,this.codePoint=r,h};var se=function(){try{return new q().decode(new fe().encode("test"),{stream:!0})==="test"}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1};(q==null||fe==null||!se())&&(q=N);var R=function(){};function B(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=R,this.onload=R,this.onerror=R,this.onreadystatechange=R,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=R}B.prototype.open=function(t,o){this._abort(!0);var i=this,a=this._xhr,h=1,d=0;this._abort=function(s){i._sendTimeout!==0&&(te(i._sendTimeout),i._sendTimeout=0),(h===1||h===2||h===3)&&(h=4,a.onload=R,a.onerror=R,a.onabort=R,a.onprogress=R,a.onreadystatechange=R,a.abort(),d!==0&&(te(d),d=0),s||(i.readyState=4,i.onabort(null),i.onreadystatechange())),h=0};var r=function(){if(h===1){var s=0,f="",m=void 0;if("contentType"in a)s=200,f="OK",m=a.contentType;else try{s=a.status,f=a.statusText,m=a.getResponseHeader("Content-Type")}catch(w){s=0,f="",m=void 0}s!==0&&(h=2,i.readyState=2,i.status=s,i.statusText=f,i._contentType=m,i.onreadystatechange())}},l=function(){if(r(),h===2||h===3){h=3;var s="";try{s=a.responseText}catch(f){}i.readyState=3,i.responseText=s,i.onprogress()}},n=function(s,f){if((f==null||f.preventDefault==null)&&(f={preventDefault:R}),l(),h===1||h===2||h===3){if(h=4,d!==0&&(te(d),d=0),i.readyState=4,s==="load")i.onload(f);else if(s==="error")i.onerror(f);else if(s==="abort")i.onabort(f);else throw new TypeError;i.onreadystatechange()}},c=function(s){a!=null&&(a.readyState===4?(!("onload"in a)||!("onerror"in a)||!("onabort"in a))&&n(a.responseText===""?"error":"load",s):a.readyState===3?"onprogress"in a||l():a.readyState===2&&r())},v=function(){d=U(function(){v()},500),a.readyState===3&&l()};"onload"in a&&(a.onload=function(s){n("load",s)}),"onerror"in a&&(a.onerror=function(s){n("error",s)}),"onabort"in a&&(a.onabort=function(s){n("abort",s)}),"onprogress"in a&&(a.onprogress=l),"onreadystatechange"in a&&(a.onreadystatechange=function(s){c(s)}),("contentType"in a||!("ontimeout"in j.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),a.open(t,o,!0),"readyState"in a&&(d=U(function(){v()},0))},B.prototype.abort=function(){this._abort(!1)},B.prototype.getResponseHeader=function(t){return this._contentType},B.prototype.setRequestHeader=function(t,o){var i=this._xhr;"setRequestHeader"in i&&i.setRequestHeader(t,o)},B.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},B.prototype.send=function(){if((!("ontimeout"in j.prototype)||!("sendAsBinary"in j.prototype)&&!("mozAnon"in j.prototype))&&C!=null&&C.readyState!=null&&C.readyState!=="complete"){var t=this;t._sendTimeout=U(function(){t._sendTimeout=0,t.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(i){throw i}};function Se(t){return t.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function ie(t){for(var o=Object.create(null),i=t.split(`\r
6
+ `),a=0;a<i.length;a+=1){var h=i[a],d=h.split(": "),r=d.shift(),l=d.join(": ");o[Se(r)]=l}this._map=o}ie.prototype.get=function(t){return this._map[Se(t)]},j!=null&&j.HEADERS_RECEIVED==null&&(j.HEADERS_RECEIVED=2);function ke(){}ke.prototype.open=function(t,o,i,a,h,d,r){t.open("GET",h);var l=0;t.onprogress=function(){var c=t.responseText,v=c.slice(l);l+=v.length,i(v)},t.onerror=function(c){c.preventDefault(),a(new Error("NetworkError"))},t.onload=function(){a(null)},t.onabort=function(){a(null)},t.onreadystatechange=function(){if(t.readyState===j.HEADERS_RECEIVED){var c=t.status,v=t.statusText,s=t.getResponseHeader("Content-Type"),f=t.getAllResponseHeaders();o(c,v,s,new ie(f))}},t.withCredentials=d;for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.setRequestHeader(n,r[n]);return t.send(),t};function Ee(t){this._headers=t}Ee.prototype.get=function(t){return this._headers.get(t)};function Pe(){}Pe.prototype.open=function(t,o,i,a,h,d,r){var l=null,n=new W,c=n.signal,v=new q;return A(h,{headers:r,credentials:d?"include":"same-origin",signal:c,cache:"no-store"}).then(function(s){return l=s.body.getReader(),o(s.status,s.statusText,s.headers.get("Content-Type"),new Ee(s.headers)),new Ne(function(f,m){var w=function(){l.read().then(function(u){if(u.done)f(void 0);else{var p=v.decode(u.value,{stream:!0});i(p),w()}}).catch(function(u){m(u)})};w()})}).catch(function(s){if(s.name!=="AbortError")return s}).then(function(s){a(s)}),{abort:function(){l!=null&&l.cancel(),n.abort()}}};function le(){this._listeners=Object.create(null)}function Re(t){U(function(){throw t},0)}le.prototype.dispatchEvent=function(t){t.target=this;var o=this._listeners[t.type];if(o!=null)for(var i=o.length,a=0;a<i;a+=1){var h=o[a];try{typeof h.handleEvent=="function"?h.handleEvent(t):h.call(this,t)}catch(d){Re(d)}}},le.prototype.addEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];a==null&&(a=[],i[t]=a);for(var h=!1,d=0;d<a.length;d+=1)a[d]===o&&(h=!0);h||a.push(o)},le.prototype.removeEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];if(a!=null){for(var h=[],d=0;d<a.length;d+=1)a[d]!==o&&h.push(a[d]);h.length===0?delete i[t]:i[t]=h}};function re(t){this.type=t,this.target=void 0}function de(t,o){re.call(this,t),this.data=o.data,this.lastEventId=o.lastEventId}de.prototype=Object.create(re.prototype);function ce(t,o){re.call(this,t),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ce.prototype=Object.create(re.prototype);function Te(t,o){re.call(this,t),this.error=o.error}Te.prototype=Object.create(re.prototype);var me=-1,G=0,$=1,ne=2,ye=-1,V=0,he=1,ue=2,Ce=3,be=/^text\/event\-stream(;.*)?$/i,De=1e3,_e=18e6,we=function(t,o){var i=t==null?o:parseInt(t,10);return i!==i&&(i=o),ve(i)},ve=function(t){return Math.min(Math.max(t,De),_e)},ae=function(t,o,i){try{typeof o=="function"&&o.call(t,i)}catch(a){Re(a)}};function L(t,o){le.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Oe(this,t,o)}function Fe(){return j!=null&&"withCredentials"in j.prototype||K==null?new j:new K}var Ae=A!=null&&oe!=null&&"body"in oe.prototype;function Oe(t,o,i){o=String(o);var a=!!i.withCredentials,h=i.lastEventIdQueryParameterName||"lastEventId",d=ve(1e3),r=we(i.heartbeatTimeout,45e3),l="",n=d,c=!1,v=0,s=i.headers||{},f=i.Transport,m=Ae&&f==null?void 0:new B(f!=null?new f:Fe()),w=f!=null&&typeof f!="string"?new f:m==null?new Pe:new ke,u=void 0,p=0,x=me,I="",b="",g="",S="",_=V,J=0,M=0,Q=function(E,k,D,F){if(x===G)if(E===200&&D!=null&&be.test(D)){x=$,c=Date.now(),n=d,t.readyState=$;var T=new ce("open",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onopen,T)}else{var P="";E!==200?(k&&(k=k.replace(/\s+/g," ")),P="EventSource's response has a status "+E+" "+k+" that is not 200. Aborting the connection."):P="EventSource's response has a Content-Type specifying an unsupported type: "+(D==null?"-":D.replace(/\s+/g," "))+". Aborting the connection.",Be();var T=new ce("error",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onerror,T),console.error(P)}},pe=function(E){if(x===$){for(var k=-1,D=0;D<E.length;D+=1){var F=E.charCodeAt(D);(F===10||F===13)&&(k=D)}var T=(k!==-1?S:"")+E.slice(0,k+1);S=(k===-1?S:"")+E.slice(k+1),E!==""&&(c=Date.now(),v+=E.length);for(var P=0;P<T.length;P+=1){var F=T.charCodeAt(P);if(_===ye&&F===10)_=V;else if(_===ye&&(_=V),F===13||F===10){if(_!==V){_===he&&(M=P+1);var Y=T.slice(J,M-1),Z=T.slice(M+(M<P&&T.charCodeAt(M)===32?1:0),P);Y==="data"?(I+=`
7
+ `,I+=Z):Y==="id"?b=Z:Y==="event"?g=Z:Y==="retry"?(d=we(Z,d),n=d):Y==="heartbeatTimeout"&&(r=we(Z,r),p!==0&&(te(p),p=U(function(){je()},r)))}if(_===V){if(I!==""){l=b,g===""&&(g="message");var ge=new de(g,{data:I.slice(1),lastEventId:b});if(t.dispatchEvent(ge),g==="open"?ae(t,t.onopen,ge):g==="message"?ae(t,t.onmessage,ge):g==="error"&&ae(t,t.onerror,ge),x===ne)return}I="",g=""}_=F===13?ye:V}else _===V&&(J=P,_=he),_===he?F===58&&(M=P+1,_=ue):_===ue&&(_=Ce)}}},xe=function(E){if(x===$||x===G){x=me,p!==0&&(te(p),p=0),p=U(function(){je()},n),n=ve(Math.min(d*16,n*2)),t.readyState=G;var k=new Te("error",{error:E});t.dispatchEvent(k),ae(t,t.onerror,k),E!=null&&console.error(E)}},Be=function(){x=ne,u!=null&&(u.abort(),u=void 0),p!==0&&(te(p),p=0),t.readyState=ne},je=function(){if(p=0,x!==me){if(!c&&u!=null)xe(new Error("No activity within "+r+" milliseconds. "+(x===G?"No response received.":v+" chars received.")+" Reconnecting.")),u!=null&&(u.abort(),u=void 0);else{var E=Math.max((c||Date.now())+r-Date.now(),1);c=!1,p=U(function(){je()},E)}return}c=!1,v=0,p=U(function(){je()},r),x=G,I="",g="",b=l,S="",J=0,M=0,_=V;var k=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&l!==""){var D=o.indexOf("?");k=D===-1?o:o.slice(0,D+1)+o.slice(D+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Z,ge){return ge===h?"":Z}),k+=(o.indexOf("?")===-1?"?":"&")+h+"="+encodeURIComponent(l)}var F=t.withCredentials,T={};T.Accept="text/event-stream";var P=t.headers;if(P!=null)for(var Y in P)Object.prototype.hasOwnProperty.call(P,Y)&&(T[Y]=P[Y]);try{u=w.open(m,Q,pe,xe,k,F,T)}catch(Z){throw Be(),Z}};t.url=o,t.readyState=G,t.withCredentials=a,t.headers=s,t._close=Be,je()}L.prototype=Object.create(le.prototype),L.prototype.CONNECTING=G,L.prototype.OPEN=$,L.prototype.CLOSED=ne,L.prototype.close=function(){this._close()},L.CONNECTING=G,L.OPEN=$,L.CLOSED=ne,L.prototype.withCredentials=void 0;var Le=H;j!=null&&(H==null||!("withCredentials"in H.prototype))&&(Le=L),function(t){{var o=t(z);o!==void 0&&(ee.exports=o)}}(function(t){t.EventSourcePolyfill=L,t.NativeEventSource=H,t.EventSource=Le})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Ie,Ie.exports);var Xe=Ie.exports,qe=e.from_html('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>',1),We=e.from_html('<p class="svelte-75jgrh"> </p>'),Ge=e.from_html('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'),$e=e.from_html('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),Ve=e.from_html('<tr class="SkeletonRow svelte-75jgrh"><td class="Skeleton svelte-75jgrh"><div class="svelte-75jgrh"></div></td><td class="Skeleton svelte-75jgrh"><div class="svelte-75jgrh"></div></td><td class="Skeleton svelte-75jgrh"><div class="svelte-75jgrh"></div></td><td class="Skeleton svelte-75jgrh"><div class="svelte-75jgrh"></div></td></tr>'),Je=e.from_html('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'),Ke=e.from_html('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'),Qe=e.from_html('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'),Ye=e.from_html("<button> </button>"),Ze=e.from_html('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'),et=e.from_html('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),tt=e.from_html('<div class="LeaderboardWrapper svelte-75jgrh"><!> <table class="LeaderboardTable svelte-75jgrh"><thead class="LeaderboardTableHeader svelte-75jgrh"><tr class="svelte-75jgrh"><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th></tr></thead><tbody class="LeaderboardTableBody svelte-75jgrh"><!></tbody></table> <!> <!></div>');const rt={hash:"svelte-75jgrh",code:`.svelte-75jgrh,
8
+ .svelte-75jgrh::before,
9
+ .svelte-75jgrh::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.LeaderboardWrapper.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;padding:16px;overflow:hidden;}.PlayerRankWrapper.svelte-75jgrh {display:flex;flex-direction:column;gap:5px;margin-top:20px;.PlayerRankLabels:where(.svelte-75jgrh), .PlayerRankData:where(.svelte-75jgrh) {display:grid;grid-template-columns:1fr 1fr 2fr;padding:6px;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:400;& > span:where(.svelte-75jgrh):last-child{justify-self:end;}p:where(.svelte-75jgrh) {width:max-content;}}.PlayerRankData:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:12px;}}.PaginationWrapper.svelte-75jgrh {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-75jgrh) {display:flex;gap:6px;}.PaginationButton:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.LeaderboardTable.svelte-75jgrh {border-collapse:separate;border-spacing:0 12px;width:100%;table-layout:fixed;.PlayerRow:where(.svelte-75jgrh) {color:#F9C408;}thead:where(.svelte-75jgrh) th:where(.svelte-75jgrh) {background:transparent;padding:6px 16px;text-align:center;font-weight:400;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;}tbody:where(.svelte-75jgrh) tr:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:500;&:last-child{justify-self:end;}}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh) {padding:12px;background-color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):first-child {border-top-left-radius:8px;border-bottom-left-radius:8px;width:15%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(2) {width:35%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(3) {width:20%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):last-child {border-top-right-radius:8px;border-bottom-right-radius:8px;width:30%;}th:where(.svelte-75jgrh), td:where(.svelte-75jgrh) {text-align:center;vertical-align:middle;}tbody:where(.svelte-75jgrh) tr.Gold:where(.svelte-75jgrh){background:linear-gradient(to right, #a2851a, color-mix(in srgb, #a2851a 50%, var(--emw-color-bg-secondary, #434343) 50%), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Silver:where(.svelte-75jgrh) {background:linear-gradient(to right, #b0aeae, color-mix(in srgb, #b0aeae, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Bronze:where(.svelte-75jgrh) {background:linear-gradient(to right, #ac763c, color-mix(in srgb, #ac763c, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}}.EmptyLeaderboard.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);color:var(--emw-color-typography-secondary, #bdbdbd);width:100%;border-radius:8px;margin:10px 0;text-align:center;padding:10px 0;}.SkeletonRow.svelte-75jgrh {height:41px;background:linear-gradient(
10
+ 90deg,
11
+ transparent 25%,
12
+ var(--emw-color-skeleton, #333232) 50%,
13
+ transparent 75%
14
+ );background-size:200% 100%;
15
+ animation: svelte-75jgrh-loading 1.5s infinite;border-radius:4px;}.PlayerRankSkeletonWrapper.svelte-75jgrh {display:flex;justify-content:space-between;width:100%;gap:6px;flex-direction:column;.PlayerRankSkeleton:where(.svelte-75jgrh) {width:100%;height:40px;border-radius:6px;background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;}}.PaginationSkeleton.svelte-75jgrh {display:flex;justify-content:space-between;gap:6px;}.PaginationSkeletonButton.svelte-75jgrh {width:80px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.PaginationNumberSkeleton.svelte-75jgrh {width:40px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.SkeletonShimmer.svelte-75jgrh {width:100%;height:100%;background:linear-gradient(
16
+ 90deg,
17
+ transparent 0%,
18
+ var(--emw-color-skeleton, #333232) 50%,
19
+ transparent 100%
20
+ );
21
+ animation: svelte-75jgrh-loading 1.5s infinite;transform:translateX(-100%);}
22
+
23
+ @keyframes svelte-75jgrh-loading {
24
+ 0% {
25
+ transform: translateX(-100%);
26
+ }
27
+ 100% {
28
+ transform: translateX(100%);
29
+ }
30
+ }
31
+
32
+ @media (min-width: 1000px) {.ShowPlayersButton.svelte-75jgrh {display:block;width:300px;margin:auto;background-color:var(--emw-color-bg-primary, #212121);}
33
+ }
34
+
35
+ @media (min-width: 750px) {.PaginationWrapper.svelte-75jgrh, .PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;}.PaginationButton.svelte-75jgrh {min-width:75px;}
36
+ }`};function Me(ee,z){e.push(z,!0),e.append_styles(ee,rt);const y=()=>e.store_get(e.$format,"$_",U),[U,te]=e.setup_stores(),j=e.prop(z,"endpoint"),K=e.prop(z,"language",7,"en"),X=e.prop(z,"session"),H=e.prop(z,"tournamentid"),C=e.prop(z,"platform");Object.keys(He).forEach(r=>{ze(r,He[r])});const Ne=()=>{Ue(K())};e.user_effect(()=>{Ne()});let A=null,oe=e.state(void 0),q=e.state(!1),fe=e.state(!1),W=e.state(void 0),O=e.state(0),N=e.state(10),se=e.state(void 0),R=e.state(void 0);const B=()=>{if(ce.has(e.get(de)))return;e.set(q,!0);const r=new URL(`${j()}/v1/tournaments/${H()}/leaderboard`),l=new Headers;X()&&l.append("X-SessionId",X()),r.searchParams.append("language",K()),r.searchParams.append("platform",C()),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),fetch(r).then(n=>n.json()).then(n=>{e.set(oe,n==null?void 0:n.items,!0),e.set(se,n==null?void 0:n.pages,!0),e.set(R,n==null?void 0:n.total,!0),ce.set(e.get(de),e.get(oe))}).catch(n=>console.log(n)).finally(()=>e.set(q,!1))},Se=r=>{const l=JSON.parse(r.data);l&&l.messageType==="LeaderBoardUpdate"&&e.set(oe,l==null?void 0:l.items,!0)},ie=()=>{A&&(A.close(),A=null);const r=new URL(`${j()}/v1/tournaments/${H()}/leaderboard/updates`);r.searchParams.append("HeartBeat","false"),r.searchParams.append("language",K()),r.searchParams.append("filter","includeUnqualifiedPlayer=true"),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),r.searchParams.append("platform",C()),A=new Xe.EventSourcePolyfill(r,{headers:{accept:"text/event-stream","X-SessionId":X()}}),A.onmessage=Se},ke=()=>{e.set(fe,!0);const r=new URL(`${j()}/v1/tournaments/leaderboard/player`),l=new Headers;r.searchParams.append("language",K()),r.searchParams.append("platform",C()),r.searchParams.append("filter","includeUnqualifiedPlayer=false"),X()&&l.append("X-SessionId",X()),fetch(r,{method:"GET",headers:l}).then(c=>c.json()).then(c=>{var s;const v=(s=c==null?void 0:c.items)==null?void 0:s.find(f=>{var m;return((m=f==null?void 0:f.tournament)==null?void 0:m.id)===H()});e.set(W,v==null?void 0:v.leaderBoard,!0),console.log(v,H(),c.items,"--- bla")}).catch(c=>{console.log(c)}).finally(()=>e.set(fe,!1))},Ee=()=>{var r;(r=e.get(se))!=null&&r.next&&(e.set(O,e.get(O)+e.get(N)),B(),ie())},Pe=()=>{var r;(r=e.get(se))!=null&&r.previous&&e.get(O)!==0&&(e.set(O,e.get(O)-e.get(N)),B(),ie())},le=r=>{e.set(O,(r-1)*e.get(N)),B(),ie()},Re=()=>{const r=Math.ceil(e.get(R)/e.get(N)),l=Math.floor(e.get(O)/e.get(N))+1;if(r<=5)return Array.from({length:r},(c,v)=>v+1);const n=[];return n.push(1),l<=3?(n.push(2,3),n.push("..."),n.push(r)):l>=r-2?(n.push("..."),n.push(r-2,r-1,r)):(n.push("..."),n.push(l-1,l,l+1),n.push("..."),n.push(r)),n},re=e.user_derived(Re),de=e.user_derived(()=>Math.floor(e.get(O)/e.get(N))+1);let ce=new Map,Te=e.user_derived(()=>{var r;return(r=ce.get(e.get(de)))!=null?r:[]});const me=(r,l)=>{const n=[];return l&&n.push("PlayerRow"),r===1&&n.push("Gold"),r===2&&n.push("Silver"),r===3&&n.push("Bronze"),n.join(" ")};e.onMount(()=>(B(),ke(),ie(),()=>{A==null||A.close(),A=null}));var G={get endpoint(){return j()},set endpoint(r){j(r),e.flushSync()},get language(){return K()},set language(r="en"){K(r),e.flushSync()},get session(){return X()},set session(r){X(r),e.flushSync()},get tournamentid(){return H()},set tournamentid(r){H(r),e.flushSync()},get platform(){return C()},set platform(r){C(r),e.flushSync()}},$=tt(),ne=e.child($);{var ye=r=>{var l=Ge(),n=e.child(l),c=e.child(n),v=e.child(c,!0);e.reset(c);var s=e.sibling(c,2),f=e.child(s,!0);e.reset(s);var m=e.sibling(s,2),w=e.child(m,!0);e.reset(m),e.reset(n);var u=e.sibling(n,2),p=e.child(u);{var x=b=>{var g=qe(),S=e.first_child(g),_=e.child(S);e.reset(S);var J=e.sibling(S,2),M=e.child(J,!0);e.reset(J);var Q=e.sibling(J,2),pe=e.child(Q,!0);e.reset(Q),e.template_effect(()=>{var xe;e.set_text(_,`${(xe=e.get(W).rank)!=null?xe:""}.`),e.set_text(M,e.get(W).score),e.set_text(pe,e.get(W).prizeName||"-")}),e.append(b,g)},I=b=>{var g=We(),S=e.child(g,!0);e.reset(g),e.template_effect(_=>e.set_text(S,_),[()=>y()("notEnrolledRank")]),e.append(b,g)};e.if_block(p,b=>{e.get(W)?b(x):b(I,!1)})}e.reset(u),e.reset(l),e.template_effect((b,g,S)=>{e.set_text(v,b),e.set_text(f,g),e.set_text(w,S)},[()=>y()("myRanking"),()=>y()("points"),()=>y()("prize")]),e.append(r,l)},V=r=>{var l=$e();e.append(r,l)};e.if_block(ne,r=>{e.get(fe)?r(V,!1):r(ye)})}var he=e.sibling(ne,2),ue=e.child(he),Ce=e.child(ue),be=e.child(Ce),De=e.child(be,!0);e.reset(be);var _e=e.sibling(be),we=e.child(_e,!0);e.reset(_e);var ve=e.sibling(_e),ae=e.child(ve,!0);e.reset(ve);var L=e.sibling(ve),Fe=e.child(L,!0);e.reset(L),e.reset(Ce),e.reset(ue);var Ae=e.sibling(ue),Oe=e.child(Ae);{var Le=r=>{var l=e.comment(),n=e.first_child(l);e.each(n,17,()=>Array(e.get(N)),e.index,(c,v,s,f)=>{var m=Ve();e.append(c,m)}),e.append(r,l)},t=r=>{var l=e.comment(),n=e.first_child(l);{var c=s=>{var f=e.comment(),m=e.first_child(f);e.each(m,17,()=>e.get(Te),w=>w.rank,(w,u)=>{var p=Je(),x=e.child(p),I=e.child(x);e.reset(x);var b=e.sibling(x),g=e.child(b,!0);e.reset(b);var S=e.sibling(b),_=e.child(S,!0);e.reset(S);var J=e.sibling(S),M=e.child(J,!0);e.reset(J),e.reset(p),e.template_effect(Q=>{var pe;e.set_class(p,1,Q,"svelte-75jgrh"),e.set_text(I,`${(pe=e.get(u).rank)!=null?pe:""}.`),e.set_text(g,e.get(u).shortName||"-"),e.set_text(_,e.get(u).score||"-"),e.set_text(M,e.get(u).prizeName||"-")},[()=>{var Q;return e.clsx(me(e.get(u).rank,e.get(u).rank===((Q=e.get(W))==null?void 0:Q.rank)))}]),e.append(w,p)}),e.append(s,f)},v=s=>{var f=Ke(),m=e.child(f),w=e.child(m),u=e.child(w),p=e.child(u,!0);e.reset(u),e.reset(w),e.reset(m),e.reset(f),e.template_effect(x=>e.set_text(p,x),[()=>y()("emptyLeaderboard")]),e.append(s,f)};e.if_block(n,s=>{var f;((f=e.get(oe))==null?void 0:f.length)>0?s(c):s(v,!1)},!0)}e.append(r,l)};e.if_block(Oe,r=>{e.get(q)?r(Le):r(t,!1)})}e.reset(Ae),e.reset(he);var o=e.sibling(he,2);{var i=r=>{var l=Ze(),n=e.child(l);n.__click=Pe;var c=e.child(n,!0);e.reset(n);var v=e.sibling(n,2);e.each(v,21,()=>e.get(re),e.index,(m,w)=>{var u=e.comment(),p=e.first_child(u);{var x=b=>{var g=Qe();e.append(b,g)},I=b=>{var g=Ye();let S;g.__click=()=>le(e.get(w));var _=e.child(g,!0);e.reset(g),e.template_effect(()=>{S=e.set_class(g,1,"PaginationButton Number svelte-75jgrh",null,S,{Active:e.get(w)===e.get(de)}),e.set_text(_,e.get(w))}),e.append(b,g)};e.if_block(p,b=>{typeof e.get(w)!="number"?b(x):b(I,!1)})}e.append(m,u)}),e.reset(v);var s=e.sibling(v,2);s.__click=Ee;var f=e.child(s,!0);e.reset(s),e.reset(l),e.template_effect((m,w)=>{var u,p;n.disabled=!((u=e.get(se))!=null&&u.previous),e.set_text(c,m),s.disabled=!((p=e.get(se))!=null&&p.next),e.set_text(f,w)},[()=>y()("previousButton"),()=>y()("nextButton")]),e.append(r,l)};e.if_block(o,r=>{!e.get(q)&&e.get(R)>e.get(N)&&r(i)})}var a=e.sibling(o,2);{var h=r=>{var l=et();e.append(r,l)};e.if_block(a,r=>{e.get(q)&&r(h)})}e.reset($),e.template_effect((r,l,n,c)=>{e.set_text(De,r),e.set_text(we,l),e.set_text(ae,n),e.set_text(Fe,c)},[()=>y()("rank"),()=>y()("user"),()=>y()("points"),()=>y()("prize")]),e.append(ee,$);var d=e.pop(G);return te(),d}e.delegate(["click"]);customElements.define("tournament-leaderboard",e.create_custom_element(Me,{endpoint:{},language:{},session:{},tournamentid:{},platform:{}},[],[],!1));exports.default=Me;