@everymatrix/casino-tournaments-ingame-table 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.
- package/dist/casino-tournaments-ingame-table/{casino-tournaments-ingame-table-cea9e05e.js → casino-tournaments-ingame-table-a3fd2fda.js} +2 -2
- package/dist/casino-tournaments-ingame-table/casino-tournaments-ingame-table.entry.js +1 -1
- package/dist/casino-tournaments-ingame-table/index.esm.js +1 -1
- package/dist/cjs/{casino-tournaments-ingame-table-58ce40fc.js → casino-tournaments-ingame-table-8b7d60a9.js} +1 -2
- package/dist/cjs/casino-tournaments-ingame-table.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/casino-tournaments-ingame-table/casino-tournaments-ingame-table.css +1 -1
- package/dist/collection/components/casino-tournaments-ingame-table/casino-tournaments-ingame-table.js +0 -1
- package/dist/esm/{casino-tournaments-ingame-table-cea9e05e.js → casino-tournaments-ingame-table-a3fd2fda.js} +1 -2
- package/dist/esm/casino-tournaments-ingame-table.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./index-7421f3cc.js";const n="__WIDGET_GLOBAL_STYLE_CACHE__";function
|
|
1
|
+
import{r as t,c as i,h as e}from"./index-7421f3cc.js";const n="__WIDGET_GLOBAL_STYLE_CACHE__";function r(t,i){if(t){const e=document.createElement("style");e.innerHTML=i,t.appendChild(e)}}function s(t,i){if(!t||!i)return;const e=new URL(i);fetch(e.href).then((t=>t.text())).then((i=>{const e=document.createElement("style");e.innerHTML=i,t&&t.appendChild(e)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function o(t,i,e,r=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!r)return e=function(t,i){const e=document.createElement("style");return window.emMessageBus.subscribe(i,(i=>{t&&(e.innerHTML=i,t.appendChild(e))}))}(t,i),e;window[n]||(window[n]={}),e=function(t,i){return window.emMessageBus.subscribe(i,(e=>{if(!t)return;const r=t.getRootNode(),s=window[n];let o=s[i]&&s[i].sheet;o?s[i].refCount=s[i].refCount+1:(o=new CSSStyleSheet,o.replaceSync(e),s[i]={sheet:o,refCount:1});const a=r.adoptedStyleSheets||[];a.includes(o)||(r.adoptedStyleSheets=[...a,o])}))}(t,i);const s=e.unsubscribe.bind(e);return e.unsubscribe=()=>{if(window[n][i]){const t=window[n][i];t.refCount>1?t.refCount=t.refCount-1:delete window[n][i]}s()},e}const a={en:{you:"You",loading:"Loading, please wait ...",leaderboard:"Leaderboard",nowinners:"No winners for the time being. Be one of them!",noLeaderboard:"No Leaderboard yet",positionsWillShow:"Player positions will appear here once scores are recorded."}},h=(t,i,e)=>{let n=a[void 0!==i&&i in a?i:"en"][t];if(void 0!==e)for(const[t,i]of Object.entries(e.values)){const e=new RegExp(`{${t}}`,"g");n=n.replace(e,i)}return n},l=()=>{let t=window.navigator.userAgent;return t.toLowerCase().match(/android/i)?"Android":t.toLowerCase().match(/iphone/i)?"iPhone":t.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"};var d,c,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f={exports:{}};
|
|
2
2
|
/** @license
|
|
3
3
|
* eventsource.js
|
|
4
4
|
* Available under MIT License (MIT)
|
|
5
5
|
* https://github.com/Yaffle/EventSource/
|
|
6
6
|
*/
|
|
7
|
-
d=f,c=f.exports,function(t){var i=t.setTimeout,e=t.clearTimeout,n=t.XMLHttpRequest,s=t.XDomainRequest,r=t.ActiveXObject,o=t.EventSource,a=t.document,h=t.Promise,l=t.fetch,u=t.Response,f=t.TextDecoder,v=t.TextEncoder,p=t.AbortController;if("undefined"==typeof window||void 0===a||"readyState"in a||null!=a.body||(a.readyState="loading",window.addEventListener("load",(function(){a.readyState="complete"}),!1)),null==n&&null!=r&&(n=function(){return new r("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(t){function i(){}return i.prototype=t,new i}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==p){var g=l;l=function(t,i){var e=i.signal;return g(t,{headers:i.headers,credentials:i.credentials,cache:i.cache}).then((function(t){var i=t.body.getReader();return e._reader=i,e._aborted&&e._reader.cancel(),{status:t.status,statusText:t.statusText,headers:t.headers,body:{getReader:function(){return i}}}}))},p=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function b(){this.bitsNeeded=0,this.codePoint=0}b.prototype.decode=function(t){function i(t,i,e){if(1===e)return t>=128>>i&&t<<i<=2047;if(2===e)return t>=2048>>i&&t<<i<=55295||t>=57344>>i&&t<<i<=65535;if(3===e)return t>=65536>>i&&t<<i<=1114111;throw new Error}function e(t,i){if(6===t)return i>>6>15?3:i>31?2:1;if(12===t)return i>15?3:2;if(18===t)return 3;throw new Error}for(var n=65533,s="",r=this.bitsNeeded,o=this.codePoint,a=0;a<t.length;a+=1){var h=t[a];0!==r&&(h<128||h>191||!i(o<<6|63&h,r-6,e(r,o)))&&(r=0,o=n,s+=String.fromCharCode(o)),0===r?(h>=0&&h<=127?(r=0,o=h):h>=192&&h<=223?(r=6,o=31&h):h>=224&&h<=239?(r=12,o=15&h):h>=240&&h<=247?(r=18,o=7&h):(r=0,o=n),0===r||i(o,r,e(r,o))||(r=0,o=n)):(r-=6,o=o<<6|63&h),0===r&&(o<=65535?s+=String.fromCharCode(o):(s+=String.fromCharCode(55296+(o-65535-1>>10)),s+=String.fromCharCode(56320+(o-65535-1&1023))))}return this.bitsNeeded=r,this.codePoint=o,s},null!=f&&null!=v&&function(){try{return"test"===(new f).decode((new v).encode("test"),{stream:!0})}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1}()||(f=b);var w=function(){};function m(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=w,this.onload=w,this.onerror=w,this.onreadystatechange=w,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=w}function y(t){return t.replace(/[A-Z]/g,(function(t){return String.fromCharCode(t.charCodeAt(0)+32)}))}function L(t){for(var i=Object.create(null),e=t.split("\r\n"),n=0;n<e.length;n+=1){var s=e[n].split(": "),r=s.shift(),o=s.join(": ");i[y(r)]=o}this._map=i}function S(){}function k(t){this._headers=t}function x(){}function T(){this._listeners=Object.create(null)}function C(t){i((function(){throw t}),0)}function R(t){this.type=t,this.target=void 0}function W(t,i){R.call(this,t),this.data=i.data,this.lastEventId=i.lastEventId}function P(t,i){R.call(this,t),this.status=i.status,this.statusText=i.statusText,this.headers=i.headers}function A(t,i){R.call(this,t),this.error=i.error}m.prototype.open=function(t,s){this._abort(!0);var r=this,o=this._xhr,a=1,h=0;this._abort=function(t){0!==r._sendTimeout&&(e(r._sendTimeout),r._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,o.onload=w,o.onerror=w,o.onabort=w,o.onprogress=w,o.onreadystatechange=w,o.abort(),0!==h&&(e(h),h=0),t||(r.readyState=4,r.onabort(null),r.onreadystatechange())),a=0};var l=function(){if(1===a){var t=0,i="",e=void 0;if("contentType"in o)t=200,i="OK",e=o.contentType;else try{t=o.status,i=o.statusText,e=o.getResponseHeader("Content-Type")}catch(n){t=0,i="",e=void 0}0!==t&&(a=2,r.readyState=2,r.status=t,r.statusText=i,r._contentType=e,r.onreadystatechange())}},d=function(){if(l(),2===a||3===a){a=3;var t="";try{t=o.responseText}catch(t){}r.readyState=3,r.responseText=t,r.onprogress()}},c=function(t,i){if(null!=i&&null!=i.preventDefault||(i={preventDefault:w}),d(),1===a||2===a||3===a){if(a=4,0!==h&&(e(h),h=0),r.readyState=4,"load"===t)r.onload(i);else if("error"===t)r.onerror(i);else{if("abort"!==t)throw new TypeError;r.onabort(i)}r.onreadystatechange()}},u=function(){h=i((function(){u()}),500),3===o.readyState&&d()};"onload"in o&&(o.onload=function(t){c("load",t)}),"onerror"in o&&(o.onerror=function(t){c("error",t)}),"onabort"in o&&(o.onabort=function(t){c("abort",t)}),"onprogress"in o&&(o.onprogress=d),"onreadystatechange"in o&&(o.onreadystatechange=function(t){!function(t){null!=o&&(4===o.readyState?"onload"in o&&"onerror"in o&&"onabort"in o||c(""===o.responseText?"error":"load",t):3===o.readyState?"onprogress"in o||d():2===o.readyState&&l())}(t)}),!("contentType"in o)&&"ontimeout"in n.prototype||(s+=(-1===s.indexOf("?")?"?":"&")+"padding=true"),o.open(t,s,!0),"readyState"in o&&(h=i((function(){u()}),0))},m.prototype.abort=function(){this._abort(!1)},m.prototype.getResponseHeader=function(){return this._contentType},m.prototype.setRequestHeader=function(t,i){var e=this._xhr;"setRequestHeader"in e&&e.setRequestHeader(t,i)},m.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},m.prototype.send=function(){if("ontimeout"in n.prototype&&("sendAsBinary"in n.prototype||"mozAnon"in n.prototype)||null==a||null==a.readyState||"complete"===a.readyState){var t=this._xhr;"withCredentials"in t&&(t.withCredentials=this.withCredentials);try{t.send(void 0)}catch(t){throw t}}else{var e=this;e._sendTimeout=i((function(){e._sendTimeout=0,e.send()}),4)}},L.prototype.get=function(t){return this._map[y(t)]},null!=n&&null==n.HEADERS_RECEIVED&&(n.HEADERS_RECEIVED=2),S.prototype.open=function(t,i,e,s,r,o,a){t.open("GET",r);var h=0;for(var l in t.onprogress=function(){var i=t.responseText.slice(h);h+=i.length,e(i)},t.onerror=function(t){t.preventDefault(),s(new Error("NetworkError"))},t.onload=function(){s(null)},t.onabort=function(){s(null)},t.onreadystatechange=function(){if(t.readyState===n.HEADERS_RECEIVED){var e=t.status,s=t.statusText,r=t.getResponseHeader("Content-Type"),o=t.getAllResponseHeaders();i(e,s,r,new L(o))}},t.withCredentials=o,a)Object.prototype.hasOwnProperty.call(a,l)&&t.setRequestHeader(l,a[l]);return t.send(),t},k.prototype.get=function(t){return this._headers.get(t)},x.prototype.open=function(t,i,e,n,s,r,o){var a=null,d=new p,c=d.signal,u=new f;return l(s,{headers:o,credentials:r?"include":"same-origin",signal:c,cache:"no-store"}).then((function(t){return a=t.body.getReader(),i(t.status,t.statusText,t.headers.get("Content-Type"),new k(t.headers)),new h((function(t,i){var n=function(){a.read().then((function(i){if(i.done)t(void 0);else{var s=u.decode(i.value,{stream:!0});e(s),n()}})).catch((function(t){i(t)}))};n()}))})).catch((function(t){return"AbortError"===t.name?void 0:t})).then((function(t){n(t)})),{abort:function(){null!=a&&a.cancel(),d.abort()}}},T.prototype.dispatchEvent=function(t){t.target=this;var i=this._listeners[t.type];if(null!=i)for(var e=i.length,n=0;n<e;n+=1){var s=i[n];try{"function"==typeof s.handleEvent?s.handleEvent(t):s.call(this,t)}catch(t){C(t)}}},T.prototype.addEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];null==n&&(e[t]=n=[]);for(var s=!1,r=0;r<n.length;r+=1)n[r]===i&&(s=!0);s||n.push(i)},T.prototype.removeEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];if(null!=n){for(var s=[],r=0;r<n.length;r+=1)n[r]!==i&&s.push(n[r]);0===s.length?delete e[t]:e[t]=s}},W.prototype=Object.create(R.prototype),P.prototype=Object.create(R.prototype),A.prototype=Object.create(R.prototype);var E=/^text\/event\-stream(;.*)?$/i,O=function(t,i){var e=null==t?i:parseInt(t,10);return e!=e&&(e=i),I(e)},I=function(t){return Math.min(Math.max(t,1e3),18e6)},$=function(t,i,e){try{"function"==typeof i&&i.call(t,e)}catch(t){C(t)}};function M(t,r){T.call(this),r=r||{},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,function(t,r,o){r=String(r);var a=Boolean(o.withCredentials),h=o.lastEventIdQueryParameterName||"lastEventId",l=I(1e3),d=O(o.heartbeatTimeout,45e3),c="",u=l,f=!1,v=0,p=o.headers||{},g=o.Transport,b=N&&null==g?void 0:new m(null!=g?new g:null!=n&&"withCredentials"in n.prototype||null==s?new n:new s),w=null!=g&&"string"!=typeof g?new g:null==b?new x:new S,y=void 0,L=0,k=-1,T="",C="",R="",M="",D=0,U=0,j=0,_=function(i,e,n,s){if(0===k)if(200===i&&null!=n&&E.test(n)){k=1,f=Date.now(),u=l,t.readyState=1;var r=new P("open",{status:i,statusText:e,headers:s});t.dispatchEvent(r),$(t,t.onopen,r)}else{var o="";200!==i?(e&&(e=e.replace(/\s+/g," ")),o="EventSource's response has a status "+i+" "+e+" that is not 200. Aborting the connection."):o="EventSource's response has a Content-Type specifying an unsupported type: "+(null==n?"-":n.replace(/\s+/g," "))+". Aborting the connection.",H(),r=new P("error",{status:i,statusText:e,headers:s}),t.dispatchEvent(r),$(t,t.onerror,r),console.error(o)}},B=function(n){if(1===k){for(var s=-1,r=0;r<n.length;r+=1)(h=n.charCodeAt(r))!=="\n".charCodeAt(0)&&h!=="\r".charCodeAt(0)||(s=r);var o=(-1!==s?M:"")+n.slice(0,s+1);M=(-1===s?M:"")+n.slice(s+1),""!==n&&(f=Date.now(),v+=n.length);for(var a=0;a<o.length;a+=1){var h=o.charCodeAt(a);if(-1===D&&h==="\n".charCodeAt(0))D=0;else if(-1===D&&(D=0),h==="\r".charCodeAt(0)||h==="\n".charCodeAt(0)){if(0!==D){1===D&&(j=a+1);var p=o.slice(U,j-1),g=o.slice(j+(j<a&&o.charCodeAt(j)===" ".charCodeAt(0)?1:0),a);"data"===p?(T+="\n",T+=g):"id"===p?C=g:"event"===p?R=g:"retry"===p?(l=O(g,l),u=l):"heartbeatTimeout"===p&&(d=O(g,d),0!==L&&(e(L),L=i((function(){F()}),d)))}if(0===D){if(""!==T){c=C,""===R&&(R="message");var b=new W(R,{data:T.slice(1),lastEventId:C});if(t.dispatchEvent(b),"open"===R?$(t,t.onopen,b):"message"===R?$(t,t.onmessage,b):"error"===R&&$(t,t.onerror,b),2===k)return}T="",R=""}D=h==="\r".charCodeAt(0)?-1:0}else 0===D&&(U=a,D=1),1===D?h===":".charCodeAt(0)&&(j=a+1,D=2):2===D&&(D=3)}}},z=function(n){if(1===k||0===k){k=-1,0!==L&&(e(L),L=0),L=i((function(){F()}),u),u=I(Math.min(16*l,2*u)),t.readyState=0;var s=new A("error",{error:n});t.dispatchEvent(s),$(t,t.onerror,s),null!=n&&console.error(n)}},H=function(){k=2,null!=y&&(y.abort(),y=void 0),0!==L&&(e(L),L=0),t.readyState=2},F=function(){if(L=0,-1===k){f=!1,v=0,L=i((function(){F()}),d),k=0,T="",R="",C=c,M="",U=0,j=0,D=0;var e=r;if("data:"!==r.slice(0,5)&&"blob:"!==r.slice(0,5)&&""!==c){var n=r.indexOf("?");e=-1===n?r:r.slice(0,n+1)+r.slice(n+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(t,i){return i===h?"":t})),e+=(-1===r.indexOf("?")?"?":"&")+h+"="+encodeURIComponent(c)}var s=t.withCredentials,o={Accept:"text/event-stream"},a=t.headers;if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(o[l]=a[l]);try{y=w.open(b,_,B,z,e,s,o)}catch(t){throw H(),t}}else if(f||null==y){var u=Math.max((f||Date.now())+d-Date.now(),1);f=!1,L=i((function(){F()}),u)}else z(new Error("No activity within "+d+" milliseconds. "+(0===k?"No response received.":v+" chars received.")+" Reconnecting.")),null!=y&&(y.abort(),y=void 0)};t.url=r,t.readyState=0,t.withCredentials=a,t.headers=p,t._close=H,F()}(this,t,r)}var N=null!=l&&null!=u&&"body"in u.prototype;(M.prototype=Object.create(T.prototype)).CONNECTING=0,M.prototype.OPEN=1,M.prototype.CLOSED=2,M.prototype.close=function(){this._close()},M.CONNECTING=0,M.OPEN=1,M.CLOSED=2,M.prototype.withCredentials=void 0;var D,U=o;null==n||null!=o&&"withCredentials"in o.prototype||(U=M),D=function(t){t.EventSourcePolyfill=M,t.NativeEventSource=o,t.EventSource=U}(c),void 0!==D&&(d.exports=D)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:u:globalThis);const v=class{constructor(e){t(this,e),this.leaderboardLoaded=i(this,"leaderboardLoaded",7),this.isCurrentOnTop=!1,this.isCurrentPlayerRanked=!1,this.timeOrder1=500,this.timeOrder2=1e3,this.isMobile=!1,this.abortController=null,this.autoLocateCurrent=!1,this.keepOnBottom=!0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.tournamentId=void 0,this.endpoint=void 0,this.session=void 0,this.language="en",this.limit=40,this.theme="Dark",this.state=void 0,this.offset=0,this.currentUserData=void 0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.isLoadingMore=!1,this.isCurrentPlayerInview=!0,this.isLoadingPrevious=!1}mergeSortedArrays(t,i,e){if(!(null==t?void 0:t.length))return i;if(!(null==i?void 0:i.length))return t;const n=new Map;t.forEach(((t,i)=>{n.set(t[e],i)}));let s=[...t];const r=[];return i.forEach((t=>{const i=t[e];n.has(i)?s[n.get(i)]=t:r.push(t)})),r.length?(s=[],s=r[r.length-1][e]<t[0][e]?[...r,...t]:[...t,...r],s):t}onLeaderboardScroll(t){(this.isLoadingPrevious||this.isLoadingMore)&&t.preventDefault()}async loadLeaderboardById(){if(this.abortController&&this.abortController.abort(),this.isLoadingMore)return;this.abortController=new AbortController,this.isLoadingMore=!0;let t=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard?language=${this.language}`);t.searchParams.set("filter","includeUnqualifiedPlayer=true"),t.searchParams.set("pagination",`offset=${this.offset},limit=${this.limit}`),t.searchParams.set("platform",l());let i={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};await fetch(t,i).then((t=>t.json())).then((i=>{const{item:e,items:n,total:s}=i;if(this.isCurrentPlayerRanked=!!e,this.isCurrentPlayerRanked){if(this.currentUserData=e,this.isLeaderboardLoading){if(this.offset>0)this.scrollCurrentPlayerToMiddle();else if(0===this.offset&&this.autoLocateCurrent&&this.currentUserData.rank>this.limit)return this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:!0,totalRank:s}),void this.loadLeaderboardById().catch(console.error)}else this.isLoadingPrevious&&this.resetScrollTop();setTimeout((()=>{this.tableListEle&&this.tableListEle.querySelectorAll(".Active").length?this.startActivePlayerObserver():this.isCurrentPlayerInview=!1}),this.timeOrder2)}this.total=s,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:this.isCurrentPlayerRanked,totalRank:s}),this.leaderboard=this.mergeSortedArrays(this.leaderboard,n,"rank"),this.startScrollObersever(),this.reStartUpSSEUpdater(t),this.isLeaderboardLoading=!1}),(t=>{this.isLeaderboardLoading=!1,"AbortError"===t.name?console.log("Request aborted because a new one started or component unmounted."):console.error("Network error",t)})).finally((()=>{this.isLoadingMore=!1}))}startScrollObersever(){this.topLastTimer&&clearTimeout(this.topLastTimer),this.topLastTimer=setTimeout((()=>{this.total<=this.limit||(1!==this.leaderboard[0].rank&&this.startTopRankObserver(),this.leaderboard[this.leaderboard.length-1].rank<this.total&&this.startLastRankObserver())}),this.timeOrder2)}scrollCurrentPlayerToMiddle(){setTimeout((()=>{if(!this.tableListEle||!this.tableListEle.querySelectorAll(".Active").length)return;const t=this.tableListEle.querySelectorAll(".Active")[0],i=this.stylingContainer.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight;let n=Math.min((e-i.top)/2-t.clientHeight,4*t.clientHeight);n=Math.max(n,t.clientHeight),this.tableListEle.scrollTo({top:t.offsetTop-n,behavior:"smooth"})}),this.timeOrder1)}onStateChanged(){switch(this.state){case"Closed":case"Closing":this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler),this.leaderboardUpdater=null)}}reStartUpSSEUpdater(t){if(this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),"Running"!==this.state)return;t.searchParams.set("pagination",`offset=${this.leaderboard.length?this.leaderboard[0].rank-1:0},limit=${this.leaderboard.length||this.limit}`);let i=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard/updates?${t.searchParams.toString()}`);this.leaderboardUpdater=new f.exports.EventSourcePolyfill(i,{headers:{accept:"text/event-stream","X-SessionId":this.session}}),this.leaderboardUpdater.addEventListener("message",this.updateMessageHandler.bind(this))}updateMessageHandler(t){if(!t.data)return;const i=JSON.parse(t.data);if("LeaderBoardUpdate"===i.messageType){const{item:t,items:e,total:n}=i;(t||this.currentUserData)&&(this.currentUserData=t||this.currentUserData,this.leaderboardLoaded.emit({item:t,isRanked:!!t,totalRank:n})),e.forEach((t=>{const i=this.leaderboard.findIndex((i=>i.rank===t.rank));i>=0&&(this.leaderboard[i]=t),i<0?this.leaderboard.push(t):this.leaderboard[i]=t})),this.leaderboard=[...this.leaderboard]}}startActivePlayerObserver(){this.activePlayerObserver&&this.activePlayerEle&&this.activePlayerObserver.unobserve(this.activePlayerEle),this.activePlayerObserver=new IntersectionObserver((t=>{t.forEach((t=>{if(this.isCurrentPlayerInview=t.isIntersecting,!t.isIntersecting){const t=this.activePlayerEle.getBoundingClientRect();this.keepOnBottom||(this.isCurrentOnTop=t.top<this.stylingContainer.offsetTop)}}))})),this.activePlayerEle=this.tableListEle.querySelectorAll(".Active")[0],this.activePlayerObserver.observe(this.activePlayerEle)}startTopRankObserver(){this.topRankToObserved&&(this.topMoreObserver.unobserve(this.topRankToObserved),this.topRankToObserved=null),this.topMoreObserver||(this.topMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadPreMore(),this.topMoreObserver.unobserve(t.target))}))}))),setTimeout((()=>{var t;this.topRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_0"),this.topRankToObserved&&this.topMoreObserver.observe(this.topRankToObserved)}),this.timeOrder2)}startLastRankObserver(){var t;this.lastRankToObserved&&(this.loadMoreObserver.unobserve(this.lastRankToObserved),this.lastRankToObserved=null),this.loadMoreObserver||(this.loadMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadMore(),this.loadMoreObserver.unobserve(t.target))}))}))),this.lastRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_"+(this.leaderboard.length-1)),this.lastRankToObserved&&this.loadMoreObserver.observe(this.lastRankToObserved)}resetScrollTop(){this.isLoadingPrevious=!1,setTimeout((()=>{const t=this.tableListEle;t.scrollTop=this.previousScrollTop+(t.scrollHeight-this.previousScrollHeight)}),100)}loadPreMore(){var t;if((null===(t=this.leaderboard)||void 0===t?void 0:t.length)&&1===this.leaderboard[0].rank||this.isLoadingPrevious)return;this.offset=this.leaderboard[0].rank-1-this.limit||0;const i=this.tableListEle;this.previousScrollHeight=i.scrollHeight,this.previousScrollTop=i.scrollTop,this.isLoadingPrevious=!0,this.preTopRank=this.leaderboard[0].rank,this.loadLeaderboardById().catch(console.error)}goToCurrentPlayerPage(){this.leaderboard.findIndex((t=>t.id===this.currentUserData.id))>=0?this.scrollCurrentPlayerToMiddle():(this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.loadLeaderboardById().catch(console.error),this.isCurrentPlayerInview=!0)}loadMore(){var t;(null===(t=this.leaderboard)||void 0===t?void 0:t.length)>=this.total||(this.offset+=this.limit,this.offset=this.offset>this.total?this.total:this.offset,this.loadLeaderboardById().catch(console.error))}handleTableListScroll(){this.isCurrentPlayerInview=this.isElementInViewport()}isElementInViewport(){const t=this.tableListEle.querySelector(".Active");if(!t)return!1;const i=t.getBoundingClientRect();return this.isCurrentOnTop=i.top<this.stylingContainer.offsetTop,i.top>=0&&i.top>this.stylingContainer.offsetTop&&i.bottom<=this.stylingContainer.offsetTop+this.stylingContainer.offsetHeight&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onTournamentIdChanged(){this.disconnectedCallback(),this.endpoint&&this.session&&!(this.session.length<10)&&this.tournamentId&&(this.isLeaderboardLoading=!0,this.resetLeaderboardStatus(),this.loadLeaderboardById().catch(console.error))}resetLeaderboardStatus(){this.offset=0,this.leaderboard=[]}componentWillLoad(){switch(this.state){case"Running":this.loadLeaderboardById().catch(console.error);break;case"Unstarted":this.isLeaderboardLoading=!1,this.resetLeaderboardStatus()}}render(){var t;return e("div",{key:"0ea2213099af1f2e39cf38e636a181ae0b8111df",class:`LeaderboardWrapper ${this.theme} ${this.isMobile?"Mobile":""}`,ref:t=>this.stylingContainer=t},this.isLeaderboardLoading?e("div",{class:"Loading"}," ",h("loading",this.language)," "):[e("div",null,!this.isCurrentPlayerInview&&this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active"},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},h("you",this.language)),e("div",{class:"Score"},this.currentUserData.score),e("div",{class:"Prize"},this.currentUserData.prizeName))),this.isLoadingPrevious&&e("div",null,"Loading"),e("div",{class:"Leaderboard",onScroll:this.onLeaderboardScroll.bind(this),onTouchMove:this.onLeaderboardScroll.bind(this),ref:t=>this.tableListEle=t},(null===(t=this.leaderboard)||void 0===t?void 0:t.length)?this.leaderboard.map(((t,i)=>{var n,s;return e("div",{id:`Rank_${i}`,class:`PlayerRank ${this.isLoadingPrevious&&t.rank<this.preTopRank?"Hidden":""} ${(null===(n=this.currentUserData)||void 0===n?void 0:n.id)===t.id?"Active":""}`},e("div",{class:"Rank"},0===t.rank?"":t.rank),e("div",{class:"Name"},(null===(s=this.currentUserData)||void 0===s?void 0:s.id)===t.id?h("you",this.language):t.shortName),e("div",{class:"Score"},t.score),e("div",{class:"Prize"},t.prizeName))})):e("div",{class:"NoWinners"},e("div",{class:"Title"}," ",h("noLeaderboard",this.language)," "),e("div",{class:"Info"}," ",h("positionsWillShow",this.language)," "))),this.isLoadingMore&&!this.isLoadingPrevious&&e("div",null,"Loading"),!this.isCurrentPlayerInview&&e("div",{class:this.isCurrentOnTop?"":"Bottom"},!this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active",onClick:this.goToCurrentPlayerPage.bind(this)},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},h("you",this.language)),e("div",{class:"Score"},this.currentUserData.score),e("div",{class:"Prize"},this.currentUserData.prizeName)))])}handleClientStylingChange(t,i){t!=i&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,i){t!=i&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,i){t!=i&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)),this.isMobile="PC"!==l()}disconnectedCallback(){this.abortController&&this.abortController.abort("Disconnected callback"),this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.leaderboardUpdater&&this.leaderboardUpdater.close(),this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),this.loadMoreObserver&&this.loadMoreObserver.disconnect(),this.topMoreObserver&&this.topMoreObserver.disconnect(),this.activePlayerObserver&&this.activePlayerObserver.disconnect(),this.tableListEle&&this.tableListEle.removeEventListener("scroll",this.handleTableListScroll.bind(this))}static get watchers(){return{state:["onStateChanged"],tournamentId:["onTournamentIdChanged"],endpoint:["onTournamentIdChanged"],session:["onTournamentIdChanged"],language:["onTournamentIdChanged"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};v.style=":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(99% - 25px) !important;overflow-y:auto;overflow-anchor:auto}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";export{v as C}
|
|
7
|
+
d=f,c=f.exports,function(t){var i=t.setTimeout,e=t.clearTimeout,n=t.XMLHttpRequest,r=t.XDomainRequest,s=t.ActiveXObject,o=t.EventSource,a=t.document,h=t.Promise,l=t.fetch,u=t.Response,f=t.TextDecoder,v=t.TextEncoder,p=t.AbortController;if("undefined"==typeof window||void 0===a||"readyState"in a||null!=a.body||(a.readyState="loading",window.addEventListener("load",(function(){a.readyState="complete"}),!1)),null==n&&null!=s&&(n=function(){return new s("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(t){function i(){}return i.prototype=t,new i}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==p){var g=l;l=function(t,i){var e=i.signal;return g(t,{headers:i.headers,credentials:i.credentials,cache:i.cache}).then((function(t){var i=t.body.getReader();return e._reader=i,e._aborted&&e._reader.cancel(),{status:t.status,statusText:t.statusText,headers:t.headers,body:{getReader:function(){return i}}}}))},p=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function b(){this.bitsNeeded=0,this.codePoint=0}b.prototype.decode=function(t){function i(t,i,e){if(1===e)return t>=128>>i&&t<<i<=2047;if(2===e)return t>=2048>>i&&t<<i<=55295||t>=57344>>i&&t<<i<=65535;if(3===e)return t>=65536>>i&&t<<i<=1114111;throw new Error}function e(t,i){if(6===t)return i>>6>15?3:i>31?2:1;if(12===t)return i>15?3:2;if(18===t)return 3;throw new Error}for(var n=65533,r="",s=this.bitsNeeded,o=this.codePoint,a=0;a<t.length;a+=1){var h=t[a];0!==s&&(h<128||h>191||!i(o<<6|63&h,s-6,e(s,o)))&&(s=0,o=n,r+=String.fromCharCode(o)),0===s?(h>=0&&h<=127?(s=0,o=h):h>=192&&h<=223?(s=6,o=31&h):h>=224&&h<=239?(s=12,o=15&h):h>=240&&h<=247?(s=18,o=7&h):(s=0,o=n),0===s||i(o,s,e(s,o))||(s=0,o=n)):(s-=6,o=o<<6|63&h),0===s&&(o<=65535?r+=String.fromCharCode(o):(r+=String.fromCharCode(55296+(o-65535-1>>10)),r+=String.fromCharCode(56320+(o-65535-1&1023))))}return this.bitsNeeded=s,this.codePoint=o,r},null!=f&&null!=v&&function(){try{return"test"===(new f).decode((new v).encode("test"),{stream:!0})}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1}()||(f=b);var w=function(){};function m(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=w,this.onload=w,this.onerror=w,this.onreadystatechange=w,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=w}function y(t){return t.replace(/[A-Z]/g,(function(t){return String.fromCharCode(t.charCodeAt(0)+32)}))}function L(t){for(var i=Object.create(null),e=t.split("\r\n"),n=0;n<e.length;n+=1){var r=e[n].split(": "),s=r.shift(),o=r.join(": ");i[y(s)]=o}this._map=i}function S(){}function k(t){this._headers=t}function x(){}function T(){this._listeners=Object.create(null)}function C(t){i((function(){throw t}),0)}function R(t){this.type=t,this.target=void 0}function W(t,i){R.call(this,t),this.data=i.data,this.lastEventId=i.lastEventId}function P(t,i){R.call(this,t),this.status=i.status,this.statusText=i.statusText,this.headers=i.headers}function A(t,i){R.call(this,t),this.error=i.error}m.prototype.open=function(t,r){this._abort(!0);var s=this,o=this._xhr,a=1,h=0;this._abort=function(t){0!==s._sendTimeout&&(e(s._sendTimeout),s._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,o.onload=w,o.onerror=w,o.onabort=w,o.onprogress=w,o.onreadystatechange=w,o.abort(),0!==h&&(e(h),h=0),t||(s.readyState=4,s.onabort(null),s.onreadystatechange())),a=0};var l=function(){if(1===a){var t=0,i="",e=void 0;if("contentType"in o)t=200,i="OK",e=o.contentType;else try{t=o.status,i=o.statusText,e=o.getResponseHeader("Content-Type")}catch(n){t=0,i="",e=void 0}0!==t&&(a=2,s.readyState=2,s.status=t,s.statusText=i,s._contentType=e,s.onreadystatechange())}},d=function(){if(l(),2===a||3===a){a=3;var t="";try{t=o.responseText}catch(t){}s.readyState=3,s.responseText=t,s.onprogress()}},c=function(t,i){if(null!=i&&null!=i.preventDefault||(i={preventDefault:w}),d(),1===a||2===a||3===a){if(a=4,0!==h&&(e(h),h=0),s.readyState=4,"load"===t)s.onload(i);else if("error"===t)s.onerror(i);else{if("abort"!==t)throw new TypeError;s.onabort(i)}s.onreadystatechange()}},u=function(){h=i((function(){u()}),500),3===o.readyState&&d()};"onload"in o&&(o.onload=function(t){c("load",t)}),"onerror"in o&&(o.onerror=function(t){c("error",t)}),"onabort"in o&&(o.onabort=function(t){c("abort",t)}),"onprogress"in o&&(o.onprogress=d),"onreadystatechange"in o&&(o.onreadystatechange=function(t){!function(t){null!=o&&(4===o.readyState?"onload"in o&&"onerror"in o&&"onabort"in o||c(""===o.responseText?"error":"load",t):3===o.readyState?"onprogress"in o||d():2===o.readyState&&l())}(t)}),!("contentType"in o)&&"ontimeout"in n.prototype||(r+=(-1===r.indexOf("?")?"?":"&")+"padding=true"),o.open(t,r,!0),"readyState"in o&&(h=i((function(){u()}),0))},m.prototype.abort=function(){this._abort(!1)},m.prototype.getResponseHeader=function(){return this._contentType},m.prototype.setRequestHeader=function(t,i){var e=this._xhr;"setRequestHeader"in e&&e.setRequestHeader(t,i)},m.prototype.getAllResponseHeaders=function(){return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},m.prototype.send=function(){if("ontimeout"in n.prototype&&("sendAsBinary"in n.prototype||"mozAnon"in n.prototype)||null==a||null==a.readyState||"complete"===a.readyState){var t=this._xhr;"withCredentials"in t&&(t.withCredentials=this.withCredentials);try{t.send(void 0)}catch(t){throw t}}else{var e=this;e._sendTimeout=i((function(){e._sendTimeout=0,e.send()}),4)}},L.prototype.get=function(t){return this._map[y(t)]},null!=n&&null==n.HEADERS_RECEIVED&&(n.HEADERS_RECEIVED=2),S.prototype.open=function(t,i,e,r,s,o,a){t.open("GET",s);var h=0;for(var l in t.onprogress=function(){var i=t.responseText.slice(h);h+=i.length,e(i)},t.onerror=function(t){t.preventDefault(),r(new Error("NetworkError"))},t.onload=function(){r(null)},t.onabort=function(){r(null)},t.onreadystatechange=function(){if(t.readyState===n.HEADERS_RECEIVED){var e=t.status,r=t.statusText,s=t.getResponseHeader("Content-Type"),o=t.getAllResponseHeaders();i(e,r,s,new L(o))}},t.withCredentials=o,a)Object.prototype.hasOwnProperty.call(a,l)&&t.setRequestHeader(l,a[l]);return t.send(),t},k.prototype.get=function(t){return this._headers.get(t)},x.prototype.open=function(t,i,e,n,r,s,o){var a=null,d=new p,c=d.signal,u=new f;return l(r,{headers:o,credentials:s?"include":"same-origin",signal:c,cache:"no-store"}).then((function(t){return a=t.body.getReader(),i(t.status,t.statusText,t.headers.get("Content-Type"),new k(t.headers)),new h((function(t,i){var n=function(){a.read().then((function(i){if(i.done)t(void 0);else{var r=u.decode(i.value,{stream:!0});e(r),n()}})).catch((function(t){i(t)}))};n()}))})).catch((function(t){return"AbortError"===t.name?void 0:t})).then((function(t){n(t)})),{abort:function(){null!=a&&a.cancel(),d.abort()}}},T.prototype.dispatchEvent=function(t){t.target=this;var i=this._listeners[t.type];if(null!=i)for(var e=i.length,n=0;n<e;n+=1){var r=i[n];try{"function"==typeof r.handleEvent?r.handleEvent(t):r.call(this,t)}catch(t){C(t)}}},T.prototype.addEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];null==n&&(e[t]=n=[]);for(var r=!1,s=0;s<n.length;s+=1)n[s]===i&&(r=!0);r||n.push(i)},T.prototype.removeEventListener=function(t,i){t=String(t);var e=this._listeners,n=e[t];if(null!=n){for(var r=[],s=0;s<n.length;s+=1)n[s]!==i&&r.push(n[s]);0===r.length?delete e[t]:e[t]=r}},W.prototype=Object.create(R.prototype),P.prototype=Object.create(R.prototype),A.prototype=Object.create(R.prototype);var E=/^text\/event\-stream(;.*)?$/i,O=function(t,i){var e=null==t?i:parseInt(t,10);return e!=e&&(e=i),I(e)},I=function(t){return Math.min(Math.max(t,1e3),18e6)},$=function(t,i,e){try{"function"==typeof i&&i.call(t,e)}catch(t){C(t)}};function M(t,s){T.call(this),s=s||{},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,function(t,s,o){s=String(s);var a=Boolean(o.withCredentials),h=o.lastEventIdQueryParameterName||"lastEventId",l=I(1e3),d=O(o.heartbeatTimeout,45e3),c="",u=l,f=!1,v=0,p=o.headers||{},g=o.Transport,b=N&&null==g?void 0:new m(null!=g?new g:null!=n&&"withCredentials"in n.prototype||null==r?new n:new r),w=null!=g&&"string"!=typeof g?new g:null==b?new x:new S,y=void 0,L=0,k=-1,T="",C="",R="",M="",D=0,U=0,j=0,_=function(i,e,n,r){if(0===k)if(200===i&&null!=n&&E.test(n)){k=1,f=Date.now(),u=l,t.readyState=1;var s=new P("open",{status:i,statusText:e,headers:r});t.dispatchEvent(s),$(t,t.onopen,s)}else{var o="";200!==i?(e&&(e=e.replace(/\s+/g," ")),o="EventSource's response has a status "+i+" "+e+" that is not 200. Aborting the connection."):o="EventSource's response has a Content-Type specifying an unsupported type: "+(null==n?"-":n.replace(/\s+/g," "))+". Aborting the connection.",H(),s=new P("error",{status:i,statusText:e,headers:r}),t.dispatchEvent(s),$(t,t.onerror,s),console.error(o)}},B=function(n){if(1===k){for(var r=-1,s=0;s<n.length;s+=1)(h=n.charCodeAt(s))!=="\n".charCodeAt(0)&&h!=="\r".charCodeAt(0)||(r=s);var o=(-1!==r?M:"")+n.slice(0,r+1);M=(-1===r?M:"")+n.slice(r+1),""!==n&&(f=Date.now(),v+=n.length);for(var a=0;a<o.length;a+=1){var h=o.charCodeAt(a);if(-1===D&&h==="\n".charCodeAt(0))D=0;else if(-1===D&&(D=0),h==="\r".charCodeAt(0)||h==="\n".charCodeAt(0)){if(0!==D){1===D&&(j=a+1);var p=o.slice(U,j-1),g=o.slice(j+(j<a&&o.charCodeAt(j)===" ".charCodeAt(0)?1:0),a);"data"===p?(T+="\n",T+=g):"id"===p?C=g:"event"===p?R=g:"retry"===p?(l=O(g,l),u=l):"heartbeatTimeout"===p&&(d=O(g,d),0!==L&&(e(L),L=i((function(){F()}),d)))}if(0===D){if(""!==T){c=C,""===R&&(R="message");var b=new W(R,{data:T.slice(1),lastEventId:C});if(t.dispatchEvent(b),"open"===R?$(t,t.onopen,b):"message"===R?$(t,t.onmessage,b):"error"===R&&$(t,t.onerror,b),2===k)return}T="",R=""}D=h==="\r".charCodeAt(0)?-1:0}else 0===D&&(U=a,D=1),1===D?h===":".charCodeAt(0)&&(j=a+1,D=2):2===D&&(D=3)}}},z=function(n){if(1===k||0===k){k=-1,0!==L&&(e(L),L=0),L=i((function(){F()}),u),u=I(Math.min(16*l,2*u)),t.readyState=0;var r=new A("error",{error:n});t.dispatchEvent(r),$(t,t.onerror,r),null!=n&&console.error(n)}},H=function(){k=2,null!=y&&(y.abort(),y=void 0),0!==L&&(e(L),L=0),t.readyState=2},F=function(){if(L=0,-1===k){f=!1,v=0,L=i((function(){F()}),d),k=0,T="",R="",C=c,M="",U=0,j=0,D=0;var e=s;if("data:"!==s.slice(0,5)&&"blob:"!==s.slice(0,5)&&""!==c){var n=s.indexOf("?");e=-1===n?s:s.slice(0,n+1)+s.slice(n+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(t,i){return i===h?"":t})),e+=(-1===s.indexOf("?")?"?":"&")+h+"="+encodeURIComponent(c)}var r=t.withCredentials,o={Accept:"text/event-stream"},a=t.headers;if(null!=a)for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(o[l]=a[l]);try{y=w.open(b,_,B,z,e,r,o)}catch(t){throw H(),t}}else if(f||null==y){var u=Math.max((f||Date.now())+d-Date.now(),1);f=!1,L=i((function(){F()}),u)}else z(new Error("No activity within "+d+" milliseconds. "+(0===k?"No response received.":v+" chars received.")+" Reconnecting.")),null!=y&&(y.abort(),y=void 0)};t.url=s,t.readyState=0,t.withCredentials=a,t.headers=p,t._close=H,F()}(this,t,s)}var N=null!=l&&null!=u&&"body"in u.prototype;(M.prototype=Object.create(T.prototype)).CONNECTING=0,M.prototype.OPEN=1,M.prototype.CLOSED=2,M.prototype.close=function(){this._close()},M.CONNECTING=0,M.OPEN=1,M.CLOSED=2,M.prototype.withCredentials=void 0;var D,U=o;null==n||null!=o&&"withCredentials"in o.prototype||(U=M),D=function(t){t.EventSourcePolyfill=M,t.NativeEventSource=o,t.EventSource=U}(c),void 0!==D&&(d.exports=D)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:u:globalThis);const v=class{constructor(e){t(this,e),this.leaderboardLoaded=i(this,"leaderboardLoaded",7),this.isCurrentOnTop=!1,this.isCurrentPlayerRanked=!1,this.timeOrder1=500,this.timeOrder2=1e3,this.isMobile=!1,this.abortController=null,this.autoLocateCurrent=!1,this.keepOnBottom=!0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.tournamentId=void 0,this.endpoint=void 0,this.session=void 0,this.language="en",this.limit=40,this.theme="Dark",this.state=void 0,this.offset=0,this.currentUserData=void 0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.isLoadingMore=!1,this.isCurrentPlayerInview=!0,this.isLoadingPrevious=!1}mergeSortedArrays(t,i,e){if(!(null==t?void 0:t.length))return i;if(!(null==i?void 0:i.length))return t;const n=new Map;t.forEach(((t,i)=>{n.set(t[e],i)}));let r=[...t];const s=[];return i.forEach((t=>{const i=t[e];n.has(i)?r[n.get(i)]=t:s.push(t)})),s.length?(r=[],r=s[s.length-1][e]<t[0][e]?[...s,...t]:[...t,...s],r):t}onLeaderboardScroll(t){(this.isLoadingPrevious||this.isLoadingMore)&&t.preventDefault()}async loadLeaderboardById(){if(this.abortController&&this.abortController.abort(),this.isLoadingMore)return;this.abortController=new AbortController,this.isLoadingMore=!0;let t=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard?language=${this.language}`);t.searchParams.set("filter","includeUnqualifiedPlayer=true"),t.searchParams.set("pagination",`offset=${this.offset},limit=${this.limit}`),t.searchParams.set("platform",l());let i={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};await fetch(t,i).then((t=>t.json())).then((i=>{const{item:e,items:n,total:r}=i;if(this.isCurrentPlayerRanked=!!e,this.isCurrentPlayerRanked){if(this.currentUserData=e,this.isLeaderboardLoading){if(this.offset>0)this.scrollCurrentPlayerToMiddle();else if(0===this.offset&&this.autoLocateCurrent&&this.currentUserData.rank>this.limit)return this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:!0,totalRank:r}),void this.loadLeaderboardById().catch(console.error)}else this.isLoadingPrevious&&this.resetScrollTop();setTimeout((()=>{this.tableListEle&&this.tableListEle.querySelectorAll(".Active").length?this.startActivePlayerObserver():this.isCurrentPlayerInview=!1}),this.timeOrder2)}this.total=r,this.leaderboardLoaded.emit({item:this.currentUserData,leaderboardOffset:this.offset,isRanked:this.isCurrentPlayerRanked,totalRank:r}),this.leaderboard=this.mergeSortedArrays(this.leaderboard,n,"rank"),this.startScrollObersever(),this.reStartUpSSEUpdater(t),this.isLeaderboardLoading=!1}),(t=>{this.isLeaderboardLoading=!1,"AbortError"===t.name?console.log("Request aborted because a new one started or component unmounted."):console.error("Network error",t)})).finally((()=>{this.isLoadingMore=!1}))}startScrollObersever(){this.topLastTimer&&clearTimeout(this.topLastTimer),this.topLastTimer=setTimeout((()=>{this.total<=this.limit||(1!==this.leaderboard[0].rank&&this.startTopRankObserver(),this.leaderboard[this.leaderboard.length-1].rank<this.total&&this.startLastRankObserver())}),this.timeOrder2)}scrollCurrentPlayerToMiddle(){setTimeout((()=>{if(!this.tableListEle||!this.tableListEle.querySelectorAll(".Active").length)return;const t=this.tableListEle.querySelectorAll(".Active")[0],i=this.stylingContainer.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight;let n=Math.min((e-i.top)/2-t.clientHeight,4*t.clientHeight);n=Math.max(n,t.clientHeight),this.tableListEle.scrollTo({top:t.offsetTop-n,behavior:"smooth"})}),this.timeOrder1)}onStateChanged(){switch(this.state){case"Closed":case"Closing":this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler),this.leaderboardUpdater=null)}}reStartUpSSEUpdater(t){if(this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),"Running"!==this.state)return;t.searchParams.set("pagination",`offset=${this.leaderboard.length?this.leaderboard[0].rank-1:0},limit=${this.leaderboard.length||this.limit}`);let i=new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}/leaderboard/updates?${t.searchParams.toString()}`);this.leaderboardUpdater=new f.exports.EventSourcePolyfill(i,{headers:{accept:"text/event-stream","X-SessionId":this.session}}),this.leaderboardUpdater.addEventListener("message",this.updateMessageHandler.bind(this))}updateMessageHandler(t){if(!t.data)return;const i=JSON.parse(t.data);if("LeaderBoardUpdate"===i.messageType){const{item:t,items:e,total:n}=i;(t||this.currentUserData)&&(this.currentUserData=t||this.currentUserData,this.leaderboardLoaded.emit({item:t,isRanked:!!t,totalRank:n})),e.forEach((t=>{const i=this.leaderboard.findIndex((i=>i.rank===t.rank));i>=0&&(this.leaderboard[i]=t),i<0?this.leaderboard.push(t):this.leaderboard[i]=t})),this.leaderboard=[...this.leaderboard]}}startActivePlayerObserver(){this.activePlayerObserver&&this.activePlayerEle&&this.activePlayerObserver.unobserve(this.activePlayerEle),this.activePlayerObserver=new IntersectionObserver((t=>{t.forEach((t=>{if(this.isCurrentPlayerInview=t.isIntersecting,!t.isIntersecting){const t=this.activePlayerEle.getBoundingClientRect();this.keepOnBottom||(this.isCurrentOnTop=t.top<this.stylingContainer.offsetTop)}}))})),this.activePlayerEle=this.tableListEle.querySelectorAll(".Active")[0],this.activePlayerObserver.observe(this.activePlayerEle)}startTopRankObserver(){this.topRankToObserved&&(this.topMoreObserver.unobserve(this.topRankToObserved),this.topRankToObserved=null),this.topMoreObserver||(this.topMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadPreMore(),this.topMoreObserver.unobserve(t.target))}))}))),setTimeout((()=>{var t;this.topRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_0"),this.topRankToObserved&&this.topMoreObserver.observe(this.topRankToObserved)}),this.timeOrder2)}startLastRankObserver(){var t;this.lastRankToObserved&&(this.loadMoreObserver.unobserve(this.lastRankToObserved),this.lastRankToObserved=null),this.loadMoreObserver||(this.loadMoreObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.loadMore(),this.loadMoreObserver.unobserve(t.target))}))}))),this.lastRankToObserved=null===(t=this.tableListEle)||void 0===t?void 0:t.querySelector("#Rank_"+(this.leaderboard.length-1)),this.lastRankToObserved&&this.loadMoreObserver.observe(this.lastRankToObserved)}resetScrollTop(){this.isLoadingPrevious=!1,setTimeout((()=>{const t=this.tableListEle;t.scrollTop=this.previousScrollTop+(t.scrollHeight-this.previousScrollHeight)}),100)}loadPreMore(){var t;if((null===(t=this.leaderboard)||void 0===t?void 0:t.length)&&1===this.leaderboard[0].rank||this.isLoadingPrevious)return;this.offset=this.leaderboard[0].rank-1-this.limit||0;const i=this.tableListEle;this.previousScrollHeight=i.scrollHeight,this.previousScrollTop=i.scrollTop,this.isLoadingPrevious=!0,this.preTopRank=this.leaderboard[0].rank,this.loadLeaderboardById().catch(console.error)}goToCurrentPlayerPage(){this.leaderboard.findIndex((t=>t.id===this.currentUserData.id))>=0?this.scrollCurrentPlayerToMiddle():(this.offset=this.currentUserData.rank-this.limit/2||0,this.leaderboard=[],this.isLeaderboardLoading=!0,this.loadLeaderboardById().catch(console.error),this.isCurrentPlayerInview=!0)}loadMore(){var t;(null===(t=this.leaderboard)||void 0===t?void 0:t.length)>=this.total||(this.offset+=this.limit,this.offset=this.offset>this.total?this.total:this.offset,this.loadLeaderboardById().catch(console.error))}handleTableListScroll(){this.isCurrentPlayerInview=this.isElementInViewport()}isElementInViewport(){const t=this.tableListEle.querySelector(".Active");if(!t)return!1;const i=t.getBoundingClientRect();return this.isCurrentOnTop=i.top<this.stylingContainer.offsetTop,i.top>=0&&i.top>this.stylingContainer.offsetTop&&i.bottom<=this.stylingContainer.offsetTop+this.stylingContainer.offsetHeight&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onTournamentIdChanged(){this.disconnectedCallback(),this.endpoint&&this.session&&!(this.session.length<10)&&this.tournamentId&&(this.isLeaderboardLoading=!0,this.resetLeaderboardStatus(),this.loadLeaderboardById().catch(console.error))}resetLeaderboardStatus(){this.offset=0,this.leaderboard=[]}componentWillLoad(){switch(this.state){case"Running":this.loadLeaderboardById().catch(console.error);break;case"Unstarted":this.isLeaderboardLoading=!1,this.resetLeaderboardStatus()}}render(){var t;return e("div",{key:"0ea2213099af1f2e39cf38e636a181ae0b8111df",class:`LeaderboardWrapper ${this.theme} ${this.isMobile?"Mobile":""}`,ref:t=>this.stylingContainer=t},this.isLeaderboardLoading?e("div",{class:"Loading"}," ",h("loading",this.language)," "):[e("div",null,!this.isCurrentPlayerInview&&this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active"},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},h("you",this.language)),e("div",{class:"Score"},this.currentUserData.score),e("div",{class:"Prize"},this.currentUserData.prizeName))),this.isLoadingPrevious&&e("div",null,"Loading"),e("div",{class:"Leaderboard",onScroll:this.onLeaderboardScroll.bind(this),onTouchMove:this.onLeaderboardScroll.bind(this),ref:t=>this.tableListEle=t},(null===(t=this.leaderboard)||void 0===t?void 0:t.length)?this.leaderboard.map(((t,i)=>{var n,r;return e("div",{id:`Rank_${i}`,class:`PlayerRank ${this.isLoadingPrevious&&t.rank<this.preTopRank?"Hidden":""} ${(null===(n=this.currentUserData)||void 0===n?void 0:n.id)===t.id?"Active":""}`},e("div",{class:"Rank"},0===t.rank?"":t.rank),e("div",{class:"Name"},(null===(r=this.currentUserData)||void 0===r?void 0:r.id)===t.id?h("you",this.language):t.shortName),e("div",{class:"Score"},t.score),e("div",{class:"Prize"},t.prizeName))})):e("div",{class:"NoWinners"},e("div",{class:"Title"}," ",h("noLeaderboard",this.language)," "),e("div",{class:"Info"}," ",h("positionsWillShow",this.language)," "))),this.isLoadingMore&&!this.isLoadingPrevious&&e("div",null,"Loading"),!this.isCurrentPlayerInview&&e("div",{class:this.isCurrentOnTop?"":"Bottom"},!this.isCurrentOnTop&&this.currentUserData&&e("div",{class:"PlayerRank Active",onClick:this.goToCurrentPlayerPage.bind(this)},e("div",{class:"Rank"},0===this.currentUserData.rank?"--":this.currentUserData.rank),e("div",{class:"Name"},h("you",this.language)),e("div",{class:"Score"},this.currentUserData.score),e("div",{class:"Prize"},this.currentUserData.prizeName)))])}handleClientStylingChange(t,i){t!=i&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,i){t!=i&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,i){t!=i&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl)),this.isMobile="PC"!==l()}disconnectedCallback(){this.abortController&&this.abortController.abort("Disconnected callback"),this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.leaderboardUpdater&&(this.leaderboardUpdater.close(),this.leaderboardUpdater.removeEventListener("message",this.updateMessageHandler)),this.loadMoreObserver&&this.loadMoreObserver.disconnect(),this.topMoreObserver&&this.topMoreObserver.disconnect(),this.activePlayerObserver&&this.activePlayerObserver.disconnect(),this.tableListEle&&this.tableListEle.removeEventListener("scroll",this.handleTableListScroll.bind(this))}static get watchers(){return{state:["onStateChanged"],tournamentId:["onTournamentIdChanged"],endpoint:["onTournamentIdChanged"],session:["onTournamentIdChanged"],language:["onTournamentIdChanged"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};v.style=":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(100% - 2px) !important;overflow-y:auto;overflow-anchor:auto}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";export{v as C}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as casino_tournaments_ingame_table}from"./casino-tournaments-ingame-table-
|
|
1
|
+
export{C as casino_tournaments_ingame_table}from"./casino-tournaments-ingame-table-a3fd2fda.js";import"./index-7421f3cc.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as CasinoTournamentsIngameTable}from"./casino-tournaments-ingame-table-
|
|
1
|
+
export{C as CasinoTournamentsIngameTable}from"./casino-tournaments-ingame-table-a3fd2fda.js";import"./index-7421f3cc.js";
|
|
@@ -1205,7 +1205,7 @@ var eventsource = {exports: {}};
|
|
|
1205
1205
|
}(typeof globalThis === 'undefined' ? (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : commonjsGlobal) : globalThis));
|
|
1206
1206
|
}(eventsource, eventsource.exports));
|
|
1207
1207
|
|
|
1208
|
-
const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(
|
|
1208
|
+
const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(100% - 2px) !important;overflow-y:auto;overflow-anchor:auto}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";
|
|
1209
1209
|
const CasinoTournamentsIngameTableStyle0 = casinoTournamentsIngameTableCss;
|
|
1210
1210
|
|
|
1211
1211
|
const CasinoTournamentsIngameTable = class {
|
|
@@ -1639,7 +1639,6 @@ const CasinoTournamentsIngameTable = class {
|
|
|
1639
1639
|
this.abortController.abort('Disconnected callback');
|
|
1640
1640
|
}
|
|
1641
1641
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
1642
|
-
this.leaderboardUpdater && this.leaderboardUpdater.close();
|
|
1643
1642
|
if (this.leaderboardUpdater) {
|
|
1644
1643
|
this.leaderboardUpdater.close();
|
|
1645
1644
|
this.leaderboardUpdater.removeEventListener('message', this.updateMessageHandler);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-
|
|
5
|
+
const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-8b7d60a9.js');
|
|
6
6
|
require('./index-3f69085c.js');
|
|
7
7
|
|
|
8
8
|
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-
|
|
5
|
+
const casinoTournamentsIngameTable = require('./casino-tournaments-ingame-table-8b7d60a9.js');
|
|
6
6
|
require('./index-3f69085c.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -435,7 +435,6 @@ export class CasinoTournamentsIngameTable {
|
|
|
435
435
|
this.abortController.abort('Disconnected callback');
|
|
436
436
|
}
|
|
437
437
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
438
|
-
this.leaderboardUpdater && this.leaderboardUpdater.close();
|
|
439
438
|
if (this.leaderboardUpdater) {
|
|
440
439
|
this.leaderboardUpdater.close();
|
|
441
440
|
this.leaderboardUpdater.removeEventListener('message', this.updateMessageHandler);
|
|
@@ -1203,7 +1203,7 @@ var eventsource = {exports: {}};
|
|
|
1203
1203
|
}(typeof globalThis === 'undefined' ? (typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : commonjsGlobal) : globalThis));
|
|
1204
1204
|
}(eventsource, eventsource.exports));
|
|
1205
1205
|
|
|
1206
|
-
const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(
|
|
1206
|
+
const casinoTournamentsIngameTableCss = ":host{display:block;height:100%}.Dark{color:var(--emw--ingame-color-text, #f5f8f6)}.Light{color:var(--emw--ingame-color-black, #0A0A17)}.Mobile.LeaderboardWrapper .Bottom .PlayerRank.Active{padding:2px 8px}.LeaderboardWrapper{height:100%;position:relative;overflow:hidden}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard,.LeaderboardWrapper .Bottom{width:calc(100% - 30px);padding:0 15px;scrollbar-width:thin}.LeaderboardWrapper .Loading,.LeaderboardWrapper .Leaderboard{padding-bottom:0}.LeaderboardWrapper .Bottom{position:absolute;bottom:0;background:linear-gradient(90deg, var(--emw--ingame-color-gray-purple50, rgba(35, 41, 119, 0.4980392157)) 0%, var(--emw--ingame-color-dark-purple50, rgba(59, 28, 117, 0.4980392157)) 100%);border-top:1px solid;border-image-source:linear-gradient(94.32deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%);border-image-slice:1;backdrop-filter:blur(20px);opacity:0.91}.LeaderboardWrapper .Bottom .PlayerRank.Active{border-width:0;cursor:pointer;padding-right:18px;background:transparent}.LeaderboardWrapper .PlayerRank{overflow-anchor:auto;font-weight:bold;align-items:center;height:26px;gap:16px;padding:2px 8px;display:flex}.LeaderboardWrapper .PlayerRank.Hidden{display:none !important}.LeaderboardWrapper .PlayerRank.Active{background-clip:padding-box, border-box;background-origin:padding-box, border-box;border:1px solid transparent;border-radius:10px;background-image:linear-gradient(91deg, var(--emw--ingame-color-pth-primary4, #11153E) 4.41%, var(--emw--ingame-color-pth-primary4, #11153E) 113.86%), linear-gradient(91deg, var(--emw--ingame-color-pth-primary1, #9500FF) 4.41%, var(--emw--ingame-color-pth-primary2, #232EC4) 113.86%)}.LeaderboardWrapper .PlayerRank div{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.LeaderboardWrapper .PlayerRank .Rank{flex:1}.LeaderboardWrapper .PlayerRank .Name{flex:2;text-align:left}.LeaderboardWrapper .PlayerRank .Score{flex:1;font-weight:normal}.LeaderboardWrapper .PlayerRank .Prize{flex:4}.LeaderboardWrapper .Leaderboard{height:calc(100% - 2px) !important;overflow-y:auto;overflow-anchor:auto}.LeaderboardWrapper .Leaderboard .NoWinners{margin:30px auto;display:flex;flex-direction:column;gap:15px}.LeaderboardWrapper .Leaderboard .NoWinners .Title{font-weight:bold;font-size:medium}.LeaderboardWrapper .Leaderboard .NoWinners .Title,.LeaderboardWrapper .Leaderboard .NoWinners .Info{display:flex;align-items:center;flex-direction:column}";
|
|
1207
1207
|
const CasinoTournamentsIngameTableStyle0 = casinoTournamentsIngameTableCss;
|
|
1208
1208
|
|
|
1209
1209
|
const CasinoTournamentsIngameTable = class {
|
|
@@ -1637,7 +1637,6 @@ const CasinoTournamentsIngameTable = class {
|
|
|
1637
1637
|
this.abortController.abort('Disconnected callback');
|
|
1638
1638
|
}
|
|
1639
1639
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
1640
|
-
this.leaderboardUpdater && this.leaderboardUpdater.close();
|
|
1641
1640
|
if (this.leaderboardUpdater) {
|
|
1642
1641
|
this.leaderboardUpdater.close();
|
|
1643
1642
|
this.leaderboardUpdater.removeEventListener('message', this.updateMessageHandler);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as casino_tournaments_ingame_table } from './casino-tournaments-ingame-table-
|
|
1
|
+
export { C as casino_tournaments_ingame_table } from './casino-tournaments-ingame-table-a3fd2fda.js';
|
|
2
2
|
import './index-7421f3cc.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CasinoTournamentsIngameTable } from './casino-tournaments-ingame-table-
|
|
1
|
+
export { C as CasinoTournamentsIngameTable } from './casino-tournaments-ingame-table-a3fd2fda.js';
|
|
2
2
|
import './index-7421f3cc.js';
|