"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1968],{64994:function(t,e,r){if(r.d(e,{A:function(){return a}}),/^(4763|5790|9347|9569)$/.test(r.j))var i=r(92099);if(/^(4763|5790|9347|9569)$/.test(r.j))var n=r(48183);if(/^(4763|5790|9347|9569)$/.test(r.j))var s=r(41705);r(76204),r(24776),r(89336),r(49781),r(66184),r(83810),r(78557),r(73687),r(7393),r(86409),r(11685);var o=r(10330),a=/^(4763|5790|9347|9569)$/.test(r.j)?(0,n.A)(function t(e){(0,i.A)(this,t),(0,s.A)(this,"aesCipher",""),e&&this.setCipher(e)},[{key:"setCipher",value:function(t){this.aesCipher=o.A.enc.Base64.parse(t)}},{key:"encrypt",value:function(t){t=JSON.stringify(t);var e=o.A.lib.WordArray.random(16),r=o.A.AES.encrypt(t,this.aesCipher,{iv:e,mode:o.A.mode.CBC,padding:o.A.pad.Pkcs7});return e.clone().concat(r.ciphertext).toString(o.A.enc.Base64)}},{key:"decrypt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=window.atob(t),r=window.btoa(e.slice(16)),i=o.A.enc.Base64.parse(window.btoa(e.slice(0,16)));return JSON.parse(o.A.AES.decrypt(r,this.aesCipher,{iv:i,mode:o.A.mode.CBC,padding:o.A.pad.Pkcs7}).toString(o.A.enc.Utf8))}}]):null},81227:function(t,e,r){r(67834),r(76204),r(78557),r(90076);var i=r(62344),n=r(28259),s=(0,i.A)({headers:"web"===window.msPlatform?(0,n.oG)():(0,n.yV)(),parser:function(t){var e=t.config,r=t.data;if(e.self)return r;if(1e4===r.bizCode)return r.data;var i=Error(r.message);return i.bizCode=r.bizCode,Promise.reject(i)}});e.A=s},24543:function(t,e,r){if(r.d(e,{A:function(){return h}}),/^(5(33|681|956)|(305|6|604)7|1830|335|4970|9332)$/.test(r.j))var i=r(29644);if(/^(5(33|681|956)|(305|6|604)7|1830|335|4970|9332)$/.test(r.j))var n=r(45841);var s=r(61790),o=r.n(s);r(78557),r(23630),r(90076);var a=r(81227),c=/^(5(33|681|956)|(305|6|604)7|1830|335|4970|9332)$/.test(r.j)?["callback","self","onError"]:null;function h(){return u.apply(this,arguments)}function u(){return(u=(0,n.A)(o().mark(function t(){var e,r,n,s,h=arguments;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=h.length>0&&void 0!==h[0]?h[0]:[],r=[],n=[],e.forEach(function(t){var e=t.callback,s=t.self,o=t.onError,a=(0,i.A)(t,c);r.push({callback:e,self:s,onError:o}),n.push(a)}),t.next=6,a.A.post("/bff",n,{self:!0});case 6:return s=t.sent,r.forEach(function(t,e){var r=t.callback,i=t.self,n=t.onError,o=s[e];if(r){if(i)r(o);else{var a=o.bizCode,c=o.data,h=o.message;1e4===a?r(c):n&&n({bizCode:a,message:h})}}}),r.length=0,n.length=0,t.abrupt("return",s);case 11:case"end":return t.stop()}},t)}))).apply(this,arguments)}},28259:function(t,e,r){r.d(e,{oG:function(){return o},sK:function(){return a},yV:function(){return s}});var i=r(59186),n=r(62392),s=function(){var t,e={clientid:"wap",platform:"WAP"};return(0,n.YB)()&&(e.AppVersion=i.A.get("appVersion")||(null===(t=window.msUserAgent)||void 0===t?void 0:t.appVersion)||"",(0,n.pT)()?e.clientid="games-wv":e.clientid="app-wv",(0,n.un)()?e.platform="ios":e.platform="android"),e},o=function(){return{clientid:"WEB",platform:"WEB"}},a={}},55066:function(t,e,r){r.d(e,{a:function(){return D}}),r(83810),r(29305),r(14382),r(36457),r(23630),r(88908),r(33087),r(36947);var i=r(41705),n=r(45841),s=r(61790),o=r.n(s);r(78557),r(90076),r(66184),r(67834),r(76204),r(73687),r(24776),r(89336),r(49781),r(7393),r(86409),r(11685),r(95021),r(11810),r(93062);var a=r(10330);function c(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function h(){return new c(null)}r(20518),r(96054),"Microsoft Internet Explorer"==navigator.appName?(c.prototype.am=function(t,e,r,i,n,s){for(var o=32767&e,a=e>>15;--s>=0;){var c=32767&this[t],h=this[t++]>>15,u=a*c+h*o;n=((c=o*c+((32767&u)<<15)+r[i]+(1073741823&n))>>>30)+(u>>>15)+a*h+(n>>>30),r[i++]=1073741823&c}return n},y=30):"Netscape"!=navigator.appName?(c.prototype.am=function(t,e,r,i,n,s){for(;--s>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},y=26):(c.prototype.am=function(t,e,r,i,n,s){for(var o=16383&e,a=e>>14;--s>=0;){var c=16383&this[t],h=this[t++]>>14,u=a*c+h*o;n=((c=o*c+((16383&u)<<14)+r[i]+n)>>28)+(u>>14)+a*h,r[i++]=268435455&c}return n},y=28),c.prototype.DB=y,c.prototype.DM=(1<<y)-1,c.prototype.DV=1<<y,c.prototype.FV=4503599627370496,c.prototype.F1=52-y,c.prototype.F2=2*y-52;var u=[];for(w=0,b=48;w<=9;++w)u[b++]=w;for(w=10,b=97;w<36;++w)u[b++]=w;for(w=10,b=65;w<36;++w)u[b++]=w;function l(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function p(t){var e=h();return e.fromInt(t),e}function f(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function d(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function m(){this.i=0,this.j=0,this.S=[]}function g(){var t;t=new Date().getTime(),k[C++]^=255&t,k[C++]^=t>>8&255,k[C++]^=t>>16&255,k[C++]^=t>>24&255,C>=256&&(C-=256)}if(d.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},d.prototype.revert=function(t){return t},d.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=h();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(c.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=h();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},c.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},c.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+DV:this.t=0},c.prototype.fromString=function(t,e){if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else if(4==e)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var r,i=t.length,n=!1,s=0;--i>=0;){var o=8==r?255&t[i]:function(t,e){var r=u[t.charCodeAt(e)];return null==r?-1:r}(t,i);if(o<0){"-"==t.charAt(i)&&(n=!0);continue}n=!1,0==s?this[this.t++]=o:s+r>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB)}8==r&&(128&t[0])!=0&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&c.ZERO.subTo(this,this)},c.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},c.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},c.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},c.prototype.lShiftTo=function(t,e){var r,i=t%this.DB,n=this.DB-i,s=(1<<n)-1,o=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(r=this.t-1;r>=0;--r)e[r+o+1]=this[r]>>n|a,a=(this[r]&s)<<i;for(r=o-1;r>=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},c.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB,n=this.DB-i,s=(1<<i)-1;e[0]=this[r]>>i;for(var o=r+1;o<this.t;++o)e[o-r-1]|=(this[o]&s)<<n,e[o-r]=this[o]>>i;i>0&&(e[this.t-r-1]|=(this.s&s)<<n),e.t=this.t-r,e.clamp()},c.prototype.subTo=function(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]-t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i-=t[r],e[r++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},c.prototype.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),n=r.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+r.t]=r.am(0,i[n],e,n,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&c.ZERO.subTo(e,e)},c.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},c.prototype.divRemTo=function(t,e,r){var i=t.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){null!=e&&e.fromInt(0),null!=r&&this.copyTo(r);return}null==r&&(r=h());var s=h(),o=this.s,a=t.s,u=this.DB-f(i[i.t-1]);u>0?(i.lShiftTo(u,s),n.lShiftTo(u,r)):(i.copyTo(s),n.copyTo(r));var l=s.t,p=s[l-1];if(0!=p){var d=p*(1<<this.F1)+(l>1?s[l-2]>>this.F2:0),v=this.FV/d,m=(1<<this.F1)/d,g=1<<this.F2,y=r.t,b=y-l,w=null==e?h():e;for(s.dlShiftTo(b,w),r.compareTo(w)>=0&&(r[r.t++]=1,r.subTo(w,r)),c.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t<l;)s[s.t++]=0;for(;--b>=0;){var _=r[--y]==p?this.DM:Math.floor(r[y]*v+(r[y-1]+g)*m);if((r[y]+=s.am(0,_,r,b,0,l))<_)for(s.dlShiftTo(b,w),r.subTo(w,r);r[y]<--_;)r.subTo(w,r)}null!=e&&(r.drShiftTo(l,e),o!=a&&c.ZERO.subTo(e,e)),r.t=l,r.clamp(),u>0&&r.rShiftTo(u,r),o<0&&c.ZERO.subTo(r,r)}}},c.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((1&t)==0)return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},c.prototype.isEven=function(){return(this.t>0?1&this[0]:this.s)==0},c.prototype.exp=function(t,e){if(t>4294967295||t<1)return c.ONE;var r=h(),i=h(),n=e.convert(this),s=f(t)-1;for(n.copyTo(r);--s>=0;)if(e.sqrTo(r,i),(t&1<<s)>0)e.mulTo(i,n,r);else{var o=r;r=i,i=o}return e.revert(r)},c.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var e,r,i=(1<<e)-1,n=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(r=this[o]>>a)>0&&(n=!0,s=l(r));o>=0;)a<e?r=(this[o]&(1<<a)-1)<<e-a|this[--o]>>(a+=this.DB-e):(r=this[o]>>(a-=e)&i,a<=0&&(a+=this.DB,--o)),r>0&&(n=!0),n&&(s+=l(r));return n?s:"0"},c.prototype.negate=function(){var t=h();return c.ZERO.subTo(this,t),t},c.prototype.abs=function(){return this.s<0?this.negate():this},c.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},c.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},c.prototype.mod=function(t){var e=h();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(c.ZERO)>0&&t.subTo(e,e),e},c.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new d(e):new v(e),this.exp(t,r)},c.ZERO=p(0),c.ONE=p(1),m.prototype.init=function(t){var e,r,i;for(e=0;e<256;++e)this.S[e]=e;for(e=0,r=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[r],this.S[r]=i;this.i=0,this.j=0},m.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==k){if(k=[],C=0,"Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto&&window.crypto.random){var y,b,w,_,k,C,A,S=window.crypto.random(32);for(A=0;A<S.length;++A)k[C++]=255&S.charCodeAt(A)}for(;C<256;)A=Math.floor(65536*Math.random()),k[C++]=A>>>8,k[C++]=255&A;C=0,g()}function x(){}function T(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}x.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=function(){if(null==_){for(g(),(_=new m).init(k),C=0;C<k.length;++C)k[C]=0;C=0}return _.next()}()},T.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},T.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=new c(t,16),this.e=parseInt(e,16)):alert("Invalid RSA public key")},T.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return alert("Message too long for RSA"),null;for(var r=[],i=t.length-1;i>=0&&e>0;){var n=t.charCodeAt(i--);n<128?r[--e]=n:n>127&&n<2048?(r[--e]=63&n|128,r[--e]=n>>6|192):(r[--e]=63&n|128,r[--e]=n>>6&63|128,r[--e]=n>>12|224)}r[--e]=0;for(var s=new x,o=[];e>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);r[--e]=o[0]}return r[--e]=2,r[--e]=0,new c(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var i=r.toString(16);return(1&i.length)==0?i:"0"+i};var O=new T;O.setPublic("ac3233fe0efc66e8bbab082817eda4402d0199ee9d4d1c3ef0a7c51c6be8fcb080cf5331b6b4dcbc1fc98e21fdc1abd59538a09053b6840db453f03b27fa4dd9c7587d191a800ea2a456e7abe05b4fd1ba02fced10c4e58792f5bddf782b76b1744a51ab2ff8e4bac7e9fd42a0d7fa311f4d01c15250a1ccb1c73d5201bca803","10001");var B=r(188),E=r(81227);function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach(function(e){(0,i.A)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var L="".concat(B.Zg,"_transId"),N=function(){var t=localStorage.getItem(L);if(t)try{var e=t=JSON.parse(t),r=e.key,i=e.transId,n=e.date;if(r&&i&&n&&n>Date.now())return{key:a.A.enc.Base64.parse(decodeURIComponent(r)),transId:i,date:n}}catch(t){console.error(t)}return null},P={remoteCipher:null,removeLocalCipher:function(t){1===t?this.remoteCipher=null:2===t&&localStorage.removeItem(L)},fetchData:function(){var t=arguments,e=this;return(0,n.A)(o().mark(function r(){var i,n,s,a,c,h,u,l,p,f,d,v,m,g,y,b;return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.length>0&&void 0!==t[0]?t[0]:"",n=t.length>1&&void 0!==t[1]?t[1]:{},s=t.length>2?t[2]:void 0,h=void 0===(c=(a=t.length>3&&void 0!==t[3]?t[3]:{}).self)||c,l=void 0===(u=a.headers)?{}:u,p="string"==typeof n?n:n.body?JSON.stringify(n.body):JSON.stringify(n),r.next=8,e.encrypt(p,s);case 8:return d=(f=r.sent).body,v=f.headers,r.prev=11,r.next=14,E.A.post(i,d,{headers:R(R({},l),v),self:!0});case 14:return m=r.sent,r.next=17,e.decrypt(m,s);case 17:if(g=JSON.parse(r.sent),!h){r.next=22;break}return r.abrupt("return",g);case 22:if(1e4!==g.bizCode){r.next=26;break}return r.abrupt("return",g.data);case 26:return(y=Error(g.message)).bizCode=g.bizCode,r.abrupt("return",Promise.reject(y));case 29:r.next=38;break;case 31:return r.prev=31,r.t0=r.catch(11),r.t0.response&&400===r.t0.response.status&&e.removeLocalCipher(s),(b=Error("Sorry, something went wrong. Please try again.")).canceled=r.t0.canceled,b.login=r.t0.login,r.abrupt("return",Promise.reject(b));case 38:case"end":return r.stop()}},r,null,[[11,31]])}))()},encrypt:function(t,e){var r=this;return(0,n.A)(o().mark(function i(){var n,s,a,c,h,u,l,p;return o().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:i.t0=e,i.next=1===i.t0?3:2===i.t0?11:18;break;case 3:return i.next=5,r.getAesCipher();case 5:return s=(n=i.sent).did,a=n.key,c=r.encryptionByAes(t,a),localStorage.setItem("deviceId",s),i.abrupt("return",{body:c,headers:{deviceId:s,did:s}});case 11:return i.next=13,r.createAesCipher();case 13:return u=(h=i.sent).key,l=h.transId,p=r.encryptionByAes(t,u),i.abrupt("return",{body:p,headers:{transId:l}});case 18:return i.abrupt("return",{body:t});case 19:case"end":return i.stop()}},i)}))()},decrypt:function(t,e){var r=this;return(0,n.A)(o().mark(function i(){var n,s;return o().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(1!==e){i.next=8;break}return i.next=3,r.getAesCipher();case 3:return n=i.sent.key,i.abrupt("return",r.decryptionByAes(n,t));case 8:if(2!==e){i.next=14;break}return i.next=11,r.createAesCipher();case 11:return s=i.sent.key,i.abrupt("return",r.decryptionByAes(s,t));case 14:return console.error(Error("Not found valid cipher type")),i.abrupt("return",t);case 16:case"end":return i.stop()}},i)}))()},encryptionByAes:function(t,e){var r=a.A.lib.WordArray.random(16),i=a.A.AES.encrypt(t,e,{iv:r,mode:a.A.mode.CBC,padding:a.A.pad.Pkcs7});return t=r.clone().concat(i.ciphertext).toString(a.A.enc.Base64)},decryptionByAes:function(t,e){try{var r=window.atob(e),i=window.btoa(r.slice(16)),n=a.A.enc.Base64.parse(window.btoa(r.slice(0,16)));return a.A.AES.decrypt(i,t,{iv:n,mode:a.A.mode.CBC,padding:a.A.pad.Pkcs7}).toString(a.A.enc.Utf8)}catch(t){console.error(t)}return""},getAesCipher:function(){var t=this;return(0,n.A)(o().mark(function e(){var r,i,n;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.remoteCipher){e.next=2;break}return e.abrupt("return",t.remoteCipher);case 2:return e.next=4,E.A.post("/patron/cipher");case 4:return r=e.sent,i=a.A.enc.Base64.parse(r.symmetricCipher),n={did:r.did,key:i},t.remoteCipher=n,e.abrupt("return",n);case 9:case"end":return e.stop()}},e)}))()},createAesCipher:function(){return(0,n.A)(o().mark(function t(){var e,r,i,n,s,c,h;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!((e=N())&&e.date>Date.now())){t.next=3;break}return t.abrupt("return",e);case 3:var o;return i=(r=a.A.lib.WordArray.random(16)).toString(a.A.enc.Base64),o=O.encrypt("password=".concat(encodeURIComponent(i))),n=window.btoa(String.fromCharCode.apply(null,o.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" "))),t.next=8,(0,E.A)({url:"/base/cipher",method:"post",headers:{"Content-type":"text/plain"},data:n});case 8:if(!(s=t.sent)){t.next=14;break}return h=R(R({},c={transId:s.transId,key:r,date:Date.now()+36e5}),{},{key:encodeURIComponent(r.toString(a.A.enc.Base64))}),localStorage.setItem(L,JSON.stringify(h)),t.abrupt("return",c);case 14:case"end":return t.stop()}},t)}))()}},D=function(){return P.fetchData.apply(P,arguments)}},10330:function(t,e,r){r(67834),r(76204),r(24776),r(84734),r(16216),r(89336),r(74576),r(78557),r(96054),r(73687);var i,n,s,o,a,c,h,u,l,p,f,d,v,m,g,y,b,w,_,k,C,A,S,x,T,O,B,E,I,R,L,N,P,D,j,M,q,$,U,V,F,z,H,W,Y=Y||(i=Math,a=(o=(s={}).lib={}).Base=function(){function t(){}return{extend:function(e){t.prototype=this;var r=new t;return e&&r.mixIn(e),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=o.WordArray=a.extend({init:function(t,e){t=this.words=t||[],n!=e?this.sigBytes=e:this.sigBytes=4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var s=0;s<n;s++){var o=r[s>>>2]>>>24-s%4*8&255;e[i+s>>>2]|=o<<24-(i+s)%4*8}else if(r.length>65535)for(var s=0;s<n;s+=4)e[i+s>>>2]=r[s>>>2];else e.push.apply(e,r);return this.sigBytes+=n,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=i.ceil(e/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*i.random()|0);return new c.init(e,t)}}),u=(h=s.enc={}).Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var s=e[n>>>2]>>>24-n%4*8&255;i.push((s>>>4).toString(16)),i.push((15&s).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(r,e/2)}},l=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var s=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(r,e)}},p=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,n=e.sigBytes,s=this.blockSize,o=n/(4*s),a=(o=t?i.ceil(o):i.max((0|o)-this._minBufferSize,0))*s,h=i.min(4*a,n);if(a){for(var u=0;u<a;u+=s)this._doProcessBlock(r,u);var l=r.splice(0,a);e.sigBytes-=h}return new c.init(l,h)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),o.Hasher=f.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new d.HMAC.init(t,r).finalize(e)}}}),d=s.algo={},s);v=Y.lib.WordArray,Y.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp();for(var n=[],s=0;s<r;s+=3)for(var o=(e[s>>>2]>>>24-s%4*8&255)<<16|(e[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|e[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)n.push(i.charAt(o>>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(t){var e=t.length,r=this._map,i=r.charAt(64);if(i){var n=t.indexOf(i);-1!=n&&(e=n)}for(var s=[],o=0,a=0;a<e;a++)if(a%4){var c=r.indexOf(t.charAt(a-1))<<a%4*2,h=r.indexOf(t.charAt(a))>>>6-a%4*2;s[o>>>2]|=(c|h)<<24-o%4*8,o++}return v.create(s,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},Y.lib.Cipher||(g=(m=Y.lib).Base,y=m.WordArray,b=m.BufferedBlockAlgorithm,(w=Y.enc).Utf8,_=w.Base64,k=Y.algo.EvpKDF,C=m.Cipher=b.extend({cfg:g.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){b.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?R:E}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),m.StreamCipher=C.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),A=Y.mode={},S=m.BlockCipherMode=g.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),x=A.CBC=function(){var t=S.extend();function e(t,e,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else var n=this._prevBlock;for(var s=0;s<r;s++)t[e+s]^=n[s]}return t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize;e.call(this,t,r,n),i.encryptBlock(t,r),this._prevBlock=t.slice(r,r+n)}}),t.Decryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,s=t.slice(r,r+n);i.decryptBlock(t,r),e.call(this,t,r,n),this._prevBlock=s}}),t}(),T=(Y.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,i=r-t.sigBytes%r,n=i<<24|i<<16|i<<8|i,s=[],o=0;o<i;o+=4)s.push(n);var a=y.create(s,i);t.concat(a)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},m.BlockCipher=C.extend({cfg:C.cfg.extend({mode:x,padding:T}),reset:function(){C.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{var i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),O=m.CipherParams=g.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),B=(Y.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var i=y.create([1398893684,1701076831]).concat(r).concat(e);else var i=e;return i.toString(_)},parse:function(t){var e=_.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var i=y.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return O.create({ciphertext:e,salt:i})}},E=m.SerializableCipher=g.extend({cfg:g.extend({format:B}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),s=n.finalize(e),o=n.cfg;return O.create({ciphertext:s,key:r,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),I=(Y.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=y.random(8));var n=k.create({keySize:e+r}).compute(t,i),s=y.create(n.words.slice(e),4*r);return n.sigBytes=4*e,O.create({key:n,iv:s,salt:i})}},R=m.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:I}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var s=E.encrypt.call(this,t,e,n.key,i);return s.mixIn(n),s},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,E.decrypt.call(this,t,e,n.key,i)}})),L=Y.lib.BlockCipher,N=Y.algo,P=[],D=[],j=[],M=[],q=[],$=[],U=[],V=[],F=[],z=[],function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,i=0,e=0;e<256;e++){var n=i^i<<1^i<<2^i<<3^i<<4;n=n>>>8^255&n^99,P[r]=n,D[n]=r;var s=t[r],o=t[s],a=t[o],c=257*t[n]^16843008*n;j[r]=c<<24|c>>>8,M[r]=c<<16|c>>>16,q[r]=c<<8|c>>>24,$[r]=c;var c=16843009*a^65537*o^257*s^16843008*r;U[n]=c<<24|c>>>8,V[n]=c<<16|c>>>16,F[n]=c<<8|c>>>24,z[n]=c,r?(r=s^t[t[t[a^s]]],i^=t[t[i]]):r=i=1}}(),H=[0,1,2,4,8,16,32,64,128,27,54],W=N.AES=L.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes/4,i=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[],s=0;s<i;s++)if(s<r)n[s]=e[s];else{var o=n[s-1];s%r?r>6&&s%r==4&&(o=P[o>>>24]<<24|P[o>>>16&255]<<16|P[o>>>8&255]<<8|P[255&o]):o=(P[(o=o<<8|o>>>24)>>>24]<<24|P[o>>>16&255]<<16|P[o>>>8&255]<<8|P[255&o])^H[s/r|0]<<24,n[s]=n[s-r]^o}for(var a=this._invKeySchedule=[],c=0;c<i;c++){var s=i-c;if(c%4)var o=n[s];else var o=n[s-4];c<4||s<=4?a[c]=o:a[c]=U[P[o>>>24]]^V[P[o>>>16&255]]^F[P[o>>>8&255]]^z[P[255&o]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,j,M,q,$,P)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,U,V,F,z,D);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,s,o,a){for(var c=this._nRounds,h=t[e]^r[0],u=t[e+1]^r[1],l=t[e+2]^r[2],p=t[e+3]^r[3],f=4,d=1;d<c;d++){var v=i[h>>>24]^n[u>>>16&255]^s[l>>>8&255]^o[255&p]^r[f++],m=i[u>>>24]^n[l>>>16&255]^s[p>>>8&255]^o[255&h]^r[f++],g=i[l>>>24]^n[p>>>16&255]^s[h>>>8&255]^o[255&u]^r[f++],y=i[p>>>24]^n[h>>>16&255]^s[u>>>8&255]^o[255&l]^r[f++];h=v,u=m,l=g,p=y}var v=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^r[f++],m=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^r[f++],g=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^r[f++],y=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^r[f++];t[e]=v,t[e+1]=m,t[e+2]=g,t[e+3]=y},keySize:8}),Y.AES=L._createHelper(W),e.A=Y},62344:function(t,e,r){r(83810),r(29305),r(14382),r(36457),r(23630),r(88908),r(33087),r(36947);var i=r(41705),n=r(40694);r(67834),r(76204),r(76281),r(77575),r(78557),r(90076),r(95021),r(17456);var s=r(83957),o=r.n(s),a=r(9576),c=r(8884),h=r(91377),u=r(78608),l=r(20770),p=r(41526),f=r(55829),d=r(80980),v=r(32308),m=r(28259);function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach(function(e){(0,i.A)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var b=[504,403];e.A=function(t){var e=t.headers,r=t.parser,i=void 0===r?null:r,s=t.baseURL,g=t.requestHeaders,w=void 0===g?null:g,_=o().create({baseURL:s||p.m4,headers:Object.assign({operid:(0,p.Ig)(),ApiLevel:2,devMem:navigator.deviceMemory||"",network:(navigator.connection||{}).effectiveType},void 0===e?{}:e)});return _.interceptors.request.use(function(t){var e=(0,h.c)();return e&&!(0,h.Gb)(e)&&(t.headers.channel=e),"web"===window.msPlatform&&Object.assign(t.headers,(0,m.oG)()),w&&Object.assign(t.headers,w()),m.sK&&"object"===(0,n.A)(m.sK)&&Object.assign(t.headers,m.sK),t},function(t){return Promise.reject(t)}),_.interceptors.response.use(function(t){var e=t.headers,r=e.nation,n=e.verifytoken;return(r&&!v.Mh.value&&(0,v.LZ)(r),n&&(0,d.Q)().setVerifyToken(n),i)?i(t):t.data},function(t){if(o().isCancel(t)){var e=Error(u.JJ);return e.canceled=!0,Promise.reject(e)}if(!t.response)return Promise.reject(Error(u.Lj));var r=t.response.status;if(401===r){(0,l.e)(),(0,f.n)().update(!1);var i=Error("Not Login");return i.login=!1,Promise.reject(i)}if(b.includes(r)||(0,c.l)(y(y({},(0,a.A)(t,["message","stack"])),{},{name:t.response.statusText,request:(0,a.A)(t.response.config,["baseURL","url","method","headers","params","data"]),response:t.response.data||{}})),500===r&&"string"==typeof t.response.data&&/Blocked\sby\sAdGuard/i.test(t.response.data))return Promise.reject(Error("Sorry, your request is blocked by an ads filter plugin of your browser. Please close it to have a better MSport experience."));if(400===r&&t.response.data){var n=t.response.data,s=n.bizCode,h=n.message;t.bizCode=s,t.message=h}return Promise.reject(t)}),_}},54259:function(t,e,r){if(r.d(e,{A:function(){return l}}),/^(4763|5790|9347|9569)$/.test(r.j))var i,n=r(45841);if(/^(4763|5790|9347|9569)$/.test(r.j))var s=r(92099);if(/^(4763|5790|9347|9569)$/.test(r.j))var o=r(48183);if(/^(4763|5790|9347|9569)$/.test(r.j))var a=r(41705);var c=r(61790),h=r.n(c);r(78557),r(90076),r(83810);var u=r(25767),l=/^(4763|5790|9347|9569)$/.test(r.j)?(0,o.A)(function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.axios;(0,s.A)(this,t),(0,a.A)(this,"key",null),this.key=new u.A(e,"pkcs8-public",{environment:"browser"}),this.axiosIns=i},[{key:"encrypt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base64";return this.key.encrypt(t,e)}},{key:"decrypt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"binary";return JSON.parse(this.key.decryptPublic(t,e))}},{key:"fetch",value:(i=(0,n.A)(h().mark(function t(){var e,r,i,n,s,o,a=arguments;return h().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:"",r=a.length>1?a[1]:void 0,n=void 0===(i=(a.length>2&&void 0!==a[2]?a[2]:{}).headers)?{}:i,s=this.encrypt(r),t.next=6,this.axiosIns.post(e,s,{self:!0,headers:n});case 6:return o=t.sent,t.abrupt("return",this.decrypt(o));case 8:case"end":return t.stop()}},t,this)})),function(){return i.apply(this,arguments)})}]):null},81633:function(t,e,r){if(r.d(e,{A:function(){return d}}),3057==r.j)var i,n=r(41705);if(3057==r.j)var s=r(29644);if(3057==r.j)var o=r(45841);r(29305),r(67834),r(76204),r(24776),r(14382),r(77575),r(33087),r(36947),r(36457),r(88908),r(83810),r(78557),r(90076),r(23630);var a=r(61790),c=r.n(a),h=r(41526),u=r(28259),l=3057==r.j?["headers","self"]:null;function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach(function(e){(0,n.A)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function d(){return v.apply(this,arguments)}function v(){return(v=(0,o.A)(c().mark(function t(){var e,r,i,n,o,a,p,d,v,y=arguments;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.length>0&&void 0!==y[0]?y[0]:"",n=void 0===(i=(r=y.length>1&&void 0!==y[1]?y[1]:{}).headers)?{}:i,a=void 0!==(o=r.self)&&o,p=(0,s.A)(r,l),d="web"===window.msPlatform?(0,u.oG)():(0,u.yV)(),v={method:"GET",headers:f(f({operid:(0,h.Ig)(),ApiLevel:2,devMem:navigator.deviceMemory||"",network:navigator.connection?navigator.connection.effectiveType:""},d),n)},p&&Object.assign(v,p),t.abrupt("return",window.fetch("".concat(h.m4,"/").concat(e),v).then(m).then(function(t){return g(t,a)}).catch(function(t){return{error:t}}));case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}var m=3057==r.j?(i=(0,o.A)(c().mark(function t(e){var r,i,n;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.status,!(e.ok&&200===e.status)){t.next=5;break}return t.abrupt("return",e.json());case 5:if(!(403===r||504===r)){t.next=12;break}return t.next=8,e.text();case 8:return i=t.sent,t.abrupt("return",{message:i});case 12:return t.prev=12,t.next=15,e.json();case 15:return n=t.sent.error,t.abrupt("return",{message:n});case 20:return t.prev=20,t.t0=t.catch(12),t.abrupt("return",{message:t.t0.message});case 23:case"end":return t.stop()}},t,null,[[12,20]])})),function(t){return i.apply(this,arguments)}):null,g=function(t,e){if(e)return{data:t};var r=t.bizCode,i=t.data,n=t.message;if(1e4===r)return{data:i};var s=Error(n);return s.bizCode=r,{error:s}}},35675:function(t,e,r){r.d(e,{A:function(){return C}}),r(94);var i,n=r(6037);r(21359),r(44830);var s=r(92099),o=r(48183),a=r(42912),c=r(74572),h=r(50171);r(78557),r(39436),r(23630);var u=r(41705);r(24776),r(84734),r(74576),r(49781),r(66184),r(83810),r(646),r(95035),r(95021),r(83103),r(17456),r(73687),r(93062),r(11810),r(83994),r(44962),r(82367);var l=r(62087);r(76204);var p=r(59186),f=function(){var t,e=p.A.get("device-id");return e||(t=Date.now(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}),p.A.set("device-id",e,{path:"/",expires:1e3})),e},d=r(85406),v=r(188),m={"^~":"^[^^]+"},g=Object.keys(m),y=/(\^|~)/g,b=(i=0,function(){return++i}),w=(0,o.A)(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.devType,i=e.productCode,n=e.deviceId,o=void 0===n?"":n,a=e.accountId,c=e.server,h=e.socketOptions,l=void 0===h?{}:h;(0,s.A)(this,t),(0,u.A)(this,"PUSH_TYPE",{MULTI:"MULTI",GROUP:"GROUP",SPECIAL:"SPECIAL"}),(0,u.A)(this,"SPLIT_CHAR","@@"),(0,u.A)(this,"socket",null),(0,u.A)(this,"requestCallbacks",{}),(0,u.A)(this,"topicListeners",{}),(0,u.A)(this,"isReady",!1),(0,u.A)(this,"topicRegListeners",{}),(0,u.A)(this,"topicRegMap",{}),(0,u.A)(this,"serverErrorLock",!1),o||(o=f()),l.transports=["websocket","polling"],l.upgrade=!1;var p="wss://ws{COUNTRY}.msport.com".replace("{COUNTRY}",v.Zg);this.config={devType:void 0===r?"WEB":r,productCode:void 0===i?"":i,deviceId:o,accountId:void 0===a?"":a,server:(void 0===c?"":c)||p,socketOptions:l}},[{key:"updateConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)e in this.config&&(this.config[e]=t[e])}},{key:"init",value:function(){this.tryConnected||(this._connect(),this.tryConnected=!0)}},{key:"_getListenerKey",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat(t).concat(this.SPLIT_CHAR).concat(e)}},{key:"_connect",value:function(){var t=this,e=this.config,r=e.server,i=e.socketOptions;this.socket=(0,l.io)(r,i),this.socket.on("connect",function(){t._register(function(){var e=t.SPLIT_CHAR;for(var r in t.isReady=!0,t.topicListeners)if(t.topicListeners[r]&&t.topicListeners[r].length){var i=r.split(e),n=i[0],s=i[1];t._postSubRequest(n,s)}for(var o in t.topicRegListeners)if(t.topicRegListeners[o]&&t.topicRegListeners[o].length){var a=o.split(e),c=a[0],h=a[1];t._postSubRequest(c,h)}})}),this.socket.on("disconnect",function(){t.isReady=!1}),this.socket.on("data",function(e){t._parseResponse(e)}),this.socket.on("connect_error",function(t){console.error(t)}),this.socket.io.on("error",function(t){console.error(t)})}},{key:"_register",value:function(t){var e={devType:this.config.devType,deviceId:this.config.deviceId};this._postRequest(e,"reg",t)}},{key:"_postRequest",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=this.config.productCode,n=b();"function"==typeof r&&(this.requestCallbacks[n]=r),t.requestId=n,t.productCode=i,this.socket.emit("data",{type:e,data:JSON.stringify(t)})}},{key:"_postSubRequest",value:function(t,e,r){var i={topic:t,subType:"SUB",pushType:e};this.config.accountId&&e===this.PUSH_TYPE.MULTI&&(i.accountId=this.config.accountId),this._postRequest(i,"sub",r)}},{key:"_postUnsubRequest",value:function(t,e,r){var i={topic:t,subType:"UNSUB",pushType:e};this.config.accountId&&e===this.PUSH_TYPE.MULTI&&(i.accountId=this.config.accountId),this._postRequest(i,"sub",r)}},{key:"_parseResponse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=JSON.parse(t.data||"{}");if("resp"===t.type){if("422"===e.rightHost)this.serverErrorLock||(alert("Sorry, the real-time data update can't work well in your current Firefox browser. Please enjoy MSport under another browser (Google Chrome is recommended)."),this.serverErrorLock=!0);else{var r=this.requestCallbacks,i=e.requestId,n=r[i];n&&(n.call(this,e),delete r[i])}}else if("ret"===t.type){for(var s=this.topicListeners,o=this.topicRegListeners,a=this.topicRegMap,c=e.topic,h=e.pushType,u=(0,d.D4)(e.body),l=this._getListenerKey(c,h),p=s[l]||[],f=0;f<p.length;f++)p[f].call(this,u);for(var v=Object.keys(o),m=0;m<v.length;m++){var g=v[m];if(p=[],a[g]&&RegExp("^"+a[g]+"$").test(l)){p=o[g]||[];for(var y=0;y<p.length;y++)p[y].call(this,u)}}}}},{key:"sub",value:function(t){var e,r=this,i=t.topic,n=t.pushType,s=t.listener,o=t.callback;this.init();for(var a=this._getListenerKey(i,n),c=!1,h=a.replace(/\+/g,"\\+"),u=0;u<g.length;u++){var l=g[u];if(-1!==a.indexOf(l)){for(var p=RegExp(l.replace(y,"\\$1"),"g"),f=p.exec(h);f;)h=h.replace(l,m[l]),f=p.exec(h);c||(c=!0)}}c?(e=this.topicRegListeners[a]||[],h=h.replace(/\./g,"\\.").replace(/\|/g,"\\|").replace(/\^(?!\^)/g,"\\^"),this.topicRegMap[a]=h):e=this.topicListeners[a]||[],e.length?(e.push(s),"function"==typeof o&&setTimeout(function(){o.call(r)},0)):(e.push(s),c?this.topicRegListeners[a]=e:this.topicListeners[a]=e,this.isReady&&this._postSubRequest(i,n,o))}},{key:"unsub",value:function(t){for(var e,r=this,i=t.topic,n=t.pushType,s=t.listener,o=t.callback,a=Object.keys(m),c=this._getListenerKey(i,n),h=!1,u=0;u<a.length;u++){var l=a[u];if(-1!==c.indexOf(l)&&!h){h=!0;break}}if((e=h?this.topicRegListeners[c]||[]:this.topicListeners[c]||[])&&e.length>0){if(s){for(var p=0;p<e.length;p++)if(e[p]===s){e.splice(p,1);break}}else e.length=0;if(0===e.length){h?delete this.topicRegListeners[c]:delete this.topicListeners[c],this.isReady&&this._postUnsubRequest(i,n,o);return}}else this.isReady&&this._postUnsubRequest(i,n,o);"function"==typeof o&&setTimeout(function(){o.call(r)},0)}}]),_=r(21026);function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}var C=new(function(t){function e(){var t,r;return(0,s.A)(this,e),t=e,r=arguments,t=(0,c.A)(t),(0,a.A)(this,k()?Reflect.construct(t,r||[],(0,c.A)(this).constructor):t.apply(this,r))}return(0,h.A)(e,t),(0,o.A)(e,[{key:"pushTopic",value:function(t){var e=this,r=t.type,i=void 0===r?1:r,n=t.sportId,s=void 0===n?"":n,o=t.categoryId,a=void 0===o?"":o,c=t.tournamentId,h=void 0===c?"":c,u=t.eventId,l=t.productId,p=t.marketIds,f=t.specifiers,d=t.pushType,v=void 0===d?"GROUP":d,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,g=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!s){console.error("sportId is required!");return}var y=g?m||function(){}:m,b=function(t){return(0,_.e)({sportId:s,categoryId:a,tournamentId:h,eventId:u,productId:l,marketId:t,specifiers:f},i)};if(1!==i&&Array.isArray(p))p.length&&p.forEach(function(t){var r=b(t);g?e.sub({topic:r,pushType:v,listener:y}):e.unsub({topic:r,pushType:v,listener:y})});else{var w=b(p);g?this.sub({topic:w,pushType:v,listener:y}):this.unsub({topic:w,pushType:v,listener:y})}}}])}(w))({productCode:Number(n.A.t("PRODUCT_CODE"))})},21026:function(t,e,r){r.d(e,{e:function(){return n}}),r(16216),r(95021),r(93062);var i=function(t){return t||"~"},n=function(t){var e=t.sportId,r=t.categoryId,n=t.tournamentId,s=t.eventId,o=t.productId,a=t.specifiers,c=t.marketId,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=[e=e.replace(/\D/g,""),r=r.replace(/\D/g,""),n,s];return 1===h?u.push("status"):(u.push(i(o),i(c),i(a)),2===h?u.push("status"):3===h&&u.push("odds")),u.join("^")}},48542:function(t,e,r){if(r(89336),r(78557),r(51908),r(69892),r(17456),r(29305),r(32733),r(84701),r(67834),r(76204),/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j))var i=r(41705);function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}r(76281),r(44962),r(94),r(77575),r(83810),r(95021),r(73687),r(83994),r(82367),r(11810);var s={topic:"topic",allScores:"allScores",betStatus:"betStatus",eventGameScores:"scoreOfSection",eventMatchStatus:"statusDescription",eventPlayedTime:"playedTime",eventPointScore:"scoreInCurrentSection",eventRemainingTimeInPeriod:"sectionRemainTime",eventScore:"scoreOfWholeMatch",eventStatus:"status",fixtureAwayTeamName:"awayTeam",fixtureHomeTeamName:"homeTeam",fixtureSportCategoryName:"category",fixtureSportName:"sport",fixtureStartTime:"startTime",fixtureTournamentName:"tournament",productStatus:"productStatus",bmLcooCount:"bmLcooCount",liveChannel:"hasLive",soccerCornerScore:"soccerCornerScore",soccerBookingsScore:"soccerBookingsScore"},o={topic:1,allScores:1,betStatus:1,scoreOfSection:1,statusDescription:1,playedTime:1,scoreInCurrentSection:1,sectionRemainTime:1,scoreOfWholeMatch:1,status:1,awayTeam:1,homeTeam:1,category:1,sport:1,startTime:1,tournament:1,productStatus:1,bmLcooCount:1,hasLive:0,soccerCornerScore:1,soccerBookingsScore:1},a={status:1,betStatus:1,startTime:1,hasLive:1,bmLcooCount:1},c=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?["topic","product","status","description","group","isFavourite","guidance","pushTime","presentationType","priority"]:null,h={product:1,status:1,description:1,group:1,isFavourite:1,pushTime:1,presentationType:1,priority:1},u=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?["topic","product","status","description","group","isFavourite","guidance","pushTime","presentationType",["id","description","odds","isActive","isWinning","refundFactor","probability"],"priority"]:null,l={id:1,description:1,odds:1,isActive:1,probability:1},p={isActive:1,product:1,status:1,isFavourite:1,presentationType:1,priority:1},f=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?["description","group","guidance"]:null;function d(t,e,r){("number"!=typeof r||isNaN(r))&&f.includes(e)&&!r||Object.assign(t,(0,i.A)({},e,r)),"priority"===e&&isNaN(r)&&delete t.priority}e.A=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?function(t,e){if(t)return"market"===e?function(t){var e={};if(t.length){for(var r=0,i=t.length;r<i;r++){var n=c[r],s=t[r];h[n]&&null!==s&&(p[n]&&(s=Number(s)),d(e,n,s))}return e}}(t):"event"===e?function(t){var e={};if(!t)return e;for(var r in t){var i=s[r]||r;if(o[i]){var n=t[r];e[i]=a[i]?Number(n):n}}return e}(t):function(t){var e={},r=u[9],i=[];try{var s=t[9];"string"==typeof s?i=JSON.parse(s):s.length&&(i=s)}catch(t){}if(Array.isArray(i)){var o,a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,void 0);var r=({}).toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,void 0):void 0}}(t))){r&&(t=r);var i=0,s=function(){};return{s:s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:s}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}(i);try{for(a.s();!(o=a.n()).done;){var c=o.value,h=c?c.split("#"):[];if(h.length>=r.length){var f=h[0];e[f]={};for(var v=1,m=h.length;v<m;v++){var g=r[v],y=h[v];l[g]&&y&&(p[g]&&(y=Number(y)),d(e[f],g,y))}}}}catch(t){a.e(t)}finally{a.f()}return e}}(t)}:null},5263:function(t,e,r){r(78557),r(23630),r(95021),r(11810);var i=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?["sportId","categoryId","tournamentId","eventId"]:null,n=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?["sportId","categoryId","tournamentId","eventId","productId","marketId","marketSpecifiers"]:null;e.A=/^(3(057|207|35)|5(33|681|956)|2155|2704|4970|6047|67|9332)$/.test(r.j)?function(t,e){if(!t||!e)return null;var r=t.split("^"),s={};return(1===e?i:n).forEach(function(t,e){var i=r[e];s[t]="~"===i?"":i}),s}:null},22442:function(t,e,r){r.d(e,{Ay:function(){return $},Cx:function(){return M},Di:function(){return q}});var i=r(41705),n=r(82480),s=r(10911),o=r(45841),a=r(61790),c=r.n(a);r(29305),r(14382),r(26448),r(74576),r(77575),r(33087),r(36947),r(57132),r(36457),r(88908),r(83810),r(78557),r(95021),r(17456),r(93062),r(39436),r(23630),r(90076);var h=r(27507),u=r(91249),l=r(35675),p=r(59186),f=r(50545),d=r(7838),v=r(14112),m=[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"popup-giveaway-header"},[e("div",[e("img",{staticClass:"popup-giveaway-header-logo",attrs:{src:r(11001)}})]),this._v(" "),e("p",[this._v("MILLIONS GIVEAWAY")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"popup-giveaway-main-light absolute-middle"},[e("img",{staticClass:"light",attrs:{src:r(58762),alt:""}})])}];r(24776);var g=r(21650),y=r(23152),b=r(21342),w=r(188),_=r(51954),k=r(6880),C=r(8581);r(54569);var A={name:"Winning",components:{Share:_.SY},props:{data:{type:Object,default:function(){return{}},required:!1},visible:{type:Boolean,required:!1,default:!1}},data:function(){return{hideAmount:!1,hideAmountChecked:!1,shareElement:null,shareVisible:!1,shareData:{shareTopTips:"You're so lucky! Share to tell your friends!",shareImgs:[]},drawLoading:!1}},computed:{hostname:function(){return location.hostname}},methods:{handleShowOff:function(){var t=this;return(0,o.A)(c().mark(function e(){var r,i;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{t.drawLoading=!0,r=t.data.image,i={WH:[720,979],backgroundColor:"transparent",imageType:"image/png",image:[{type:"image",src:r,pos:[0,0,720,979]}],text:[{text:"".concat(t.$t("CURRENCY")," ").concat(t.data.total),type:"text",pos:[508,308],style:{color:"#e1c593",font:"bold 60px arial",textAlign:"center"}}],quality:1},t.$nextTick((0,o.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:g.A.elementDraw(i).then(function(e){t.shareData.shareImgs.push(e),t.shareVisible=!0,t.drawLoading=!1});case 1:case"end":return e.stop()}},e)})))}catch(e){console.error(e),t.drawLoading=!1}case 1:case"end":return e.stop()}},e)}))()},handleUse:function(){var t=this.data.vouchers;if(1===t[0].status){if(t[0].platform&&"android"===t[0].platform.toLowerCase())this.openApp(t[0].amount);else{var e=this.data.bizType||[];(0,b.j)(e)}}else location.href=(0,w.z9)("/vouchers")},openApp:function(t){var e=this;(0,k.XT)("/params",{onfailed:function(){return e.popupDialog(t)},force:!0})},popupDialog:function(t){this.$dialog({title:"Download MSport App",message:"This voucher can be used on MSport app only. Download free app to get ".concat(this.$t("CURRENCY")," ").concat(t," OFF now."),confirmButtonText:"Free Download",cancelButtonText:"Cancel",showClose:!0,distinguishCancelAndClose:!0,closeOnClickModal:!0}).then(function(){(0,y.l)()})},closeVoucher:function(){this.$emit("voucherShow",!1),C.A.beforeClose(),f.pC.close()},onCloseShare:function(){this.shareVisible=!1}}},S=r(67658),x=(0,S.A)(A,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"},{name:"loading",rawName:"v-loading.fullscreen",value:t.drawLoading,expression:"drawLoading",modifiers:{fullscreen:!0}}],ref:"winning",staticClass:"popup-giveaway-wrap"},[i("div",{staticClass:"popup-giveaway-container"},[t._m(0),t._v(" "),i("div",{staticClass:"popup-giveaway-main"},[i("div",{staticClass:"popup-giveaway-main-pkg absolute-middle"},[i("div",{staticClass:"popup-giveaway-main-top"}),t._v(" "),i("div",{staticClass:"popup-giveaway-main-bot"}),t._v(" "),i("div",{staticClass:"popup-giveaway-main-amount absolute-middle"},[i("p",{staticClass:"prize-info"},[i("span",[t._v(t._s(t.data.total))]),t._v(" "),i("span",{staticClass:"unit"},[t._v(t._s(t.$t("CURRENCY")))]),t._v(" "),i("img",{staticClass:"popup-giveaway-main-amount-vouchers",attrs:{src:r(47677)}})])]),t._v(" "),i("div",{staticClass:"popup-giveaway-main-text"},[t._v("\n          AMAZING! YOU GOT\n        ")])]),t._v(" "),t._m(1),t._v(" "),i("img",{staticClass:"popup-giveaway-main-img1",attrs:{src:r(43082)}}),t._v(" "),i("img",{staticClass:"popup-giveaway-main-img2",attrs:{src:r(92065)}}),t._v(" "),i("img",{staticClass:"popup-giveaway-main-img3",attrs:{src:r(19352)}})]),t._v(" "),t.data.hiddenButton?t._e():i("div",{staticClass:"popup-giveaway-btn"},[i("div",{staticClass:"popup-giveaway-btn-wrap",on:{click:t.handleShowOff}},[t._v("\n        Show Off\n      ")]),t._v(" "),i("div",{staticClass:"popup-giveaway-btn-wrap",on:{click:t.handleUse}},[t._v("\n        Use Now\n      ")])]),t._v(" "),i("div",{staticClass:"popup-giveaway-close",on:{click:t.closeVoucher}},[i("svg-icon",{attrs:{"icon-class":"icon-close-round"}})],1),t._v(" "),t.data.showNotice?i("div",{staticClass:"popup-giveaway-notice"},[t._v("\n      Notice: This is a Giveaway Voucher Template.\n    ")]):t._e()]),t._v(" "),i("Share",{attrs:{"share-title":t.data.messageTitle,"share-top-tips":t.shareData.shareTopTips,"share-imgs":t.shareData.shareImgs,"share-url":t.data.wapLink,"share-text":t.data.message,"has-hide-amount-btn":!1},on:{close:t.onCloseShare},model:{value:t.shareVisible,callback:function(e){t.shareVisible=e},expression:"shareVisible"}})],1)},m,!1,null,null,null).exports;r(61421);var T=(0,S.A)({name:"ConditionalVoucher",props:{quest:{type:Object,default:function(){return{}}}},computed:{hexColors:function(){var t=this.quest.hex;return t?"["===t[0]?JSON.parse(t):[t]:[]}},methods:{handleClose:function(){C.A.beforeClose(),f.pC.close(),this.$emit("close")},handleClick:function(){window.mstrace("push_quest_click"),this.quest.wapLink&&(location.href=this.quest.wapLink)}}},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"push-conditional-voucher-wrap"},[i("div",{staticClass:"push-conditional-voucher"},[t.quest.image?i("img",{staticClass:"push-conditional-voucher--banner",attrs:{src:t.quest.image}}):i("div",{staticClass:"push-conditional-voucher--summary"},[i("div",{staticClass:"note"},[t._v("\n        You got conditional vouchers\n      ")]),t._v(" "),i("div",{staticClass:"title"},[i("span",[t._v(t._s(t.quest.title))]),t._v(" "),i("img",{attrs:{src:r(32197)}})]),t._v(" "),i("div",{staticClass:"total-value"},[t._v("\n        "+t._s(t.$t("CURRENCY_UNIT"))+" "+t._s(t.quest.amount)+"\n      ")])]),t._v(" "),i("div",{staticClass:"push-conditional-voucher--main"},[i("div",{staticClass:"push-conditional-voucher--task"},[t._l(t.quest.display,function(e,r){return[i("div",{key:r,staticClass:"task-item"},[i("div",{staticClass:"task-item-inner flex"},[i("div",{staticClass:"task-icon"},[i("img",{attrs:{src:e.icon}})]),t._v(" "),i("div",{staticClass:"task-content"},[t._v("\n                "+t._s(e.content)+"\n              ")])])])]})],2),t._v(" "),i("a",{staticClass:"check-details v-button",style:{background:t.hexColors[0],color:t.hexColors[1]},on:{click:t.handleClick}},[t._v(t._s(t.quest.text||"Check Details"))])]),t._v(" "),i("a",{staticClass:"close-btn",on:{click:t.handleClose}},[i("svg-icon",{attrs:{"icon-class":"icon-clear"}})],1)])])},[],!1,null,null,null).exports,O=r(49434),B=r(64057),E=r(49912),I=r(76185),R=r(20770),L=r(62392);function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach(function(e){(0,i.A)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var D=new h.default,j={_topicMap:{realsport:"personal_winning_topic",virtual:"personal_virtual_winning_topic",voucher:"user_voucher_receive_topic",quest:"user_quest_receive_topic"},_ref:{},paused:!1,ready:!1,waitDuration:3e3,priority:0,options:{ad:!1,realsport:!0,voucher:!0,quest:!0,virtual:!1},pool:{realsport:[],virtual:[],voucher:[],quest:[],reset:function(){this.realsport.splice(0),this.virtual.splice(0),this.voucher.splice(0),this.quest.splice(0)}},setupPushConfig:function(){var t=p.A.get("userId")||p.A.get("accessToken");l.A.updateConfig({accountId:t})},init:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.update(e),this.watchStatus(),(0,R.g)()?this.aggregateMessage():(this.ready=!1,(0,u.iXd)("LOGIN_SUCCESS").on(function(){(0,R.e)(!0),t.aggregateMessage()})),this.options.ad&&this.getPopupAd()},update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._topicMap;for(var r in t){var i=t[r],n=this.callbackRef(r);if(i!==this.options[r]){var s=e[r];i?(this.sub(s,n),"ad"===r&&this.getPopupAd()):this.unsub(s)}}this.options=Object.assign(this.options,t)},unsetup:function(){this.initSubHub(!1)},updateRedayStatus:function(t){t?this.ready=!1:(this.ready=!0,this.fire())},watchStatus:function(){var t=this;/virtual/.test(location.pathname)?B.A.$on("VIRTUAL_BETSLIP_VISIBLE",function(e){return t.updateRedayStatus(e)}):B.A.$on(E.ZP,function(e){return t.updateRedayStatus(e)}),B.A.$on("product-down",function(e){return t.updateRedayStatus(e)})},aggregateMessage:function(){var t=this;return(0,o.A)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.setupPushConfig(),t.ready=!1,t.initSubHub(),e.next=5,(0,d.y)(t.waitDuration);case 5:t.ready=!0,t.fire();case 7:case"end":return e.stop()}},e)}))()},pause:function(){this.paused=!0},play:function(){this.paused=!1,this.fire()},initSubHub:function(){var t=this,e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],r=e?this.sub:this.unsub,i=this._topicMap;Object.entries(this.options).forEach(function(e){var n=(0,s.A)(e,2),o=n[0];if(n[1]){var a=t.callbackRef(o);r(i[o],a)}})},callFire:function(t,e){var r=JSON.parse(t);this.pool[e].push(r),this.fire(e)},callbackRef:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this._ref[e])return this._ref[e];var r=function(r){return t.callFire(r,e)};return this._ref[e]=r,r},fire:function(t){var e=this;if(this.ready&&!this.paused){var r=null;if(t)r=this.pool[t].pop();else{var i=this.pool,s=i.realsport,o=i.virtual,a=i.voucher,c=i.quest;s.length?(s.sort(function(t,r){return e.compireStringNum(t.totalWinnings,r.totalWinnings)}),(0,n.A)(s),r=s.pop(),t="realsport"):o.length?(o.sort(function(t,r){return e.compireStringNum(t.totalWinnings,r.totalWinnings)}),(0,n.A)(o),r=o.pop(),t="virtual"):a.length?(r=a.pop(),t="voucher"):c.length&&(r=c.pop(),t="quest")}var h=this.getPriorityType(t,r),u=this.getPriority(h);this.checkPriority(u)&&r&&this.popup(t,r),this.pool.reset()}},getPriorityType:function(t,e){if(e)return"realsport"===t||"virtual"===t?t:1===e.template?"giveaway":t},getPriority:function(t){switch(t){case"realsport":return 1;case"virtual":return 3;case"giveaway":return 7;case"voucher":case"quest":return 9;default:return 0}},resetPriority:function(){this.priority=0},checkPriority:function(t){return 0===this.priority||t<=this.priority},compireStringNum:function(t,e){return+t.replace(/,/g,"")-+e.replace(/,/g,"")},popup:function(t,e){switch(C.A.beforeClose(),f.pC.close(),B.A.$emit("popup_ad_close"),t){case"realsport":case"virtual":this.popupWinning(t,e);break;case"voucher":this.popupVoucherInfo(e);break;case"quest":this.popupQuest(e)}e&&C.A.afterOpen();var r=this.getPriorityType(t,e);this.priority=this.getPriority(r),this.active=!1,B.A.$emit("update-balance")},popupWinning:function(t,e){var r=this;if(e){var i="virtual"===t,n=i?I.A:v.A;(0,f.pC)({message:D.$createElement(n,{props:P(P({},e),{},{pushTime:new Date().getTime()})}),showClose:!!i,classNames:["dialog-push-winning",i?"virtual-push-dialog":"dialog-push"]}).then(function(){C.A.beforeClose()}).catch(function(t){C.A.beforeClose(),r.resetPriority(),console.error(t)})}},popupVoucherInfo:function(t){if(t){var e=1===t.template,r=e?x:O.A;(0,f.pC)({message:D.$createElement(r,{props:{data:P({},t),visible:!0}}),showClose:!1,classNames:["dialog-push",e?"giveaway-dialog":"voucher-dialog"]}).then(function(){C.A.beforeClose()}).catch(function(t){C.A.beforeClose(),console.error(t)}),e||B.A.$emit("update-bet-vouchers")}},popupQuest:function(t){var e=this;t&&(0,f.pC)({message:D.$createElement(T,{props:{quest:t}}),showClose:!1,classNames:["dialog-push","quest-dialog"]}).then(function(){C.A.beforeClose()}).catch(function(t){C.A.beforeClose(),e.resetPriority(),console.error(t)})},sub:function(t,e){l.A.sub({topic:t,pushType:"MULTI",listener:e})},unsub:function(t){l.A.unsub({topic:t,pushType:"MULTI",listener:null})},getPopupAd:function(){return!(this.priority>0)}},M=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ad,r=t.realsport,i=t.voucher,n=t.quest,s=t.virtual,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,L.YB)()||(o&&(D=o),j.init({ad:void 0!==e&&e,realsport:void 0===r||r,voucher:void 0===i||i,virtual:void 0!==s&&s,quest:void 0===n||n}))},q=function(){j.unsetup()},$=3057==r.j?j:null},19199:function(t,e,r){r.d(e,{A:function(){return I}}),r(76281),r(44962),r(51908),r(78557),r(90076),r(95021),r(83994),r(93062),r(82367);var i=r(13879),n=r(91249),s=r(50545),o=r(188),a=r(40333),c=r(55829),h=r(98143),u=r(88469),l=r(71465),p=r(64057),f=r(26832),d=r(56806),v=r(8581),m=r(19621),g=r(45841);r(24776);var y=r(61790),b=r.n(y),w=r(59186),_=r(11540);r(36630);var k="HOME_TOP_BUBBLE",C=r(67658),A=(0,C.A)({name:"TopBubbleAd",setup:function(){var t=(0,c.n)();return{loginStatus:(0,a.bP)(t).loginStatus}},data:function(){return{visible:!1,userId:"",width:0,ad:null}},created:function(){var t=this;p.A.$on("close_topBubbleAd",function(e){e&&t.close()})},mounted:function(){var t=this;if(this.loginStatus)this.fetchData();else var e=this.$watch("loginStatus",function(r){r&&(t.fetchData(),e())})},methods:{fetchData:function(){var t=this;return(0,g.A)(b().mark(function e(){var r;return b().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,_.AU)(["HomeTopBubble"]);case 3:r=e.sent[0].ads,t.ad=r&&r[0],t.ad&&t.showBubble(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error(e.t0);case 12:case"end":return e.stop()}},e,null,[[0,9]])}))()},renderImage:function(){var t=this,e=new Image;e.onload=function(){t.visible=!0,t.$nextTick(function(){t.loginStatus&&t.$el.focus(),t.width=e.width/2})},e.src=this.ad.image},showBubble:function(){this.userId=w.A.get("userId");var t="".concat(k,"_").concat(this.userId);localStorage.getItem(t)||this.renderImage()},close:function(){this.visible=!1,localStorage.setItem("".concat(k,"_").concat(this.userId),1)},handleClick:function(){this.ad.href&&(location.href=this.ad.href),this.close()},handleClose:function(){this.close(),window.mstrace("Home_IconClose")}}},function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.ad&&t.visible?r("div",{staticClass:"m-ad--top-bubble-wrap",attrs:{tabindex:"0"}},[r("a",{staticClass:"m-ad--top-bubble",on:{blur:t.close,click:function(e){return e.stopPropagation(),t.handleClick.apply(null,arguments)}}},[r("img",{attrs:{src:t.ad.image,width:t.width,alt:t.ad.text}})]),t._v(" "),r("svg-icon",{staticClass:"m-close-btn",attrs:{"icon-class":"icon-close"},on:{click:function(e){return e.stopPropagation(),t.handleClose.apply(null,arguments)}}})],1):t._e()},[],!1,null,"53dd2636",null).exports,S=r(48428),x=r.n(S),T=r(51193);r(54080);var O=(0,d.A)(function(){return r.e(9454).then(r.bind(r,73594))}),B=(0,d.A)(function(){return r.e(5292).then(r.bind(r,6795))}),E={name:"LayoutHeader",components:{VPopup:s.VY,AZmenu:O,Me:B,IconButton:m.A,TopBubbleAd:A},props:{source:{type:String,default:""},hasTopBubble:{type:Boolean,default:!1}},setup:function(){var t=(0,c.n)(),e=(0,a.bP)(t).loginStatus,r=(0,u.u)(),s=(0,a.bP)(r).myBetsCount,p=(0,h.k)(),f=(0,a.bP)(p),d=f.phone,v=f.balance,m=f.showBalance,g=p.getBalance,y=(0,l.Z)(),b=(0,a.bP)(y).messageCount,w=["ng","ug"].includes(o.Zg)?0:2,_=(0,i.EW)(function(){return 0===w?m.value.replace(/\.\d+/,""):m.value});return(0,i.wB)(function(){return e.value},function(t){t&&!v&&g()}),(0,n.iXd)("LOGIN_SUCCESS").on((0,u.u)().getMyBetsCount),{loginStatus:e,getBalance:g,localShowBalance:_,myBetsCount:s,phone:d,messageCount:b}},data:function(){return{azmenuVisible:!1,meVisible:!1,homeUrl:(0,o.z9)(),depositTip:!1,isClicked:!1}},computed:{showCustomLogo:function(){return!!this.$route&&this.$route.meta.showCustomLogo}},created:function(){var t=this;this.loginStatus&&(this.getBalance().catch(console.error),(0,u.u)().getMyBetsCount(),(0,l.Z)().getNewMessage()),p.A.$on("update-balance",this.getBalance),p.A.$on("close_deposit_tip",function(){t.depositTip=!1,t.changeMe()})},mounted:function(){var t=this;if(this.loginStatus){var e=x()(location.href,!0).query.open;e&&"me_deposit"===e&&(this.changeMe(),setTimeout(function(){t.depositTip=!0},500)),this.phone||(0,h.k)().getAccountInfoWrap(),p.A.$on("phone-change",this.getBalance)}},methods:{showAZmenu:function(){this.meVisible=!1,this.azmenuVisible=!0,v.A.afterOpen(),window.mstrace("Top_AZ")},closeAZmenu:function(){v.A.beforeClose(),this.azmenuVisible=!1},openSignup:function(){(0,T.r)(),window.mstrace("header_join")},gotoCashout:function(){var t="/my_bets/cashout";if(t&&(0,f.N)(this.$router)){if(this.$route.fullPath.toLowerCase()===t.toLowerCase()||"cashout"===this.$route.name)return;this.$router.push(t);return}location.href=(0,o.z9)(t)},changeMe:function(){this.depositTip&&this.meVisible||(this.meVisible?(v.A.beforeClose(),this.meVisible=!1):(p.A.$emit("close_topBubbleAd",!0),this.meVisible=!0,v.A.afterOpen()),this.isClicked=!0)},handleChangeMe:function(){this.changeMe(),window.mstrace("Top_Me")},closeMe:function(){v.A.beforeClose(),this.meVisible=!1},handleLogin:function(){v.A.afterOpen(),this.$login(),window.mstrace("".concat(this.source,"_Login"),this.source)}}},I=(0,C.A)(E,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("header",{ref:"header",staticClass:"m-header",class:{"flex-start":t.loginStatus},attrs:{"data-category":"Top"}},[i("div",{staticClass:"m-header-left"},[i("button",{staticClass:"m-az-btn",attrs:{"aria-label":"A-Z"},on:{click:t.showAZmenu}},[i("img",{attrs:{width:"21px",height:"21px",src:r(40199),alt:"A-Z"}})])]),t._v(" "),i("div",{staticClass:"m-header-mid"},[i("a",{staticClass:"m-logo",attrs:{href:t.homeUrl}},[i("img",t.showCustomLogo?{attrs:{src:r(87941),alt:"MSport"}}:{attrs:{src:r(67710),alt:"MSport",width:"125",height:"20"}})])]),t._v(" "),i("div",{staticClass:"m-header-right"},[t.loginStatus?[i("IconButton",{staticClass:"m-my-bets",on:{click:t.gotoCashout}},[i("img",{attrs:{slot:"icon",src:r(25668)},slot:"icon"}),t._v("\n        My Bets\n        "),t.myBetsCount?i("span",{staticClass:"num"},[t._v(t._s(t.myBetsCount))]):t._e()]),t._v(" "),i("IconButton",{staticClass:"m-user-btn",on:{click:t.handleChangeMe}},[i("img",{attrs:{slot:"icon",src:r(41884)},slot:"icon"}),t._v("\n        "+t._s(t.$t("CURRENCY_UNIT"))+" "),i("span",{attrs:{id:"balance-num"}},[t._v(t._s(t.localShowBalance))]),t._v(" "),t.messageCount&&!t.isClicked?i("div",{staticClass:"num"},[t._v("\n          "+t._s(t.messageCount)+"\n        ")]):t._e(),t._v(" "),t.hasTopBubble?i("TopBubbleAd"):t._e()],1)]:[i("div",{staticClass:"m-btn-group"},[i("button",{staticClass:"m-register-btn m-btn",on:{click:t.openSignup}},[t._v("\n          Join\n        ")]),t._v(" "),i("button",{staticClass:"m-login-btn m-btn",on:{click:t.handleLogin}},[t._v("\n          Login\n        ")])])]],2),t._v(" "),i("VPopup",{staticClass:"m-az-menu",attrs:{type:"popup-left"},on:{close:t.closeAZmenu},model:{value:t.azmenuVisible,callback:function(e){t.azmenuVisible=e},expression:"azmenuVisible"}},[i("keep-alive",[t.azmenuVisible?i("AZmenu",{on:{close:t.closeAZmenu}}):t._e()],1)],1),t._v(" "),i("VPopup",{staticClass:"m-popup-me",attrs:{type:"popup-right"},on:{close:t.closeMe},model:{value:t.meVisible,callback:function(e){t.meVisible=e},expression:"meVisible"}},[i("keep-alive",[t.meVisible?i("Me",{on:{close:t.closeMe}}):t._e()],1)],1)],1)},[],!1,null,"15ad53a6",null).exports},19621:function(t,e,r){r.d(e,{A:function(){return i}});var i=(0,r(67658).A)({name:"IconButton",props:{imgSrc:{type:String,default:""},active:{type:Boolean,default:!1},activeImgSrc:{type:String,default:""},href:{type:String,default:""}},methods:{handleClick:function(){this.href&&(location.href=this.href),this.$emit("click")}}},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("a",{staticClass:"icon-button x-link-active",class:{active:t.active},on:{click:t.handleClick}},[r("div",{staticClass:"icon-container"},[t._t("icon",function(){return[t.active?r("img",{attrs:{src:t.activeImgSrc}}):r("img",{attrs:{src:t.imgSrc}})]})],2),t._v(" "),t._t("default")],2)},[],!1,null,"3dcff04c",null).exports},31412:function(t,e,r){r.d(e,{A:function(){return l}}),r(14382),r(84734),r(51908),r(78557),r(646),r(95035),r(95021),r(83103),r(17456),r(73687),r(53819);var i=r(50545),n=r(40333),s=r(55829),o=r(42877);r(94);var a={components:{Tag:r(86401).A},props:{item:{type:Object,default:function(){},required:!0},active:{type:Boolean,default:!1},loadedAllImg:{type:Boolean,default:!1},order:{type:Number,default:1}},mounted:function(){var t=this;if(this.active){this.scrollIntoView();var e=this.$watch("loadedAllImg",function(){t.scrollIntoView(),e()})}var r=this.$el.querySelector("img");r&&(r.onload=function(){r.style.width=r.width+"px",t.$emit("on-load-img")},r.onerror=function(){r.style.width="50px",t.$emit("on-load-img")})},methods:{handleClick:function(t){window.mstrace("Home_PrimaryTab".concat(this.order),"",{click_text:t.text})},scrollIntoView:function(){var t=this.$el.getBoundingClientRect(),e=t.left,r=t.width;e+r>window.innerWidth&&(this.$parent.$el.scrollLeft=window.innerWidth-r-20)}}},c=r(67658),h=(0,c.A)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("a",{staticClass:"first-nav-item",class:{active:t.active,"sk-relative":t.item.flagText},attrs:{href:t.item.href,"aria-label":t.item.name},on:{click:function(e){return t.handleClick(t.item)}}},[t.item.image?[i("img",{staticClass:"first-nav-img",attrs:{src:t.item.image,alt:t.item.name}})]:[t._v("\n    "+t._s(t.item.text)+"\n  ")],t._v(" "),t.item.flagText?["Superkick FreeBet Alarm"!==t.item.flagText?i("Tag",[t._v("\n      "+t._s(t.item.flagText)+"\n    ")]):t._e(),t._v(" "),t.$route.meta.showNewTag&&"Superkick FreeBet Alarm"===t.item.flagText?i("img",{staticClass:"first-nav-item-sk",attrs:{src:r(86870)}}):t._e()]:t._e()],2)},[],!1,null,null,null).exports,u={name:"FirstNavs",components:{VSnapNav:i.I8,VSnapNavItem:i.zn,FirstNavItem:h},setup:function(){var t=(0,s.n)(),e=(0,n.bP)(t).loginStatus,r=(0,o.Ay)();return{loginStatus:e,firstNavs:r.firstNavs,fetchFirstNavs:r.fetchFirstNavs}},data:function(){return{currentHref:"",loadedImgCount:0}},computed:{totalImgNav:function(){return this.firstNavs.filter(function(t){return t.image}).length},loadedAllImg:function(){return this.loadedImgCount===this.totalImgNav}},watch:{firstNavs:function(t){this.resolveList(t),this.listenRouteChange(t)},loginStatus:function(t){t&&this.$route.meta.showNewTag&&"home"!==this.$route.name&&this.fetchFirstNavs()}},created:function(){"home"!==this.$route.name&&this.fetchFirstNavs()},methods:{onLoadImg:function(){this.loadedImgCount++,this.$refs.snapNav.updateBar(),this.$refs.snapNav.$el.querySelector(".first-nav-wrap.active").scrollIntoViewIfNeeded()},resolveList:function(t){for(var e=0;e<t.length;e++){var r=t[e],i=r.href,n=r.name;if(this.checkActive(i,n)){this.currentHref=i;break}}this.currentHref||(this.currentHref=t[0].href)},regUrl:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.pathname;if(!e.match(/\/(\w*)\/*$/))return!1;var r=e.match(/\/(\w*)\/*$/)[1];if(r===this.$region)return!0;var i=RegExp(r,"i"),n=t.match(/\/(\w*)\/*$/);if(!n)return!1;var s=n[1];return!!s&&i.test(s)},checkActive:function(t,e){return this.regUrl(t)},listenRouteChange:function(t){var e=this;this.$route&&this.$watch(function(){return e.$route},function(){e.resolveList(t)})}}},l=(0,c.A)(u,function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.currentHref?r("VSnapNav",{ref:"snapNav",staticClass:"first-navs",attrs:{inkbar:"","force-bar-width":42},model:{value:t.currentHref,callback:function(e){t.currentHref=e},expression:"currentHref"}},[t._l(t.firstNavs,function(e,i){return[r("VSnapNavItem",{key:e.href,staticClass:"first-nav-wrap",attrs:{name:e.href}},[r("FirstNavItem",{attrs:{item:e,order:i+1,active:t.currentHref===e.href,"loaded-all-img":t.loadedAllImg},on:{"on-load-img":t.onLoadImg}})],1)]})],2):t._e()},[],!1,null,null,null).exports},90084:function(t,e,r){r.d(e,{A:function(){return h}});var i=r(13839),n=r(22442),s=r(99856),o=r(19199),a=r(31412),c={name:"Layout",components:{GlobalContainer:i.A,LayoutHeader:o.A,FirstNavs:a.A},props:{source:{type:String,default:""},hasFirstNavs:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},noPush:{type:Boolean,default:!1},hasTopBubble:{type:Boolean,default:!1},hasChat:{type:Boolean,default:!1},theme:{type:String,default:""}},mounted:function(){this.noPush||(0,n.Cx)(),this.hasChat&&s.A.init({zIndex:99999})},beforeDestroy:function(){this.noPush||(0,n.Di)()}},h=(0,r(67658).A)(c,function(){var t=this.$createElement,e=this._self._c||t;return e("GlobalContainer",{class:["m-layout",{"layout-no-header":!this.hasFirstNavs}]},[this._t("before-header"),this._v(" "),this.hasHeader?e("LayoutHeader",{attrs:{source:this.source,"has-top-bubble":this.hasTopBubble}}):this._e(),this._v(" "),this.hasFirstNavs?e("FirstNavs"):this._e(),this._v(" "),e("main",{staticClass:"m-main"},[this._t("default")],2),this._v(" "),this._t("footer")],2)},[],!1,null,null,null).exports},76971:function(t,e,r){r.d(e,{A:function(){return s}}),r(68854),r(89336),r(49781),r(66184);var i=r(11540),n=r(8581),s=(0,r(67658).A)({name:"PopupAd",props:{href:{type:String,default:""},image:{type:String,default:""},text:{type:String,default:""}},mounted:function(){n.A.afterOpen()},deactivated:function(){n.A.beforeClose()},beforeDestroy:function(){n.A.beforeClose()},methods:{record:function(){var t=(0,i.jB)("POPUP_AD").oldImageData,e=void 0===t?[]:t,r=this.image,n=e.findIndex(function(t){return t.image===r});-1===n?e.unshift({image:r,date:Date.now()}):e[n]={image:r,date:Date.now()},e=e.slice(0,3),window.localStorage.setItem("POPUP_AD",JSON.stringify(e))},handleClick:function(){this.href&&(this.record(),location.href=this.href)},handleClose:function(){n.A.beforeClose(),this.record(),this.$emit("close")}}},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"m-popup-ad-wrap"},[e("a",{staticClass:"m-popup-ad x-link-active",attrs:{href:this.href},on:{click:this.handleClick}},[e("img",{attrs:{src:this.image,alt:this.text,fetchpriority:"high"}})]),this._v(" "),e("button",{staticClass:"m-pop-close-btn x-link-active",on:{click:this.handleClose}},[e("svg",{attrs:{width:"40",height:"40",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512S793.6 0 512 0zm0 998.4C243.2 998.4 25.6 780.8 25.6 512S243.2 25.6 512 25.6 998.4 243.2 998.4 512 780.8 998.4 512 998.4z"}}),e("path",{attrs:{d:"M706.56 296.96L512 494.08 317.44 296.96l-20.48 20.48L494.08 512 296.96 706.56l20.48 20.48L512 529.92l194.56 197.12 20.48-20.48L529.92 512l197.12-194.56z"}})])])])},[],!1,null,null,null).exports},14112:function(t,e,r){r.d(e,{A:function(){return T}});var i=[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"pop-winning-top"},[e("img",{staticClass:"cup",attrs:{src:r(89661)}}),this._v(" "),e("img",{staticClass:"title",attrs:{src:r(97363)}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"myBets-stake-back-img"},[e("img",{attrs:{src:r(89704)}})])}],n=r(40694),s=r(45841),o=r(61790),a=r.n(o);r(76204),r(24776),r(84734),r(94),r(78557),r(95021),r(73687),r(93062),r(90076);var c=r(54476),h=r(50545),u=r(88240),l=r(81527),p=r(68002),f=r(14816),d=r(37324),v=r(7518),m=r(82414),g=r(2287),y=r(188),b=[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"share-footer-left"},[e("img",{staticClass:"share-footer-logo",attrs:{src:r(67710),alt:"MSport"}})])}],w=r(67658),_=(0,w.A)({name:"ShareWinning",props:{fromTypeText:{type:String,default:""},shortId:{type:String,default:""},showWinnings:{type:Number,default:0},hideMount:{type:Boolean,default:!1}},computed:{showTotalWinnings:function(){return this.hideMount?"****":this.showWinnings},hostname:function(){return location.hostname}}},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"m-winning-share-container",attrs:{id:"share-element"}},[e("div",{staticClass:"share-amount"},[this._v("\n    "+this._s(this.$t("CURRENCY_UNIT"))+" "+this._s(this.showTotalWinnings)+"\n  ")]),this._v(" "),e("div",{staticClass:"share-msg"},[this._v("\n    From "+this._s(this.fromTypeText)+", Ticket ID: "+this._s(this.shortId)+"\n  ")]),this._v(" "),e("div",{staticClass:"share-footer"},[this._m(0),this._v(" "),e("div",{staticClass:"share-footer-mid"}),this._v(" "),e("p",{staticClass:"share-footer-host"},[this._v("\n      "+this._s(this.hostname)+"\n    ")])])])},b,!1,null,null,null).exports,k=(0,w.A)({name:"Coins",props:{delayTime:{type:Number,default:0},rotateDeg:{type:Number,default:0}}},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"popwin-coin"},[t._l(9,function(e){return[r("div",{key:e,class:["coin","coin"+e,{forwards:9===e}],style:{animationDelay:.07*e+t.delayTime+"s",transform:"rotateZ("+t.rotateDeg+"deg)",backgroundPosition:-(60*(e-1))+"px 0"}})]})],2)},[],!1,null,null,null).exports,C=r(51954),A=r(8581),S=r(47257);r(85738),r(72331),r(53044),r(66639);var x={name:"PopupWinning",i18n:{messages:p.B},components:{VButton:h.NO,ShareWinning:_,Share:C.SY,Coins:k,ShareTicket:C.m8},props:{isShareElement:{type:Boolean,default:!1},isShowCheckDetail:{type:Boolean,default:!0},hasHideAmountBtn:{type:Boolean,default:!1},bizType:{type:Number,default:0},totalWinnings:{type:String,default:""},shortId:{type:String,default:""},orderId:{type:String,default:""},message:{type:String,default:""},pushTime:{type:Number,default:0},canTopListShare:{type:Boolean,default:!0}},setup:function(){var t=(0,f.A)();return{resOrderDetail:t.resOrderDetail,getOrderDetail:t.getOrderDetail}},data:function(){return{hideAmount:!1,hideAmountChecked:!1,shareElement:null,shareVisible:!1,shareTopTips:"Click the picture to preview the shared content.",shareImgs:[],shareUrl:"",drawLoading:!1,online:!1,userLimit:null,isStakeShare:!1,delayTimeList:[.4,.6,.7,.9,.5,.9],rotateNumList:[0,0,0,-190,-90,-99]}},computed:{showWinnings:function(){return+this.totalWinnings.replace(/,/g,"")},hasShowOff:function(){return 3!==this.bizType},fromTypeText:function(){switch(this.bizType){case 1:return"Sports Betting";case 3:return"Jackpot";default:return"Others"}},hostname:function(){return location.hostname},shareText:function(){var t="",e=this.resOrderDetail,r=this.hideAmountChecked;return e.totalStake&&(t=r?"This is my winning ticket on MSport, check the bet details and win together: ":"I just won ".concat(this.$t("CURRENCY_UNIT")).concat(e.totalReturn," on MSport. This is my winning ticket, check the bet details and win together: ")),t}},watch:{pushTime:function(t){var e=this;t&&(this.resOrderDetail={},m.A.stop(),setTimeout(function(){m.A.play(),e.animeAmount()},500))}},created:function(){this.hasShowOff&&(this.checkTime(),this.getUserLimit())},mounted:function(){var t=this;m.A.loadAnimation({container:this.$el,renderer:"svg",loop:!1,autoplay:!1,path:"".concat("https://static.msport.com/ug/main/","lib/ribbon.json")}),m.A.play(),setTimeout(function(){m.A.play(),t.animeAmount()},500)},methods:{animeAmount:function(){var t=this.showWinnings.toString(),e=t.indexOf(".")+1,r=t.length-e,i=e?Math.pow(-10,r):1;(0,c.A)({targets:".amount-con",innerHTML:[0,this.showWinnings],easing:"linear",round:i})},toggleHideAmount:function(){this.hideAmountChecked=!this.hideAmountChecked},checkDetails:function(){var t=this.orderId;1===this.bizType?location.href=(0,y.z9)("/my_bets/order_info?id=".concat(t)):3===this.bizType&&(location.href=(0,y.z9)("/jackpot/bets/".concat(t)))},onHideAmount:function(t){this.hideAmountChecked=t},callbackBeforeShare:function(t){var e=this.shareImgs,r=this.orderId;return(0,g.A)(r,"prized",e[t])},shareFn:function(){var t=this;return(0,s.A)(a().mark(function e(){var r,i;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t.shareImgs=[],t.drawLoading=!0,r="",!t.isStakeShare){e.next=11;break}if(t.resOrderDetail.orderId){e.next=8;break}return e.next=8,t.getOrderDetail(t.orderId);case 8:t.shareContainer2||(r=t.$refs.shareContainer2.$el),e.next=12;break;case 11:t.shareContainer||(r=t.$refs.shareContainer.$el);case 12:if(!(t.shareImgs.length<2)){e.next=23;break}return t.hideAmount=!1,e.next=16,(0,v.W)(r);case 16:i=e.sent.data,t.shareImgs.push(i),t.hideAmount=!0,t.$nextTick(function(){(0,v.W)(r,{scale:2}).then(function(e){var r=e.data;t.shareImgs.push(r),t.drawLoading=!1,t.shareVisible=!0})}),e.next=25;break;case 23:t.drawLoading=!1,t.shareVisible=!0;case 25:e.next=31;break;case 27:e.prev=27,e.t0=e.catch(0),t.drawLoading=!1,console.error(e.t0);case 31:case"end":return e.stop()}},e,null,[[0,27]])}))()},handleShowOff:function(){var t=arguments,e=this;return(0,s.A)(a().mark(function r(){var i,s;return a().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(i=t.length>0&&void 0!==t[0]&&t[0],e.isStakeShare=i,s=e.orderId,e.shareUrl=(0,S.qQ)((0,d.G)(s,"PRIZED")),!i){r.next=17;break}if("object"!==(0,n.A)(e.userLimit)){r.next=10;break}return e.drawLoading=!0,r.next=9,e.getUserLimit();case 9:e.drawLoading=!1;case 10:if(!e.userLimit){r.next=14;break}return r.abrupt("return",(0,u.A)("Oops! You're not qualified."));case 14:e.shareTopTips="";case 15:r.next=18;break;case 17:e.shareTopTips="Click the picture to preview the shared content.";case 18:e.shareFn();case 19:case"end":return r.stop()}},r)}))()},onCloseShare:function(){this.shareVisible=!1},closeDialog:function(){A.A.beforeClose(),h.pC.close(),this.$emit("close")},getUserLimit:function(){var t=this;return(0,s.A)(a().mark(function e(){var r;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,l.po)();case 3:r=e.sent,t.userLimit=r,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}))()},checkTime:function(){var t=this;return(0,s.A)(a().mark(function e(){var r;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,l.D6)();case 3:r=e.sent,t.online=r.online,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}))()}}},T=(0,w.A)(x,function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:t.drawLoading,expression:"drawLoading"}],ref:"winning",staticClass:"m-winning-wrap"},[r("div",{staticClass:"pop-winning"},[t._m(0),t._v(" "),r("div",{staticClass:"pop-winning-main"},[r("p",{staticClass:"amount"},[t._v("\n        "+t._s(t.$t("CURRENCY"))+" "),r("span",{staticClass:"amount-con"},[t._v(t._s(t.showWinnings))])]),t._v(" "),r("p",{staticClass:"desc"},[t._v("\n        From "+t._s(t.fromTypeText)+", Ticket ID: "+t._s(t.shortId)+"\n      ")]),t._v(" "),r("div",{staticClass:"pop-winning-button"},[t.isShowCheckDetail?r("VButton",{staticClass:"check",on:{click:t.checkDetails}},[t._v("\n          CHECK DETAILS\n        ")]):t._e(),t._v(" "),t.hasShowOff?r("VButton",{staticClass:"show",on:{click:function(e){return t.handleShowOff(!1)}}},[t._v("\n          SHOW OFF\n        ")]):t._e()],1),t._v(" "),r("div",{staticClass:"close",on:{click:t.closeDialog}},[r("svg-icon",{attrs:{"icon-class":"icon-png-x"}})],1),t._v(" "),r("div",{staticClass:"pop-winning-bot"},[t.hasShowOff&&t.online?r("div",{staticClass:"m-share-stake-back",on:{click:function(e){return t.handleShowOff(!0)}}},[r("p",[t._v("Tap and Get Stake Back Up to "+t._s(t.$t("CURRENCY_UNIT"))+t._s(t.$t("stakeBackUp")))]),t._v(" "),t._m(1)]):t._e()])])]),t._v(" "),t._l(6,function(e){return r("Coins",{key:e,class:"pop-winning-coins"+e,attrs:{"delay-time":t.delayTimeList[e-1],"rotate-deg":t.rotateNumList[e-1]}})}),t._v(" "),r("ShareWinning",{ref:"shareContainer",attrs:{"from-type-text":t.fromTypeText,"short-id":t.shortId,"show-winnings":t.showWinnings,"hide-mount":t.hideAmount}}),t._v(" "),r("ShareTicket",{ref:"shareContainer2",attrs:{"order-detail":t.resOrderDetail,"show-footer-buttons":!1,"hide-amount":t.hideAmount,"is-share":""}}),t._v(" "),r("Share",{class:["m-winning-share",{"none-pad":t.isStakeShare}],attrs:{"share-top-tips":t.shareTopTips,"share-imgs":t.shareImgs,"channel-prefix":t.isStakeShare?"promo_share_winnings":"share_winnings","share-url":t.shareUrl,"share-text":t.shareText,"callback-before-share":t.callbackBeforeShare,"hide-amount-checked":t.hideAmountChecked,"default-hide-amount":t.hideAmountChecked,"order-id":t.orderId,"has-top-list":"","can-top-list-share":t.canTopListShare},on:{close:t.onCloseShare,"hide-amount":t.onHideAmount},model:{value:t.shareVisible,callback:function(e){t.shareVisible=e},expression:"shareVisible"}},[t.shareVisible&&t.isStakeShare?r("div",{staticClass:"m-share-order",attrs:{slot:"share-top"},slot:"share-top"},[r("div",{staticClass:"m-share-order-title"},[t._v("\n        Share to Your Friends!\n      ")]),t._v(" "),r("div",{staticClass:"m-share-order-content"},[t._v("\n        Every time a new bet is placed through the "),r("span",{staticClass:"light"},[t._v("SHARED LINK")]),t._v(", 1% stake of the new bet will be refunded to you! Until you get all the stake back!\n      ")]),t._v(" "),r("div",{staticClass:"m-share-order-tip"},[r("svg-icon",{attrs:{"icon-class":"icon-gantanhao"}}),t._v("Each Customer can only follow 1 bet once!\n      ")],1)]):t._e(),t._v(" "),t.shareVisible&&t.isStakeShare?r("div",{staticClass:"m-share-order-bottom",attrs:{slot:"share-bottom"},slot:"share-bottom"},[t._v("\n      Tips: Share the bet on Groups and Forums where punters hang out, and your bet will have a greater chance of being followed!\n    ")]):t._e()])],2)},i,!1,null,null,null).exports},87941:function(t,e,r){t.exports=r.p+"images/4f606596.gif"},86870:function(t,e,r){t.exports=r.p+"images/708ca9ae.png"},43082:function(t,e,r){t.exports=r.p+"images/75585be7.png"},92065:function(t,e,r){t.exports=r.p+"images/e231239a.png"},19352:function(t,e,r){t.exports=r.p+"images/4af57cd0.png"},58762:function(t,e,r){t.exports=r.p+"images/1d23e60b.png"},11001:function(t,e,r){t.exports=r.p+"images/d7eaa530.png"},47677:function(t,e,r){t.exports=r.p+"images/d3b25c7c.png"},89661:function(t,e,r){t.exports=r.p+"images/81dca316.png"},97363:function(t,e,r){t.exports=r.p+"images/bae7e3d7.png"},39276:function(t,e,r){r.d(e,{q:function(){return s}});let i=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=/^(3(057|207|35)|5(33|681|790|956)|9(332|347|569)|2155|2704|4763|4970|6047|67)$/.test(r.j)?["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]:null;function s(t){let e=t,r=t.indexOf("["),s=t.indexOf("]");-1!=r&&-1!=s&&(t=t.substring(0,r)+t.substring(r,s).replace(/:/g,";")+t.substring(s,t.length));let o=i.exec(t||""),a={},c=14;for(;c--;)a[n[c]]=o[c]||"";return -1!=r&&-1!=s&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(t,e){let r=e.replace(/\/{2,9}/g,"/").split("/");return("/"==e.slice(0,1)||0===e.length)&&r.splice(0,1),"/"==e.slice(-1)&&r.splice(r.length-1,1),r}(0,a.path),a.queryKey=function(t,e){let r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,i){e&&(r[e]=i)}),r}(0,a.query),a}},62087:function(t,e,r){let i,n;r.d(e,{io:function(){return ty}});var s,o,a={};r.r(a),r.d(a,{Decoder:function(){return tu},Encoder:function(){return tc},PacketType:function(){return o},protocol:function(){return ta}});let c=Object.create(null);c.open="0",c.close="1",c.ping="2",c.pong="3",c.message="4",c.upgrade="5",c.noop="6";let h=Object.create(null);Object.keys(c).forEach(t=>{h[c[t]]=t});let u={type:"error",data:"parser error"},l="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),p="function"==typeof ArrayBuffer,f=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,d=({type:t,data:e},r,i)=>l&&e instanceof Blob?r?i(e):v(e,i):p&&(e instanceof ArrayBuffer||f(e))?r?i(e):v(new Blob([e]),i):i(c[t]+(e||"")),v=(t,e)=>{let r=new FileReader;return r.onload=function(){e("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(t)};function m(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<g.length;t++)y[g.charCodeAt(t)]=t;let b=t=>{let e=.75*t.length,r=t.length,i,n=0,s,o,a,c;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);let h=new ArrayBuffer(e),u=new Uint8Array(h);for(i=0;i<r;i+=4)s=y[t.charCodeAt(i)],o=y[t.charCodeAt(i+1)],a=y[t.charCodeAt(i+2)],c=y[t.charCodeAt(i+3)],u[n++]=s<<2|o>>4,u[n++]=(15&o)<<4|a>>2,u[n++]=(3&a)<<6|63&c;return h},w="function"==typeof ArrayBuffer,_=(t,e)=>{if("string"!=typeof t)return{type:"message",data:C(t,e)};let r=t.charAt(0);return"b"===r?{type:"message",data:k(t.substring(1),e)}:h[r]?t.length>1?{type:h[r],data:t.substring(1)}:{type:h[r]}:u},k=(t,e)=>w?C(b(t),e):{base64:!0,data:t},C=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,A=(t,e)=>{let r=t.length,i=Array(r),n=0;t.forEach((t,s)=>{d(t,!1,t=>{i[s]=t,++n===r&&e(i.join("\x1e"))})})},S=(t,e)=>{let r=t.split("\x1e"),i=[];for(let t=0;t<r.length;t++){let n=_(r[t],e);if(i.push(n),"error"===n.type)break}return i};var x=r(75782);let T="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function O(t,...e){return e.reduce((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e),{})}let B=T.setTimeout,E=T.clearTimeout;function I(t,e){e.useNativeTimers?(t.setTimeoutFn=B.bind(T),t.clearTimeoutFn=E.bind(T)):(t.setTimeoutFn=T.setTimeout.bind(T),t.clearTimeoutFn=T.clearTimeout.bind(T))}class R extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}}class L extends x.v{constructor(t){super(),this.writable=!1,I(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,r){return super.emitReserved("error",new R(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=_(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return -1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){let e=function(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}(t);return e.length?"?"+e:""}}let N="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),P={},D=0,j=0,M;function q(t){let e="";do e=N[t%64]+e,t=Math.floor(t/64);while(t>0);return e}function $(){let t=q(+new Date);return t!==M?(D=0,M=t):t+"."+q(D++)}for(;j<64;j++)P[N[j]]=j;let U=!1;try{U="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}let V=U;function F(t){let e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||V))return new XMLHttpRequest}catch(t){}if(!e)try{return new T[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}function z(){}let H=null!=new F({xdomain:!1}).responseType;class W extends x.v{constructor(t,e){super(),I(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;let e=O(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;let r=this.xhr=new F(e);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders)for(let t in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&r.setRequestHeader(t,this.opts.extraHeaders[t])}catch(t){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var t;3===r.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(r)),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof r.status?r.status:0)},0))},r.send(this.data)}catch(t){this.setTimeoutFn(()=>{this.onError(t)},0);return}"undefined"!=typeof document&&(this.index=W.requestsCount++,W.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=z,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete W.requests[this.index],this.xhr=null}}onLoad(){let t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Y(){for(let t in W.requests)W.requests.hasOwnProperty(t)&&W.requests[t].abort()}W.requestsCount=0,W.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Y):"function"==typeof addEventListener&&addEventListener("onpagehide"in T?"pagehide":"unload",Y,!1));let J="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),K=T.WebSocket||T.MozWebSocket,Z="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),G={websocket:class extends L{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let t=this.uri(),e=this.opts.protocols,r=Z?{}:O(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Z?new K(t,e,r):e?new K(t,e):new K(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],i=e===t.length-1;d(r,this.supportsBinary,t=>{try{this.ws.send(t)}catch(t){}i&&J(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=$()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!K}},webtransport:class extends L{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{let e;let r=t.readable.getReader();this.writer=t.writable.getWriter();let i=()=>{r.read().then(({done:t,value:r})=>{if(!t){if(e||1!==r.byteLength||54!==r[0]){var s,o;this.onPacket((s=e,o="arraybuffer",n||(n=new TextDecoder),_(s||r[0]<48||r[0]>54?r:n.decode(r),o))),e=!1}else e=!0;i()}}).catch(t=>{})};i();let s=this.query.sid?`0{"sid":"${this.query.sid}"}`:"0";this.writer.write(new TextEncoder().encode(s)).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],n=e===t.length-1;!function(t,e){l&&t.data instanceof Blob?t.data.arrayBuffer().then(m).then(e):p&&(t.data instanceof ArrayBuffer||f(t.data))?e(m(t.data)):d(t,!1,t=>{i||(i=new TextEncoder),e(i.encode(t))})}(r,t=>{"message"===r.type&&"string"!=typeof r.data&&t[0]>=48&&t[0]<=54&&this.writer.write(Uint8Array.of(54)),this.writer.write(t).then(()=>{n&&J(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})})}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends L{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){let e="https:"===location.protocol,r=location.port;r||(r=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port}let e=t&&t.forceBase64;this.supportsBinary=H&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){S(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){let t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,A(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=$()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new W(this.uri(),t)}doWrite(t,e){let r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}};var X=r(39276);class Q extends x.v{constructor(t,e={}){super(),this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=(0,X.q)(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=(0,X.q)(e.host).host),I(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},r=t.split("&");for(let t=0,i=r.length;t<i;t++){let i=r[t].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new G[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Q.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else if(0===this.transports.length){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(t){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let e=this.createTransport(t),r=!1;Q.priorWebsocketSuccess=!1;let i=()=>{r||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!r){if("pong"===t.type&&"probe"===t.data)this.upgrading=!0,this.emitReserved("upgrading",e),e&&(Q.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{r||"closed"===this.readyState||(h(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}));else{let t=Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}}))};function n(){r||(r=!0,h(),e.close(),e=null)}let s=t=>{let r=Error("probe error: "+t);r.transport=e.name,n(),this.emitReserved("upgradeError",r)};function o(){s("transport closed")}function a(){s("socket closed")}function c(t){e&&t.name!==e.name&&n()}let h=()=>{e.removeListener("open",i),e.removeListener("error",s),e.removeListener("close",o),this.off("close",a),this.off("upgrading",c)};e.once("open",i),e.once("error",s),e.once("close",o),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{r||e.open()},200):e.open()}onOpen(){if(this.readyState="open",Q.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0,e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let e=Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){let r=this.writeBuffer[e].data;if(r&&(t+="string"==typeof r?function(t){let e=0,r=0;for(let i=0,n=t.length;i<n;i++)(e=t.charCodeAt(i))<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(i++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),e>0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}write(t,e,r){return this.sendPacket("message",t,e,r),this}send(t,e,r){return this.sendPacket("message",t,e,r),this}sendPacket(t,e,r,i){if("function"==typeof e&&(i=e,e=void 0),"function"==typeof r&&(i=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let n={type:t,data:e,options:r};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),i&&this.once("flush",i),this.flush()}close(){let t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Q.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){let e=[],r=0,i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&e.push(t[r]);return e}}Q.protocol=4,Q.protocol;let tt="function"==typeof ArrayBuffer,te=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,tr=Object.prototype.toString,ti="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===tr.call(Blob),tn="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===tr.call(File);function ts(t){return tt&&(t instanceof ArrayBuffer||te(t))||ti&&t instanceof Blob||tn&&t instanceof File}let to=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ta=5;(s=o||(o={}))[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK";class tc{constructor(t){this.replacer=t}encode(t){return(t.type===o.EVENT||t.type===o.ACK)&&function t(e,r){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let r=0,i=e.length;r<i;r++)if(t(e[r]))return!0;return!1}if(ts(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1==arguments.length)return t(e.toJSON(),!0);for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return!0;return!1}(t)?this.encodeAsBinary({type:t.type===o.EVENT?o.BINARY_EVENT:o.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===o.BINARY_EVENT||t.type===o.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e=function(t){let e=[],r=t.data;return t.data=function t(e,r){if(!e)return e;if(ts(e)){let t={_placeholder:!0,num:r.length};return r.push(e),t}if(Array.isArray(e)){let i=Array(e.length);for(let n=0;n<e.length;n++)i[n]=t(e[n],r);return i}if("object"==typeof e&&!(e instanceof Date)){let i={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=t(e[n],r));return i}return e}(r,e),t.attachments=e.length,{packet:t,buffers:e}}(t),r=this.encodeAsString(e.packet),i=e.buffers;return i.unshift(r),i}}function th(t){return"[object Object]"===Object.prototype.toString.call(t)}class tu extends x.v{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(e=this.decodeString(t)).type===o.BINARY_EVENT;r||e.type===o.BINARY_ACK?(e.type=r?o.EVENT:o.ACK,this.reconstructor=new tl(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(ts(t)||t.base64){if(this.reconstructor)(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw Error("got binary data when not reconstructing a packet")}else throw Error("Unknown type: "+t)}decodeString(t){let e=0,r={type:Number(t.charAt(0))};if(void 0===o[r.type])throw Error("unknown packet type "+r.type);if(r.type===o.BINARY_EVENT||r.type===o.BINARY_ACK){let i=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);let n=t.substring(i,e);if(n!=Number(n)||"-"!==t.charAt(e))throw Error("Illegal attachments");r.attachments=Number(n)}if("/"===t.charAt(e+1)){let i=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);r.nsp=t.substring(i,e)}else r.nsp="/";let i=t.charAt(e+1);if(""!==i&&Number(i)==i){let i=e+1;for(;++e;){let r=t.charAt(e);if(null==r||Number(r)!=r){--e;break}if(e===t.length)break}r.id=Number(t.substring(i,e+1))}if(t.charAt(++e)){let i=this.tryParse(t.substr(e));if(tu.isPayloadValid(r.type,i))r.data=i;else throw Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case o.CONNECT:return th(e);case o.DISCONNECT:return void 0===e;case o.CONNECT_ERROR:return"string"==typeof e||th(e);case o.EVENT:case o.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===to.indexOf(e[0]));case o.ACK:case o.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class tl{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e,r;let t=(e=this.reconPack,r=this.buffers,e.data=function t(e,r){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<r.length)return r[e.num];throw Error("illegal attachments")}if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=t(e[i],r);else if("object"==typeof e)for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=t(e[i],r));return e}(e.data,r),delete e.attachments,e);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function tp(t,e,r){return t.on(e,r),function(){t.off(e,r)}}let tf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class td extends x.v{constructor(t,e,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[tp(t,"open",this.onopen.bind(this)),tp(t,"packet",this.onpacket.bind(this)),tp(t,"error",this.onerror.bind(this)),tp(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(tf.hasOwnProperty(t))throw Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let r={type:o.EVENT,data:e};if(r.options={},r.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){let t=this.ids++,i=e.pop();this._registerAckCallback(t,i),r.id=t}let i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return(!this.flags.volatile||i&&this.connected)&&(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,e){var r;let i=null!==(r=this.flags.timeout)&&void 0!==r?r:this._opts.ackTimeout;if(void 0===i){this.acks[t]=e;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,Error("operation has timed out"))},i);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(n),e.apply(this,[null,...t])}}emitWithAck(t,...e){let r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((i,n)=>{e.push((t,e)=>r?t?n(t):i(e):i(t)),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...i)=>{if(r===this._queue[0])return null!==t?r.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...i)),r.pending=!1,this._drainQueue()}),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;let e=this._queue[0];(!e.pending||t)&&(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:o.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(!(t.nsp!==this.nsp))switch(t.type){case o.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case o.EVENT:case o.BINARY_EVENT:this.onevent(t);break;case o.ACK:case o.BINARY_ACK:this.onack(t);break;case o.DISCONNECT:this.ondisconnect();break;case o.CONNECT_ERROR:this.destroy();let e=Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){let e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length)for(let e of this._anyListeners.slice())e.apply(this,t);super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,r=!1;return function(...i){r||(r=!0,e.packet({type:o.ACK,id:t,data:i}))}}onack(t){let e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:o.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let e of this._anyOutgoingListeners.slice())e.apply(this,t.data)}}function tv(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}tv.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(1&Math.floor(10*e))==0?t-r:t+r}return 0|Math.min(t,this.max)},tv.prototype.reset=function(){this.attempts=0},tv.prototype.setMin=function(t){this.ms=t},tv.prototype.setMax=function(t){this.max=t},tv.prototype.setJitter=function(t){this.jitter=t};class tm extends x.v{constructor(t,e){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,I(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=e.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new tv({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;let i=e.parser||a;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Q(this.uri,this.opts);let e=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let i=tp(e,"open",function(){r.onopen(),t&&t()}),n=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},s=tp(e,"error",n);if(!1!==this._timeout){let t=this._timeout,r=this.setTimeoutFn(()=>{i(),n(Error("timeout")),e.close()},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(tp(t,"ping",this.onping.bind(this)),tp(t,"data",this.ondata.bind(this)),tp(t,"error",this.onerror.bind(this)),tp(t,"close",this.onclose.bind(this)),tp(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){J(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new td(this,t,e),this.nsps[t]=r),r}_destroy(t){for(let t of Object.keys(this.nsps))if(this.nsps[t].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let r=0;r<e.length;r++)this.engine.write(e[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{!t.skipReconnect&&(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}let tg={};function ty(t,e){let r;"object"==typeof t&&(e=t,t=void 0);let i=function(t,e="",r){let i=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),i=(0,X.q)(t)),!i.port&&(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let n=-1!==i.host.indexOf(":")?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+e,i.href=i.protocol+"://"+n+(r&&r.port===i.port?"":":"+i.port),i}(t,(e=e||{}).path||"/socket.io"),n=i.source,s=i.id,o=i.path,a=tg[s]&&o in tg[s].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||a?r=new tm(n,e):(tg[s]||(tg[s]=new tm(n,e)),r=tg[s]),i.query&&!e.query&&(e.query=i.queryKey),r.socket(i.path,e)}Object.assign(ty,{Manager:tm,Socket:td,io:ty,connect:ty})}}]);